mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-22 04:40:17 +03:00
2 lines
24 KiB
JavaScript
2 lines
24 KiB
JavaScript
|
|
import{ssrElement as K,escape as T,mergeProps as Ke,ssr as $,isServer as x,getRequestEvent as k,renderToString as ze,renderToStream as Ge,createComponent as R,delegateEvents as Je,ssrHydrationKey as q,useAssets as Ve,NoHydration as ye,Hydration as Xe,ssrAttribute as z,HydrationScript as Ye}from"solid-js/web";import{lazy as Qe,createComponent as we,sharedConfig as U,getOwner as ve,runWithOwner as Re,createMemo as P,createSignal as M,createRenderEffect as Ze,on as ne,useContext as et,createContext as be,startTransition as tt,resetErrorBoundaries as nt,batch as rt,untrack as Se,children as st,Show as Ee,createRoot as ot,onCleanup as re,Suspense as at,catchError as it,ErrorBoundary as ct}from"solid-js";import{provideRequestEvent as ut}from"solid-js/web/storage";import{H3Event as Y,setResponseStatus as lt,setHeader as ht,getRequestIP as dt,getResponseStatus as ft,getResponseStatusText as pt,getResponseHeader as mt,setResponseHeader as gt,removeResponseHeader as yt,appendResponseHeader as wt,getResponseHeaders as vt,getRequestURL as Rt,getRequestWebStream as bt,sendRedirect as St,getCookie as Et,setCookie as At,eventHandler as $t}from"h3";import{getContext as Pt}from"unctx";import{AsyncLocalStorage as Tt}from"node:async_hooks";import{createRouter as xt}from"radix3";function Ct(e){let t;const n=$e(e),s={duplex:"half",method:e.method,headers:e.headers};return e.node.req.body instanceof ArrayBuffer?new Request(n,{...s,body:e.node.req.body}):new Request(n,{...s,get body(){return t||(t=Mt(e),t)}})}function Lt(e){return e.web??={request:Ct(e),url:$e(e)},e.web.request}function Ht(){return Bt()}const Ae=Symbol("$HTTPEvent");function qt(e){return typeof e=="object"&&(e instanceof Y||e?.[Ae]instanceof Y||e?.__is_event__===!0)}function S(e){return function(...t){let n=t[0];if(qt(n))t[0]=n instanceof Y||n.__is_event__?n:n[Ae];else{if(!globalThis.app.config.server.experimental?.asyncContext)throw new Error("AsyncLocalStorage was not enabled. Use the `server.experimental.asyncContext: true` option in your app configuration to enable it. Or, pass the instance of HTTPEvent that you have as the first argument to the function.");if(n=Ht(),!n)throw new Error("No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.");t.unshift(n)}return e(...t)}}const $e=S(Rt),kt=S(dt),Q=S(lt),ue=S(ft),Ot=S(pt),G=S(vt),le=S(mt),Ft=S(gt),_t=S(wt),he=S(St),It=S(Et),Ut=S(At),jt=S(ht),Mt=S(bt),Nt=S(yt),Wt=S(Lt);function Dt(){return Pt("nitro-app",{asyncContext:!!globalThis.app.config.server.experimental?.asyncContext,AsyncLocalStorage:Tt})}function Bt(){return Dt().use().event}const Pe=[{page:!0,$component:{src:"src/routes/index.jsx?pick=default&pick=$css",build:()=>import("./index.js"),import:()=>import("./index.js")},path:"/",filePath:"/home/gromov/projects/my/svg-sprites/integration/apps/solid-start-vite/src/routes/index.jsx"}],Kt=zt(Pe.filter(e=>e.page));function zt(e){function t(n,s,r,o){const a=Object.values(n).find(i=>r.startsWith(i.id+"/"));return a?(t(a.children||(a.children=[]),s,r.slice(a.id.length)),n):(n.push({...s,id:r,path:r.replace(/\([^)/]+\)/g,"").replace(/\/+/g,"/")}),n)}return e.sort((n,s)=>n.path.length-s.path.length).reduce((n,s)=>t(n,s,s.path,s.path),[])}function Gt(e,t){const n=Vt.lookup(e);if(n&&n.route){const s=n.route,r=t==="HEAD"?s.$HEAD||s.$GET:s[`$${t}`];if(r===void 0)return;const o=s.page===!0&&s.$component!==void 0;return{handler:r,params:n.params,isPage:o}}}function Jt(e){return e.$HEAD||e.$GET||e.$POST||e.$PUT||e.$PATCH||e.$DELETE}const Vt=xt({routes:Pe.reduce((e,t)=>{if(!Jt(t))return e;let n=t.path.replace(/\([^)/]+\)/g,"").replace(/\/+/g,"/").replace(/\*([^/]*)/g,(s,r)=>`**:${r}`).split("/").map(s=>s.startsWith(":")||s.startsWith("*")?s:encodeURIComponent(s)).join("/");if(/:[^/]*\?/g.test(n))throw new Error(`Optional parameters are not supported in API routes: ${n}`);if(e[n])throw new Error(`Duplicate API routes for "${n}" found at "${e[n].route.path}" and "${t.path}"`);return e[n]={route:t},e},{})}),V="solidFetchEvent";function Xt(e){return{request:Wt(e),response:Zt(e),clientAddres
|