this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

clean-up

-18945
-16
.nitro/types/nitro-config.d.ts
··· 1 - // Generated by nitro 2 - 3 - // App Config 4 - import type { Defu } from 'defu' 5 - 6 - 7 - 8 - type UserAppConfig = Defu<{}, []> 9 - 10 - declare module "nitropack/types" { 11 - interface AppConfig extends UserAppConfig {} 12 - interface NitroRuntimeConfig { 13 - 14 - } 15 - } 16 - export {}
-136
.nitro/types/nitro-imports.d.ts
··· 1 - declare global { 2 - const appendCorsHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['appendCorsHeaders'] 3 - const appendCorsPreflightHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['appendCorsPreflightHeaders'] 4 - const appendHeader: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['appendHeader'] 5 - const appendHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['appendHeaders'] 6 - const appendResponseHeader: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['appendResponseHeader'] 7 - const appendResponseHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['appendResponseHeaders'] 8 - const assertMethod: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['assertMethod'] 9 - const cachedEventHandler: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/cache')['cachedEventHandler'] 10 - const cachedFunction: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/cache')['cachedFunction'] 11 - const callNodeListener: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['callNodeListener'] 12 - const clearResponseHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['clearResponseHeaders'] 13 - const clearSession: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['clearSession'] 14 - const createApp: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['createApp'] 15 - const createAppEventHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['createAppEventHandler'] 16 - const createError: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['createError'] 17 - const createEvent: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['createEvent'] 18 - const createEventStream: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['createEventStream'] 19 - const createRouter: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['createRouter'] 20 - const defaultContentType: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['defaultContentType'] 21 - const defineCachedEventHandler: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/cache')['defineCachedEventHandler'] 22 - const defineCachedFunction: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/cache')['defineCachedFunction'] 23 - const defineEventHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['defineEventHandler'] 24 - const defineLazyEventHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['defineLazyEventHandler'] 25 - const defineNitroErrorHandler: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/error/utils')['defineNitroErrorHandler'] 26 - const defineNitroPlugin: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/plugin')['defineNitroPlugin'] 27 - const defineNodeListener: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['defineNodeListener'] 28 - const defineNodeMiddleware: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['defineNodeMiddleware'] 29 - const defineRenderHandler: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/renderer')['defineRenderHandler'] 30 - const defineRequestMiddleware: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['defineRequestMiddleware'] 31 - const defineResponseMiddleware: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['defineResponseMiddleware'] 32 - const defineRouteMeta: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/meta')['defineRouteMeta'] 33 - const defineTask: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/task')['defineTask'] 34 - const defineWebSocket: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['defineWebSocket'] 35 - const defineWebSocketHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['defineWebSocketHandler'] 36 - const deleteCookie: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['deleteCookie'] 37 - const dynamicEventHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['dynamicEventHandler'] 38 - const eventHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['eventHandler'] 39 - const fetchWithEvent: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['fetchWithEvent'] 40 - const fromNodeMiddleware: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['fromNodeMiddleware'] 41 - const fromPlainHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['fromPlainHandler'] 42 - const fromWebHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['fromWebHandler'] 43 - const getCookie: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getCookie'] 44 - const getHeader: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getHeader'] 45 - const getHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getHeaders'] 46 - const getMethod: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getMethod'] 47 - const getProxyRequestHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getProxyRequestHeaders'] 48 - const getQuery: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getQuery'] 49 - const getRequestFingerprint: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRequestFingerprint'] 50 - const getRequestHeader: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRequestHeader'] 51 - const getRequestHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRequestHeaders'] 52 - const getRequestHost: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRequestHost'] 53 - const getRequestIP: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRequestIP'] 54 - const getRequestPath: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRequestPath'] 55 - const getRequestProtocol: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRequestProtocol'] 56 - const getRequestURL: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRequestURL'] 57 - const getRequestWebStream: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRequestWebStream'] 58 - const getResponseHeader: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getResponseHeader'] 59 - const getResponseHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getResponseHeaders'] 60 - const getResponseStatus: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getResponseStatus'] 61 - const getResponseStatusText: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getResponseStatusText'] 62 - const getRouteRules: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/route-rules')['getRouteRules'] 63 - const getRouterParam: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRouterParam'] 64 - const getRouterParams: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getRouterParams'] 65 - const getSession: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getSession'] 66 - const getValidatedQuery: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getValidatedQuery'] 67 - const getValidatedRouterParams: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['getValidatedRouterParams'] 68 - const handleCacheHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['handleCacheHeaders'] 69 - const handleCors: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['handleCors'] 70 - const isCorsOriginAllowed: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['isCorsOriginAllowed'] 71 - const isError: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['isError'] 72 - const isEvent: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['isEvent'] 73 - const isEventHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['isEventHandler'] 74 - const isMethod: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['isMethod'] 75 - const isPreflightRequest: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['isPreflightRequest'] 76 - const isStream: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['isStream'] 77 - const isWebResponse: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['isWebResponse'] 78 - const lazyEventHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['lazyEventHandler'] 79 - const nitroPlugin: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/plugin')['nitroPlugin'] 80 - const parseCookies: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['parseCookies'] 81 - const promisifyNodeListener: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['promisifyNodeListener'] 82 - const proxyRequest: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['proxyRequest'] 83 - const readBody: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['readBody'] 84 - const readFormData: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['readFormData'] 85 - const readMultipartFormData: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['readMultipartFormData'] 86 - const readRawBody: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['readRawBody'] 87 - const readValidatedBody: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['readValidatedBody'] 88 - const removeResponseHeader: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['removeResponseHeader'] 89 - const runTask: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/task')['runTask'] 90 - const sanitizeStatusCode: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['sanitizeStatusCode'] 91 - const sanitizeStatusMessage: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['sanitizeStatusMessage'] 92 - const sealSession: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['sealSession'] 93 - const send: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['send'] 94 - const sendError: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['sendError'] 95 - const sendIterable: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['sendIterable'] 96 - const sendNoContent: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['sendNoContent'] 97 - const sendProxy: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['sendProxy'] 98 - const sendRedirect: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['sendRedirect'] 99 - const sendStream: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['sendStream'] 100 - const sendWebResponse: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['sendWebResponse'] 101 - const serveStatic: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['serveStatic'] 102 - const setCookie: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['setCookie'] 103 - const setHeader: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['setHeader'] 104 - const setHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['setHeaders'] 105 - const setResponseHeader: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['setResponseHeader'] 106 - const setResponseHeaders: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['setResponseHeaders'] 107 - const setResponseStatus: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['setResponseStatus'] 108 - const splitCookiesString: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['splitCookiesString'] 109 - const toEventHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['toEventHandler'] 110 - const toNodeListener: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['toNodeListener'] 111 - const toPlainHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['toPlainHandler'] 112 - const toWebHandler: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['toWebHandler'] 113 - const toWebRequest: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['toWebRequest'] 114 - const unsealSession: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['unsealSession'] 115 - const updateSession: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['updateSession'] 116 - const useAppConfig: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/config')['useAppConfig'] 117 - const useBase: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['useBase'] 118 - const useEvent: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/context')['useEvent'] 119 - const useNitroApp: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/app')['useNitroApp'] 120 - const useRuntimeConfig: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/config')['useRuntimeConfig'] 121 - const useSession: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['useSession'] 122 - const useStorage: typeof import('../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/storage')['useStorage'] 123 - const writeEarlyHints: typeof import('../../node_modules/.pnpm/h3@1.15.3/node_modules/h3')['writeEarlyHints'] 124 - } 125 - export { useNitroApp } from 'nitropack/runtime/internal/app'; 126 - export { useRuntimeConfig, useAppConfig } from 'nitropack/runtime/internal/config'; 127 - export { defineNitroPlugin, nitroPlugin } from 'nitropack/runtime/internal/plugin'; 128 - export { defineCachedFunction, defineCachedEventHandler, cachedFunction, cachedEventHandler } from 'nitropack/runtime/internal/cache'; 129 - export { useStorage } from 'nitropack/runtime/internal/storage'; 130 - export { defineRenderHandler } from 'nitropack/runtime/internal/renderer'; 131 - export { defineRouteMeta } from 'nitropack/runtime/internal/meta'; 132 - export { getRouteRules } from 'nitropack/runtime/internal/route-rules'; 133 - export { useEvent } from 'nitropack/runtime/internal/context'; 134 - export { defineTask, runTask } from 'nitropack/runtime/internal/task'; 135 - export { defineNitroErrorHandler } from 'nitropack/runtime/internal/error/utils'; 136 - export { appendCorsHeaders, appendCorsPreflightHeaders, appendHeader, appendHeaders, appendResponseHeader, appendResponseHeaders, assertMethod, callNodeListener, clearResponseHeaders, clearSession, createApp, createAppEventHandler, createError, createEvent, createEventStream, createRouter, defaultContentType, defineEventHandler, defineLazyEventHandler, defineNodeListener, defineNodeMiddleware, defineRequestMiddleware, defineResponseMiddleware, defineWebSocket, defineWebSocketHandler, deleteCookie, dynamicEventHandler, eventHandler, fetchWithEvent, fromNodeMiddleware, fromPlainHandler, fromWebHandler, getCookie, getHeader, getHeaders, getMethod, getProxyRequestHeaders, getQuery, getRequestFingerprint, getRequestHeader, getRequestHeaders, getRequestHost, getRequestIP, getRequestPath, getRequestProtocol, getRequestURL, getRequestWebStream, getResponseHeader, getResponseHeaders, getResponseStatus, getResponseStatusText, getRouterParam, getRouterParams, getSession, getValidatedQuery, getValidatedRouterParams, handleCacheHeaders, handleCors, isCorsOriginAllowed, isError, isEvent, isEventHandler, isMethod, isPreflightRequest, isStream, isWebResponse, lazyEventHandler, parseCookies, promisifyNodeListener, proxyRequest, readBody, readFormData, readMultipartFormData, readRawBody, readValidatedBody, removeResponseHeader, sanitizeStatusCode, sanitizeStatusMessage, sealSession, send, sendError, sendIterable, sendNoContent, sendProxy, sendRedirect, sendStream, sendWebResponse, serveStatic, setCookie, setHeader, setHeaders, setResponseHeader, setResponseHeaders, setResponseStatus, splitCookiesString, toEventHandler, toNodeListener, toPlainHandler, toWebHandler, toWebRequest, unsealSession, updateSession, useBase, useSession, writeEarlyHints } from 'h3';
-8
.nitro/types/nitro-routes.d.ts
··· 1 - // Generated by nitro 2 - import type { Serialize, Simplify } from "nitropack/types"; 3 - declare module "nitropack/types" { 4 - type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T 5 - interface InternalApi { 6 - } 7 - } 8 - export {}
-3
.nitro/types/nitro.d.ts
··· 1 - /// <reference path="./nitro-routes.d.ts" /> 2 - /// <reference path="./nitro-config.d.ts" /> 3 - /// <reference path="./nitro-imports.d.ts" />
-15
.output/nitro.json
··· 1 - { 2 - "date": "2025-05-23T08:23:44.578Z", 3 - "preset": "node-server", 4 - "framework": { 5 - "name": "nitro", 6 - "version": "" 7 - }, 8 - "versions": { 9 - "nitro": "2.11.12" 10 - }, 11 - "commands": { 12 - "preview": "node ./server/index.mjs" 13 - }, 14 - "config": {} 15 - }
-1
.output/public/assets/basic-D_HBRECz.js
··· 1 - import{d as N,i as m,e as O,r as d,j as e,P as x,L as h,g}from"./main-C_SO_aYE.js";import{u as w,Q as P,T,a as R,b as p,c,d as k,e as u,f as j,g as b}from"./table-BGKcx7UY.js";function L(o){const t=N();return async(...n)=>{try{const r=await o(...n);if(m(r))throw r;return r}catch(r){if(m(r))return r.options._fromLocation=t.state.location,t.navigate(t.resolveRedirect(r).options);throw r}}}function S(o,t){return w(o,P)}const M=function(){const t=L(g),{offset:n}=O.useSearch(),r=["pokemon-list","basic",{limit:x,offset:n}],{data:s,error:y}=S({queryKey:r,queryFn:async()=>await t({data:{offset:n}})}),i=d.useMemo(()=>(s==null?void 0:s.prevOffset)==null?null:s.prevOffset.toString(),[s==null?void 0:s.prevOffset]),l=d.useMemo(()=>(s==null?void 0:s.nextOffset)==null?null:s.nextOffset.toString(),[s==null?void 0:s.nextOffset]);if(s){const v=s.pokemon??[];return e.jsxs("div",{className:"p-4",children:[e.jsxs("h1",{className:"text-2xl font-bold mb-4",children:["National Pokédex: Pokémon ",n+1,"-",n+x]}),e.jsxs(T,{children:[e.jsx(R,{children:e.jsxs(p,{children:[e.jsx(c,{children:"#"}),e.jsx(c,{children:"Name"}),e.jsx(c,{children:"Details"})]})}),e.jsx(k,{children:v.map(a=>e.jsxs(p,{children:[e.jsx(u,{children:a.id}),e.jsx(u,{className:"capitalize",children:a.name}),e.jsx(u,{children:a.types.map(f=>e.jsx("span",{className:"inline-block px-2 py-1 mr-1 text-sm font-medium rounded-full bg-gray-100",children:f.type.name},f.type.name))})]},a.name))})]}),e.jsxs("div",{className:"flex justify-center gap-4 mt-4",children:[e.jsx(h,{to:"/basic",className:j({variant:"outline",className:b(!i&&"opacity-50 cursor-not-allowed")}),search:{offset:Number(i)},disabled:!i,children:"Previous"}),e.jsx(h,{to:"/basic",search:{offset:Number(l)},className:j({variant:"outline",className:b(!l&&"opacity-50 cursor-not-allowed")}),disabled:!l,children:"Next"})]})]})}return y?e.jsx("div",{children:"Error loading Pokémon."}):e.jsx("div",{children:"No data"})};export{M as component};
-1
.output/public/assets/global-B8kMkExK.css
··· 1 - /*! tailwindcss v4.1.7 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-600:oklch(54.6% .245 262.881);--color-gray-100:oklch(96.7% .003 264.542);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-bold:700;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring)50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.relative{position:relative}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-1{margin-right:calc(var(--spacing)*1)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.flex{display:flex}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-\[40vmin\]{height:40vmin}.min-h-screen{min-height:100vh}.w-full{width:100%}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.animate-\[spin_20s_linear_infinite\]{animation:20s linear infinite spin}.cursor-not-allowed{cursor:not-allowed}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.bg-\[\#61dafb\]{background-color:#61dafb}.bg-\[\#282c34\]{background-color:#282c34}.bg-background{background-color:var(--background)}.bg-destructive{background-color:var(--destructive)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.text-center{text-align:center}.text-left{text-align:left}.align-middle{vertical-align:middle}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\[calc\(10px\+2vmin\)\]{font-size:calc(10px + 2vmin)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.whitespace-nowrap{white-space:nowrap}.text-\[\#61dafb\]{color:#61dafb}.text-\[\#282c34\]{color:#282c34}.text-black{color:var(--color-black)}.text-blue-600{color:var(--color-blue-600)}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}@media (hover:hover){.hover\:bg-\[\#21a1f3\]:hover{background-color:#21a1f3}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive)90%,transparent)}}.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted)50%,transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary)90%,transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary)80%,transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--ring)50%,transparent)}}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)20%,transparent)}}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive)60%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input)30%,transparent)}}@media (hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent)50%,transparent)}}.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input)50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--destructive)40%,transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y:2px;translate:var(--tw-translate-x)var(--tw-translate-y)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}body{margin:calc(var(--spacing)*0);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}:root{--background:oklch(100% 0 0);--foreground:oklch(14.1% .005 285.823);--card:oklch(100% 0 0);--card-foreground:oklch(14.1% .005 285.823);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.1% .005 285.823);--primary:oklch(21% .006 285.885);--primary-foreground:oklch(98.5% 0 0);--secondary:oklch(96.7% .001 286.375);--secondary-foreground:oklch(21% .006 285.885);--muted:oklch(96.7% .001 286.375);--muted-foreground:oklch(55.2% .016 285.938);--accent:oklch(96.7% .001 286.375);--accent-foreground:oklch(21% .006 285.885);--destructive:oklch(57.7% .245 27.325);--destructive-foreground:oklch(57.7% .245 27.325);--border:oklch(92% .004 286.32);--input:oklch(92% .004 286.32);--ring:oklch(87.1% .006 286.286);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--radius:.625rem;--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.1% .005 285.823);--sidebar-primary:oklch(21% .006 285.885);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(96.7% .001 286.375);--sidebar-accent-foreground:oklch(21% .006 285.885);--sidebar-border:oklch(92% .004 286.32);--sidebar-ring:oklch(87.1% .006 286.286)}.dark{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(14.1% .005 285.823);--card-foreground:oklch(98.5% 0 0);--popover:oklch(14.1% .005 285.823);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(98.5% 0 0);--primary-foreground:oklch(21% .006 285.885);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(27.4% .006 286.033);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(39.6% .141 25.723);--destructive-foreground:oklch(63.7% .237 25.331);--border:oklch(27.4% .006 286.033);--input:oklch(27.4% .006 286.033);--ring:oklch(44.2% .017 285.786);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(21% .006 285.885);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:oklch(48.8% .243 264.376);--sidebar-primary-foreground:oklch(98.5% 0 0);--sidebar-accent:oklch(27.4% .006 286.033);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(27.4% .006 286.033);--sidebar-ring:oklch(44.2% .017 285.786)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0))}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}
-1
.output/public/assets/index-Cb09vRb3.js
··· 1 - import{r as s,j as e}from"./main-C_SO_aYE.js";const o="/assets/logo-CHtJT8UQ.svg",i=function(){const[t,n]=s.useState(0);return e.jsx("div",{className:"text-center",children:e.jsxs("header",{className:"min-h-screen flex flex-col items-center justify-center bg-[#282c34] text-white text-[calc(10px+2vmin)]",children:[e.jsx("img",{src:o,className:"h-[40vmin] pointer-events-none animate-[spin_20s_linear_infinite]",alt:"logo"}),e.jsxs("p",{children:["Edit ",e.jsx("code",{children:"src/routes/index.tsx"})," and save to reload."]}),e.jsxs("button",{type:"button",className:"mt-4 px-6 py-2 rounded bg-[#61dafb] text-[#282c34] font-bold hover:bg-[#21a1f3] transition",onClick:()=>n(r=>r+1),children:["Counter: ",t]}),e.jsx("a",{className:"text-[#61dafb] hover:underline mt-4",href:"https://reactjs.org",target:"_blank",rel:"noopener noreferrer",children:"Learn React"}),e.jsx("a",{className:"text-[#61dafb] hover:underline",href:"https://tanstack.com",target:"_blank",rel:"noopener noreferrer",children:"Learn TanStack"})]})})};export{i as component};
-1
.output/public/assets/intent-preloading-BYVPES3z.js
··· 1 - import{j as o}from"./main-C_SO_aYE.js";const e=function(){return o.jsx("div",{children:"Not Found"})};export{e as notFoundComponent};
-1
.output/public/assets/intent-preloading-BbIeCNkQ.js
··· 1 - import{c,r as u,j as e,L as m}from"./main-C_SO_aYE.js";import{u as j}from"./useSuspenseQuery-BacjgsWj.js";import{T as b,a as N,b as x,c as l,d as v,e as o,f as d,g as f}from"./table-BGKcx7UY.js";const T=20,g=/\/api\/v2\/pokemon\/(\d+)\/?/,O=function(){const{offset:a}=c.useSearch(),{pokemonListOptions:p}=c.useRouteContext(),{data:s}=j(p),r=u.useMemo(()=>(s==null?void 0:s.previous)==null?null:new URL(s.previous).searchParams.get("offset")??null,[s==null?void 0:s.previous]),t=u.useMemo(()=>(s==null?void 0:s.next)==null?null:new URL(s.next).searchParams.get("offset")??null,[s==null?void 0:s.next]),h=s.results??[];return e.jsxs("div",{className:"p-4",children:[e.jsxs("h1",{className:"text-2xl font-bold mb-4",children:["National Pokédex: Pokémon ",a+1,"-",a+T]}),e.jsxs(b,{children:[e.jsx(N,{children:e.jsxs(x,{children:[e.jsx(l,{children:"#"}),e.jsx(l,{children:"Name"}),e.jsx(l,{children:"Details"})]})}),e.jsx(v,{children:h.map(n=>{var i;return e.jsxs(x,{children:[e.jsx(o,{children:(i=n.url.match(g))==null?void 0:i[1]}),e.jsx(o,{className:"capitalize",children:n.name}),e.jsx(o,{children:e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:"View"})})]},n.name)})})]}),e.jsxs("div",{className:"flex justify-center gap-4 mt-4",children:[e.jsx(m,{to:"/intent-preloading",preload:"intent",className:d({variant:"outline",className:f(!r&&"opacity-50 cursor-not-allowed")}),search:{offset:Number(r)},disabled:!r,children:"Previous"}),e.jsx(m,{to:"/intent-preloading",preload:"intent",search:{offset:Number(t)},className:d({variant:"outline",className:f(!t&&"opacity-50 cursor-not-allowed")}),disabled:!t,children:"Next"})]})]})};export{O as component};
-1
.output/public/assets/intent-preloading-Bn-PcF_7.js
··· 1 - import{j as r}from"./main-C_SO_aYE.js";const t=function(){return r.jsx("div",{children:"Error"})};export{t as errorComponent};
-44
.output/public/assets/logo-CHtJT8UQ.svg
··· 1 - <?xml version="1.0" encoding="UTF-8"?> 2 - <svg id="Layer_1" 3 - xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 841.9 595.3"> 4 - <!-- Generator: Adobe Illustrator 29.3.0, SVG Export Plug-In . SVG Version: 2.1.0 Build 146) --> 5 - <defs> 6 - <style> 7 - .st0 { 8 - fill: #9ae7fc; 9 - } 10 - 11 - .st1 { 12 - fill: #61dafb; 13 - } 14 - </style> 15 - </defs> 16 - <g> 17 - <path class="st1" d="M666.3,296.5c0-32.5-40.7-63.3-103.1-82.4,14.4-63.6,8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6,0,8.3.9,11.4,2.6,13.6,7.8,19.5,37.5,14.9,75.7-1.1,9.4-2.9,19.3-5.1,29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50,32.6-30.3,63.2-46.9,84-46.9v-22.3c-27.5,0-63.5,19.6-99.9,53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7,0,51.4,16.5,84,46.6-14,14.7-28,31.4-41.3,49.9-22.6,2.4-44,6.1-63.6,11-2.3-10-4-19.7-5.2-29-4.7-38.2,1.1-67.9,14.6-75.8,3-1.8,6.9-2.6,11.5-2.6v-22.3c-8.4,0-16,1.8-22.6,5.6-28.1,16.2-34.4,66.7-19.9,130.1-62.2,19.2-102.7,49.9-102.7,82.3s40.7,63.3,103.1,82.4c-14.4,63.6-8,114.2,20.2,130.4,6.5,3.8,14.1,5.6,22.5,5.6,27.5,0,63.5-19.6,99.9-53.6,36.4,33.8,72.4,53.2,99.9,53.2,8.4,0,16-1.8,22.6-5.6,28.1-16.2,34.4-66.7,19.9-130.1,62-19.1,102.5-49.9,102.5-82.3zm-130.2-66.7c-3.7,12.9-8.3,26.2-13.5,39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4,14.2,2.1,27.9,4.7,41,7.9zm-45.8,106.5c-7.8,13.5-15.8,26.3-24.1,38.2-14.9,1.3-30,2-45.2,2s-30.2-.7-45-1.9c-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8,6.2-13.4,13.2-26.8,20.7-39.9,7.8-13.5,15.8-26.3,24.1-38.2,14.9-1.3,30-2,45.2-2s30.2.7,45,1.9c8.3,11.9,16.4,24.6,24.2,38,7.6,13.1,14.5,26.4,20.8,39.8-6.3,13.4-13.2,26.8-20.7,39.9zm32.3-13c5.4,13.4,10,26.8,13.8,39.8-13.1,3.2-26.9,5.9-41.2,8,4.9-7.7,9.8-15.6,14.4-23.7,4.6-8,8.9-16.1,13-24.1zm-101.4,106.7c-9.3-9.6-18.6-20.3-27.8-32,9,.4,18.2.7,27.5.7s18.7-.2,27.8-.7c-9,11.7-18.3,22.4-27.5,32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9,3.7-12.9,8.3-26.2,13.5-39.5,4.1,8,8.4,16,13.1,24s9.5,15.8,14.4,23.4zm73.9-208.1c9.3,9.6,18.6,20.3,27.8,32-9-.4-18.2-.7-27.5-.7s-18.7.2-27.8.7c9-11.7,18.3-22.4,27.5-32zm-74,58.9c-4.9,7.7-9.8,15.6-14.4,23.7-4.6,8-8.9,16-13,24-5.4-13.4-10-26.8-13.8-39.8,13.1-3.1,26.9-5.8,41.2-7.9zm-90.5,125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6,58.3-50.6c8.6-3.7,18-7,27.7-10.1,5.7,19.6,13.2,40,22.5,60.9-9.2,20.8-16.6,41.1-22.2,60.6-9.9-3.1-19.3-6.5-28-10.2zm53.8,142.9c-13.6-7.8-19.5-37.5-14.9-75.7,1.1-9.4,2.9-19.3,5.1-29.4,19.6,4.8,41,8.5,63.5,10.9,13.5,18.5,27.5,35.3,41.6,50-32.6,30.3-63.2,46.9-84,46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7,38.2-1.1,67.9-14.6,75.8-3,1.8-6.9,2.6-11.5,2.6-20.7,0-51.4-16.5-84-46.6,14-14.7,28-31.4,41.3-49.9,22.6-2.4,44-6.1,63.6-11,2.3,10.1,4.1,19.8,5.2,29.1zm38.5-66.7c-8.6,3.7-18,7-27.7,10.1-5.7-19.6-13.2-40-22.5-60.9,9.2-20.8,16.6-41.1,22.2-60.6,9.9,3.1,19.3,6.5,28.1,10.2,35.4,15.1,58.3,34.9,58.3,50.6,0,15.7-23,35.6-58.4,50.6zm-264.9-268.7z"/> 18 - <circle class="st1" cx="420.9" cy="296.5" r="45.7"/> 19 - <path class="st1" d="M520.5,78.1"/> 20 - </g> 21 - <circle class="st0" cx="420.8" cy="296.6" r="43"/> 22 - <path class="st1" d="M466.1,296.6c0,25-20.2,45.2-45.2,45.2s-45.2-20.2-45.2-45.2,20.2-45.2,45.2-45.2,45.2,20.2,45.2,45.2ZM386,295.6v-6.3c0-1.1,1.2-5.1,1.8-6.2,1-1.9,2.9-3.5,4.6-4.7l-3.4-3.4c4-3.6,9.4-3.7,13.7-.7,1.9-4.7,6.6-7.1,11.6-6.7l-.8,4.2c5.9.2,13.1,4.1,13.1,10.8s0,.5-.7.7c-1.7.3-3.4-.4-5-.6s-1.2-.4-1.2.3,2.5,4.1,3,5.5,1,3.5.8,5.3c-5.6-.8-10.5-3.2-14.8-6.7.3,2.6,4.1,21.7,5.3,21.9s.8-.6,1-1.1,1.3-6.3,1.3-6.7c0-1-1.7-1.8-2.2-2.8-1.2-2.7,1.3-4.7,3.7-3.3s5.2,6.2,7.5,7.3,13,1.4,14.8,3.3-2.9,4.6-1.5,7.6c6.7-2.6,13.5-3.3,20.6-2.5,3.1-9.7,3.1-20.3-.9-29.8-7.3,0-14.7-3.6-17.2-10.8-2.5-7.2-.7-8.6-1.3-9.3-.8-1-6.3.6-7.4-1.5s.3-1.1-.2-1.4-1.9-.6-2.6-.8c-26-6.4-51.3,15.7-49.7,42.1,0,1.6,1.6,10.3,2.4,11.1s4.8,0,6.3,0,3.7.3,5,.5c2.9.4,7.2,2.4,9.4,2.5s2.4-.8,2.7-2.4c.4-2.6.5-7.4.5-10.1s-1-7.8-1.3-11.6c-.9-.2-.7,0-.9.5-.7,1.3-1.1,3.2-1.9,4.8s-5.2,8.7-5.7,9-.7-.5-.8-.8c-1.6-3.5-2-7.9-1.9-11.8-.9-1-5.4,4.9-6.7,5.3l-.8-.4v-.3h-.2ZM455.6,276.4c1.1-1.2-6-8.9-7.2-10-3-2.7-5.4-4.5-3.5,1.4s5.7,7.8,10.6,8.5h.1ZM410.9,270.1c-.4-.5-6.1,2.9-5.5,4.6,1.9-1.3,5.9-1.7,5.5-4.6ZM400.4,276.4c-.3-2.4-6.3-2.7-7.2-1s1.6,1.4,1.9,1.4c1.8.3,3.5-.6,5.2-.4h.1ZM411.3,276.8c3.8,1.3,6.6,3.6,10.9,3.7s0-3-1.2-3.9c-2.2-1.7-5.1-2.4-7.8-2.4s-1.6-.3-1.4.4c2.8.6,7.3.7,8.4,3.8-2.3-.3-3.9-1.6-6.2-2s-2.5-.5-2.6.3h0ZM420.6,290.3c-.8-5.1-5.7-10.8-10.9-11.6s-1.3-.4-.8.5,4.7,3.2,5.7,4,4.5,4.2,2.1,3.8-8.4-7.8-9.4-6.7c.2.9,1.1,1.9,1.7,2.7,3,3.8,6.9,6.8,11.8,7.4h-.2ZM395.3,279.8c-5,1.1-6.9,6.3-6.7,11,.7.8,5-3.8,5.4-4.5s2.7-4.6,1.1-4-2.9,4.4-4.2,4.6.2-2.1.4-2.5c1.1-1.6,2.9-3.1,4-4.6h0ZM400.4,281.5c-.4-.5-2,1.3-2.3,1.7-2.9,3.9-2.6,10.2-1.5,14.8.8.2.8-.3,1.2-.7,3-3.8,5.5-10.5,4.5-15.4-2.1,3.1-3.1,7.3-3.6,11h-1.3c0-4,1.9-7.7,3-11.4h0ZM426.9,305.9c0-1.7-1.7-1.4-2.5-1.9s-1.3-1.9-3-1.4c1.3,2.1,3,3.2,5.5,3.4h0ZM417.2,308.5c7.6.7,5.5-1.9,1.4-5.5-1.3-.3-1.5,4.5-1.4,5.5ZM437,309.7c-3.5-.3-7.8-2-11.2-2.1s-1.3,0-1.9.7c4,1.3,8.4,1.7,12.1,4l1-2.5h0ZM420.5,312.8c-7.3,0-15.1,3.7-20.4,8.8s-4.8,5.3-4.8,6.2c0,1.8,8.6,6.2,10.5,6.8,12.1,4.8,27.5,3.5,38.2-4.2s3.1-2.7,0-6.2c-5.7-6.6-14.7-11.4-23.4-11.3h-.1ZM398.7,316.9c-1.4-1.4-5-1.9-7-2.1s-5.3-.3-6.9.6l13.9,1.4h0ZM456.9,314.8h-7.4c-.9,0-4.9,1.1-6,1.6s-.8.6,0,.5c2.4,0,5.1-1,7.6-1.3s3.5.2,5.1,0,1.3-.3.6-.8h0Z"/> 23 - <path class="st0" d="M386,295.6l.8.4c1.3-.3,5.8-6.2,6.7-5.3,0,3.9.3,8.3,1.9,11.8s0,1.2.8.8,5.1-7.8,5.7-9,1.3-3.5,1.9-4.8,0-.7.9-.5c.3,3.8,1.2,7.8,1.3,11.6s0,7.5-.5,10.1-1.1,2.4-2.7,2.4-6.5-2.1-9.4-2.5-3.7-.5-5-.5-5.4,1.1-6.3,0-2.2-9.5-2.4-11.1c-1.5-26.4,23.7-48.5,49.7-42.1s2.2.4,2.6.8,0,1,.2,1.4c1.1,2,6.5.5,7.4,1.5s.4,6.9,1.3,9.3c2.5,7.2,10,10.9,17.2,10.8,4,9.4,4,20.1.9,29.8-7.2-.7-13.9,0-20.6,2.5-1.3-3.1,4.1-5.1,1.5-7.6s-11.8-1.9-14.8-3.3-5.4-6.1-7.5-7.3-4.9.6-3.7,3.3,2.1,1.8,2.2,2.8-1,6.2-1.3,6.7-.3,1.3-1,1.1c-1.1-.3-5-19.3-5.3-21.9,4.3,3.5,9.2,5.9,14.8,6.7.2-1.9-.3-3.5-.8-5.3s-3-5.1-3-5.5c0-.8.9-.3,1.2-.3,1.6,0,3.3.8,5,.6s.7.3.7-.7c0-6.6-7.2-10.6-13.1-10.8l.8-4.2c-5.1-.3-9.6,2-11.6,6.7-4.3-3-9.8-3-13.7.7l3.4,3.4c-1.8,1.3-3.5,2.8-4.6,4.7s-1.8,5.1-1.8,6.2v6.6h.2ZM431.6,265c7.8,2.1,8.7-3.5.2-1.3l-.2,1.3ZM432.4,270.9c.3.6,6.4-.4,5.8-2.3s-4.6.6-5.7.6l-.2,1.7h.1ZM434.5,276c.8,1.2,5.7-1.8,5.5-2.7-.4-1.9-6.6,1.2-5.5,2.7ZM442.9,276.4c-.9-.9-5,2.8-4.6,4,.6,2.4,5.7-3,4.6-4ZM445.1,279.9c-.3.2-3.1,4.6-1.5,5s3.5-3.4,3.5-4-1.3-1.3-2-.9h0ZM448.9,287.4c2.1.8,3.8-5.1,2.3-5.5-1.9-.6-2.6,5.1-2.3,5.5ZM457.3,288.6c.5-1.7,1.1-4.7-1-5.5-1,.3-.6,3.9-.6,4.8l.3.5,1.3.2h0Z"/> 24 - <path class="st0" d="M455.6,276.4c-5-.8-9.1-3.6-10.6-8.5s.5-4,3.5-1.4,8.3,8.7,7.2,10h-.1Z"/> 25 - <path class="st0" d="M420.6,290.3c-4.9-.6-8.9-3.6-11.8-7.4s-1.5-1.8-1.7-2.7c1-1,8.5,6.6,9.4,6.7,2.4.4-1.8-3.5-2.1-3.8-1-.8-5.4-3.5-5.7-4-.4-.8.5-.5.8-.5,5.2.8,10.1,6.6,10.9,11.6h.2Z"/> 26 - <path class="st0" d="M400.4,281.5c-1.1,3.7-3,7.3-3,11.4h1.3c.5-3.7,1.5-7.8,3.6-11,1,4.8-1.5,11.6-4.5,15.4s-.4.8-1.2.7c-1.1-4.5-1.3-10.8,1.5-14.8s1.9-2.2,2.3-1.7h0Z"/> 27 - <path class="st0" d="M411.3,276.8c0-.8,2.1-.4,2.6-.3,2.4.4,4,1.7,6.2,2-1.2-3.1-5.7-3.2-8.4-3.8,0-.8.9-.4,1.4-.4,2.8,0,5.6.7,7.8,2.4,2.2,1.7,4,4,1.2,3.9-4.3,0-7.1-2.4-10.9-3.7h0Z"/> 28 - <path class="st0" d="M395.3,279.8c-1.1,1.6-3,3-4,4.6s-1.9,2.8-.4,2.5,2.8-4,4.2-4.6-.9,3.6-1.1,4c-.4.7-4.7,5.2-5.4,4.5-.2-4.6,1.8-9.9,6.7-11h0Z"/> 29 - <path class="st0" d="M437,309.7l-1,2.5c-3.6-2.3-8-2.8-12.1-4,.5-.7,1.1-.7,1.9-.7,3.4,0,7.8,1.8,11.2,2.1h0Z"/> 30 - <path class="st0" d="M417.2,308.5c0-1,0-5.8,1.4-5.5,4,3.5,6.1,6.2-1.4,5.5Z"/> 31 - <path class="st0" d="M400.4,276.4c-1.8-.3-3.5.7-5.2.4s-2.3-.8-1.9-1.4c.8-1.6,6.9-1.4,7.2,1h-.1Z"/> 32 - <path class="st0" d="M410.9,270.1c.4,3-3.6,3.3-5.5,4.6-.6-1.8,5-5.1,5.5-4.6Z"/> 33 - <path class="st0" d="M426.9,305.9c-2.5-.2-4.1-1.3-5.5-3.4,1.7-.4,2,.8,3,1.4s2.6.3,2.5,1.9h0Z"/> 34 - <path class="st1" d="M432.4,270.9l.2-1.7c1.1,0,5.1-2.2,5.7-.6s-5.5,2.9-5.8,2.3h-.1Z"/> 35 - <path class="st1" d="M431.6,265l.2-1.3c8.4-2.1,7.7,3.4-.2,1.3Z"/> 36 - <path class="st1" d="M434.5,276c-1.1-1.5,5.1-4.6,5.5-2.7s-4.6,4-5.5,2.7Z"/> 37 - <path class="st1" d="M442.9,276.4c1.1,1.1-4,6.4-4.6,4s3.7-4.9,4.6-4Z"/> 38 - <path class="st1" d="M445.1,279.9c.7-.4,2.1,0,2,.9s-2.4,4.4-3.5,4,1.3-4.8,1.5-5h0Z"/> 39 - <path class="st1" d="M448.9,287.4c-.3-.3.4-6.1,2.3-5.5,1.4.4-.2,6.2-2.3,5.5Z"/> 40 - <path class="st1" d="M457.3,288.6l-1.3-.2-.3-.5c0-.9-.4-4.6.6-4.8,2.1.8,1.5,3.8,1,5.5h0Z"/> 41 - <path class="st0" d="M420.5,312.8c8.9,0,17.9,4.7,23.4,11.3,5.6,6.6,3.8,3.5,0,6.2-10.7,7.7-26.1,9-38.2,4.2-1.9-.8-10.5-5.1-10.5-6.8s4-5.3,4.8-6.2c5.3-5,13.1-8.6,20.4-8.8h.1Z"/> 42 - <path class="st0" d="M398.7,316.9l-13.9-1.4c1.7-1,5-.8,6.9-.6s5.6.7,7,2.1h0Z"/> 43 - <path class="st0" d="M456.9,314.8c.7.5,0,.8-.6.8-1.6.2-3.5-.2-5.1,0-2.4.3-5.2,1.2-7.6,1.3s-1.1,0,0-.5,5.1-1.6,6-1.6h7.4,0Z"/> 44 - </svg>
-68
.output/public/assets/main-C_SO_aYE.js
··· 1 - const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/suspense-C9NRSXhZ.js","assets/useSuspenseQuery-BacjgsWj.js","assets/table-BGKcx7UY.js","assets/preloading-Cx2nmQCS.js","assets/pagination-DHyhKn7Y.js","assets/intent-preloading-BbIeCNkQ.js","assets/basic-D_HBRECz.js"])))=>i.map(i=>d[i]); 2 - var zy=l=>{throw TypeError(l)};var kc=(l,s,u)=>s.has(l)||zy("Cannot "+u);var B=(l,s,u)=>(kc(l,s,"read from private field"),u?u.call(l):s.get(l)),Ot=(l,s,u)=>s.has(l)?zy("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,u),yt=(l,s,u,c)=>(kc(l,s,"write to private field"),c?c.call(l,u):s.set(l,u),u),ce=(l,s,u)=>(kc(l,s,"access private method"),u);var ps=(l,s,u,c)=>({set _(o){yt(l,s,o,u)},get _(){return B(l,s,c)}});function y0(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var $c={exports:{}},Xi={};/** 3 - * @license React 4 - * react-jsx-runtime.production.js 5 - * 6 - * Copyright (c) Meta Platforms, Inc. and affiliates. 7 - * 8 - * This source code is licensed under the MIT license found in the 9 - * LICENSE file in the root directory of this source tree. 10 - */var wy;function v0(){if(wy)return Xi;wy=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function u(c,o,d){var y=null;if(d!==void 0&&(y=""+d),o.key!==void 0&&(y=""+o.key),"key"in o){d={};for(var v in o)v!=="key"&&(d[v]=o[v])}else d=o;return o=d.ref,{$$typeof:l,type:c,key:y,ref:o!==void 0?o:null,props:d}}return Xi.Fragment=s,Xi.jsx=u,Xi.jsxs=u,Xi}var Uy;function m0(){return Uy||(Uy=1,$c.exports=v0()),$c.exports}var V=m0(),Pc={exports:{}},vt={};/** 11 - * @license React 12 - * react.production.js 13 - * 14 - * Copyright (c) Meta Platforms, Inc. and affiliates. 15 - * 16 - * This source code is licensed under the MIT license found in the 17 - * LICENSE file in the root directory of this source tree. 18 - */var Ny;function p0(){if(Ny)return vt;Ny=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),y=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.iterator;function b(E){return E===null||typeof E!="object"?null:(E=p&&E[p]||E["@@iterator"],typeof E=="function"?E:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,U={};function j(E,N,F){this.props=E,this.context=N,this.refs=U,this.updater=F||x}j.prototype.isReactComponent={},j.prototype.setState=function(E,N){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,N,"setState")},j.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function G(){}G.prototype=j.prototype;function Z(E,N,F){this.props=E,this.context=N,this.refs=U,this.updater=F||x}var K=Z.prototype=new G;K.constructor=Z,M(K,j.prototype),K.isPureReactComponent=!0;var I=Array.isArray,k={H:null,A:null,T:null,S:null,V:null},Y=Object.prototype.hasOwnProperty;function $(E,N,F,J,P,lt){return F=lt.ref,{$$typeof:l,type:E,key:N,ref:F!==void 0?F:null,props:lt}}function q(E,N){return $(E.type,N,void 0,void 0,void 0,E.props)}function w(E){return typeof E=="object"&&E!==null&&E.$$typeof===l}function W(E){var N={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(F){return N[F]})}var ot=/\/+/g;function et(E,N){return typeof E=="object"&&E!==null&&E.key!=null?W(""+E.key):N.toString(36)}function dt(){}function pt(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(dt,dt):(E.status="pending",E.then(function(N){E.status==="pending"&&(E.status="fulfilled",E.value=N)},function(N){E.status==="pending"&&(E.status="rejected",E.reason=N)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function ht(E,N,F,J,P){var lt=typeof E;(lt==="undefined"||lt==="boolean")&&(E=null);var tt=!1;if(E===null)tt=!0;else switch(lt){case"bigint":case"string":case"number":tt=!0;break;case"object":switch(E.$$typeof){case l:case s:tt=!0;break;case g:return tt=E._init,ht(tt(E._payload),N,F,J,P)}}if(tt)return P=P(E),tt=J===""?"."+et(E,0):J,I(P)?(F="",tt!=null&&(F=tt.replace(ot,"$&/")+"/"),ht(P,N,F,"",function(bt){return bt})):P!=null&&(w(P)&&(P=q(P,F+(P.key==null||E&&E.key===P.key?"":(""+P.key).replace(ot,"$&/")+"/")+tt)),N.push(P)),1;tt=0;var St=J===""?".":J+":";if(I(E))for(var it=0;it<E.length;it++)J=E[it],lt=St+et(J,it),tt+=ht(J,N,F,lt,P);else if(it=b(E),typeof it=="function")for(E=it.call(E),it=0;!(J=E.next()).done;)J=J.value,lt=St+et(J,it++),tt+=ht(J,N,F,lt,P);else if(lt==="object"){if(typeof E.then=="function")return ht(pt(E),N,F,J,P);throw N=String(E),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}return tt}function C(E,N,F){if(E==null)return E;var J=[],P=0;return ht(E,J,"","",function(lt){return N.call(F,lt,P++)}),J}function X(E){if(E._status===-1){var N=E._result;N=N(),N.then(function(F){(E._status===0||E._status===-1)&&(E._status=1,E._result=F)},function(F){(E._status===0||E._status===-1)&&(E._status=2,E._result=F)}),E._status===-1&&(E._status=0,E._result=N)}if(E._status===1)return E._result.default;throw E._result}var at=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var N=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(N))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)};function gt(){}return vt.Children={map:C,forEach:function(E,N,F){C(E,function(){N.apply(this,arguments)},F)},count:function(E){var N=0;return C(E,function(){N++}),N},toArray:function(E){return C(E,function(N){return N})||[]},only:function(E){if(!w(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},vt.Component=j,vt.Fragment=u,vt.Profiler=o,vt.PureComponent=Z,vt.StrictMode=c,vt.Suspense=S,vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,vt.__COMPILER_RUNTIME={__proto__:null,c:function(E){return k.H.useMemoCache(E)}},vt.cache=function(E){return function(){return E.apply(null,arguments)}},vt.cloneElement=function(E,N,F){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var J=M({},E.props),P=E.key,lt=void 0;if(N!=null)for(tt in N.ref!==void 0&&(lt=void 0),N.key!==void 0&&(P=""+N.key),N)!Y.call(N,tt)||tt==="key"||tt==="__self"||tt==="__source"||tt==="ref"&&N.ref===void 0||(J[tt]=N[tt]);var tt=arguments.length-2;if(tt===1)J.children=F;else if(1<tt){for(var St=Array(tt),it=0;it<tt;it++)St[it]=arguments[it+2];J.children=St}return $(E.type,P,void 0,void 0,lt,J)},vt.createContext=function(E){return E={$$typeof:y,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:d,_context:E},E},vt.createElement=function(E,N,F){var J,P={},lt=null;if(N!=null)for(J in N.key!==void 0&&(lt=""+N.key),N)Y.call(N,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(P[J]=N[J]);var tt=arguments.length-2;if(tt===1)P.children=F;else if(1<tt){for(var St=Array(tt),it=0;it<tt;it++)St[it]=arguments[it+2];P.children=St}if(E&&E.defaultProps)for(J in tt=E.defaultProps,tt)P[J]===void 0&&(P[J]=tt[J]);return $(E,lt,void 0,void 0,null,P)},vt.createRef=function(){return{current:null}},vt.forwardRef=function(E){return{$$typeof:v,render:E}},vt.isValidElement=w,vt.lazy=function(E){return{$$typeof:g,_payload:{_status:-1,_result:E},_init:X}},vt.memo=function(E,N){return{$$typeof:h,type:E,compare:N===void 0?null:N}},vt.startTransition=function(E){var N=k.T,F={};k.T=F;try{var J=E(),P=k.S;P!==null&&P(F,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(gt,at)}catch(lt){at(lt)}finally{k.T=N}},vt.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},vt.use=function(E){return k.H.use(E)},vt.useActionState=function(E,N,F){return k.H.useActionState(E,N,F)},vt.useCallback=function(E,N){return k.H.useCallback(E,N)},vt.useContext=function(E){return k.H.useContext(E)},vt.useDebugValue=function(){},vt.useDeferredValue=function(E,N){return k.H.useDeferredValue(E,N)},vt.useEffect=function(E,N,F){var J=k.H;if(typeof F=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return J.useEffect(E,N)},vt.useId=function(){return k.H.useId()},vt.useImperativeHandle=function(E,N,F){return k.H.useImperativeHandle(E,N,F)},vt.useInsertionEffect=function(E,N){return k.H.useInsertionEffect(E,N)},vt.useLayoutEffect=function(E,N){return k.H.useLayoutEffect(E,N)},vt.useMemo=function(E,N){return k.H.useMemo(E,N)},vt.useOptimistic=function(E,N){return k.H.useOptimistic(E,N)},vt.useReducer=function(E,N,F){return k.H.useReducer(E,N,F)},vt.useRef=function(E){return k.H.useRef(E)},vt.useState=function(E){return k.H.useState(E)},vt.useSyncExternalStore=function(E,N,F){return k.H.useSyncExternalStore(E,N,F)},vt.useTransition=function(){return k.H.useTransition()},vt.version="19.1.0",vt}var Ly;function nu(){return Ly||(Ly=1,Pc.exports=p0()),Pc.exports}var st=nu();const Pi=y0(st);var Wc={exports:{}},Zi={},Ic={exports:{}},to={};/** 19 - * @license React 20 - * scheduler.production.js 21 - * 22 - * Copyright (c) Meta Platforms, Inc. and affiliates. 23 - * 24 - * This source code is licensed under the MIT license found in the 25 - * LICENSE file in the root directory of this source tree. 26 - */var jy;function g0(){return jy||(jy=1,function(l){function s(C,X){var at=C.length;C.push(X);t:for(;0<at;){var gt=at-1>>>1,E=C[gt];if(0<o(E,X))C[gt]=X,C[at]=E,at=gt;else break t}}function u(C){return C.length===0?null:C[0]}function c(C){if(C.length===0)return null;var X=C[0],at=C.pop();if(at!==X){C[0]=at;t:for(var gt=0,E=C.length,N=E>>>1;gt<N;){var F=2*(gt+1)-1,J=C[F],P=F+1,lt=C[P];if(0>o(J,at))P<E&&0>o(lt,J)?(C[gt]=lt,C[P]=at,gt=P):(C[gt]=J,C[F]=at,gt=F);else if(P<E&&0>o(lt,at))C[gt]=lt,C[P]=at,gt=P;else break t}}return X}function o(C,X){var at=C.sortIndex-X.sortIndex;return at!==0?at:C.id-X.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var y=Date,v=y.now();l.unstable_now=function(){return y.now()-v}}var S=[],h=[],g=1,p=null,b=3,x=!1,M=!1,U=!1,j=!1,G=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function I(C){for(var X=u(h);X!==null;){if(X.callback===null)c(h);else if(X.startTime<=C)c(h),X.sortIndex=X.expirationTime,s(S,X);else break;X=u(h)}}function k(C){if(U=!1,I(C),!M)if(u(S)!==null)M=!0,Y||(Y=!0,et());else{var X=u(h);X!==null&&ht(k,X.startTime-C)}}var Y=!1,$=-1,q=5,w=-1;function W(){return j?!0:!(l.unstable_now()-w<q)}function ot(){if(j=!1,Y){var C=l.unstable_now();w=C;var X=!0;try{t:{M=!1,U&&(U=!1,Z($),$=-1),x=!0;var at=b;try{e:{for(I(C),p=u(S);p!==null&&!(p.expirationTime>C&&W());){var gt=p.callback;if(typeof gt=="function"){p.callback=null,b=p.priorityLevel;var E=gt(p.expirationTime<=C);if(C=l.unstable_now(),typeof E=="function"){p.callback=E,I(C),X=!0;break e}p===u(S)&&c(S),I(C)}else c(S);p=u(S)}if(p!==null)X=!0;else{var N=u(h);N!==null&&ht(k,N.startTime-C),X=!1}}break t}finally{p=null,b=at,x=!1}X=void 0}}finally{X?et():Y=!1}}}var et;if(typeof K=="function")et=function(){K(ot)};else if(typeof MessageChannel<"u"){var dt=new MessageChannel,pt=dt.port2;dt.port1.onmessage=ot,et=function(){pt.postMessage(null)}}else et=function(){G(ot,0)};function ht(C,X){$=G(function(){C(l.unstable_now())},X)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(C){C.callback=null},l.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<C?Math.floor(1e3/C):5},l.unstable_getCurrentPriorityLevel=function(){return b},l.unstable_next=function(C){switch(b){case 1:case 2:case 3:var X=3;break;default:X=b}var at=b;b=X;try{return C()}finally{b=at}},l.unstable_requestPaint=function(){j=!0},l.unstable_runWithPriority=function(C,X){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var at=b;b=C;try{return X()}finally{b=at}},l.unstable_scheduleCallback=function(C,X,at){var gt=l.unstable_now();switch(typeof at=="object"&&at!==null?(at=at.delay,at=typeof at=="number"&&0<at?gt+at:gt):at=gt,C){case 1:var E=-1;break;case 2:E=250;break;case 5:E=1073741823;break;case 4:E=1e4;break;default:E=5e3}return E=at+E,C={id:g++,callback:X,priorityLevel:C,startTime:at,expirationTime:E,sortIndex:-1},at>gt?(C.sortIndex=at,s(h,C),u(S)===null&&C===u(h)&&(U?(Z($),$=-1):U=!0,ht(k,at-gt))):(C.sortIndex=E,s(S,C),M||x||(M=!0,Y||(Y=!0,et()))),C},l.unstable_shouldYield=W,l.unstable_wrapCallback=function(C){var X=b;return function(){var at=b;b=X;try{return C.apply(this,arguments)}finally{b=at}}}}(to)),to}var Hy;function S0(){return Hy||(Hy=1,Ic.exports=g0()),Ic.exports}var eo={exports:{}},oe={};/** 27 - * @license React 28 - * react-dom.production.js 29 - * 30 - * Copyright (c) Meta Platforms, Inc. and affiliates. 31 - * 32 - * This source code is licensed under the MIT license found in the 33 - * LICENSE file in the root directory of this source tree. 34 - */var By;function b0(){if(By)return oe;By=1;var l=nu();function s(S){var h="https://react.dev/errors/"+S;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+S+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var c={d:{f:u,r:function(){throw Error(s(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(S,h,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:p==null?null:""+p,children:S,containerInfo:h,implementation:g}}var y=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function v(S,h){if(S==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return oe.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,oe.createPortal=function(S,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(s(299));return d(S,h,null,g)},oe.flushSync=function(S){var h=y.T,g=c.p;try{if(y.T=null,c.p=2,S)return S()}finally{y.T=h,c.p=g,c.d.f()}},oe.preconnect=function(S,h){typeof S=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,c.d.C(S,h))},oe.prefetchDNS=function(S){typeof S=="string"&&c.d.D(S)},oe.preinit=function(S,h){if(typeof S=="string"&&h&&typeof h.as=="string"){var g=h.as,p=v(g,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?c.d.S(S,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:x}):g==="script"&&c.d.X(S,{crossOrigin:p,integrity:b,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},oe.preinitModule=function(S,h){if(typeof S=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=v(h.as,h.crossOrigin);c.d.M(S,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&c.d.M(S)},oe.preload=function(S,h){if(typeof S=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,p=v(g,h.crossOrigin);c.d.L(S,g,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},oe.preloadModule=function(S,h){if(typeof S=="string")if(h){var g=v(h.as,h.crossOrigin);c.d.m(S,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else c.d.m(S)},oe.requestFormReset=function(S){c.d.r(S)},oe.unstable_batchedUpdates=function(S,h){return S(h)},oe.useFormState=function(S,h,g){return y.H.useFormState(S,h,g)},oe.useFormStatus=function(){return y.H.useHostTransitionStatus()},oe.version="19.1.0",oe}var qy;function Rv(){if(qy)return eo.exports;qy=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),eo.exports=b0(),eo.exports}/** 35 - * @license React 36 - * react-dom-client.production.js 37 - * 38 - * Copyright (c) Meta Platforms, Inc. and affiliates. 39 - * 40 - * This source code is licensed under the MIT license found in the 41 - * LICENSE file in the root directory of this source tree. 42 - */var Qy;function _0(){if(Qy)return Zi;Qy=1;var l=S0(),s=nu(),u=Rv();function c(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function d(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function y(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function v(t){if(d(t)!==t)throw Error(c(188))}function S(t){var e=t.alternate;if(!e){if(e=d(t),e===null)throw Error(c(188));return e!==t?null:t}for(var n=t,a=e;;){var i=n.return;if(i===null)break;var r=i.alternate;if(r===null){if(a=i.return,a!==null){n=a;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===n)return v(i),t;if(r===a)return v(i),e;r=r.sibling}throw Error(c(188))}if(n.return!==a.return)n=i,a=r;else{for(var f=!1,m=i.child;m;){if(m===n){f=!0,n=i,a=r;break}if(m===a){f=!0,a=i,n=r;break}m=m.sibling}if(!f){for(m=r.child;m;){if(m===n){f=!0,n=r,a=i;break}if(m===a){f=!0,a=r,n=i;break}m=m.sibling}if(!f)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?t:e}function h(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=h(t),e!==null)return e;t=t.sibling}return null}var g=Object.assign,p=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),G=Symbol.for("react.provider"),Z=Symbol.for("react.consumer"),K=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),ot=Symbol.iterator;function et(t){return t===null||typeof t!="object"?null:(t=ot&&t[ot]||t["@@iterator"],typeof t=="function"?t:null)}var dt=Symbol.for("react.client.reference");function pt(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===dt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case j:return"Profiler";case U:return"StrictMode";case k:return"Suspense";case Y:return"SuspenseList";case w:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case x:return"Portal";case K:return(t.displayName||"Context")+".Provider";case Z:return(t._context.displayName||"Context")+".Consumer";case I:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case $:return e=t.displayName||null,e!==null?e:pt(t.type)||"Memo";case q:e=t._payload,t=t._init;try{return pt(t(e))}catch{}}return null}var ht=Array.isArray,C=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,at={pending:!1,data:null,method:null,action:null},gt=[],E=-1;function N(t){return{current:t}}function F(t){0>E||(t.current=gt[E],gt[E]=null,E--)}function J(t,e){E++,gt[E]=t.current,t.current=e}var P=N(null),lt=N(null),tt=N(null),St=N(null);function it(t,e){switch(J(tt,e),J(lt,t),J(P,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?iy(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=iy(e),t=uy(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}F(P),J(P,t)}function bt(){F(P),F(lt),F(tt)}function Nt(t){t.memoizedState!==null&&J(St,t);var e=P.current,n=uy(e,t.type);e!==n&&(J(lt,t),J(P,n))}function Qt(t){lt.current===t&&(F(P),F(lt)),St.current===t&&(F(St),Qi._currentValue=at)}var Bt=Object.prototype.hasOwnProperty,me=l.unstable_scheduleCallback,$e=l.unstable_cancelCallback,Nn=l.unstable_shouldYield,Le=l.unstable_requestPaint,Wt=l.unstable_now,Va=l.unstable_getCurrentPriorityLevel,Jl=l.unstable_ImmediatePriority,Fl=l.unstable_UserBlockingPriority,xt=l.unstable_NormalPriority,Jt=l.unstable_LowPriority,Ya=l.unstable_IdlePriority,au=l.log,Hs=l.unstable_setDisableYieldValue,ya=null,Me=null;function Ln(t){if(typeof au=="function"&&Hs(t),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(ya,t)}catch{}}var Oe=Math.clz32?Math.clz32:tm,Wv=Math.log,Iv=Math.LN2;function tm(t){return t>>>=0,t===0?32:31-(Wv(t)/Iv|0)|0}var lu=256,iu=4194304;function va(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function uu(t,e,n){var a=t.pendingLanes;if(a===0)return 0;var i=0,r=t.suspendedLanes,f=t.pingedLanes;t=t.warmLanes;var m=a&134217727;return m!==0?(a=m&~r,a!==0?i=va(a):(f&=m,f!==0?i=va(f):n||(n=m&~t,n!==0&&(i=va(n))))):(m=a&~r,m!==0?i=va(m):f!==0?i=va(f):n||(n=a&~t,n!==0&&(i=va(n)))),i===0?0:e!==0&&e!==i&&(e&r)===0&&(r=i&-i,n=e&-e,r>=n||r===32&&(n&4194048)!==0)?e:i}function kl(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function em(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Go(){var t=lu;return lu<<=1,(lu&4194048)===0&&(lu=256),t}function Vo(){var t=iu;return iu<<=1,(iu&62914560)===0&&(iu=4194304),t}function Bs(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function $l(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function nm(t,e,n,a,i,r){var f=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var m=t.entanglements,_=t.expirationTimes,A=t.hiddenUpdates;for(n=f&~n;0<n;){var L=31-Oe(n),Q=1<<L;m[L]=0,_[L]=-1;var D=A[L];if(D!==null)for(A[L]=null,L=0;L<D.length;L++){var z=D[L];z!==null&&(z.lane&=-536870913)}n&=~Q}a!==0&&Yo(t,a,0),r!==0&&i===0&&t.tag!==0&&(t.suspendedLanes|=r&~(f&~e))}function Yo(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var a=31-Oe(e);t.entangledLanes|=e,t.entanglements[a]=t.entanglements[a]|1073741824|n&4194090}function Ko(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var a=31-Oe(n),i=1<<a;i&e|t[a]&e&&(t[a]|=e),n&=~i}}function qs(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Qs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Xo(){var t=X.p;return t!==0?t:(t=window.event,t===void 0?32:My(t.type))}function am(t,e){var n=X.p;try{return X.p=t,e()}finally{X.p=n}}var jn=Math.random().toString(36).slice(2),se="__reactFiber$"+jn,pe="__reactProps$"+jn,Ka="__reactContainer$"+jn,Gs="__reactEvents$"+jn,lm="__reactListeners$"+jn,im="__reactHandles$"+jn,Zo="__reactResources$"+jn,Pl="__reactMarker$"+jn;function Vs(t){delete t[se],delete t[pe],delete t[Gs],delete t[lm],delete t[im]}function Xa(t){var e=t[se];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Ka]||n[se]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=oy(t);t!==null;){if(n=t[se])return n;t=oy(t)}return e}t=n,n=t.parentNode}return null}function Za(t){if(t=t[se]||t[Ka]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function Wl(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(c(33))}function Ja(t){var e=t[Zo];return e||(e=t[Zo]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function It(t){t[Pl]=!0}var Jo=new Set,Fo={};function ma(t,e){Fa(t,e),Fa(t+"Capture",e)}function Fa(t,e){for(Fo[t]=e,t=0;t<e.length;t++)Jo.add(e[t])}var um=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ko={},$o={};function sm(t){return Bt.call($o,t)?!0:Bt.call(ko,t)?!1:um.test(t)?$o[t]=!0:(ko[t]=!0,!1)}function su(t,e,n){if(sm(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var a=e.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function ru(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function mn(t,e,n,a){if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+a)}}var Ys,Po;function ka(t){if(Ys===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Ys=e&&e[1]||"",Po=-1<n.stack.indexOf(` 43 - at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return` 44 - `+Ys+t+Po}var Ks=!1;function Xs(t,e){if(!t||Ks)return"";Ks=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(e){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(z){var D=z}Reflect.construct(t,[],Q)}else{try{Q.call()}catch(z){D=z}t.call(Q.prototype)}}else{try{throw Error()}catch(z){D=z}(Q=t())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(z){if(z&&D&&typeof z.stack=="string")return[z.stack,D.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),f=r[0],m=r[1];if(f&&m){var _=f.split(` 45 - `),A=m.split(` 46 - `);for(i=a=0;a<_.length&&!_[a].includes("DetermineComponentFrameRoot");)a++;for(;i<A.length&&!A[i].includes("DetermineComponentFrameRoot");)i++;if(a===_.length||i===A.length)for(a=_.length-1,i=A.length-1;1<=a&&0<=i&&_[a]!==A[i];)i--;for(;1<=a&&0<=i;a--,i--)if(_[a]!==A[i]){if(a!==1||i!==1)do if(a--,i--,0>i||_[a]!==A[i]){var L=` 47 - `+_[a].replace(" at new "," at ");return t.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",t.displayName)),L}while(1<=a&&0<=i);break}}}finally{Ks=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?ka(n):""}function rm(t){switch(t.tag){case 26:case 27:case 5:return ka(t.type);case 16:return ka("Lazy");case 13:return ka("Suspense");case 19:return ka("SuspenseList");case 0:case 15:return Xs(t.type,!1);case 11:return Xs(t.type.render,!1);case 1:return Xs(t.type,!0);case 31:return ka("Activity");default:return""}}function Wo(t){try{var e="";do e+=rm(t),t=t.return;while(t);return e}catch(n){return` 48 - Error generating stack: `+n.message+` 49 - `+n.stack}}function je(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Io(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function cm(t){var e=Io(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),a=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,r=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(f){a=""+f,r.call(this,f)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function cu(t){t._valueTracker||(t._valueTracker=cm(t))}function tf(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),a="";return t&&(a=Io(t)?t.checked?"true":"false":t.value),t=a,t!==n?(e.setValue(t),!0):!1}function ou(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var om=/[\n"\\]/g;function He(t){return t.replace(om,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Zs(t,e,n,a,i,r,f,m){t.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?t.type=f:t.removeAttribute("type"),e!=null?f==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+je(e)):t.value!==""+je(e)&&(t.value=""+je(e)):f!=="submit"&&f!=="reset"||t.removeAttribute("value"),e!=null?Js(t,f,je(e)):n!=null?Js(t,f,je(n)):a!=null&&t.removeAttribute("value"),i==null&&r!=null&&(t.defaultChecked=!!r),i!=null&&(t.checked=i&&typeof i!="function"&&typeof i!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?t.name=""+je(m):t.removeAttribute("name")}function ef(t,e,n,a,i,r,f,m){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.type=r),e!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||e!=null))return;n=n!=null?""+je(n):"",e=e!=null?""+je(e):n,m||e===t.value||(t.value=e),t.defaultValue=e}a=a??i,a=typeof a!="function"&&typeof a!="symbol"&&!!a,t.checked=m?t.checked:!!a,t.defaultChecked=!!a,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.name=f)}function Js(t,e,n){e==="number"&&ou(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function $a(t,e,n,a){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&a&&(t[n].defaultSelected=!0)}else{for(n=""+je(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,a&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function nf(t,e,n){if(e!=null&&(e=""+je(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+je(n):""}function af(t,e,n,a){if(e==null){if(a!=null){if(n!=null)throw Error(c(92));if(ht(a)){if(1<a.length)throw Error(c(93));a=a[0]}n=a}n==null&&(n=""),e=n}n=je(e),t.defaultValue=n,a=t.textContent,a===n&&a!==""&&a!==null&&(t.value=a)}function Pa(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var fm=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function lf(t,e,n){var a=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":a?t.setProperty(e,n):typeof n!="number"||n===0||fm.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function uf(t,e,n){if(e!=null&&typeof e!="object")throw Error(c(62));if(t=t.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||e!=null&&e.hasOwnProperty(a)||(a.indexOf("--")===0?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="");for(var i in e)a=e[i],e.hasOwnProperty(i)&&n[i]!==a&&lf(t,i,a)}else for(var r in e)e.hasOwnProperty(r)&&lf(t,r,e[r])}function Fs(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var dm=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),hm=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function fu(t){return hm.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var ks=null;function $s(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Wa=null,Ia=null;function sf(t){var e=Za(t);if(e&&(t=e.stateNode)){var n=t[pe]||null;t:switch(t=e.stateNode,e.type){case"input":if(Zs(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+He(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var a=n[e];if(a!==t&&a.form===t.form){var i=a[pe]||null;if(!i)throw Error(c(90));Zs(a,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(e=0;e<n.length;e++)a=n[e],a.form===t.form&&tf(a)}break t;case"textarea":nf(t,n.value,n.defaultValue);break t;case"select":e=n.value,e!=null&&$a(t,!!n.multiple,e,!1)}}}var Ps=!1;function rf(t,e,n){if(Ps)return t(e,n);Ps=!0;try{var a=t(e);return a}finally{if(Ps=!1,(Wa!==null||Ia!==null)&&($u(),Wa&&(e=Wa,t=Ia,Ia=Wa=null,sf(e),t)))for(e=0;e<t.length;e++)sf(t[e])}}function Il(t,e){var n=t.stateNode;if(n===null)return null;var a=n[pe]||null;if(a===null)return null;n=a[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(t=t.type,a=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!a;break t;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(c(231,e,typeof n));return n}var pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ws=!1;if(pn)try{var ti={};Object.defineProperty(ti,"passive",{get:function(){Ws=!0}}),window.addEventListener("test",ti,ti),window.removeEventListener("test",ti,ti)}catch{Ws=!1}var Hn=null,Is=null,du=null;function cf(){if(du)return du;var t,e=Is,n=e.length,a,i="value"in Hn?Hn.value:Hn.textContent,r=i.length;for(t=0;t<n&&e[t]===i[t];t++);var f=n-t;for(a=1;a<=f&&e[n-a]===i[r-a];a++);return du=i.slice(t,1<a?1-a:void 0)}function hu(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function yu(){return!0}function of(){return!1}function ge(t){function e(n,a,i,r,f){this._reactName=n,this._targetInst=i,this.type=a,this.nativeEvent=r,this.target=f,this.currentTarget=null;for(var m in t)t.hasOwnProperty(m)&&(n=t[m],this[m]=n?n(r):r[m]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?yu:of,this.isPropagationStopped=of,this}return g(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=yu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=yu)},persist:function(){},isPersistent:yu}),e}var pa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vu=ge(pa),ei=g({},pa,{view:0,detail:0}),ym=ge(ei),tr,er,ni,mu=g({},ei,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ni&&(ni&&t.type==="mousemove"?(tr=t.screenX-ni.screenX,er=t.screenY-ni.screenY):er=tr=0,ni=t),tr)},movementY:function(t){return"movementY"in t?t.movementY:er}}),ff=ge(mu),vm=g({},mu,{dataTransfer:0}),mm=ge(vm),pm=g({},ei,{relatedTarget:0}),nr=ge(pm),gm=g({},pa,{animationName:0,elapsedTime:0,pseudoElement:0}),Sm=ge(gm),bm=g({},pa,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),_m=ge(bm),Em=g({},pa,{data:0}),df=ge(Em),Rm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tm={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Mm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Om(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Mm[t])?!!e[t]:!1}function ar(){return Om}var Am=g({},ei,{key:function(t){if(t.key){var e=Rm[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=hu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Tm[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(t){return t.type==="keypress"?hu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?hu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),xm=ge(Am),Dm=g({},mu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hf=ge(Dm),Cm=g({},ei,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar}),zm=ge(Cm),wm=g({},pa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Um=ge(wm),Nm=g({},mu,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Lm=ge(Nm),jm=g({},pa,{newState:0,oldState:0}),Hm=ge(jm),Bm=[9,13,27,32],lr=pn&&"CompositionEvent"in window,ai=null;pn&&"documentMode"in document&&(ai=document.documentMode);var qm=pn&&"TextEvent"in window&&!ai,yf=pn&&(!lr||ai&&8<ai&&11>=ai),vf=" ",mf=!1;function pf(t,e){switch(t){case"keyup":return Bm.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gf(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var tl=!1;function Qm(t,e){switch(t){case"compositionend":return gf(e);case"keypress":return e.which!==32?null:(mf=!0,vf);case"textInput":return t=e.data,t===vf&&mf?null:t;default:return null}}function Gm(t,e){if(tl)return t==="compositionend"||!lr&&pf(t,e)?(t=cf(),du=Is=Hn=null,tl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return yf&&e.locale!=="ko"?null:e.data;default:return null}}var Vm={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Sf(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Vm[t.type]:e==="textarea"}function bf(t,e,n,a){Wa?Ia?Ia.push(a):Ia=[a]:Wa=a,e=ns(e,"onChange"),0<e.length&&(n=new vu("onChange","change",null,n,a),t.push({event:n,listeners:e}))}var li=null,ii=null;function Ym(t){ty(t,0)}function pu(t){var e=Wl(t);if(tf(e))return t}function _f(t,e){if(t==="change")return e}var Ef=!1;if(pn){var ir;if(pn){var ur="oninput"in document;if(!ur){var Rf=document.createElement("div");Rf.setAttribute("oninput","return;"),ur=typeof Rf.oninput=="function"}ir=ur}else ir=!1;Ef=ir&&(!document.documentMode||9<document.documentMode)}function Tf(){li&&(li.detachEvent("onpropertychange",Mf),ii=li=null)}function Mf(t){if(t.propertyName==="value"&&pu(ii)){var e=[];bf(e,ii,t,$s(t)),rf(Ym,e)}}function Km(t,e,n){t==="focusin"?(Tf(),li=e,ii=n,li.attachEvent("onpropertychange",Mf)):t==="focusout"&&Tf()}function Xm(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return pu(ii)}function Zm(t,e){if(t==="click")return pu(e)}function Jm(t,e){if(t==="input"||t==="change")return pu(e)}function Fm(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ae=typeof Object.is=="function"?Object.is:Fm;function ui(t,e){if(Ae(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),a=Object.keys(e);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var i=n[a];if(!Bt.call(e,i)||!Ae(t[i],e[i]))return!1}return!0}function Of(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Af(t,e){var n=Of(t);t=0;for(var a;n;){if(n.nodeType===3){if(a=t+n.textContent.length,t<=e&&a>=e)return{node:n,offset:e-t};t=a}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Of(n)}}function xf(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?xf(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Df(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=ou(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=ou(t.document)}return e}function sr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var km=pn&&"documentMode"in document&&11>=document.documentMode,el=null,rr=null,si=null,cr=!1;function Cf(t,e,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cr||el==null||el!==ou(a)||(a=el,"selectionStart"in a&&sr(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),si&&ui(si,a)||(si=a,a=ns(rr,"onSelect"),0<a.length&&(e=new vu("onSelect","select",null,e,n),t.push({event:e,listeners:a}),e.target=el)))}function ga(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var nl={animationend:ga("Animation","AnimationEnd"),animationiteration:ga("Animation","AnimationIteration"),animationstart:ga("Animation","AnimationStart"),transitionrun:ga("Transition","TransitionRun"),transitionstart:ga("Transition","TransitionStart"),transitioncancel:ga("Transition","TransitionCancel"),transitionend:ga("Transition","TransitionEnd")},or={},zf={};pn&&(zf=document.createElement("div").style,"AnimationEvent"in window||(delete nl.animationend.animation,delete nl.animationiteration.animation,delete nl.animationstart.animation),"TransitionEvent"in window||delete nl.transitionend.transition);function Sa(t){if(or[t])return or[t];if(!nl[t])return t;var e=nl[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in zf)return or[t]=e[n];return t}var wf=Sa("animationend"),Uf=Sa("animationiteration"),Nf=Sa("animationstart"),$m=Sa("transitionrun"),Pm=Sa("transitionstart"),Wm=Sa("transitioncancel"),Lf=Sa("transitionend"),jf=new Map,fr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");fr.push("scrollEnd");function Pe(t,e){jf.set(t,e),ma(e,[t])}var Hf=new WeakMap;function Be(t,e){if(typeof t=="object"&&t!==null){var n=Hf.get(t);return n!==void 0?n:(e={value:t,source:e,stack:Wo(e)},Hf.set(t,e),e)}return{value:t,source:e,stack:Wo(e)}}var qe=[],al=0,dr=0;function gu(){for(var t=al,e=dr=al=0;e<t;){var n=qe[e];qe[e++]=null;var a=qe[e];qe[e++]=null;var i=qe[e];qe[e++]=null;var r=qe[e];if(qe[e++]=null,a!==null&&i!==null){var f=a.pending;f===null?i.next=i:(i.next=f.next,f.next=i),a.pending=i}r!==0&&Bf(n,i,r)}}function Su(t,e,n,a){qe[al++]=t,qe[al++]=e,qe[al++]=n,qe[al++]=a,dr|=a,t.lanes|=a,t=t.alternate,t!==null&&(t.lanes|=a)}function hr(t,e,n,a){return Su(t,e,n,a),bu(t)}function ll(t,e){return Su(t,null,null,e),bu(t)}function Bf(t,e,n){t.lanes|=n;var a=t.alternate;a!==null&&(a.lanes|=n);for(var i=!1,r=t.return;r!==null;)r.childLanes|=n,a=r.alternate,a!==null&&(a.childLanes|=n),r.tag===22&&(t=r.stateNode,t===null||t._visibility&1||(i=!0)),t=r,r=r.return;return t.tag===3?(r=t.stateNode,i&&e!==null&&(i=31-Oe(n),t=r.hiddenUpdates,a=t[i],a===null?t[i]=[e]:a.push(e),e.lane=n|536870912),r):null}function bu(t){if(50<wi)throw wi=0,Sc=null,Error(c(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var il={};function Im(t,e,n,a){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xe(t,e,n,a){return new Im(t,e,n,a)}function yr(t){return t=t.prototype,!(!t||!t.isReactComponent)}function gn(t,e){var n=t.alternate;return n===null?(n=xe(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function qf(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function _u(t,e,n,a,i,r){var f=0;if(a=t,typeof t=="function")yr(t)&&(f=1);else if(typeof t=="string")f=e0(t,n,P.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case w:return t=xe(31,n,e,i),t.elementType=w,t.lanes=r,t;case M:return ba(n.children,i,r,e);case U:f=8,i|=24;break;case j:return t=xe(12,n,e,i|2),t.elementType=j,t.lanes=r,t;case k:return t=xe(13,n,e,i),t.elementType=k,t.lanes=r,t;case Y:return t=xe(19,n,e,i),t.elementType=Y,t.lanes=r,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G:case K:f=10;break t;case Z:f=9;break t;case I:f=11;break t;case $:f=14;break t;case q:f=16,a=null;break t}f=29,n=Error(c(130,t===null?"null":typeof t,"")),a=null}return e=xe(f,n,e,i),e.elementType=t,e.type=a,e.lanes=r,e}function ba(t,e,n,a){return t=xe(7,t,a,e),t.lanes=n,t}function vr(t,e,n){return t=xe(6,t,null,e),t.lanes=n,t}function mr(t,e,n){return e=xe(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var ul=[],sl=0,Eu=null,Ru=0,Qe=[],Ge=0,_a=null,Sn=1,bn="";function Ea(t,e){ul[sl++]=Ru,ul[sl++]=Eu,Eu=t,Ru=e}function Qf(t,e,n){Qe[Ge++]=Sn,Qe[Ge++]=bn,Qe[Ge++]=_a,_a=t;var a=Sn;t=bn;var i=32-Oe(a)-1;a&=~(1<<i),n+=1;var r=32-Oe(e)+i;if(30<r){var f=i-i%5;r=(a&(1<<f)-1).toString(32),a>>=f,i-=f,Sn=1<<32-Oe(e)+i|n<<i|a,bn=r+t}else Sn=1<<r|n<<i|a,bn=t}function pr(t){t.return!==null&&(Ea(t,1),Qf(t,1,0))}function gr(t){for(;t===Eu;)Eu=ul[--sl],ul[sl]=null,Ru=ul[--sl],ul[sl]=null;for(;t===_a;)_a=Qe[--Ge],Qe[Ge]=null,bn=Qe[--Ge],Qe[Ge]=null,Sn=Qe[--Ge],Qe[Ge]=null}var de=null,Gt=null,At=!1,Ra=null,ln=!1,Sr=Error(c(519));function Ta(t){var e=Error(c(418,""));throw oi(Be(e,t)),Sr}function Gf(t){var e=t.stateNode,n=t.type,a=t.memoizedProps;switch(e[se]=t,e[pe]=a,n){case"dialog":Rt("cancel",e),Rt("close",e);break;case"iframe":case"object":case"embed":Rt("load",e);break;case"video":case"audio":for(n=0;n<Ni.length;n++)Rt(Ni[n],e);break;case"source":Rt("error",e);break;case"img":case"image":case"link":Rt("error",e),Rt("load",e);break;case"details":Rt("toggle",e);break;case"input":Rt("invalid",e),ef(e,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),cu(e);break;case"select":Rt("invalid",e);break;case"textarea":Rt("invalid",e),af(e,a.value,a.defaultValue,a.children),cu(e)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||a.suppressHydrationWarning===!0||ly(e.textContent,n)?(a.popover!=null&&(Rt("beforetoggle",e),Rt("toggle",e)),a.onScroll!=null&&Rt("scroll",e),a.onScrollEnd!=null&&Rt("scrollend",e),a.onClick!=null&&(e.onclick=as),e=!0):e=!1,e||Ta(t)}function Vf(t){for(de=t.return;de;)switch(de.tag){case 5:case 13:ln=!1;return;case 27:case 3:ln=!0;return;default:de=de.return}}function ri(t){if(t!==de)return!1;if(!At)return Vf(t),At=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Lc(t.type,t.memoizedProps)),n=!n),n&&Gt&&Ta(t),Vf(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(317));t:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(n=t.data,n==="/$"){if(e===0){Gt=Ie(t.nextSibling);break t}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++;t=t.nextSibling}Gt=null}}else e===27?(e=Gt,In(t.type)?(t=qc,qc=null,Gt=t):Gt=e):Gt=de?Ie(t.stateNode.nextSibling):null;return!0}function ci(){Gt=de=null,At=!1}function Yf(){var t=Ra;return t!==null&&(_e===null?_e=t:_e.push.apply(_e,t),Ra=null),t}function oi(t){Ra===null?Ra=[t]:Ra.push(t)}var br=N(null),Ma=null,_n=null;function Bn(t,e,n){J(br,e._currentValue),e._currentValue=n}function En(t){t._currentValue=br.current,F(br)}function _r(t,e,n){for(;t!==null;){var a=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,a!==null&&(a.childLanes|=e)):a!==null&&(a.childLanes&e)!==e&&(a.childLanes|=e),t===n)break;t=t.return}}function Er(t,e,n,a){var i=t.child;for(i!==null&&(i.return=t);i!==null;){var r=i.dependencies;if(r!==null){var f=i.child;r=r.firstContext;t:for(;r!==null;){var m=r;r=i;for(var _=0;_<e.length;_++)if(m.context===e[_]){r.lanes|=n,m=r.alternate,m!==null&&(m.lanes|=n),_r(r.return,n,t),a||(f=null);break t}r=m.next}}else if(i.tag===18){if(f=i.return,f===null)throw Error(c(341));f.lanes|=n,r=f.alternate,r!==null&&(r.lanes|=n),_r(f,n,t),f=null}else f=i.child;if(f!==null)f.return=i;else for(f=i;f!==null;){if(f===t){f=null;break}if(i=f.sibling,i!==null){i.return=f.return,f=i;break}f=f.return}i=f}}function fi(t,e,n,a){t=null;for(var i=e,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var f=i.alternate;if(f===null)throw Error(c(387));if(f=f.memoizedProps,f!==null){var m=i.type;Ae(i.pendingProps.value,f.value)||(t!==null?t.push(m):t=[m])}}else if(i===St.current){if(f=i.alternate,f===null)throw Error(c(387));f.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(t!==null?t.push(Qi):t=[Qi])}i=i.return}t!==null&&Er(e,t,n,a),e.flags|=262144}function Tu(t){for(t=t.firstContext;t!==null;){if(!Ae(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Oa(t){Ma=t,_n=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function re(t){return Kf(Ma,t)}function Mu(t,e){return Ma===null&&Oa(t),Kf(t,e)}function Kf(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},_n===null){if(t===null)throw Error(c(308));_n=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else _n=_n.next=e;return n}var tp=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,a){t.push(a)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},ep=l.unstable_scheduleCallback,np=l.unstable_NormalPriority,$t={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rr(){return{controller:new tp,data:new Map,refCount:0}}function di(t){t.refCount--,t.refCount===0&&ep(np,function(){t.controller.abort()})}var hi=null,Tr=0,rl=0,cl=null;function ap(t,e){if(hi===null){var n=hi=[];Tr=0,rl=Oc(),cl={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Tr++,e.then(Xf,Xf),e}function Xf(){if(--Tr===0&&hi!==null){cl!==null&&(cl.status="fulfilled");var t=hi;hi=null,rl=0,cl=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function lp(t,e){var n=[],a={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return t.then(function(){a.status="fulfilled",a.value=e;for(var i=0;i<n.length;i++)(0,n[i])(e)},function(i){for(a.status="rejected",a.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),a}var Zf=C.S;C.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&ap(t,e),Zf!==null&&Zf(t,e)};var Aa=N(null);function Mr(){var t=Aa.current;return t!==null?t:jt.pooledCache}function Ou(t,e){e===null?J(Aa,Aa.current):J(Aa,e.pool)}function Jf(){var t=Mr();return t===null?null:{parent:$t._currentValue,pool:t}}var yi=Error(c(460)),Ff=Error(c(474)),Au=Error(c(542)),Or={then:function(){}};function kf(t){return t=t.status,t==="fulfilled"||t==="rejected"}function xu(){}function $f(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(xu,xu),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Wf(t),t;default:if(typeof e.status=="string")e.then(xu,xu);else{if(t=jt,t!==null&&100<t.shellSuspendCounter)throw Error(c(482));t=e,t.status="pending",t.then(function(a){if(e.status==="pending"){var i=e;i.status="fulfilled",i.value=a}},function(a){if(e.status==="pending"){var i=e;i.status="rejected",i.reason=a}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Wf(t),t}throw vi=e,yi}}var vi=null;function Pf(){if(vi===null)throw Error(c(459));var t=vi;return vi=null,t}function Wf(t){if(t===yi||t===Au)throw Error(c(483))}var qn=!1;function Ar(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xr(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Qn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Gn(t,e,n){var a=t.updateQueue;if(a===null)return null;if(a=a.shared,(Dt&2)!==0){var i=a.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),a.pending=e,e=bu(t),Bf(t,null,n),e}return Su(t,a,e,n),bu(t)}function mi(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,Ko(t,n)}}function Dr(t,e){var n=t.updateQueue,a=t.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=f:r=r.next=f,n=n.next}while(n!==null);r===null?i=r=e:r=r.next=e}else i=r=e;n={baseState:a.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Cr=!1;function pi(){if(Cr){var t=cl;if(t!==null)throw t}}function gi(t,e,n,a){Cr=!1;var i=t.updateQueue;qn=!1;var r=i.firstBaseUpdate,f=i.lastBaseUpdate,m=i.shared.pending;if(m!==null){i.shared.pending=null;var _=m,A=_.next;_.next=null,f===null?r=A:f.next=A,f=_;var L=t.alternate;L!==null&&(L=L.updateQueue,m=L.lastBaseUpdate,m!==f&&(m===null?L.firstBaseUpdate=A:m.next=A,L.lastBaseUpdate=_))}if(r!==null){var Q=i.baseState;f=0,L=A=_=null,m=r;do{var D=m.lane&-536870913,z=D!==m.lane;if(z?(Tt&D)===D:(a&D)===D){D!==0&&D===rl&&(Cr=!0),L!==null&&(L=L.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});t:{var ft=t,rt=m;D=e;var Ut=n;switch(rt.tag){case 1:if(ft=rt.payload,typeof ft=="function"){Q=ft.call(Ut,Q,D);break t}Q=ft;break t;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=rt.payload,D=typeof ft=="function"?ft.call(Ut,Q,D):ft,D==null)break t;Q=g({},Q,D);break t;case 2:qn=!0}}D=m.callback,D!==null&&(t.flags|=64,z&&(t.flags|=8192),z=i.callbacks,z===null?i.callbacks=[D]:z.push(D))}else z={lane:D,tag:m.tag,payload:m.payload,callback:m.callback,next:null},L===null?(A=L=z,_=Q):L=L.next=z,f|=D;if(m=m.next,m===null){if(m=i.shared.pending,m===null)break;z=m,m=z.next,z.next=null,i.lastBaseUpdate=z,i.shared.pending=null}}while(!0);L===null&&(_=Q),i.baseState=_,i.firstBaseUpdate=A,i.lastBaseUpdate=L,r===null&&(i.shared.lanes=0),kn|=f,t.lanes=f,t.memoizedState=Q}}function If(t,e){if(typeof t!="function")throw Error(c(191,t));t.call(e)}function td(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)If(n[t],e)}var ol=N(null),Du=N(0);function ed(t,e){t=Dn,J(Du,t),J(ol,e),Dn=t|e.baseLanes}function zr(){J(Du,Dn),J(ol,ol.current)}function wr(){Dn=Du.current,F(ol),F(Du)}var Vn=0,mt=null,zt=null,Ft=null,Cu=!1,fl=!1,xa=!1,zu=0,Si=0,dl=null,ip=0;function Kt(){throw Error(c(321))}function Ur(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Ae(t[n],e[n]))return!1;return!0}function Nr(t,e,n,a,i,r){return Vn=r,mt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,C.H=t===null||t.memoizedState===null?Bd:qd,xa=!1,r=n(a,i),xa=!1,fl&&(r=ad(e,n,a,i)),nd(t),r}function nd(t){C.H=Hu;var e=zt!==null&&zt.next!==null;if(Vn=0,Ft=zt=mt=null,Cu=!1,Si=0,dl=null,e)throw Error(c(300));t===null||te||(t=t.dependencies,t!==null&&Tu(t)&&(te=!0))}function ad(t,e,n,a){mt=t;var i=0;do{if(fl&&(dl=null),Si=0,fl=!1,25<=i)throw Error(c(301));if(i+=1,Ft=zt=null,t.updateQueue!=null){var r=t.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}C.H=dp,r=e(n,a)}while(fl);return r}function up(){var t=C.H,e=t.useState()[0];return e=typeof e.then=="function"?bi(e):e,t=t.useState()[0],(zt!==null?zt.memoizedState:null)!==t&&(mt.flags|=1024),e}function Lr(){var t=zu!==0;return zu=0,t}function jr(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function Hr(t){if(Cu){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}Cu=!1}Vn=0,Ft=zt=mt=null,fl=!1,Si=zu=0,dl=null}function Se(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ft===null?mt.memoizedState=Ft=t:Ft=Ft.next=t,Ft}function kt(){if(zt===null){var t=mt.alternate;t=t!==null?t.memoizedState:null}else t=zt.next;var e=Ft===null?mt.memoizedState:Ft.next;if(e!==null)Ft=e,zt=t;else{if(t===null)throw mt.alternate===null?Error(c(467)):Error(c(310));zt=t,t={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},Ft===null?mt.memoizedState=Ft=t:Ft=Ft.next=t}return Ft}function Br(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bi(t){var e=Si;return Si+=1,dl===null&&(dl=[]),t=$f(dl,t,e),e=mt,(Ft===null?e.memoizedState:Ft.next)===null&&(e=e.alternate,C.H=e===null||e.memoizedState===null?Bd:qd),t}function wu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return bi(t);if(t.$$typeof===K)return re(t)}throw Error(c(438,String(t)))}function qr(t){var e=null,n=mt.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var a=mt.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(e={data:a.data.map(function(i){return i.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=Br(),mt.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),a=0;a<t;a++)n[a]=W;return e.index++,n}function Rn(t,e){return typeof e=="function"?e(t):e}function Uu(t){var e=kt();return Qr(e,zt,t)}function Qr(t,e,n){var a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=n;var i=t.baseQueue,r=a.pending;if(r!==null){if(i!==null){var f=i.next;i.next=r.next,r.next=f}e.baseQueue=i=r,a.pending=null}if(r=t.baseState,i===null)t.memoizedState=r;else{e=i.next;var m=f=null,_=null,A=e,L=!1;do{var Q=A.lane&-536870913;if(Q!==A.lane?(Tt&Q)===Q:(Vn&Q)===Q){var D=A.revertLane;if(D===0)_!==null&&(_=_.next={lane:0,revertLane:0,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null}),Q===rl&&(L=!0);else if((Vn&D)===D){A=A.next,D===rl&&(L=!0);continue}else Q={lane:0,revertLane:A.revertLane,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},_===null?(m=_=Q,f=r):_=_.next=Q,mt.lanes|=D,kn|=D;Q=A.action,xa&&n(r,Q),r=A.hasEagerState?A.eagerState:n(r,Q)}else D={lane:Q,revertLane:A.revertLane,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null},_===null?(m=_=D,f=r):_=_.next=D,mt.lanes|=Q,kn|=Q;A=A.next}while(A!==null&&A!==e);if(_===null?f=r:_.next=m,!Ae(r,t.memoizedState)&&(te=!0,L&&(n=cl,n!==null)))throw n;t.memoizedState=r,t.baseState=f,t.baseQueue=_,a.lastRenderedState=r}return i===null&&(a.lanes=0),[t.memoizedState,a.dispatch]}function Gr(t){var e=kt(),n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=t;var a=n.dispatch,i=n.pending,r=e.memoizedState;if(i!==null){n.pending=null;var f=i=i.next;do r=t(r,f.action),f=f.next;while(f!==i);Ae(r,e.memoizedState)||(te=!0),e.memoizedState=r,e.baseQueue===null&&(e.baseState=r),n.lastRenderedState=r}return[r,a]}function ld(t,e,n){var a=mt,i=kt(),r=At;if(r){if(n===void 0)throw Error(c(407));n=n()}else n=e();var f=!Ae((zt||i).memoizedState,n);f&&(i.memoizedState=n,te=!0),i=i.queue;var m=sd.bind(null,a,i,t);if(_i(2048,8,m,[t]),i.getSnapshot!==e||f||Ft!==null&&Ft.memoizedState.tag&1){if(a.flags|=2048,hl(9,Nu(),ud.bind(null,a,i,n,e),null),jt===null)throw Error(c(349));r||(Vn&124)!==0||id(a,e,n)}return n}function id(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=mt.updateQueue,e===null?(e=Br(),mt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function ud(t,e,n,a){e.value=n,e.getSnapshot=a,rd(e)&&cd(t)}function sd(t,e,n){return n(function(){rd(e)&&cd(t)})}function rd(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Ae(t,n)}catch{return!0}}function cd(t){var e=ll(t,2);e!==null&&Ue(e,t,2)}function Vr(t){var e=Se();if(typeof t=="function"){var n=t;if(t=n(),xa){Ln(!0);try{n()}finally{Ln(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rn,lastRenderedState:t},e}function od(t,e,n,a){return t.baseState=n,Qr(t,zt,typeof a=="function"?a:Rn)}function sp(t,e,n,a,i){if(ju(t))throw Error(c(485));if(t=e.action,t!==null){var r={payload:i,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){r.listeners.push(f)}};C.T!==null?n(!0):r.isTransition=!1,a(r),n=e.pending,n===null?(r.next=e.pending=r,fd(e,r)):(r.next=n.next,e.pending=n.next=r)}}function fd(t,e){var n=e.action,a=e.payload,i=t.state;if(e.isTransition){var r=C.T,f={};C.T=f;try{var m=n(i,a),_=C.S;_!==null&&_(f,m),dd(t,e,m)}catch(A){Yr(t,e,A)}finally{C.T=r}}else try{r=n(i,a),dd(t,e,r)}catch(A){Yr(t,e,A)}}function dd(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){hd(t,e,a)},function(a){return Yr(t,e,a)}):hd(t,e,n)}function hd(t,e,n){e.status="fulfilled",e.value=n,yd(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,fd(t,n)))}function Yr(t,e,n){var a=t.pending;if(t.pending=null,a!==null){a=a.next;do e.status="rejected",e.reason=n,yd(e),e=e.next;while(e!==a)}t.action=null}function yd(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function vd(t,e){return e}function md(t,e){if(At){var n=jt.formState;if(n!==null){t:{var a=mt;if(At){if(Gt){e:{for(var i=Gt,r=ln;i.nodeType!==8;){if(!r){i=null;break e}if(i=Ie(i.nextSibling),i===null){i=null;break e}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){Gt=Ie(i.nextSibling),a=i.data==="F!";break t}}Ta(a)}a=!1}a&&(e=n[0])}}return n=Se(),n.memoizedState=n.baseState=e,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vd,lastRenderedState:e},n.queue=a,n=Ld.bind(null,mt,a),a.dispatch=n,a=Vr(!1),r=Fr.bind(null,mt,!1,a.queue),a=Se(),i={state:e,dispatch:null,action:t,pending:null},a.queue=i,n=sp.bind(null,mt,i,r,n),i.dispatch=n,a.memoizedState=t,[e,n,!1]}function pd(t){var e=kt();return gd(e,zt,t)}function gd(t,e,n){if(e=Qr(t,e,vd)[0],t=Uu(Rn)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var a=bi(e)}catch(f){throw f===yi?Au:f}else a=e;e=kt();var i=e.queue,r=i.dispatch;return n!==e.memoizedState&&(mt.flags|=2048,hl(9,Nu(),rp.bind(null,i,n),null)),[a,r,t]}function rp(t,e){t.action=e}function Sd(t){var e=kt(),n=zt;if(n!==null)return gd(e,n,t);kt(),e=e.memoizedState,n=kt();var a=n.queue.dispatch;return n.memoizedState=t,[e,a,!1]}function hl(t,e,n,a){return t={tag:t,create:n,deps:a,inst:e,next:null},e=mt.updateQueue,e===null&&(e=Br(),mt.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(a=n.next,n.next=t,t.next=a,e.lastEffect=t),t}function Nu(){return{destroy:void 0,resource:void 0}}function bd(){return kt().memoizedState}function Lu(t,e,n,a){var i=Se();a=a===void 0?null:a,mt.flags|=t,i.memoizedState=hl(1|e,Nu(),n,a)}function _i(t,e,n,a){var i=kt();a=a===void 0?null:a;var r=i.memoizedState.inst;zt!==null&&a!==null&&Ur(a,zt.memoizedState.deps)?i.memoizedState=hl(e,r,n,a):(mt.flags|=t,i.memoizedState=hl(1|e,r,n,a))}function _d(t,e){Lu(8390656,8,t,e)}function Ed(t,e){_i(2048,8,t,e)}function Rd(t,e){return _i(4,2,t,e)}function Td(t,e){return _i(4,4,t,e)}function Md(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Od(t,e,n){n=n!=null?n.concat([t]):null,_i(4,4,Md.bind(null,e,t),n)}function Kr(){}function Ad(t,e){var n=kt();e=e===void 0?null:e;var a=n.memoizedState;return e!==null&&Ur(e,a[1])?a[0]:(n.memoizedState=[t,e],t)}function xd(t,e){var n=kt();e=e===void 0?null:e;var a=n.memoizedState;if(e!==null&&Ur(e,a[1]))return a[0];if(a=t(),xa){Ln(!0);try{t()}finally{Ln(!1)}}return n.memoizedState=[a,e],a}function Xr(t,e,n){return n===void 0||(Vn&1073741824)!==0?t.memoizedState=e:(t.memoizedState=n,t=zh(),mt.lanes|=t,kn|=t,n)}function Dd(t,e,n,a){return Ae(n,e)?n:ol.current!==null?(t=Xr(t,n,a),Ae(t,e)||(te=!0),t):(Vn&42)===0?(te=!0,t.memoizedState=n):(t=zh(),mt.lanes|=t,kn|=t,e)}function Cd(t,e,n,a,i){var r=X.p;X.p=r!==0&&8>r?r:8;var f=C.T,m={};C.T=m,Fr(t,!1,e,n);try{var _=i(),A=C.S;if(A!==null&&A(m,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var L=lp(_,a);Ei(t,e,L,we(t))}else Ei(t,e,a,we(t))}catch(Q){Ei(t,e,{then:function(){},status:"rejected",reason:Q},we())}finally{X.p=r,C.T=f}}function cp(){}function Zr(t,e,n,a){if(t.tag!==5)throw Error(c(476));var i=zd(t).queue;Cd(t,i,e,at,n===null?cp:function(){return wd(t),n(a)})}function zd(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:at,baseState:at,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rn,lastRenderedState:at},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rn,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function wd(t){var e=zd(t).next.queue;Ei(t,e,{},we())}function Jr(){return re(Qi)}function Ud(){return kt().memoizedState}function Nd(){return kt().memoizedState}function op(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=we();t=Qn(n);var a=Gn(e,t,n);a!==null&&(Ue(a,e,n),mi(a,e,n)),e={cache:Rr()},t.payload=e;return}e=e.return}}function fp(t,e,n){var a=we();n={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},ju(t)?jd(e,n):(n=hr(t,e,n,a),n!==null&&(Ue(n,t,a),Hd(n,e,a)))}function Ld(t,e,n){var a=we();Ei(t,e,n,a)}function Ei(t,e,n,a){var i={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(ju(t))jd(e,i);else{var r=t.alternate;if(t.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var f=e.lastRenderedState,m=r(f,n);if(i.hasEagerState=!0,i.eagerState=m,Ae(m,f))return Su(t,e,i,0),jt===null&&gu(),!1}catch{}finally{}if(n=hr(t,e,i,a),n!==null)return Ue(n,t,a),Hd(n,e,a),!0}return!1}function Fr(t,e,n,a){if(a={lane:2,revertLane:Oc(),action:a,hasEagerState:!1,eagerState:null,next:null},ju(t)){if(e)throw Error(c(479))}else e=hr(t,n,a,2),e!==null&&Ue(e,t,2)}function ju(t){var e=t.alternate;return t===mt||e!==null&&e===mt}function jd(t,e){fl=Cu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Hd(t,e,n){if((n&4194048)!==0){var a=e.lanes;a&=t.pendingLanes,n|=a,e.lanes=n,Ko(t,n)}}var Hu={readContext:re,use:wu,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt},Bd={readContext:re,use:wu,useCallback:function(t,e){return Se().memoizedState=[t,e===void 0?null:e],t},useContext:re,useEffect:_d,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,Lu(4194308,4,Md.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Lu(4194308,4,t,e)},useInsertionEffect:function(t,e){Lu(4,2,t,e)},useMemo:function(t,e){var n=Se();e=e===void 0?null:e;var a=t();if(xa){Ln(!0);try{t()}finally{Ln(!1)}}return n.memoizedState=[a,e],a},useReducer:function(t,e,n){var a=Se();if(n!==void 0){var i=n(e);if(xa){Ln(!0);try{n(e)}finally{Ln(!1)}}}else i=e;return a.memoizedState=a.baseState=i,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:i},a.queue=t,t=t.dispatch=fp.bind(null,mt,t),[a.memoizedState,t]},useRef:function(t){var e=Se();return t={current:t},e.memoizedState=t},useState:function(t){t=Vr(t);var e=t.queue,n=Ld.bind(null,mt,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:Kr,useDeferredValue:function(t,e){var n=Se();return Xr(n,t,e)},useTransition:function(){var t=Vr(!1);return t=Cd.bind(null,mt,t.queue,!0,!1),Se().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var a=mt,i=Se();if(At){if(n===void 0)throw Error(c(407));n=n()}else{if(n=e(),jt===null)throw Error(c(349));(Tt&124)!==0||id(a,e,n)}i.memoizedState=n;var r={value:n,getSnapshot:e};return i.queue=r,_d(sd.bind(null,a,r,t),[t]),a.flags|=2048,hl(9,Nu(),ud.bind(null,a,r,n,e),null),n},useId:function(){var t=Se(),e=jt.identifierPrefix;if(At){var n=bn,a=Sn;n=(a&~(1<<32-Oe(a)-1)).toString(32)+n,e="«"+e+"R"+n,n=zu++,0<n&&(e+="H"+n.toString(32)),e+="»"}else n=ip++,e="«"+e+"r"+n.toString(32)+"»";return t.memoizedState=e},useHostTransitionStatus:Jr,useFormState:md,useActionState:md,useOptimistic:function(t){var e=Se();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=Fr.bind(null,mt,!0,n),n.dispatch=e,[t,e]},useMemoCache:qr,useCacheRefresh:function(){return Se().memoizedState=op.bind(null,mt)}},qd={readContext:re,use:wu,useCallback:Ad,useContext:re,useEffect:Ed,useImperativeHandle:Od,useInsertionEffect:Rd,useLayoutEffect:Td,useMemo:xd,useReducer:Uu,useRef:bd,useState:function(){return Uu(Rn)},useDebugValue:Kr,useDeferredValue:function(t,e){var n=kt();return Dd(n,zt.memoizedState,t,e)},useTransition:function(){var t=Uu(Rn)[0],e=kt().memoizedState;return[typeof t=="boolean"?t:bi(t),e]},useSyncExternalStore:ld,useId:Ud,useHostTransitionStatus:Jr,useFormState:pd,useActionState:pd,useOptimistic:function(t,e){var n=kt();return od(n,zt,t,e)},useMemoCache:qr,useCacheRefresh:Nd},dp={readContext:re,use:wu,useCallback:Ad,useContext:re,useEffect:Ed,useImperativeHandle:Od,useInsertionEffect:Rd,useLayoutEffect:Td,useMemo:xd,useReducer:Gr,useRef:bd,useState:function(){return Gr(Rn)},useDebugValue:Kr,useDeferredValue:function(t,e){var n=kt();return zt===null?Xr(n,t,e):Dd(n,zt.memoizedState,t,e)},useTransition:function(){var t=Gr(Rn)[0],e=kt().memoizedState;return[typeof t=="boolean"?t:bi(t),e]},useSyncExternalStore:ld,useId:Ud,useHostTransitionStatus:Jr,useFormState:Sd,useActionState:Sd,useOptimistic:function(t,e){var n=kt();return zt!==null?od(n,zt,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:qr,useCacheRefresh:Nd},yl=null,Ri=0;function Bu(t){var e=Ri;return Ri+=1,yl===null&&(yl=[]),$f(yl,t,e)}function Ti(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function qu(t,e){throw e.$$typeof===p?Error(c(525)):(t=Object.prototype.toString.call(e),Error(c(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Qd(t){var e=t._init;return e(t._payload)}function Gd(t){function e(T,R){if(t){var O=T.deletions;O===null?(T.deletions=[R],T.flags|=16):O.push(R)}}function n(T,R){if(!t)return null;for(;R!==null;)e(T,R),R=R.sibling;return null}function a(T){for(var R=new Map;T!==null;)T.key!==null?R.set(T.key,T):R.set(T.index,T),T=T.sibling;return R}function i(T,R){return T=gn(T,R),T.index=0,T.sibling=null,T}function r(T,R,O){return T.index=O,t?(O=T.alternate,O!==null?(O=O.index,O<R?(T.flags|=67108866,R):O):(T.flags|=67108866,R)):(T.flags|=1048576,R)}function f(T){return t&&T.alternate===null&&(T.flags|=67108866),T}function m(T,R,O,H){return R===null||R.tag!==6?(R=vr(O,T.mode,H),R.return=T,R):(R=i(R,O),R.return=T,R)}function _(T,R,O,H){var nt=O.type;return nt===M?L(T,R,O.props.children,H,O.key):R!==null&&(R.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===q&&Qd(nt)===R.type)?(R=i(R,O.props),Ti(R,O),R.return=T,R):(R=_u(O.type,O.key,O.props,null,T.mode,H),Ti(R,O),R.return=T,R)}function A(T,R,O,H){return R===null||R.tag!==4||R.stateNode.containerInfo!==O.containerInfo||R.stateNode.implementation!==O.implementation?(R=mr(O,T.mode,H),R.return=T,R):(R=i(R,O.children||[]),R.return=T,R)}function L(T,R,O,H,nt){return R===null||R.tag!==7?(R=ba(O,T.mode,H,nt),R.return=T,R):(R=i(R,O),R.return=T,R)}function Q(T,R,O){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=vr(""+R,T.mode,O),R.return=T,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case b:return O=_u(R.type,R.key,R.props,null,T.mode,O),Ti(O,R),O.return=T,O;case x:return R=mr(R,T.mode,O),R.return=T,R;case q:var H=R._init;return R=H(R._payload),Q(T,R,O)}if(ht(R)||et(R))return R=ba(R,T.mode,O,null),R.return=T,R;if(typeof R.then=="function")return Q(T,Bu(R),O);if(R.$$typeof===K)return Q(T,Mu(T,R),O);qu(T,R)}return null}function D(T,R,O,H){var nt=R!==null?R.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return nt!==null?null:m(T,R,""+O,H);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case b:return O.key===nt?_(T,R,O,H):null;case x:return O.key===nt?A(T,R,O,H):null;case q:return nt=O._init,O=nt(O._payload),D(T,R,O,H)}if(ht(O)||et(O))return nt!==null?null:L(T,R,O,H,null);if(typeof O.then=="function")return D(T,R,Bu(O),H);if(O.$$typeof===K)return D(T,R,Mu(T,O),H);qu(T,O)}return null}function z(T,R,O,H,nt){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return T=T.get(O)||null,m(R,T,""+H,nt);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return T=T.get(H.key===null?O:H.key)||null,_(R,T,H,nt);case x:return T=T.get(H.key===null?O:H.key)||null,A(R,T,H,nt);case q:var _t=H._init;return H=_t(H._payload),z(T,R,O,H,nt)}if(ht(H)||et(H))return T=T.get(O)||null,L(R,T,H,nt,null);if(typeof H.then=="function")return z(T,R,O,Bu(H),nt);if(H.$$typeof===K)return z(T,R,O,Mu(R,H),nt);qu(R,H)}return null}function ft(T,R,O,H){for(var nt=null,_t=null,ut=R,ct=R=0,ne=null;ut!==null&&ct<O.length;ct++){ut.index>ct?(ne=ut,ut=null):ne=ut.sibling;var Mt=D(T,ut,O[ct],H);if(Mt===null){ut===null&&(ut=ne);break}t&&ut&&Mt.alternate===null&&e(T,ut),R=r(Mt,R,ct),_t===null?nt=Mt:_t.sibling=Mt,_t=Mt,ut=ne}if(ct===O.length)return n(T,ut),At&&Ea(T,ct),nt;if(ut===null){for(;ct<O.length;ct++)ut=Q(T,O[ct],H),ut!==null&&(R=r(ut,R,ct),_t===null?nt=ut:_t.sibling=ut,_t=ut);return At&&Ea(T,ct),nt}for(ut=a(ut);ct<O.length;ct++)ne=z(ut,T,ct,O[ct],H),ne!==null&&(t&&ne.alternate!==null&&ut.delete(ne.key===null?ct:ne.key),R=r(ne,R,ct),_t===null?nt=ne:_t.sibling=ne,_t=ne);return t&&ut.forEach(function(la){return e(T,la)}),At&&Ea(T,ct),nt}function rt(T,R,O,H){if(O==null)throw Error(c(151));for(var nt=null,_t=null,ut=R,ct=R=0,ne=null,Mt=O.next();ut!==null&&!Mt.done;ct++,Mt=O.next()){ut.index>ct?(ne=ut,ut=null):ne=ut.sibling;var la=D(T,ut,Mt.value,H);if(la===null){ut===null&&(ut=ne);break}t&&ut&&la.alternate===null&&e(T,ut),R=r(la,R,ct),_t===null?nt=la:_t.sibling=la,_t=la,ut=ne}if(Mt.done)return n(T,ut),At&&Ea(T,ct),nt;if(ut===null){for(;!Mt.done;ct++,Mt=O.next())Mt=Q(T,Mt.value,H),Mt!==null&&(R=r(Mt,R,ct),_t===null?nt=Mt:_t.sibling=Mt,_t=Mt);return At&&Ea(T,ct),nt}for(ut=a(ut);!Mt.done;ct++,Mt=O.next())Mt=z(ut,T,ct,Mt.value,H),Mt!==null&&(t&&Mt.alternate!==null&&ut.delete(Mt.key===null?ct:Mt.key),R=r(Mt,R,ct),_t===null?nt=Mt:_t.sibling=Mt,_t=Mt);return t&&ut.forEach(function(h0){return e(T,h0)}),At&&Ea(T,ct),nt}function Ut(T,R,O,H){if(typeof O=="object"&&O!==null&&O.type===M&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case b:t:{for(var nt=O.key;R!==null;){if(R.key===nt){if(nt=O.type,nt===M){if(R.tag===7){n(T,R.sibling),H=i(R,O.props.children),H.return=T,T=H;break t}}else if(R.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===q&&Qd(nt)===R.type){n(T,R.sibling),H=i(R,O.props),Ti(H,O),H.return=T,T=H;break t}n(T,R);break}else e(T,R);R=R.sibling}O.type===M?(H=ba(O.props.children,T.mode,H,O.key),H.return=T,T=H):(H=_u(O.type,O.key,O.props,null,T.mode,H),Ti(H,O),H.return=T,T=H)}return f(T);case x:t:{for(nt=O.key;R!==null;){if(R.key===nt)if(R.tag===4&&R.stateNode.containerInfo===O.containerInfo&&R.stateNode.implementation===O.implementation){n(T,R.sibling),H=i(R,O.children||[]),H.return=T,T=H;break t}else{n(T,R);break}else e(T,R);R=R.sibling}H=mr(O,T.mode,H),H.return=T,T=H}return f(T);case q:return nt=O._init,O=nt(O._payload),Ut(T,R,O,H)}if(ht(O))return ft(T,R,O,H);if(et(O)){if(nt=et(O),typeof nt!="function")throw Error(c(150));return O=nt.call(O),rt(T,R,O,H)}if(typeof O.then=="function")return Ut(T,R,Bu(O),H);if(O.$$typeof===K)return Ut(T,R,Mu(T,O),H);qu(T,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,R!==null&&R.tag===6?(n(T,R.sibling),H=i(R,O),H.return=T,T=H):(n(T,R),H=vr(O,T.mode,H),H.return=T,T=H),f(T)):n(T,R)}return function(T,R,O,H){try{Ri=0;var nt=Ut(T,R,O,H);return yl=null,nt}catch(ut){if(ut===yi||ut===Au)throw ut;var _t=xe(29,ut,null,T.mode);return _t.lanes=H,_t.return=T,_t}finally{}}}var vl=Gd(!0),Vd=Gd(!1),Ve=N(null),un=null;function Yn(t){var e=t.alternate;J(Pt,Pt.current&1),J(Ve,t),un===null&&(e===null||ol.current!==null||e.memoizedState!==null)&&(un=t)}function Yd(t){if(t.tag===22){if(J(Pt,Pt.current),J(Ve,t),un===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(un=t)}}else Kn()}function Kn(){J(Pt,Pt.current),J(Ve,Ve.current)}function Tn(t){F(Ve),un===t&&(un=null),F(Pt)}var Pt=N(0);function Qu(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||Bc(n)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function kr(t,e,n,a){e=t.memoizedState,n=n(a,e),n=n==null?e:g({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var $r={enqueueSetState:function(t,e,n){t=t._reactInternals;var a=we(),i=Qn(a);i.payload=e,n!=null&&(i.callback=n),e=Gn(t,i,a),e!==null&&(Ue(e,t,a),mi(e,t,a))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var a=we(),i=Qn(a);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=Gn(t,i,a),e!==null&&(Ue(e,t,a),mi(e,t,a))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=we(),a=Qn(n);a.tag=2,e!=null&&(a.callback=e),e=Gn(t,a,n),e!==null&&(Ue(e,t,n),mi(e,t,n))}};function Kd(t,e,n,a,i,r,f){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(a,r,f):e.prototype&&e.prototype.isPureReactComponent?!ui(n,a)||!ui(i,r):!0}function Xd(t,e,n,a){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,a),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,a),e.state!==t&&$r.enqueueReplaceState(e,e.state,null)}function Da(t,e){var n=e;if("ref"in e){n={};for(var a in e)a!=="ref"&&(n[a]=e[a])}if(t=t.defaultProps){n===e&&(n=g({},n));for(var i in t)n[i]===void 0&&(n[i]=t[i])}return n}var Gu=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function Zd(t){Gu(t)}function Jd(t){console.error(t)}function Fd(t){Gu(t)}function Vu(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(a){setTimeout(function(){throw a})}}function kd(t,e,n){try{var a=t.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Pr(t,e,n){return n=Qn(n),n.tag=3,n.payload={element:null},n.callback=function(){Vu(t,e)},n}function $d(t){return t=Qn(t),t.tag=3,t}function Pd(t,e,n,a){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=a.value;t.payload=function(){return i(r)},t.callback=function(){kd(e,n,a)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(t.callback=function(){kd(e,n,a),typeof i!="function"&&($n===null?$n=new Set([this]):$n.add(this));var m=a.stack;this.componentDidCatch(a.value,{componentStack:m!==null?m:""})})}function hp(t,e,n,a,i){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(e=n.alternate,e!==null&&fi(e,n,i,!0),n=Ve.current,n!==null){switch(n.tag){case 13:return un===null?_c():n.alternate===null&&Vt===0&&(Vt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,a===Or?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([a]):e.add(a),Rc(t,a,i)),!1;case 22:return n.flags|=65536,a===Or?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([a]):n.add(a)),Rc(t,a,i)),!1}throw Error(c(435,n.tag))}return Rc(t,a,i),_c(),!1}if(At)return e=Ve.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=i,a!==Sr&&(t=Error(c(422),{cause:a}),oi(Be(t,n)))):(a!==Sr&&(e=Error(c(423),{cause:a}),oi(Be(e,n))),t=t.current.alternate,t.flags|=65536,i&=-i,t.lanes|=i,a=Be(a,n),i=Pr(t.stateNode,a,i),Dr(t,i),Vt!==4&&(Vt=2)),!1;var r=Error(c(520),{cause:a});if(r=Be(r,n),zi===null?zi=[r]:zi.push(r),Vt!==4&&(Vt=2),e===null)return!0;a=Be(a,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=i&-i,n.lanes|=t,t=Pr(n.stateNode,a,t),Dr(n,t),!1;case 1:if(e=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&($n===null||!$n.has(r))))return n.flags|=65536,i&=-i,n.lanes|=i,i=$d(i),Pd(i,t,n,a),Dr(n,i),!1}n=n.return}while(n!==null);return!1}var Wd=Error(c(461)),te=!1;function le(t,e,n,a){e.child=t===null?Vd(e,null,n,a):vl(e,t.child,n,a)}function Id(t,e,n,a,i){n=n.render;var r=e.ref;if("ref"in a){var f={};for(var m in a)m!=="ref"&&(f[m]=a[m])}else f=a;return Oa(e),a=Nr(t,e,n,f,r,i),m=Lr(),t!==null&&!te?(jr(t,e,i),Mn(t,e,i)):(At&&m&&pr(e),e.flags|=1,le(t,e,a,i),e.child)}function th(t,e,n,a,i){if(t===null){var r=n.type;return typeof r=="function"&&!yr(r)&&r.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=r,eh(t,e,r,a,i)):(t=_u(n.type,null,a,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(r=t.child,!ic(t,i)){var f=r.memoizedProps;if(n=n.compare,n=n!==null?n:ui,n(f,a)&&t.ref===e.ref)return Mn(t,e,i)}return e.flags|=1,t=gn(r,a),t.ref=e.ref,t.return=e,e.child=t}function eh(t,e,n,a,i){if(t!==null){var r=t.memoizedProps;if(ui(r,a)&&t.ref===e.ref)if(te=!1,e.pendingProps=a=r,ic(t,i))(t.flags&131072)!==0&&(te=!0);else return e.lanes=t.lanes,Mn(t,e,i)}return Wr(t,e,n,a,i)}function nh(t,e,n){var a=e.pendingProps,i=a.children,r=t!==null?t.memoizedState:null;if(a.mode==="hidden"){if((e.flags&128)!==0){if(a=r!==null?r.baseLanes|n:n,t!==null){for(i=e.child=t.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;e.childLanes=r&~a}else e.childLanes=0,e.child=null;return ah(t,e,a,n)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ou(e,r!==null?r.cachePool:null),r!==null?ed(e,r):zr(),Yd(e);else return e.lanes=e.childLanes=536870912,ah(t,e,r!==null?r.baseLanes|n:n,n)}else r!==null?(Ou(e,r.cachePool),ed(e,r),Kn(),e.memoizedState=null):(t!==null&&Ou(e,null),zr(),Kn());return le(t,e,i,n),e.child}function ah(t,e,n,a){var i=Mr();return i=i===null?null:{parent:$t._currentValue,pool:i},e.memoizedState={baseLanes:n,cachePool:i},t!==null&&Ou(e,null),zr(),Yd(e),t!==null&&fi(t,e,a,!0),null}function Yu(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Wr(t,e,n,a,i){return Oa(e),n=Nr(t,e,n,a,void 0,i),a=Lr(),t!==null&&!te?(jr(t,e,i),Mn(t,e,i)):(At&&a&&pr(e),e.flags|=1,le(t,e,n,i),e.child)}function lh(t,e,n,a,i,r){return Oa(e),e.updateQueue=null,n=ad(e,a,n,i),nd(t),a=Lr(),t!==null&&!te?(jr(t,e,r),Mn(t,e,r)):(At&&a&&pr(e),e.flags|=1,le(t,e,n,r),e.child)}function ih(t,e,n,a,i){if(Oa(e),e.stateNode===null){var r=il,f=n.contextType;typeof f=="object"&&f!==null&&(r=re(f)),r=new n(a,r),e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=$r,e.stateNode=r,r._reactInternals=e,r=e.stateNode,r.props=a,r.state=e.memoizedState,r.refs={},Ar(e),f=n.contextType,r.context=typeof f=="object"&&f!==null?re(f):il,r.state=e.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(kr(e,n,f,a),r.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(f=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),f!==r.state&&$r.enqueueReplaceState(r,r.state,null),gi(e,a,r,i),pi(),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308),a=!0}else if(t===null){r=e.stateNode;var m=e.memoizedProps,_=Da(n,m);r.props=_;var A=r.context,L=n.contextType;f=il,typeof L=="object"&&L!==null&&(f=re(L));var Q=n.getDerivedStateFromProps;L=typeof Q=="function"||typeof r.getSnapshotBeforeUpdate=="function",m=e.pendingProps!==m,L||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(m||A!==f)&&Xd(e,r,a,f),qn=!1;var D=e.memoizedState;r.state=D,gi(e,a,r,i),pi(),A=e.memoizedState,m||D!==A||qn?(typeof Q=="function"&&(kr(e,n,Q,a),A=e.memoizedState),(_=qn||Kd(e,n,_,a,D,A,f))?(L||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(e.flags|=4194308)):(typeof r.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=a,e.memoizedState=A),r.props=a,r.state=A,r.context=f,a=_):(typeof r.componentDidMount=="function"&&(e.flags|=4194308),a=!1)}else{r=e.stateNode,xr(t,e),f=e.memoizedProps,L=Da(n,f),r.props=L,Q=e.pendingProps,D=r.context,A=n.contextType,_=il,typeof A=="object"&&A!==null&&(_=re(A)),m=n.getDerivedStateFromProps,(A=typeof m=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f!==Q||D!==_)&&Xd(e,r,a,_),qn=!1,D=e.memoizedState,r.state=D,gi(e,a,r,i),pi();var z=e.memoizedState;f!==Q||D!==z||qn||t!==null&&t.dependencies!==null&&Tu(t.dependencies)?(typeof m=="function"&&(kr(e,n,m,a),z=e.memoizedState),(L=qn||Kd(e,n,L,a,D,z,_)||t!==null&&t.dependencies!==null&&Tu(t.dependencies))?(A||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,z,_),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,z,_)),typeof r.componentDidUpdate=="function"&&(e.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof r.componentDidUpdate!="function"||f===t.memoizedProps&&D===t.memoizedState||(e.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===t.memoizedProps&&D===t.memoizedState||(e.flags|=1024),e.memoizedProps=a,e.memoizedState=z),r.props=a,r.state=z,r.context=_,a=L):(typeof r.componentDidUpdate!="function"||f===t.memoizedProps&&D===t.memoizedState||(e.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===t.memoizedProps&&D===t.memoizedState||(e.flags|=1024),a=!1)}return r=a,Yu(t,e),a=(e.flags&128)!==0,r||a?(r=e.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:r.render(),e.flags|=1,t!==null&&a?(e.child=vl(e,t.child,null,i),e.child=vl(e,null,n,i)):le(t,e,n,i),e.memoizedState=r.state,t=e.child):t=Mn(t,e,i),t}function uh(t,e,n,a){return ci(),e.flags|=256,le(t,e,n,a),e.child}var Ir={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tc(t){return{baseLanes:t,cachePool:Jf()}}function ec(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Ye),t}function sh(t,e,n){var a=e.pendingProps,i=!1,r=(e.flags&128)!==0,f;if((f=r)||(f=t!==null&&t.memoizedState===null?!1:(Pt.current&2)!==0),f&&(i=!0,e.flags&=-129),f=(e.flags&32)!==0,e.flags&=-33,t===null){if(At){if(i?Yn(e):Kn(),At){var m=Gt,_;if(_=m){t:{for(_=m,m=ln;_.nodeType!==8;){if(!m){m=null;break t}if(_=Ie(_.nextSibling),_===null){m=null;break t}}m=_}m!==null?(e.memoizedState={dehydrated:m,treeContext:_a!==null?{id:Sn,overflow:bn}:null,retryLane:536870912,hydrationErrors:null},_=xe(18,null,null,0),_.stateNode=m,_.return=e,e.child=_,de=e,Gt=null,_=!0):_=!1}_||Ta(e)}if(m=e.memoizedState,m!==null&&(m=m.dehydrated,m!==null))return Bc(m)?e.lanes=32:e.lanes=536870912,null;Tn(e)}return m=a.children,a=a.fallback,i?(Kn(),i=e.mode,m=Ku({mode:"hidden",children:m},i),a=ba(a,i,n,null),m.return=e,a.return=e,m.sibling=a,e.child=m,i=e.child,i.memoizedState=tc(n),i.childLanes=ec(t,f,n),e.memoizedState=Ir,a):(Yn(e),nc(e,m))}if(_=t.memoizedState,_!==null&&(m=_.dehydrated,m!==null)){if(r)e.flags&256?(Yn(e),e.flags&=-257,e=ac(t,e,n)):e.memoizedState!==null?(Kn(),e.child=t.child,e.flags|=128,e=null):(Kn(),i=a.fallback,m=e.mode,a=Ku({mode:"visible",children:a.children},m),i=ba(i,m,n,null),i.flags|=2,a.return=e,i.return=e,a.sibling=i,e.child=a,vl(e,t.child,null,n),a=e.child,a.memoizedState=tc(n),a.childLanes=ec(t,f,n),e.memoizedState=Ir,e=i);else if(Yn(e),Bc(m)){if(f=m.nextSibling&&m.nextSibling.dataset,f)var A=f.dgst;f=A,a=Error(c(419)),a.stack="",a.digest=f,oi({value:a,source:null,stack:null}),e=ac(t,e,n)}else if(te||fi(t,e,n,!1),f=(n&t.childLanes)!==0,te||f){if(f=jt,f!==null&&(a=n&-n,a=(a&42)!==0?1:qs(a),a=(a&(f.suspendedLanes|n))!==0?0:a,a!==0&&a!==_.retryLane))throw _.retryLane=a,ll(t,a),Ue(f,t,a),Wd;m.data==="$?"||_c(),e=ac(t,e,n)}else m.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=_.treeContext,Gt=Ie(m.nextSibling),de=e,At=!0,Ra=null,ln=!1,t!==null&&(Qe[Ge++]=Sn,Qe[Ge++]=bn,Qe[Ge++]=_a,Sn=t.id,bn=t.overflow,_a=e),e=nc(e,a.children),e.flags|=4096);return e}return i?(Kn(),i=a.fallback,m=e.mode,_=t.child,A=_.sibling,a=gn(_,{mode:"hidden",children:a.children}),a.subtreeFlags=_.subtreeFlags&65011712,A!==null?i=gn(A,i):(i=ba(i,m,n,null),i.flags|=2),i.return=e,a.return=e,a.sibling=i,e.child=a,a=i,i=e.child,m=t.child.memoizedState,m===null?m=tc(n):(_=m.cachePool,_!==null?(A=$t._currentValue,_=_.parent!==A?{parent:A,pool:A}:_):_=Jf(),m={baseLanes:m.baseLanes|n,cachePool:_}),i.memoizedState=m,i.childLanes=ec(t,f,n),e.memoizedState=Ir,a):(Yn(e),n=t.child,t=n.sibling,n=gn(n,{mode:"visible",children:a.children}),n.return=e,n.sibling=null,t!==null&&(f=e.deletions,f===null?(e.deletions=[t],e.flags|=16):f.push(t)),e.child=n,e.memoizedState=null,n)}function nc(t,e){return e=Ku({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Ku(t,e){return t=xe(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function ac(t,e,n){return vl(e,t.child,null,n),t=nc(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function rh(t,e,n){t.lanes|=e;var a=t.alternate;a!==null&&(a.lanes|=e),_r(t.return,e,n)}function lc(t,e,n,a,i){var r=t.memoizedState;r===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:i}:(r.isBackwards=e,r.rendering=null,r.renderingStartTime=0,r.last=a,r.tail=n,r.tailMode=i)}function ch(t,e,n){var a=e.pendingProps,i=a.revealOrder,r=a.tail;if(le(t,e,a.children,n),a=Pt.current,(a&2)!==0)a=a&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&rh(t,n,e);else if(t.tag===19)rh(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}a&=1}switch(J(Pt,a),i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Qu(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),lc(e,!1,i,n,r);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Qu(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}lc(e,!0,n,null,r);break;case"together":lc(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Mn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),kn|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(fi(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(c(153));if(e.child!==null){for(t=e.child,n=gn(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=gn(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function ic(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Tu(t)))}function yp(t,e,n){switch(e.tag){case 3:it(e,e.stateNode.containerInfo),Bn(e,$t,t.memoizedState.cache),ci();break;case 27:case 5:Nt(e);break;case 4:it(e,e.stateNode.containerInfo);break;case 10:Bn(e,e.type,e.memoizedProps.value);break;case 13:var a=e.memoizedState;if(a!==null)return a.dehydrated!==null?(Yn(e),e.flags|=128,null):(n&e.child.childLanes)!==0?sh(t,e,n):(Yn(e),t=Mn(t,e,n),t!==null?t.sibling:null);Yn(e);break;case 19:var i=(t.flags&128)!==0;if(a=(n&e.childLanes)!==0,a||(fi(t,e,n,!1),a=(n&e.childLanes)!==0),i){if(a)return ch(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),J(Pt,Pt.current),a)break;return null;case 22:case 23:return e.lanes=0,nh(t,e,n);case 24:Bn(e,$t,t.memoizedState.cache)}return Mn(t,e,n)}function oh(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)te=!0;else{if(!ic(t,n)&&(e.flags&128)===0)return te=!1,yp(t,e,n);te=(t.flags&131072)!==0}else te=!1,At&&(e.flags&1048576)!==0&&Qf(e,Ru,e.index);switch(e.lanes=0,e.tag){case 16:t:{t=e.pendingProps;var a=e.elementType,i=a._init;if(a=i(a._payload),e.type=a,typeof a=="function")yr(a)?(t=Da(a,t),e.tag=1,e=ih(null,e,a,t,n)):(e.tag=0,e=Wr(null,e,a,t,n));else{if(a!=null){if(i=a.$$typeof,i===I){e.tag=11,e=Id(null,e,a,t,n);break t}else if(i===$){e.tag=14,e=th(null,e,a,t,n);break t}}throw e=pt(a)||a,Error(c(306,e,""))}}return e;case 0:return Wr(t,e,e.type,e.pendingProps,n);case 1:return a=e.type,i=Da(a,e.pendingProps),ih(t,e,a,i,n);case 3:t:{if(it(e,e.stateNode.containerInfo),t===null)throw Error(c(387));a=e.pendingProps;var r=e.memoizedState;i=r.element,xr(t,e),gi(e,a,null,n);var f=e.memoizedState;if(a=f.cache,Bn(e,$t,a),a!==r.cache&&Er(e,[$t],n,!0),pi(),a=f.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:f.cache},e.updateQueue.baseState=r,e.memoizedState=r,e.flags&256){e=uh(t,e,a,n);break t}else if(a!==i){i=Be(Error(c(424)),e),oi(i),e=uh(t,e,a,n);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Gt=Ie(t.firstChild),de=e,At=!0,Ra=null,ln=!0,n=Vd(e,null,a,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ci(),a===i){e=Mn(t,e,n);break t}le(t,e,a,n)}e=e.child}return e;case 26:return Yu(t,e),t===null?(n=yy(e.type,null,e.pendingProps,null))?e.memoizedState=n:At||(n=e.type,t=e.pendingProps,a=ls(tt.current).createElement(n),a[se]=e,a[pe]=t,ue(a,n,t),It(a),e.stateNode=a):e.memoizedState=yy(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Nt(e),t===null&&At&&(a=e.stateNode=fy(e.type,e.pendingProps,tt.current),de=e,ln=!0,i=Gt,In(e.type)?(qc=i,Gt=Ie(a.firstChild)):Gt=i),le(t,e,e.pendingProps.children,n),Yu(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&At&&((i=a=Gt)&&(a=Vp(a,e.type,e.pendingProps,ln),a!==null?(e.stateNode=a,de=e,Gt=Ie(a.firstChild),ln=!1,i=!0):i=!1),i||Ta(e)),Nt(e),i=e.type,r=e.pendingProps,f=t!==null?t.memoizedProps:null,a=r.children,Lc(i,r)?a=null:f!==null&&Lc(i,f)&&(e.flags|=32),e.memoizedState!==null&&(i=Nr(t,e,up,null,null,n),Qi._currentValue=i),Yu(t,e),le(t,e,a,n),e.child;case 6:return t===null&&At&&((t=n=Gt)&&(n=Yp(n,e.pendingProps,ln),n!==null?(e.stateNode=n,de=e,Gt=null,t=!0):t=!1),t||Ta(e)),null;case 13:return sh(t,e,n);case 4:return it(e,e.stateNode.containerInfo),a=e.pendingProps,t===null?e.child=vl(e,null,a,n):le(t,e,a,n),e.child;case 11:return Id(t,e,e.type,e.pendingProps,n);case 7:return le(t,e,e.pendingProps,n),e.child;case 8:return le(t,e,e.pendingProps.children,n),e.child;case 12:return le(t,e,e.pendingProps.children,n),e.child;case 10:return a=e.pendingProps,Bn(e,e.type,a.value),le(t,e,a.children,n),e.child;case 9:return i=e.type._context,a=e.pendingProps.children,Oa(e),i=re(i),a=a(i),e.flags|=1,le(t,e,a,n),e.child;case 14:return th(t,e,e.type,e.pendingProps,n);case 15:return eh(t,e,e.type,e.pendingProps,n);case 19:return ch(t,e,n);case 31:return a=e.pendingProps,n=e.mode,a={mode:a.mode,children:a.children},t===null?(n=Ku(a,n),n.ref=e.ref,e.child=n,n.return=e,e=n):(n=gn(t.child,a),n.ref=e.ref,e.child=n,n.return=e,e=n),e;case 22:return nh(t,e,n);case 24:return Oa(e),a=re($t),t===null?(i=Mr(),i===null&&(i=jt,r=Rr(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=n),i=r),e.memoizedState={parent:a,cache:i},Ar(e),Bn(e,$t,i)):((t.lanes&n)!==0&&(xr(t,e),gi(e,null,null,n),pi()),i=t.memoizedState,r=e.memoizedState,i.parent!==a?(i={parent:a,cache:a},e.memoizedState=i,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=i),Bn(e,$t,a)):(a=r.cache,Bn(e,$t,a),a!==i.cache&&Er(e,[$t],n,!0))),le(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(c(156,e.tag))}function On(t){t.flags|=4}function fh(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Sy(e)){if(e=Ve.current,e!==null&&((Tt&4194048)===Tt?un!==null:(Tt&62914560)!==Tt&&(Tt&536870912)===0||e!==un))throw vi=Or,Ff;t.flags|=8192}}function Xu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?Vo():536870912,t.lanes|=e,Sl|=e)}function Mi(t,e){if(!At)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:a.sibling=null}}function qt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,a=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags&65011712,a|=i.flags&65011712,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags,a|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=a,t.childLanes=n,e}function vp(t,e,n){var a=e.pendingProps;switch(gr(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(e),null;case 1:return qt(e),null;case 3:return n=e.stateNode,a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),En($t),bt(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(ri(e)?On(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Yf())),qt(e),null;case 26:return n=e.memoizedState,t===null?(On(e),n!==null?(qt(e),fh(e,n)):(qt(e),e.flags&=-16777217)):n?n!==t.memoizedState?(On(e),qt(e),fh(e,n)):(qt(e),e.flags&=-16777217):(t.memoizedProps!==a&&On(e),qt(e),e.flags&=-16777217),null;case 27:Qt(e),n=tt.current;var i=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==a&&On(e);else{if(!a){if(e.stateNode===null)throw Error(c(166));return qt(e),null}t=P.current,ri(e)?Gf(e):(t=fy(i,a,n),e.stateNode=t,On(e))}return qt(e),null;case 5:if(Qt(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==a&&On(e);else{if(!a){if(e.stateNode===null)throw Error(c(166));return qt(e),null}if(t=P.current,ri(e))Gf(e);else{switch(i=ls(tt.current),t){case 1:t=i.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:t=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":t=i.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":t=i.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":t=i.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?t.multiple=!0:a.size&&(t.size=a.size);break;default:t=typeof a.is=="string"?i.createElement(n,{is:a.is}):i.createElement(n)}}t[se]=e,t[pe]=a;t:for(i=e.child;i!==null;){if(i.tag===5||i.tag===6)t.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break t;for(;i.sibling===null;){if(i.return===null||i.return===e)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}e.stateNode=t;t:switch(ue(t,n,a),n){case"button":case"input":case"select":case"textarea":t=!!a.autoFocus;break t;case"img":t=!0;break t;default:t=!1}t&&On(e)}}return qt(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==a&&On(e);else{if(typeof a!="string"&&e.stateNode===null)throw Error(c(166));if(t=tt.current,ri(e)){if(t=e.stateNode,n=e.memoizedProps,a=null,i=de,i!==null)switch(i.tag){case 27:case 5:a=i.memoizedProps}t[se]=e,t=!!(t.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||ly(t.nodeValue,n)),t||Ta(e)}else t=ls(t).createTextNode(a),t[se]=e,e.stateNode=t}return qt(e),null;case 13:if(a=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(i=ri(e),a!==null&&a.dehydrated!==null){if(t===null){if(!i)throw Error(c(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));i[se]=e}else ci(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;qt(e),i=!1}else i=Yf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),i=!0;if(!i)return e.flags&256?(Tn(e),e):(Tn(e),null)}if(Tn(e),(e.flags&128)!==0)return e.lanes=n,e;if(n=a!==null,t=t!==null&&t.memoizedState!==null,n){a=e.child,i=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(i=a.alternate.memoizedState.cachePool.pool);var r=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==i&&(a.flags|=2048)}return n!==t&&n&&(e.child.flags|=8192),Xu(e,e.updateQueue),qt(e),null;case 4:return bt(),t===null&&Cc(e.stateNode.containerInfo),qt(e),null;case 10:return En(e.type),qt(e),null;case 19:if(F(Pt),i=e.memoizedState,i===null)return qt(e),null;if(a=(e.flags&128)!==0,r=i.rendering,r===null)if(a)Mi(i,!1);else{if(Vt!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(r=Qu(t),r!==null){for(e.flags|=128,Mi(i,!1),t=r.updateQueue,e.updateQueue=t,Xu(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)qf(n,t),n=n.sibling;return J(Pt,Pt.current&1|2),e.child}t=t.sibling}i.tail!==null&&Wt()>Fu&&(e.flags|=128,a=!0,Mi(i,!1),e.lanes=4194304)}else{if(!a)if(t=Qu(r),t!==null){if(e.flags|=128,a=!0,t=t.updateQueue,e.updateQueue=t,Xu(e,t),Mi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!r.alternate&&!At)return qt(e),null}else 2*Wt()-i.renderingStartTime>Fu&&n!==536870912&&(e.flags|=128,a=!0,Mi(i,!1),e.lanes=4194304);i.isBackwards?(r.sibling=e.child,e.child=r):(t=i.last,t!==null?t.sibling=r:e.child=r,i.last=r)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Wt(),e.sibling=null,t=Pt.current,J(Pt,a?t&1|2:t&1),e):(qt(e),null);case 22:case 23:return Tn(e),wr(),a=e.memoizedState!==null,t!==null?t.memoizedState!==null!==a&&(e.flags|=8192):a&&(e.flags|=8192),a?(n&536870912)!==0&&(e.flags&128)===0&&(qt(e),e.subtreeFlags&6&&(e.flags|=8192)):qt(e),n=e.updateQueue,n!==null&&Xu(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),a=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),a!==n&&(e.flags|=2048),t!==null&&F(Aa),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),En($t),qt(e),null;case 25:return null;case 30:return null}throw Error(c(156,e.tag))}function mp(t,e){switch(gr(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return En($t),bt(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Qt(e),null;case 13:if(Tn(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(c(340));ci()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return F(Pt),null;case 4:return bt(),null;case 10:return En(e.type),null;case 22:case 23:return Tn(e),wr(),t!==null&&F(Aa),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return En($t),null;case 25:return null;default:return null}}function dh(t,e){switch(gr(e),e.tag){case 3:En($t),bt();break;case 26:case 27:case 5:Qt(e);break;case 4:bt();break;case 13:Tn(e);break;case 19:F(Pt);break;case 10:En(e.type);break;case 22:case 23:Tn(e),wr(),t!==null&&F(Aa);break;case 24:En($t)}}function Oi(t,e){try{var n=e.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&t)===t){a=void 0;var r=n.create,f=n.inst;a=r(),f.destroy=a}n=n.next}while(n!==i)}}catch(m){Lt(e,e.return,m)}}function Xn(t,e,n){try{var a=e.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var r=i.next;a=r;do{if((a.tag&t)===t){var f=a.inst,m=f.destroy;if(m!==void 0){f.destroy=void 0,i=e;var _=n,A=m;try{A()}catch(L){Lt(i,_,L)}}}a=a.next}while(a!==r)}}catch(L){Lt(e,e.return,L)}}function hh(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{td(e,n)}catch(a){Lt(t,t.return,a)}}}function yh(t,e,n){n.props=Da(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(a){Lt(t,e,a)}}function Ai(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var a=t.stateNode;break;case 30:a=t.stateNode;break;default:a=t.stateNode}typeof n=="function"?t.refCleanup=n(a):n.current=a}}catch(i){Lt(t,e,i)}}function sn(t,e){var n=t.ref,a=t.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(i){Lt(t,e,i)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Lt(t,e,i)}else n.current=null}function vh(t){var e=t.type,n=t.memoizedProps,a=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break t;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(i){Lt(t,t.return,i)}}function uc(t,e,n){try{var a=t.stateNode;Hp(a,t.type,n,e),a[pe]=e}catch(i){Lt(t,t.return,i)}}function mh(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&In(t.type)||t.tag===4}function sc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||mh(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&In(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function rc(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=as));else if(a!==4&&(a===27&&In(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(rc(t,e,n),t=t.sibling;t!==null;)rc(t,e,n),t=t.sibling}function Zu(t,e,n){var a=t.tag;if(a===5||a===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(a!==4&&(a===27&&In(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Zu(t,e,n),t=t.sibling;t!==null;)Zu(t,e,n),t=t.sibling}function ph(t){var e=t.stateNode,n=t.memoizedProps;try{for(var a=t.type,i=e.attributes;i.length;)e.removeAttributeNode(i[0]);ue(e,a,n),e[se]=t,e[pe]=n}catch(r){Lt(t,t.return,r)}}var An=!1,Xt=!1,cc=!1,gh=typeof WeakSet=="function"?WeakSet:Set,ee=null;function pp(t,e){if(t=t.containerInfo,Uc=os,t=Df(t),sr(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var i=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break t}var f=0,m=-1,_=-1,A=0,L=0,Q=t,D=null;e:for(;;){for(var z;Q!==n||i!==0&&Q.nodeType!==3||(m=f+i),Q!==r||a!==0&&Q.nodeType!==3||(_=f+a),Q.nodeType===3&&(f+=Q.nodeValue.length),(z=Q.firstChild)!==null;)D=Q,Q=z;for(;;){if(Q===t)break e;if(D===n&&++A===i&&(m=f),D===r&&++L===a&&(_=f),(z=Q.nextSibling)!==null)break;Q=D,D=Q.parentNode}Q=z}n=m===-1||_===-1?null:{start:m,end:_}}else n=null}n=n||{start:0,end:0}}else n=null;for(Nc={focusedElem:t,selectionRange:n},os=!1,ee=e;ee!==null;)if(e=ee,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,ee=t;else for(;ee!==null;){switch(e=ee,r=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&r!==null){t=void 0,n=e,i=r.memoizedProps,r=r.memoizedState,a=n.stateNode;try{var ft=Da(n.type,i,n.elementType===n.type);t=a.getSnapshotBeforeUpdate(ft,r),a.__reactInternalSnapshotBeforeUpdate=t}catch(rt){Lt(n,n.return,rt)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Hc(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Hc(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(c(163))}if(t=e.sibling,t!==null){t.return=e.return,ee=t;break}ee=e.return}}function Sh(t,e,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Zn(t,n),a&4&&Oi(5,n);break;case 1:if(Zn(t,n),a&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(f){Lt(n,n.return,f)}else{var i=Da(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(i,e,t.__reactInternalSnapshotBeforeUpdate)}catch(f){Lt(n,n.return,f)}}a&64&&hh(n),a&512&&Ai(n,n.return);break;case 3:if(Zn(t,n),a&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{td(t,e)}catch(f){Lt(n,n.return,f)}}break;case 27:e===null&&a&4&&ph(n);case 26:case 5:Zn(t,n),e===null&&a&4&&vh(n),a&512&&Ai(n,n.return);break;case 12:Zn(t,n);break;case 13:Zn(t,n),a&4&&Eh(t,n),a&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=Op.bind(null,n),Kp(t,n))));break;case 22:if(a=n.memoizedState!==null||An,!a){e=e!==null&&e.memoizedState!==null||Xt,i=An;var r=Xt;An=a,(Xt=e)&&!r?Jn(t,n,(n.subtreeFlags&8772)!==0):Zn(t,n),An=i,Xt=r}break;case 30:break;default:Zn(t,n)}}function bh(t){var e=t.alternate;e!==null&&(t.alternate=null,bh(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Vs(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Ht=null,be=!1;function xn(t,e,n){for(n=n.child;n!==null;)_h(t,e,n),n=n.sibling}function _h(t,e,n){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(ya,n)}catch{}switch(n.tag){case 26:Xt||sn(n,e),xn(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xt||sn(n,e);var a=Ht,i=be;In(n.type)&&(Ht=n.stateNode,be=!1),xn(t,e,n),ji(n.stateNode),Ht=a,be=i;break;case 5:Xt||sn(n,e);case 6:if(a=Ht,i=be,Ht=null,xn(t,e,n),Ht=a,be=i,Ht!==null)if(be)try{(Ht.nodeType===9?Ht.body:Ht.nodeName==="HTML"?Ht.ownerDocument.body:Ht).removeChild(n.stateNode)}catch(r){Lt(n,e,r)}else try{Ht.removeChild(n.stateNode)}catch(r){Lt(n,e,r)}break;case 18:Ht!==null&&(be?(t=Ht,cy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Ki(t)):cy(Ht,n.stateNode));break;case 4:a=Ht,i=be,Ht=n.stateNode.containerInfo,be=!0,xn(t,e,n),Ht=a,be=i;break;case 0:case 11:case 14:case 15:Xt||Xn(2,n,e),Xt||Xn(4,n,e),xn(t,e,n);break;case 1:Xt||(sn(n,e),a=n.stateNode,typeof a.componentWillUnmount=="function"&&yh(n,e,a)),xn(t,e,n);break;case 21:xn(t,e,n);break;case 22:Xt=(a=Xt)||n.memoizedState!==null,xn(t,e,n),Xt=a;break;default:xn(t,e,n)}}function Eh(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ki(t)}catch(n){Lt(e,e.return,n)}}function gp(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new gh),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new gh),e;default:throw Error(c(435,t.tag))}}function oc(t,e){var n=gp(t);e.forEach(function(a){var i=Ap.bind(null,t,a);n.has(a)||(n.add(a),a.then(i,i))})}function De(t,e){var n=e.deletions;if(n!==null)for(var a=0;a<n.length;a++){var i=n[a],r=t,f=e,m=f;t:for(;m!==null;){switch(m.tag){case 27:if(In(m.type)){Ht=m.stateNode,be=!1;break t}break;case 5:Ht=m.stateNode,be=!1;break t;case 3:case 4:Ht=m.stateNode.containerInfo,be=!0;break t}m=m.return}if(Ht===null)throw Error(c(160));_h(r,f,i),Ht=null,be=!1,r=i.alternate,r!==null&&(r.return=null),i.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)Rh(e,t),e=e.sibling}var We=null;function Rh(t,e){var n=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:De(e,t),Ce(t),a&4&&(Xn(3,t,t.return),Oi(3,t),Xn(5,t,t.return));break;case 1:De(e,t),Ce(t),a&512&&(Xt||n===null||sn(n,n.return)),a&64&&An&&(t=t.updateQueue,t!==null&&(a=t.callbacks,a!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var i=We;if(De(e,t),Ce(t),a&512&&(Xt||n===null||sn(n,n.return)),a&4){var r=n!==null?n.memoizedState:null;if(a=t.memoizedState,n===null)if(a===null)if(t.stateNode===null){t:{a=t.type,n=t.memoizedProps,i=i.ownerDocument||i;e:switch(a){case"title":r=i.getElementsByTagName("title")[0],(!r||r[Pl]||r[se]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=i.createElement(a),i.head.insertBefore(r,i.querySelector("head > title"))),ue(r,a,n),r[se]=t,It(r),a=r;break t;case"link":var f=py("link","href",i).get(a+(n.href||""));if(f){for(var m=0;m<f.length;m++)if(r=f[m],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(m,1);break e}}r=i.createElement(a),ue(r,a,n),i.head.appendChild(r);break;case"meta":if(f=py("meta","content",i).get(a+(n.content||""))){for(m=0;m<f.length;m++)if(r=f[m],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){f.splice(m,1);break e}}r=i.createElement(a),ue(r,a,n),i.head.appendChild(r);break;default:throw Error(c(468,a))}r[se]=t,It(r),a=r}t.stateNode=a}else gy(i,t.type,t.stateNode);else t.stateNode=my(i,a,t.memoizedProps);else r!==a?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,a===null?gy(i,t.type,t.stateNode):my(i,a,t.memoizedProps)):a===null&&t.stateNode!==null&&uc(t,t.memoizedProps,n.memoizedProps)}break;case 27:De(e,t),Ce(t),a&512&&(Xt||n===null||sn(n,n.return)),n!==null&&a&4&&uc(t,t.memoizedProps,n.memoizedProps);break;case 5:if(De(e,t),Ce(t),a&512&&(Xt||n===null||sn(n,n.return)),t.flags&32){i=t.stateNode;try{Pa(i,"")}catch(z){Lt(t,t.return,z)}}a&4&&t.stateNode!=null&&(i=t.memoizedProps,uc(t,i,n!==null?n.memoizedProps:i)),a&1024&&(cc=!0);break;case 6:if(De(e,t),Ce(t),a&4){if(t.stateNode===null)throw Error(c(162));a=t.memoizedProps,n=t.stateNode;try{n.nodeValue=a}catch(z){Lt(t,t.return,z)}}break;case 3:if(ss=null,i=We,We=is(e.containerInfo),De(e,t),We=i,Ce(t),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Ki(e.containerInfo)}catch(z){Lt(t,t.return,z)}cc&&(cc=!1,Th(t));break;case 4:a=We,We=is(t.stateNode.containerInfo),De(e,t),Ce(t),We=a;break;case 12:De(e,t),Ce(t);break;case 13:De(e,t),Ce(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(mc=Wt()),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,oc(t,a)));break;case 22:i=t.memoizedState!==null;var _=n!==null&&n.memoizedState!==null,A=An,L=Xt;if(An=A||i,Xt=L||_,De(e,t),Xt=L,An=A,Ce(t),a&8192)t:for(e=t.stateNode,e._visibility=i?e._visibility&-2:e._visibility|1,i&&(n===null||_||An||Xt||Ca(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){_=n=e;try{if(r=_.stateNode,i)f=r.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{m=_.stateNode;var Q=_.memoizedProps.style,D=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;m.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(z){Lt(_,_.return,z)}}}else if(e.tag===6){if(n===null){_=e;try{_.stateNode.nodeValue=i?"":_.memoizedProps}catch(z){Lt(_,_.return,z)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}a&4&&(a=t.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,oc(t,n))));break;case 19:De(e,t),Ce(t),a&4&&(a=t.updateQueue,a!==null&&(t.updateQueue=null,oc(t,a)));break;case 30:break;case 21:break;default:De(e,t),Ce(t)}}function Ce(t){var e=t.flags;if(e&2){try{for(var n,a=t.return;a!==null;){if(mh(a)){n=a;break}a=a.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var i=n.stateNode,r=sc(t);Zu(t,r,i);break;case 5:var f=n.stateNode;n.flags&32&&(Pa(f,""),n.flags&=-33);var m=sc(t);Zu(t,m,f);break;case 3:case 4:var _=n.stateNode.containerInfo,A=sc(t);rc(t,A,_);break;default:throw Error(c(161))}}catch(L){Lt(t,t.return,L)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Th(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;Th(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Zn(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Sh(t,e.alternate,e),e=e.sibling}function Ca(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Xn(4,e,e.return),Ca(e);break;case 1:sn(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&yh(e,e.return,n),Ca(e);break;case 27:ji(e.stateNode);case 26:case 5:sn(e,e.return),Ca(e);break;case 22:e.memoizedState===null&&Ca(e);break;case 30:Ca(e);break;default:Ca(e)}t=t.sibling}}function Jn(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var a=e.alternate,i=t,r=e,f=r.flags;switch(r.tag){case 0:case 11:case 15:Jn(i,r,n),Oi(4,r);break;case 1:if(Jn(i,r,n),a=r,i=a.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(A){Lt(a,a.return,A)}if(a=r,i=a.updateQueue,i!==null){var m=a.stateNode;try{var _=i.shared.hiddenCallbacks;if(_!==null)for(i.shared.hiddenCallbacks=null,i=0;i<_.length;i++)If(_[i],m)}catch(A){Lt(a,a.return,A)}}n&&f&64&&hh(r),Ai(r,r.return);break;case 27:ph(r);case 26:case 5:Jn(i,r,n),n&&a===null&&f&4&&vh(r),Ai(r,r.return);break;case 12:Jn(i,r,n);break;case 13:Jn(i,r,n),n&&f&4&&Eh(i,r);break;case 22:r.memoizedState===null&&Jn(i,r,n),Ai(r,r.return);break;case 30:break;default:Jn(i,r,n)}e=e.sibling}}function fc(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&di(n))}function dc(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&di(t))}function rn(t,e,n,a){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Mh(t,e,n,a),e=e.sibling}function Mh(t,e,n,a){var i=e.flags;switch(e.tag){case 0:case 11:case 15:rn(t,e,n,a),i&2048&&Oi(9,e);break;case 1:rn(t,e,n,a);break;case 3:rn(t,e,n,a),i&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&di(t)));break;case 12:if(i&2048){rn(t,e,n,a),t=e.stateNode;try{var r=e.memoizedProps,f=r.id,m=r.onPostCommit;typeof m=="function"&&m(f,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(_){Lt(e,e.return,_)}}else rn(t,e,n,a);break;case 13:rn(t,e,n,a);break;case 23:break;case 22:r=e.stateNode,f=e.alternate,e.memoizedState!==null?r._visibility&2?rn(t,e,n,a):xi(t,e):r._visibility&2?rn(t,e,n,a):(r._visibility|=2,ml(t,e,n,a,(e.subtreeFlags&10256)!==0)),i&2048&&fc(f,e);break;case 24:rn(t,e,n,a),i&2048&&dc(e.alternate,e);break;default:rn(t,e,n,a)}}function ml(t,e,n,a,i){for(i=i&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var r=t,f=e,m=n,_=a,A=f.flags;switch(f.tag){case 0:case 11:case 15:ml(r,f,m,_,i),Oi(8,f);break;case 23:break;case 22:var L=f.stateNode;f.memoizedState!==null?L._visibility&2?ml(r,f,m,_,i):xi(r,f):(L._visibility|=2,ml(r,f,m,_,i)),i&&A&2048&&fc(f.alternate,f);break;case 24:ml(r,f,m,_,i),i&&A&2048&&dc(f.alternate,f);break;default:ml(r,f,m,_,i)}e=e.sibling}}function xi(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,a=e,i=a.flags;switch(a.tag){case 22:xi(n,a),i&2048&&fc(a.alternate,a);break;case 24:xi(n,a),i&2048&&dc(a.alternate,a);break;default:xi(n,a)}e=e.sibling}}var Di=8192;function pl(t){if(t.subtreeFlags&Di)for(t=t.child;t!==null;)Oh(t),t=t.sibling}function Oh(t){switch(t.tag){case 26:pl(t),t.flags&Di&&t.memoizedState!==null&&a0(We,t.memoizedState,t.memoizedProps);break;case 5:pl(t);break;case 3:case 4:var e=We;We=is(t.stateNode.containerInfo),pl(t),We=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=Di,Di=16777216,pl(t),Di=e):pl(t));break;default:pl(t)}}function Ah(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Ci(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var a=e[n];ee=a,Dh(a,t)}Ah(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xh(t),t=t.sibling}function xh(t){switch(t.tag){case 0:case 11:case 15:Ci(t),t.flags&2048&&Xn(9,t,t.return);break;case 3:Ci(t);break;case 12:Ci(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,Ju(t)):Ci(t);break;default:Ci(t)}}function Ju(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var a=e[n];ee=a,Dh(a,t)}Ah(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Xn(8,e,e.return),Ju(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,Ju(e));break;default:Ju(e)}t=t.sibling}}function Dh(t,e){for(;ee!==null;){var n=ee;switch(n.tag){case 0:case 11:case 15:Xn(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:di(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,ee=a;else t:for(n=t;ee!==null;){a=ee;var i=a.sibling,r=a.return;if(bh(a),a===n){ee=null;break t}if(i!==null){i.return=r,ee=i;break t}ee=r}}}var Sp={getCacheForType:function(t){var e=re($t),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n}},bp=typeof WeakMap=="function"?WeakMap:Map,Dt=0,jt=null,Et=null,Tt=0,Ct=0,ze=null,Fn=!1,gl=!1,hc=!1,Dn=0,Vt=0,kn=0,za=0,yc=0,Ye=0,Sl=0,zi=null,_e=null,vc=!1,mc=0,Fu=1/0,ku=null,$n=null,ie=0,Pn=null,bl=null,_l=0,pc=0,gc=null,Ch=null,wi=0,Sc=null;function we(){if((Dt&2)!==0&&Tt!==0)return Tt&-Tt;if(C.T!==null){var t=rl;return t!==0?t:Oc()}return Xo()}function zh(){Ye===0&&(Ye=(Tt&536870912)===0||At?Go():536870912);var t=Ve.current;return t!==null&&(t.flags|=32),Ye}function Ue(t,e,n){(t===jt&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)&&(El(t,0),Wn(t,Tt,Ye,!1)),$l(t,n),((Dt&2)===0||t!==jt)&&(t===jt&&((Dt&2)===0&&(za|=n),Vt===4&&Wn(t,Tt,Ye,!1)),cn(t))}function wh(t,e,n){if((Dt&6)!==0)throw Error(c(327));var a=!n&&(e&124)===0&&(e&t.expiredLanes)===0||kl(t,e),i=a?Rp(t,e):Ec(t,e,!0),r=a;do{if(i===0){gl&&!a&&Wn(t,e,0,!1);break}else{if(n=t.current.alternate,r&&!_p(n)){i=Ec(t,e,!1),r=!1;continue}if(i===2){if(r=e,t.errorRecoveryDisabledLanes&r)var f=0;else f=t.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){e=f;t:{var m=t;i=zi;var _=m.current.memoizedState.isDehydrated;if(_&&(El(m,f).flags|=256),f=Ec(m,f,!1),f!==2){if(hc&&!_){m.errorRecoveryDisabledLanes|=r,za|=r,i=4;break t}r=_e,_e=i,r!==null&&(_e===null?_e=r:_e.push.apply(_e,r))}i=f}if(r=!1,i!==2)continue}}if(i===1){El(t,0),Wn(t,e,0,!0);break}t:{switch(a=t,r=i,r){case 0:case 1:throw Error(c(345));case 4:if((e&4194048)!==e)break;case 6:Wn(a,e,Ye,!Fn);break t;case 2:_e=null;break;case 3:case 5:break;default:throw Error(c(329))}if((e&62914560)===e&&(i=mc+300-Wt(),10<i)){if(Wn(a,e,Ye,!Fn),uu(a,0,!0)!==0)break t;a.timeoutHandle=sy(Uh.bind(null,a,n,_e,ku,vc,e,Ye,za,Sl,Fn,r,2,-0,0),i);break t}Uh(a,n,_e,ku,vc,e,Ye,za,Sl,Fn,r,0,-0,0)}}break}while(!0);cn(t)}function Uh(t,e,n,a,i,r,f,m,_,A,L,Q,D,z){if(t.timeoutHandle=-1,Q=e.subtreeFlags,(Q&8192||(Q&16785408)===16785408)&&(qi={stylesheets:null,count:0,unsuspend:n0},Oh(e),Q=l0(),Q!==null)){t.cancelPendingCommit=Q(Qh.bind(null,t,e,r,n,a,i,f,m,_,L,1,D,z)),Wn(t,r,f,!A);return}Qh(t,e,r,n,a,i,f,m,_)}function _p(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var i=n[a],r=i.getSnapshot;i=i.value;try{if(!Ae(r(),i))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Wn(t,e,n,a){e&=~yc,e&=~za,t.suspendedLanes|=e,t.pingedLanes&=~e,a&&(t.warmLanes|=e),a=t.expirationTimes;for(var i=e;0<i;){var r=31-Oe(i),f=1<<r;a[r]=-1,i&=~f}n!==0&&Yo(t,n,e)}function $u(){return(Dt&6)===0?(Ui(0),!1):!0}function bc(){if(Et!==null){if(Ct===0)var t=Et.return;else t=Et,_n=Ma=null,Hr(t),yl=null,Ri=0,t=Et;for(;t!==null;)dh(t.alternate,t),t=t.return;Et=null}}function El(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,qp(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),bc(),jt=t,Et=n=gn(t.current,null),Tt=e,Ct=0,ze=null,Fn=!1,gl=kl(t,e),hc=!1,Sl=Ye=yc=za=kn=Vt=0,_e=zi=null,vc=!1,(e&8)!==0&&(e|=e&32);var a=t.entangledLanes;if(a!==0)for(t=t.entanglements,a&=e;0<a;){var i=31-Oe(a),r=1<<i;e|=t[i],a&=~r}return Dn=e,gu(),n}function Nh(t,e){mt=null,C.H=Hu,e===yi||e===Au?(e=Pf(),Ct=3):e===Ff?(e=Pf(),Ct=4):Ct=e===Wd?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,ze=e,Et===null&&(Vt=1,Vu(t,Be(e,t.current)))}function Lh(){var t=C.H;return C.H=Hu,t===null?Hu:t}function jh(){var t=C.A;return C.A=Sp,t}function _c(){Vt=4,Fn||(Tt&4194048)!==Tt&&Ve.current!==null||(gl=!0),(kn&134217727)===0&&(za&134217727)===0||jt===null||Wn(jt,Tt,Ye,!1)}function Ec(t,e,n){var a=Dt;Dt|=2;var i=Lh(),r=jh();(jt!==t||Tt!==e)&&(ku=null,El(t,e)),e=!1;var f=Vt;t:do try{if(Ct!==0&&Et!==null){var m=Et,_=ze;switch(Ct){case 8:bc(),f=6;break t;case 3:case 2:case 9:case 6:Ve.current===null&&(e=!0);var A=Ct;if(Ct=0,ze=null,Rl(t,m,_,A),n&&gl){f=0;break t}break;default:A=Ct,Ct=0,ze=null,Rl(t,m,_,A)}}Ep(),f=Vt;break}catch(L){Nh(t,L)}while(!0);return e&&t.shellSuspendCounter++,_n=Ma=null,Dt=a,C.H=i,C.A=r,Et===null&&(jt=null,Tt=0,gu()),f}function Ep(){for(;Et!==null;)Hh(Et)}function Rp(t,e){var n=Dt;Dt|=2;var a=Lh(),i=jh();jt!==t||Tt!==e?(ku=null,Fu=Wt()+500,El(t,e)):gl=kl(t,e);t:do try{if(Ct!==0&&Et!==null){e=Et;var r=ze;e:switch(Ct){case 1:Ct=0,ze=null,Rl(t,e,r,1);break;case 2:case 9:if(kf(r)){Ct=0,ze=null,Bh(e);break}e=function(){Ct!==2&&Ct!==9||jt!==t||(Ct=7),cn(t)},r.then(e,e);break t;case 3:Ct=7;break t;case 4:Ct=5;break t;case 7:kf(r)?(Ct=0,ze=null,Bh(e)):(Ct=0,ze=null,Rl(t,e,r,7));break;case 5:var f=null;switch(Et.tag){case 26:f=Et.memoizedState;case 5:case 27:var m=Et;if(!f||Sy(f)){Ct=0,ze=null;var _=m.sibling;if(_!==null)Et=_;else{var A=m.return;A!==null?(Et=A,Pu(A)):Et=null}break e}}Ct=0,ze=null,Rl(t,e,r,5);break;case 6:Ct=0,ze=null,Rl(t,e,r,6);break;case 8:bc(),Vt=6;break t;default:throw Error(c(462))}}Tp();break}catch(L){Nh(t,L)}while(!0);return _n=Ma=null,C.H=a,C.A=i,Dt=n,Et!==null?0:(jt=null,Tt=0,gu(),Vt)}function Tp(){for(;Et!==null&&!Nn();)Hh(Et)}function Hh(t){var e=oh(t.alternate,t,Dn);t.memoizedProps=t.pendingProps,e===null?Pu(t):Et=e}function Bh(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=lh(n,e,e.pendingProps,e.type,void 0,Tt);break;case 11:e=lh(n,e,e.pendingProps,e.type.render,e.ref,Tt);break;case 5:Hr(e);default:dh(n,e),e=Et=qf(e,Dn),e=oh(n,e,Dn)}t.memoizedProps=t.pendingProps,e===null?Pu(t):Et=e}function Rl(t,e,n,a){_n=Ma=null,Hr(e),yl=null,Ri=0;var i=e.return;try{if(hp(t,i,e,n,Tt)){Vt=1,Vu(t,Be(n,t.current)),Et=null;return}}catch(r){if(i!==null)throw Et=i,r;Vt=1,Vu(t,Be(n,t.current)),Et=null;return}e.flags&32768?(At||a===1?t=!0:gl||(Tt&536870912)!==0?t=!1:(Fn=t=!0,(a===2||a===9||a===3||a===6)&&(a=Ve.current,a!==null&&a.tag===13&&(a.flags|=16384))),qh(e,t)):Pu(e)}function Pu(t){var e=t;do{if((e.flags&32768)!==0){qh(e,Fn);return}t=e.return;var n=vp(e.alternate,e,Dn);if(n!==null){Et=n;return}if(e=e.sibling,e!==null){Et=e;return}Et=e=t}while(e!==null);Vt===0&&(Vt=5)}function qh(t,e){do{var n=mp(t.alternate,t);if(n!==null){n.flags&=32767,Et=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){Et=t;return}Et=t=n}while(t!==null);Vt=6,Et=null}function Qh(t,e,n,a,i,r,f,m,_){t.cancelPendingCommit=null;do Wu();while(ie!==0);if((Dt&6)!==0)throw Error(c(327));if(e!==null){if(e===t.current)throw Error(c(177));if(r=e.lanes|e.childLanes,r|=dr,nm(t,n,r,f,m,_),t===jt&&(Et=jt=null,Tt=0),bl=e,Pn=t,_l=n,pc=r,gc=i,Ch=a,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,xp(xt,function(){return Xh(),null})):(t.callbackNode=null,t.callbackPriority=0),a=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||a){a=C.T,C.T=null,i=X.p,X.p=2,f=Dt,Dt|=4;try{pp(t,e,n)}finally{Dt=f,X.p=i,C.T=a}}ie=1,Gh(),Vh(),Yh()}}function Gh(){if(ie===1){ie=0;var t=Pn,e=bl,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=C.T,C.T=null;var a=X.p;X.p=2;var i=Dt;Dt|=4;try{Rh(e,t);var r=Nc,f=Df(t.containerInfo),m=r.focusedElem,_=r.selectionRange;if(f!==m&&m&&m.ownerDocument&&xf(m.ownerDocument.documentElement,m)){if(_!==null&&sr(m)){var A=_.start,L=_.end;if(L===void 0&&(L=A),"selectionStart"in m)m.selectionStart=A,m.selectionEnd=Math.min(L,m.value.length);else{var Q=m.ownerDocument||document,D=Q&&Q.defaultView||window;if(D.getSelection){var z=D.getSelection(),ft=m.textContent.length,rt=Math.min(_.start,ft),Ut=_.end===void 0?rt:Math.min(_.end,ft);!z.extend&&rt>Ut&&(f=Ut,Ut=rt,rt=f);var T=Af(m,rt),R=Af(m,Ut);if(T&&R&&(z.rangeCount!==1||z.anchorNode!==T.node||z.anchorOffset!==T.offset||z.focusNode!==R.node||z.focusOffset!==R.offset)){var O=Q.createRange();O.setStart(T.node,T.offset),z.removeAllRanges(),rt>Ut?(z.addRange(O),z.extend(R.node,R.offset)):(O.setEnd(R.node,R.offset),z.addRange(O))}}}}for(Q=[],z=m;z=z.parentNode;)z.nodeType===1&&Q.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<Q.length;m++){var H=Q[m];H.element.scrollLeft=H.left,H.element.scrollTop=H.top}}os=!!Uc,Nc=Uc=null}finally{Dt=i,X.p=a,C.T=n}}t.current=e,ie=2}}function Vh(){if(ie===2){ie=0;var t=Pn,e=bl,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=C.T,C.T=null;var a=X.p;X.p=2;var i=Dt;Dt|=4;try{Sh(t,e.alternate,e)}finally{Dt=i,X.p=a,C.T=n}}ie=3}}function Yh(){if(ie===4||ie===3){ie=0,Le();var t=Pn,e=bl,n=_l,a=Ch;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?ie=5:(ie=0,bl=Pn=null,Kh(t,t.pendingLanes));var i=t.pendingLanes;if(i===0&&($n=null),Qs(n),e=e.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(ya,e,void 0,(e.current.flags&128)===128)}catch{}if(a!==null){e=C.T,i=X.p,X.p=2,C.T=null;try{for(var r=t.onRecoverableError,f=0;f<a.length;f++){var m=a[f];r(m.value,{componentStack:m.stack})}}finally{C.T=e,X.p=i}}(_l&3)!==0&&Wu(),cn(t),i=t.pendingLanes,(n&4194090)!==0&&(i&42)!==0?t===Sc?wi++:(wi=0,Sc=t):wi=0,Ui(0)}}function Kh(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,di(e)))}function Wu(t){return Gh(),Vh(),Yh(),Xh()}function Xh(){if(ie!==5)return!1;var t=Pn,e=pc;pc=0;var n=Qs(_l),a=C.T,i=X.p;try{X.p=32>n?32:n,C.T=null,n=gc,gc=null;var r=Pn,f=_l;if(ie=0,bl=Pn=null,_l=0,(Dt&6)!==0)throw Error(c(331));var m=Dt;if(Dt|=4,xh(r.current),Mh(r,r.current,f,n),Dt=m,Ui(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(ya,r)}catch{}return!0}finally{X.p=i,C.T=a,Kh(t,e)}}function Zh(t,e,n){e=Be(n,e),e=Pr(t.stateNode,e,2),t=Gn(t,e,2),t!==null&&($l(t,2),cn(t))}function Lt(t,e,n){if(t.tag===3)Zh(t,t,n);else for(;e!==null;){if(e.tag===3){Zh(e,t,n);break}else if(e.tag===1){var a=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&($n===null||!$n.has(a))){t=Be(n,t),n=$d(2),a=Gn(e,n,2),a!==null&&(Pd(n,a,e,t),$l(a,2),cn(a));break}}e=e.return}}function Rc(t,e,n){var a=t.pingCache;if(a===null){a=t.pingCache=new bp;var i=new Set;a.set(e,i)}else i=a.get(e),i===void 0&&(i=new Set,a.set(e,i));i.has(n)||(hc=!0,i.add(n),t=Mp.bind(null,t,e,n),e.then(t,t))}function Mp(t,e,n){var a=t.pingCache;a!==null&&a.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,jt===t&&(Tt&n)===n&&(Vt===4||Vt===3&&(Tt&62914560)===Tt&&300>Wt()-mc?(Dt&2)===0&&El(t,0):yc|=n,Sl===Tt&&(Sl=0)),cn(t)}function Jh(t,e){e===0&&(e=Vo()),t=ll(t,e),t!==null&&($l(t,e),cn(t))}function Op(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Jh(t,n)}function Ap(t,e){var n=0;switch(t.tag){case 13:var a=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:a=t.stateNode;break;case 22:a=t.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(e),Jh(t,n)}function xp(t,e){return me(t,e)}var Iu=null,Tl=null,Tc=!1,ts=!1,Mc=!1,wa=0;function cn(t){t!==Tl&&t.next===null&&(Tl===null?Iu=Tl=t:Tl=Tl.next=t),ts=!0,Tc||(Tc=!0,Cp())}function Ui(t,e){if(!Mc&&ts){Mc=!0;do for(var n=!1,a=Iu;a!==null;){if(t!==0){var i=a.pendingLanes;if(i===0)var r=0;else{var f=a.suspendedLanes,m=a.pingedLanes;r=(1<<31-Oe(42|t)+1)-1,r&=i&~(f&~m),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,Ph(a,r))}else r=Tt,r=uu(a,a===jt?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(r&3)===0||kl(a,r)||(n=!0,Ph(a,r));a=a.next}while(n);Mc=!1}}function Dp(){Fh()}function Fh(){ts=Tc=!1;var t=0;wa!==0&&(Bp()&&(t=wa),wa=0);for(var e=Wt(),n=null,a=Iu;a!==null;){var i=a.next,r=kh(a,e);r===0?(a.next=null,n===null?Iu=i:n.next=i,i===null&&(Tl=n)):(n=a,(t!==0||(r&3)!==0)&&(ts=!0)),a=i}Ui(t)}function kh(t,e){for(var n=t.suspendedLanes,a=t.pingedLanes,i=t.expirationTimes,r=t.pendingLanes&-62914561;0<r;){var f=31-Oe(r),m=1<<f,_=i[f];_===-1?((m&n)===0||(m&a)!==0)&&(i[f]=em(m,e)):_<=e&&(t.expiredLanes|=m),r&=~m}if(e=jt,n=Tt,n=uu(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a=t.callbackNode,n===0||t===e&&(Ct===2||Ct===9)||t.cancelPendingCommit!==null)return a!==null&&a!==null&&$e(a),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||kl(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(a!==null&&$e(a),Qs(n)){case 2:case 8:n=Fl;break;case 32:n=xt;break;case 268435456:n=Ya;break;default:n=xt}return a=$h.bind(null,t),n=me(n,a),t.callbackPriority=e,t.callbackNode=n,e}return a!==null&&a!==null&&$e(a),t.callbackPriority=2,t.callbackNode=null,2}function $h(t,e){if(ie!==0&&ie!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Wu()&&t.callbackNode!==n)return null;var a=Tt;return a=uu(t,t===jt?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),a===0?null:(wh(t,a,e),kh(t,Wt()),t.callbackNode!=null&&t.callbackNode===n?$h.bind(null,t):null)}function Ph(t,e){if(Wu())return null;wh(t,e,!0)}function Cp(){Qp(function(){(Dt&6)!==0?me(Jl,Dp):Fh()})}function Oc(){return wa===0&&(wa=Go()),wa}function Wh(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:fu(""+t)}function Ih(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function zp(t,e,n,a,i){if(e==="submit"&&n&&n.stateNode===i){var r=Wh((i[pe]||null).action),f=a.submitter;f&&(e=(e=f[pe]||null)?Wh(e.formAction):f.getAttribute("formAction"),e!==null&&(r=e,f=null));var m=new vu("action","action",null,a,i);t.push({event:m,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(wa!==0){var _=f?Ih(i,f):new FormData(i);Zr(n,{pending:!0,data:_,method:i.method,action:r},null,_)}}else typeof r=="function"&&(m.preventDefault(),_=f?Ih(i,f):new FormData(i),Zr(n,{pending:!0,data:_,method:i.method,action:r},r,_))},currentTarget:i}]})}}for(var Ac=0;Ac<fr.length;Ac++){var xc=fr[Ac],wp=xc.toLowerCase(),Up=xc[0].toUpperCase()+xc.slice(1);Pe(wp,"on"+Up)}Pe(wf,"onAnimationEnd"),Pe(Uf,"onAnimationIteration"),Pe(Nf,"onAnimationStart"),Pe("dblclick","onDoubleClick"),Pe("focusin","onFocus"),Pe("focusout","onBlur"),Pe($m,"onTransitionRun"),Pe(Pm,"onTransitionStart"),Pe(Wm,"onTransitionCancel"),Pe(Lf,"onTransitionEnd"),Fa("onMouseEnter",["mouseout","mouseover"]),Fa("onMouseLeave",["mouseout","mouseover"]),Fa("onPointerEnter",["pointerout","pointerover"]),Fa("onPointerLeave",["pointerout","pointerover"]),ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ni="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Np=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ni));function ty(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var a=t[n],i=a.event;a=a.listeners;t:{var r=void 0;if(e)for(var f=a.length-1;0<=f;f--){var m=a[f],_=m.instance,A=m.currentTarget;if(m=m.listener,_!==r&&i.isPropagationStopped())break t;r=m,i.currentTarget=A;try{r(i)}catch(L){Gu(L)}i.currentTarget=null,r=_}else for(f=0;f<a.length;f++){if(m=a[f],_=m.instance,A=m.currentTarget,m=m.listener,_!==r&&i.isPropagationStopped())break t;r=m,i.currentTarget=A;try{r(i)}catch(L){Gu(L)}i.currentTarget=null,r=_}}}}function Rt(t,e){var n=e[Gs];n===void 0&&(n=e[Gs]=new Set);var a=t+"__bubble";n.has(a)||(ey(e,t,2,!1),n.add(a))}function Dc(t,e,n){var a=0;e&&(a|=4),ey(n,t,a,e)}var es="_reactListening"+Math.random().toString(36).slice(2);function Cc(t){if(!t[es]){t[es]=!0,Jo.forEach(function(n){n!=="selectionchange"&&(Np.has(n)||Dc(n,!1,t),Dc(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[es]||(e[es]=!0,Dc("selectionchange",!1,e))}}function ey(t,e,n,a){switch(My(e)){case 2:var i=s0;break;case 8:i=r0;break;default:i=Kc}n=i.bind(null,e,n,t),i=void 0,!Ws||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),a?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function zc(t,e,n,a,i){var r=a;if((e&1)===0&&(e&2)===0&&a!==null)t:for(;;){if(a===null)return;var f=a.tag;if(f===3||f===4){var m=a.stateNode.containerInfo;if(m===i)break;if(f===4)for(f=a.return;f!==null;){var _=f.tag;if((_===3||_===4)&&f.stateNode.containerInfo===i)return;f=f.return}for(;m!==null;){if(f=Xa(m),f===null)return;if(_=f.tag,_===5||_===6||_===26||_===27){a=r=f;continue t}m=m.parentNode}}a=a.return}rf(function(){var A=r,L=$s(n),Q=[];t:{var D=jf.get(t);if(D!==void 0){var z=vu,ft=t;switch(t){case"keypress":if(hu(n)===0)break t;case"keydown":case"keyup":z=xm;break;case"focusin":ft="focus",z=nr;break;case"focusout":ft="blur",z=nr;break;case"beforeblur":case"afterblur":z=nr;break;case"click":if(n.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":z=ff;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=mm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=zm;break;case wf:case Uf:case Nf:z=Sm;break;case Lf:z=Um;break;case"scroll":case"scrollend":z=ym;break;case"wheel":z=Lm;break;case"copy":case"cut":case"paste":z=_m;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=hf;break;case"toggle":case"beforetoggle":z=Hm}var rt=(e&4)!==0,Ut=!rt&&(t==="scroll"||t==="scrollend"),T=rt?D!==null?D+"Capture":null:D;rt=[];for(var R=A,O;R!==null;){var H=R;if(O=H.stateNode,H=H.tag,H!==5&&H!==26&&H!==27||O===null||T===null||(H=Il(R,T),H!=null&&rt.push(Li(R,H,O))),Ut)break;R=R.return}0<rt.length&&(D=new z(D,ft,null,n,L),Q.push({event:D,listeners:rt}))}}if((e&7)===0){t:{if(D=t==="mouseover"||t==="pointerover",z=t==="mouseout"||t==="pointerout",D&&n!==ks&&(ft=n.relatedTarget||n.fromElement)&&(Xa(ft)||ft[Ka]))break t;if((z||D)&&(D=L.window===L?L:(D=L.ownerDocument)?D.defaultView||D.parentWindow:window,z?(ft=n.relatedTarget||n.toElement,z=A,ft=ft?Xa(ft):null,ft!==null&&(Ut=d(ft),rt=ft.tag,ft!==Ut||rt!==5&&rt!==27&&rt!==6)&&(ft=null)):(z=null,ft=A),z!==ft)){if(rt=ff,H="onMouseLeave",T="onMouseEnter",R="mouse",(t==="pointerout"||t==="pointerover")&&(rt=hf,H="onPointerLeave",T="onPointerEnter",R="pointer"),Ut=z==null?D:Wl(z),O=ft==null?D:Wl(ft),D=new rt(H,R+"leave",z,n,L),D.target=Ut,D.relatedTarget=O,H=null,Xa(L)===A&&(rt=new rt(T,R+"enter",ft,n,L),rt.target=O,rt.relatedTarget=Ut,H=rt),Ut=H,z&&ft)e:{for(rt=z,T=ft,R=0,O=rt;O;O=Ml(O))R++;for(O=0,H=T;H;H=Ml(H))O++;for(;0<R-O;)rt=Ml(rt),R--;for(;0<O-R;)T=Ml(T),O--;for(;R--;){if(rt===T||T!==null&&rt===T.alternate)break e;rt=Ml(rt),T=Ml(T)}rt=null}else rt=null;z!==null&&ny(Q,D,z,rt,!1),ft!==null&&Ut!==null&&ny(Q,Ut,ft,rt,!0)}}t:{if(D=A?Wl(A):window,z=D.nodeName&&D.nodeName.toLowerCase(),z==="select"||z==="input"&&D.type==="file")var nt=_f;else if(Sf(D))if(Ef)nt=Jm;else{nt=Xm;var _t=Km}else z=D.nodeName,!z||z.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?A&&Fs(A.elementType)&&(nt=_f):nt=Zm;if(nt&&(nt=nt(t,A))){bf(Q,nt,n,L);break t}_t&&_t(t,D,A),t==="focusout"&&A&&D.type==="number"&&A.memoizedProps.value!=null&&Js(D,"number",D.value)}switch(_t=A?Wl(A):window,t){case"focusin":(Sf(_t)||_t.contentEditable==="true")&&(el=_t,rr=A,si=null);break;case"focusout":si=rr=el=null;break;case"mousedown":cr=!0;break;case"contextmenu":case"mouseup":case"dragend":cr=!1,Cf(Q,n,L);break;case"selectionchange":if(km)break;case"keydown":case"keyup":Cf(Q,n,L)}var ut;if(lr)t:{switch(t){case"compositionstart":var ct="onCompositionStart";break t;case"compositionend":ct="onCompositionEnd";break t;case"compositionupdate":ct="onCompositionUpdate";break t}ct=void 0}else tl?pf(t,n)&&(ct="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(ct="onCompositionStart");ct&&(yf&&n.locale!=="ko"&&(tl||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&tl&&(ut=cf()):(Hn=L,Is="value"in Hn?Hn.value:Hn.textContent,tl=!0)),_t=ns(A,ct),0<_t.length&&(ct=new df(ct,t,null,n,L),Q.push({event:ct,listeners:_t}),ut?ct.data=ut:(ut=gf(n),ut!==null&&(ct.data=ut)))),(ut=qm?Qm(t,n):Gm(t,n))&&(ct=ns(A,"onBeforeInput"),0<ct.length&&(_t=new df("onBeforeInput","beforeinput",null,n,L),Q.push({event:_t,listeners:ct}),_t.data=ut)),zp(Q,t,A,n,L)}ty(Q,e)})}function Li(t,e,n){return{instance:t,listener:e,currentTarget:n}}function ns(t,e){for(var n=e+"Capture",a=[];t!==null;){var i=t,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=Il(t,n),i!=null&&a.unshift(Li(t,i,r)),i=Il(t,e),i!=null&&a.push(Li(t,i,r))),t.tag===3)return a;t=t.return}return[]}function Ml(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ny(t,e,n,a,i){for(var r=e._reactName,f=[];n!==null&&n!==a;){var m=n,_=m.alternate,A=m.stateNode;if(m=m.tag,_!==null&&_===a)break;m!==5&&m!==26&&m!==27||A===null||(_=A,i?(A=Il(n,r),A!=null&&f.unshift(Li(n,A,_))):i||(A=Il(n,r),A!=null&&f.push(Li(n,A,_)))),n=n.return}f.length!==0&&t.push({event:e,listeners:f})}var Lp=/\r\n?/g,jp=/\u0000|\uFFFD/g;function ay(t){return(typeof t=="string"?t:""+t).replace(Lp,` 50 - `).replace(jp,"")}function ly(t,e){return e=ay(e),ay(t)===e}function as(){}function wt(t,e,n,a,i,r){switch(n){case"children":typeof a=="string"?e==="body"||e==="textarea"&&a===""||Pa(t,a):(typeof a=="number"||typeof a=="bigint")&&e!=="body"&&Pa(t,""+a);break;case"className":ru(t,"class",a);break;case"tabIndex":ru(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":ru(t,n,a);break;case"style":uf(t,a,r);break;case"data":if(e!=="object"){ru(t,"data",a);break}case"src":case"href":if(a===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(n);break}a=fu(""+a),t.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(n==="formAction"?(e!=="input"&&wt(t,e,"name",i.name,i,null),wt(t,e,"formEncType",i.formEncType,i,null),wt(t,e,"formMethod",i.formMethod,i,null),wt(t,e,"formTarget",i.formTarget,i,null)):(wt(t,e,"encType",i.encType,i,null),wt(t,e,"method",i.method,i,null),wt(t,e,"target",i.target,i,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(n);break}a=fu(""+a),t.setAttribute(n,a);break;case"onClick":a!=null&&(t.onclick=as);break;case"onScroll":a!=null&&Rt("scroll",t);break;case"onScrollEnd":a!=null&&Rt("scrollend",t);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(c(60));t.innerHTML=n}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}n=fu(""+a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,""+a):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":a===!0?t.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(n,a):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(n,a):t.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(n):t.setAttribute(n,a);break;case"popover":Rt("beforetoggle",t),Rt("toggle",t),su(t,"popover",a);break;case"xlinkActuate":mn(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":mn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":mn(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":mn(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":mn(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":mn(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":mn(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":mn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":mn(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":su(t,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=dm.get(n)||n,su(t,n,a))}}function wc(t,e,n,a,i,r){switch(n){case"style":uf(t,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(c(60));t.innerHTML=n}}break;case"children":typeof a=="string"?Pa(t,a):(typeof a=="number"||typeof a=="bigint")&&Pa(t,""+a);break;case"onScroll":a!=null&&Rt("scroll",t);break;case"onScrollEnd":a!=null&&Rt("scrollend",t);break;case"onClick":a!=null&&(t.onclick=as);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fo.hasOwnProperty(n))t:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),e=n.slice(2,i?n.length-7:void 0),r=t[pe]||null,r=r!=null?r[n]:null,typeof r=="function"&&t.removeEventListener(e,r,i),typeof a=="function")){typeof r!="function"&&r!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,a,i);break t}n in t?t[n]=a:a===!0?t.setAttribute(n,""):su(t,n,a)}}}function ue(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",t),Rt("load",t);var a=!1,i=!1,r;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"src":a=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,e));default:wt(t,e,r,f,n,null)}}i&&wt(t,e,"srcSet",n.srcSet,n,null),a&&wt(t,e,"src",n.src,n,null);return;case"input":Rt("invalid",t);var m=r=f=i=null,_=null,A=null;for(a in n)if(n.hasOwnProperty(a)){var L=n[a];if(L!=null)switch(a){case"name":i=L;break;case"type":f=L;break;case"checked":_=L;break;case"defaultChecked":A=L;break;case"value":r=L;break;case"defaultValue":m=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(c(137,e));break;default:wt(t,e,a,L,n,null)}}ef(t,r,m,_,A,f,i,!1),cu(t);return;case"select":Rt("invalid",t),a=f=r=null;for(i in n)if(n.hasOwnProperty(i)&&(m=n[i],m!=null))switch(i){case"value":r=m;break;case"defaultValue":f=m;break;case"multiple":a=m;default:wt(t,e,i,m,n,null)}e=r,n=f,t.multiple=!!a,e!=null?$a(t,!!a,e,!1):n!=null&&$a(t,!!a,n,!0);return;case"textarea":Rt("invalid",t),r=i=a=null;for(f in n)if(n.hasOwnProperty(f)&&(m=n[f],m!=null))switch(f){case"value":a=m;break;case"defaultValue":i=m;break;case"children":r=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(c(91));break;default:wt(t,e,f,m,n,null)}af(t,a,i,r),cu(t);return;case"option":for(_ in n)if(n.hasOwnProperty(_)&&(a=n[_],a!=null))switch(_){case"selected":t.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:wt(t,e,_,a,n,null)}return;case"dialog":Rt("beforetoggle",t),Rt("toggle",t),Rt("cancel",t),Rt("close",t);break;case"iframe":case"object":Rt("load",t);break;case"video":case"audio":for(a=0;a<Ni.length;a++)Rt(Ni[a],t);break;case"image":Rt("error",t),Rt("load",t);break;case"details":Rt("toggle",t);break;case"embed":case"source":case"link":Rt("error",t),Rt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(A in n)if(n.hasOwnProperty(A)&&(a=n[A],a!=null))switch(A){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,e));default:wt(t,e,A,a,n,null)}return;default:if(Fs(e)){for(L in n)n.hasOwnProperty(L)&&(a=n[L],a!==void 0&&wc(t,e,L,a,n,void 0));return}}for(m in n)n.hasOwnProperty(m)&&(a=n[m],a!=null&&wt(t,e,m,a,n,null))}function Hp(t,e,n,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,f=null,m=null,_=null,A=null,L=null;for(z in n){var Q=n[z];if(n.hasOwnProperty(z)&&Q!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":_=Q;default:a.hasOwnProperty(z)||wt(t,e,z,null,a,Q)}}for(var D in a){var z=a[D];if(Q=n[D],a.hasOwnProperty(D)&&(z!=null||Q!=null))switch(D){case"type":r=z;break;case"name":i=z;break;case"checked":A=z;break;case"defaultChecked":L=z;break;case"value":f=z;break;case"defaultValue":m=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(c(137,e));break;default:z!==Q&&wt(t,e,D,z,a,Q)}}Zs(t,f,m,_,A,L,r,i);return;case"select":z=f=m=D=null;for(r in n)if(_=n[r],n.hasOwnProperty(r)&&_!=null)switch(r){case"value":break;case"multiple":z=_;default:a.hasOwnProperty(r)||wt(t,e,r,null,a,_)}for(i in a)if(r=a[i],_=n[i],a.hasOwnProperty(i)&&(r!=null||_!=null))switch(i){case"value":D=r;break;case"defaultValue":m=r;break;case"multiple":f=r;default:r!==_&&wt(t,e,i,r,a,_)}e=m,n=f,a=z,D!=null?$a(t,!!n,D,!1):!!a!=!!n&&(e!=null?$a(t,!!n,e,!0):$a(t,!!n,n?[]:"",!1));return;case"textarea":z=D=null;for(m in n)if(i=n[m],n.hasOwnProperty(m)&&i!=null&&!a.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:wt(t,e,m,null,a,i)}for(f in a)if(i=a[f],r=n[f],a.hasOwnProperty(f)&&(i!=null||r!=null))switch(f){case"value":D=i;break;case"defaultValue":z=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(c(91));break;default:i!==r&&wt(t,e,f,i,a,r)}nf(t,D,z);return;case"option":for(var ft in n)if(D=n[ft],n.hasOwnProperty(ft)&&D!=null&&!a.hasOwnProperty(ft))switch(ft){case"selected":t.selected=!1;break;default:wt(t,e,ft,null,a,D)}for(_ in a)if(D=a[_],z=n[_],a.hasOwnProperty(_)&&D!==z&&(D!=null||z!=null))switch(_){case"selected":t.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:wt(t,e,_,D,a,z)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var rt in n)D=n[rt],n.hasOwnProperty(rt)&&D!=null&&!a.hasOwnProperty(rt)&&wt(t,e,rt,null,a,D);for(A in a)if(D=a[A],z=n[A],a.hasOwnProperty(A)&&D!==z&&(D!=null||z!=null))switch(A){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(c(137,e));break;default:wt(t,e,A,D,a,z)}return;default:if(Fs(e)){for(var Ut in n)D=n[Ut],n.hasOwnProperty(Ut)&&D!==void 0&&!a.hasOwnProperty(Ut)&&wc(t,e,Ut,void 0,a,D);for(L in a)D=a[L],z=n[L],!a.hasOwnProperty(L)||D===z||D===void 0&&z===void 0||wc(t,e,L,D,a,z);return}}for(var T in n)D=n[T],n.hasOwnProperty(T)&&D!=null&&!a.hasOwnProperty(T)&&wt(t,e,T,null,a,D);for(Q in a)D=a[Q],z=n[Q],!a.hasOwnProperty(Q)||D===z||D==null&&z==null||wt(t,e,Q,D,a,z)}var Uc=null,Nc=null;function ls(t){return t.nodeType===9?t:t.ownerDocument}function iy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function uy(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Lc(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var jc=null;function Bp(){var t=window.event;return t&&t.type==="popstate"?t===jc?!1:(jc=t,!0):(jc=null,!1)}var sy=typeof setTimeout=="function"?setTimeout:void 0,qp=typeof clearTimeout=="function"?clearTimeout:void 0,ry=typeof Promise=="function"?Promise:void 0,Qp=typeof queueMicrotask=="function"?queueMicrotask:typeof ry<"u"?function(t){return ry.resolve(null).then(t).catch(Gp)}:sy;function Gp(t){setTimeout(function(){throw t})}function In(t){return t==="head"}function cy(t,e){var n=e,a=0,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(0<a&&8>a){n=a;var f=t.ownerDocument;if(n&1&&ji(f.documentElement),n&2&&ji(f.body),n&4)for(n=f.head,ji(n),f=n.firstChild;f;){var m=f.nextSibling,_=f.nodeName;f[Pl]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=m}}if(i===0){t.removeChild(r),Ki(e);return}i--}else n==="$"||n==="$?"||n==="$!"?i++:a=n.charCodeAt(0)-48;else a=0;n=r}while(n);Ki(e)}function Hc(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Hc(n),Vs(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function Vp(t,e,n,a){for(;t.nodeType===1;){var i=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!a&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(a){if(!t[Pl])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(r=t.getAttribute("rel"),r==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(r!==i.rel||t.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||t.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||t.getAttribute("title")!==(i.title==null?null:i.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(r=t.getAttribute("src"),(r!==(i.src==null?null:i.src)||t.getAttribute("type")!==(i.type==null?null:i.type)||t.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&t.getAttribute("name")===r)return t}else return t;if(t=Ie(t.nextSibling),t===null)break}return null}function Yp(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Ie(t.nextSibling),t===null))return null;return t}function Bc(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function Kp(t,e){var n=t.ownerDocument;if(t.data!=="$?"||n.readyState==="complete")e();else{var a=function(){e(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),t._reactRetry=a}}function Ie(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var qc=null;function oy(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}function fy(t,e,n){switch(e=ls(n),t){case"html":if(t=e.documentElement,!t)throw Error(c(452));return t;case"head":if(t=e.head,!t)throw Error(c(453));return t;case"body":if(t=e.body,!t)throw Error(c(454));return t;default:throw Error(c(451))}}function ji(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Vs(t)}var Ke=new Map,dy=new Set;function is(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Cn=X.d;X.d={f:Xp,r:Zp,D:Jp,C:Fp,L:kp,m:$p,X:Wp,S:Pp,M:Ip};function Xp(){var t=Cn.f(),e=$u();return t||e}function Zp(t){var e=Za(t);e!==null&&e.tag===5&&e.type==="form"?wd(e):Cn.r(t)}var Ol=typeof document>"u"?null:document;function hy(t,e,n){var a=Ol;if(a&&typeof e=="string"&&e){var i=He(e);i='link[rel="'+t+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),dy.has(i)||(dy.add(i),t={rel:t,crossOrigin:n,href:e},a.querySelector(i)===null&&(e=a.createElement("link"),ue(e,"link",t),It(e),a.head.appendChild(e)))}}function Jp(t){Cn.D(t),hy("dns-prefetch",t,null)}function Fp(t,e){Cn.C(t,e),hy("preconnect",t,e)}function kp(t,e,n){Cn.L(t,e,n);var a=Ol;if(a&&t&&e){var i='link[rel="preload"][as="'+He(e)+'"]';e==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+He(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+He(n.imageSizes)+'"]')):i+='[href="'+He(t)+'"]';var r=i;switch(e){case"style":r=Al(t);break;case"script":r=xl(t)}Ke.has(r)||(t=g({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),Ke.set(r,t),a.querySelector(i)!==null||e==="style"&&a.querySelector(Hi(r))||e==="script"&&a.querySelector(Bi(r))||(e=a.createElement("link"),ue(e,"link",t),It(e),a.head.appendChild(e)))}}function $p(t,e){Cn.m(t,e);var n=Ol;if(n&&t){var a=e&&typeof e.as=="string"?e.as:"script",i='link[rel="modulepreload"][as="'+He(a)+'"][href="'+He(t)+'"]',r=i;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=xl(t)}if(!Ke.has(r)&&(t=g({rel:"modulepreload",href:t},e),Ke.set(r,t),n.querySelector(i)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Bi(r)))return}a=n.createElement("link"),ue(a,"link",t),It(a),n.head.appendChild(a)}}}function Pp(t,e,n){Cn.S(t,e,n);var a=Ol;if(a&&t){var i=Ja(a).hoistableStyles,r=Al(t);e=e||"default";var f=i.get(r);if(!f){var m={loading:0,preload:null};if(f=a.querySelector(Hi(r)))m.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":e},n),(n=Ke.get(r))&&Qc(t,n);var _=f=a.createElement("link");It(_),ue(_,"link",t),_._p=new Promise(function(A,L){_.onload=A,_.onerror=L}),_.addEventListener("load",function(){m.loading|=1}),_.addEventListener("error",function(){m.loading|=2}),m.loading|=4,us(f,e,a)}f={type:"stylesheet",instance:f,count:1,state:m},i.set(r,f)}}}function Wp(t,e){Cn.X(t,e);var n=Ol;if(n&&t){var a=Ja(n).hoistableScripts,i=xl(t),r=a.get(i);r||(r=n.querySelector(Bi(i)),r||(t=g({src:t,async:!0},e),(e=Ke.get(i))&&Gc(t,e),r=n.createElement("script"),It(r),ue(r,"link",t),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(i,r))}}function Ip(t,e){Cn.M(t,e);var n=Ol;if(n&&t){var a=Ja(n).hoistableScripts,i=xl(t),r=a.get(i);r||(r=n.querySelector(Bi(i)),r||(t=g({src:t,async:!0,type:"module"},e),(e=Ke.get(i))&&Gc(t,e),r=n.createElement("script"),It(r),ue(r,"link",t),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(i,r))}}function yy(t,e,n,a){var i=(i=tt.current)?is(i):null;if(!i)throw Error(c(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Al(n.href),n=Ja(i).hoistableStyles,a=n.get(e),a||(a={type:"style",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Al(n.href);var r=Ja(i).hoistableStyles,f=r.get(t);if(f||(i=i.ownerDocument||i,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(t,f),(r=i.querySelector(Hi(t)))&&!r._p&&(f.instance=r,f.state.loading=5),Ke.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ke.set(t,n),r||t0(i,t,n,f.state))),e&&a===null)throw Error(c(528,""));return f}if(e&&a!==null)throw Error(c(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=xl(n),n=Ja(i).hoistableScripts,a=n.get(e),a||(a={type:"script",instance:null,count:0,state:null},n.set(e,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,t))}}function Al(t){return'href="'+He(t)+'"'}function Hi(t){return'link[rel="stylesheet"]['+t+"]"}function vy(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function t0(t,e,n,a){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?a.loading=1:(e=t.createElement("link"),a.preload=e,e.addEventListener("load",function(){return a.loading|=1}),e.addEventListener("error",function(){return a.loading|=2}),ue(e,"link",n),It(e),t.head.appendChild(e))}function xl(t){return'[src="'+He(t)+'"]'}function Bi(t){return"script[async]"+t}function my(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var a=t.querySelector('style[data-href~="'+He(n.href)+'"]');if(a)return e.instance=a,It(a),a;var i=g({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(t.ownerDocument||t).createElement("style"),It(a),ue(a,"style",i),us(a,n.precedence,t),e.instance=a;case"stylesheet":i=Al(n.href);var r=t.querySelector(Hi(i));if(r)return e.state.loading|=4,e.instance=r,It(r),r;a=vy(n),(i=Ke.get(i))&&Qc(a,i),r=(t.ownerDocument||t).createElement("link"),It(r);var f=r;return f._p=new Promise(function(m,_){f.onload=m,f.onerror=_}),ue(r,"link",a),e.state.loading|=4,us(r,n.precedence,t),e.instance=r;case"script":return r=xl(n.src),(i=t.querySelector(Bi(r)))?(e.instance=i,It(i),i):(a=n,(i=Ke.get(r))&&(a=g({},n),Gc(a,i)),t=t.ownerDocument||t,i=t.createElement("script"),It(i),ue(i,"link",a),t.head.appendChild(i),e.instance=i);case"void":return null;default:throw Error(c(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(a=e.instance,e.state.loading|=4,us(a,n.precedence,t));return e.instance}function us(t,e,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=a.length?a[a.length-1]:null,r=i,f=0;f<a.length;f++){var m=a[f];if(m.dataset.precedence===e)r=m;else if(r!==i)break}r?r.parentNode.insertBefore(t,r.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function Qc(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Gc(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var ss=null;function py(t,e,n){if(ss===null){var a=new Map,i=ss=new Map;i.set(n,a)}else i=ss,a=i.get(n),a||(a=new Map,i.set(n,a));if(a.has(t))return a;for(a.set(t,null),n=n.getElementsByTagName(t),i=0;i<n.length;i++){var r=n[i];if(!(r[Pl]||r[se]||t==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var f=r.getAttribute(e)||"";f=t+f;var m=a.get(f);m?m.push(r):a.set(f,[r])}}return a}function gy(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function e0(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Sy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var qi=null;function n0(){}function a0(t,e,n){if(qi===null)throw Error(c(475));var a=qi;if(e.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var i=Al(n.href),r=t.querySelector(Hi(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(a.count++,a=rs.bind(a),t.then(a,a)),e.state.loading|=4,e.instance=r,It(r);return}r=t.ownerDocument||t,n=vy(n),(i=Ke.get(i))&&Qc(n,i),r=r.createElement("link"),It(r);var f=r;f._p=new Promise(function(m,_){f.onload=m,f.onerror=_}),ue(r,"link",n),e.instance=r}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(a.count++,e=rs.bind(a),t.addEventListener("load",e),t.addEventListener("error",e))}}function l0(){if(qi===null)throw Error(c(475));var t=qi;return t.stylesheets&&t.count===0&&Vc(t,t.stylesheets),0<t.count?function(e){var n=setTimeout(function(){if(t.stylesheets&&Vc(t,t.stylesheets),t.unsuspend){var a=t.unsuspend;t.unsuspend=null,a()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(n)}}:null}function rs(){if(this.count--,this.count===0){if(this.stylesheets)Vc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var cs=null;function Vc(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,cs=new Map,e.forEach(i0,t),cs=null,rs.call(t))}function i0(t,e){if(!(e.state.loading&4)){var n=cs.get(t);if(n)var a=n.get(null);else{n=new Map,cs.set(t,n);for(var i=t.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var f=i[r];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),a=f)}a&&n.set(null,a)}i=e.instance,f=i.getAttribute("data-precedence"),r=n.get(f)||a,r===a&&n.set(null,i),n.set(f,i),this.count++,a=rs.bind(this),i.addEventListener("load",a),i.addEventListener("error",a),r?r.parentNode.insertBefore(i,r.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(i,t.firstChild)),e.state.loading|=4}}var Qi={$$typeof:K,Provider:null,Consumer:null,_currentValue:at,_currentValue2:at,_threadCount:0};function u0(t,e,n,a,i,r,f,m){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Bs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bs(0),this.hiddenUpdates=Bs(null),this.identifierPrefix=a,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=m,this.incompleteTransitions=new Map}function by(t,e,n,a,i,r,f,m,_,A,L,Q){return t=new u0(t,e,n,f,m,_,A,Q),e=1,r===!0&&(e|=24),r=xe(3,null,null,e),t.current=r,r.stateNode=t,e=Rr(),e.refCount++,t.pooledCache=e,e.refCount++,r.memoizedState={element:a,isDehydrated:n,cache:e},Ar(r),t}function _y(t){return t?(t=il,t):il}function Ey(t,e,n,a,i,r){i=_y(i),a.context===null?a.context=i:a.pendingContext=i,a=Qn(e),a.payload={element:n},r=r===void 0?null:r,r!==null&&(a.callback=r),n=Gn(t,a,e),n!==null&&(Ue(n,t,e),mi(n,t,e))}function Ry(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Yc(t,e){Ry(t,e),(t=t.alternate)&&Ry(t,e)}function Ty(t){if(t.tag===13){var e=ll(t,67108864);e!==null&&Ue(e,t,67108864),Yc(t,67108864)}}var os=!0;function s0(t,e,n,a){var i=C.T;C.T=null;var r=X.p;try{X.p=2,Kc(t,e,n,a)}finally{X.p=r,C.T=i}}function r0(t,e,n,a){var i=C.T;C.T=null;var r=X.p;try{X.p=8,Kc(t,e,n,a)}finally{X.p=r,C.T=i}}function Kc(t,e,n,a){if(os){var i=Xc(a);if(i===null)zc(t,e,a,fs,n),Oy(t,a);else if(o0(i,t,e,n,a))a.stopPropagation();else if(Oy(t,a),e&4&&-1<c0.indexOf(t)){for(;i!==null;){var r=Za(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var f=va(r.pendingLanes);if(f!==0){var m=r;for(m.pendingLanes|=2,m.entangledLanes|=2;f;){var _=1<<31-Oe(f);m.entanglements[1]|=_,f&=~_}cn(r),(Dt&6)===0&&(Fu=Wt()+500,Ui(0))}}break;case 13:m=ll(r,2),m!==null&&Ue(m,r,2),$u(),Yc(r,2)}if(r=Xc(a),r===null&&zc(t,e,a,fs,n),r===i)break;i=r}i!==null&&a.stopPropagation()}else zc(t,e,a,null,n)}}function Xc(t){return t=$s(t),Zc(t)}var fs=null;function Zc(t){if(fs=null,t=Xa(t),t!==null){var e=d(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=y(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return fs=t,null}function My(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Va()){case Jl:return 2;case Fl:return 8;case xt:case Jt:return 32;case Ya:return 268435456;default:return 32}default:return 32}}var Jc=!1,ta=null,ea=null,na=null,Gi=new Map,Vi=new Map,aa=[],c0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Oy(t,e){switch(t){case"focusin":case"focusout":ta=null;break;case"dragenter":case"dragleave":ea=null;break;case"mouseover":case"mouseout":na=null;break;case"pointerover":case"pointerout":Gi.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vi.delete(e.pointerId)}}function Yi(t,e,n,a,i,r){return t===null||t.nativeEvent!==r?(t={blockedOn:e,domEventName:n,eventSystemFlags:a,nativeEvent:r,targetContainers:[i]},e!==null&&(e=Za(e),e!==null&&Ty(e)),t):(t.eventSystemFlags|=a,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function o0(t,e,n,a,i){switch(e){case"focusin":return ta=Yi(ta,t,e,n,a,i),!0;case"dragenter":return ea=Yi(ea,t,e,n,a,i),!0;case"mouseover":return na=Yi(na,t,e,n,a,i),!0;case"pointerover":var r=i.pointerId;return Gi.set(r,Yi(Gi.get(r)||null,t,e,n,a,i)),!0;case"gotpointercapture":return r=i.pointerId,Vi.set(r,Yi(Vi.get(r)||null,t,e,n,a,i)),!0}return!1}function Ay(t){var e=Xa(t.target);if(e!==null){var n=d(e);if(n!==null){if(e=n.tag,e===13){if(e=y(n),e!==null){t.blockedOn=e,am(t.priority,function(){if(n.tag===13){var a=we();a=qs(a);var i=ll(n,a);i!==null&&Ue(i,n,a),Yc(n,a)}});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ds(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Xc(t.nativeEvent);if(n===null){n=t.nativeEvent;var a=new n.constructor(n.type,n);ks=a,n.target.dispatchEvent(a),ks=null}else return e=Za(n),e!==null&&Ty(e),t.blockedOn=n,!1;e.shift()}return!0}function xy(t,e,n){ds(t)&&n.delete(e)}function f0(){Jc=!1,ta!==null&&ds(ta)&&(ta=null),ea!==null&&ds(ea)&&(ea=null),na!==null&&ds(na)&&(na=null),Gi.forEach(xy),Vi.forEach(xy)}function hs(t,e){t.blockedOn===e&&(t.blockedOn=null,Jc||(Jc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,f0)))}var ys=null;function Dy(t){ys!==t&&(ys=t,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){ys===t&&(ys=null);for(var e=0;e<t.length;e+=3){var n=t[e],a=t[e+1],i=t[e+2];if(typeof a!="function"){if(Zc(a||n)===null)continue;break}var r=Za(n);r!==null&&(t.splice(e,3),e-=3,Zr(r,{pending:!0,data:i,method:n.method,action:a},a,i))}}))}function Ki(t){function e(_){return hs(_,t)}ta!==null&&hs(ta,t),ea!==null&&hs(ea,t),na!==null&&hs(na,t),Gi.forEach(e),Vi.forEach(e);for(var n=0;n<aa.length;n++){var a=aa[n];a.blockedOn===t&&(a.blockedOn=null)}for(;0<aa.length&&(n=aa[0],n.blockedOn===null);)Ay(n),n.blockedOn===null&&aa.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var i=n[a],r=n[a+1],f=i[pe]||null;if(typeof r=="function")f||Dy(n);else if(f){var m=null;if(r&&r.hasAttribute("formAction")){if(i=r,f=r[pe]||null)m=f.formAction;else if(Zc(i)!==null)continue}else m=f.action;typeof m=="function"?n[a+1]=m:(n.splice(a,3),a-=3),Dy(n)}}}function Fc(t){this._internalRoot=t}vs.prototype.render=Fc.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(c(409));var n=e.current,a=we();Ey(n,a,t,e,null,null)},vs.prototype.unmount=Fc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ey(t.current,2,null,t,null,null),$u(),e[Ka]=null}};function vs(t){this._internalRoot=t}vs.prototype.unstable_scheduleHydration=function(t){if(t){var e=Xo();t={blockedOn:null,target:t,priority:e};for(var n=0;n<aa.length&&e!==0&&e<aa[n].priority;n++);aa.splice(n,0,t),n===0&&Ay(t)}};var Cy=s.version;if(Cy!=="19.1.0")throw Error(c(527,Cy,"19.1.0"));X.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(c(188)):(t=Object.keys(t).join(","),Error(c(268,t)));return t=S(e),t=t!==null?h(t):null,t=t===null?null:t.stateNode,t};var d0={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ms=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ms.isDisabled&&ms.supportsFiber)try{ya=ms.inject(d0),Me=ms}catch{}}return Zi.createRoot=function(t,e){if(!o(t))throw Error(c(299));var n=!1,a="",i=Zd,r=Jd,f=Fd,m=null;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(a=e.identifierPrefix),e.onUncaughtError!==void 0&&(i=e.onUncaughtError),e.onCaughtError!==void 0&&(r=e.onCaughtError),e.onRecoverableError!==void 0&&(f=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(m=e.unstable_transitionCallbacks)),e=by(t,1,!1,null,null,n,a,i,r,f,m,null),t[Ka]=e.current,Cc(t),new Fc(e)},Zi.hydrateRoot=function(t,e,n){if(!o(t))throw Error(c(299));var a=!1,i="",r=Zd,f=Jd,m=Fd,_=null,A=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(m=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(_=n.unstable_transitionCallbacks),n.formState!==void 0&&(A=n.formState)),e=by(t,1,!0,e,n??null,a,i,r,f,m,_,A),e.context=_y(null),n=e.current,a=we(),a=qs(a),i=Qn(a),i.callback=null,Gn(n,i,a),n=a,e.current.lanes=n,$l(e,n),cn(e),t[Ka]=e.current,Cc(t),new vs(e)},Zi.version="19.1.0",Zi}var Gy;function E0(){if(Gy)return Wc.exports;Gy=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Wc.exports=_0(),Wc.exports}var R0=E0();function Tv(l){if(Array.isArray(l))return l.flatMap(g=>Tv(g));if(typeof l!="string")return[];const s=[];let u=0,c,o,d,y,v;const S=()=>{for(;u<l.length&&/\s/.test(l.charAt(u));)u+=1;return u<l.length},h=()=>(o=l.charAt(u),o!=="="&&o!==";"&&o!==",");for(;u<l.length;){for(c=u,v=!1;S();)if(o=l.charAt(u),o===","){for(d=u,u+=1,S(),y=u;u<l.length&&h();)u+=1;u<l.length&&l.charAt(u)==="="?(v=!0,u=y,s.push(l.slice(c,d)),c=u):u=d+1}else u+=1;(!v||u>=l.length)&&s.push(l.slice(c,l.length))}return s}function T0(l){return l instanceof Headers?new Headers(l):Array.isArray(l)?new Headers(l):typeof l=="object"?new Headers(l):new Headers}function M0(...l){return l.reduce((s,u)=>{const c=T0(u);for(const[o,d]of c.entries())o==="set-cookie"?Tv(d).forEach(v=>s.append("set-cookie",v)):s.set(o,d);return s},new Headers)}const Cl=new WeakMap,Es=new WeakMap,Ms={current:[]};let no=!1,$i=0;const Fi=new Set,gs=new Map;function Mv(l){const s=Array.from(l).sort((u,c)=>u instanceof zl&&u.options.deps.includes(c)?1:c instanceof zl&&c.options.deps.includes(u)?-1:0);for(const u of s){if(Ms.current.includes(u))continue;Ms.current.push(u),u.recompute();const c=Es.get(u);if(c)for(const o of c){const d=Cl.get(o);d&&Mv(d)}}}function O0(l){l.listeners.forEach(s=>s({prevVal:l.prevState,currentVal:l.state}))}function A0(l){l.listeners.forEach(s=>s({prevVal:l.prevState,currentVal:l.state}))}function Ov(l){if($i>0&&!gs.has(l)&&gs.set(l,l.prevState),Fi.add(l),!($i>0)&&!no)try{for(no=!0;Fi.size>0;){const s=Array.from(Fi);Fi.clear();for(const u of s){const c=gs.get(u)??u.prevState;u.prevState=c,O0(u)}for(const u of s){const c=Cl.get(u);c&&(Ms.current.push(u),Mv(c))}for(const u of s){const c=Cl.get(u);if(c)for(const o of c)A0(o)}}}finally{no=!1,Ms.current=[],gs.clear()}}function Vy(l){$i++;try{l()}finally{if($i--,$i===0){const s=Array.from(Fi)[0];s&&Ov(s)}}}class go{constructor(s,u){this.listeners=new Set,this.subscribe=c=>{var o,d;this.listeners.add(c);const y=(d=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:d.call(o,c,this);return()=>{this.listeners.delete(c),y==null||y()}},this.setState=c=>{var o,d,y;this.prevState=this.state,this.state=(o=this.options)!=null&&o.updateFn?this.options.updateFn(this.prevState)(c):c(this.prevState),(y=(d=this.options)==null?void 0:d.onUpdate)==null||y.call(d),Ov(this)},this.prevState=s,this.state=s,this.options=u}}class zl{constructor(s){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const u=[],c=[];for(const o of this.options.deps)u.push(o.prevState),c.push(o.state);return this.lastSeenDepValues=c,{prevDepVals:u,currDepVals:c,prevVal:this.prevState??void 0}},this.recompute=()=>{var u,c;this.prevState=this.state;const{prevDepVals:o,currDepVals:d,prevVal:y}=this.getDepVals();this.state=this.options.fn({prevDepVals:o,currDepVals:d,prevVal:y}),(c=(u=this.options).onUpdate)==null||c.call(u)},this.checkIfRecalculationNeededDeeply=()=>{for(const d of this.options.deps)d instanceof zl&&d.checkIfRecalculationNeededDeeply();let u=!1;const c=this.lastSeenDepValues,{currDepVals:o}=this.getDepVals();for(let d=0;d<o.length;d++)if(o[d]!==c[d]){u=!0;break}u&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const u of this._subscriptions)u()}),this.subscribe=u=>{var c,o;this.listeners.add(u);const d=(o=(c=this.options).onSubscribe)==null?void 0:o.call(c,u,this);return()=>{this.listeners.delete(u),d==null||d()}},this.options=s,this.state=s.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(s=this.options.deps){for(const u of s)if(u instanceof zl)u.registerOnGraph(),this.registerOnGraph(u.options.deps);else if(u instanceof go){let c=Cl.get(u);c||(c=new Set,Cl.set(u,c)),c.add(this);let o=Es.get(this);o||(o=new Set,Es.set(this,o)),o.add(u)}}unregisterFromGraph(s=this.options.deps){for(const u of s)if(u instanceof zl)this.unregisterFromGraph(u.options.deps);else if(u instanceof go){const c=Cl.get(u);c&&c.delete(this);const o=Es.get(this);o&&o.delete(u)}}}const da="__TSR_index",Yy="popstate",Ky="beforeunload";function Av(l){let s=l.getLocation();const u=new Set,c=y=>{s=l.getLocation(),u.forEach(v=>v({location:s,action:y}))},o=y=>{l.notifyOnIndexChange??!0?c(y):s=l.getLocation()},d=async({task:y,navigateOpts:v,...S})=>{var h,g;if((v==null?void 0:v.ignoreBlocker)??!1){y();return}const b=((h=l.getBlockers)==null?void 0:h.call(l))??[],x=S.type==="PUSH"||S.type==="REPLACE";if(typeof document<"u"&&b.length&&x)for(const M of b){const U=Wi(S.path,S.state);if(await M.blockerFn({currentLocation:s,nextLocation:U,action:S.type})){(g=l.onBlocked)==null||g.call(l);return}}y()};return{get location(){return s},get length(){return l.getLength()},subscribers:u,subscribe:y=>(u.add(y),()=>{u.delete(y)}),push:(y,v,S)=>{const h=s.state[da];v=So(h+1,v),d({task:()=>{l.pushState(y,v),c({type:"PUSH"})},navigateOpts:S,type:"PUSH",path:y,state:v})},replace:(y,v,S)=>{const h=s.state[da];v=So(h,v),d({task:()=>{l.replaceState(y,v),c({type:"REPLACE"})},navigateOpts:S,type:"REPLACE",path:y,state:v})},go:(y,v)=>{d({task:()=>{l.go(y),o({type:"GO",index:y})},navigateOpts:v,type:"GO"})},back:y=>{d({task:()=>{l.back((y==null?void 0:y.ignoreBlocker)??!1),o({type:"BACK"})},navigateOpts:y,type:"BACK"})},forward:y=>{d({task:()=>{l.forward((y==null?void 0:y.ignoreBlocker)??!1),o({type:"FORWARD"})},navigateOpts:y,type:"FORWARD"})},canGoBack:()=>s.state[da]!==0,createHref:y=>l.createHref(y),block:y=>{var v;if(!l.setBlockers)return()=>{};const S=((v=l.getBlockers)==null?void 0:v.call(l))??[];return l.setBlockers([...S,y]),()=>{var h,g;const p=((h=l.getBlockers)==null?void 0:h.call(l))??[];(g=l.setBlockers)==null||g.call(l,p.filter(b=>b!==y))}},flush:()=>{var y;return(y=l.flush)==null?void 0:y.call(l)},destroy:()=>{var y;return(y=l.destroy)==null?void 0:y.call(l)},notify:c}}function So(l,s){return s||(s={}),{...s,key:xo(),[da]:l}}function x0(l){var s;const u=typeof document<"u"?window:void 0,c=u.history.pushState,o=u.history.replaceState;let d=[];const y=()=>d,v=w=>d=w,S=w=>w,h=()=>Wi(`${u.location.pathname}${u.location.search}${u.location.hash}`,u.history.state);(s=u.history.state)!=null&&s.key||u.history.replaceState({[da]:0,key:xo()},"");let g=h(),p,b=!1,x=!1,M=!1,U=!1;const j=()=>g;let G,Z;const K=()=>{G&&(q._ignoreSubscribers=!0,(G.isPush?u.history.pushState:u.history.replaceState)(G.state,"",G.href),q._ignoreSubscribers=!1,G=void 0,Z=void 0,p=void 0)},I=(w,W,ot)=>{const et=S(W);Z||(p=g),g=Wi(W,ot),G={href:et,state:ot,isPush:(G==null?void 0:G.isPush)||w==="push"},Z||(Z=Promise.resolve().then(()=>K()))},k=w=>{g=h(),q.notify({type:w})},Y=async()=>{if(x){x=!1;return}const w=h(),W=w.state[da]-g.state[da],ot=W===1,et=W===-1,dt=!ot&&!et||b;b=!1;const pt=dt?"GO":et?"BACK":"FORWARD",ht=dt?{type:"GO",index:W}:{type:et?"BACK":"FORWARD"};if(M)M=!1;else{const C=y();if(typeof document<"u"&&C.length){for(const X of C)if(await X.blockerFn({currentLocation:g,nextLocation:w,action:pt})){x=!0,u.history.go(1),q.notify(ht);return}}}g=h(),q.notify(ht)},$=w=>{if(U){U=!1;return}let W=!1;const ot=y();if(typeof document<"u"&&ot.length)for(const et of ot){const dt=et.enableBeforeUnload??!0;if(dt===!0){W=!0;break}if(typeof dt=="function"&&dt()===!0){W=!0;break}}if(W)return w.preventDefault(),w.returnValue=""},q=Av({getLocation:j,getLength:()=>u.history.length,pushState:(w,W)=>I("push",w,W),replaceState:(w,W)=>I("replace",w,W),back:w=>(w&&(M=!0),U=!0,u.history.back()),forward:w=>{w&&(M=!0),U=!0,u.history.forward()},go:w=>{b=!0,u.history.go(w)},createHref:w=>S(w),flush:K,destroy:()=>{u.history.pushState=c,u.history.replaceState=o,u.removeEventListener(Ky,$,{capture:!0}),u.removeEventListener(Yy,Y)},onBlocked:()=>{p&&g!==p&&(g=p)},getBlockers:y,setBlockers:v,notifyOnIndexChange:!1});return u.addEventListener(Ky,$,{capture:!0}),u.addEventListener(Yy,Y),u.history.pushState=function(...w){const W=c.apply(u.history,w);return q._ignoreSubscribers||k("PUSH"),W},u.history.replaceState=function(...w){const W=o.apply(u.history,w);return q._ignoreSubscribers||k("REPLACE"),W},q}function D0(l={initialEntries:["/"]}){const s=l.initialEntries;let u=l.initialIndex?Math.min(Math.max(l.initialIndex,0),s.length-1):s.length-1;const c=s.map((d,y)=>So(y,void 0));return Av({getLocation:()=>Wi(s[u],c[u]),getLength:()=>s.length,pushState:(d,y)=>{u<s.length-1&&(s.splice(u+1),c.splice(u+1)),c.push(y),s.push(d),u=Math.max(s.length-1,0)},replaceState:(d,y)=>{c[u]=y,s[u]=d},back:()=>{u=Math.max(u-1,0)},forward:()=>{u=Math.min(u+1,s.length-1)},go:d=>{u=Math.min(Math.max(u+d,0),s.length-1)},createHref:d=>d})}function Wi(l,s){const u=l.indexOf("#"),c=l.indexOf("?");return{href:l,pathname:l.substring(0,u>0?c>0?Math.min(u,c):u:c>0?c:l.length),hash:u>-1?l.substring(u):"",search:c>-1?l.slice(c,u===-1?void 0:u):"",state:s||{[da]:0,key:xo()}}}function xo(){return(Math.random()+1).toString(36).substring(7)}var C0="Invariant failed";function Fe(l,s){if(!l)throw new Error(C0)}function bo(l){return l[l.length-1]}function z0(l){return typeof l=="function"}function Ba(l,s){return z0(l)?l(s):l}function _o(l,s){return s.reduce((u,c)=>(u[c]=l[c],u),{})}function Xe(l,s){if(l===s)return l;const u=s,c=Zy(l)&&Zy(u);if(c||yn(l)&&yn(u)){const o=c?l:Object.keys(l),d=o.length,y=c?u:Object.keys(u),v=y.length,S=c?[]:{};let h=0;for(let g=0;g<v;g++){const p=c?g:y[g];(!c&&o.includes(p)||c)&&l[p]===void 0&&u[p]===void 0?(S[p]=void 0,h++):(S[p]=Xe(l[p],u[p]),S[p]===l[p]&&l[p]!==void 0&&h++)}return d===v&&h===d?l:S}return u}function yn(l){if(!Xy(l))return!1;const s=l.constructor;if(typeof s>"u")return!0;const u=s.prototype;return!(!Xy(u)||!u.hasOwnProperty("isPrototypeOf"))}function Xy(l){return Object.prototype.toString.call(l)==="[object Object]"}function Zy(l){return Array.isArray(l)&&l.length===Object.keys(l).length}function Jy(l,s){let u=Object.keys(l);return s&&(u=u.filter(c=>l[c]!==void 0)),u}function wl(l,s,u){if(l===s)return!0;if(typeof l!=typeof s)return!1;if(yn(l)&&yn(s)){const c=(u==null?void 0:u.ignoreUndefined)??!0,o=Jy(l,c),d=Jy(s,c);return!(u!=null&&u.partial)&&o.length!==d.length?!1:d.every(y=>wl(l[y],s[y],u))}return Array.isArray(l)&&Array.isArray(s)?l.length!==s.length?!1:!l.some((c,o)=>!wl(c,s[o],u)):!1}function Dl(l){let s,u;const c=new Promise((o,d)=>{s=o,u=d});return c.status="pending",c.resolve=o=>{c.status="resolved",c.value=o,s(o),l==null||l(o)},c.reject=o=>{c.status="rejected",u(o)},c}function w0(l){return/%[0-9A-Fa-f]{2}/.test(l)}function vn(l){return ws(l.filter(s=>s!==void 0).join("/"))}function ws(l){return l.replace(/\/{2,}/g,"/")}function Do(l){return l==="/"?l:l.replace(/^\/{1,}/,"")}function Vl(l){return l==="/"?l:l.replace(/\/{1,}$/,"")}function U0(l){return Vl(Do(l))}function Os(l,s){return l!=null&&l.endsWith("/")&&l!=="/"&&l!==`${s}/`?l.slice(0,-1):l}function N0(l,s,u){return Os(l,u)===Os(s,u)}function L0({basepath:l,base:s,to:u,trailingSlash:c="never",caseSensitive:o}){var d,y;s=As(l,s,o),u=As(l,u,o);let v=Yl(s);const S=Yl(u);v.length>1&&((d=bo(v))==null?void 0:d.value)==="/"&&v.pop(),S.forEach((p,b)=>{p.value==="/"?b?b===S.length-1&&v.push(p):v=[p]:p.value===".."?v.pop():p.value==="."||v.push(p)}),v.length>1&&(((y=bo(v))==null?void 0:y.value)==="/"?c==="never"&&v.pop():c==="always"&&v.push({type:"pathname",value:"/"}));const h=v.map(p=>{if(p.type==="param"){const b=p.value.substring(1);if(p.prefixSegment&&p.suffixSegment)return`${p.prefixSegment}{$${b}}${p.suffixSegment}`;if(p.prefixSegment)return`${p.prefixSegment}{$${b}}`;if(p.suffixSegment)return`{$${b}}${p.suffixSegment}`}if(p.type==="wildcard"){if(p.prefixSegment&&p.suffixSegment)return`${p.prefixSegment}{$}${p.suffixSegment}`;if(p.prefixSegment)return`${p.prefixSegment}{$}`;if(p.suffixSegment)return`{$}${p.suffixSegment}`}return p.value}),g=vn([l,...h]);return ws(g)}const j0=/^\$.{1,}$/,H0=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,B0=/^\$$/,q0=/^(.*?)\{\$\}(.*)$/;function Yl(l){if(!l)return[];l=ws(l);const s=[];if(l.slice(0,1)==="/"&&(l=l.substring(1),s.push({type:"pathname",value:"/"})),!l)return s;const u=l.split("/").filter(Boolean);return s.push(...u.map(c=>{const o=c.match(q0);if(o){const y=o[1],v=o[2];return{type:"wildcard",value:"$",prefixSegment:y||void 0,suffixSegment:v||void 0}}const d=c.match(H0);if(d){const y=d[1],v=d[2],S=d[3];return{type:"param",value:""+v,prefixSegment:y||void 0,suffixSegment:S||void 0}}return j0.test(c)?{type:"param",value:"$"+c.substring(1),prefixSegment:void 0,suffixSegment:void 0}:B0.test(c)?{type:"wildcard",value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:"pathname",value:c.includes("%25")?c.split("%25").map(y=>decodeURI(y)).join("%25"):decodeURI(c)}})),l.slice(-1)==="/"&&(l=l.substring(1),s.push({type:"pathname",value:"/"})),s}function ao({path:l,params:s,leaveWildcards:u,leaveParams:c,decodeCharMap:o}){const d=Yl(l);function y(g){const p=s[g],b=typeof p=="string";return["*","_splat"].includes(g)?b?encodeURI(p):p:b?Q0(p,o):p}let v=!1;const S={},h=vn(d.map(g=>{if(g.type==="wildcard"){S._splat=s._splat;const p=g.prefixSegment||"",b=g.suffixSegment||"",x=y("_splat");return u?`${p}${g.value}${x??""}${b}`:`${p}${x}${b}`}if(g.type==="param"){const p=g.value.substring(1);!v&&!(p in s)&&(v=!0),S[p]=s[p];const b=g.prefixSegment||"",x=g.suffixSegment||"";if(c){const M=y(g.value);return`${b}${g.value}${M??""}${x}`}return`${b}${y(p)??"undefined"}${x}`}return g.value}));return{usedParams:S,interpolatedPath:h,isMissingParams:v}}function Q0(l,s){let u=encodeURIComponent(l);if(s)for(const[c,o]of s)u=u.replaceAll(c,o);return u}function Eo(l,s,u){const c=G0(l,s,u);if(!(u.to&&!c))return c??{}}function As(l,s,u=!1){const c=u?l:l.toLowerCase(),o=u?s:s.toLowerCase();switch(!0){case c==="/":return s;case o===c:return"";case s.length<l.length:return s;case o[c.length]!=="/":return s;case o.startsWith(c):return s.slice(l.length);default:return s}}function G0(l,s,u){if(l!=="/"&&!s.startsWith(l))return;s=As(l,s,u.caseSensitive);const c=As(l,`${u.to??"$"}`,u.caseSensitive),o=Yl(s),d=Yl(c);s.startsWith("/")||o.unshift({type:"pathname",value:"/"}),c.startsWith("/")||d.unshift({type:"pathname",value:"/"});const y={};return(()=>{var S;for(let h=0;h<Math.max(o.length,d.length);h++){const g=o[h],p=d[h],b=h>=o.length-1,x=h>=d.length-1;if(p){if(p.type==="wildcard"){const M=o.slice(h);let U;if(p.prefixSegment||p.suffixSegment){if(!g)return!1;const j=p.prefixSegment||"",G=p.suffixSegment||"",Z=g.value;if("prefixSegment"in p&&!Z.startsWith(j)||"suffixSegment"in p&&!((S=o[o.length-1])!=null&&S.value.endsWith(G)))return!1;let K=decodeURI(vn(M.map(I=>I.value)));j&&K.startsWith(j)&&(K=K.slice(j.length)),G&&K.endsWith(G)&&(K=K.slice(0,K.length-G.length)),U=K}else U=decodeURI(vn(M.map(j=>j.value)));return y["*"]=U,y._splat=U,!0}if(p.type==="pathname"){if(p.value==="/"&&!(g!=null&&g.value))return!0;if(g){if(u.caseSensitive){if(p.value!==g.value)return!1}else if(p.value.toLowerCase()!==g.value.toLowerCase())return!1}}if(!g)return!1;if(p.type==="param"){if(g.value==="/")return!1;let M;if(p.prefixSegment||p.suffixSegment){const U=p.prefixSegment||"",j=p.suffixSegment||"",G=g.value;if(U&&!G.startsWith(U)||j&&!G.endsWith(j))return!1;let Z=G;U&&Z.startsWith(U)&&(Z=Z.slice(U.length)),j&&Z.endsWith(j)&&(Z=Z.slice(0,Z.length-j.length)),M=decodeURIComponent(Z)}else M=decodeURIComponent(g.value);y[p.value.substring(1)]=M}}if(!b&&x)return y["**"]=vn(o.slice(h+1).map(M=>M.value)),!!u.fuzzy&&(p==null?void 0:p.value)!=="/"}return!0})()?y:void 0}function Re(l){return!!(l!=null&&l.isNotFound)}function V0(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{return}}const xs="tsr-scroll-restoration-v1_3",Y0=(l,s)=>{let u;return(...c)=>{u||(u=setTimeout(()=>{l(...c),u=null},s))}};function K0(){const l=V0();if(!l)return;const s=l.getItem(xs);let u=s?JSON.parse(s):{};return{state:u,set:c=>(u=Ba(c,u)||u,l.setItem(xs,JSON.stringify(u)))}}const lo=K0(),Ro=l=>l.state.key||l.href;function X0(l){const s=[];let u;for(;u=l.parentNode;)s.unshift(`${l.tagName}:nth-child(${[].indexOf.call(u.children,l)+1})`),l=u;return`${s.join(" > ")}`.toLowerCase()}let Ds=!1;function xv(l,s,u,c,o){var d;let y;try{y=JSON.parse(sessionStorage.getItem(l)||"{}")}catch(h){console.error(h);return}const v=s||((d=window.history.state)==null?void 0:d.key),S=y[v];Ds=!0,(()=>{if(c&&S){for(const g in S){const p=S[g];if(g==="window")window.scrollTo({top:p.scrollY,left:p.scrollX,behavior:u});else if(g){const b=document.querySelector(g);b&&(b.scrollLeft=p.scrollX,b.scrollTop=p.scrollY)}}return}const h=window.location.hash.split("#")[1];if(h){const g=(window.history.state||{}).__hashScrollIntoViewOptions??!0;if(g){const p=document.getElementById(h);p&&p.scrollIntoView(g)}return}["window",...(o==null?void 0:o.filter(g=>g!=="window"))??[]].forEach(g=>{const p=g==="window"?window:document.querySelector(g);p&&p.scrollTo({top:0,left:0,behavior:u})})})(),Ds=!1}function Z0(l,s){if(lo===void 0||((l.options.scrollRestoration??!1)&&(l.isScrollRestoring=!0),typeof document>"u"||l.isScrollRestorationSetup))return;l.isScrollRestorationSetup=!0,Ds=!1;const c=l.options.getScrollRestorationKey||Ro;window.history.scrollRestoration="manual";const o=d=>{if(Ds||!l.isScrollRestoring)return;let y="";if(d.target===document||d.target===window)y="window";else{const S=d.target.getAttribute("data-scroll-restoration-id");S?y=`[data-scroll-restoration-id="${S}"]`:y=X0(d.target)}const v=c(l.state.location);lo.set(S=>{const h=S[v]=S[v]||{},g=h[y]=h[y]||{};if(y==="window")g.scrollX=window.scrollX||0,g.scrollY=window.scrollY||0;else if(y){const p=document.querySelector(y);p&&(g.scrollX=p.scrollLeft||0,g.scrollY=p.scrollTop||0)}return S})};typeof document<"u"&&document.addEventListener("scroll",Y0(o,100),!0),l.subscribe("onRendered",d=>{const y=c(d.toLocation);if(!l.resetNextScroll){l.resetNextScroll=!0;return}xv(xs,y,l.options.scrollRestorationBehavior||void 0,l.isScrollRestoring||void 0,l.options.scrollToTopSelectors||void 0),l.isScrollRestoring&&lo.set(v=>(v[y]=v[y]||{},v))})}function J0(l){if(typeof document<"u"&&document.querySelector){const s=l.state.location.state.__hashScrollIntoViewOptions??!0;if(s&&l.state.location.hash!==""){const u=document.getElementById(l.state.location.hash);u&&u.scrollIntoView(s)}}}function Dv(l,s){const u=Object.entries(l).flatMap(([o,d])=>Array.isArray(d)?d.map(y=>[o,String(y)]):[[o,String(d)]]);return""+new URLSearchParams(u).toString()}function io(l){if(!l)return"";const s=w0(l)?decodeURIComponent(l):decodeURIComponent(encodeURIComponent(l));return s==="false"?!1:s==="true"?!0:+s*0===0&&+s+""===s?+s:s}function F0(l,s){const u=l;return[...new URLSearchParams(u).entries()].reduce((d,[y,v])=>{const S=d[y];return S==null?d[y]=io(v):d[y]=Array.isArray(S)?[...S,io(v)]:[S,io(v)],d},{})}const k0=P0(JSON.parse),$0=W0(JSON.stringify,JSON.parse);function P0(l){return s=>{s.substring(0,1)==="?"&&(s=s.substring(1));const u=F0(s);for(const c in u){const o=u[c];if(typeof o=="string")try{u[c]=l(o)}catch{}}return u}}function W0(l,s){function u(c){if(typeof c=="object"&&c!==null)try{return l(c)}catch{}else if(typeof c=="string"&&typeof s=="function")try{return s(c),l(c)}catch{}return c}return c=>{c={...c},Object.keys(c).forEach(d=>{const y=c[d];typeof y>"u"||y===void 0?delete c[d]:c[d]=u(y)});const o=Dv(c).toString();return o?`?${o}`:""}}const nn="__root__";function I0(l){if(l.statusCode=l.statusCode||l.code||307,!l.reloadDocument)try{new URL(`${l.href}`),l.reloadDocument=!0}catch{}const s=new Headers(l.headers||{}),u=new Response(null,{status:l.statusCode,headers:s});if(u.options=l,l.throw)throw u;return u}function Ee(l){return l instanceof Response&&!!l.options}function tg(l){if(typeof l=="object"&&l.isSerializedRedirect)return I0(l)}function eg(l){return l instanceof Error?{name:l.name,message:l.message}:{data:l}}function qa(l){const s=l.resolvedLocation,u=l.location,c=(s==null?void 0:s.pathname)!==u.pathname,o=(s==null?void 0:s.href)!==u.href,d=(s==null?void 0:s.hash)!==u.hash;return{fromLocation:s,toLocation:u,pathChanged:c,hrefChanged:o,hashChanged:d}}class ng{constructor(s){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=u=>u(),this.isShell=!1,this.update=u=>{var c;u.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const o=this.options;this.options={...this.options,...u},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(d=>[encodeURIComponent(d),d])):void 0,(!this.basepath||u.basepath&&u.basepath!==o.basepath)&&(u.basepath===void 0||u.basepath===""||u.basepath==="/"?this.basepath="/":this.basepath=`/${U0(u.basepath)}`),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??(this.isServer?D0({initialEntries:[this.basepath||"/"]}):x0()),this.latestLocation=this.parseLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new go(lg(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(d=>!["redirected"].includes(d.status))}}}),Z0(this)),typeof window<"u"&&"CSS"in window&&typeof((c=window.CSS)==null?void 0:c.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)")),this.latestLocation.search.__TSS_SHELL&&(this.isShell=!0)},this.buildRouteTree=()=>{const{routesById:u,routesByPath:c,flatRoutes:o}=ig({routeTree:this.routeTree,initRoute:(y,v)=>{y.init({originalIndex:v,defaultSsr:this.options.defaultSsr})}});this.routesById=u,this.routesByPath=c,this.flatRoutes=o;const d=this.options.notFoundRoute;d&&(d.init({originalIndex:99999999999,defaultSsr:this.options.defaultSsr}),this.routesById[d.id]=d)},this.subscribe=(u,c)=>{const o={eventType:u,fn:c};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=u=>{this.subscribers.forEach(c=>{c.eventType===u.type&&c.fn(u)})},this.parseLocation=(u,c)=>{const o=({pathname:S,search:h,hash:g,state:p})=>{const b=this.options.parseSearch(h),x=this.options.stringifySearch(b);return{pathname:S,searchStr:x,search:Xe(u==null?void 0:u.search,b),hash:g.split("#").reverse()[0]??"",href:`${S}${x}${g}`,state:Xe(u==null?void 0:u.state,p)}},d=o(c??this.history.location),{__tempLocation:y,__tempKey:v}=d.state;if(y&&(!v||v===this.tempLocationKey)){const S=o(y);return S.state.key=d.state.key,delete S.state.__tempLocation,{...S,maskedLocation:d}}return d},this.resolvePathWithBase=(u,c)=>L0({basepath:this.basepath,base:u,to:ws(c),trailingSlash:this.options.trailingSlash,caseSensitive:this.options.caseSensitive}),this.matchRoutes=(u,c,o)=>typeof u=="string"?this.matchRoutesInternal({pathname:u,search:c},o):this.matchRoutesInternal(u,c),this.getMatchedRoutes=(u,c)=>ug({pathname:u,routePathname:c,basepath:this.basepath,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes}),this.cancelMatch=u=>{const c=this.getMatch(u);c&&(c.abortController.abort(),clearTimeout(c.pendingTimeout))},this.cancelMatches=()=>{var u;(u=this.state.pendingMatches)==null||u.forEach(c=>{this.cancelMatch(c.id)})},this.buildLocation=u=>{const c=(d={})=>{var y;const v=d._fromLocation||this.latestLocation,S=this.matchRoutes(v,{_buildLocation:!0}),h=bo(S);let g=h.fullPath;d.unsafeRelative==="path"?g=v.pathname:d.to&&d.from&&(g=d.from,[...S].reverse().find($=>$.fullPath===g||$.fullPath===vn([g,"/"]))||console.warn(`Could not find match for from: ${d.from}`));const p=h.search,b={...h.params},x=d.to?this.resolvePathWithBase(g,`${d.to}`):g;let M=(d.params??!0)===!0?b:{...b,...Ba(d.params,b)};const U=this.matchRoutes(x,{},{_buildLocation:!0}).map(Y=>this.looseRoutesById[Y.routeId]);Object.keys(M).length>0&&U.map(Y=>{var $;return(($=Y.options.params)==null?void 0:$.stringify)??Y.options.stringifyParams}).filter(Boolean).forEach(Y=>{M={...M,...Y(M)}});const j=ao({path:x,params:M??{},leaveWildcards:!1,leaveParams:u.leaveParams,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath;let G=p;if(u._includeValidateSearch&&((y=this.options.search)!=null&&y.strict)){let Y={};U.forEach($=>{try{$.options.validateSearch&&(Y={...Y,...To($.options.validateSearch,{...Y,...G})??{}})}catch{}}),G=Y}G=sg({search:G,dest:d,destRoutes:U,_includeValidateSearch:u._includeValidateSearch}),G=Xe(p,G);const Z=this.options.stringifySearch(G),K=d.hash===!0?v.hash:d.hash?Ba(d.hash,v.hash):void 0,I=K?`#${K}`:"";let k=d.state===!0?v.state:d.state?Ba(d.state,v.state):{};return k=Xe(v.state,k),{pathname:j,search:G,searchStr:Z,state:k,hash:K??"",href:`${j}${Z}${I}`,unmaskOnReload:d.unmaskOnReload}},o=(d={},y)=>{var v;const S=c(d);let h=y?c(y):void 0;if(!h){let g={};const p=(v=this.options.routeMasks)==null?void 0:v.find(b=>{const x=Eo(this.basepath,S.pathname,{to:b.from,caseSensitive:!1,fuzzy:!1});return x?(g=x,!0):!1});if(p){const{from:b,...x}=p;y={..._o(u,["from"]),...x,params:g},h=c(y)}}if(h){const g=c(y);S.maskedLocation=g}return S};return u.mask?o(u,{..._o(u,["from"]),...u.mask}):o(u)},this.commitLocation=({viewTransition:u,ignoreBlocker:c,...o})=>{const d=()=>{const S=["key","__TSR_index","__hashScrollIntoViewOptions"];S.forEach(g=>{o.state[g]=this.latestLocation.state[g]});const h=wl(o.state,this.latestLocation.state);return S.forEach(g=>{delete o.state[g]}),h},y=this.latestLocation.href===o.href,v=this.commitLocationPromise;if(this.commitLocationPromise=Dl(()=>{v==null||v.resolve()}),y&&d())this.load();else{let{maskedLocation:S,hashScrollIntoView:h,...g}=o;S&&(g={...S,state:{...S.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=u,this.history[o.replace?"replace":"push"](g.href,g.state,{ignoreBlocker:c})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:u,resetScroll:c,hashScrollIntoView:o,viewTransition:d,ignoreBlocker:y,href:v,...S}={})=>{if(v){const g=this.history.location.state.__TSR_index,p=Wi(v,{__TSR_index:u?g:g+1});S.to=p.pathname,S.search=this.options.parseSearch(p.search),S.hash=p.hash.slice(1)}const h=this.buildLocation({...S,_includeValidateSearch:!0});return this.commitLocation({...h,viewTransition:d,replace:u,resetScroll:c,hashScrollIntoView:o,ignoreBlocker:y})},this.navigate=({to:u,reloadDocument:c,href:o,...d})=>{if(!c&&o)try{new URL(`${o}`),c=!0}catch{}if(c){if(!o){const y=this.buildLocation({to:u,...d});o=this.history.createHref(y.href)}d.replace?window.location.replace(o):window.location.href=o;return}return this.buildAndCommitLocation({...d,href:o,to:u})},this.beforeLoad=()=>{this.cancelMatches(),this.latestLocation=this.parseLocation(this.latestLocation);const u=this.matchRoutes(this.latestLocation);this.__store.setState(c=>({...c,status:"pending",isLoading:!0,location:this.latestLocation,pendingMatches:u,cachedMatches:c.cachedMatches.filter(o=>!u.find(d=>d.id===o.id))}))},this.load=async u=>{let c,o,d;for(d=new Promise(y=>{this.startTransition(async()=>{var v;try{this.beforeLoad();const S=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...qa({resolvedLocation:h,location:S})}),this.emit({type:"onBeforeLoad",...qa({resolvedLocation:h,location:S})}),await this.loadMatches({sync:u==null?void 0:u.sync,matches:this.state.pendingMatches,location:S,onReady:async()=>{this.startViewTransition(async()=>{let g,p,b;Vy(()=>{this.__store.setState(x=>{const M=x.matches,U=x.pendingMatches||x.matches;return g=M.filter(j=>!U.find(G=>G.id===j.id)),p=U.filter(j=>!M.find(G=>G.id===j.id)),b=M.filter(j=>U.find(G=>G.id===j.id)),{...x,isLoading:!1,loadedAt:Date.now(),matches:U,pendingMatches:void 0,cachedMatches:[...x.cachedMatches,...g.filter(j=>j.status!=="error")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[p,"onEnter"],[b,"onStay"]].forEach(([x,M])=>{x.forEach(U=>{var j,G;(G=(j=this.looseRoutesById[U.routeId].options)[M])==null||G.call(j,U)})})})}})}catch(S){Ee(S)?(c=S,this.isServer||this.navigate({...c.options,replace:!0,ignoreBlocker:!0})):Re(S)&&(o=S),this.__store.setState(h=>({...h,statusCode:c?c.status:o?404:h.matches.some(g=>g.status==="error")?500:200,redirect:c}))}this.latestLoadPromise===d&&((v=this.commitLocationPromise)==null||v.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),y()})}),this.latestLoadPromise=d,await d;this.latestLoadPromise&&d!==this.latestLoadPromise;)await this.latestLoadPromise;this.hasNotFoundMatch()&&this.__store.setState(y=>({...y,statusCode:404}))},this.startViewTransition=u=>{const c=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,c&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof c=="object"&&this.isViewTransitionTypesSupported){const d=this.latestLocation,y=this.state.resolvedLocation,v=typeof c.types=="function"?c.types(qa({resolvedLocation:y,location:d})):c.types;o={update:u,types:v}}else o=u;document.startViewTransition(o)}else u()},this.updateMatch=(u,c)=>{var o;let d;const y=(o=this.state.pendingMatches)==null?void 0:o.find(g=>g.id===u),v=this.state.matches.find(g=>g.id===u),S=this.state.cachedMatches.find(g=>g.id===u),h=y?"pendingMatches":v?"matches":S?"cachedMatches":"";return h&&this.__store.setState(g=>{var p;return{...g,[h]:(p=g[h])==null?void 0:p.map(b=>b.id===u?d=c(b):b)}}),d},this.getMatch=u=>[...this.state.cachedMatches,...this.state.pendingMatches??[],...this.state.matches].find(c=>c.id===u),this.loadMatches=async({location:u,matches:c,preload:o,onReady:d,updateMatch:y=this.updateMatch,sync:v})=>{let S,h=!1;const g=async()=>{h||(h=!0,await(d==null?void 0:d()))},p=x=>!!(o&&!this.state.matches.find(M=>M.id===x)),b=(x,M)=>{var U,j,G,Z;if(Ee(M)||Re(M)){if(Ee(M)&&M.redirectHandled&&!M.options.reloadDocument)throw M;if(y(x.id,K=>({...K,status:Ee(M)?"redirected":Re(M)?"notFound":"error",isFetching:!1,error:M,beforeLoadPromise:void 0,loaderPromise:void 0})),M.routeId||(M.routeId=x.routeId),(U=x.beforeLoadPromise)==null||U.resolve(),(j=x.loaderPromise)==null||j.resolve(),(G=x.loadPromise)==null||G.resolve(),Ee(M))throw h=!0,M.options._fromLocation=u,M.redirectHandled=!0,M=this.resolveRedirect(M),M;if(Re(M))throw this._handleNotFound(c,M,{updateMatch:y}),(Z=this.serverSsr)==null||Z.onMatchSettled({router:this,match:this.getMatch(x.id)}),M}};try{await new Promise((x,M)=>{(async()=>{var U,j,G,Z;try{const K=(Y,$,q)=>{var w,W;const{id:ot,routeId:et}=c[Y],dt=this.looseRoutesById[et];if($ instanceof Promise)throw $;$.routerCode=q,S=S??Y,b(this.getMatch(ot),$);try{(W=(w=dt.options).onError)==null||W.call(w,$)}catch(pt){$=pt,b(this.getMatch(ot),$)}y(ot,pt=>{var ht,C;return(ht=pt.beforeLoadPromise)==null||ht.resolve(),(C=pt.loadPromise)==null||C.resolve(),{...pt,error:$,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController,beforeLoadPromise:void 0}})};for(const[Y,{id:$,routeId:q}]of c.entries()){const w=this.getMatch($),W=(U=c[Y-1])==null?void 0:U.id,ot=this.looseRoutesById[q],et=ot.options.pendingMs??this.options.defaultPendingMs,dt=!!(d&&!this.isServer&&!p($)&&(ot.options.loader||ot.options.beforeLoad||Fy(ot))&&typeof et=="number"&&et!==1/0&&(ot.options.pendingComponent??((j=this.options)==null?void 0:j.defaultPendingComponent)));let pt=!0;if((w.beforeLoadPromise||w.loaderPromise)&&(dt&&setTimeout(()=>{try{g()}catch{}},et),await w.beforeLoadPromise,pt=this.getMatch($).status!=="success"),pt){try{y($,St=>{const it=St.loadPromise;return{...St,loadPromise:Dl(()=>{it==null||it.resolve()}),beforeLoadPromise:Dl()}});const ht=new AbortController;let C;dt&&(C=setTimeout(()=>{try{g()}catch{}},et));const{paramsError:X,searchError:at}=this.getMatch($);X&&K(Y,X,"PARSE_PARAMS"),at&&K(Y,at,"VALIDATE_SEARCH");const gt=()=>W?this.getMatch(W).context:this.options.context??{};y($,St=>({...St,isFetching:"beforeLoad",fetchCount:St.fetchCount+1,abortController:ht,pendingTimeout:C,context:{...gt(),...St.__routeContext}}));const{search:E,params:N,context:F,cause:J}=this.getMatch($),P=p($),lt={search:E,abortController:ht,params:N,preload:P,context:F,location:u,navigate:St=>this.navigate({...St,_fromLocation:u}),buildLocation:this.buildLocation,cause:P?"preload":J,matches:c},tt=await((Z=(G=ot.options).beforeLoad)==null?void 0:Z.call(G,lt))??{};(Ee(tt)||Re(tt))&&K(Y,tt,"BEFORE_LOAD"),y($,St=>({...St,__beforeLoadContext:tt,context:{...gt(),...St.__routeContext,...tt},abortController:ht}))}catch(ht){K(Y,ht,"BEFORE_LOAD")}y($,ht=>{var C;return(C=ht.beforeLoadPromise)==null||C.resolve(),{...ht,beforeLoadPromise:void 0,isFetching:!1}})}}const I=c.slice(0,S),k=[];I.forEach(({id:Y,routeId:$},q)=>{k.push((async()=>{const{loaderPromise:w}=this.getMatch(Y);let W=!1,ot=!1;if(w){await w;const et=this.getMatch(Y);et.error&&b(et,et.error)}else{const et=k[q-1],dt=this.looseRoutesById[$],pt=()=>{const{params:P,loaderDeps:lt,abortController:tt,context:St,cause:it}=this.getMatch(Y),bt=p(Y);return{params:P,deps:lt,preload:!!bt,parentMatchPromise:et,abortController:tt,context:St,location:u,navigate:Nt=>this.navigate({...Nt,_fromLocation:u}),cause:bt?"preload":it,route:dt}},ht=Date.now()-this.getMatch(Y).updatedAt,C=p(Y),X=C?dt.options.preloadStaleTime??this.options.defaultPreloadStaleTime??3e4:dt.options.staleTime??this.options.defaultStaleTime??0,at=dt.options.shouldReload,gt=typeof at=="function"?at(pt()):at;y(Y,P=>({...P,loaderPromise:Dl(),preload:!!C&&!this.state.matches.find(lt=>lt.id===Y)}));const E=async()=>{var P,lt,tt,St,it,bt;const Nt=this.getMatch(Y);if(!Nt)return;const Qt={matches:c,match:Nt,params:Nt.params,loaderData:Nt.loaderData},Bt=await((lt=(P=dt.options).head)==null?void 0:lt.call(P,Qt)),me=Bt==null?void 0:Bt.meta,$e=Bt==null?void 0:Bt.links,Nn=Bt==null?void 0:Bt.scripts,Le=await((St=(tt=dt.options).scripts)==null?void 0:St.call(tt,Qt)),Wt=await((bt=(it=dt.options).headers)==null?void 0:bt.call(it,Qt));return{meta:me,links:$e,headScripts:Nn,headers:Wt,scripts:Le}},N=async()=>{var P,lt,tt,St,it;try{const bt=async()=>{const Nt=this.getMatch(Y);Nt.minPendingPromise&&await Nt.minPendingPromise};try{this.loadRouteChunk(dt),y(Y,Bt=>({...Bt,isFetching:"loader"}));const Nt=await((lt=(P=dt.options).loader)==null?void 0:lt.call(P,pt()));b(this.getMatch(Y),Nt),await dt._lazyPromise,await bt(),await dt._componentsPromise,y(Y,Bt=>({...Bt,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:Nt}));const Qt=await E();y(Y,Bt=>({...Bt,...Qt}))}catch(Nt){let Qt=Nt;await bt(),b(this.getMatch(Y),Nt);try{(St=(tt=dt.options).onError)==null||St.call(tt,Nt)}catch(me){Qt=me,b(this.getMatch(Y),me)}const Bt=await E();y(Y,me=>({...me,error:Qt,status:"error",isFetching:!1,...Bt}))}(it=this.serverSsr)==null||it.onMatchSettled({router:this,match:this.getMatch(Y)})}catch(bt){const Nt=await E();y(Y,Qt=>({...Qt,loaderPromise:void 0,...Nt})),b(this.getMatch(Y),bt)}},{status:F,invalid:J}=this.getMatch(Y);if(W=F==="success"&&(J||(gt??ht>X)),!(C&&dt.options.preload===!1))if(W&&!v)ot=!0,(async()=>{try{await N();const{loaderPromise:P,loadPromise:lt}=this.getMatch(Y);P==null||P.resolve(),lt==null||lt.resolve(),y(Y,tt=>({...tt,loaderPromise:void 0}))}catch(P){Ee(P)&&await this.navigate(P.options)}})();else if(F!=="success"||W&&v)await N();else{const P=await E();y(Y,lt=>({...lt,...P}))}}if(!ot){const{loaderPromise:et,loadPromise:dt}=this.getMatch(Y);et==null||et.resolve(),dt==null||dt.resolve()}return y(Y,et=>({...et,isFetching:ot?et.isFetching:!1,loaderPromise:ot?et.loaderPromise:void 0,invalid:!1})),this.getMatch(Y)})())}),await Promise.all(k),x()}catch(K){M(K)}})()}),await g()}catch(x){if(Ee(x)||Re(x))throw Re(x)&&!o&&await g(),x}return c},this.invalidate=u=>{const c=o=>{var d;return((d=u==null?void 0:u.filter)==null?void 0:d.call(u,o))??!0?{...o,invalid:!0,...o.status==="error"?{status:"pending",error:void 0}:{}}:o};return this.__store.setState(o=>{var d;return{...o,matches:o.matches.map(c),cachedMatches:o.cachedMatches.map(c),pendingMatches:(d=o.pendingMatches)==null?void 0:d.map(c)}}),this.load({sync:u==null?void 0:u.sync})},this.resolveRedirect=u=>(u.options.href||(u.options.href=this.buildLocation(u.options).href,u.headers.set("Location",u.options.href)),u.headers.get("Location")||u.headers.set("Location",u.options.href),u),this.clearCache=u=>{const c=u==null?void 0:u.filter;c!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(d=>!c(d))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const u=c=>{const o=this.looseRoutesById[c.routeId];if(!o.options.loader)return!0;const d=(c.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??5*60*1e3;return!(c.status!=="error"&&Date.now()-c.updatedAt<d)};this.clearCache({filter:u})},this.loadRouteChunk=u=>(u._lazyPromise===void 0&&(u.lazyFn?u._lazyPromise=u.lazyFn().then(c=>{const{id:o,...d}=c.options;Object.assign(u.options,d)}):u._lazyPromise=Promise.resolve()),u._componentsPromise===void 0&&(u._componentsPromise=u._lazyPromise.then(()=>Promise.all(Cv.map(async c=>{const o=u.options[c];o!=null&&o.preload&&await o.preload()})))),u._componentsPromise),this.preloadRoute=async u=>{const c=this.buildLocation(u);let o=this.matchRoutes(c,{throwOnError:!0,preload:!0,dest:u});const d=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(v=>v.id)),y=new Set([...d,...this.state.cachedMatches.map(v=>v.id)]);Vy(()=>{o.forEach(v=>{y.has(v.id)||this.__store.setState(S=>({...S,cachedMatches:[...S.cachedMatches,v]}))})});try{return o=await this.loadMatches({matches:o,location:c,preload:!0,updateMatch:(v,S)=>{d.has(v)?o=o.map(h=>h.id===v?S(h):h):this.updateMatch(v,S)}}),o}catch(v){if(Ee(v))return v.options.reloadDocument?void 0:await this.preloadRoute({...v.options,_fromLocation:c});Re(v)||console.error(v);return}},this.matchRoute=(u,c)=>{const o={...u,to:u.to?this.resolvePathWithBase(u.from||"",u.to):void 0,params:u.params||{},leaveParams:!0},d=this.buildLocation(o);if(c!=null&&c.pending&&this.state.status!=="pending")return!1;const v=((c==null?void 0:c.pending)===void 0?!this.state.isLoading:c.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,S=Eo(this.basepath,v.pathname,{...c,to:d.pathname});return!S||u.params&&!wl(S,u.params,{partial:!0})?!1:S&&((c==null?void 0:c.includeSearch)??!0)?wl(v.search,d.search,{partial:!0})?S:!1:S},this._handleNotFound=(u,c,{updateMatch:o=this.updateMatch}={})=>{var d;const y=this.routesById[c.routeId??""]??this.routeTree,v={};for(const h of u)v[h.routeId]=h;!y.options.notFoundComponent&&((d=this.options)!=null&&d.defaultNotFoundComponent)&&(y.options.notFoundComponent=this.options.defaultNotFoundComponent),Fe(y.options.notFoundComponent);const S=v[y.id];Fe(S,"Could not find match for route: "+y.id),o(S.id,h=>({...h,status:"notFound",error:c,isFetching:!1})),c.routerCode==="BEFORE_LOAD"&&y.parentRoute&&(c.routeId=y.parentRoute.id,this._handleNotFound(u,c,{updateMatch:o}))},this.hasNotFoundMatch=()=>this.__store.state.matches.some(u=>u.status==="notFound"||u.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...s,caseSensitive:s.caseSensitive??!1,notFoundMode:s.notFoundMode??"fuzzy",stringifySearch:s.stringifySearch??$0,parseSearch:s.parseSearch??k0}),typeof document<"u"&&(window.__TSR_ROUTER__=this)}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(s,u){var c;const{foundRoute:o,matchedRoutes:d,routeParams:y}=this.getMatchedRoutes(s.pathname,(c=u==null?void 0:u.dest)==null?void 0:c.to);let v=!1;(o?o.path!=="/"&&y["**"]:Vl(s.pathname))&&(this.options.notFoundRoute?d.push(this.options.notFoundRoute):v=!0);const S=(()=>{if(v){if(this.options.notFoundMode!=="root")for(let b=d.length-1;b>=0;b--){const x=d[b];if(x.children)return x.id}return nn}})(),h=d.map(b=>{var x;let M;const U=((x=b.options.params)==null?void 0:x.parse)??b.options.parseParams;if(U)try{const j=U(y);Object.assign(y,j)}catch(j){if(M=new ag(j.message,{cause:j}),u!=null&&u.throwOnError)throw M;return M}}),g=[],p=b=>(b==null?void 0:b.id)?b.context??this.options.context??{}:this.options.context??{};return d.forEach((b,x)=>{var M,U;const j=g[x-1],[G,Z,K]=(()=>{const pt=(j==null?void 0:j.search)??s.search,ht=(j==null?void 0:j._strictSearch)??{};try{const C=To(b.options.validateSearch,{...pt})??{};return[{...pt,...C},{...ht,...C},void 0]}catch(C){let X=C;if(C instanceof Cs||(X=new Cs(C.message,{cause:C})),u!=null&&u.throwOnError)throw X;return[pt,{},X]}})(),I=((U=(M=b.options).loaderDeps)==null?void 0:U.call(M,{search:G}))??"",k=I?JSON.stringify(I):"",{usedParams:Y,interpolatedPath:$}=ao({path:b.fullPath,params:y,decodeCharMap:this.pathParamsDecodeCharMap}),q=ao({path:b.id,params:y,leaveWildcards:!0,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath+k,w=this.getMatch(q),W=this.state.matches.find(pt=>pt.routeId===b.id),ot=W?"stay":"enter";let et;if(w)et={...w,cause:ot,params:W?Xe(W.params,y):y,_strictParams:Y,search:Xe(W?W.search:w.search,G),_strictSearch:Z};else{const pt=b.options.loader||b.options.beforeLoad||b.lazyFn||Fy(b)?"pending":"success";et={id:q,index:x,routeId:b.id,params:W?Xe(W.params,y):y,_strictParams:Y,pathname:vn([this.basepath,$]),updatedAt:Date.now(),search:W?Xe(W.search,G):G,_strictSearch:Z,searchError:void 0,status:pt,isFetching:!1,error:void 0,paramsError:h[x],__routeContext:{},__beforeLoadContext:{},context:{},abortController:new AbortController,fetchCount:0,cause:ot,loaderDeps:W?Xe(W.loaderDeps,I):I,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:b.options.staticData||{},loadPromise:Dl(),fullPath:b.fullPath}}u!=null&&u.preload||(et.globalNotFound=S===b.id),et.searchError=K;const dt=p(j);et.context={...dt,...et.__routeContext,...et.__beforeLoadContext},g.push(et)}),g.forEach((b,x)=>{var M,U;const j=this.looseRoutesById[b.routeId];if(!this.getMatch(b.id)&&(u==null?void 0:u._buildLocation)!==!0){const Z=g[x-1],K=p(Z),I={deps:b.loaderDeps,params:b.params,context:K,location:s,navigate:k=>this.navigate({...k,_fromLocation:s}),buildLocation:this.buildLocation,cause:b.cause,abortController:b.abortController,preload:!!b.preload,matches:g};b.__routeContext=((U=(M=j.options).context)==null?void 0:U.call(M,I))??{},b.context={...K,...b.__routeContext,...b.__beforeLoadContext}}}),g}}class Cs extends Error{}class ag extends Error{}function lg(l){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:l,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function To(l,s){if(l==null)return{};if("~standard"in l){const u=l["~standard"].validate(s);if(u instanceof Promise)throw new Cs("Async validation not supported");if(u.issues)throw new Cs(JSON.stringify(u.issues,void 0,2),{cause:u});return u.value}return"parse"in l?l.parse(s):typeof l=="function"?l(s):{}}const Cv=["component","errorComponent","pendingComponent","notFoundComponent"];function Fy(l){var s;for(const u of Cv)if((s=l.options[u])!=null&&s.preload)return!0;return!1}function ig({routeTree:l,initRoute:s}){const u={},c={},o=S=>{S.forEach((h,g)=>{s==null||s(h,g);const p=u[h.id];if(Fe(!p,`Duplicate routes found with id: ${String(h.id)}`),u[h.id]=h,!h.isRoot&&h.path){const x=Vl(h.fullPath);(!c[x]||h.fullPath.endsWith("/"))&&(c[x]=h)}const b=h.children;b!=null&&b.length&&o(b)})};o([l]);const d=[];Object.values(u).forEach((S,h)=>{var g;if(S.isRoot||!S.path)return;const p=Do(S.fullPath),b=Yl(p);for(;b.length>1&&((g=b[0])==null?void 0:g.value)==="/";)b.shift();const x=b.map(M=>M.value==="/"?.75:M.type==="param"&&M.prefixSegment&&M.suffixSegment?.55:M.type==="param"&&M.prefixSegment?.52:M.type==="param"&&M.suffixSegment?.51:M.type==="param"?.5:M.type==="wildcard"&&M.prefixSegment&&M.suffixSegment?.3:M.type==="wildcard"&&M.prefixSegment?.27:M.type==="wildcard"&&M.suffixSegment?.26:M.type==="wildcard"?.25:1);d.push({child:S,trimmed:p,parsed:b,index:h,scores:x})});const v=d.sort((S,h)=>{const g=Math.min(S.scores.length,h.scores.length);for(let p=0;p<g;p++)if(S.scores[p]!==h.scores[p])return h.scores[p]-S.scores[p];if(S.scores.length!==h.scores.length)return h.scores.length-S.scores.length;for(let p=0;p<g;p++)if(S.parsed[p].value!==h.parsed[p].value)return S.parsed[p].value>h.parsed[p].value?1:-1;return S.index-h.index}).map((S,h)=>(S.child.rank=h,S.child));return{routesById:u,routesByPath:c,flatRoutes:v}}function ug({pathname:l,routePathname:s,basepath:u,caseSensitive:c,routesByPath:o,routesById:d,flatRoutes:y}){let v={};const S=Vl(l),h=x=>{var M;return Eo(u,S,{to:x.fullPath,caseSensitive:((M=x.options)==null?void 0:M.caseSensitive)??c,fuzzy:!0})};let g=s!==void 0?o[s]:void 0;g?v=h(g):g=y.find(x=>{const M=h(x);return M?(v=M,!0):!1});let p=g||d[nn];const b=[p];for(;p.parentRoute;)p=p.parentRoute,b.unshift(p);return{matchedRoutes:b,routeParams:v,foundRoute:g}}function sg({search:l,dest:s,destRoutes:u,_includeValidateSearch:c}){const o=u.reduce((v,S)=>{var h;const g=[];if("search"in S.options)(h=S.options.search)!=null&&h.middlewares&&g.push(...S.options.search.middlewares);else if(S.options.preSearchFilters||S.options.postSearchFilters){const p=({search:b,next:x})=>{let M=b;"preSearchFilters"in S.options&&S.options.preSearchFilters&&(M=S.options.preSearchFilters.reduce((j,G)=>G(j),b));const U=x(M);return"postSearchFilters"in S.options&&S.options.postSearchFilters?S.options.postSearchFilters.reduce((j,G)=>G(j),U):U};g.push(p)}if(c&&S.options.validateSearch){const p=({search:b,next:x})=>{const M=x(b);try{return{...M,...To(S.options.validateSearch,M)??{}}}catch{return M}};g.push(p)}return v.concat(g)},[])??[],d=({search:v})=>s.search?s.search===!0?v:Ba(s.search,v):{};o.push(d);const y=(v,S)=>{if(v>=o.length)return S;const h=o[v];return h({search:S,next:p=>y(v+1,p)})};return y(0,l)}const hn=Symbol.for("TSR_DEFERRED_PROMISE");function rg(l,s){const u=l;return u[hn]||(u[hn]={status:"pending"},u.then(c=>{u[hn].status="success",u[hn].data=c}).catch(c=>{u[hn].status="error",u[hn].error={data:eg(c),__isServerError:!0}})),u}const cg="Error preloading route! ☝️";class zv{constructor(s){if(this.init=u=>{var c,o;this.originalIndex=u.originalIndex;const d=this.options,y=!(d!=null&&d.path)&&!(d!=null&&d.id);this.parentRoute=(o=(c=this.options).getParentRoute)==null?void 0:o.call(c),y?this._path=nn:this.parentRoute||Fe(!1);let v=y?nn:d==null?void 0:d.path;v&&v!=="/"&&(v=Do(v));const S=(d==null?void 0:d.id)||v;let h=y?nn:vn([this.parentRoute.id===nn?"":this.parentRoute.id,S]);v===nn&&(v="/"),h!==nn&&(h=vn(["/",h]));const g=h===nn?"/":vn([this.parentRoute.fullPath,v]);this._path=v,this._id=h,this._fullPath=g,this._to=g,this._ssr=(d==null?void 0:d.ssr)??u.defaultSsr??!0},this.clone=u=>{this._path=u._path,this._id=u._id,this._fullPath=u._fullPath,this._to=u._to,this._ssr=u._ssr,this.options.getParentRoute=u.options.getParentRoute,this.children=u.children},this.addChildren=u=>this._addFileChildren(u),this._addFileChildren=u=>(Array.isArray(u)&&(this.children=u),typeof u=="object"&&u!==null&&(this.children=Object.values(u)),this),this._addFileTypes=()=>this,this.updateLoader=u=>(Object.assign(this.options,u),this),this.update=u=>(Object.assign(this.options,u),this),this.lazy=u=>(this.lazyFn=u,this),this.options=s||{},this.isRoot=!(s!=null&&s.getParentRoute),s!=null&&s.id&&(s!=null&&s.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}get ssr(){return this._ssr}}class og extends zv{constructor(s){super(s)}}const ve={stringify:l=>JSON.stringify(l,function(u,c){const o=this[u],d=Ss.find(y=>y.stringifyCondition(o));return d?d.stringify(o):c}),parse:l=>JSON.parse(l,function(u,c){const o=this[u];if(yn(o)){const d=Ss.find(y=>y.parseCondition(o));if(d)return d.parse(o)}return c}),encode:l=>{if(Array.isArray(l))return l.map(u=>ve.encode(u));if(yn(l))return Object.fromEntries(Object.entries(l).map(([u,c])=>[u,ve.encode(c)]));const s=Ss.find(u=>u.stringifyCondition(l));return s?s.stringify(l):l},decode:l=>{if(yn(l)){const s=Ss.find(u=>u.parseCondition(l));if(s)return s.parse(l)}return Array.isArray(l)?l.map(s=>ve.decode(s)):yn(l)?Object.fromEntries(Object.entries(l).map(([s,u])=>[s,ve.decode(u)])):l}},Ji=(l,s,u,c)=>({key:l,stringifyCondition:s,stringify:o=>({[`$${l}`]:u(o)}),parseCondition:o=>Object.hasOwn(o,`$${l}`),parse:o=>c(o[`$${l}`])}),Ss=[Ji("undefined",l=>l===void 0,()=>0,()=>{}),Ji("date",l=>l instanceof Date,l=>l.toISOString(),l=>new Date(l)),Ji("error",l=>l instanceof Error,l=>({...l,message:l.message,stack:void 0,cause:l.cause}),l=>Object.assign(new Error(l.message),l)),Ji("formData",l=>l instanceof FormData,l=>{const s={};return l.forEach((u,c)=>{const o=s[c];o!==void 0?Array.isArray(o)?o.push(u):s[c]=[o,u]:s[c]=u}),s},l=>{const s=new FormData;return Object.entries(l).forEach(([u,c])=>{Array.isArray(c)?c.forEach(o=>s.append(u,o)):s.append(u,c)}),s}),Ji("bigint",l=>typeof l=="bigint",l=>l.toString(),l=>BigInt(l))];async function fg(l){var s,u,c;Fe((s=window.__TSR_SSR__)==null?void 0:s.dehydrated);const{manifest:o,dehydratedData:d,lastMatchId:y}=ve.parse(window.__TSR_SSR__.dehydrated);l.ssr={manifest:o,serializer:ve},l.clientSsr={getStreamedValue:h=>{var g;if(l.isServer)return;const p=(g=window.__TSR_SSR__)==null?void 0:g.streamedValues[h];if(p)return p.parsed||(p.parsed=l.ssr.serializer.parse(p.value)),p.parsed}};const v=l.matchRoutes(l.state.location),S=Promise.all(v.map(h=>{const g=l.looseRoutesById[h.routeId];return l.loadRouteChunk(g)}));return v.forEach(h=>{var g;const p=window.__TSR_SSR__.matches.find(b=>b.id===h.id);if(p)return Object.assign(h,p),p.__beforeLoadContext&&(h.__beforeLoadContext=l.ssr.serializer.parse(p.__beforeLoadContext)),p.loaderData&&(h.loaderData=l.ssr.serializer.parse(p.loaderData)),p.error&&(h.error=l.ssr.serializer.parse(p.error)),(g=h.extracted)==null||g.forEach(b=>{Mo(h,["loaderData",...b.path],b.value)}),h}),l.__store.setState(h=>({...h,matches:v})),(c=(u=l.options).hydrate)==null||c.call(u,d),await Promise.all(l.state.matches.map(async h=>{var g,p,b,x,M,U;const j=l.looseRoutesById[h.routeId],G=l.state.matches[h.index-1],Z=(G==null?void 0:G.context)??l.options.context??{},K={deps:h.loaderDeps,params:h.params,context:Z,location:l.state.location,navigate:$=>l.navigate({...$,_fromLocation:l.state.location}),buildLocation:l.buildLocation,cause:h.cause,abortController:h.abortController,preload:!1,matches:v};h.__routeContext=((p=(g=j.options).context)==null?void 0:p.call(g,K))??{},h.context={...Z,...h.__routeContext,...h.__beforeLoadContext};const I={matches:l.state.matches,match:h,params:h.params,loaderData:h.loaderData},k=await((x=(b=j.options).head)==null?void 0:x.call(b,I)),Y=await((U=(M=j.options).scripts)==null?void 0:U.call(M,I));h.meta=k==null?void 0:k.meta,h.links=k==null?void 0:k.links,h.headScripts=k==null?void 0:k.scripts,h.scripts=Y})),v[v.length-1].id!==y?await Promise.all([S,l.load()]):S}function Mo(l,s,u){s.length===1&&(l[s[0]]=u);const[c,...o]=s;Array.isArray(l)?Mo(l[Number(c)],o,u):yn(l)&&Mo(l[c],o,u)}const dg="modulepreload",hg=function(l){return"/"+l},ky={},ae=function(s,u,c){let o=Promise.resolve();if(u&&u.length>0){let y=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const v=document.querySelector("meta[property=csp-nonce]"),S=(v==null?void 0:v.nonce)||(v==null?void 0:v.getAttribute("nonce"));o=y(u.map(h=>{if(h=hg(h),h in ky)return;ky[h]=!0;const g=h.endsWith(".css"),p=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":dg,g||(b.as="script"),b.crossOrigin="",b.href=h,S&&b.setAttribute("nonce",S),document.head.appendChild(b),g)return new Promise((x,M)=>{b.addEventListener("load",x),b.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${h}`)))})}))}function d(y){const v=new Event("vite:preloadError",{cancelable:!0});if(v.payload=y,window.dispatchEvent(v),!v.defaultPrevented)throw y}return o.then(y=>{for(const v of y||[])v.status==="rejected"&&d(v.reason);return s().catch(d)})};const yg=[];function Rs(l,s){const u=s||l||{};return typeof u.method>"u"&&(u.method="GET"),{options:u,middleware:c=>Rs(void 0,Object.assign(u,{middleware:c})),validator:c=>Rs(void 0,Object.assign(u,{validator:c})),type:c=>Rs(void 0,Object.assign(u,{type:c})),handler:(...c)=>{const[o,d]=c;Object.assign(u,{...o,extractedFn:o,serverFn:d});const y=[...u.middleware||[],_g(u)];return Object.assign(async v=>$y(y,"client",{...o,...u,data:v==null?void 0:v.data,headers:v==null?void 0:v.headers,signal:v==null?void 0:v.signal,context:{}}).then(S=>{if(u.response==="full")return S;if(S.error)throw S.error;return S.result}),{...o,__executeServer:async(v,S)=>{const h=v instanceof FormData?pg(v):v;h.type=typeof u.type=="function"?u.type(h):u.type;const g={...o,...h,signal:S},p=()=>$y(y,"server",g).then(b=>({result:b.result,error:b.error,context:b.sendContext}));if(g.type==="static"){let b;if(an!=null&&an.getItem&&(b=await an.getItem(g)),b||(b=await p().then(x=>({ctx:x,error:null})).catch(x=>({ctx:void 0,error:x})),an!=null&&an.setItem&&await an.setItem(g,b)),Fe(b),b.error)throw b.error;return b.ctx}return p()}})}}}async function $y(l,s,u){const c=gg([...yg,...l]),o=async d=>{const y=c.shift();if(!y)return d;y.options.validator&&(s!=="client"||y.options.validateClient)&&(d.data=await bg(y.options.validator,d.data));const v=s==="client"?y.options.client:y.options.server;return v?Sg(v,d,async S=>o(S).catch(h=>{if(Ee(h)||Re(h))return{...S,error:h};throw h})):o(d)};return o({...u,headers:u.headers||{},sendContext:u.sendContext||{},context:u.context||{}})}let an;function vg(l){const s=an;return an=typeof l=="function"?l():l,()=>{an=s}}async function mg(l){const s=new TextEncoder().encode(l),u=await crypto.subtle.digest("SHA-1",s);return Array.from(new Uint8Array(u)).map(d=>d.toString(16).padStart(2,"0")).join("")}vg(()=>{const l=async(c,o)=>`/__tsr/staticServerFnCache/${await mg(`${c.functionId}__${o}`)}.json`,s=c=>JSON.stringify(c??"",(y,v)=>v&&typeof v=="object"&&!Array.isArray(v)?Object.keys(v).sort().reduce((S,h)=>(S[h]=v[h],S),{}):v).replace(/[/\\?%*:|"<>]/g,"-").replace(/\s+/g,"_"),u=typeof document<"u"?new Map:null;return{getItem:async c=>{if(typeof document>"u"){const o=s(c.data),d=await l(c,o),y="/home/dogpawhat/Development/preloading-example/.output/public",{promises:v}=await ae(async()=>{const{promises:b}=await import("node:fs");return{promises:b}},[]),h=(await ae(()=>import("node:path"),[])).join(y,d),[g,p]=await v.readFile(h,"utf-8").then(b=>[ve.parse(b),null]).catch(b=>[null,b]);if(p&&p.code!=="ENOENT")throw p;return g}},setItem:async(c,o)=>{const{promises:d}=await ae(async()=>{const{promises:p}=await import("node:fs");return{promises:p}},[]),y=await ae(()=>import("node:path"),[]),v=s(c.data),S=await l(c,v),g=y.join("/home/dogpawhat/Development/preloading-example/.output/public",S);await d.mkdir(y.dirname(g),{recursive:!0}),await d.writeFile(g,ve.stringify(o))},fetchItem:async c=>{const o=s(c.data),d=await l(c,o);let y=u==null?void 0:u.get(d);return y||(y=await fetch(d,{method:"GET"}).then(v=>v.text()).then(v=>ve.parse(v)),u==null||u.set(d,y)),y}}});function pg(l){const s=l.get("__TSR_CONTEXT");if(l.delete("__TSR_CONTEXT"),typeof s!="string")return{context:{},data:l};try{return{context:ve.parse(s),data:l}}catch{return{data:l}}}function gg(l){const s=new Set,u=[],c=o=>{o.forEach(d=>{d.options.middleware&&c(d.options.middleware),s.has(d)||(s.add(d),u.push(d))})};return c(l),u}const Sg=async(l,s,u)=>l({...s,next:async(c={})=>u({...s,...c,context:{...s.context,...c.context},sendContext:{...s.sendContext,...c.sendContext??{}},headers:M0(s.headers,c.headers),result:c.result!==void 0?c.result:s.response==="raw"?c:s.result,error:c.error??s.error})});function bg(l,s){if(l==null)return{};if("~standard"in l){const u=l["~standard"].validate(s);if(u instanceof Promise)throw new Error("Async validation not supported");if(u.issues)throw new Error(JSON.stringify(u.issues,void 0,2));return u.value}if("parse"in l)return l.parse(s);if(typeof l=="function")return l(s);throw new Error("Invalid validator type!")}function _g(l){return{_types:void 0,options:{validator:l.validator,validateClient:l.validateClient,client:async({next:s,sendContext:u,...c})=>{var o;const d={...c,context:u,type:typeof c.type=="function"?c.type(c):c.type};if(c.type==="static"&&typeof document<"u"){Fe(an);const v=await an.fetchItem(d);if(v){if(v.error)throw v.error;return s(v.ctx)}`${d.functionId}${JSON.stringify(d.data)}`}const y=await((o=l.extractedFn)==null?void 0:o.call(l,d));return s(y)},server:async({next:s,...u})=>{var c;const o=await((c=l.serverFn)==null?void 0:c.call(l,u));return s({...u,result:o})}}}}function Eg({promise:l}){const s=rg(l);if(s[hn].status==="pending")throw s;if(s[hn].status==="error")throw s[hn].error;return[s[hn].data,s]}function Rg(l){const s=V.jsx(Tg,{...l});return l.fallback?V.jsx(st.Suspense,{fallback:l.fallback,children:s}):s}function Tg(l){const[s]=Eg(l);return l.children(s)}function Co(l){const s=l.errorComponent??Us;return V.jsx(Mg,{getResetKey:l.getResetKey,onCatch:l.onCatch,children:({error:u,reset:c})=>u?st.createElement(s,{error:u,reset:c}):l.children})}class Mg extends st.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(s){return{resetKey:s.getResetKey()}}static getDerivedStateFromError(s){return{error:s}}reset(){this.setState({error:null})}componentDidUpdate(s,u){u.error&&u.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(s,u){this.props.onCatch&&this.props.onCatch(s,u)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Us({error:l}){const[s,u]=st.useState(!1);return V.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[V.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),V.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>u(c=>!c),children:s?"Hide Error":"Show Error"})]}),V.jsx("div",{style:{height:".25rem"}}),s?V.jsx("div",{children:V.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:l.message?V.jsx("code",{children:l.message}):null})}):null]})}function Og({children:l,fallback:s=null}){return Ag()?V.jsx(Pi.Fragment,{children:l}):V.jsx(Pi.Fragment,{children:s})}function Ag(){return Pi.useSyncExternalStore(xg,()=>!0,()=>!1)}function xg(){return()=>{}}var uo={exports:{}},so={},ro={exports:{}},co={};/** 51 - * @license React 52 - * use-sync-external-store-shim.production.js 53 - * 54 - * Copyright (c) Meta Platforms, Inc. and affiliates. 55 - * 56 - * This source code is licensed under the MIT license found in the 57 - * LICENSE file in the root directory of this source tree. 58 - */var Py;function Dg(){if(Py)return co;Py=1;var l=nu();function s(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var u=typeof Object.is=="function"?Object.is:s,c=l.useState,o=l.useEffect,d=l.useLayoutEffect,y=l.useDebugValue;function v(p,b){var x=b(),M=c({inst:{value:x,getSnapshot:b}}),U=M[0].inst,j=M[1];return d(function(){U.value=x,U.getSnapshot=b,S(U)&&j({inst:U})},[p,x,b]),o(function(){return S(U)&&j({inst:U}),p(function(){S(U)&&j({inst:U})})},[p]),y(x),x}function S(p){var b=p.getSnapshot;p=p.value;try{var x=b();return!u(p,x)}catch{return!0}}function h(p,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:v;return co.useSyncExternalStore=l.useSyncExternalStore!==void 0?l.useSyncExternalStore:g,co}var Wy;function Cg(){return Wy||(Wy=1,ro.exports=Dg()),ro.exports}/** 59 - * @license React 60 - * use-sync-external-store-shim/with-selector.production.js 61 - * 62 - * Copyright (c) Meta Platforms, Inc. and affiliates. 63 - * 64 - * This source code is licensed under the MIT license found in the 65 - * LICENSE file in the root directory of this source tree. 66 - */var Iy;function zg(){if(Iy)return so;Iy=1;var l=nu(),s=Cg();function u(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var c=typeof Object.is=="function"?Object.is:u,o=s.useSyncExternalStore,d=l.useRef,y=l.useEffect,v=l.useMemo,S=l.useDebugValue;return so.useSyncExternalStoreWithSelector=function(h,g,p,b,x){var M=d(null);if(M.current===null){var U={hasValue:!1,value:null};M.current=U}else U=M.current;M=v(function(){function G(Y){if(!Z){if(Z=!0,K=Y,Y=b(Y),x!==void 0&&U.hasValue){var $=U.value;if(x($,Y))return I=$}return I=Y}if($=I,c(K,Y))return $;var q=b(Y);return x!==void 0&&x($,q)?(K=Y,$):(K=Y,I=q)}var Z=!1,K,I,k=p===void 0?null:p;return[function(){return G(g())},k===null?void 0:function(){return G(k())}]},[g,p,b,x]);var j=o(h,M[0],M[1]);return y(function(){U.hasValue=!0,U.value=j},[j]),S(j),j},so}var tv;function wg(){return tv||(tv=1,uo.exports=zg()),uo.exports}var Ug=wg();function Ng(l,s=u=>u){return Ug.useSyncExternalStoreWithSelector(l.subscribe,()=>l.state,()=>l.state,s,Lg)}function Lg(l,s){if(Object.is(l,s))return!0;if(typeof l!="object"||l===null||typeof s!="object"||s===null)return!1;if(l instanceof Map&&s instanceof Map){if(l.size!==s.size)return!1;for(const[c,o]of l)if(!s.has(c)||!Object.is(o,s.get(c)))return!1;return!0}if(l instanceof Set&&s instanceof Set){if(l.size!==s.size)return!1;for(const c of l)if(!s.has(c))return!1;return!0}const u=Object.keys(l);if(u.length!==Object.keys(s).length)return!1;for(let c=0;c<u.length;c++)if(!Object.prototype.hasOwnProperty.call(s,u[c])||!Object.is(l[u[c]],s[u[c]]))return!1;return!0}const oo=st.createContext(null);function wv(){return typeof document>"u"?oo:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=oo,oo)}function Ne(l){const s=st.useContext(wv());return l==null||l.warn,s}function Zt(l){const s=Ne({warn:(l==null?void 0:l.router)===void 0}),u=(l==null?void 0:l.router)||s,c=st.useRef(void 0);return Ng(u.__store,o=>{if(l!=null&&l.select){if(l.structuralSharing??u.options.defaultStructuralSharing){const d=Xe(c.current,l.select(o));return c.current=d,d}return l.select(o)}return o})}const Ns=st.createContext(void 0),jg=st.createContext(void 0);function ke(l){const s=st.useContext(l.from?jg:Ns);return Zt({select:c=>{const o=c.matches.find(d=>l.from?l.from===d.routeId:d.id===s);if(Fe(!((l.shouldThrow??!0)&&!o),`Could not find ${l.from?`an active match from "${l.from}"`:"a nearest match!"}`),o!==void 0)return l.select?l.select(o):o},structuralSharing:l.structuralSharing})}function zo(l){return ke({from:l.from,strict:l.strict,structuralSharing:l.structuralSharing,select:s=>l.select?l.select(s.loaderData):s.loaderData})}function wo(l){const{select:s,...u}=l;return ke({...u,select:c=>s?s(c.loaderDeps):c.loaderDeps})}function Uo(l){return ke({from:l.from,strict:l.strict,shouldThrow:l.shouldThrow,structuralSharing:l.structuralSharing,select:s=>l.select?l.select(s.params):s.params})}function No(l){return ke({from:l.from,strict:l.strict,shouldThrow:l.shouldThrow,structuralSharing:l.structuralSharing,select:s=>l.select?l.select(s.search):s.search})}function Lo(l){const{navigate:s,state:u}=Ne(),c=ke({strict:!1,select:o=>o.index});return st.useCallback(o=>{const d=o.from??(l==null?void 0:l.from)??u.matches[c].fullPath;return s({...o,from:d})},[l==null?void 0:l.from,s])}var Hg=Rv();const ki=typeof window<"u"?st.useLayoutEffect:st.useEffect;function fo(l){const s=st.useRef({value:l,prev:null}),u=s.current.value;return l!==u&&(s.current={value:l,prev:u}),s.current.prev}function Bg(l,s,u={},c={}){const o=st.useRef(typeof IntersectionObserver=="function"),d=st.useRef(null);return st.useEffect(()=>{if(!(!l.current||!o.current||c.disabled))return d.current=new IntersectionObserver(([y])=>{s(y)},u),d.current.observe(l.current),()=>{var y;(y=d.current)==null||y.disconnect()}},[s,u,c.disabled,l]),d.current}function qg(l){const s=st.useRef(null);return st.useImperativeHandle(l,()=>s.current,[]),s}function Qg(l,s){const u=Ne(),[c,o]=st.useState(!1),d=st.useRef(!1),y=qg(s),{activeProps:v=()=>({className:"active"}),inactiveProps:S=()=>({}),activeOptions:h,to:g,preload:p,preloadDelay:b,hashScrollIntoView:x,replace:M,startTransition:U,resetScroll:j,viewTransition:G,children:Z,target:K,disabled:I,style:k,className:Y,onClick:$,onFocus:q,onMouseEnter:w,onMouseLeave:W,onTouchStart:ot,ignoreBlocker:et,...dt}=l,{params:pt,search:ht,hash:C,state:X,mask:at,reloadDocument:gt,...E}=dt,N=st.useMemo(()=>{try{return new URL(`${g}`),"external"}catch{}return"internal"},[g]),F=Zt({select:xt=>xt.location.search,structuralSharing:!0}),J=ke({strict:!1,select:xt=>xt.fullPath}),P=l.from??J;l={...l,from:P};const lt=st.useMemo(()=>u.buildLocation(l),[u,l,F]),tt=st.useMemo(()=>l.reloadDocument?!1:p??u.options.defaultPreload,[u.options.defaultPreload,p,l.reloadDocument]),St=b??u.options.defaultPreloadDelay??0,it=Zt({select:xt=>{if(h!=null&&h.exact){if(!N0(xt.location.pathname,lt.pathname,u.basepath))return!1}else{const Jt=Os(xt.location.pathname,u.basepath).split("/");if(!Os(lt.pathname,u.basepath).split("/").every((Hs,ya)=>Hs===Jt[ya]))return!1}return((h==null?void 0:h.includeSearch)??!0)&&!wl(xt.location.search,lt.search,{partial:!(h!=null&&h.exact),ignoreUndefined:!(h!=null&&h.explicitUndefined)})?!1:h!=null&&h.includeHash?xt.location.hash===lt.hash:!0}}),bt=st.useCallback(()=>{u.preloadRoute(l).catch(xt=>{console.warn(xt),console.warn(cg)})},[l,u]),Nt=st.useCallback(xt=>{xt!=null&&xt.isIntersecting&&bt()},[bt]);if(Bg(y,Nt,{rootMargin:"100px"},{disabled:!!I||tt!=="viewport"}),ki(()=>{d.current||!I&&tt==="render"&&(bt(),d.current=!0)},[I,bt,tt]),N==="external")return{...E,ref:y,type:N,href:g,...Z&&{children:Z},...K&&{target:K},...I&&{disabled:I},...k&&{style:k},...Y&&{className:Y},...$&&{onClick:$},...q&&{onFocus:q},...w&&{onMouseEnter:w},...W&&{onMouseLeave:W},...ot&&{onTouchStart:ot}};const Qt=xt=>{if(!I&&!Gg(xt)&&!xt.defaultPrevented&&(!K||K==="_self")&&xt.button===0){xt.preventDefault(),Hg.flushSync(()=>{o(!0)});const Jt=u.subscribe("onResolved",()=>{Jt(),o(!1)});return u.navigate({...l,replace:M,resetScroll:j,hashScrollIntoView:x,startTransition:U,viewTransition:G,ignoreBlocker:et})}},Bt=xt=>{I||tt&&bt()},me=Bt,$e=xt=>{if(I)return;const Jt=xt.target||{};if(tt){if(Jt.preloadTimeout)return;St?Jt.preloadTimeout=setTimeout(()=>{Jt.preloadTimeout=null,bt()},St):bt()}},Nn=xt=>{if(I)return;const Jt=xt.target||{};Jt.preloadTimeout&&(clearTimeout(Jt.preloadTimeout),Jt.preloadTimeout=null)},Le=xt=>Jt=>{var Ya;(Ya=Jt.persist)==null||Ya.call(Jt),xt.filter(Boolean).forEach(au=>{Jt.defaultPrevented||au(Jt)})},Wt=it?Ba(v,{})??{}:{},Va=it?{}:Ba(S,{}),Jl=[Y,Wt.className,Va.className].filter(Boolean).join(" "),Fl={...k,...Wt.style,...Va.style};return{...E,...Wt,...Va,href:I?void 0:lt.maskedLocation?u.history.createHref(lt.maskedLocation.href):u.history.createHref(lt.href),ref:y,onClick:Le([$,Qt]),onFocus:Le([q,Bt]),onMouseEnter:Le([w,$e]),onMouseLeave:Le([W,Nn]),onTouchStart:Le([ot,me]),disabled:!!I,target:K,...Object.keys(Fl).length&&{style:Fl},...Jl&&{className:Jl},...I&&{role:"link","aria-disabled":!0},...it&&{"data-status":"active","aria-current":"page"},...c&&{"data-transitioning":"transitioning"}}}const ua=st.forwardRef((l,s)=>{const{_asChild:u,...c}=l,{type:o,ref:d,...y}=Qg(c,s),v=typeof c.children=="function"?c.children({isActive:y["data-status"]==="active"}):c.children;return typeof u>"u"&&delete y.disabled,st.createElement(u||"a",{...y,ref:d},v)});function Gg(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}let Vg=class extends zv{constructor(s){super(s),this.useMatch=u=>ke({select:u==null?void 0:u.select,from:this.id,structuralSharing:u==null?void 0:u.structuralSharing}),this.useRouteContext=u=>ke({...u,from:this.id,select:c=>u!=null&&u.select?u.select(c.context):c.context}),this.useSearch=u=>No({select:u==null?void 0:u.select,structuralSharing:u==null?void 0:u.structuralSharing,from:this.id}),this.useParams=u=>Uo({select:u==null?void 0:u.select,structuralSharing:u==null?void 0:u.structuralSharing,from:this.id}),this.useLoaderDeps=u=>wo({...u,from:this.id}),this.useLoaderData=u=>zo({...u,from:this.id}),this.useNavigate=()=>Lo({from:this.fullPath}),this.Link=Pi.forwardRef((u,c)=>V.jsx(ua,{ref:c,from:this.fullPath,...u})),this.$$typeof=Symbol.for("react.memo")}};function Yg(l){return new Vg(l)}function Kg(){return l=>Zg(l)}class Xg extends og{constructor(s){super(s),this.useMatch=u=>ke({select:u==null?void 0:u.select,from:this.id,structuralSharing:u==null?void 0:u.structuralSharing}),this.useRouteContext=u=>ke({...u,from:this.id,select:c=>u!=null&&u.select?u.select(c.context):c.context}),this.useSearch=u=>No({select:u==null?void 0:u.select,structuralSharing:u==null?void 0:u.structuralSharing,from:this.id}),this.useParams=u=>Uo({select:u==null?void 0:u.select,structuralSharing:u==null?void 0:u.structuralSharing,from:this.id}),this.useLoaderDeps=u=>wo({...u,from:this.id}),this.useLoaderData=u=>zo({...u,from:this.id}),this.useNavigate=()=>Lo({from:this.fullPath}),this.Link=Pi.forwardRef((u,c)=>V.jsx(ua,{ref:c,from:this.fullPath,...u})),this.$$typeof=Symbol.for("react.memo")}}function Zg(l){return new Xg(l)}function ha(l){return typeof l=="object"?new ev(l,{silent:!0}).createRoute(l):new ev(l,{silent:!0}).createRoute}class ev{constructor(s,u){this.path=s,this.createRoute=c=>{this.silent;const o=Yg(c);return o.isRoot=!1,o},this.silent=u==null?void 0:u.silent}}class nv{constructor(s){this.useMatch=u=>ke({select:u==null?void 0:u.select,from:this.options.id,structuralSharing:u==null?void 0:u.structuralSharing}),this.useRouteContext=u=>ke({from:this.options.id,select:c=>u!=null&&u.select?u.select(c.context):c.context}),this.useSearch=u=>No({select:u==null?void 0:u.select,structuralSharing:u==null?void 0:u.structuralSharing,from:this.options.id}),this.useParams=u=>Uo({select:u==null?void 0:u.select,structuralSharing:u==null?void 0:u.structuralSharing,from:this.options.id}),this.useLoaderDeps=u=>wo({...u,from:this.options.id}),this.useLoaderData=u=>zo({...u,from:this.options.id}),this.useNavigate=()=>{const u=Ne();return Lo({from:u.routesById[this.options.id].fullPath})},this.options=s,this.$$typeof=Symbol.for("react.memo")}}function av(l){return typeof l=="object"?new nv(l):s=>new nv({id:l,...s})}function Jg(l){const s=Zt({select:u=>`not-found-${u.location.pathname}-${u.status}`});return V.jsx(Co,{getResetKey:()=>s,onCatch:(u,c)=>{var o;if(Re(u))(o=l.onCatch)==null||o.call(l,u,c);else throw u},errorComponent:({error:u})=>{var c;if(Re(u))return(c=l.fallback)==null?void 0:c.call(l,u);throw u},children:l.children})}function Fg(){return V.jsx("p",{children:"Not Found"})}function Ts(l){return V.jsx(V.Fragment,{children:l.children})}function Uv(l,s,u){return s.options.notFoundComponent?V.jsx(s.options.notFoundComponent,{data:u}):l.options.defaultNotFoundComponent?V.jsx(l.options.defaultNotFoundComponent,{data:u}):V.jsx(Fg,{})}var ho,lv;function kg(){if(lv)return ho;lv=1;const l={},s=l.hasOwnProperty,u=(q,w)=>{for(const W in q)s.call(q,W)&&w(W,q[W])},c=(q,w)=>(w&&u(w,(W,ot)=>{q[W]=ot}),q),o=(q,w)=>{const W=q.length;let ot=-1;for(;++ot<W;)w(q[ot])},d=q=>"\\u"+("0000"+q).slice(-4),y=(q,w)=>{let W=q.toString(16);return w?W:W.toUpperCase()},v=l.toString,S=Array.isArray,h=q=>typeof Buffer=="function"&&Buffer.isBuffer(q),g=q=>v.call(q)=="[object Object]",p=q=>typeof q=="string"||v.call(q)=="[object String]",b=q=>typeof q=="number"||v.call(q)=="[object Number]",x=q=>typeof q=="bigint",M=q=>typeof q=="function",U=q=>v.call(q)=="[object Map]",j=q=>v.call(q)=="[object Set]",G={"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Z=/[\\\b\f\n\r\t]/,K=/[0-9]/,I=/[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,k=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g,Y=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g,$=(q,w)=>{const W=()=>{X=C,++w.indentLevel,C=w.indent.repeat(w.indentLevel)},ot={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:" ",indentLevel:0,__inline1__:!1,__inline2__:!1},et=w&&w.json;et&&(ot.quotes="double",ot.wrap=!0),w=c(ot,w),w.quotes!="single"&&w.quotes!="double"&&w.quotes!="backtick"&&(w.quotes="single");const dt=w.quotes=="double"?'"':w.quotes=="backtick"?"`":"'",pt=w.compact,ht=w.lowercaseHex;let C=w.indent.repeat(w.indentLevel),X="";const at=w.__inline1__,gt=w.__inline2__,E=pt?"":` 67 - `;let N,F=!0;const J=w.numbers=="binary",P=w.numbers=="octal",lt=w.numbers=="decimal",tt=w.numbers=="hexadecimal";if(et&&q&&M(q.toJSON)&&(q=q.toJSON()),!p(q)){if(U(q))return q.size==0?"new Map()":(pt||(w.__inline1__=!0,w.__inline2__=!1),"new Map("+$(Array.from(q),w)+")");if(j(q))return q.size==0?"new Set()":"new Set("+$(Array.from(q),w)+")";if(h(q))return q.length==0?"Buffer.from([])":"Buffer.from("+$(Array.from(q),w)+")";if(S(q))return N=[],w.wrap=!0,at&&(w.__inline1__=!1,w.__inline2__=!0),gt||W(),o(q,it=>{F=!1,gt&&(w.__inline2__=!1),N.push((pt||gt?"":C)+$(it,w))}),F?"[]":gt?"["+N.join(", ")+"]":"["+E+N.join(","+E)+E+(pt?"":X)+"]";if(b(q)||x(q)){if(et)return JSON.stringify(Number(q));let it;if(lt)it=String(q);else if(tt){let bt=q.toString(16);ht||(bt=bt.toUpperCase()),it="0x"+bt}else J?it="0b"+q.toString(2):P&&(it="0o"+q.toString(8));return x(q)?it+"n":it}else return x(q)?et?JSON.stringify(Number(q)):q+"n":g(q)?(N=[],w.wrap=!0,W(),u(q,(it,bt)=>{F=!1,N.push((pt?"":C)+$(it,w)+":"+(pt?"":" ")+$(bt,w))}),F?"{}":"{"+E+N.join(","+E)+E+(pt?"":X)+"}"):et?JSON.stringify(q)||"null":String(q)}const St=w.escapeEverything?k:Y;return N=q.replace(St,(it,bt,Nt,Qt,Bt,me)=>{if(bt){if(w.minimal)return bt;const Nn=bt.charCodeAt(0),Le=bt.charCodeAt(1);if(w.es6){const Wt=(Nn-55296)*1024+Le-56320+65536;return"\\u{"+y(Wt,ht)+"}"}return d(y(Nn,ht))+d(y(Le,ht))}if(Nt)return d(y(Nt.charCodeAt(0),ht));if(it=="\0"&&!et&&!K.test(me.charAt(Bt+1)))return"\\0";if(Qt)return Qt==dt||w.escapeEverything?"\\"+Qt:Qt;if(Z.test(it))return G[it];if(w.minimal&&!I.test(it))return it;const $e=y(it.charCodeAt(0),ht);return et||$e.length>2?d($e):"\\x"+("00"+$e).slice(-2)}),dt=="`"&&(N=N.replace(/\$\{/g,"\\${")),w.isScriptContext&&(N=N.replace(/<\/(script|style)/gi,"<\\/$1").replace(/<!--/g,et?"\\u003C!--":"\\x3C!--")),w.wrap&&(N=dt+N+dt),N};return $.version="3.0.2",ho=$,ho}kg();function $g({children:l,log:s}){return typeof document<"u"?null:V.jsx("script",{className:"tsr-once",dangerouslySetInnerHTML:{__html:[l,"",'if (typeof __TSR_SSR__ !== "undefined") __TSR_SSR__.cleanScripts()'].filter(Boolean).join(` 68 - `)}})}function Pg(){const l=Ne(),u=(l.options.getScrollRestorationKey||Ro)(l.latestLocation),c=u!==Ro(l.latestLocation)?u:null;return!l.isScrollRestoring||!l.isServer?null:V.jsx($g,{children:`(${xv.toString()})(${JSON.stringify(xs)},${JSON.stringify(c)}, undefined, true)`,log:!1})}const Nv=st.memo(function({matchId:s}){var u,c;const o=Ne(),d=Zt({select:G=>{var Z;return(Z=G.matches.find(K=>K.id===s))==null?void 0:Z.routeId}});Fe(d);const y=o.routesById[d],v=y.options.pendingComponent??o.options.defaultPendingComponent,S=v?V.jsx(v,{}):null,h=y.options.errorComponent??o.options.defaultErrorComponent,g=y.options.onCatch??o.options.defaultOnCatch,p=y.isRoot?y.options.notFoundComponent??((u=o.options.notFoundRoute)==null?void 0:u.options.component):y.options.notFoundComponent,b=(!y.isRoot||y.options.wrapInSuspense)&&(y.options.wrapInSuspense??v??((c=y.options.errorComponent)==null?void 0:c.preload))?st.Suspense:Ts,x=h?Co:Ts,M=p?Jg:Ts,U=Zt({select:G=>G.loadedAt}),j=Zt({select:G=>{var Z;const K=G.matches.findIndex(I=>I.id===s);return(Z=G.matches[K-1])==null?void 0:Z.routeId}});return V.jsxs(V.Fragment,{children:[V.jsx(Ns.Provider,{value:s,children:V.jsx(b,{fallback:S,children:V.jsx(x,{getResetKey:()=>U,errorComponent:h||Us,onCatch:(G,Z)=>{if(Re(G))throw G;g==null||g(G,Z)},children:V.jsx(M,{fallback:G=>{if(!p||G.routeId&&G.routeId!==d||!G.routeId&&!y.isRoot)throw G;return st.createElement(p,G)},children:V.jsx(Ig,{matchId:s})})})})}),j===nn&&o.options.scrollRestoration?V.jsxs(V.Fragment,{children:[V.jsx(Wg,{}),V.jsx(Pg,{})]}):null]})});function Wg(){const l=Ne(),s=st.useRef(void 0);return V.jsx("script",{suppressHydrationWarning:!0,ref:u=>{u&&(s.current===void 0||s.current.href!==l.latestLocation.href)&&(l.emit({type:"onRendered",...qa(l.state)}),s.current=l.latestLocation)}},l.latestLocation.state.key)}const Ig=st.memo(function({matchId:s}){var u,c,o;const d=Ne(),{match:y,key:v,routeId:S}=Zt({select:b=>{const x=b.matches.findIndex(K=>K.id===s),M=b.matches[x],U=M.routeId,j=d.routesById[U].options.remountDeps??d.options.defaultRemountDeps,G=j==null?void 0:j({routeId:U,loaderDeps:M.loaderDeps,params:M._strictParams,search:M._strictSearch});return{key:G?JSON.stringify(G):void 0,routeId:U,match:_o(M,["id","status","error"])}},structuralSharing:!0}),h=d.routesById[S],g=st.useMemo(()=>{const b=h.options.component??d.options.defaultComponent;return b?V.jsx(b,{},v):V.jsx(jo,{})},[v,h.options.component,d.options.defaultComponent]),p=(h.options.errorComponent??d.options.defaultErrorComponent)||Us;if(y.status==="notFound")return Fe(Re(y.error)),Uv(d,h,y.error);if(y.status==="redirected")throw Fe(Ee(y.error)),(u=d.getMatch(y.id))==null?void 0:u.loadPromise;if(y.status==="error"){if(d.isServer)return V.jsx(p,{error:y.error,reset:void 0,info:{componentStack:""}});throw y.error}if(y.status==="pending"){const b=h.options.pendingMinMs??d.options.defaultPendingMinMs;if(b&&!((c=d.getMatch(y.id))!=null&&c.minPendingPromise)&&!d.isServer){const x=Dl();Promise.resolve().then(()=>{d.updateMatch(y.id,M=>({...M,minPendingPromise:x}))}),setTimeout(()=>{x.resolve(),d.updateMatch(y.id,M=>({...M,minPendingPromise:void 0}))},b)}throw(o=d.getMatch(y.id))==null?void 0:o.loadPromise}return g}),jo=st.memo(function(){const s=Ne(),u=st.useContext(Ns),c=Zt({select:h=>{var g;return(g=h.matches.find(p=>p.id===u))==null?void 0:g.routeId}}),o=s.routesById[c],d=Zt({select:h=>{const p=h.matches.find(b=>b.id===u);return Fe(p),p.globalNotFound}}),y=Zt({select:h=>{var g;const p=h.matches,b=p.findIndex(x=>x.id===u);return(g=p[b+1])==null?void 0:g.id}}),v=s.options.defaultPendingComponent?V.jsx(s.options.defaultPendingComponent,{}):null;if(s.isShell)return V.jsx(st.Suspense,{fallback:v,children:V.jsx(tS,{})});if(d)return Uv(s,o,void 0);if(!y)return null;const S=V.jsx(Nv,{matchId:y});return u===nn?V.jsx(st.Suspense,{fallback:v,children:S}):S});function tS(){throw new Error("ShellBoundaryError")}function eS(l){return typeof(l==null?void 0:l.message)!="string"?!1:l.message.startsWith("Failed to fetch dynamically imported module")||l.message.startsWith("error loading dynamically imported module")||l.message.startsWith("Importing a module script failed")}function Te(l,s,u){let c,o,d,y;const v=()=>typeof document>"u"&&(u==null?void 0:u())===!1?(o=()=>null,Promise.resolve()):(c||(c=l().then(h=>{c=void 0,o=h[s??"default"]}).catch(h=>{if(d=h,eS(d)&&d instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const g=`tanstack_router_reload:${d.message}`;sessionStorage.getItem(g)||(sessionStorage.setItem(g,"1"),y=!0)}})),c),S=function(g){if(y)throw window.location.reload(),new Promise(()=>{});if(d)throw d;if(!o)throw v();return(u==null?void 0:u())===!1?V.jsx(Og,{fallback:V.jsx(jo,{}),children:st.createElement(o,g)}):st.createElement(o,g)};return S.preload=v,S}function nS(){const l=Ne(),s=st.useRef({router:l,mounted:!1}),u=Zt({select:({isLoading:p})=>p}),[c,o]=st.useState(!1),d=Zt({select:p=>p.matches.some(b=>b.status==="pending"),structuralSharing:!0}),y=fo(u),v=u||c||d,S=fo(v),h=u||d,g=fo(h);return l.isServer||(l.startTransition=p=>{o(!0),st.startTransition(()=>{p(),o(!1)})}),st.useEffect(()=>{const p=l.history.subscribe(l.load),b=l.buildLocation({to:l.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Vl(l.latestLocation.href)!==Vl(b.href)&&l.commitLocation({...b,replace:!0}),()=>{p()}},[l,l.history]),ki(()=>{if(typeof window<"u"&&l.clientSsr||s.current.router===l&&s.current.mounted)return;s.current={router:l,mounted:!0},(async()=>{try{await l.load()}catch(b){console.error(b)}})()},[l]),ki(()=>{y&&!u&&l.emit({type:"onLoad",...qa(l.state)})},[y,l,u]),ki(()=>{g&&!h&&l.emit({type:"onBeforeRouteMount",...qa(l.state)})},[h,g,l]),ki(()=>{S&&!v&&(l.emit({type:"onResolved",...qa(l.state)}),l.__store.setState(p=>({...p,status:"idle",resolvedLocation:p.location})),J0(l))},[v,S,l]),null}function aS(){const l=Ne(),s=l.options.defaultPendingComponent?V.jsx(l.options.defaultPendingComponent,{}):null,u=l.isServer||typeof document<"u"&&l.clientSsr?Ts:st.Suspense,c=V.jsxs(u,{fallback:s,children:[V.jsx(nS,{}),V.jsx(lS,{})]});return l.options.InnerWrap?V.jsx(l.options.InnerWrap,{children:c}):c}function lS(){const l=Zt({select:u=>{var c;return(c=u.matches[0])==null?void 0:c.id}}),s=Zt({select:u=>u.loadedAt});return V.jsx(Ns.Provider,{value:l,children:V.jsx(Co,{getResetKey:()=>s,errorComponent:Us,onCatch:u=>{u.message||u.toString()},children:l?V.jsx(Nv,{matchId:l}):null})})}const iS=l=>new uS(l);class uS extends ng{constructor(s){super(s)}}typeof globalThis<"u"?(globalThis.createFileRoute=ha,globalThis.createLazyFileRoute=av):typeof window<"u"&&(window.createFileRoute=ha,window.createFileRoute=av);function sS({router:l,children:s,...u}){Object.keys(u).length>0&&l.update({...l.options,...u,context:{...l.options.context,...u.context}});const c=wv(),o=V.jsx(c.Provider,{value:l,children:s});return l.options.Wrap?V.jsx(l.options.Wrap,{children:o}):o}function rS({router:l,...s}){return V.jsx(sS,{router:l,...s,children:V.jsx(aS,{})})}function Lv({tag:l,attrs:s,children:u}){switch(l){case"title":return V.jsx("title",{...s,suppressHydrationWarning:!0,children:u});case"meta":return V.jsx("meta",{...s,suppressHydrationWarning:!0});case"link":return V.jsx("link",{...s,suppressHydrationWarning:!0});case"style":return V.jsx("style",{...s,dangerouslySetInnerHTML:{__html:u}});case"script":return s&&s.src?V.jsx("script",{...s,suppressHydrationWarning:!0}):typeof u=="string"?V.jsx("script",{...s,dangerouslySetInnerHTML:{__html:u},suppressHydrationWarning:!0}):null;default:return null}}const cS=()=>{const l=Ne(),s=Zt({select:y=>y.matches.map(v=>v.meta).filter(Boolean)}),u=st.useMemo(()=>{const y=[],v={};let S;return[...s].reverse().forEach(h=>{[...h].reverse().forEach(g=>{if(g)if(g.title)S||(S={tag:"title",children:g.title});else{const p=g.name??g.property;if(p){if(v[p])return;v[p]=!0}y.push({tag:"meta",attrs:{...g}})}})}),S&&y.push(S),y.reverse(),y},[s]),c=Zt({select:y=>{var v;const S=y.matches.map(p=>p.links).filter(Boolean).flat(1).map(p=>({tag:"link",attrs:{...p}})),h=(v=l.ssr)==null?void 0:v.manifest,g=y.matches.map(p=>{var b;return((b=h==null?void 0:h.routes[p.routeId])==null?void 0:b.assets)??[]}).filter(Boolean).flat(1).filter(p=>p.tag==="link").map(p=>({tag:"link",attrs:{...p.attrs,suppressHydrationWarning:!0}}));return[...S,...g]},structuralSharing:!0}),o=Zt({select:y=>{const v=[];return y.matches.map(S=>l.looseRoutesById[S.routeId]).forEach(S=>{var h,g,p,b;return(b=(p=(g=(h=l.ssr)==null?void 0:h.manifest)==null?void 0:g.routes[S.id])==null?void 0:p.preloads)==null?void 0:b.filter(Boolean).forEach(x=>{v.push({tag:"link",attrs:{rel:"modulepreload",href:x}})})}),v},structuralSharing:!0}),d=Zt({select:y=>y.matches.map(v=>v.headScripts).flat(1).filter(Boolean).map(({children:v,...S})=>({tag:"script",attrs:{...S},children:v})),structuralSharing:!0});return fS([...u,...o,...c,...d],y=>JSON.stringify(y))};function oS(){return cS().map(s=>st.createElement(Lv,{...s,key:`tsr-meta-${JSON.stringify(s)}`}))}function fS(l,s){const u=new Set;return l.filter(c=>{const o=s(c);return u.has(o)?!1:(u.add(o),!0)})}const dS=()=>{const l=Ne(),s=Zt({select:o=>{var d;const y=[],v=(d=l.ssr)==null?void 0:d.manifest;return v?(o.matches.map(S=>l.looseRoutesById[S.routeId]).forEach(S=>{var h,g;return(g=(h=v.routes[S.id])==null?void 0:h.assets)==null?void 0:g.filter(p=>p.tag==="script").forEach(p=>{y.push({tag:"script",attrs:p.attrs,children:p.children})})}),y):[]},structuralSharing:!0}),{scripts:u}=Zt({select:o=>({scripts:o.matches.map(d=>d.scripts).flat(1).filter(Boolean).map(({children:d,...y})=>({tag:"script",attrs:{...y,suppressHydrationWarning:!0},children:d}))}),structuralSharing:!0}),c=[...u,...s];return V.jsx(V.Fragment,{children:c.map((o,d)=>st.createElement(Lv,{...o,key:`tsr-scripts-${o.tag}-${d}`}))})};let bs;function hS(l){return bs||(l.router.state.matches.length?bs=Promise.resolve():bs=fg(l.router)),V.jsx(Rg,{promise:bs,children:()=>V.jsx(rS,{router:l.router})})}var Ls=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(l){return this.listeners.add(l),this.onSubscribe(),()=>{this.listeners.delete(l),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},js=typeof window>"u"||"Deno"in globalThis;function Je(){}function yS(l,s){return typeof l=="function"?l(s):l}function vS(l){return typeof l=="number"&&l>=0&&l!==1/0}function mS(l,s){return Math.max(l+(s||0)-Date.now(),0)}function iv(l,s){return typeof l=="function"?l(s):l}function pS(l,s){return typeof l=="function"?l(s):l}function uv(l,s){const{type:u="all",exact:c,fetchStatus:o,predicate:d,queryKey:y,stale:v}=l;if(y){if(c){if(s.queryHash!==Ho(y,s.options))return!1}else if(!Ii(s.queryKey,y))return!1}if(u!=="all"){const S=s.isActive();if(u==="active"&&!S||u==="inactive"&&S)return!1}return!(typeof v=="boolean"&&s.isStale()!==v||o&&o!==s.state.fetchStatus||d&&!d(s))}function sv(l,s){const{exact:u,status:c,predicate:o,mutationKey:d}=l;if(d){if(!s.options.mutationKey)return!1;if(u){if(Qa(s.options.mutationKey)!==Qa(d))return!1}else if(!Ii(s.options.mutationKey,d))return!1}return!(c&&s.state.status!==c||o&&!o(s))}function Ho(l,s){return((s==null?void 0:s.queryKeyHashFn)||Qa)(l)}function Qa(l){return JSON.stringify(l,(s,u)=>Oo(u)?Object.keys(u).sort().reduce((c,o)=>(c[o]=u[o],c),{}):u)}function Ii(l,s){return l===s?!0:typeof l!=typeof s?!1:l&&s&&typeof l=="object"&&typeof s=="object"?Object.keys(s).every(u=>Ii(l[u],s[u])):!1}function jv(l,s){if(l===s)return l;const u=rv(l)&&rv(s);if(u||Oo(l)&&Oo(s)){const c=u?l:Object.keys(l),o=c.length,d=u?s:Object.keys(s),y=d.length,v=u?[]:{};let S=0;for(let h=0;h<y;h++){const g=u?h:d[h];(!u&&c.includes(g)||u)&&l[g]===void 0&&s[g]===void 0?(v[g]=void 0,S++):(v[g]=jv(l[g],s[g]),v[g]===l[g]&&l[g]!==void 0&&S++)}return o===y&&S===o?l:v}return s}function Zb(l,s){if(!s||Object.keys(l).length!==Object.keys(s).length)return!1;for(const u in l)if(l[u]!==s[u])return!1;return!0}function rv(l){return Array.isArray(l)&&l.length===Object.keys(l).length}function Oo(l){if(!cv(l))return!1;const s=l.constructor;if(s===void 0)return!0;const u=s.prototype;return!(!cv(u)||!u.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(l)!==Object.prototype)}function cv(l){return Object.prototype.toString.call(l)==="[object Object]"}function gS(l){return new Promise(s=>{setTimeout(s,l)})}function SS(l,s,u){return typeof u.structuralSharing=="function"?u.structuralSharing(l,s):u.structuralSharing!==!1?jv(l,s):s}function bS(l,s,u=0){const c=[...l,s];return u&&c.length>u?c.slice(1):c}function _S(l,s,u=0){const c=[s,...l];return u&&c.length>u?c.slice(0,-1):c}var Bo=Symbol();function Hv(l,s){return!l.queryFn&&(s!=null&&s.initialPromise)?()=>s.initialPromise:!l.queryFn||l.queryFn===Bo?()=>Promise.reject(new Error(`Missing queryFn: '${l.queryHash}'`)):l.queryFn}function Jb(l,s){return typeof l=="function"?l(...s):!!l}var Ua,sa,Ul,vv,ES=(vv=class extends Ls{constructor(){super();Ot(this,Ua);Ot(this,sa);Ot(this,Ul);yt(this,Ul,s=>{if(!js&&window.addEventListener){const u=()=>s();return window.addEventListener("visibilitychange",u,!1),()=>{window.removeEventListener("visibilitychange",u)}}})}onSubscribe(){B(this,sa)||this.setEventListener(B(this,Ul))}onUnsubscribe(){var s;this.hasListeners()||((s=B(this,sa))==null||s.call(this),yt(this,sa,void 0))}setEventListener(s){var u;yt(this,Ul,s),(u=B(this,sa))==null||u.call(this),yt(this,sa,s(c=>{typeof c=="boolean"?this.setFocused(c):this.onFocus()}))}setFocused(s){B(this,Ua)!==s&&(yt(this,Ua,s),this.onFocus())}onFocus(){const s=this.isFocused();this.listeners.forEach(u=>{u(s)})}isFocused(){var s;return typeof B(this,Ua)=="boolean"?B(this,Ua):((s=globalThis.document)==null?void 0:s.visibilityState)!=="hidden"}},Ua=new WeakMap,sa=new WeakMap,Ul=new WeakMap,vv),Bv=new ES,Nl,ra,Ll,mv,RS=(mv=class extends Ls{constructor(){super();Ot(this,Nl,!0);Ot(this,ra);Ot(this,Ll);yt(this,Ll,s=>{if(!js&&window.addEventListener){const u=()=>s(!0),c=()=>s(!1);return window.addEventListener("online",u,!1),window.addEventListener("offline",c,!1),()=>{window.removeEventListener("online",u),window.removeEventListener("offline",c)}}})}onSubscribe(){B(this,ra)||this.setEventListener(B(this,Ll))}onUnsubscribe(){var s;this.hasListeners()||((s=B(this,ra))==null||s.call(this),yt(this,ra,void 0))}setEventListener(s){var u;yt(this,Ll,s),(u=B(this,ra))==null||u.call(this),yt(this,ra,s(this.setOnline.bind(this)))}setOnline(s){B(this,Nl)!==s&&(yt(this,Nl,s),this.listeners.forEach(c=>{c(s)}))}isOnline(){return B(this,Nl)}},Nl=new WeakMap,ra=new WeakMap,Ll=new WeakMap,mv),zs=new RS;function TS(){let l,s;const u=new Promise((o,d)=>{l=o,s=d});u.status="pending",u.catch(()=>{});function c(o){Object.assign(u,o),delete u.resolve,delete u.reject}return u.resolve=o=>{c({status:"fulfilled",value:o}),l(o)},u.reject=o=>{c({status:"rejected",reason:o}),s(o)},u}function MS(l){var u;let s;if((u=l.then(c=>(s=c,c)))==null||u.catch(Je),s!==void 0)return{data:s}}function OS(l){return Math.min(1e3*2**l,3e4)}function qv(l){return(l??"online")==="online"?zs.isOnline():!0}var Qv=class extends Error{constructor(l){super("CancelledError"),this.revert=l==null?void 0:l.revert,this.silent=l==null?void 0:l.silent}};function yo(l){return l instanceof Qv}function Gv(l){let s=!1,u=0,c=!1,o;const d=TS(),y=U=>{var j;c||(b(new Qv(U)),(j=l.abort)==null||j.call(l))},v=()=>{s=!0},S=()=>{s=!1},h=()=>Bv.isFocused()&&(l.networkMode==="always"||zs.isOnline())&&l.canRun(),g=()=>qv(l.networkMode)&&l.canRun(),p=U=>{var j;c||(c=!0,(j=l.onSuccess)==null||j.call(l,U),o==null||o(),d.resolve(U))},b=U=>{var j;c||(c=!0,(j=l.onError)==null||j.call(l,U),o==null||o(),d.reject(U))},x=()=>new Promise(U=>{var j;o=G=>{(c||h())&&U(G)},(j=l.onPause)==null||j.call(l)}).then(()=>{var U;o=void 0,c||(U=l.onContinue)==null||U.call(l)}),M=()=>{if(c)return;let U;const j=u===0?l.initialPromise:void 0;try{U=j??l.fn()}catch(G){U=Promise.reject(G)}Promise.resolve(U).then(p).catch(G=>{var Y;if(c)return;const Z=l.retry??(js?0:3),K=l.retryDelay??OS,I=typeof K=="function"?K(u,G):K,k=Z===!0||typeof Z=="number"&&u<Z||typeof Z=="function"&&Z(u,G);if(s||!k){b(G);return}u++,(Y=l.onFail)==null||Y.call(l,u,G),gS(I).then(()=>h()?void 0:x()).then(()=>{s?b(G):M()})})};return{promise:d,cancel:y,continue:()=>(o==null||o(),d),cancelRetry:v,continueRetry:S,canStart:g,start:()=>(g()?M():x().then(M),d)}}var AS=l=>setTimeout(l,0);function xS(){let l=[],s=0,u=v=>{v()},c=v=>{v()},o=AS;const d=v=>{s?l.push(v):o(()=>{u(v)})},y=()=>{const v=l;l=[],v.length&&o(()=>{c(()=>{v.forEach(S=>{u(S)})})})};return{batch:v=>{let S;s++;try{S=v()}finally{s--,s||y()}return S},batchCalls:v=>(...S)=>{d(()=>{v(...S)})},schedule:d,setNotifyFunction:v=>{u=v},setBatchNotifyFunction:v=>{c=v},setScheduler:v=>{o=v}}}var ye=xS(),Na,pv,Vv=(pv=class{constructor(){Ot(this,Na)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vS(this.gcTime)&&yt(this,Na,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(l){this.gcTime=Math.max(this.gcTime||0,l??(js?1/0:5*60*1e3))}clearGcTimeout(){B(this,Na)&&(clearTimeout(B(this,Na)),yt(this,Na,void 0))}},Na=new WeakMap,pv),jl,Hl,Ze,La,fe,tu,ja,tn,wn,gv,DS=(gv=class extends Vv{constructor(s){super();Ot(this,tn);Ot(this,jl);Ot(this,Hl);Ot(this,Ze);Ot(this,La);Ot(this,fe);Ot(this,tu);Ot(this,ja);yt(this,ja,!1),yt(this,tu,s.defaultOptions),this.setOptions(s.options),this.observers=[],yt(this,La,s.client),yt(this,Ze,B(this,La).getQueryCache()),this.queryKey=s.queryKey,this.queryHash=s.queryHash,yt(this,jl,zS(this.options)),this.state=s.state??B(this,jl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var s;return(s=B(this,fe))==null?void 0:s.promise}setOptions(s){this.options={...B(this,tu),...s},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&B(this,Ze).remove(this)}setData(s,u){const c=SS(this.state.data,s,this.options);return ce(this,tn,wn).call(this,{data:c,type:"success",dataUpdatedAt:u==null?void 0:u.updatedAt,manual:u==null?void 0:u.manual}),c}setState(s,u){ce(this,tn,wn).call(this,{type:"setState",state:s,setStateOptions:u})}cancel(s){var c,o;const u=(c=B(this,fe))==null?void 0:c.promise;return(o=B(this,fe))==null||o.cancel(s),u?u.then(Je).catch(Je):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(B(this,jl))}isActive(){return this.observers.some(s=>pS(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bo||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(s=0){return this.state.isInvalidated||this.state.data===void 0||!mS(this.state.dataUpdatedAt,s)}onFocus(){var u;const s=this.observers.find(c=>c.shouldFetchOnWindowFocus());s==null||s.refetch({cancelRefetch:!1}),(u=B(this,fe))==null||u.continue()}onOnline(){var u;const s=this.observers.find(c=>c.shouldFetchOnReconnect());s==null||s.refetch({cancelRefetch:!1}),(u=B(this,fe))==null||u.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),B(this,Ze).notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){this.observers.includes(s)&&(this.observers=this.observers.filter(u=>u!==s),this.observers.length||(B(this,fe)&&(B(this,ja)?B(this,fe).cancel({revert:!0}):B(this,fe).cancelRetry()),this.scheduleGc()),B(this,Ze).notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,tn,wn).call(this,{type:"invalidate"})}fetch(s,u){var S,h,g;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(u!=null&&u.cancelRefetch))this.cancel({silent:!0});else if(B(this,fe))return B(this,fe).continueRetry(),B(this,fe).promise}if(s&&this.setOptions(s),!this.options.queryFn){const p=this.observers.find(b=>b.options.queryFn);p&&this.setOptions(p.options)}const c=new AbortController,o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(yt(this,ja,!0),c.signal)})},d=()=>{const p=Hv(this.options,u),b={client:B(this,La),queryKey:this.queryKey,meta:this.meta};return o(b),yt(this,ja,!1),this.options.persister?this.options.persister(p,b,this):p(b)},y={fetchOptions:u,options:this.options,queryKey:this.queryKey,client:B(this,La),state:this.state,fetchFn:d};o(y),(S=this.options.behavior)==null||S.onFetch(y,this),yt(this,Hl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=y.fetchOptions)==null?void 0:h.meta))&&ce(this,tn,wn).call(this,{type:"fetch",meta:(g=y.fetchOptions)==null?void 0:g.meta});const v=p=>{var b,x,M,U;yo(p)&&p.silent||ce(this,tn,wn).call(this,{type:"error",error:p}),yo(p)||((x=(b=B(this,Ze).config).onError)==null||x.call(b,p,this),(U=(M=B(this,Ze).config).onSettled)==null||U.call(M,this.state.data,p,this)),this.scheduleGc()};return yt(this,fe,Gv({initialPromise:u==null?void 0:u.initialPromise,fn:y.fetchFn,abort:c.abort.bind(c),onSuccess:p=>{var b,x,M,U;if(p===void 0){v(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(j){v(j);return}(x=(b=B(this,Ze).config).onSuccess)==null||x.call(b,p,this),(U=(M=B(this,Ze).config).onSettled)==null||U.call(M,p,this.state.error,this),this.scheduleGc()},onError:v,onFail:(p,b)=>{ce(this,tn,wn).call(this,{type:"failed",failureCount:p,error:b})},onPause:()=>{ce(this,tn,wn).call(this,{type:"pause"})},onContinue:()=>{ce(this,tn,wn).call(this,{type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay,networkMode:y.options.networkMode,canRun:()=>!0})),B(this,fe).start()}},jl=new WeakMap,Hl=new WeakMap,Ze=new WeakMap,La=new WeakMap,fe=new WeakMap,tu=new WeakMap,ja=new WeakMap,tn=new WeakSet,wn=function(s){const u=c=>{switch(s.type){case"failed":return{...c,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...c,fetchStatus:"paused"};case"continue":return{...c,fetchStatus:"fetching"};case"fetch":return{...c,...CS(c.data,this.options),fetchMeta:s.meta??null};case"success":return{...c,data:s.data,dataUpdateCount:c.dataUpdateCount+1,dataUpdatedAt:s.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=s.error;return yo(o)&&o.revert&&B(this,Hl)?{...B(this,Hl),fetchStatus:"idle"}:{...c,error:o,errorUpdateCount:c.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:c.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...c,isInvalidated:!0};case"setState":return{...c,...s.state}}};this.state=u(this.state),ye.batch(()=>{this.observers.forEach(c=>{c.onQueryUpdate()}),B(this,Ze).notify({query:this,type:"updated",action:s})})},gv);function CS(l,s){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qv(s.networkMode)?"fetching":"paused",...l===void 0&&{error:null,status:"pending"}}}function zS(l){const s=typeof l.initialData=="function"?l.initialData():l.initialData,u=s!==void 0,c=u?typeof l.initialDataUpdatedAt=="function"?l.initialDataUpdatedAt():l.initialDataUpdatedAt:0;return{data:s,dataUpdateCount:0,dataUpdatedAt:u?c??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:u?"success":"pending",fetchStatus:"idle"}}var on,Sv,wS=(Sv=class extends Ls{constructor(s={}){super();Ot(this,on);this.config=s,yt(this,on,new Map)}build(s,u,c){const o=u.queryKey,d=u.queryHash??Ho(o,u);let y=this.get(d);return y||(y=new DS({client:s,queryKey:o,queryHash:d,options:s.defaultQueryOptions(u),state:c,defaultOptions:s.getQueryDefaults(o)}),this.add(y)),y}add(s){B(this,on).has(s.queryHash)||(B(this,on).set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){const u=B(this,on).get(s.queryHash);u&&(s.destroy(),u===s&&B(this,on).delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){ye.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return B(this,on).get(s)}getAll(){return[...B(this,on).values()]}find(s){const u={exact:!0,...s};return this.getAll().find(c=>uv(u,c))}findAll(s={}){const u=this.getAll();return Object.keys(s).length>0?u.filter(c=>uv(s,c)):u}notify(s){ye.batch(()=>{this.listeners.forEach(u=>{u(s)})})}onFocus(){ye.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){ye.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},on=new WeakMap,Sv),fn,he,Ha,dn,ia,bv,US=(bv=class extends Vv{constructor(s){super();Ot(this,dn);Ot(this,fn);Ot(this,he);Ot(this,Ha);this.mutationId=s.mutationId,yt(this,he,s.mutationCache),yt(this,fn,[]),this.state=s.state||NS(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){B(this,fn).includes(s)||(B(this,fn).push(s),this.clearGcTimeout(),B(this,he).notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){yt(this,fn,B(this,fn).filter(u=>u!==s)),this.scheduleGc(),B(this,he).notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){B(this,fn).length||(this.state.status==="pending"?this.scheduleGc():B(this,he).remove(this))}continue(){var s;return((s=B(this,Ha))==null?void 0:s.continue())??this.execute(this.state.variables)}async execute(s){var d,y,v,S,h,g,p,b,x,M,U,j,G,Z,K,I,k,Y,$,q;const u=()=>{ce(this,dn,ia).call(this,{type:"continue"})};yt(this,Ha,Gv({fn:()=>this.options.mutationFn?this.options.mutationFn(s):Promise.reject(new Error("No mutationFn found")),onFail:(w,W)=>{ce(this,dn,ia).call(this,{type:"failed",failureCount:w,error:W})},onPause:()=>{ce(this,dn,ia).call(this,{type:"pause"})},onContinue:u,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>B(this,he).canRun(this)}));const c=this.state.status==="pending",o=!B(this,Ha).canStart();try{if(c)u();else{ce(this,dn,ia).call(this,{type:"pending",variables:s,isPaused:o}),await((y=(d=B(this,he).config).onMutate)==null?void 0:y.call(d,s,this));const W=await((S=(v=this.options).onMutate)==null?void 0:S.call(v,s));W!==this.state.context&&ce(this,dn,ia).call(this,{type:"pending",context:W,variables:s,isPaused:o})}const w=await B(this,Ha).start();return await((g=(h=B(this,he).config).onSuccess)==null?void 0:g.call(h,w,s,this.state.context,this)),await((b=(p=this.options).onSuccess)==null?void 0:b.call(p,w,s,this.state.context)),await((M=(x=B(this,he).config).onSettled)==null?void 0:M.call(x,w,null,this.state.variables,this.state.context,this)),await((j=(U=this.options).onSettled)==null?void 0:j.call(U,w,null,s,this.state.context)),ce(this,dn,ia).call(this,{type:"success",data:w}),w}catch(w){try{throw await((Z=(G=B(this,he).config).onError)==null?void 0:Z.call(G,w,s,this.state.context,this)),await((I=(K=this.options).onError)==null?void 0:I.call(K,w,s,this.state.context)),await((Y=(k=B(this,he).config).onSettled)==null?void 0:Y.call(k,void 0,w,this.state.variables,this.state.context,this)),await((q=($=this.options).onSettled)==null?void 0:q.call($,void 0,w,s,this.state.context)),w}finally{ce(this,dn,ia).call(this,{type:"error",error:w})}}finally{B(this,he).runNext(this)}}},fn=new WeakMap,he=new WeakMap,Ha=new WeakMap,dn=new WeakSet,ia=function(s){const u=c=>{switch(s.type){case"failed":return{...c,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...c,isPaused:!0};case"continue":return{...c,isPaused:!1};case"pending":return{...c,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...c,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...c,data:void 0,error:s.error,failureCount:c.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=u(this.state),ye.batch(()=>{B(this,fn).forEach(c=>{c.onMutationUpdate(s)}),B(this,he).notify({mutation:this,type:"updated",action:s})})},bv);function NS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Un,en,eu,_v,LS=(_v=class extends Ls{constructor(s={}){super();Ot(this,Un);Ot(this,en);Ot(this,eu);this.config=s,yt(this,Un,new Set),yt(this,en,new Map),yt(this,eu,0)}build(s,u,c){const o=new US({mutationCache:this,mutationId:++ps(this,eu)._,options:s.defaultMutationOptions(u),state:c});return this.add(o),o}add(s){B(this,Un).add(s);const u=_s(s);if(typeof u=="string"){const c=B(this,en).get(u);c?c.push(s):B(this,en).set(u,[s])}this.notify({type:"added",mutation:s})}remove(s){if(B(this,Un).delete(s)){const u=_s(s);if(typeof u=="string"){const c=B(this,en).get(u);if(c)if(c.length>1){const o=c.indexOf(s);o!==-1&&c.splice(o,1)}else c[0]===s&&B(this,en).delete(u)}}this.notify({type:"removed",mutation:s})}canRun(s){const u=_s(s);if(typeof u=="string"){const c=B(this,en).get(u),o=c==null?void 0:c.find(d=>d.state.status==="pending");return!o||o===s}else return!0}runNext(s){var c;const u=_s(s);if(typeof u=="string"){const o=(c=B(this,en).get(u))==null?void 0:c.find(d=>d!==s&&d.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ye.batch(()=>{B(this,Un).forEach(s=>{this.notify({type:"removed",mutation:s})}),B(this,Un).clear(),B(this,en).clear()})}getAll(){return Array.from(B(this,Un))}find(s){const u={exact:!0,...s};return this.getAll().find(c=>sv(u,c))}findAll(s={}){return this.getAll().filter(u=>sv(s,u))}notify(s){ye.batch(()=>{this.listeners.forEach(u=>{u(s)})})}resumePausedMutations(){const s=this.getAll().filter(u=>u.state.isPaused);return ye.batch(()=>Promise.all(s.map(u=>u.continue().catch(Je))))}},Un=new WeakMap,en=new WeakMap,eu=new WeakMap,_v);function _s(l){var s;return(s=l.options.scope)==null?void 0:s.id}function ov(l){return{onFetch:(s,u)=>{var g,p,b,x,M;const c=s.options,o=(b=(p=(g=s.fetchOptions)==null?void 0:g.meta)==null?void 0:p.fetchMore)==null?void 0:b.direction,d=((x=s.state.data)==null?void 0:x.pages)||[],y=((M=s.state.data)==null?void 0:M.pageParams)||[];let v={pages:[],pageParams:[]},S=0;const h=async()=>{let U=!1;const j=K=>{Object.defineProperty(K,"signal",{enumerable:!0,get:()=>(s.signal.aborted?U=!0:s.signal.addEventListener("abort",()=>{U=!0}),s.signal)})},G=Hv(s.options,s.fetchOptions),Z=async(K,I,k)=>{if(U)return Promise.reject();if(I==null&&K.pages.length)return Promise.resolve(K);const Y={client:s.client,queryKey:s.queryKey,pageParam:I,direction:k?"backward":"forward",meta:s.options.meta};j(Y);const $=await G(Y),{maxPages:q}=s.options,w=k?_S:bS;return{pages:w(K.pages,$,q),pageParams:w(K.pageParams,I,q)}};if(o&&d.length){const K=o==="backward",I=K?jS:fv,k={pages:d,pageParams:y},Y=I(c,k);v=await Z(k,Y,K)}else{const K=l??d.length;do{const I=S===0?y[0]??c.initialPageParam:fv(c,v);if(S>0&&I==null)break;v=await Z(v,I),S++}while(S<K)}return v};s.options.persister?s.fetchFn=()=>{var U,j;return(j=(U=s.options).persister)==null?void 0:j.call(U,h,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},u)}:s.fetchFn=h}}}function fv(l,{pages:s,pageParams:u}){const c=s.length-1;return s.length>0?l.getNextPageParam(s[c],s,u[c],u):void 0}function jS(l,{pages:s,pageParams:u}){var c;return s.length>0?(c=l.getPreviousPageParam)==null?void 0:c.call(l,s[0],s,u[0],u):void 0}var Yt,ca,oa,Bl,ql,fa,Ql,Gl,Ev,HS=(Ev=class{constructor(l={}){Ot(this,Yt);Ot(this,ca);Ot(this,oa);Ot(this,Bl);Ot(this,ql);Ot(this,fa);Ot(this,Ql);Ot(this,Gl);yt(this,Yt,l.queryCache||new wS),yt(this,ca,l.mutationCache||new LS),yt(this,oa,l.defaultOptions||{}),yt(this,Bl,new Map),yt(this,ql,new Map),yt(this,fa,0)}mount(){ps(this,fa)._++,B(this,fa)===1&&(yt(this,Ql,Bv.subscribe(async l=>{l&&(await this.resumePausedMutations(),B(this,Yt).onFocus())})),yt(this,Gl,zs.subscribe(async l=>{l&&(await this.resumePausedMutations(),B(this,Yt).onOnline())})))}unmount(){var l,s;ps(this,fa)._--,B(this,fa)===0&&((l=B(this,Ql))==null||l.call(this),yt(this,Ql,void 0),(s=B(this,Gl))==null||s.call(this),yt(this,Gl,void 0))}isFetching(l){return B(this,Yt).findAll({...l,fetchStatus:"fetching"}).length}isMutating(l){return B(this,ca).findAll({...l,status:"pending"}).length}getQueryData(l){var u;const s=this.defaultQueryOptions({queryKey:l});return(u=B(this,Yt).get(s.queryHash))==null?void 0:u.state.data}ensureQueryData(l){const s=this.defaultQueryOptions(l),u=B(this,Yt).build(this,s),c=u.state.data;return c===void 0?this.fetchQuery(l):(l.revalidateIfStale&&u.isStaleByTime(iv(s.staleTime,u))&&this.prefetchQuery(s),Promise.resolve(c))}getQueriesData(l){return B(this,Yt).findAll(l).map(({queryKey:s,state:u})=>{const c=u.data;return[s,c]})}setQueryData(l,s,u){const c=this.defaultQueryOptions({queryKey:l}),o=B(this,Yt).get(c.queryHash),d=o==null?void 0:o.state.data,y=yS(s,d);if(y!==void 0)return B(this,Yt).build(this,c).setData(y,{...u,manual:!0})}setQueriesData(l,s,u){return ye.batch(()=>B(this,Yt).findAll(l).map(({queryKey:c})=>[c,this.setQueryData(c,s,u)]))}getQueryState(l){var u;const s=this.defaultQueryOptions({queryKey:l});return(u=B(this,Yt).get(s.queryHash))==null?void 0:u.state}removeQueries(l){const s=B(this,Yt);ye.batch(()=>{s.findAll(l).forEach(u=>{s.remove(u)})})}resetQueries(l,s){const u=B(this,Yt);return ye.batch(()=>(u.findAll(l).forEach(c=>{c.reset()}),this.refetchQueries({type:"active",...l},s)))}cancelQueries(l,s={}){const u={revert:!0,...s},c=ye.batch(()=>B(this,Yt).findAll(l).map(o=>o.cancel(u)));return Promise.all(c).then(Je).catch(Je)}invalidateQueries(l,s={}){return ye.batch(()=>(B(this,Yt).findAll(l).forEach(u=>{u.invalidate()}),(l==null?void 0:l.refetchType)==="none"?Promise.resolve():this.refetchQueries({...l,type:(l==null?void 0:l.refetchType)??(l==null?void 0:l.type)??"active"},s)))}refetchQueries(l,s={}){const u={...s,cancelRefetch:s.cancelRefetch??!0},c=ye.batch(()=>B(this,Yt).findAll(l).filter(o=>!o.isDisabled()).map(o=>{let d=o.fetch(void 0,u);return u.throwOnError||(d=d.catch(Je)),o.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(c).then(Je)}fetchQuery(l){const s=this.defaultQueryOptions(l);s.retry===void 0&&(s.retry=!1);const u=B(this,Yt).build(this,s);return u.isStaleByTime(iv(s.staleTime,u))?u.fetch(s):Promise.resolve(u.state.data)}prefetchQuery(l){return this.fetchQuery(l).then(Je).catch(Je)}fetchInfiniteQuery(l){return l.behavior=ov(l.pages),this.fetchQuery(l)}prefetchInfiniteQuery(l){return this.fetchInfiniteQuery(l).then(Je).catch(Je)}ensureInfiniteQueryData(l){return l.behavior=ov(l.pages),this.ensureQueryData(l)}resumePausedMutations(){return zs.isOnline()?B(this,ca).resumePausedMutations():Promise.resolve()}getQueryCache(){return B(this,Yt)}getMutationCache(){return B(this,ca)}getDefaultOptions(){return B(this,oa)}setDefaultOptions(l){yt(this,oa,l)}setQueryDefaults(l,s){B(this,Bl).set(Qa(l),{queryKey:l,defaultOptions:s})}getQueryDefaults(l){const s=[...B(this,Bl).values()],u={};return s.forEach(c=>{Ii(l,c.queryKey)&&Object.assign(u,c.defaultOptions)}),u}setMutationDefaults(l,s){B(this,ql).set(Qa(l),{mutationKey:l,defaultOptions:s})}getMutationDefaults(l){const s=[...B(this,ql).values()],u={};return s.forEach(c=>{Ii(l,c.mutationKey)&&Object.assign(u,c.defaultOptions)}),u}defaultQueryOptions(l){if(l._defaulted)return l;const s={...B(this,oa).queries,...this.getQueryDefaults(l.queryKey),...l,_defaulted:!0};return s.queryHash||(s.queryHash=Ho(s.queryKey,s)),s.refetchOnReconnect===void 0&&(s.refetchOnReconnect=s.networkMode!=="always"),s.throwOnError===void 0&&(s.throwOnError=!!s.suspense),!s.networkMode&&s.persister&&(s.networkMode="offlineFirst"),s.queryFn===Bo&&(s.enabled=!1),s}defaultMutationOptions(l){return l!=null&&l._defaulted?l:{...B(this,oa).mutations,...(l==null?void 0:l.mutationKey)&&this.getMutationDefaults(l.mutationKey),...l,_defaulted:!0}}clear(){B(this,Yt).clear(),B(this,ca).clear()}},Yt=new WeakMap,ca=new WeakMap,oa=new WeakMap,Bl=new WeakMap,ql=new WeakMap,fa=new WeakMap,Ql=new WeakMap,Gl=new WeakMap,Ev);function Yv(l){return l}function BS(l){return{mutationKey:l.options.mutationKey,state:l.state,...l.options.scope&&{scope:l.options.scope},...l.meta&&{meta:l.meta}}}function qS(l,s,u){var c;return{dehydratedAt:Date.now(),state:{...l.state,...l.state.data!==void 0&&{data:s(l.state.data)}},queryKey:l.queryKey,queryHash:l.queryHash,...l.state.status==="pending"&&{promise:(c=l.promise)==null?void 0:c.then(s).catch(o=>u(o)?Promise.reject(new Error("redacted")):Promise.reject(o))},...l.meta&&{meta:l.meta}}}function QS(l){return l.state.isPaused}function GS(l){return l.state.status==="success"}function VS(l){return!0}function dv(l,s={}){var S,h,g,p;const u=s.shouldDehydrateMutation??((S=l.getDefaultOptions().dehydrate)==null?void 0:S.shouldDehydrateMutation)??QS,c=l.getMutationCache().getAll().flatMap(b=>u(b)?[BS(b)]:[]),o=s.shouldDehydrateQuery??((h=l.getDefaultOptions().dehydrate)==null?void 0:h.shouldDehydrateQuery)??GS,d=s.shouldRedactErrors??((g=l.getDefaultOptions().dehydrate)==null?void 0:g.shouldRedactErrors)??VS,y=s.serializeData??((p=l.getDefaultOptions().dehydrate)==null?void 0:p.serializeData)??Yv,v=l.getQueryCache().getAll().flatMap(b=>o(b)?[qS(b,y,d)]:[]);return{mutations:c,queries:v}}function hv(l,s,u){var S;if(typeof s!="object"||s===null)return;const c=l.getMutationCache(),o=l.getQueryCache(),d=((S=l.getDefaultOptions().hydrate)==null?void 0:S.deserializeData)??Yv,y=s.mutations||[],v=s.queries||[];y.forEach(({state:h,...g})=>{var p,b;c.build(l,{...(p=l.getDefaultOptions().hydrate)==null?void 0:p.mutations,...(b=u==null?void 0:u.defaultOptions)==null?void 0:b.mutations,...g},h)}),v.forEach(({queryKey:h,state:g,queryHash:p,meta:b,promise:x,dehydratedAt:M})=>{var I,k;const U=x?MS(x):void 0,j=g.data===void 0?U==null?void 0:U.data:g.data,G=j===void 0?j:d(j);let Z=o.get(p);const K=(Z==null?void 0:Z.state.status)==="pending";if(Z){const Y=U&&M!==void 0&&M>Z.state.dataUpdatedAt;if(g.dataUpdatedAt>Z.state.dataUpdatedAt||Y){const{fetchStatus:$,...q}=g;Z.setState({...q,data:G})}}else Z=o.build(l,{...(I=l.getDefaultOptions().hydrate)==null?void 0:I.queries,...(k=u==null?void 0:u.defaultOptions)==null?void 0:k.queries,queryKey:h,queryHash:p,meta:b},{...g,data:G,fetchStatus:"idle",status:G!==void 0?"success":g.status});x&&!K&&(M===void 0||M>Z.state.dataUpdatedAt)&&Z.fetch(void 0,{initialPromise:Promise.resolve(x).then(d)})})}var Kv=st.createContext(void 0),Fb=l=>{const s=st.useContext(Kv);if(!s)throw new Error("No QueryClient set, use QueryClientProvider to set one");return s},YS=({client:l,children:s})=>(st.useEffect(()=>(l.mount(),()=>{l.unmount()}),[l]),V.jsx(Kv.Provider,{value:l,children:s}));function KS(l,s,u){const c=new Set,o=new Set,d=s.getDefaultOptions();s.setDefaultOptions({...d,queries:{...d.queries,_experimental_beforeQuery:v=>{var S,h;(h=(S=d.queries)==null?void 0:S._experimental_beforeQuery)==null||h.call(S,v);const g=v.queryKeyHashFn||Qa;if(l.isServer){if(c.has(g(v.queryKey)))return;if(c.add(g(v.queryKey)),s.getQueryData(v.queryKey)!==void 0){v.__skipInjection=!0;return}}else{const p=l.clientSsr.getStreamedValue("__QueryClient__"+g(v.queryKey));p&&!p.hydrated&&(p.hydrated=!0,hv(s,p))}},_experimental_afterQuery:(v,S)=>{var h,g;const p=v.queryKeyHashFn||Qa;l.isServer&&!v.__skipInjection&&s.getQueryData(v.queryKey)!==void 0&&!o.has(p(v.queryKey))&&(o.add(p(v.queryKey)),l.serverSsr.streamValue("__QueryClient__"+p(v.queryKey),dv(s,{shouldDehydrateMutation:()=>!1,shouldDehydrateQuery:b=>p(b.queryKey)===p(v.queryKey)}))),(g=(h=d.queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,v,S)}}});{const v=s.getMutationCache().config;s.getMutationCache().config={...v,onError:(h,g,p,b)=>{var x;return Ee(h)?(h.options._fromLocation=l.state.location,l.navigate(l.resolveRedirect(h).options)):(x=v.onError)==null?void 0:x.call(v,h,g,p,b)}};const S=s.getQueryCache().config;s.getQueryCache().config={...S,onError:(h,g)=>{var p;return Ee(h)?(h.options._fromLocation=l.state.location,l.navigate(l.resolveRedirect(h).options)):(p=S.onError)==null?void 0:p.call(S,h,g)}}}const y=l.options;return l.options={...l.options,dehydrate:()=>{var v;return{...(v=y.dehydrate)==null?void 0:v.call(y),dehydratedQueryClient:dv(s)}},hydrate:v=>{var S;(S=y.hydrate)==null||S.call(y,v),hv(s,v.dehydratedQueryClient)},context:{...y.context,queryClient:s},Wrap:({children:v})=>{const S=st.Fragment,h=y.Wrap||st.Fragment;return V.jsx(S,{children:V.jsx(YS,{client:s,children:V.jsx(h,{children:v})})})}},l}var XS=function(){return null};const ZS=function(){return null};function JS(){return V.jsx("header",{className:"p-2 flex gap-2 bg-white text-black justify-between",children:V.jsxs("nav",{className:"flex flex-row",children:[V.jsx("div",{className:"px-2",children:V.jsx(ua,{to:"/",activeProps:{className:"font-bold"},children:"Home"})}),V.jsx("div",{className:"px-2",children:V.jsx(ua,{to:"/basic",activeProps:{className:"font-bold"},children:"Basic Example"})}),V.jsx("div",{className:"px-2",children:V.jsx(ua,{to:"/suspense",activeProps:{className:"font-bold"},children:"Suspense Example"})}),V.jsx("div",{className:"px-2",children:V.jsx(ua,{to:"/preloading",activeProps:{className:"font-bold"},children:"Preloading Example"})}),V.jsx("div",{className:"px-2",children:V.jsx(ua,{to:"/intent-preloading",preload:"intent",activeProps:{className:"font-bold"},children:"Intent Preloading Example"})}),V.jsx("div",{className:"px-2",children:V.jsx(ua,{to:"/pagination",activeProps:{className:"font-bold"},children:"Pagination Example"})})]})})}const FS="/assets/global-B8kMkExK.css",Ga=Kg()({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"fizzbuzz"}],links:[{rel:"icon",href:"/favicon.ico"},{rel:"stylesheet",href:FS}]}),component:kS});function kS(){return V.jsx($S,{children:V.jsx(jo,{})})}function $S(l){return V.jsxs("html",{lang:"en",children:[V.jsx("head",{children:V.jsx(oS,{})}),V.jsxs("body",{children:[V.jsx(JS,{}),l.children,V.jsx(ZS,{}),V.jsx(XS,{buttonPosition:"bottom-right"}),V.jsx(dS,{})]})]})}var zn;function PS(l){return{lang:(l==null?void 0:l.lang)??(zn==null?void 0:zn.lang),message:l==null?void 0:l.message,abortEarly:(l==null?void 0:l.abortEarly)??(zn==null?void 0:zn.abortEarly),abortPipeEarly:(l==null?void 0:l.abortPipeEarly)??(zn==null?void 0:zn.abortPipeEarly)}}var vo;function WS(l){return vo==null?void 0:vo.get(l)}var mo;function IS(l){return mo==null?void 0:mo.get(l)}var po;function tb(l,s){var u;return(u=po==null?void 0:po.get(l))==null?void 0:u.get(s)}function eb(l){var u,c;const s=typeof l;return s==="string"?`"${l}"`:s==="number"||s==="bigint"||s==="boolean"?`${l}`:s==="object"||s==="function"?(l&&((c=(u=Object.getPrototypeOf(l))==null?void 0:u.constructor)==null?void 0:c.name))??"null":s}function Ao(l,s,u,c,o){const d=o&&"input"in o?o.input:u.value,y=(o==null?void 0:o.expected)??l.expects??null,v=(o==null?void 0:o.received)??eb(d),S={kind:l.kind,type:l.type,input:d,expected:y,received:v,message:`Invalid ${s}: ${y?`Expected ${y} but r`:"R"}eceived ${v}`,requirement:l.requirement,path:o==null?void 0:o.path,issues:o==null?void 0:o.issues,lang:c.lang,abortEarly:c.abortEarly,abortPipeEarly:c.abortPipeEarly},h=l.kind==="schema",g=(o==null?void 0:o.message)??l.message??tb(l.reference,S.lang)??(h?IS(S.lang):null)??c.message??WS(S.lang);g!==void 0&&(S.message=typeof g=="function"?g(S):g),h&&(u.typed=!1),u.issues?u.issues.push(S):u.issues=[S]}function qo(l){return{version:1,vendor:"valibot",validate(s){return l["~run"]({value:s},PS())}}}function nb(l,s,u){return typeof l.fallback=="function"?l.fallback(s,u):l.fallback}function Xv(l,s,u){return typeof l.default=="function"?l.default(s,u):l.default}function Kl(l){return{kind:"schema",type:"number",reference:Kl,expects:"number",async:!1,message:l,get"~standard"(){return qo(this)},"~run"(s,u){return typeof s.value=="number"&&!isNaN(s.value)?s.typed=!0:Ao(this,"type",s,u),s}}}function Xl(l,s){return{kind:"schema",type:"object",reference:Xl,expects:"Object",async:!1,entries:l,message:s,get"~standard"(){return qo(this)},"~run"(u,c){var d;const o=u.value;if(o&&typeof o=="object"){u.typed=!0,u.value={};for(const y in this.entries){const v=this.entries[y];if(y in o||(v.type==="exact_optional"||v.type==="optional"||v.type==="nullish")&&v.default!==void 0){const S=y in o?o[y]:Xv(v),h=v["~run"]({value:S},c);if(h.issues){const g={type:"object",origin:"value",input:o,key:y,value:S};for(const p of h.issues)p.path?p.path.unshift(g):p.path=[g],(d=u.issues)==null||d.push(p);if(u.issues||(u.issues=h.issues),c.abortEarly){u.typed=!1;break}}h.typed||(u.typed=!1),u.value[y]=h.value}else if(v.fallback!==void 0)u.value[y]=nb(v);else if(v.type!=="exact_optional"&&v.type!=="optional"&&v.type!=="nullish"&&(Ao(this,"key",u,c,{input:void 0,expected:`"${y}"`,path:[{type:"object",origin:"key",input:o,key:y,value:o[y]}]}),c.abortEarly))break}}else Ao(this,"type",u,c);return u}}}function Zl(l,s){return{kind:"schema",type:"optional",reference:Zl,expects:`(${l.expects} | undefined)`,async:!1,wrapped:l,default:s,get"~standard"(){return qo(this)},"~run"(u,c){return u.value===void 0&&(this.default!==void 0&&(u.value=Xv(this,u,c)),u.value===void 0)?(u.typed=!0,u):this.wrapped["~run"](u,c)}}}async function ab(l,s,u){const c=s[0];if(yn(c)&&c.method){const o=c,d=o.data instanceof FormData?"formData":"payload",y=new Headers({...d==="payload"?{"content-type":"application/json",accept:"application/json","x-tsr-redirect":"manual"}:{},...o.headers instanceof Headers?Object.fromEntries(o.headers.entries()):o.headers});if(o.method==="GET"){const v=Dv({payload:ve.stringify({data:o.data,context:o.context})});v&&(l.includes("?")?l+=`&${v}`:l+=`?${v}`)}return l.includes("?")?l+="&createServerFn":l+="?createServerFn",o.response==="raw"&&(l+="&raw"),await yv(()=>u(l,{method:o.method,headers:y,signal:o.signal,...lb(o)}))}return await yv(()=>u(l,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s),redirect:"manual"}))}function lb(l){return l.method==="POST"?l.data instanceof FormData?(l.data.set("__TSR_CONTEXT",ve.stringify(l.context)),{body:l.data}):{body:ve.stringify({data:l.data??null,context:l.context})}:{}}async function yv(l){var s;const u=await(async()=>{try{return await l()}catch(c){if(c instanceof Response)return c;throw c}})();if(!u.ok){const c=u.headers.get("content-type");throw c&&c.includes("application/json")?ve.decode(await u.json()):new Error(await u.text())}if((s=u.headers.get("content-type"))!=null&&s.includes("application/json")){let c=ve.decode(await u.json());const o=tg(c);if(o&&(c=o),Ee(c)||Re(c)||c instanceof Error)throw c;return c}return u}function ib(l){return l.replace(/^\/|\/$/g,"")}const ub=(l,s)=>{const u=`/${ib(s)}/${l}`;return Object.assign((...o)=>ab(u,o,fetch),{url:u,functionId:l})},kb=25,sb=ub("src_util_pokemon_ts--getServerPokemonList_createServerFn_handler","/_serverFn"),Qo=Rs({method:"GET"}).handler(sb),rb=()=>ae(()=>import("./suspense-DRsZG-IO.js"),[]),cb=()=>ae(()=>import("./suspense-CVRJPFh1.js"),[]),ob=()=>ae(()=>import("./suspense-C9NRSXhZ.js"),__vite__mapDeps([0,1,2])),fb=Xl({offset:Zl(Kl(),0)}),Zv=ha({validateSearch:fb,component:Te(ob,"component",()=>Zv.ssr),notFoundComponent:Te(cb,"notFoundComponent"),errorComponent:Te(rb,"errorComponent"),pendingComponent:db});function db(){return V.jsx("div",{children:"Loading..."})}const hb=()=>ae(()=>import("./preloading-CS9n1_uB.js"),[]),yb=()=>ae(()=>import("./preloading-CF6-eBB1.js"),[]),vb=()=>ae(()=>import("./preloading-Cx2nmQCS.js"),__vite__mapDeps([3,1,2])),mb=20,pb=Xl({offset:Zl(Kl(),0)}),Jv=ha({validateSearch:pb,loaderDeps:({search:l})=>({offset:l.offset}),context:({deps:l})=>{const s=["pokemon-list","preloading",{limit:mb,offset:l.offset}];return{pokemonListOptions:{queryKey:s,queryFn:async()=>{const c=await Qo({data:{offset:l.offset}});return{results:c.pokemon.map(o=>({name:o.name,url:`/api/v2/pokemon/${o.id}/`})),next:c.nextOffset!==null?`/api/v2/pokemon/?offset=${c.nextOffset}`:null,previous:c.prevOffset!==null?`/api/v2/pokemon/?offset=${c.prevOffset}`:null}}}}},loader:({context:l})=>{l.queryClient.prefetchQuery(l.pokemonListOptions)},component:Te(vb,"component",()=>Jv.ssr),notFoundComponent:Te(yb,"notFoundComponent"),errorComponent:Te(hb,"errorComponent"),pendingComponent:gb});function gb(){return V.jsx("div",{children:"Loading..."})}const Sb=()=>ae(()=>import("./pagination-CseTwIHn.js"),[]),bb=()=>ae(()=>import("./pagination-DT5U_TVa.js"),[]),_b=()=>ae(()=>import("./pagination-DHyhKn7Y.js"),__vite__mapDeps([4,1,2])),Eb=20,Rb=Xl({offset:Zl(Kl(),0)}),Fv=ha({validateSearch:Rb,loaderDeps:({search:l})=>({offset:l.offset}),context:({deps:l})=>{const s=["pokemon-list","pagination",{limit:Eb,offset:l.offset}];return{pokemonListOptions:{queryKey:s,queryFn:async({queryKey:c})=>(await Qo({data:{offset:c[2].offset}})).pokemon}}},loader:({context:l})=>{l.queryClient.prefetchQuery(l.pokemonListOptions)},component:Te(_b,"component",()=>Fv.ssr),notFoundComponent:Te(bb,"notFoundComponent"),errorComponent:Te(Sb,"errorComponent"),pendingComponent:Tb});function Tb(){return V.jsx("div",{children:"Loading..."})}const Mb=()=>ae(()=>import("./intent-preloading-Bn-PcF_7.js"),[]),Ob=()=>ae(()=>import("./intent-preloading-BYVPES3z.js"),[]),Ab=()=>ae(()=>import("./intent-preloading-BbIeCNkQ.js"),__vite__mapDeps([5,1,2])),xb=20,Db=Xl({offset:Zl(Kl(),0)}),kv=ha({validateSearch:Db,loaderDeps:({search:l})=>({offset:l.offset}),context:({deps:l})=>{const s=["pokemon-list","intent-preloading",{limit:xb,offset:l.offset}];return{pokemonListOptions:{queryKey:s,queryFn:async()=>{const c=await Qo({data:{offset:l.offset}});return{results:c.pokemon.map(o=>({name:o.name,url:`/api/v2/pokemon/${o.id}/`})),next:c.nextOffset!==null?`/api/v2/pokemon/?offset=${c.nextOffset}`:null,previous:c.prevOffset!==null?`/api/v2/pokemon/?offset=${c.prevOffset}`:null}}}}},loader:({context:l})=>{l.queryClient.prefetchQuery(l.pokemonListOptions)},component:Te(Ab,"component",()=>kv.ssr),notFoundComponent:Te(Ob,"notFoundComponent"),errorComponent:Te(Mb,"errorComponent"),pendingComponent:Cb});function Cb(){return V.jsx("div",{children:"Loading..."})}const zb=()=>ae(()=>import("./basic-D_HBRECz.js"),__vite__mapDeps([6,2])),wb=Xl({offset:Zl(Kl(),0)}),$v=ha({validateSearch:wb,component:Te(zb,"component",()=>$v.ssr)}),Ub=()=>ae(()=>import("./index-Cb09vRb3.js"),[]),Pv=ha({component:Te(Ub,"component",()=>Pv.ssr)}),Nb=Zv.update({id:"/suspense",path:"/suspense",getParentRoute:()=>Ga}),Lb=Jv.update({id:"/preloading",path:"/preloading",getParentRoute:()=>Ga}),jb=Fv.update({id:"/pagination",path:"/pagination",getParentRoute:()=>Ga}),Hb=kv.update({id:"/intent-preloading",path:"/intent-preloading",getParentRoute:()=>Ga}),Bb=$v.update({id:"/basic",path:"/basic",getParentRoute:()=>Ga}),qb=Pv.update({id:"/",path:"/",getParentRoute:()=>Ga}),Qb={IndexRoute:qb,BasicRoute:Bb,IntentPreloadingRoute:Hb,PaginationRoute:jb,PreloadingRoute:Lb,SuspenseRoute:Nb},Gb=Ga._addFileChildren(Qb)._addFileTypes();function Vb(){const l=new HS;return KS(iS({routeTree:Gb,scrollRestoration:!0,defaultPreload:!1,defaultStructuralSharing:!0,defaultPreloadStaleTime:0,defaultPendingMs:0,defaultErrorComponent:()=>V.jsx("div",{children:"Error"}),defaultPendingComponent:()=>V.jsx("div",{children:"Loading..."}),defaultNotFoundComponent:()=>V.jsx("div",{children:"Not Found"}),context:{queryClient:l}}),l)}const Yb=Vb();st.startTransition(()=>{R0.hydrateRoot(document,V.jsx(st.StrictMode,{children:V.jsx(hS,{router:Yb})}))});export{ua as L,kb as P,Zv as R,Ls as S,Jv as a,Fv as b,kv as c,Ne as d,$v as e,pS as f,Qo as g,iv as h,Ee as i,V as j,js as k,vS as l,Bv as m,Je as n,CS as o,TS as p,SS as q,st as r,Zb as s,mS as t,Fb as u,ye as v,Jb as w};
-1
.output/public/assets/pagination-CseTwIHn.js
··· 1 - import{j as r}from"./main-C_SO_aYE.js";const t=function(){return r.jsx("div",{children:"Error"})};export{t as errorComponent};
-1
.output/public/assets/pagination-DHyhKn7Y.js
··· 1 - import{b as f,u as N,r as p,j as e,L as x}from"./main-C_SO_aYE.js";import{u as y}from"./useSuspenseQuery-BacjgsWj.js";import{T as v,a as g,b as d,c as o,d as T,e as a,f as h,g as j}from"./table-BGKcx7UY.js";const i=20,P=/\/api\/v2\/pokemon\/(\d+)\/?/,L=function(){const{offset:c}=f.useSearch(),{pokemonListOptions:l}=f.useRouteContext(),u=N(),{data:s}=y(l),n=p.useMemo(()=>(s==null?void 0:s.previous)==null?null:new URL(s.previous).searchParams.get("offset")??null,[s==null?void 0:s.previous]),t=p.useMemo(()=>(s==null?void 0:s.next)==null?null:new URL(s.next).searchParams.get("offset")??null,[s==null?void 0:s.next]);n!==null&&u.prefetchQuery({...l,queryKey:["pokemon-list","pagination",{limit:i,offset:Number(n)}]}),t!==null&&u.prefetchQuery({...l,queryKey:["pokemon-list","pagination",{limit:i,offset:Number(t)}]});const b=s.results??[];return e.jsxs("div",{className:"p-4",children:[e.jsxs("h1",{className:"text-2xl font-bold mb-4",children:["National Pokédex: Pokémon ",c+1,"-",c+i]}),e.jsxs(v,{children:[e.jsx(g,{children:e.jsxs(d,{children:[e.jsx(o,{children:"#"}),e.jsx(o,{children:"Name"}),e.jsx(o,{children:"Details"})]})}),e.jsx(T,{children:b.map(r=>{var m;return e.jsxs(d,{children:[e.jsx(a,{children:(m=r.url.match(P))==null?void 0:m[1]}),e.jsx(a,{className:"capitalize",children:r.name}),e.jsx(a,{children:e.jsx("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:"View"})})]},r.name)})})]}),e.jsxs("div",{className:"flex justify-center gap-4 mt-4",children:[e.jsx(x,{to:"/pagination",preload:"intent",className:h({variant:"outline",className:j(!n&&"opacity-50 cursor-not-allowed")}),search:{offset:Number(n)},disabled:!n,children:"Previous"}),e.jsx(x,{to:"/pagination",preload:"intent",search:{offset:Number(t)},className:h({variant:"outline",className:j(!t&&"opacity-50 cursor-not-allowed")}),disabled:!t,children:"Next"})]})]})};export{L as component};
-1
.output/public/assets/pagination-DT5U_TVa.js
··· 1 - import{j as o}from"./main-C_SO_aYE.js";const e=function(){return o.jsx("div",{children:"Not Found"})};export{e as notFoundComponent};
-1
.output/public/assets/preloading-CF6-eBB1.js
··· 1 - import{j as o}from"./main-C_SO_aYE.js";const e=function(){return o.jsx("div",{children:"Not Found"})};export{e as notFoundComponent};
-1
.output/public/assets/preloading-CS9n1_uB.js
··· 1 - import{j as r}from"./main-C_SO_aYE.js";const t=function(){return r.jsx("div",{children:"Error"})};export{t as errorComponent};
-1
.output/public/assets/preloading-Cx2nmQCS.js
··· 1 - import{a as i,r as u,j as e,L as m}from"./main-C_SO_aYE.js";import{u as j}from"./useSuspenseQuery-BacjgsWj.js";import{T as b,a as N,b as x,c as l,d as v,e as a,f as d,g as f}from"./table-BGKcx7UY.js";const T=20,g=/\/api\/v2\/pokemon\/(\d+)\/?/,O=function(){const{offset:o}=i.useSearch(),{pokemonListOptions:h}=i.useRouteContext(),{data:s}=j(h),r=u.useMemo(()=>(s==null?void 0:s.previous)==null?null:new URL(s.previous).searchParams.get("offset")??null,[s==null?void 0:s.previous]),t=u.useMemo(()=>(s==null?void 0:s.next)==null?null:new URL(s.next).searchParams.get("offset")??null,[s==null?void 0:s.next]),p=s.results??[];return e.jsxs("div",{className:"p-4",children:[e.jsxs("h1",{className:"text-2xl font-bold mb-4",children:["National Pokédex: Pokémon ",o+1,"-",o+T]}),e.jsxs(b,{children:[e.jsx(N,{children:e.jsxs(x,{children:[e.jsx(l,{children:"#"}),e.jsx(l,{children:"Name"}),e.jsx(l,{children:"Details"})]})}),e.jsx(v,{children:p.map(n=>{var c;return e.jsxs(x,{children:[e.jsx(a,{children:(c=n.url.match(g))==null?void 0:c[1]}),e.jsx(a,{className:"capitalize",children:n.name}),e.jsx(a,{children:e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:"View"})})]},n.name)})})]}),e.jsxs("div",{className:"flex justify-center gap-4 mt-4",children:[e.jsx(m,{to:"/preloading",className:d({variant:"outline",className:f(!r&&"opacity-50 cursor-not-allowed")}),search:{offset:Number(r)},disabled:!r,children:"Previous"}),e.jsx(m,{to:"/preloading",search:{offset:Number(t)},className:d({variant:"outline",className:f(!t&&"opacity-50 cursor-not-allowed")}),disabled:!t,children:"Next"})]})]})};export{O as component};
-1
.output/public/assets/suspense-C9NRSXhZ.js
··· 1 - import{R as j,g as v,r as c,j as e,L as u}from"./main-C_SO_aYE.js";import{u as b}from"./useSuspenseQuery-BacjgsWj.js";import{T as N,a as y,b as f,c as a,d as k,e as i,f as m,g as p}from"./table-BGKcx7UY.js";const x=20,O=/\/api\/v2\/pokemon\/(\d+)\/?/,R=function(){const{offset:t}=j.useSearch(),d=["pokemon-list","suspense",{limit:x,offset:t}],{data:s}=b({queryKey:d,queryFn:async()=>{const n=await v({data:{offset:t}});return{results:n.pokemon.map(r=>({name:r.name,url:`/api/v2/pokemon/${r.id}/`})),next:n.nextOffset!==null?`/api/v2/pokemon/?offset=${n.nextOffset}`:null,previous:n.prevOffset!==null?`/api/v2/pokemon/?offset=${n.prevOffset}`:null}}}),l=c.useMemo(()=>(s==null?void 0:s.previous)==null?null:new URL(s.previous).searchParams.get("offset")??null,[s==null?void 0:s.previous]),o=c.useMemo(()=>(s==null?void 0:s.next)==null?null:new URL(s.next).searchParams.get("offset")??null,[s==null?void 0:s.next]),h=s.results??[];return e.jsxs("div",{className:"p-4",children:[e.jsxs("h1",{className:"text-2xl font-bold mb-4",children:["National Pokédex: Pokémon ",t+1,"-",t+x]}),e.jsxs(N,{children:[e.jsx(y,{children:e.jsxs(f,{children:[e.jsx(a,{children:"#"}),e.jsx(a,{children:"Name"}),e.jsx(a,{children:"Details"})]})}),e.jsx(k,{children:h.map(n=>{var r;return e.jsxs(f,{children:[e.jsx(i,{children:(r=n.url.match(O))==null?void 0:r[1]}),e.jsx(i,{className:"capitalize",children:n.name}),e.jsx(i,{children:e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 underline",children:"View"})})]},n.name)})})]}),e.jsxs("div",{className:"flex justify-center gap-4 mt-4",children:[e.jsx(u,{to:"/suspense",className:m({variant:"outline",className:p(!l&&"opacity-50 cursor-not-allowed")}),search:{offset:Number(l)},disabled:!l,children:"Previous"}),e.jsx(u,{to:"/suspense",search:{offset:Number(o)},className:m({variant:"outline",className:p(!o&&"opacity-50 cursor-not-allowed")}),disabled:!o,children:"Next"})]})]})};export{R as component};
-1
.output/public/assets/suspense-CVRJPFh1.js
··· 1 - import{j as o}from"./main-C_SO_aYE.js";const e=function(){return o.jsx("div",{children:"Not Found"})};export{e as notFoundComponent};
-1
.output/public/assets/suspense-DRsZG-IO.js
··· 1 - import{j as r}from"./main-C_SO_aYE.js";const t=function(){return r.jsx("div",{children:"Error"})};export{t as errorComponent};
-1
.output/public/assets/table-BGKcx7UY.js
··· 1 - var Ze=e=>{throw TypeError(e)};var Te=(e,t,r)=>t.has(e)||Ze("Cannot "+r);var o=(e,t,r)=>(Te(e,t,"read from private field"),r?r.call(e):t.get(e)),T=(e,t,r)=>t.has(e)?Ze("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),k=(e,t,r,s)=>(Te(e,t,"write to private field"),s?s.call(e,r):t.set(e,r),r),S=(e,t,r)=>(Te(e,t,"access private method"),r);import{S as Mt,p as et,f as V,s as Ae,h as Se,n as Pe,k as je,l as tt,t as Tt,m as Et,o as Ot,q as rt,v as mt,r as W,w as At,u as Pt,j as oe}from"./main-C_SO_aYE.js";var P,g,ge,A,te,le,q,K,ve,ce,de,re,se,J,ue,v,be,Ne,_e,Ge,Fe,Le,Ve,Qe,ft,ht,Tr=(ht=class extends Mt{constructor(t,r){super();T(this,v);T(this,P);T(this,g);T(this,ge);T(this,A);T(this,te);T(this,le);T(this,q);T(this,K);T(this,ve);T(this,ce);T(this,de);T(this,re);T(this,se);T(this,J);T(this,ue,new Set);this.options=r,k(this,P,t),k(this,K,null),k(this,q,et()),this.options.experimental_prefetchInRender||o(this,q).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(o(this,g).addObserver(this),st(o(this,g),this.options)?S(this,v,be).call(this):this.updateResult(),S(this,v,Fe).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ue(o(this,g),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ue(o(this,g),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,S(this,v,Le).call(this),S(this,v,Ve).call(this),o(this,g).removeObserver(this)}setOptions(t){const r=this.options,s=o(this,g);if(this.options=o(this,P).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof V(this.options.enabled,o(this,g))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");S(this,v,Qe).call(this),o(this,g).setOptions(this.options),r._defaulted&&!Ae(this.options,r)&&o(this,P).getQueryCache().notify({type:"observerOptionsUpdated",query:o(this,g),observer:this});const a=this.hasListeners();a&&ot(o(this,g),s,this.options,r)&&S(this,v,be).call(this),this.updateResult(),a&&(o(this,g)!==s||V(this.options.enabled,o(this,g))!==V(r.enabled,o(this,g))||Se(this.options.staleTime,o(this,g))!==Se(r.staleTime,o(this,g)))&&S(this,v,Ne).call(this);const i=S(this,v,_e).call(this);a&&(o(this,g)!==s||V(this.options.enabled,o(this,g))!==V(r.enabled,o(this,g))||i!==o(this,J))&&S(this,v,Ge).call(this,i)}getOptimisticResult(t){const r=o(this,P).getQueryCache().build(o(this,P),t),s=this.createResult(r,t);return Nt(this,s)&&(k(this,A,s),k(this,le,this.options),k(this,te,o(this,g).state)),s}getCurrentResult(){return o(this,A)}trackResult(t,r){return new Proxy(t,{get:(s,a)=>(this.trackProp(a),r==null||r(a),Reflect.get(s,a))})}trackProp(t){o(this,ue).add(t)}getCurrentQuery(){return o(this,g)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=o(this,P).defaultQueryOptions(t),s=o(this,P).getQueryCache().build(o(this,P),r);return s.fetch().then(()=>this.createResult(s,r))}fetch(t){return S(this,v,be).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),o(this,A)))}createResult(t,r){var _;const s=o(this,g),a=this.options,i=o(this,A),n=o(this,te),p=o(this,le),f=t!==s?t.state:o(this,ge),{state:y}=t;let b={...y},I=!1,x;if(r._optimisticResults){const E=this.hasListeners(),X=!E&&st(t,r),G=E&&ot(t,s,r,a);(X||G)&&(b={...b,...Ot(y.data,t.options)}),r._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:R,errorUpdatedAt:C,status:w}=b;x=b.data;let N=!1;if(r.placeholderData!==void 0&&x===void 0&&w==="pending"){let E;i!=null&&i.isPlaceholderData&&r.placeholderData===(p==null?void 0:p.placeholderData)?(E=i.data,N=!0):E=typeof r.placeholderData=="function"?r.placeholderData((_=o(this,de))==null?void 0:_.state.data,o(this,de)):r.placeholderData,E!==void 0&&(w="success",x=rt(i==null?void 0:i.data,E,r),I=!0)}if(r.select&&x!==void 0&&!N)if(i&&x===(n==null?void 0:n.data)&&r.select===o(this,ve))x=o(this,ce);else try{k(this,ve,r.select),x=r.select(x),x=rt(i==null?void 0:i.data,x,r),k(this,ce,x),k(this,K,null)}catch(E){k(this,K,E)}o(this,K)&&(R=o(this,K),x=o(this,ce),C=Date.now(),w="error");const H=b.fetchStatus==="fetching",Q=w==="pending",F=w==="error",U=Q&&H,L=x!==void 0,u={status:w,fetchStatus:b.fetchStatus,isPending:Q,isSuccess:w==="success",isError:F,isInitialLoading:U,isLoading:U,data:x,dataUpdatedAt:b.dataUpdatedAt,error:R,errorUpdatedAt:C,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:b.dataUpdateCount>0||b.errorUpdateCount>0,isFetchedAfterMount:b.dataUpdateCount>f.dataUpdateCount||b.errorUpdateCount>f.errorUpdateCount,isFetching:H,isRefetching:H&&!Q,isLoadingError:F&&!L,isPaused:b.fetchStatus==="paused",isPlaceholderData:I,isRefetchError:F&&L,isStale:He(t,r),refetch:this.refetch,promise:o(this,q)};if(this.options.experimental_prefetchInRender){const E=Y=>{u.status==="error"?Y.reject(u.error):u.data!==void 0&&Y.resolve(u.data)},X=()=>{const Y=k(this,q,u.promise=et());E(Y)},G=o(this,q);switch(G.status){case"pending":t.queryHash===s.queryHash&&E(G);break;case"fulfilled":(u.status==="error"||u.data!==G.value)&&X();break;case"rejected":(u.status!=="error"||u.error!==G.reason)&&X();break}}return u}updateResult(){const t=o(this,A),r=this.createResult(o(this,g),this.options);if(k(this,te,o(this,g).state),k(this,le,this.options),o(this,te).data!==void 0&&k(this,de,o(this,g)),Ae(r,t))return;k(this,A,r);const s=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!o(this,ue).size)return!0;const n=new Set(i??o(this,ue));return this.options.throwOnError&&n.add("error"),Object.keys(o(this,A)).some(p=>{const d=p;return o(this,A)[d]!==t[d]&&n.has(d)})};S(this,v,ft).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&S(this,v,Fe).call(this)}},P=new WeakMap,g=new WeakMap,ge=new WeakMap,A=new WeakMap,te=new WeakMap,le=new WeakMap,q=new WeakMap,K=new WeakMap,ve=new WeakMap,ce=new WeakMap,de=new WeakMap,re=new WeakMap,se=new WeakMap,J=new WeakMap,ue=new WeakMap,v=new WeakSet,be=function(t){S(this,v,Qe).call(this);let r=o(this,g).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Pe)),r},Ne=function(){S(this,v,Le).call(this);const t=Se(this.options.staleTime,o(this,g));if(je||o(this,A).isStale||!tt(t))return;const s=Tt(o(this,A).dataUpdatedAt,t)+1;k(this,re,setTimeout(()=>{o(this,A).isStale||this.updateResult()},s))},_e=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(o(this,g)):this.options.refetchInterval)??!1},Ge=function(t){S(this,v,Ve).call(this),k(this,J,t),!(je||V(this.options.enabled,o(this,g))===!1||!tt(o(this,J))||o(this,J)===0)&&k(this,se,setInterval(()=>{(this.options.refetchIntervalInBackground||Et.isFocused())&&S(this,v,be).call(this)},o(this,J)))},Fe=function(){S(this,v,Ne).call(this),S(this,v,Ge).call(this,S(this,v,_e).call(this))},Le=function(){o(this,re)&&(clearTimeout(o(this,re)),k(this,re,void 0))},Ve=function(){o(this,se)&&(clearInterval(o(this,se)),k(this,se,void 0))},Qe=function(){const t=o(this,P).getQueryCache().build(o(this,P),this.options);if(t===o(this,g))return;const r=o(this,g);k(this,g,t),k(this,ge,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},ft=function(t){mt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(o(this,A))}),o(this,P).getQueryCache().notify({query:o(this,g),type:"observerResultsUpdated"})})},ht);function jt(e,t){return V(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function st(e,t){return jt(e,t)||e.state.data!==void 0&&Ue(e,t,t.refetchOnMount)}function Ue(e,t,r){if(V(t.enabled,e)!==!1){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&He(e,t)}return!1}function ot(e,t,r,s){return(e!==t||V(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&He(e,r)}function He(e,t){return V(t.enabled,e)!==!1&&e.isStaleByTime(Se(t.staleTime,e))}function Nt(e,t){return!Ae(e.getCurrentResult(),t)}var pt=W.createContext(!1),_t=()=>W.useContext(pt);pt.Provider;function Gt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ft=W.createContext(Gt()),Lt=()=>W.useContext(Ft),Vt=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Qt=e=>{W.useEffect(()=>{e.clearReset()},[e])},Ut=({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(a&&e.data===void 0||At(r,[e.error,s])),Er=(e,t)=>t.state.data===void 0,Bt=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...r)=>Math.max(t(...r),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Dt=(e,t)=>e.isLoading&&e.isFetching&&!t,Wt=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,nt=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Or(e,t,r){var b,I,x,R,C;const s=Pt(),a=_t(),i=Lt(),n=s.defaultQueryOptions(e);(I=(b=s.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||I.call(b,n),n._optimisticResults=a?"isRestoring":"optimistic",Bt(n),Vt(n,i),Qt(i);const p=!s.getQueryCache().get(n.queryHash),[d]=W.useState(()=>new t(s,n)),f=d.getOptimisticResult(n),y=!a&&e.subscribed!==!1;if(W.useSyncExternalStore(W.useCallback(w=>{const N=y?d.subscribe(mt.batchCalls(w)):Pe;return d.updateResult(),N},[d,y]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),W.useEffect(()=>{d.setOptions(n)},[n,d]),Wt(n,f))throw nt(n,d,i);if(Ut({result:f,errorResetBoundary:i,throwOnError:n.throwOnError,query:s.getQueryCache().get(n.queryHash),suspense:n.suspense}))throw f.error;if((R=(x=s.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||R.call(x,n,f),n.experimental_prefetchInRender&&!je&&Dt(f,a)){const w=p?nt(n,d,i):(C=s.getQueryCache().get(n.queryHash))==null?void 0:C.promise;w==null||w.catch(Pe).finally(()=>{d.updateResult()})}return n.notifyOnChangeProps?f:d.trackResult(f)}function bt(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=bt(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function gt(){for(var e,t,r=0,s="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=bt(e))&&(s&&(s+=" "),s+=t);return s}const at=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,it=gt,Ht=(e,t)=>r=>{var s;if((t==null?void 0:t.variants)==null)return it(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=t,n=Object.keys(a).map(f=>{const y=r==null?void 0:r[f],b=i==null?void 0:i[f];if(y===null)return null;const I=at(y)||at(b);return a[f][I]}),p=r&&Object.entries(r).reduce((f,y)=>{let[b,I]=y;return I===void 0||(f[b]=I),f},{}),d=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((f,y)=>{let{class:b,className:I,...x}=y;return Object.entries(x).every(R=>{let[C,w]=R;return Array.isArray(w)?w.includes({...i,...p}[C]):{...i,...p}[C]===w})?[...f,b,I]:f},[]);return it(e,n,d,r==null?void 0:r.class,r==null?void 0:r.className)},$e="-",$t=e=>{const t=Kt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:n=>{const p=n.split($e);return p[0]===""&&p.length!==1&&p.shift(),vt(p,t)||qt(n)},getConflictingClassGroupIds:(n,p)=>{const d=r[n]||[];return p&&s[n]?[...d,...s[n]]:d}}},vt=(e,t)=>{var n;if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),a=s?vt(e.slice(1),s):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join($e);return(n=t.validators.find(({validator:p})=>p(i)))==null?void 0:n.classGroupId},lt=/^\[(.+)\]$/,qt=e=>{if(lt.test(e)){const t=lt.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Kt=e=>{const{theme:t,classGroups:r}=e,s={nextPart:new Map,validators:[]};for(const a in r)Be(r[a],s,a,t);return s},Be=(e,t,r,s)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:ct(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(Jt(a)){Be(a(s),t,r,s);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,n])=>{Be(n,ct(t,i),r,s)})})},ct=(e,t)=>{let r=e;return t.split($e).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},Jt=e=>e.isThemeGetter,Xt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,s=new Map;const a=(i,n)=>{r.set(i,n),t++,t>e&&(t=0,s=r,r=new Map)};return{get(i){let n=r.get(i);if(n!==void 0)return n;if((n=s.get(i))!==void 0)return a(i,n),n},set(i,n){r.has(i)?r.set(i,n):a(i,n)}}},De="!",We=":",Yt=We.length,Zt=e=>{const{prefix:t,experimentalParseClassName:r}=e;let s=a=>{const i=[];let n=0,p=0,d=0,f;for(let R=0;R<a.length;R++){let C=a[R];if(n===0&&p===0){if(C===We){i.push(a.slice(d,R)),d=R+Yt;continue}if(C==="/"){f=R;continue}}C==="["?n++:C==="]"?n--:C==="("?p++:C===")"&&p--}const y=i.length===0?a:a.substring(d),b=er(y),I=b!==y,x=f&&f>d?f-d:void 0;return{modifiers:i,hasImportantModifier:I,baseClassName:b,maybePostfixModifierPosition:x}};if(t){const a=t+We,i=s;s=n=>n.startsWith(a)?i(n.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:n,maybePostfixModifierPosition:void 0}}if(r){const a=s;s=i=>r({className:i,parseClassName:a})}return s},er=e=>e.endsWith(De)?e.substring(0,e.length-1):e.startsWith(De)?e.substring(1):e,tr=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const a=[];let i=[];return s.forEach(n=>{n[0]==="["||t[n]?(a.push(...i.sort(),n),i=[]):i.push(n)}),a.push(...i.sort()),a}},rr=e=>({cache:Xt(e.cacheSize),parseClassName:Zt(e),sortModifiers:tr(e),...$t(e)}),sr=/\s+/,or=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:a,sortModifiers:i}=t,n=[],p=e.trim().split(sr);let d="";for(let f=p.length-1;f>=0;f-=1){const y=p[f],{isExternal:b,modifiers:I,hasImportantModifier:x,baseClassName:R,maybePostfixModifierPosition:C}=r(y);if(b){d=y+(d.length>0?" "+d:d);continue}let w=!!C,N=s(w?R.substring(0,C):R);if(!N){if(!w){d=y+(d.length>0?" "+d:d);continue}if(N=s(R),!N){d=y+(d.length>0?" "+d:d);continue}w=!1}const H=i(I).join(":"),Q=x?H+De:H,F=Q+N;if(n.includes(F))continue;n.push(F);const U=a(N,w);for(let L=0;L<U.length;++L){const ne=U[L];n.push(Q+ne)}d=y+(d.length>0?" "+d:d)}return d};function nr(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=yt(t))&&(s&&(s+=" "),s+=r);return s}const yt=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=yt(e[s]))&&(r&&(r+=" "),r+=t);return r};function ar(e,...t){let r,s,a,i=n;function n(d){const f=t.reduce((y,b)=>b(y),e());return r=rr(f),s=r.cache.get,a=r.cache.set,i=p,p(d)}function p(d){const f=s(d);if(f)return f;const y=or(d,r);return a(d,y),y}return function(){return i(nr.apply(null,arguments))}}const z=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},xt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ir=/^\d+\/\d+$/,lr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ur=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ie=e=>ir.test(e),m=e=>!!e&&!Number.isNaN(Number(e)),$=e=>!!e&&Number.isInteger(Number(e)),Ee=e=>e.endsWith("%")&&m(e.slice(0,-1)),D=e=>lr.test(e),mr=()=>!0,fr=e=>cr.test(e)&&!dr.test(e),kt=()=>!1,pr=e=>ur.test(e),br=e=>hr.test(e),gr=e=>!l(e)&&!c(e),vr=e=>he(e,St,kt),l=e=>xt.test(e),ee=e=>he(e,zt,fr),Oe=e=>he(e,Rr,m),dt=e=>he(e,Rt,kt),yr=e=>he(e,Ct,br),Re=e=>he(e,It,pr),c=e=>wt.test(e),pe=e=>me(e,zt),xr=e=>me(e,Cr),ut=e=>me(e,Rt),wr=e=>me(e,St),kr=e=>me(e,Ct),Ce=e=>me(e,It,!0),he=(e,t,r)=>{const s=xt.exec(e);return s?s[1]?t(s[1]):r(s[2]):!1},me=(e,t,r=!1)=>{const s=wt.exec(e);return s?s[1]?t(s[1]):r:!1},Rt=e=>e==="position"||e==="percentage",Ct=e=>e==="image"||e==="url",St=e=>e==="length"||e==="size"||e==="bg-size",zt=e=>e==="length",Rr=e=>e==="number",Cr=e=>e==="family-name",It=e=>e==="shadow",Sr=()=>{const e=z("color"),t=z("font"),r=z("text"),s=z("font-weight"),a=z("tracking"),i=z("leading"),n=z("breakpoint"),p=z("container"),d=z("spacing"),f=z("radius"),y=z("shadow"),b=z("inset-shadow"),I=z("text-shadow"),x=z("drop-shadow"),R=z("blur"),C=z("perspective"),w=z("aspect"),N=z("ease"),H=z("animate"),Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...F(),c,l],L=()=>["auto","hidden","clip","visible","scroll"],ne=()=>["auto","contain","none"],u=()=>[c,l,d],_=()=>[ie,"full","auto",...u()],E=()=>[$,"none","subgrid",c,l],X=()=>["auto",{span:["full",$,c,l]},$,c,l],G=()=>[$,"auto",c,l],Y=()=>["auto","min","max","fr",c,l],ze=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...u()],Z=()=>[ie,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...u()],h=()=>[e,c,l],qe=()=>[...F(),ut,dt,{position:[c,l]}],Ke=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Je=()=>["auto","cover","contain",wr,vr,{size:[c,l]}],Ie=()=>[Ee,pe,ee],O=()=>["","none","full",f,c,l],j=()=>["",m,pe,ee],ye=()=>["solid","dashed","dotted","double"],Xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>[m,Ee,ut,dt],Ye=()=>["","none",R,c,l],xe=()=>["none",m,c,l],we=()=>["none",m,c,l],Me=()=>[m,c,l],ke=()=>[ie,"full",...u()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[D],breakpoint:[D],color:[mr],container:[D],"drop-shadow":[D],ease:["in","out","in-out"],font:[gr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[D],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[D],shadow:[D],spacing:["px",m],text:[D],"text-shadow":[D],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ie,l,c,w]}],container:["container"],columns:[{columns:[m,l,c,p]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:ne()}],"overscroll-x":[{"overscroll-x":ne()}],"overscroll-y":[{"overscroll-y":ne()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{start:_()}],end:[{end:_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[$,"auto",c,l]}],basis:[{basis:[ie,"full","auto",p,...u()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[m,ie,"auto","initial","none",l]}],grow:[{grow:["",m,c,l]}],shrink:[{shrink:["",m,c,l]}],order:[{order:[$,"first","last","none",c,l]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:X()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:X()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:u()}],"gap-x":[{"gap-x":u()}],"gap-y":[{"gap-y":u()}],"justify-content":[{justify:[...ze(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...ze()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":ze()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:u()}],px:[{px:u()}],py:[{py:u()}],ps:[{ps:u()}],pe:[{pe:u()}],pt:[{pt:u()}],pr:[{pr:u()}],pb:[{pb:u()}],pl:[{pl:u()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":u()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":u()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],w:[{w:[p,"screen",...Z()]}],"min-w":[{"min-w":[p,"screen","none",...Z()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[n]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",r,pe,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,c,Oe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ee,l]}],"font-family":[{font:[xr,l,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,c,l]}],"line-clamp":[{"line-clamp":[m,"none",c,Oe]}],leading:[{leading:[i,...u()]}],"list-image":[{"list-image":["none",c,l]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",c,l]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:h()}],"text-color":[{text:h()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[m,"from-font","auto",c,ee]}],"text-decoration-color":[{decoration:h()}],"underline-offset":[{"underline-offset":[m,"auto",c,l]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:u()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",c,l]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",c,l]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:qe()}],"bg-repeat":[{bg:Ke()}],"bg-size":[{bg:Je()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$,c,l],radial:["",c,l],conic:[$,c,l]},kr,yr]}],"bg-color":[{bg:h()}],"gradient-from-pos":[{from:Ie()}],"gradient-via-pos":[{via:Ie()}],"gradient-to-pos":[{to:Ie()}],"gradient-from":[{from:h()}],"gradient-via":[{via:h()}],"gradient-to":[{to:h()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:j()}],"border-w-x":[{"border-x":j()}],"border-w-y":[{"border-y":j()}],"border-w-s":[{"border-s":j()}],"border-w-e":[{"border-e":j()}],"border-w-t":[{"border-t":j()}],"border-w-r":[{"border-r":j()}],"border-w-b":[{"border-b":j()}],"border-w-l":[{"border-l":j()}],"divide-x":[{"divide-x":j()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":j()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:h()}],"border-color-x":[{"border-x":h()}],"border-color-y":[{"border-y":h()}],"border-color-s":[{"border-s":h()}],"border-color-e":[{"border-e":h()}],"border-color-t":[{"border-t":h()}],"border-color-r":[{"border-r":h()}],"border-color-b":[{"border-b":h()}],"border-color-l":[{"border-l":h()}],"divide-color":[{divide:h()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[m,c,l]}],"outline-w":[{outline:["",m,pe,ee]}],"outline-color":[{outline:h()}],shadow:[{shadow:["","none",y,Ce,Re]}],"shadow-color":[{shadow:h()}],"inset-shadow":[{"inset-shadow":["none",b,Ce,Re]}],"inset-shadow-color":[{"inset-shadow":h()}],"ring-w":[{ring:j()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:h()}],"ring-offset-w":[{"ring-offset":[m,ee]}],"ring-offset-color":[{"ring-offset":h()}],"inset-ring-w":[{"inset-ring":j()}],"inset-ring-color":[{"inset-ring":h()}],"text-shadow":[{"text-shadow":["none",I,Ce,Re]}],"text-shadow-color":[{"text-shadow":h()}],opacity:[{opacity:[m,c,l]}],"mix-blend":[{"mix-blend":[...Xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[m]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":h()}],"mask-image-linear-to-color":[{"mask-linear-to":h()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":h()}],"mask-image-t-to-color":[{"mask-t-to":h()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":h()}],"mask-image-r-to-color":[{"mask-r-to":h()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":h()}],"mask-image-b-to-color":[{"mask-b-to":h()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":h()}],"mask-image-l-to-color":[{"mask-l-to":h()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":h()}],"mask-image-x-to-color":[{"mask-x-to":h()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":h()}],"mask-image-y-to-color":[{"mask-y-to":h()}],"mask-image-radial":[{"mask-radial":[c,l]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"mask-image-radial-from-color":[{"mask-radial-from":h()}],"mask-image-radial-to-color":[{"mask-radial-to":h()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":F()}],"mask-image-conic-pos":[{"mask-conic":[m]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"mask-image-conic-from-color":[{"mask-conic-from":h()}],"mask-image-conic-to-color":[{"mask-conic-to":h()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:qe()}],"mask-repeat":[{mask:Ke()}],"mask-size":[{mask:Je()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",c,l]}],filter:[{filter:["","none",c,l]}],blur:[{blur:Ye()}],brightness:[{brightness:[m,c,l]}],contrast:[{contrast:[m,c,l]}],"drop-shadow":[{"drop-shadow":["","none",x,Ce,Re]}],"drop-shadow-color":[{"drop-shadow":h()}],grayscale:[{grayscale:["",m,c,l]}],"hue-rotate":[{"hue-rotate":[m,c,l]}],invert:[{invert:["",m,c,l]}],saturate:[{saturate:[m,c,l]}],sepia:[{sepia:["",m,c,l]}],"backdrop-filter":[{"backdrop-filter":["","none",c,l]}],"backdrop-blur":[{"backdrop-blur":Ye()}],"backdrop-brightness":[{"backdrop-brightness":[m,c,l]}],"backdrop-contrast":[{"backdrop-contrast":[m,c,l]}],"backdrop-grayscale":[{"backdrop-grayscale":["",m,c,l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m,c,l]}],"backdrop-invert":[{"backdrop-invert":["",m,c,l]}],"backdrop-opacity":[{"backdrop-opacity":[m,c,l]}],"backdrop-saturate":[{"backdrop-saturate":[m,c,l]}],"backdrop-sepia":[{"backdrop-sepia":["",m,c,l]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":u()}],"border-spacing-x":[{"border-spacing-x":u()}],"border-spacing-y":[{"border-spacing-y":u()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",c,l]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[m,"initial",c,l]}],ease:[{ease:["linear","initial",N,c,l]}],delay:[{delay:[m,c,l]}],animate:[{animate:["none",H,c,l]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,c,l]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:we()}],"scale-x":[{"scale-x":we()}],"scale-y":[{"scale-y":we()}],"scale-z":[{"scale-z":we()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[c,l,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],accent:[{accent:h()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:h()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",c,l]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":u()}],"scroll-mx":[{"scroll-mx":u()}],"scroll-my":[{"scroll-my":u()}],"scroll-ms":[{"scroll-ms":u()}],"scroll-me":[{"scroll-me":u()}],"scroll-mt":[{"scroll-mt":u()}],"scroll-mr":[{"scroll-mr":u()}],"scroll-mb":[{"scroll-mb":u()}],"scroll-ml":[{"scroll-ml":u()}],"scroll-p":[{"scroll-p":u()}],"scroll-px":[{"scroll-px":u()}],"scroll-py":[{"scroll-py":u()}],"scroll-ps":[{"scroll-ps":u()}],"scroll-pe":[{"scroll-pe":u()}],"scroll-pt":[{"scroll-pt":u()}],"scroll-pr":[{"scroll-pr":u()}],"scroll-pb":[{"scroll-pb":u()}],"scroll-pl":[{"scroll-pl":u()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",c,l]}],fill:[{fill:["none",...h()]}],"stroke-w":[{stroke:[m,pe,ee,Oe]}],stroke:[{stroke:["none",...h()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},zr=ar(Sr);function fe(...e){return zr(gt(e))}const Ar=Ht("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Pr({className:e,...t}){return oe.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:oe.jsx("table",{"data-slot":"table",className:fe("w-full caption-bottom text-sm",e),...t})})}function jr({className:e,...t}){return oe.jsx("thead",{"data-slot":"table-header",className:fe("[&_tr]:border-b",e),...t})}function Nr({className:e,...t}){return oe.jsx("tbody",{"data-slot":"table-body",className:fe("[&_tr:last-child]:border-0",e),...t})}function _r({className:e,...t}){return oe.jsx("tr",{"data-slot":"table-row",className:fe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Gr({className:e,...t}){return oe.jsx("th",{"data-slot":"table-head",className:fe("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Fr({className:e,...t}){return oe.jsx("td",{"data-slot":"table-cell",className:fe("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}export{Tr as Q,Pr as T,jr as a,_r as b,Gr as c,Nr as d,Fr as e,Ar as f,fe as g,Er as h,Or as u};
-1
.output/public/assets/useSuspenseQuery-BacjgsWj.js
··· 1 - import{u as r,Q as u,h as s}from"./table-BGKcx7UY.js";function t(e,a){return r({...e,enabled:!0,suspense:!0,throwOnError:s,placeholderData:void 0},u)}export{t as u};
.output/public/favicon.ico

This is a binary file and will not be displayed.

.output/public/logo192.png

This is a binary file and will not be displayed.

.output/public/logo512.png

This is a binary file and will not be displayed.

-25
.output/public/manifest.json
··· 1 - { 2 - "short_name": "TanStack App", 3 - "name": "Create TanStack App Sample", 4 - "icons": [ 5 - { 6 - "src": "favicon.ico", 7 - "sizes": "64x64 32x32 24x24 16x16", 8 - "type": "image/x-icon" 9 - }, 10 - { 11 - "src": "logo192.png", 12 - "type": "image/png", 13 - "sizes": "192x192" 14 - }, 15 - { 16 - "src": "logo512.png", 17 - "type": "image/png", 18 - "sizes": "512x512" 19 - } 20 - ], 21 - "start_url": ".", 22 - "display": "standalone", 23 - "theme_color": "#000000", 24 - "background_color": "#ffffff" 25 - }
-3
.output/public/robots.txt
··· 1 - # https://www.robotstxt.org/robotstxt.html 2 - User-agent: * 3 - Disallow:
-117
.output/server/chunks/_/basic-D2SeuWcm.mjs
··· 1 - import { jsxs, jsx } from 'react/jsx-runtime'; 2 - import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell, f as buttonVariants, g as cn, u as useBaseQuery, Q as QueryObserver } from './table-VHJbrm0X.mjs'; 3 - import { e as Route$1, P as POKEMON_LIMIT$3, L as Link, d as useRouter, i as isRedirect, g as getServerPokemonList } from './ssr.mjs'; 4 - import { useMemo } from 'react'; 5 - import 'class-variance-authority'; 6 - import 'clsx'; 7 - import 'tailwind-merge'; 8 - import 'react-dom'; 9 - import 'valibot'; 10 - import 'drizzle-orm'; 11 - import 'drizzle-orm/libsql'; 12 - import '@t3-oss/env-core'; 13 - import 'drizzle-orm/sqlite-core'; 14 - import 'node:async_hooks'; 15 - import 'node:stream'; 16 - import 'react-dom/server'; 17 - import 'node:stream/web'; 18 - 19 - function useQuery(options, queryClient) { 20 - return useBaseQuery(options, QueryObserver, queryClient); 21 - } 22 - function useServerFn(serverFn) { 23 - const router = useRouter(); 24 - return async (...args) => { 25 - try { 26 - const res = await serverFn(...args); 27 - if (isRedirect(res)) { 28 - throw res; 29 - } 30 - return res; 31 - } catch (err) { 32 - if (isRedirect(err)) { 33 - err.options._fromLocation = router.state.location; 34 - return router.navigate(router.resolveRedirect(err).options); 35 - } 36 - throw err; 37 - } 38 - }; 39 - } 40 - const SplitComponent = function RouteComponent() { 41 - var _a; 42 - const getPokemonList = useServerFn(getServerPokemonList); 43 - const { 44 - offset: currentOffset 45 - } = Route$1.useSearch(); 46 - const newKey = ["pokemon-list", "basic", { 47 - limit: POKEMON_LIMIT$3, 48 - offset: currentOffset 49 - }]; 50 - const { 51 - data, 52 - error 53 - } = useQuery({ 54 - queryKey: newKey, 55 - queryFn: async () => { 56 - return await getPokemonList({ 57 - data: { 58 - offset: currentOffset 59 - } 60 - }); 61 - } 62 - }); 63 - const previousOffset = useMemo(() => { 64 - if ((data == null ? void 0 : data.prevOffset) == null) { 65 - return null; 66 - } 67 - return data.prevOffset.toString(); 68 - }, [data == null ? void 0 : data.prevOffset]); 69 - const nextOffset = useMemo(() => { 70 - if ((data == null ? void 0 : data.nextOffset) == null) { 71 - return null; 72 - } 73 - return data.nextOffset.toString(); 74 - }, [data == null ? void 0 : data.nextOffset]); 75 - if (data) { 76 - const results = (_a = data.pokemon) != null ? _a : []; 77 - return /* @__PURE__ */ jsxs("div", { className: "p-4", children: [ 78 - /* @__PURE__ */ jsxs("h1", { className: "text-2xl font-bold mb-4", children: [ 79 - "National Pok\xE9dex: Pok\xE9mon ", 80 - currentOffset + 1, 81 - "-", 82 - currentOffset + POKEMON_LIMIT$3 83 - ] }), 84 - /* @__PURE__ */ jsxs(Table, { children: [ 85 - /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [ 86 - /* @__PURE__ */ jsx(TableHead, { children: "#" }), 87 - /* @__PURE__ */ jsx(TableHead, { children: "Name" }), 88 - /* @__PURE__ */ jsx(TableHead, { children: "Details" }) 89 - ] }) }), 90 - /* @__PURE__ */ jsx(TableBody, { children: results.map((pokemon) => /* @__PURE__ */ jsxs(TableRow, { children: [ 91 - /* @__PURE__ */ jsx(TableCell, { children: pokemon.id }), 92 - /* @__PURE__ */ jsx(TableCell, { className: "capitalize", children: pokemon.name }), 93 - /* @__PURE__ */ jsx(TableCell, { children: pokemon.types.map((type) => /* @__PURE__ */ jsx("span", { className: "inline-block px-2 py-1 mr-1 text-sm font-medium rounded-full bg-gray-100", children: type.type.name }, type.type.name)) }) 94 - ] }, pokemon.name)) }) 95 - ] }), 96 - /* @__PURE__ */ jsxs("div", { className: "flex justify-center gap-4 mt-4", children: [ 97 - /* @__PURE__ */ jsx(Link, { to: "/basic", className: buttonVariants({ 98 - variant: "outline", 99 - className: cn(!previousOffset && "opacity-50 cursor-not-allowed") 100 - }), search: { 101 - offset: Number(previousOffset) 102 - }, disabled: !previousOffset, children: "Previous" }), 103 - /* @__PURE__ */ jsx(Link, { to: "/basic", search: { 104 - offset: Number(nextOffset) 105 - }, className: buttonVariants({ 106 - variant: "outline", 107 - className: cn(!nextOffset && "opacity-50 cursor-not-allowed") 108 - }), disabled: !nextOffset, children: "Next" }) 109 - ] }) 110 - ] }); 111 - } 112 - if (error) return /* @__PURE__ */ jsx("div", { children: "Error loading Pok\xE9mon." }); 113 - return /* @__PURE__ */ jsx("div", { children: "No data" }); 114 - }; 115 - 116 - export { SplitComponent as component }; 117 - //# sourceMappingURL=basic-D2SeuWcm.mjs.map
-1
.output/server/chunks/_/basic-D2SeuWcm.mjs.map
··· 1 - {"version":3,"file":"basic-D2SeuWcm.mjs","sources":["../../../../../node_modules/.pnpm/@tanstack+react-query@5.76.2_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useQuery.js","../../../../../node_modules/.pnpm/@tanstack+react-start-client@1.121.0-alpha.11_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/@tanstack/react-start-client/dist/esm/useServerFn.js","../../../../../src/routes/basic.tsx?tsr-split=component"],"sourcesContent":null,"names":["SplitComponent","RouteComponent","getPokemonList","useServerFn","getServerPokemonList","offset","currentOffset","Route","useSearch","newKey","limit","POKEMON_LIMIT","data","error","useQuery","queryKey","queryFn","previousOffset","useMemo","prevOffset","toString","nextOffset","results","pokemon","map","id","name","types","type","buttonVariants","variant","className","cn","Number"],"mappings":"","x_google_ignoreList":[0,1]}
-24
.output/server/chunks/_/index-DR_wIx-E.mjs
··· 1 - import { jsx, jsxs } from 'react/jsx-runtime'; 2 - import { useState } from 'react'; 3 - 4 - const logo = "/assets/logo-CHtJT8UQ.svg"; 5 - const SplitComponent = function App() { 6 - const [count, setCount] = useState(0); 7 - return /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxs("header", { className: "min-h-screen flex flex-col items-center justify-center bg-[#282c34] text-white text-[calc(10px+2vmin)]", children: [ 8 - /* @__PURE__ */ jsx("img", { src: logo, className: "h-[40vmin] pointer-events-none animate-[spin_20s_linear_infinite]", alt: "logo" }), 9 - /* @__PURE__ */ jsxs("p", { children: [ 10 - "Edit ", 11 - /* @__PURE__ */ jsx("code", { children: "src/routes/index.tsx" }), 12 - " and save to reload." 13 - ] }), 14 - /* @__PURE__ */ jsxs("button", { type: "button", className: "mt-4 px-6 py-2 rounded bg-[#61dafb] text-[#282c34] font-bold hover:bg-[#21a1f3] transition", onClick: () => setCount((c) => c + 1), children: [ 15 - "Counter: ", 16 - count 17 - ] }), 18 - /* @__PURE__ */ jsx("a", { className: "text-[#61dafb] hover:underline mt-4", href: "https://reactjs.org", target: "_blank", rel: "noopener noreferrer", children: "Learn React" }), 19 - /* @__PURE__ */ jsx("a", { className: "text-[#61dafb] hover:underline", href: "https://tanstack.com", target: "_blank", rel: "noopener noreferrer", children: "Learn TanStack" }) 20 - ] }) }); 21 - }; 22 - 23 - export { SplitComponent as component }; 24 - //# sourceMappingURL=index-DR_wIx-E.mjs.map
-1
.output/server/chunks/_/index-DR_wIx-E.mjs.map
··· 1 - {"version":3,"file":"index-DR_wIx-E.mjs","sources":["../../../../../src/logo.svg","../../../../../src/routes/index.tsx?tsr-split=component"],"sourcesContent":null,"names":["SplitComponent","App","count","setCount","useState","logo","c"],"mappings":";;;AAAA,MAAe,IAAA,GAAA,2BAAA;ACEgBA,MAAAA,cAAAA,GAAA,SAMtBC,GAAM,GAAA;AACd,EAAA,MAAM,CAACC,KAAAA,EAAOC,QAAQ,CAAA,GAAIC,SAAS,CAAC,CAAA;AAGlC,EAAA,uBAAA,GAAA,CAAA,KAAI,EAAA,EAAA,SAAU,EAAA,aAAA,EACd,+BAAC,QAAA,EAAA,EAAO,SAAU,EAAA,wGAAA,EACjB,QAAA,EAAA;AAAA,wBAAC,OACA,EAAA,GAAA,EAAKC,MACL,SAAU,EAAA,mEAAA,EACV,GAAI,EAAA,MAAA,EAAM,CAAA;AAAA,oBAEV,IAAA,CAAA,GAAC,EAAA,EAAA,QAAA,EAAA;AAAA,MAAA,OAAA;AAAA,sBACK,GAAA,CAAA,MAAA,EAAA,EAAK,QAAA,EAAoB,wBAAA,CAAA;AAAA,MAAO;AAAA,OACvC,CAAA;AAAA,oBACC,IAAA,CAAA,QAAA,EAAA,EACA,IAAA,EAAK,UACL,SAAU,EAAA,4FAAA,EACV,OAAS,EAAA,MAAMF,SAAUG,CAAAA,CAAAA,KAAMA,CAAI,GAAA,CAAC,GAAE,QAAA,EAAA;AAAA,MAAA,WAAA;AAAA,MAE5BJ;AAAAA,OACX,CAAA;AAAA,oBACC,GAAA,CAAA,GAAA,EACA,EAAA,SAAA,EAAU,qCACV,EAAA,IAAA,EAAK,qBACL,EAAA,MAAA,EAAO,QACP,EAAA,GAAA,EAAI,qBAAqB,EAAA,QAAA,EAG1B,eAAA,CAAA;AAAA,oBACC,GAAA,CAAA,GAAA,EACA,EAAA,SAAA,EAAU,gCACV,EAAA,IAAA,EAAK,sBACL,EAAA,MAAA,EAAO,QACP,EAAA,GAAA,EAAI,qBAAqB,EAAA,QAAA,EAG1B,kBAAA;AAAA,GAAA,EACD,CAAA,EACD,CAAA;AAEF;;;;"}
-88
.output/server/chunks/_/intent-preloading-BGRNd4ca.mjs
··· 1 - import { jsxs, jsx } from 'react/jsx-runtime'; 2 - import { u as useSuspenseQuery } from './useSuspenseQuery-D_gTj2Eu.mjs'; 3 - import { c as Route$2, L as Link } from './ssr.mjs'; 4 - import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell, f as buttonVariants, g as cn } from './table-VHJbrm0X.mjs'; 5 - import { useMemo } from 'react'; 6 - import 'react-dom'; 7 - import 'valibot'; 8 - import 'drizzle-orm'; 9 - import 'drizzle-orm/libsql'; 10 - import '@t3-oss/env-core'; 11 - import 'drizzle-orm/sqlite-core'; 12 - import 'node:async_hooks'; 13 - import 'node:stream'; 14 - import 'react-dom/server'; 15 - import 'node:stream/web'; 16 - import 'class-variance-authority'; 17 - import 'clsx'; 18 - import 'tailwind-merge'; 19 - 20 - const POKEMON_LIMIT = 20; 21 - const matchPokemonIdExp = /\/api\/v2\/pokemon\/(\d+)\/?/; 22 - const SplitComponent = function RouteComponent() { 23 - var _a; 24 - const { 25 - offset: currentOffset 26 - } = Route$2.useSearch(); 27 - const { 28 - pokemonListOptions 29 - } = Route$2.useRouteContext(); 30 - const { 31 - data 32 - } = useSuspenseQuery(pokemonListOptions); 33 - const previousOffset = useMemo(() => { 34 - var _a2; 35 - if ((data == null ? void 0 : data.previous) == null) { 36 - return null; 37 - } 38 - return (_a2 = new URL(data.previous).searchParams.get("offset")) != null ? _a2 : null; 39 - }, [data == null ? void 0 : data.previous]); 40 - const nextOffset = useMemo(() => { 41 - var _a2; 42 - if ((data == null ? void 0 : data.next) == null) { 43 - return null; 44 - } 45 - return (_a2 = new URL(data.next).searchParams.get("offset")) != null ? _a2 : null; 46 - }, [data == null ? void 0 : data.next]); 47 - const results = (_a = data.results) != null ? _a : []; 48 - return /* @__PURE__ */ jsxs("div", { className: "p-4", children: [ 49 - /* @__PURE__ */ jsxs("h1", { className: "text-2xl font-bold mb-4", children: [ 50 - "National Pok\xE9dex: Pok\xE9mon ", 51 - currentOffset + 1, 52 - "-", 53 - currentOffset + POKEMON_LIMIT 54 - ] }), 55 - /* @__PURE__ */ jsxs(Table, { children: [ 56 - /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [ 57 - /* @__PURE__ */ jsx(TableHead, { children: "#" }), 58 - /* @__PURE__ */ jsx(TableHead, { children: "Name" }), 59 - /* @__PURE__ */ jsx(TableHead, { children: "Details" }) 60 - ] }) }), 61 - /* @__PURE__ */ jsx(TableBody, { children: results.map((pokemon) => { 62 - var _a2; 63 - return /* @__PURE__ */ jsxs(TableRow, { children: [ 64 - /* @__PURE__ */ jsx(TableCell, { children: (_a2 = pokemon.url.match(matchPokemonIdExp)) == null ? void 0 : _a2[1] }), 65 - /* @__PURE__ */ jsx(TableCell, { className: "capitalize", children: pokemon.name }), 66 - /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("a", { href: pokemon.url, target: "_blank", rel: "noopener noreferrer", className: "text-blue-600 underline", children: "View" }) }) 67 - ] }, pokemon.name); 68 - }) }) 69 - ] }), 70 - /* @__PURE__ */ jsxs("div", { className: "flex justify-center gap-4 mt-4", children: [ 71 - /* @__PURE__ */ jsx(Link, { to: "/intent-preloading", preload: "intent", className: buttonVariants({ 72 - variant: "outline", 73 - className: cn(!previousOffset && "opacity-50 cursor-not-allowed") 74 - }), search: { 75 - offset: Number(previousOffset) 76 - }, disabled: !previousOffset, children: "Previous" }), 77 - /* @__PURE__ */ jsx(Link, { to: "/intent-preloading", preload: "intent", search: { 78 - offset: Number(nextOffset) 79 - }, className: buttonVariants({ 80 - variant: "outline", 81 - className: cn(!nextOffset && "opacity-50 cursor-not-allowed") 82 - }), disabled: !nextOffset, children: "Next" }) 83 - ] }) 84 - ] }); 85 - }; 86 - 87 - export { SplitComponent as component }; 88 - //# sourceMappingURL=intent-preloading-BGRNd4ca.mjs.map
-1
.output/server/chunks/_/intent-preloading-BGRNd4ca.mjs.map
··· 1 - {"version":3,"file":"intent-preloading-BGRNd4ca.mjs","sources":["../../../../../src/routes/intent-preloading.tsx?tsr-split=component"],"sourcesContent":null,"names":["POKEMON_LIMIT","matchPokemonIdExp","SplitComponent","RouteComponent","offset","currentOffset","Route","useSearch","pokemonListOptions","useRouteContext","data","useSuspenseQuery","previousOffset","useMemo","previous","_a","URL","searchParams","get","nextOffset","next","results","map","pokemon","url","match","name","buttonVariants","variant","className","cn","Number"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,aAAgB,GAAA,EAAA;AAEtB,MAAMC,iBAAoB,GAAA,8BAAA;AAyDzBC,MAAAA,cAAAA,GAAA,SAcQC,cAAiB,GAAA;;AACnB,EAAA,MAAA;AAAA,IAAEC,MAAQC,EAAAA;AAAAA,GAAAA,GAAkBC,QAAMC,SAAU,EAAA;AAC5C,EAAA,MAAA;AAAA,IAAEC;AAAAA,GAAAA,GAAuBF,QAAMG,eAAgB,EAAA;AAE/C,EAAA,MAAA;AAAA,IAAEC;AAAAA,GAAAA,GAASC,iBAAiBH,kBAAkB,CAAA;AAE9CI,EAAAA,MAAAA,cAAAA,GAAiBC,QAAQ,MAAM;;AAChCH,IAAAA,IAAAA,CAAAA,IAAAA,IAAAA,IAAAA,GAAAA,MAAAA,GAAAA,IAAAA,CAAMI,aAAY,IAAM,EAAA;AACpB,MAAA,OAAA,IAAA;AAAA;AAGD,IAAAC,OAAAA,CAAAA,GAAAA,GAAA,IAAIC,GAAAA,CAAIN,IAAKI,CAAAA,QAAQ,CAAEG,CAAAA,YAAAA,CAAaC,GAAI,CAAA,QAAQ,CAAhD,KAAA,IAAA,GAAAH,GAAqD,GAAA,IAAA;AAAA,KAC1D,CAACL,IAAAA,IAAMI,OAAAA,MAAAA,GAAAA,IAAAA,CAAAA,QAAQ,CAAC,CAAA;AAEbK,EAAAA,MAAAA,UAAAA,GAAaN,QAAQ,MAAM;;AAC5BH,IAAAA,IAAAA,CAAAA,IAAAA,IAAAA,IAAAA,GAAAA,MAAAA,GAAAA,IAAAA,CAAMU,SAAQ,IAAM,EAAA;AAChB,MAAA,OAAA,IAAA;AAAA;AAGD,IAAAL,OAAAA,CAAAA,GAAAA,GAAA,IAAIC,GAAAA,CAAIN,IAAKU,CAAAA,IAAI,CAAEH,CAAAA,YAAAA,CAAaC,GAAI,CAAA,QAAQ,CAA5C,KAAA,IAAA,GAAAH,GAAiD,GAAA,IAAA;AAAA,KACtD,CAACL,IAAAA,IAAMU,OAAAA,MAAAA,GAAAA,IAAAA,CAAAA,IAAI,CAAC,CAAA;AAETC,EAAAA,MAAAA,OAAUX,GAAAA,CAAAA,EAAAA,GAAAA,IAAAA,CAAKW,OAALX,KAAAA,IAAAA,GAAAA,EAAAA,GAAgB,EAAE;AAEjC,EAAA,uBAAC,IAAA,CAAA,KAAA,EAAI,EAAA,SAAA,EAAU,OACd,QAAA,EAAA;AAAA,oBAAC,IAAA,CAAA,IAAA,EAAA,EAAG,SAAA,EAAU,2BAAyB,QAAA,EAAA;AAAA,MAAA,kCAAA;AAAA,MACXL,aAAgB,GAAA,CAAA;AAAA,MAAE,GAAA;AAAA,MAC5CA,aAAgBL,GAAAA;AAAAA,OAClB,CAAA;AAAA,oBACC,IAAA,CAAA,KACA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAC,WAAA,EAAA,EACA,0BAAC,IAAA,CAAA,QAAA,EACA,EAAA,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAC,KAAA,CAAA;AAAA,wBACX,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAI,QAAA,CAAA;AAAA,wBACd,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAO,WAAA;AAAA,OAAA,EACnB,CAAA,EACD,CAAA;AAAA,0BACC,SACCqB,EAAAA,EAAAA,UAAAA,OAAQC,CAAAA,GAAAA,CAAI,CAACC,OAAAA,KAAAA;;AACZ,QAAA,uBAAA,IAAA,CAAA,QACA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,SAAA,IAAWA,QAAAA,EAAAA,CAAQC,MAAAA,OAAAA,CAAAA,GAAAA,CAAIC,KAAMxB,CAAAA,iBAAiB,MAA3BuB,IAAAA,GAAAA,MAAAA,GAAAA,GAA+B,CAAA,CAAG,GAAA,CAAA;AAAA,8BACrD,WAAA,EAAU,SAAA,EAAU,cAAcD,kBAAQG,MAAK,CAAA;AAAA,8BAC/C,WAAA,EACA,QAAA,sBAAC,GAAA,EAAA,EACA,MAAMH,OAAQC,CAAAA,GAAAA,EACd,QAAO,QACP,EAAA,GAAA,EAAI,uBACJ,SAAU,EAAA,yBAAA,EAAyB,UAAA,MAAA,EAGpC,GACD;AAAA,SAAA,EAZcD,EAAAA,OAAAA,CAAQG,IAavB,CAAA;AAAA,OACA,GACF;AAAA,OACD,CAAA;AAAA,oBACC,IAAA,CAAA,KAAA,EAAI,EAAA,SAAA,EAAU,kCACd,QAAA,EAAA;AAAA,0BAAC,MACA,EAAA,EAAA,EAAG,sBACH,OAAQ,EAAA,QAAA,EACR,WAAWC,cAAe,CAAA;AAAA,QACzBC,OAAS,EAAA,SAAA;AAAA,QACTC,SAAWC,EAAAA,EAAAA,CAAG,CAAClB,cAAAA,IAAkB,+BAA+B;AAAA,OAChE,GACD,MAAQ,EAAA;AAAA,QAAER,MAAAA,EAAQ2B,OAAOnB,cAAc;AAAA,SACvC,QAAU,EAAA,CAACA,cAAe,EAAA,QAAA,EAG3B,YAAA,CAAA;AAAA,0BACC,IACA,EAAA,EAAA,IAAG,oBACH,EAAA,OAAA,EAAQ,UACR,MAAQ,EAAA;AAAA,QAAER,MAAAA,EAAQ2B,OAAOZ,UAAU;AAAA,OAAA,EACnC,WAAWQ,cAAe,CAAA;AAAA,QACzBC,OAAS,EAAA,SAAA;AAAA,QACTC,SAAWC,EAAAA,EAAAA,CAAG,CAACX,UAAAA,IAAc,+BAA+B;AAAA,OAC5D,CACD,EAAA,QAAA,EAAU,CAACA,UAAW,EAAA,QAAA,EAGvB,QAAA;AAAA,OACD;AAAA,KACD,CAAA;AAEF;;;;"}
-8
.output/server/chunks/_/intent-preloading-CDby3_eA.mjs
··· 1 - import { jsx } from 'react/jsx-runtime'; 2 - 3 - const SplitErrorComponent = function ErrorComponent() { 4 - return /* @__PURE__ */ jsx("div", { children: "Error" }); 5 - }; 6 - 7 - export { SplitErrorComponent as errorComponent }; 8 - //# sourceMappingURL=intent-preloading-CDby3_eA.mjs.map
-1
.output/server/chunks/_/intent-preloading-CDby3_eA.mjs.map
··· 1 - {"version":3,"file":"intent-preloading-CDby3_eA.mjs","sources":["../../../../../src/routes/intent-preloading.tsx?tsr-split=errorComponent"],"sourcesContent":null,"names":["SplitErrorComponent","ErrorComponent"],"mappings":";;AA4ECA,MAAAA,mBAAAA,GAAA,SAMQC,cAAiB,GAAA;AAClB,EAAA,uBAAC,GAAA,CAAA,KAAA,EAAA,EAAI,QAAA,EAAK,SAAA,CAAA;AAClB;;;;"}
-8
.output/server/chunks/_/intent-preloading-eUhkQotn.mjs
··· 1 - import { jsx } from 'react/jsx-runtime'; 2 - 3 - const SplitNotFoundComponent = function NotFoundComponent() { 4 - return /* @__PURE__ */ jsx("div", { children: "Not Found" }); 5 - }; 6 - 7 - export { SplitNotFoundComponent as notFoundComponent }; 8 - //# sourceMappingURL=intent-preloading-eUhkQotn.mjs.map
-1
.output/server/chunks/_/intent-preloading-eUhkQotn.mjs.map
··· 1 - {"version":3,"file":"intent-preloading-eUhkQotn.mjs","sources":["../../../../../src/routes/intent-preloading.tsx?tsr-split=notFoundComponent"],"sourcesContent":null,"names":["SplitNotFoundComponent","NotFoundComponent"],"mappings":";;AA4ECA,MAAAA,sBAAAA,GAAA,SAEQC,iBAAoB,GAAA;AACrB,EAAA,uBAAC,GAAA,CAAA,KAAA,EAAA,EAAI,QAAA,EAAS,aAAA,CAAA;AACtB;;;;"}
-8
.output/server/chunks/_/pagination-CDby3_eA.mjs
··· 1 - import { jsx } from 'react/jsx-runtime'; 2 - 3 - const SplitErrorComponent = function ErrorComponent() { 4 - return /* @__PURE__ */ jsx("div", { children: "Error" }); 5 - }; 6 - 7 - export { SplitErrorComponent as errorComponent }; 8 - //# sourceMappingURL=pagination-CDby3_eA.mjs.map
-1
.output/server/chunks/_/pagination-CDby3_eA.mjs.map
··· 1 - {"version":3,"file":"pagination-CDby3_eA.mjs","sources":["../../../../../src/routes/pagination.tsx?tsr-split=errorComponent"],"sourcesContent":null,"names":["SplitErrorComponent","ErrorComponent"],"mappings":";;AAoECA,MAAAA,mBAAAA,GAAA,SAMQC,cAAiB,GAAA;AAClB,EAAA,uBAAC,GAAA,CAAA,KAAA,EAAA,EAAI,QAAA,EAAK,SAAA,CAAA;AAClB;;;;"}
-107
.output/server/chunks/_/pagination-Cw9fMujH.mjs
··· 1 - import { jsxs, jsx } from 'react/jsx-runtime'; 2 - import { u as useSuspenseQuery } from './useSuspenseQuery-D_gTj2Eu.mjs'; 3 - import { b as Route$3, u as useQueryClient, L as Link } from './ssr.mjs'; 4 - import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell, f as buttonVariants, g as cn } from './table-VHJbrm0X.mjs'; 5 - import { useMemo } from 'react'; 6 - import 'react-dom'; 7 - import 'valibot'; 8 - import 'drizzle-orm'; 9 - import 'drizzle-orm/libsql'; 10 - import '@t3-oss/env-core'; 11 - import 'drizzle-orm/sqlite-core'; 12 - import 'node:async_hooks'; 13 - import 'node:stream'; 14 - import 'react-dom/server'; 15 - import 'node:stream/web'; 16 - import 'class-variance-authority'; 17 - import 'clsx'; 18 - import 'tailwind-merge'; 19 - 20 - const POKEMON_LIMIT = 20; 21 - const matchPokemonIdExp = /\/api\/v2\/pokemon\/(\d+)\/?/; 22 - const SplitComponent = function RouteComponent() { 23 - var _a; 24 - const { 25 - offset: currentOffset 26 - } = Route$3.useSearch(); 27 - const { 28 - pokemonListOptions 29 - } = Route$3.useRouteContext(); 30 - const queryClient = useQueryClient(); 31 - const { 32 - data 33 - } = useSuspenseQuery(pokemonListOptions); 34 - const previousOffset = useMemo(() => { 35 - var _a2; 36 - if ((data == null ? void 0 : data.previous) == null) { 37 - return null; 38 - } 39 - return (_a2 = new URL(data.previous).searchParams.get("offset")) != null ? _a2 : null; 40 - }, [data == null ? void 0 : data.previous]); 41 - const nextOffset = useMemo(() => { 42 - var _a2; 43 - if ((data == null ? void 0 : data.next) == null) { 44 - return null; 45 - } 46 - return (_a2 = new URL(data.next).searchParams.get("offset")) != null ? _a2 : null; 47 - }, [data == null ? void 0 : data.next]); 48 - if (previousOffset !== null) { 49 - void queryClient.prefetchQuery({ 50 - ...pokemonListOptions, 51 - queryKey: ["pokemon-list", "pagination", { 52 - limit: POKEMON_LIMIT, 53 - offset: Number(previousOffset) 54 - }] 55 - }); 56 - } 57 - if (nextOffset !== null) { 58 - void queryClient.prefetchQuery({ 59 - ...pokemonListOptions, 60 - queryKey: ["pokemon-list", "pagination", { 61 - limit: POKEMON_LIMIT, 62 - offset: Number(nextOffset) 63 - }] 64 - }); 65 - } 66 - const results = (_a = data.results) != null ? _a : []; 67 - return /* @__PURE__ */ jsxs("div", { className: "p-4", children: [ 68 - /* @__PURE__ */ jsxs("h1", { className: "text-2xl font-bold mb-4", children: [ 69 - "National Pok\xE9dex: Pok\xE9mon ", 70 - currentOffset + 1, 71 - "-", 72 - currentOffset + POKEMON_LIMIT 73 - ] }), 74 - /* @__PURE__ */ jsxs(Table, { children: [ 75 - /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [ 76 - /* @__PURE__ */ jsx(TableHead, { children: "#" }), 77 - /* @__PURE__ */ jsx(TableHead, { children: "Name" }), 78 - /* @__PURE__ */ jsx(TableHead, { children: "Details" }) 79 - ] }) }), 80 - /* @__PURE__ */ jsx(TableBody, { children: results.map((pokemon) => { 81 - var _a2; 82 - return /* @__PURE__ */ jsxs(TableRow, { children: [ 83 - /* @__PURE__ */ jsx(TableCell, { children: (_a2 = pokemon.url.match(matchPokemonIdExp)) == null ? void 0 : _a2[1] }), 84 - /* @__PURE__ */ jsx(TableCell, { className: "capitalize", children: pokemon.name }), 85 - /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("a", { href: pokemon.url, target: "_blank", rel: "noopener noreferrer", className: "text-blue-600 underline", children: "View" }) }) 86 - ] }, pokemon.name); 87 - }) }) 88 - ] }), 89 - /* @__PURE__ */ jsxs("div", { className: "flex justify-center gap-4 mt-4", children: [ 90 - /* @__PURE__ */ jsx(Link, { to: "/pagination", preload: "intent", className: buttonVariants({ 91 - variant: "outline", 92 - className: cn(!previousOffset && "opacity-50 cursor-not-allowed") 93 - }), search: { 94 - offset: Number(previousOffset) 95 - }, disabled: !previousOffset, children: "Previous" }), 96 - /* @__PURE__ */ jsx(Link, { to: "/pagination", preload: "intent", search: { 97 - offset: Number(nextOffset) 98 - }, className: buttonVariants({ 99 - variant: "outline", 100 - className: cn(!nextOffset && "opacity-50 cursor-not-allowed") 101 - }), disabled: !nextOffset, children: "Next" }) 102 - ] }) 103 - ] }); 104 - }; 105 - 106 - export { SplitComponent as component }; 107 - //# sourceMappingURL=pagination-Cw9fMujH.mjs.map
-1
.output/server/chunks/_/pagination-Cw9fMujH.mjs.map
··· 1 - {"version":3,"file":"pagination-Cw9fMujH.mjs","sources":["../../../../../src/routes/pagination.tsx?tsr-split=component"],"sourcesContent":null,"names":["POKEMON_LIMIT","matchPokemonIdExp","SplitComponent","RouteComponent","offset","currentOffset","Route","useSearch","pokemonListOptions","useRouteContext","queryClient","useQueryClient","data","useSuspenseQuery","previousOffset","useMemo","previous","_a","URL","searchParams","get","nextOffset","next","prefetchQuery","queryKey","limit","Number","results","map","pokemon","url","match","name","buttonVariants","variant","className","cn"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,MAAMA,aAAgB,GAAA,EAAA;AAEtB,MAAMC,iBAAoB,GAAA,8BAAA;AA6CzBC,MAAAA,cAAAA,GAAA,SAcQC,cAAiB,GAAA;;AACnB,EAAA,MAAA;AAAA,IAAEC,MAAQC,EAAAA;AAAAA,GAAAA,GAAkBC,QAAMC,SAAU,EAAA;AAC5C,EAAA,MAAA;AAAA,IAAEC;AAAAA,GAAAA,GAAuBF,QAAMG,eAAgB,EAAA;AACrD,EAAA,MAAMC,cAAcC,cAAe,EAAA;AAE7B,EAAA,MAAA;AAAA,IAAEC;AAAAA,GAAAA,GAASC,iBAAiBL,kBAAkB,CAAA;AAE9CM,EAAAA,MAAAA,cAAAA,GAAiBC,QAAQ,MAAM;;AAChCH,IAAAA,IAAAA,CAAAA,IAAAA,IAAAA,IAAAA,GAAAA,MAAAA,GAAAA,IAAAA,CAAMI,aAAY,IAAM,EAAA;AACpB,MAAA,OAAA,IAAA;AAAA;AAGD,IAAAC,OAAAA,CAAAA,GAAAA,GAAA,IAAIC,GAAAA,CAAIN,IAAKI,CAAAA,QAAQ,CAAEG,CAAAA,YAAAA,CAAaC,GAAI,CAAA,QAAQ,CAAhD,KAAA,IAAA,GAAAH,GAAqD,GAAA,IAAA;AAAA,KAC1D,CAACL,IAAAA,IAAMI,OAAAA,MAAAA,GAAAA,IAAAA,CAAAA,QAAQ,CAAC,CAAA;AAEbK,EAAAA,MAAAA,UAAAA,GAAaN,QAAQ,MAAM;;AAC5BH,IAAAA,IAAAA,CAAAA,IAAAA,IAAAA,IAAAA,GAAAA,MAAAA,GAAAA,IAAAA,CAAMU,SAAQ,IAAM,EAAA;AAChB,MAAA,OAAA,IAAA;AAAA;AAGD,IAAAL,OAAAA,CAAAA,GAAAA,GAAA,IAAIC,GAAAA,CAAIN,IAAKU,CAAAA,IAAI,CAAEH,CAAAA,YAAAA,CAAaC,GAAI,CAAA,QAAQ,CAA5C,KAAA,IAAA,GAAAH,GAAiD,GAAA,IAAA;AAAA,KACtD,CAACL,IAAAA,IAAMU,OAAAA,MAAAA,GAAAA,IAAAA,CAAAA,IAAI,CAAC,CAAA;AAEf,EAAA,IAAIR,mBAAmB,IAAM,EAAA;AAC5B,IAAA,KAAKJ,YAAYa,aAAc,CAAA;AAAA,MAC9B,GAAGf,kBAAAA;AAAAA,MACHgB,QAAAA,EAAU,CACT,cAAA,EACA,YACA,EAAA;AAAA,QAAEC,KAAOzB,EAAAA,aAAAA;AAAAA,QAAeI,MAAAA,EAAQsB,OAAOZ,cAAc;AAAA,OAAG;AAAA,KAEzD,CAAA;AAAA;AAGF,EAAA,IAAIO,eAAe,IAAM,EAAA;AACxB,IAAA,KAAKX,YAAYa,aAAc,CAAA;AAAA,MAC9B,GAAGf,kBAAAA;AAAAA,MACHgB,QAAAA,EAAU,CACT,cAAA,EACA,YACA,EAAA;AAAA,QAAEC,KAAOzB,EAAAA,aAAAA;AAAAA,QAAeI,MAAAA,EAAQsB,OAAOL,UAAU;AAAA,OAAG;AAAA,KAErD,CAAA;AAAA;AAGIM,EAAAA,MAAAA,OAAUf,GAAAA,CAAAA,EAAAA,GAAAA,IAAAA,CAAKe,OAALf,KAAAA,IAAAA,GAAAA,EAAAA,GAAgB,EAAE;AAEjC,EAAA,uBAAC,IAAA,CAAA,KAAA,EAAI,EAAA,SAAA,EAAU,OACd,QAAA,EAAA;AAAA,oBAAC,IAAA,CAAA,IAAA,EAAA,EAAG,SAAA,EAAU,2BAAyB,QAAA,EAAA;AAAA,MAAA,kCAAA;AAAA,MACXP,aAAgB,GAAA,CAAA;AAAA,MAAE,GAAA;AAAA,MAC5CA,aAAgBL,GAAAA;AAAAA,OAClB,CAAA;AAAA,oBACC,IAAA,CAAA,KACA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAC,WAAA,EAAA,EACA,0BAAC,IAAA,CAAA,QAAA,EACA,EAAA,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAC,KAAA,CAAA;AAAA,wBACX,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAI,QAAA,CAAA;AAAA,wBACd,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAO,WAAA;AAAA,OAAA,EACnB,CAAA,EACD,CAAA;AAAA,0BACC,SACC2B,EAAAA,EAAAA,UAAAA,OAAQC,CAAAA,GAAAA,CAAI,CAACC,OAAAA,KAAAA;;AACZ,QAAA,uBAAA,IAAA,CAAA,QACA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,SAAA,IAAWA,QAAAA,EAAAA,CAAQC,MAAAA,OAAAA,CAAAA,GAAAA,CAAIC,KAAM9B,CAAAA,iBAAiB,MAA3B6B,IAAAA,GAAAA,MAAAA,GAAAA,GAA+B,CAAA,CAAG,GAAA,CAAA;AAAA,8BACrD,WAAA,EAAU,SAAA,EAAU,cAAcD,kBAAQG,MAAK,CAAA;AAAA,8BAC/C,WAAA,EACA,QAAA,sBAAC,GAAA,EAAA,EACA,MAAMH,OAAQC,CAAAA,GAAAA,EACd,QAAO,QACP,EAAA,GAAA,EAAI,uBACJ,SAAU,EAAA,yBAAA,EAAyB,UAAA,MAAA,EAGpC,GACD;AAAA,SAAA,EAZcD,EAAAA,OAAAA,CAAQG,IAavB,CAAA;AAAA,OACA,GACF;AAAA,OACD,CAAA;AAAA,oBACC,IAAA,CAAA,KAAA,EAAI,EAAA,SAAA,EAAU,kCACd,QAAA,EAAA;AAAA,0BAAC,MACA,EAAA,EAAA,EAAG,eACH,OAAQ,EAAA,QAAA,EACR,WAAWC,cAAe,CAAA;AAAA,QACzBC,OAAS,EAAA,SAAA;AAAA,QACTC,SAAWC,EAAAA,EAAAA,CAAG,CAACtB,cAAAA,IAAkB,+BAA+B;AAAA,OAChE,GACD,MAAQ,EAAA;AAAA,QAAEV,MAAAA,EAAQsB,OAAOZ,cAAc;AAAA,SACvC,QAAU,EAAA,CAACA,cAAe,EAAA,QAAA,EAG3B,YAAA,CAAA;AAAA,0BACC,IACA,EAAA,EAAA,IAAG,aACH,EAAA,OAAA,EAAQ,UACR,MAAQ,EAAA;AAAA,QAAEV,MAAAA,EAAQsB,OAAOL,UAAU;AAAA,OAAA,EACnC,WAAWY,cAAe,CAAA;AAAA,QACzBC,OAAS,EAAA,SAAA;AAAA,QACTC,SAAWC,EAAAA,EAAAA,CAAG,CAACf,UAAAA,IAAc,+BAA+B;AAAA,OAC5D,CACD,EAAA,QAAA,EAAU,CAACA,UAAW,EAAA,QAAA,EAGvB,QAAA;AAAA,OACD;AAAA,KACD,CAAA;AAEF;;;;"}
-8
.output/server/chunks/_/pagination-eUhkQotn.mjs
··· 1 - import { jsx } from 'react/jsx-runtime'; 2 - 3 - const SplitNotFoundComponent = function NotFoundComponent() { 4 - return /* @__PURE__ */ jsx("div", { children: "Not Found" }); 5 - }; 6 - 7 - export { SplitNotFoundComponent as notFoundComponent }; 8 - //# sourceMappingURL=pagination-eUhkQotn.mjs.map
-1
.output/server/chunks/_/pagination-eUhkQotn.mjs.map
··· 1 - {"version":3,"file":"pagination-eUhkQotn.mjs","sources":["../../../../../src/routes/pagination.tsx?tsr-split=notFoundComponent"],"sourcesContent":null,"names":["SplitNotFoundComponent","NotFoundComponent"],"mappings":";;AAoECA,MAAAA,sBAAAA,GAAA,SAEQC,iBAAoB,GAAA;AACrB,EAAA,uBAAC,GAAA,CAAA,KAAA,EAAA,EAAI,QAAA,EAAS,aAAA,CAAA;AACtB;;;;"}
-50
.output/server/chunks/_/pokemon-BBQDA5Ex.mjs
··· 1 - import * as v from 'valibot'; 2 - import { z as createServerRpc, A as createServerFn, D as DB } from './ssr.mjs'; 3 - import 'react/jsx-runtime'; 4 - import 'react'; 5 - import 'react-dom'; 6 - import 'drizzle-orm'; 7 - import 'drizzle-orm/libsql'; 8 - import '@t3-oss/env-core'; 9 - import 'drizzle-orm/sqlite-core'; 10 - import 'node:async_hooks'; 11 - import 'node:stream'; 12 - import 'react-dom/server'; 13 - import 'node:stream/web'; 14 - 15 - const PokemonListParamsSchema = v.object({ 16 - offset: v.optional(v.number()) 17 - }); 18 - const innerGetPokemonList = async (offset) => { 19 - const pokemon = await DB.queries.getPokemonAtOffset(offset, POKEMON_LIMIT + 1); 20 - const hasMore = pokemon.length > POKEMON_LIMIT; 21 - const results = hasMore ? pokemon.slice(0, -1) : pokemon; 22 - console.log("results", results); 23 - return { 24 - pokemon: results, 25 - nextOffset: hasMore ? offset + POKEMON_LIMIT : null, 26 - prevOffset: offset > 0 ? Math.max(0, offset - POKEMON_LIMIT) : null 27 - }; 28 - }; 29 - const getServerPokemonList_createServerFn_handler = createServerRpc("src_util_pokemon_ts--getServerPokemonList_createServerFn_handler", "/_serverFn", (opts, signal) => { 30 - return getServerPokemonList.__executeServer(opts, signal); 31 - }); 32 - const POKEMON_LIMIT = 25; 33 - const getServerPokemonList = createServerFn({ 34 - method: "GET" 35 - }).validator((params) => { 36 - var _a; 37 - const validated = v.parse(PokemonListParamsSchema, params); 38 - const offset = (_a = validated.offset) != null ? _a : 0; 39 - if (offset < 0) throw new Error("Offset must be greater than or equal to 0"); 40 - return { 41 - offset 42 - }; 43 - }).handler(getServerPokemonList_createServerFn_handler, async ({ 44 - data 45 - }) => { 46 - return await innerGetPokemonList(data.offset); 47 - }); 48 - 49 - export { getServerPokemonList_createServerFn_handler }; 50 - //# sourceMappingURL=pokemon-BBQDA5Ex.mjs.map
-1
.output/server/chunks/_/pokemon-BBQDA5Ex.mjs.map
··· 1 - {"version":3,"file":"pokemon-BBQDA5Ex.mjs","sources":["../../../../../src/util/pokemon.ts?tsr-directive-use-server="],"sourcesContent":null,"names":["PokemonListParamsSchema","v","object","offset","optional","number","innerGetPokemonList","pokemon","DB","queries","getPokemonAtOffset","POKEMON_LIMIT","hasMore","length","results","slice","log","nextOffset","prevOffset","Math","max","getServerPokemonList_createServerFn_handler","createServerRpc","opts","signal","getServerPokemonList.__executeServer","__executeServer","getServerPokemonList","createServerFn","method","validator","params","validated","parse","Error","handler","data"],"mappings":";;;;;;;;;;;;;;AAMA,MAAMA,uBAAAA,GAA0BC,EAAEC,MAAO,CAAA;AAAA,EACxCC,MAAQF,EAAAA,CAAAA,CAAEG,QAASH,CAAAA,CAAAA,CAAEI,QAAQ;AAC9B,CAAC,CAAA;AAED,MAAMC,mBAAAA,GAAsB,OAAOH,MAAmB,KAAA;AAErD,EAAA,MAAMI,UAAU,MAAMC,EAAAA,CAAGC,QAAQC,kBAChCP,CAAAA,MAAAA,EACAQ,gBAAgB,CACjB,CAAA;AAGMC,EAAAA,MAAAA,OAAAA,GAAUL,QAAQM,MAASF,GAAAA,aAAAA;AAGjC,EAAA,MAAMG,UAAUF,OAAUL,GAAAA,OAAAA,CAAQQ,KAAM,CAAA,CAAA,EAAG,EAAE,CAAIR,GAAAA,OAAAA;AAEzCS,EAAAA,OAAAA,CAAAA,GAAAA,CAAI,WAAWF,OAAO,CAAA;AAEvB,EAAA,OAAA;AAAA,IACNP,OAASO,EAAAA,OAAAA;AAAAA,IACTG,UAAAA,EAAYL,OAAUT,GAAAA,MAAAA,GAASQ,aAAgB,GAAA,IAAA;AAAA,IAC/CO,UAAAA,EAAYf,SAAS,CAAIgB,GAAAA,IAAAA,CAAKC,IAAI,CAAGjB,EAAAA,MAAAA,GAASQ,aAAa,CAAI,GAAA;AAAA,GAChE;AACD,CAAA;AAAC,MAAAU,8CAAAC,eAAA,CAAA,kEAAA,EAAA,YAYQC,EAAAA,CAAAA,MAAAC,MAAA,KAAA;AAAAC,EAAAA,OAAAA,oBAAAA,CAAAC,eAAAH,CAAAA,IAAAA,EAAAC,MAAA,CAAA;AAAA,CAAA;AAtCF,MAAMb,aAAgB,GAAA,EAAA;AA4BtB,MAAMgB,uBAAuBC,cAAe,CAAA;AAAA,EAAEC,MAAQ,EAAA;AAAM,CAAC,CAAA,CAClEC,SAAWC,CAAAA,CAAW,MAAA,KAAA;;AACtB,EAAA,MAAMC,SAAY/B,GAAAA,CAAAA,CAAEgC,KAAMjC,CAAAA,uBAAAA,EAAyB+B,MAAM,CAAA;AACnD5B,EAAAA,MAAAA,MAAAA,GAAAA,CAAS6B,EAAU7B,GAAAA,SAAAA,CAAAA,MAAAA,KAAV6B,IAAoB,GAAA,EAAA,GAAA,CAAA;AAEnC,EAAA,IAAI7B,MAAS,GAAA,CAAA,EACN,MAAA,IAAI+B,MAAM,2CAA2C,CAAA;AAErD,EAAA,OAAA;AAAA,IAAE/B;AAAAA,GAAO;AACjB,CAAC,CAAA,CACAgC,OAAOd,CAAAA,2CAAAA,EAAC,OAAO;AAAA,EAAEe;AAAK,CAAM,KAAA;AACrB,EAAA,OAAA,MAAM9B,mBAAoB8B,CAAAA,IAAAA,CAAKjC,MAAM,CAAA;AAC7C,CAAC,CAAA;;;;"}
-8
.output/server/chunks/_/preloading-CDby3_eA.mjs
··· 1 - import { jsx } from 'react/jsx-runtime'; 2 - 3 - const SplitErrorComponent = function ErrorComponent() { 4 - return /* @__PURE__ */ jsx("div", { children: "Error" }); 5 - }; 6 - 7 - export { SplitErrorComponent as errorComponent }; 8 - //# sourceMappingURL=preloading-CDby3_eA.mjs.map
-1
.output/server/chunks/_/preloading-CDby3_eA.mjs.map
··· 1 - {"version":3,"file":"preloading-CDby3_eA.mjs","sources":["../../../../../src/routes/preloading.tsx?tsr-split=errorComponent"],"sourcesContent":null,"names":["SplitErrorComponent","ErrorComponent"],"mappings":";;AA4ECA,MAAAA,mBAAAA,GAAA,SAMQC,cAAiB,GAAA;AAClB,EAAA,uBAAC,GAAA,CAAA,KAAA,EAAA,EAAI,QAAA,EAAK,SAAA,CAAA;AAClB;;;;"}
-88
.output/server/chunks/_/preloading-D-Pu2kHV.mjs
··· 1 - import { jsxs, jsx } from 'react/jsx-runtime'; 2 - import { u as useSuspenseQuery } from './useSuspenseQuery-D_gTj2Eu.mjs'; 3 - import { a as Route$4, L as Link } from './ssr.mjs'; 4 - import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell, f as buttonVariants, g as cn } from './table-VHJbrm0X.mjs'; 5 - import { useMemo } from 'react'; 6 - import 'react-dom'; 7 - import 'valibot'; 8 - import 'drizzle-orm'; 9 - import 'drizzle-orm/libsql'; 10 - import '@t3-oss/env-core'; 11 - import 'drizzle-orm/sqlite-core'; 12 - import 'node:async_hooks'; 13 - import 'node:stream'; 14 - import 'react-dom/server'; 15 - import 'node:stream/web'; 16 - import 'class-variance-authority'; 17 - import 'clsx'; 18 - import 'tailwind-merge'; 19 - 20 - const POKEMON_LIMIT = 20; 21 - const matchPokemonIdExp = /\/api\/v2\/pokemon\/(\d+)\/?/; 22 - const SplitComponent = function RouteComponent() { 23 - var _a; 24 - const { 25 - offset: currentOffset 26 - } = Route$4.useSearch(); 27 - const { 28 - pokemonListOptions 29 - } = Route$4.useRouteContext(); 30 - const { 31 - data 32 - } = useSuspenseQuery(pokemonListOptions); 33 - const previousOffset = useMemo(() => { 34 - var _a2; 35 - if ((data == null ? void 0 : data.previous) == null) { 36 - return null; 37 - } 38 - return (_a2 = new URL(data.previous).searchParams.get("offset")) != null ? _a2 : null; 39 - }, [data == null ? void 0 : data.previous]); 40 - const nextOffset = useMemo(() => { 41 - var _a2; 42 - if ((data == null ? void 0 : data.next) == null) { 43 - return null; 44 - } 45 - return (_a2 = new URL(data.next).searchParams.get("offset")) != null ? _a2 : null; 46 - }, [data == null ? void 0 : data.next]); 47 - const results = (_a = data.results) != null ? _a : []; 48 - return /* @__PURE__ */ jsxs("div", { className: "p-4", children: [ 49 - /* @__PURE__ */ jsxs("h1", { className: "text-2xl font-bold mb-4", children: [ 50 - "National Pok\xE9dex: Pok\xE9mon ", 51 - currentOffset + 1, 52 - "-", 53 - currentOffset + POKEMON_LIMIT 54 - ] }), 55 - /* @__PURE__ */ jsxs(Table, { children: [ 56 - /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [ 57 - /* @__PURE__ */ jsx(TableHead, { children: "#" }), 58 - /* @__PURE__ */ jsx(TableHead, { children: "Name" }), 59 - /* @__PURE__ */ jsx(TableHead, { children: "Details" }) 60 - ] }) }), 61 - /* @__PURE__ */ jsx(TableBody, { children: results.map((pokemon) => { 62 - var _a2; 63 - return /* @__PURE__ */ jsxs(TableRow, { children: [ 64 - /* @__PURE__ */ jsx(TableCell, { children: (_a2 = pokemon.url.match(matchPokemonIdExp)) == null ? void 0 : _a2[1] }), 65 - /* @__PURE__ */ jsx(TableCell, { className: "capitalize", children: pokemon.name }), 66 - /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("a", { href: pokemon.url, target: "_blank", rel: "noopener noreferrer", className: "text-blue-600 underline", children: "View" }) }) 67 - ] }, pokemon.name); 68 - }) }) 69 - ] }), 70 - /* @__PURE__ */ jsxs("div", { className: "flex justify-center gap-4 mt-4", children: [ 71 - /* @__PURE__ */ jsx(Link, { to: "/preloading", className: buttonVariants({ 72 - variant: "outline", 73 - className: cn(!previousOffset && "opacity-50 cursor-not-allowed") 74 - }), search: { 75 - offset: Number(previousOffset) 76 - }, disabled: !previousOffset, children: "Previous" }), 77 - /* @__PURE__ */ jsx(Link, { to: "/preloading", search: { 78 - offset: Number(nextOffset) 79 - }, className: buttonVariants({ 80 - variant: "outline", 81 - className: cn(!nextOffset && "opacity-50 cursor-not-allowed") 82 - }), disabled: !nextOffset, children: "Next" }) 83 - ] }) 84 - ] }); 85 - }; 86 - 87 - export { SplitComponent as component }; 88 - //# sourceMappingURL=preloading-D-Pu2kHV.mjs.map
-1
.output/server/chunks/_/preloading-D-Pu2kHV.mjs.map
··· 1 - {"version":3,"file":"preloading-D-Pu2kHV.mjs","sources":["../../../../../src/routes/preloading.tsx?tsr-split=component"],"sourcesContent":null,"names":["POKEMON_LIMIT","matchPokemonIdExp","SplitComponent","RouteComponent","offset","currentOffset","Route","useSearch","pokemonListOptions","useRouteContext","data","useSuspenseQuery","previousOffset","useMemo","previous","_a","URL","searchParams","get","nextOffset","next","results","map","pokemon","url","match","name","buttonVariants","variant","className","cn","Number"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,aAAgB,GAAA,EAAA;AAEtB,MAAMC,iBAAoB,GAAA,8BAAA;AAyDzBC,MAAAA,cAAAA,GAAA,SAcQC,cAAiB,GAAA;;AACnB,EAAA,MAAA;AAAA,IAAEC,MAAQC,EAAAA;AAAAA,GAAAA,GAAkBC,QAAMC,SAAU,EAAA;AAC5C,EAAA,MAAA;AAAA,IAAEC;AAAAA,GAAAA,GAAuBF,QAAMG,eAAgB,EAAA;AAE/C,EAAA,MAAA;AAAA,IAAEC;AAAAA,GAAAA,GAASC,iBAAiBH,kBAAkB,CAAA;AAE9CI,EAAAA,MAAAA,cAAAA,GAAiBC,QAAQ,MAAM;;AAChCH,IAAAA,IAAAA,CAAAA,IAAAA,IAAAA,IAAAA,GAAAA,MAAAA,GAAAA,IAAAA,CAAMI,aAAY,IAAM,EAAA;AACpB,MAAA,OAAA,IAAA;AAAA;AAGD,IAAAC,OAAAA,CAAAA,GAAAA,GAAA,IAAIC,GAAAA,CAAIN,IAAKI,CAAAA,QAAQ,CAAEG,CAAAA,YAAAA,CAAaC,GAAI,CAAA,QAAQ,CAAhD,KAAA,IAAA,GAAAH,GAAqD,GAAA,IAAA;AAAA,KAC1D,CAACL,IAAAA,IAAMI,OAAAA,MAAAA,GAAAA,IAAAA,CAAAA,QAAQ,CAAC,CAAA;AAEbK,EAAAA,MAAAA,UAAAA,GAAaN,QAAQ,MAAM;;AAC5BH,IAAAA,IAAAA,CAAAA,IAAAA,IAAAA,IAAAA,GAAAA,MAAAA,GAAAA,IAAAA,CAAMU,SAAQ,IAAM,EAAA;AAChB,MAAA,OAAA,IAAA;AAAA;AAGD,IAAAL,OAAAA,CAAAA,GAAAA,GAAA,IAAIC,GAAAA,CAAIN,IAAKU,CAAAA,IAAI,CAAEH,CAAAA,YAAAA,CAAaC,GAAI,CAAA,QAAQ,CAA5C,KAAA,IAAA,GAAAH,GAAiD,GAAA,IAAA;AAAA,KACtD,CAACL,IAAAA,IAAMU,OAAAA,MAAAA,GAAAA,IAAAA,CAAAA,IAAI,CAAC,CAAA;AAETC,EAAAA,MAAAA,OAAUX,GAAAA,CAAAA,EAAAA,GAAAA,IAAAA,CAAKW,OAALX,KAAAA,IAAAA,GAAAA,EAAAA,GAAgB,EAAE;AAEjC,EAAA,uBAAC,IAAA,CAAA,KAAA,EAAI,EAAA,SAAA,EAAU,OACd,QAAA,EAAA;AAAA,oBAAC,IAAA,CAAA,IAAA,EAAA,EAAG,SAAA,EAAU,2BAAyB,QAAA,EAAA;AAAA,MAAA,kCAAA;AAAA,MACXL,aAAgB,GAAA,CAAA;AAAA,MAAE,GAAA;AAAA,MAC5CA,aAAgBL,GAAAA;AAAAA,OAClB,CAAA;AAAA,oBACC,IAAA,CAAA,KACA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAC,WAAA,EAAA,EACA,0BAAC,IAAA,CAAA,QAAA,EACA,EAAA,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAC,KAAA,CAAA;AAAA,wBACX,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAI,QAAA,CAAA;AAAA,wBACd,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAO,WAAA;AAAA,OAAA,EACnB,CAAA,EACD,CAAA;AAAA,0BACC,SACCqB,EAAAA,EAAAA,UAAAA,OAAQC,CAAAA,GAAAA,CAAI,CAACC,OAAAA,KAAAA;;AACZ,QAAA,uBAAA,IAAA,CAAA,QACA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,SAAA,IAAWA,QAAAA,EAAAA,CAAQC,MAAAA,OAAAA,CAAAA,GAAAA,CAAIC,KAAMxB,CAAAA,iBAAiB,MAA3BuB,IAAAA,GAAAA,MAAAA,GAAAA,GAA+B,CAAA,CAAG,GAAA,CAAA;AAAA,8BACrD,WAAA,EAAU,SAAA,EAAU,cAAcD,kBAAQG,MAAK,CAAA;AAAA,8BAC/C,WAAA,EACA,QAAA,sBAAC,GAAA,EAAA,EACA,MAAMH,OAAQC,CAAAA,GAAAA,EACd,QAAO,QACP,EAAA,GAAA,EAAI,uBACJ,SAAU,EAAA,yBAAA,EAAyB,UAAA,MAAA,EAGpC,GACD;AAAA,SAAA,EAZcD,EAAAA,OAAAA,CAAQG,IAavB,CAAA;AAAA,OACA,GACF;AAAA,OACD,CAAA;AAAA,oBACC,IAAA,CAAA,KAAA,EAAI,EAAA,SAAA,EAAU,kCACd,QAAA,EAAA;AAAA,0BAAC,IACA,EAAA,EAAA,EAAG,EAAA,aAAA,EACH,WAAWC,cAAe,CAAA;AAAA,QACzBC,OAAS,EAAA,SAAA;AAAA,QACTC,SAAWC,EAAAA,EAAAA,CAAG,CAAClB,cAAAA,IAAkB,+BAA+B;AAAA,OAChE,GACD,MAAQ,EAAA;AAAA,QAAER,MAAAA,EAAQ2B,OAAOnB,cAAc;AAAA,SACvC,QAAU,EAAA,CAACA,cAAe,EAAA,QAAA,EAG3B,YAAA,CAAA;AAAA,sBACC,GAAA,CAAA,IAAA,EAAA,EACA,EAAA,EAAG,eACH,MAAQ,EAAA;AAAA,QAAER,MAAAA,EAAQ2B,OAAOZ,UAAU;AAAA,OAAA,EACnC,WAAWQ,cAAe,CAAA;AAAA,QACzBC,OAAS,EAAA,SAAA;AAAA,QACTC,SAAWC,EAAAA,EAAAA,CAAG,CAACX,UAAAA,IAAc,+BAA+B;AAAA,OAC5D,CACD,EAAA,QAAA,EAAU,CAACA,UAAW,EAAA,QAAA,EAGvB,QAAA;AAAA,OACD;AAAA,KACD,CAAA;AAEF;;;;"}
-8
.output/server/chunks/_/preloading-eUhkQotn.mjs
··· 1 - import { jsx } from 'react/jsx-runtime'; 2 - 3 - const SplitNotFoundComponent = function NotFoundComponent() { 4 - return /* @__PURE__ */ jsx("div", { children: "Not Found" }); 5 - }; 6 - 7 - export { SplitNotFoundComponent as notFoundComponent }; 8 - //# sourceMappingURL=preloading-eUhkQotn.mjs.map
-1
.output/server/chunks/_/preloading-eUhkQotn.mjs.map
··· 1 - {"version":3,"file":"preloading-eUhkQotn.mjs","sources":["../../../../../src/routes/preloading.tsx?tsr-split=notFoundComponent"],"sourcesContent":null,"names":["SplitNotFoundComponent","NotFoundComponent"],"mappings":";;AA4ECA,MAAAA,sBAAAA,GAAA,SAEQC,iBAAoB,GAAA;AACrB,EAAA,uBAAC,GAAA,CAAA,KAAA,EAAA,EAAI,QAAA,EAAS,aAAA,CAAA;AACtB;;;;"}
-106
.output/server/chunks/_/routeTree.gen-C-haoEjS.mjs
··· 1 - import { r as rootRouteId, t as trimPathLeft, j as joinPaths } from './ssr.mjs'; 2 - import 'react/jsx-runtime'; 3 - import 'react'; 4 - import 'react-dom'; 5 - import 'valibot'; 6 - import 'drizzle-orm'; 7 - import 'drizzle-orm/libsql'; 8 - import '@t3-oss/env-core'; 9 - import 'drizzle-orm/sqlite-core'; 10 - import 'node:async_hooks'; 11 - import 'node:stream'; 12 - import 'react-dom/server'; 13 - import 'node:stream/web'; 14 - 15 - function createServerRoute(__, __opts) { 16 - const options = __opts || {}; 17 - const route = { 18 - path: "", 19 - id: "", 20 - fullPath: "", 21 - to: "", 22 - options, 23 - parentRoute: void 0, 24 - _types: {}, 25 - // children: undefined as TChildren, 26 - middleware: (middlewares) => createServerRoute(void 0, { 27 - ...options, 28 - middleware: middlewares 29 - }), 30 - methods: (methodsOrGetMethods) => { 31 - const methods = (() => { 32 - if (typeof methodsOrGetMethods === "function") { 33 - return methodsOrGetMethods(createMethodBuilder()); 34 - } 35 - return methodsOrGetMethods; 36 - })(); 37 - return createServerRoute(void 0, { 38 - ...__opts, 39 - methods 40 - }); 41 - }, 42 - update: (opts) => createServerRoute(void 0, { 43 - ...options, 44 - ...opts 45 - }), 46 - init: (opts) => { 47 - var _a; 48 - options.originalIndex = opts.originalIndex; 49 - const isRoot = !options.path && !options.id; 50 - route.parentRoute = (_a = options.getParentRoute) == null ? void 0 : _a.call(options); 51 - if (isRoot) { 52 - route.path = rootRouteId; 53 - } else if (!route.parentRoute) { 54 - throw new Error(`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a ServerRoute instance.`); 55 - } 56 - let path = isRoot ? rootRouteId : options.path; 57 - if (path && path !== "/") { 58 - path = trimPathLeft(path); 59 - } 60 - const customId = options.id || path; 61 - let id = isRoot ? rootRouteId : joinPaths([route.parentRoute.id === rootRouteId ? "" : route.parentRoute.id, customId]); 62 - if (path === rootRouteId) { 63 - path = "/"; 64 - } 65 - if (id !== rootRouteId) { 66 - id = joinPaths(["/", id]); 67 - } 68 - const fullPath = id === rootRouteId ? "/" : joinPaths([route.parentRoute.fullPath, path]); 69 - route.path = path; 70 - route.id = id; 71 - route.fullPath = fullPath; 72 - route.to = fullPath; 73 - }, 74 - _addFileChildren: (children) => { 75 - if (Array.isArray(children)) { 76 - route.children = children; 77 - } 78 - if (typeof children === "object" && children !== null) { 79 - route.children = Object.values(children); 80 - } 81 - return route; 82 - }, 83 - _addFileTypes: () => route 84 - }; 85 - return route; 86 - } 87 - const createMethodBuilder = (__opts) => { 88 - return { 89 - _options: __opts || {}, 90 - _types: {}, 91 - middleware: (middlewares) => createMethodBuilder({ 92 - ...__opts, 93 - middlewares 94 - }), 95 - handler: (handler) => createMethodBuilder({ 96 - ...__opts, 97 - handler 98 - }) 99 - }; 100 - }; 101 - const rootRoute = createServerRoute(); 102 - const rootRouteChildren = {}; 103 - const routeTree = rootRoute._addFileChildren(rootRouteChildren)._addFileTypes(); 104 - 105 - export { routeTree }; 106 - //# sourceMappingURL=routeTree.gen-C-haoEjS.mjs.map
-1
.output/server/chunks/_/routeTree.gen-C-haoEjS.mjs.map
··· 1 - {"version":3,"file":"routeTree.gen-C-haoEjS.mjs","sources":["../../../../../node_modules/.pnpm/@tanstack+start-server-core@1.121.0-alpha.11/node_modules/@tanstack/start-server-core/dist/esm/serverRoute.js","../../../../../.tanstack-start/server-routes/routeTree.gen.ts"],"sourcesContent":null,"names":["createServerRoute","__","__opts","options","route","path","id","fullPath","to","parentRoute","_types","middleware","middlewares","methods","methodsOrGetMethods","createMethodBuilder","update","opts","init","_a","originalIndex","isRoot","getParentRoute","call","rootRouteId","Error","trimPathLeft","customId","joinPaths","_addFileChildren","children","Array","isArray","Object","values","_addFileTypes","_options","handler","rootRoute","rootRouteChildren","routeTree"],"mappings":"","x_google_ignoreList":[0]}
-12117
.output/server/chunks/_/ssr.mjs
··· 1 - import { jsx, jsxs, Fragment } from 'react/jsx-runtime'; 2 - import * as React from 'react'; 3 - import React__default, { useRef, createElement as createElement$1, Fragment as Fragment$1 } from 'react'; 4 - import { flushSync } from 'react-dom'; 5 - import * as v from 'valibot'; 6 - import { sql, relations } from 'drizzle-orm'; 7 - import { drizzle } from 'drizzle-orm/libsql'; 8 - import { createEnv } from '@t3-oss/env-core'; 9 - import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core'; 10 - import { AsyncLocalStorage } from 'node:async_hooks'; 11 - import { PassThrough, Readable } from 'node:stream'; 12 - import ReactDOMServer from 'react-dom/server'; 13 - import { ReadableStream as ReadableStream$1 } from 'node:stream/web'; 14 - 15 - var __typeError = (msg) => { 16 - throw TypeError(msg); 17 - }; 18 - var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); 19 - var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); 20 - var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); 21 - var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value); 22 - var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); 23 - var __privateWrapper = (obj, member, setter, getter) => ({ 24 - set _(value) { 25 - __privateSet(obj, member, value); 26 - }, 27 - get _() { 28 - return __privateGet(obj, member, getter); 29 - } 30 - }); 31 - var _focused, _cleanup, _setup, _a, _online, _cleanup2, _setup2, _b, _gcTimeout, _c, _initialState, _revertState, _cache, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn, _d, _queries, _e, _observers, _mutationCache, _retryer2, _Mutation_instances, dispatch_fn2, _f, _mutations, _scopes, _mutationId, _g, _queryCache, _mutationCache2, _defaultOptions2, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h; 32 - var prefix = "Invariant failed"; 33 - function invariant(condition, message) { 34 - if (condition) { 35 - return; 36 - } 37 - { 38 - throw new Error(prefix); 39 - } 40 - } 41 - function warning(condition, message) { 42 - } 43 - const __storeToDerived = /* @__PURE__ */ new WeakMap(); 44 - const __derivedToStore = /* @__PURE__ */ new WeakMap(); 45 - const __depsThatHaveWrittenThisTick = { 46 - current: [] 47 - }; 48 - let __isFlushing = false; 49 - let __batchDepth = 0; 50 - const __pendingUpdates = /* @__PURE__ */ new Set(); 51 - const __initialBatchValues = /* @__PURE__ */ new Map(); 52 - function __flush_internals(relatedVals) { 53 - const sorted = Array.from(relatedVals).sort((a, b) => { 54 - if (a instanceof Derived && a.options.deps.includes(b)) return 1; 55 - if (b instanceof Derived && b.options.deps.includes(a)) return -1; 56 - return 0; 57 - }); 58 - for (const derived of sorted) { 59 - if (__depsThatHaveWrittenThisTick.current.includes(derived)) { 60 - continue; 61 - } 62 - __depsThatHaveWrittenThisTick.current.push(derived); 63 - derived.recompute(); 64 - const stores = __derivedToStore.get(derived); 65 - if (stores) { 66 - for (const store of stores) { 67 - const relatedLinkedDerivedVals = __storeToDerived.get(store); 68 - if (!relatedLinkedDerivedVals) continue; 69 - __flush_internals(relatedLinkedDerivedVals); 70 - } 71 - } 72 - } 73 - } 74 - function __notifyListeners(store) { 75 - store.listeners.forEach( 76 - (listener) => listener({ 77 - prevVal: store.prevState, 78 - currentVal: store.state 79 - }) 80 - ); 81 - } 82 - function __notifyDerivedListeners(derived) { 83 - derived.listeners.forEach( 84 - (listener) => listener({ 85 - prevVal: derived.prevState, 86 - currentVal: derived.state 87 - }) 88 - ); 89 - } 90 - function __flush(store) { 91 - if (__batchDepth > 0 && !__initialBatchValues.has(store)) { 92 - __initialBatchValues.set(store, store.prevState); 93 - } 94 - __pendingUpdates.add(store); 95 - if (__batchDepth > 0) return; 96 - if (__isFlushing) return; 97 - try { 98 - __isFlushing = true; 99 - while (__pendingUpdates.size > 0) { 100 - const stores = Array.from(__pendingUpdates); 101 - __pendingUpdates.clear(); 102 - for (const store2 of stores) { 103 - const prevState = __initialBatchValues.get(store2) ?? store2.prevState; 104 - store2.prevState = prevState; 105 - __notifyListeners(store2); 106 - } 107 - for (const store2 of stores) { 108 - const derivedVals = __storeToDerived.get(store2); 109 - if (!derivedVals) continue; 110 - __depsThatHaveWrittenThisTick.current.push(store2); 111 - __flush_internals(derivedVals); 112 - } 113 - for (const store2 of stores) { 114 - const derivedVals = __storeToDerived.get(store2); 115 - if (!derivedVals) continue; 116 - for (const derived of derivedVals) { 117 - __notifyDerivedListeners(derived); 118 - } 119 - } 120 - } 121 - } finally { 122 - __isFlushing = false; 123 - __depsThatHaveWrittenThisTick.current = []; 124 - __initialBatchValues.clear(); 125 - } 126 - } 127 - function batch$1(fn) { 128 - __batchDepth++; 129 - try { 130 - fn(); 131 - } finally { 132 - __batchDepth--; 133 - if (__batchDepth === 0) { 134 - const pendingUpdateToFlush = Array.from(__pendingUpdates)[0]; 135 - if (pendingUpdateToFlush) { 136 - __flush(pendingUpdateToFlush); 137 - } 138 - } 139 - } 140 - } 141 - class Store { 142 - constructor(initialState, options) { 143 - this.listeners = /* @__PURE__ */ new Set(); 144 - this.subscribe = (listener) => { 145 - var _a2, _b2; 146 - this.listeners.add(listener); 147 - const unsub = (_b2 = (_a2 = this.options) == null ? void 0 : _a2.onSubscribe) == null ? void 0 : _b2.call(_a2, listener, this); 148 - return () => { 149 - this.listeners.delete(listener); 150 - unsub == null ? void 0 : unsub(); 151 - }; 152 - }; 153 - this.setState = (updater) => { 154 - var _a2, _b2, _c2; 155 - this.prevState = this.state; 156 - this.state = ((_a2 = this.options) == null ? void 0 : _a2.updateFn) ? this.options.updateFn(this.prevState)(updater) : updater(this.prevState); 157 - (_c2 = (_b2 = this.options) == null ? void 0 : _b2.onUpdate) == null ? void 0 : _c2.call(_b2); 158 - __flush(this); 159 - }; 160 - this.prevState = initialState; 161 - this.state = initialState; 162 - this.options = options; 163 - } 164 - } 165 - class Derived { 166 - constructor(options) { 167 - this.listeners = /* @__PURE__ */ new Set(); 168 - this._subscriptions = []; 169 - this.lastSeenDepValues = []; 170 - this.getDepVals = () => { 171 - const prevDepVals = []; 172 - const currDepVals = []; 173 - for (const dep of this.options.deps) { 174 - prevDepVals.push(dep.prevState); 175 - currDepVals.push(dep.state); 176 - } 177 - this.lastSeenDepValues = currDepVals; 178 - return { 179 - prevDepVals, 180 - currDepVals, 181 - prevVal: this.prevState ?? void 0 182 - }; 183 - }; 184 - this.recompute = () => { 185 - var _a2, _b2; 186 - this.prevState = this.state; 187 - const { prevDepVals, currDepVals, prevVal } = this.getDepVals(); 188 - this.state = this.options.fn({ 189 - prevDepVals, 190 - currDepVals, 191 - prevVal 192 - }); 193 - (_b2 = (_a2 = this.options).onUpdate) == null ? void 0 : _b2.call(_a2); 194 - }; 195 - this.checkIfRecalculationNeededDeeply = () => { 196 - for (const dep of this.options.deps) { 197 - if (dep instanceof Derived) { 198 - dep.checkIfRecalculationNeededDeeply(); 199 - } 200 - } 201 - let shouldRecompute = false; 202 - const lastSeenDepValues = this.lastSeenDepValues; 203 - const { currDepVals } = this.getDepVals(); 204 - for (let i = 0; i < currDepVals.length; i++) { 205 - if (currDepVals[i] !== lastSeenDepValues[i]) { 206 - shouldRecompute = true; 207 - break; 208 - } 209 - } 210 - if (shouldRecompute) { 211 - this.recompute(); 212 - } 213 - }; 214 - this.mount = () => { 215 - this.registerOnGraph(); 216 - this.checkIfRecalculationNeededDeeply(); 217 - return () => { 218 - this.unregisterFromGraph(); 219 - for (const cleanup of this._subscriptions) { 220 - cleanup(); 221 - } 222 - }; 223 - }; 224 - this.subscribe = (listener) => { 225 - var _a2, _b2; 226 - this.listeners.add(listener); 227 - const unsub = (_b2 = (_a2 = this.options).onSubscribe) == null ? void 0 : _b2.call(_a2, listener, this); 228 - return () => { 229 - this.listeners.delete(listener); 230 - unsub == null ? void 0 : unsub(); 231 - }; 232 - }; 233 - this.options = options; 234 - this.state = options.fn({ 235 - prevDepVals: void 0, 236 - prevVal: void 0, 237 - currDepVals: this.getDepVals().currDepVals 238 - }); 239 - } 240 - registerOnGraph(deps = this.options.deps) { 241 - for (const dep of deps) { 242 - if (dep instanceof Derived) { 243 - dep.registerOnGraph(); 244 - this.registerOnGraph(dep.options.deps); 245 - } else if (dep instanceof Store) { 246 - let relatedLinkedDerivedVals = __storeToDerived.get(dep); 247 - if (!relatedLinkedDerivedVals) { 248 - relatedLinkedDerivedVals = /* @__PURE__ */ new Set(); 249 - __storeToDerived.set(dep, relatedLinkedDerivedVals); 250 - } 251 - relatedLinkedDerivedVals.add(this); 252 - let relatedStores = __derivedToStore.get(this); 253 - if (!relatedStores) { 254 - relatedStores = /* @__PURE__ */ new Set(); 255 - __derivedToStore.set(this, relatedStores); 256 - } 257 - relatedStores.add(dep); 258 - } 259 - } 260 - } 261 - unregisterFromGraph(deps = this.options.deps) { 262 - for (const dep of deps) { 263 - if (dep instanceof Derived) { 264 - this.unregisterFromGraph(dep.options.deps); 265 - } else if (dep instanceof Store) { 266 - const relatedLinkedDerivedVals = __storeToDerived.get(dep); 267 - if (relatedLinkedDerivedVals) { 268 - relatedLinkedDerivedVals.delete(this); 269 - } 270 - const relatedStores = __derivedToStore.get(this); 271 - if (relatedStores) { 272 - relatedStores.delete(dep); 273 - } 274 - } 275 - } 276 - } 277 - } 278 - const stateIndexKey = "__TSR_index"; 279 - const popStateEvent = "popstate"; 280 - const beforeUnloadEvent = "beforeunload"; 281 - function createHistory(opts) { 282 - let location = opts.getLocation(); 283 - const subscribers = /* @__PURE__ */ new Set(); 284 - const notify = (action) => { 285 - location = opts.getLocation(); 286 - subscribers.forEach((subscriber) => subscriber({ location, action })); 287 - }; 288 - const handleIndexChange = (action) => { 289 - if (opts.notifyOnIndexChange ?? true) notify(action); 290 - else location = opts.getLocation(); 291 - }; 292 - const tryNavigation = async ({ 293 - task, 294 - navigateOpts, 295 - ...actionInfo 296 - }) => { 297 - var _a2, _b2; 298 - const ignoreBlocker = (navigateOpts == null ? void 0 : navigateOpts.ignoreBlocker) ?? false; 299 - if (ignoreBlocker) { 300 - task(); 301 - return; 302 - } 303 - const blockers = ((_a2 = opts.getBlockers) == null ? void 0 : _a2.call(opts)) ?? []; 304 - const isPushOrReplace = actionInfo.type === "PUSH" || actionInfo.type === "REPLACE"; 305 - if (typeof document !== "undefined" && blockers.length && isPushOrReplace) { 306 - for (const blocker of blockers) { 307 - const nextLocation = parseHref(actionInfo.path, actionInfo.state); 308 - const isBlocked = await blocker.blockerFn({ 309 - currentLocation: location, 310 - nextLocation, 311 - action: actionInfo.type 312 - }); 313 - if (isBlocked) { 314 - (_b2 = opts.onBlocked) == null ? void 0 : _b2.call(opts); 315 - return; 316 - } 317 - } 318 - } 319 - task(); 320 - }; 321 - return { 322 - get location() { 323 - return location; 324 - }, 325 - get length() { 326 - return opts.getLength(); 327 - }, 328 - subscribers, 329 - subscribe: (cb) => { 330 - subscribers.add(cb); 331 - return () => { 332 - subscribers.delete(cb); 333 - }; 334 - }, 335 - push: (path, state, navigateOpts) => { 336 - const currentIndex = location.state[stateIndexKey]; 337 - state = assignKeyAndIndex(currentIndex + 1, state); 338 - tryNavigation({ 339 - task: () => { 340 - opts.pushState(path, state); 341 - notify({ type: "PUSH" }); 342 - }, 343 - navigateOpts, 344 - type: "PUSH", 345 - path, 346 - state 347 - }); 348 - }, 349 - replace: (path, state, navigateOpts) => { 350 - const currentIndex = location.state[stateIndexKey]; 351 - state = assignKeyAndIndex(currentIndex, state); 352 - tryNavigation({ 353 - task: () => { 354 - opts.replaceState(path, state); 355 - notify({ type: "REPLACE" }); 356 - }, 357 - navigateOpts, 358 - type: "REPLACE", 359 - path, 360 - state 361 - }); 362 - }, 363 - go: (index2, navigateOpts) => { 364 - tryNavigation({ 365 - task: () => { 366 - opts.go(index2); 367 - handleIndexChange({ type: "GO", index: index2 }); 368 - }, 369 - navigateOpts, 370 - type: "GO" 371 - }); 372 - }, 373 - back: (navigateOpts) => { 374 - tryNavigation({ 375 - task: () => { 376 - opts.back((navigateOpts == null ? void 0 : navigateOpts.ignoreBlocker) ?? false); 377 - handleIndexChange({ type: "BACK" }); 378 - }, 379 - navigateOpts, 380 - type: "BACK" 381 - }); 382 - }, 383 - forward: (navigateOpts) => { 384 - tryNavigation({ 385 - task: () => { 386 - opts.forward((navigateOpts == null ? void 0 : navigateOpts.ignoreBlocker) ?? false); 387 - handleIndexChange({ type: "FORWARD" }); 388 - }, 389 - navigateOpts, 390 - type: "FORWARD" 391 - }); 392 - }, 393 - canGoBack: () => location.state[stateIndexKey] !== 0, 394 - createHref: (str) => opts.createHref(str), 395 - block: (blocker) => { 396 - var _a2; 397 - if (!opts.setBlockers) return () => { 398 - }; 399 - const blockers = ((_a2 = opts.getBlockers) == null ? void 0 : _a2.call(opts)) ?? []; 400 - opts.setBlockers([...blockers, blocker]); 401 - return () => { 402 - var _a22, _b2; 403 - const blockers2 = ((_a22 = opts.getBlockers) == null ? void 0 : _a22.call(opts)) ?? []; 404 - (_b2 = opts.setBlockers) == null ? void 0 : _b2.call(opts, blockers2.filter((b) => b !== blocker)); 405 - }; 406 - }, 407 - flush: () => { 408 - var _a2; 409 - return (_a2 = opts.flush) == null ? void 0 : _a2.call(opts); 410 - }, 411 - destroy: () => { 412 - var _a2; 413 - return (_a2 = opts.destroy) == null ? void 0 : _a2.call(opts); 414 - }, 415 - notify 416 - }; 417 - } 418 - function assignKeyAndIndex(index2, state) { 419 - if (!state) { 420 - state = {}; 421 - } 422 - return { 423 - ...state, 424 - key: createRandomKey(), 425 - [stateIndexKey]: index2 426 - }; 427 - } 428 - function createBrowserHistory(opts) { 429 - var _a2; 430 - const win = typeof document !== "undefined" ? window : void 0; 431 - const originalPushState = win.history.pushState; 432 - const originalReplaceState = win.history.replaceState; 433 - let blockers = []; 434 - const _getBlockers = () => blockers; 435 - const _setBlockers = (newBlockers) => blockers = newBlockers; 436 - const createHref = (path) => path; 437 - const parseLocation = () => parseHref( 438 - `${win.location.pathname}${win.location.search}${win.location.hash}`, 439 - win.history.state 440 - ); 441 - if (!((_a2 = win.history.state) == null ? void 0 : _a2.key)) { 442 - win.history.replaceState( 443 - { 444 - [stateIndexKey]: 0, 445 - key: createRandomKey() 446 - }, 447 - "" 448 - ); 449 - } 450 - let currentLocation = parseLocation(); 451 - let rollbackLocation; 452 - let nextPopIsGo = false; 453 - let ignoreNextPop = false; 454 - let skipBlockerNextPop = false; 455 - let ignoreNextBeforeUnload = false; 456 - const getLocation = () => currentLocation; 457 - let next; 458 - let scheduled; 459 - const flush = () => { 460 - if (!next) { 461 - return; 462 - } 463 - history._ignoreSubscribers = true; 464 - (next.isPush ? win.history.pushState : win.history.replaceState)( 465 - next.state, 466 - "", 467 - next.href 468 - ); 469 - history._ignoreSubscribers = false; 470 - next = void 0; 471 - scheduled = void 0; 472 - rollbackLocation = void 0; 473 - }; 474 - const queueHistoryAction = (type, destHref, state) => { 475 - const href = createHref(destHref); 476 - if (!scheduled) { 477 - rollbackLocation = currentLocation; 478 - } 479 - currentLocation = parseHref(destHref, state); 480 - next = { 481 - href, 482 - state, 483 - isPush: (next == null ? void 0 : next.isPush) || type === "push" 484 - }; 485 - if (!scheduled) { 486 - scheduled = Promise.resolve().then(() => flush()); 487 - } 488 - }; 489 - const onPushPop = (type) => { 490 - currentLocation = parseLocation(); 491 - history.notify({ type }); 492 - }; 493 - const onPushPopEvent = async () => { 494 - if (ignoreNextPop) { 495 - ignoreNextPop = false; 496 - return; 497 - } 498 - const nextLocation = parseLocation(); 499 - const delta = nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey]; 500 - const isForward = delta === 1; 501 - const isBack = delta === -1; 502 - const isGo = !isForward && !isBack || nextPopIsGo; 503 - nextPopIsGo = false; 504 - const action = isGo ? "GO" : isBack ? "BACK" : "FORWARD"; 505 - const notify = isGo ? { 506 - type: "GO", 507 - index: delta 508 - } : { 509 - type: isBack ? "BACK" : "FORWARD" 510 - }; 511 - if (skipBlockerNextPop) { 512 - skipBlockerNextPop = false; 513 - } else { 514 - const blockers2 = _getBlockers(); 515 - if (typeof document !== "undefined" && blockers2.length) { 516 - for (const blocker of blockers2) { 517 - const isBlocked = await blocker.blockerFn({ 518 - currentLocation, 519 - nextLocation, 520 - action 521 - }); 522 - if (isBlocked) { 523 - ignoreNextPop = true; 524 - win.history.go(1); 525 - history.notify(notify); 526 - return; 527 - } 528 - } 529 - } 530 - } 531 - currentLocation = parseLocation(); 532 - history.notify(notify); 533 - }; 534 - const onBeforeUnload = (e) => { 535 - if (ignoreNextBeforeUnload) { 536 - ignoreNextBeforeUnload = false; 537 - return; 538 - } 539 - let shouldBlock = false; 540 - const blockers2 = _getBlockers(); 541 - if (typeof document !== "undefined" && blockers2.length) { 542 - for (const blocker of blockers2) { 543 - const shouldHaveBeforeUnload = blocker.enableBeforeUnload ?? true; 544 - if (shouldHaveBeforeUnload === true) { 545 - shouldBlock = true; 546 - break; 547 - } 548 - if (typeof shouldHaveBeforeUnload === "function" && shouldHaveBeforeUnload() === true) { 549 - shouldBlock = true; 550 - break; 551 - } 552 - } 553 - } 554 - if (shouldBlock) { 555 - e.preventDefault(); 556 - return e.returnValue = ""; 557 - } 558 - return; 559 - }; 560 - const history = createHistory({ 561 - getLocation, 562 - getLength: () => win.history.length, 563 - pushState: (href, state) => queueHistoryAction("push", href, state), 564 - replaceState: (href, state) => queueHistoryAction("replace", href, state), 565 - back: (ignoreBlocker) => { 566 - if (ignoreBlocker) skipBlockerNextPop = true; 567 - ignoreNextBeforeUnload = true; 568 - return win.history.back(); 569 - }, 570 - forward: (ignoreBlocker) => { 571 - if (ignoreBlocker) skipBlockerNextPop = true; 572 - ignoreNextBeforeUnload = true; 573 - win.history.forward(); 574 - }, 575 - go: (n) => { 576 - nextPopIsGo = true; 577 - win.history.go(n); 578 - }, 579 - createHref: (href) => createHref(href), 580 - flush, 581 - destroy: () => { 582 - win.history.pushState = originalPushState; 583 - win.history.replaceState = originalReplaceState; 584 - win.removeEventListener(beforeUnloadEvent, onBeforeUnload, { 585 - capture: true 586 - }); 587 - win.removeEventListener(popStateEvent, onPushPopEvent); 588 - }, 589 - onBlocked: () => { 590 - if (rollbackLocation && currentLocation !== rollbackLocation) { 591 - currentLocation = rollbackLocation; 592 - } 593 - }, 594 - getBlockers: _getBlockers, 595 - setBlockers: _setBlockers, 596 - notifyOnIndexChange: false 597 - }); 598 - win.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true }); 599 - win.addEventListener(popStateEvent, onPushPopEvent); 600 - win.history.pushState = function(...args) { 601 - const res = originalPushState.apply(win.history, args); 602 - if (!history._ignoreSubscribers) onPushPop("PUSH"); 603 - return res; 604 - }; 605 - win.history.replaceState = function(...args) { 606 - const res = originalReplaceState.apply(win.history, args); 607 - if (!history._ignoreSubscribers) onPushPop("REPLACE"); 608 - return res; 609 - }; 610 - return history; 611 - } 612 - function createMemoryHistory(opts = { 613 - initialEntries: ["/"] 614 - }) { 615 - const entries = opts.initialEntries; 616 - let index2 = opts.initialIndex ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1) : entries.length - 1; 617 - const states = entries.map( 618 - (_entry, index22) => assignKeyAndIndex(index22, void 0) 619 - ); 620 - const getLocation = () => parseHref(entries[index2], states[index2]); 621 - return createHistory({ 622 - getLocation, 623 - getLength: () => entries.length, 624 - pushState: (path, state) => { 625 - if (index2 < entries.length - 1) { 626 - entries.splice(index2 + 1); 627 - states.splice(index2 + 1); 628 - } 629 - states.push(state); 630 - entries.push(path); 631 - index2 = Math.max(entries.length - 1, 0); 632 - }, 633 - replaceState: (path, state) => { 634 - states[index2] = state; 635 - entries[index2] = path; 636 - }, 637 - back: () => { 638 - index2 = Math.max(index2 - 1, 0); 639 - }, 640 - forward: () => { 641 - index2 = Math.min(index2 + 1, entries.length - 1); 642 - }, 643 - go: (n) => { 644 - index2 = Math.min(Math.max(index2 + n, 0), entries.length - 1); 645 - }, 646 - createHref: (path) => path 647 - }); 648 - } 649 - function parseHref(href, state) { 650 - const hashIndex = href.indexOf("#"); 651 - const searchIndex = href.indexOf("?"); 652 - return { 653 - href, 654 - pathname: href.substring( 655 - 0, 656 - hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : href.length 657 - ), 658 - hash: hashIndex > -1 ? href.substring(hashIndex) : "", 659 - search: searchIndex > -1 ? href.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : "", 660 - state: state || { [stateIndexKey]: 0, key: createRandomKey() } 661 - }; 662 - } 663 - function createRandomKey() { 664 - return (Math.random() + 1).toString(36).substring(7); 665 - } 666 - function last(arr) { 667 - return arr[arr.length - 1]; 668 - } 669 - function isFunction(d) { 670 - return typeof d === "function"; 671 - } 672 - function functionalUpdate$1(updater, previous) { 673 - if (isFunction(updater)) { 674 - return updater(previous); 675 - } 676 - return updater; 677 - } 678 - function pick(parent, keys) { 679 - return keys.reduce((obj, key) => { 680 - obj[key] = parent[key]; 681 - return obj; 682 - }, {}); 683 - } 684 - function replaceEqualDeep$1(prev, _next) { 685 - if (prev === _next) { 686 - return prev; 687 - } 688 - const next = _next; 689 - const array = isPlainArray$1(prev) && isPlainArray$1(next); 690 - if (array || isPlainObject$2(prev) && isPlainObject$2(next)) { 691 - const prevItems = array ? prev : Object.keys(prev); 692 - const prevSize = prevItems.length; 693 - const nextItems = array ? next : Object.keys(next); 694 - const nextSize = nextItems.length; 695 - const copy2 = array ? [] : {}; 696 - let equalItems = 0; 697 - for (let i = 0; i < nextSize; i++) { 698 - const key = array ? i : nextItems[i]; 699 - if ((!array && prevItems.includes(key) || array) && prev[key] === void 0 && next[key] === void 0) { 700 - copy2[key] = void 0; 701 - equalItems++; 702 - } else { 703 - copy2[key] = replaceEqualDeep$1(prev[key], next[key]); 704 - if (copy2[key] === prev[key] && prev[key] !== void 0) { 705 - equalItems++; 706 - } 707 - } 708 - } 709 - return prevSize === nextSize && equalItems === prevSize ? prev : copy2; 710 - } 711 - return next; 712 - } 713 - function isPlainObject$2(o) { 714 - if (!hasObjectPrototype$1(o)) { 715 - return false; 716 - } 717 - const ctor = o.constructor; 718 - if (typeof ctor === "undefined") { 719 - return true; 720 - } 721 - const prot = ctor.prototype; 722 - if (!hasObjectPrototype$1(prot)) { 723 - return false; 724 - } 725 - if (!prot.hasOwnProperty("isPrototypeOf")) { 726 - return false; 727 - } 728 - return true; 729 - } 730 - function hasObjectPrototype$1(o) { 731 - return Object.prototype.toString.call(o) === "[object Object]"; 732 - } 733 - function isPlainArray$1(value) { 734 - return Array.isArray(value) && value.length === Object.keys(value).length; 735 - } 736 - function getObjectKeys(obj, ignoreUndefined) { 737 - let keys = Object.keys(obj); 738 - if (ignoreUndefined) { 739 - keys = keys.filter((key) => obj[key] !== void 0); 740 - } 741 - return keys; 742 - } 743 - function deepEqual(a, b, opts) { 744 - if (a === b) { 745 - return true; 746 - } 747 - if (typeof a !== typeof b) { 748 - return false; 749 - } 750 - if (isPlainObject$2(a) && isPlainObject$2(b)) { 751 - const ignoreUndefined = (opts == null ? void 0 : opts.ignoreUndefined) ?? true; 752 - const aKeys = getObjectKeys(a, ignoreUndefined); 753 - const bKeys = getObjectKeys(b, ignoreUndefined); 754 - if (!(opts == null ? void 0 : opts.partial) && aKeys.length !== bKeys.length) { 755 - return false; 756 - } 757 - return bKeys.every((key) => deepEqual(a[key], b[key], opts)); 758 - } 759 - if (Array.isArray(a) && Array.isArray(b)) { 760 - if (a.length !== b.length) { 761 - return false; 762 - } 763 - return !a.some((item, index2) => !deepEqual(item, b[index2], opts)); 764 - } 765 - return false; 766 - } 767 - function createControlledPromise(onResolve) { 768 - let resolveLoadPromise; 769 - let rejectLoadPromise; 770 - const controlledPromise = new Promise((resolve, reject) => { 771 - resolveLoadPromise = resolve; 772 - rejectLoadPromise = reject; 773 - }); 774 - controlledPromise.status = "pending"; 775 - controlledPromise.resolve = (value) => { 776 - controlledPromise.status = "resolved"; 777 - controlledPromise.value = value; 778 - resolveLoadPromise(value); 779 - onResolve == null ? void 0 : onResolve(value); 780 - }; 781 - controlledPromise.reject = (e) => { 782 - controlledPromise.status = "rejected"; 783 - rejectLoadPromise(e); 784 - }; 785 - return controlledPromise; 786 - } 787 - function hasUriEncodedChars(inputString) { 788 - const pattern2 = /%[0-9A-Fa-f]{2}/; 789 - return pattern2.test(inputString); 790 - } 791 - function joinPaths(paths) { 792 - return cleanPath( 793 - paths.filter((val) => { 794 - return val !== void 0; 795 - }).join("/") 796 - ); 797 - } 798 - function cleanPath(path) { 799 - return path.replace(/\/{2,}/g, "/"); 800 - } 801 - function trimPathLeft(path) { 802 - return path === "/" ? path : path.replace(/^\/{1,}/, ""); 803 - } 804 - function trimPathRight(path) { 805 - return path === "/" ? path : path.replace(/\/{1,}$/, ""); 806 - } 807 - function trimPath(path) { 808 - return trimPathRight(trimPathLeft(path)); 809 - } 810 - function removeTrailingSlash(value, basepath) { 811 - if ((value == null ? void 0 : value.endsWith("/")) && value !== "/" && value !== `${basepath}/`) { 812 - return value.slice(0, -1); 813 - } 814 - return value; 815 - } 816 - function exactPathTest(pathName1, pathName2, basepath) { 817 - return removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath); 818 - } 819 - function resolvePath({ 820 - basepath, 821 - base, 822 - to, 823 - trailingSlash = "never", 824 - caseSensitive 825 - }) { 826 - var _a2, _b2; 827 - base = removeBasepath(basepath, base, caseSensitive); 828 - to = removeBasepath(basepath, to, caseSensitive); 829 - let baseSegments = parsePathname(base); 830 - const toSegments = parsePathname(to); 831 - if (baseSegments.length > 1 && ((_a2 = last(baseSegments)) == null ? void 0 : _a2.value) === "/") { 832 - baseSegments.pop(); 833 - } 834 - toSegments.forEach((toSegment, index2) => { 835 - if (toSegment.value === "/") { 836 - if (!index2) { 837 - baseSegments = [toSegment]; 838 - } else if (index2 === toSegments.length - 1) { 839 - baseSegments.push(toSegment); 840 - } else ; 841 - } else if (toSegment.value === "..") { 842 - baseSegments.pop(); 843 - } else if (toSegment.value === ".") ; 844 - else { 845 - baseSegments.push(toSegment); 846 - } 847 - }); 848 - if (baseSegments.length > 1) { 849 - if (((_b2 = last(baseSegments)) == null ? void 0 : _b2.value) === "/") { 850 - if (trailingSlash === "never") { 851 - baseSegments.pop(); 852 - } 853 - } else if (trailingSlash === "always") { 854 - baseSegments.push({ type: "pathname", value: "/" }); 855 - } 856 - } 857 - const segmentValues = baseSegments.map((segment) => { 858 - if (segment.type === "param") { 859 - const param = segment.value.substring(1); 860 - if (segment.prefixSegment && segment.suffixSegment) { 861 - return `${segment.prefixSegment}{$${param}}${segment.suffixSegment}`; 862 - } else if (segment.prefixSegment) { 863 - return `${segment.prefixSegment}{$${param}}`; 864 - } else if (segment.suffixSegment) { 865 - return `{$${param}}${segment.suffixSegment}`; 866 - } 867 - } 868 - if (segment.type === "wildcard") { 869 - if (segment.prefixSegment && segment.suffixSegment) { 870 - return `${segment.prefixSegment}{$}${segment.suffixSegment}`; 871 - } else if (segment.prefixSegment) { 872 - return `${segment.prefixSegment}{$}`; 873 - } else if (segment.suffixSegment) { 874 - return `{$}${segment.suffixSegment}`; 875 - } 876 - } 877 - return segment.value; 878 - }); 879 - const joined = joinPaths([basepath, ...segmentValues]); 880 - return cleanPath(joined); 881 - } 882 - const PARAM_RE = /^\$.{1,}$/; 883 - const PARAM_W_CURLY_BRACES_RE = /^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/; 884 - const WILDCARD_RE = /^\$$/; 885 - const WILDCARD_W_CURLY_BRACES_RE = /^(.*?)\{\$\}(.*)$/; 886 - function parsePathname(pathname) { 887 - if (!pathname) { 888 - return []; 889 - } 890 - pathname = cleanPath(pathname); 891 - const segments = []; 892 - if (pathname.slice(0, 1) === "/") { 893 - pathname = pathname.substring(1); 894 - segments.push({ 895 - type: "pathname", 896 - value: "/" 897 - }); 898 - } 899 - if (!pathname) { 900 - return segments; 901 - } 902 - const split = pathname.split("/").filter(Boolean); 903 - segments.push( 904 - ...split.map((part) => { 905 - const wildcardBracesMatch = part.match(WILDCARD_W_CURLY_BRACES_RE); 906 - if (wildcardBracesMatch) { 907 - const prefix2 = wildcardBracesMatch[1]; 908 - const suffix = wildcardBracesMatch[2]; 909 - return { 910 - type: "wildcard", 911 - value: "$", 912 - prefixSegment: prefix2 || void 0, 913 - suffixSegment: suffix || void 0 914 - }; 915 - } 916 - const paramBracesMatch = part.match(PARAM_W_CURLY_BRACES_RE); 917 - if (paramBracesMatch) { 918 - const prefix2 = paramBracesMatch[1]; 919 - const paramName = paramBracesMatch[2]; 920 - const suffix = paramBracesMatch[3]; 921 - return { 922 - type: "param", 923 - value: "" + paramName, 924 - prefixSegment: prefix2 || void 0, 925 - suffixSegment: suffix || void 0 926 - }; 927 - } 928 - if (PARAM_RE.test(part)) { 929 - const paramName = part.substring(1); 930 - return { 931 - type: "param", 932 - value: "$" + paramName, 933 - prefixSegment: void 0, 934 - suffixSegment: void 0 935 - }; 936 - } 937 - if (WILDCARD_RE.test(part)) { 938 - return { 939 - type: "wildcard", 940 - value: "$", 941 - prefixSegment: void 0, 942 - suffixSegment: void 0 943 - }; 944 - } 945 - return { 946 - type: "pathname", 947 - value: part.includes("%25") ? part.split("%25").map((segment) => decodeURI(segment)).join("%25") : decodeURI(part) 948 - }; 949 - }) 950 - ); 951 - if (pathname.slice(-1) === "/") { 952 - pathname = pathname.substring(1); 953 - segments.push({ 954 - type: "pathname", 955 - value: "/" 956 - }); 957 - } 958 - return segments; 959 - } 960 - function interpolatePath({ 961 - path, 962 - params, 963 - leaveWildcards, 964 - leaveParams, 965 - decodeCharMap 966 - }) { 967 - const interpolatedPathSegments = parsePathname(path); 968 - function encodeParam(key) { 969 - const value = params[key]; 970 - const isValueString = typeof value === "string"; 971 - if (["*", "_splat"].includes(key)) { 972 - return isValueString ? encodeURI(value) : value; 973 - } else { 974 - return isValueString ? encodePathParam(value, decodeCharMap) : value; 975 - } 976 - } 977 - let isMissingParams = false; 978 - const usedParams = {}; 979 - const interpolatedPath = joinPaths( 980 - interpolatedPathSegments.map((segment) => { 981 - if (segment.type === "wildcard") { 982 - usedParams._splat = params._splat; 983 - const segmentPrefix = segment.prefixSegment || ""; 984 - const segmentSuffix = segment.suffixSegment || ""; 985 - const value = encodeParam("_splat"); 986 - if (leaveWildcards) { 987 - return `${segmentPrefix}${segment.value}${value ?? ""}${segmentSuffix}`; 988 - } 989 - return `${segmentPrefix}${value}${segmentSuffix}`; 990 - } 991 - if (segment.type === "param") { 992 - const key = segment.value.substring(1); 993 - if (!isMissingParams && !(key in params)) { 994 - isMissingParams = true; 995 - } 996 - usedParams[key] = params[key]; 997 - const segmentPrefix = segment.prefixSegment || ""; 998 - const segmentSuffix = segment.suffixSegment || ""; 999 - if (leaveParams) { 1000 - const value = encodeParam(segment.value); 1001 - return `${segmentPrefix}${segment.value}${value ?? ""}${segmentSuffix}`; 1002 - } 1003 - return `${segmentPrefix}${encodeParam(key) ?? "undefined"}${segmentSuffix}`; 1004 - } 1005 - return segment.value; 1006 - }) 1007 - ); 1008 - return { usedParams, interpolatedPath, isMissingParams }; 1009 - } 1010 - function encodePathParam(value, decodeCharMap) { 1011 - let encoded = encodeURIComponent(value); 1012 - if (decodeCharMap) { 1013 - for (const [encodedChar, char] of decodeCharMap) { 1014 - encoded = encoded.replaceAll(encodedChar, char); 1015 - } 1016 - } 1017 - return encoded; 1018 - } 1019 - function matchPathname(basepath, currentPathname, matchLocation) { 1020 - const pathParams = matchByPath(basepath, currentPathname, matchLocation); 1021 - if (matchLocation.to && !pathParams) { 1022 - return; 1023 - } 1024 - return pathParams ?? {}; 1025 - } 1026 - function removeBasepath(basepath, pathname, caseSensitive = false) { 1027 - const normalizedBasepath = caseSensitive ? basepath : basepath.toLowerCase(); 1028 - const normalizedPathname = caseSensitive ? pathname : pathname.toLowerCase(); 1029 - switch (true) { 1030 - // default behaviour is to serve app from the root - pathname 1031 - // left untouched 1032 - case normalizedBasepath === "/": 1033 - return pathname; 1034 - // shortcut for removing the basepath if it matches the pathname 1035 - case normalizedPathname === normalizedBasepath: 1036 - return ""; 1037 - // in case pathname is shorter than basepath - there is 1038 - // nothing to remove 1039 - case pathname.length < basepath.length: 1040 - return pathname; 1041 - // avoid matching partial segments - strict equality handled 1042 - // earlier, otherwise, basepath separated from pathname with 1043 - // separator, therefore lack of separator means partial 1044 - // segment match (`/app` should not match `/application`) 1045 - case normalizedPathname[normalizedBasepath.length] !== "/": 1046 - return pathname; 1047 - // remove the basepath from the pathname if it starts with it 1048 - case normalizedPathname.startsWith(normalizedBasepath): 1049 - return pathname.slice(basepath.length); 1050 - // otherwise, return the pathname as is 1051 - default: 1052 - return pathname; 1053 - } 1054 - } 1055 - function matchByPath(basepath, from, matchLocation) { 1056 - if (basepath !== "/" && !from.startsWith(basepath)) { 1057 - return void 0; 1058 - } 1059 - from = removeBasepath(basepath, from, matchLocation.caseSensitive); 1060 - const to = removeBasepath( 1061 - basepath, 1062 - `${matchLocation.to ?? "$"}`, 1063 - matchLocation.caseSensitive 1064 - ); 1065 - const baseSegments = parsePathname(from); 1066 - const routeSegments = parsePathname(to); 1067 - if (!from.startsWith("/")) { 1068 - baseSegments.unshift({ 1069 - type: "pathname", 1070 - value: "/" 1071 - }); 1072 - } 1073 - if (!to.startsWith("/")) { 1074 - routeSegments.unshift({ 1075 - type: "pathname", 1076 - value: "/" 1077 - }); 1078 - } 1079 - const params = {}; 1080 - const isMatch = (() => { 1081 - var _a2; 1082 - for (let i = 0; i < Math.max(baseSegments.length, routeSegments.length); i++) { 1083 - const baseSegment = baseSegments[i]; 1084 - const routeSegment = routeSegments[i]; 1085 - const isLastBaseSegment = i >= baseSegments.length - 1; 1086 - const isLastRouteSegment = i >= routeSegments.length - 1; 1087 - if (routeSegment) { 1088 - if (routeSegment.type === "wildcard") { 1089 - const remainingBaseSegments = baseSegments.slice(i); 1090 - let _splat; 1091 - if (routeSegment.prefixSegment || routeSegment.suffixSegment) { 1092 - if (!baseSegment) return false; 1093 - const prefix2 = routeSegment.prefixSegment || ""; 1094 - const suffix = routeSegment.suffixSegment || ""; 1095 - const baseValue = baseSegment.value; 1096 - if ("prefixSegment" in routeSegment) { 1097 - if (!baseValue.startsWith(prefix2)) { 1098 - return false; 1099 - } 1100 - } 1101 - if ("suffixSegment" in routeSegment) { 1102 - if (!((_a2 = baseSegments[baseSegments.length - 1]) == null ? void 0 : _a2.value.endsWith(suffix))) { 1103 - return false; 1104 - } 1105 - } 1106 - let rejoinedSplat = decodeURI( 1107 - joinPaths(remainingBaseSegments.map((d) => d.value)) 1108 - ); 1109 - if (prefix2 && rejoinedSplat.startsWith(prefix2)) { 1110 - rejoinedSplat = rejoinedSplat.slice(prefix2.length); 1111 - } 1112 - if (suffix && rejoinedSplat.endsWith(suffix)) { 1113 - rejoinedSplat = rejoinedSplat.slice( 1114 - 0, 1115 - rejoinedSplat.length - suffix.length 1116 - ); 1117 - } 1118 - _splat = rejoinedSplat; 1119 - } else { 1120 - _splat = decodeURI( 1121 - joinPaths(remainingBaseSegments.map((d) => d.value)) 1122 - ); 1123 - } 1124 - params["*"] = _splat; 1125 - params["_splat"] = _splat; 1126 - return true; 1127 - } 1128 - if (routeSegment.type === "pathname") { 1129 - if (routeSegment.value === "/" && !(baseSegment == null ? void 0 : baseSegment.value)) { 1130 - return true; 1131 - } 1132 - if (baseSegment) { 1133 - if (matchLocation.caseSensitive) { 1134 - if (routeSegment.value !== baseSegment.value) { 1135 - return false; 1136 - } 1137 - } else if (routeSegment.value.toLowerCase() !== baseSegment.value.toLowerCase()) { 1138 - return false; 1139 - } 1140 - } 1141 - } 1142 - if (!baseSegment) { 1143 - return false; 1144 - } 1145 - if (routeSegment.type === "param") { 1146 - if (baseSegment.value === "/") { 1147 - return false; 1148 - } 1149 - let _paramValue; 1150 - if (routeSegment.prefixSegment || routeSegment.suffixSegment) { 1151 - const prefix2 = routeSegment.prefixSegment || ""; 1152 - const suffix = routeSegment.suffixSegment || ""; 1153 - const baseValue = baseSegment.value; 1154 - if (prefix2 && !baseValue.startsWith(prefix2)) { 1155 - return false; 1156 - } 1157 - if (suffix && !baseValue.endsWith(suffix)) { 1158 - return false; 1159 - } 1160 - let paramValue = baseValue; 1161 - if (prefix2 && paramValue.startsWith(prefix2)) { 1162 - paramValue = paramValue.slice(prefix2.length); 1163 - } 1164 - if (suffix && paramValue.endsWith(suffix)) { 1165 - paramValue = paramValue.slice( 1166 - 0, 1167 - paramValue.length - suffix.length 1168 - ); 1169 - } 1170 - _paramValue = decodeURIComponent(paramValue); 1171 - } else { 1172 - _paramValue = decodeURIComponent(baseSegment.value); 1173 - } 1174 - params[routeSegment.value.substring(1)] = _paramValue; 1175 - } 1176 - } 1177 - if (!isLastBaseSegment && isLastRouteSegment) { 1178 - params["**"] = joinPaths(baseSegments.slice(i + 1).map((d) => d.value)); 1179 - return !!matchLocation.fuzzy && (routeSegment == null ? void 0 : routeSegment.value) !== "/"; 1180 - } 1181 - } 1182 - return true; 1183 - })(); 1184 - return isMatch ? params : void 0; 1185 - } 1186 - function isNotFound(obj) { 1187 - return !!(obj == null ? void 0 : obj.isNotFound); 1188 - } 1189 - function getSafeSessionStorage() { 1190 - try { 1191 - if ("undefined" !== "undefined" && typeof window.sessionStorage === "object") ; 1192 - } catch { 1193 - return void 0; 1194 - } 1195 - return void 0; 1196 - } 1197 - const storageKey = "tsr-scroll-restoration-v1_3"; 1198 - const throttle = (fn, wait) => { 1199 - let timeout; 1200 - return (...args) => { 1201 - if (!timeout) { 1202 - timeout = setTimeout(() => { 1203 - fn(...args); 1204 - timeout = null; 1205 - }, wait); 1206 - } 1207 - }; 1208 - }; 1209 - function createScrollRestorationCache() { 1210 - const safeSessionStorage = getSafeSessionStorage(); 1211 - if (!safeSessionStorage) { 1212 - return void 0; 1213 - } 1214 - const persistedState = safeSessionStorage.getItem(storageKey); 1215 - let state = persistedState ? JSON.parse(persistedState) : {}; 1216 - return { 1217 - state, 1218 - // This setter is simply to make sure that we set the sessionStorage right 1219 - // after the state is updated. It doesn't necessarily need to be a functional 1220 - // update. 1221 - set: (updater) => (state = functionalUpdate$1(updater, state) || state, safeSessionStorage.setItem(storageKey, JSON.stringify(state))) 1222 - }; 1223 - } 1224 - const scrollRestorationCache = createScrollRestorationCache(); 1225 - const defaultGetScrollRestorationKey = (location) => { 1226 - return location.state.key || location.href; 1227 - }; 1228 - function getCssSelector(el) { 1229 - const path = []; 1230 - let parent; 1231 - while (parent = el.parentNode) { 1232 - path.unshift( 1233 - `${el.tagName}:nth-child(${[].indexOf.call(parent.children, el) + 1})` 1234 - ); 1235 - el = parent; 1236 - } 1237 - return `${path.join(" > ")}`.toLowerCase(); 1238 - } 1239 - let ignoreScroll = false; 1240 - function restoreScroll(storageKey2, key, behavior, shouldScrollRestoration, scrollToTopSelectors) { 1241 - var _a2; 1242 - let byKey; 1243 - try { 1244 - byKey = JSON.parse(sessionStorage.getItem(storageKey2) || "{}"); 1245 - } catch (error) { 1246 - console.error(error); 1247 - return; 1248 - } 1249 - const resolvedKey = key || ((_a2 = window.history.state) == null ? void 0 : _a2.key); 1250 - const elementEntries = byKey[resolvedKey]; 1251 - ignoreScroll = true; 1252 - (() => { 1253 - if (shouldScrollRestoration && elementEntries) { 1254 - for (const elementSelector in elementEntries) { 1255 - const entry = elementEntries[elementSelector]; 1256 - if (elementSelector === "window") { 1257 - window.scrollTo({ 1258 - top: entry.scrollY, 1259 - left: entry.scrollX, 1260 - behavior 1261 - }); 1262 - } else if (elementSelector) { 1263 - const element = document.querySelector(elementSelector); 1264 - if (element) { 1265 - element.scrollLeft = entry.scrollX; 1266 - element.scrollTop = entry.scrollY; 1267 - } 1268 - } 1269 - } 1270 - return; 1271 - } 1272 - const hash = window.location.hash.split("#")[1]; 1273 - if (hash) { 1274 - const hashScrollIntoViewOptions = (window.history.state || {}).__hashScrollIntoViewOptions ?? true; 1275 - if (hashScrollIntoViewOptions) { 1276 - const el = document.getElementById(hash); 1277 - if (el) { 1278 - el.scrollIntoView(hashScrollIntoViewOptions); 1279 - } 1280 - } 1281 - return; 1282 - } 1283 - [ 1284 - "window", 1285 - ...(scrollToTopSelectors == null ? void 0 : scrollToTopSelectors.filter((d) => d !== "window")) ?? [] 1286 - ].forEach((selector) => { 1287 - const element = selector === "window" ? window : document.querySelector(selector); 1288 - if (element) { 1289 - element.scrollTo({ 1290 - top: 0, 1291 - left: 0, 1292 - behavior 1293 - }); 1294 - } 1295 - }); 1296 - })(); 1297 - ignoreScroll = false; 1298 - } 1299 - function setupScrollRestoration(router, force) { 1300 - if (scrollRestorationCache === void 0) { 1301 - return; 1302 - } 1303 - const shouldScrollRestoration = router.options.scrollRestoration ?? false; 1304 - if (shouldScrollRestoration) { 1305 - router.isScrollRestoring = true; 1306 - } 1307 - if (typeof document === "undefined" || router.isScrollRestorationSetup) { 1308 - return; 1309 - } 1310 - router.isScrollRestorationSetup = true; 1311 - ignoreScroll = false; 1312 - const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey; 1313 - window.history.scrollRestoration = "manual"; 1314 - const onScroll = (event) => { 1315 - if (ignoreScroll || !router.isScrollRestoring) { 1316 - return; 1317 - } 1318 - let elementSelector = ""; 1319 - if (event.target === document || event.target === window) { 1320 - elementSelector = "window"; 1321 - } else { 1322 - const attrId = event.target.getAttribute( 1323 - "data-scroll-restoration-id" 1324 - ); 1325 - if (attrId) { 1326 - elementSelector = `[data-scroll-restoration-id="${attrId}"]`; 1327 - } else { 1328 - elementSelector = getCssSelector(event.target); 1329 - } 1330 - } 1331 - const restoreKey = getKey(router.state.location); 1332 - scrollRestorationCache.set((state) => { 1333 - const keyEntry = state[restoreKey] = state[restoreKey] || {}; 1334 - const elementEntry = keyEntry[elementSelector] = keyEntry[elementSelector] || {}; 1335 - if (elementSelector === "window") { 1336 - elementEntry.scrollX = window.scrollX || 0; 1337 - elementEntry.scrollY = window.scrollY || 0; 1338 - } else if (elementSelector) { 1339 - const element = document.querySelector(elementSelector); 1340 - if (element) { 1341 - elementEntry.scrollX = element.scrollLeft || 0; 1342 - elementEntry.scrollY = element.scrollTop || 0; 1343 - } 1344 - } 1345 - return state; 1346 - }); 1347 - }; 1348 - if (typeof document !== "undefined") { 1349 - document.addEventListener("scroll", throttle(onScroll, 100), true); 1350 - } 1351 - router.subscribe("onRendered", (event) => { 1352 - const cacheKey = getKey(event.toLocation); 1353 - if (!router.resetNextScroll) { 1354 - router.resetNextScroll = true; 1355 - return; 1356 - } 1357 - restoreScroll( 1358 - storageKey, 1359 - cacheKey, 1360 - router.options.scrollRestorationBehavior || void 0, 1361 - router.isScrollRestoring || void 0, 1362 - router.options.scrollToTopSelectors || void 0 1363 - ); 1364 - if (router.isScrollRestoring) { 1365 - scrollRestorationCache.set((state) => { 1366 - state[cacheKey] = state[cacheKey] || {}; 1367 - return state; 1368 - }); 1369 - } 1370 - }); 1371 - } 1372 - function handleHashScroll(router) { 1373 - if (typeof document !== "undefined" && document.querySelector) { 1374 - const hashScrollIntoViewOptions = router.state.location.state.__hashScrollIntoViewOptions ?? true; 1375 - if (hashScrollIntoViewOptions && router.state.location.hash !== "") { 1376 - const el = document.getElementById(router.state.location.hash); 1377 - if (el) { 1378 - el.scrollIntoView(hashScrollIntoViewOptions); 1379 - } 1380 - } 1381 - } 1382 - } 1383 - function encode(obj, pfx) { 1384 - const normalizedObject = Object.entries(obj).flatMap(([key, value]) => { 1385 - if (Array.isArray(value)) { 1386 - return value.map((v2) => [key, String(v2)]); 1387 - } else { 1388 - return [[key, String(value)]]; 1389 - } 1390 - }); 1391 - const searchParams = new URLSearchParams(normalizedObject); 1392 - return "" + searchParams.toString(); 1393 - } 1394 - function toValue(mix) { 1395 - if (!mix) return ""; 1396 - const str = hasUriEncodedChars(mix) ? decodeURIComponent(mix) : decodeURIComponent(encodeURIComponent(mix)); 1397 - if (str === "false") return false; 1398 - if (str === "true") return true; 1399 - return +str * 0 === 0 && +str + "" === str ? +str : str; 1400 - } 1401 - function decode(str, pfx) { 1402 - const searchParamsPart = str; 1403 - const searchParams = new URLSearchParams(searchParamsPart); 1404 - const entries = [...searchParams.entries()]; 1405 - return entries.reduce((acc, [key, value]) => { 1406 - const previousValue = acc[key]; 1407 - if (previousValue == null) { 1408 - acc[key] = toValue(value); 1409 - } else { 1410 - acc[key] = Array.isArray(previousValue) ? [...previousValue, toValue(value)] : [previousValue, toValue(value)]; 1411 - } 1412 - return acc; 1413 - }, {}); 1414 - } 1415 - const defaultParseSearch = parseSearchWith(JSON.parse); 1416 - const defaultStringifySearch = stringifySearchWith( 1417 - JSON.stringify, 1418 - JSON.parse 1419 - ); 1420 - function parseSearchWith(parser) { 1421 - return (searchStr) => { 1422 - if (searchStr.substring(0, 1) === "?") { 1423 - searchStr = searchStr.substring(1); 1424 - } 1425 - const query = decode(searchStr); 1426 - for (const key in query) { 1427 - const value = query[key]; 1428 - if (typeof value === "string") { 1429 - try { 1430 - query[key] = parser(value); 1431 - } catch (err) { 1432 - } 1433 - } 1434 - } 1435 - return query; 1436 - }; 1437 - } 1438 - function stringifySearchWith(stringify2, parser) { 1439 - function stringifyValue(val) { 1440 - if (typeof val === "object" && val !== null) { 1441 - try { 1442 - return stringify2(val); 1443 - } catch (err) { 1444 - } 1445 - } else if (typeof val === "string" && typeof parser === "function") { 1446 - try { 1447 - parser(val); 1448 - return stringify2(val); 1449 - } catch (err) { 1450 - } 1451 - } 1452 - return val; 1453 - } 1454 - return (search) => { 1455 - search = { ...search }; 1456 - Object.keys(search).forEach((key) => { 1457 - const val = search[key]; 1458 - if (typeof val === "undefined" || val === void 0) { 1459 - delete search[key]; 1460 - } else { 1461 - search[key] = stringifyValue(val); 1462 - } 1463 - }); 1464 - const searchStr = encode(search).toString(); 1465 - return searchStr ? `?${searchStr}` : ""; 1466 - }; 1467 - } 1468 - const rootRouteId = "__root__"; 1469 - function isRedirect(obj) { 1470 - return obj instanceof Response && !!obj.options; 1471 - } 1472 - function isResolvedRedirect(obj) { 1473 - return isRedirect(obj) && !!obj.options.href; 1474 - } 1475 - function defaultSerializeError(err) { 1476 - if (err instanceof Error) { 1477 - const obj = { 1478 - name: err.name, 1479 - message: err.message 1480 - }; 1481 - return obj; 1482 - } 1483 - return { 1484 - data: err 1485 - }; 1486 - } 1487 - function getLocationChangeInfo(routerState) { 1488 - const fromLocation = routerState.resolvedLocation; 1489 - const toLocation = routerState.location; 1490 - const pathChanged = (fromLocation == null ? void 0 : fromLocation.pathname) !== toLocation.pathname; 1491 - const hrefChanged = (fromLocation == null ? void 0 : fromLocation.href) !== toLocation.href; 1492 - const hashChanged = (fromLocation == null ? void 0 : fromLocation.hash) !== toLocation.hash; 1493 - return { fromLocation, toLocation, pathChanged, hrefChanged, hashChanged }; 1494 - } 1495 - class RouterCore { 1496 - /** 1497 - * @deprecated Use the `createRouter` function instead 1498 - */ 1499 - constructor(options) { 1500 - this.tempLocationKey = `${Math.round( 1501 - Math.random() * 1e7 1502 - )}`; 1503 - this.resetNextScroll = true; 1504 - this.shouldViewTransition = void 0; 1505 - this.isViewTransitionTypesSupported = void 0; 1506 - this.subscribers = /* @__PURE__ */ new Set(); 1507 - this.isScrollRestoring = false; 1508 - this.isScrollRestorationSetup = false; 1509 - this.startTransition = (fn) => fn(); 1510 - this.isShell = false; 1511 - this.update = (newOptions) => { 1512 - if (newOptions.notFoundRoute) { 1513 - console.warn( 1514 - "The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info." 1515 - ); 1516 - } 1517 - const previousOptions = this.options; 1518 - this.options = { 1519 - ...this.options, 1520 - ...newOptions 1521 - }; 1522 - this.isServer = this.options.isServer ?? typeof document === "undefined"; 1523 - this.pathParamsDecodeCharMap = this.options.pathParamsAllowedCharacters ? new Map( 1524 - this.options.pathParamsAllowedCharacters.map((char) => [ 1525 - encodeURIComponent(char), 1526 - char 1527 - ]) 1528 - ) : void 0; 1529 - if (!this.basepath || newOptions.basepath && newOptions.basepath !== previousOptions.basepath) { 1530 - if (newOptions.basepath === void 0 || newOptions.basepath === "" || newOptions.basepath === "/") { 1531 - this.basepath = "/"; 1532 - } else { 1533 - this.basepath = `/${trimPath(newOptions.basepath)}`; 1534 - } 1535 - } 1536 - if (!this.history || this.options.history && this.options.history !== this.history) { 1537 - this.history = this.options.history ?? (this.isServer ? createMemoryHistory({ 1538 - initialEntries: [this.basepath || "/"] 1539 - }) : createBrowserHistory()); 1540 - this.latestLocation = this.parseLocation(); 1541 - } 1542 - if (this.options.routeTree !== this.routeTree) { 1543 - this.routeTree = this.options.routeTree; 1544 - this.buildRouteTree(); 1545 - } 1546 - if (!this.__store) { 1547 - this.__store = new Store(getInitialRouterState(this.latestLocation), { 1548 - onUpdate: () => { 1549 - this.__store.state = { 1550 - ...this.state, 1551 - cachedMatches: this.state.cachedMatches.filter( 1552 - (d) => !["redirected"].includes(d.status) 1553 - ) 1554 - }; 1555 - } 1556 - }); 1557 - setupScrollRestoration(this); 1558 - } 1559 - if (this.latestLocation.search.__TSS_SHELL) { 1560 - this.isShell = true; 1561 - } 1562 - }; 1563 - this.buildRouteTree = () => { 1564 - const { routesById, routesByPath, flatRoutes } = processRouteTree({ 1565 - routeTree: this.routeTree, 1566 - initRoute: (route, i) => { 1567 - route.init({ 1568 - originalIndex: i, 1569 - defaultSsr: this.options.defaultSsr 1570 - }); 1571 - } 1572 - }); 1573 - this.routesById = routesById; 1574 - this.routesByPath = routesByPath; 1575 - this.flatRoutes = flatRoutes; 1576 - const notFoundRoute = this.options.notFoundRoute; 1577 - if (notFoundRoute) { 1578 - notFoundRoute.init({ 1579 - originalIndex: 99999999999, 1580 - defaultSsr: this.options.defaultSsr 1581 - }); 1582 - this.routesById[notFoundRoute.id] = notFoundRoute; 1583 - } 1584 - }; 1585 - this.subscribe = (eventType, fn) => { 1586 - const listener = { 1587 - eventType, 1588 - fn 1589 - }; 1590 - this.subscribers.add(listener); 1591 - return () => { 1592 - this.subscribers.delete(listener); 1593 - }; 1594 - }; 1595 - this.emit = (routerEvent) => { 1596 - this.subscribers.forEach((listener) => { 1597 - if (listener.eventType === routerEvent.type) { 1598 - listener.fn(routerEvent); 1599 - } 1600 - }); 1601 - }; 1602 - this.parseLocation = (previousLocation, locationToParse) => { 1603 - const parse = ({ 1604 - pathname, 1605 - search, 1606 - hash, 1607 - state 1608 - }) => { 1609 - const parsedSearch = this.options.parseSearch(search); 1610 - const searchStr = this.options.stringifySearch(parsedSearch); 1611 - return { 1612 - pathname, 1613 - searchStr, 1614 - search: replaceEqualDeep$1(previousLocation == null ? void 0 : previousLocation.search, parsedSearch), 1615 - hash: hash.split("#").reverse()[0] ?? "", 1616 - href: `${pathname}${searchStr}${hash}`, 1617 - state: replaceEqualDeep$1(previousLocation == null ? void 0 : previousLocation.state, state) 1618 - }; 1619 - }; 1620 - const location = parse(locationToParse ?? this.history.location); 1621 - const { __tempLocation, __tempKey } = location.state; 1622 - if (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) { 1623 - const parsedTempLocation = parse(__tempLocation); 1624 - parsedTempLocation.state.key = location.state.key; 1625 - delete parsedTempLocation.state.__tempLocation; 1626 - return { 1627 - ...parsedTempLocation, 1628 - maskedLocation: location 1629 - }; 1630 - } 1631 - return location; 1632 - }; 1633 - this.resolvePathWithBase = (from, path) => { 1634 - const resolvedPath = resolvePath({ 1635 - basepath: this.basepath, 1636 - base: from, 1637 - to: cleanPath(path), 1638 - trailingSlash: this.options.trailingSlash, 1639 - caseSensitive: this.options.caseSensitive 1640 - }); 1641 - return resolvedPath; 1642 - }; 1643 - this.matchRoutes = (pathnameOrNext, locationSearchOrOpts, opts) => { 1644 - if (typeof pathnameOrNext === "string") { 1645 - return this.matchRoutesInternal( 1646 - { 1647 - pathname: pathnameOrNext, 1648 - search: locationSearchOrOpts 1649 - }, 1650 - opts 1651 - ); 1652 - } 1653 - return this.matchRoutesInternal(pathnameOrNext, locationSearchOrOpts); 1654 - }; 1655 - this.getMatchedRoutes = (pathname, routePathname) => { 1656 - return getMatchedRoutes({ 1657 - pathname, 1658 - routePathname, 1659 - basepath: this.basepath, 1660 - caseSensitive: this.options.caseSensitive, 1661 - routesByPath: this.routesByPath, 1662 - routesById: this.routesById, 1663 - flatRoutes: this.flatRoutes 1664 - }); 1665 - }; 1666 - this.cancelMatch = (id) => { 1667 - const match = this.getMatch(id); 1668 - if (!match) return; 1669 - match.abortController.abort(); 1670 - clearTimeout(match.pendingTimeout); 1671 - }; 1672 - this.cancelMatches = () => { 1673 - var _a2; 1674 - (_a2 = this.state.pendingMatches) == null ? void 0 : _a2.forEach((match) => { 1675 - this.cancelMatch(match.id); 1676 - }); 1677 - }; 1678 - this.buildLocation = (opts) => { 1679 - const build = (dest = {}) => { 1680 - var _a2; 1681 - const currentLocation = dest._fromLocation || this.latestLocation; 1682 - const allFromMatches = this.matchRoutes(currentLocation, { 1683 - _buildLocation: true 1684 - }); 1685 - const lastMatch = last(allFromMatches); 1686 - let fromPath = lastMatch.fullPath; 1687 - if (dest.unsafeRelative === "path") { 1688 - fromPath = currentLocation.pathname; 1689 - } else if (dest.to && dest.from) { 1690 - fromPath = dest.from; 1691 - const existingFrom = [...allFromMatches].reverse().find((d) => { 1692 - return d.fullPath === fromPath || d.fullPath === joinPaths([fromPath, "/"]); 1693 - }); 1694 - if (!existingFrom) { 1695 - console.warn(`Could not find match for from: ${dest.from}`); 1696 - } 1697 - } 1698 - const fromSearch = lastMatch.search; 1699 - const fromParams = { ...lastMatch.params }; 1700 - const nextTo = dest.to ? this.resolvePathWithBase(fromPath, `${dest.to}`) : fromPath; 1701 - let nextParams = (dest.params ?? true) === true ? fromParams : { 1702 - ...fromParams, 1703 - ...functionalUpdate$1(dest.params, fromParams) 1704 - }; 1705 - const destRoutes = this.matchRoutes( 1706 - nextTo, 1707 - {}, 1708 - { 1709 - _buildLocation: true 1710 - } 1711 - ).map((d) => this.looseRoutesById[d.routeId]); 1712 - if (Object.keys(nextParams).length > 0) { 1713 - destRoutes.map((route) => { 1714 - var _a22; 1715 - return ((_a22 = route.options.params) == null ? void 0 : _a22.stringify) ?? route.options.stringifyParams; 1716 - }).filter(Boolean).forEach((fn) => { 1717 - nextParams = { ...nextParams, ...fn(nextParams) }; 1718 - }); 1719 - } 1720 - const nextPathname = interpolatePath({ 1721 - path: nextTo, 1722 - params: nextParams ?? {}, 1723 - leaveWildcards: false, 1724 - leaveParams: opts.leaveParams, 1725 - decodeCharMap: this.pathParamsDecodeCharMap 1726 - }).interpolatedPath; 1727 - let nextSearch = fromSearch; 1728 - if (opts._includeValidateSearch && ((_a2 = this.options.search) == null ? void 0 : _a2.strict)) { 1729 - let validatedSearch = {}; 1730 - destRoutes.forEach((route) => { 1731 - try { 1732 - if (route.options.validateSearch) { 1733 - validatedSearch = { 1734 - ...validatedSearch, 1735 - ...validateSearch(route.options.validateSearch, { 1736 - ...validatedSearch, 1737 - ...nextSearch 1738 - }) ?? {} 1739 - }; 1740 - } 1741 - } catch { 1742 - } 1743 - }); 1744 - nextSearch = validatedSearch; 1745 - } 1746 - nextSearch = applySearchMiddleware({ 1747 - search: nextSearch, 1748 - dest, 1749 - destRoutes, 1750 - _includeValidateSearch: opts._includeValidateSearch 1751 - }); 1752 - nextSearch = replaceEqualDeep$1(fromSearch, nextSearch); 1753 - const searchStr = this.options.stringifySearch(nextSearch); 1754 - const hash = dest.hash === true ? currentLocation.hash : dest.hash ? functionalUpdate$1(dest.hash, currentLocation.hash) : void 0; 1755 - const hashStr = hash ? `#${hash}` : ""; 1756 - let nextState = dest.state === true ? currentLocation.state : dest.state ? functionalUpdate$1(dest.state, currentLocation.state) : {}; 1757 - nextState = replaceEqualDeep$1(currentLocation.state, nextState); 1758 - return { 1759 - pathname: nextPathname, 1760 - search: nextSearch, 1761 - searchStr, 1762 - state: nextState, 1763 - hash: hash ?? "", 1764 - href: `${nextPathname}${searchStr}${hashStr}`, 1765 - unmaskOnReload: dest.unmaskOnReload 1766 - }; 1767 - }; 1768 - const buildWithMatches = (dest = {}, maskedDest) => { 1769 - var _a2; 1770 - const next = build(dest); 1771 - let maskedNext = maskedDest ? build(maskedDest) : void 0; 1772 - if (!maskedNext) { 1773 - let params = {}; 1774 - const foundMask = (_a2 = this.options.routeMasks) == null ? void 0 : _a2.find((d) => { 1775 - const match = matchPathname(this.basepath, next.pathname, { 1776 - to: d.from, 1777 - caseSensitive: false, 1778 - fuzzy: false 1779 - }); 1780 - if (match) { 1781 - params = match; 1782 - return true; 1783 - } 1784 - return false; 1785 - }); 1786 - if (foundMask) { 1787 - const { from: _from, ...maskProps } = foundMask; 1788 - maskedDest = { 1789 - ...pick(opts, ["from"]), 1790 - ...maskProps, 1791 - params 1792 - }; 1793 - maskedNext = build(maskedDest); 1794 - } 1795 - } 1796 - if (maskedNext) { 1797 - const maskedFinal = build(maskedDest); 1798 - next.maskedLocation = maskedFinal; 1799 - } 1800 - return next; 1801 - }; 1802 - if (opts.mask) { 1803 - return buildWithMatches(opts, { 1804 - ...pick(opts, ["from"]), 1805 - ...opts.mask 1806 - }); 1807 - } 1808 - return buildWithMatches(opts); 1809 - }; 1810 - this.commitLocation = ({ 1811 - viewTransition, 1812 - ignoreBlocker, 1813 - ...next 1814 - }) => { 1815 - const isSameState = () => { 1816 - const ignoredProps = [ 1817 - "key", 1818 - "__TSR_index", 1819 - "__hashScrollIntoViewOptions" 1820 - ]; 1821 - ignoredProps.forEach((prop) => { 1822 - next.state[prop] = this.latestLocation.state[prop]; 1823 - }); 1824 - const isEqual = deepEqual(next.state, this.latestLocation.state); 1825 - ignoredProps.forEach((prop) => { 1826 - delete next.state[prop]; 1827 - }); 1828 - return isEqual; 1829 - }; 1830 - const isSameUrl = this.latestLocation.href === next.href; 1831 - const previousCommitPromise = this.commitLocationPromise; 1832 - this.commitLocationPromise = createControlledPromise(() => { 1833 - previousCommitPromise == null ? void 0 : previousCommitPromise.resolve(); 1834 - }); 1835 - if (isSameUrl && isSameState()) { 1836 - this.load(); 1837 - } else { 1838 - let { maskedLocation, hashScrollIntoView, ...nextHistory } = next; 1839 - if (maskedLocation) { 1840 - nextHistory = { 1841 - ...maskedLocation, 1842 - state: { 1843 - ...maskedLocation.state, 1844 - __tempKey: void 0, 1845 - __tempLocation: { 1846 - ...nextHistory, 1847 - search: nextHistory.searchStr, 1848 - state: { 1849 - ...nextHistory.state, 1850 - __tempKey: void 0, 1851 - __tempLocation: void 0, 1852 - key: void 0 1853 - } 1854 - } 1855 - } 1856 - }; 1857 - if (nextHistory.unmaskOnReload ?? this.options.unmaskOnReload ?? false) { 1858 - nextHistory.state.__tempKey = this.tempLocationKey; 1859 - } 1860 - } 1861 - nextHistory.state.__hashScrollIntoViewOptions = hashScrollIntoView ?? this.options.defaultHashScrollIntoView ?? true; 1862 - this.shouldViewTransition = viewTransition; 1863 - this.history[next.replace ? "replace" : "push"]( 1864 - nextHistory.href, 1865 - nextHistory.state, 1866 - { ignoreBlocker } 1867 - ); 1868 - } 1869 - this.resetNextScroll = next.resetScroll ?? true; 1870 - if (!this.history.subscribers.size) { 1871 - this.load(); 1872 - } 1873 - return this.commitLocationPromise; 1874 - }; 1875 - this.buildAndCommitLocation = ({ 1876 - replace, 1877 - resetScroll, 1878 - hashScrollIntoView, 1879 - viewTransition, 1880 - ignoreBlocker, 1881 - href, 1882 - ...rest 1883 - } = {}) => { 1884 - if (href) { 1885 - const currentIndex = this.history.location.state.__TSR_index; 1886 - const parsed = parseHref(href, { 1887 - __TSR_index: replace ? currentIndex : currentIndex + 1 1888 - }); 1889 - rest.to = parsed.pathname; 1890 - rest.search = this.options.parseSearch(parsed.search); 1891 - rest.hash = parsed.hash.slice(1); 1892 - } 1893 - const location = this.buildLocation({ 1894 - ...rest, 1895 - _includeValidateSearch: true 1896 - }); 1897 - return this.commitLocation({ 1898 - ...location, 1899 - viewTransition, 1900 - replace, 1901 - resetScroll, 1902 - hashScrollIntoView, 1903 - ignoreBlocker 1904 - }); 1905 - }; 1906 - this.navigate = ({ to, reloadDocument, href, ...rest }) => { 1907 - if (!reloadDocument && href) { 1908 - try { 1909 - new URL(`${href}`); 1910 - reloadDocument = true; 1911 - } catch { 1912 - } 1913 - } 1914 - if (reloadDocument) { 1915 - if (!href) { 1916 - const location = this.buildLocation({ to, ...rest }); 1917 - href = this.history.createHref(location.href); 1918 - } 1919 - if (rest.replace) { 1920 - window.location.replace(href); 1921 - } else { 1922 - window.location.href = href; 1923 - } 1924 - return; 1925 - } 1926 - return this.buildAndCommitLocation({ 1927 - ...rest, 1928 - href, 1929 - to 1930 - }); 1931 - }; 1932 - this.beforeLoad = () => { 1933 - this.cancelMatches(); 1934 - this.latestLocation = this.parseLocation(this.latestLocation); 1935 - const pendingMatches = this.matchRoutes(this.latestLocation); 1936 - this.__store.setState((s) => ({ 1937 - ...s, 1938 - status: "pending", 1939 - isLoading: true, 1940 - location: this.latestLocation, 1941 - pendingMatches, 1942 - // If a cached moved to pendingMatches, remove it from cachedMatches 1943 - cachedMatches: s.cachedMatches.filter((d) => { 1944 - return !pendingMatches.find((e) => e.id === d.id); 1945 - }) 1946 - })); 1947 - }; 1948 - this.load = async (opts) => { 1949 - let redirect; 1950 - let notFound; 1951 - let loadPromise; 1952 - loadPromise = new Promise((resolve) => { 1953 - this.startTransition(async () => { 1954 - var _a2; 1955 - try { 1956 - this.beforeLoad(); 1957 - const next = this.latestLocation; 1958 - const prevLocation = this.state.resolvedLocation; 1959 - if (!this.state.redirect) { 1960 - this.emit({ 1961 - type: "onBeforeNavigate", 1962 - ...getLocationChangeInfo({ 1963 - resolvedLocation: prevLocation, 1964 - location: next 1965 - }) 1966 - }); 1967 - } 1968 - this.emit({ 1969 - type: "onBeforeLoad", 1970 - ...getLocationChangeInfo({ 1971 - resolvedLocation: prevLocation, 1972 - location: next 1973 - }) 1974 - }); 1975 - await this.loadMatches({ 1976 - sync: opts == null ? void 0 : opts.sync, 1977 - matches: this.state.pendingMatches, 1978 - location: next, 1979 - // eslint-disable-next-line @typescript-eslint/require-await 1980 - onReady: async () => { 1981 - this.startViewTransition(async () => { 1982 - let exitingMatches; 1983 - let enteringMatches; 1984 - let stayingMatches; 1985 - batch$1(() => { 1986 - this.__store.setState((s) => { 1987 - const previousMatches = s.matches; 1988 - const newMatches = s.pendingMatches || s.matches; 1989 - exitingMatches = previousMatches.filter( 1990 - (match) => !newMatches.find((d) => d.id === match.id) 1991 - ); 1992 - enteringMatches = newMatches.filter( 1993 - (match) => !previousMatches.find((d) => d.id === match.id) 1994 - ); 1995 - stayingMatches = previousMatches.filter( 1996 - (match) => newMatches.find((d) => d.id === match.id) 1997 - ); 1998 - return { 1999 - ...s, 2000 - isLoading: false, 2001 - loadedAt: Date.now(), 2002 - matches: newMatches, 2003 - pendingMatches: void 0, 2004 - cachedMatches: [ 2005 - ...s.cachedMatches, 2006 - ...exitingMatches.filter((d) => d.status !== "error") 2007 - ] 2008 - }; 2009 - }); 2010 - this.clearExpiredCache(); 2011 - }); 2012 - [ 2013 - [exitingMatches, "onLeave"], 2014 - [enteringMatches, "onEnter"], 2015 - [stayingMatches, "onStay"] 2016 - ].forEach(([matches, hook]) => { 2017 - matches.forEach((match) => { 2018 - var _a22, _b2; 2019 - (_b2 = (_a22 = this.looseRoutesById[match.routeId].options)[hook]) == null ? void 0 : _b2.call(_a22, match); 2020 - }); 2021 - }); 2022 - }); 2023 - } 2024 - }); 2025 - } catch (err) { 2026 - if (isRedirect(err)) { 2027 - redirect = err; 2028 - if (!this.isServer) { 2029 - this.navigate({ 2030 - ...redirect.options, 2031 - replace: true, 2032 - ignoreBlocker: true 2033 - }); 2034 - } 2035 - } else if (isNotFound(err)) { 2036 - notFound = err; 2037 - } 2038 - this.__store.setState((s) => ({ 2039 - ...s, 2040 - statusCode: redirect ? redirect.status : notFound ? 404 : s.matches.some((d) => d.status === "error") ? 500 : 200, 2041 - redirect 2042 - })); 2043 - } 2044 - if (this.latestLoadPromise === loadPromise) { 2045 - (_a2 = this.commitLocationPromise) == null ? void 0 : _a2.resolve(); 2046 - this.latestLoadPromise = void 0; 2047 - this.commitLocationPromise = void 0; 2048 - } 2049 - resolve(); 2050 - }); 2051 - }); 2052 - this.latestLoadPromise = loadPromise; 2053 - await loadPromise; 2054 - while (this.latestLoadPromise && loadPromise !== this.latestLoadPromise) { 2055 - await this.latestLoadPromise; 2056 - } 2057 - if (this.hasNotFoundMatch()) { 2058 - this.__store.setState((s) => ({ 2059 - ...s, 2060 - statusCode: 404 2061 - })); 2062 - } 2063 - }; 2064 - this.startViewTransition = (fn) => { 2065 - const shouldViewTransition = this.shouldViewTransition ?? this.options.defaultViewTransition; 2066 - delete this.shouldViewTransition; 2067 - if (shouldViewTransition && typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function") { 2068 - let startViewTransitionParams; 2069 - if (typeof shouldViewTransition === "object" && this.isViewTransitionTypesSupported) { 2070 - const next = this.latestLocation; 2071 - const prevLocation = this.state.resolvedLocation; 2072 - const resolvedViewTransitionTypes = typeof shouldViewTransition.types === "function" ? shouldViewTransition.types( 2073 - getLocationChangeInfo({ 2074 - resolvedLocation: prevLocation, 2075 - location: next 2076 - }) 2077 - ) : shouldViewTransition.types; 2078 - startViewTransitionParams = { 2079 - update: fn, 2080 - types: resolvedViewTransitionTypes 2081 - }; 2082 - } else { 2083 - startViewTransitionParams = fn; 2084 - } 2085 - document.startViewTransition(startViewTransitionParams); 2086 - } else { 2087 - fn(); 2088 - } 2089 - }; 2090 - this.updateMatch = (id, updater) => { 2091 - var _a2; 2092 - let updated; 2093 - const isPending = (_a2 = this.state.pendingMatches) == null ? void 0 : _a2.find((d) => d.id === id); 2094 - const isMatched = this.state.matches.find((d) => d.id === id); 2095 - const isCached = this.state.cachedMatches.find((d) => d.id === id); 2096 - const matchesKey = isPending ? "pendingMatches" : isMatched ? "matches" : isCached ? "cachedMatches" : ""; 2097 - if (matchesKey) { 2098 - this.__store.setState((s) => { 2099 - var _a22; 2100 - return { 2101 - ...s, 2102 - [matchesKey]: (_a22 = s[matchesKey]) == null ? void 0 : _a22.map( 2103 - (d) => d.id === id ? updated = updater(d) : d 2104 - ) 2105 - }; 2106 - }); 2107 - } 2108 - return updated; 2109 - }; 2110 - this.getMatch = (matchId) => { 2111 - return [ 2112 - ...this.state.cachedMatches, 2113 - ...this.state.pendingMatches ?? [], 2114 - ...this.state.matches 2115 - ].find((d) => d.id === matchId); 2116 - }; 2117 - this.loadMatches = async ({ 2118 - location, 2119 - matches, 2120 - preload: allPreload, 2121 - onReady, 2122 - updateMatch = this.updateMatch, 2123 - sync 2124 - }) => { 2125 - let firstBadMatchIndex; 2126 - let rendered = false; 2127 - const triggerOnReady = async () => { 2128 - if (!rendered) { 2129 - rendered = true; 2130 - await (onReady == null ? void 0 : onReady()); 2131 - } 2132 - }; 2133 - const resolvePreload = (matchId) => { 2134 - return !!(allPreload && !this.state.matches.find((d) => d.id === matchId)); 2135 - }; 2136 - const handleRedirectAndNotFound = (match, err) => { 2137 - var _a2, _b2, _c2, _d2; 2138 - if (isRedirect(err) || isNotFound(err)) { 2139 - if (isRedirect(err)) { 2140 - if (err.redirectHandled) { 2141 - if (!err.options.reloadDocument) { 2142 - throw err; 2143 - } 2144 - } 2145 - } 2146 - updateMatch(match.id, (prev) => ({ 2147 - ...prev, 2148 - status: isRedirect(err) ? "redirected" : isNotFound(err) ? "notFound" : "error", 2149 - isFetching: false, 2150 - error: err, 2151 - beforeLoadPromise: void 0, 2152 - loaderPromise: void 0 2153 - })); 2154 - if (!err.routeId) { 2155 - err.routeId = match.routeId; 2156 - } 2157 - (_a2 = match.beforeLoadPromise) == null ? void 0 : _a2.resolve(); 2158 - (_b2 = match.loaderPromise) == null ? void 0 : _b2.resolve(); 2159 - (_c2 = match.loadPromise) == null ? void 0 : _c2.resolve(); 2160 - if (isRedirect(err)) { 2161 - rendered = true; 2162 - err.options._fromLocation = location; 2163 - err.redirectHandled = true; 2164 - err = this.resolveRedirect(err); 2165 - throw err; 2166 - } else if (isNotFound(err)) { 2167 - this._handleNotFound(matches, err, { 2168 - updateMatch 2169 - }); 2170 - (_d2 = this.serverSsr) == null ? void 0 : _d2.onMatchSettled({ 2171 - router: this, 2172 - match: this.getMatch(match.id) 2173 - }); 2174 - throw err; 2175 - } 2176 - } 2177 - }; 2178 - try { 2179 - await new Promise((resolveAll, rejectAll) => { 2180 - ; 2181 - (async () => { 2182 - var _a2, _b2, _c2, _d2; 2183 - try { 2184 - const handleSerialError = (index2, err, routerCode) => { 2185 - var _a22, _b22; 2186 - const { id: matchId, routeId } = matches[index2]; 2187 - const route = this.looseRoutesById[routeId]; 2188 - if (err instanceof Promise) { 2189 - throw err; 2190 - } 2191 - err.routerCode = routerCode; 2192 - firstBadMatchIndex = firstBadMatchIndex ?? index2; 2193 - handleRedirectAndNotFound(this.getMatch(matchId), err); 2194 - try { 2195 - (_b22 = (_a22 = route.options).onError) == null ? void 0 : _b22.call(_a22, err); 2196 - } catch (errorHandlerErr) { 2197 - err = errorHandlerErr; 2198 - handleRedirectAndNotFound(this.getMatch(matchId), err); 2199 - } 2200 - updateMatch(matchId, (prev) => { 2201 - var _a3, _b3; 2202 - (_a3 = prev.beforeLoadPromise) == null ? void 0 : _a3.resolve(); 2203 - (_b3 = prev.loadPromise) == null ? void 0 : _b3.resolve(); 2204 - return { 2205 - ...prev, 2206 - error: err, 2207 - status: "error", 2208 - isFetching: false, 2209 - updatedAt: Date.now(), 2210 - abortController: new AbortController(), 2211 - beforeLoadPromise: void 0 2212 - }; 2213 - }); 2214 - }; 2215 - for (const [index2, { id: matchId, routeId }] of matches.entries()) { 2216 - const existingMatch = this.getMatch(matchId); 2217 - const parentMatchId = (_a2 = matches[index2 - 1]) == null ? void 0 : _a2.id; 2218 - const route = this.looseRoutesById[routeId]; 2219 - const pendingMs = route.options.pendingMs ?? this.options.defaultPendingMs; 2220 - const shouldPending = !!(onReady && !this.isServer && !resolvePreload(matchId) && (route.options.loader || route.options.beforeLoad || routeNeedsPreload(route)) && typeof pendingMs === "number" && pendingMs !== Infinity && (route.options.pendingComponent ?? ((_b2 = this.options) == null ? void 0 : _b2.defaultPendingComponent))); 2221 - let executeBeforeLoad = true; 2222 - if ( 2223 - // If we are in the middle of a load, either of these will be present 2224 - // (not to be confused with `loadPromise`, which is always defined) 2225 - existingMatch.beforeLoadPromise || existingMatch.loaderPromise 2226 - ) { 2227 - if (shouldPending) { 2228 - setTimeout(() => { 2229 - try { 2230 - triggerOnReady(); 2231 - } catch { 2232 - } 2233 - }, pendingMs); 2234 - } 2235 - await existingMatch.beforeLoadPromise; 2236 - executeBeforeLoad = this.getMatch(matchId).status !== "success"; 2237 - } 2238 - if (executeBeforeLoad) { 2239 - try { 2240 - updateMatch(matchId, (prev) => { 2241 - const prevLoadPromise = prev.loadPromise; 2242 - return { 2243 - ...prev, 2244 - loadPromise: createControlledPromise(() => { 2245 - prevLoadPromise == null ? void 0 : prevLoadPromise.resolve(); 2246 - }), 2247 - beforeLoadPromise: createControlledPromise() 2248 - }; 2249 - }); 2250 - const abortController = new AbortController(); 2251 - let pendingTimeout; 2252 - if (shouldPending) { 2253 - pendingTimeout = setTimeout(() => { 2254 - try { 2255 - triggerOnReady(); 2256 - } catch { 2257 - } 2258 - }, pendingMs); 2259 - } 2260 - const { paramsError, searchError } = this.getMatch(matchId); 2261 - if (paramsError) { 2262 - handleSerialError(index2, paramsError, "PARSE_PARAMS"); 2263 - } 2264 - if (searchError) { 2265 - handleSerialError(index2, searchError, "VALIDATE_SEARCH"); 2266 - } 2267 - const getParentMatchContext = () => parentMatchId ? this.getMatch(parentMatchId).context : this.options.context ?? {}; 2268 - updateMatch(matchId, (prev) => ({ 2269 - ...prev, 2270 - isFetching: "beforeLoad", 2271 - fetchCount: prev.fetchCount + 1, 2272 - abortController, 2273 - pendingTimeout, 2274 - context: { 2275 - ...getParentMatchContext(), 2276 - ...prev.__routeContext 2277 - } 2278 - })); 2279 - const { search, params, context, cause } = this.getMatch(matchId); 2280 - const preload = resolvePreload(matchId); 2281 - const beforeLoadFnContext = { 2282 - search, 2283 - abortController, 2284 - params, 2285 - preload, 2286 - context, 2287 - location, 2288 - navigate: (opts) => this.navigate({ ...opts, _fromLocation: location }), 2289 - buildLocation: this.buildLocation, 2290 - cause: preload ? "preload" : cause, 2291 - matches 2292 - }; 2293 - const beforeLoadContext = await ((_d2 = (_c2 = route.options).beforeLoad) == null ? void 0 : _d2.call(_c2, beforeLoadFnContext)) ?? {}; 2294 - if (isRedirect(beforeLoadContext) || isNotFound(beforeLoadContext)) { 2295 - handleSerialError(index2, beforeLoadContext, "BEFORE_LOAD"); 2296 - } 2297 - updateMatch(matchId, (prev) => { 2298 - return { 2299 - ...prev, 2300 - __beforeLoadContext: beforeLoadContext, 2301 - context: { 2302 - ...getParentMatchContext(), 2303 - ...prev.__routeContext, 2304 - ...beforeLoadContext 2305 - }, 2306 - abortController 2307 - }; 2308 - }); 2309 - } catch (err) { 2310 - handleSerialError(index2, err, "BEFORE_LOAD"); 2311 - } 2312 - updateMatch(matchId, (prev) => { 2313 - var _a22; 2314 - (_a22 = prev.beforeLoadPromise) == null ? void 0 : _a22.resolve(); 2315 - return { 2316 - ...prev, 2317 - beforeLoadPromise: void 0, 2318 - isFetching: false 2319 - }; 2320 - }); 2321 - } 2322 - } 2323 - const validResolvedMatches = matches.slice(0, firstBadMatchIndex); 2324 - const matchPromises = []; 2325 - validResolvedMatches.forEach(({ id: matchId, routeId }, index2) => { 2326 - matchPromises.push( 2327 - (async () => { 2328 - const { loaderPromise: prevLoaderPromise } = this.getMatch(matchId); 2329 - let loaderShouldRunAsync = false; 2330 - let loaderIsRunningAsync = false; 2331 - if (prevLoaderPromise) { 2332 - await prevLoaderPromise; 2333 - const match = this.getMatch(matchId); 2334 - if (match.error) { 2335 - handleRedirectAndNotFound(match, match.error); 2336 - } 2337 - } else { 2338 - const parentMatchPromise = matchPromises[index2 - 1]; 2339 - const route = this.looseRoutesById[routeId]; 2340 - const getLoaderContext = () => { 2341 - const { 2342 - params, 2343 - loaderDeps, 2344 - abortController, 2345 - context, 2346 - cause 2347 - } = this.getMatch(matchId); 2348 - const preload2 = resolvePreload(matchId); 2349 - return { 2350 - params, 2351 - deps: loaderDeps, 2352 - preload: !!preload2, 2353 - parentMatchPromise, 2354 - abortController, 2355 - context, 2356 - location, 2357 - navigate: (opts) => this.navigate({ ...opts, _fromLocation: location }), 2358 - cause: preload2 ? "preload" : cause, 2359 - route 2360 - }; 2361 - }; 2362 - const age = Date.now() - this.getMatch(matchId).updatedAt; 2363 - const preload = resolvePreload(matchId); 2364 - const staleAge = preload ? route.options.preloadStaleTime ?? this.options.defaultPreloadStaleTime ?? 3e4 : route.options.staleTime ?? this.options.defaultStaleTime ?? 0; 2365 - const shouldReloadOption = route.options.shouldReload; 2366 - const shouldReload = typeof shouldReloadOption === "function" ? shouldReloadOption(getLoaderContext()) : shouldReloadOption; 2367 - updateMatch(matchId, (prev) => ({ 2368 - ...prev, 2369 - loaderPromise: createControlledPromise(), 2370 - preload: !!preload && !this.state.matches.find((d) => d.id === matchId) 2371 - })); 2372 - const executeHead = async () => { 2373 - var _a22, _b22, _c22, _d22, _e2, _f2; 2374 - const match = this.getMatch(matchId); 2375 - if (!match) { 2376 - return; 2377 - } 2378 - const assetContext = { 2379 - matches, 2380 - match, 2381 - params: match.params, 2382 - loaderData: match.loaderData 2383 - }; 2384 - const headFnContent = await ((_b22 = (_a22 = route.options).head) == null ? void 0 : _b22.call(_a22, assetContext)); 2385 - const meta = headFnContent == null ? void 0 : headFnContent.meta; 2386 - const links = headFnContent == null ? void 0 : headFnContent.links; 2387 - const headScripts = headFnContent == null ? void 0 : headFnContent.scripts; 2388 - const scripts = await ((_d22 = (_c22 = route.options).scripts) == null ? void 0 : _d22.call(_c22, assetContext)); 2389 - const headers = await ((_f2 = (_e2 = route.options).headers) == null ? void 0 : _f2.call(_e2, assetContext)); 2390 - return { meta, links, headScripts, headers, scripts }; 2391 - }; 2392 - const runLoader = async () => { 2393 - var _a22, _b22, _c22, _d22, _e2; 2394 - try { 2395 - const potentialPendingMinPromise = async () => { 2396 - const latestMatch = this.getMatch(matchId); 2397 - if (latestMatch.minPendingPromise) { 2398 - await latestMatch.minPendingPromise; 2399 - } 2400 - }; 2401 - try { 2402 - this.loadRouteChunk(route); 2403 - updateMatch(matchId, (prev) => ({ 2404 - ...prev, 2405 - isFetching: "loader" 2406 - })); 2407 - const loaderData = await ((_b22 = (_a22 = route.options).loader) == null ? void 0 : _b22.call(_a22, getLoaderContext())); 2408 - handleRedirectAndNotFound( 2409 - this.getMatch(matchId), 2410 - loaderData 2411 - ); 2412 - await route._lazyPromise; 2413 - await potentialPendingMinPromise(); 2414 - await route._componentsPromise; 2415 - updateMatch(matchId, (prev) => ({ 2416 - ...prev, 2417 - error: void 0, 2418 - status: "success", 2419 - isFetching: false, 2420 - updatedAt: Date.now(), 2421 - loaderData 2422 - })); 2423 - const head = await executeHead(); 2424 - updateMatch(matchId, (prev) => ({ 2425 - ...prev, 2426 - ...head 2427 - })); 2428 - } catch (e) { 2429 - let error = e; 2430 - await potentialPendingMinPromise(); 2431 - handleRedirectAndNotFound(this.getMatch(matchId), e); 2432 - try { 2433 - (_d22 = (_c22 = route.options).onError) == null ? void 0 : _d22.call(_c22, e); 2434 - } catch (onErrorError) { 2435 - error = onErrorError; 2436 - handleRedirectAndNotFound( 2437 - this.getMatch(matchId), 2438 - onErrorError 2439 - ); 2440 - } 2441 - const head = await executeHead(); 2442 - updateMatch(matchId, (prev) => ({ 2443 - ...prev, 2444 - error, 2445 - status: "error", 2446 - isFetching: false, 2447 - ...head 2448 - })); 2449 - } 2450 - (_e2 = this.serverSsr) == null ? void 0 : _e2.onMatchSettled({ 2451 - router: this, 2452 - match: this.getMatch(matchId) 2453 - }); 2454 - } catch (err) { 2455 - const head = await executeHead(); 2456 - updateMatch(matchId, (prev) => ({ 2457 - ...prev, 2458 - loaderPromise: void 0, 2459 - ...head 2460 - })); 2461 - handleRedirectAndNotFound(this.getMatch(matchId), err); 2462 - } 2463 - }; 2464 - const { status, invalid } = this.getMatch(matchId); 2465 - loaderShouldRunAsync = status === "success" && (invalid || (shouldReload ?? age > staleAge)); 2466 - if (preload && route.options.preload === false) { 2467 - } else if (loaderShouldRunAsync && !sync) { 2468 - loaderIsRunningAsync = true; 2469 - (async () => { 2470 - try { 2471 - await runLoader(); 2472 - const { loaderPromise, loadPromise } = this.getMatch(matchId); 2473 - loaderPromise == null ? void 0 : loaderPromise.resolve(); 2474 - loadPromise == null ? void 0 : loadPromise.resolve(); 2475 - updateMatch(matchId, (prev) => ({ 2476 - ...prev, 2477 - loaderPromise: void 0 2478 - })); 2479 - } catch (err) { 2480 - if (isRedirect(err)) { 2481 - await this.navigate(err.options); 2482 - } 2483 - } 2484 - })(); 2485 - } else if (status !== "success" || loaderShouldRunAsync && sync) { 2486 - await runLoader(); 2487 - } else { 2488 - const head = await executeHead(); 2489 - updateMatch(matchId, (prev) => ({ 2490 - ...prev, 2491 - ...head 2492 - })); 2493 - } 2494 - } 2495 - if (!loaderIsRunningAsync) { 2496 - const { loaderPromise, loadPromise } = this.getMatch(matchId); 2497 - loaderPromise == null ? void 0 : loaderPromise.resolve(); 2498 - loadPromise == null ? void 0 : loadPromise.resolve(); 2499 - } 2500 - updateMatch(matchId, (prev) => ({ 2501 - ...prev, 2502 - isFetching: loaderIsRunningAsync ? prev.isFetching : false, 2503 - loaderPromise: loaderIsRunningAsync ? prev.loaderPromise : void 0, 2504 - invalid: false 2505 - })); 2506 - return this.getMatch(matchId); 2507 - })() 2508 - ); 2509 - }); 2510 - await Promise.all(matchPromises); 2511 - resolveAll(); 2512 - } catch (err) { 2513 - rejectAll(err); 2514 - } 2515 - })(); 2516 - }); 2517 - await triggerOnReady(); 2518 - } catch (err) { 2519 - if (isRedirect(err) || isNotFound(err)) { 2520 - if (isNotFound(err) && !allPreload) { 2521 - await triggerOnReady(); 2522 - } 2523 - throw err; 2524 - } 2525 - } 2526 - return matches; 2527 - }; 2528 - this.invalidate = (opts) => { 2529 - const invalidate = (d) => { 2530 - var _a2; 2531 - if (((_a2 = opts == null ? void 0 : opts.filter) == null ? void 0 : _a2.call(opts, d)) ?? true) { 2532 - return { 2533 - ...d, 2534 - invalid: true, 2535 - ...d.status === "error" ? { status: "pending", error: void 0 } : {} 2536 - }; 2537 - } 2538 - return d; 2539 - }; 2540 - this.__store.setState((s) => { 2541 - var _a2; 2542 - return { 2543 - ...s, 2544 - matches: s.matches.map(invalidate), 2545 - cachedMatches: s.cachedMatches.map(invalidate), 2546 - pendingMatches: (_a2 = s.pendingMatches) == null ? void 0 : _a2.map(invalidate) 2547 - }; 2548 - }); 2549 - return this.load({ sync: opts == null ? void 0 : opts.sync }); 2550 - }; 2551 - this.resolveRedirect = (redirect) => { 2552 - if (!redirect.options.href) { 2553 - redirect.options.href = this.buildLocation(redirect.options).href; 2554 - redirect.headers.set("Location", redirect.options.href); 2555 - } 2556 - if (!redirect.headers.get("Location")) { 2557 - redirect.headers.set("Location", redirect.options.href); 2558 - } 2559 - return redirect; 2560 - }; 2561 - this.clearCache = (opts) => { 2562 - const filter = opts == null ? void 0 : opts.filter; 2563 - if (filter !== void 0) { 2564 - this.__store.setState((s) => { 2565 - return { 2566 - ...s, 2567 - cachedMatches: s.cachedMatches.filter( 2568 - (m) => !filter(m) 2569 - ) 2570 - }; 2571 - }); 2572 - } else { 2573 - this.__store.setState((s) => { 2574 - return { 2575 - ...s, 2576 - cachedMatches: [] 2577 - }; 2578 - }); 2579 - } 2580 - }; 2581 - this.clearExpiredCache = () => { 2582 - const filter = (d) => { 2583 - const route = this.looseRoutesById[d.routeId]; 2584 - if (!route.options.loader) { 2585 - return true; 2586 - } 2587 - const gcTime = (d.preload ? route.options.preloadGcTime ?? this.options.defaultPreloadGcTime : route.options.gcTime ?? this.options.defaultGcTime) ?? 5 * 60 * 1e3; 2588 - return !(d.status !== "error" && Date.now() - d.updatedAt < gcTime); 2589 - }; 2590 - this.clearCache({ filter }); 2591 - }; 2592 - this.loadRouteChunk = (route) => { 2593 - if (route._lazyPromise === void 0) { 2594 - if (route.lazyFn) { 2595 - route._lazyPromise = route.lazyFn().then((lazyRoute) => { 2596 - const { id: _id, ...options2 } = lazyRoute.options; 2597 - Object.assign(route.options, options2); 2598 - }); 2599 - } else { 2600 - route._lazyPromise = Promise.resolve(); 2601 - } 2602 - } 2603 - if (route._componentsPromise === void 0) { 2604 - route._componentsPromise = route._lazyPromise.then( 2605 - () => Promise.all( 2606 - componentTypes.map(async (type) => { 2607 - const component = route.options[type]; 2608 - if (component == null ? void 0 : component.preload) { 2609 - await component.preload(); 2610 - } 2611 - }) 2612 - ) 2613 - ); 2614 - } 2615 - return route._componentsPromise; 2616 - }; 2617 - this.preloadRoute = async (opts) => { 2618 - const next = this.buildLocation(opts); 2619 - let matches = this.matchRoutes(next, { 2620 - throwOnError: true, 2621 - preload: true, 2622 - dest: opts 2623 - }); 2624 - const activeMatchIds = new Set( 2625 - [...this.state.matches, ...this.state.pendingMatches ?? []].map( 2626 - (d) => d.id 2627 - ) 2628 - ); 2629 - const loadedMatchIds = /* @__PURE__ */ new Set([ 2630 - ...activeMatchIds, 2631 - ...this.state.cachedMatches.map((d) => d.id) 2632 - ]); 2633 - batch$1(() => { 2634 - matches.forEach((match) => { 2635 - if (!loadedMatchIds.has(match.id)) { 2636 - this.__store.setState((s) => ({ 2637 - ...s, 2638 - cachedMatches: [...s.cachedMatches, match] 2639 - })); 2640 - } 2641 - }); 2642 - }); 2643 - try { 2644 - matches = await this.loadMatches({ 2645 - matches, 2646 - location: next, 2647 - preload: true, 2648 - updateMatch: (id, updater) => { 2649 - if (activeMatchIds.has(id)) { 2650 - matches = matches.map((d) => d.id === id ? updater(d) : d); 2651 - } else { 2652 - this.updateMatch(id, updater); 2653 - } 2654 - } 2655 - }); 2656 - return matches; 2657 - } catch (err) { 2658 - if (isRedirect(err)) { 2659 - if (err.options.reloadDocument) { 2660 - return void 0; 2661 - } 2662 - return await this.preloadRoute({ 2663 - ...err.options, 2664 - _fromLocation: next 2665 - }); 2666 - } 2667 - if (!isNotFound(err)) { 2668 - console.error(err); 2669 - } 2670 - return void 0; 2671 - } 2672 - }; 2673 - this.matchRoute = (location, opts) => { 2674 - const matchLocation = { 2675 - ...location, 2676 - to: location.to ? this.resolvePathWithBase( 2677 - location.from || "", 2678 - location.to 2679 - ) : void 0, 2680 - params: location.params || {}, 2681 - leaveParams: true 2682 - }; 2683 - const next = this.buildLocation(matchLocation); 2684 - if ((opts == null ? void 0 : opts.pending) && this.state.status !== "pending") { 2685 - return false; 2686 - } 2687 - const pending = (opts == null ? void 0 : opts.pending) === void 0 ? !this.state.isLoading : opts.pending; 2688 - const baseLocation = pending ? this.latestLocation : this.state.resolvedLocation || this.state.location; 2689 - const match = matchPathname(this.basepath, baseLocation.pathname, { 2690 - ...opts, 2691 - to: next.pathname 2692 - }); 2693 - if (!match) { 2694 - return false; 2695 - } 2696 - if (location.params) { 2697 - if (!deepEqual(match, location.params, { partial: true })) { 2698 - return false; 2699 - } 2700 - } 2701 - if (match && ((opts == null ? void 0 : opts.includeSearch) ?? true)) { 2702 - return deepEqual(baseLocation.search, next.search, { partial: true }) ? match : false; 2703 - } 2704 - return match; 2705 - }; 2706 - this._handleNotFound = (matches, err, { 2707 - updateMatch = this.updateMatch 2708 - } = {}) => { 2709 - var _a2; 2710 - const routeCursor = this.routesById[err.routeId ?? ""] ?? this.routeTree; 2711 - const matchesByRouteId = {}; 2712 - for (const match of matches) { 2713 - matchesByRouteId[match.routeId] = match; 2714 - } 2715 - if (!routeCursor.options.notFoundComponent && ((_a2 = this.options) == null ? void 0 : _a2.defaultNotFoundComponent)) { 2716 - routeCursor.options.notFoundComponent = this.options.defaultNotFoundComponent; 2717 - } 2718 - invariant( 2719 - routeCursor.options.notFoundComponent); 2720 - const matchForRoute = matchesByRouteId[routeCursor.id]; 2721 - invariant( 2722 - matchForRoute, 2723 - "Could not find match for route: " + routeCursor.id 2724 - ); 2725 - updateMatch(matchForRoute.id, (prev) => ({ 2726 - ...prev, 2727 - status: "notFound", 2728 - error: err, 2729 - isFetching: false 2730 - })); 2731 - if (err.routerCode === "BEFORE_LOAD" && routeCursor.parentRoute) { 2732 - err.routeId = routeCursor.parentRoute.id; 2733 - this._handleNotFound(matches, err, { 2734 - updateMatch 2735 - }); 2736 - } 2737 - }; 2738 - this.hasNotFoundMatch = () => { 2739 - return this.__store.state.matches.some( 2740 - (d) => d.status === "notFound" || d.globalNotFound 2741 - ); 2742 - }; 2743 - this.update({ 2744 - defaultPreloadDelay: 50, 2745 - defaultPendingMs: 1e3, 2746 - defaultPendingMinMs: 500, 2747 - context: void 0, 2748 - ...options, 2749 - caseSensitive: options.caseSensitive ?? false, 2750 - notFoundMode: options.notFoundMode ?? "fuzzy", 2751 - stringifySearch: options.stringifySearch ?? defaultStringifySearch, 2752 - parseSearch: options.parseSearch ?? defaultParseSearch 2753 - }); 2754 - if (typeof document !== "undefined") { 2755 - window.__TSR_ROUTER__ = this; 2756 - } 2757 - } 2758 - get state() { 2759 - return this.__store.state; 2760 - } 2761 - get looseRoutesById() { 2762 - return this.routesById; 2763 - } 2764 - matchRoutesInternal(next, opts) { 2765 - var _a2; 2766 - const { foundRoute, matchedRoutes, routeParams } = this.getMatchedRoutes( 2767 - next.pathname, 2768 - (_a2 = opts == null ? void 0 : opts.dest) == null ? void 0 : _a2.to 2769 - ); 2770 - let isGlobalNotFound = false; 2771 - if ( 2772 - // If we found a route, and it's not an index route and we have left over path 2773 - foundRoute ? foundRoute.path !== "/" && routeParams["**"] : ( 2774 - // Or if we didn't find a route and we have left over path 2775 - trimPathRight(next.pathname) 2776 - ) 2777 - ) { 2778 - if (this.options.notFoundRoute) { 2779 - matchedRoutes.push(this.options.notFoundRoute); 2780 - } else { 2781 - isGlobalNotFound = true; 2782 - } 2783 - } 2784 - const globalNotFoundRouteId = (() => { 2785 - if (!isGlobalNotFound) { 2786 - return void 0; 2787 - } 2788 - if (this.options.notFoundMode !== "root") { 2789 - for (let i = matchedRoutes.length - 1; i >= 0; i--) { 2790 - const route = matchedRoutes[i]; 2791 - if (route.children) { 2792 - return route.id; 2793 - } 2794 - } 2795 - } 2796 - return rootRouteId; 2797 - })(); 2798 - const parseErrors = matchedRoutes.map((route) => { 2799 - var _a22; 2800 - let parsedParamsError; 2801 - const parseParams = ((_a22 = route.options.params) == null ? void 0 : _a22.parse) ?? route.options.parseParams; 2802 - if (parseParams) { 2803 - try { 2804 - const parsedParams = parseParams(routeParams); 2805 - Object.assign(routeParams, parsedParams); 2806 - } catch (err) { 2807 - parsedParamsError = new PathParamError(err.message, { 2808 - cause: err 2809 - }); 2810 - if (opts == null ? void 0 : opts.throwOnError) { 2811 - throw parsedParamsError; 2812 - } 2813 - return parsedParamsError; 2814 - } 2815 - } 2816 - return; 2817 - }); 2818 - const matches = []; 2819 - const getParentContext = (parentMatch) => { 2820 - const parentMatchId = parentMatch == null ? void 0 : parentMatch.id; 2821 - const parentContext = !parentMatchId ? this.options.context ?? {} : parentMatch.context ?? this.options.context ?? {}; 2822 - return parentContext; 2823 - }; 2824 - matchedRoutes.forEach((route, index2) => { 2825 - var _a22, _b2; 2826 - const parentMatch = matches[index2 - 1]; 2827 - const [preMatchSearch, strictMatchSearch, searchError] = (() => { 2828 - const parentSearch = (parentMatch == null ? void 0 : parentMatch.search) ?? next.search; 2829 - const parentStrictSearch = (parentMatch == null ? void 0 : parentMatch._strictSearch) ?? {}; 2830 - try { 2831 - const strictSearch = validateSearch(route.options.validateSearch, { ...parentSearch }) ?? {}; 2832 - return [ 2833 - { 2834 - ...parentSearch, 2835 - ...strictSearch 2836 - }, 2837 - { ...parentStrictSearch, ...strictSearch }, 2838 - void 0 2839 - ]; 2840 - } catch (err) { 2841 - let searchParamError = err; 2842 - if (!(err instanceof SearchParamError)) { 2843 - searchParamError = new SearchParamError(err.message, { 2844 - cause: err 2845 - }); 2846 - } 2847 - if (opts == null ? void 0 : opts.throwOnError) { 2848 - throw searchParamError; 2849 - } 2850 - return [parentSearch, {}, searchParamError]; 2851 - } 2852 - })(); 2853 - const loaderDeps = ((_b2 = (_a22 = route.options).loaderDeps) == null ? void 0 : _b2.call(_a22, { 2854 - search: preMatchSearch 2855 - })) ?? ""; 2856 - const loaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) : ""; 2857 - const { usedParams, interpolatedPath } = interpolatePath({ 2858 - path: route.fullPath, 2859 - params: routeParams, 2860 - decodeCharMap: this.pathParamsDecodeCharMap 2861 - }); 2862 - const matchId = interpolatePath({ 2863 - path: route.id, 2864 - params: routeParams, 2865 - leaveWildcards: true, 2866 - decodeCharMap: this.pathParamsDecodeCharMap 2867 - }).interpolatedPath + loaderDepsHash; 2868 - const existingMatch = this.getMatch(matchId); 2869 - const previousMatch = this.state.matches.find( 2870 - (d) => d.routeId === route.id 2871 - ); 2872 - const cause = previousMatch ? "stay" : "enter"; 2873 - let match; 2874 - if (existingMatch) { 2875 - match = { 2876 - ...existingMatch, 2877 - cause, 2878 - params: previousMatch ? replaceEqualDeep$1(previousMatch.params, routeParams) : routeParams, 2879 - _strictParams: usedParams, 2880 - search: previousMatch ? replaceEqualDeep$1(previousMatch.search, preMatchSearch) : replaceEqualDeep$1(existingMatch.search, preMatchSearch), 2881 - _strictSearch: strictMatchSearch 2882 - }; 2883 - } else { 2884 - const status = route.options.loader || route.options.beforeLoad || route.lazyFn || routeNeedsPreload(route) ? "pending" : "success"; 2885 - match = { 2886 - id: matchId, 2887 - index: index2, 2888 - routeId: route.id, 2889 - params: previousMatch ? replaceEqualDeep$1(previousMatch.params, routeParams) : routeParams, 2890 - _strictParams: usedParams, 2891 - pathname: joinPaths([this.basepath, interpolatedPath]), 2892 - updatedAt: Date.now(), 2893 - search: previousMatch ? replaceEqualDeep$1(previousMatch.search, preMatchSearch) : preMatchSearch, 2894 - _strictSearch: strictMatchSearch, 2895 - searchError: void 0, 2896 - status, 2897 - isFetching: false, 2898 - error: void 0, 2899 - paramsError: parseErrors[index2], 2900 - __routeContext: {}, 2901 - __beforeLoadContext: {}, 2902 - context: {}, 2903 - abortController: new AbortController(), 2904 - fetchCount: 0, 2905 - cause, 2906 - loaderDeps: previousMatch ? replaceEqualDeep$1(previousMatch.loaderDeps, loaderDeps) : loaderDeps, 2907 - invalid: false, 2908 - preload: false, 2909 - links: void 0, 2910 - scripts: void 0, 2911 - headScripts: void 0, 2912 - meta: void 0, 2913 - staticData: route.options.staticData || {}, 2914 - loadPromise: createControlledPromise(), 2915 - fullPath: route.fullPath 2916 - }; 2917 - } 2918 - if (!(opts == null ? void 0 : opts.preload)) { 2919 - match.globalNotFound = globalNotFoundRouteId === route.id; 2920 - } 2921 - match.searchError = searchError; 2922 - const parentContext = getParentContext(parentMatch); 2923 - match.context = { 2924 - ...parentContext, 2925 - ...match.__routeContext, 2926 - ...match.__beforeLoadContext 2927 - }; 2928 - matches.push(match); 2929 - }); 2930 - matches.forEach((match, index2) => { 2931 - var _a22, _b2; 2932 - const route = this.looseRoutesById[match.routeId]; 2933 - const existingMatch = this.getMatch(match.id); 2934 - if (!existingMatch && (opts == null ? void 0 : opts._buildLocation) !== true) { 2935 - const parentMatch = matches[index2 - 1]; 2936 - const parentContext = getParentContext(parentMatch); 2937 - const contextFnContext = { 2938 - deps: match.loaderDeps, 2939 - params: match.params, 2940 - context: parentContext, 2941 - location: next, 2942 - navigate: (opts2) => this.navigate({ ...opts2, _fromLocation: next }), 2943 - buildLocation: this.buildLocation, 2944 - cause: match.cause, 2945 - abortController: match.abortController, 2946 - preload: !!match.preload, 2947 - matches 2948 - }; 2949 - match.__routeContext = ((_b2 = (_a22 = route.options).context) == null ? void 0 : _b2.call(_a22, contextFnContext)) ?? {}; 2950 - match.context = { 2951 - ...parentContext, 2952 - ...match.__routeContext, 2953 - ...match.__beforeLoadContext 2954 - }; 2955 - } 2956 - }); 2957 - return matches; 2958 - } 2959 - } 2960 - class SearchParamError extends Error { 2961 - } 2962 - class PathParamError extends Error { 2963 - } 2964 - function getInitialRouterState(location) { 2965 - return { 2966 - loadedAt: 0, 2967 - isLoading: false, 2968 - isTransitioning: false, 2969 - status: "idle", 2970 - resolvedLocation: void 0, 2971 - location, 2972 - matches: [], 2973 - pendingMatches: [], 2974 - cachedMatches: [], 2975 - statusCode: 200 2976 - }; 2977 - } 2978 - function validateSearch(validateSearch2, input) { 2979 - if (validateSearch2 == null) return {}; 2980 - if ("~standard" in validateSearch2) { 2981 - const result = validateSearch2["~standard"].validate(input); 2982 - if (result instanceof Promise) 2983 - throw new SearchParamError("Async validation not supported"); 2984 - if (result.issues) 2985 - throw new SearchParamError(JSON.stringify(result.issues, void 0, 2), { 2986 - cause: result 2987 - }); 2988 - return result.value; 2989 - } 2990 - if ("parse" in validateSearch2) { 2991 - return validateSearch2.parse(input); 2992 - } 2993 - if (typeof validateSearch2 === "function") { 2994 - return validateSearch2(input); 2995 - } 2996 - return {}; 2997 - } 2998 - const componentTypes = [ 2999 - "component", 3000 - "errorComponent", 3001 - "pendingComponent", 3002 - "notFoundComponent" 3003 - ]; 3004 - function routeNeedsPreload(route) { 3005 - var _a2; 3006 - for (const componentType of componentTypes) { 3007 - if ((_a2 = route.options[componentType]) == null ? void 0 : _a2.preload) { 3008 - return true; 3009 - } 3010 - } 3011 - return false; 3012 - } 3013 - function processRouteTree({ 3014 - routeTree: routeTree2, 3015 - initRoute 3016 - }) { 3017 - const routesById = {}; 3018 - const routesByPath = {}; 3019 - const recurseRoutes = (childRoutes) => { 3020 - childRoutes.forEach((childRoute, i) => { 3021 - initRoute == null ? void 0 : initRoute(childRoute, i); 3022 - const existingRoute = routesById[childRoute.id]; 3023 - invariant( 3024 - !existingRoute, 3025 - `Duplicate routes found with id: ${String(childRoute.id)}` 3026 - ); 3027 - routesById[childRoute.id] = childRoute; 3028 - if (!childRoute.isRoot && childRoute.path) { 3029 - const trimmedFullPath = trimPathRight(childRoute.fullPath); 3030 - if (!routesByPath[trimmedFullPath] || childRoute.fullPath.endsWith("/")) { 3031 - routesByPath[trimmedFullPath] = childRoute; 3032 - } 3033 - } 3034 - const children2 = childRoute.children; 3035 - if (children2 == null ? void 0 : children2.length) { 3036 - recurseRoutes(children2); 3037 - } 3038 - }); 3039 - }; 3040 - recurseRoutes([routeTree2]); 3041 - const scoredRoutes = []; 3042 - const routes = Object.values(routesById); 3043 - routes.forEach((d, i) => { 3044 - var _a2; 3045 - if (d.isRoot || !d.path) { 3046 - return; 3047 - } 3048 - const trimmed = trimPathLeft(d.fullPath); 3049 - const parsed = parsePathname(trimmed); 3050 - while (parsed.length > 1 && ((_a2 = parsed[0]) == null ? void 0 : _a2.value) === "/") { 3051 - parsed.shift(); 3052 - } 3053 - const scores = parsed.map((segment) => { 3054 - if (segment.value === "/") { 3055 - return 0.75; 3056 - } 3057 - if (segment.type === "param" && segment.prefixSegment && segment.suffixSegment) { 3058 - return 0.55; 3059 - } 3060 - if (segment.type === "param" && segment.prefixSegment) { 3061 - return 0.52; 3062 - } 3063 - if (segment.type === "param" && segment.suffixSegment) { 3064 - return 0.51; 3065 - } 3066 - if (segment.type === "param") { 3067 - return 0.5; 3068 - } 3069 - if (segment.type === "wildcard" && segment.prefixSegment && segment.suffixSegment) { 3070 - return 0.3; 3071 - } 3072 - if (segment.type === "wildcard" && segment.prefixSegment) { 3073 - return 0.27; 3074 - } 3075 - if (segment.type === "wildcard" && segment.suffixSegment) { 3076 - return 0.26; 3077 - } 3078 - if (segment.type === "wildcard") { 3079 - return 0.25; 3080 - } 3081 - return 1; 3082 - }); 3083 - scoredRoutes.push({ child: d, trimmed, parsed, index: i, scores }); 3084 - }); 3085 - const flatRoutes = scoredRoutes.sort((a, b) => { 3086 - const minLength = Math.min(a.scores.length, b.scores.length); 3087 - for (let i = 0; i < minLength; i++) { 3088 - if (a.scores[i] !== b.scores[i]) { 3089 - return b.scores[i] - a.scores[i]; 3090 - } 3091 - } 3092 - if (a.scores.length !== b.scores.length) { 3093 - return b.scores.length - a.scores.length; 3094 - } 3095 - for (let i = 0; i < minLength; i++) { 3096 - if (a.parsed[i].value !== b.parsed[i].value) { 3097 - return a.parsed[i].value > b.parsed[i].value ? 1 : -1; 3098 - } 3099 - } 3100 - return a.index - b.index; 3101 - }).map((d, i) => { 3102 - d.child.rank = i; 3103 - return d.child; 3104 - }); 3105 - return { routesById, routesByPath, flatRoutes }; 3106 - } 3107 - function getMatchedRoutes({ 3108 - pathname, 3109 - routePathname, 3110 - basepath, 3111 - caseSensitive, 3112 - routesByPath, 3113 - routesById, 3114 - flatRoutes 3115 - }) { 3116 - let routeParams = {}; 3117 - const trimmedPath = trimPathRight(pathname); 3118 - const getMatchedParams = (route) => { 3119 - var _a2; 3120 - const result = matchPathname(basepath, trimmedPath, { 3121 - to: route.fullPath, 3122 - caseSensitive: ((_a2 = route.options) == null ? void 0 : _a2.caseSensitive) ?? caseSensitive, 3123 - fuzzy: true 3124 - }); 3125 - return result; 3126 - }; 3127 - let foundRoute = routePathname !== void 0 ? routesByPath[routePathname] : void 0; 3128 - if (foundRoute) { 3129 - routeParams = getMatchedParams(foundRoute); 3130 - } else { 3131 - foundRoute = flatRoutes.find((route) => { 3132 - const matchedParams = getMatchedParams(route); 3133 - if (matchedParams) { 3134 - routeParams = matchedParams; 3135 - return true; 3136 - } 3137 - return false; 3138 - }); 3139 - } 3140 - let routeCursor = foundRoute || routesById[rootRouteId]; 3141 - const matchedRoutes = [routeCursor]; 3142 - while (routeCursor.parentRoute) { 3143 - routeCursor = routeCursor.parentRoute; 3144 - matchedRoutes.unshift(routeCursor); 3145 - } 3146 - return { matchedRoutes, routeParams, foundRoute }; 3147 - } 3148 - function applySearchMiddleware({ 3149 - search, 3150 - dest, 3151 - destRoutes, 3152 - _includeValidateSearch 3153 - }) { 3154 - const allMiddlewares = destRoutes.reduce( 3155 - (acc, route) => { 3156 - var _a2; 3157 - const middlewares = []; 3158 - if ("search" in route.options) { 3159 - if ((_a2 = route.options.search) == null ? void 0 : _a2.middlewares) { 3160 - middlewares.push(...route.options.search.middlewares); 3161 - } 3162 - } else if (route.options.preSearchFilters || route.options.postSearchFilters) { 3163 - const legacyMiddleware = ({ 3164 - search: search2, 3165 - next 3166 - }) => { 3167 - let nextSearch = search2; 3168 - if ("preSearchFilters" in route.options && route.options.preSearchFilters) { 3169 - nextSearch = route.options.preSearchFilters.reduce( 3170 - (prev, next2) => next2(prev), 3171 - search2 3172 - ); 3173 - } 3174 - const result = next(nextSearch); 3175 - if ("postSearchFilters" in route.options && route.options.postSearchFilters) { 3176 - return route.options.postSearchFilters.reduce( 3177 - (prev, next2) => next2(prev), 3178 - result 3179 - ); 3180 - } 3181 - return result; 3182 - }; 3183 - middlewares.push(legacyMiddleware); 3184 - } 3185 - if (_includeValidateSearch && route.options.validateSearch) { 3186 - const validate = ({ search: search2, next }) => { 3187 - const result = next(search2); 3188 - try { 3189 - const validatedSearch = { 3190 - ...result, 3191 - ...validateSearch(route.options.validateSearch, result) ?? {} 3192 - }; 3193 - return validatedSearch; 3194 - } catch { 3195 - return result; 3196 - } 3197 - }; 3198 - middlewares.push(validate); 3199 - } 3200 - return acc.concat(middlewares); 3201 - }, 3202 - [] 3203 - ) ?? []; 3204 - const final = ({ search: search2 }) => { 3205 - if (!dest.search) { 3206 - return {}; 3207 - } 3208 - if (dest.search === true) { 3209 - return search2; 3210 - } 3211 - return functionalUpdate$1(dest.search, search2); 3212 - }; 3213 - allMiddlewares.push(final); 3214 - const applyNext = (index2, currentSearch) => { 3215 - if (index2 >= allMiddlewares.length) { 3216 - return currentSearch; 3217 - } 3218 - const middleware = allMiddlewares[index2]; 3219 - const next = (newSearch) => { 3220 - return applyNext(index2 + 1, newSearch); 3221 - }; 3222 - return middleware({ search: currentSearch, next }); 3223 - }; 3224 - return applyNext(0, search); 3225 - } 3226 - const TSR_DEFERRED_PROMISE = Symbol.for("TSR_DEFERRED_PROMISE"); 3227 - function defer(_promise, options) { 3228 - const promise = _promise; 3229 - if (promise[TSR_DEFERRED_PROMISE]) { 3230 - return promise; 3231 - } 3232 - promise[TSR_DEFERRED_PROMISE] = { status: "pending" }; 3233 - promise.then((data) => { 3234 - promise[TSR_DEFERRED_PROMISE].status = "success"; 3235 - promise[TSR_DEFERRED_PROMISE].data = data; 3236 - }).catch((error) => { 3237 - promise[TSR_DEFERRED_PROMISE].status = "error"; 3238 - promise[TSR_DEFERRED_PROMISE].error = { 3239 - data: defaultSerializeError(error), 3240 - __isServerError: true 3241 - }; 3242 - }); 3243 - return promise; 3244 - } 3245 - const preloadWarning = "Error preloading route! ☝️"; 3246 - class BaseRoute { 3247 - constructor(options) { 3248 - this.init = (opts) => { 3249 - var _a2, _b2; 3250 - this.originalIndex = opts.originalIndex; 3251 - const options2 = this.options; 3252 - const isRoot = !(options2 == null ? void 0 : options2.path) && !(options2 == null ? void 0 : options2.id); 3253 - this.parentRoute = (_b2 = (_a2 = this.options).getParentRoute) == null ? void 0 : _b2.call(_a2); 3254 - if (isRoot) { 3255 - this._path = rootRouteId; 3256 - } else if (!this.parentRoute) { 3257 - invariant( 3258 - false); 3259 - } 3260 - let path = isRoot ? rootRouteId : options2 == null ? void 0 : options2.path; 3261 - if (path && path !== "/") { 3262 - path = trimPathLeft(path); 3263 - } 3264 - const customId = (options2 == null ? void 0 : options2.id) || path; 3265 - let id = isRoot ? rootRouteId : joinPaths([ 3266 - this.parentRoute.id === rootRouteId ? "" : this.parentRoute.id, 3267 - customId 3268 - ]); 3269 - if (path === rootRouteId) { 3270 - path = "/"; 3271 - } 3272 - if (id !== rootRouteId) { 3273 - id = joinPaths(["/", id]); 3274 - } 3275 - const fullPath = id === rootRouteId ? "/" : joinPaths([this.parentRoute.fullPath, path]); 3276 - this._path = path; 3277 - this._id = id; 3278 - this._fullPath = fullPath; 3279 - this._to = fullPath; 3280 - this._ssr = (options2 == null ? void 0 : options2.ssr) ?? opts.defaultSsr ?? true; 3281 - }; 3282 - this.clone = (other) => { 3283 - this._path = other._path; 3284 - this._id = other._id; 3285 - this._fullPath = other._fullPath; 3286 - this._to = other._to; 3287 - this._ssr = other._ssr; 3288 - this.options.getParentRoute = other.options.getParentRoute; 3289 - this.children = other.children; 3290 - }; 3291 - this.addChildren = (children2) => { 3292 - return this._addFileChildren(children2); 3293 - }; 3294 - this._addFileChildren = (children2) => { 3295 - if (Array.isArray(children2)) { 3296 - this.children = children2; 3297 - } 3298 - if (typeof children2 === "object" && children2 !== null) { 3299 - this.children = Object.values(children2); 3300 - } 3301 - return this; 3302 - }; 3303 - this._addFileTypes = () => { 3304 - return this; 3305 - }; 3306 - this.updateLoader = (options2) => { 3307 - Object.assign(this.options, options2); 3308 - return this; 3309 - }; 3310 - this.update = (options2) => { 3311 - Object.assign(this.options, options2); 3312 - return this; 3313 - }; 3314 - this.lazy = (lazyFn) => { 3315 - this.lazyFn = lazyFn; 3316 - return this; 3317 - }; 3318 - this.options = options || {}; 3319 - this.isRoot = !(options == null ? void 0 : options.getParentRoute); 3320 - if ((options == null ? void 0 : options.id) && (options == null ? void 0 : options.path)) { 3321 - throw new Error(`Route cannot have both an 'id' and a 'path' option.`); 3322 - } 3323 - } 3324 - get to() { 3325 - return this._to; 3326 - } 3327 - get id() { 3328 - return this._id; 3329 - } 3330 - get path() { 3331 - return this._path; 3332 - } 3333 - get fullPath() { 3334 - return this._fullPath; 3335 - } 3336 - get ssr() { 3337 - return this._ssr; 3338 - } 3339 - } 3340 - class BaseRootRoute extends BaseRoute { 3341 - constructor(options) { 3342 - super(options); 3343 - } 3344 - } 3345 - function CatchBoundary(props) { 3346 - const errorComponent = props.errorComponent ?? ErrorComponent; 3347 - return /* @__PURE__ */ jsx( 3348 - CatchBoundaryImpl, 3349 - { 3350 - getResetKey: props.getResetKey, 3351 - onCatch: props.onCatch, 3352 - children: ({ error, reset }) => { 3353 - if (error) { 3354 - return React.createElement(errorComponent, { 3355 - error, 3356 - reset 3357 - }); 3358 - } 3359 - return props.children; 3360 - } 3361 - } 3362 - ); 3363 - } 3364 - class CatchBoundaryImpl extends React.Component { 3365 - constructor() { 3366 - super(...arguments); 3367 - this.state = { error: null }; 3368 - } 3369 - static getDerivedStateFromProps(props) { 3370 - return { resetKey: props.getResetKey() }; 3371 - } 3372 - static getDerivedStateFromError(error) { 3373 - return { error }; 3374 - } 3375 - reset() { 3376 - this.setState({ error: null }); 3377 - } 3378 - componentDidUpdate(prevProps, prevState) { 3379 - if (prevState.error && prevState.resetKey !== this.state.resetKey) { 3380 - this.reset(); 3381 - } 3382 - } 3383 - componentDidCatch(error, errorInfo) { 3384 - if (this.props.onCatch) { 3385 - this.props.onCatch(error, errorInfo); 3386 - } 3387 - } 3388 - render() { 3389 - return this.props.children({ 3390 - error: this.state.resetKey !== this.props.getResetKey() ? null : this.state.error, 3391 - reset: () => { 3392 - this.reset(); 3393 - } 3394 - }); 3395 - } 3396 - } 3397 - function ErrorComponent({ error }) { 3398 - const [show, setShow] = React.useState("production" !== "production"); 3399 - return /* @__PURE__ */ jsxs("div", { style: { padding: ".5rem", maxWidth: "100%" }, children: [ 3400 - /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: ".5rem" }, children: [ 3401 - /* @__PURE__ */ jsx("strong", { style: { fontSize: "1rem" }, children: "Something went wrong!" }), 3402 - /* @__PURE__ */ jsx( 3403 - "button", 3404 - { 3405 - style: { 3406 - appearance: "none", 3407 - fontSize: ".6em", 3408 - border: "1px solid currentColor", 3409 - padding: ".1rem .2rem", 3410 - fontWeight: "bold", 3411 - borderRadius: ".25rem" 3412 - }, 3413 - onClick: () => setShow((d) => !d), 3414 - children: show ? "Hide Error" : "Show Error" 3415 - } 3416 - ) 3417 - ] }), 3418 - /* @__PURE__ */ jsx("div", { style: { height: ".25rem" } }), 3419 - show ? /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx( 3420 - "pre", 3421 - { 3422 - style: { 3423 - fontSize: ".7em", 3424 - border: "1px solid red", 3425 - borderRadius: ".25rem", 3426 - padding: ".3rem", 3427 - color: "red", 3428 - overflow: "auto" 3429 - }, 3430 - children: error.message ? /* @__PURE__ */ jsx("code", { children: error.message }) : null 3431 - } 3432 - ) }) : null 3433 - ] }); 3434 - } 3435 - function ClientOnly({ children: children2, fallback = null }) { 3436 - return useHydrated() ? /* @__PURE__ */ jsx(React__default.Fragment, { children: children2 }) : /* @__PURE__ */ jsx(React__default.Fragment, { children: fallback }); 3437 - } 3438 - function useHydrated() { 3439 - return React__default.useSyncExternalStore( 3440 - subscribe, 3441 - () => true, 3442 - () => false 3443 - ); 3444 - } 3445 - function subscribe() { 3446 - return () => { 3447 - }; 3448 - } 3449 - function getDefaultExportFromCjs(x) { 3450 - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; 3451 - } 3452 - var withSelector = { exports: {} }; 3453 - var withSelector_production = {}; 3454 - var shim = { exports: {} }; 3455 - var useSyncExternalStoreShim_production = {}; 3456 - /** 3457 - * @license React 3458 - * use-sync-external-store-shim.production.js 3459 - * 3460 - * Copyright (c) Meta Platforms, Inc. and affiliates. 3461 - * 3462 - * This source code is licensed under the MIT license found in the 3463 - * LICENSE file in the root directory of this source tree. 3464 - */ 3465 - var hasRequiredUseSyncExternalStoreShim_production; 3466 - function requireUseSyncExternalStoreShim_production() { 3467 - if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production; 3468 - hasRequiredUseSyncExternalStoreShim_production = 1; 3469 - var React2 = React__default; 3470 - React2.useState; React2.useEffect; React2.useLayoutEffect; React2.useDebugValue; 3471 - function useSyncExternalStore$1(subscribe2, getSnapshot) { 3472 - return getSnapshot(); 3473 - } 3474 - var shim2 = useSyncExternalStore$1 ; 3475 - useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React2.useSyncExternalStore ? React2.useSyncExternalStore : shim2; 3476 - return useSyncExternalStoreShim_production; 3477 - } 3478 - var hasRequiredShim; 3479 - function requireShim() { 3480 - if (hasRequiredShim) return shim.exports; 3481 - hasRequiredShim = 1; 3482 - { 3483 - shim.exports = requireUseSyncExternalStoreShim_production(); 3484 - } 3485 - return shim.exports; 3486 - } 3487 - /** 3488 - * @license React 3489 - * use-sync-external-store-shim/with-selector.production.js 3490 - * 3491 - * Copyright (c) Meta Platforms, Inc. and affiliates. 3492 - * 3493 - * This source code is licensed under the MIT license found in the 3494 - * LICENSE file in the root directory of this source tree. 3495 - */ 3496 - var hasRequiredWithSelector_production; 3497 - function requireWithSelector_production() { 3498 - if (hasRequiredWithSelector_production) return withSelector_production; 3499 - hasRequiredWithSelector_production = 1; 3500 - var React2 = React__default, shim2 = requireShim(); 3501 - function is(x, y) { 3502 - return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; 3503 - } 3504 - var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef2 = React2.useRef, useEffect2 = React2.useEffect, useMemo = React2.useMemo, useDebugValue = React2.useDebugValue; 3505 - withSelector_production.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot, getServerSnapshot, selector, isEqual) { 3506 - var instRef = useRef2(null); 3507 - if (null === instRef.current) { 3508 - var inst = { hasValue: false, value: null }; 3509 - instRef.current = inst; 3510 - } else inst = instRef.current; 3511 - instRef = useMemo( 3512 - function() { 3513 - function memoizedSelector(nextSnapshot) { 3514 - if (!hasMemo) { 3515 - hasMemo = true; 3516 - memoizedSnapshot = nextSnapshot; 3517 - nextSnapshot = selector(nextSnapshot); 3518 - if (void 0 !== isEqual && inst.hasValue) { 3519 - var currentSelection = inst.value; 3520 - if (isEqual(currentSelection, nextSnapshot)) 3521 - return memoizedSelection = currentSelection; 3522 - } 3523 - return memoizedSelection = nextSnapshot; 3524 - } 3525 - currentSelection = memoizedSelection; 3526 - if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; 3527 - var nextSelection = selector(nextSnapshot); 3528 - if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) 3529 - return memoizedSnapshot = nextSnapshot, currentSelection; 3530 - memoizedSnapshot = nextSnapshot; 3531 - return memoizedSelection = nextSelection; 3532 - } 3533 - var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; 3534 - return [ 3535 - function() { 3536 - return memoizedSelector(getSnapshot()); 3537 - }, 3538 - null === maybeGetServerSnapshot ? void 0 : function() { 3539 - return memoizedSelector(maybeGetServerSnapshot()); 3540 - } 3541 - ]; 3542 - }, 3543 - [getSnapshot, getServerSnapshot, selector, isEqual] 3544 - ); 3545 - var value = useSyncExternalStore(subscribe2, instRef[0], instRef[1]); 3546 - useEffect2( 3547 - function() { 3548 - inst.hasValue = true; 3549 - inst.value = value; 3550 - }, 3551 - [value] 3552 - ); 3553 - useDebugValue(value); 3554 - return value; 3555 - }; 3556 - return withSelector_production; 3557 - } 3558 - var hasRequiredWithSelector; 3559 - function requireWithSelector() { 3560 - if (hasRequiredWithSelector) return withSelector.exports; 3561 - hasRequiredWithSelector = 1; 3562 - { 3563 - withSelector.exports = requireWithSelector_production(); 3564 - } 3565 - return withSelector.exports; 3566 - } 3567 - var withSelectorExports = requireWithSelector(); 3568 - function useStore(store, selector = (d) => d) { 3569 - const slice = withSelectorExports.useSyncExternalStoreWithSelector( 3570 - store.subscribe, 3571 - () => store.state, 3572 - () => store.state, 3573 - selector, 3574 - shallow 3575 - ); 3576 - return slice; 3577 - } 3578 - function shallow(objA, objB) { 3579 - if (Object.is(objA, objB)) { 3580 - return true; 3581 - } 3582 - if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) { 3583 - return false; 3584 - } 3585 - if (objA instanceof Map && objB instanceof Map) { 3586 - if (objA.size !== objB.size) return false; 3587 - for (const [k, v2] of objA) { 3588 - if (!objB.has(k) || !Object.is(v2, objB.get(k))) return false; 3589 - } 3590 - return true; 3591 - } 3592 - if (objA instanceof Set && objB instanceof Set) { 3593 - if (objA.size !== objB.size) return false; 3594 - for (const v2 of objA) { 3595 - if (!objB.has(v2)) return false; 3596 - } 3597 - return true; 3598 - } 3599 - const keysA = Object.keys(objA); 3600 - if (keysA.length !== Object.keys(objB).length) { 3601 - return false; 3602 - } 3603 - for (let i = 0; i < keysA.length; i++) { 3604 - if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) { 3605 - return false; 3606 - } 3607 - } 3608 - return true; 3609 - } 3610 - const routerContext = React.createContext(null); 3611 - function getRouterContext() { 3612 - if (typeof document === "undefined") { 3613 - return routerContext; 3614 - } 3615 - if (window.__TSR_ROUTER_CONTEXT__) { 3616 - return window.__TSR_ROUTER_CONTEXT__; 3617 - } 3618 - window.__TSR_ROUTER_CONTEXT__ = routerContext; 3619 - return routerContext; 3620 - } 3621 - function useRouter(opts) { 3622 - const value = React.useContext(getRouterContext()); 3623 - warning( 3624 - !(((opts == null ? void 0 : opts.warn) ?? true) && !value)); 3625 - return value; 3626 - } 3627 - function useRouterState(opts) { 3628 - const contextRouter = useRouter({ 3629 - warn: (opts == null ? void 0 : opts.router) === void 0 3630 - }); 3631 - const router = (opts == null ? void 0 : opts.router) || contextRouter; 3632 - const previousResult = useRef(void 0); 3633 - return useStore(router.__store, (state) => { 3634 - if (opts == null ? void 0 : opts.select) { 3635 - if (opts.structuralSharing ?? router.options.defaultStructuralSharing) { 3636 - const newSlice = replaceEqualDeep$1( 3637 - previousResult.current, 3638 - opts.select(state) 3639 - ); 3640 - previousResult.current = newSlice; 3641 - return newSlice; 3642 - } 3643 - return opts.select(state); 3644 - } 3645 - return state; 3646 - }); 3647 - } 3648 - const matchContext = React.createContext(void 0); 3649 - const dummyMatchContext = React.createContext( 3650 - void 0 3651 - ); 3652 - function useMatch(opts) { 3653 - const nearestMatchId = React.useContext( 3654 - opts.from ? dummyMatchContext : matchContext 3655 - ); 3656 - const matchSelection = useRouterState({ 3657 - select: (state) => { 3658 - const match = state.matches.find( 3659 - (d) => opts.from ? opts.from === d.routeId : d.id === nearestMatchId 3660 - ); 3661 - invariant( 3662 - !((opts.shouldThrow ?? true) && !match), 3663 - `Could not find ${opts.from ? `an active match from "${opts.from}"` : "a nearest match!"}` 3664 - ); 3665 - if (match === void 0) { 3666 - return void 0; 3667 - } 3668 - return opts.select ? opts.select(match) : match; 3669 - }, 3670 - structuralSharing: opts.structuralSharing 3671 - }); 3672 - return matchSelection; 3673 - } 3674 - function useLoaderData(opts) { 3675 - return useMatch({ 3676 - from: opts.from, 3677 - strict: opts.strict, 3678 - structuralSharing: opts.structuralSharing, 3679 - select: (s) => { 3680 - return opts.select ? opts.select(s.loaderData) : s.loaderData; 3681 - } 3682 - }); 3683 - } 3684 - function useLoaderDeps(opts) { 3685 - const { select, ...rest } = opts; 3686 - return useMatch({ 3687 - ...rest, 3688 - select: (s) => { 3689 - return select ? select(s.loaderDeps) : s.loaderDeps; 3690 - } 3691 - }); 3692 - } 3693 - function useParams(opts) { 3694 - return useMatch({ 3695 - from: opts.from, 3696 - strict: opts.strict, 3697 - shouldThrow: opts.shouldThrow, 3698 - structuralSharing: opts.structuralSharing, 3699 - select: (match) => { 3700 - return opts.select ? opts.select(match.params) : match.params; 3701 - } 3702 - }); 3703 - } 3704 - function useSearch(opts) { 3705 - return useMatch({ 3706 - from: opts.from, 3707 - strict: opts.strict, 3708 - shouldThrow: opts.shouldThrow, 3709 - structuralSharing: opts.structuralSharing, 3710 - select: (match) => { 3711 - return opts.select ? opts.select(match.search) : match.search; 3712 - } 3713 - }); 3714 - } 3715 - function useNavigate(_defaultOpts) { 3716 - const { navigate, state } = useRouter(); 3717 - const matchIndex = useMatch({ 3718 - strict: false, 3719 - select: (match) => match.index 3720 - }); 3721 - return React.useCallback( 3722 - (options) => { 3723 - const from = options.from ?? (_defaultOpts == null ? void 0 : _defaultOpts.from) ?? state.matches[matchIndex].fullPath; 3724 - return navigate({ 3725 - ...options, 3726 - from 3727 - }); 3728 - }, 3729 - // eslint-disable-next-line react-hooks/exhaustive-deps 3730 - [_defaultOpts == null ? void 0 : _defaultOpts.from, navigate] 3731 - ); 3732 - } 3733 - const useLayoutEffect = React.useEffect; 3734 - function usePrevious(value) { 3735 - const ref = React.useRef({ 3736 - value, 3737 - prev: null 3738 - }); 3739 - const current = ref.current.value; 3740 - if (value !== current) { 3741 - ref.current = { 3742 - value, 3743 - prev: current 3744 - }; 3745 - } 3746 - return ref.current.prev; 3747 - } 3748 - function useIntersectionObserver(ref, callback, intersectionObserverOptions = {}, options = {}) { 3749 - const isIntersectionObserverAvailable = React.useRef( 3750 - typeof IntersectionObserver === "function" 3751 - ); 3752 - const observerRef = React.useRef(null); 3753 - React.useEffect(() => { 3754 - if (!ref.current || !isIntersectionObserverAvailable.current || options.disabled) { 3755 - return; 3756 - } 3757 - observerRef.current = new IntersectionObserver(([entry]) => { 3758 - callback(entry); 3759 - }, intersectionObserverOptions); 3760 - observerRef.current.observe(ref.current); 3761 - return () => { 3762 - var _a2; 3763 - (_a2 = observerRef.current) == null ? void 0 : _a2.disconnect(); 3764 - }; 3765 - }, [callback, intersectionObserverOptions, options.disabled, ref]); 3766 - return observerRef.current; 3767 - } 3768 - function useForwardedRef(ref) { 3769 - const innerRef = React.useRef(null); 3770 - React.useImperativeHandle(ref, () => innerRef.current, []); 3771 - return innerRef; 3772 - } 3773 - function useLinkProps(options, forwardedRef) { 3774 - const router = useRouter(); 3775 - const [isTransitioning, setIsTransitioning] = React.useState(false); 3776 - const hasRenderFetched = React.useRef(false); 3777 - const innerRef = useForwardedRef(forwardedRef); 3778 - const { 3779 - // custom props 3780 - activeProps = () => ({ className: "active" }), 3781 - inactiveProps = () => ({}), 3782 - activeOptions, 3783 - to, 3784 - preload: userPreload, 3785 - preloadDelay: userPreloadDelay, 3786 - hashScrollIntoView, 3787 - replace, 3788 - startTransition: startTransition2, 3789 - resetScroll, 3790 - viewTransition, 3791 - // element props 3792 - children: children2, 3793 - target, 3794 - disabled, 3795 - style: style2, 3796 - className: className2, 3797 - onClick, 3798 - onFocus, 3799 - onMouseEnter, 3800 - onMouseLeave, 3801 - onTouchStart, 3802 - ignoreBlocker, 3803 - ...rest 3804 - } = options; 3805 - const { 3806 - // prevent these from being returned 3807 - params: _params, 3808 - search: _search, 3809 - hash: _hash, 3810 - state: _state, 3811 - mask: _mask, 3812 - reloadDocument: _reloadDocument, 3813 - ...propsSafeToSpread 3814 - } = rest; 3815 - const type = React.useMemo(() => { 3816 - try { 3817 - new URL(`${to}`); 3818 - return "external"; 3819 - } catch { 3820 - } 3821 - return "internal"; 3822 - }, [to]); 3823 - const currentSearch = useRouterState({ 3824 - select: (s) => s.location.search, 3825 - structuralSharing: true 3826 - }); 3827 - const nearestFrom = useMatch({ 3828 - strict: false, 3829 - select: (match) => match.fullPath 3830 - }); 3831 - const from = options.from ?? nearestFrom; 3832 - options = { ...options, from }; 3833 - const next = React.useMemo( 3834 - () => router.buildLocation(options), 3835 - // eslint-disable-next-line react-hooks/exhaustive-deps 3836 - [router, options, currentSearch] 3837 - ); 3838 - const preload = React.useMemo(() => { 3839 - if (options.reloadDocument) { 3840 - return false; 3841 - } 3842 - return userPreload ?? router.options.defaultPreload; 3843 - }, [router.options.defaultPreload, userPreload, options.reloadDocument]); 3844 - const preloadDelay = userPreloadDelay ?? router.options.defaultPreloadDelay ?? 0; 3845 - const isActive = useRouterState({ 3846 - select: (s) => { 3847 - if (activeOptions == null ? void 0 : activeOptions.exact) { 3848 - const testExact = exactPathTest( 3849 - s.location.pathname, 3850 - next.pathname, 3851 - router.basepath 3852 - ); 3853 - if (!testExact) { 3854 - return false; 3855 - } 3856 - } else { 3857 - const currentPathSplit = removeTrailingSlash( 3858 - s.location.pathname, 3859 - router.basepath 3860 - ).split("/"); 3861 - const nextPathSplit = removeTrailingSlash( 3862 - next.pathname, 3863 - router.basepath 3864 - ).split("/"); 3865 - const pathIsFuzzyEqual = nextPathSplit.every( 3866 - (d, i) => d === currentPathSplit[i] 3867 - ); 3868 - if (!pathIsFuzzyEqual) { 3869 - return false; 3870 - } 3871 - } 3872 - if ((activeOptions == null ? void 0 : activeOptions.includeSearch) ?? true) { 3873 - const searchTest = deepEqual(s.location.search, next.search, { 3874 - partial: !(activeOptions == null ? void 0 : activeOptions.exact), 3875 - ignoreUndefined: !(activeOptions == null ? void 0 : activeOptions.explicitUndefined) 3876 - }); 3877 - if (!searchTest) { 3878 - return false; 3879 - } 3880 - } 3881 - if (activeOptions == null ? void 0 : activeOptions.includeHash) { 3882 - return s.location.hash === next.hash; 3883 - } 3884 - return true; 3885 - } 3886 - }); 3887 - const doPreload = React.useCallback(() => { 3888 - router.preloadRoute(options).catch((err) => { 3889 - console.warn(err); 3890 - console.warn(preloadWarning); 3891 - }); 3892 - }, [options, router]); 3893 - const preloadViewportIoCallback = React.useCallback( 3894 - (entry) => { 3895 - if (entry == null ? void 0 : entry.isIntersecting) { 3896 - doPreload(); 3897 - } 3898 - }, 3899 - [doPreload] 3900 - ); 3901 - useIntersectionObserver( 3902 - innerRef, 3903 - preloadViewportIoCallback, 3904 - { rootMargin: "100px" }, 3905 - { disabled: !!disabled || !(preload === "viewport") } 3906 - ); 3907 - useLayoutEffect(() => { 3908 - if (hasRenderFetched.current) { 3909 - return; 3910 - } 3911 - if (!disabled && preload === "render") { 3912 - doPreload(); 3913 - hasRenderFetched.current = true; 3914 - } 3915 - }, [disabled, doPreload, preload]); 3916 - if (type === "external") { 3917 - return { 3918 - ...propsSafeToSpread, 3919 - ref: innerRef, 3920 - type, 3921 - href: to, 3922 - ...children2 && { children: children2 }, 3923 - ...target && { target }, 3924 - ...disabled && { disabled }, 3925 - ...style2 && { style: style2 }, 3926 - ...className2 && { className: className2 }, 3927 - ...onClick && { onClick }, 3928 - ...onFocus && { onFocus }, 3929 - ...onMouseEnter && { onMouseEnter }, 3930 - ...onMouseLeave && { onMouseLeave }, 3931 - ...onTouchStart && { onTouchStart } 3932 - }; 3933 - } 3934 - const handleClick = (e) => { 3935 - if (!disabled && !isCtrlEvent(e) && !e.defaultPrevented && (!target || target === "_self") && e.button === 0) { 3936 - e.preventDefault(); 3937 - flushSync(() => { 3938 - setIsTransitioning(true); 3939 - }); 3940 - const unsub = router.subscribe("onResolved", () => { 3941 - unsub(); 3942 - setIsTransitioning(false); 3943 - }); 3944 - return router.navigate({ 3945 - ...options, 3946 - replace, 3947 - resetScroll, 3948 - hashScrollIntoView, 3949 - startTransition: startTransition2, 3950 - viewTransition, 3951 - ignoreBlocker 3952 - }); 3953 - } 3954 - }; 3955 - const handleFocus = (_) => { 3956 - if (disabled) return; 3957 - if (preload) { 3958 - doPreload(); 3959 - } 3960 - }; 3961 - const handleTouchStart = handleFocus; 3962 - const handleEnter = (e) => { 3963 - if (disabled) return; 3964 - const eventTarget = e.target || {}; 3965 - if (preload) { 3966 - if (eventTarget.preloadTimeout) { 3967 - return; 3968 - } 3969 - if (!preloadDelay) { 3970 - doPreload(); 3971 - } else { 3972 - eventTarget.preloadTimeout = setTimeout(() => { 3973 - eventTarget.preloadTimeout = null; 3974 - doPreload(); 3975 - }, preloadDelay); 3976 - } 3977 - } 3978 - }; 3979 - const handleLeave = (e) => { 3980 - if (disabled) return; 3981 - const eventTarget = e.target || {}; 3982 - if (eventTarget.preloadTimeout) { 3983 - clearTimeout(eventTarget.preloadTimeout); 3984 - eventTarget.preloadTimeout = null; 3985 - } 3986 - }; 3987 - const composeHandlers = (handlers) => (e) => { 3988 - var _a2; 3989 - (_a2 = e.persist) == null ? void 0 : _a2.call(e); 3990 - handlers.filter(Boolean).forEach((handler) => { 3991 - if (e.defaultPrevented) return; 3992 - handler(e); 3993 - }); 3994 - }; 3995 - const resolvedActiveProps = isActive ? functionalUpdate$1(activeProps, {}) ?? {} : {}; 3996 - const resolvedInactiveProps = isActive ? {} : functionalUpdate$1(inactiveProps, {}); 3997 - const resolvedClassName = [ 3998 - className2, 3999 - resolvedActiveProps.className, 4000 - resolvedInactiveProps.className 4001 - ].filter(Boolean).join(" "); 4002 - const resolvedStyle = { 4003 - ...style2, 4004 - ...resolvedActiveProps.style, 4005 - ...resolvedInactiveProps.style 4006 - }; 4007 - return { 4008 - ...propsSafeToSpread, 4009 - ...resolvedActiveProps, 4010 - ...resolvedInactiveProps, 4011 - href: disabled ? void 0 : next.maskedLocation ? router.history.createHref(next.maskedLocation.href) : router.history.createHref(next.href), 4012 - ref: innerRef, 4013 - onClick: composeHandlers([onClick, handleClick]), 4014 - onFocus: composeHandlers([onFocus, handleFocus]), 4015 - onMouseEnter: composeHandlers([onMouseEnter, handleEnter]), 4016 - onMouseLeave: composeHandlers([onMouseLeave, handleLeave]), 4017 - onTouchStart: composeHandlers([onTouchStart, handleTouchStart]), 4018 - disabled: !!disabled, 4019 - target, 4020 - ...Object.keys(resolvedStyle).length && { style: resolvedStyle }, 4021 - ...resolvedClassName && { className: resolvedClassName }, 4022 - ...disabled && { 4023 - role: "link", 4024 - "aria-disabled": true 4025 - }, 4026 - ...isActive && { "data-status": "active", "aria-current": "page" }, 4027 - ...isTransitioning && { "data-transitioning": "transitioning" } 4028 - }; 4029 - } 4030 - const Link = React.forwardRef( 4031 - (props, ref) => { 4032 - const { _asChild, ...rest } = props; 4033 - const { 4034 - type: _type, 4035 - ref: innerRef, 4036 - ...linkProps 4037 - } = useLinkProps(rest, ref); 4038 - const children2 = typeof rest.children === "function" ? rest.children({ 4039 - isActive: linkProps["data-status"] === "active" 4040 - }) : rest.children; 4041 - if (typeof _asChild === "undefined") { 4042 - delete linkProps.disabled; 4043 - } 4044 - return React.createElement( 4045 - _asChild ? _asChild : "a", 4046 - { 4047 - ...linkProps, 4048 - ref: innerRef 4049 - }, 4050 - children2 4051 - ); 4052 - } 4053 - ); 4054 - function isCtrlEvent(e) { 4055 - return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey); 4056 - } 4057 - let Route$7 = class Route extends BaseRoute { 4058 - /** 4059 - * @deprecated Use the `createRoute` function instead. 4060 - */ 4061 - constructor(options) { 4062 - super(options); 4063 - this.useMatch = (opts) => { 4064 - return useMatch({ 4065 - select: opts == null ? void 0 : opts.select, 4066 - from: this.id, 4067 - structuralSharing: opts == null ? void 0 : opts.structuralSharing 4068 - }); 4069 - }; 4070 - this.useRouteContext = (opts) => { 4071 - return useMatch({ 4072 - ...opts, 4073 - from: this.id, 4074 - select: (d) => (opts == null ? void 0 : opts.select) ? opts.select(d.context) : d.context 4075 - }); 4076 - }; 4077 - this.useSearch = (opts) => { 4078 - return useSearch({ 4079 - select: opts == null ? void 0 : opts.select, 4080 - structuralSharing: opts == null ? void 0 : opts.structuralSharing, 4081 - from: this.id 4082 - }); 4083 - }; 4084 - this.useParams = (opts) => { 4085 - return useParams({ 4086 - select: opts == null ? void 0 : opts.select, 4087 - structuralSharing: opts == null ? void 0 : opts.structuralSharing, 4088 - from: this.id 4089 - }); 4090 - }; 4091 - this.useLoaderDeps = (opts) => { 4092 - return useLoaderDeps({ ...opts, from: this.id }); 4093 - }; 4094 - this.useLoaderData = (opts) => { 4095 - return useLoaderData({ ...opts, from: this.id }); 4096 - }; 4097 - this.useNavigate = () => { 4098 - return useNavigate({ from: this.fullPath }); 4099 - }; 4100 - this.Link = React__default.forwardRef( 4101 - (props, ref) => { 4102 - return /* @__PURE__ */ jsx(Link, { ref, from: this.fullPath, ...props }); 4103 - } 4104 - ); 4105 - this.$$typeof = Symbol.for("react.memo"); 4106 - } 4107 - }; 4108 - function createRoute(options) { 4109 - return new Route$7(options); 4110 - } 4111 - function createRootRouteWithContext() { 4112 - return (options) => { 4113 - return createRootRoute(options); 4114 - }; 4115 - } 4116 - class RootRoute extends BaseRootRoute { 4117 - /** 4118 - * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead. 4119 - */ 4120 - constructor(options) { 4121 - super(options); 4122 - this.useMatch = (opts) => { 4123 - return useMatch({ 4124 - select: opts == null ? void 0 : opts.select, 4125 - from: this.id, 4126 - structuralSharing: opts == null ? void 0 : opts.structuralSharing 4127 - }); 4128 - }; 4129 - this.useRouteContext = (opts) => { 4130 - return useMatch({ 4131 - ...opts, 4132 - from: this.id, 4133 - select: (d) => (opts == null ? void 0 : opts.select) ? opts.select(d.context) : d.context 4134 - }); 4135 - }; 4136 - this.useSearch = (opts) => { 4137 - return useSearch({ 4138 - select: opts == null ? void 0 : opts.select, 4139 - structuralSharing: opts == null ? void 0 : opts.structuralSharing, 4140 - from: this.id 4141 - }); 4142 - }; 4143 - this.useParams = (opts) => { 4144 - return useParams({ 4145 - select: opts == null ? void 0 : opts.select, 4146 - structuralSharing: opts == null ? void 0 : opts.structuralSharing, 4147 - from: this.id 4148 - }); 4149 - }; 4150 - this.useLoaderDeps = (opts) => { 4151 - return useLoaderDeps({ ...opts, from: this.id }); 4152 - }; 4153 - this.useLoaderData = (opts) => { 4154 - return useLoaderData({ ...opts, from: this.id }); 4155 - }; 4156 - this.useNavigate = () => { 4157 - return useNavigate({ from: this.fullPath }); 4158 - }; 4159 - this.Link = React__default.forwardRef( 4160 - (props, ref) => { 4161 - return /* @__PURE__ */ jsx(Link, { ref, from: this.fullPath, ...props }); 4162 - } 4163 - ); 4164 - this.$$typeof = Symbol.for("react.memo"); 4165 - } 4166 - } 4167 - function createRootRoute(options) { 4168 - return new RootRoute(options); 4169 - } 4170 - function createFileRoute(path) { 4171 - if (typeof path === "object") { 4172 - return new FileRoute(path, { 4173 - silent: true 4174 - }).createRoute(path); 4175 - } 4176 - return new FileRoute(path, { 4177 - silent: true 4178 - }).createRoute; 4179 - } 4180 - class FileRoute { 4181 - constructor(path, _opts) { 4182 - this.path = path; 4183 - this.createRoute = (options) => { 4184 - warning( 4185 - this.silent); 4186 - const route = createRoute(options); 4187 - route.isRoot = false; 4188 - return route; 4189 - }; 4190 - this.silent = _opts == null ? void 0 : _opts.silent; 4191 - } 4192 - } 4193 - class LazyRoute { 4194 - constructor(opts) { 4195 - this.useMatch = (opts2) => { 4196 - return useMatch({ 4197 - select: opts2 == null ? void 0 : opts2.select, 4198 - from: this.options.id, 4199 - structuralSharing: opts2 == null ? void 0 : opts2.structuralSharing 4200 - }); 4201 - }; 4202 - this.useRouteContext = (opts2) => { 4203 - return useMatch({ 4204 - from: this.options.id, 4205 - select: (d) => (opts2 == null ? void 0 : opts2.select) ? opts2.select(d.context) : d.context 4206 - }); 4207 - }; 4208 - this.useSearch = (opts2) => { 4209 - return useSearch({ 4210 - select: opts2 == null ? void 0 : opts2.select, 4211 - structuralSharing: opts2 == null ? void 0 : opts2.structuralSharing, 4212 - from: this.options.id 4213 - }); 4214 - }; 4215 - this.useParams = (opts2) => { 4216 - return useParams({ 4217 - select: opts2 == null ? void 0 : opts2.select, 4218 - structuralSharing: opts2 == null ? void 0 : opts2.structuralSharing, 4219 - from: this.options.id 4220 - }); 4221 - }; 4222 - this.useLoaderDeps = (opts2) => { 4223 - return useLoaderDeps({ ...opts2, from: this.options.id }); 4224 - }; 4225 - this.useLoaderData = (opts2) => { 4226 - return useLoaderData({ ...opts2, from: this.options.id }); 4227 - }; 4228 - this.useNavigate = () => { 4229 - const router = useRouter(); 4230 - return useNavigate({ from: router.routesById[this.options.id].fullPath }); 4231 - }; 4232 - this.options = opts; 4233 - this.$$typeof = Symbol.for("react.memo"); 4234 - } 4235 - } 4236 - function createLazyFileRoute(id) { 4237 - if (typeof id === "object") { 4238 - return new LazyRoute(id); 4239 - } 4240 - return (opts) => new LazyRoute({ id, ...opts }); 4241 - } 4242 - function CatchNotFound(props) { 4243 - const resetKey = useRouterState({ 4244 - select: (s) => `not-found-${s.location.pathname}-${s.status}` 4245 - }); 4246 - return /* @__PURE__ */ jsx( 4247 - CatchBoundary, 4248 - { 4249 - getResetKey: () => resetKey, 4250 - onCatch: (error, errorInfo) => { 4251 - var _a2; 4252 - if (isNotFound(error)) { 4253 - (_a2 = props.onCatch) == null ? void 0 : _a2.call(props, error, errorInfo); 4254 - } else { 4255 - throw error; 4256 - } 4257 - }, 4258 - errorComponent: ({ error }) => { 4259 - var _a2; 4260 - if (isNotFound(error)) { 4261 - return (_a2 = props.fallback) == null ? void 0 : _a2.call(props, error); 4262 - } else { 4263 - throw error; 4264 - } 4265 - }, 4266 - children: props.children 4267 - } 4268 - ); 4269 - } 4270 - function DefaultGlobalNotFound() { 4271 - return /* @__PURE__ */ jsx("p", { children: "Not Found" }); 4272 - } 4273 - function SafeFragment(props) { 4274 - return /* @__PURE__ */ jsx(Fragment, { children: props.children }); 4275 - } 4276 - function renderRouteNotFound(router, route, data) { 4277 - if (!route.options.notFoundComponent) { 4278 - if (router.options.defaultNotFoundComponent) { 4279 - return /* @__PURE__ */ jsx(router.options.defaultNotFoundComponent, { data }); 4280 - } 4281 - return /* @__PURE__ */ jsx(DefaultGlobalNotFound, {}); 4282 - } 4283 - return /* @__PURE__ */ jsx(route.options.notFoundComponent, { data }); 4284 - } 4285 - var jsesc_1; 4286 - var hasRequiredJsesc; 4287 - function requireJsesc() { 4288 - if (hasRequiredJsesc) return jsesc_1; 4289 - hasRequiredJsesc = 1; 4290 - const object = {}; 4291 - const hasOwnProperty = object.hasOwnProperty; 4292 - const forOwn = (object2, callback) => { 4293 - for (const key in object2) { 4294 - if (hasOwnProperty.call(object2, key)) { 4295 - callback(key, object2[key]); 4296 - } 4297 - } 4298 - }; 4299 - const extend = (destination, source) => { 4300 - if (!source) { 4301 - return destination; 4302 - } 4303 - forOwn(source, (key, value) => { 4304 - destination[key] = value; 4305 - }); 4306 - return destination; 4307 - }; 4308 - const forEach2 = (array, callback) => { 4309 - const length = array.length; 4310 - let index2 = -1; 4311 - while (++index2 < length) { 4312 - callback(array[index2]); 4313 - } 4314 - }; 4315 - const fourHexEscape = (hex) => { 4316 - return "\\u" + ("0000" + hex).slice(-4); 4317 - }; 4318 - const hexadecimal = (code, lowercase) => { 4319 - let hexadecimal2 = code.toString(16); 4320 - if (lowercase) return hexadecimal2; 4321 - return hexadecimal2.toUpperCase(); 4322 - }; 4323 - const toString = object.toString; 4324 - const isArray3 = Array.isArray; 4325 - const isBuffer = (value) => { 4326 - return typeof Buffer === "function" && Buffer.isBuffer(value); 4327 - }; 4328 - const isObject = (value) => { 4329 - return toString.call(value) == "[object Object]"; 4330 - }; 4331 - const isString2 = (value) => { 4332 - return typeof value == "string" || toString.call(value) == "[object String]"; 4333 - }; 4334 - const isNumber2 = (value) => { 4335 - return typeof value == "number" || toString.call(value) == "[object Number]"; 4336 - }; 4337 - const isBigInt = (value) => { 4338 - return typeof value == "bigint"; 4339 - }; 4340 - const isFunction2 = (value) => { 4341 - return typeof value == "function"; 4342 - }; 4343 - const isMap2 = (value) => { 4344 - return toString.call(value) == "[object Map]"; 4345 - }; 4346 - const isSet2 = (value) => { 4347 - return toString.call(value) == "[object Set]"; 4348 - }; 4349 - const singleEscapes = { 4350 - "\\": "\\\\", 4351 - "\b": "\\b", 4352 - "\f": "\\f", 4353 - "\n": "\\n", 4354 - "\r": "\\r", 4355 - " ": "\\t" 4356 - // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'. 4357 - // '\v': '\\x0B' 4358 - }; 4359 - const regexSingleEscape = /[\\\b\f\n\r\t]/; 4360 - const regexDigit = /[0-9]/; 4361 - const regexWhitespace = /[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; 4362 - const escapeEverythingRegex = /([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g; 4363 - const escapeNonAsciiRegex = /([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g; 4364 - const jsesc2 = (argument, options) => { 4365 - const increaseIndentation = () => { 4366 - oldIndent = indent; 4367 - ++options.indentLevel; 4368 - indent = options.indent.repeat(options.indentLevel); 4369 - }; 4370 - const defaults = { 4371 - "escapeEverything": false, 4372 - "minimal": false, 4373 - "isScriptContext": false, 4374 - "quotes": "single", 4375 - "wrap": false, 4376 - "es6": false, 4377 - "json": false, 4378 - "compact": true, 4379 - "lowercaseHex": false, 4380 - "numbers": "decimal", 4381 - "indent": " ", 4382 - "indentLevel": 0, 4383 - "__inline1__": false, 4384 - "__inline2__": false 4385 - }; 4386 - const json2 = options && options.json; 4387 - if (json2) { 4388 - defaults.quotes = "double"; 4389 - defaults.wrap = true; 4390 - } 4391 - options = extend(defaults, options); 4392 - if (options.quotes != "single" && options.quotes != "double" && options.quotes != "backtick") { 4393 - options.quotes = "single"; 4394 - } 4395 - const quote = options.quotes == "double" ? '"' : options.quotes == "backtick" ? "`" : "'"; 4396 - const compact = options.compact; 4397 - const lowercaseHex = options.lowercaseHex; 4398 - let indent = options.indent.repeat(options.indentLevel); 4399 - let oldIndent = ""; 4400 - const inline1 = options.__inline1__; 4401 - const inline2 = options.__inline2__; 4402 - const newLine = compact ? "" : "\n"; 4403 - let result; 4404 - let isEmpty = true; 4405 - const useBinNumbers = options.numbers == "binary"; 4406 - const useOctNumbers = options.numbers == "octal"; 4407 - const useDecNumbers = options.numbers == "decimal"; 4408 - const useHexNumbers = options.numbers == "hexadecimal"; 4409 - if (json2 && argument && isFunction2(argument.toJSON)) { 4410 - argument = argument.toJSON(); 4411 - } 4412 - if (!isString2(argument)) { 4413 - if (isMap2(argument)) { 4414 - if (argument.size == 0) { 4415 - return "new Map()"; 4416 - } 4417 - if (!compact) { 4418 - options.__inline1__ = true; 4419 - options.__inline2__ = false; 4420 - } 4421 - return "new Map(" + jsesc2(Array.from(argument), options) + ")"; 4422 - } 4423 - if (isSet2(argument)) { 4424 - if (argument.size == 0) { 4425 - return "new Set()"; 4426 - } 4427 - return "new Set(" + jsesc2(Array.from(argument), options) + ")"; 4428 - } 4429 - if (isBuffer(argument)) { 4430 - if (argument.length == 0) { 4431 - return "Buffer.from([])"; 4432 - } 4433 - return "Buffer.from(" + jsesc2(Array.from(argument), options) + ")"; 4434 - } 4435 - if (isArray3(argument)) { 4436 - result = []; 4437 - options.wrap = true; 4438 - if (inline1) { 4439 - options.__inline1__ = false; 4440 - options.__inline2__ = true; 4441 - } 4442 - if (!inline2) { 4443 - increaseIndentation(); 4444 - } 4445 - forEach2(argument, (value) => { 4446 - isEmpty = false; 4447 - if (inline2) { 4448 - options.__inline2__ = false; 4449 - } 4450 - result.push( 4451 - (compact || inline2 ? "" : indent) + jsesc2(value, options) 4452 - ); 4453 - }); 4454 - if (isEmpty) { 4455 - return "[]"; 4456 - } 4457 - if (inline2) { 4458 - return "[" + result.join(", ") + "]"; 4459 - } 4460 - return "[" + newLine + result.join("," + newLine) + newLine + (compact ? "" : oldIndent) + "]"; 4461 - } else if (isNumber2(argument) || isBigInt(argument)) { 4462 - if (json2) { 4463 - return JSON.stringify(Number(argument)); 4464 - } 4465 - let result2; 4466 - if (useDecNumbers) { 4467 - result2 = String(argument); 4468 - } else if (useHexNumbers) { 4469 - let hexadecimal2 = argument.toString(16); 4470 - if (!lowercaseHex) { 4471 - hexadecimal2 = hexadecimal2.toUpperCase(); 4472 - } 4473 - result2 = "0x" + hexadecimal2; 4474 - } else if (useBinNumbers) { 4475 - result2 = "0b" + argument.toString(2); 4476 - } else if (useOctNumbers) { 4477 - result2 = "0o" + argument.toString(8); 4478 - } 4479 - if (isBigInt(argument)) { 4480 - return result2 + "n"; 4481 - } 4482 - return result2; 4483 - } else if (isBigInt(argument)) { 4484 - if (json2) { 4485 - return JSON.stringify(Number(argument)); 4486 - } 4487 - return argument + "n"; 4488 - } else if (!isObject(argument)) { 4489 - if (json2) { 4490 - return JSON.stringify(argument) || "null"; 4491 - } 4492 - return String(argument); 4493 - } else { 4494 - result = []; 4495 - options.wrap = true; 4496 - increaseIndentation(); 4497 - forOwn(argument, (key, value) => { 4498 - isEmpty = false; 4499 - result.push( 4500 - (compact ? "" : indent) + jsesc2(key, options) + ":" + (compact ? "" : " ") + jsesc2(value, options) 4501 - ); 4502 - }); 4503 - if (isEmpty) { 4504 - return "{}"; 4505 - } 4506 - return "{" + newLine + result.join("," + newLine) + newLine + (compact ? "" : oldIndent) + "}"; 4507 - } 4508 - } 4509 - const regex = options.escapeEverything ? escapeEverythingRegex : escapeNonAsciiRegex; 4510 - result = argument.replace(regex, (char, pair, lone, quoteChar, index2, string) => { 4511 - if (pair) { 4512 - if (options.minimal) return pair; 4513 - const first = pair.charCodeAt(0); 4514 - const second = pair.charCodeAt(1); 4515 - if (options.es6) { 4516 - const codePoint = (first - 55296) * 1024 + second - 56320 + 65536; 4517 - const hex2 = hexadecimal(codePoint, lowercaseHex); 4518 - return "\\u{" + hex2 + "}"; 4519 - } 4520 - return fourHexEscape(hexadecimal(first, lowercaseHex)) + fourHexEscape(hexadecimal(second, lowercaseHex)); 4521 - } 4522 - if (lone) { 4523 - return fourHexEscape(hexadecimal(lone.charCodeAt(0), lowercaseHex)); 4524 - } 4525 - if (char == "\0" && !json2 && !regexDigit.test(string.charAt(index2 + 1))) { 4526 - return "\\0"; 4527 - } 4528 - if (quoteChar) { 4529 - if (quoteChar == quote || options.escapeEverything) { 4530 - return "\\" + quoteChar; 4531 - } 4532 - return quoteChar; 4533 - } 4534 - if (regexSingleEscape.test(char)) { 4535 - return singleEscapes[char]; 4536 - } 4537 - if (options.minimal && !regexWhitespace.test(char)) { 4538 - return char; 4539 - } 4540 - const hex = hexadecimal(char.charCodeAt(0), lowercaseHex); 4541 - if (json2 || hex.length > 2) { 4542 - return fourHexEscape(hex); 4543 - } 4544 - return "\\x" + ("00" + hex).slice(-2); 4545 - }); 4546 - if (quote == "`") { 4547 - result = result.replace(/\$\{/g, "\\${"); 4548 - } 4549 - if (options.isScriptContext) { 4550 - result = result.replace(/<\/(script|style)/gi, "<\\/$1").replace(/<!--/g, json2 ? "\\u003C!--" : "\\x3C!--"); 4551 - } 4552 - if (options.wrap) { 4553 - result = quote + result + quote; 4554 - } 4555 - return result; 4556 - }; 4557 - jsesc2.version = "3.0.2"; 4558 - jsesc_1 = jsesc2; 4559 - return jsesc_1; 4560 - } 4561 - var jsescExports = requireJsesc(); 4562 - const jsesc = /* @__PURE__ */ getDefaultExportFromCjs(jsescExports); 4563 - function ScriptOnce({ 4564 - children: children2, 4565 - log 4566 - }) { 4567 - if (typeof document !== "undefined") { 4568 - return null; 4569 - } 4570 - return /* @__PURE__ */ jsx( 4571 - "script", 4572 - { 4573 - className: "tsr-once", 4574 - dangerouslySetInnerHTML: { 4575 - __html: [ 4576 - children2, 4577 - "", 4578 - 'if (typeof __TSR_SSR__ !== "undefined") __TSR_SSR__.cleanScripts()' 4579 - ].filter(Boolean).join("\n") 4580 - } 4581 - } 4582 - ); 4583 - } 4584 - function ScrollRestoration() { 4585 - const router = useRouter(); 4586 - const getKey = router.options.getScrollRestorationKey || defaultGetScrollRestorationKey; 4587 - const userKey = getKey(router.latestLocation); 4588 - const resolvedKey = userKey !== defaultGetScrollRestorationKey(router.latestLocation) ? userKey : null; 4589 - if (!router.isScrollRestoring || !router.isServer) { 4590 - return null; 4591 - } 4592 - return /* @__PURE__ */ jsx( 4593 - ScriptOnce, 4594 - { 4595 - children: `(${restoreScroll.toString()})(${JSON.stringify(storageKey)},${JSON.stringify(resolvedKey)}, undefined, true)`, 4596 - log: false 4597 - } 4598 - ); 4599 - } 4600 - const Match$1 = React.memo(function MatchImpl({ 4601 - matchId 4602 - }) { 4603 - var _a2, _b2; 4604 - const router = useRouter(); 4605 - const routeId = useRouterState({ 4606 - select: (s) => { 4607 - var _a22; 4608 - return (_a22 = s.matches.find((d) => d.id === matchId)) == null ? void 0 : _a22.routeId; 4609 - } 4610 - }); 4611 - invariant( 4612 - routeId); 4613 - const route = router.routesById[routeId]; 4614 - const PendingComponent = route.options.pendingComponent ?? router.options.defaultPendingComponent; 4615 - const pendingElement = PendingComponent ? /* @__PURE__ */ jsx(PendingComponent, {}) : null; 4616 - const routeErrorComponent = route.options.errorComponent ?? router.options.defaultErrorComponent; 4617 - const routeOnCatch = route.options.onCatch ?? router.options.defaultOnCatch; 4618 - const routeNotFoundComponent = route.isRoot ? ( 4619 - // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component 4620 - route.options.notFoundComponent ?? ((_a2 = router.options.notFoundRoute) == null ? void 0 : _a2.options.component) 4621 - ) : route.options.notFoundComponent; 4622 - const ResolvedSuspenseBoundary = ( 4623 - // If we're on the root route, allow forcefully wrapping in suspense 4624 - (!route.isRoot || route.options.wrapInSuspense) && (route.options.wrapInSuspense ?? PendingComponent ?? ((_b2 = route.options.errorComponent) == null ? void 0 : _b2.preload)) ? React.Suspense : SafeFragment 4625 - ); 4626 - const ResolvedCatchBoundary = routeErrorComponent ? CatchBoundary : SafeFragment; 4627 - const ResolvedNotFoundBoundary = routeNotFoundComponent ? CatchNotFound : SafeFragment; 4628 - const resetKey = useRouterState({ 4629 - select: (s) => s.loadedAt 4630 - }); 4631 - const parentRouteId = useRouterState({ 4632 - select: (s) => { 4633 - var _a22; 4634 - const index2 = s.matches.findIndex((d) => d.id === matchId); 4635 - return (_a22 = s.matches[index2 - 1]) == null ? void 0 : _a22.routeId; 4636 - } 4637 - }); 4638 - return /* @__PURE__ */ jsxs(Fragment, { children: [ 4639 - /* @__PURE__ */ jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsx(ResolvedSuspenseBoundary, { fallback: pendingElement, children: /* @__PURE__ */ jsx( 4640 - ResolvedCatchBoundary, 4641 - { 4642 - getResetKey: () => resetKey, 4643 - errorComponent: routeErrorComponent || ErrorComponent, 4644 - onCatch: (error, errorInfo) => { 4645 - if (isNotFound(error)) throw error; 4646 - routeOnCatch == null ? void 0 : routeOnCatch(error, errorInfo); 4647 - }, 4648 - children: /* @__PURE__ */ jsx( 4649 - ResolvedNotFoundBoundary, 4650 - { 4651 - fallback: (error) => { 4652 - if (!routeNotFoundComponent || error.routeId && error.routeId !== routeId || !error.routeId && !route.isRoot) 4653 - throw error; 4654 - return React.createElement(routeNotFoundComponent, error); 4655 - }, 4656 - children: /* @__PURE__ */ jsx(MatchInner, { matchId }) 4657 - } 4658 - ) 4659 - } 4660 - ) }) }), 4661 - parentRouteId === rootRouteId && router.options.scrollRestoration ? /* @__PURE__ */ jsxs(Fragment, { children: [ 4662 - /* @__PURE__ */ jsx(OnRendered, {}), 4663 - /* @__PURE__ */ jsx(ScrollRestoration, {}) 4664 - ] }) : null 4665 - ] }); 4666 - }); 4667 - function OnRendered() { 4668 - const router = useRouter(); 4669 - const prevLocationRef = React.useRef( 4670 - void 0 4671 - ); 4672 - return /* @__PURE__ */ jsx( 4673 - "script", 4674 - { 4675 - suppressHydrationWarning: true, 4676 - ref: (el) => { 4677 - if (el && (prevLocationRef.current === void 0 || prevLocationRef.current.href !== router.latestLocation.href)) { 4678 - router.emit({ 4679 - type: "onRendered", 4680 - ...getLocationChangeInfo(router.state) 4681 - }); 4682 - prevLocationRef.current = router.latestLocation; 4683 - } 4684 - } 4685 - }, 4686 - router.latestLocation.state.key 4687 - ); 4688 - } 4689 - const MatchInner = React.memo(function MatchInnerImpl({ 4690 - matchId 4691 - }) { 4692 - var _a2, _b2, _c2; 4693 - const router = useRouter(); 4694 - const { match, key, routeId } = useRouterState({ 4695 - select: (s) => { 4696 - const matchIndex = s.matches.findIndex((d) => d.id === matchId); 4697 - const match2 = s.matches[matchIndex]; 4698 - const routeId2 = match2.routeId; 4699 - const remountFn = router.routesById[routeId2].options.remountDeps ?? router.options.defaultRemountDeps; 4700 - const remountDeps = remountFn == null ? void 0 : remountFn({ 4701 - routeId: routeId2, 4702 - loaderDeps: match2.loaderDeps, 4703 - params: match2._strictParams, 4704 - search: match2._strictSearch 4705 - }); 4706 - const key2 = remountDeps ? JSON.stringify(remountDeps) : void 0; 4707 - return { 4708 - key: key2, 4709 - routeId: routeId2, 4710 - match: pick(match2, ["id", "status", "error"]) 4711 - }; 4712 - }, 4713 - structuralSharing: true 4714 - }); 4715 - const route = router.routesById[routeId]; 4716 - const out = React.useMemo(() => { 4717 - const Comp = route.options.component ?? router.options.defaultComponent; 4718 - if (Comp) { 4719 - return /* @__PURE__ */ jsx(Comp, {}, key); 4720 - } 4721 - return /* @__PURE__ */ jsx(Outlet, {}); 4722 - }, [key, route.options.component, router.options.defaultComponent]); 4723 - const RouteErrorComponent = (route.options.errorComponent ?? router.options.defaultErrorComponent) || ErrorComponent; 4724 - if (match.status === "notFound") { 4725 - invariant(isNotFound(match.error)); 4726 - return renderRouteNotFound(router, route, match.error); 4727 - } 4728 - if (match.status === "redirected") { 4729 - invariant(isRedirect(match.error)); 4730 - throw (_a2 = router.getMatch(match.id)) == null ? void 0 : _a2.loadPromise; 4731 - } 4732 - if (match.status === "error") { 4733 - if (router.isServer) { 4734 - return /* @__PURE__ */ jsx( 4735 - RouteErrorComponent, 4736 - { 4737 - error: match.error, 4738 - reset: void 0, 4739 - info: { 4740 - componentStack: "" 4741 - } 4742 - } 4743 - ); 4744 - } 4745 - throw match.error; 4746 - } 4747 - if (match.status === "pending") { 4748 - const pendingMinMs = route.options.pendingMinMs ?? router.options.defaultPendingMinMs; 4749 - if (pendingMinMs && !((_b2 = router.getMatch(match.id)) == null ? void 0 : _b2.minPendingPromise)) { 4750 - if (!router.isServer) { 4751 - const minPendingPromise = createControlledPromise(); 4752 - Promise.resolve().then(() => { 4753 - router.updateMatch(match.id, (prev) => ({ 4754 - ...prev, 4755 - minPendingPromise 4756 - })); 4757 - }); 4758 - setTimeout(() => { 4759 - minPendingPromise.resolve(); 4760 - router.updateMatch(match.id, (prev) => ({ 4761 - ...prev, 4762 - minPendingPromise: void 0 4763 - })); 4764 - }, pendingMinMs); 4765 - } 4766 - } 4767 - throw (_c2 = router.getMatch(match.id)) == null ? void 0 : _c2.loadPromise; 4768 - } 4769 - return out; 4770 - }); 4771 - const Outlet = React.memo(function OutletImpl() { 4772 - const router = useRouter(); 4773 - const matchId = React.useContext(matchContext); 4774 - const routeId = useRouterState({ 4775 - select: (s) => { 4776 - var _a2; 4777 - return (_a2 = s.matches.find((d) => d.id === matchId)) == null ? void 0 : _a2.routeId; 4778 - } 4779 - }); 4780 - const route = router.routesById[routeId]; 4781 - const parentGlobalNotFound = useRouterState({ 4782 - select: (s) => { 4783 - const matches = s.matches; 4784 - const parentMatch = matches.find((d) => d.id === matchId); 4785 - invariant( 4786 - parentMatch); 4787 - return parentMatch.globalNotFound; 4788 - } 4789 - }); 4790 - const childMatchId = useRouterState({ 4791 - select: (s) => { 4792 - var _a2; 4793 - const matches = s.matches; 4794 - const index2 = matches.findIndex((d) => d.id === matchId); 4795 - return (_a2 = matches[index2 + 1]) == null ? void 0 : _a2.id; 4796 - } 4797 - }); 4798 - const pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ jsx(router.options.defaultPendingComponent, {}) : null; 4799 - if (router.isShell) 4800 - return /* @__PURE__ */ jsx(React.Suspense, { fallback: pendingElement, children: /* @__PURE__ */ jsx(ShellInner, {}) }); 4801 - if (parentGlobalNotFound) { 4802 - return renderRouteNotFound(router, route, void 0); 4803 - } 4804 - if (!childMatchId) { 4805 - return null; 4806 - } 4807 - const nextMatch = /* @__PURE__ */ jsx(Match$1, { matchId: childMatchId }); 4808 - if (matchId === rootRouteId) { 4809 - return /* @__PURE__ */ jsx(React.Suspense, { fallback: pendingElement, children: nextMatch }); 4810 - } 4811 - return nextMatch; 4812 - }); 4813 - function ShellInner() { 4814 - throw new Error("ShellBoundaryError"); 4815 - } 4816 - function isModuleNotFoundError(error) { 4817 - if (typeof (error == null ? void 0 : error.message) !== "string") return false; 4818 - return error.message.startsWith("Failed to fetch dynamically imported module") || error.message.startsWith("error loading dynamically imported module") || error.message.startsWith("Importing a module script failed"); 4819 - } 4820 - function lazyRouteComponent(importer, exportName, ssr) { 4821 - let loadPromise; 4822 - let comp; 4823 - let error; 4824 - const load = () => { 4825 - if (typeof document === "undefined" && (ssr == null ? void 0 : ssr()) === false) { 4826 - comp = () => null; 4827 - return Promise.resolve(); 4828 - } 4829 - if (!loadPromise) { 4830 - loadPromise = importer().then((res) => { 4831 - loadPromise = void 0; 4832 - comp = res[exportName ?? "default"]; 4833 - }).catch((err) => { 4834 - error = err; 4835 - if (isModuleNotFoundError(error)) ; 4836 - }); 4837 - } 4838 - return loadPromise; 4839 - }; 4840 - const lazyComp = function Lazy(props) { 4841 - if (error) { 4842 - throw error; 4843 - } 4844 - if (!comp) { 4845 - throw load(); 4846 - } 4847 - if ((ssr == null ? void 0 : ssr()) === false) { 4848 - return /* @__PURE__ */ jsx(ClientOnly, { fallback: /* @__PURE__ */ jsx(Outlet, {}), children: React.createElement(comp, props) }); 4849 - } 4850 - return React.createElement(comp, props); 4851 - }; 4852 - lazyComp.preload = load; 4853 - return lazyComp; 4854 - } 4855 - function Transitioner() { 4856 - const router = useRouter(); 4857 - const mountLoadForRouter = React.useRef({ router, mounted: false }); 4858 - const isLoading = useRouterState({ 4859 - select: ({ isLoading: isLoading2 }) => isLoading2 4860 - }); 4861 - const [isTransitioning, setIsTransitioning] = React.useState(false); 4862 - const hasPendingMatches = useRouterState({ 4863 - select: (s) => s.matches.some((d) => d.status === "pending"), 4864 - structuralSharing: true 4865 - }); 4866 - const previousIsLoading = usePrevious(isLoading); 4867 - const isAnyPending = isLoading || isTransitioning || hasPendingMatches; 4868 - const previousIsAnyPending = usePrevious(isAnyPending); 4869 - const isPagePending = isLoading || hasPendingMatches; 4870 - const previousIsPagePending = usePrevious(isPagePending); 4871 - if (!router.isServer) { 4872 - router.startTransition = (fn) => { 4873 - setIsTransitioning(true); 4874 - React.startTransition(() => { 4875 - fn(); 4876 - setIsTransitioning(false); 4877 - }); 4878 - }; 4879 - } 4880 - React.useEffect(() => { 4881 - const unsub = router.history.subscribe(router.load); 4882 - const nextLocation = router.buildLocation({ 4883 - to: router.latestLocation.pathname, 4884 - search: true, 4885 - params: true, 4886 - hash: true, 4887 - state: true, 4888 - _includeValidateSearch: true 4889 - }); 4890 - if (trimPathRight(router.latestLocation.href) !== trimPathRight(nextLocation.href)) { 4891 - router.commitLocation({ ...nextLocation, replace: true }); 4892 - } 4893 - return () => { 4894 - unsub(); 4895 - }; 4896 - }, [router, router.history]); 4897 - useLayoutEffect(() => { 4898 - if (mountLoadForRouter.current.router === router && mountLoadForRouter.current.mounted) { 4899 - return; 4900 - } 4901 - mountLoadForRouter.current = { router, mounted: true }; 4902 - const tryLoad = async () => { 4903 - try { 4904 - await router.load(); 4905 - } catch (err) { 4906 - console.error(err); 4907 - } 4908 - }; 4909 - tryLoad(); 4910 - }, [router]); 4911 - useLayoutEffect(() => { 4912 - if (previousIsLoading && !isLoading) { 4913 - router.emit({ 4914 - type: "onLoad", 4915 - // When the new URL has committed, when the new matches have been loaded into state.matches 4916 - ...getLocationChangeInfo(router.state) 4917 - }); 4918 - } 4919 - }, [previousIsLoading, router, isLoading]); 4920 - useLayoutEffect(() => { 4921 - if (previousIsPagePending && !isPagePending) { 4922 - router.emit({ 4923 - type: "onBeforeRouteMount", 4924 - ...getLocationChangeInfo(router.state) 4925 - }); 4926 - } 4927 - }, [isPagePending, previousIsPagePending, router]); 4928 - useLayoutEffect(() => { 4929 - if (previousIsAnyPending && !isAnyPending) { 4930 - router.emit({ 4931 - type: "onResolved", 4932 - ...getLocationChangeInfo(router.state) 4933 - }); 4934 - router.__store.setState((s) => ({ 4935 - ...s, 4936 - status: "idle", 4937 - resolvedLocation: s.location 4938 - })); 4939 - handleHashScroll(router); 4940 - } 4941 - }, [isAnyPending, previousIsAnyPending, router]); 4942 - return null; 4943 - } 4944 - function Matches() { 4945 - const router = useRouter(); 4946 - const pendingElement = router.options.defaultPendingComponent ? /* @__PURE__ */ jsx(router.options.defaultPendingComponent, {}) : null; 4947 - const ResolvedSuspense = router.isServer || typeof document !== "undefined" && router.clientSsr ? SafeFragment : React.Suspense; 4948 - const inner = /* @__PURE__ */ jsxs(ResolvedSuspense, { fallback: pendingElement, children: [ 4949 - /* @__PURE__ */ jsx(Transitioner, {}), 4950 - /* @__PURE__ */ jsx(MatchesInner, {}) 4951 - ] }); 4952 - return router.options.InnerWrap ? /* @__PURE__ */ jsx(router.options.InnerWrap, { children: inner }) : inner; 4953 - } 4954 - function MatchesInner() { 4955 - const matchId = useRouterState({ 4956 - select: (s) => { 4957 - var _a2; 4958 - return (_a2 = s.matches[0]) == null ? void 0 : _a2.id; 4959 - } 4960 - }); 4961 - const resetKey = useRouterState({ 4962 - select: (s) => s.loadedAt 4963 - }); 4964 - return /* @__PURE__ */ jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsx( 4965 - CatchBoundary, 4966 - { 4967 - getResetKey: () => resetKey, 4968 - errorComponent: ErrorComponent, 4969 - onCatch: (error) => { 4970 - warning(false, error.message || error.toString()); 4971 - }, 4972 - children: matchId ? /* @__PURE__ */ jsx(Match$1, { matchId }) : null 4973 - } 4974 - ) }); 4975 - } 4976 - const createRouter$1 = (options) => { 4977 - return new Router(options); 4978 - }; 4979 - class Router extends RouterCore { 4980 - constructor(options) { 4981 - super(options); 4982 - } 4983 - } 4984 - if (typeof globalThis !== "undefined") { 4985 - globalThis.createFileRoute = createFileRoute; 4986 - globalThis.createLazyFileRoute = createLazyFileRoute; 4987 - } 4988 - function RouterContextProvider({ 4989 - router, 4990 - children: children2, 4991 - ...rest 4992 - }) { 4993 - if (Object.keys(rest).length > 0) { 4994 - router.update({ 4995 - ...router.options, 4996 - ...rest, 4997 - context: { 4998 - ...router.options.context, 4999 - ...rest.context 5000 - } 5001 - }); 5002 - } 5003 - const routerContext2 = getRouterContext(); 5004 - const provider = /* @__PURE__ */ jsx(routerContext2.Provider, { value: router, children: children2 }); 5005 - if (router.options.Wrap) { 5006 - return /* @__PURE__ */ jsx(router.options.Wrap, { children: provider }); 5007 - } 5008 - return provider; 5009 - } 5010 - function RouterProvider({ router, ...rest }) { 5011 - return /* @__PURE__ */ jsx(RouterContextProvider, { router, ...rest, children: /* @__PURE__ */ jsx(Matches, {}) }); 5012 - } 5013 - function Asset({ tag, attrs, children: children2 }) { 5014 - switch (tag) { 5015 - case "title": 5016 - return /* @__PURE__ */ jsx("title", { ...attrs, suppressHydrationWarning: true, children: children2 }); 5017 - case "meta": 5018 - return /* @__PURE__ */ jsx("meta", { ...attrs, suppressHydrationWarning: true }); 5019 - case "link": 5020 - return /* @__PURE__ */ jsx("link", { ...attrs, suppressHydrationWarning: true }); 5021 - case "style": 5022 - return /* @__PURE__ */ jsx( 5023 - "style", 5024 - { 5025 - ...attrs, 5026 - dangerouslySetInnerHTML: { __html: children2 } 5027 - } 5028 - ); 5029 - case "script": 5030 - if (attrs && attrs.src) { 5031 - return /* @__PURE__ */ jsx("script", { ...attrs, suppressHydrationWarning: true }); 5032 - } 5033 - if (typeof children2 === "string") 5034 - return /* @__PURE__ */ jsx( 5035 - "script", 5036 - { 5037 - ...attrs, 5038 - dangerouslySetInnerHTML: { 5039 - __html: children2 5040 - }, 5041 - suppressHydrationWarning: true 5042 - } 5043 - ); 5044 - return null; 5045 - default: 5046 - return null; 5047 - } 5048 - } 5049 - const useTags = () => { 5050 - const router = useRouter(); 5051 - const routeMeta = useRouterState({ 5052 - select: (state) => { 5053 - return state.matches.map((match) => match.meta).filter(Boolean); 5054 - } 5055 - }); 5056 - const meta = React.useMemo(() => { 5057 - const resultMeta = []; 5058 - const metaByAttribute = {}; 5059 - let title; 5060 - [...routeMeta].reverse().forEach((metas) => { 5061 - [...metas].reverse().forEach((m) => { 5062 - if (!m) return; 5063 - if (m.title) { 5064 - if (!title) { 5065 - title = { 5066 - tag: "title", 5067 - children: m.title 5068 - }; 5069 - } 5070 - } else { 5071 - const attribute = m.name ?? m.property; 5072 - if (attribute) { 5073 - if (metaByAttribute[attribute]) { 5074 - return; 5075 - } else { 5076 - metaByAttribute[attribute] = true; 5077 - } 5078 - } 5079 - resultMeta.push({ 5080 - tag: "meta", 5081 - attrs: { 5082 - ...m 5083 - } 5084 - }); 5085 - } 5086 - }); 5087 - }); 5088 - if (title) { 5089 - resultMeta.push(title); 5090 - } 5091 - resultMeta.reverse(); 5092 - return resultMeta; 5093 - }, [routeMeta]); 5094 - const links = useRouterState({ 5095 - select: (state) => { 5096 - var _a2; 5097 - const constructed = state.matches.map((match) => match.links).filter(Boolean).flat(1).map((link) => ({ 5098 - tag: "link", 5099 - attrs: { 5100 - ...link 5101 - } 5102 - })); 5103 - const manifest = (_a2 = router.ssr) == null ? void 0 : _a2.manifest; 5104 - const assets = state.matches.map((match) => { 5105 - var _a22; 5106 - return ((_a22 = manifest == null ? void 0 : manifest.routes[match.routeId]) == null ? void 0 : _a22.assets) ?? []; 5107 - }).filter(Boolean).flat(1).filter((asset) => asset.tag === "link").map( 5108 - (asset) => ({ 5109 - tag: "link", 5110 - attrs: { 5111 - ...asset.attrs, 5112 - suppressHydrationWarning: true 5113 - } 5114 - }) 5115 - ); 5116 - return [...constructed, ...assets]; 5117 - }, 5118 - structuralSharing: true 5119 - }); 5120 - const preloadMeta = useRouterState({ 5121 - select: (state) => { 5122 - const preloadMeta2 = []; 5123 - state.matches.map((match) => router.looseRoutesById[match.routeId]).forEach( 5124 - (route) => { 5125 - var _a2, _b2, _c2, _d2; 5126 - return (_d2 = (_c2 = (_b2 = (_a2 = router.ssr) == null ? void 0 : _a2.manifest) == null ? void 0 : _b2.routes[route.id]) == null ? void 0 : _c2.preloads) == null ? void 0 : _d2.filter(Boolean).forEach((preload) => { 5127 - preloadMeta2.push({ 5128 - tag: "link", 5129 - attrs: { 5130 - rel: "modulepreload", 5131 - href: preload 5132 - } 5133 - }); 5134 - }); 5135 - } 5136 - ); 5137 - return preloadMeta2; 5138 - }, 5139 - structuralSharing: true 5140 - }); 5141 - const headScripts = useRouterState({ 5142 - select: (state) => state.matches.map((match) => match.headScripts).flat(1).filter(Boolean).map(({ children: children2, ...script }) => ({ 5143 - tag: "script", 5144 - attrs: { 5145 - ...script 5146 - }, 5147 - children: children2 5148 - })), 5149 - structuralSharing: true 5150 - }); 5151 - return uniqBy( 5152 - [ 5153 - ...meta, 5154 - ...preloadMeta, 5155 - ...links, 5156 - ...headScripts 5157 - ], 5158 - (d) => { 5159 - return JSON.stringify(d); 5160 - } 5161 - ); 5162 - }; 5163 - function HeadContent() { 5164 - const tags = useTags(); 5165 - return tags.map((tag) => /* @__PURE__ */ createElement$1(Asset, { ...tag, key: `tsr-meta-${JSON.stringify(tag)}` })); 5166 - } 5167 - function uniqBy(arr, fn) { 5168 - const seen = /* @__PURE__ */ new Set(); 5169 - return arr.filter((item) => { 5170 - const key = fn(item); 5171 - if (seen.has(key)) { 5172 - return false; 5173 - } 5174 - seen.add(key); 5175 - return true; 5176 - }); 5177 - } 5178 - const Scripts = () => { 5179 - const router = useRouter(); 5180 - const assetScripts = useRouterState({ 5181 - select: (state) => { 5182 - var _a2; 5183 - const assetScripts2 = []; 5184 - const manifest = (_a2 = router.ssr) == null ? void 0 : _a2.manifest; 5185 - if (!manifest) { 5186 - return []; 5187 - } 5188 - state.matches.map((match) => router.looseRoutesById[match.routeId]).forEach( 5189 - (route) => { 5190 - var _a22, _b2; 5191 - return (_b2 = (_a22 = manifest.routes[route.id]) == null ? void 0 : _a22.assets) == null ? void 0 : _b2.filter((d) => d.tag === "script").forEach((asset) => { 5192 - assetScripts2.push({ 5193 - tag: "script", 5194 - attrs: asset.attrs, 5195 - children: asset.children 5196 - }); 5197 - }); 5198 - } 5199 - ); 5200 - return assetScripts2; 5201 - }, 5202 - structuralSharing: true 5203 - }); 5204 - const { scripts } = useRouterState({ 5205 - select: (state) => ({ 5206 - scripts: state.matches.map((match) => match.scripts).flat(1).filter(Boolean).map(({ children: children2, ...script }) => ({ 5207 - tag: "script", 5208 - attrs: { 5209 - ...script, 5210 - suppressHydrationWarning: true 5211 - }, 5212 - children: children2 5213 - })) 5214 - }), 5215 - structuralSharing: true 5216 - }); 5217 - const allScripts = [...scripts, ...assetScripts]; 5218 - return /* @__PURE__ */ jsx(Fragment, { children: allScripts.map((asset, i) => /* @__PURE__ */ createElement$1(Asset, { ...asset, key: `tsr-scripts-${asset.tag}-${i}` })) }); 5219 - }; 5220 - function StartServer(props) { 5221 - return /* @__PURE__ */ jsx(RouterProvider, { router: props.router }); 5222 - } 5223 - var fullPattern = " daum[ /]| deusu/| yadirectfetcher|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\btime/|\\||^<|^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|^{{.*}}$|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|firephp|functionize|gomezagent|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|ips-agent|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|perl|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/"; 5224 - var naivePattern = /bot|crawl|http|lighthouse|scan|search|spider/i; 5225 - var pattern; 5226 - function getPattern() { 5227 - if (pattern instanceof RegExp) { 5228 - return pattern; 5229 - } 5230 - try { 5231 - pattern = new RegExp(fullPattern, "i"); 5232 - } catch (error) { 5233 - pattern = naivePattern; 5234 - } 5235 - return pattern; 5236 - } 5237 - function isbot(userAgent) { 5238 - return Boolean(userAgent) && getPattern().test(userAgent); 5239 - } 5240 - function transformReadableStreamWithRouter(router, routerStream) { 5241 - return transformStreamWithRouter(router, routerStream); 5242 - } 5243 - function transformPipeableStreamWithRouter(router, routerStream) { 5244 - return Readable.fromWeb( 5245 - transformStreamWithRouter(router, Readable.toWeb(routerStream)) 5246 - ); 5247 - } 5248 - const patternBodyStart = /(<body)/; 5249 - const patternBodyEnd = /(<\/body>)/; 5250 - const patternHtmlEnd = /(<\/html>)/; 5251 - const patternHeadStart = /(<head.*?>)/; 5252 - const patternClosingTag = /(<\/[a-zA-Z][\w:.-]*?>)/g; 5253 - const textDecoder = new TextDecoder(); 5254 - function createPassthrough() { 5255 - let controller; 5256 - const encoder = new TextEncoder(); 5257 - const stream = new ReadableStream$1({ 5258 - start(c) { 5259 - controller = c; 5260 - } 5261 - }); 5262 - const res = { 5263 - stream, 5264 - write: (chunk) => { 5265 - controller.enqueue(encoder.encode(chunk)); 5266 - }, 5267 - end: (chunk) => { 5268 - if (chunk) { 5269 - controller.enqueue(encoder.encode(chunk)); 5270 - } 5271 - controller.close(); 5272 - res.destroyed = true; 5273 - }, 5274 - destroy: (error) => { 5275 - controller.error(error); 5276 - }, 5277 - destroyed: false 5278 - }; 5279 - return res; 5280 - } 5281 - async function readStream(stream, opts) { 5282 - var _a2, _b2, _c2; 5283 - try { 5284 - const reader = stream.getReader(); 5285 - let chunk; 5286 - while (!(chunk = await reader.read()).done) { 5287 - (_a2 = opts.onData) == null ? void 0 : _a2.call(opts, chunk); 5288 - } 5289 - (_b2 = opts.onEnd) == null ? void 0 : _b2.call(opts); 5290 - } catch (error) { 5291 - (_c2 = opts.onError) == null ? void 0 : _c2.call(opts, error); 5292 - } 5293 - } 5294 - function transformStreamWithRouter(router, appStream) { 5295 - const finalPassThrough = createPassthrough(); 5296 - let isAppRendering = true; 5297 - let routerStreamBuffer = ""; 5298 - let pendingClosingTags = ""; 5299 - let bodyStarted = false; 5300 - let headStarted = false; 5301 - let leftover = ""; 5302 - let leftoverHtml = ""; 5303 - function getBufferedRouterStream() { 5304 - const html = routerStreamBuffer; 5305 - routerStreamBuffer = ""; 5306 - return html; 5307 - } 5308 - function decodeChunk(chunk) { 5309 - if (chunk instanceof Uint8Array) { 5310 - return textDecoder.decode(chunk); 5311 - } 5312 - return String(chunk); 5313 - } 5314 - const injectedHtmlDonePromise = createControlledPromise(); 5315 - let processingCount = 0; 5316 - router.serverSsr.injectedHtml.forEach((promise) => { 5317 - handleInjectedHtml(promise); 5318 - }); 5319 - const stopListeningToInjectedHtml = router.subscribe( 5320 - "onInjectedHtml", 5321 - (e) => { 5322 - handleInjectedHtml(e.promise); 5323 - } 5324 - ); 5325 - function handleInjectedHtml(promise) { 5326 - processingCount++; 5327 - promise.then((html) => { 5328 - if (!bodyStarted) { 5329 - routerStreamBuffer += html; 5330 - } else { 5331 - finalPassThrough.write(html); 5332 - } 5333 - }).catch(injectedHtmlDonePromise.reject).finally(() => { 5334 - processingCount--; 5335 - if (!isAppRendering && processingCount === 0) { 5336 - stopListeningToInjectedHtml(); 5337 - injectedHtmlDonePromise.resolve(); 5338 - } 5339 - }); 5340 - } 5341 - injectedHtmlDonePromise.then(() => { 5342 - const finalHtml = leftoverHtml + getBufferedRouterStream() + pendingClosingTags; 5343 - finalPassThrough.end(finalHtml); 5344 - }).catch((err) => { 5345 - console.error("Error reading routerStream:", err); 5346 - finalPassThrough.destroy(err); 5347 - }); 5348 - readStream(appStream, { 5349 - onData: (chunk) => { 5350 - const text2 = decodeChunk(chunk.value); 5351 - let chunkString = leftover + text2; 5352 - const bodyEndMatch = chunkString.match(patternBodyEnd); 5353 - const htmlEndMatch = chunkString.match(patternHtmlEnd); 5354 - if (!bodyStarted) { 5355 - const bodyStartMatch = chunkString.match(patternBodyStart); 5356 - if (bodyStartMatch) { 5357 - bodyStarted = true; 5358 - } 5359 - } 5360 - if (!headStarted) { 5361 - const headStartMatch = chunkString.match(patternHeadStart); 5362 - if (headStartMatch) { 5363 - headStarted = true; 5364 - const index2 = headStartMatch.index; 5365 - const headTag = headStartMatch[0]; 5366 - const remaining = chunkString.slice(index2 + headTag.length); 5367 - finalPassThrough.write( 5368 - chunkString.slice(0, index2) + headTag + getBufferedRouterStream() 5369 - ); 5370 - chunkString = remaining; 5371 - } 5372 - } 5373 - if (!bodyStarted) { 5374 - finalPassThrough.write(chunkString); 5375 - leftover = ""; 5376 - return; 5377 - } 5378 - if (bodyEndMatch && htmlEndMatch && bodyEndMatch.index < htmlEndMatch.index) { 5379 - const bodyEndIndex = bodyEndMatch.index; 5380 - pendingClosingTags = chunkString.slice(bodyEndIndex); 5381 - finalPassThrough.write( 5382 - chunkString.slice(0, bodyEndIndex) + getBufferedRouterStream() 5383 - ); 5384 - leftover = ""; 5385 - return; 5386 - } 5387 - let result; 5388 - let lastIndex = 0; 5389 - while ((result = patternClosingTag.exec(chunkString)) !== null) { 5390 - lastIndex = result.index + result[0].length; 5391 - } 5392 - if (lastIndex > 0) { 5393 - const processed = chunkString.slice(0, lastIndex) + getBufferedRouterStream() + leftoverHtml; 5394 - finalPassThrough.write(processed); 5395 - leftover = chunkString.slice(lastIndex); 5396 - } else { 5397 - leftover = chunkString; 5398 - leftoverHtml += getBufferedRouterStream(); 5399 - } 5400 - }, 5401 - onEnd: () => { 5402 - isAppRendering = false; 5403 - if (processingCount === 0) { 5404 - injectedHtmlDonePromise.resolve(); 5405 - } 5406 - }, 5407 - onError: (error) => { 5408 - console.error("Error reading appStream:", error); 5409 - finalPassThrough.destroy(error); 5410 - } 5411 - }); 5412 - return finalPassThrough.stream; 5413 - } 5414 - function splitSetCookieString(cookiesString) { 5415 - if (Array.isArray(cookiesString)) { 5416 - return cookiesString.flatMap((c) => splitSetCookieString(c)); 5417 - } 5418 - if (typeof cookiesString !== "string") { 5419 - return []; 5420 - } 5421 - const cookiesStrings = []; 5422 - let pos = 0; 5423 - let start; 5424 - let ch; 5425 - let lastComma; 5426 - let nextStart; 5427 - let cookiesSeparatorFound; 5428 - const skipWhitespace = () => { 5429 - while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) { 5430 - pos += 1; 5431 - } 5432 - return pos < cookiesString.length; 5433 - }; 5434 - const notSpecialChar = () => { 5435 - ch = cookiesString.charAt(pos); 5436 - return ch !== "=" && ch !== ";" && ch !== ","; 5437 - }; 5438 - while (pos < cookiesString.length) { 5439 - start = pos; 5440 - cookiesSeparatorFound = false; 5441 - while (skipWhitespace()) { 5442 - ch = cookiesString.charAt(pos); 5443 - if (ch === ",") { 5444 - lastComma = pos; 5445 - pos += 1; 5446 - skipWhitespace(); 5447 - nextStart = pos; 5448 - while (pos < cookiesString.length && notSpecialChar()) { 5449 - pos += 1; 5450 - } 5451 - if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") { 5452 - cookiesSeparatorFound = true; 5453 - pos = nextStart; 5454 - cookiesStrings.push(cookiesString.slice(start, lastComma)); 5455 - start = pos; 5456 - } else { 5457 - pos = lastComma + 1; 5458 - } 5459 - } else { 5460 - pos += 1; 5461 - } 5462 - } 5463 - if (!cookiesSeparatorFound || pos >= cookiesString.length) { 5464 - cookiesStrings.push(cookiesString.slice(start, cookiesString.length)); 5465 - } 5466 - } 5467 - return cookiesStrings; 5468 - } 5469 - function toHeadersInstance(init) { 5470 - if (init instanceof Headers) { 5471 - return new Headers(init); 5472 - } else if (Array.isArray(init)) { 5473 - return new Headers(init); 5474 - } else if (typeof init === "object") { 5475 - return new Headers(init); 5476 - } else { 5477 - return new Headers(); 5478 - } 5479 - } 5480 - function mergeHeaders(...headers) { 5481 - return headers.reduce((acc, header) => { 5482 - const headersInstance = toHeadersInstance(header); 5483 - for (const [key, value] of headersInstance.entries()) { 5484 - if (key === "set-cookie") { 5485 - const splitCookies = splitSetCookieString(value); 5486 - splitCookies.forEach((cookie) => acc.append("set-cookie", cookie)); 5487 - } else { 5488 - acc.set(key, value); 5489 - } 5490 - } 5491 - return acc; 5492 - }, new Headers()); 5493 - } 5494 - const startSerializer = { 5495 - stringify: (value) => JSON.stringify(value, function replacer(key, val) { 5496 - const ogVal = this[key]; 5497 - const serializer = serializers.find((t) => t.stringifyCondition(ogVal)); 5498 - if (serializer) { 5499 - return serializer.stringify(ogVal); 5500 - } 5501 - return val; 5502 - }), 5503 - parse: (value) => JSON.parse(value, function parser(key, val) { 5504 - const ogVal = this[key]; 5505 - if (isPlainObject$2(ogVal)) { 5506 - const serializer = serializers.find((t) => t.parseCondition(ogVal)); 5507 - if (serializer) { 5508 - return serializer.parse(ogVal); 5509 - } 5510 - } 5511 - return val; 5512 - }), 5513 - encode: (value) => { 5514 - if (Array.isArray(value)) { 5515 - return value.map((v2) => startSerializer.encode(v2)); 5516 - } 5517 - if (isPlainObject$2(value)) { 5518 - return Object.fromEntries( 5519 - Object.entries(value).map(([key, v2]) => [ 5520 - key, 5521 - startSerializer.encode(v2) 5522 - ]) 5523 - ); 5524 - } 5525 - const serializer = serializers.find((t) => t.stringifyCondition(value)); 5526 - if (serializer) { 5527 - return serializer.stringify(value); 5528 - } 5529 - return value; 5530 - }, 5531 - decode: (value) => { 5532 - if (isPlainObject$2(value)) { 5533 - const serializer = serializers.find((t) => t.parseCondition(value)); 5534 - if (serializer) { 5535 - return serializer.parse(value); 5536 - } 5537 - } 5538 - if (Array.isArray(value)) { 5539 - return value.map((v2) => startSerializer.decode(v2)); 5540 - } 5541 - if (isPlainObject$2(value)) { 5542 - return Object.fromEntries( 5543 - Object.entries(value).map(([key, v2]) => [ 5544 - key, 5545 - startSerializer.decode(v2) 5546 - ]) 5547 - ); 5548 - } 5549 - return value; 5550 - } 5551 - }; 5552 - const createSerializer = (key, check, toValue2, fromValue) => ({ 5553 - key, 5554 - stringifyCondition: check, 5555 - stringify: (value) => ({ [`$${key}`]: toValue2(value) }), 5556 - parseCondition: (value) => Object.hasOwn(value, `$${key}`), 5557 - parse: (value) => fromValue(value[`$${key}`]) 5558 - }); 5559 - const serializers = [ 5560 - createSerializer( 5561 - // Key 5562 - "undefined", 5563 - // Check 5564 - (v2) => v2 === void 0, 5565 - // To 5566 - () => 0, 5567 - // From 5568 - () => void 0 5569 - ), 5570 - createSerializer( 5571 - // Key 5572 - "date", 5573 - // Check 5574 - (v2) => v2 instanceof Date, 5575 - // To 5576 - (v2) => v2.toISOString(), 5577 - // From 5578 - (v2) => new Date(v2) 5579 - ), 5580 - createSerializer( 5581 - // Key 5582 - "error", 5583 - // Check 5584 - (v2) => v2 instanceof Error, 5585 - // To 5586 - (v2) => ({ 5587 - ...v2, 5588 - message: v2.message, 5589 - stack: void 0, 5590 - cause: v2.cause 5591 - }), 5592 - // From 5593 - (v2) => Object.assign(new Error(v2.message), v2) 5594 - ), 5595 - createSerializer( 5596 - // Key 5597 - "formData", 5598 - // Check 5599 - (v2) => v2 instanceof FormData, 5600 - // To 5601 - (v2) => { 5602 - const entries = {}; 5603 - v2.forEach((value, key) => { 5604 - const entry = entries[key]; 5605 - if (entry !== void 0) { 5606 - if (Array.isArray(entry)) { 5607 - entry.push(value); 5608 - } else { 5609 - entries[key] = [entry, value]; 5610 - } 5611 - } else { 5612 - entries[key] = value; 5613 - } 5614 - }); 5615 - return entries; 5616 - }, 5617 - // From 5618 - (v2) => { 5619 - const formData = new FormData(); 5620 - Object.entries(v2).forEach(([key, value]) => { 5621 - if (Array.isArray(value)) { 5622 - value.forEach((val) => formData.append(key, val)); 5623 - } else { 5624 - formData.append(key, value); 5625 - } 5626 - }); 5627 - return formData; 5628 - } 5629 - ), 5630 - createSerializer( 5631 - // Key 5632 - "bigint", 5633 - // Check 5634 - (v2) => typeof v2 === "bigint", 5635 - // To 5636 - (v2) => v2.toString(), 5637 - // From 5638 - (v2) => BigInt(v2) 5639 - ) 5640 - ]; 5641 - const globalMiddleware = []; 5642 - function createServerFn(options, __opts) { 5643 - const resolvedOptions = __opts || options || {}; 5644 - if (typeof resolvedOptions.method === "undefined") { 5645 - resolvedOptions.method = "GET"; 5646 - } 5647 - return { 5648 - options: resolvedOptions, 5649 - middleware: (middleware) => { 5650 - return createServerFn(void 0, Object.assign(resolvedOptions, { 5651 - middleware 5652 - })); 5653 - }, 5654 - validator: (validator) => { 5655 - return createServerFn(void 0, Object.assign(resolvedOptions, { 5656 - validator 5657 - })); 5658 - }, 5659 - type: (type) => { 5660 - return createServerFn(void 0, Object.assign(resolvedOptions, { 5661 - type 5662 - })); 5663 - }, 5664 - handler: (...args) => { 5665 - const [extractedFn, serverFn] = args; 5666 - Object.assign(resolvedOptions, { 5667 - ...extractedFn, 5668 - extractedFn, 5669 - serverFn 5670 - }); 5671 - const resolvedMiddleware = [...resolvedOptions.middleware || [], serverFnBaseToMiddleware(resolvedOptions)]; 5672 - return Object.assign(async (opts) => { 5673 - return executeMiddleware$1(resolvedMiddleware, "client", { 5674 - ...extractedFn, 5675 - ...resolvedOptions, 5676 - data: opts == null ? void 0 : opts.data, 5677 - headers: opts == null ? void 0 : opts.headers, 5678 - signal: opts == null ? void 0 : opts.signal, 5679 - context: {} 5680 - }).then((d) => { 5681 - if (resolvedOptions.response === "full") { 5682 - return d; 5683 - } 5684 - if (d.error) throw d.error; 5685 - return d.result; 5686 - }); 5687 - }, { 5688 - // This copies over the URL, function ID 5689 - ...extractedFn, 5690 - // The extracted function on the server-side calls 5691 - // this function 5692 - __executeServer: async (opts_, signal) => { 5693 - const opts = opts_ instanceof FormData ? extractFormDataContext(opts_) : opts_; 5694 - opts.type = typeof resolvedOptions.type === "function" ? resolvedOptions.type(opts) : resolvedOptions.type; 5695 - const ctx = { 5696 - ...extractedFn, 5697 - ...opts, 5698 - signal 5699 - }; 5700 - const run = () => executeMiddleware$1(resolvedMiddleware, "server", ctx).then((d) => ({ 5701 - // Only send the result and sendContext back to the client 5702 - result: d.result, 5703 - error: d.error, 5704 - context: d.sendContext 5705 - })); 5706 - if (ctx.type === "static") { 5707 - let response; 5708 - if (serverFnStaticCache == null ? void 0 : serverFnStaticCache.getItem) { 5709 - response = await serverFnStaticCache.getItem(ctx); 5710 - } 5711 - if (!response) { 5712 - response = await run().then((d) => { 5713 - return { 5714 - ctx: d, 5715 - error: null 5716 - }; 5717 - }).catch((e) => { 5718 - return { 5719 - ctx: void 0, 5720 - error: e 5721 - }; 5722 - }); 5723 - if (serverFnStaticCache == null ? void 0 : serverFnStaticCache.setItem) { 5724 - await serverFnStaticCache.setItem(ctx, response); 5725 - } 5726 - } 5727 - invariant(response); 5728 - if (response.error) { 5729 - throw response.error; 5730 - } 5731 - return response.ctx; 5732 - } 5733 - return run(); 5734 - } 5735 - }); 5736 - } 5737 - }; 5738 - } 5739 - async function executeMiddleware$1(middlewares, env2, opts) { 5740 - const flattenedMiddlewares = flattenMiddlewares([...globalMiddleware, ...middlewares]); 5741 - const next = async (ctx) => { 5742 - const nextMiddleware = flattenedMiddlewares.shift(); 5743 - if (!nextMiddleware) { 5744 - return ctx; 5745 - } 5746 - if (nextMiddleware.options.validator && (env2 === "client" ? nextMiddleware.options.validateClient : true)) { 5747 - ctx.data = await execValidator(nextMiddleware.options.validator, ctx.data); 5748 - } 5749 - const middlewareFn = env2 === "client" ? nextMiddleware.options.client : nextMiddleware.options.server; 5750 - if (middlewareFn) { 5751 - return applyMiddleware(middlewareFn, ctx, async (newCtx) => { 5752 - return next(newCtx).catch((error) => { 5753 - if (isRedirect(error) || isNotFound(error)) { 5754 - return { 5755 - ...newCtx, 5756 - error 5757 - }; 5758 - } 5759 - throw error; 5760 - }); 5761 - }); 5762 - } 5763 - return next(ctx); 5764 - }; 5765 - return next({ 5766 - ...opts, 5767 - headers: opts.headers || {}, 5768 - sendContext: opts.sendContext || {}, 5769 - context: opts.context || {} 5770 - }); 5771 - } 5772 - let serverFnStaticCache; 5773 - function setServerFnStaticCache(cache) { 5774 - const previousCache = serverFnStaticCache; 5775 - serverFnStaticCache = typeof cache === "function" ? cache() : cache; 5776 - return () => { 5777 - serverFnStaticCache = previousCache; 5778 - }; 5779 - } 5780 - function createServerFnStaticCache(serverFnStaticCache2) { 5781 - return serverFnStaticCache2; 5782 - } 5783 - async function sha1Hash(message) { 5784 - const msgBuffer = new TextEncoder().encode(message); 5785 - const hashBuffer = await crypto.subtle.digest("SHA-1", msgBuffer); 5786 - const hashArray = Array.from(new Uint8Array(hashBuffer)); 5787 - const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join(""); 5788 - return hashHex; 5789 - } 5790 - setServerFnStaticCache(() => { 5791 - const getStaticCacheUrl = async (options, hash) => { 5792 - const filename = await sha1Hash(`${options.functionId}__${hash}`); 5793 - return `/__tsr/staticServerFnCache/${filename}.json`; 5794 - }; 5795 - const jsonToFilenameSafeString = (json2) => { 5796 - const sortedKeysReplacer = (key, value) => value && typeof value === "object" && !Array.isArray(value) ? Object.keys(value).sort().reduce((acc, curr) => { 5797 - acc[curr] = value[curr]; 5798 - return acc; 5799 - }, {}) : value; 5800 - const jsonString = JSON.stringify(json2 ?? "", sortedKeysReplacer); 5801 - return jsonString.replace(/[/\\?%*:|"<>]/g, "-").replace(/\s+/g, "_"); 5802 - }; 5803 - const staticClientCache = typeof document !== "undefined" ? /* @__PURE__ */ new Map() : null; 5804 - return createServerFnStaticCache({ 5805 - getItem: async (ctx) => { 5806 - if (typeof document === "undefined") { 5807 - const hash = jsonToFilenameSafeString(ctx.data); 5808 - const url = await getStaticCacheUrl(ctx, hash); 5809 - const publicUrl = "/home/dogpawhat/Development/preloading-example/.output/public"; 5810 - const { 5811 - promises: fs 5812 - } = await import('node:fs'); 5813 - const path = await import('node:path'); 5814 - const filePath = path.join(publicUrl, url); 5815 - const [cachedResult, readError] = await fs.readFile(filePath, "utf-8").then((c) => [startSerializer.parse(c), null]).catch((e) => [null, e]); 5816 - if (readError && readError.code !== "ENOENT") { 5817 - throw readError; 5818 - } 5819 - return cachedResult; 5820 - } 5821 - return void 0; 5822 - }, 5823 - setItem: async (ctx, response) => { 5824 - const { 5825 - promises: fs 5826 - } = await import('node:fs'); 5827 - const path = await import('node:path'); 5828 - const hash = jsonToFilenameSafeString(ctx.data); 5829 - const url = await getStaticCacheUrl(ctx, hash); 5830 - const publicUrl = "/home/dogpawhat/Development/preloading-example/.output/public"; 5831 - const filePath = path.join(publicUrl, url); 5832 - await fs.mkdir(path.dirname(filePath), { 5833 - recursive: true 5834 - }); 5835 - await fs.writeFile(filePath, startSerializer.stringify(response)); 5836 - }, 5837 - fetchItem: async (ctx) => { 5838 - const hash = jsonToFilenameSafeString(ctx.data); 5839 - const url = await getStaticCacheUrl(ctx, hash); 5840 - let result = staticClientCache == null ? void 0 : staticClientCache.get(url); 5841 - if (!result) { 5842 - result = await fetch(url, { 5843 - method: "GET" 5844 - }).then((r) => r.text()).then((d) => startSerializer.parse(d)); 5845 - staticClientCache == null ? void 0 : staticClientCache.set(url, result); 5846 - } 5847 - return result; 5848 - } 5849 - }); 5850 - }); 5851 - function extractFormDataContext(formData) { 5852 - const serializedContext = formData.get("__TSR_CONTEXT"); 5853 - formData.delete("__TSR_CONTEXT"); 5854 - if (typeof serializedContext !== "string") { 5855 - return { 5856 - context: {}, 5857 - data: formData 5858 - }; 5859 - } 5860 - try { 5861 - const context = startSerializer.parse(serializedContext); 5862 - return { 5863 - context, 5864 - data: formData 5865 - }; 5866 - } catch { 5867 - return { 5868 - data: formData 5869 - }; 5870 - } 5871 - } 5872 - function flattenMiddlewares(middlewares) { 5873 - const seen = /* @__PURE__ */ new Set(); 5874 - const flattened = []; 5875 - const recurse = (middleware) => { 5876 - middleware.forEach((m) => { 5877 - if (m.options.middleware) { 5878 - recurse(m.options.middleware); 5879 - } 5880 - if (!seen.has(m)) { 5881 - seen.add(m); 5882 - flattened.push(m); 5883 - } 5884 - }); 5885 - }; 5886 - recurse(middlewares); 5887 - return flattened; 5888 - } 5889 - const applyMiddleware = async (middlewareFn, ctx, nextFn) => { 5890 - return middlewareFn({ 5891 - ...ctx, 5892 - next: async (userCtx = {}) => { 5893 - return nextFn({ 5894 - ...ctx, 5895 - ...userCtx, 5896 - context: { 5897 - ...ctx.context, 5898 - ...userCtx.context 5899 - }, 5900 - sendContext: { 5901 - ...ctx.sendContext, 5902 - ...userCtx.sendContext ?? {} 5903 - }, 5904 - headers: mergeHeaders(ctx.headers, userCtx.headers), 5905 - result: userCtx.result !== void 0 ? userCtx.result : ctx.response === "raw" ? userCtx : ctx.result, 5906 - error: userCtx.error ?? ctx.error 5907 - }); 5908 - } 5909 - }); 5910 - }; 5911 - function execValidator(validator, input) { 5912 - if (validator == null) return {}; 5913 - if ("~standard" in validator) { 5914 - const result = validator["~standard"].validate(input); 5915 - if (result instanceof Promise) throw new Error("Async validation not supported"); 5916 - if (result.issues) throw new Error(JSON.stringify(result.issues, void 0, 2)); 5917 - return result.value; 5918 - } 5919 - if ("parse" in validator) { 5920 - return validator.parse(input); 5921 - } 5922 - if (typeof validator === "function") { 5923 - return validator(input); 5924 - } 5925 - throw new Error("Invalid validator type!"); 5926 - } 5927 - function serverFnBaseToMiddleware(options) { 5928 - return { 5929 - _types: void 0, 5930 - options: { 5931 - validator: options.validator, 5932 - validateClient: options.validateClient, 5933 - client: async ({ 5934 - next, 5935 - sendContext, 5936 - ...ctx 5937 - }) => { 5938 - var _a2; 5939 - const payload = { 5940 - ...ctx, 5941 - // switch the sendContext over to context 5942 - context: sendContext, 5943 - type: typeof ctx.type === "function" ? ctx.type(ctx) : ctx.type 5944 - }; 5945 - if (ctx.type === "static" && "production" === "production" && typeof document !== "undefined") { 5946 - invariant(serverFnStaticCache); 5947 - const result = await serverFnStaticCache.fetchItem(payload); 5948 - if (result) { 5949 - if (result.error) { 5950 - throw result.error; 5951 - } 5952 - return next(result.ctx); 5953 - } 5954 - warning(result, `No static cache item found for ${payload.functionId}__${JSON.stringify(payload.data)}, falling back to server function...`); 5955 - } 5956 - const res = await ((_a2 = options.extractedFn) == null ? void 0 : _a2.call(options, payload)); 5957 - return next(res); 5958 - }, 5959 - server: async ({ 5960 - next, 5961 - ...ctx 5962 - }) => { 5963 - var _a2; 5964 - const result = await ((_a2 = options.serverFn) == null ? void 0 : _a2.call(options, ctx)); 5965 - return next({ 5966 - ...ctx, 5967 - result 5968 - }); 5969 - } 5970 - } 5971 - }; 5972 - } 5973 - function json(payload, init) { 5974 - return new Response(JSON.stringify(payload), { 5975 - ...init, 5976 - headers: mergeHeaders( 5977 - { "content-type": "application/json" }, 5978 - init == null ? void 0 : init.headers 5979 - ) 5980 - }); 5981 - } 5982 - function hasProp(obj, prop) { 5983 - try { 5984 - return prop in obj; 5985 - } catch { 5986 - return false; 5987 - } 5988 - } 5989 - var __defProp$2 = Object.defineProperty; 5990 - var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 5991 - var __publicField$2 = (obj, key, value) => { 5992 - __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value); 5993 - return value; 5994 - }; 5995 - class H3Error extends Error { 5996 - constructor(message, opts = {}) { 5997 - super(message, opts); 5998 - __publicField$2(this, "statusCode", 500); 5999 - __publicField$2(this, "fatal", false); 6000 - __publicField$2(this, "unhandled", false); 6001 - __publicField$2(this, "statusMessage"); 6002 - __publicField$2(this, "data"); 6003 - __publicField$2(this, "cause"); 6004 - if (opts.cause && !this.cause) { 6005 - this.cause = opts.cause; 6006 - } 6007 - } 6008 - toJSON() { 6009 - const obj = { 6010 - message: this.message, 6011 - statusCode: sanitizeStatusCode(this.statusCode, 500) 6012 - }; 6013 - if (this.statusMessage) { 6014 - obj.statusMessage = sanitizeStatusMessage(this.statusMessage); 6015 - } 6016 - if (this.data !== void 0) { 6017 - obj.data = this.data; 6018 - } 6019 - return obj; 6020 - } 6021 - } 6022 - __publicField$2(H3Error, "__h3_error__", true); 6023 - function createError(input) { 6024 - if (typeof input === "string") { 6025 - return new H3Error(input); 6026 - } 6027 - if (isError$1(input)) { 6028 - return input; 6029 - } 6030 - const err = new H3Error(input.message ?? input.statusMessage ?? "", { 6031 - cause: input.cause || input 6032 - }); 6033 - if (hasProp(input, "stack")) { 6034 - try { 6035 - Object.defineProperty(err, "stack", { 6036 - get() { 6037 - return input.stack; 6038 - } 6039 - }); 6040 - } catch { 6041 - try { 6042 - err.stack = input.stack; 6043 - } catch { 6044 - } 6045 - } 6046 - } 6047 - if (input.data) { 6048 - err.data = input.data; 6049 - } 6050 - if (input.statusCode) { 6051 - err.statusCode = sanitizeStatusCode(input.statusCode, err.statusCode); 6052 - } else if (input.status) { 6053 - err.statusCode = sanitizeStatusCode(input.status, err.statusCode); 6054 - } 6055 - if (input.statusMessage) { 6056 - err.statusMessage = input.statusMessage; 6057 - } else if (input.statusText) { 6058 - err.statusMessage = input.statusText; 6059 - } 6060 - if (err.statusMessage) { 6061 - const originalMessage = err.statusMessage; 6062 - const sanitizedMessage = sanitizeStatusMessage(err.statusMessage); 6063 - if (sanitizedMessage !== originalMessage) { 6064 - console.warn( 6065 - "[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default." 6066 - ); 6067 - } 6068 - } 6069 - if (input.fatal !== void 0) { 6070 - err.fatal = input.fatal; 6071 - } 6072 - if (input.unhandled !== void 0) { 6073 - err.unhandled = input.unhandled; 6074 - } 6075 - return err; 6076 - } 6077 - function isError$1(input) { 6078 - var _a2; 6079 - return ((_a2 = input == null ? void 0 : input.constructor) == null ? void 0 : _a2.__h3_error__) === true; 6080 - } 6081 - function isMethod(event, expected, allowHead) { 6082 - if (typeof expected === "string") { 6083 - if (event.method === expected) { 6084 - return true; 6085 - } 6086 - } else if (expected.includes(event.method)) { 6087 - return true; 6088 - } 6089 - return false; 6090 - } 6091 - function assertMethod(event, expected, allowHead) { 6092 - if (!isMethod(event, expected)) { 6093 - throw createError({ 6094 - statusCode: 405, 6095 - statusMessage: "HTTP method is not allowed." 6096 - }); 6097 - } 6098 - } 6099 - function getRequestHost(event, opts = {}) { 6100 - if (opts.xForwardedHost) { 6101 - const xForwardedHost = event.node.req.headers["x-forwarded-host"]; 6102 - if (xForwardedHost) { 6103 - return xForwardedHost; 6104 - } 6105 - } 6106 - return event.node.req.headers.host || "localhost"; 6107 - } 6108 - function getRequestProtocol(event, opts = {}) { 6109 - var _a2; 6110 - if (opts.xForwardedProto !== false && event.node.req.headers["x-forwarded-proto"] === "https") { 6111 - return "https"; 6112 - } 6113 - return ((_a2 = event.node.req.connection) == null ? void 0 : _a2.encrypted) ? "https" : "http"; 6114 - } 6115 - function getRequestURL(event, opts = {}) { 6116 - const host = getRequestHost(event, opts); 6117 - const protocol = getRequestProtocol(event, opts); 6118 - const path = (event.node.req.originalUrl || event.path).replace( 6119 - /^[/\\]+/g, 6120 - "/" 6121 - ); 6122 - return new URL(path, `${protocol}://${host}`); 6123 - } 6124 - function toWebRequest(event) { 6125 - var _a2; 6126 - return ((_a2 = event.web) == null ? void 0 : _a2.request) || new Request(getRequestURL(event), { 6127 - // @ts-ignore Undici option 6128 - duplex: "half", 6129 - method: event.method, 6130 - headers: event.headers, 6131 - body: getRequestWebStream(event) 6132 - }); 6133 - } 6134 - const RawBodySymbol = Symbol.for("h3RawBody"); 6135 - const PayloadMethods$1 = ["PATCH", "POST", "PUT", "DELETE"]; 6136 - function readRawBody(event, encoding = "utf8") { 6137 - var _a2, _b2; 6138 - assertMethod(event, PayloadMethods$1); 6139 - const _rawBody = event._requestBody || ((_b2 = (_a2 = event.web) == null ? void 0 : _a2.request) == null ? void 0 : _b2.body) || event.node.req[RawBodySymbol] || event.node.req.rawBody || event.node.req.body; 6140 - if (_rawBody) { 6141 - const promise2 = Promise.resolve(_rawBody).then((_resolved) => { 6142 - if (Buffer.isBuffer(_resolved)) { 6143 - return _resolved; 6144 - } 6145 - if (typeof _resolved.pipeTo === "function") { 6146 - return new Promise((resolve, reject) => { 6147 - const chunks = []; 6148 - _resolved.pipeTo( 6149 - new WritableStream({ 6150 - write(chunk) { 6151 - chunks.push(chunk); 6152 - }, 6153 - close() { 6154 - resolve(Buffer.concat(chunks)); 6155 - }, 6156 - abort(reason) { 6157 - reject(reason); 6158 - } 6159 - }) 6160 - ).catch(reject); 6161 - }); 6162 - } else if (typeof _resolved.pipe === "function") { 6163 - return new Promise((resolve, reject) => { 6164 - const chunks = []; 6165 - _resolved.on("data", (chunk) => { 6166 - chunks.push(chunk); 6167 - }).on("end", () => { 6168 - resolve(Buffer.concat(chunks)); 6169 - }).on("error", reject); 6170 - }); 6171 - } 6172 - if (_resolved.constructor === Object) { 6173 - return Buffer.from(JSON.stringify(_resolved)); 6174 - } 6175 - if (_resolved instanceof URLSearchParams) { 6176 - return Buffer.from(_resolved.toString()); 6177 - } 6178 - return Buffer.from(_resolved); 6179 - }); 6180 - return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2; 6181 - } 6182 - if (!Number.parseInt(event.node.req.headers["content-length"] || "") && !String(event.node.req.headers["transfer-encoding"] ?? "").split(",").map((e) => e.trim()).filter(Boolean).includes("chunked")) { 6183 - return Promise.resolve(void 0); 6184 - } 6185 - const promise = event.node.req[RawBodySymbol] = new Promise( 6186 - (resolve, reject) => { 6187 - const bodyData = []; 6188 - event.node.req.on("error", (err) => { 6189 - reject(err); 6190 - }).on("data", (chunk) => { 6191 - bodyData.push(chunk); 6192 - }).on("end", () => { 6193 - resolve(Buffer.concat(bodyData)); 6194 - }); 6195 - } 6196 - ); 6197 - const result = encoding ? promise.then((buff) => buff.toString(encoding)) : promise; 6198 - return result; 6199 - } 6200 - function getRequestWebStream(event) { 6201 - var _a2, _b2; 6202 - if (!PayloadMethods$1.includes(event.method)) { 6203 - return; 6204 - } 6205 - const bodyStream = ((_b2 = (_a2 = event.web) == null ? void 0 : _a2.request) == null ? void 0 : _b2.body) || event._requestBody; 6206 - if (bodyStream) { 6207 - return bodyStream; 6208 - } 6209 - const _hasRawBody = RawBodySymbol in event.node.req || "rawBody" in event.node.req || "body" in event.node.req || "__unenv__" in event.node.req; 6210 - if (_hasRawBody) { 6211 - return new ReadableStream({ 6212 - async start(controller) { 6213 - const _rawBody = await readRawBody(event, false); 6214 - if (_rawBody) { 6215 - controller.enqueue(_rawBody); 6216 - } 6217 - controller.close(); 6218 - } 6219 - }); 6220 - } 6221 - return new ReadableStream({ 6222 - start: (controller) => { 6223 - event.node.req.on("data", (chunk) => { 6224 - controller.enqueue(chunk); 6225 - }); 6226 - event.node.req.on("end", () => { 6227 - controller.close(); 6228 - }); 6229 - event.node.req.on("error", (err) => { 6230 - controller.error(err); 6231 - }); 6232 - } 6233 - }); 6234 - } 6235 - const DISALLOWED_STATUS_CHARS = /[^\u0009\u0020-\u007E]/g; 6236 - function sanitizeStatusMessage(statusMessage = "") { 6237 - return statusMessage.replace(DISALLOWED_STATUS_CHARS, ""); 6238 - } 6239 - function sanitizeStatusCode(statusCode, defaultStatusCode = 200) { 6240 - if (!statusCode) { 6241 - return defaultStatusCode; 6242 - } 6243 - if (typeof statusCode === "string") { 6244 - statusCode = Number.parseInt(statusCode, 10); 6245 - } 6246 - if (statusCode < 100 || statusCode > 999) { 6247 - return defaultStatusCode; 6248 - } 6249 - return statusCode; 6250 - } 6251 - function splitCookiesString(cookiesString) { 6252 - if (Array.isArray(cookiesString)) { 6253 - return cookiesString.flatMap((c) => splitCookiesString(c)); 6254 - } 6255 - if (typeof cookiesString !== "string") { 6256 - return []; 6257 - } 6258 - const cookiesStrings = []; 6259 - let pos = 0; 6260 - let start; 6261 - let ch; 6262 - let lastComma; 6263 - let nextStart; 6264 - let cookiesSeparatorFound; 6265 - const skipWhitespace = () => { 6266 - while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) { 6267 - pos += 1; 6268 - } 6269 - return pos < cookiesString.length; 6270 - }; 6271 - const notSpecialChar = () => { 6272 - ch = cookiesString.charAt(pos); 6273 - return ch !== "=" && ch !== ";" && ch !== ","; 6274 - }; 6275 - while (pos < cookiesString.length) { 6276 - start = pos; 6277 - cookiesSeparatorFound = false; 6278 - while (skipWhitespace()) { 6279 - ch = cookiesString.charAt(pos); 6280 - if (ch === ",") { 6281 - lastComma = pos; 6282 - pos += 1; 6283 - skipWhitespace(); 6284 - nextStart = pos; 6285 - while (pos < cookiesString.length && notSpecialChar()) { 6286 - pos += 1; 6287 - } 6288 - if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") { 6289 - cookiesSeparatorFound = true; 6290 - pos = nextStart; 6291 - cookiesStrings.push(cookiesString.slice(start, lastComma)); 6292 - start = pos; 6293 - } else { 6294 - pos = lastComma + 1; 6295 - } 6296 - } else { 6297 - pos += 1; 6298 - } 6299 - } 6300 - if (!cookiesSeparatorFound || pos >= cookiesString.length) { 6301 - cookiesStrings.push(cookiesString.slice(start)); 6302 - } 6303 - } 6304 - return cookiesStrings; 6305 - } 6306 - typeof setImmediate === "undefined" ? (fn) => fn() : setImmediate; 6307 - function getResponseStatus$1(event) { 6308 - return event.node.res.statusCode; 6309 - } 6310 - function getResponseHeaders$1(event) { 6311 - return event.node.res.getHeaders(); 6312 - } 6313 - function sendStream(event, stream) { 6314 - if (!stream || typeof stream !== "object") { 6315 - throw new Error("[h3] Invalid stream provided."); 6316 - } 6317 - event.node.res._data = stream; 6318 - if (!event.node.res.socket) { 6319 - event._handled = true; 6320 - return Promise.resolve(); 6321 - } 6322 - if (hasProp(stream, "pipeTo") && typeof stream.pipeTo === "function") { 6323 - return stream.pipeTo( 6324 - new WritableStream({ 6325 - write(chunk) { 6326 - event.node.res.write(chunk); 6327 - } 6328 - }) 6329 - ).then(() => { 6330 - event.node.res.end(); 6331 - }); 6332 - } 6333 - if (hasProp(stream, "pipe") && typeof stream.pipe === "function") { 6334 - return new Promise((resolve, reject) => { 6335 - stream.pipe(event.node.res); 6336 - if (stream.on) { 6337 - stream.on("end", () => { 6338 - event.node.res.end(); 6339 - resolve(); 6340 - }); 6341 - stream.on("error", (error) => { 6342 - reject(error); 6343 - }); 6344 - } 6345 - event.node.res.on("close", () => { 6346 - if (stream.abort) { 6347 - stream.abort(); 6348 - } 6349 - }); 6350 - }); 6351 - } 6352 - throw new Error("[h3] Invalid or incompatible stream provided."); 6353 - } 6354 - function sendWebResponse(event, response) { 6355 - for (const [key, value] of response.headers) { 6356 - if (key === "set-cookie") { 6357 - event.node.res.appendHeader(key, splitCookiesString(value)); 6358 - } else { 6359 - event.node.res.setHeader(key, value); 6360 - } 6361 - } 6362 - if (response.status) { 6363 - event.node.res.statusCode = sanitizeStatusCode( 6364 - response.status, 6365 - event.node.res.statusCode 6366 - ); 6367 - } 6368 - if (response.statusText) { 6369 - event.node.res.statusMessage = sanitizeStatusMessage(response.statusText); 6370 - } 6371 - if (response.redirected) { 6372 - event.node.res.setHeader("location", response.url); 6373 - } 6374 - if (!response.body) { 6375 - event.node.res.end(); 6376 - return; 6377 - } 6378 - return sendStream(event, response.body); 6379 - } 6380 - var __defProp = Object.defineProperty; 6381 - var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 6382 - var __publicField = (obj, key, value) => { 6383 - __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); 6384 - return value; 6385 - }; 6386 - class H3Event { 6387 - constructor(req, res) { 6388 - __publicField(this, "__is_event__", true); 6389 - __publicField(this, "node"); 6390 - __publicField(this, "web"); 6391 - __publicField(this, "context", {}); 6392 - __publicField(this, "_method"); 6393 - __publicField(this, "_path"); 6394 - __publicField(this, "_headers"); 6395 - __publicField(this, "_requestBody"); 6396 - __publicField(this, "_handled", false); 6397 - __publicField(this, "_onBeforeResponseCalled"); 6398 - __publicField(this, "_onAfterResponseCalled"); 6399 - this.node = { req, res }; 6400 - } 6401 - // --- Request --- 6402 - get method() { 6403 - if (!this._method) { 6404 - this._method = (this.node.req.method || "GET").toUpperCase(); 6405 - } 6406 - return this._method; 6407 - } 6408 - get path() { 6409 - return this._path || this.node.req.url || "/"; 6410 - } 6411 - get headers() { 6412 - if (!this._headers) { 6413 - this._headers = _normalizeNodeHeaders(this.node.req.headers); 6414 - } 6415 - return this._headers; 6416 - } 6417 - // --- Respoonse --- 6418 - get handled() { 6419 - return this._handled || this.node.res.writableEnded || this.node.res.headersSent; 6420 - } 6421 - respondWith(response) { 6422 - return Promise.resolve(response).then( 6423 - (_response) => sendWebResponse(this, _response) 6424 - ); 6425 - } 6426 - // --- Utils --- 6427 - toString() { 6428 - return `[${this.method}] ${this.path}`; 6429 - } 6430 - toJSON() { 6431 - return this.toString(); 6432 - } 6433 - // --- Deprecated --- 6434 - /** @deprecated Please use `event.node.req` instead. */ 6435 - get req() { 6436 - return this.node.req; 6437 - } 6438 - /** @deprecated Please use `event.node.res` instead. */ 6439 - get res() { 6440 - return this.node.res; 6441 - } 6442 - } 6443 - function _normalizeNodeHeaders(nodeHeaders) { 6444 - const headers = new Headers(); 6445 - for (const [name, value] of Object.entries(nodeHeaders)) { 6446 - if (Array.isArray(value)) { 6447 - for (const item of value) { 6448 - headers.append(name, item); 6449 - } 6450 - } else if (value) { 6451 - headers.set(name, value); 6452 - } 6453 - } 6454 - return headers; 6455 - } 6456 - function defineEventHandler$1(handler) { 6457 - if (typeof handler === "function") { 6458 - handler.__is_handler__ = true; 6459 - return handler; 6460 - } 6461 - const _hooks = { 6462 - onRequest: _normalizeArray(handler.onRequest), 6463 - onBeforeResponse: _normalizeArray(handler.onBeforeResponse) 6464 - }; 6465 - const _handler = (event) => { 6466 - return _callHandler(event, handler.handler, _hooks); 6467 - }; 6468 - _handler.__is_handler__ = true; 6469 - _handler.__resolve__ = handler.handler.__resolve__; 6470 - _handler.__websocket__ = handler.websocket; 6471 - return _handler; 6472 - } 6473 - function _normalizeArray(input) { 6474 - return input ? Array.isArray(input) ? input : [input] : void 0; 6475 - } 6476 - async function _callHandler(event, handler, hooks) { 6477 - if (hooks.onRequest) { 6478 - for (const hook of hooks.onRequest) { 6479 - await hook(event); 6480 - if (event.handled) { 6481 - return; 6482 - } 6483 - } 6484 - } 6485 - const body = await handler(event); 6486 - const response = { body }; 6487 - if (hooks.onBeforeResponse) { 6488 - for (const hook of hooks.onBeforeResponse) { 6489 - await hook(event, response); 6490 - } 6491 - } 6492 - return response.body; 6493 - } 6494 - const eventStorage = new AsyncLocalStorage(); 6495 - function defineEventHandler(handler) { 6496 - return defineEventHandler$1((event) => { 6497 - return runWithEvent(event, () => handler(event)); 6498 - }); 6499 - } 6500 - async function runWithEvent(event, fn) { 6501 - return eventStorage.run(event, fn); 6502 - } 6503 - function getEvent() { 6504 - const event = eventStorage.getStore(); 6505 - if (!event) { 6506 - throw new Error( 6507 - `No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.` 6508 - ); 6509 - } 6510 - return event; 6511 - } 6512 - const HTTPEventSymbol = Symbol("$HTTPEvent"); 6513 - function isEvent(obj) { 6514 - return typeof obj === "object" && (obj instanceof H3Event || (obj == null ? void 0 : obj[HTTPEventSymbol]) instanceof H3Event || (obj == null ? void 0 : obj.__is_event__) === true); 6515 - } 6516 - function createWrapperFunction(h3Function) { 6517 - return function(...args) { 6518 - const event = args[0]; 6519 - if (!isEvent(event)) { 6520 - args.unshift(getEvent()); 6521 - } else { 6522 - args[0] = event instanceof H3Event || event.__is_event__ ? event : event[HTTPEventSymbol]; 6523 - } 6524 - return h3Function(...args); 6525 - }; 6526 - } 6527 - const getResponseStatus = createWrapperFunction(getResponseStatus$1); 6528 - const getResponseHeaders = createWrapperFunction(getResponseHeaders$1); 6529 - function requestHandler(handler) { 6530 - return handler; 6531 - } 6532 - const minifiedTsrBootStrapScript = 'const __TSR_SSR__={matches:[],streamedValues:{},initMatch:o=>(__TSR_SSR__.matches.push(o),o.extracted?.forEach(l=>{if(l.type==="stream"){let r;l.value=new ReadableStream({start(e){r={enqueue:t=>{try{e.enqueue(t)}catch{}},close:()=>{try{e.close()}catch{}}}}}),l.value.controller=r}else{let r,e;l.value=new Promise((t,a)=>{e=a,r=t}),l.value.reject=e,l.value.resolve=r}}),!0),resolvePromise:({matchId:o,id:l,promiseState:r})=>{const e=__TSR_SSR__.matches.find(t=>t.id===o);if(e){const t=e.extracted?.[l];if(t&&t.type==="promise"&&t.value&&r.status==="success")return t.value.resolve(r.data),!0}return!1},injectChunk:({matchId:o,id:l,chunk:r})=>{const e=__TSR_SSR__.matches.find(t=>t.id===o);if(e){const t=e.extracted?.[l];if(t&&t.type==="stream"&&t.value?.controller)return t.value.controller.enqueue(new TextEncoder().encode(r.toString())),!0}return!1},closeStream:({matchId:o,id:l})=>{const r=__TSR_SSR__.matches.find(e=>e.id===o);if(r){const e=r.extracted?.[l];if(e&&e.type==="stream"&&e.value?.controller)return e.value.controller.close(),!0}return!1},cleanScripts:()=>{document.querySelectorAll(".tsr-once").forEach(o=>{o.remove()})}};window.__TSR_SSR__=__TSR_SSR__;\n'; 6533 - function attachRouterServerSsrUtils(router, manifest) { 6534 - router.ssr = { 6535 - manifest, 6536 - serializer: startSerializer 6537 - }; 6538 - router.serverSsr = { 6539 - injectedHtml: [], 6540 - streamedKeys: /* @__PURE__ */ new Set(), 6541 - injectHtml: (getHtml) => { 6542 - const promise = Promise.resolve().then(getHtml); 6543 - router.serverSsr.injectedHtml.push(promise); 6544 - router.emit({ 6545 - type: "onInjectedHtml", 6546 - promise 6547 - }); 6548 - return promise.then(() => { 6549 - }); 6550 - }, 6551 - injectScript: (getScript, opts) => { 6552 - return router.serverSsr.injectHtml(async () => { 6553 - const script = await getScript(); 6554 - return `<script class='tsr-once'>${script}${""}; if (typeof __TSR_SSR__ !== 'undefined') __TSR_SSR__.cleanScripts()<\/script>`; 6555 - }); 6556 - }, 6557 - streamValue: (key, value) => { 6558 - warning( 6559 - !router.serverSsr.streamedKeys.has(key)); 6560 - router.serverSsr.streamedKeys.add(key); 6561 - router.serverSsr.injectScript( 6562 - () => `__TSR_SSR__.streamedValues['${key}'] = { value: ${jsesc( 6563 - router.ssr.serializer.stringify(value), 6564 - { 6565 - isScriptContext: true, 6566 - wrap: true, 6567 - json: true 6568 - } 6569 - )}}` 6570 - ); 6571 - }, 6572 - onMatchSettled 6573 - }; 6574 - router.serverSsr.injectScript(() => minifiedTsrBootStrapScript, { 6575 - logScript: false 6576 - }); 6577 - } 6578 - function dehydrateRouter(router) { 6579 - var _a2, _b2, _c2; 6580 - const dehydratedRouter = { 6581 - manifest: router.ssr.manifest, 6582 - dehydratedData: (_b2 = (_a2 = router.options).dehydrate) == null ? void 0 : _b2.call(_a2), 6583 - lastMatchId: ((_c2 = router.state.matches[router.state.matches.length - 1]) == null ? void 0 : _c2.id) || "" 6584 - }; 6585 - router.serverSsr.injectScript( 6586 - () => `__TSR_SSR__.dehydrated = ${jsesc( 6587 - router.ssr.serializer.stringify(dehydratedRouter), 6588 - { 6589 - isScriptContext: true, 6590 - wrap: true, 6591 - json: true 6592 - } 6593 - )}` 6594 - ); 6595 - } 6596 - function extractAsyncLoaderData(loaderData, ctx) { 6597 - const extracted = []; 6598 - const replaced = replaceBy(loaderData, (value, path) => { 6599 - if (value instanceof ReadableStream) { 6600 - const [copy1, copy2] = value.tee(); 6601 - const entry = { 6602 - type: "stream", 6603 - path, 6604 - id: extracted.length, 6605 - matchIndex: ctx.match.index, 6606 - stream: copy2 6607 - }; 6608 - extracted.push(entry); 6609 - return copy1; 6610 - } else if (value instanceof Promise) { 6611 - const deferredPromise = defer(value); 6612 - const entry = { 6613 - type: "promise", 6614 - path, 6615 - id: extracted.length, 6616 - matchIndex: ctx.match.index, 6617 - promise: deferredPromise 6618 - }; 6619 - extracted.push(entry); 6620 - } 6621 - return value; 6622 - }); 6623 - return { replaced, extracted }; 6624 - } 6625 - function onMatchSettled(opts) { 6626 - const { router, match } = opts; 6627 - let extracted = void 0; 6628 - let serializedLoaderData = void 0; 6629 - if (match.loaderData !== void 0) { 6630 - const result = extractAsyncLoaderData(match.loaderData, { 6631 - match 6632 - }); 6633 - match.loaderData = result.replaced; 6634 - extracted = result.extracted; 6635 - serializedLoaderData = extracted.reduce( 6636 - (acc, entry) => { 6637 - return deepImmutableSetByPath(acc, ["temp", ...entry.path], void 0); 6638 - }, 6639 - { temp: result.replaced } 6640 - ).temp; 6641 - } 6642 - const initCode = `__TSR_SSR__.initMatch(${jsesc( 6643 - { 6644 - id: match.id, 6645 - __beforeLoadContext: router.ssr.serializer.stringify( 6646 - match.__beforeLoadContext 6647 - ), 6648 - loaderData: router.ssr.serializer.stringify(serializedLoaderData), 6649 - error: router.ssr.serializer.stringify(match.error), 6650 - extracted: extracted == null ? void 0 : extracted.map((entry) => pick(entry, ["type", "path"])), 6651 - updatedAt: match.updatedAt, 6652 - status: match.status 6653 - }, 6654 - { 6655 - isScriptContext: true, 6656 - wrap: true, 6657 - json: true 6658 - } 6659 - )})`; 6660 - router.serverSsr.injectScript(() => initCode); 6661 - if (extracted) { 6662 - extracted.forEach((entry) => { 6663 - if (entry.type === "promise") return injectPromise(entry); 6664 - return injectStream(entry); 6665 - }); 6666 - } 6667 - function injectPromise(entry) { 6668 - router.serverSsr.injectScript(async () => { 6669 - await entry.promise; 6670 - return `__TSR_SSR__.resolvePromise(${jsesc( 6671 - { 6672 - matchId: match.id, 6673 - id: entry.id, 6674 - promiseState: entry.promise[TSR_DEFERRED_PROMISE] 6675 - }, 6676 - { 6677 - isScriptContext: true, 6678 - wrap: true, 6679 - json: true 6680 - } 6681 - )})`; 6682 - }); 6683 - } 6684 - function injectStream(entry) { 6685 - router.serverSsr.injectHtml(async () => { 6686 - try { 6687 - const reader = entry.stream.getReader(); 6688 - let chunk = null; 6689 - while (!(chunk = await reader.read()).done) { 6690 - if (chunk.value) { 6691 - const code = `__TSR_SSR__.injectChunk(${jsesc( 6692 - { 6693 - matchId: match.id, 6694 - id: entry.id, 6695 - chunk: chunk.value 6696 - }, 6697 - { 6698 - isScriptContext: true, 6699 - wrap: true, 6700 - json: true 6701 - } 6702 - )})`; 6703 - router.serverSsr.injectScript(() => code); 6704 - } 6705 - } 6706 - router.serverSsr.injectScript( 6707 - () => `__TSR_SSR__.closeStream(${jsesc( 6708 - { 6709 - matchId: match.id, 6710 - id: entry.id 6711 - }, 6712 - { 6713 - isScriptContext: true, 6714 - wrap: true, 6715 - json: true 6716 - } 6717 - )})` 6718 - ); 6719 - } catch (err) { 6720 - console.error("stream read error", err); 6721 - } 6722 - return ""; 6723 - }); 6724 - } 6725 - } 6726 - function deepImmutableSetByPath(obj, path, value) { 6727 - if (path.length === 0) { 6728 - return value; 6729 - } 6730 - const [key, ...rest] = path; 6731 - if (Array.isArray(obj)) { 6732 - return obj.map((item, i) => { 6733 - if (i === Number(key)) { 6734 - return deepImmutableSetByPath(item, rest, value); 6735 - } 6736 - return item; 6737 - }); 6738 - } 6739 - if (isPlainObject$2(obj)) { 6740 - return { 6741 - ...obj, 6742 - [key]: deepImmutableSetByPath(obj[key], rest, value) 6743 - }; 6744 - } 6745 - return obj; 6746 - } 6747 - function replaceBy(obj, cb, path = []) { 6748 - if (isPlainArray$1(obj)) { 6749 - return obj.map((value, i) => replaceBy(value, cb, [...path, `${i}`])); 6750 - } 6751 - if (isPlainObject$2(obj)) { 6752 - const newObj2 = {}; 6753 - for (const key in obj) { 6754 - newObj2[key] = replaceBy(obj[key], cb, [...path, key]); 6755 - } 6756 - return newObj2; 6757 - } 6758 - const newObj = cb(obj, path); 6759 - if (newObj !== obj) { 6760 - return newObj; 6761 - } 6762 - return obj; 6763 - } 6764 - const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "__root.tsx", "children": ["/", "/basic", "/intent-preloading", "/pagination", "/preloading", "/suspense"], "preloads": ["/assets/main-C_SO_aYE.js"], "assets": [{ "tag": "script", "attrs": { "src": "/assets/main-C_SO_aYE.js", "type": "module" } }] }, "/": { "filePath": "index.tsx", "assets": [], "preloads": ["/assets/index-Cb09vRb3.js"] }, "/basic": { "filePath": "basic.tsx", "assets": [], "preloads": ["/assets/basic-D_HBRECz.js", "/assets/table-BGKcx7UY.js"] }, "/intent-preloading": { "filePath": "intent-preloading.tsx", "assets": [], "preloads": ["/assets/intent-preloading-BYVPES3z.js"] }, "/pagination": { "filePath": "pagination.tsx", "assets": [], "preloads": ["/assets/pagination-DT5U_TVa.js"] }, "/preloading": { "filePath": "preloading.tsx", "assets": [], "preloads": ["/assets/preloading-CF6-eBB1.js"] }, "/suspense": { "filePath": "suspense.tsx", "assets": [], "preloads": ["/assets/suspense-CVRJPFh1.js"] } } }); 6765 - function getStartManifest() { 6766 - const startManifest = tsrStartManifest(); 6767 - const rootRoute = startManifest.routes[rootRouteId] = startManifest.routes[rootRouteId] || {}; 6768 - rootRoute.assets = rootRoute.assets || []; 6769 - const manifest = { 6770 - ...startManifest, 6771 - routes: Object.fromEntries( 6772 - Object.entries(startManifest.routes).map(([k, v2]) => { 6773 - const { preloads, assets } = v2; 6774 - return [ 6775 - k, 6776 - { 6777 - preloads, 6778 - assets 6779 - } 6780 - ]; 6781 - }) 6782 - ) 6783 - }; 6784 - return manifest; 6785 - } 6786 - const _serverFnManifest = { 6787 - "src_util_pokemon_ts--getServerPokemonList_createServerFn_handler": { 6788 - functionName: "getServerPokemonList_createServerFn_handler", 6789 - importer: () => import('./pokemon-BBQDA5Ex.mjs') 6790 - } 6791 - }; 6792 - const serverFnManifest = _serverFnManifest; 6793 - function sanitizeBase$1(base) { 6794 - return base.replace(/^\/|\/$/g, ""); 6795 - } 6796 - const handleServerAction = async ({ 6797 - request 6798 - }) => { 6799 - const controller = new AbortController(); 6800 - const signal = controller.signal; 6801 - const abort = () => controller.abort(); 6802 - request.signal.addEventListener("abort", abort); 6803 - const method = request.method; 6804 - const url = new URL(request.url, "http://localhost:3000"); 6805 - const regex = new RegExp(`${sanitizeBase$1("/_serverFn")}/([^/?#]+)`); 6806 - const match = url.pathname.match(regex); 6807 - const serverFnId = match ? match[1] : null; 6808 - const search = Object.fromEntries(url.searchParams.entries()); 6809 - const isCreateServerFn = "createServerFn" in search; 6810 - const isRaw = "raw" in search; 6811 - if (typeof serverFnId !== "string") { 6812 - throw new Error("Invalid server action param for serverFnId: " + serverFnId); 6813 - } 6814 - const serverFnInfo = serverFnManifest[serverFnId]; 6815 - if (!serverFnInfo) { 6816 - console.info("serverFnManifest", serverFnManifest); 6817 - throw new Error("Server function info not found for " + serverFnId); 6818 - } 6819 - const fnModule = await serverFnInfo.importer(); 6820 - if (!fnModule) { 6821 - console.info("serverFnInfo", serverFnInfo); 6822 - throw new Error("Server function module not resolved for " + serverFnId); 6823 - } 6824 - const action = fnModule[serverFnInfo.functionName]; 6825 - if (!action) { 6826 - console.info("serverFnInfo", serverFnInfo); 6827 - console.info("fnModule", fnModule); 6828 - throw new Error(`Server function module export not resolved for serverFn ID: ${serverFnId}`); 6829 - } 6830 - const formDataContentTypes = ["multipart/form-data", "application/x-www-form-urlencoded"]; 6831 - const response = await (async () => { 6832 - try { 6833 - let result = await (async () => { 6834 - if (request.headers.get("Content-Type") && formDataContentTypes.some((type) => { 6835 - var _a2; 6836 - return (_a2 = request.headers.get("Content-Type")) == null ? void 0 : _a2.includes(type); 6837 - })) { 6838 - invariant(method.toLowerCase() !== "get", "GET requests with FormData payloads are not supported"); 6839 - return await action(await request.formData(), signal); 6840 - } 6841 - if (method.toLowerCase() === "get") { 6842 - let payload2 = search; 6843 - if (isCreateServerFn) { 6844 - payload2 = search.payload; 6845 - } 6846 - payload2 = payload2 ? startSerializer.parse(payload2) : payload2; 6847 - return await action(payload2, signal); 6848 - } 6849 - const jsonPayloadAsString = await request.text(); 6850 - const payload = startSerializer.parse(jsonPayloadAsString); 6851 - if (isCreateServerFn) { 6852 - return await action(payload, signal); 6853 - } 6854 - return await action(...payload, signal); 6855 - })(); 6856 - if (result.result instanceof Response) { 6857 - return result.result; 6858 - } 6859 - if (!isCreateServerFn) { 6860 - result = result.result; 6861 - if (result instanceof Response) { 6862 - return result; 6863 - } 6864 - } 6865 - if (isNotFound(result)) { 6866 - return isNotFoundResponse(result); 6867 - } 6868 - return new Response(result !== void 0 ? startSerializer.stringify(result) : void 0, { 6869 - status: getResponseStatus(getEvent()), 6870 - headers: { 6871 - "Content-Type": "application/json" 6872 - } 6873 - }); 6874 - } catch (error) { 6875 - if (error instanceof Response) { 6876 - return error; 6877 - } 6878 - if (isNotFound(error)) { 6879 - return isNotFoundResponse(error); 6880 - } 6881 - console.info(); 6882 - console.info("Server Fn Error!"); 6883 - console.info(); 6884 - console.error(error); 6885 - console.info(); 6886 - return new Response(startSerializer.stringify(error), { 6887 - status: 500, 6888 - headers: { 6889 - "Content-Type": "application/json" 6890 - } 6891 - }); 6892 - } 6893 - })(); 6894 - request.signal.removeEventListener("abort", abort); 6895 - if (isRaw) { 6896 - return response; 6897 - } 6898 - return response; 6899 - }; 6900 - function isNotFoundResponse(error) { 6901 - const { 6902 - headers, 6903 - ...rest 6904 - } = error; 6905 - return new Response(JSON.stringify(rest), { 6906 - status: 200, 6907 - headers: { 6908 - "Content-Type": "application/json", 6909 - ...headers || {} 6910 - } 6911 - }); 6912 - } 6913 - function getStartResponseHeaders(opts) { 6914 - let headers = mergeHeaders( 6915 - getResponseHeaders(), 6916 - { 6917 - "Content-Type": "text/html; charset=UTF-8" 6918 - }, 6919 - ...opts.router.state.matches.map((match) => { 6920 - return match.headers; 6921 - }) 6922 - ); 6923 - const { redirect } = opts.router.state; 6924 - if (redirect) { 6925 - headers = mergeHeaders(headers, redirect.headers); 6926 - } 6927 - return headers; 6928 - } 6929 - function createStartHandler({ 6930 - createRouter: createRouter2 6931 - }) { 6932 - return (cb) => { 6933 - const originalFetch = globalThis.fetch; 6934 - const startRequestResolver = async ({ request }) => { 6935 - globalThis.fetch = async function(input, init) { 6936 - function resolve(url2, requestOptions) { 6937 - const fetchRequest = new Request(url2, requestOptions); 6938 - return startRequestResolver({ request: fetchRequest }); 6939 - } 6940 - function getOrigin() { 6941 - return request.headers.get("Origin") || request.headers.get("Referer") || "http://localhost"; 6942 - } 6943 - if (typeof input === "string" && input.startsWith("/")) { 6944 - const url2 = new URL(input, getOrigin()); 6945 - return resolve(url2, init); 6946 - } else if (typeof input === "object" && "url" in input && typeof input.url === "string" && input.url.startsWith("/")) { 6947 - const url2 = new URL(input.url, getOrigin()); 6948 - return resolve(url2, init); 6949 - } 6950 - return originalFetch(input, init); 6951 - }; 6952 - const url = new URL(request.url); 6953 - const href = url.href.replace(url.origin, ""); 6954 - const history = createMemoryHistory({ 6955 - initialEntries: [href] 6956 - }); 6957 - const router = createRouter2(); 6958 - attachRouterServerSsrUtils(router, getStartManifest()); 6959 - router.update({ 6960 - history 6961 - }); 6962 - const response = await (async () => { 6963 - try { 6964 - if (false) ; 6965 - const serverFnBase = joinPaths([ 6966 - "/", 6967 - trimPath("/_serverFn"), 6968 - "/" 6969 - ]); 6970 - if (href.startsWith(serverFnBase)) { 6971 - return await handleServerAction({ request }); 6972 - } 6973 - const serverRouteTreeModule = await (async () => { 6974 - try { 6975 - return await import( 6976 - // @ts-expect-error 6977 - './routeTree.gen-C-haoEjS.mjs' 6978 - ); 6979 - } catch (e) { 6980 - console.log(e); 6981 - return void 0; 6982 - } 6983 - })(); 6984 - if (serverRouteTreeModule) { 6985 - const [_matchedRoutes, response3] = await handleServerRoutes({ 6986 - routeTree: serverRouteTreeModule.routeTree, 6987 - request 6988 - }); 6989 - if (response3) return response3; 6990 - } 6991 - const requestAcceptHeader = request.headers.get("Accept") || "*/*"; 6992 - const splitRequestAcceptHeader = requestAcceptHeader.split(","); 6993 - const supportedMimeTypes = ["*/*", "text/html"]; 6994 - const isRouterAcceptSupported = supportedMimeTypes.some( 6995 - (mimeType) => splitRequestAcceptHeader.some( 6996 - (acceptedMimeType) => acceptedMimeType.trim().startsWith(mimeType) 6997 - ) 6998 - ); 6999 - if (!isRouterAcceptSupported) { 7000 - return json( 7001 - { 7002 - error: "Only HTML requests are supported here" 7003 - }, 7004 - { 7005 - status: 500 7006 - } 7007 - ); 7008 - } 7009 - await router.load(); 7010 - if (router.state.redirect) return router.state.redirect; 7011 - dehydrateRouter(router); 7012 - const responseHeaders = getStartResponseHeaders({ router }); 7013 - const response2 = await cb({ 7014 - request, 7015 - router, 7016 - responseHeaders 7017 - }); 7018 - return response2; 7019 - } catch (err) { 7020 - if (err instanceof Response) { 7021 - return err; 7022 - } 7023 - throw err; 7024 - } 7025 - })(); 7026 - if (isRedirect(response)) { 7027 - if (isResolvedRedirect(response)) { 7028 - if (request.headers.get("x-tsr-redirect") === "manual") { 7029 - return json( 7030 - { 7031 - ...response.options, 7032 - isSerializedRedirect: true 7033 - }, 7034 - { 7035 - headers: response.headers 7036 - } 7037 - ); 7038 - } 7039 - return response; 7040 - } 7041 - if (response.options.to && typeof response.options.to === "string" && !response.options.to.startsWith("/")) { 7042 - throw new Error( 7043 - `Server side redirects must use absolute paths via the 'href' or 'to' options. Received: ${JSON.stringify(response.options)}` 7044 - ); 7045 - } 7046 - if (["params", "search", "hash"].some( 7047 - (d) => typeof response.options[d] === "function" 7048 - )) { 7049 - throw new Error( 7050 - `Server side redirects must use static search, params, and hash values and do not support functional values. Received functional values for: ${Object.keys( 7051 - response.options 7052 - ).filter((d) => typeof response.options[d] === "function").map((d) => `"${d}"`).join(", ")}` 7053 - ); 7054 - } 7055 - const redirect = router.resolveRedirect(response); 7056 - if (request.headers.get("x-tsr-redirect") === "manual") { 7057 - return json( 7058 - { 7059 - ...response.options, 7060 - isSerializedRedirect: true 7061 - }, 7062 - { 7063 - headers: response.headers 7064 - } 7065 - ); 7066 - } 7067 - return redirect; 7068 - } 7069 - return response; 7070 - }; 7071 - return requestHandler(startRequestResolver); 7072 - }; 7073 - } 7074 - async function handleServerRoutes({ 7075 - routeTree: routeTree2, 7076 - request 7077 - }) { 7078 - const { flatRoutes, routesById, routesByPath } = processRouteTree({ 7079 - routeTree: routeTree2, 7080 - initRoute: (route, i) => { 7081 - route.init({ 7082 - originalIndex: i 7083 - }); 7084 - } 7085 - }); 7086 - const url = new URL(request.url); 7087 - const pathname = url.pathname; 7088 - const history = createMemoryHistory({ 7089 - initialEntries: [pathname] 7090 - }); 7091 - const { matchedRoutes, foundRoute, routeParams } = getMatchedRoutes({ 7092 - pathname: history.location.pathname, 7093 - basepath: "/", 7094 - caseSensitive: true, 7095 - routesByPath, 7096 - routesById, 7097 - flatRoutes 7098 - }); 7099 - let response; 7100 - if (foundRoute && foundRoute.id !== rootRouteId) { 7101 - const method = Object.keys(foundRoute.options.methods).find( 7102 - (method2) => method2.toLowerCase() === request.method.toLowerCase() 7103 - ); 7104 - if (method) { 7105 - const handler = foundRoute.options.methods[method]; 7106 - if (handler) { 7107 - const middlewares = flattenMiddlewares( 7108 - matchedRoutes.flatMap((r) => r.options.middleware).filter(Boolean) 7109 - ).map((d) => d.options.server); 7110 - middlewares.push(handlerToMiddleware(handler)); 7111 - const ctx = await executeMiddleware(middlewares, { 7112 - request, 7113 - context: {}, 7114 - params: routeParams, 7115 - pathname: history.location.pathname 7116 - }); 7117 - response = ctx.response; 7118 - } 7119 - } 7120 - } 7121 - return [matchedRoutes, response]; 7122 - } 7123 - function handlerToMiddleware(handler) { 7124 - return async ({ next: _next, ...rest }) => ({ 7125 - response: await handler(rest) 7126 - }); 7127 - } 7128 - function executeMiddleware(middlewares, ctx) { 7129 - let index2 = -1; 7130 - const next = async (ctx2) => { 7131 - index2++; 7132 - const middleware = middlewares[index2]; 7133 - if (!middleware) return ctx2; 7134 - const result = await middleware({ 7135 - ...ctx2, 7136 - // Allow the middleware to call the next middleware in the chain 7137 - next: async (nextCtx) => { 7138 - const nextResult = await next({ ...ctx2, ...nextCtx }); 7139 - return Object.assign(ctx2, handleCtxResult(nextResult)); 7140 - } 7141 - // Allow the middleware result to extend the return context 7142 - }).catch((err) => { 7143 - if (isSpecialResponse(err)) { 7144 - return { 7145 - response: err 7146 - }; 7147 - } 7148 - throw err; 7149 - }); 7150 - return Object.assign(ctx2, handleCtxResult(result)); 7151 - }; 7152 - return handleCtxResult(next(ctx)); 7153 - } 7154 - function handleCtxResult(result) { 7155 - if (isSpecialResponse(result)) { 7156 - return { 7157 - response: result 7158 - }; 7159 - } 7160 - return result; 7161 - } 7162 - function isSpecialResponse(err) { 7163 - return isResponse(err) || isRedirect(err); 7164 - } 7165 - function isResponse(response) { 7166 - return response instanceof Response; 7167 - } 7168 - function defineHandlerCallback(handler) { 7169 - return handler; 7170 - } 7171 - const defaultStreamHandler = defineHandlerCallback( 7172 - async ({ request, router, responseHeaders }) => { 7173 - if (typeof ReactDOMServer.renderToReadableStream === "function") { 7174 - const stream = await ReactDOMServer.renderToReadableStream( 7175 - /* @__PURE__ */ jsx(StartServer, { router }), 7176 - { 7177 - signal: request.signal 7178 - } 7179 - ); 7180 - if (isbot(request.headers.get("User-Agent"))) { 7181 - await stream.allReady; 7182 - } 7183 - const responseStream = transformReadableStreamWithRouter( 7184 - router, 7185 - stream 7186 - ); 7187 - return new Response(responseStream, { 7188 - status: router.state.statusCode, 7189 - headers: responseHeaders 7190 - }); 7191 - } 7192 - if (typeof ReactDOMServer.renderToPipeableStream === "function") { 7193 - const reactAppPassthrough = new PassThrough(); 7194 - try { 7195 - const pipeable = ReactDOMServer.renderToPipeableStream( 7196 - /* @__PURE__ */ jsx(StartServer, { router }), 7197 - { 7198 - ...isbot(request.headers.get("User-Agent")) ? { 7199 - onAllReady() { 7200 - pipeable.pipe(reactAppPassthrough); 7201 - } 7202 - } : { 7203 - onShellReady() { 7204 - pipeable.pipe(reactAppPassthrough); 7205 - } 7206 - }, 7207 - onError: (error, info) => { 7208 - if (error instanceof Error && error.message === "ShellBoundaryError") 7209 - return; 7210 - console.error("Error in renderToPipeableStream:", error, info); 7211 - } 7212 - } 7213 - ); 7214 - } catch (e) { 7215 - console.error("Error in renderToPipeableStream:", e); 7216 - } 7217 - const responseStream = transformPipeableStreamWithRouter( 7218 - router, 7219 - reactAppPassthrough 7220 - ); 7221 - return new Response(responseStream, { 7222 - status: router.state.statusCode, 7223 - headers: responseHeaders 7224 - }); 7225 - } 7226 - throw new Error( 7227 - "No renderToReadableStream or renderToPipeableStream found in react-dom/server. Ensure you are using a version of react-dom that supports streaming." 7228 - ); 7229 - } 7230 - ); 7231 - var Subscribable = class { 7232 - constructor() { 7233 - this.listeners = /* @__PURE__ */ new Set(); 7234 - this.subscribe = this.subscribe.bind(this); 7235 - } 7236 - subscribe(listener) { 7237 - this.listeners.add(listener); 7238 - this.onSubscribe(); 7239 - return () => { 7240 - this.listeners.delete(listener); 7241 - this.onUnsubscribe(); 7242 - }; 7243 - } 7244 - hasListeners() { 7245 - return this.listeners.size > 0; 7246 - } 7247 - onSubscribe() { 7248 - } 7249 - onUnsubscribe() { 7250 - } 7251 - }; 7252 - var isServer = "undefined" === "undefined"; 7253 - function noop() { 7254 - } 7255 - function functionalUpdate(updater, input) { 7256 - return typeof updater === "function" ? updater(input) : updater; 7257 - } 7258 - function isValidTimeout(value) { 7259 - return typeof value === "number" && value >= 0 && value !== Infinity; 7260 - } 7261 - function timeUntilStale(updatedAt, staleTime) { 7262 - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); 7263 - } 7264 - function resolveStaleTime(staleTime, query) { 7265 - return typeof staleTime === "function" ? staleTime(query) : staleTime; 7266 - } 7267 - function resolveEnabled(enabled, query) { 7268 - return typeof enabled === "function" ? enabled(query) : enabled; 7269 - } 7270 - function matchQuery(filters, query) { 7271 - const { 7272 - type = "all", 7273 - exact, 7274 - fetchStatus, 7275 - predicate, 7276 - queryKey, 7277 - stale 7278 - } = filters; 7279 - if (queryKey) { 7280 - if (exact) { 7281 - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { 7282 - return false; 7283 - } 7284 - } else if (!partialMatchKey(query.queryKey, queryKey)) { 7285 - return false; 7286 - } 7287 - } 7288 - if (type !== "all") { 7289 - const isActive = query.isActive(); 7290 - if (type === "active" && !isActive) { 7291 - return false; 7292 - } 7293 - if (type === "inactive" && isActive) { 7294 - return false; 7295 - } 7296 - } 7297 - if (typeof stale === "boolean" && query.isStale() !== stale) { 7298 - return false; 7299 - } 7300 - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { 7301 - return false; 7302 - } 7303 - if (predicate && !predicate(query)) { 7304 - return false; 7305 - } 7306 - return true; 7307 - } 7308 - function matchMutation(filters, mutation) { 7309 - const { exact, status, predicate, mutationKey } = filters; 7310 - if (mutationKey) { 7311 - if (!mutation.options.mutationKey) { 7312 - return false; 7313 - } 7314 - if (exact) { 7315 - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { 7316 - return false; 7317 - } 7318 - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { 7319 - return false; 7320 - } 7321 - } 7322 - if (status && mutation.state.status !== status) { 7323 - return false; 7324 - } 7325 - if (predicate && !predicate(mutation)) { 7326 - return false; 7327 - } 7328 - return true; 7329 - } 7330 - function hashQueryKeyByOptions(queryKey, options) { 7331 - const hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashKey; 7332 - return hashFn(queryKey); 7333 - } 7334 - function hashKey(queryKey) { 7335 - return JSON.stringify( 7336 - queryKey, 7337 - (_, val) => isPlainObject$1(val) ? Object.keys(val).sort().reduce((result, key) => { 7338 - result[key] = val[key]; 7339 - return result; 7340 - }, {}) : val 7341 - ); 7342 - } 7343 - function partialMatchKey(a, b) { 7344 - if (a === b) { 7345 - return true; 7346 - } 7347 - if (typeof a !== typeof b) { 7348 - return false; 7349 - } 7350 - if (a && b && typeof a === "object" && typeof b === "object") { 7351 - return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); 7352 - } 7353 - return false; 7354 - } 7355 - function replaceEqualDeep(a, b) { 7356 - if (a === b) { 7357 - return a; 7358 - } 7359 - const array = isPlainArray(a) && isPlainArray(b); 7360 - if (array || isPlainObject$1(a) && isPlainObject$1(b)) { 7361 - const aItems = array ? a : Object.keys(a); 7362 - const aSize = aItems.length; 7363 - const bItems = array ? b : Object.keys(b); 7364 - const bSize = bItems.length; 7365 - const copy2 = array ? [] : {}; 7366 - let equalItems = 0; 7367 - for (let i = 0; i < bSize; i++) { 7368 - const key = array ? i : bItems[i]; 7369 - if ((!array && aItems.includes(key) || array) && a[key] === void 0 && b[key] === void 0) { 7370 - copy2[key] = void 0; 7371 - equalItems++; 7372 - } else { 7373 - copy2[key] = replaceEqualDeep(a[key], b[key]); 7374 - if (copy2[key] === a[key] && a[key] !== void 0) { 7375 - equalItems++; 7376 - } 7377 - } 7378 - } 7379 - return aSize === bSize && equalItems === aSize ? a : copy2; 7380 - } 7381 - return b; 7382 - } 7383 - function shallowEqualObjects(a, b) { 7384 - if (!b || Object.keys(a).length !== Object.keys(b).length) { 7385 - return false; 7386 - } 7387 - for (const key in a) { 7388 - if (a[key] !== b[key]) { 7389 - return false; 7390 - } 7391 - } 7392 - return true; 7393 - } 7394 - function isPlainArray(value) { 7395 - return Array.isArray(value) && value.length === Object.keys(value).length; 7396 - } 7397 - function isPlainObject$1(o) { 7398 - if (!hasObjectPrototype(o)) { 7399 - return false; 7400 - } 7401 - const ctor = o.constructor; 7402 - if (ctor === void 0) { 7403 - return true; 7404 - } 7405 - const prot = ctor.prototype; 7406 - if (!hasObjectPrototype(prot)) { 7407 - return false; 7408 - } 7409 - if (!prot.hasOwnProperty("isPrototypeOf")) { 7410 - return false; 7411 - } 7412 - if (Object.getPrototypeOf(o) !== Object.prototype) { 7413 - return false; 7414 - } 7415 - return true; 7416 - } 7417 - function hasObjectPrototype(o) { 7418 - return Object.prototype.toString.call(o) === "[object Object]"; 7419 - } 7420 - function sleep(timeout) { 7421 - return new Promise((resolve) => { 7422 - setTimeout(resolve, timeout); 7423 - }); 7424 - } 7425 - function replaceData(prevData, data, options) { 7426 - if (typeof options.structuralSharing === "function") { 7427 - return options.structuralSharing(prevData, data); 7428 - } else if (options.structuralSharing !== false) { 7429 - return replaceEqualDeep(prevData, data); 7430 - } 7431 - return data; 7432 - } 7433 - function addToEnd(items, item, max = 0) { 7434 - const newItems = [...items, item]; 7435 - return max && newItems.length > max ? newItems.slice(1) : newItems; 7436 - } 7437 - function addToStart(items, item, max = 0) { 7438 - const newItems = [item, ...items]; 7439 - return max && newItems.length > max ? newItems.slice(0, -1) : newItems; 7440 - } 7441 - var skipToken = Symbol(); 7442 - function ensureQueryFn(options, fetchOptions) { 7443 - if (!options.queryFn && (fetchOptions == null ? void 0 : fetchOptions.initialPromise)) { 7444 - return () => fetchOptions.initialPromise; 7445 - } 7446 - if (!options.queryFn || options.queryFn === skipToken) { 7447 - return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); 7448 - } 7449 - return options.queryFn; 7450 - } 7451 - function shouldThrowError(throwOnError, params) { 7452 - if (typeof throwOnError === "function") { 7453 - return throwOnError(...params); 7454 - } 7455 - return !!throwOnError; 7456 - } 7457 - var FocusManager = (_a = class extends Subscribable { 7458 - constructor() { 7459 - super(); 7460 - __privateAdd(this, _focused); 7461 - __privateAdd(this, _cleanup); 7462 - __privateAdd(this, _setup); 7463 - __privateSet(this, _setup, (onFocus) => { 7464 - return; 7465 - }); 7466 - } 7467 - onSubscribe() { 7468 - if (!__privateGet(this, _cleanup)) { 7469 - this.setEventListener(__privateGet(this, _setup)); 7470 - } 7471 - } 7472 - onUnsubscribe() { 7473 - var _a2; 7474 - if (!this.hasListeners()) { 7475 - (_a2 = __privateGet(this, _cleanup)) == null ? void 0 : _a2.call(this); 7476 - __privateSet(this, _cleanup, void 0); 7477 - } 7478 - } 7479 - setEventListener(setup) { 7480 - var _a2; 7481 - __privateSet(this, _setup, setup); 7482 - (_a2 = __privateGet(this, _cleanup)) == null ? void 0 : _a2.call(this); 7483 - __privateSet(this, _cleanup, setup((focused) => { 7484 - if (typeof focused === "boolean") { 7485 - this.setFocused(focused); 7486 - } else { 7487 - this.onFocus(); 7488 - } 7489 - })); 7490 - } 7491 - setFocused(focused) { 7492 - const changed = __privateGet(this, _focused) !== focused; 7493 - if (changed) { 7494 - __privateSet(this, _focused, focused); 7495 - this.onFocus(); 7496 - } 7497 - } 7498 - onFocus() { 7499 - const isFocused = this.isFocused(); 7500 - this.listeners.forEach((listener) => { 7501 - listener(isFocused); 7502 - }); 7503 - } 7504 - isFocused() { 7505 - var _a2; 7506 - if (typeof __privateGet(this, _focused) === "boolean") { 7507 - return __privateGet(this, _focused); 7508 - } 7509 - return ((_a2 = globalThis.document) == null ? void 0 : _a2.visibilityState) !== "hidden"; 7510 - } 7511 - }, _focused = new WeakMap(), _cleanup = new WeakMap(), _setup = new WeakMap(), _a); 7512 - var focusManager = new FocusManager(); 7513 - var OnlineManager = (_b = class extends Subscribable { 7514 - constructor() { 7515 - super(); 7516 - __privateAdd(this, _online, true); 7517 - __privateAdd(this, _cleanup2); 7518 - __privateAdd(this, _setup2); 7519 - __privateSet(this, _setup2, (onOnline) => { 7520 - return; 7521 - }); 7522 - } 7523 - onSubscribe() { 7524 - if (!__privateGet(this, _cleanup2)) { 7525 - this.setEventListener(__privateGet(this, _setup2)); 7526 - } 7527 - } 7528 - onUnsubscribe() { 7529 - var _a2; 7530 - if (!this.hasListeners()) { 7531 - (_a2 = __privateGet(this, _cleanup2)) == null ? void 0 : _a2.call(this); 7532 - __privateSet(this, _cleanup2, void 0); 7533 - } 7534 - } 7535 - setEventListener(setup) { 7536 - var _a2; 7537 - __privateSet(this, _setup2, setup); 7538 - (_a2 = __privateGet(this, _cleanup2)) == null ? void 0 : _a2.call(this); 7539 - __privateSet(this, _cleanup2, setup(this.setOnline.bind(this))); 7540 - } 7541 - setOnline(online) { 7542 - const changed = __privateGet(this, _online) !== online; 7543 - if (changed) { 7544 - __privateSet(this, _online, online); 7545 - this.listeners.forEach((listener) => { 7546 - listener(online); 7547 - }); 7548 - } 7549 - } 7550 - isOnline() { 7551 - return __privateGet(this, _online); 7552 - } 7553 - }, _online = new WeakMap(), _cleanup2 = new WeakMap(), _setup2 = new WeakMap(), _b); 7554 - var onlineManager = new OnlineManager(); 7555 - function pendingThenable() { 7556 - let resolve; 7557 - let reject; 7558 - const thenable = new Promise((_resolve, _reject) => { 7559 - resolve = _resolve; 7560 - reject = _reject; 7561 - }); 7562 - thenable.status = "pending"; 7563 - thenable.catch(() => { 7564 - }); 7565 - function finalize(data) { 7566 - Object.assign(thenable, data); 7567 - delete thenable.resolve; 7568 - delete thenable.reject; 7569 - } 7570 - thenable.resolve = (value) => { 7571 - finalize({ 7572 - status: "fulfilled", 7573 - value 7574 - }); 7575 - resolve(value); 7576 - }; 7577 - thenable.reject = (reason) => { 7578 - finalize({ 7579 - status: "rejected", 7580 - reason 7581 - }); 7582 - reject(reason); 7583 - }; 7584 - return thenable; 7585 - } 7586 - function tryResolveSync(promise) { 7587 - var _a2; 7588 - let data; 7589 - (_a2 = promise.then((result) => { 7590 - data = result; 7591 - return result; 7592 - })) == null ? void 0 : _a2.catch(noop); 7593 - if (data !== void 0) { 7594 - return { data }; 7595 - } 7596 - return void 0; 7597 - } 7598 - function defaultRetryDelay(failureCount) { 7599 - return Math.min(1e3 * 2 ** failureCount, 3e4); 7600 - } 7601 - function canFetch(networkMode) { 7602 - return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; 7603 - } 7604 - var CancelledError = class extends Error { 7605 - constructor(options) { 7606 - super("CancelledError"); 7607 - this.revert = options == null ? void 0 : options.revert; 7608 - this.silent = options == null ? void 0 : options.silent; 7609 - } 7610 - }; 7611 - function isCancelledError(value) { 7612 - return value instanceof CancelledError; 7613 - } 7614 - function createRetryer(config) { 7615 - let isRetryCancelled = false; 7616 - let failureCount = 0; 7617 - let isResolved = false; 7618 - let continueFn; 7619 - const thenable = pendingThenable(); 7620 - const cancel = (cancelOptions) => { 7621 - var _a2; 7622 - if (!isResolved) { 7623 - reject(new CancelledError(cancelOptions)); 7624 - (_a2 = config.abort) == null ? void 0 : _a2.call(config); 7625 - } 7626 - }; 7627 - const cancelRetry = () => { 7628 - isRetryCancelled = true; 7629 - }; 7630 - const continueRetry = () => { 7631 - isRetryCancelled = false; 7632 - }; 7633 - const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun(); 7634 - const canStart = () => canFetch(config.networkMode) && config.canRun(); 7635 - const resolve = (value) => { 7636 - var _a2; 7637 - if (!isResolved) { 7638 - isResolved = true; 7639 - (_a2 = config.onSuccess) == null ? void 0 : _a2.call(config, value); 7640 - continueFn == null ? void 0 : continueFn(); 7641 - thenable.resolve(value); 7642 - } 7643 - }; 7644 - const reject = (value) => { 7645 - var _a2; 7646 - if (!isResolved) { 7647 - isResolved = true; 7648 - (_a2 = config.onError) == null ? void 0 : _a2.call(config, value); 7649 - continueFn == null ? void 0 : continueFn(); 7650 - thenable.reject(value); 7651 - } 7652 - }; 7653 - const pause = () => { 7654 - return new Promise((continueResolve) => { 7655 - var _a2; 7656 - continueFn = (value) => { 7657 - if (isResolved || canContinue()) { 7658 - continueResolve(value); 7659 - } 7660 - }; 7661 - (_a2 = config.onPause) == null ? void 0 : _a2.call(config); 7662 - }).then(() => { 7663 - var _a2; 7664 - continueFn = void 0; 7665 - if (!isResolved) { 7666 - (_a2 = config.onContinue) == null ? void 0 : _a2.call(config); 7667 - } 7668 - }); 7669 - }; 7670 - const run = () => { 7671 - if (isResolved) { 7672 - return; 7673 - } 7674 - let promiseOrValue; 7675 - const initialPromise = failureCount === 0 ? config.initialPromise : void 0; 7676 - try { 7677 - promiseOrValue = initialPromise ?? config.fn(); 7678 - } catch (error) { 7679 - promiseOrValue = Promise.reject(error); 7680 - } 7681 - Promise.resolve(promiseOrValue).then(resolve).catch((error) => { 7682 - var _a2; 7683 - if (isResolved) { 7684 - return; 7685 - } 7686 - const retry = config.retry ?? (0 ); 7687 - const retryDelay = config.retryDelay ?? defaultRetryDelay; 7688 - const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; 7689 - const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); 7690 - if (isRetryCancelled || !shouldRetry) { 7691 - reject(error); 7692 - return; 7693 - } 7694 - failureCount++; 7695 - (_a2 = config.onFail) == null ? void 0 : _a2.call(config, failureCount, error); 7696 - sleep(delay).then(() => { 7697 - return canContinue() ? void 0 : pause(); 7698 - }).then(() => { 7699 - if (isRetryCancelled) { 7700 - reject(error); 7701 - } else { 7702 - run(); 7703 - } 7704 - }); 7705 - }); 7706 - }; 7707 - return { 7708 - promise: thenable, 7709 - cancel, 7710 - continue: () => { 7711 - continueFn == null ? void 0 : continueFn(); 7712 - return thenable; 7713 - }, 7714 - cancelRetry, 7715 - continueRetry, 7716 - canStart, 7717 - start: () => { 7718 - if (canStart()) { 7719 - run(); 7720 - } else { 7721 - pause().then(run); 7722 - } 7723 - return thenable; 7724 - } 7725 - }; 7726 - } 7727 - var defaultScheduler = (cb) => setTimeout(cb, 0); 7728 - function createNotifyManager() { 7729 - let queue = []; 7730 - let transactions = 0; 7731 - let notifyFn = (callback) => { 7732 - callback(); 7733 - }; 7734 - let batchNotifyFn = (callback) => { 7735 - callback(); 7736 - }; 7737 - let scheduleFn = defaultScheduler; 7738 - const schedule = (callback) => { 7739 - if (transactions) { 7740 - queue.push(callback); 7741 - } else { 7742 - scheduleFn(() => { 7743 - notifyFn(callback); 7744 - }); 7745 - } 7746 - }; 7747 - const flush = () => { 7748 - const originalQueue = queue; 7749 - queue = []; 7750 - if (originalQueue.length) { 7751 - scheduleFn(() => { 7752 - batchNotifyFn(() => { 7753 - originalQueue.forEach((callback) => { 7754 - notifyFn(callback); 7755 - }); 7756 - }); 7757 - }); 7758 - } 7759 - }; 7760 - return { 7761 - batch: (callback) => { 7762 - let result; 7763 - transactions++; 7764 - try { 7765 - result = callback(); 7766 - } finally { 7767 - transactions--; 7768 - if (!transactions) { 7769 - flush(); 7770 - } 7771 - } 7772 - return result; 7773 - }, 7774 - /** 7775 - * All calls to the wrapped function will be batched. 7776 - */ 7777 - batchCalls: (callback) => { 7778 - return (...args) => { 7779 - schedule(() => { 7780 - callback(...args); 7781 - }); 7782 - }; 7783 - }, 7784 - schedule, 7785 - /** 7786 - * Use this method to set a custom notify function. 7787 - * This can be used to for example wrap notifications with `React.act` while running tests. 7788 - */ 7789 - setNotifyFunction: (fn) => { 7790 - notifyFn = fn; 7791 - }, 7792 - /** 7793 - * Use this method to set a custom function to batch notifications together into a single tick. 7794 - * By default React Query will use the batch function provided by ReactDOM or React Native. 7795 - */ 7796 - setBatchNotifyFunction: (fn) => { 7797 - batchNotifyFn = fn; 7798 - }, 7799 - setScheduler: (fn) => { 7800 - scheduleFn = fn; 7801 - } 7802 - }; 7803 - } 7804 - var notifyManager = createNotifyManager(); 7805 - var Removable = (_c = class { 7806 - constructor() { 7807 - __privateAdd(this, _gcTimeout); 7808 - } 7809 - destroy() { 7810 - this.clearGcTimeout(); 7811 - } 7812 - scheduleGc() { 7813 - this.clearGcTimeout(); 7814 - if (isValidTimeout(this.gcTime)) { 7815 - __privateSet(this, _gcTimeout, setTimeout(() => { 7816 - this.optionalRemove(); 7817 - }, this.gcTime)); 7818 - } 7819 - } 7820 - updateGcTime(newGcTime) { 7821 - this.gcTime = Math.max( 7822 - this.gcTime || 0, 7823 - newGcTime ?? (Infinity ) 7824 - ); 7825 - } 7826 - clearGcTimeout() { 7827 - if (__privateGet(this, _gcTimeout)) { 7828 - clearTimeout(__privateGet(this, _gcTimeout)); 7829 - __privateSet(this, _gcTimeout, void 0); 7830 - } 7831 - } 7832 - }, _gcTimeout = new WeakMap(), _c); 7833 - var Query = (_d = class extends Removable { 7834 - constructor(config) { 7835 - super(); 7836 - __privateAdd(this, _Query_instances); 7837 - __privateAdd(this, _initialState); 7838 - __privateAdd(this, _revertState); 7839 - __privateAdd(this, _cache); 7840 - __privateAdd(this, _client); 7841 - __privateAdd(this, _retryer); 7842 - __privateAdd(this, _defaultOptions); 7843 - __privateAdd(this, _abortSignalConsumed); 7844 - __privateSet(this, _abortSignalConsumed, false); 7845 - __privateSet(this, _defaultOptions, config.defaultOptions); 7846 - this.setOptions(config.options); 7847 - this.observers = []; 7848 - __privateSet(this, _client, config.client); 7849 - __privateSet(this, _cache, __privateGet(this, _client).getQueryCache()); 7850 - this.queryKey = config.queryKey; 7851 - this.queryHash = config.queryHash; 7852 - __privateSet(this, _initialState, getDefaultState$1(this.options)); 7853 - this.state = config.state ?? __privateGet(this, _initialState); 7854 - this.scheduleGc(); 7855 - } 7856 - get meta() { 7857 - return this.options.meta; 7858 - } 7859 - get promise() { 7860 - var _a2; 7861 - return (_a2 = __privateGet(this, _retryer)) == null ? void 0 : _a2.promise; 7862 - } 7863 - setOptions(options) { 7864 - this.options = { ...__privateGet(this, _defaultOptions), ...options }; 7865 - this.updateGcTime(this.options.gcTime); 7866 - } 7867 - optionalRemove() { 7868 - if (!this.observers.length && this.state.fetchStatus === "idle") { 7869 - __privateGet(this, _cache).remove(this); 7870 - } 7871 - } 7872 - setData(newData, options) { 7873 - const data = replaceData(this.state.data, newData, this.options); 7874 - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { 7875 - data, 7876 - type: "success", 7877 - dataUpdatedAt: options == null ? void 0 : options.updatedAt, 7878 - manual: options == null ? void 0 : options.manual 7879 - }); 7880 - return data; 7881 - } 7882 - setState(state, setStateOptions) { 7883 - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "setState", state, setStateOptions }); 7884 - } 7885 - cancel(options) { 7886 - var _a2, _b2; 7887 - const promise = (_a2 = __privateGet(this, _retryer)) == null ? void 0 : _a2.promise; 7888 - (_b2 = __privateGet(this, _retryer)) == null ? void 0 : _b2.cancel(options); 7889 - return promise ? promise.then(noop).catch(noop) : Promise.resolve(); 7890 - } 7891 - destroy() { 7892 - super.destroy(); 7893 - this.cancel({ silent: true }); 7894 - } 7895 - reset() { 7896 - this.destroy(); 7897 - this.setState(__privateGet(this, _initialState)); 7898 - } 7899 - isActive() { 7900 - return this.observers.some( 7901 - (observer) => resolveEnabled(observer.options.enabled, this) !== false 7902 - ); 7903 - } 7904 - isDisabled() { 7905 - if (this.getObserversCount() > 0) { 7906 - return !this.isActive(); 7907 - } 7908 - return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; 7909 - } 7910 - isStale() { 7911 - if (this.state.isInvalidated) { 7912 - return true; 7913 - } 7914 - if (this.getObserversCount() > 0) { 7915 - return this.observers.some( 7916 - (observer) => observer.getCurrentResult().isStale 7917 - ); 7918 - } 7919 - return this.state.data === void 0; 7920 - } 7921 - isStaleByTime(staleTime = 0) { 7922 - return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime); 7923 - } 7924 - onFocus() { 7925 - var _a2; 7926 - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); 7927 - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); 7928 - (_a2 = __privateGet(this, _retryer)) == null ? void 0 : _a2.continue(); 7929 - } 7930 - onOnline() { 7931 - var _a2; 7932 - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); 7933 - observer == null ? void 0 : observer.refetch({ cancelRefetch: false }); 7934 - (_a2 = __privateGet(this, _retryer)) == null ? void 0 : _a2.continue(); 7935 - } 7936 - addObserver(observer) { 7937 - if (!this.observers.includes(observer)) { 7938 - this.observers.push(observer); 7939 - this.clearGcTimeout(); 7940 - __privateGet(this, _cache).notify({ type: "observerAdded", query: this, observer }); 7941 - } 7942 - } 7943 - removeObserver(observer) { 7944 - if (this.observers.includes(observer)) { 7945 - this.observers = this.observers.filter((x) => x !== observer); 7946 - if (!this.observers.length) { 7947 - if (__privateGet(this, _retryer)) { 7948 - if (__privateGet(this, _abortSignalConsumed)) { 7949 - __privateGet(this, _retryer).cancel({ revert: true }); 7950 - } else { 7951 - __privateGet(this, _retryer).cancelRetry(); 7952 - } 7953 - } 7954 - this.scheduleGc(); 7955 - } 7956 - __privateGet(this, _cache).notify({ type: "observerRemoved", query: this, observer }); 7957 - } 7958 - } 7959 - getObserversCount() { 7960 - return this.observers.length; 7961 - } 7962 - invalidate() { 7963 - if (!this.state.isInvalidated) { 7964 - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "invalidate" }); 7965 - } 7966 - } 7967 - fetch(options, fetchOptions) { 7968 - var _a2, _b2, _c2; 7969 - if (this.state.fetchStatus !== "idle") { 7970 - if (this.state.data !== void 0 && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) { 7971 - this.cancel({ silent: true }); 7972 - } else if (__privateGet(this, _retryer)) { 7973 - __privateGet(this, _retryer).continueRetry(); 7974 - return __privateGet(this, _retryer).promise; 7975 - } 7976 - } 7977 - if (options) { 7978 - this.setOptions(options); 7979 - } 7980 - if (!this.options.queryFn) { 7981 - const observer = this.observers.find((x) => x.options.queryFn); 7982 - if (observer) { 7983 - this.setOptions(observer.options); 7984 - } 7985 - } 7986 - const abortController = new AbortController(); 7987 - const addSignalProperty = (object) => { 7988 - Object.defineProperty(object, "signal", { 7989 - enumerable: true, 7990 - get: () => { 7991 - __privateSet(this, _abortSignalConsumed, true); 7992 - return abortController.signal; 7993 - } 7994 - }); 7995 - }; 7996 - const fetchFn = () => { 7997 - const queryFn = ensureQueryFn(this.options, fetchOptions); 7998 - const queryFnContext = { 7999 - client: __privateGet(this, _client), 8000 - queryKey: this.queryKey, 8001 - meta: this.meta 8002 - }; 8003 - addSignalProperty(queryFnContext); 8004 - __privateSet(this, _abortSignalConsumed, false); 8005 - if (this.options.persister) { 8006 - return this.options.persister( 8007 - queryFn, 8008 - queryFnContext, 8009 - this 8010 - ); 8011 - } 8012 - return queryFn(queryFnContext); 8013 - }; 8014 - const context = { 8015 - fetchOptions, 8016 - options: this.options, 8017 - queryKey: this.queryKey, 8018 - client: __privateGet(this, _client), 8019 - state: this.state, 8020 - fetchFn 8021 - }; 8022 - addSignalProperty(context); 8023 - (_a2 = this.options.behavior) == null ? void 0 : _a2.onFetch( 8024 - context, 8025 - this 8026 - ); 8027 - __privateSet(this, _revertState, this.state); 8028 - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_b2 = context.fetchOptions) == null ? void 0 : _b2.meta)) { 8029 - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "fetch", meta: (_c2 = context.fetchOptions) == null ? void 0 : _c2.meta }); 8030 - } 8031 - const onError = (error) => { 8032 - var _a3, _b3, _c3, _d2; 8033 - if (!(isCancelledError(error) && error.silent)) { 8034 - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { 8035 - type: "error", 8036 - error 8037 - }); 8038 - } 8039 - if (!isCancelledError(error)) { 8040 - (_b3 = (_a3 = __privateGet(this, _cache).config).onError) == null ? void 0 : _b3.call( 8041 - _a3, 8042 - error, 8043 - this 8044 - ); 8045 - (_d2 = (_c3 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d2.call( 8046 - _c3, 8047 - this.state.data, 8048 - error, 8049 - this 8050 - ); 8051 - } 8052 - this.scheduleGc(); 8053 - }; 8054 - __privateSet(this, _retryer, createRetryer({ 8055 - initialPromise: fetchOptions == null ? void 0 : fetchOptions.initialPromise, 8056 - fn: context.fetchFn, 8057 - abort: abortController.abort.bind(abortController), 8058 - onSuccess: (data) => { 8059 - var _a3, _b3, _c3, _d2; 8060 - if (data === void 0) { 8061 - onError(new Error(`${this.queryHash} data is undefined`)); 8062 - return; 8063 - } 8064 - try { 8065 - this.setData(data); 8066 - } catch (error) { 8067 - onError(error); 8068 - return; 8069 - } 8070 - (_b3 = (_a3 = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _b3.call(_a3, data, this); 8071 - (_d2 = (_c3 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d2.call( 8072 - _c3, 8073 - data, 8074 - this.state.error, 8075 - this 8076 - ); 8077 - this.scheduleGc(); 8078 - }, 8079 - onError, 8080 - onFail: (failureCount, error) => { 8081 - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "failed", failureCount, error }); 8082 - }, 8083 - onPause: () => { 8084 - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "pause" }); 8085 - }, 8086 - onContinue: () => { 8087 - __privateMethod(this, _Query_instances, dispatch_fn).call(this, { type: "continue" }); 8088 - }, 8089 - retry: context.options.retry, 8090 - retryDelay: context.options.retryDelay, 8091 - networkMode: context.options.networkMode, 8092 - canRun: () => true 8093 - })); 8094 - return __privateGet(this, _retryer).start(); 8095 - } 8096 - }, _initialState = new WeakMap(), _revertState = new WeakMap(), _cache = new WeakMap(), _client = new WeakMap(), _retryer = new WeakMap(), _defaultOptions = new WeakMap(), _abortSignalConsumed = new WeakMap(), _Query_instances = new WeakSet(), dispatch_fn = function(action) { 8097 - const reducer = (state) => { 8098 - switch (action.type) { 8099 - case "failed": 8100 - return { 8101 - ...state, 8102 - fetchFailureCount: action.failureCount, 8103 - fetchFailureReason: action.error 8104 - }; 8105 - case "pause": 8106 - return { 8107 - ...state, 8108 - fetchStatus: "paused" 8109 - }; 8110 - case "continue": 8111 - return { 8112 - ...state, 8113 - fetchStatus: "fetching" 8114 - }; 8115 - case "fetch": 8116 - return { 8117 - ...state, 8118 - ...fetchState(state.data, this.options), 8119 - fetchMeta: action.meta ?? null 8120 - }; 8121 - case "success": 8122 - return { 8123 - ...state, 8124 - data: action.data, 8125 - dataUpdateCount: state.dataUpdateCount + 1, 8126 - dataUpdatedAt: action.dataUpdatedAt ?? Date.now(), 8127 - error: null, 8128 - isInvalidated: false, 8129 - status: "success", 8130 - ...!action.manual && { 8131 - fetchStatus: "idle", 8132 - fetchFailureCount: 0, 8133 - fetchFailureReason: null 8134 - } 8135 - }; 8136 - case "error": 8137 - const error = action.error; 8138 - if (isCancelledError(error) && error.revert && __privateGet(this, _revertState)) { 8139 - return { ...__privateGet(this, _revertState), fetchStatus: "idle" }; 8140 - } 8141 - return { 8142 - ...state, 8143 - error, 8144 - errorUpdateCount: state.errorUpdateCount + 1, 8145 - errorUpdatedAt: Date.now(), 8146 - fetchFailureCount: state.fetchFailureCount + 1, 8147 - fetchFailureReason: error, 8148 - fetchStatus: "idle", 8149 - status: "error" 8150 - }; 8151 - case "invalidate": 8152 - return { 8153 - ...state, 8154 - isInvalidated: true 8155 - }; 8156 - case "setState": 8157 - return { 8158 - ...state, 8159 - ...action.state 8160 - }; 8161 - } 8162 - }; 8163 - this.state = reducer(this.state); 8164 - notifyManager.batch(() => { 8165 - this.observers.forEach((observer) => { 8166 - observer.onQueryUpdate(); 8167 - }); 8168 - __privateGet(this, _cache).notify({ query: this, type: "updated", action }); 8169 - }); 8170 - }, _d); 8171 - function fetchState(data, options) { 8172 - return { 8173 - fetchFailureCount: 0, 8174 - fetchFailureReason: null, 8175 - fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", 8176 - ...data === void 0 && { 8177 - error: null, 8178 - status: "pending" 8179 - } 8180 - }; 8181 - } 8182 - function getDefaultState$1(options) { 8183 - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; 8184 - const hasData = data !== void 0; 8185 - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; 8186 - return { 8187 - data, 8188 - dataUpdateCount: 0, 8189 - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, 8190 - error: null, 8191 - errorUpdateCount: 0, 8192 - errorUpdatedAt: 0, 8193 - fetchFailureCount: 0, 8194 - fetchFailureReason: null, 8195 - fetchMeta: null, 8196 - isInvalidated: false, 8197 - status: hasData ? "success" : "pending", 8198 - fetchStatus: "idle" 8199 - }; 8200 - } 8201 - var QueryCache = (_e = class extends Subscribable { 8202 - constructor(config = {}) { 8203 - super(); 8204 - __privateAdd(this, _queries); 8205 - this.config = config; 8206 - __privateSet(this, _queries, /* @__PURE__ */ new Map()); 8207 - } 8208 - build(client, options, state) { 8209 - const queryKey = options.queryKey; 8210 - const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); 8211 - let query = this.get(queryHash); 8212 - if (!query) { 8213 - query = new Query({ 8214 - client, 8215 - queryKey, 8216 - queryHash, 8217 - options: client.defaultQueryOptions(options), 8218 - state, 8219 - defaultOptions: client.getQueryDefaults(queryKey) 8220 - }); 8221 - this.add(query); 8222 - } 8223 - return query; 8224 - } 8225 - add(query) { 8226 - if (!__privateGet(this, _queries).has(query.queryHash)) { 8227 - __privateGet(this, _queries).set(query.queryHash, query); 8228 - this.notify({ 8229 - type: "added", 8230 - query 8231 - }); 8232 - } 8233 - } 8234 - remove(query) { 8235 - const queryInMap = __privateGet(this, _queries).get(query.queryHash); 8236 - if (queryInMap) { 8237 - query.destroy(); 8238 - if (queryInMap === query) { 8239 - __privateGet(this, _queries).delete(query.queryHash); 8240 - } 8241 - this.notify({ type: "removed", query }); 8242 - } 8243 - } 8244 - clear() { 8245 - notifyManager.batch(() => { 8246 - this.getAll().forEach((query) => { 8247 - this.remove(query); 8248 - }); 8249 - }); 8250 - } 8251 - get(queryHash) { 8252 - return __privateGet(this, _queries).get(queryHash); 8253 - } 8254 - getAll() { 8255 - return [...__privateGet(this, _queries).values()]; 8256 - } 8257 - find(filters) { 8258 - const defaultedFilters = { exact: true, ...filters }; 8259 - return this.getAll().find( 8260 - (query) => matchQuery(defaultedFilters, query) 8261 - ); 8262 - } 8263 - findAll(filters = {}) { 8264 - const queries = this.getAll(); 8265 - return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; 8266 - } 8267 - notify(event) { 8268 - notifyManager.batch(() => { 8269 - this.listeners.forEach((listener) => { 8270 - listener(event); 8271 - }); 8272 - }); 8273 - } 8274 - onFocus() { 8275 - notifyManager.batch(() => { 8276 - this.getAll().forEach((query) => { 8277 - query.onFocus(); 8278 - }); 8279 - }); 8280 - } 8281 - onOnline() { 8282 - notifyManager.batch(() => { 8283 - this.getAll().forEach((query) => { 8284 - query.onOnline(); 8285 - }); 8286 - }); 8287 - } 8288 - }, _queries = new WeakMap(), _e); 8289 - var Mutation = (_f = class extends Removable { 8290 - constructor(config) { 8291 - super(); 8292 - __privateAdd(this, _Mutation_instances); 8293 - __privateAdd(this, _observers); 8294 - __privateAdd(this, _mutationCache); 8295 - __privateAdd(this, _retryer2); 8296 - this.mutationId = config.mutationId; 8297 - __privateSet(this, _mutationCache, config.mutationCache); 8298 - __privateSet(this, _observers, []); 8299 - this.state = config.state || getDefaultState(); 8300 - this.setOptions(config.options); 8301 - this.scheduleGc(); 8302 - } 8303 - setOptions(options) { 8304 - this.options = options; 8305 - this.updateGcTime(this.options.gcTime); 8306 - } 8307 - get meta() { 8308 - return this.options.meta; 8309 - } 8310 - addObserver(observer) { 8311 - if (!__privateGet(this, _observers).includes(observer)) { 8312 - __privateGet(this, _observers).push(observer); 8313 - this.clearGcTimeout(); 8314 - __privateGet(this, _mutationCache).notify({ 8315 - type: "observerAdded", 8316 - mutation: this, 8317 - observer 8318 - }); 8319 - } 8320 - } 8321 - removeObserver(observer) { 8322 - __privateSet(this, _observers, __privateGet(this, _observers).filter((x) => x !== observer)); 8323 - this.scheduleGc(); 8324 - __privateGet(this, _mutationCache).notify({ 8325 - type: "observerRemoved", 8326 - mutation: this, 8327 - observer 8328 - }); 8329 - } 8330 - optionalRemove() { 8331 - if (!__privateGet(this, _observers).length) { 8332 - if (this.state.status === "pending") { 8333 - this.scheduleGc(); 8334 - } else { 8335 - __privateGet(this, _mutationCache).remove(this); 8336 - } 8337 - } 8338 - } 8339 - continue() { 8340 - var _a2; 8341 - return ((_a2 = __privateGet(this, _retryer2)) == null ? void 0 : _a2.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before 8342 - this.execute(this.state.variables); 8343 - } 8344 - async execute(variables) { 8345 - var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t; 8346 - const onContinue = () => { 8347 - __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "continue" }); 8348 - }; 8349 - __privateSet(this, _retryer2, createRetryer({ 8350 - fn: () => { 8351 - if (!this.options.mutationFn) { 8352 - return Promise.reject(new Error("No mutationFn found")); 8353 - } 8354 - return this.options.mutationFn(variables); 8355 - }, 8356 - onFail: (failureCount, error) => { 8357 - __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "failed", failureCount, error }); 8358 - }, 8359 - onPause: () => { 8360 - __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "pause" }); 8361 - }, 8362 - onContinue, 8363 - retry: this.options.retry ?? 0, 8364 - retryDelay: this.options.retryDelay, 8365 - networkMode: this.options.networkMode, 8366 - canRun: () => __privateGet(this, _mutationCache).canRun(this) 8367 - })); 8368 - const restored = this.state.status === "pending"; 8369 - const isPaused = !__privateGet(this, _retryer2).canStart(); 8370 - try { 8371 - if (restored) { 8372 - onContinue(); 8373 - } else { 8374 - __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "pending", variables, isPaused }); 8375 - await ((_b2 = (_a2 = __privateGet(this, _mutationCache).config).onMutate) == null ? void 0 : _b2.call( 8376 - _a2, 8377 - variables, 8378 - this 8379 - )); 8380 - const context = await ((_d2 = (_c2 = this.options).onMutate) == null ? void 0 : _d2.call(_c2, variables)); 8381 - if (context !== this.state.context) { 8382 - __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { 8383 - type: "pending", 8384 - context, 8385 - variables, 8386 - isPaused 8387 - }); 8388 - } 8389 - } 8390 - const data = await __privateGet(this, _retryer2).start(); 8391 - await ((_f2 = (_e2 = __privateGet(this, _mutationCache).config).onSuccess) == null ? void 0 : _f2.call( 8392 - _e2, 8393 - data, 8394 - variables, 8395 - this.state.context, 8396 - this 8397 - )); 8398 - await ((_h2 = (_g2 = this.options).onSuccess) == null ? void 0 : _h2.call(_g2, data, variables, this.state.context)); 8399 - await ((_j2 = (_i2 = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _j2.call( 8400 - _i2, 8401 - data, 8402 - null, 8403 - this.state.variables, 8404 - this.state.context, 8405 - this 8406 - )); 8407 - await ((_l = (_k = this.options).onSettled) == null ? void 0 : _l.call(_k, data, null, variables, this.state.context)); 8408 - __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "success", data }); 8409 - return data; 8410 - } catch (error) { 8411 - try { 8412 - await ((_n = (_m = __privateGet(this, _mutationCache).config).onError) == null ? void 0 : _n.call( 8413 - _m, 8414 - error, 8415 - variables, 8416 - this.state.context, 8417 - this 8418 - )); 8419 - await ((_p = (_o = this.options).onError) == null ? void 0 : _p.call( 8420 - _o, 8421 - error, 8422 - variables, 8423 - this.state.context 8424 - )); 8425 - await ((_r = (_q = __privateGet(this, _mutationCache).config).onSettled) == null ? void 0 : _r.call( 8426 - _q, 8427 - void 0, 8428 - error, 8429 - this.state.variables, 8430 - this.state.context, 8431 - this 8432 - )); 8433 - await ((_t = (_s = this.options).onSettled) == null ? void 0 : _t.call( 8434 - _s, 8435 - void 0, 8436 - error, 8437 - variables, 8438 - this.state.context 8439 - )); 8440 - throw error; 8441 - } finally { 8442 - __privateMethod(this, _Mutation_instances, dispatch_fn2).call(this, { type: "error", error }); 8443 - } 8444 - } finally { 8445 - __privateGet(this, _mutationCache).runNext(this); 8446 - } 8447 - } 8448 - }, _observers = new WeakMap(), _mutationCache = new WeakMap(), _retryer2 = new WeakMap(), _Mutation_instances = new WeakSet(), dispatch_fn2 = function(action) { 8449 - const reducer = (state) => { 8450 - switch (action.type) { 8451 - case "failed": 8452 - return { 8453 - ...state, 8454 - failureCount: action.failureCount, 8455 - failureReason: action.error 8456 - }; 8457 - case "pause": 8458 - return { 8459 - ...state, 8460 - isPaused: true 8461 - }; 8462 - case "continue": 8463 - return { 8464 - ...state, 8465 - isPaused: false 8466 - }; 8467 - case "pending": 8468 - return { 8469 - ...state, 8470 - context: action.context, 8471 - data: void 0, 8472 - failureCount: 0, 8473 - failureReason: null, 8474 - error: null, 8475 - isPaused: action.isPaused, 8476 - status: "pending", 8477 - variables: action.variables, 8478 - submittedAt: Date.now() 8479 - }; 8480 - case "success": 8481 - return { 8482 - ...state, 8483 - data: action.data, 8484 - failureCount: 0, 8485 - failureReason: null, 8486 - error: null, 8487 - status: "success", 8488 - isPaused: false 8489 - }; 8490 - case "error": 8491 - return { 8492 - ...state, 8493 - data: void 0, 8494 - error: action.error, 8495 - failureCount: state.failureCount + 1, 8496 - failureReason: action.error, 8497 - isPaused: false, 8498 - status: "error" 8499 - }; 8500 - } 8501 - }; 8502 - this.state = reducer(this.state); 8503 - notifyManager.batch(() => { 8504 - __privateGet(this, _observers).forEach((observer) => { 8505 - observer.onMutationUpdate(action); 8506 - }); 8507 - __privateGet(this, _mutationCache).notify({ 8508 - mutation: this, 8509 - type: "updated", 8510 - action 8511 - }); 8512 - }); 8513 - }, _f); 8514 - function getDefaultState() { 8515 - return { 8516 - context: void 0, 8517 - data: void 0, 8518 - error: null, 8519 - failureCount: 0, 8520 - failureReason: null, 8521 - isPaused: false, 8522 - status: "idle", 8523 - variables: void 0, 8524 - submittedAt: 0 8525 - }; 8526 - } 8527 - var MutationCache = (_g = class extends Subscribable { 8528 - constructor(config = {}) { 8529 - super(); 8530 - __privateAdd(this, _mutations); 8531 - __privateAdd(this, _scopes); 8532 - __privateAdd(this, _mutationId); 8533 - this.config = config; 8534 - __privateSet(this, _mutations, /* @__PURE__ */ new Set()); 8535 - __privateSet(this, _scopes, /* @__PURE__ */ new Map()); 8536 - __privateSet(this, _mutationId, 0); 8537 - } 8538 - build(client, options, state) { 8539 - const mutation = new Mutation({ 8540 - mutationCache: this, 8541 - mutationId: ++__privateWrapper(this, _mutationId)._, 8542 - options: client.defaultMutationOptions(options), 8543 - state 8544 - }); 8545 - this.add(mutation); 8546 - return mutation; 8547 - } 8548 - add(mutation) { 8549 - __privateGet(this, _mutations).add(mutation); 8550 - const scope = scopeFor(mutation); 8551 - if (typeof scope === "string") { 8552 - const scopedMutations = __privateGet(this, _scopes).get(scope); 8553 - if (scopedMutations) { 8554 - scopedMutations.push(mutation); 8555 - } else { 8556 - __privateGet(this, _scopes).set(scope, [mutation]); 8557 - } 8558 - } 8559 - this.notify({ type: "added", mutation }); 8560 - } 8561 - remove(mutation) { 8562 - if (__privateGet(this, _mutations).delete(mutation)) { 8563 - const scope = scopeFor(mutation); 8564 - if (typeof scope === "string") { 8565 - const scopedMutations = __privateGet(this, _scopes).get(scope); 8566 - if (scopedMutations) { 8567 - if (scopedMutations.length > 1) { 8568 - const index2 = scopedMutations.indexOf(mutation); 8569 - if (index2 !== -1) { 8570 - scopedMutations.splice(index2, 1); 8571 - } 8572 - } else if (scopedMutations[0] === mutation) { 8573 - __privateGet(this, _scopes).delete(scope); 8574 - } 8575 - } 8576 - } 8577 - } 8578 - this.notify({ type: "removed", mutation }); 8579 - } 8580 - canRun(mutation) { 8581 - const scope = scopeFor(mutation); 8582 - if (typeof scope === "string") { 8583 - const mutationsWithSameScope = __privateGet(this, _scopes).get(scope); 8584 - const firstPendingMutation = mutationsWithSameScope == null ? void 0 : mutationsWithSameScope.find( 8585 - (m) => m.state.status === "pending" 8586 - ); 8587 - return !firstPendingMutation || firstPendingMutation === mutation; 8588 - } else { 8589 - return true; 8590 - } 8591 - } 8592 - runNext(mutation) { 8593 - var _a2; 8594 - const scope = scopeFor(mutation); 8595 - if (typeof scope === "string") { 8596 - const foundMutation = (_a2 = __privateGet(this, _scopes).get(scope)) == null ? void 0 : _a2.find((m) => m !== mutation && m.state.isPaused); 8597 - return (foundMutation == null ? void 0 : foundMutation.continue()) ?? Promise.resolve(); 8598 - } else { 8599 - return Promise.resolve(); 8600 - } 8601 - } 8602 - clear() { 8603 - notifyManager.batch(() => { 8604 - __privateGet(this, _mutations).forEach((mutation) => { 8605 - this.notify({ type: "removed", mutation }); 8606 - }); 8607 - __privateGet(this, _mutations).clear(); 8608 - __privateGet(this, _scopes).clear(); 8609 - }); 8610 - } 8611 - getAll() { 8612 - return Array.from(__privateGet(this, _mutations)); 8613 - } 8614 - find(filters) { 8615 - const defaultedFilters = { exact: true, ...filters }; 8616 - return this.getAll().find( 8617 - (mutation) => matchMutation(defaultedFilters, mutation) 8618 - ); 8619 - } 8620 - findAll(filters = {}) { 8621 - return this.getAll().filter((mutation) => matchMutation(filters, mutation)); 8622 - } 8623 - notify(event) { 8624 - notifyManager.batch(() => { 8625 - this.listeners.forEach((listener) => { 8626 - listener(event); 8627 - }); 8628 - }); 8629 - } 8630 - resumePausedMutations() { 8631 - const pausedMutations = this.getAll().filter((x) => x.state.isPaused); 8632 - return notifyManager.batch( 8633 - () => Promise.all( 8634 - pausedMutations.map((mutation) => mutation.continue().catch(noop)) 8635 - ) 8636 - ); 8637 - } 8638 - }, _mutations = new WeakMap(), _scopes = new WeakMap(), _mutationId = new WeakMap(), _g); 8639 - function scopeFor(mutation) { 8640 - var _a2; 8641 - return (_a2 = mutation.options.scope) == null ? void 0 : _a2.id; 8642 - } 8643 - function infiniteQueryBehavior(pages) { 8644 - return { 8645 - onFetch: (context, query) => { 8646 - var _a2, _b2, _c2, _d2, _e2; 8647 - const options = context.options; 8648 - const direction = (_c2 = (_b2 = (_a2 = context.fetchOptions) == null ? void 0 : _a2.meta) == null ? void 0 : _b2.fetchMore) == null ? void 0 : _c2.direction; 8649 - const oldPages = ((_d2 = context.state.data) == null ? void 0 : _d2.pages) || []; 8650 - const oldPageParams = ((_e2 = context.state.data) == null ? void 0 : _e2.pageParams) || []; 8651 - let result = { pages: [], pageParams: [] }; 8652 - let currentPage = 0; 8653 - const fetchFn = async () => { 8654 - let cancelled = false; 8655 - const addSignalProperty = (object) => { 8656 - Object.defineProperty(object, "signal", { 8657 - enumerable: true, 8658 - get: () => { 8659 - if (context.signal.aborted) { 8660 - cancelled = true; 8661 - } else { 8662 - context.signal.addEventListener("abort", () => { 8663 - cancelled = true; 8664 - }); 8665 - } 8666 - return context.signal; 8667 - } 8668 - }); 8669 - }; 8670 - const queryFn = ensureQueryFn(context.options, context.fetchOptions); 8671 - const fetchPage = async (data, param, previous) => { 8672 - if (cancelled) { 8673 - return Promise.reject(); 8674 - } 8675 - if (param == null && data.pages.length) { 8676 - return Promise.resolve(data); 8677 - } 8678 - const queryFnContext = { 8679 - client: context.client, 8680 - queryKey: context.queryKey, 8681 - pageParam: param, 8682 - direction: previous ? "backward" : "forward", 8683 - meta: context.options.meta 8684 - }; 8685 - addSignalProperty(queryFnContext); 8686 - const page = await queryFn( 8687 - queryFnContext 8688 - ); 8689 - const { maxPages } = context.options; 8690 - const addTo = previous ? addToStart : addToEnd; 8691 - return { 8692 - pages: addTo(data.pages, page, maxPages), 8693 - pageParams: addTo(data.pageParams, param, maxPages) 8694 - }; 8695 - }; 8696 - if (direction && oldPages.length) { 8697 - const previous = direction === "backward"; 8698 - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; 8699 - const oldData = { 8700 - pages: oldPages, 8701 - pageParams: oldPageParams 8702 - }; 8703 - const param = pageParamFn(options, oldData); 8704 - result = await fetchPage(oldData, param, previous); 8705 - } else { 8706 - const remainingPages = pages ?? oldPages.length; 8707 - do { 8708 - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); 8709 - if (currentPage > 0 && param == null) { 8710 - break; 8711 - } 8712 - result = await fetchPage(result, param); 8713 - currentPage++; 8714 - } while (currentPage < remainingPages); 8715 - } 8716 - return result; 8717 - }; 8718 - if (context.options.persister) { 8719 - context.fetchFn = () => { 8720 - var _a3, _b3; 8721 - return (_b3 = (_a3 = context.options).persister) == null ? void 0 : _b3.call( 8722 - _a3, 8723 - fetchFn, 8724 - { 8725 - client: context.client, 8726 - queryKey: context.queryKey, 8727 - meta: context.options.meta, 8728 - signal: context.signal 8729 - }, 8730 - query 8731 - ); 8732 - }; 8733 - } else { 8734 - context.fetchFn = fetchFn; 8735 - } 8736 - } 8737 - }; 8738 - } 8739 - function getNextPageParam(options, { pages, pageParams }) { 8740 - const lastIndex = pages.length - 1; 8741 - return pages.length > 0 ? options.getNextPageParam( 8742 - pages[lastIndex], 8743 - pages, 8744 - pageParams[lastIndex], 8745 - pageParams 8746 - ) : void 0; 8747 - } 8748 - function getPreviousPageParam(options, { pages, pageParams }) { 8749 - var _a2; 8750 - return pages.length > 0 ? (_a2 = options.getPreviousPageParam) == null ? void 0 : _a2.call(options, pages[0], pages, pageParams[0], pageParams) : void 0; 8751 - } 8752 - var QueryClient = (_h = class { 8753 - constructor(config = {}) { 8754 - __privateAdd(this, _queryCache); 8755 - __privateAdd(this, _mutationCache2); 8756 - __privateAdd(this, _defaultOptions2); 8757 - __privateAdd(this, _queryDefaults); 8758 - __privateAdd(this, _mutationDefaults); 8759 - __privateAdd(this, _mountCount); 8760 - __privateAdd(this, _unsubscribeFocus); 8761 - __privateAdd(this, _unsubscribeOnline); 8762 - __privateSet(this, _queryCache, config.queryCache || new QueryCache()); 8763 - __privateSet(this, _mutationCache2, config.mutationCache || new MutationCache()); 8764 - __privateSet(this, _defaultOptions2, config.defaultOptions || {}); 8765 - __privateSet(this, _queryDefaults, /* @__PURE__ */ new Map()); 8766 - __privateSet(this, _mutationDefaults, /* @__PURE__ */ new Map()); 8767 - __privateSet(this, _mountCount, 0); 8768 - } 8769 - mount() { 8770 - __privateWrapper(this, _mountCount)._++; 8771 - if (__privateGet(this, _mountCount) !== 1) return; 8772 - __privateSet(this, _unsubscribeFocus, focusManager.subscribe(async (focused) => { 8773 - if (focused) { 8774 - await this.resumePausedMutations(); 8775 - __privateGet(this, _queryCache).onFocus(); 8776 - } 8777 - })); 8778 - __privateSet(this, _unsubscribeOnline, onlineManager.subscribe(async (online) => { 8779 - if (online) { 8780 - await this.resumePausedMutations(); 8781 - __privateGet(this, _queryCache).onOnline(); 8782 - } 8783 - })); 8784 - } 8785 - unmount() { 8786 - var _a2, _b2; 8787 - __privateWrapper(this, _mountCount)._--; 8788 - if (__privateGet(this, _mountCount) !== 0) return; 8789 - (_a2 = __privateGet(this, _unsubscribeFocus)) == null ? void 0 : _a2.call(this); 8790 - __privateSet(this, _unsubscribeFocus, void 0); 8791 - (_b2 = __privateGet(this, _unsubscribeOnline)) == null ? void 0 : _b2.call(this); 8792 - __privateSet(this, _unsubscribeOnline, void 0); 8793 - } 8794 - isFetching(filters) { 8795 - return __privateGet(this, _queryCache).findAll({ ...filters, fetchStatus: "fetching" }).length; 8796 - } 8797 - isMutating(filters) { 8798 - return __privateGet(this, _mutationCache2).findAll({ ...filters, status: "pending" }).length; 8799 - } 8800 - /** 8801 - * Imperative (non-reactive) way to retrieve data for a QueryKey. 8802 - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. 8803 - * 8804 - * Hint: Do not use this function inside a component, because it won't receive updates. 8805 - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. 8806 - */ 8807 - getQueryData(queryKey) { 8808 - var _a2; 8809 - const options = this.defaultQueryOptions({ queryKey }); 8810 - return (_a2 = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a2.state.data; 8811 - } 8812 - ensureQueryData(options) { 8813 - const defaultedOptions = this.defaultQueryOptions(options); 8814 - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); 8815 - const cachedData = query.state.data; 8816 - if (cachedData === void 0) { 8817 - return this.fetchQuery(options); 8818 - } 8819 - if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { 8820 - void this.prefetchQuery(defaultedOptions); 8821 - } 8822 - return Promise.resolve(cachedData); 8823 - } 8824 - getQueriesData(filters) { 8825 - return __privateGet(this, _queryCache).findAll(filters).map(({ queryKey, state }) => { 8826 - const data = state.data; 8827 - return [queryKey, data]; 8828 - }); 8829 - } 8830 - setQueryData(queryKey, updater, options) { 8831 - const defaultedOptions = this.defaultQueryOptions({ queryKey }); 8832 - const query = __privateGet(this, _queryCache).get( 8833 - defaultedOptions.queryHash 8834 - ); 8835 - const prevData = query == null ? void 0 : query.state.data; 8836 - const data = functionalUpdate(updater, prevData); 8837 - if (data === void 0) { 8838 - return void 0; 8839 - } 8840 - return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true }); 8841 - } 8842 - setQueriesData(filters, updater, options) { 8843 - return notifyManager.batch( 8844 - () => __privateGet(this, _queryCache).findAll(filters).map(({ queryKey }) => [ 8845 - queryKey, 8846 - this.setQueryData(queryKey, updater, options) 8847 - ]) 8848 - ); 8849 - } 8850 - getQueryState(queryKey) { 8851 - var _a2; 8852 - const options = this.defaultQueryOptions({ queryKey }); 8853 - return (_a2 = __privateGet(this, _queryCache).get( 8854 - options.queryHash 8855 - )) == null ? void 0 : _a2.state; 8856 - } 8857 - removeQueries(filters) { 8858 - const queryCache = __privateGet(this, _queryCache); 8859 - notifyManager.batch(() => { 8860 - queryCache.findAll(filters).forEach((query) => { 8861 - queryCache.remove(query); 8862 - }); 8863 - }); 8864 - } 8865 - resetQueries(filters, options) { 8866 - const queryCache = __privateGet(this, _queryCache); 8867 - return notifyManager.batch(() => { 8868 - queryCache.findAll(filters).forEach((query) => { 8869 - query.reset(); 8870 - }); 8871 - return this.refetchQueries( 8872 - { 8873 - type: "active", 8874 - ...filters 8875 - }, 8876 - options 8877 - ); 8878 - }); 8879 - } 8880 - cancelQueries(filters, cancelOptions = {}) { 8881 - const defaultedCancelOptions = { revert: true, ...cancelOptions }; 8882 - const promises = notifyManager.batch( 8883 - () => __privateGet(this, _queryCache).findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) 8884 - ); 8885 - return Promise.all(promises).then(noop).catch(noop); 8886 - } 8887 - invalidateQueries(filters, options = {}) { 8888 - return notifyManager.batch(() => { 8889 - __privateGet(this, _queryCache).findAll(filters).forEach((query) => { 8890 - query.invalidate(); 8891 - }); 8892 - if ((filters == null ? void 0 : filters.refetchType) === "none") { 8893 - return Promise.resolve(); 8894 - } 8895 - return this.refetchQueries( 8896 - { 8897 - ...filters, 8898 - type: (filters == null ? void 0 : filters.refetchType) ?? (filters == null ? void 0 : filters.type) ?? "active" 8899 - }, 8900 - options 8901 - ); 8902 - }); 8903 - } 8904 - refetchQueries(filters, options = {}) { 8905 - const fetchOptions = { 8906 - ...options, 8907 - cancelRefetch: options.cancelRefetch ?? true 8908 - }; 8909 - const promises = notifyManager.batch( 8910 - () => __privateGet(this, _queryCache).findAll(filters).filter((query) => !query.isDisabled()).map((query) => { 8911 - let promise = query.fetch(void 0, fetchOptions); 8912 - if (!fetchOptions.throwOnError) { 8913 - promise = promise.catch(noop); 8914 - } 8915 - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; 8916 - }) 8917 - ); 8918 - return Promise.all(promises).then(noop); 8919 - } 8920 - fetchQuery(options) { 8921 - const defaultedOptions = this.defaultQueryOptions(options); 8922 - if (defaultedOptions.retry === void 0) { 8923 - defaultedOptions.retry = false; 8924 - } 8925 - const query = __privateGet(this, _queryCache).build(this, defaultedOptions); 8926 - return query.isStaleByTime( 8927 - resolveStaleTime(defaultedOptions.staleTime, query) 8928 - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); 8929 - } 8930 - prefetchQuery(options) { 8931 - return this.fetchQuery(options).then(noop).catch(noop); 8932 - } 8933 - fetchInfiniteQuery(options) { 8934 - options.behavior = infiniteQueryBehavior(options.pages); 8935 - return this.fetchQuery(options); 8936 - } 8937 - prefetchInfiniteQuery(options) { 8938 - return this.fetchInfiniteQuery(options).then(noop).catch(noop); 8939 - } 8940 - ensureInfiniteQueryData(options) { 8941 - options.behavior = infiniteQueryBehavior(options.pages); 8942 - return this.ensureQueryData(options); 8943 - } 8944 - resumePausedMutations() { 8945 - if (onlineManager.isOnline()) { 8946 - return __privateGet(this, _mutationCache2).resumePausedMutations(); 8947 - } 8948 - return Promise.resolve(); 8949 - } 8950 - getQueryCache() { 8951 - return __privateGet(this, _queryCache); 8952 - } 8953 - getMutationCache() { 8954 - return __privateGet(this, _mutationCache2); 8955 - } 8956 - getDefaultOptions() { 8957 - return __privateGet(this, _defaultOptions2); 8958 - } 8959 - setDefaultOptions(options) { 8960 - __privateSet(this, _defaultOptions2, options); 8961 - } 8962 - setQueryDefaults(queryKey, options) { 8963 - __privateGet(this, _queryDefaults).set(hashKey(queryKey), { 8964 - queryKey, 8965 - defaultOptions: options 8966 - }); 8967 - } 8968 - getQueryDefaults(queryKey) { 8969 - const defaults = [...__privateGet(this, _queryDefaults).values()]; 8970 - const result = {}; 8971 - defaults.forEach((queryDefault) => { 8972 - if (partialMatchKey(queryKey, queryDefault.queryKey)) { 8973 - Object.assign(result, queryDefault.defaultOptions); 8974 - } 8975 - }); 8976 - return result; 8977 - } 8978 - setMutationDefaults(mutationKey, options) { 8979 - __privateGet(this, _mutationDefaults).set(hashKey(mutationKey), { 8980 - mutationKey, 8981 - defaultOptions: options 8982 - }); 8983 - } 8984 - getMutationDefaults(mutationKey) { 8985 - const defaults = [...__privateGet(this, _mutationDefaults).values()]; 8986 - const result = {}; 8987 - defaults.forEach((queryDefault) => { 8988 - if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { 8989 - Object.assign(result, queryDefault.defaultOptions); 8990 - } 8991 - }); 8992 - return result; 8993 - } 8994 - defaultQueryOptions(options) { 8995 - if (options._defaulted) { 8996 - return options; 8997 - } 8998 - const defaultedOptions = { 8999 - ...__privateGet(this, _defaultOptions2).queries, 9000 - ...this.getQueryDefaults(options.queryKey), 9001 - ...options, 9002 - _defaulted: true 9003 - }; 9004 - if (!defaultedOptions.queryHash) { 9005 - defaultedOptions.queryHash = hashQueryKeyByOptions( 9006 - defaultedOptions.queryKey, 9007 - defaultedOptions 9008 - ); 9009 - } 9010 - if (defaultedOptions.refetchOnReconnect === void 0) { 9011 - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; 9012 - } 9013 - if (defaultedOptions.throwOnError === void 0) { 9014 - defaultedOptions.throwOnError = !!defaultedOptions.suspense; 9015 - } 9016 - if (!defaultedOptions.networkMode && defaultedOptions.persister) { 9017 - defaultedOptions.networkMode = "offlineFirst"; 9018 - } 9019 - if (defaultedOptions.queryFn === skipToken) { 9020 - defaultedOptions.enabled = false; 9021 - } 9022 - return defaultedOptions; 9023 - } 9024 - defaultMutationOptions(options) { 9025 - if (options == null ? void 0 : options._defaulted) { 9026 - return options; 9027 - } 9028 - return { 9029 - ...__privateGet(this, _defaultOptions2).mutations, 9030 - ...(options == null ? void 0 : options.mutationKey) && this.getMutationDefaults(options.mutationKey), 9031 - ...options, 9032 - _defaulted: true 9033 - }; 9034 - } 9035 - clear() { 9036 - __privateGet(this, _queryCache).clear(); 9037 - __privateGet(this, _mutationCache2).clear(); 9038 - } 9039 - }, _queryCache = new WeakMap(), _mutationCache2 = new WeakMap(), _defaultOptions2 = new WeakMap(), _queryDefaults = new WeakMap(), _mutationDefaults = new WeakMap(), _mountCount = new WeakMap(), _unsubscribeFocus = new WeakMap(), _unsubscribeOnline = new WeakMap(), _h); 9040 - function defaultTransformerFn(data) { 9041 - return data; 9042 - } 9043 - function dehydrateMutation(mutation) { 9044 - return { 9045 - mutationKey: mutation.options.mutationKey, 9046 - state: mutation.state, 9047 - ...mutation.options.scope && { scope: mutation.options.scope }, 9048 - ...mutation.meta && { meta: mutation.meta } 9049 - }; 9050 - } 9051 - function dehydrateQuery(query, serializeData, shouldRedactErrors) { 9052 - var _a2; 9053 - return { 9054 - dehydratedAt: Date.now(), 9055 - state: { 9056 - ...query.state, 9057 - ...query.state.data !== void 0 && { 9058 - data: serializeData(query.state.data) 9059 - } 9060 - }, 9061 - queryKey: query.queryKey, 9062 - queryHash: query.queryHash, 9063 - ...query.state.status === "pending" && { 9064 - promise: (_a2 = query.promise) == null ? void 0 : _a2.then(serializeData).catch((error) => { 9065 - if (!shouldRedactErrors(error)) { 9066 - return Promise.reject(error); 9067 - } 9068 - return Promise.reject(new Error("redacted")); 9069 - }) 9070 - }, 9071 - ...query.meta && { meta: query.meta } 9072 - }; 9073 - } 9074 - function defaultShouldDehydrateMutation(mutation) { 9075 - return mutation.state.isPaused; 9076 - } 9077 - function defaultShouldDehydrateQuery(query) { 9078 - return query.state.status === "success"; 9079 - } 9080 - function defaultShouldRedactErrors(_) { 9081 - return true; 9082 - } 9083 - function dehydrate(client, options = {}) { 9084 - var _a2, _b2, _c2, _d2; 9085 - const filterMutation = options.shouldDehydrateMutation ?? ((_a2 = client.getDefaultOptions().dehydrate) == null ? void 0 : _a2.shouldDehydrateMutation) ?? defaultShouldDehydrateMutation; 9086 - const mutations = client.getMutationCache().getAll().flatMap( 9087 - (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] 9088 - ); 9089 - const filterQuery = options.shouldDehydrateQuery ?? ((_b2 = client.getDefaultOptions().dehydrate) == null ? void 0 : _b2.shouldDehydrateQuery) ?? defaultShouldDehydrateQuery; 9090 - const shouldRedactErrors = options.shouldRedactErrors ?? ((_c2 = client.getDefaultOptions().dehydrate) == null ? void 0 : _c2.shouldRedactErrors) ?? defaultShouldRedactErrors; 9091 - const serializeData = options.serializeData ?? ((_d2 = client.getDefaultOptions().dehydrate) == null ? void 0 : _d2.serializeData) ?? defaultTransformerFn; 9092 - const queries = client.getQueryCache().getAll().flatMap( 9093 - (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [] 9094 - ); 9095 - return { mutations, queries }; 9096 - } 9097 - function hydrate(client, dehydratedState, options) { 9098 - var _a2; 9099 - if (typeof dehydratedState !== "object" || dehydratedState === null) { 9100 - return; 9101 - } 9102 - const mutationCache = client.getMutationCache(); 9103 - const queryCache = client.getQueryCache(); 9104 - const deserializeData = ((_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.deserializeData) ?? defaultTransformerFn; 9105 - const mutations = dehydratedState.mutations || []; 9106 - const queries = dehydratedState.queries || []; 9107 - mutations.forEach(({ state, ...mutationOptions }) => { 9108 - var _a3, _b2; 9109 - mutationCache.build( 9110 - client, 9111 - { 9112 - ...(_a3 = client.getDefaultOptions().hydrate) == null ? void 0 : _a3.mutations, 9113 - ...(_b2 = void 0 ) == null ? void 0 : _b2.mutations, 9114 - ...mutationOptions 9115 - }, 9116 - state 9117 - ); 9118 - }); 9119 - queries.forEach( 9120 - ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { 9121 - var _a3, _b2; 9122 - const syncData = promise ? tryResolveSync(promise) : void 0; 9123 - const rawData = state.data === void 0 ? syncData == null ? void 0 : syncData.data : state.data; 9124 - const data = rawData === void 0 ? rawData : deserializeData(rawData); 9125 - let query = queryCache.get(queryHash); 9126 - const existingQueryIsPending = (query == null ? void 0 : query.state.status) === "pending"; 9127 - if (query) { 9128 - const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration 9129 - // payloads that might not have dehydratedAt 9130 - dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt; 9131 - if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) { 9132 - const { fetchStatus: _ignored, ...serializedState } = state; 9133 - query.setState({ 9134 - ...serializedState, 9135 - data 9136 - }); 9137 - } 9138 - } else { 9139 - query = queryCache.build( 9140 - client, 9141 - { 9142 - ...(_a3 = client.getDefaultOptions().hydrate) == null ? void 0 : _a3.queries, 9143 - ...(_b2 = void 0 ) == null ? void 0 : _b2.queries, 9144 - queryKey, 9145 - queryHash, 9146 - meta 9147 - }, 9148 - // Reset fetch status to idle to avoid 9149 - // query being stuck in fetching state upon hydration 9150 - { 9151 - ...state, 9152 - data, 9153 - fetchStatus: "idle", 9154 - status: data !== void 0 ? "success" : state.status 9155 - } 9156 - ); 9157 - } 9158 - if (promise && !existingQueryIsPending && // Only hydrate if dehydration is newer than any existing data, 9159 - // this is always true for new queries 9160 - (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { 9161 - void query.fetch(void 0, { 9162 - // RSC transformed promises are not thenable 9163 - initialPromise: Promise.resolve(promise).then(deserializeData) 9164 - }); 9165 - } 9166 - } 9167 - ); 9168 - } 9169 - var QueryClientContext = React.createContext( 9170 - void 0 9171 - ); 9172 - var useQueryClient = (queryClient) => { 9173 - const client = React.useContext(QueryClientContext); 9174 - if (queryClient) { 9175 - return queryClient; 9176 - } 9177 - if (!client) { 9178 - throw new Error("No QueryClient set, use QueryClientProvider to set one"); 9179 - } 9180 - return client; 9181 - }; 9182 - var QueryClientProvider = ({ 9183 - client, 9184 - children: children2 9185 - }) => { 9186 - React.useEffect(() => { 9187 - client.mount(); 9188 - return () => { 9189 - client.unmount(); 9190 - }; 9191 - }, [client]); 9192 - return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children: children2 }); 9193 - }; 9194 - function queryOptions(options) { 9195 - return options; 9196 - } 9197 - function routerWithQueryClient(router, queryClient, additionalOpts) { 9198 - const seenQueryKeys = /* @__PURE__ */ new Set(); 9199 - const streamedQueryKeys = /* @__PURE__ */ new Set(); 9200 - const ogClientOptions = queryClient.getDefaultOptions(); 9201 - queryClient.setDefaultOptions({ 9202 - ...ogClientOptions, 9203 - queries: { 9204 - ...ogClientOptions.queries, 9205 - _experimental_beforeQuery: (options) => { 9206 - var _a2, _b2; 9207 - (_b2 = (_a2 = ogClientOptions.queries) == null ? void 0 : _a2._experimental_beforeQuery) == null ? void 0 : _b2.call(_a2, options); 9208 - const hash = options.queryKeyHashFn || hashKey; 9209 - if (router.isServer) { 9210 - if (seenQueryKeys.has(hash(options.queryKey))) { 9211 - return; 9212 - } 9213 - seenQueryKeys.add(hash(options.queryKey)); 9214 - if (queryClient.getQueryData(options.queryKey) !== void 0) { 9215 - options.__skipInjection = true; 9216 - return; 9217 - } 9218 - } else { 9219 - const dehydratedClient = router.clientSsr.getStreamedValue( 9220 - "__QueryClient__" + hash(options.queryKey) 9221 - ); 9222 - if (dehydratedClient && !dehydratedClient.hydrated) { 9223 - dehydratedClient.hydrated = true; 9224 - hydrate(queryClient, dehydratedClient); 9225 - } 9226 - } 9227 - }, 9228 - _experimental_afterQuery: (options, _result) => { 9229 - var _a2, _b2; 9230 - const hash = options.queryKeyHashFn || hashKey; 9231 - if (router.isServer && !options.__skipInjection && queryClient.getQueryData(options.queryKey) !== void 0 && !streamedQueryKeys.has(hash(options.queryKey))) { 9232 - streamedQueryKeys.add(hash(options.queryKey)); 9233 - router.serverSsr.streamValue( 9234 - "__QueryClient__" + hash(options.queryKey), 9235 - dehydrate(queryClient, { 9236 - shouldDehydrateMutation: () => false, 9237 - shouldDehydrateQuery: (query) => hash(query.queryKey) === hash(options.queryKey) 9238 - }) 9239 - ); 9240 - } 9241 - (_b2 = (_a2 = ogClientOptions.queries) == null ? void 0 : _a2._experimental_afterQuery) == null ? void 0 : _b2.call( 9242 - _a2, 9243 - options, 9244 - _result 9245 - ); 9246 - } 9247 - } 9248 - }); 9249 - { 9250 - const ogMutationCacheConfig = queryClient.getMutationCache().config; 9251 - queryClient.getMutationCache().config = { 9252 - ...ogMutationCacheConfig, 9253 - onError: (error, _variables, _context, _mutation) => { 9254 - var _a2; 9255 - if (isRedirect(error)) { 9256 - error.options._fromLocation = router.state.location; 9257 - return router.navigate(router.resolveRedirect(error).options); 9258 - } 9259 - return (_a2 = ogMutationCacheConfig.onError) == null ? void 0 : _a2.call( 9260 - ogMutationCacheConfig, 9261 - error, 9262 - _variables, 9263 - _context, 9264 - _mutation 9265 - ); 9266 - } 9267 - }; 9268 - const ogQueryCacheConfig = queryClient.getQueryCache().config; 9269 - queryClient.getQueryCache().config = { 9270 - ...ogQueryCacheConfig, 9271 - onError: (error, _query) => { 9272 - var _a2; 9273 - if (isRedirect(error)) { 9274 - error.options._fromLocation = router.state.location; 9275 - return router.navigate(router.resolveRedirect(error).options); 9276 - } 9277 - return (_a2 = ogQueryCacheConfig.onError) == null ? void 0 : _a2.call(ogQueryCacheConfig, error, _query); 9278 - } 9279 - }; 9280 - } 9281 - const ogOptions = router.options; 9282 - router.options = { 9283 - ...router.options, 9284 - dehydrate: () => { 9285 - var _a2; 9286 - return { 9287 - ...(_a2 = ogOptions.dehydrate) == null ? void 0 : _a2.call(ogOptions), 9288 - // When critical data is dehydrated, we also dehydrate the query client 9289 - dehydratedQueryClient: dehydrate(queryClient) 9290 - }; 9291 - }, 9292 - hydrate: (dehydrated) => { 9293 - var _a2; 9294 - (_a2 = ogOptions.hydrate) == null ? void 0 : _a2.call(ogOptions, dehydrated); 9295 - hydrate(queryClient, dehydrated.dehydratedQueryClient); 9296 - }, 9297 - context: { 9298 - ...ogOptions.context, 9299 - // Pass the query client to the context, so we can access it in loaders 9300 - queryClient 9301 - }, 9302 - // Wrap the app in a QueryClientProvider 9303 - Wrap: ({ children: children2 }) => { 9304 - const OuterWrapper = Fragment$1; 9305 - const OGWrap = ogOptions.Wrap || Fragment$1; 9306 - return /* @__PURE__ */ jsx(OuterWrapper, { children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(OGWrap, { children: children2 }) }) }); 9307 - } 9308 - }; 9309 - return router; 9310 - } 9311 - var IS_DEV = false; 9312 - var equalFn = (a, b) => a === b; 9313 - var $PROXY = Symbol("solid-proxy"); 9314 - var SUPPORTS_PROXY = typeof Proxy === "function"; 9315 - var $TRACK = Symbol("solid-track"); 9316 - var signalOptions = { 9317 - equals: equalFn 9318 - }; 9319 - var runEffects = runQueue; 9320 - var STALE = 1; 9321 - var PENDING = 2; 9322 - var UNOWNED = { 9323 - owned: null, 9324 - cleanups: null, 9325 - context: null, 9326 - owner: null 9327 - }; 9328 - var Owner = null; 9329 - var Transition = null; 9330 - var ExternalSourceConfig = null; 9331 - var Listener = null; 9332 - var Updates = null; 9333 - var Effects = null; 9334 - var ExecCount = 0; 9335 - function createRoot(fn, detachedOwner) { 9336 - const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : { 9337 - owned: null, 9338 - cleanups: null, 9339 - context: current ? current.context : null, 9340 - owner: current 9341 - }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root))); 9342 - Owner = root; 9343 - Listener = null; 9344 - try { 9345 - return runUpdates(updateFn, true); 9346 - } finally { 9347 - Listener = listener; 9348 - Owner = owner; 9349 - } 9350 - } 9351 - function createSignal$1(value, options) { 9352 - options = options ? Object.assign({}, signalOptions, options) : signalOptions; 9353 - const s = { 9354 - value, 9355 - observers: null, 9356 - observerSlots: null, 9357 - comparator: options.equals || void 0 9358 - }; 9359 - const setter = (value2) => { 9360 - if (typeof value2 === "function") { 9361 - value2 = value2(s.value); 9362 - } 9363 - return writeSignal(s, value2); 9364 - }; 9365 - return [readSignal.bind(s), setter]; 9366 - } 9367 - function createComputed(fn, value, options) { 9368 - const c = createComputation(fn, value, true, STALE); 9369 - updateComputation(c); 9370 - } 9371 - function createRenderEffect(fn, value, options) { 9372 - const c = createComputation(fn, value, false, STALE); 9373 - updateComputation(c); 9374 - } 9375 - function createEffect(fn, value, options) { 9376 - runEffects = runUserEffects; 9377 - const c = createComputation(fn, value, false, STALE); 9378 - if (!options || !options.render) c.user = true; 9379 - Effects ? Effects.push(c) : updateComputation(c); 9380 - } 9381 - function createMemo(fn, value, options) { 9382 - options = options ? Object.assign({}, signalOptions, options) : signalOptions; 9383 - const c = createComputation(fn, value, true, 0); 9384 - c.observers = null; 9385 - c.observerSlots = null; 9386 - c.comparator = options.equals || void 0; 9387 - updateComputation(c); 9388 - return readSignal.bind(c); 9389 - } 9390 - function batch(fn) { 9391 - return runUpdates(fn, false); 9392 - } 9393 - function untrack(fn) { 9394 - if (Listener === null) return fn(); 9395 - const listener = Listener; 9396 - Listener = null; 9397 - try { 9398 - if (ExternalSourceConfig) ; 9399 - return fn(); 9400 - } finally { 9401 - Listener = listener; 9402 - } 9403 - } 9404 - function on(deps, fn, options) { 9405 - const isArray3 = Array.isArray(deps); 9406 - let prevInput; 9407 - let defer2 = options && options.defer; 9408 - return (prevValue) => { 9409 - let input; 9410 - if (isArray3) { 9411 - input = Array(deps.length); 9412 - for (let i = 0; i < deps.length; i++) input[i] = deps[i](); 9413 - } else input = deps(); 9414 - if (defer2) { 9415 - defer2 = false; 9416 - return prevValue; 9417 - } 9418 - const result = untrack(() => fn(input, prevInput, prevValue)); 9419 - prevInput = input; 9420 - return result; 9421 - }; 9422 - } 9423 - function onMount(fn) { 9424 - createEffect(() => untrack(fn)); 9425 - } 9426 - function onCleanup(fn) { 9427 - if (Owner === null) ; 9428 - else if (Owner.cleanups === null) Owner.cleanups = [fn]; 9429 - else Owner.cleanups.push(fn); 9430 - return fn; 9431 - } 9432 - function getOwner() { 9433 - return Owner; 9434 - } 9435 - function runWithOwner(o, fn) { 9436 - const prev = Owner; 9437 - const prevListener = Listener; 9438 - Owner = o; 9439 - Listener = null; 9440 - try { 9441 - return runUpdates(fn, true); 9442 - } catch (err) { 9443 - handleError(err); 9444 - } finally { 9445 - Owner = prev; 9446 - Listener = prevListener; 9447 - } 9448 - } 9449 - function startTransition(fn) { 9450 - const l = Listener; 9451 - const o = Owner; 9452 - return Promise.resolve().then(() => { 9453 - Listener = l; 9454 - Owner = o; 9455 - runUpdates(fn, false); 9456 - Listener = Owner = null; 9457 - return void 0; 9458 - }); 9459 - } 9460 - var [transPending, setTransPending] = /* @__PURE__ */ createSignal$1(false); 9461 - function useTransition() { 9462 - return [transPending, startTransition]; 9463 - } 9464 - function createContext(defaultValue, options) { 9465 - const id = Symbol("context"); 9466 - return { 9467 - id, 9468 - Provider: createProvider(id), 9469 - defaultValue 9470 - }; 9471 - } 9472 - function useContext(context) { 9473 - let value; 9474 - return Owner && Owner.context && (value = Owner.context[context.id]) !== void 0 ? value : context.defaultValue; 9475 - } 9476 - function children(fn) { 9477 - const children2 = createMemo(fn); 9478 - const memo = createMemo(() => resolveChildren(children2())); 9479 - memo.toArray = () => { 9480 - const c = memo(); 9481 - return Array.isArray(c) ? c : c != null ? [c] : []; 9482 - }; 9483 - return memo; 9484 - } 9485 - function readSignal() { 9486 - if (this.sources && this.state) { 9487 - if (this.state === STALE) updateComputation(this); 9488 - else { 9489 - const updates = Updates; 9490 - Updates = null; 9491 - runUpdates(() => lookUpstream(this), false); 9492 - Updates = updates; 9493 - } 9494 - } 9495 - if (Listener) { 9496 - const sSlot = this.observers ? this.observers.length : 0; 9497 - if (!Listener.sources) { 9498 - Listener.sources = [this]; 9499 - Listener.sourceSlots = [sSlot]; 9500 - } else { 9501 - Listener.sources.push(this); 9502 - Listener.sourceSlots.push(sSlot); 9503 - } 9504 - if (!this.observers) { 9505 - this.observers = [Listener]; 9506 - this.observerSlots = [Listener.sources.length - 1]; 9507 - } else { 9508 - this.observers.push(Listener); 9509 - this.observerSlots.push(Listener.sources.length - 1); 9510 - } 9511 - } 9512 - return this.value; 9513 - } 9514 - function writeSignal(node, value, isComp) { 9515 - let current = node.value; 9516 - if (!node.comparator || !node.comparator(current, value)) { 9517 - node.value = value; 9518 - if (node.observers && node.observers.length) { 9519 - runUpdates(() => { 9520 - for (let i = 0; i < node.observers.length; i += 1) { 9521 - const o = node.observers[i]; 9522 - const TransitionRunning = Transition && Transition.running; 9523 - if (TransitionRunning && Transition.disposed.has(o)) ; 9524 - if (TransitionRunning ? !o.tState : !o.state) { 9525 - if (o.pure) Updates.push(o); 9526 - else Effects.push(o); 9527 - if (o.observers) markDownstream(o); 9528 - } 9529 - if (!TransitionRunning) o.state = STALE; 9530 - } 9531 - if (Updates.length > 1e6) { 9532 - Updates = []; 9533 - if (IS_DEV) ; 9534 - throw new Error(); 9535 - } 9536 - }, false); 9537 - } 9538 - } 9539 - return value; 9540 - } 9541 - function updateComputation(node) { 9542 - if (!node.fn) return; 9543 - cleanNode(node); 9544 - const time = ExecCount; 9545 - runComputation( 9546 - node, 9547 - node.value, 9548 - time 9549 - ); 9550 - } 9551 - function runComputation(node, value, time) { 9552 - let nextValue; 9553 - const owner = Owner, listener = Listener; 9554 - Listener = Owner = node; 9555 - try { 9556 - nextValue = node.fn(value); 9557 - } catch (err) { 9558 - if (node.pure) { 9559 - { 9560 - node.state = STALE; 9561 - node.owned && node.owned.forEach(cleanNode); 9562 - node.owned = null; 9563 - } 9564 - } 9565 - node.updatedAt = time + 1; 9566 - return handleError(err); 9567 - } finally { 9568 - Listener = listener; 9569 - Owner = owner; 9570 - } 9571 - if (!node.updatedAt || node.updatedAt <= time) { 9572 - if (node.updatedAt != null && "observers" in node) { 9573 - writeSignal(node, nextValue); 9574 - } else node.value = nextValue; 9575 - node.updatedAt = time; 9576 - } 9577 - } 9578 - function createComputation(fn, init, pure, state = STALE, options) { 9579 - const c = { 9580 - fn, 9581 - state, 9582 - updatedAt: null, 9583 - owned: null, 9584 - sources: null, 9585 - sourceSlots: null, 9586 - cleanups: null, 9587 - value: init, 9588 - owner: Owner, 9589 - context: Owner ? Owner.context : null, 9590 - pure 9591 - }; 9592 - if (Owner === null) ; 9593 - else if (Owner !== UNOWNED) { 9594 - { 9595 - if (!Owner.owned) Owner.owned = [c]; 9596 - else Owner.owned.push(c); 9597 - } 9598 - } 9599 - return c; 9600 - } 9601 - function runTop(node) { 9602 - if (node.state === 0) return; 9603 - if (node.state === PENDING) return lookUpstream(node); 9604 - if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node); 9605 - const ancestors = [node]; 9606 - while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) { 9607 - if (node.state) ancestors.push(node); 9608 - } 9609 - for (let i = ancestors.length - 1; i >= 0; i--) { 9610 - node = ancestors[i]; 9611 - if (node.state === STALE) { 9612 - updateComputation(node); 9613 - } else if (node.state === PENDING) { 9614 - const updates = Updates; 9615 - Updates = null; 9616 - runUpdates(() => lookUpstream(node, ancestors[0]), false); 9617 - Updates = updates; 9618 - } 9619 - } 9620 - } 9621 - function runUpdates(fn, init) { 9622 - if (Updates) return fn(); 9623 - let wait = false; 9624 - if (!init) Updates = []; 9625 - if (Effects) wait = true; 9626 - else Effects = []; 9627 - ExecCount++; 9628 - try { 9629 - const res = fn(); 9630 - completeUpdates(wait); 9631 - return res; 9632 - } catch (err) { 9633 - if (!wait) Effects = null; 9634 - Updates = null; 9635 - handleError(err); 9636 - } 9637 - } 9638 - function completeUpdates(wait) { 9639 - if (Updates) { 9640 - runQueue(Updates); 9641 - Updates = null; 9642 - } 9643 - if (wait) return; 9644 - const e = Effects; 9645 - Effects = null; 9646 - if (e.length) runUpdates(() => runEffects(e), false); 9647 - } 9648 - function runQueue(queue) { 9649 - for (let i = 0; i < queue.length; i++) runTop(queue[i]); 9650 - } 9651 - function runUserEffects(queue) { 9652 - let i, userLength = 0; 9653 - for (i = 0; i < queue.length; i++) { 9654 - const e = queue[i]; 9655 - if (!e.user) runTop(e); 9656 - else queue[userLength++] = e; 9657 - } 9658 - for (i = 0; i < userLength; i++) runTop(queue[i]); 9659 - } 9660 - function lookUpstream(node, ignore) { 9661 - node.state = 0; 9662 - for (let i = 0; i < node.sources.length; i += 1) { 9663 - const source = node.sources[i]; 9664 - if (source.sources) { 9665 - const state = source.state; 9666 - if (state === STALE) { 9667 - if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) 9668 - runTop(source); 9669 - } else if (state === PENDING) lookUpstream(source, ignore); 9670 - } 9671 - } 9672 - } 9673 - function markDownstream(node) { 9674 - for (let i = 0; i < node.observers.length; i += 1) { 9675 - const o = node.observers[i]; 9676 - if (!o.state) { 9677 - o.state = PENDING; 9678 - if (o.pure) Updates.push(o); 9679 - else Effects.push(o); 9680 - o.observers && markDownstream(o); 9681 - } 9682 - } 9683 - } 9684 - function cleanNode(node) { 9685 - let i; 9686 - if (node.sources) { 9687 - while (node.sources.length) { 9688 - const source = node.sources.pop(), index2 = node.sourceSlots.pop(), obs = source.observers; 9689 - if (obs && obs.length) { 9690 - const n = obs.pop(), s = source.observerSlots.pop(); 9691 - if (index2 < obs.length) { 9692 - n.sourceSlots[s] = index2; 9693 - obs[index2] = n; 9694 - source.observerSlots[index2] = s; 9695 - } 9696 - } 9697 - } 9698 - } 9699 - if (node.tOwned) { 9700 - for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]); 9701 - delete node.tOwned; 9702 - } 9703 - if (node.owned) { 9704 - for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]); 9705 - node.owned = null; 9706 - } 9707 - if (node.cleanups) { 9708 - for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i](); 9709 - node.cleanups = null; 9710 - } 9711 - node.state = 0; 9712 - } 9713 - function castError(err) { 9714 - if (err instanceof Error) return err; 9715 - return new Error(typeof err === "string" ? err : "Unknown error", { 9716 - cause: err 9717 - }); 9718 - } 9719 - function handleError(err, owner = Owner) { 9720 - const error = castError(err); 9721 - throw error; 9722 - } 9723 - function resolveChildren(children2) { 9724 - if (typeof children2 === "function" && !children2.length) return resolveChildren(children2()); 9725 - if (Array.isArray(children2)) { 9726 - const results = []; 9727 - for (let i = 0; i < children2.length; i++) { 9728 - const result = resolveChildren(children2[i]); 9729 - Array.isArray(result) ? results.push.apply(results, result) : results.push(result); 9730 - } 9731 - return results; 9732 - } 9733 - return children2; 9734 - } 9735 - function createProvider(id, options) { 9736 - return function provider(props) { 9737 - let res; 9738 - createRenderEffect( 9739 - () => res = untrack(() => { 9740 - Owner.context = { 9741 - ...Owner.context, 9742 - [id]: props.value 9743 - }; 9744 - return children(() => props.children); 9745 - }), 9746 - void 0 9747 - ); 9748 - return res; 9749 - }; 9750 - } 9751 - var FALLBACK = Symbol("fallback"); 9752 - function dispose(d) { 9753 - for (let i = 0; i < d.length; i++) d[i](); 9754 - } 9755 - function mapArray(list, mapFn, options = {}) { 9756 - let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null; 9757 - onCleanup(() => dispose(disposers)); 9758 - return () => { 9759 - let newItems = list() || [], newLen = newItems.length, i, j; 9760 - newItems[$TRACK]; 9761 - return untrack(() => { 9762 - let newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item; 9763 - if (newLen === 0) { 9764 - if (len !== 0) { 9765 - dispose(disposers); 9766 - disposers = []; 9767 - items = []; 9768 - mapped = []; 9769 - len = 0; 9770 - indexes && (indexes = []); 9771 - } 9772 - if (options.fallback) { 9773 - items = [FALLBACK]; 9774 - mapped[0] = createRoot((disposer) => { 9775 - disposers[0] = disposer; 9776 - return options.fallback(); 9777 - }); 9778 - len = 1; 9779 - } 9780 - } else if (len === 0) { 9781 - mapped = new Array(newLen); 9782 - for (j = 0; j < newLen; j++) { 9783 - items[j] = newItems[j]; 9784 - mapped[j] = createRoot(mapper); 9785 - } 9786 - len = newLen; 9787 - } else { 9788 - temp = new Array(newLen); 9789 - tempdisposers = new Array(newLen); 9790 - indexes && (tempIndexes = new Array(newLen)); 9791 - for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++) ; 9792 - for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) { 9793 - temp[newEnd] = mapped[end]; 9794 - tempdisposers[newEnd] = disposers[end]; 9795 - indexes && (tempIndexes[newEnd] = indexes[end]); 9796 - } 9797 - newIndices = /* @__PURE__ */ new Map(); 9798 - newIndicesNext = new Array(newEnd + 1); 9799 - for (j = newEnd; j >= start; j--) { 9800 - item = newItems[j]; 9801 - i = newIndices.get(item); 9802 - newIndicesNext[j] = i === void 0 ? -1 : i; 9803 - newIndices.set(item, j); 9804 - } 9805 - for (i = start; i <= end; i++) { 9806 - item = items[i]; 9807 - j = newIndices.get(item); 9808 - if (j !== void 0 && j !== -1) { 9809 - temp[j] = mapped[i]; 9810 - tempdisposers[j] = disposers[i]; 9811 - indexes && (tempIndexes[j] = indexes[i]); 9812 - j = newIndicesNext[j]; 9813 - newIndices.set(item, j); 9814 - } else disposers[i](); 9815 - } 9816 - for (j = start; j < newLen; j++) { 9817 - if (j in temp) { 9818 - mapped[j] = temp[j]; 9819 - disposers[j] = tempdisposers[j]; 9820 - if (indexes) { 9821 - indexes[j] = tempIndexes[j]; 9822 - indexes[j](j); 9823 - } 9824 - } else mapped[j] = createRoot(mapper); 9825 - } 9826 - mapped = mapped.slice(0, len = newLen); 9827 - items = newItems.slice(0); 9828 - } 9829 - return mapped; 9830 - }); 9831 - function mapper(disposer) { 9832 - disposers[j] = disposer; 9833 - if (indexes) { 9834 - const [s, set] = createSignal$1(j); 9835 - indexes[j] = set; 9836 - return mapFn(newItems[j], s); 9837 - } 9838 - return mapFn(newItems[j]); 9839 - } 9840 - }; 9841 - } 9842 - function indexArray(list, mapFn, options = {}) { 9843 - let items = [], mapped = [], disposers = [], signals = [], len = 0, i; 9844 - onCleanup(() => dispose(disposers)); 9845 - return () => { 9846 - const newItems = list() || [], newLen = newItems.length; 9847 - newItems[$TRACK]; 9848 - return untrack(() => { 9849 - if (newLen === 0) { 9850 - if (len !== 0) { 9851 - dispose(disposers); 9852 - disposers = []; 9853 - items = []; 9854 - mapped = []; 9855 - len = 0; 9856 - signals = []; 9857 - } 9858 - if (options.fallback) { 9859 - items = [FALLBACK]; 9860 - mapped[0] = createRoot((disposer) => { 9861 - disposers[0] = disposer; 9862 - return options.fallback(); 9863 - }); 9864 - len = 1; 9865 - } 9866 - return mapped; 9867 - } 9868 - if (items[0] === FALLBACK) { 9869 - disposers[0](); 9870 - disposers = []; 9871 - items = []; 9872 - mapped = []; 9873 - len = 0; 9874 - } 9875 - for (i = 0; i < newLen; i++) { 9876 - if (i < items.length && items[i] !== newItems[i]) { 9877 - signals[i](() => newItems[i]); 9878 - } else if (i >= items.length) { 9879 - mapped[i] = createRoot(mapper); 9880 - } 9881 - } 9882 - for (; i < items.length; i++) { 9883 - disposers[i](); 9884 - } 9885 - len = signals.length = disposers.length = newLen; 9886 - items = newItems.slice(0); 9887 - return mapped = mapped.slice(0, len); 9888 - }); 9889 - function mapper(disposer) { 9890 - disposers[i] = disposer; 9891 - const [s, set] = createSignal$1(newItems[i]); 9892 - signals[i] = set; 9893 - return mapFn(s, i); 9894 - } 9895 - }; 9896 - } 9897 - function createComponent(Comp, props) { 9898 - return untrack(() => Comp(props || {})); 9899 - } 9900 - function trueFn() { 9901 - return true; 9902 - } 9903 - var propTraps = { 9904 - get(_, property, receiver) { 9905 - if (property === $PROXY) return receiver; 9906 - return _.get(property); 9907 - }, 9908 - has(_, property) { 9909 - if (property === $PROXY) return true; 9910 - return _.has(property); 9911 - }, 9912 - set: trueFn, 9913 - deleteProperty: trueFn, 9914 - getOwnPropertyDescriptor(_, property) { 9915 - return { 9916 - configurable: true, 9917 - enumerable: true, 9918 - get() { 9919 - return _.get(property); 9920 - }, 9921 - set: trueFn, 9922 - deleteProperty: trueFn 9923 - }; 9924 - }, 9925 - ownKeys(_) { 9926 - return _.keys(); 9927 - } 9928 - }; 9929 - function resolveSource(s) { 9930 - return !(s = typeof s === "function" ? s() : s) ? {} : s; 9931 - } 9932 - function resolveSources() { 9933 - for (let i = 0, length = this.length; i < length; ++i) { 9934 - const v2 = this[i](); 9935 - if (v2 !== void 0) return v2; 9936 - } 9937 - } 9938 - function mergeProps(...sources) { 9939 - let proxy = false; 9940 - for (let i = 0; i < sources.length; i++) { 9941 - const s = sources[i]; 9942 - proxy = proxy || !!s && $PROXY in s; 9943 - sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s; 9944 - } 9945 - if (SUPPORTS_PROXY && proxy) { 9946 - return new Proxy( 9947 - { 9948 - get(property) { 9949 - for (let i = sources.length - 1; i >= 0; i--) { 9950 - const v2 = resolveSource(sources[i])[property]; 9951 - if (v2 !== void 0) return v2; 9952 - } 9953 - }, 9954 - has(property) { 9955 - for (let i = sources.length - 1; i >= 0; i--) { 9956 - if (property in resolveSource(sources[i])) return true; 9957 - } 9958 - return false; 9959 - }, 9960 - keys() { 9961 - const keys = []; 9962 - for (let i = 0; i < sources.length; i++) 9963 - keys.push(...Object.keys(resolveSource(sources[i]))); 9964 - return [...new Set(keys)]; 9965 - } 9966 - }, 9967 - propTraps 9968 - ); 9969 - } 9970 - const sourcesMap = {}; 9971 - const defined = /* @__PURE__ */ Object.create(null); 9972 - for (let i = sources.length - 1; i >= 0; i--) { 9973 - const source = sources[i]; 9974 - if (!source) continue; 9975 - const sourceKeys = Object.getOwnPropertyNames(source); 9976 - for (let i2 = sourceKeys.length - 1; i2 >= 0; i2--) { 9977 - const key = sourceKeys[i2]; 9978 - if (key === "__proto__" || key === "constructor") continue; 9979 - const desc = Object.getOwnPropertyDescriptor(source, key); 9980 - if (!defined[key]) { 9981 - defined[key] = desc.get ? { 9982 - enumerable: true, 9983 - configurable: true, 9984 - get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)]) 9985 - } : desc.value !== void 0 ? desc : void 0; 9986 - } else { 9987 - const sources2 = sourcesMap[key]; 9988 - if (sources2) { 9989 - if (desc.get) sources2.push(desc.get.bind(source)); 9990 - else if (desc.value !== void 0) sources2.push(() => desc.value); 9991 - } 9992 - } 9993 - } 9994 - } 9995 - const target = {}; 9996 - const definedKeys = Object.keys(defined); 9997 - for (let i = definedKeys.length - 1; i >= 0; i--) { 9998 - const key = definedKeys[i], desc = defined[key]; 9999 - if (desc && desc.get) Object.defineProperty(target, key, desc); 10000 - else target[key] = desc ? desc.value : void 0; 10001 - } 10002 - return target; 10003 - } 10004 - function splitProps(props, ...keys) { 10005 - if (SUPPORTS_PROXY && $PROXY in props) { 10006 - const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]); 10007 - const res = keys.map((k) => { 10008 - return new Proxy( 10009 - { 10010 - get(property) { 10011 - return k.includes(property) ? props[property] : void 0; 10012 - }, 10013 - has(property) { 10014 - return k.includes(property) && property in props; 10015 - }, 10016 - keys() { 10017 - return k.filter((property) => property in props); 10018 - } 10019 - }, 10020 - propTraps 10021 - ); 10022 - }); 10023 - res.push( 10024 - new Proxy( 10025 - { 10026 - get(property) { 10027 - return blocked.has(property) ? void 0 : props[property]; 10028 - }, 10029 - has(property) { 10030 - return blocked.has(property) ? false : property in props; 10031 - }, 10032 - keys() { 10033 - return Object.keys(props).filter((k) => !blocked.has(k)); 10034 - } 10035 - }, 10036 - propTraps 10037 - ) 10038 - ); 10039 - return res; 10040 - } 10041 - const otherObject = {}; 10042 - const objects = keys.map(() => ({})); 10043 - for (const propName of Object.getOwnPropertyNames(props)) { 10044 - const desc = Object.getOwnPropertyDescriptor(props, propName); 10045 - const isDefaultDesc = !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable; 10046 - let blocked = false; 10047 - let objectIndex = 0; 10048 - for (const k of keys) { 10049 - if (k.includes(propName)) { 10050 - blocked = true; 10051 - isDefaultDesc ? objects[objectIndex][propName] = desc.value : Object.defineProperty(objects[objectIndex], propName, desc); 10052 - } 10053 - ++objectIndex; 10054 - } 10055 - if (!blocked) { 10056 - isDefaultDesc ? otherObject[propName] = desc.value : Object.defineProperty(otherObject, propName, desc); 10057 - } 10058 - } 10059 - return [...objects, otherObject]; 10060 - } 10061 - var counter = 0; 10062 - function createUniqueId() { 10063 - return `cl-${counter++}`; 10064 - } 10065 - var narrowedError = (name) => `Stale read from <${name}>.`; 10066 - function For(props) { 10067 - const fallback = "fallback" in props && { 10068 - fallback: () => props.fallback 10069 - }; 10070 - return createMemo(mapArray(() => props.each, props.children, fallback || void 0)); 10071 - } 10072 - function Index(props) { 10073 - const fallback = "fallback" in props && { 10074 - fallback: () => props.fallback 10075 - }; 10076 - return createMemo(indexArray(() => props.each, props.children, fallback || void 0)); 10077 - } 10078 - function Show(props) { 10079 - const keyed = props.keyed; 10080 - const conditionValue = createMemo(() => props.when, void 0, void 0); 10081 - const condition = keyed ? conditionValue : createMemo(conditionValue, void 0, { 10082 - equals: (a, b) => !a === !b 10083 - }); 10084 - return createMemo( 10085 - () => { 10086 - const c = condition(); 10087 - if (c) { 10088 - const child = props.children; 10089 - const fn = typeof child === "function" && child.length > 0; 10090 - return fn ? untrack( 10091 - () => child( 10092 - keyed ? c : () => { 10093 - if (!untrack(condition)) throw narrowedError("Show"); 10094 - return conditionValue(); 10095 - } 10096 - ) 10097 - ) : child; 10098 - } 10099 - return props.fallback; 10100 - }, 10101 - void 0, 10102 - void 0 10103 - ); 10104 - } 10105 - function Switch(props) { 10106 - const chs = children(() => props.children); 10107 - const switchFunc = createMemo(() => { 10108 - const ch = chs(); 10109 - const mps = Array.isArray(ch) ? ch : [ch]; 10110 - let func = () => void 0; 10111 - for (let i = 0; i < mps.length; i++) { 10112 - const index2 = i; 10113 - const mp = mps[i]; 10114 - const prevFunc = func; 10115 - const conditionValue = createMemo( 10116 - () => prevFunc() ? void 0 : mp.when, 10117 - void 0, 10118 - void 0 10119 - ); 10120 - const condition = mp.keyed ? conditionValue : createMemo(conditionValue, void 0, { 10121 - equals: (a, b) => !a === !b 10122 - }); 10123 - func = () => prevFunc() || (condition() ? [index2, conditionValue, mp] : void 0); 10124 - } 10125 - return func; 10126 - }); 10127 - return createMemo( 10128 - () => { 10129 - const sel = switchFunc()(); 10130 - if (!sel) return props.fallback; 10131 - const [index2, conditionValue, mp] = sel; 10132 - const child = mp.children; 10133 - const fn = typeof child === "function" && child.length > 0; 10134 - return fn ? untrack( 10135 - () => child( 10136 - mp.keyed ? conditionValue() : () => { 10137 - var _a2; 10138 - if (((_a2 = untrack(switchFunc)()) == null ? void 0 : _a2[0]) !== index2) throw narrowedError("Match"); 10139 - return conditionValue(); 10140 - } 10141 - ) 10142 - ) : child; 10143 - }, 10144 - void 0, 10145 - void 0 10146 - ); 10147 - } 10148 - function Match(props) { 10149 - return props; 10150 - } 10151 - var booleans = [ 10152 - "allowfullscreen", 10153 - "async", 10154 - "autofocus", 10155 - "autoplay", 10156 - "checked", 10157 - "controls", 10158 - "default", 10159 - "disabled", 10160 - "formnovalidate", 10161 - "hidden", 10162 - "indeterminate", 10163 - "inert", 10164 - "ismap", 10165 - "loop", 10166 - "multiple", 10167 - "muted", 10168 - "nomodule", 10169 - "novalidate", 10170 - "open", 10171 - "playsinline", 10172 - "readonly", 10173 - "required", 10174 - "reversed", 10175 - "seamless", 10176 - "selected" 10177 - ]; 10178 - var Properties = /* @__PURE__ */ new Set([ 10179 - "className", 10180 - "value", 10181 - "readOnly", 10182 - "formNoValidate", 10183 - "isMap", 10184 - "noModule", 10185 - "playsInline", 10186 - ...booleans 10187 - ]); 10188 - var ChildProperties = /* @__PURE__ */ new Set([ 10189 - "innerHTML", 10190 - "textContent", 10191 - "innerText", 10192 - "children" 10193 - ]); 10194 - var Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), { 10195 - className: "class", 10196 - htmlFor: "for" 10197 - }); 10198 - var PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), { 10199 - class: "className", 10200 - formnovalidate: { 10201 - $: "formNoValidate", 10202 - BUTTON: 1, 10203 - INPUT: 1 10204 - }, 10205 - ismap: { 10206 - $: "isMap", 10207 - IMG: 1 10208 - }, 10209 - nomodule: { 10210 - $: "noModule", 10211 - SCRIPT: 1 10212 - }, 10213 - playsinline: { 10214 - $: "playsInline", 10215 - VIDEO: 1 10216 - }, 10217 - readonly: { 10218 - $: "readOnly", 10219 - INPUT: 1, 10220 - TEXTAREA: 1 10221 - } 10222 - }); 10223 - function getPropAlias(prop, tagName) { 10224 - const a = PropAliases[prop]; 10225 - return typeof a === "object" ? a[tagName] ? a["$"] : void 0 : a; 10226 - } 10227 - var DelegatedEvents = /* @__PURE__ */ new Set([ 10228 - "beforeinput", 10229 - "click", 10230 - "dblclick", 10231 - "contextmenu", 10232 - "focusin", 10233 - "focusout", 10234 - "input", 10235 - "keydown", 10236 - "keyup", 10237 - "mousedown", 10238 - "mousemove", 10239 - "mouseout", 10240 - "mouseover", 10241 - "mouseup", 10242 - "pointerdown", 10243 - "pointermove", 10244 - "pointerout", 10245 - "pointerover", 10246 - "pointerup", 10247 - "touchend", 10248 - "touchmove", 10249 - "touchstart" 10250 - ]); 10251 - var SVGElements = /* @__PURE__ */ new Set([ 10252 - "altGlyph", 10253 - "altGlyphDef", 10254 - "altGlyphItem", 10255 - "animate", 10256 - "animateColor", 10257 - "animateMotion", 10258 - "animateTransform", 10259 - "circle", 10260 - "clipPath", 10261 - "color-profile", 10262 - "cursor", 10263 - "defs", 10264 - "desc", 10265 - "ellipse", 10266 - "feBlend", 10267 - "feColorMatrix", 10268 - "feComponentTransfer", 10269 - "feComposite", 10270 - "feConvolveMatrix", 10271 - "feDiffuseLighting", 10272 - "feDisplacementMap", 10273 - "feDistantLight", 10274 - "feDropShadow", 10275 - "feFlood", 10276 - "feFuncA", 10277 - "feFuncB", 10278 - "feFuncG", 10279 - "feFuncR", 10280 - "feGaussianBlur", 10281 - "feImage", 10282 - "feMerge", 10283 - "feMergeNode", 10284 - "feMorphology", 10285 - "feOffset", 10286 - "fePointLight", 10287 - "feSpecularLighting", 10288 - "feSpotLight", 10289 - "feTile", 10290 - "feTurbulence", 10291 - "filter", 10292 - "font", 10293 - "font-face", 10294 - "font-face-format", 10295 - "font-face-name", 10296 - "font-face-src", 10297 - "font-face-uri", 10298 - "foreignObject", 10299 - "g", 10300 - "glyph", 10301 - "glyphRef", 10302 - "hkern", 10303 - "image", 10304 - "line", 10305 - "linearGradient", 10306 - "marker", 10307 - "mask", 10308 - "metadata", 10309 - "missing-glyph", 10310 - "mpath", 10311 - "path", 10312 - "pattern", 10313 - "polygon", 10314 - "polyline", 10315 - "radialGradient", 10316 - "rect", 10317 - "set", 10318 - "stop", 10319 - "svg", 10320 - "switch", 10321 - "symbol", 10322 - "text", 10323 - "textPath", 10324 - "tref", 10325 - "tspan", 10326 - "use", 10327 - "view", 10328 - "vkern" 10329 - ]); 10330 - var SVGNamespace = { 10331 - xlink: "http://www.w3.org/1999/xlink", 10332 - xml: "http://www.w3.org/XML/1998/namespace" 10333 - }; 10334 - function reconcileArrays(parentNode, a, b) { 10335 - let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null; 10336 - while (aStart < aEnd || bStart < bEnd) { 10337 - if (a[aStart] === b[bStart]) { 10338 - aStart++; 10339 - bStart++; 10340 - continue; 10341 - } 10342 - while (a[aEnd - 1] === b[bEnd - 1]) { 10343 - aEnd--; 10344 - bEnd--; 10345 - } 10346 - if (aEnd === aStart) { 10347 - const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after; 10348 - while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node); 10349 - } else if (bEnd === bStart) { 10350 - while (aStart < aEnd) { 10351 - if (!map || !map.has(a[aStart])) a[aStart].remove(); 10352 - aStart++; 10353 - } 10354 - } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) { 10355 - const node = a[--aEnd].nextSibling; 10356 - parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling); 10357 - parentNode.insertBefore(b[--bEnd], node); 10358 - a[aEnd] = b[bEnd]; 10359 - } else { 10360 - if (!map) { 10361 - map = /* @__PURE__ */ new Map(); 10362 - let i = bStart; 10363 - while (i < bEnd) map.set(b[i], i++); 10364 - } 10365 - const index2 = map.get(a[aStart]); 10366 - if (index2 != null) { 10367 - if (bStart < index2 && index2 < bEnd) { 10368 - let i = aStart, sequence = 1, t; 10369 - while (++i < aEnd && i < bEnd) { 10370 - if ((t = map.get(a[i])) == null || t !== index2 + sequence) break; 10371 - sequence++; 10372 - } 10373 - if (sequence > index2 - bStart) { 10374 - const node = a[aStart]; 10375 - while (bStart < index2) parentNode.insertBefore(b[bStart++], node); 10376 - } else parentNode.replaceChild(b[bStart++], a[aStart++]); 10377 - } else aStart++; 10378 - } else a[aStart++].remove(); 10379 - } 10380 - } 10381 - } 10382 - var $$EVENTS = "_$DX_DELEGATE"; 10383 - function template(html, isImportNode, isSVG, isMathML) { 10384 - let node; 10385 - const create = () => { 10386 - const t = document.createElement("template"); 10387 - t.innerHTML = html; 10388 - return t.content.firstChild; 10389 - }; 10390 - const fn = () => (node || (node = create())).cloneNode(true); 10391 - fn.cloneNode = fn; 10392 - return fn; 10393 - } 10394 - function delegateEvents(eventNames, document2 = window.document) { 10395 - const e = document2[$$EVENTS] || (document2[$$EVENTS] = /* @__PURE__ */ new Set()); 10396 - for (let i = 0, l = eventNames.length; i < l; i++) { 10397 - const name = eventNames[i]; 10398 - if (!e.has(name)) { 10399 - e.add(name); 10400 - document2.addEventListener(name, eventHandler); 10401 - } 10402 - } 10403 - } 10404 - function clearDelegatedEvents(document2 = window.document) { 10405 - if (document2[$$EVENTS]) { 10406 - for (let name of document2[$$EVENTS].keys()) document2.removeEventListener(name, eventHandler); 10407 - delete document2[$$EVENTS]; 10408 - } 10409 - } 10410 - function setAttribute(node, name, value) { 10411 - if (value == null) node.removeAttribute(name); 10412 - else node.setAttribute(name, value); 10413 - } 10414 - function setAttributeNS(node, namespace, name, value) { 10415 - if (value == null) node.removeAttributeNS(namespace, name); 10416 - else node.setAttributeNS(namespace, name, value); 10417 - } 10418 - function setBoolAttribute(node, name, value) { 10419 - value ? node.setAttribute(name, "") : node.removeAttribute(name); 10420 - } 10421 - function className(node, value) { 10422 - if (value == null) node.removeAttribute("class"); 10423 - else node.className = value; 10424 - } 10425 - function addEventListener(node, name, handler, delegate) { 10426 - if (delegate) { 10427 - if (Array.isArray(handler)) { 10428 - node[`$$${name}`] = handler[0]; 10429 - node[`$$${name}Data`] = handler[1]; 10430 - } else node[`$$${name}`] = handler; 10431 - } else if (Array.isArray(handler)) { 10432 - const handlerFn = handler[0]; 10433 - node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e)); 10434 - } else node.addEventListener(name, handler, typeof handler !== "function" && handler); 10435 - } 10436 - function classList(node, value, prev = {}) { 10437 - const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev); 10438 - let i, len; 10439 - for (i = 0, len = prevKeys.length; i < len; i++) { 10440 - const key = prevKeys[i]; 10441 - if (!key || key === "undefined" || value[key]) continue; 10442 - toggleClassKey(node, key, false); 10443 - delete prev[key]; 10444 - } 10445 - for (i = 0, len = classKeys.length; i < len; i++) { 10446 - const key = classKeys[i], classValue = !!value[key]; 10447 - if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue; 10448 - toggleClassKey(node, key, true); 10449 - prev[key] = classValue; 10450 - } 10451 - return prev; 10452 - } 10453 - function style(node, value, prev) { 10454 - if (!value) return prev ? setAttribute(node, "style") : value; 10455 - const nodeStyle = node.style; 10456 - if (typeof value === "string") return nodeStyle.cssText = value; 10457 - typeof prev === "string" && (nodeStyle.cssText = prev = void 0); 10458 - prev || (prev = {}); 10459 - value || (value = {}); 10460 - let v2, s; 10461 - for (s in prev) { 10462 - value[s] == null && nodeStyle.removeProperty(s); 10463 - delete prev[s]; 10464 - } 10465 - for (s in value) { 10466 - v2 = value[s]; 10467 - if (v2 !== prev[s]) { 10468 - nodeStyle.setProperty(s, v2); 10469 - prev[s] = v2; 10470 - } 10471 - } 10472 - return prev; 10473 - } 10474 - function spread(node, props = {}, isSVG, skipChildren) { 10475 - const prevProps = {}; 10476 - if (!skipChildren) { 10477 - createRenderEffect( 10478 - () => prevProps.children = insertExpression(node, props.children, prevProps.children) 10479 - ); 10480 - } 10481 - createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node)); 10482 - createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true)); 10483 - return prevProps; 10484 - } 10485 - function use(fn, element, arg) { 10486 - return untrack(() => fn(element, arg)); 10487 - } 10488 - function insert(parent, accessor, marker, initial) { 10489 - if (marker !== void 0 && !initial) initial = []; 10490 - if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker); 10491 - createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial); 10492 - } 10493 - function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) { 10494 - props || (props = {}); 10495 - for (const prop in prevProps) { 10496 - if (!(prop in props)) { 10497 - if (prop === "children") continue; 10498 - prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef, props); 10499 - } 10500 - } 10501 - for (const prop in props) { 10502 - if (prop === "children") { 10503 - continue; 10504 - } 10505 - const value = props[prop]; 10506 - prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef, props); 10507 - } 10508 - } 10509 - function toPropertyName(name) { 10510 - return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase()); 10511 - } 10512 - function toggleClassKey(node, key, value) { 10513 - const classNames = key.trim().split(/\s+/); 10514 - for (let i = 0, nameLen = classNames.length; i < nameLen; i++) 10515 - node.classList.toggle(classNames[i], value); 10516 - } 10517 - function assignProp(node, prop, value, prev, isSVG, skipRef, props) { 10518 - let isCE, isProp, isChildProp, propAlias, forceProp; 10519 - if (prop === "style") return style(node, value, prev); 10520 - if (prop === "classList") return classList(node, value, prev); 10521 - if (value === prev) return prev; 10522 - if (prop === "ref") { 10523 - if (!skipRef) value(node); 10524 - } else if (prop.slice(0, 3) === "on:") { 10525 - const e = prop.slice(3); 10526 - prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev); 10527 - value && node.addEventListener(e, value, typeof value !== "function" && value); 10528 - } else if (prop.slice(0, 10) === "oncapture:") { 10529 - const e = prop.slice(10); 10530 - prev && node.removeEventListener(e, prev, true); 10531 - value && node.addEventListener(e, value, true); 10532 - } else if (prop.slice(0, 2) === "on") { 10533 - const name = prop.slice(2).toLowerCase(); 10534 - const delegate = DelegatedEvents.has(name); 10535 - if (!delegate && prev) { 10536 - const h = Array.isArray(prev) ? prev[0] : prev; 10537 - node.removeEventListener(name, h); 10538 - } 10539 - if (delegate || value) { 10540 - addEventListener(node, name, value, delegate); 10541 - delegate && delegateEvents([name]); 10542 - } 10543 - } else if (prop.slice(0, 5) === "attr:") { 10544 - setAttribute(node, prop.slice(5), value); 10545 - } else if (prop.slice(0, 5) === "bool:") { 10546 - setBoolAttribute(node, prop.slice(5), value); 10547 - } else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-") || "is" in props)) { 10548 - if (forceProp) { 10549 - prop = prop.slice(5); 10550 - isProp = true; 10551 - } 10552 - if (prop === "class" || prop === "className") className(node, value); 10553 - else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value; 10554 - else node[propAlias || prop] = value; 10555 - } else { 10556 - const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]]; 10557 - if (ns) setAttributeNS(node, ns, prop, value); 10558 - else setAttribute(node, Aliases[prop] || prop, value); 10559 - } 10560 - return value; 10561 - } 10562 - function eventHandler(e) { 10563 - let node = e.target; 10564 - const key = `$$${e.type}`; 10565 - const oriTarget = e.target; 10566 - const oriCurrentTarget = e.currentTarget; 10567 - const retarget = (value) => Object.defineProperty(e, "target", { 10568 - configurable: true, 10569 - value 10570 - }); 10571 - const handleNode = () => { 10572 - const handler = node[key]; 10573 - if (handler && !node.disabled) { 10574 - const data = node[`${key}Data`]; 10575 - data !== void 0 ? handler.call(node, data, e) : handler.call(node, e); 10576 - if (e.cancelBubble) return; 10577 - } 10578 - node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host); 10579 - return true; 10580 - }; 10581 - const walkUpTree = () => { 10582 - while (handleNode() && (node = node._$host || node.parentNode || node.host)) ; 10583 - }; 10584 - Object.defineProperty(e, "currentTarget", { 10585 - configurable: true, 10586 - get() { 10587 - return node || document; 10588 - } 10589 - }); 10590 - if (e.composedPath) { 10591 - const path = e.composedPath(); 10592 - retarget(path[0]); 10593 - for (let i = 0; i < path.length - 2; i++) { 10594 - node = path[i]; 10595 - if (!handleNode()) break; 10596 - if (node._$host) { 10597 - node = node._$host; 10598 - walkUpTree(); 10599 - break; 10600 - } 10601 - if (node.parentNode === oriCurrentTarget) { 10602 - break; 10603 - } 10604 - } 10605 - } else walkUpTree(); 10606 - retarget(oriTarget); 10607 - } 10608 - function insertExpression(parent, value, current, marker, unwrapArray) { 10609 - while (typeof current === "function") current = current(); 10610 - if (value === current) return current; 10611 - const t = typeof value, multi = marker !== void 0; 10612 - parent = multi && current[0] && current[0].parentNode || parent; 10613 - if (t === "string" || t === "number") { 10614 - if (t === "number") { 10615 - value = value.toString(); 10616 - if (value === current) return current; 10617 - } 10618 - if (multi) { 10619 - let node = current[0]; 10620 - if (node && node.nodeType === 3) { 10621 - node.data !== value && (node.data = value); 10622 - } else node = document.createTextNode(value); 10623 - current = cleanChildren(parent, current, marker, node); 10624 - } else { 10625 - if (current !== "" && typeof current === "string") { 10626 - current = parent.firstChild.data = value; 10627 - } else current = parent.textContent = value; 10628 - } 10629 - } else if (value == null || t === "boolean") { 10630 - current = cleanChildren(parent, current, marker); 10631 - } else if (t === "function") { 10632 - createRenderEffect(() => { 10633 - let v2 = value(); 10634 - while (typeof v2 === "function") v2 = v2(); 10635 - current = insertExpression(parent, v2, current, marker); 10636 - }); 10637 - return () => current; 10638 - } else if (Array.isArray(value)) { 10639 - const array = []; 10640 - const currentArray = current && Array.isArray(current); 10641 - if (normalizeIncomingArray(array, value, current, unwrapArray)) { 10642 - createRenderEffect(() => current = insertExpression(parent, array, current, marker, true)); 10643 - return () => current; 10644 - } 10645 - if (array.length === 0) { 10646 - current = cleanChildren(parent, current, marker); 10647 - if (multi) return current; 10648 - } else if (currentArray) { 10649 - if (current.length === 0) { 10650 - appendNodes(parent, array, marker); 10651 - } else reconcileArrays(parent, current, array); 10652 - } else { 10653 - current && cleanChildren(parent); 10654 - appendNodes(parent, array); 10655 - } 10656 - current = array; 10657 - } else if (value.nodeType) { 10658 - if (Array.isArray(current)) { 10659 - if (multi) return current = cleanChildren(parent, current, marker, value); 10660 - cleanChildren(parent, current, null, value); 10661 - } else if (current == null || current === "" || !parent.firstChild) { 10662 - parent.appendChild(value); 10663 - } else parent.replaceChild(value, parent.firstChild); 10664 - current = value; 10665 - } else ; 10666 - return current; 10667 - } 10668 - function normalizeIncomingArray(normalized, array, current, unwrap) { 10669 - let dynamic = false; 10670 - for (let i = 0, len = array.length; i < len; i++) { 10671 - let item = array[i], prev = current && current[normalized.length], t; 10672 - if (item == null || item === true || item === false) ; 10673 - else if ((t = typeof item) === "object" && item.nodeType) { 10674 - normalized.push(item); 10675 - } else if (Array.isArray(item)) { 10676 - dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic; 10677 - } else if (t === "function") { 10678 - if (unwrap) { 10679 - while (typeof item === "function") item = item(); 10680 - dynamic = normalizeIncomingArray( 10681 - normalized, 10682 - Array.isArray(item) ? item : [item], 10683 - Array.isArray(prev) ? prev : [prev] 10684 - ) || dynamic; 10685 - } else { 10686 - normalized.push(item); 10687 - dynamic = true; 10688 - } 10689 - } else { 10690 - const value = String(item); 10691 - if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev); 10692 - else normalized.push(document.createTextNode(value)); 10693 - } 10694 - } 10695 - return dynamic; 10696 - } 10697 - function appendNodes(parent, array, marker = null) { 10698 - for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker); 10699 - } 10700 - function cleanChildren(parent, current, marker, replacement) { 10701 - if (marker === void 0) return parent.textContent = ""; 10702 - const node = replacement || document.createTextNode(""); 10703 - if (current.length) { 10704 - let inserted = false; 10705 - for (let i = current.length - 1; i >= 0; i--) { 10706 - const el = current[i]; 10707 - if (node !== el) { 10708 - const isParent = el.parentNode === parent; 10709 - if (!inserted && !i) 10710 - isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker); 10711 - else isParent && el.remove(); 10712 - } else inserted = true; 10713 - } 10714 - } else parent.insertBefore(node, marker); 10715 - return [node]; 10716 - } 10717 - var SVG_NAMESPACE = "http://www.w3.org/2000/svg"; 10718 - function createElement(tagName, isSVG = false) { 10719 - return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName); 10720 - } 10721 - function Portal(props) { 10722 - const { useShadow } = props, marker = document.createTextNode(""), mount = () => props.mount || document.body, owner = getOwner(); 10723 - let content; 10724 - createEffect( 10725 - () => { 10726 - content || (content = runWithOwner(owner, () => createMemo(() => props.children))); 10727 - const el = mount(); 10728 - if (el instanceof HTMLHeadElement) { 10729 - const [clean, setClean] = createSignal$1(false); 10730 - const cleanup = () => setClean(true); 10731 - createRoot((dispose2) => insert(el, () => !clean() ? content() : dispose2(), null)); 10732 - onCleanup(cleanup); 10733 - } else { 10734 - const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({ 10735 - mode: "open" 10736 - }) : container; 10737 - Object.defineProperty(container, "_$host", { 10738 - get() { 10739 - return marker.parentNode; 10740 - }, 10741 - configurable: true 10742 - }); 10743 - insert(renderRoot, content); 10744 - el.appendChild(container); 10745 - props.ref && props.ref(container); 10746 - onCleanup(() => el.removeChild(container)); 10747 - } 10748 - }, 10749 - void 0, 10750 - { 10751 - render: true 10752 - } 10753 - ); 10754 - return marker; 10755 - } 10756 - function createDynamic(component, props) { 10757 - const cached = createMemo(component); 10758 - return createMemo(() => { 10759 - const component2 = cached(); 10760 - switch (typeof component2) { 10761 - case "function": 10762 - return untrack(() => component2(props)); 10763 - case "string": 10764 - const isSvg = SVGElements.has(component2); 10765 - const el = createElement(component2, isSvg); 10766 - spread(el, props, isSvg); 10767 - return el; 10768 - } 10769 - }); 10770 - } 10771 - function Dynamic(props) { 10772 - const [, others] = splitProps(props, ["component"]); 10773 - return createDynamic(() => props.component, others); 10774 - } 10775 - var DoubleIndexedKV = class { 10776 - constructor() { 10777 - this.keyToValue = /* @__PURE__ */ new Map(); 10778 - this.valueToKey = /* @__PURE__ */ new Map(); 10779 - } 10780 - set(key, value) { 10781 - this.keyToValue.set(key, value); 10782 - this.valueToKey.set(value, key); 10783 - } 10784 - getByKey(key) { 10785 - return this.keyToValue.get(key); 10786 - } 10787 - getByValue(value) { 10788 - return this.valueToKey.get(value); 10789 - } 10790 - clear() { 10791 - this.keyToValue.clear(); 10792 - this.valueToKey.clear(); 10793 - } 10794 - }; 10795 - var Registry = class { 10796 - constructor(generateIdentifier) { 10797 - this.generateIdentifier = generateIdentifier; 10798 - this.kv = new DoubleIndexedKV(); 10799 - } 10800 - register(value, identifier) { 10801 - if (this.kv.getByValue(value)) { 10802 - return; 10803 - } 10804 - if (!identifier) { 10805 - identifier = this.generateIdentifier(value); 10806 - } 10807 - this.kv.set(identifier, value); 10808 - } 10809 - clear() { 10810 - this.kv.clear(); 10811 - } 10812 - getIdentifier(value) { 10813 - return this.kv.getByValue(value); 10814 - } 10815 - getValue(identifier) { 10816 - return this.kv.getByKey(identifier); 10817 - } 10818 - }; 10819 - var ClassRegistry = class extends Registry { 10820 - constructor() { 10821 - super((c) => c.name); 10822 - this.classToAllowedProps = /* @__PURE__ */ new Map(); 10823 - } 10824 - register(value, options) { 10825 - if (typeof options === "object") { 10826 - if (options.allowProps) { 10827 - this.classToAllowedProps.set(value, options.allowProps); 10828 - } 10829 - super.register(value, options.identifier); 10830 - } else { 10831 - super.register(value, options); 10832 - } 10833 - } 10834 - getAllowedProps(value) { 10835 - return this.classToAllowedProps.get(value); 10836 - } 10837 - }; 10838 - function valuesOfObj(record) { 10839 - if ("values" in Object) { 10840 - return Object.values(record); 10841 - } 10842 - const values = []; 10843 - for (const key in record) { 10844 - if (record.hasOwnProperty(key)) { 10845 - values.push(record[key]); 10846 - } 10847 - } 10848 - return values; 10849 - } 10850 - function find(record, predicate) { 10851 - const values = valuesOfObj(record); 10852 - if ("find" in values) { 10853 - return values.find(predicate); 10854 - } 10855 - const valuesNotNever = values; 10856 - for (let i = 0; i < valuesNotNever.length; i++) { 10857 - const value = valuesNotNever[i]; 10858 - if (predicate(value)) { 10859 - return value; 10860 - } 10861 - } 10862 - return void 0; 10863 - } 10864 - function forEach(record, run) { 10865 - Object.entries(record).forEach(([key, value]) => run(value, key)); 10866 - } 10867 - function includes(arr, value) { 10868 - return arr.indexOf(value) !== -1; 10869 - } 10870 - function findArr(record, predicate) { 10871 - for (let i = 0; i < record.length; i++) { 10872 - const value = record[i]; 10873 - if (predicate(value)) { 10874 - return value; 10875 - } 10876 - } 10877 - return void 0; 10878 - } 10879 - var CustomTransformerRegistry = class { 10880 - constructor() { 10881 - this.transfomers = {}; 10882 - } 10883 - register(transformer) { 10884 - this.transfomers[transformer.name] = transformer; 10885 - } 10886 - findApplicable(v2) { 10887 - return find(this.transfomers, (transformer) => transformer.isApplicable(v2)); 10888 - } 10889 - findByName(name) { 10890 - return this.transfomers[name]; 10891 - } 10892 - }; 10893 - var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1); 10894 - var isUndefined = (payload) => typeof payload === "undefined"; 10895 - var isNull = (payload) => payload === null; 10896 - var isPlainObject = (payload) => { 10897 - if (typeof payload !== "object" || payload === null) 10898 - return false; 10899 - if (payload === Object.prototype) 10900 - return false; 10901 - if (Object.getPrototypeOf(payload) === null) 10902 - return true; 10903 - return Object.getPrototypeOf(payload) === Object.prototype; 10904 - }; 10905 - var isEmptyObject = (payload) => isPlainObject(payload) && Object.keys(payload).length === 0; 10906 - var isArray = (payload) => Array.isArray(payload); 10907 - var isString = (payload) => typeof payload === "string"; 10908 - var isNumber = (payload) => typeof payload === "number" && !isNaN(payload); 10909 - var isBoolean = (payload) => typeof payload === "boolean"; 10910 - var isRegExp = (payload) => payload instanceof RegExp; 10911 - var isMap = (payload) => payload instanceof Map; 10912 - var isSet = (payload) => payload instanceof Set; 10913 - var isSymbol = (payload) => getType(payload) === "Symbol"; 10914 - var isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf()); 10915 - var isError = (payload) => payload instanceof Error; 10916 - var isNaNValue = (payload) => typeof payload === "number" && isNaN(payload); 10917 - var isPrimitive = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload); 10918 - var isBigint = (payload) => typeof payload === "bigint"; 10919 - var isInfinite = (payload) => payload === Infinity || payload === -Infinity; 10920 - var isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView); 10921 - var isURL = (payload) => payload instanceof URL; 10922 - var escapeKey = (key) => key.replace(/\./g, "\\."); 10923 - var stringifyPath = (path) => path.map(String).map(escapeKey).join("."); 10924 - var parsePath = (string) => { 10925 - const result = []; 10926 - let segment = ""; 10927 - for (let i = 0; i < string.length; i++) { 10928 - let char = string.charAt(i); 10929 - const isEscapedDot = char === "\\" && string.charAt(i + 1) === "."; 10930 - if (isEscapedDot) { 10931 - segment += "."; 10932 - i++; 10933 - continue; 10934 - } 10935 - const isEndOfSegment = char === "."; 10936 - if (isEndOfSegment) { 10937 - result.push(segment); 10938 - segment = ""; 10939 - continue; 10940 - } 10941 - segment += char; 10942 - } 10943 - const lastSegment = segment; 10944 - result.push(lastSegment); 10945 - return result; 10946 - }; 10947 - function simpleTransformation(isApplicable, annotation, transform, untransform) { 10948 - return { 10949 - isApplicable, 10950 - annotation, 10951 - transform, 10952 - untransform 10953 - }; 10954 - } 10955 - var simpleRules = [ 10956 - simpleTransformation(isUndefined, "undefined", () => null, () => void 0), 10957 - simpleTransformation(isBigint, "bigint", (v2) => v2.toString(), (v2) => { 10958 - if (typeof BigInt !== "undefined") { 10959 - return BigInt(v2); 10960 - } 10961 - return v2; 10962 - }), 10963 - simpleTransformation(isDate, "Date", (v2) => v2.toISOString(), (v2) => new Date(v2)), 10964 - simpleTransformation(isError, "Error", (v2, superJson) => { 10965 - const baseError = { 10966 - name: v2.name, 10967 - message: v2.message 10968 - }; 10969 - superJson.allowedErrorProps.forEach((prop) => { 10970 - baseError[prop] = v2[prop]; 10971 - }); 10972 - return baseError; 10973 - }, (v2, superJson) => { 10974 - const e = new Error(v2.message); 10975 - e.name = v2.name; 10976 - e.stack = v2.stack; 10977 - superJson.allowedErrorProps.forEach((prop) => { 10978 - e[prop] = v2[prop]; 10979 - }); 10980 - return e; 10981 - }), 10982 - simpleTransformation(isRegExp, "regexp", (v2) => "" + v2, (regex) => { 10983 - const body = regex.slice(1, regex.lastIndexOf("/")); 10984 - const flags = regex.slice(regex.lastIndexOf("/") + 1); 10985 - return new RegExp(body, flags); 10986 - }), 10987 - simpleTransformation( 10988 - isSet, 10989 - "set", 10990 - // (sets only exist in es6+) 10991 - // eslint-disable-next-line es5/no-es6-methods 10992 - (v2) => [...v2.values()], 10993 - (v2) => new Set(v2) 10994 - ), 10995 - simpleTransformation(isMap, "map", (v2) => [...v2.entries()], (v2) => new Map(v2)), 10996 - simpleTransformation((v2) => isNaNValue(v2) || isInfinite(v2), "number", (v2) => { 10997 - if (isNaNValue(v2)) { 10998 - return "NaN"; 10999 - } 11000 - if (v2 > 0) { 11001 - return "Infinity"; 11002 - } else { 11003 - return "-Infinity"; 11004 - } 11005 - }, Number), 11006 - simpleTransformation((v2) => v2 === 0 && 1 / v2 === -Infinity, "number", () => { 11007 - return "-0"; 11008 - }, Number), 11009 - simpleTransformation(isURL, "URL", (v2) => v2.toString(), (v2) => new URL(v2)) 11010 - ]; 11011 - function compositeTransformation(isApplicable, annotation, transform, untransform) { 11012 - return { 11013 - isApplicable, 11014 - annotation, 11015 - transform, 11016 - untransform 11017 - }; 11018 - } 11019 - var symbolRule = compositeTransformation((s, superJson) => { 11020 - if (isSymbol(s)) { 11021 - const isRegistered = !!superJson.symbolRegistry.getIdentifier(s); 11022 - return isRegistered; 11023 - } 11024 - return false; 11025 - }, (s, superJson) => { 11026 - const identifier = superJson.symbolRegistry.getIdentifier(s); 11027 - return ["symbol", identifier]; 11028 - }, (v2) => v2.description, (_, a, superJson) => { 11029 - const value = superJson.symbolRegistry.getValue(a[1]); 11030 - if (!value) { 11031 - throw new Error("Trying to deserialize unknown symbol"); 11032 - } 11033 - return value; 11034 - }); 11035 - var constructorToName = [ 11036 - Int8Array, 11037 - Uint8Array, 11038 - Int16Array, 11039 - Uint16Array, 11040 - Int32Array, 11041 - Uint32Array, 11042 - Float32Array, 11043 - Float64Array, 11044 - Uint8ClampedArray 11045 - ].reduce((obj, ctor) => { 11046 - obj[ctor.name] = ctor; 11047 - return obj; 11048 - }, {}); 11049 - var typedArrayRule = compositeTransformation(isTypedArray, (v2) => ["typed-array", v2.constructor.name], (v2) => [...v2], (v2, a) => { 11050 - const ctor = constructorToName[a[1]]; 11051 - if (!ctor) { 11052 - throw new Error("Trying to deserialize unknown typed array"); 11053 - } 11054 - return new ctor(v2); 11055 - }); 11056 - function isInstanceOfRegisteredClass(potentialClass, superJson) { 11057 - if (potentialClass == null ? void 0 : potentialClass.constructor) { 11058 - const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor); 11059 - return isRegistered; 11060 - } 11061 - return false; 11062 - } 11063 - var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => { 11064 - const identifier = superJson.classRegistry.getIdentifier(clazz.constructor); 11065 - return ["class", identifier]; 11066 - }, (clazz, superJson) => { 11067 - const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor); 11068 - if (!allowedProps) { 11069 - return { ...clazz }; 11070 - } 11071 - const result = {}; 11072 - allowedProps.forEach((prop) => { 11073 - result[prop] = clazz[prop]; 11074 - }); 11075 - return result; 11076 - }, (v2, a, superJson) => { 11077 - const clazz = superJson.classRegistry.getValue(a[1]); 11078 - if (!clazz) { 11079 - throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564"); 11080 - } 11081 - return Object.assign(Object.create(clazz.prototype), v2); 11082 - }); 11083 - var customRule = compositeTransformation((value, superJson) => { 11084 - return !!superJson.customTransformerRegistry.findApplicable(value); 11085 - }, (value, superJson) => { 11086 - const transformer = superJson.customTransformerRegistry.findApplicable(value); 11087 - return ["custom", transformer.name]; 11088 - }, (value, superJson) => { 11089 - const transformer = superJson.customTransformerRegistry.findApplicable(value); 11090 - return transformer.serialize(value); 11091 - }, (v2, a, superJson) => { 11092 - const transformer = superJson.customTransformerRegistry.findByName(a[1]); 11093 - if (!transformer) { 11094 - throw new Error("Trying to deserialize unknown custom value"); 11095 - } 11096 - return transformer.deserialize(v2); 11097 - }); 11098 - var compositeRules = [classRule, symbolRule, customRule, typedArrayRule]; 11099 - var transformValue = (value, superJson) => { 11100 - const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson)); 11101 - if (applicableCompositeRule) { 11102 - return { 11103 - value: applicableCompositeRule.transform(value, superJson), 11104 - type: applicableCompositeRule.annotation(value, superJson) 11105 - }; 11106 - } 11107 - const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson)); 11108 - if (applicableSimpleRule) { 11109 - return { 11110 - value: applicableSimpleRule.transform(value, superJson), 11111 - type: applicableSimpleRule.annotation 11112 - }; 11113 - } 11114 - return void 0; 11115 - }; 11116 - var simpleRulesByAnnotation = {}; 11117 - simpleRules.forEach((rule) => { 11118 - simpleRulesByAnnotation[rule.annotation] = rule; 11119 - }); 11120 - var untransformValue = (json2, type, superJson) => { 11121 - if (isArray(type)) { 11122 - switch (type[0]) { 11123 - case "symbol": 11124 - return symbolRule.untransform(json2, type, superJson); 11125 - case "class": 11126 - return classRule.untransform(json2, type, superJson); 11127 - case "custom": 11128 - return customRule.untransform(json2, type, superJson); 11129 - case "typed-array": 11130 - return typedArrayRule.untransform(json2, type, superJson); 11131 - default: 11132 - throw new Error("Unknown transformation: " + type); 11133 - } 11134 - } else { 11135 - const transformation = simpleRulesByAnnotation[type]; 11136 - if (!transformation) { 11137 - throw new Error("Unknown transformation: " + type); 11138 - } 11139 - return transformation.untransform(json2, superJson); 11140 - } 11141 - }; 11142 - var getNthKey = (value, n) => { 11143 - const keys = value.keys(); 11144 - while (n > 0) { 11145 - keys.next(); 11146 - n--; 11147 - } 11148 - return keys.next().value; 11149 - }; 11150 - function validatePath(path) { 11151 - if (includes(path, "__proto__")) { 11152 - throw new Error("__proto__ is not allowed as a property"); 11153 - } 11154 - if (includes(path, "prototype")) { 11155 - throw new Error("prototype is not allowed as a property"); 11156 - } 11157 - if (includes(path, "constructor")) { 11158 - throw new Error("constructor is not allowed as a property"); 11159 - } 11160 - } 11161 - var getDeep = (object, path) => { 11162 - validatePath(path); 11163 - for (let i = 0; i < path.length; i++) { 11164 - const key = path[i]; 11165 - if (isSet(object)) { 11166 - object = getNthKey(object, +key); 11167 - } else if (isMap(object)) { 11168 - const row = +key; 11169 - const type = +path[++i] === 0 ? "key" : "value"; 11170 - const keyOfRow = getNthKey(object, row); 11171 - switch (type) { 11172 - case "key": 11173 - object = keyOfRow; 11174 - break; 11175 - case "value": 11176 - object = object.get(keyOfRow); 11177 - break; 11178 - } 11179 - } else { 11180 - object = object[key]; 11181 - } 11182 - } 11183 - return object; 11184 - }; 11185 - var setDeep = (object, path, mapper) => { 11186 - validatePath(path); 11187 - if (path.length === 0) { 11188 - return mapper(object); 11189 - } 11190 - let parent = object; 11191 - for (let i = 0; i < path.length - 1; i++) { 11192 - const key = path[i]; 11193 - if (isArray(parent)) { 11194 - const index2 = +key; 11195 - parent = parent[index2]; 11196 - } else if (isPlainObject(parent)) { 11197 - parent = parent[key]; 11198 - } else if (isSet(parent)) { 11199 - const row = +key; 11200 - parent = getNthKey(parent, row); 11201 - } else if (isMap(parent)) { 11202 - const isEnd = i === path.length - 2; 11203 - if (isEnd) { 11204 - break; 11205 - } 11206 - const row = +key; 11207 - const type = +path[++i] === 0 ? "key" : "value"; 11208 - const keyOfRow = getNthKey(parent, row); 11209 - switch (type) { 11210 - case "key": 11211 - parent = keyOfRow; 11212 - break; 11213 - case "value": 11214 - parent = parent.get(keyOfRow); 11215 - break; 11216 - } 11217 - } 11218 - } 11219 - const lastKey = path[path.length - 1]; 11220 - if (isArray(parent)) { 11221 - parent[+lastKey] = mapper(parent[+lastKey]); 11222 - } else if (isPlainObject(parent)) { 11223 - parent[lastKey] = mapper(parent[lastKey]); 11224 - } 11225 - if (isSet(parent)) { 11226 - const oldValue = getNthKey(parent, +lastKey); 11227 - const newValue = mapper(oldValue); 11228 - if (oldValue !== newValue) { 11229 - parent.delete(oldValue); 11230 - parent.add(newValue); 11231 - } 11232 - } 11233 - if (isMap(parent)) { 11234 - const row = +path[path.length - 2]; 11235 - const keyToRow = getNthKey(parent, row); 11236 - const type = +lastKey === 0 ? "key" : "value"; 11237 - switch (type) { 11238 - case "key": { 11239 - const newKey = mapper(keyToRow); 11240 - parent.set(newKey, parent.get(keyToRow)); 11241 - if (newKey !== keyToRow) { 11242 - parent.delete(keyToRow); 11243 - } 11244 - break; 11245 - } 11246 - case "value": { 11247 - parent.set(keyToRow, mapper(parent.get(keyToRow))); 11248 - break; 11249 - } 11250 - } 11251 - } 11252 - return object; 11253 - }; 11254 - function traverse(tree, walker2, origin = []) { 11255 - if (!tree) { 11256 - return; 11257 - } 11258 - if (!isArray(tree)) { 11259 - forEach(tree, (subtree, key) => traverse(subtree, walker2, [...origin, ...parsePath(key)])); 11260 - return; 11261 - } 11262 - const [nodeValue, children2] = tree; 11263 - if (children2) { 11264 - forEach(children2, (child, key) => { 11265 - traverse(child, walker2, [...origin, ...parsePath(key)]); 11266 - }); 11267 - } 11268 - walker2(nodeValue, origin); 11269 - } 11270 - function applyValueAnnotations(plain, annotations, superJson) { 11271 - traverse(annotations, (type, path) => { 11272 - plain = setDeep(plain, path, (v2) => untransformValue(v2, type, superJson)); 11273 - }); 11274 - return plain; 11275 - } 11276 - function applyReferentialEqualityAnnotations(plain, annotations) { 11277 - function apply(identicalPaths, path) { 11278 - const object = getDeep(plain, parsePath(path)); 11279 - identicalPaths.map(parsePath).forEach((identicalObjectPath) => { 11280 - plain = setDeep(plain, identicalObjectPath, () => object); 11281 - }); 11282 - } 11283 - if (isArray(annotations)) { 11284 - const [root, other] = annotations; 11285 - root.forEach((identicalPath) => { 11286 - plain = setDeep(plain, parsePath(identicalPath), () => plain); 11287 - }); 11288 - if (other) { 11289 - forEach(other, apply); 11290 - } 11291 - } else { 11292 - forEach(annotations, apply); 11293 - } 11294 - return plain; 11295 - } 11296 - var isDeep = (object, superJson) => isPlainObject(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson); 11297 - function addIdentity(object, path, identities) { 11298 - const existingSet = identities.get(object); 11299 - if (existingSet) { 11300 - existingSet.push(path); 11301 - } else { 11302 - identities.set(object, [path]); 11303 - } 11304 - } 11305 - function generateReferentialEqualityAnnotations(identitites, dedupe) { 11306 - const result = {}; 11307 - let rootEqualityPaths = void 0; 11308 - identitites.forEach((paths) => { 11309 - if (paths.length <= 1) { 11310 - return; 11311 - } 11312 - if (!dedupe) { 11313 - paths = paths.map((path) => path.map(String)).sort((a, b) => a.length - b.length); 11314 - } 11315 - const [representativePath, ...identicalPaths] = paths; 11316 - if (representativePath.length === 0) { 11317 - rootEqualityPaths = identicalPaths.map(stringifyPath); 11318 - } else { 11319 - result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath); 11320 - } 11321 - }); 11322 - if (rootEqualityPaths) { 11323 - if (isEmptyObject(result)) { 11324 - return [rootEqualityPaths]; 11325 - } else { 11326 - return [rootEqualityPaths, result]; 11327 - } 11328 - } else { 11329 - return isEmptyObject(result) ? void 0 : result; 11330 - } 11331 - } 11332 - var walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => { 11333 - const primitive = isPrimitive(object); 11334 - if (!primitive) { 11335 - addIdentity(object, path, identities); 11336 - const seen = seenObjects.get(object); 11337 - if (seen) { 11338 - return dedupe ? { 11339 - transformedValue: null 11340 - } : seen; 11341 - } 11342 - } 11343 - if (!isDeep(object, superJson)) { 11344 - const transformed2 = transformValue(object, superJson); 11345 - const result2 = transformed2 ? { 11346 - transformedValue: transformed2.value, 11347 - annotations: [transformed2.type] 11348 - } : { 11349 - transformedValue: object 11350 - }; 11351 - if (!primitive) { 11352 - seenObjects.set(object, result2); 11353 - } 11354 - return result2; 11355 - } 11356 - if (includes(objectsInThisPath, object)) { 11357 - return { 11358 - transformedValue: null 11359 - }; 11360 - } 11361 - const transformationResult = transformValue(object, superJson); 11362 - const transformed = (transformationResult == null ? void 0 : transformationResult.value) ?? object; 11363 - const transformedValue = isArray(transformed) ? [] : {}; 11364 - const innerAnnotations = {}; 11365 - forEach(transformed, (value, index2) => { 11366 - if (index2 === "__proto__" || index2 === "constructor" || index2 === "prototype") { 11367 - throw new Error(`Detected property ${index2}. This is a prototype pollution risk, please remove it from your object.`); 11368 - } 11369 - const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index2], [...objectsInThisPath, object], seenObjects); 11370 - transformedValue[index2] = recursiveResult.transformedValue; 11371 - if (isArray(recursiveResult.annotations)) { 11372 - innerAnnotations[index2] = recursiveResult.annotations; 11373 - } else if (isPlainObject(recursiveResult.annotations)) { 11374 - forEach(recursiveResult.annotations, (tree, key) => { 11375 - innerAnnotations[escapeKey(index2) + "." + key] = tree; 11376 - }); 11377 - } 11378 - }); 11379 - const result = isEmptyObject(innerAnnotations) ? { 11380 - transformedValue, 11381 - annotations: !!transformationResult ? [transformationResult.type] : void 0 11382 - } : { 11383 - transformedValue, 11384 - annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations 11385 - }; 11386 - if (!primitive) { 11387 - seenObjects.set(object, result); 11388 - } 11389 - return result; 11390 - }; 11391 - function getType2(payload) { 11392 - return Object.prototype.toString.call(payload).slice(8, -1); 11393 - } 11394 - function isArray2(payload) { 11395 - return getType2(payload) === "Array"; 11396 - } 11397 - function isPlainObject2(payload) { 11398 - if (getType2(payload) !== "Object") 11399 - return false; 11400 - const prototype = Object.getPrototypeOf(payload); 11401 - return !!prototype && prototype.constructor === Object && prototype === Object.prototype; 11402 - } 11403 - function assignProp2(carry, key, newVal, originalObject, includeNonenumerable) { 11404 - const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable"; 11405 - if (propType === "enumerable") 11406 - carry[key] = newVal; 11407 - if (includeNonenumerable && propType === "nonenumerable") { 11408 - Object.defineProperty(carry, key, { 11409 - value: newVal, 11410 - enumerable: false, 11411 - writable: true, 11412 - configurable: true 11413 - }); 11414 - } 11415 - } 11416 - function copy(target, options = {}) { 11417 - if (isArray2(target)) { 11418 - return target.map((item) => copy(item, options)); 11419 - } 11420 - if (!isPlainObject2(target)) { 11421 - return target; 11422 - } 11423 - const props = Object.getOwnPropertyNames(target); 11424 - const symbols = Object.getOwnPropertySymbols(target); 11425 - return [...props, ...symbols].reduce((carry, key) => { 11426 - if (isArray2(options.props) && !options.props.includes(key)) { 11427 - return carry; 11428 - } 11429 - const val = target[key]; 11430 - const newVal = copy(val, options); 11431 - assignProp2(carry, key, newVal, target, options.nonenumerable); 11432 - return carry; 11433 - }, {}); 11434 - } 11435 - var SuperJSON = class { 11436 - /** 11437 - * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`. 11438 - */ 11439 - constructor({ dedupe = false } = {}) { 11440 - this.classRegistry = new ClassRegistry(); 11441 - this.symbolRegistry = new Registry((s) => s.description ?? ""); 11442 - this.customTransformerRegistry = new CustomTransformerRegistry(); 11443 - this.allowedErrorProps = []; 11444 - this.dedupe = dedupe; 11445 - } 11446 - serialize(object) { 11447 - const identities = /* @__PURE__ */ new Map(); 11448 - const output = walker(object, identities, this, this.dedupe); 11449 - const res = { 11450 - json: output.transformedValue 11451 - }; 11452 - if (output.annotations) { 11453 - res.meta = { 11454 - ...res.meta, 11455 - values: output.annotations 11456 - }; 11457 - } 11458 - const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe); 11459 - if (equalityAnnotations) { 11460 - res.meta = { 11461 - ...res.meta, 11462 - referentialEqualities: equalityAnnotations 11463 - }; 11464 - } 11465 - return res; 11466 - } 11467 - deserialize(payload) { 11468 - const { json: json2, meta } = payload; 11469 - let result = copy(json2); 11470 - if (meta == null ? void 0 : meta.values) { 11471 - result = applyValueAnnotations(result, meta.values, this); 11472 - } 11473 - if (meta == null ? void 0 : meta.referentialEqualities) { 11474 - result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities); 11475 - } 11476 - return result; 11477 - } 11478 - stringify(object) { 11479 - return JSON.stringify(this.serialize(object)); 11480 - } 11481 - parse(string) { 11482 - return this.deserialize(JSON.parse(string)); 11483 - } 11484 - registerClass(v2, options) { 11485 - this.classRegistry.register(v2, options); 11486 - } 11487 - registerSymbol(v2, identifier) { 11488 - this.symbolRegistry.register(v2, identifier); 11489 - } 11490 - registerCustom(transformer, name) { 11491 - this.customTransformerRegistry.register({ 11492 - name, 11493 - ...transformer 11494 - }); 11495 - } 11496 - allowErrorProps(...props) { 11497 - this.allowedErrorProps.push(...props); 11498 - } 11499 - }; 11500 - SuperJSON.defaultInstance = new SuperJSON(); 11501 - SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance); 11502 - SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance); 11503 - SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance); 11504 - SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance); 11505 - SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance); 11506 - SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance); 11507 - SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance); 11508 - SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance); 11509 - var serialize = SuperJSON.serialize; 11510 - var stringify = SuperJSON.stringify; 11511 - function getQueryStatusLabel(query) { 11512 - return query.state.fetchStatus === "fetching" ? "fetching" : !query.getObserversCount() ? "inactive" : query.state.fetchStatus === "paused" ? "paused" : query.isStale() ? "stale" : "fresh"; 11513 - } 11514 - function getSidedProp(prop, side) { 11515 - return `${prop}${side.charAt(0).toUpperCase() + side.slice(1)}`; 11516 - } 11517 - function getQueryStatusColor({ 11518 - queryState, 11519 - observerCount, 11520 - isStale 11521 - }) { 11522 - return queryState.fetchStatus === "fetching" ? "blue" : !observerCount ? "gray" : queryState.fetchStatus === "paused" ? "purple" : isStale ? "yellow" : "green"; 11523 - } 11524 - function getMutationStatusColor({ 11525 - status, 11526 - isPaused 11527 - }) { 11528 - return isPaused ? "purple" : status === "error" ? "red" : status === "pending" ? "yellow" : status === "success" ? "green" : "gray"; 11529 - } 11530 - function getQueryStatusColorByLabel(label) { 11531 - return label === "fresh" ? "green" : label === "stale" ? "yellow" : label === "paused" ? "purple" : label === "inactive" ? "gray" : "blue"; 11532 - } 11533 - var displayValue = (value, beautify = false) => { 11534 - const { 11535 - json: json2 11536 - } = serialize(value); 11537 - return JSON.stringify(json2, null, beautify ? 2 : void 0); 11538 - }; 11539 - var getStatusRank = (q) => q.state.fetchStatus !== "idle" ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1; 11540 - var queryHashSort = (a, b) => a.queryHash.localeCompare(b.queryHash); 11541 - var dateSort = (a, b) => a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1; 11542 - var statusAndDateSort = (a, b) => { 11543 - if (getStatusRank(a) === getStatusRank(b)) { 11544 - return dateSort(a, b); 11545 - } 11546 - return getStatusRank(a) > getStatusRank(b) ? 1 : -1; 11547 - }; 11548 - var sortFns = { 11549 - status: statusAndDateSort, 11550 - "query hash": queryHashSort, 11551 - "last updated": dateSort 11552 - }; 11553 - var getMutationStatusRank = (m) => m.state.isPaused ? 0 : m.state.status === "error" ? 2 : m.state.status === "pending" ? 1 : 3; 11554 - var mutationDateSort = (a, b) => a.state.submittedAt < b.state.submittedAt ? 1 : -1; 11555 - var mutationStatusSort = (a, b) => { 11556 - if (getMutationStatusRank(a) === getMutationStatusRank(b)) { 11557 - return mutationDateSort(a, b); 11558 - } 11559 - return getMutationStatusRank(a) > getMutationStatusRank(b) ? 1 : -1; 11560 - }; 11561 - var mutationSortFns = { 11562 - status: mutationStatusSort, 11563 - "last updated": mutationDateSort 11564 - }; 11565 - var convertRemToPixels = (rem) => { 11566 - return rem * parseFloat(getComputedStyle(document.documentElement).fontSize); 11567 - }; 11568 - var getPreferredColorScheme = () => { 11569 - const [colorScheme, setColorScheme] = createSignal$1("dark"); 11570 - onMount(() => { 11571 - const query = window.matchMedia("(prefers-color-scheme: dark)"); 11572 - setColorScheme(query.matches ? "dark" : "light"); 11573 - const listener = (e) => { 11574 - setColorScheme(e.matches ? "dark" : "light"); 11575 - }; 11576 - query.addEventListener("change", listener); 11577 - onCleanup(() => query.removeEventListener("change", listener)); 11578 - }); 11579 - return colorScheme; 11580 - }; 11581 - var updateNestedDataByPath = (oldData, updatePath, value) => { 11582 - if (updatePath.length === 0) { 11583 - return value; 11584 - } 11585 - if (oldData instanceof Map) { 11586 - const newData = new Map(oldData); 11587 - if (updatePath.length === 1) { 11588 - newData.set(updatePath[0], value); 11589 - return newData; 11590 - } 11591 - const [head, ...tail] = updatePath; 11592 - newData.set(head, updateNestedDataByPath(newData.get(head), tail, value)); 11593 - return newData; 11594 - } 11595 - if (oldData instanceof Set) { 11596 - const setAsArray = updateNestedDataByPath(Array.from(oldData), updatePath, value); 11597 - return new Set(setAsArray); 11598 - } 11599 - if (Array.isArray(oldData)) { 11600 - const newData = [...oldData]; 11601 - if (updatePath.length === 1) { 11602 - newData[updatePath[0]] = value; 11603 - return newData; 11604 - } 11605 - const [head, ...tail] = updatePath; 11606 - newData[head] = updateNestedDataByPath(newData[head], tail, value); 11607 - return newData; 11608 - } 11609 - if (oldData instanceof Object) { 11610 - const newData = { 11611 - ...oldData 11612 - }; 11613 - if (updatePath.length === 1) { 11614 - newData[updatePath[0]] = value; 11615 - return newData; 11616 - } 11617 - const [head, ...tail] = updatePath; 11618 - newData[head] = updateNestedDataByPath(newData[head], tail, value); 11619 - return newData; 11620 - } 11621 - return oldData; 11622 - }; 11623 - var deleteNestedDataByPath = (oldData, deletePath) => { 11624 - if (oldData instanceof Map) { 11625 - const newData = new Map(oldData); 11626 - if (deletePath.length === 1) { 11627 - newData.delete(deletePath[0]); 11628 - return newData; 11629 - } 11630 - const [head, ...tail] = deletePath; 11631 - newData.set(head, deleteNestedDataByPath(newData.get(head), tail)); 11632 - return newData; 11633 - } 11634 - if (oldData instanceof Set) { 11635 - const setAsArray = deleteNestedDataByPath(Array.from(oldData), deletePath); 11636 - return new Set(setAsArray); 11637 - } 11638 - if (Array.isArray(oldData)) { 11639 - const newData = [...oldData]; 11640 - if (deletePath.length === 1) { 11641 - return newData.filter((_, idx) => idx.toString() !== deletePath[0]); 11642 - } 11643 - const [head, ...tail] = deletePath; 11644 - newData[head] = deleteNestedDataByPath(newData[head], tail); 11645 - return newData; 11646 - } 11647 - if (oldData instanceof Object) { 11648 - const newData = { 11649 - ...oldData 11650 - }; 11651 - if (deletePath.length === 1) { 11652 - delete newData[deletePath[0]]; 11653 - return newData; 11654 - } 11655 - const [head, ...tail] = deletePath; 11656 - newData[head] = deleteNestedDataByPath(newData[head], tail); 11657 - return newData; 11658 - } 11659 - return oldData; 11660 - }; 11661 - var ReactQueryDevtools2 = function() { 11662 - return null; 11663 - } ; 11664 - var R = ((a) => (a[a.AggregateError = 1] = "AggregateError", a[a.ArrowFunction = 2] = "ArrowFunction", a[a.ErrorPrototypeStack = 4] = "ErrorPrototypeStack", a[a.ObjectAssign = 8] = "ObjectAssign", a[a.BigIntTypedArray = 16] = "BigIntTypedArray", a))(R || {}); 11665 - var T = "__SEROVAL_REFS__"; 11666 - var O = /* @__PURE__ */ new Map(); 11667 - typeof globalThis != "undefined" ? Object.defineProperty(globalThis, T, { value: O, configurable: true, writable: false, enumerable: false }) : typeof self != "undefined" ? Object.defineProperty(self, T, { value: O, configurable: true, writable: false, enumerable: false }) : typeof global != "undefined" && Object.defineProperty(global, T, { value: O, configurable: true, writable: false, enumerable: false }); 11668 - R.AggregateError | R.BigIntTypedArray; 11669 - const TanStackRouterDevtools = function() { 11670 - return null; 11671 - } ; 11672 - function Header() { 11673 - return /* @__PURE__ */ jsx("header", { className: "p-2 flex gap-2 bg-white text-black justify-between", children: /* @__PURE__ */ jsxs("nav", { className: "flex flex-row", children: [ 11674 - /* @__PURE__ */ jsx("div", { className: "px-2", children: /* @__PURE__ */ jsx(Link, { to: "/", activeProps: { className: "font-bold" }, children: "Home" }) }), 11675 - /* @__PURE__ */ jsx("div", { className: "px-2", children: /* @__PURE__ */ jsx(Link, { to: "/basic", activeProps: { className: "font-bold" }, children: "Basic Example" }) }), 11676 - /* @__PURE__ */ jsx("div", { className: "px-2", children: /* @__PURE__ */ jsx(Link, { to: "/suspense", activeProps: { className: "font-bold" }, children: "Suspense Example" }) }), 11677 - /* @__PURE__ */ jsx("div", { className: "px-2", children: /* @__PURE__ */ jsx(Link, { to: "/preloading", activeProps: { className: "font-bold" }, children: "Preloading Example" }) }), 11678 - /* @__PURE__ */ jsx("div", { className: "px-2", children: /* @__PURE__ */ jsx( 11679 - Link, 11680 - { 11681 - to: "/intent-preloading", 11682 - preload: "intent", 11683 - activeProps: { className: "font-bold" }, 11684 - children: "Intent Preloading Example" 11685 - } 11686 - ) }), 11687 - /* @__PURE__ */ jsx("div", { className: "px-2", children: /* @__PURE__ */ jsx(Link, { to: "/pagination", activeProps: { className: "font-bold" }, children: "Pagination Example" }) }) 11688 - ] }) }); 11689 - } 11690 - const appCss = "/assets/global-B8kMkExK.css"; 11691 - const Route$6 = createRootRouteWithContext()({ 11692 - head: () => ({ 11693 - meta: [ 11694 - { 11695 - charSet: "utf-8" 11696 - }, 11697 - { 11698 - name: "viewport", 11699 - content: "width=device-width, initial-scale=1" 11700 - }, 11701 - { 11702 - title: "fizzbuzz" 11703 - } 11704 - ], 11705 - links: [ 11706 - { rel: "icon", href: "/favicon.ico" }, 11707 - { rel: "stylesheet", href: appCss } 11708 - ] 11709 - }), 11710 - component: RootComponent 11711 - }); 11712 - function RootComponent() { 11713 - return /* @__PURE__ */ jsx(RootDocument, { children: /* @__PURE__ */ jsx(Outlet, {}) }); 11714 - } 11715 - function RootDocument(props) { 11716 - return /* @__PURE__ */ jsxs("html", { lang: "en", children: [ 11717 - /* @__PURE__ */ jsx("head", { children: /* @__PURE__ */ jsx(HeadContent, {}) }), 11718 - /* @__PURE__ */ jsxs("body", { children: [ 11719 - /* @__PURE__ */ jsx(Header, {}), 11720 - props.children, 11721 - /* @__PURE__ */ jsx(TanStackRouterDevtools, {}), 11722 - /* @__PURE__ */ jsx(ReactQueryDevtools2, { buttonPosition: "bottom-right" }), 11723 - /* @__PURE__ */ jsx(Scripts, {}) 11724 - ] }) 11725 - ] }); 11726 - } 11727 - function sanitizeBase(base) { 11728 - return base.replace(/^\/|\/$/g, ""); 11729 - } 11730 - const createServerRpc = (functionId, serverBase, splitImportFn) => { 11731 - invariant( 11732 - splitImportFn); 11733 - const url = `/${sanitizeBase(serverBase)}/${functionId}`; 11734 - return Object.assign(splitImportFn, { 11735 - url, 11736 - functionId 11737 - }); 11738 - }; 11739 - const env = createEnv({ 11740 - server: { 11741 - DB_NAME: v.string() 11742 - }, 11743 - runtimeEnv: process.env 11744 - }); 11745 - const pokemon = sqliteTable("pokemon", { 11746 - id: integer("id").primaryKey(), 11747 - name: text("name").notNull(), 11748 - dexId: integer("dex_id").notNull() 11749 - }); 11750 - const pokemonRelations = relations(pokemon, ({ many }) => ({ 11751 - types: many(pokemonTypes) 11752 - })); 11753 - const types = sqliteTable("types", { 11754 - id: integer("id").primaryKey(), 11755 - name: text("name").notNull() 11756 - }); 11757 - const typesRelations = relations(types, ({ many }) => ({ 11758 - pokemon: many(pokemonTypes) 11759 - })); 11760 - const pokemonTypes = sqliteTable( 11761 - "pokemon_types", 11762 - { 11763 - id: integer("id").primaryKey(), 11764 - pokemonId: integer("pokemon_id").notNull().references(() => pokemon.id), 11765 - typeId: integer("type_id").notNull().references(() => types.id) 11766 - }, 11767 - (table) => [ 11768 - index("idx_pt_pokemon").on(table.pokemonId), 11769 - index("idx_pt_type").on(table.typeId) 11770 - ] 11771 - ); 11772 - const pokemonTypesRelations = relations(pokemonTypes, ({ one }) => ({ 11773 - pokemon: one(pokemon, { 11774 - fields: [pokemonTypes.pokemonId], 11775 - references: [pokemon.id] 11776 - }), 11777 - type: one(types, { 11778 - fields: [pokemonTypes.typeId], 11779 - references: [types.id] 11780 - }) 11781 - })); 11782 - const schema = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 11783 - __proto__: null, 11784 - pokemon, 11785 - pokemonRelations, 11786 - pokemonTypes, 11787 - pokemonTypesRelations, 11788 - types, 11789 - typesRelations 11790 - }, Symbol.toStringTag, { value: "Module" })); 11791 - const db = drizzle(env.DB_NAME, { schema }); 11792 - const preparedGetPokemonAtOffset = db.query.pokemon.findMany({ 11793 - columns: { 11794 - id: true, 11795 - name: true, 11796 - dexId: true 11797 - }, 11798 - orderBy: (pokemon2, { asc }) => [asc(pokemon2.dexId)], 11799 - limit: sql.placeholder("limit"), 11800 - offset: sql.placeholder("offset"), 11801 - with: { 11802 - types: { 11803 - orderBy: (types2, { asc }) => [asc(types2.typeId)], 11804 - columns: {}, 11805 - with: { 11806 - type: { 11807 - columns: { 11808 - name: true 11809 - } 11810 - } 11811 - } 11812 - } 11813 - } 11814 - }).prepare(); 11815 - const DB = { 11816 - queries: { 11817 - getPokemonAtOffset: async (offset, limit) => { 11818 - return preparedGetPokemonAtOffset.execute({ 11819 - limit, 11820 - offset 11821 - }); 11822 - } 11823 - } 11824 - }; 11825 - const POKEMON_LIMIT$3 = 25; 11826 - const PokemonListParamsSchema = v.object({ 11827 - offset: v.optional(v.number()) 11828 - }); 11829 - const innerGetPokemonList = async (offset) => { 11830 - const pokemon2 = await DB.queries.getPokemonAtOffset(offset, POKEMON_LIMIT$3 + 1); 11831 - const hasMore = pokemon2.length > POKEMON_LIMIT$3; 11832 - const results = hasMore ? pokemon2.slice(0, -1) : pokemon2; 11833 - console.log("results", results); 11834 - return { 11835 - pokemon: results, 11836 - nextOffset: hasMore ? offset + POKEMON_LIMIT$3 : null, 11837 - prevOffset: offset > 0 ? Math.max(0, offset - POKEMON_LIMIT$3) : null 11838 - }; 11839 - }; 11840 - const getServerPokemonList_createServerFn_handler = createServerRpc("src_util_pokemon_ts--getServerPokemonList_createServerFn_handler", "/_serverFn", (opts, signal) => { 11841 - return getServerPokemonList.__executeServer(opts, signal); 11842 - }); 11843 - const getServerPokemonList = createServerFn({ 11844 - method: "GET" 11845 - }).validator((params) => { 11846 - const validated = v.parse(PokemonListParamsSchema, params); 11847 - const offset = validated.offset ?? 0; 11848 - if (offset < 0) throw new Error("Offset must be greater than or equal to 0"); 11849 - return { 11850 - offset 11851 - }; 11852 - }).handler(getServerPokemonList_createServerFn_handler, async ({ 11853 - data 11854 - }) => { 11855 - return await innerGetPokemonList(data.offset); 11856 - }); 11857 - const $$splitErrorComponentImporter$3 = () => import('./suspense-CDby3_eA.mjs'); 11858 - const $$splitNotFoundComponentImporter$3 = () => import('./suspense-eUhkQotn.mjs'); 11859 - const $$splitComponentImporter$5 = () => import('./suspense-wbT_yPoJ.mjs'); 11860 - const searchParamsSchema$4 = v.object({ 11861 - offset: v.optional(v.number(), 0) 11862 - }); 11863 - const Route$5 = createFileRoute({ 11864 - validateSearch: searchParamsSchema$4, 11865 - component: lazyRouteComponent($$splitComponentImporter$5, "component", () => Route$5.ssr), 11866 - notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter$3, "notFoundComponent"), 11867 - errorComponent: lazyRouteComponent($$splitErrorComponentImporter$3, "errorComponent"), 11868 - pendingComponent: LoadingComponent$3 11869 - }); 11870 - function LoadingComponent$3() { 11871 - return /* @__PURE__ */ jsx("div", { children: "Loading..." }); 11872 - } 11873 - const $$splitErrorComponentImporter$2 = () => import('./preloading-CDby3_eA.mjs'); 11874 - const $$splitNotFoundComponentImporter$2 = () => import('./preloading-eUhkQotn.mjs'); 11875 - const $$splitComponentImporter$4 = () => import('./preloading-D-Pu2kHV.mjs'); 11876 - const POKEMON_LIMIT$2 = 20; 11877 - const searchParamsSchema$3 = v.object({ 11878 - offset: v.optional(v.number(), 0) 11879 - }); 11880 - const Route$4 = createFileRoute({ 11881 - validateSearch: searchParamsSchema$3, 11882 - loaderDeps: ({ 11883 - search 11884 - }) => ({ 11885 - offset: search.offset 11886 - }), 11887 - context: ({ 11888 - deps 11889 - }) => { 11890 - const newKey = ["pokemon-list", "preloading", { 11891 - limit: POKEMON_LIMIT$2, 11892 - offset: deps.offset 11893 - }]; 11894 - const pokemonListOptions = queryOptions({ 11895 - queryKey: newKey, 11896 - queryFn: async () => { 11897 - const result = await getServerPokemonList({ 11898 - data: { 11899 - offset: deps.offset 11900 - } 11901 - }); 11902 - return { 11903 - results: result.pokemon.map((p) => ({ 11904 - name: p.name, 11905 - url: `/api/v2/pokemon/${p.id}/` 11906 - })), 11907 - next: result.nextOffset !== null ? `/api/v2/pokemon/?offset=${result.nextOffset}` : null, 11908 - previous: result.prevOffset !== null ? `/api/v2/pokemon/?offset=${result.prevOffset}` : null 11909 - }; 11910 - } 11911 - }); 11912 - return { 11913 - pokemonListOptions 11914 - }; 11915 - }, 11916 - loader: ({ 11917 - context 11918 - }) => { 11919 - context.queryClient.prefetchQuery(context.pokemonListOptions); 11920 - }, 11921 - component: lazyRouteComponent($$splitComponentImporter$4, "component", () => Route$4.ssr), 11922 - notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter$2, "notFoundComponent"), 11923 - errorComponent: lazyRouteComponent($$splitErrorComponentImporter$2, "errorComponent"), 11924 - pendingComponent: LoadingComponent$2 11925 - }); 11926 - function LoadingComponent$2() { 11927 - return /* @__PURE__ */ jsx("div", { children: "Loading..." }); 11928 - } 11929 - const $$splitErrorComponentImporter$1 = () => import('./pagination-CDby3_eA.mjs'); 11930 - const $$splitNotFoundComponentImporter$1 = () => import('./pagination-eUhkQotn.mjs'); 11931 - const $$splitComponentImporter$3 = () => import('./pagination-Cw9fMujH.mjs'); 11932 - const POKEMON_LIMIT$1 = 20; 11933 - const searchParamsSchema$2 = v.object({ 11934 - offset: v.optional(v.number(), 0) 11935 - }); 11936 - const Route$3 = createFileRoute({ 11937 - validateSearch: searchParamsSchema$2, 11938 - loaderDeps: ({ 11939 - search 11940 - }) => ({ 11941 - offset: search.offset 11942 - }), 11943 - context: ({ 11944 - deps 11945 - }) => { 11946 - const newKey = ["pokemon-list", "pagination", { 11947 - limit: POKEMON_LIMIT$1, 11948 - offset: deps.offset 11949 - }]; 11950 - const pokemonListOptions = queryOptions({ 11951 - queryKey: newKey, 11952 - queryFn: async ({ 11953 - queryKey 11954 - }) => { 11955 - const result = await getServerPokemonList({ 11956 - data: { 11957 - offset: queryKey[2].offset 11958 - } 11959 - }); 11960 - return result.pokemon; 11961 - } 11962 - }); 11963 - return { 11964 - pokemonListOptions 11965 - }; 11966 - }, 11967 - loader: ({ 11968 - context 11969 - }) => { 11970 - context.queryClient.prefetchQuery(context.pokemonListOptions); 11971 - }, 11972 - component: lazyRouteComponent($$splitComponentImporter$3, "component", () => Route$3.ssr), 11973 - notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter$1, "notFoundComponent"), 11974 - errorComponent: lazyRouteComponent($$splitErrorComponentImporter$1, "errorComponent"), 11975 - pendingComponent: LoadingComponent$1 11976 - }); 11977 - function LoadingComponent$1() { 11978 - return /* @__PURE__ */ jsx("div", { children: "Loading..." }); 11979 - } 11980 - const $$splitErrorComponentImporter = () => import('./intent-preloading-CDby3_eA.mjs'); 11981 - const $$splitNotFoundComponentImporter = () => import('./intent-preloading-eUhkQotn.mjs'); 11982 - const $$splitComponentImporter$2 = () => import('./intent-preloading-BGRNd4ca.mjs'); 11983 - const POKEMON_LIMIT = 20; 11984 - const searchParamsSchema$1 = v.object({ 11985 - offset: v.optional(v.number(), 0) 11986 - }); 11987 - const Route$2 = createFileRoute({ 11988 - validateSearch: searchParamsSchema$1, 11989 - loaderDeps: ({ 11990 - search 11991 - }) => ({ 11992 - offset: search.offset 11993 - }), 11994 - context: ({ 11995 - deps 11996 - }) => { 11997 - const newKey = ["pokemon-list", "intent-preloading", { 11998 - limit: POKEMON_LIMIT, 11999 - offset: deps.offset 12000 - }]; 12001 - const pokemonListOptions = queryOptions({ 12002 - queryKey: newKey, 12003 - queryFn: async () => { 12004 - const result = await getServerPokemonList({ 12005 - data: { 12006 - offset: deps.offset 12007 - } 12008 - }); 12009 - return { 12010 - results: result.pokemon.map((p) => ({ 12011 - name: p.name, 12012 - url: `/api/v2/pokemon/${p.id}/` 12013 - })), 12014 - next: result.nextOffset !== null ? `/api/v2/pokemon/?offset=${result.nextOffset}` : null, 12015 - previous: result.prevOffset !== null ? `/api/v2/pokemon/?offset=${result.prevOffset}` : null 12016 - }; 12017 - } 12018 - }); 12019 - return { 12020 - pokemonListOptions 12021 - }; 12022 - }, 12023 - loader: ({ 12024 - context 12025 - }) => { 12026 - context.queryClient.prefetchQuery(context.pokemonListOptions); 12027 - }, 12028 - component: lazyRouteComponent($$splitComponentImporter$2, "component", () => Route$2.ssr), 12029 - notFoundComponent: lazyRouteComponent($$splitNotFoundComponentImporter, "notFoundComponent"), 12030 - errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"), 12031 - pendingComponent: LoadingComponent 12032 - }); 12033 - function LoadingComponent() { 12034 - return /* @__PURE__ */ jsx("div", { children: "Loading..." }); 12035 - } 12036 - const $$splitComponentImporter$1 = () => import('./basic-D2SeuWcm.mjs'); 12037 - const searchParamsSchema = v.object({ 12038 - offset: v.optional(v.number(), 0) 12039 - }); 12040 - const Route$1 = createFileRoute({ 12041 - validateSearch: searchParamsSchema, 12042 - component: lazyRouteComponent($$splitComponentImporter$1, "component", () => Route$1.ssr) 12043 - }); 12044 - const $$splitComponentImporter = () => import('./index-DR_wIx-E.mjs'); 12045 - const Route2 = createFileRoute({ 12046 - component: lazyRouteComponent($$splitComponentImporter, "component", () => Route2.ssr) 12047 - }); 12048 - const SuspenseRoute = Route$5.update({ 12049 - id: "/suspense", 12050 - path: "/suspense", 12051 - getParentRoute: () => Route$6 12052 - }); 12053 - const PreloadingRoute = Route$4.update({ 12054 - id: "/preloading", 12055 - path: "/preloading", 12056 - getParentRoute: () => Route$6 12057 - }); 12058 - const PaginationRoute = Route$3.update({ 12059 - id: "/pagination", 12060 - path: "/pagination", 12061 - getParentRoute: () => Route$6 12062 - }); 12063 - const IntentPreloadingRoute = Route$2.update({ 12064 - id: "/intent-preloading", 12065 - path: "/intent-preloading", 12066 - getParentRoute: () => Route$6 12067 - }); 12068 - const BasicRoute = Route$1.update({ 12069 - id: "/basic", 12070 - path: "/basic", 12071 - getParentRoute: () => Route$6 12072 - }); 12073 - const IndexRoute = Route2.update({ 12074 - id: "/", 12075 - path: "/", 12076 - getParentRoute: () => Route$6 12077 - }); 12078 - const rootRouteChildren = { 12079 - IndexRoute, 12080 - BasicRoute, 12081 - IntentPreloadingRoute, 12082 - PaginationRoute, 12083 - PreloadingRoute, 12084 - SuspenseRoute 12085 - }; 12086 - const routeTree = Route$6._addFileChildren(rootRouteChildren)._addFileTypes(); 12087 - function createRouter() { 12088 - const queryClient = new QueryClient(); 12089 - const router = routerWithQueryClient( 12090 - createRouter$1({ 12091 - routeTree, 12092 - scrollRestoration: true, 12093 - defaultPreload: false, 12094 - defaultStructuralSharing: true, 12095 - defaultPreloadStaleTime: 0, 12096 - defaultPendingMs: 0, 12097 - defaultErrorComponent: () => /* @__PURE__ */ jsx("div", { children: "Error" }), 12098 - defaultPendingComponent: () => /* @__PURE__ */ jsx("div", { children: "Loading..." }), 12099 - defaultNotFoundComponent: () => /* @__PURE__ */ jsx("div", { children: "Not Found" }), 12100 - context: { 12101 - queryClient 12102 - } 12103 - }), 12104 - queryClient 12105 - ); 12106 - return router; 12107 - } 12108 - const serverEntry$1 = createStartHandler({ 12109 - createRouter 12110 - })(defaultStreamHandler); 12111 - const serverEntry = defineEventHandler(function(event) { 12112 - const request = toWebRequest(event); 12113 - return serverEntry$1({ request }); 12114 - }); 12115 - 12116 - export { getSidedProp as $, createServerFn as A, getPreferredColorScheme as B, createMemo as C, DB as D, createComponent as E, createContext as F, createSignal$1 as G, onMount as H, createEffect as I, Portal as J, Show as K, Link as L, template as M, insert as N, createRenderEffect as O, POKEMON_LIMIT$3 as P, className as Q, Route$5 as R, Subscribable as S, clearDelegatedEvents as T, delegateEvents as U, useContext as V, onCleanup as W, sortFns as X, mutationSortFns as Y, on as Z, setAttribute as _, Route$4 as a, use as a0, createUniqueId as a1, batch as a2, getQueryStatusLabel as a3, getMutationStatusColor as a4, getQueryStatusColor as a5, getQueryStatusColorByLabel as a6, displayValue as a7, For as a8, convertRemToPixels as a9, untrack as aa, $TRACK as ab, useTransition as ac, spread as ad, mergeProps as ae, createRoot as af, serialize as ag, Index as ah, updateNestedDataByPath as ai, addEventListener as aj, stringify as ak, Match as al, Switch as am, deleteNestedDataByPath as an, splitProps as ao, Dynamic as ap, createComputed as aq, Route$3 as b, Route$2 as c, useRouter as d, serverEntry as default, Route$1 as e, resolveEnabled as f, getServerPokemonList as g, shallowEqualObjects as h, isRedirect as i, joinPaths as j, resolveStaleTime as k, isServer as l, isValidTimeout as m, noop as n, timeUntilStale as o, pendingThenable as p, focusManager as q, rootRouteId as r, skipToken as s, trimPathLeft as t, useQueryClient as u, fetchState as v, replaceData as w, notifyManager as x, shouldThrowError as y, createServerRpc as z }; 12117 - //# sourceMappingURL=ssr.mjs.map
-1
.output/server/chunks/_/ssr.mjs.map
··· 1 - {"version":3,"file":"ssr.mjs","sources":[],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
-8
.output/server/chunks/_/suspense-CDby3_eA.mjs
··· 1 - import { jsx } from 'react/jsx-runtime'; 2 - 3 - const SplitErrorComponent = function ErrorComponent() { 4 - return /* @__PURE__ */ jsx("div", { children: "Error" }); 5 - }; 6 - 7 - export { SplitErrorComponent as errorComponent }; 8 - //# sourceMappingURL=suspense-CDby3_eA.mjs.map
-1
.output/server/chunks/_/suspense-CDby3_eA.mjs.map
··· 1 - {"version":3,"file":"suspense-CDby3_eA.mjs","sources":["../../../../../src/routes/suspense.tsx?tsr-split=errorComponent"],"sourcesContent":null,"names":["SplitErrorComponent","ErrorComponent"],"mappings":";;AAoCCA,MAAAA,mBAAAA,GAAA,SAMQC,cAAiB,GAAA;AAClB,EAAA,uBAAC,GAAA,CAAA,KAAA,EAAA,EAAI,QAAA,EAAK,SAAA,CAAA;AAClB;;;;"}
-8
.output/server/chunks/_/suspense-eUhkQotn.mjs
··· 1 - import { jsx } from 'react/jsx-runtime'; 2 - 3 - const SplitNotFoundComponent = function NotFoundComponent() { 4 - return /* @__PURE__ */ jsx("div", { children: "Not Found" }); 5 - }; 6 - 7 - export { SplitNotFoundComponent as notFoundComponent }; 8 - //# sourceMappingURL=suspense-eUhkQotn.mjs.map
-1
.output/server/chunks/_/suspense-eUhkQotn.mjs.map
··· 1 - {"version":3,"file":"suspense-eUhkQotn.mjs","sources":["../../../../../src/routes/suspense.tsx?tsr-split=notFoundComponent"],"sourcesContent":null,"names":["SplitNotFoundComponent","NotFoundComponent"],"mappings":";;AAoCCA,MAAAA,sBAAAA,GAAA,SAEQC,iBAAoB,GAAA;AACrB,EAAA,uBAAC,GAAA,CAAA,KAAA,EAAA,EAAI,QAAA,EAAS,aAAA,CAAA;AACtB;;;;"}
-106
.output/server/chunks/_/suspense-wbT_yPoJ.mjs
··· 1 - import { jsxs, jsx } from 'react/jsx-runtime'; 2 - import { u as useSuspenseQuery } from './useSuspenseQuery-D_gTj2Eu.mjs'; 3 - import { R as Route$5, L as Link, g as getServerPokemonList } from './ssr.mjs'; 4 - import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell, f as buttonVariants, g as cn } from './table-VHJbrm0X.mjs'; 5 - import { useMemo } from 'react'; 6 - import 'react-dom'; 7 - import 'valibot'; 8 - import 'drizzle-orm'; 9 - import 'drizzle-orm/libsql'; 10 - import '@t3-oss/env-core'; 11 - import 'drizzle-orm/sqlite-core'; 12 - import 'node:async_hooks'; 13 - import 'node:stream'; 14 - import 'react-dom/server'; 15 - import 'node:stream/web'; 16 - import 'class-variance-authority'; 17 - import 'clsx'; 18 - import 'tailwind-merge'; 19 - 20 - const POKEMON_LIMIT = 20; 21 - const matchPokemonIdExp = /\/api\/v2\/pokemon\/(\d+)\/?/; 22 - const SplitComponent = function RouteComponent() { 23 - var _a; 24 - const { 25 - offset: currentOffset 26 - } = Route$5.useSearch(); 27 - const newKey = ["pokemon-list", "suspense", { 28 - limit: POKEMON_LIMIT, 29 - offset: currentOffset 30 - }]; 31 - const { 32 - data 33 - } = useSuspenseQuery({ 34 - queryKey: newKey, 35 - queryFn: async () => { 36 - const result = await getServerPokemonList({ 37 - data: { 38 - offset: currentOffset 39 - } 40 - }); 41 - return { 42 - results: result.pokemon.map((p) => ({ 43 - name: p.name, 44 - url: `/api/v2/pokemon/${p.id}/` 45 - })), 46 - next: result.nextOffset !== null ? `/api/v2/pokemon/?offset=${result.nextOffset}` : null, 47 - previous: result.prevOffset !== null ? `/api/v2/pokemon/?offset=${result.prevOffset}` : null 48 - }; 49 - } 50 - }); 51 - const previousOffset = useMemo(() => { 52 - var _a2; 53 - if ((data == null ? void 0 : data.previous) == null) { 54 - return null; 55 - } 56 - return (_a2 = new URL(data.previous).searchParams.get("offset")) != null ? _a2 : null; 57 - }, [data == null ? void 0 : data.previous]); 58 - const nextOffset = useMemo(() => { 59 - var _a2; 60 - if ((data == null ? void 0 : data.next) == null) { 61 - return null; 62 - } 63 - return (_a2 = new URL(data.next).searchParams.get("offset")) != null ? _a2 : null; 64 - }, [data == null ? void 0 : data.next]); 65 - const results = (_a = data.results) != null ? _a : []; 66 - return /* @__PURE__ */ jsxs("div", { className: "p-4", children: [ 67 - /* @__PURE__ */ jsxs("h1", { className: "text-2xl font-bold mb-4", children: [ 68 - "National Pok\xE9dex: Pok\xE9mon ", 69 - currentOffset + 1, 70 - "-", 71 - currentOffset + POKEMON_LIMIT 72 - ] }), 73 - /* @__PURE__ */ jsxs(Table, { children: [ 74 - /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [ 75 - /* @__PURE__ */ jsx(TableHead, { children: "#" }), 76 - /* @__PURE__ */ jsx(TableHead, { children: "Name" }), 77 - /* @__PURE__ */ jsx(TableHead, { children: "Details" }) 78 - ] }) }), 79 - /* @__PURE__ */ jsx(TableBody, { children: results.map((pokemon) => { 80 - var _a2; 81 - return /* @__PURE__ */ jsxs(TableRow, { children: [ 82 - /* @__PURE__ */ jsx(TableCell, { children: (_a2 = pokemon.url.match(matchPokemonIdExp)) == null ? void 0 : _a2[1] }), 83 - /* @__PURE__ */ jsx(TableCell, { className: "capitalize", children: pokemon.name }), 84 - /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx("a", { href: pokemon.url, target: "_blank", rel: "noopener noreferrer", className: "text-blue-600 underline", children: "View" }) }) 85 - ] }, pokemon.name); 86 - }) }) 87 - ] }), 88 - /* @__PURE__ */ jsxs("div", { className: "flex justify-center gap-4 mt-4", children: [ 89 - /* @__PURE__ */ jsx(Link, { to: "/suspense", className: buttonVariants({ 90 - variant: "outline", 91 - className: cn(!previousOffset && "opacity-50 cursor-not-allowed") 92 - }), search: { 93 - offset: Number(previousOffset) 94 - }, disabled: !previousOffset, children: "Previous" }), 95 - /* @__PURE__ */ jsx(Link, { to: "/suspense", search: { 96 - offset: Number(nextOffset) 97 - }, className: buttonVariants({ 98 - variant: "outline", 99 - className: cn(!nextOffset && "opacity-50 cursor-not-allowed") 100 - }), disabled: !nextOffset, children: "Next" }) 101 - ] }) 102 - ] }); 103 - }; 104 - 105 - export { SplitComponent as component }; 106 - //# sourceMappingURL=suspense-wbT_yPoJ.mjs.map
-1
.output/server/chunks/_/suspense-wbT_yPoJ.mjs.map
··· 1 - {"version":3,"file":"suspense-wbT_yPoJ.mjs","sources":["../../../../../src/routes/suspense.tsx?tsr-split=component"],"sourcesContent":null,"names":["POKEMON_LIMIT","matchPokemonIdExp","SplitComponent","RouteComponent","offset","currentOffset","Route","useSearch","newKey","limit","data","useSuspenseQuery","queryKey","queryFn","result","getServerPokemonList","results","pokemon","map","p","name","url","id","next","nextOffset","previous","prevOffset","previousOffset","useMemo","_a","URL","searchParams","get","match","buttonVariants","variant","className","cn","Number"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,MAAMA,aAAgB,GAAA,EAAA;AAEtB,MAAMC,iBAAoB,GAAA,8BAAA;AAiBzBC,MAAAA,cAAAA,GAAA,SAcQC,cAAiB,GAAA;;AACnB,EAAA,MAAA;AAAA,IAAEC,MAAQC,EAAAA;AAAAA,GAAAA,GAAkBC,QAAMC,SAAU,EAAA;AAE5CC,EAAAA,MAAAA,MAAAA,GAAS,CACd,cAAA,EACA,UACA,EAAA;AAAA,IAAEC,KAAOT,EAAAA,aAAAA;AAAAA,IAAeI,MAAQC,EAAAA;AAAAA,GAAe,CAAA;AAG1C,EAAA,MAAA;AAAA,IAAEK;AAAAA,MAASC,gBAAiB,CAAA;AAAA,IACjCC,QAAUJ,EAAAA,MAAAA;AAAAA,IACVK,SAAS,YAAY;AACdC,MAAAA,MAAAA,MAAAA,GAAS,MAAMC,oBAAqB,CAAA;AAAA,QACzCL,IAAM,EAAA;AAAA,UAAEN,MAAQC,EAAAA;AAAAA;AAAAA,OAChB,CAAA;AACM,MAAA,OAAA;AAAA,QACNW,OAASF,EAAAA,MAAAA,CAAOG,OAAQC,CAAAA,GAAAA,CAAKC,CAAO,CAAA,MAAA;AAAA,UACnCC,MAAMD,CAAEC,CAAAA,IAAAA;AAAAA,UACRC,GAAAA,EAAK,CAAmBF,gBAAAA,EAAAA,CAAAA,CAAEG,EAAE,CAAA,CAAA;AAAA,SAC3B,CAAA,CAAA;AAAA,QACFC,MACCT,MAAOU,CAAAA,UAAAA,KAAe,OACnB,CAA2BV,wBAAAA,EAAAA,MAAAA,CAAOU,UAAU,CAC5C,CAAA,GAAA,IAAA;AAAA,QACJC,UACCX,MAAOY,CAAAA,UAAAA,KAAe,OACnB,CAA2BZ,wBAAAA,EAAAA,MAAAA,CAAOY,UAAU,CAC5C,CAAA,GAAA;AAAA,OACL;AAAA;AAAA,GAED,CAAA;AAEKC,EAAAA,MAAAA,cAAAA,GAAiBC,QAAQ,MAAM;;AAChClB,IAAAA,IAAAA,CAAAA,IAAAA,IAAAA,IAAAA,GAAAA,MAAAA,GAAAA,IAAAA,CAAMe,aAAY,IAAM,EAAA;AACpB,MAAA,OAAA,IAAA;AAAA;AAGD,IAAAI,OAAAA,CAAAA,GAAAA,GAAA,IAAIC,GAAAA,CAAIpB,IAAKe,CAAAA,QAAQ,CAAEM,CAAAA,YAAAA,CAAaC,GAAI,CAAA,QAAQ,CAAhD,KAAA,IAAA,GAAAH,GAAqD,GAAA,IAAA;AAAA,KAC1D,CAACnB,IAAAA,IAAMe,OAAAA,MAAAA,GAAAA,IAAAA,CAAAA,QAAQ,CAAC,CAAA;AAEbD,EAAAA,MAAAA,UAAAA,GAAaI,QAAQ,MAAM;;AAC5BlB,IAAAA,IAAAA,CAAAA,IAAAA,IAAAA,IAAAA,GAAAA,MAAAA,GAAAA,IAAAA,CAAMa,SAAQ,IAAM,EAAA;AAChB,MAAA,OAAA,IAAA;AAAA;AAGD,IAAAM,OAAAA,CAAAA,GAAAA,GAAA,IAAIC,GAAAA,CAAIpB,IAAKa,CAAAA,IAAI,CAAEQ,CAAAA,YAAAA,CAAaC,GAAI,CAAA,QAAQ,CAA5C,KAAA,IAAA,GAAAH,GAAiD,GAAA,IAAA;AAAA,KACtD,CAACnB,IAAAA,IAAMa,OAAAA,MAAAA,GAAAA,IAAAA,CAAAA,IAAI,CAAC,CAAA;AAETP,EAAAA,MAAAA,OAAUN,GAAAA,CAAAA,EAAAA,GAAAA,IAAAA,CAAKM,OAALN,KAAAA,IAAAA,GAAAA,EAAAA,GAAgB,EAAE;AAEjC,EAAA,uBAAC,IAAA,CAAA,KAAA,EAAI,EAAA,SAAA,EAAU,OACd,QAAA,EAAA;AAAA,oBAAC,IAAA,CAAA,IAAA,EAAA,EAAG,SAAA,EAAU,2BAAyB,QAAA,EAAA;AAAA,MAAA,kCAAA;AAAA,MACXL,aAAgB,GAAA,CAAA;AAAA,MAAE,GAAA;AAAA,MAC5CA,aAAgBL,GAAAA;AAAAA,OAClB,CAAA;AAAA,oBACC,IAAA,CAAA,KACA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAC,WAAA,EAAA,EACA,0BAAC,IAAA,CAAA,QAAA,EACA,EAAA,QAAA,EAAA;AAAA,wBAAC,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAC,KAAA,CAAA;AAAA,wBACX,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAI,QAAA,CAAA;AAAA,wBACd,GAAA,CAAA,SAAA,EAAA,EAAU,QAAA,EAAO,WAAA;AAAA,OAAA,EACnB,CAAA,EACD,CAAA;AAAA,0BACC,SACCgB,EAAAA,EAAAA,UAAAA,OAAQE,CAAAA,GAAAA,CAAI,CAACD,OAAAA,KAAAA;;AACZ,QAAA,uBAAA,IAAA,CAAA,QACA,EAAA,EAAA,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,SAAA,IAAWA,QAAAA,EAAAA,CAAQI,MAAAA,OAAAA,CAAAA,GAAAA,CAAIY,KAAMhC,CAAAA,iBAAiB,MAA3BoB,IAAAA,GAAAA,MAAAA,GAAAA,GAA+B,CAAA,CAAG,GAAA,CAAA;AAAA,8BACrD,WAAA,EAAU,SAAA,EAAU,cAAcJ,kBAAQG,MAAK,CAAA;AAAA,8BAC/C,WAAA,EACA,QAAA,sBAAC,GAAA,EAAA,EACA,MAAMH,OAAQI,CAAAA,GAAAA,EACd,QAAO,QACP,EAAA,GAAA,EAAI,uBACJ,SAAU,EAAA,yBAAA,EAAyB,UAAA,MAAA,EAGpC,GACD;AAAA,SAAA,EAZcJ,EAAAA,OAAAA,CAAQG,IAavB,CAAA;AAAA,OACA,GACF;AAAA,OACD,CAAA;AAAA,oBACC,IAAA,CAAA,KAAA,EAAI,EAAA,SAAA,EAAU,kCACd,QAAA,EAAA;AAAA,0BAAC,IACA,EAAA,EAAA,EAAG,EAAA,WAAA,EACH,WAAWc,cAAe,CAAA;AAAA,QACzBC,OAAS,EAAA,SAAA;AAAA,QACTC,SAAWC,EAAAA,EAAAA,CAAG,CAACV,cAAAA,IAAkB,+BAA+B;AAAA,OAChE,GACD,MAAQ,EAAA;AAAA,QAAEvB,MAAAA,EAAQkC,OAAOX,cAAc;AAAA,SACvC,QAAU,EAAA,CAACA,cAAe,EAAA,QAAA,EAG3B,YAAA,CAAA;AAAA,sBACC,GAAA,CAAA,IAAA,EAAA,EACA,EAAA,EAAG,aACH,MAAQ,EAAA;AAAA,QAAEvB,MAAAA,EAAQkC,OAAOd,UAAU;AAAA,OAAA,EACnC,WAAWU,cAAe,CAAA;AAAA,QACzBC,OAAS,EAAA,SAAA;AAAA,QACTC,SAAWC,EAAAA,EAAAA,CAAG,CAACb,UAAAA,IAAc,+BAA+B;AAAA,OAC5D,CACD,EAAA,QAAA,EAAU,CAACA,UAAW,EAAA,QAAA,EAGvB,QAAA;AAAA,OACD;AAAA,KACD,CAAA;AAEF;;;;"}
-659
.output/server/chunks/_/table-VHJbrm0X.mjs
··· 1 - import { u as useQueryClient, x as notifyManager, n as noop, y as shouldThrowError, S as Subscribable, p as pendingThenable, f as resolveEnabled, h as shallowEqualObjects, k as resolveStaleTime, v as fetchState, w as replaceData } from './ssr.mjs'; 2 - import * as React from 'react'; 3 - import { jsx } from 'react/jsx-runtime'; 4 - import { cva } from 'class-variance-authority'; 5 - import { clsx } from 'clsx'; 6 - import { twMerge } from 'tailwind-merge'; 7 - 8 - var __typeError = (msg) => { 9 - throw TypeError(msg); 10 - }; 11 - var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); 12 - var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); 13 - var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); 14 - var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value); 15 - var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); 16 - var _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn, _a; 17 - var QueryObserver = (_a = class extends Subscribable { 18 - constructor(client, options) { 19 - super(); 20 - __privateAdd(this, _QueryObserver_instances); 21 - __privateAdd(this, _client); 22 - __privateAdd(this, _currentQuery); 23 - __privateAdd(this, _currentQueryInitialState); 24 - __privateAdd(this, _currentResult); 25 - __privateAdd(this, _currentResultState); 26 - __privateAdd(this, _currentResultOptions); 27 - __privateAdd(this, _currentThenable); 28 - __privateAdd(this, _selectError); 29 - __privateAdd(this, _selectFn); 30 - __privateAdd(this, _selectResult); 31 - __privateAdd(this, _lastQueryWithDefinedData); 32 - __privateAdd(this, _staleTimeoutId); 33 - __privateAdd(this, _refetchIntervalId); 34 - __privateAdd(this, _currentRefetchInterval); 35 - __privateAdd(this, _trackedProps, /* @__PURE__ */ new Set()); 36 - this.options = options; 37 - __privateSet(this, _client, client); 38 - __privateSet(this, _selectError, null); 39 - __privateSet(this, _currentThenable, pendingThenable()); 40 - if (!this.options.experimental_prefetchInRender) { 41 - __privateGet(this, _currentThenable).reject( 42 - new Error("experimental_prefetchInRender feature flag is not enabled") 43 - ); 44 - } 45 - this.bindMethods(); 46 - this.setOptions(options); 47 - } 48 - bindMethods() { 49 - this.refetch = this.refetch.bind(this); 50 - } 51 - onSubscribe() { 52 - if (this.listeners.size === 1) { 53 - __privateGet(this, _currentQuery).addObserver(this); 54 - if (shouldFetchOnMount(__privateGet(this, _currentQuery), this.options)) { 55 - __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); 56 - } else { 57 - this.updateResult(); 58 - } 59 - __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); 60 - } 61 - } 62 - onUnsubscribe() { 63 - if (!this.hasListeners()) { 64 - this.destroy(); 65 - } 66 - } 67 - shouldFetchOnReconnect() { 68 - return shouldFetchOn( 69 - __privateGet(this, _currentQuery), 70 - this.options, 71 - this.options.refetchOnReconnect 72 - ); 73 - } 74 - shouldFetchOnWindowFocus() { 75 - return shouldFetchOn( 76 - __privateGet(this, _currentQuery), 77 - this.options, 78 - this.options.refetchOnWindowFocus 79 - ); 80 - } 81 - destroy() { 82 - this.listeners = /* @__PURE__ */ new Set(); 83 - __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); 84 - __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); 85 - __privateGet(this, _currentQuery).removeObserver(this); 86 - } 87 - setOptions(options) { 88 - const prevOptions = this.options; 89 - const prevQuery = __privateGet(this, _currentQuery); 90 - this.options = __privateGet(this, _client).defaultQueryOptions(options); 91 - if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== "boolean") { 92 - throw new Error( 93 - "Expected enabled to be a boolean or a callback that returns a boolean" 94 - ); 95 - } 96 - __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); 97 - __privateGet(this, _currentQuery).setOptions(this.options); 98 - if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) { 99 - __privateGet(this, _client).getQueryCache().notify({ 100 - type: "observerOptionsUpdated", 101 - query: __privateGet(this, _currentQuery), 102 - observer: this 103 - }); 104 - } 105 - const mounted = this.hasListeners(); 106 - if (mounted && shouldFetchOptionally( 107 - __privateGet(this, _currentQuery), 108 - prevQuery, 109 - this.options, 110 - prevOptions 111 - )) { 112 - __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this); 113 - } 114 - this.updateResult(); 115 - if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || resolveStaleTime(this.options.staleTime, __privateGet(this, _currentQuery)) !== resolveStaleTime(prevOptions.staleTime, __privateGet(this, _currentQuery)))) { 116 - __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); 117 - } 118 - const nextRefetchInterval = __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this); 119 - if (mounted && (__privateGet(this, _currentQuery) !== prevQuery || resolveEnabled(this.options.enabled, __privateGet(this, _currentQuery)) !== resolveEnabled(prevOptions.enabled, __privateGet(this, _currentQuery)) || nextRefetchInterval !== __privateGet(this, _currentRefetchInterval))) { 120 - __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, nextRefetchInterval); 121 - } 122 - } 123 - getOptimisticResult(options) { 124 - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), options); 125 - const result = this.createResult(query, options); 126 - if (shouldAssignObserverCurrentProperties(this, result)) { 127 - __privateSet(this, _currentResult, result); 128 - __privateSet(this, _currentResultOptions, this.options); 129 - __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); 130 - } 131 - return result; 132 - } 133 - getCurrentResult() { 134 - return __privateGet(this, _currentResult); 135 - } 136 - trackResult(result, onPropTracked) { 137 - return new Proxy(result, { 138 - get: (target, key) => { 139 - this.trackProp(key); 140 - onPropTracked == null ? void 0 : onPropTracked(key); 141 - return Reflect.get(target, key); 142 - } 143 - }); 144 - } 145 - trackProp(key) { 146 - __privateGet(this, _trackedProps).add(key); 147 - } 148 - getCurrentQuery() { 149 - return __privateGet(this, _currentQuery); 150 - } 151 - refetch({ ...options } = {}) { 152 - return this.fetch({ 153 - ...options 154 - }); 155 - } 156 - fetchOptimistic(options) { 157 - const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options); 158 - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), defaultedOptions); 159 - return query.fetch().then(() => this.createResult(query, defaultedOptions)); 160 - } 161 - fetch(fetchOptions) { 162 - var _a2; 163 - return __privateMethod(this, _QueryObserver_instances, executeFetch_fn).call(this, { 164 - ...fetchOptions, 165 - cancelRefetch: (_a2 = fetchOptions.cancelRefetch) != null ? _a2 : true 166 - }).then(() => { 167 - this.updateResult(); 168 - return __privateGet(this, _currentResult); 169 - }); 170 - } 171 - createResult(query, options) { 172 - var _a2; 173 - const prevQuery = __privateGet(this, _currentQuery); 174 - const prevOptions = this.options; 175 - const prevResult = __privateGet(this, _currentResult); 176 - const prevResultState = __privateGet(this, _currentResultState); 177 - const prevResultOptions = __privateGet(this, _currentResultOptions); 178 - const queryChange = query !== prevQuery; 179 - const queryInitialState = queryChange ? query.state : __privateGet(this, _currentQueryInitialState); 180 - const { state } = query; 181 - let newState = { ...state }; 182 - let isPlaceholderData = false; 183 - let data; 184 - if (options._optimisticResults) { 185 - const mounted = this.hasListeners(); 186 - const fetchOnMount = !mounted && shouldFetchOnMount(query, options); 187 - const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); 188 - if (fetchOnMount || fetchOptionally) { 189 - newState = { 190 - ...newState, 191 - ...fetchState(state.data, query.options) 192 - }; 193 - } 194 - if (options._optimisticResults === "isRestoring") { 195 - newState.fetchStatus = "idle"; 196 - } 197 - } 198 - let { error, errorUpdatedAt, status } = newState; 199 - data = newState.data; 200 - let skipSelect = false; 201 - if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { 202 - let placeholderData; 203 - if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) { 204 - placeholderData = prevResult.data; 205 - skipSelect = true; 206 - } else { 207 - placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( 208 - (_a2 = __privateGet(this, _lastQueryWithDefinedData)) == null ? void 0 : _a2.state.data, 209 - __privateGet(this, _lastQueryWithDefinedData) 210 - ) : options.placeholderData; 211 - } 212 - if (placeholderData !== void 0) { 213 - status = "success"; 214 - data = replaceData( 215 - prevResult == null ? void 0 : prevResult.data, 216 - placeholderData, 217 - options 218 - ); 219 - isPlaceholderData = true; 220 - } 221 - } 222 - if (options.select && data !== void 0 && !skipSelect) { 223 - if (prevResult && data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) { 224 - data = __privateGet(this, _selectResult); 225 - } else { 226 - try { 227 - __privateSet(this, _selectFn, options.select); 228 - data = options.select(data); 229 - data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options); 230 - __privateSet(this, _selectResult, data); 231 - __privateSet(this, _selectError, null); 232 - } catch (selectError) { 233 - __privateSet(this, _selectError, selectError); 234 - } 235 - } 236 - } 237 - if (__privateGet(this, _selectError)) { 238 - error = __privateGet(this, _selectError); 239 - data = __privateGet(this, _selectResult); 240 - errorUpdatedAt = Date.now(); 241 - status = "error"; 242 - } 243 - const isFetching = newState.fetchStatus === "fetching"; 244 - const isPending = status === "pending"; 245 - const isError = status === "error"; 246 - const isLoading = isPending && isFetching; 247 - const hasData = data !== void 0; 248 - const result = { 249 - status, 250 - fetchStatus: newState.fetchStatus, 251 - isPending, 252 - isSuccess: status === "success", 253 - isError, 254 - isInitialLoading: isLoading, 255 - isLoading, 256 - data, 257 - dataUpdatedAt: newState.dataUpdatedAt, 258 - error, 259 - errorUpdatedAt, 260 - failureCount: newState.fetchFailureCount, 261 - failureReason: newState.fetchFailureReason, 262 - errorUpdateCount: newState.errorUpdateCount, 263 - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, 264 - isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, 265 - isFetching, 266 - isRefetching: isFetching && !isPending, 267 - isLoadingError: isError && !hasData, 268 - isPaused: newState.fetchStatus === "paused", 269 - isPlaceholderData, 270 - isRefetchError: isError && hasData, 271 - isStale: isStale(query, options), 272 - refetch: this.refetch, 273 - promise: __privateGet(this, _currentThenable) 274 - }; 275 - const nextResult = result; 276 - if (this.options.experimental_prefetchInRender) { 277 - const finalizeThenableIfPossible = (thenable) => { 278 - if (nextResult.status === "error") { 279 - thenable.reject(nextResult.error); 280 - } else if (nextResult.data !== void 0) { 281 - thenable.resolve(nextResult.data); 282 - } 283 - }; 284 - const recreateThenable = () => { 285 - const pending = __privateSet(this, _currentThenable, nextResult.promise = pendingThenable()); 286 - finalizeThenableIfPossible(pending); 287 - }; 288 - const prevThenable = __privateGet(this, _currentThenable); 289 - switch (prevThenable.status) { 290 - case "pending": 291 - if (query.queryHash === prevQuery.queryHash) { 292 - finalizeThenableIfPossible(prevThenable); 293 - } 294 - break; 295 - case "fulfilled": 296 - if (nextResult.status === "error" || nextResult.data !== prevThenable.value) { 297 - recreateThenable(); 298 - } 299 - break; 300 - case "rejected": 301 - if (nextResult.status !== "error" || nextResult.error !== prevThenable.reason) { 302 - recreateThenable(); 303 - } 304 - break; 305 - } 306 - } 307 - return nextResult; 308 - } 309 - updateResult() { 310 - const prevResult = __privateGet(this, _currentResult); 311 - const nextResult = this.createResult(__privateGet(this, _currentQuery), this.options); 312 - __privateSet(this, _currentResultState, __privateGet(this, _currentQuery).state); 313 - __privateSet(this, _currentResultOptions, this.options); 314 - if (__privateGet(this, _currentResultState).data !== void 0) { 315 - __privateSet(this, _lastQueryWithDefinedData, __privateGet(this, _currentQuery)); 316 - } 317 - if (shallowEqualObjects(nextResult, prevResult)) { 318 - return; 319 - } 320 - __privateSet(this, _currentResult, nextResult); 321 - const shouldNotifyListeners = () => { 322 - if (!prevResult) { 323 - return true; 324 - } 325 - const { notifyOnChangeProps } = this.options; 326 - const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; 327 - if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !__privateGet(this, _trackedProps).size) { 328 - return true; 329 - } 330 - const includedProps = new Set( 331 - notifyOnChangePropsValue != null ? notifyOnChangePropsValue : __privateGet(this, _trackedProps) 332 - ); 333 - if (this.options.throwOnError) { 334 - includedProps.add("error"); 335 - } 336 - return Object.keys(__privateGet(this, _currentResult)).some((key) => { 337 - const typedKey = key; 338 - const changed = __privateGet(this, _currentResult)[typedKey] !== prevResult[typedKey]; 339 - return changed && includedProps.has(typedKey); 340 - }); 341 - }; 342 - __privateMethod(this, _QueryObserver_instances, notify_fn).call(this, { listeners: shouldNotifyListeners() }); 343 - } 344 - onQueryUpdate() { 345 - this.updateResult(); 346 - if (this.hasListeners()) { 347 - __privateMethod(this, _QueryObserver_instances, updateTimers_fn).call(this); 348 - } 349 - } 350 - }, _client = /* @__PURE__ */ new WeakMap(), _currentQuery = /* @__PURE__ */ new WeakMap(), _currentQueryInitialState = /* @__PURE__ */ new WeakMap(), _currentResult = /* @__PURE__ */ new WeakMap(), _currentResultState = /* @__PURE__ */ new WeakMap(), _currentResultOptions = /* @__PURE__ */ new WeakMap(), _currentThenable = /* @__PURE__ */ new WeakMap(), _selectError = /* @__PURE__ */ new WeakMap(), _selectFn = /* @__PURE__ */ new WeakMap(), _selectResult = /* @__PURE__ */ new WeakMap(), _lastQueryWithDefinedData = /* @__PURE__ */ new WeakMap(), _staleTimeoutId = /* @__PURE__ */ new WeakMap(), _refetchIntervalId = /* @__PURE__ */ new WeakMap(), _currentRefetchInterval = /* @__PURE__ */ new WeakMap(), _trackedProps = /* @__PURE__ */ new WeakMap(), _QueryObserver_instances = /* @__PURE__ */ new WeakSet(), executeFetch_fn = function(fetchOptions) { 351 - __privateMethod(this, _QueryObserver_instances, updateQuery_fn).call(this); 352 - let promise = __privateGet(this, _currentQuery).fetch( 353 - this.options, 354 - fetchOptions 355 - ); 356 - if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) { 357 - promise = promise.catch(noop); 358 - } 359 - return promise; 360 - }, updateStaleTimeout_fn = function() { 361 - __privateMethod(this, _QueryObserver_instances, clearStaleTimeout_fn).call(this); 362 - resolveStaleTime( 363 - this.options.staleTime, 364 - __privateGet(this, _currentQuery) 365 - ); 366 - { 367 - return; 368 - } 369 - }, computeRefetchInterval_fn = function() { 370 - var _a2; 371 - return (_a2 = typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(__privateGet(this, _currentQuery)) : this.options.refetchInterval) != null ? _a2 : false; 372 - }, updateRefetchInterval_fn = function(nextInterval) { 373 - __privateMethod(this, _QueryObserver_instances, clearRefetchInterval_fn).call(this); 374 - __privateSet(this, _currentRefetchInterval, nextInterval); 375 - { 376 - return; 377 - } 378 - }, updateTimers_fn = function() { 379 - __privateMethod(this, _QueryObserver_instances, updateStaleTimeout_fn).call(this); 380 - __privateMethod(this, _QueryObserver_instances, updateRefetchInterval_fn).call(this, __privateMethod(this, _QueryObserver_instances, computeRefetchInterval_fn).call(this)); 381 - }, clearStaleTimeout_fn = function() { 382 - if (__privateGet(this, _staleTimeoutId)) { 383 - clearTimeout(__privateGet(this, _staleTimeoutId)); 384 - __privateSet(this, _staleTimeoutId, void 0); 385 - } 386 - }, clearRefetchInterval_fn = function() { 387 - if (__privateGet(this, _refetchIntervalId)) { 388 - clearInterval(__privateGet(this, _refetchIntervalId)); 389 - __privateSet(this, _refetchIntervalId, void 0); 390 - } 391 - }, updateQuery_fn = function() { 392 - const query = __privateGet(this, _client).getQueryCache().build(__privateGet(this, _client), this.options); 393 - if (query === __privateGet(this, _currentQuery)) { 394 - return; 395 - } 396 - const prevQuery = __privateGet(this, _currentQuery); 397 - __privateSet(this, _currentQuery, query); 398 - __privateSet(this, _currentQueryInitialState, query.state); 399 - if (this.hasListeners()) { 400 - prevQuery == null ? void 0 : prevQuery.removeObserver(this); 401 - query.addObserver(this); 402 - } 403 - }, notify_fn = function(notifyOptions) { 404 - notifyManager.batch(() => { 405 - if (notifyOptions.listeners) { 406 - this.listeners.forEach((listener) => { 407 - listener(__privateGet(this, _currentResult)); 408 - }); 409 - } 410 - __privateGet(this, _client).getQueryCache().notify({ 411 - query: __privateGet(this, _currentQuery), 412 - type: "observerResultsUpdated" 413 - }); 414 - }); 415 - }, _a); 416 - function shouldLoadOnMount(query, options) { 417 - return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); 418 - } 419 - function shouldFetchOnMount(query, options) { 420 - return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); 421 - } 422 - function shouldFetchOn(query, options, field) { 423 - if (resolveEnabled(options.enabled, query) !== false) { 424 - const value = typeof field === "function" ? field(query) : field; 425 - return value === "always" || value !== false && isStale(query, options); 426 - } 427 - return false; 428 - } 429 - function shouldFetchOptionally(query, prevQuery, options, prevOptions) { 430 - return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); 431 - } 432 - function isStale(query, options) { 433 - return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query)); 434 - } 435 - function shouldAssignObserverCurrentProperties(observer, optimisticResult) { 436 - if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { 437 - return true; 438 - } 439 - return false; 440 - } 441 - var IsRestoringContext = React.createContext(false); 442 - var useIsRestoring = () => React.useContext(IsRestoringContext); 443 - IsRestoringContext.Provider; 444 - function createValue() { 445 - let isReset = false; 446 - return { 447 - clearReset: () => { 448 - isReset = false; 449 - }, 450 - reset: () => { 451 - isReset = true; 452 - }, 453 - isReset: () => { 454 - return isReset; 455 - } 456 - }; 457 - } 458 - var QueryErrorResetBoundaryContext = React.createContext(createValue()); 459 - var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext); 460 - var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => { 461 - if (options.suspense || options.throwOnError || options.experimental_prefetchInRender) { 462 - if (!errorResetBoundary.isReset()) { 463 - options.retryOnMount = false; 464 - } 465 - } 466 - }; 467 - var useClearResetErrorBoundary = (errorResetBoundary) => { 468 - React.useEffect(() => { 469 - errorResetBoundary.clearReset(); 470 - }, [errorResetBoundary]); 471 - }; 472 - var getHasError = ({ 473 - result, 474 - errorResetBoundary, 475 - throwOnError, 476 - query, 477 - suspense 478 - }) => { 479 - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query])); 480 - }; 481 - var defaultThrowOnError = (_error, query) => query.state.data === void 0; 482 - var ensureSuspenseTimers = (defaultedOptions) => { 483 - const originalStaleTime = defaultedOptions.staleTime; 484 - if (defaultedOptions.suspense) { 485 - defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => Math.max(originalStaleTime(...args), 1e3) : Math.max(originalStaleTime != null ? originalStaleTime : 1e3, 1e3); 486 - if (typeof defaultedOptions.gcTime === "number") { 487 - defaultedOptions.gcTime = Math.max(defaultedOptions.gcTime, 1e3); 488 - } 489 - } 490 - }; 491 - var shouldSuspend = (defaultedOptions, result) => (defaultedOptions == null ? void 0 : defaultedOptions.suspense) && result.isPending; 492 - var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { 493 - errorResetBoundary.clearReset(); 494 - }); 495 - function useBaseQuery(options, Observer, queryClient) { 496 - var _a2, _b, _c, _d; 497 - const client = useQueryClient(queryClient); 498 - const isRestoring = useIsRestoring(); 499 - const errorResetBoundary = useQueryErrorResetBoundary(); 500 - const defaultedOptions = client.defaultQueryOptions(options); 501 - (_b = (_a2 = client.getDefaultOptions().queries) == null ? void 0 : _a2._experimental_beforeQuery) == null ? void 0 : _b.call( 502 - _a2, 503 - defaultedOptions 504 - ); 505 - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; 506 - ensureSuspenseTimers(defaultedOptions); 507 - ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary); 508 - useClearResetErrorBoundary(errorResetBoundary); 509 - !client.getQueryCache().get(defaultedOptions.queryHash); 510 - const [observer] = React.useState( 511 - () => new Observer( 512 - client, 513 - defaultedOptions 514 - ) 515 - ); 516 - const result = observer.getOptimisticResult(defaultedOptions); 517 - const shouldSubscribe = !isRestoring && options.subscribed !== false; 518 - React.useSyncExternalStore( 519 - React.useCallback( 520 - (onStoreChange) => { 521 - const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop; 522 - observer.updateResult(); 523 - return unsubscribe; 524 - }, 525 - [observer, shouldSubscribe] 526 - ), 527 - () => observer.getCurrentResult(), 528 - () => observer.getCurrentResult() 529 - ); 530 - React.useEffect(() => { 531 - observer.setOptions(defaultedOptions); 532 - }, [defaultedOptions, observer]); 533 - if (shouldSuspend(defaultedOptions, result)) { 534 - throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); 535 - } 536 - if (getHasError({ 537 - result, 538 - errorResetBoundary, 539 - throwOnError: defaultedOptions.throwOnError, 540 - query: client.getQueryCache().get(defaultedOptions.queryHash), 541 - suspense: defaultedOptions.suspense 542 - })) { 543 - throw result.error; 544 - } 545 - (_d = (_c = client.getDefaultOptions().queries) == null ? void 0 : _c._experimental_afterQuery) == null ? void 0 : _d.call( 546 - _c, 547 - defaultedOptions, 548 - result 549 - ); 550 - if (defaultedOptions.experimental_prefetchInRender && false) ; 551 - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; 552 - } 553 - function cn(...inputs) { 554 - return twMerge(clsx(inputs)); 555 - } 556 - const buttonVariants = cva( 557 - `inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`, 558 - { 559 - variants: { 560 - variant: { 561 - default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90", 562 - destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60", 563 - outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50", 564 - secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80", 565 - ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50", 566 - link: "text-primary underline-offset-4 hover:underline" 567 - }, 568 - size: { 569 - default: "h-9 px-4 py-2 has-[>svg]:px-3", 570 - sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5", 571 - lg: "h-10 rounded-md px-6 has-[>svg]:px-4", 572 - icon: "size-9" 573 - } 574 - }, 575 - defaultVariants: { 576 - variant: "default", 577 - size: "default" 578 - } 579 - } 580 - ); 581 - function Table({ className, ...props }) { 582 - return /* @__PURE__ */ jsx( 583 - "div", 584 - { 585 - "data-slot": "table-container", 586 - className: "relative w-full overflow-x-auto", 587 - children: /* @__PURE__ */ jsx( 588 - "table", 589 - { 590 - "data-slot": "table", 591 - className: cn("w-full caption-bottom text-sm", className), 592 - ...props 593 - } 594 - ) 595 - } 596 - ); 597 - } 598 - function TableHeader({ className, ...props }) { 599 - return /* @__PURE__ */ jsx( 600 - "thead", 601 - { 602 - "data-slot": "table-header", 603 - className: cn("[&_tr]:border-b", className), 604 - ...props 605 - } 606 - ); 607 - } 608 - function TableBody({ className, ...props }) { 609 - return /* @__PURE__ */ jsx( 610 - "tbody", 611 - { 612 - "data-slot": "table-body", 613 - className: cn("[&_tr:last-child]:border-0", className), 614 - ...props 615 - } 616 - ); 617 - } 618 - function TableRow({ className, ...props }) { 619 - return /* @__PURE__ */ jsx( 620 - "tr", 621 - { 622 - "data-slot": "table-row", 623 - className: cn( 624 - "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors", 625 - className 626 - ), 627 - ...props 628 - } 629 - ); 630 - } 631 - function TableHead({ className, ...props }) { 632 - return /* @__PURE__ */ jsx( 633 - "th", 634 - { 635 - "data-slot": "table-head", 636 - className: cn( 637 - "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", 638 - className 639 - ), 640 - ...props 641 - } 642 - ); 643 - } 644 - function TableCell({ className, ...props }) { 645 - return /* @__PURE__ */ jsx( 646 - "td", 647 - { 648 - "data-slot": "table-cell", 649 - className: cn( 650 - "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", 651 - className 652 - ), 653 - ...props 654 - } 655 - ); 656 - } 657 - 658 - export { QueryObserver as Q, Table as T, TableHeader as a, TableRow as b, TableHead as c, TableBody as d, TableCell as e, buttonVariants as f, cn as g, defaultThrowOnError as h, useBaseQuery as u }; 659 - //# sourceMappingURL=table-VHJbrm0X.mjs.map
-1
.output/server/chunks/_/table-VHJbrm0X.mjs.map
··· 1 - {"version":3,"file":"table-VHJbrm0X.mjs","sources":["../../../../../node_modules/.pnpm/@tanstack+query-core@5.76.2/node_modules/@tanstack/query-core/build/modern/queryObserver.js","../../../../../node_modules/.pnpm/@tanstack+react-query@5.76.2_react@19.1.0/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js","../../../../../node_modules/.pnpm/@tanstack+react-query@5.76.2_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../../../../../node_modules/.pnpm/@tanstack+react-query@5.76.2_react@19.1.0/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../../../../../node_modules/.pnpm/@tanstack+react-query@5.76.2_react@19.1.0/node_modules/@tanstack/react-query/build/modern/suspense.js","../../../../../node_modules/.pnpm/@tanstack+react-query@5.76.2_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../../../../../src/lib/utils.ts","../../../../../src/components/ui/button.tsx","../../../../../src/components/ui/table.tsx"],"sourcesContent":null,"names":["_a"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5]}
-18
.output/server/chunks/_/useSuspenseQuery-D_gTj2Eu.mjs
··· 1 - import { u as useBaseQuery, Q as QueryObserver, h as defaultThrowOnError } from './table-VHJbrm0X.mjs'; 2 - 3 - function useSuspenseQuery(options, queryClient) { 4 - return useBaseQuery( 5 - { 6 - ...options, 7 - enabled: true, 8 - suspense: true, 9 - throwOnError: defaultThrowOnError, 10 - placeholderData: void 0 11 - }, 12 - QueryObserver, 13 - queryClient 14 - ); 15 - } 16 - 17 - export { useSuspenseQuery as u }; 18 - //# sourceMappingURL=useSuspenseQuery-D_gTj2Eu.mjs.map
-1
.output/server/chunks/_/useSuspenseQuery-D_gTj2Eu.mjs.map
··· 1 - {"version":3,"file":"useSuspenseQuery-D_gTj2Eu.mjs","sources":["../../../../../node_modules/.pnpm/@tanstack+react-query@5.76.2_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"],"sourcesContent":null,"names":[],"mappings":"","x_google_ignoreList":[0]}
-5018
.output/server/index.mjs
··· 1 - import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};import http, { Server as Server$1 } from 'node:http'; 2 - import https, { Server } from 'node:https'; 3 - import { EventEmitter } from 'node:events'; 4 - import { Buffer as Buffer$1 } from 'node:buffer'; 5 - import { promises, existsSync } from 'node:fs'; 6 - import { resolve as resolve$1, dirname as dirname$1, join } from 'node:path'; 7 - import { createHash } from 'node:crypto'; 8 - import { fileURLToPath } from 'node:url'; 9 - 10 - const suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/; 11 - const suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/; 12 - const JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/; 13 - function jsonParseTransform(key, value) { 14 - if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) { 15 - warnKeyDropped(key); 16 - return; 17 - } 18 - return value; 19 - } 20 - function warnKeyDropped(key) { 21 - console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`); 22 - } 23 - function destr(value, options = {}) { 24 - if (typeof value !== "string") { 25 - return value; 26 - } 27 - if (value[0] === '"' && value[value.length - 1] === '"' && value.indexOf("\\") === -1) { 28 - return value.slice(1, -1); 29 - } 30 - const _value = value.trim(); 31 - if (_value.length <= 9) { 32 - switch (_value.toLowerCase()) { 33 - case "true": { 34 - return true; 35 - } 36 - case "false": { 37 - return false; 38 - } 39 - case "undefined": { 40 - return void 0; 41 - } 42 - case "null": { 43 - return null; 44 - } 45 - case "nan": { 46 - return Number.NaN; 47 - } 48 - case "infinity": { 49 - return Number.POSITIVE_INFINITY; 50 - } 51 - case "-infinity": { 52 - return Number.NEGATIVE_INFINITY; 53 - } 54 - } 55 - } 56 - if (!JsonSigRx.test(value)) { 57 - if (options.strict) { 58 - throw new SyntaxError("[destr] Invalid JSON"); 59 - } 60 - return value; 61 - } 62 - try { 63 - if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) { 64 - if (options.strict) { 65 - throw new Error("[destr] Possible prototype pollution"); 66 - } 67 - return JSON.parse(value, jsonParseTransform); 68 - } 69 - return JSON.parse(value); 70 - } catch (error) { 71 - if (options.strict) { 72 - throw error; 73 - } 74 - return value; 75 - } 76 - } 77 - 78 - const HASH_RE = /#/g; 79 - const AMPERSAND_RE = /&/g; 80 - const SLASH_RE = /\//g; 81 - const EQUAL_RE = /=/g; 82 - const PLUS_RE = /\+/g; 83 - const ENC_CARET_RE = /%5e/gi; 84 - const ENC_BACKTICK_RE = /%60/gi; 85 - const ENC_PIPE_RE = /%7c/gi; 86 - const ENC_SPACE_RE = /%20/gi; 87 - const ENC_SLASH_RE = /%2f/gi; 88 - function encode(text) { 89 - return encodeURI("" + text).replace(ENC_PIPE_RE, "|"); 90 - } 91 - function encodeQueryValue(input) { 92 - return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F"); 93 - } 94 - function encodeQueryKey(text) { 95 - return encodeQueryValue(text).replace(EQUAL_RE, "%3D"); 96 - } 97 - function decode(text = "") { 98 - try { 99 - return decodeURIComponent("" + text); 100 - } catch { 101 - return "" + text; 102 - } 103 - } 104 - function decodePath(text) { 105 - return decode(text.replace(ENC_SLASH_RE, "%252F")); 106 - } 107 - function decodeQueryKey(text) { 108 - return decode(text.replace(PLUS_RE, " ")); 109 - } 110 - function decodeQueryValue(text) { 111 - return decode(text.replace(PLUS_RE, " ")); 112 - } 113 - 114 - function parseQuery(parametersString = "") { 115 - const object = /* @__PURE__ */ Object.create(null); 116 - if (parametersString[0] === "?") { 117 - parametersString = parametersString.slice(1); 118 - } 119 - for (const parameter of parametersString.split("&")) { 120 - const s = parameter.match(/([^=]+)=?(.*)/) || []; 121 - if (s.length < 2) { 122 - continue; 123 - } 124 - const key = decodeQueryKey(s[1]); 125 - if (key === "__proto__" || key === "constructor") { 126 - continue; 127 - } 128 - const value = decodeQueryValue(s[2] || ""); 129 - if (object[key] === void 0) { 130 - object[key] = value; 131 - } else if (Array.isArray(object[key])) { 132 - object[key].push(value); 133 - } else { 134 - object[key] = [object[key], value]; 135 - } 136 - } 137 - return object; 138 - } 139 - function encodeQueryItem(key, value) { 140 - if (typeof value === "number" || typeof value === "boolean") { 141 - value = String(value); 142 - } 143 - if (!value) { 144 - return encodeQueryKey(key); 145 - } 146 - if (Array.isArray(value)) { 147 - return value.map( 148 - (_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}` 149 - ).join("&"); 150 - } 151 - return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`; 152 - } 153 - function stringifyQuery(query) { 154 - return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&"); 155 - } 156 - 157 - const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/; 158 - const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/; 159 - const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/; 160 - const JOIN_LEADING_SLASH_RE = /^\.?\//; 161 - function hasProtocol(inputString, opts = {}) { 162 - if (typeof opts === "boolean") { 163 - opts = { acceptRelative: opts }; 164 - } 165 - if (opts.strict) { 166 - return PROTOCOL_STRICT_REGEX.test(inputString); 167 - } 168 - return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false); 169 - } 170 - function hasTrailingSlash(input = "", respectQueryAndFragment) { 171 - { 172 - return input.endsWith("/"); 173 - } 174 - } 175 - function withoutTrailingSlash(input = "", respectQueryAndFragment) { 176 - { 177 - return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/"; 178 - } 179 - } 180 - function withTrailingSlash(input = "", respectQueryAndFragment) { 181 - { 182 - return input.endsWith("/") ? input : input + "/"; 183 - } 184 - } 185 - function hasLeadingSlash(input = "") { 186 - return input.startsWith("/"); 187 - } 188 - function withLeadingSlash(input = "") { 189 - return hasLeadingSlash(input) ? input : "/" + input; 190 - } 191 - function withBase(input, base) { 192 - if (isEmptyURL(base) || hasProtocol(input)) { 193 - return input; 194 - } 195 - const _base = withoutTrailingSlash(base); 196 - if (input.startsWith(_base)) { 197 - return input; 198 - } 199 - return joinURL(_base, input); 200 - } 201 - function withoutBase(input, base) { 202 - if (isEmptyURL(base)) { 203 - return input; 204 - } 205 - const _base = withoutTrailingSlash(base); 206 - if (!input.startsWith(_base)) { 207 - return input; 208 - } 209 - const trimmed = input.slice(_base.length); 210 - return trimmed[0] === "/" ? trimmed : "/" + trimmed; 211 - } 212 - function withQuery(input, query) { 213 - const parsed = parseURL(input); 214 - const mergedQuery = { ...parseQuery(parsed.search), ...query }; 215 - parsed.search = stringifyQuery(mergedQuery); 216 - return stringifyParsedURL(parsed); 217 - } 218 - function getQuery(input) { 219 - return parseQuery(parseURL(input).search); 220 - } 221 - function isEmptyURL(url) { 222 - return !url || url === "/"; 223 - } 224 - function isNonEmptyURL(url) { 225 - return url && url !== "/"; 226 - } 227 - function joinURL(base, ...input) { 228 - let url = base || ""; 229 - for (const segment of input.filter((url2) => isNonEmptyURL(url2))) { 230 - if (url) { 231 - const _segment = segment.replace(JOIN_LEADING_SLASH_RE, ""); 232 - url = withTrailingSlash(url) + _segment; 233 - } else { 234 - url = segment; 235 - } 236 - } 237 - return url; 238 - } 239 - 240 - const protocolRelative = Symbol.for("ufo:protocolRelative"); 241 - function parseURL(input = "", defaultProto) { 242 - const _specialProtoMatch = input.match( 243 - /^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i 244 - ); 245 - if (_specialProtoMatch) { 246 - const [, _proto, _pathname = ""] = _specialProtoMatch; 247 - return { 248 - protocol: _proto.toLowerCase(), 249 - pathname: _pathname, 250 - href: _proto + _pathname, 251 - auth: "", 252 - host: "", 253 - search: "", 254 - hash: "" 255 - }; 256 - } 257 - if (!hasProtocol(input, { acceptRelative: true })) { 258 - return parsePath(input); 259 - } 260 - const [, protocol = "", auth, hostAndPath = ""] = input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || []; 261 - let [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || []; 262 - if (protocol === "file:") { 263 - path = path.replace(/\/(?=[A-Za-z]:)/, ""); 264 - } 265 - const { pathname, search, hash } = parsePath(path); 266 - return { 267 - protocol: protocol.toLowerCase(), 268 - auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "", 269 - host, 270 - pathname, 271 - search, 272 - hash, 273 - [protocolRelative]: !protocol 274 - }; 275 - } 276 - function parsePath(input = "") { 277 - const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1); 278 - return { 279 - pathname, 280 - search, 281 - hash 282 - }; 283 - } 284 - function stringifyParsedURL(parsed) { 285 - const pathname = parsed.pathname || ""; 286 - const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : ""; 287 - const hash = parsed.hash || ""; 288 - const auth = parsed.auth ? parsed.auth + "@" : ""; 289 - const host = parsed.host || ""; 290 - const proto = parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || "") + "//" : ""; 291 - return proto + auth + host + pathname + search + hash; 292 - } 293 - 294 - const NODE_TYPES = { 295 - NORMAL: 0, 296 - WILDCARD: 1, 297 - PLACEHOLDER: 2 298 - }; 299 - 300 - function createRouter$1(options = {}) { 301 - const ctx = { 302 - options, 303 - rootNode: createRadixNode(), 304 - staticRoutesMap: {} 305 - }; 306 - const normalizeTrailingSlash = (p) => options.strictTrailingSlash ? p : p.replace(/\/$/, "") || "/"; 307 - if (options.routes) { 308 - for (const path in options.routes) { 309 - insert(ctx, normalizeTrailingSlash(path), options.routes[path]); 310 - } 311 - } 312 - return { 313 - ctx, 314 - lookup: (path) => lookup(ctx, normalizeTrailingSlash(path)), 315 - insert: (path, data) => insert(ctx, normalizeTrailingSlash(path), data), 316 - remove: (path) => remove(ctx, normalizeTrailingSlash(path)) 317 - }; 318 - } 319 - function lookup(ctx, path) { 320 - const staticPathNode = ctx.staticRoutesMap[path]; 321 - if (staticPathNode) { 322 - return staticPathNode.data; 323 - } 324 - const sections = path.split("/"); 325 - const params = {}; 326 - let paramsFound = false; 327 - let wildcardNode = null; 328 - let node = ctx.rootNode; 329 - let wildCardParam = null; 330 - for (let i = 0; i < sections.length; i++) { 331 - const section = sections[i]; 332 - if (node.wildcardChildNode !== null) { 333 - wildcardNode = node.wildcardChildNode; 334 - wildCardParam = sections.slice(i).join("/"); 335 - } 336 - const nextNode = node.children.get(section); 337 - if (nextNode === void 0) { 338 - if (node && node.placeholderChildren.length > 1) { 339 - const remaining = sections.length - i; 340 - node = node.placeholderChildren.find((c) => c.maxDepth === remaining) || null; 341 - } else { 342 - node = node.placeholderChildren[0] || null; 343 - } 344 - if (!node) { 345 - break; 346 - } 347 - if (node.paramName) { 348 - params[node.paramName] = section; 349 - } 350 - paramsFound = true; 351 - } else { 352 - node = nextNode; 353 - } 354 - } 355 - if ((node === null || node.data === null) && wildcardNode !== null) { 356 - node = wildcardNode; 357 - params[node.paramName || "_"] = wildCardParam; 358 - paramsFound = true; 359 - } 360 - if (!node) { 361 - return null; 362 - } 363 - if (paramsFound) { 364 - return { 365 - ...node.data, 366 - params: paramsFound ? params : void 0 367 - }; 368 - } 369 - return node.data; 370 - } 371 - function insert(ctx, path, data) { 372 - let isStaticRoute = true; 373 - const sections = path.split("/"); 374 - let node = ctx.rootNode; 375 - let _unnamedPlaceholderCtr = 0; 376 - const matchedNodes = [node]; 377 - for (const section of sections) { 378 - let childNode; 379 - if (childNode = node.children.get(section)) { 380 - node = childNode; 381 - } else { 382 - const type = getNodeType(section); 383 - childNode = createRadixNode({ type, parent: node }); 384 - node.children.set(section, childNode); 385 - if (type === NODE_TYPES.PLACEHOLDER) { 386 - childNode.paramName = section === "*" ? `_${_unnamedPlaceholderCtr++}` : section.slice(1); 387 - node.placeholderChildren.push(childNode); 388 - isStaticRoute = false; 389 - } else if (type === NODE_TYPES.WILDCARD) { 390 - node.wildcardChildNode = childNode; 391 - childNode.paramName = section.slice( 392 - 3 393 - /* "**:" */ 394 - ) || "_"; 395 - isStaticRoute = false; 396 - } 397 - matchedNodes.push(childNode); 398 - node = childNode; 399 - } 400 - } 401 - for (const [depth, node2] of matchedNodes.entries()) { 402 - node2.maxDepth = Math.max(matchedNodes.length - depth, node2.maxDepth || 0); 403 - } 404 - node.data = data; 405 - if (isStaticRoute === true) { 406 - ctx.staticRoutesMap[path] = node; 407 - } 408 - return node; 409 - } 410 - function remove(ctx, path) { 411 - let success = false; 412 - const sections = path.split("/"); 413 - let node = ctx.rootNode; 414 - for (const section of sections) { 415 - node = node.children.get(section); 416 - if (!node) { 417 - return success; 418 - } 419 - } 420 - if (node.data) { 421 - const lastSection = sections.at(-1) || ""; 422 - node.data = null; 423 - if (Object.keys(node.children).length === 0 && node.parent) { 424 - node.parent.children.delete(lastSection); 425 - node.parent.wildcardChildNode = null; 426 - node.parent.placeholderChildren = []; 427 - } 428 - success = true; 429 - } 430 - return success; 431 - } 432 - function createRadixNode(options = {}) { 433 - return { 434 - type: options.type || NODE_TYPES.NORMAL, 435 - maxDepth: 0, 436 - parent: options.parent || null, 437 - children: /* @__PURE__ */ new Map(), 438 - data: options.data || null, 439 - paramName: options.paramName || null, 440 - wildcardChildNode: null, 441 - placeholderChildren: [] 442 - }; 443 - } 444 - function getNodeType(str) { 445 - if (str.startsWith("**")) { 446 - return NODE_TYPES.WILDCARD; 447 - } 448 - if (str[0] === ":" || str === "*") { 449 - return NODE_TYPES.PLACEHOLDER; 450 - } 451 - return NODE_TYPES.NORMAL; 452 - } 453 - 454 - function toRouteMatcher(router) { 455 - const table = _routerNodeToTable("", router.ctx.rootNode); 456 - return _createMatcher(table, router.ctx.options.strictTrailingSlash); 457 - } 458 - function _createMatcher(table, strictTrailingSlash) { 459 - return { 460 - ctx: { table }, 461 - matchAll: (path) => _matchRoutes(path, table, strictTrailingSlash) 462 - }; 463 - } 464 - function _createRouteTable() { 465 - return { 466 - static: /* @__PURE__ */ new Map(), 467 - wildcard: /* @__PURE__ */ new Map(), 468 - dynamic: /* @__PURE__ */ new Map() 469 - }; 470 - } 471 - function _matchRoutes(path, table, strictTrailingSlash) { 472 - if (strictTrailingSlash !== true && path.endsWith("/")) { 473 - path = path.slice(0, -1) || "/"; 474 - } 475 - const matches = []; 476 - for (const [key, value] of _sortRoutesMap(table.wildcard)) { 477 - if (path === key || path.startsWith(key + "/")) { 478 - matches.push(value); 479 - } 480 - } 481 - for (const [key, value] of _sortRoutesMap(table.dynamic)) { 482 - if (path.startsWith(key + "/")) { 483 - const subPath = "/" + path.slice(key.length).split("/").splice(2).join("/"); 484 - matches.push(..._matchRoutes(subPath, value)); 485 - } 486 - } 487 - const staticMatch = table.static.get(path); 488 - if (staticMatch) { 489 - matches.push(staticMatch); 490 - } 491 - return matches.filter(Boolean); 492 - } 493 - function _sortRoutesMap(m) { 494 - return [...m.entries()].sort((a, b) => a[0].length - b[0].length); 495 - } 496 - function _routerNodeToTable(initialPath, initialNode) { 497 - const table = _createRouteTable(); 498 - function _addNode(path, node) { 499 - if (path) { 500 - if (node.type === NODE_TYPES.NORMAL && !(path.includes("*") || path.includes(":"))) { 501 - if (node.data) { 502 - table.static.set(path, node.data); 503 - } 504 - } else if (node.type === NODE_TYPES.WILDCARD) { 505 - table.wildcard.set(path.replace("/**", ""), node.data); 506 - } else if (node.type === NODE_TYPES.PLACEHOLDER) { 507 - const subTable = _routerNodeToTable("", node); 508 - if (node.data) { 509 - subTable.static.set("/", node.data); 510 - } 511 - table.dynamic.set(path.replace(/\/\*|\/:\w+/, ""), subTable); 512 - return; 513 - } 514 - } 515 - for (const [childPath, child] of node.children.entries()) { 516 - _addNode(`${path}/${childPath}`.replace("//", "/"), child); 517 - } 518 - } 519 - _addNode(initialPath, initialNode); 520 - return table; 521 - } 522 - 523 - function isPlainObject(value) { 524 - if (value === null || typeof value !== "object") { 525 - return false; 526 - } 527 - const prototype = Object.getPrototypeOf(value); 528 - if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) { 529 - return false; 530 - } 531 - if (Symbol.iterator in value) { 532 - return false; 533 - } 534 - if (Symbol.toStringTag in value) { 535 - return Object.prototype.toString.call(value) === "[object Module]"; 536 - } 537 - return true; 538 - } 539 - 540 - function _defu(baseObject, defaults, namespace = ".", merger) { 541 - if (!isPlainObject(defaults)) { 542 - return _defu(baseObject, {}, namespace, merger); 543 - } 544 - const object = Object.assign({}, defaults); 545 - for (const key in baseObject) { 546 - if (key === "__proto__" || key === "constructor") { 547 - continue; 548 - } 549 - const value = baseObject[key]; 550 - if (value === null || value === void 0) { 551 - continue; 552 - } 553 - if (merger && merger(object, key, value, namespace)) { 554 - continue; 555 - } 556 - if (Array.isArray(value) && Array.isArray(object[key])) { 557 - object[key] = [...value, ...object[key]]; 558 - } else if (isPlainObject(value) && isPlainObject(object[key])) { 559 - object[key] = _defu( 560 - value, 561 - object[key], 562 - (namespace ? `${namespace}.` : "") + key.toString(), 563 - merger 564 - ); 565 - } else { 566 - object[key] = value; 567 - } 568 - } 569 - return object; 570 - } 571 - function createDefu(merger) { 572 - return (...arguments_) => ( 573 - // eslint-disable-next-line unicorn/no-array-reduce 574 - arguments_.reduce((p, c) => _defu(p, c, "", merger), {}) 575 - ); 576 - } 577 - const defu = createDefu(); 578 - const defuFn = createDefu((object, key, currentValue) => { 579 - if (object[key] !== void 0 && typeof currentValue === "function") { 580 - object[key] = currentValue(object[key]); 581 - return true; 582 - } 583 - }); 584 - 585 - function o(n){throw new Error(`${n} is not implemented yet!`)}let i$1 = class i extends EventEmitter{__unenv__={};readableEncoding=null;readableEnded=true;readableFlowing=false;readableHighWaterMark=0;readableLength=0;readableObjectMode=false;readableAborted=false;readableDidRead=false;closed=false;errored=null;readable=false;destroyed=false;static from(e,t){return new i(t)}constructor(e){super();}_read(e){}read(e){}setEncoding(e){return this}pause(){return this}resume(){return this}isPaused(){return true}unpipe(e){return this}unshift(e,t){}wrap(e){return this}push(e,t){return false}_destroy(e,t){this.removeAllListeners();}destroy(e){return this.destroyed=true,this._destroy(e),this}pipe(e,t){return {}}compose(e,t){throw new Error("Method not implemented.")}[Symbol.asyncDispose](){return this.destroy(),Promise.resolve()}async*[Symbol.asyncIterator](){throw o("Readable.asyncIterator")}iterator(e){throw o("Readable.iterator")}map(e,t){throw o("Readable.map")}filter(e,t){throw o("Readable.filter")}forEach(e,t){throw o("Readable.forEach")}reduce(e,t,r){throw o("Readable.reduce")}find(e,t){throw o("Readable.find")}findIndex(e,t){throw o("Readable.findIndex")}some(e,t){throw o("Readable.some")}toArray(e){throw o("Readable.toArray")}every(e,t){throw o("Readable.every")}flatMap(e,t){throw o("Readable.flatMap")}drop(e,t){throw o("Readable.drop")}take(e,t){throw o("Readable.take")}asIndexedPairs(e){throw o("Readable.asIndexedPairs")}};let l$1 = class l extends EventEmitter{__unenv__={};writable=true;writableEnded=false;writableFinished=false;writableHighWaterMark=0;writableLength=0;writableObjectMode=false;writableCorked=0;closed=false;errored=null;writableNeedDrain=false;destroyed=false;_data;_encoding="utf8";constructor(e){super();}pipe(e,t){return {}}_write(e,t,r){if(this.writableEnded){r&&r();return}if(this._data===void 0)this._data=e;else {const s=typeof this._data=="string"?Buffer$1.from(this._data,this._encoding||t||"utf8"):this._data,a=typeof e=="string"?Buffer$1.from(e,t||this._encoding||"utf8"):e;this._data=Buffer$1.concat([s,a]);}this._encoding=t,r&&r();}_writev(e,t){}_destroy(e,t){}_final(e){}write(e,t,r){const s=typeof t=="string"?this._encoding:"utf8",a=typeof t=="function"?t:typeof r=="function"?r:void 0;return this._write(e,s,a),true}setDefaultEncoding(e){return this}end(e,t,r){const s=typeof e=="function"?e:typeof t=="function"?t:typeof r=="function"?r:void 0;if(this.writableEnded)return s&&s(),this;const a=e===s?void 0:e;if(a){const u=t===s?void 0:t;this.write(a,u,s);}return this.writableEnded=true,this.writableFinished=true,this.emit("close"),this.emit("finish"),this}cork(){}uncork(){}destroy(e){return this.destroyed=true,delete this._data,this.removeAllListeners(),this}compose(e,t){throw new Error("Method not implemented.")}};const c=class{allowHalfOpen=true;_destroy;constructor(e=new i$1,t=new l$1){Object.assign(this,e),Object.assign(this,t),this._destroy=g(e._destroy,t._destroy);}};function _(){return Object.assign(c.prototype,i$1.prototype),Object.assign(c.prototype,l$1.prototype),c}function g(...n){return function(...e){for(const t of n)t(...e);}}const m=_();class A extends m{__unenv__={};bufferSize=0;bytesRead=0;bytesWritten=0;connecting=false;destroyed=false;pending=false;localAddress="";localPort=0;remoteAddress="";remoteFamily="";remotePort=0;autoSelectFamilyAttemptedAddresses=[];readyState="readOnly";constructor(e){super();}write(e,t,r){return false}connect(e,t,r){return this}end(e,t,r){return this}setEncoding(e){return this}pause(){return this}resume(){return this}setTimeout(e,t){return this}setNoDelay(e){return this}setKeepAlive(e,t){return this}address(){return {}}unref(){return this}ref(){return this}destroySoon(){this.destroy();}resetAndDestroy(){const e=new Error("ERR_SOCKET_CLOSED");return e.code="ERR_SOCKET_CLOSED",this.destroy(e),this}}class y extends i$1{aborted=false;httpVersion="1.1";httpVersionMajor=1;httpVersionMinor=1;complete=true;connection;socket;headers={};trailers={};method="GET";url="/";statusCode=200;statusMessage="";closed=false;errored=null;readable=false;constructor(e){super(),this.socket=this.connection=e||new A;}get rawHeaders(){const e=this.headers,t=[];for(const r in e)if(Array.isArray(e[r]))for(const s of e[r])t.push(r,s);else t.push(r,e[r]);return t}get rawTrailers(){return []}setTimeout(e,t){return this}get headersDistinct(){return p(this.headers)}get trailersDistinct(){return p(this.trailers)}}function p(n){const e={};for(const[t,r]of Object.entries(n))t&&(e[t]=(Array.isArray(r)?r:[r]).filter(Boolean));return e}class w extends l$1{statusCode=200;statusMessage="";upgrading=false;chunkedEncoding=false;shouldKeepAlive=false;useChunkedEncodingByDefault=false;sendDate=false;finished=false;headersSent=false;strictContentLength=false;connection=null;socket=null;req;_headers={};constructor(e){super(),this.req=e;}assignSocket(e){e._httpMessage=this,this.socket=e,this.connection=e,this.emit("socket",e),this._flush();}_flush(){this.flushHeaders();}detachSocket(e){}writeContinue(e){}writeHead(e,t,r){e&&(this.statusCode=e),typeof t=="string"&&(this.statusMessage=t,t=void 0);const s=r||t;if(s&&!Array.isArray(s))for(const a in s)this.setHeader(a,s[a]);return this.headersSent=true,this}writeProcessing(){}setTimeout(e,t){return this}appendHeader(e,t){e=e.toLowerCase();const r=this._headers[e],s=[...Array.isArray(r)?r:[r],...Array.isArray(t)?t:[t]].filter(Boolean);return this._headers[e]=s.length>1?s:s[0],this}setHeader(e,t){return this._headers[e.toLowerCase()]=t,this}setHeaders(e){for(const[t,r]of Object.entries(e))this.setHeader(t,r);return this}getHeader(e){return this._headers[e.toLowerCase()]}getHeaders(){return this._headers}getHeaderNames(){return Object.keys(this._headers)}hasHeader(e){return e.toLowerCase()in this._headers}removeHeader(e){delete this._headers[e.toLowerCase()];}addTrailers(e){}flushHeaders(){}writeEarlyHints(e,t){typeof t=="function"&&t();}}const E=(()=>{const n=function(){};return n.prototype=Object.create(null),n})();function R(n={}){const e=new E,t=Array.isArray(n)||H(n)?n:Object.entries(n);for(const[r,s]of t)if(s){if(e[r]===void 0){e[r]=s;continue}e[r]=[...Array.isArray(e[r])?e[r]:[e[r]],...Array.isArray(s)?s:[s]];}return e}function H(n){return typeof n?.entries=="function"}function S(n={}){if(n instanceof Headers)return n;const e=new Headers;for(const[t,r]of Object.entries(n))if(r!==void 0){if(Array.isArray(r)){for(const s of r)e.append(t,String(s));continue}e.set(t,String(r));}return e}const C=new Set([101,204,205,304]);async function b(n,e){const t=new y,r=new w(t);t.url=e.url?.toString()||"/";let s;if(!t.url.startsWith("/")){const d=new URL(t.url);s=d.host,t.url=d.pathname+d.search+d.hash;}t.method=e.method||"GET",t.headers=R(e.headers||{}),t.headers.host||(t.headers.host=e.host||s||"localhost"),t.connection.encrypted=t.connection.encrypted||e.protocol==="https",t.body=e.body||null,t.__unenv__=e.context,await n(t,r);let a=r._data;(C.has(r.statusCode)||t.method.toUpperCase()==="HEAD")&&(a=null,delete r._headers["content-length"]);const u={status:r.statusCode,statusText:r.statusMessage,headers:r._headers,body:a};return t.destroy(),r.destroy(),u}async function O(n,e,t={}){try{const r=await b(n,{url:e,...t});return new Response(r.body,{status:r.status,statusText:r.statusText,headers:S(r.headers)})}catch(r){return new Response(r.toString(),{status:Number.parseInt(r.statusCode||r.code)||500,statusText:r.statusText})}} 586 - 587 - function hasProp(obj, prop) { 588 - try { 589 - return prop in obj; 590 - } catch { 591 - return false; 592 - } 593 - } 594 - 595 - class H3Error extends Error { 596 - static __h3_error__ = true; 597 - statusCode = 500; 598 - fatal = false; 599 - unhandled = false; 600 - statusMessage; 601 - data; 602 - cause; 603 - constructor(message, opts = {}) { 604 - super(message, opts); 605 - if (opts.cause && !this.cause) { 606 - this.cause = opts.cause; 607 - } 608 - } 609 - toJSON() { 610 - const obj = { 611 - message: this.message, 612 - statusCode: sanitizeStatusCode(this.statusCode, 500) 613 - }; 614 - if (this.statusMessage) { 615 - obj.statusMessage = sanitizeStatusMessage(this.statusMessage); 616 - } 617 - if (this.data !== void 0) { 618 - obj.data = this.data; 619 - } 620 - return obj; 621 - } 622 - } 623 - function createError$1(input) { 624 - if (typeof input === "string") { 625 - return new H3Error(input); 626 - } 627 - if (isError(input)) { 628 - return input; 629 - } 630 - const err = new H3Error(input.message ?? input.statusMessage ?? "", { 631 - cause: input.cause || input 632 - }); 633 - if (hasProp(input, "stack")) { 634 - try { 635 - Object.defineProperty(err, "stack", { 636 - get() { 637 - return input.stack; 638 - } 639 - }); 640 - } catch { 641 - try { 642 - err.stack = input.stack; 643 - } catch { 644 - } 645 - } 646 - } 647 - if (input.data) { 648 - err.data = input.data; 649 - } 650 - if (input.statusCode) { 651 - err.statusCode = sanitizeStatusCode(input.statusCode, err.statusCode); 652 - } else if (input.status) { 653 - err.statusCode = sanitizeStatusCode(input.status, err.statusCode); 654 - } 655 - if (input.statusMessage) { 656 - err.statusMessage = input.statusMessage; 657 - } else if (input.statusText) { 658 - err.statusMessage = input.statusText; 659 - } 660 - if (err.statusMessage) { 661 - const originalMessage = err.statusMessage; 662 - const sanitizedMessage = sanitizeStatusMessage(err.statusMessage); 663 - if (sanitizedMessage !== originalMessage) { 664 - console.warn( 665 - "[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default." 666 - ); 667 - } 668 - } 669 - if (input.fatal !== void 0) { 670 - err.fatal = input.fatal; 671 - } 672 - if (input.unhandled !== void 0) { 673 - err.unhandled = input.unhandled; 674 - } 675 - return err; 676 - } 677 - function sendError(event, error, debug) { 678 - if (event.handled) { 679 - return; 680 - } 681 - const h3Error = isError(error) ? error : createError$1(error); 682 - const responseBody = { 683 - statusCode: h3Error.statusCode, 684 - statusMessage: h3Error.statusMessage, 685 - stack: [], 686 - data: h3Error.data 687 - }; 688 - if (debug) { 689 - responseBody.stack = (h3Error.stack || "").split("\n").map((l) => l.trim()); 690 - } 691 - if (event.handled) { 692 - return; 693 - } 694 - const _code = Number.parseInt(h3Error.statusCode); 695 - setResponseStatus(event, _code, h3Error.statusMessage); 696 - event.node.res.setHeader("content-type", MIMES.json); 697 - event.node.res.end(JSON.stringify(responseBody, void 0, 2)); 698 - } 699 - function isError(input) { 700 - return input?.constructor?.__h3_error__ === true; 701 - } 702 - function isMethod(event, expected, allowHead) { 703 - if (typeof expected === "string") { 704 - if (event.method === expected) { 705 - return true; 706 - } 707 - } else if (expected.includes(event.method)) { 708 - return true; 709 - } 710 - return false; 711 - } 712 - function assertMethod(event, expected, allowHead) { 713 - if (!isMethod(event, expected)) { 714 - throw createError$1({ 715 - statusCode: 405, 716 - statusMessage: "HTTP method is not allowed." 717 - }); 718 - } 719 - } 720 - function getRequestHeaders(event) { 721 - const _headers = {}; 722 - for (const key in event.node.req.headers) { 723 - const val = event.node.req.headers[key]; 724 - _headers[key] = Array.isArray(val) ? val.filter(Boolean).join(", ") : val; 725 - } 726 - return _headers; 727 - } 728 - function getRequestHeader(event, name) { 729 - const headers = getRequestHeaders(event); 730 - const value = headers[name.toLowerCase()]; 731 - return value; 732 - } 733 - function getRequestHost(event, opts = {}) { 734 - if (opts.xForwardedHost) { 735 - const xForwardedHost = event.node.req.headers["x-forwarded-host"]; 736 - if (xForwardedHost) { 737 - return xForwardedHost; 738 - } 739 - } 740 - return event.node.req.headers.host || "localhost"; 741 - } 742 - function getRequestProtocol(event, opts = {}) { 743 - if (opts.xForwardedProto !== false && event.node.req.headers["x-forwarded-proto"] === "https") { 744 - return "https"; 745 - } 746 - return event.node.req.connection?.encrypted ? "https" : "http"; 747 - } 748 - function getRequestURL(event, opts = {}) { 749 - const host = getRequestHost(event, opts); 750 - const protocol = getRequestProtocol(event, opts); 751 - const path = (event.node.req.originalUrl || event.path).replace( 752 - /^[/\\]+/g, 753 - "/" 754 - ); 755 - return new URL(path, `${protocol}://${host}`); 756 - } 757 - 758 - const RawBodySymbol = Symbol.for("h3RawBody"); 759 - const PayloadMethods$1 = ["PATCH", "POST", "PUT", "DELETE"]; 760 - function readRawBody(event, encoding = "utf8") { 761 - assertMethod(event, PayloadMethods$1); 762 - const _rawBody = event._requestBody || event.web?.request?.body || event.node.req[RawBodySymbol] || event.node.req.rawBody || event.node.req.body; 763 - if (_rawBody) { 764 - const promise2 = Promise.resolve(_rawBody).then((_resolved) => { 765 - if (Buffer.isBuffer(_resolved)) { 766 - return _resolved; 767 - } 768 - if (typeof _resolved.pipeTo === "function") { 769 - return new Promise((resolve, reject) => { 770 - const chunks = []; 771 - _resolved.pipeTo( 772 - new WritableStream({ 773 - write(chunk) { 774 - chunks.push(chunk); 775 - }, 776 - close() { 777 - resolve(Buffer.concat(chunks)); 778 - }, 779 - abort(reason) { 780 - reject(reason); 781 - } 782 - }) 783 - ).catch(reject); 784 - }); 785 - } else if (typeof _resolved.pipe === "function") { 786 - return new Promise((resolve, reject) => { 787 - const chunks = []; 788 - _resolved.on("data", (chunk) => { 789 - chunks.push(chunk); 790 - }).on("end", () => { 791 - resolve(Buffer.concat(chunks)); 792 - }).on("error", reject); 793 - }); 794 - } 795 - if (_resolved.constructor === Object) { 796 - return Buffer.from(JSON.stringify(_resolved)); 797 - } 798 - if (_resolved instanceof URLSearchParams) { 799 - return Buffer.from(_resolved.toString()); 800 - } 801 - if (_resolved instanceof FormData) { 802 - return new Response(_resolved).bytes().then((uint8arr) => Buffer.from(uint8arr)); 803 - } 804 - return Buffer.from(_resolved); 805 - }); 806 - return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2; 807 - } 808 - if (!Number.parseInt(event.node.req.headers["content-length"] || "") && !String(event.node.req.headers["transfer-encoding"] ?? "").split(",").map((e) => e.trim()).filter(Boolean).includes("chunked")) { 809 - return Promise.resolve(void 0); 810 - } 811 - const promise = event.node.req[RawBodySymbol] = new Promise( 812 - (resolve, reject) => { 813 - const bodyData = []; 814 - event.node.req.on("error", (err) => { 815 - reject(err); 816 - }).on("data", (chunk) => { 817 - bodyData.push(chunk); 818 - }).on("end", () => { 819 - resolve(Buffer.concat(bodyData)); 820 - }); 821 - } 822 - ); 823 - const result = encoding ? promise.then((buff) => buff.toString(encoding)) : promise; 824 - return result; 825 - } 826 - function getRequestWebStream(event) { 827 - if (!PayloadMethods$1.includes(event.method)) { 828 - return; 829 - } 830 - const bodyStream = event.web?.request?.body || event._requestBody; 831 - if (bodyStream) { 832 - return bodyStream; 833 - } 834 - const _hasRawBody = RawBodySymbol in event.node.req || "rawBody" in event.node.req || "body" in event.node.req || "__unenv__" in event.node.req; 835 - if (_hasRawBody) { 836 - return new ReadableStream({ 837 - async start(controller) { 838 - const _rawBody = await readRawBody(event, false); 839 - if (_rawBody) { 840 - controller.enqueue(_rawBody); 841 - } 842 - controller.close(); 843 - } 844 - }); 845 - } 846 - return new ReadableStream({ 847 - start: (controller) => { 848 - event.node.req.on("data", (chunk) => { 849 - controller.enqueue(chunk); 850 - }); 851 - event.node.req.on("end", () => { 852 - controller.close(); 853 - }); 854 - event.node.req.on("error", (err) => { 855 - controller.error(err); 856 - }); 857 - } 858 - }); 859 - } 860 - 861 - function handleCacheHeaders(event, opts) { 862 - const cacheControls = ["public", ...opts.cacheControls || []]; 863 - let cacheMatched = false; 864 - if (opts.maxAge !== void 0) { 865 - cacheControls.push(`max-age=${+opts.maxAge}`, `s-maxage=${+opts.maxAge}`); 866 - } 867 - if (opts.modifiedTime) { 868 - const modifiedTime = new Date(opts.modifiedTime); 869 - const ifModifiedSince = event.node.req.headers["if-modified-since"]; 870 - event.node.res.setHeader("last-modified", modifiedTime.toUTCString()); 871 - if (ifModifiedSince && new Date(ifModifiedSince) >= modifiedTime) { 872 - cacheMatched = true; 873 - } 874 - } 875 - if (opts.etag) { 876 - event.node.res.setHeader("etag", opts.etag); 877 - const ifNonMatch = event.node.req.headers["if-none-match"]; 878 - if (ifNonMatch === opts.etag) { 879 - cacheMatched = true; 880 - } 881 - } 882 - event.node.res.setHeader("cache-control", cacheControls.join(", ")); 883 - if (cacheMatched) { 884 - event.node.res.statusCode = 304; 885 - if (!event.handled) { 886 - event.node.res.end(); 887 - } 888 - return true; 889 - } 890 - return false; 891 - } 892 - 893 - const MIMES = { 894 - html: "text/html", 895 - json: "application/json" 896 - }; 897 - 898 - const DISALLOWED_STATUS_CHARS = /[^\u0009\u0020-\u007E]/g; 899 - function sanitizeStatusMessage(statusMessage = "") { 900 - return statusMessage.replace(DISALLOWED_STATUS_CHARS, ""); 901 - } 902 - function sanitizeStatusCode(statusCode, defaultStatusCode = 200) { 903 - if (!statusCode) { 904 - return defaultStatusCode; 905 - } 906 - if (typeof statusCode === "string") { 907 - statusCode = Number.parseInt(statusCode, 10); 908 - } 909 - if (statusCode < 100 || statusCode > 999) { 910 - return defaultStatusCode; 911 - } 912 - return statusCode; 913 - } 914 - function splitCookiesString(cookiesString) { 915 - if (Array.isArray(cookiesString)) { 916 - return cookiesString.flatMap((c) => splitCookiesString(c)); 917 - } 918 - if (typeof cookiesString !== "string") { 919 - return []; 920 - } 921 - const cookiesStrings = []; 922 - let pos = 0; 923 - let start; 924 - let ch; 925 - let lastComma; 926 - let nextStart; 927 - let cookiesSeparatorFound; 928 - const skipWhitespace = () => { 929 - while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) { 930 - pos += 1; 931 - } 932 - return pos < cookiesString.length; 933 - }; 934 - const notSpecialChar = () => { 935 - ch = cookiesString.charAt(pos); 936 - return ch !== "=" && ch !== ";" && ch !== ","; 937 - }; 938 - while (pos < cookiesString.length) { 939 - start = pos; 940 - cookiesSeparatorFound = false; 941 - while (skipWhitespace()) { 942 - ch = cookiesString.charAt(pos); 943 - if (ch === ",") { 944 - lastComma = pos; 945 - pos += 1; 946 - skipWhitespace(); 947 - nextStart = pos; 948 - while (pos < cookiesString.length && notSpecialChar()) { 949 - pos += 1; 950 - } 951 - if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") { 952 - cookiesSeparatorFound = true; 953 - pos = nextStart; 954 - cookiesStrings.push(cookiesString.slice(start, lastComma)); 955 - start = pos; 956 - } else { 957 - pos = lastComma + 1; 958 - } 959 - } else { 960 - pos += 1; 961 - } 962 - } 963 - if (!cookiesSeparatorFound || pos >= cookiesString.length) { 964 - cookiesStrings.push(cookiesString.slice(start)); 965 - } 966 - } 967 - return cookiesStrings; 968 - } 969 - 970 - const defer = typeof setImmediate === "undefined" ? (fn) => fn() : setImmediate; 971 - function send(event, data, type) { 972 - if (type) { 973 - defaultContentType(event, type); 974 - } 975 - return new Promise((resolve) => { 976 - defer(() => { 977 - if (!event.handled) { 978 - event.node.res.end(data); 979 - } 980 - resolve(); 981 - }); 982 - }); 983 - } 984 - function sendNoContent(event, code) { 985 - if (event.handled) { 986 - return; 987 - } 988 - if (!code && event.node.res.statusCode !== 200) { 989 - code = event.node.res.statusCode; 990 - } 991 - const _code = sanitizeStatusCode(code, 204); 992 - if (_code === 204) { 993 - event.node.res.removeHeader("content-length"); 994 - } 995 - event.node.res.writeHead(_code); 996 - event.node.res.end(); 997 - } 998 - function setResponseStatus(event, code, text) { 999 - if (code) { 1000 - event.node.res.statusCode = sanitizeStatusCode( 1001 - code, 1002 - event.node.res.statusCode 1003 - ); 1004 - } 1005 - if (text) { 1006 - event.node.res.statusMessage = sanitizeStatusMessage(text); 1007 - } 1008 - } 1009 - function defaultContentType(event, type) { 1010 - if (type && event.node.res.statusCode !== 304 && !event.node.res.getHeader("content-type")) { 1011 - event.node.res.setHeader("content-type", type); 1012 - } 1013 - } 1014 - function sendRedirect(event, location, code = 302) { 1015 - event.node.res.statusCode = sanitizeStatusCode( 1016 - code, 1017 - event.node.res.statusCode 1018 - ); 1019 - event.node.res.setHeader("location", location); 1020 - const encodedLoc = location.replace(/"/g, "%22"); 1021 - const html = `<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${encodedLoc}"></head></html>`; 1022 - return send(event, html, MIMES.html); 1023 - } 1024 - function getResponseHeader(event, name) { 1025 - return event.node.res.getHeader(name); 1026 - } 1027 - function setResponseHeaders(event, headers) { 1028 - for (const [name, value] of Object.entries(headers)) { 1029 - event.node.res.setHeader( 1030 - name, 1031 - value 1032 - ); 1033 - } 1034 - } 1035 - const setHeaders = setResponseHeaders; 1036 - function setResponseHeader(event, name, value) { 1037 - event.node.res.setHeader(name, value); 1038 - } 1039 - function appendResponseHeader(event, name, value) { 1040 - let current = event.node.res.getHeader(name); 1041 - if (!current) { 1042 - event.node.res.setHeader(name, value); 1043 - return; 1044 - } 1045 - if (!Array.isArray(current)) { 1046 - current = [current.toString()]; 1047 - } 1048 - event.node.res.setHeader(name, [...current, value]); 1049 - } 1050 - function removeResponseHeader(event, name) { 1051 - return event.node.res.removeHeader(name); 1052 - } 1053 - function isStream(data) { 1054 - if (!data || typeof data !== "object") { 1055 - return false; 1056 - } 1057 - if (typeof data.pipe === "function") { 1058 - if (typeof data._read === "function") { 1059 - return true; 1060 - } 1061 - if (typeof data.abort === "function") { 1062 - return true; 1063 - } 1064 - } 1065 - if (typeof data.pipeTo === "function") { 1066 - return true; 1067 - } 1068 - return false; 1069 - } 1070 - function isWebResponse(data) { 1071 - return typeof Response !== "undefined" && data instanceof Response; 1072 - } 1073 - function sendStream(event, stream) { 1074 - if (!stream || typeof stream !== "object") { 1075 - throw new Error("[h3] Invalid stream provided."); 1076 - } 1077 - event.node.res._data = stream; 1078 - if (!event.node.res.socket) { 1079 - event._handled = true; 1080 - return Promise.resolve(); 1081 - } 1082 - if (hasProp(stream, "pipeTo") && typeof stream.pipeTo === "function") { 1083 - return stream.pipeTo( 1084 - new WritableStream({ 1085 - write(chunk) { 1086 - event.node.res.write(chunk); 1087 - } 1088 - }) 1089 - ).then(() => { 1090 - event.node.res.end(); 1091 - }); 1092 - } 1093 - if (hasProp(stream, "pipe") && typeof stream.pipe === "function") { 1094 - return new Promise((resolve, reject) => { 1095 - stream.pipe(event.node.res); 1096 - if (stream.on) { 1097 - stream.on("end", () => { 1098 - event.node.res.end(); 1099 - resolve(); 1100 - }); 1101 - stream.on("error", (error) => { 1102 - reject(error); 1103 - }); 1104 - } 1105 - event.node.res.on("close", () => { 1106 - if (stream.abort) { 1107 - stream.abort(); 1108 - } 1109 - }); 1110 - }); 1111 - } 1112 - throw new Error("[h3] Invalid or incompatible stream provided."); 1113 - } 1114 - function sendWebResponse(event, response) { 1115 - for (const [key, value] of response.headers) { 1116 - if (key === "set-cookie") { 1117 - event.node.res.appendHeader(key, splitCookiesString(value)); 1118 - } else { 1119 - event.node.res.setHeader(key, value); 1120 - } 1121 - } 1122 - if (response.status) { 1123 - event.node.res.statusCode = sanitizeStatusCode( 1124 - response.status, 1125 - event.node.res.statusCode 1126 - ); 1127 - } 1128 - if (response.statusText) { 1129 - event.node.res.statusMessage = sanitizeStatusMessage(response.statusText); 1130 - } 1131 - if (response.redirected) { 1132 - event.node.res.setHeader("location", response.url); 1133 - } 1134 - if (!response.body) { 1135 - event.node.res.end(); 1136 - return; 1137 - } 1138 - return sendStream(event, response.body); 1139 - } 1140 - 1141 - const PayloadMethods = /* @__PURE__ */ new Set(["PATCH", "POST", "PUT", "DELETE"]); 1142 - const ignoredHeaders = /* @__PURE__ */ new Set([ 1143 - "transfer-encoding", 1144 - "accept-encoding", 1145 - "connection", 1146 - "keep-alive", 1147 - "upgrade", 1148 - "expect", 1149 - "host", 1150 - "accept" 1151 - ]); 1152 - async function proxyRequest(event, target, opts = {}) { 1153 - let body; 1154 - let duplex; 1155 - if (PayloadMethods.has(event.method)) { 1156 - if (opts.streamRequest) { 1157 - body = getRequestWebStream(event); 1158 - duplex = "half"; 1159 - } else { 1160 - body = await readRawBody(event, false).catch(() => void 0); 1161 - } 1162 - } 1163 - const method = opts.fetchOptions?.method || event.method; 1164 - const fetchHeaders = mergeHeaders$1( 1165 - getProxyRequestHeaders(event, { host: target.startsWith("/") }), 1166 - opts.fetchOptions?.headers, 1167 - opts.headers 1168 - ); 1169 - return sendProxy(event, target, { 1170 - ...opts, 1171 - fetchOptions: { 1172 - method, 1173 - body, 1174 - duplex, 1175 - ...opts.fetchOptions, 1176 - headers: fetchHeaders 1177 - } 1178 - }); 1179 - } 1180 - async function sendProxy(event, target, opts = {}) { 1181 - let response; 1182 - try { 1183 - response = await _getFetch(opts.fetch)(target, { 1184 - headers: opts.headers, 1185 - ignoreResponseError: true, 1186 - // make $ofetch.raw transparent 1187 - ...opts.fetchOptions 1188 - }); 1189 - } catch (error) { 1190 - throw createError$1({ 1191 - status: 502, 1192 - statusMessage: "Bad Gateway", 1193 - cause: error 1194 - }); 1195 - } 1196 - event.node.res.statusCode = sanitizeStatusCode( 1197 - response.status, 1198 - event.node.res.statusCode 1199 - ); 1200 - event.node.res.statusMessage = sanitizeStatusMessage(response.statusText); 1201 - const cookies = []; 1202 - for (const [key, value] of response.headers.entries()) { 1203 - if (key === "content-encoding") { 1204 - continue; 1205 - } 1206 - if (key === "content-length") { 1207 - continue; 1208 - } 1209 - if (key === "set-cookie") { 1210 - cookies.push(...splitCookiesString(value)); 1211 - continue; 1212 - } 1213 - event.node.res.setHeader(key, value); 1214 - } 1215 - if (cookies.length > 0) { 1216 - event.node.res.setHeader( 1217 - "set-cookie", 1218 - cookies.map((cookie) => { 1219 - if (opts.cookieDomainRewrite) { 1220 - cookie = rewriteCookieProperty( 1221 - cookie, 1222 - opts.cookieDomainRewrite, 1223 - "domain" 1224 - ); 1225 - } 1226 - if (opts.cookiePathRewrite) { 1227 - cookie = rewriteCookieProperty( 1228 - cookie, 1229 - opts.cookiePathRewrite, 1230 - "path" 1231 - ); 1232 - } 1233 - return cookie; 1234 - }) 1235 - ); 1236 - } 1237 - if (opts.onResponse) { 1238 - await opts.onResponse(event, response); 1239 - } 1240 - if (response._data !== void 0) { 1241 - return response._data; 1242 - } 1243 - if (event.handled) { 1244 - return; 1245 - } 1246 - if (opts.sendStream === false) { 1247 - const data = new Uint8Array(await response.arrayBuffer()); 1248 - return event.node.res.end(data); 1249 - } 1250 - if (response.body) { 1251 - for await (const chunk of response.body) { 1252 - event.node.res.write(chunk); 1253 - } 1254 - } 1255 - return event.node.res.end(); 1256 - } 1257 - function getProxyRequestHeaders(event, opts) { 1258 - const headers = /* @__PURE__ */ Object.create(null); 1259 - const reqHeaders = getRequestHeaders(event); 1260 - for (const name in reqHeaders) { 1261 - if (!ignoredHeaders.has(name) || name === "host" && opts?.host) { 1262 - headers[name] = reqHeaders[name]; 1263 - } 1264 - } 1265 - return headers; 1266 - } 1267 - function fetchWithEvent(event, req, init, options) { 1268 - return _getFetch(options?.fetch)(req, { 1269 - ...init, 1270 - context: init?.context || event.context, 1271 - headers: { 1272 - ...getProxyRequestHeaders(event, { 1273 - host: typeof req === "string" && req.startsWith("/") 1274 - }), 1275 - ...init?.headers 1276 - } 1277 - }); 1278 - } 1279 - function _getFetch(_fetch) { 1280 - if (_fetch) { 1281 - return _fetch; 1282 - } 1283 - if (globalThis.fetch) { 1284 - return globalThis.fetch; 1285 - } 1286 - throw new Error( 1287 - "fetch is not available. Try importing `node-fetch-native/polyfill` for Node.js." 1288 - ); 1289 - } 1290 - function rewriteCookieProperty(header, map, property) { 1291 - const _map = typeof map === "string" ? { "*": map } : map; 1292 - return header.replace( 1293 - new RegExp(`(;\\s*${property}=)([^;]+)`, "gi"), 1294 - (match, prefix, previousValue) => { 1295 - let newValue; 1296 - if (previousValue in _map) { 1297 - newValue = _map[previousValue]; 1298 - } else if ("*" in _map) { 1299 - newValue = _map["*"]; 1300 - } else { 1301 - return match; 1302 - } 1303 - return newValue ? prefix + newValue : ""; 1304 - } 1305 - ); 1306 - } 1307 - function mergeHeaders$1(defaults, ...inputs) { 1308 - const _inputs = inputs.filter(Boolean); 1309 - if (_inputs.length === 0) { 1310 - return defaults; 1311 - } 1312 - const merged = new Headers(defaults); 1313 - for (const input of _inputs) { 1314 - const entries = Array.isArray(input) ? input : typeof input.entries === "function" ? input.entries() : Object.entries(input); 1315 - for (const [key, value] of entries) { 1316 - if (value !== void 0) { 1317 - merged.set(key, value); 1318 - } 1319 - } 1320 - } 1321 - return merged; 1322 - } 1323 - 1324 - class H3Event { 1325 - "__is_event__" = true; 1326 - // Context 1327 - node; 1328 - // Node 1329 - web; 1330 - // Web 1331 - context = {}; 1332 - // Shared 1333 - // Request 1334 - _method; 1335 - _path; 1336 - _headers; 1337 - _requestBody; 1338 - // Response 1339 - _handled = false; 1340 - // Hooks 1341 - _onBeforeResponseCalled; 1342 - _onAfterResponseCalled; 1343 - constructor(req, res) { 1344 - this.node = { req, res }; 1345 - } 1346 - // --- Request --- 1347 - get method() { 1348 - if (!this._method) { 1349 - this._method = (this.node.req.method || "GET").toUpperCase(); 1350 - } 1351 - return this._method; 1352 - } 1353 - get path() { 1354 - return this._path || this.node.req.url || "/"; 1355 - } 1356 - get headers() { 1357 - if (!this._headers) { 1358 - this._headers = _normalizeNodeHeaders(this.node.req.headers); 1359 - } 1360 - return this._headers; 1361 - } 1362 - // --- Respoonse --- 1363 - get handled() { 1364 - return this._handled || this.node.res.writableEnded || this.node.res.headersSent; 1365 - } 1366 - respondWith(response) { 1367 - return Promise.resolve(response).then( 1368 - (_response) => sendWebResponse(this, _response) 1369 - ); 1370 - } 1371 - // --- Utils --- 1372 - toString() { 1373 - return `[${this.method}] ${this.path}`; 1374 - } 1375 - toJSON() { 1376 - return this.toString(); 1377 - } 1378 - // --- Deprecated --- 1379 - /** @deprecated Please use `event.node.req` instead. */ 1380 - get req() { 1381 - return this.node.req; 1382 - } 1383 - /** @deprecated Please use `event.node.res` instead. */ 1384 - get res() { 1385 - return this.node.res; 1386 - } 1387 - } 1388 - function isEvent(input) { 1389 - return hasProp(input, "__is_event__"); 1390 - } 1391 - function createEvent(req, res) { 1392 - return new H3Event(req, res); 1393 - } 1394 - function _normalizeNodeHeaders(nodeHeaders) { 1395 - const headers = new Headers(); 1396 - for (const [name, value] of Object.entries(nodeHeaders)) { 1397 - if (Array.isArray(value)) { 1398 - for (const item of value) { 1399 - headers.append(name, item); 1400 - } 1401 - } else if (value) { 1402 - headers.set(name, value); 1403 - } 1404 - } 1405 - return headers; 1406 - } 1407 - 1408 - function defineEventHandler(handler) { 1409 - if (typeof handler === "function") { 1410 - handler.__is_handler__ = true; 1411 - return handler; 1412 - } 1413 - const _hooks = { 1414 - onRequest: _normalizeArray(handler.onRequest), 1415 - onBeforeResponse: _normalizeArray(handler.onBeforeResponse) 1416 - }; 1417 - const _handler = (event) => { 1418 - return _callHandler(event, handler.handler, _hooks); 1419 - }; 1420 - _handler.__is_handler__ = true; 1421 - _handler.__resolve__ = handler.handler.__resolve__; 1422 - _handler.__websocket__ = handler.websocket; 1423 - return _handler; 1424 - } 1425 - function _normalizeArray(input) { 1426 - return input ? Array.isArray(input) ? input : [input] : void 0; 1427 - } 1428 - async function _callHandler(event, handler, hooks) { 1429 - if (hooks.onRequest) { 1430 - for (const hook of hooks.onRequest) { 1431 - await hook(event); 1432 - if (event.handled) { 1433 - return; 1434 - } 1435 - } 1436 - } 1437 - const body = await handler(event); 1438 - const response = { body }; 1439 - if (hooks.onBeforeResponse) { 1440 - for (const hook of hooks.onBeforeResponse) { 1441 - await hook(event, response); 1442 - } 1443 - } 1444 - return response.body; 1445 - } 1446 - const eventHandler = defineEventHandler; 1447 - function isEventHandler(input) { 1448 - return hasProp(input, "__is_handler__"); 1449 - } 1450 - function toEventHandler(input, _, _route) { 1451 - if (!isEventHandler(input)) { 1452 - console.warn( 1453 - "[h3] Implicit event handler conversion is deprecated. Use `eventHandler()` or `fromNodeMiddleware()` to define event handlers.", 1454 - _route && _route !== "/" ? ` 1455 - Route: ${_route}` : "", 1456 - ` 1457 - Handler: ${input}` 1458 - ); 1459 - } 1460 - return input; 1461 - } 1462 - function defineLazyEventHandler(factory) { 1463 - let _promise; 1464 - let _resolved; 1465 - const resolveHandler = () => { 1466 - if (_resolved) { 1467 - return Promise.resolve(_resolved); 1468 - } 1469 - if (!_promise) { 1470 - _promise = Promise.resolve(factory()).then((r) => { 1471 - const handler2 = r.default || r; 1472 - if (typeof handler2 !== "function") { 1473 - throw new TypeError( 1474 - "Invalid lazy handler result. It should be a function:", 1475 - handler2 1476 - ); 1477 - } 1478 - _resolved = { handler: toEventHandler(r.default || r) }; 1479 - return _resolved; 1480 - }); 1481 - } 1482 - return _promise; 1483 - }; 1484 - const handler = eventHandler((event) => { 1485 - if (_resolved) { 1486 - return _resolved.handler(event); 1487 - } 1488 - return resolveHandler().then((r) => r.handler(event)); 1489 - }); 1490 - handler.__resolve__ = resolveHandler; 1491 - return handler; 1492 - } 1493 - const lazyEventHandler = defineLazyEventHandler; 1494 - 1495 - function createApp(options = {}) { 1496 - const stack = []; 1497 - const handler = createAppEventHandler(stack, options); 1498 - const resolve = createResolver(stack); 1499 - handler.__resolve__ = resolve; 1500 - const getWebsocket = cachedFn(() => websocketOptions(resolve, options)); 1501 - const app = { 1502 - // @ts-expect-error 1503 - use: (arg1, arg2, arg3) => use(app, arg1, arg2, arg3), 1504 - resolve, 1505 - handler, 1506 - stack, 1507 - options, 1508 - get websocket() { 1509 - return getWebsocket(); 1510 - } 1511 - }; 1512 - return app; 1513 - } 1514 - function use(app, arg1, arg2, arg3) { 1515 - if (Array.isArray(arg1)) { 1516 - for (const i of arg1) { 1517 - use(app, i, arg2, arg3); 1518 - } 1519 - } else if (Array.isArray(arg2)) { 1520 - for (const i of arg2) { 1521 - use(app, arg1, i, arg3); 1522 - } 1523 - } else if (typeof arg1 === "string") { 1524 - app.stack.push( 1525 - normalizeLayer({ ...arg3, route: arg1, handler: arg2 }) 1526 - ); 1527 - } else if (typeof arg1 === "function") { 1528 - app.stack.push(normalizeLayer({ ...arg2, handler: arg1 })); 1529 - } else { 1530 - app.stack.push(normalizeLayer({ ...arg1 })); 1531 - } 1532 - return app; 1533 - } 1534 - function createAppEventHandler(stack, options) { 1535 - const spacing = options.debug ? 2 : void 0; 1536 - return eventHandler(async (event) => { 1537 - event.node.req.originalUrl = event.node.req.originalUrl || event.node.req.url || "/"; 1538 - const _reqPath = event._path || event.node.req.url || "/"; 1539 - let _layerPath; 1540 - if (options.onRequest) { 1541 - await options.onRequest(event); 1542 - } 1543 - for (const layer of stack) { 1544 - if (layer.route.length > 1) { 1545 - if (!_reqPath.startsWith(layer.route)) { 1546 - continue; 1547 - } 1548 - _layerPath = _reqPath.slice(layer.route.length) || "/"; 1549 - } else { 1550 - _layerPath = _reqPath; 1551 - } 1552 - if (layer.match && !layer.match(_layerPath, event)) { 1553 - continue; 1554 - } 1555 - event._path = _layerPath; 1556 - event.node.req.url = _layerPath; 1557 - const val = await layer.handler(event); 1558 - const _body = val === void 0 ? void 0 : await val; 1559 - if (_body !== void 0) { 1560 - const _response = { body: _body }; 1561 - if (options.onBeforeResponse) { 1562 - event._onBeforeResponseCalled = true; 1563 - await options.onBeforeResponse(event, _response); 1564 - } 1565 - await handleHandlerResponse(event, _response.body, spacing); 1566 - if (options.onAfterResponse) { 1567 - event._onAfterResponseCalled = true; 1568 - await options.onAfterResponse(event, _response); 1569 - } 1570 - return; 1571 - } 1572 - if (event.handled) { 1573 - if (options.onAfterResponse) { 1574 - event._onAfterResponseCalled = true; 1575 - await options.onAfterResponse(event, void 0); 1576 - } 1577 - return; 1578 - } 1579 - } 1580 - if (!event.handled) { 1581 - throw createError$1({ 1582 - statusCode: 404, 1583 - statusMessage: `Cannot find any path matching ${event.path || "/"}.` 1584 - }); 1585 - } 1586 - if (options.onAfterResponse) { 1587 - event._onAfterResponseCalled = true; 1588 - await options.onAfterResponse(event, void 0); 1589 - } 1590 - }); 1591 - } 1592 - function createResolver(stack) { 1593 - return async (path) => { 1594 - let _layerPath; 1595 - for (const layer of stack) { 1596 - if (layer.route === "/" && !layer.handler.__resolve__) { 1597 - continue; 1598 - } 1599 - if (!path.startsWith(layer.route)) { 1600 - continue; 1601 - } 1602 - _layerPath = path.slice(layer.route.length) || "/"; 1603 - if (layer.match && !layer.match(_layerPath, void 0)) { 1604 - continue; 1605 - } 1606 - let res = { route: layer.route, handler: layer.handler }; 1607 - if (res.handler.__resolve__) { 1608 - const _res = await res.handler.__resolve__(_layerPath); 1609 - if (!_res) { 1610 - continue; 1611 - } 1612 - res = { 1613 - ...res, 1614 - ..._res, 1615 - route: joinURL(res.route || "/", _res.route || "/") 1616 - }; 1617 - } 1618 - return res; 1619 - } 1620 - }; 1621 - } 1622 - function normalizeLayer(input) { 1623 - let handler = input.handler; 1624 - if (handler.handler) { 1625 - handler = handler.handler; 1626 - } 1627 - if (input.lazy) { 1628 - handler = lazyEventHandler(handler); 1629 - } else if (!isEventHandler(handler)) { 1630 - handler = toEventHandler(handler, void 0, input.route); 1631 - } 1632 - return { 1633 - route: withoutTrailingSlash(input.route), 1634 - match: input.match, 1635 - handler 1636 - }; 1637 - } 1638 - function handleHandlerResponse(event, val, jsonSpace) { 1639 - if (val === null) { 1640 - return sendNoContent(event); 1641 - } 1642 - if (val) { 1643 - if (isWebResponse(val)) { 1644 - return sendWebResponse(event, val); 1645 - } 1646 - if (isStream(val)) { 1647 - return sendStream(event, val); 1648 - } 1649 - if (val.buffer) { 1650 - return send(event, val); 1651 - } 1652 - if (val.arrayBuffer && typeof val.arrayBuffer === "function") { 1653 - return val.arrayBuffer().then((arrayBuffer) => { 1654 - return send(event, Buffer.from(arrayBuffer), val.type); 1655 - }); 1656 - } 1657 - if (val instanceof Error) { 1658 - throw createError$1(val); 1659 - } 1660 - if (typeof val.end === "function") { 1661 - return true; 1662 - } 1663 - } 1664 - const valType = typeof val; 1665 - if (valType === "string") { 1666 - return send(event, val, MIMES.html); 1667 - } 1668 - if (valType === "object" || valType === "boolean" || valType === "number") { 1669 - return send(event, JSON.stringify(val, void 0, jsonSpace), MIMES.json); 1670 - } 1671 - if (valType === "bigint") { 1672 - return send(event, val.toString(), MIMES.json); 1673 - } 1674 - throw createError$1({ 1675 - statusCode: 500, 1676 - statusMessage: `[h3] Cannot send ${valType} as response.` 1677 - }); 1678 - } 1679 - function cachedFn(fn) { 1680 - let cache; 1681 - return () => { 1682 - if (!cache) { 1683 - cache = fn(); 1684 - } 1685 - return cache; 1686 - }; 1687 - } 1688 - function websocketOptions(evResolver, appOptions) { 1689 - return { 1690 - ...appOptions.websocket, 1691 - async resolve(info) { 1692 - const url = info.request?.url || info.url || "/"; 1693 - const { pathname } = typeof url === "string" ? parseURL(url) : url; 1694 - const resolved = await evResolver(pathname); 1695 - return resolved?.handler?.__websocket__ || {}; 1696 - } 1697 - }; 1698 - } 1699 - 1700 - const RouterMethods = [ 1701 - "connect", 1702 - "delete", 1703 - "get", 1704 - "head", 1705 - "options", 1706 - "post", 1707 - "put", 1708 - "trace", 1709 - "patch" 1710 - ]; 1711 - function createRouter(opts = {}) { 1712 - const _router = createRouter$1({}); 1713 - const routes = {}; 1714 - let _matcher; 1715 - const router = {}; 1716 - const addRoute = (path, handler, method) => { 1717 - let route = routes[path]; 1718 - if (!route) { 1719 - routes[path] = route = { path, handlers: {} }; 1720 - _router.insert(path, route); 1721 - } 1722 - if (Array.isArray(method)) { 1723 - for (const m of method) { 1724 - addRoute(path, handler, m); 1725 - } 1726 - } else { 1727 - route.handlers[method] = toEventHandler(handler, void 0, path); 1728 - } 1729 - return router; 1730 - }; 1731 - router.use = router.add = (path, handler, method) => addRoute(path, handler, method || "all"); 1732 - for (const method of RouterMethods) { 1733 - router[method] = (path, handle) => router.add(path, handle, method); 1734 - } 1735 - const matchHandler = (path = "/", method = "get") => { 1736 - const qIndex = path.indexOf("?"); 1737 - if (qIndex !== -1) { 1738 - path = path.slice(0, Math.max(0, qIndex)); 1739 - } 1740 - const matched = _router.lookup(path); 1741 - if (!matched || !matched.handlers) { 1742 - return { 1743 - error: createError$1({ 1744 - statusCode: 404, 1745 - name: "Not Found", 1746 - statusMessage: `Cannot find any route matching ${path || "/"}.` 1747 - }) 1748 - }; 1749 - } 1750 - let handler = matched.handlers[method] || matched.handlers.all; 1751 - if (!handler) { 1752 - if (!_matcher) { 1753 - _matcher = toRouteMatcher(_router); 1754 - } 1755 - const _matches = _matcher.matchAll(path).reverse(); 1756 - for (const _match of _matches) { 1757 - if (_match.handlers[method]) { 1758 - handler = _match.handlers[method]; 1759 - matched.handlers[method] = matched.handlers[method] || handler; 1760 - break; 1761 - } 1762 - if (_match.handlers.all) { 1763 - handler = _match.handlers.all; 1764 - matched.handlers.all = matched.handlers.all || handler; 1765 - break; 1766 - } 1767 - } 1768 - } 1769 - if (!handler) { 1770 - return { 1771 - error: createError$1({ 1772 - statusCode: 405, 1773 - name: "Method Not Allowed", 1774 - statusMessage: `Method ${method} is not allowed on this route.` 1775 - }) 1776 - }; 1777 - } 1778 - return { matched, handler }; 1779 - }; 1780 - const isPreemptive = opts.preemptive || opts.preemtive; 1781 - router.handler = eventHandler((event) => { 1782 - const match = matchHandler( 1783 - event.path, 1784 - event.method.toLowerCase() 1785 - ); 1786 - if ("error" in match) { 1787 - if (isPreemptive) { 1788 - throw match.error; 1789 - } else { 1790 - return; 1791 - } 1792 - } 1793 - event.context.matchedRoute = match.matched; 1794 - const params = match.matched.params || {}; 1795 - event.context.params = params; 1796 - return Promise.resolve(match.handler(event)).then((res) => { 1797 - if (res === void 0 && isPreemptive) { 1798 - return null; 1799 - } 1800 - return res; 1801 - }); 1802 - }); 1803 - router.handler.__resolve__ = async (path) => { 1804 - path = withLeadingSlash(path); 1805 - const match = matchHandler(path); 1806 - if ("error" in match) { 1807 - return; 1808 - } 1809 - let res = { 1810 - route: match.matched.path, 1811 - handler: match.handler 1812 - }; 1813 - if (match.handler.__resolve__) { 1814 - const _res = await match.handler.__resolve__(path); 1815 - if (!_res) { 1816 - return; 1817 - } 1818 - res = { ...res, ..._res }; 1819 - } 1820 - return res; 1821 - }; 1822 - return router; 1823 - } 1824 - function toNodeListener(app) { 1825 - const toNodeHandle = async function(req, res) { 1826 - const event = createEvent(req, res); 1827 - try { 1828 - await app.handler(event); 1829 - } catch (_error) { 1830 - const error = createError$1(_error); 1831 - if (!isError(_error)) { 1832 - error.unhandled = true; 1833 - } 1834 - setResponseStatus(event, error.statusCode, error.statusMessage); 1835 - if (app.options.onError) { 1836 - await app.options.onError(error, event); 1837 - } 1838 - if (event.handled) { 1839 - return; 1840 - } 1841 - if (error.unhandled || error.fatal) { 1842 - console.error("[h3]", error.fatal ? "[fatal]" : "[unhandled]", error); 1843 - } 1844 - if (app.options.onBeforeResponse && !event._onBeforeResponseCalled) { 1845 - await app.options.onBeforeResponse(event, { body: error }); 1846 - } 1847 - await sendError(event, error, !!app.options.debug); 1848 - if (app.options.onAfterResponse && !event._onAfterResponseCalled) { 1849 - await app.options.onAfterResponse(event, { body: error }); 1850 - } 1851 - } 1852 - }; 1853 - return toNodeHandle; 1854 - } 1855 - 1856 - function flatHooks(configHooks, hooks = {}, parentName) { 1857 - for (const key in configHooks) { 1858 - const subHook = configHooks[key]; 1859 - const name = parentName ? `${parentName}:${key}` : key; 1860 - if (typeof subHook === "object" && subHook !== null) { 1861 - flatHooks(subHook, hooks, name); 1862 - } else if (typeof subHook === "function") { 1863 - hooks[name] = subHook; 1864 - } 1865 - } 1866 - return hooks; 1867 - } 1868 - const defaultTask = { run: (function_) => function_() }; 1869 - const _createTask = () => defaultTask; 1870 - const createTask = typeof console.createTask !== "undefined" ? console.createTask : _createTask; 1871 - function serialTaskCaller(hooks, args) { 1872 - const name = args.shift(); 1873 - const task = createTask(name); 1874 - return hooks.reduce( 1875 - (promise, hookFunction) => promise.then(() => task.run(() => hookFunction(...args))), 1876 - Promise.resolve() 1877 - ); 1878 - } 1879 - function parallelTaskCaller(hooks, args) { 1880 - const name = args.shift(); 1881 - const task = createTask(name); 1882 - return Promise.all(hooks.map((hook) => task.run(() => hook(...args)))); 1883 - } 1884 - function callEachWith(callbacks, arg0) { 1885 - for (const callback of [...callbacks]) { 1886 - callback(arg0); 1887 - } 1888 - } 1889 - 1890 - class Hookable { 1891 - constructor() { 1892 - this._hooks = {}; 1893 - this._before = void 0; 1894 - this._after = void 0; 1895 - this._deprecatedMessages = void 0; 1896 - this._deprecatedHooks = {}; 1897 - this.hook = this.hook.bind(this); 1898 - this.callHook = this.callHook.bind(this); 1899 - this.callHookWith = this.callHookWith.bind(this); 1900 - } 1901 - hook(name, function_, options = {}) { 1902 - if (!name || typeof function_ !== "function") { 1903 - return () => { 1904 - }; 1905 - } 1906 - const originalName = name; 1907 - let dep; 1908 - while (this._deprecatedHooks[name]) { 1909 - dep = this._deprecatedHooks[name]; 1910 - name = dep.to; 1911 - } 1912 - if (dep && !options.allowDeprecated) { 1913 - let message = dep.message; 1914 - if (!message) { 1915 - message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : ""); 1916 - } 1917 - if (!this._deprecatedMessages) { 1918 - this._deprecatedMessages = /* @__PURE__ */ new Set(); 1919 - } 1920 - if (!this._deprecatedMessages.has(message)) { 1921 - console.warn(message); 1922 - this._deprecatedMessages.add(message); 1923 - } 1924 - } 1925 - if (!function_.name) { 1926 - try { 1927 - Object.defineProperty(function_, "name", { 1928 - get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb", 1929 - configurable: true 1930 - }); 1931 - } catch { 1932 - } 1933 - } 1934 - this._hooks[name] = this._hooks[name] || []; 1935 - this._hooks[name].push(function_); 1936 - return () => { 1937 - if (function_) { 1938 - this.removeHook(name, function_); 1939 - function_ = void 0; 1940 - } 1941 - }; 1942 - } 1943 - hookOnce(name, function_) { 1944 - let _unreg; 1945 - let _function = (...arguments_) => { 1946 - if (typeof _unreg === "function") { 1947 - _unreg(); 1948 - } 1949 - _unreg = void 0; 1950 - _function = void 0; 1951 - return function_(...arguments_); 1952 - }; 1953 - _unreg = this.hook(name, _function); 1954 - return _unreg; 1955 - } 1956 - removeHook(name, function_) { 1957 - if (this._hooks[name]) { 1958 - const index = this._hooks[name].indexOf(function_); 1959 - if (index !== -1) { 1960 - this._hooks[name].splice(index, 1); 1961 - } 1962 - if (this._hooks[name].length === 0) { 1963 - delete this._hooks[name]; 1964 - } 1965 - } 1966 - } 1967 - deprecateHook(name, deprecated) { 1968 - this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated; 1969 - const _hooks = this._hooks[name] || []; 1970 - delete this._hooks[name]; 1971 - for (const hook of _hooks) { 1972 - this.hook(name, hook); 1973 - } 1974 - } 1975 - deprecateHooks(deprecatedHooks) { 1976 - Object.assign(this._deprecatedHooks, deprecatedHooks); 1977 - for (const name in deprecatedHooks) { 1978 - this.deprecateHook(name, deprecatedHooks[name]); 1979 - } 1980 - } 1981 - addHooks(configHooks) { 1982 - const hooks = flatHooks(configHooks); 1983 - const removeFns = Object.keys(hooks).map( 1984 - (key) => this.hook(key, hooks[key]) 1985 - ); 1986 - return () => { 1987 - for (const unreg of removeFns.splice(0, removeFns.length)) { 1988 - unreg(); 1989 - } 1990 - }; 1991 - } 1992 - removeHooks(configHooks) { 1993 - const hooks = flatHooks(configHooks); 1994 - for (const key in hooks) { 1995 - this.removeHook(key, hooks[key]); 1996 - } 1997 - } 1998 - removeAllHooks() { 1999 - for (const key in this._hooks) { 2000 - delete this._hooks[key]; 2001 - } 2002 - } 2003 - callHook(name, ...arguments_) { 2004 - arguments_.unshift(name); 2005 - return this.callHookWith(serialTaskCaller, name, ...arguments_); 2006 - } 2007 - callHookParallel(name, ...arguments_) { 2008 - arguments_.unshift(name); 2009 - return this.callHookWith(parallelTaskCaller, name, ...arguments_); 2010 - } 2011 - callHookWith(caller, name, ...arguments_) { 2012 - const event = this._before || this._after ? { name, args: arguments_, context: {} } : void 0; 2013 - if (this._before) { 2014 - callEachWith(this._before, event); 2015 - } 2016 - const result = caller( 2017 - name in this._hooks ? [...this._hooks[name]] : [], 2018 - arguments_ 2019 - ); 2020 - if (result instanceof Promise) { 2021 - return result.finally(() => { 2022 - if (this._after && event) { 2023 - callEachWith(this._after, event); 2024 - } 2025 - }); 2026 - } 2027 - if (this._after && event) { 2028 - callEachWith(this._after, event); 2029 - } 2030 - return result; 2031 - } 2032 - beforeEach(function_) { 2033 - this._before = this._before || []; 2034 - this._before.push(function_); 2035 - return () => { 2036 - if (this._before !== void 0) { 2037 - const index = this._before.indexOf(function_); 2038 - if (index !== -1) { 2039 - this._before.splice(index, 1); 2040 - } 2041 - } 2042 - }; 2043 - } 2044 - afterEach(function_) { 2045 - this._after = this._after || []; 2046 - this._after.push(function_); 2047 - return () => { 2048 - if (this._after !== void 0) { 2049 - const index = this._after.indexOf(function_); 2050 - if (index !== -1) { 2051 - this._after.splice(index, 1); 2052 - } 2053 - } 2054 - }; 2055 - } 2056 - } 2057 - function createHooks() { 2058 - return new Hookable(); 2059 - } 2060 - 2061 - const s$1=globalThis.Headers,i=globalThis.AbortController,l=globalThis.fetch||(()=>{throw new Error("[node-fetch-native] Failed to fetch: `globalThis.fetch` is not available!")}); 2062 - 2063 - class FetchError extends Error { 2064 - constructor(message, opts) { 2065 - super(message, opts); 2066 - this.name = "FetchError"; 2067 - if (opts?.cause && !this.cause) { 2068 - this.cause = opts.cause; 2069 - } 2070 - } 2071 - } 2072 - function createFetchError(ctx) { 2073 - const errorMessage = ctx.error?.message || ctx.error?.toString() || ""; 2074 - const method = ctx.request?.method || ctx.options?.method || "GET"; 2075 - const url = ctx.request?.url || String(ctx.request) || "/"; 2076 - const requestStr = `[${method}] ${JSON.stringify(url)}`; 2077 - const statusStr = ctx.response ? `${ctx.response.status} ${ctx.response.statusText}` : "<no response>"; 2078 - const message = `${requestStr}: ${statusStr}${errorMessage ? ` ${errorMessage}` : ""}`; 2079 - const fetchError = new FetchError( 2080 - message, 2081 - ctx.error ? { cause: ctx.error } : void 0 2082 - ); 2083 - for (const key of ["request", "options", "response"]) { 2084 - Object.defineProperty(fetchError, key, { 2085 - get() { 2086 - return ctx[key]; 2087 - } 2088 - }); 2089 - } 2090 - for (const [key, refKey] of [ 2091 - ["data", "_data"], 2092 - ["status", "status"], 2093 - ["statusCode", "status"], 2094 - ["statusText", "statusText"], 2095 - ["statusMessage", "statusText"] 2096 - ]) { 2097 - Object.defineProperty(fetchError, key, { 2098 - get() { 2099 - return ctx.response && ctx.response[refKey]; 2100 - } 2101 - }); 2102 - } 2103 - return fetchError; 2104 - } 2105 - 2106 - const payloadMethods = new Set( 2107 - Object.freeze(["PATCH", "POST", "PUT", "DELETE"]) 2108 - ); 2109 - function isPayloadMethod(method = "GET") { 2110 - return payloadMethods.has(method.toUpperCase()); 2111 - } 2112 - function isJSONSerializable(value) { 2113 - if (value === void 0) { 2114 - return false; 2115 - } 2116 - const t = typeof value; 2117 - if (t === "string" || t === "number" || t === "boolean" || t === null) { 2118 - return true; 2119 - } 2120 - if (t !== "object") { 2121 - return false; 2122 - } 2123 - if (Array.isArray(value)) { 2124 - return true; 2125 - } 2126 - if (value.buffer) { 2127 - return false; 2128 - } 2129 - return value.constructor && value.constructor.name === "Object" || typeof value.toJSON === "function"; 2130 - } 2131 - const textTypes = /* @__PURE__ */ new Set([ 2132 - "image/svg", 2133 - "application/xml", 2134 - "application/xhtml", 2135 - "application/html" 2136 - ]); 2137 - const JSON_RE = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i; 2138 - function detectResponseType(_contentType = "") { 2139 - if (!_contentType) { 2140 - return "json"; 2141 - } 2142 - const contentType = _contentType.split(";").shift() || ""; 2143 - if (JSON_RE.test(contentType)) { 2144 - return "json"; 2145 - } 2146 - if (textTypes.has(contentType) || contentType.startsWith("text/")) { 2147 - return "text"; 2148 - } 2149 - return "blob"; 2150 - } 2151 - function resolveFetchOptions(request, input, defaults, Headers) { 2152 - const headers = mergeHeaders( 2153 - input?.headers ?? request?.headers, 2154 - defaults?.headers, 2155 - Headers 2156 - ); 2157 - let query; 2158 - if (defaults?.query || defaults?.params || input?.params || input?.query) { 2159 - query = { 2160 - ...defaults?.params, 2161 - ...defaults?.query, 2162 - ...input?.params, 2163 - ...input?.query 2164 - }; 2165 - } 2166 - return { 2167 - ...defaults, 2168 - ...input, 2169 - query, 2170 - params: query, 2171 - headers 2172 - }; 2173 - } 2174 - function mergeHeaders(input, defaults, Headers) { 2175 - if (!defaults) { 2176 - return new Headers(input); 2177 - } 2178 - const headers = new Headers(defaults); 2179 - if (input) { 2180 - for (const [key, value] of Symbol.iterator in input || Array.isArray(input) ? input : new Headers(input)) { 2181 - headers.set(key, value); 2182 - } 2183 - } 2184 - return headers; 2185 - } 2186 - async function callHooks(context, hooks) { 2187 - if (hooks) { 2188 - if (Array.isArray(hooks)) { 2189 - for (const hook of hooks) { 2190 - await hook(context); 2191 - } 2192 - } else { 2193 - await hooks(context); 2194 - } 2195 - } 2196 - } 2197 - 2198 - const retryStatusCodes = /* @__PURE__ */ new Set([ 2199 - 408, 2200 - // Request Timeout 2201 - 409, 2202 - // Conflict 2203 - 425, 2204 - // Too Early (Experimental) 2205 - 429, 2206 - // Too Many Requests 2207 - 500, 2208 - // Internal Server Error 2209 - 502, 2210 - // Bad Gateway 2211 - 503, 2212 - // Service Unavailable 2213 - 504 2214 - // Gateway Timeout 2215 - ]); 2216 - const nullBodyResponses = /* @__PURE__ */ new Set([101, 204, 205, 304]); 2217 - function createFetch(globalOptions = {}) { 2218 - const { 2219 - fetch = globalThis.fetch, 2220 - Headers = globalThis.Headers, 2221 - AbortController = globalThis.AbortController 2222 - } = globalOptions; 2223 - async function onError(context) { 2224 - const isAbort = context.error && context.error.name === "AbortError" && !context.options.timeout || false; 2225 - if (context.options.retry !== false && !isAbort) { 2226 - let retries; 2227 - if (typeof context.options.retry === "number") { 2228 - retries = context.options.retry; 2229 - } else { 2230 - retries = isPayloadMethod(context.options.method) ? 0 : 1; 2231 - } 2232 - const responseCode = context.response && context.response.status || 500; 2233 - if (retries > 0 && (Array.isArray(context.options.retryStatusCodes) ? context.options.retryStatusCodes.includes(responseCode) : retryStatusCodes.has(responseCode))) { 2234 - const retryDelay = typeof context.options.retryDelay === "function" ? context.options.retryDelay(context) : context.options.retryDelay || 0; 2235 - if (retryDelay > 0) { 2236 - await new Promise((resolve) => setTimeout(resolve, retryDelay)); 2237 - } 2238 - return $fetchRaw(context.request, { 2239 - ...context.options, 2240 - retry: retries - 1 2241 - }); 2242 - } 2243 - } 2244 - const error = createFetchError(context); 2245 - if (Error.captureStackTrace) { 2246 - Error.captureStackTrace(error, $fetchRaw); 2247 - } 2248 - throw error; 2249 - } 2250 - const $fetchRaw = async function $fetchRaw2(_request, _options = {}) { 2251 - const context = { 2252 - request: _request, 2253 - options: resolveFetchOptions( 2254 - _request, 2255 - _options, 2256 - globalOptions.defaults, 2257 - Headers 2258 - ), 2259 - response: void 0, 2260 - error: void 0 2261 - }; 2262 - if (context.options.method) { 2263 - context.options.method = context.options.method.toUpperCase(); 2264 - } 2265 - if (context.options.onRequest) { 2266 - await callHooks(context, context.options.onRequest); 2267 - } 2268 - if (typeof context.request === "string") { 2269 - if (context.options.baseURL) { 2270 - context.request = withBase(context.request, context.options.baseURL); 2271 - } 2272 - if (context.options.query) { 2273 - context.request = withQuery(context.request, context.options.query); 2274 - delete context.options.query; 2275 - } 2276 - if ("query" in context.options) { 2277 - delete context.options.query; 2278 - } 2279 - if ("params" in context.options) { 2280 - delete context.options.params; 2281 - } 2282 - } 2283 - if (context.options.body && isPayloadMethod(context.options.method)) { 2284 - if (isJSONSerializable(context.options.body)) { 2285 - context.options.body = typeof context.options.body === "string" ? context.options.body : JSON.stringify(context.options.body); 2286 - context.options.headers = new Headers(context.options.headers || {}); 2287 - if (!context.options.headers.has("content-type")) { 2288 - context.options.headers.set("content-type", "application/json"); 2289 - } 2290 - if (!context.options.headers.has("accept")) { 2291 - context.options.headers.set("accept", "application/json"); 2292 - } 2293 - } else if ( 2294 - // ReadableStream Body 2295 - "pipeTo" in context.options.body && typeof context.options.body.pipeTo === "function" || // Node.js Stream Body 2296 - typeof context.options.body.pipe === "function" 2297 - ) { 2298 - if (!("duplex" in context.options)) { 2299 - context.options.duplex = "half"; 2300 - } 2301 - } 2302 - } 2303 - let abortTimeout; 2304 - if (!context.options.signal && context.options.timeout) { 2305 - const controller = new AbortController(); 2306 - abortTimeout = setTimeout(() => { 2307 - const error = new Error( 2308 - "[TimeoutError]: The operation was aborted due to timeout" 2309 - ); 2310 - error.name = "TimeoutError"; 2311 - error.code = 23; 2312 - controller.abort(error); 2313 - }, context.options.timeout); 2314 - context.options.signal = controller.signal; 2315 - } 2316 - try { 2317 - context.response = await fetch( 2318 - context.request, 2319 - context.options 2320 - ); 2321 - } catch (error) { 2322 - context.error = error; 2323 - if (context.options.onRequestError) { 2324 - await callHooks( 2325 - context, 2326 - context.options.onRequestError 2327 - ); 2328 - } 2329 - return await onError(context); 2330 - } finally { 2331 - if (abortTimeout) { 2332 - clearTimeout(abortTimeout); 2333 - } 2334 - } 2335 - const hasBody = (context.response.body || // https://github.com/unjs/ofetch/issues/324 2336 - // https://github.com/unjs/ofetch/issues/294 2337 - // https://github.com/JakeChampion/fetch/issues/1454 2338 - context.response._bodyInit) && !nullBodyResponses.has(context.response.status) && context.options.method !== "HEAD"; 2339 - if (hasBody) { 2340 - const responseType = (context.options.parseResponse ? "json" : context.options.responseType) || detectResponseType(context.response.headers.get("content-type") || ""); 2341 - switch (responseType) { 2342 - case "json": { 2343 - const data = await context.response.text(); 2344 - const parseFunction = context.options.parseResponse || destr; 2345 - context.response._data = parseFunction(data); 2346 - break; 2347 - } 2348 - case "stream": { 2349 - context.response._data = context.response.body || context.response._bodyInit; 2350 - break; 2351 - } 2352 - default: { 2353 - context.response._data = await context.response[responseType](); 2354 - } 2355 - } 2356 - } 2357 - if (context.options.onResponse) { 2358 - await callHooks( 2359 - context, 2360 - context.options.onResponse 2361 - ); 2362 - } 2363 - if (!context.options.ignoreResponseError && context.response.status >= 400 && context.response.status < 600) { 2364 - if (context.options.onResponseError) { 2365 - await callHooks( 2366 - context, 2367 - context.options.onResponseError 2368 - ); 2369 - } 2370 - return await onError(context); 2371 - } 2372 - return context.response; 2373 - }; 2374 - const $fetch = async function $fetch2(request, options) { 2375 - const r = await $fetchRaw(request, options); 2376 - return r._data; 2377 - }; 2378 - $fetch.raw = $fetchRaw; 2379 - $fetch.native = (...args) => fetch(...args); 2380 - $fetch.create = (defaultOptions = {}, customGlobalOptions = {}) => createFetch({ 2381 - ...globalOptions, 2382 - ...customGlobalOptions, 2383 - defaults: { 2384 - ...globalOptions.defaults, 2385 - ...customGlobalOptions.defaults, 2386 - ...defaultOptions 2387 - } 2388 - }); 2389 - return $fetch; 2390 - } 2391 - 2392 - function createNodeFetch() { 2393 - const useKeepAlive = JSON.parse(process.env.FETCH_KEEP_ALIVE || "false"); 2394 - if (!useKeepAlive) { 2395 - return l; 2396 - } 2397 - const agentOptions = { keepAlive: true }; 2398 - const httpAgent = new http.Agent(agentOptions); 2399 - const httpsAgent = new https.Agent(agentOptions); 2400 - const nodeFetchOptions = { 2401 - agent(parsedURL) { 2402 - return parsedURL.protocol === "http:" ? httpAgent : httpsAgent; 2403 - } 2404 - }; 2405 - return function nodeFetchWithKeepAlive(input, init) { 2406 - return l(input, { ...nodeFetchOptions, ...init }); 2407 - }; 2408 - } 2409 - const fetch = globalThis.fetch ? (...args) => globalThis.fetch(...args) : createNodeFetch(); 2410 - const Headers$1 = globalThis.Headers || s$1; 2411 - const AbortController = globalThis.AbortController || i; 2412 - createFetch({ fetch, Headers: Headers$1, AbortController }); 2413 - 2414 - function wrapToPromise(value) { 2415 - if (!value || typeof value.then !== "function") { 2416 - return Promise.resolve(value); 2417 - } 2418 - return value; 2419 - } 2420 - function asyncCall(function_, ...arguments_) { 2421 - try { 2422 - return wrapToPromise(function_(...arguments_)); 2423 - } catch (error) { 2424 - return Promise.reject(error); 2425 - } 2426 - } 2427 - function isPrimitive(value) { 2428 - const type = typeof value; 2429 - return value === null || type !== "object" && type !== "function"; 2430 - } 2431 - function isPureObject(value) { 2432 - const proto = Object.getPrototypeOf(value); 2433 - return !proto || proto.isPrototypeOf(Object); 2434 - } 2435 - function stringify(value) { 2436 - if (isPrimitive(value)) { 2437 - return String(value); 2438 - } 2439 - if (isPureObject(value) || Array.isArray(value)) { 2440 - return JSON.stringify(value); 2441 - } 2442 - if (typeof value.toJSON === "function") { 2443 - return stringify(value.toJSON()); 2444 - } 2445 - throw new Error("[unstorage] Cannot stringify value!"); 2446 - } 2447 - const BASE64_PREFIX = "base64:"; 2448 - function serializeRaw(value) { 2449 - if (typeof value === "string") { 2450 - return value; 2451 - } 2452 - return BASE64_PREFIX + base64Encode(value); 2453 - } 2454 - function deserializeRaw(value) { 2455 - if (typeof value !== "string") { 2456 - return value; 2457 - } 2458 - if (!value.startsWith(BASE64_PREFIX)) { 2459 - return value; 2460 - } 2461 - return base64Decode(value.slice(BASE64_PREFIX.length)); 2462 - } 2463 - function base64Decode(input) { 2464 - if (globalThis.Buffer) { 2465 - return Buffer.from(input, "base64"); 2466 - } 2467 - return Uint8Array.from( 2468 - globalThis.atob(input), 2469 - (c) => c.codePointAt(0) 2470 - ); 2471 - } 2472 - function base64Encode(input) { 2473 - if (globalThis.Buffer) { 2474 - return Buffer.from(input).toString("base64"); 2475 - } 2476 - return globalThis.btoa(String.fromCodePoint(...input)); 2477 - } 2478 - 2479 - const storageKeyProperties = [ 2480 - "has", 2481 - "hasItem", 2482 - "get", 2483 - "getItem", 2484 - "getItemRaw", 2485 - "set", 2486 - "setItem", 2487 - "setItemRaw", 2488 - "del", 2489 - "remove", 2490 - "removeItem", 2491 - "getMeta", 2492 - "setMeta", 2493 - "removeMeta", 2494 - "getKeys", 2495 - "clear", 2496 - "mount", 2497 - "unmount" 2498 - ]; 2499 - function prefixStorage(storage, base) { 2500 - base = normalizeBaseKey(base); 2501 - if (!base) { 2502 - return storage; 2503 - } 2504 - const nsStorage = { ...storage }; 2505 - for (const property of storageKeyProperties) { 2506 - nsStorage[property] = (key = "", ...args) => ( 2507 - // @ts-ignore 2508 - storage[property](base + key, ...args) 2509 - ); 2510 - } 2511 - nsStorage.getKeys = (key = "", ...arguments_) => storage.getKeys(base + key, ...arguments_).then((keys) => keys.map((key2) => key2.slice(base.length))); 2512 - nsStorage.getItems = async (items, commonOptions) => { 2513 - const prefixedItems = items.map( 2514 - (item) => typeof item === "string" ? base + item : { ...item, key: base + item.key } 2515 - ); 2516 - const results = await storage.getItems(prefixedItems, commonOptions); 2517 - return results.map((entry) => ({ 2518 - key: entry.key.slice(base.length), 2519 - value: entry.value 2520 - })); 2521 - }; 2522 - nsStorage.setItems = async (items, commonOptions) => { 2523 - const prefixedItems = items.map((item) => ({ 2524 - key: base + item.key, 2525 - value: item.value, 2526 - options: item.options 2527 - })); 2528 - return storage.setItems(prefixedItems, commonOptions); 2529 - }; 2530 - return nsStorage; 2531 - } 2532 - function normalizeKey$1(key) { 2533 - if (!key) { 2534 - return ""; 2535 - } 2536 - return key.split("?")[0]?.replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, "") || ""; 2537 - } 2538 - function joinKeys(...keys) { 2539 - return normalizeKey$1(keys.join(":")); 2540 - } 2541 - function normalizeBaseKey(base) { 2542 - base = normalizeKey$1(base); 2543 - return base ? base + ":" : ""; 2544 - } 2545 - function filterKeyByDepth(key, depth) { 2546 - if (depth === void 0) { 2547 - return true; 2548 - } 2549 - let substrCount = 0; 2550 - let index = key.indexOf(":"); 2551 - while (index > -1) { 2552 - substrCount++; 2553 - index = key.indexOf(":", index + 1); 2554 - } 2555 - return substrCount <= depth; 2556 - } 2557 - function filterKeyByBase(key, base) { 2558 - if (base) { 2559 - return key.startsWith(base) && key[key.length - 1] !== "$"; 2560 - } 2561 - return key[key.length - 1] !== "$"; 2562 - } 2563 - 2564 - function defineDriver$1(factory) { 2565 - return factory; 2566 - } 2567 - 2568 - const DRIVER_NAME$1 = "memory"; 2569 - const memory = defineDriver$1(() => { 2570 - const data = /* @__PURE__ */ new Map(); 2571 - return { 2572 - name: DRIVER_NAME$1, 2573 - getInstance: () => data, 2574 - hasItem(key) { 2575 - return data.has(key); 2576 - }, 2577 - getItem(key) { 2578 - return data.get(key) ?? null; 2579 - }, 2580 - getItemRaw(key) { 2581 - return data.get(key) ?? null; 2582 - }, 2583 - setItem(key, value) { 2584 - data.set(key, value); 2585 - }, 2586 - setItemRaw(key, value) { 2587 - data.set(key, value); 2588 - }, 2589 - removeItem(key) { 2590 - data.delete(key); 2591 - }, 2592 - getKeys() { 2593 - return [...data.keys()]; 2594 - }, 2595 - clear() { 2596 - data.clear(); 2597 - }, 2598 - dispose() { 2599 - data.clear(); 2600 - } 2601 - }; 2602 - }); 2603 - 2604 - function createStorage(options = {}) { 2605 - const context = { 2606 - mounts: { "": options.driver || memory() }, 2607 - mountpoints: [""], 2608 - watching: false, 2609 - watchListeners: [], 2610 - unwatch: {} 2611 - }; 2612 - const getMount = (key) => { 2613 - for (const base of context.mountpoints) { 2614 - if (key.startsWith(base)) { 2615 - return { 2616 - base, 2617 - relativeKey: key.slice(base.length), 2618 - driver: context.mounts[base] 2619 - }; 2620 - } 2621 - } 2622 - return { 2623 - base: "", 2624 - relativeKey: key, 2625 - driver: context.mounts[""] 2626 - }; 2627 - }; 2628 - const getMounts = (base, includeParent) => { 2629 - return context.mountpoints.filter( 2630 - (mountpoint) => mountpoint.startsWith(base) || includeParent && base.startsWith(mountpoint) 2631 - ).map((mountpoint) => ({ 2632 - relativeBase: base.length > mountpoint.length ? base.slice(mountpoint.length) : void 0, 2633 - mountpoint, 2634 - driver: context.mounts[mountpoint] 2635 - })); 2636 - }; 2637 - const onChange = (event, key) => { 2638 - if (!context.watching) { 2639 - return; 2640 - } 2641 - key = normalizeKey$1(key); 2642 - for (const listener of context.watchListeners) { 2643 - listener(event, key); 2644 - } 2645 - }; 2646 - const startWatch = async () => { 2647 - if (context.watching) { 2648 - return; 2649 - } 2650 - context.watching = true; 2651 - for (const mountpoint in context.mounts) { 2652 - context.unwatch[mountpoint] = await watch( 2653 - context.mounts[mountpoint], 2654 - onChange, 2655 - mountpoint 2656 - ); 2657 - } 2658 - }; 2659 - const stopWatch = async () => { 2660 - if (!context.watching) { 2661 - return; 2662 - } 2663 - for (const mountpoint in context.unwatch) { 2664 - await context.unwatch[mountpoint](); 2665 - } 2666 - context.unwatch = {}; 2667 - context.watching = false; 2668 - }; 2669 - const runBatch = (items, commonOptions, cb) => { 2670 - const batches = /* @__PURE__ */ new Map(); 2671 - const getBatch = (mount) => { 2672 - let batch = batches.get(mount.base); 2673 - if (!batch) { 2674 - batch = { 2675 - driver: mount.driver, 2676 - base: mount.base, 2677 - items: [] 2678 - }; 2679 - batches.set(mount.base, batch); 2680 - } 2681 - return batch; 2682 - }; 2683 - for (const item of items) { 2684 - const isStringItem = typeof item === "string"; 2685 - const key = normalizeKey$1(isStringItem ? item : item.key); 2686 - const value = isStringItem ? void 0 : item.value; 2687 - const options2 = isStringItem || !item.options ? commonOptions : { ...commonOptions, ...item.options }; 2688 - const mount = getMount(key); 2689 - getBatch(mount).items.push({ 2690 - key, 2691 - value, 2692 - relativeKey: mount.relativeKey, 2693 - options: options2 2694 - }); 2695 - } 2696 - return Promise.all([...batches.values()].map((batch) => cb(batch))).then( 2697 - (r) => r.flat() 2698 - ); 2699 - }; 2700 - const storage = { 2701 - // Item 2702 - hasItem(key, opts = {}) { 2703 - key = normalizeKey$1(key); 2704 - const { relativeKey, driver } = getMount(key); 2705 - return asyncCall(driver.hasItem, relativeKey, opts); 2706 - }, 2707 - getItem(key, opts = {}) { 2708 - key = normalizeKey$1(key); 2709 - const { relativeKey, driver } = getMount(key); 2710 - return asyncCall(driver.getItem, relativeKey, opts).then( 2711 - (value) => destr(value) 2712 - ); 2713 - }, 2714 - getItems(items, commonOptions = {}) { 2715 - return runBatch(items, commonOptions, (batch) => { 2716 - if (batch.driver.getItems) { 2717 - return asyncCall( 2718 - batch.driver.getItems, 2719 - batch.items.map((item) => ({ 2720 - key: item.relativeKey, 2721 - options: item.options 2722 - })), 2723 - commonOptions 2724 - ).then( 2725 - (r) => r.map((item) => ({ 2726 - key: joinKeys(batch.base, item.key), 2727 - value: destr(item.value) 2728 - })) 2729 - ); 2730 - } 2731 - return Promise.all( 2732 - batch.items.map((item) => { 2733 - return asyncCall( 2734 - batch.driver.getItem, 2735 - item.relativeKey, 2736 - item.options 2737 - ).then((value) => ({ 2738 - key: item.key, 2739 - value: destr(value) 2740 - })); 2741 - }) 2742 - ); 2743 - }); 2744 - }, 2745 - getItemRaw(key, opts = {}) { 2746 - key = normalizeKey$1(key); 2747 - const { relativeKey, driver } = getMount(key); 2748 - if (driver.getItemRaw) { 2749 - return asyncCall(driver.getItemRaw, relativeKey, opts); 2750 - } 2751 - return asyncCall(driver.getItem, relativeKey, opts).then( 2752 - (value) => deserializeRaw(value) 2753 - ); 2754 - }, 2755 - async setItem(key, value, opts = {}) { 2756 - if (value === void 0) { 2757 - return storage.removeItem(key); 2758 - } 2759 - key = normalizeKey$1(key); 2760 - const { relativeKey, driver } = getMount(key); 2761 - if (!driver.setItem) { 2762 - return; 2763 - } 2764 - await asyncCall(driver.setItem, relativeKey, stringify(value), opts); 2765 - if (!driver.watch) { 2766 - onChange("update", key); 2767 - } 2768 - }, 2769 - async setItems(items, commonOptions) { 2770 - await runBatch(items, commonOptions, async (batch) => { 2771 - if (batch.driver.setItems) { 2772 - return asyncCall( 2773 - batch.driver.setItems, 2774 - batch.items.map((item) => ({ 2775 - key: item.relativeKey, 2776 - value: stringify(item.value), 2777 - options: item.options 2778 - })), 2779 - commonOptions 2780 - ); 2781 - } 2782 - if (!batch.driver.setItem) { 2783 - return; 2784 - } 2785 - await Promise.all( 2786 - batch.items.map((item) => { 2787 - return asyncCall( 2788 - batch.driver.setItem, 2789 - item.relativeKey, 2790 - stringify(item.value), 2791 - item.options 2792 - ); 2793 - }) 2794 - ); 2795 - }); 2796 - }, 2797 - async setItemRaw(key, value, opts = {}) { 2798 - if (value === void 0) { 2799 - return storage.removeItem(key, opts); 2800 - } 2801 - key = normalizeKey$1(key); 2802 - const { relativeKey, driver } = getMount(key); 2803 - if (driver.setItemRaw) { 2804 - await asyncCall(driver.setItemRaw, relativeKey, value, opts); 2805 - } else if (driver.setItem) { 2806 - await asyncCall(driver.setItem, relativeKey, serializeRaw(value), opts); 2807 - } else { 2808 - return; 2809 - } 2810 - if (!driver.watch) { 2811 - onChange("update", key); 2812 - } 2813 - }, 2814 - async removeItem(key, opts = {}) { 2815 - if (typeof opts === "boolean") { 2816 - opts = { removeMeta: opts }; 2817 - } 2818 - key = normalizeKey$1(key); 2819 - const { relativeKey, driver } = getMount(key); 2820 - if (!driver.removeItem) { 2821 - return; 2822 - } 2823 - await asyncCall(driver.removeItem, relativeKey, opts); 2824 - if (opts.removeMeta || opts.removeMata) { 2825 - await asyncCall(driver.removeItem, relativeKey + "$", opts); 2826 - } 2827 - if (!driver.watch) { 2828 - onChange("remove", key); 2829 - } 2830 - }, 2831 - // Meta 2832 - async getMeta(key, opts = {}) { 2833 - if (typeof opts === "boolean") { 2834 - opts = { nativeOnly: opts }; 2835 - } 2836 - key = normalizeKey$1(key); 2837 - const { relativeKey, driver } = getMount(key); 2838 - const meta = /* @__PURE__ */ Object.create(null); 2839 - if (driver.getMeta) { 2840 - Object.assign(meta, await asyncCall(driver.getMeta, relativeKey, opts)); 2841 - } 2842 - if (!opts.nativeOnly) { 2843 - const value = await asyncCall( 2844 - driver.getItem, 2845 - relativeKey + "$", 2846 - opts 2847 - ).then((value_) => destr(value_)); 2848 - if (value && typeof value === "object") { 2849 - if (typeof value.atime === "string") { 2850 - value.atime = new Date(value.atime); 2851 - } 2852 - if (typeof value.mtime === "string") { 2853 - value.mtime = new Date(value.mtime); 2854 - } 2855 - Object.assign(meta, value); 2856 - } 2857 - } 2858 - return meta; 2859 - }, 2860 - setMeta(key, value, opts = {}) { 2861 - return this.setItem(key + "$", value, opts); 2862 - }, 2863 - removeMeta(key, opts = {}) { 2864 - return this.removeItem(key + "$", opts); 2865 - }, 2866 - // Keys 2867 - async getKeys(base, opts = {}) { 2868 - base = normalizeBaseKey(base); 2869 - const mounts = getMounts(base, true); 2870 - let maskedMounts = []; 2871 - const allKeys = []; 2872 - let allMountsSupportMaxDepth = true; 2873 - for (const mount of mounts) { 2874 - if (!mount.driver.flags?.maxDepth) { 2875 - allMountsSupportMaxDepth = false; 2876 - } 2877 - const rawKeys = await asyncCall( 2878 - mount.driver.getKeys, 2879 - mount.relativeBase, 2880 - opts 2881 - ); 2882 - for (const key of rawKeys) { 2883 - const fullKey = mount.mountpoint + normalizeKey$1(key); 2884 - if (!maskedMounts.some((p) => fullKey.startsWith(p))) { 2885 - allKeys.push(fullKey); 2886 - } 2887 - } 2888 - maskedMounts = [ 2889 - mount.mountpoint, 2890 - ...maskedMounts.filter((p) => !p.startsWith(mount.mountpoint)) 2891 - ]; 2892 - } 2893 - const shouldFilterByDepth = opts.maxDepth !== void 0 && !allMountsSupportMaxDepth; 2894 - return allKeys.filter( 2895 - (key) => (!shouldFilterByDepth || filterKeyByDepth(key, opts.maxDepth)) && filterKeyByBase(key, base) 2896 - ); 2897 - }, 2898 - // Utils 2899 - async clear(base, opts = {}) { 2900 - base = normalizeBaseKey(base); 2901 - await Promise.all( 2902 - getMounts(base, false).map(async (m) => { 2903 - if (m.driver.clear) { 2904 - return asyncCall(m.driver.clear, m.relativeBase, opts); 2905 - } 2906 - if (m.driver.removeItem) { 2907 - const keys = await m.driver.getKeys(m.relativeBase || "", opts); 2908 - return Promise.all( 2909 - keys.map((key) => m.driver.removeItem(key, opts)) 2910 - ); 2911 - } 2912 - }) 2913 - ); 2914 - }, 2915 - async dispose() { 2916 - await Promise.all( 2917 - Object.values(context.mounts).map((driver) => dispose(driver)) 2918 - ); 2919 - }, 2920 - async watch(callback) { 2921 - await startWatch(); 2922 - context.watchListeners.push(callback); 2923 - return async () => { 2924 - context.watchListeners = context.watchListeners.filter( 2925 - (listener) => listener !== callback 2926 - ); 2927 - if (context.watchListeners.length === 0) { 2928 - await stopWatch(); 2929 - } 2930 - }; 2931 - }, 2932 - async unwatch() { 2933 - context.watchListeners = []; 2934 - await stopWatch(); 2935 - }, 2936 - // Mount 2937 - mount(base, driver) { 2938 - base = normalizeBaseKey(base); 2939 - if (base && context.mounts[base]) { 2940 - throw new Error(`already mounted at ${base}`); 2941 - } 2942 - if (base) { 2943 - context.mountpoints.push(base); 2944 - context.mountpoints.sort((a, b) => b.length - a.length); 2945 - } 2946 - context.mounts[base] = driver; 2947 - if (context.watching) { 2948 - Promise.resolve(watch(driver, onChange, base)).then((unwatcher) => { 2949 - context.unwatch[base] = unwatcher; 2950 - }).catch(console.error); 2951 - } 2952 - return storage; 2953 - }, 2954 - async unmount(base, _dispose = true) { 2955 - base = normalizeBaseKey(base); 2956 - if (!base || !context.mounts[base]) { 2957 - return; 2958 - } 2959 - if (context.watching && base in context.unwatch) { 2960 - context.unwatch[base]?.(); 2961 - delete context.unwatch[base]; 2962 - } 2963 - if (_dispose) { 2964 - await dispose(context.mounts[base]); 2965 - } 2966 - context.mountpoints = context.mountpoints.filter((key) => key !== base); 2967 - delete context.mounts[base]; 2968 - }, 2969 - getMount(key = "") { 2970 - key = normalizeKey$1(key) + ":"; 2971 - const m = getMount(key); 2972 - return { 2973 - driver: m.driver, 2974 - base: m.base 2975 - }; 2976 - }, 2977 - getMounts(base = "", opts = {}) { 2978 - base = normalizeKey$1(base); 2979 - const mounts = getMounts(base, opts.parents); 2980 - return mounts.map((m) => ({ 2981 - driver: m.driver, 2982 - base: m.mountpoint 2983 - })); 2984 - }, 2985 - // Aliases 2986 - keys: (base, opts = {}) => storage.getKeys(base, opts), 2987 - get: (key, opts = {}) => storage.getItem(key, opts), 2988 - set: (key, value, opts = {}) => storage.setItem(key, value, opts), 2989 - has: (key, opts = {}) => storage.hasItem(key, opts), 2990 - del: (key, opts = {}) => storage.removeItem(key, opts), 2991 - remove: (key, opts = {}) => storage.removeItem(key, opts) 2992 - }; 2993 - return storage; 2994 - } 2995 - function watch(driver, onChange, base) { 2996 - return driver.watch ? driver.watch((event, key) => onChange(event, base + key)) : () => { 2997 - }; 2998 - } 2999 - async function dispose(driver) { 3000 - if (typeof driver.dispose === "function") { 3001 - await asyncCall(driver.dispose); 3002 - } 3003 - } 3004 - 3005 - const _assets = { 3006 - 3007 - }; 3008 - 3009 - const normalizeKey = function normalizeKey(key) { 3010 - if (!key) { 3011 - return ""; 3012 - } 3013 - return key.split("?")[0]?.replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, "") || ""; 3014 - }; 3015 - 3016 - const assets$1 = { 3017 - getKeys() { 3018 - return Promise.resolve(Object.keys(_assets)) 3019 - }, 3020 - hasItem (id) { 3021 - id = normalizeKey(id); 3022 - return Promise.resolve(id in _assets) 3023 - }, 3024 - getItem (id) { 3025 - id = normalizeKey(id); 3026 - return Promise.resolve(_assets[id] ? _assets[id].import() : null) 3027 - }, 3028 - getMeta (id) { 3029 - id = normalizeKey(id); 3030 - return Promise.resolve(_assets[id] ? _assets[id].meta : {}) 3031 - } 3032 - }; 3033 - 3034 - function defineDriver(factory) { 3035 - return factory; 3036 - } 3037 - function createError(driver, message, opts) { 3038 - const err = new Error(`[unstorage] [${driver}] ${message}`, opts); 3039 - if (Error.captureStackTrace) { 3040 - Error.captureStackTrace(err, createError); 3041 - } 3042 - return err; 3043 - } 3044 - function createRequiredError(driver, name) { 3045 - if (Array.isArray(name)) { 3046 - return createError( 3047 - driver, 3048 - `Missing some of the required options ${name.map((n) => "`" + n + "`").join(", ")}` 3049 - ); 3050 - } 3051 - return createError(driver, `Missing required option \`${name}\`.`); 3052 - } 3053 - 3054 - function ignoreNotfound(err) { 3055 - return err.code === "ENOENT" || err.code === "EISDIR" ? null : err; 3056 - } 3057 - function ignoreExists(err) { 3058 - return err.code === "EEXIST" ? null : err; 3059 - } 3060 - async function writeFile(path, data, encoding) { 3061 - await ensuredir(dirname$1(path)); 3062 - return promises.writeFile(path, data, encoding); 3063 - } 3064 - function readFile(path, encoding) { 3065 - return promises.readFile(path, encoding).catch(ignoreNotfound); 3066 - } 3067 - function unlink(path) { 3068 - return promises.unlink(path).catch(ignoreNotfound); 3069 - } 3070 - function readdir(dir) { 3071 - return promises.readdir(dir, { withFileTypes: true }).catch(ignoreNotfound).then((r) => r || []); 3072 - } 3073 - async function ensuredir(dir) { 3074 - if (existsSync(dir)) { 3075 - return; 3076 - } 3077 - await ensuredir(dirname$1(dir)).catch(ignoreExists); 3078 - await promises.mkdir(dir).catch(ignoreExists); 3079 - } 3080 - async function readdirRecursive(dir, ignore, maxDepth) { 3081 - if (ignore && ignore(dir)) { 3082 - return []; 3083 - } 3084 - const entries = await readdir(dir); 3085 - const files = []; 3086 - await Promise.all( 3087 - entries.map(async (entry) => { 3088 - const entryPath = resolve$1(dir, entry.name); 3089 - if (entry.isDirectory()) { 3090 - if (maxDepth === void 0 || maxDepth > 0) { 3091 - const dirFiles = await readdirRecursive( 3092 - entryPath, 3093 - ignore, 3094 - maxDepth === void 0 ? void 0 : maxDepth - 1 3095 - ); 3096 - files.push(...dirFiles.map((f) => entry.name + "/" + f)); 3097 - } 3098 - } else { 3099 - if (!(ignore && ignore(entry.name))) { 3100 - files.push(entry.name); 3101 - } 3102 - } 3103 - }) 3104 - ); 3105 - return files; 3106 - } 3107 - async function rmRecursive(dir) { 3108 - const entries = await readdir(dir); 3109 - await Promise.all( 3110 - entries.map((entry) => { 3111 - const entryPath = resolve$1(dir, entry.name); 3112 - if (entry.isDirectory()) { 3113 - return rmRecursive(entryPath).then(() => promises.rmdir(entryPath)); 3114 - } else { 3115 - return promises.unlink(entryPath); 3116 - } 3117 - }) 3118 - ); 3119 - } 3120 - 3121 - const PATH_TRAVERSE_RE = /\.\.:|\.\.$/; 3122 - const DRIVER_NAME = "fs-lite"; 3123 - const unstorage_47drivers_47fs_45lite = defineDriver((opts = {}) => { 3124 - if (!opts.base) { 3125 - throw createRequiredError(DRIVER_NAME, "base"); 3126 - } 3127 - opts.base = resolve$1(opts.base); 3128 - const r = (key) => { 3129 - if (PATH_TRAVERSE_RE.test(key)) { 3130 - throw createError( 3131 - DRIVER_NAME, 3132 - `Invalid key: ${JSON.stringify(key)}. It should not contain .. segments` 3133 - ); 3134 - } 3135 - const resolved = join(opts.base, key.replace(/:/g, "/")); 3136 - return resolved; 3137 - }; 3138 - return { 3139 - name: DRIVER_NAME, 3140 - options: opts, 3141 - flags: { 3142 - maxDepth: true 3143 - }, 3144 - hasItem(key) { 3145 - return existsSync(r(key)); 3146 - }, 3147 - getItem(key) { 3148 - return readFile(r(key), "utf8"); 3149 - }, 3150 - getItemRaw(key) { 3151 - return readFile(r(key)); 3152 - }, 3153 - async getMeta(key) { 3154 - const { atime, mtime, size, birthtime, ctime } = await promises.stat(r(key)).catch(() => ({})); 3155 - return { atime, mtime, size, birthtime, ctime }; 3156 - }, 3157 - setItem(key, value) { 3158 - if (opts.readOnly) { 3159 - return; 3160 - } 3161 - return writeFile(r(key), value, "utf8"); 3162 - }, 3163 - setItemRaw(key, value) { 3164 - if (opts.readOnly) { 3165 - return; 3166 - } 3167 - return writeFile(r(key), value); 3168 - }, 3169 - removeItem(key) { 3170 - if (opts.readOnly) { 3171 - return; 3172 - } 3173 - return unlink(r(key)); 3174 - }, 3175 - getKeys(_base, topts) { 3176 - return readdirRecursive(r("."), opts.ignore, topts?.maxDepth); 3177 - }, 3178 - async clear() { 3179 - if (opts.readOnly || opts.noClear) { 3180 - return; 3181 - } 3182 - await rmRecursive(r(".")); 3183 - } 3184 - }; 3185 - }); 3186 - 3187 - const storage = createStorage({}); 3188 - 3189 - storage.mount('/assets', assets$1); 3190 - 3191 - storage.mount('data', unstorage_47drivers_47fs_45lite({"driver":"fsLite","base":"./.data/kv"})); 3192 - 3193 - function useStorage(base = "") { 3194 - return base ? prefixStorage(storage, base) : storage; 3195 - } 3196 - 3197 - const e=globalThis.process?.getBuiltinModule?.("crypto")?.hash,r="sha256",s="base64url";function digest(t){if(e)return e(r,t,s);const o=createHash(r).update(t);return globalThis.process?.versions?.webcontainer?o.digest().toString(s):o.digest(s)} 3198 - 3199 - const Hasher = /* @__PURE__ */ (() => { 3200 - class Hasher2 { 3201 - buff = ""; 3202 - #context = /* @__PURE__ */ new Map(); 3203 - write(str) { 3204 - this.buff += str; 3205 - } 3206 - dispatch(value) { 3207 - const type = value === null ? "null" : typeof value; 3208 - return this[type](value); 3209 - } 3210 - object(object) { 3211 - if (object && typeof object.toJSON === "function") { 3212 - return this.object(object.toJSON()); 3213 - } 3214 - const objString = Object.prototype.toString.call(object); 3215 - let objType = ""; 3216 - const objectLength = objString.length; 3217 - objType = objectLength < 10 ? "unknown:[" + objString + "]" : objString.slice(8, objectLength - 1); 3218 - objType = objType.toLowerCase(); 3219 - let objectNumber = null; 3220 - if ((objectNumber = this.#context.get(object)) === void 0) { 3221 - this.#context.set(object, this.#context.size); 3222 - } else { 3223 - return this.dispatch("[CIRCULAR:" + objectNumber + "]"); 3224 - } 3225 - if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object)) { 3226 - this.write("buffer:"); 3227 - return this.write(object.toString("utf8")); 3228 - } 3229 - if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") { 3230 - if (this[objType]) { 3231 - this[objType](object); 3232 - } else { 3233 - this.unknown(object, objType); 3234 - } 3235 - } else { 3236 - const keys = Object.keys(object).sort(); 3237 - const extraKeys = []; 3238 - this.write("object:" + (keys.length + extraKeys.length) + ":"); 3239 - const dispatchForKey = (key) => { 3240 - this.dispatch(key); 3241 - this.write(":"); 3242 - this.dispatch(object[key]); 3243 - this.write(","); 3244 - }; 3245 - for (const key of keys) { 3246 - dispatchForKey(key); 3247 - } 3248 - for (const key of extraKeys) { 3249 - dispatchForKey(key); 3250 - } 3251 - } 3252 - } 3253 - array(arr, unordered) { 3254 - unordered = unordered === void 0 ? false : unordered; 3255 - this.write("array:" + arr.length + ":"); 3256 - if (!unordered || arr.length <= 1) { 3257 - for (const entry of arr) { 3258 - this.dispatch(entry); 3259 - } 3260 - return; 3261 - } 3262 - const contextAdditions = /* @__PURE__ */ new Map(); 3263 - const entries = arr.map((entry) => { 3264 - const hasher = new Hasher2(); 3265 - hasher.dispatch(entry); 3266 - for (const [key, value] of hasher.#context) { 3267 - contextAdditions.set(key, value); 3268 - } 3269 - return hasher.toString(); 3270 - }); 3271 - this.#context = contextAdditions; 3272 - entries.sort(); 3273 - return this.array(entries, false); 3274 - } 3275 - date(date) { 3276 - return this.write("date:" + date.toJSON()); 3277 - } 3278 - symbol(sym) { 3279 - return this.write("symbol:" + sym.toString()); 3280 - } 3281 - unknown(value, type) { 3282 - this.write(type); 3283 - if (!value) { 3284 - return; 3285 - } 3286 - this.write(":"); 3287 - if (value && typeof value.entries === "function") { 3288 - return this.array( 3289 - [...value.entries()], 3290 - true 3291 - /* ordered */ 3292 - ); 3293 - } 3294 - } 3295 - error(err) { 3296 - return this.write("error:" + err.toString()); 3297 - } 3298 - boolean(bool) { 3299 - return this.write("bool:" + bool); 3300 - } 3301 - string(string) { 3302 - this.write("string:" + string.length + ":"); 3303 - this.write(string); 3304 - } 3305 - function(fn) { 3306 - this.write("fn:"); 3307 - if (isNativeFunction(fn)) { 3308 - this.dispatch("[native]"); 3309 - } else { 3310 - this.dispatch(fn.toString()); 3311 - } 3312 - } 3313 - number(number) { 3314 - return this.write("number:" + number); 3315 - } 3316 - null() { 3317 - return this.write("Null"); 3318 - } 3319 - undefined() { 3320 - return this.write("Undefined"); 3321 - } 3322 - regexp(regex) { 3323 - return this.write("regex:" + regex.toString()); 3324 - } 3325 - arraybuffer(arr) { 3326 - this.write("arraybuffer:"); 3327 - return this.dispatch(new Uint8Array(arr)); 3328 - } 3329 - url(url) { 3330 - return this.write("url:" + url.toString()); 3331 - } 3332 - map(map) { 3333 - this.write("map:"); 3334 - const arr = [...map]; 3335 - return this.array(arr, false); 3336 - } 3337 - set(set) { 3338 - this.write("set:"); 3339 - const arr = [...set]; 3340 - return this.array(arr, false); 3341 - } 3342 - bigint(number) { 3343 - return this.write("bigint:" + number.toString()); 3344 - } 3345 - } 3346 - for (const type of [ 3347 - "uint8array", 3348 - "uint8clampedarray", 3349 - "unt8array", 3350 - "uint16array", 3351 - "unt16array", 3352 - "uint32array", 3353 - "unt32array", 3354 - "float32array", 3355 - "float64array" 3356 - ]) { 3357 - Hasher2.prototype[type] = function(arr) { 3358 - this.write(type + ":"); 3359 - return this.array([...arr], false); 3360 - }; 3361 - } 3362 - function isNativeFunction(f) { 3363 - if (typeof f !== "function") { 3364 - return false; 3365 - } 3366 - return Function.prototype.toString.call(f).slice( 3367 - -15 3368 - /* "[native code] }".length */ 3369 - ) === "[native code] }"; 3370 - } 3371 - return Hasher2; 3372 - })(); 3373 - function serialize(object) { 3374 - const hasher = new Hasher(); 3375 - hasher.dispatch(object); 3376 - return hasher.buff; 3377 - } 3378 - function hash(value) { 3379 - return digest(typeof value === "string" ? value : serialize(value)).replace(/[-_]/g, "").slice(0, 10); 3380 - } 3381 - 3382 - function defaultCacheOptions() { 3383 - return { 3384 - name: "_", 3385 - base: "/cache", 3386 - swr: true, 3387 - maxAge: 1 3388 - }; 3389 - } 3390 - function defineCachedFunction(fn, opts = {}) { 3391 - opts = { ...defaultCacheOptions(), ...opts }; 3392 - const pending = {}; 3393 - const group = opts.group || "nitro/functions"; 3394 - const name = opts.name || fn.name || "_"; 3395 - const integrity = opts.integrity || hash([fn, opts]); 3396 - const validate = opts.validate || ((entry) => entry.value !== void 0); 3397 - async function get(key, resolver, shouldInvalidateCache, event) { 3398 - const cacheKey = [opts.base, group, name, key + ".json"].filter(Boolean).join(":").replace(/:\/$/, ":index"); 3399 - let entry = await useStorage().getItem(cacheKey).catch((error) => { 3400 - console.error(`[cache] Cache read error.`, error); 3401 - useNitroApp().captureError(error, { event, tags: ["cache"] }); 3402 - }) || {}; 3403 - if (typeof entry !== "object") { 3404 - entry = {}; 3405 - const error = new Error("Malformed data read from cache."); 3406 - console.error("[cache]", error); 3407 - useNitroApp().captureError(error, { event, tags: ["cache"] }); 3408 - } 3409 - const ttl = (opts.maxAge ?? 0) * 1e3; 3410 - if (ttl) { 3411 - entry.expires = Date.now() + ttl; 3412 - } 3413 - const expired = shouldInvalidateCache || entry.integrity !== integrity || ttl && Date.now() - (entry.mtime || 0) > ttl || validate(entry) === false; 3414 - const _resolve = async () => { 3415 - const isPending = pending[key]; 3416 - if (!isPending) { 3417 - if (entry.value !== void 0 && (opts.staleMaxAge || 0) >= 0 && opts.swr === false) { 3418 - entry.value = void 0; 3419 - entry.integrity = void 0; 3420 - entry.mtime = void 0; 3421 - entry.expires = void 0; 3422 - } 3423 - pending[key] = Promise.resolve(resolver()); 3424 - } 3425 - try { 3426 - entry.value = await pending[key]; 3427 - } catch (error) { 3428 - if (!isPending) { 3429 - delete pending[key]; 3430 - } 3431 - throw error; 3432 - } 3433 - if (!isPending) { 3434 - entry.mtime = Date.now(); 3435 - entry.integrity = integrity; 3436 - delete pending[key]; 3437 - if (validate(entry) !== false) { 3438 - let setOpts; 3439 - if (opts.maxAge && !opts.swr) { 3440 - setOpts = { ttl: opts.maxAge }; 3441 - } 3442 - const promise = useStorage().setItem(cacheKey, entry, setOpts).catch((error) => { 3443 - console.error(`[cache] Cache write error.`, error); 3444 - useNitroApp().captureError(error, { event, tags: ["cache"] }); 3445 - }); 3446 - if (event?.waitUntil) { 3447 - event.waitUntil(promise); 3448 - } 3449 - } 3450 - } 3451 - }; 3452 - const _resolvePromise = expired ? _resolve() : Promise.resolve(); 3453 - if (entry.value === void 0) { 3454 - await _resolvePromise; 3455 - } else if (expired && event && event.waitUntil) { 3456 - event.waitUntil(_resolvePromise); 3457 - } 3458 - if (opts.swr && validate(entry) !== false) { 3459 - _resolvePromise.catch((error) => { 3460 - console.error(`[cache] SWR handler error.`, error); 3461 - useNitroApp().captureError(error, { event, tags: ["cache"] }); 3462 - }); 3463 - return entry; 3464 - } 3465 - return _resolvePromise.then(() => entry); 3466 - } 3467 - return async (...args) => { 3468 - const shouldBypassCache = await opts.shouldBypassCache?.(...args); 3469 - if (shouldBypassCache) { 3470 - return fn(...args); 3471 - } 3472 - const key = await (opts.getKey || getKey)(...args); 3473 - const shouldInvalidateCache = await opts.shouldInvalidateCache?.(...args); 3474 - const entry = await get( 3475 - key, 3476 - () => fn(...args), 3477 - shouldInvalidateCache, 3478 - args[0] && isEvent(args[0]) ? args[0] : void 0 3479 - ); 3480 - let value = entry.value; 3481 - if (opts.transform) { 3482 - value = await opts.transform(entry, ...args) || value; 3483 - } 3484 - return value; 3485 - }; 3486 - } 3487 - function cachedFunction(fn, opts = {}) { 3488 - return defineCachedFunction(fn, opts); 3489 - } 3490 - function getKey(...args) { 3491 - return args.length > 0 ? hash(args) : ""; 3492 - } 3493 - function escapeKey(key) { 3494 - return String(key).replace(/\W/g, ""); 3495 - } 3496 - function defineCachedEventHandler(handler, opts = defaultCacheOptions()) { 3497 - const variableHeaderNames = (opts.varies || []).filter(Boolean).map((h) => h.toLowerCase()).sort(); 3498 - const _opts = { 3499 - ...opts, 3500 - getKey: async (event) => { 3501 - const customKey = await opts.getKey?.(event); 3502 - if (customKey) { 3503 - return escapeKey(customKey); 3504 - } 3505 - const _path = event.node.req.originalUrl || event.node.req.url || event.path; 3506 - let _pathname; 3507 - try { 3508 - _pathname = escapeKey(decodeURI(parseURL(_path).pathname)).slice(0, 16) || "index"; 3509 - } catch { 3510 - _pathname = "-"; 3511 - } 3512 - const _hashedPath = `${_pathname}.${hash(_path)}`; 3513 - const _headers = variableHeaderNames.map((header) => [header, event.node.req.headers[header]]).map(([name, value]) => `${escapeKey(name)}.${hash(value)}`); 3514 - return [_hashedPath, ..._headers].join(":"); 3515 - }, 3516 - validate: (entry) => { 3517 - if (!entry.value) { 3518 - return false; 3519 - } 3520 - if (entry.value.code >= 400) { 3521 - return false; 3522 - } 3523 - if (entry.value.body === void 0) { 3524 - return false; 3525 - } 3526 - if (entry.value.headers.etag === "undefined" || entry.value.headers["last-modified"] === "undefined") { 3527 - return false; 3528 - } 3529 - return true; 3530 - }, 3531 - group: opts.group || "nitro/handlers", 3532 - integrity: opts.integrity || hash([handler, opts]) 3533 - }; 3534 - const _cachedHandler = cachedFunction( 3535 - async (incomingEvent) => { 3536 - const variableHeaders = {}; 3537 - for (const header of variableHeaderNames) { 3538 - const value = incomingEvent.node.req.headers[header]; 3539 - if (value !== void 0) { 3540 - variableHeaders[header] = value; 3541 - } 3542 - } 3543 - const reqProxy = cloneWithProxy(incomingEvent.node.req, { 3544 - headers: variableHeaders 3545 - }); 3546 - const resHeaders = {}; 3547 - let _resSendBody; 3548 - const resProxy = cloneWithProxy(incomingEvent.node.res, { 3549 - statusCode: 200, 3550 - writableEnded: false, 3551 - writableFinished: false, 3552 - headersSent: false, 3553 - closed: false, 3554 - getHeader(name) { 3555 - return resHeaders[name]; 3556 - }, 3557 - setHeader(name, value) { 3558 - resHeaders[name] = value; 3559 - return this; 3560 - }, 3561 - getHeaderNames() { 3562 - return Object.keys(resHeaders); 3563 - }, 3564 - hasHeader(name) { 3565 - return name in resHeaders; 3566 - }, 3567 - removeHeader(name) { 3568 - delete resHeaders[name]; 3569 - }, 3570 - getHeaders() { 3571 - return resHeaders; 3572 - }, 3573 - end(chunk, arg2, arg3) { 3574 - if (typeof chunk === "string") { 3575 - _resSendBody = chunk; 3576 - } 3577 - if (typeof arg2 === "function") { 3578 - arg2(); 3579 - } 3580 - if (typeof arg3 === "function") { 3581 - arg3(); 3582 - } 3583 - return this; 3584 - }, 3585 - write(chunk, arg2, arg3) { 3586 - if (typeof chunk === "string") { 3587 - _resSendBody = chunk; 3588 - } 3589 - if (typeof arg2 === "function") { 3590 - arg2(void 0); 3591 - } 3592 - if (typeof arg3 === "function") { 3593 - arg3(); 3594 - } 3595 - return true; 3596 - }, 3597 - writeHead(statusCode, headers2) { 3598 - this.statusCode = statusCode; 3599 - if (headers2) { 3600 - if (Array.isArray(headers2) || typeof headers2 === "string") { 3601 - throw new TypeError("Raw headers is not supported."); 3602 - } 3603 - for (const header in headers2) { 3604 - const value = headers2[header]; 3605 - if (value !== void 0) { 3606 - this.setHeader( 3607 - header, 3608 - value 3609 - ); 3610 - } 3611 - } 3612 - } 3613 - return this; 3614 - } 3615 - }); 3616 - const event = createEvent(reqProxy, resProxy); 3617 - event.fetch = (url, fetchOptions) => fetchWithEvent(event, url, fetchOptions, { 3618 - fetch: useNitroApp().localFetch 3619 - }); 3620 - event.$fetch = (url, fetchOptions) => fetchWithEvent(event, url, fetchOptions, { 3621 - fetch: globalThis.$fetch 3622 - }); 3623 - event.waitUntil = incomingEvent.waitUntil; 3624 - event.context = incomingEvent.context; 3625 - event.context.cache = { 3626 - options: _opts 3627 - }; 3628 - const body = await handler(event) || _resSendBody; 3629 - const headers = event.node.res.getHeaders(); 3630 - headers.etag = String( 3631 - headers.Etag || headers.etag || `W/"${hash(body)}"` 3632 - ); 3633 - headers["last-modified"] = String( 3634 - headers["Last-Modified"] || headers["last-modified"] || (/* @__PURE__ */ new Date()).toUTCString() 3635 - ); 3636 - const cacheControl = []; 3637 - if (opts.swr) { 3638 - if (opts.maxAge) { 3639 - cacheControl.push(`s-maxage=${opts.maxAge}`); 3640 - } 3641 - if (opts.staleMaxAge) { 3642 - cacheControl.push(`stale-while-revalidate=${opts.staleMaxAge}`); 3643 - } else { 3644 - cacheControl.push("stale-while-revalidate"); 3645 - } 3646 - } else if (opts.maxAge) { 3647 - cacheControl.push(`max-age=${opts.maxAge}`); 3648 - } 3649 - if (cacheControl.length > 0) { 3650 - headers["cache-control"] = cacheControl.join(", "); 3651 - } 3652 - const cacheEntry = { 3653 - code: event.node.res.statusCode, 3654 - headers, 3655 - body 3656 - }; 3657 - return cacheEntry; 3658 - }, 3659 - _opts 3660 - ); 3661 - return defineEventHandler(async (event) => { 3662 - if (opts.headersOnly) { 3663 - if (handleCacheHeaders(event, { maxAge: opts.maxAge })) { 3664 - return; 3665 - } 3666 - return handler(event); 3667 - } 3668 - const response = await _cachedHandler( 3669 - event 3670 - ); 3671 - if (event.node.res.headersSent || event.node.res.writableEnded) { 3672 - return response.body; 3673 - } 3674 - if (handleCacheHeaders(event, { 3675 - modifiedTime: new Date(response.headers["last-modified"]), 3676 - etag: response.headers.etag, 3677 - maxAge: opts.maxAge 3678 - })) { 3679 - return; 3680 - } 3681 - event.node.res.statusCode = response.code; 3682 - for (const name in response.headers) { 3683 - const value = response.headers[name]; 3684 - if (name === "set-cookie") { 3685 - event.node.res.appendHeader( 3686 - name, 3687 - splitCookiesString(value) 3688 - ); 3689 - } else { 3690 - if (value !== void 0) { 3691 - event.node.res.setHeader(name, value); 3692 - } 3693 - } 3694 - } 3695 - return response.body; 3696 - }); 3697 - } 3698 - function cloneWithProxy(obj, overrides) { 3699 - return new Proxy(obj, { 3700 - get(target, property, receiver) { 3701 - if (property in overrides) { 3702 - return overrides[property]; 3703 - } 3704 - return Reflect.get(target, property, receiver); 3705 - }, 3706 - set(target, property, value, receiver) { 3707 - if (property in overrides) { 3708 - overrides[property] = value; 3709 - return true; 3710 - } 3711 - return Reflect.set(target, property, value, receiver); 3712 - } 3713 - }); 3714 - } 3715 - const cachedEventHandler = defineCachedEventHandler; 3716 - 3717 - function klona(x) { 3718 - if (typeof x !== 'object') return x; 3719 - 3720 - var k, tmp, str=Object.prototype.toString.call(x); 3721 - 3722 - if (str === '[object Object]') { 3723 - if (x.constructor !== Object && typeof x.constructor === 'function') { 3724 - tmp = new x.constructor(); 3725 - for (k in x) { 3726 - if (x.hasOwnProperty(k) && tmp[k] !== x[k]) { 3727 - tmp[k] = klona(x[k]); 3728 - } 3729 - } 3730 - } else { 3731 - tmp = {}; // null 3732 - for (k in x) { 3733 - if (k === '__proto__') { 3734 - Object.defineProperty(tmp, k, { 3735 - value: klona(x[k]), 3736 - configurable: true, 3737 - enumerable: true, 3738 - writable: true, 3739 - }); 3740 - } else { 3741 - tmp[k] = klona(x[k]); 3742 - } 3743 - } 3744 - } 3745 - return tmp; 3746 - } 3747 - 3748 - if (str === '[object Array]') { 3749 - k = x.length; 3750 - for (tmp=Array(k); k--;) { 3751 - tmp[k] = klona(x[k]); 3752 - } 3753 - return tmp; 3754 - } 3755 - 3756 - if (str === '[object Set]') { 3757 - tmp = new Set; 3758 - x.forEach(function (val) { 3759 - tmp.add(klona(val)); 3760 - }); 3761 - return tmp; 3762 - } 3763 - 3764 - if (str === '[object Map]') { 3765 - tmp = new Map; 3766 - x.forEach(function (val, key) { 3767 - tmp.set(klona(key), klona(val)); 3768 - }); 3769 - return tmp; 3770 - } 3771 - 3772 - if (str === '[object Date]') { 3773 - return new Date(+x); 3774 - } 3775 - 3776 - if (str === '[object RegExp]') { 3777 - tmp = new RegExp(x.source, x.flags); 3778 - tmp.lastIndex = x.lastIndex; 3779 - return tmp; 3780 - } 3781 - 3782 - if (str === '[object DataView]') { 3783 - return new x.constructor( klona(x.buffer) ); 3784 - } 3785 - 3786 - if (str === '[object ArrayBuffer]') { 3787 - return x.slice(0); 3788 - } 3789 - 3790 - // ArrayBuffer.isView(x) 3791 - // ~> `new` bcuz `Buffer.slice` => ref 3792 - if (str.slice(-6) === 'Array]') { 3793 - return new x.constructor(x); 3794 - } 3795 - 3796 - return x; 3797 - } 3798 - 3799 - const inlineAppConfig = {}; 3800 - 3801 - 3802 - 3803 - const appConfig = defuFn(inlineAppConfig); 3804 - 3805 - const NUMBER_CHAR_RE = /\d/; 3806 - const STR_SPLITTERS = ["-", "_", "/", "."]; 3807 - function isUppercase(char = "") { 3808 - if (NUMBER_CHAR_RE.test(char)) { 3809 - return void 0; 3810 - } 3811 - return char !== char.toLowerCase(); 3812 - } 3813 - function splitByCase(str, separators) { 3814 - const splitters = STR_SPLITTERS; 3815 - const parts = []; 3816 - if (!str || typeof str !== "string") { 3817 - return parts; 3818 - } 3819 - let buff = ""; 3820 - let previousUpper; 3821 - let previousSplitter; 3822 - for (const char of str) { 3823 - const isSplitter = splitters.includes(char); 3824 - if (isSplitter === true) { 3825 - parts.push(buff); 3826 - buff = ""; 3827 - previousUpper = void 0; 3828 - continue; 3829 - } 3830 - const isUpper = isUppercase(char); 3831 - if (previousSplitter === false) { 3832 - if (previousUpper === false && isUpper === true) { 3833 - parts.push(buff); 3834 - buff = char; 3835 - previousUpper = isUpper; 3836 - continue; 3837 - } 3838 - if (previousUpper === true && isUpper === false && buff.length > 1) { 3839 - const lastChar = buff.at(-1); 3840 - parts.push(buff.slice(0, Math.max(0, buff.length - 1))); 3841 - buff = lastChar + char; 3842 - previousUpper = isUpper; 3843 - continue; 3844 - } 3845 - } 3846 - buff += char; 3847 - previousUpper = isUpper; 3848 - previousSplitter = isSplitter; 3849 - } 3850 - parts.push(buff); 3851 - return parts; 3852 - } 3853 - function kebabCase(str, joiner) { 3854 - return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => p.toLowerCase()).join(joiner) : ""; 3855 - } 3856 - function snakeCase(str) { 3857 - return kebabCase(str || "", "_"); 3858 - } 3859 - 3860 - function getEnv(key, opts) { 3861 - const envKey = snakeCase(key).toUpperCase(); 3862 - return destr( 3863 - process.env[opts.prefix + envKey] ?? process.env[opts.altPrefix + envKey] 3864 - ); 3865 - } 3866 - function _isObject(input) { 3867 - return typeof input === "object" && !Array.isArray(input); 3868 - } 3869 - function applyEnv(obj, opts, parentKey = "") { 3870 - for (const key in obj) { 3871 - const subKey = parentKey ? `${parentKey}_${key}` : key; 3872 - const envValue = getEnv(subKey, opts); 3873 - if (_isObject(obj[key])) { 3874 - if (_isObject(envValue)) { 3875 - obj[key] = { ...obj[key], ...envValue }; 3876 - applyEnv(obj[key], opts, subKey); 3877 - } else if (envValue === void 0) { 3878 - applyEnv(obj[key], opts, subKey); 3879 - } else { 3880 - obj[key] = envValue ?? obj[key]; 3881 - } 3882 - } else { 3883 - obj[key] = envValue ?? obj[key]; 3884 - } 3885 - if (opts.envExpansion && typeof obj[key] === "string") { 3886 - obj[key] = _expandFromEnv(obj[key]); 3887 - } 3888 - } 3889 - return obj; 3890 - } 3891 - const envExpandRx = /\{\{([^{}]*)\}\}/g; 3892 - function _expandFromEnv(value) { 3893 - return value.replace(envExpandRx, (match, key) => { 3894 - return process.env[key] || match; 3895 - }); 3896 - } 3897 - 3898 - const _inlineRuntimeConfig = { 3899 - "app": { 3900 - "baseURL": "/" 3901 - }, 3902 - "nitro": { 3903 - "routeRules": {} 3904 - } 3905 - }; 3906 - const envOptions = { 3907 - prefix: "NITRO_", 3908 - altPrefix: _inlineRuntimeConfig.nitro.envPrefix ?? process.env.NITRO_ENV_PREFIX ?? "_", 3909 - envExpansion: _inlineRuntimeConfig.nitro.envExpansion ?? process.env.NITRO_ENV_EXPANSION ?? false 3910 - }; 3911 - const _sharedRuntimeConfig = _deepFreeze( 3912 - applyEnv(klona(_inlineRuntimeConfig), envOptions) 3913 - ); 3914 - function useRuntimeConfig(event) { 3915 - { 3916 - return _sharedRuntimeConfig; 3917 - } 3918 - } 3919 - _deepFreeze(klona(appConfig)); 3920 - function _deepFreeze(object) { 3921 - const propNames = Object.getOwnPropertyNames(object); 3922 - for (const name of propNames) { 3923 - const value = object[name]; 3924 - if (value && typeof value === "object") { 3925 - _deepFreeze(value); 3926 - } 3927 - } 3928 - return Object.freeze(object); 3929 - } 3930 - new Proxy(/* @__PURE__ */ Object.create(null), { 3931 - get: (_, prop) => { 3932 - console.warn( 3933 - "Please use `useRuntimeConfig()` instead of accessing config directly." 3934 - ); 3935 - const runtimeConfig = useRuntimeConfig(); 3936 - if (prop in runtimeConfig) { 3937 - return runtimeConfig[prop]; 3938 - } 3939 - return void 0; 3940 - } 3941 - }); 3942 - 3943 - function createContext(opts = {}) { 3944 - let currentInstance; 3945 - let isSingleton = false; 3946 - const checkConflict = (instance) => { 3947 - if (currentInstance && currentInstance !== instance) { 3948 - throw new Error("Context conflict"); 3949 - } 3950 - }; 3951 - let als; 3952 - if (opts.asyncContext) { 3953 - const _AsyncLocalStorage = opts.AsyncLocalStorage || globalThis.AsyncLocalStorage; 3954 - if (_AsyncLocalStorage) { 3955 - als = new _AsyncLocalStorage(); 3956 - } else { 3957 - console.warn("[unctx] `AsyncLocalStorage` is not provided."); 3958 - } 3959 - } 3960 - const _getCurrentInstance = () => { 3961 - if (als) { 3962 - const instance = als.getStore(); 3963 - if (instance !== void 0) { 3964 - return instance; 3965 - } 3966 - } 3967 - return currentInstance; 3968 - }; 3969 - return { 3970 - use: () => { 3971 - const _instance = _getCurrentInstance(); 3972 - if (_instance === void 0) { 3973 - throw new Error("Context is not available"); 3974 - } 3975 - return _instance; 3976 - }, 3977 - tryUse: () => { 3978 - return _getCurrentInstance(); 3979 - }, 3980 - set: (instance, replace) => { 3981 - if (!replace) { 3982 - checkConflict(instance); 3983 - } 3984 - currentInstance = instance; 3985 - isSingleton = true; 3986 - }, 3987 - unset: () => { 3988 - currentInstance = void 0; 3989 - isSingleton = false; 3990 - }, 3991 - call: (instance, callback) => { 3992 - checkConflict(instance); 3993 - currentInstance = instance; 3994 - try { 3995 - return als ? als.run(instance, callback) : callback(); 3996 - } finally { 3997 - if (!isSingleton) { 3998 - currentInstance = void 0; 3999 - } 4000 - } 4001 - }, 4002 - async callAsync(instance, callback) { 4003 - currentInstance = instance; 4004 - const onRestore = () => { 4005 - currentInstance = instance; 4006 - }; 4007 - const onLeave = () => currentInstance === instance ? onRestore : void 0; 4008 - asyncHandlers.add(onLeave); 4009 - try { 4010 - const r = als ? als.run(instance, callback) : callback(); 4011 - if (!isSingleton) { 4012 - currentInstance = void 0; 4013 - } 4014 - return await r; 4015 - } finally { 4016 - asyncHandlers.delete(onLeave); 4017 - } 4018 - } 4019 - }; 4020 - } 4021 - function createNamespace(defaultOpts = {}) { 4022 - const contexts = {}; 4023 - return { 4024 - get(key, opts = {}) { 4025 - if (!contexts[key]) { 4026 - contexts[key] = createContext({ ...defaultOpts, ...opts }); 4027 - } 4028 - return contexts[key]; 4029 - } 4030 - }; 4031 - } 4032 - const _globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : {}; 4033 - const globalKey = "__unctx__"; 4034 - const defaultNamespace = _globalThis[globalKey] || (_globalThis[globalKey] = createNamespace()); 4035 - const getContext = (key, opts = {}) => defaultNamespace.get(key, opts); 4036 - const asyncHandlersKey = "__unctx_async_handlers__"; 4037 - const asyncHandlers = _globalThis[asyncHandlersKey] || (_globalThis[asyncHandlersKey] = /* @__PURE__ */ new Set()); 4038 - 4039 - getContext("nitro-app", { 4040 - asyncContext: undefined, 4041 - AsyncLocalStorage: void 0 4042 - }); 4043 - 4044 - const config = useRuntimeConfig(); 4045 - const _routeRulesMatcher = toRouteMatcher( 4046 - createRouter$1({ routes: config.nitro.routeRules }) 4047 - ); 4048 - function createRouteRulesHandler(ctx) { 4049 - return eventHandler((event) => { 4050 - const routeRules = getRouteRules(event); 4051 - if (routeRules.headers) { 4052 - setHeaders(event, routeRules.headers); 4053 - } 4054 - if (routeRules.redirect) { 4055 - let target = routeRules.redirect.to; 4056 - if (target.endsWith("/**")) { 4057 - let targetPath = event.path; 4058 - const strpBase = routeRules.redirect._redirectStripBase; 4059 - if (strpBase) { 4060 - targetPath = withoutBase(targetPath, strpBase); 4061 - } 4062 - target = joinURL(target.slice(0, -3), targetPath); 4063 - } else if (event.path.includes("?")) { 4064 - const query = getQuery(event.path); 4065 - target = withQuery(target, query); 4066 - } 4067 - return sendRedirect(event, target, routeRules.redirect.statusCode); 4068 - } 4069 - if (routeRules.proxy) { 4070 - let target = routeRules.proxy.to; 4071 - if (target.endsWith("/**")) { 4072 - let targetPath = event.path; 4073 - const strpBase = routeRules.proxy._proxyStripBase; 4074 - if (strpBase) { 4075 - targetPath = withoutBase(targetPath, strpBase); 4076 - } 4077 - target = joinURL(target.slice(0, -3), targetPath); 4078 - } else if (event.path.includes("?")) { 4079 - const query = getQuery(event.path); 4080 - target = withQuery(target, query); 4081 - } 4082 - return proxyRequest(event, target, { 4083 - fetch: ctx.localFetch, 4084 - ...routeRules.proxy 4085 - }); 4086 - } 4087 - }); 4088 - } 4089 - function getRouteRules(event) { 4090 - event.context._nitro = event.context._nitro || {}; 4091 - if (!event.context._nitro.routeRules) { 4092 - event.context._nitro.routeRules = getRouteRulesForPath( 4093 - withoutBase(event.path.split("?")[0], useRuntimeConfig().app.baseURL) 4094 - ); 4095 - } 4096 - return event.context._nitro.routeRules; 4097 - } 4098 - function getRouteRulesForPath(path) { 4099 - return defu({}, ..._routeRulesMatcher.matchAll(path).reverse()); 4100 - } 4101 - 4102 - function _captureError(error, type) { 4103 - console.error(`[${type}]`, error); 4104 - useNitroApp().captureError(error, { tags: [type] }); 4105 - } 4106 - function trapUnhandledNodeErrors() { 4107 - process.on( 4108 - "unhandledRejection", 4109 - (error) => _captureError(error, "unhandledRejection") 4110 - ); 4111 - process.on( 4112 - "uncaughtException", 4113 - (error) => _captureError(error, "uncaughtException") 4114 - ); 4115 - } 4116 - function joinHeaders(value) { 4117 - return Array.isArray(value) ? value.join(", ") : String(value); 4118 - } 4119 - function normalizeFetchResponse(response) { 4120 - if (!response.headers.has("set-cookie")) { 4121 - return response; 4122 - } 4123 - return new Response(response.body, { 4124 - status: response.status, 4125 - statusText: response.statusText, 4126 - headers: normalizeCookieHeaders(response.headers) 4127 - }); 4128 - } 4129 - function normalizeCookieHeader(header = "") { 4130 - return splitCookiesString(joinHeaders(header)); 4131 - } 4132 - function normalizeCookieHeaders(headers) { 4133 - const outgoingHeaders = new Headers(); 4134 - for (const [name, header] of headers) { 4135 - if (name === "set-cookie") { 4136 - for (const cookie of normalizeCookieHeader(header)) { 4137 - outgoingHeaders.append("set-cookie", cookie); 4138 - } 4139 - } else { 4140 - outgoingHeaders.set(name, joinHeaders(header)); 4141 - } 4142 - } 4143 - return outgoingHeaders; 4144 - } 4145 - 4146 - function defineNitroErrorHandler(handler) { 4147 - return handler; 4148 - } 4149 - 4150 - const errorHandler$0 = defineNitroErrorHandler( 4151 - function defaultNitroErrorHandler(error, event) { 4152 - const res = defaultHandler(error, event); 4153 - setResponseHeaders(event, res.headers); 4154 - setResponseStatus(event, res.status, res.statusText); 4155 - return send(event, JSON.stringify(res.body, null, 2)); 4156 - } 4157 - ); 4158 - function defaultHandler(error, event, opts) { 4159 - const isSensitive = error.unhandled || error.fatal; 4160 - const statusCode = error.statusCode || 500; 4161 - const statusMessage = error.statusMessage || "Server Error"; 4162 - const url = getRequestURL(event, { xForwardedHost: true, xForwardedProto: true }); 4163 - if (statusCode === 404) { 4164 - const baseURL = "/"; 4165 - if (/^\/[^/]/.test(baseURL) && !url.pathname.startsWith(baseURL)) { 4166 - const redirectTo = `${baseURL}${url.pathname.slice(1)}${url.search}`; 4167 - return { 4168 - status: 302, 4169 - statusText: "Found", 4170 - headers: { location: redirectTo }, 4171 - body: `Redirecting...` 4172 - }; 4173 - } 4174 - } 4175 - if (isSensitive && !opts?.silent) { 4176 - const tags = [error.unhandled && "[unhandled]", error.fatal && "[fatal]"].filter(Boolean).join(" "); 4177 - console.error(`[request error] ${tags} [${event.method}] ${url} 4178 - `, error); 4179 - } 4180 - const headers = { 4181 - "content-type": "application/json", 4182 - // Prevent browser from guessing the MIME types of resources. 4183 - "x-content-type-options": "nosniff", 4184 - // Prevent error page from being embedded in an iframe 4185 - "x-frame-options": "DENY", 4186 - // Prevent browsers from sending the Referer header 4187 - "referrer-policy": "no-referrer", 4188 - // Disable the execution of any js 4189 - "content-security-policy": "script-src 'none'; frame-ancestors 'none';" 4190 - }; 4191 - setResponseStatus(event, statusCode, statusMessage); 4192 - if (statusCode === 404 || !getResponseHeader(event, "cache-control")) { 4193 - headers["cache-control"] = "no-cache"; 4194 - } 4195 - const body = { 4196 - error: true, 4197 - url: url.href, 4198 - statusCode, 4199 - statusMessage, 4200 - message: isSensitive ? "Server Error" : error.message, 4201 - data: isSensitive ? void 0 : error.data 4202 - }; 4203 - return { 4204 - status: statusCode, 4205 - statusText: statusMessage, 4206 - headers, 4207 - body 4208 - }; 4209 - } 4210 - 4211 - const errorHandlers = [errorHandler$0]; 4212 - 4213 - async function errorHandler(error, event) { 4214 - for (const handler of errorHandlers) { 4215 - try { 4216 - await handler(error, event, { defaultHandler }); 4217 - if (event.handled) { 4218 - return; // Response handled 4219 - } 4220 - } catch(error) { 4221 - // Handler itself thrown, log and continue 4222 - console.error(error); 4223 - } 4224 - } 4225 - // H3 will handle fallback 4226 - } 4227 - 4228 - const plugins = [ 4229 - 4230 - ]; 4231 - 4232 - const assets = { 4233 - "/favicon.ico": { 4234 - "type": "image/vnd.microsoft.icon", 4235 - "etag": "\"f1e-ESBTjHetHyiokkO0tT/irBbMO8Y\"", 4236 - "mtime": "2025-05-23T08:23:42.003Z", 4237 - "size": 3870, 4238 - "path": "../public/favicon.ico" 4239 - }, 4240 - "/logo192.png": { 4241 - "type": "image/png", 4242 - "etag": "\"14e3-f08taHgqf6/O2oRVTsq5tImHdQA\"", 4243 - "mtime": "2025-05-23T08:23:42.003Z", 4244 - "size": 5347, 4245 - "path": "../public/logo192.png" 4246 - }, 4247 - "/logo512.png": { 4248 - "type": "image/png", 4249 - "etag": "\"25c0-RpFfnQJpTtSb/HqVNJR2hBA9w/4\"", 4250 - "mtime": "2025-05-23T08:23:42.003Z", 4251 - "size": 9664, 4252 - "path": "../public/logo512.png" 4253 - }, 4254 - "/manifest.json": { 4255 - "type": "application/json", 4256 - "etag": "\"1f2-Oqn/x1R1hBTtEjA8nFhpBeFJJNg\"", 4257 - "mtime": "2025-05-23T08:23:42.003Z", 4258 - "size": 498, 4259 - "path": "../public/manifest.json" 4260 - }, 4261 - "/robots.txt": { 4262 - "type": "text/plain; charset=utf-8", 4263 - "etag": "\"43-BEzmj4PuhUNHX+oW9uOnPSihxtU\"", 4264 - "mtime": "2025-05-23T08:23:42.003Z", 4265 - "size": 67, 4266 - "path": "../public/robots.txt" 4267 - }, 4268 - "/.vite/manifest.json": { 4269 - "type": "application/json", 4270 - "etag": "\"18a8-bzZS203rlWRdfxDxbL+MZcJB7Fk\"", 4271 - "mtime": "2025-05-23T08:23:42.003Z", 4272 - "size": 6312, 4273 - "path": "../public/.vite/manifest.json" 4274 - }, 4275 - "/assets/basic-D_HBRECz.js": { 4276 - "type": "text/javascript; charset=utf-8", 4277 - "etag": "\"7b1-xEPcv5bUDLrG7Y0DBQ7eRyGe0Po\"", 4278 - "mtime": "2025-05-23T08:23:42.003Z", 4279 - "size": 1969, 4280 - "path": "../public/assets/basic-D_HBRECz.js" 4281 - }, 4282 - "/assets/global-B8kMkExK.css": { 4283 - "type": "text/css; charset=utf-8", 4284 - "etag": "\"4d8d-usxGHq56PZw7yApQ4R6KaZ7yA/k\"", 4285 - "mtime": "2025-05-23T08:23:42.003Z", 4286 - "size": 19853, 4287 - "path": "../public/assets/global-B8kMkExK.css" 4288 - }, 4289 - "/assets/index-Cb09vRb3.js": { 4290 - "type": "text/javascript; charset=utf-8", 4291 - "etag": "\"417-/pxSUpr9MmDrxrxm/XksJaLa6Kg\"", 4292 - "mtime": "2025-05-23T08:23:42.003Z", 4293 - "size": 1047, 4294 - "path": "../public/assets/index-Cb09vRb3.js" 4295 - }, 4296 - "/assets/intent-preloading-BYVPES3z.js": { 4297 - "type": "text/javascript; charset=utf-8", 4298 - "etag": "\"86-R0dYb9cCj07rgAp9RkwVKw90yYU\"", 4299 - "mtime": "2025-05-23T08:23:42.003Z", 4300 - "size": 134, 4301 - "path": "../public/assets/intent-preloading-BYVPES3z.js" 4302 - }, 4303 - "/assets/intent-preloading-BbIeCNkQ.js": { 4304 - "type": "text/javascript; charset=utf-8", 4305 - "etag": "\"6b2-NIWNWGkaVTszyfR6jHOXrqw49a4\"", 4306 - "mtime": "2025-05-23T08:23:42.003Z", 4307 - "size": 1714, 4308 - "path": "../public/assets/intent-preloading-BbIeCNkQ.js" 4309 - }, 4310 - "/assets/intent-preloading-Bn-PcF_7.js": { 4311 - "type": "text/javascript; charset=utf-8", 4312 - "etag": "\"7f-NrLrblyk5AfOT7sXv4GkLgWGK+Y\"", 4313 - "mtime": "2025-05-23T08:23:42.003Z", 4314 - "size": 127, 4315 - "path": "../public/assets/intent-preloading-Bn-PcF_7.js" 4316 - }, 4317 - "/assets/logo-CHtJT8UQ.svg": { 4318 - "type": "image/svg+xml", 4319 - "etag": "\"21a0-mFG3bLdagHIeK0ThLR52w7noTKo\"", 4320 - "mtime": "2025-05-23T08:23:42.003Z", 4321 - "size": 8608, 4322 - "path": "../public/assets/logo-CHtJT8UQ.svg" 4323 - }, 4324 - "/assets/main-C_SO_aYE.js": { 4325 - "type": "text/javascript; charset=utf-8", 4326 - "etag": "\"4cfd3-cEkHYIpmIUTh5IieKLOoWcMLAxI\"", 4327 - "mtime": "2025-05-23T08:23:42.003Z", 4328 - "size": 315347, 4329 - "path": "../public/assets/main-C_SO_aYE.js" 4330 - }, 4331 - "/assets/pagination-CseTwIHn.js": { 4332 - "type": "text/javascript; charset=utf-8", 4333 - "etag": "\"7f-NrLrblyk5AfOT7sXv4GkLgWGK+Y\"", 4334 - "mtime": "2025-05-23T08:23:42.003Z", 4335 - "size": 127, 4336 - "path": "../public/assets/pagination-CseTwIHn.js" 4337 - }, 4338 - "/assets/pagination-DHyhKn7Y.js": { 4339 - "type": "text/javascript; charset=utf-8", 4340 - "etag": "\"784-o/mlX3Uxnc3G/EviJKjs5AQHDRs\"", 4341 - "mtime": "2025-05-23T08:23:42.003Z", 4342 - "size": 1924, 4343 - "path": "../public/assets/pagination-DHyhKn7Y.js" 4344 - }, 4345 - "/assets/pagination-DT5U_TVa.js": { 4346 - "type": "text/javascript; charset=utf-8", 4347 - "etag": "\"86-R0dYb9cCj07rgAp9RkwVKw90yYU\"", 4348 - "mtime": "2025-05-23T08:23:42.003Z", 4349 - "size": 134, 4350 - "path": "../public/assets/pagination-DT5U_TVa.js" 4351 - }, 4352 - "/assets/preloading-CF6-eBB1.js": { 4353 - "type": "text/javascript; charset=utf-8", 4354 - "etag": "\"86-R0dYb9cCj07rgAp9RkwVKw90yYU\"", 4355 - "mtime": "2025-05-23T08:23:42.003Z", 4356 - "size": 134, 4357 - "path": "../public/assets/preloading-CF6-eBB1.js" 4358 - }, 4359 - "/assets/preloading-CS9n1_uB.js": { 4360 - "type": "text/javascript; charset=utf-8", 4361 - "etag": "\"7f-NrLrblyk5AfOT7sXv4GkLgWGK+Y\"", 4362 - "mtime": "2025-05-23T08:23:42.003Z", 4363 - "size": 127, 4364 - "path": "../public/assets/preloading-CS9n1_uB.js" 4365 - }, 4366 - "/assets/preloading-Cx2nmQCS.js": { 4367 - "type": "text/javascript; charset=utf-8", 4368 - "etag": "\"687-BbPrlBwrOM5UsinDh5oRaXQRwPA\"", 4369 - "mtime": "2025-05-23T08:23:42.003Z", 4370 - "size": 1671, 4371 - "path": "../public/assets/preloading-Cx2nmQCS.js" 4372 - }, 4373 - "/assets/suspense-C9NRSXhZ.js": { 4374 - "type": "text/javascript; charset=utf-8", 4375 - "etag": "\"7b6-FNN+1FVnx+RHRml44AzVXHDrunk\"", 4376 - "mtime": "2025-05-23T08:23:42.003Z", 4377 - "size": 1974, 4378 - "path": "../public/assets/suspense-C9NRSXhZ.js" 4379 - }, 4380 - "/assets/suspense-CVRJPFh1.js": { 4381 - "type": "text/javascript; charset=utf-8", 4382 - "etag": "\"86-R0dYb9cCj07rgAp9RkwVKw90yYU\"", 4383 - "mtime": "2025-05-23T08:23:42.003Z", 4384 - "size": 134, 4385 - "path": "../public/assets/suspense-CVRJPFh1.js" 4386 - }, 4387 - "/assets/suspense-DRsZG-IO.js": { 4388 - "type": "text/javascript; charset=utf-8", 4389 - "etag": "\"7f-NrLrblyk5AfOT7sXv4GkLgWGK+Y\"", 4390 - "mtime": "2025-05-23T08:23:42.003Z", 4391 - "size": 127, 4392 - "path": "../public/assets/suspense-DRsZG-IO.js" 4393 - }, 4394 - "/assets/table-BGKcx7UY.js": { 4395 - "type": "text/javascript; charset=utf-8", 4396 - "etag": "\"962f-Wm9wNoHcBQiaf88W+tkOsG86x/E\"", 4397 - "mtime": "2025-05-23T08:23:42.003Z", 4398 - "size": 38447, 4399 - "path": "../public/assets/table-BGKcx7UY.js" 4400 - }, 4401 - "/assets/useSuspenseQuery-BacjgsWj.js": { 4402 - "type": "text/javascript; charset=utf-8", 4403 - "etag": "\"a6-swelqtRUXzwnPho7rFq8yjj5zj8\"", 4404 - "mtime": "2025-05-23T08:23:42.003Z", 4405 - "size": 166, 4406 - "path": "../public/assets/useSuspenseQuery-BacjgsWj.js" 4407 - } 4408 - }; 4409 - 4410 - const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//; 4411 - function normalizeWindowsPath(input = "") { 4412 - if (!input) { 4413 - return input; 4414 - } 4415 - return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase()); 4416 - } 4417 - const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/; 4418 - const _DRIVE_LETTER_RE = /^[A-Za-z]:$/; 4419 - function cwd() { 4420 - if (typeof process !== "undefined" && typeof process.cwd === "function") { 4421 - return process.cwd().replace(/\\/g, "/"); 4422 - } 4423 - return "/"; 4424 - } 4425 - const resolve = function(...arguments_) { 4426 - arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument)); 4427 - let resolvedPath = ""; 4428 - let resolvedAbsolute = false; 4429 - for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) { 4430 - const path = index >= 0 ? arguments_[index] : cwd(); 4431 - if (!path || path.length === 0) { 4432 - continue; 4433 - } 4434 - resolvedPath = `${path}/${resolvedPath}`; 4435 - resolvedAbsolute = isAbsolute(path); 4436 - } 4437 - resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute); 4438 - if (resolvedAbsolute && !isAbsolute(resolvedPath)) { 4439 - return `/${resolvedPath}`; 4440 - } 4441 - return resolvedPath.length > 0 ? resolvedPath : "."; 4442 - }; 4443 - function normalizeString(path, allowAboveRoot) { 4444 - let res = ""; 4445 - let lastSegmentLength = 0; 4446 - let lastSlash = -1; 4447 - let dots = 0; 4448 - let char = null; 4449 - for (let index = 0; index <= path.length; ++index) { 4450 - if (index < path.length) { 4451 - char = path[index]; 4452 - } else if (char === "/") { 4453 - break; 4454 - } else { 4455 - char = "/"; 4456 - } 4457 - if (char === "/") { 4458 - if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) { 4459 - if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") { 4460 - if (res.length > 2) { 4461 - const lastSlashIndex = res.lastIndexOf("/"); 4462 - if (lastSlashIndex === -1) { 4463 - res = ""; 4464 - lastSegmentLength = 0; 4465 - } else { 4466 - res = res.slice(0, lastSlashIndex); 4467 - lastSegmentLength = res.length - 1 - res.lastIndexOf("/"); 4468 - } 4469 - lastSlash = index; 4470 - dots = 0; 4471 - continue; 4472 - } else if (res.length > 0) { 4473 - res = ""; 4474 - lastSegmentLength = 0; 4475 - lastSlash = index; 4476 - dots = 0; 4477 - continue; 4478 - } 4479 - } 4480 - if (allowAboveRoot) { 4481 - res += res.length > 0 ? "/.." : ".."; 4482 - lastSegmentLength = 2; 4483 - } 4484 - } else { 4485 - if (res.length > 0) { 4486 - res += `/${path.slice(lastSlash + 1, index)}`; 4487 - } else { 4488 - res = path.slice(lastSlash + 1, index); 4489 - } 4490 - lastSegmentLength = index - lastSlash - 1; 4491 - } 4492 - lastSlash = index; 4493 - dots = 0; 4494 - } else if (char === "." && dots !== -1) { 4495 - ++dots; 4496 - } else { 4497 - dots = -1; 4498 - } 4499 - } 4500 - return res; 4501 - } 4502 - const isAbsolute = function(p) { 4503 - return _IS_ABSOLUTE_RE.test(p); 4504 - }; 4505 - const dirname = function(p) { 4506 - const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1); 4507 - if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) { 4508 - segments[0] += "/"; 4509 - } 4510 - return segments.join("/") || (isAbsolute(p) ? "/" : "."); 4511 - }; 4512 - 4513 - function readAsset (id) { 4514 - const serverDir = dirname(fileURLToPath(globalThis._importMeta_.url)); 4515 - return promises.readFile(resolve(serverDir, assets[id].path)) 4516 - } 4517 - 4518 - const publicAssetBases = {}; 4519 - 4520 - function isPublicAssetURL(id = '') { 4521 - if (assets[id]) { 4522 - return true 4523 - } 4524 - for (const base in publicAssetBases) { 4525 - if (id.startsWith(base)) { return true } 4526 - } 4527 - return false 4528 - } 4529 - 4530 - function getAsset (id) { 4531 - return assets[id] 4532 - } 4533 - 4534 - const METHODS = /* @__PURE__ */ new Set(["HEAD", "GET"]); 4535 - const EncodingMap = { gzip: ".gz", br: ".br" }; 4536 - const _SZjwDq = eventHandler((event) => { 4537 - if (event.method && !METHODS.has(event.method)) { 4538 - return; 4539 - } 4540 - let id = decodePath( 4541 - withLeadingSlash(withoutTrailingSlash(parseURL(event.path).pathname)) 4542 - ); 4543 - let asset; 4544 - const encodingHeader = String( 4545 - getRequestHeader(event, "accept-encoding") || "" 4546 - ); 4547 - const encodings = [ 4548 - ...encodingHeader.split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(), 4549 - "" 4550 - ]; 4551 - if (encodings.length > 1) { 4552 - appendResponseHeader(event, "Vary", "Accept-Encoding"); 4553 - } 4554 - for (const encoding of encodings) { 4555 - for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) { 4556 - const _asset = getAsset(_id); 4557 - if (_asset) { 4558 - asset = _asset; 4559 - id = _id; 4560 - break; 4561 - } 4562 - } 4563 - } 4564 - if (!asset) { 4565 - if (isPublicAssetURL(id)) { 4566 - removeResponseHeader(event, "Cache-Control"); 4567 - throw createError$1({ statusCode: 404 }); 4568 - } 4569 - return; 4570 - } 4571 - const ifNotMatch = getRequestHeader(event, "if-none-match") === asset.etag; 4572 - if (ifNotMatch) { 4573 - setResponseStatus(event, 304, "Not Modified"); 4574 - return ""; 4575 - } 4576 - const ifModifiedSinceH = getRequestHeader(event, "if-modified-since"); 4577 - const mtimeDate = new Date(asset.mtime); 4578 - if (ifModifiedSinceH && asset.mtime && new Date(ifModifiedSinceH) >= mtimeDate) { 4579 - setResponseStatus(event, 304, "Not Modified"); 4580 - return ""; 4581 - } 4582 - if (asset.type && !getResponseHeader(event, "Content-Type")) { 4583 - setResponseHeader(event, "Content-Type", asset.type); 4584 - } 4585 - if (asset.etag && !getResponseHeader(event, "ETag")) { 4586 - setResponseHeader(event, "ETag", asset.etag); 4587 - } 4588 - if (asset.mtime && !getResponseHeader(event, "Last-Modified")) { 4589 - setResponseHeader(event, "Last-Modified", mtimeDate.toUTCString()); 4590 - } 4591 - if (asset.encoding && !getResponseHeader(event, "Content-Encoding")) { 4592 - setResponseHeader(event, "Content-Encoding", asset.encoding); 4593 - } 4594 - if (asset.size > 0 && !getResponseHeader(event, "Content-Length")) { 4595 - setResponseHeader(event, "Content-Length", asset.size); 4596 - } 4597 - return readAsset(id); 4598 - }); 4599 - 4600 - const _lazy_vr5YKA = () => import('./chunks/_/ssr.mjs'); 4601 - 4602 - const handlers = [ 4603 - { route: '', handler: _SZjwDq, lazy: false, middleware: true, method: undefined }, 4604 - { route: '/**', handler: _lazy_vr5YKA, lazy: true, middleware: false, method: undefined } 4605 - ]; 4606 - 4607 - function createNitroApp() { 4608 - const config = useRuntimeConfig(); 4609 - const hooks = createHooks(); 4610 - const captureError = (error, context = {}) => { 4611 - const promise = hooks.callHookParallel("error", error, context).catch((error_) => { 4612 - console.error("Error while capturing another error", error_); 4613 - }); 4614 - if (context.event && isEvent(context.event)) { 4615 - const errors = context.event.context.nitro?.errors; 4616 - if (errors) { 4617 - errors.push({ error, context }); 4618 - } 4619 - if (context.event.waitUntil) { 4620 - context.event.waitUntil(promise); 4621 - } 4622 - } 4623 - }; 4624 - const h3App = createApp({ 4625 - debug: destr(false), 4626 - onError: (error, event) => { 4627 - captureError(error, { event, tags: ["request"] }); 4628 - return errorHandler(error, event); 4629 - }, 4630 - onRequest: async (event) => { 4631 - event.context.nitro = event.context.nitro || { errors: [] }; 4632 - const fetchContext = event.node.req?.__unenv__; 4633 - if (fetchContext?._platform) { 4634 - event.context = { 4635 - _platform: fetchContext?._platform, 4636 - // #3335 4637 - ...fetchContext._platform, 4638 - ...event.context 4639 - }; 4640 - } 4641 - if (!event.context.waitUntil && fetchContext?.waitUntil) { 4642 - event.context.waitUntil = fetchContext.waitUntil; 4643 - } 4644 - event.fetch = (req, init) => fetchWithEvent(event, req, init, { fetch: localFetch }); 4645 - event.$fetch = (req, init) => fetchWithEvent(event, req, init, { 4646 - fetch: $fetch 4647 - }); 4648 - event.waitUntil = (promise) => { 4649 - if (!event.context.nitro._waitUntilPromises) { 4650 - event.context.nitro._waitUntilPromises = []; 4651 - } 4652 - event.context.nitro._waitUntilPromises.push(promise); 4653 - if (event.context.waitUntil) { 4654 - event.context.waitUntil(promise); 4655 - } 4656 - }; 4657 - event.captureError = (error, context) => { 4658 - captureError(error, { event, ...context }); 4659 - }; 4660 - await nitroApp$1.hooks.callHook("request", event).catch((error) => { 4661 - captureError(error, { event, tags: ["request"] }); 4662 - }); 4663 - }, 4664 - onBeforeResponse: async (event, response) => { 4665 - await nitroApp$1.hooks.callHook("beforeResponse", event, response).catch((error) => { 4666 - captureError(error, { event, tags: ["request", "response"] }); 4667 - }); 4668 - }, 4669 - onAfterResponse: async (event, response) => { 4670 - await nitroApp$1.hooks.callHook("afterResponse", event, response).catch((error) => { 4671 - captureError(error, { event, tags: ["request", "response"] }); 4672 - }); 4673 - } 4674 - }); 4675 - const router = createRouter({ 4676 - preemptive: true 4677 - }); 4678 - const nodeHandler = toNodeListener(h3App); 4679 - const localCall = (aRequest) => b(nodeHandler, aRequest); 4680 - const localFetch = (input, init) => { 4681 - if (!input.toString().startsWith("/")) { 4682 - return globalThis.fetch(input, init); 4683 - } 4684 - return O( 4685 - nodeHandler, 4686 - input, 4687 - init 4688 - ).then((response) => normalizeFetchResponse(response)); 4689 - }; 4690 - const $fetch = createFetch({ 4691 - fetch: localFetch, 4692 - Headers: Headers$1, 4693 - defaults: { baseURL: config.app.baseURL } 4694 - }); 4695 - globalThis.$fetch = $fetch; 4696 - h3App.use(createRouteRulesHandler({ localFetch })); 4697 - for (const h of handlers) { 4698 - let handler = h.lazy ? lazyEventHandler(h.handler) : h.handler; 4699 - if (h.middleware || !h.route) { 4700 - const middlewareBase = (config.app.baseURL + (h.route || "/")).replace( 4701 - /\/+/g, 4702 - "/" 4703 - ); 4704 - h3App.use(middlewareBase, handler); 4705 - } else { 4706 - const routeRules = getRouteRulesForPath( 4707 - h.route.replace(/:\w+|\*\*/g, "_") 4708 - ); 4709 - if (routeRules.cache) { 4710 - handler = cachedEventHandler(handler, { 4711 - group: "nitro/routes", 4712 - ...routeRules.cache 4713 - }); 4714 - } 4715 - router.use(h.route, handler, h.method); 4716 - } 4717 - } 4718 - h3App.use(config.app.baseURL, router.handler); 4719 - const app = { 4720 - hooks, 4721 - h3App, 4722 - router, 4723 - localCall, 4724 - localFetch, 4725 - captureError 4726 - }; 4727 - return app; 4728 - } 4729 - function runNitroPlugins(nitroApp2) { 4730 - for (const plugin of plugins) { 4731 - try { 4732 - plugin(nitroApp2); 4733 - } catch (error) { 4734 - nitroApp2.captureError(error, { tags: ["plugin"] }); 4735 - throw error; 4736 - } 4737 - } 4738 - } 4739 - const nitroApp$1 = createNitroApp(); 4740 - function useNitroApp() { 4741 - return nitroApp$1; 4742 - } 4743 - runNitroPlugins(nitroApp$1); 4744 - 4745 - const debug = (...args) => { 4746 - }; 4747 - function GracefulShutdown(server, opts) { 4748 - opts = opts || {}; 4749 - const options = Object.assign( 4750 - { 4751 - signals: "SIGINT SIGTERM", 4752 - timeout: 3e4, 4753 - development: false, 4754 - forceExit: true, 4755 - onShutdown: (signal) => Promise.resolve(signal), 4756 - preShutdown: (signal) => Promise.resolve(signal) 4757 - }, 4758 - opts 4759 - ); 4760 - let isShuttingDown = false; 4761 - const connections = {}; 4762 - let connectionCounter = 0; 4763 - const secureConnections = {}; 4764 - let secureConnectionCounter = 0; 4765 - let failed = false; 4766 - let finalRun = false; 4767 - function onceFactory() { 4768 - let called = false; 4769 - return (emitter, events, callback) => { 4770 - function call() { 4771 - if (!called) { 4772 - called = true; 4773 - return Reflect.apply(callback, this, arguments); 4774 - } 4775 - } 4776 - for (const e of events) { 4777 - emitter.on(e, call); 4778 - } 4779 - }; 4780 - } 4781 - const signals = options.signals.split(" ").map((s) => s.trim()).filter((s) => s.length > 0); 4782 - const once = onceFactory(); 4783 - once(process, signals, (signal) => { 4784 - debug("received shut down signal", signal); 4785 - shutdown(signal).then(() => { 4786 - if (options.forceExit) { 4787 - process.exit(failed ? 1 : 0); 4788 - } 4789 - }).catch((error) => { 4790 - debug("server shut down error occurred", error); 4791 - process.exit(1); 4792 - }); 4793 - }); 4794 - function isFunction(functionToCheck) { 4795 - const getType = Object.prototype.toString.call(functionToCheck); 4796 - return /^\[object\s([A-Za-z]+)?Function]$/.test(getType); 4797 - } 4798 - function destroy(socket, force = false) { 4799 - if (socket._isIdle && isShuttingDown || force) { 4800 - socket.destroy(); 4801 - if (socket.server instanceof http.Server) { 4802 - delete connections[socket._connectionId]; 4803 - } else { 4804 - delete secureConnections[socket._connectionId]; 4805 - } 4806 - } 4807 - } 4808 - function destroyAllConnections(force = false) { 4809 - debug("Destroy Connections : " + (force ? "forced close" : "close")); 4810 - let counter = 0; 4811 - let secureCounter = 0; 4812 - for (const key of Object.keys(connections)) { 4813 - const socket = connections[key]; 4814 - const serverResponse = socket._httpMessage; 4815 - if (serverResponse && !force) { 4816 - if (!serverResponse.headersSent) { 4817 - serverResponse.setHeader("connection", "close"); 4818 - } 4819 - } else { 4820 - counter++; 4821 - destroy(socket); 4822 - } 4823 - } 4824 - debug("Connections destroyed : " + counter); 4825 - debug("Connection Counter : " + connectionCounter); 4826 - for (const key of Object.keys(secureConnections)) { 4827 - const socket = secureConnections[key]; 4828 - const serverResponse = socket._httpMessage; 4829 - if (serverResponse && !force) { 4830 - if (!serverResponse.headersSent) { 4831 - serverResponse.setHeader("connection", "close"); 4832 - } 4833 - } else { 4834 - secureCounter++; 4835 - destroy(socket); 4836 - } 4837 - } 4838 - debug("Secure Connections destroyed : " + secureCounter); 4839 - debug("Secure Connection Counter : " + secureConnectionCounter); 4840 - } 4841 - server.on("request", (req, res) => { 4842 - req.socket._isIdle = false; 4843 - if (isShuttingDown && !res.headersSent) { 4844 - res.setHeader("connection", "close"); 4845 - } 4846 - res.on("finish", () => { 4847 - req.socket._isIdle = true; 4848 - destroy(req.socket); 4849 - }); 4850 - }); 4851 - server.on("connection", (socket) => { 4852 - if (isShuttingDown) { 4853 - socket.destroy(); 4854 - } else { 4855 - const id = connectionCounter++; 4856 - socket._isIdle = true; 4857 - socket._connectionId = id; 4858 - connections[id] = socket; 4859 - socket.once("close", () => { 4860 - delete connections[socket._connectionId]; 4861 - }); 4862 - } 4863 - }); 4864 - server.on("secureConnection", (socket) => { 4865 - if (isShuttingDown) { 4866 - socket.destroy(); 4867 - } else { 4868 - const id = secureConnectionCounter++; 4869 - socket._isIdle = true; 4870 - socket._connectionId = id; 4871 - secureConnections[id] = socket; 4872 - socket.once("close", () => { 4873 - delete secureConnections[socket._connectionId]; 4874 - }); 4875 - } 4876 - }); 4877 - process.on("close", () => { 4878 - debug("closed"); 4879 - }); 4880 - function shutdown(sig) { 4881 - function cleanupHttp() { 4882 - destroyAllConnections(); 4883 - debug("Close http server"); 4884 - return new Promise((resolve, reject) => { 4885 - server.close((err) => { 4886 - if (err) { 4887 - return reject(err); 4888 - } 4889 - return resolve(true); 4890 - }); 4891 - }); 4892 - } 4893 - debug("shutdown signal - " + sig); 4894 - if (options.development) { 4895 - debug("DEV-Mode - immediate forceful shutdown"); 4896 - return process.exit(0); 4897 - } 4898 - function finalHandler() { 4899 - if (!finalRun) { 4900 - finalRun = true; 4901 - if (options.finally && isFunction(options.finally)) { 4902 - debug("executing finally()"); 4903 - options.finally(); 4904 - } 4905 - } 4906 - return Promise.resolve(); 4907 - } 4908 - function waitForReadyToShutDown(totalNumInterval) { 4909 - debug(`waitForReadyToShutDown... ${totalNumInterval}`); 4910 - if (totalNumInterval === 0) { 4911 - debug( 4912 - `Could not close connections in time (${options.timeout}ms), will forcefully shut down` 4913 - ); 4914 - return Promise.resolve(true); 4915 - } 4916 - const allConnectionsClosed = Object.keys(connections).length === 0 && Object.keys(secureConnections).length === 0; 4917 - if (allConnectionsClosed) { 4918 - debug("All connections closed. Continue to shutting down"); 4919 - return Promise.resolve(false); 4920 - } 4921 - debug("Schedule the next waitForReadyToShutdown"); 4922 - return new Promise((resolve) => { 4923 - setTimeout(() => { 4924 - resolve(waitForReadyToShutDown(totalNumInterval - 1)); 4925 - }, 250); 4926 - }); 4927 - } 4928 - if (isShuttingDown) { 4929 - return Promise.resolve(); 4930 - } 4931 - debug("shutting down"); 4932 - return options.preShutdown(sig).then(() => { 4933 - isShuttingDown = true; 4934 - cleanupHttp(); 4935 - }).then(() => { 4936 - const pollIterations = options.timeout ? Math.round(options.timeout / 250) : 0; 4937 - return waitForReadyToShutDown(pollIterations); 4938 - }).then((force) => { 4939 - debug("Do onShutdown now"); 4940 - if (force) { 4941 - destroyAllConnections(force); 4942 - } 4943 - return options.onShutdown(sig); 4944 - }).then(finalHandler).catch((error) => { 4945 - const errString = typeof error === "string" ? error : JSON.stringify(error); 4946 - debug(errString); 4947 - failed = true; 4948 - throw errString; 4949 - }); 4950 - } 4951 - function shutdownManual() { 4952 - return shutdown("manual"); 4953 - } 4954 - return shutdownManual; 4955 - } 4956 - 4957 - function getGracefulShutdownConfig() { 4958 - return { 4959 - disabled: !!process.env.NITRO_SHUTDOWN_DISABLED, 4960 - signals: (process.env.NITRO_SHUTDOWN_SIGNALS || "SIGTERM SIGINT").split(" ").map((s) => s.trim()), 4961 - timeout: Number.parseInt(process.env.NITRO_SHUTDOWN_TIMEOUT || "", 10) || 3e4, 4962 - forceExit: !process.env.NITRO_SHUTDOWN_NO_FORCE_EXIT 4963 - }; 4964 - } 4965 - function setupGracefulShutdown(listener, nitroApp) { 4966 - const shutdownConfig = getGracefulShutdownConfig(); 4967 - if (shutdownConfig.disabled) { 4968 - return; 4969 - } 4970 - GracefulShutdown(listener, { 4971 - signals: shutdownConfig.signals.join(" "), 4972 - timeout: shutdownConfig.timeout, 4973 - forceExit: shutdownConfig.forceExit, 4974 - onShutdown: async () => { 4975 - await new Promise((resolve) => { 4976 - const timeout = setTimeout(() => { 4977 - console.warn("Graceful shutdown timeout, force exiting..."); 4978 - resolve(); 4979 - }, shutdownConfig.timeout); 4980 - nitroApp.hooks.callHook("close").catch((error) => { 4981 - console.error(error); 4982 - }).finally(() => { 4983 - clearTimeout(timeout); 4984 - resolve(); 4985 - }); 4986 - }); 4987 - } 4988 - }); 4989 - } 4990 - 4991 - const cert = process.env.NITRO_SSL_CERT; 4992 - const key = process.env.NITRO_SSL_KEY; 4993 - const nitroApp = useNitroApp(); 4994 - const server = cert && key ? new Server({ key, cert }, toNodeListener(nitroApp.h3App)) : new Server$1(toNodeListener(nitroApp.h3App)); 4995 - const port = destr(process.env.NITRO_PORT || process.env.PORT) || 3e3; 4996 - const host = process.env.NITRO_HOST || process.env.HOST; 4997 - const path = process.env.NITRO_UNIX_SOCKET; 4998 - const listener = server.listen(path ? { path } : { port, host }, (err) => { 4999 - if (err) { 5000 - console.error(err); 5001 - process.exit(1); 5002 - } 5003 - const protocol = cert && key ? "https" : "http"; 5004 - const addressInfo = listener.address(); 5005 - if (typeof addressInfo === "string") { 5006 - console.log(`Listening on unix socket ${addressInfo}`); 5007 - return; 5008 - } 5009 - const baseURL = (useRuntimeConfig().app.baseURL || "").replace(/\/$/, ""); 5010 - const url = `${protocol}://${addressInfo.family === "IPv6" ? `[${addressInfo.address}]` : addressInfo.address}:${addressInfo.port}${baseURL}`; 5011 - console.log(`Listening on ${url}`); 5012 - }); 5013 - trapUnhandledNodeErrors(); 5014 - setupGracefulShutdown(listener, nitroApp); 5015 - const nodeServer = {}; 5016 - 5017 - export { nodeServer as default }; 5018 - //# sourceMappingURL=index.mjs.map
-1
.output/server/index.mjs.map
··· 1 - {"version":3,"file":"index.mjs","sources":["../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../node_modules/.pnpm/ufo@1.6.1/node_modules/ufo/dist/index.mjs","../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs","../../node_modules/.pnpm/node-mock-http@1.0.0/node_modules/node-mock-http/dist/index.mjs","../../node_modules/.pnpm/h3@1.15.3/node_modules/h3/dist/index.mjs","../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../node_modules/.pnpm/node-fetch-native@1.6.6/node_modules/node-fetch-native/dist/native.mjs","../../node_modules/.pnpm/ofetch@1.4.1/node_modules/ofetch/dist/shared/ofetch.03887fc3.mjs","../../node_modules/.pnpm/ofetch@1.4.1/node_modules/ofetch/dist/node.mjs","../../node_modules/.pnpm/unstorage@1.16.0_db0@0.3.2_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7___ioredis@5.6.1/node_modules/unstorage/dist/shared/unstorage.CoCt7NXC.mjs","../../node_modules/.pnpm/unstorage@1.16.0_db0@0.3.2_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7___ioredis@5.6.1/node_modules/unstorage/dist/index.mjs","../../node_modules/.pnpm/unstorage@1.16.0_db0@0.3.2_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7___ioredis@5.6.1/node_modules/unstorage/drivers/utils/index.mjs","../../node_modules/.pnpm/unstorage@1.16.0_db0@0.3.2_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7___ioredis@5.6.1/node_modules/unstorage/drivers/utils/node-fs.mjs","../../node_modules/.pnpm/unstorage@1.16.0_db0@0.3.2_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7___ioredis@5.6.1/node_modules/unstorage/drivers/fs-lite.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/config.mjs","../../node_modules/.pnpm/unctx@2.4.1/node_modules/unctx/dist/index.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/context.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/static.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/app.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../node_modules/.pnpm/nitropack@2.11.12_@libsql+client@0.15.7_drizzle-orm@0.43.1_@libsql+client@0.15.7_/node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"sourcesContent":null,"names":["createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","normalizeKey","defineDriver","DRIVER_NAME","dirname","fsPromises","resolve","fsp","_inlineAppConfig","createRadixRouter","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]}
-28
.output/server/package.json
··· 1 - { 2 - "name": "preloading-example-prod", 3 - "version": "0.0.0", 4 - "type": "module", 5 - "private": true, 6 - "dependencies": { 7 - "@libsql/client": "0.15.7", 8 - "@libsql/core": "0.15.7", 9 - "@libsql/hrana-client": "0.7.0", 10 - "@libsql/isomorphic-fetch": "0.3.1", 11 - "@libsql/isomorphic-ws": "0.1.5", 12 - "@libsql/linux-x64-gnu": "0.5.11", 13 - "@neon-rs/load": "0.0.4", 14 - "@t3-oss/env-core": "0.13.4", 15 - "class-variance-authority": "0.7.1", 16 - "clsx": "2.1.1", 17 - "detect-libc": "2.0.2", 18 - "drizzle-orm": "0.43.1", 19 - "js-base64": "3.7.7", 20 - "libsql": "0.5.11", 21 - "promise-limit": "2.7.0", 22 - "react": "19.1.0", 23 - "react-dom": "19.1.0", 24 - "tailwind-merge": "3.3.0", 25 - "valibot": "1.1.0", 26 - "ws": "8.18.2" 27 - } 28 - }