rari 0.17.2 → 0.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/cli.mjs +1 -1
  2. package/dist/{define-B_ozIapW.mjs → define-CuBTL1jt.mjs} +1 -1
  3. package/dist/{execute-CbhDMAQ3.mjs → execute-DJ7w3uhW.mjs} +1 -1
  4. package/dist/{feed-NrJzjZyg.mjs → feed-CfjUO7Zz.mjs} +1 -1
  5. package/dist/get-client-component-D2K213pV.mjs +1 -0
  6. package/dist/image/static.d.mts +1 -1
  7. package/dist/image.d.mts +1 -1
  8. package/dist/image.mjs +1 -1
  9. package/dist/index.d.mts +1 -1
  10. package/dist/mdx/define.mjs +1 -1
  11. package/dist/mdx.mjs +1 -1
  12. package/dist/navigation-transition-store-dfNJmkIX.mjs +1 -0
  13. package/dist/og.mjs +1 -1
  14. package/dist/preload-modules-BDQFWAlZ.mjs +2 -0
  15. package/dist/proxy/{runtime-executor.d.mts → executor.d.mts} +1 -1
  16. package/dist/proxy/{runtime-executor.mjs → executor.mjs} +2 -2
  17. package/dist/react-helpers-GTRYJwF2.d.mts +5 -0
  18. package/dist/react-helpers-duOBWuYF.mjs +1 -0
  19. package/dist/{robots-BOPIkPcN.mjs → robots-C4JcczMZ.mjs} +1 -1
  20. package/dist/route-cache-D2iIKQIU.mjs +1 -0
  21. package/dist/router-Cc9lVbtA.mjs +1 -0
  22. package/dist/router.d.mts +2 -1
  23. package/dist/router.mjs +1 -1
  24. package/dist/{rsc-vite-build-CSnu8C3P.mjs → rsc-vite-build-Cyc5ad0S.mjs} +1 -1
  25. package/dist/runtime/AppRouterProvider.d.mts +15 -5
  26. package/dist/runtime/AppRouterProvider.mjs +1 -1
  27. package/dist/runtime/ClientRouter.d.mts +3 -3
  28. package/dist/runtime/ClientRouter.mjs +4 -4
  29. package/dist/runtime/ErrorBoundaryWrapper.d.mts +3 -4
  30. package/dist/runtime/ErrorBoundaryWrapper.mjs +1 -1
  31. package/dist/runtime/action-flight-refresh.mjs +1 -1
  32. package/dist/runtime/call-server.mjs +1 -1
  33. package/dist/runtime/entry-client.mjs +2 -2
  34. package/dist/runtime/merge-flight-refresh.d.mts +7 -7
  35. package/dist/runtime/merge-flight-refresh.mjs +1 -1
  36. package/dist/runtime/rsc-client-runtime.mjs +1 -1
  37. package/dist/{sitemap--bdIkWl5.mjs → sitemap-BcUkIffd.mjs} +1 -1
  38. package/dist/{static-modules-DBL6iFbg.d.mts → static-modules-e8GEN_C9.d.mts} +4 -3
  39. package/dist/type-guards-BLY2PlGR.mjs +1 -0
  40. package/dist/{types-CkJ_86mo.d.mts → types-Cp7dbLe7.d.mts} +10 -14
  41. package/dist/vite.d.mts +1 -1
  42. package/dist/vite.mjs +56 -56
  43. package/package.json +12 -20
  44. package/dist/get-client-component-s7qprTUa.mjs +0 -1
  45. package/dist/navigation-transition-store-CSKrbtbK.mjs +0 -1
  46. package/dist/preload-modules-Dv_GzGCm.mjs +0 -2
  47. package/dist/router-Cl4J7j1A.mjs +0 -1
  48. package/dist/runtime/flight-route-cache.d.mts +0 -27
  49. package/dist/runtime/flight-route-cache.mjs +0 -1
  50. package/dist/runtime/flight-router-state.d.mts +0 -11
  51. package/dist/runtime/flight-router-state.mjs +0 -1
  52. package/dist/serialize-router-state-uOGGpmBr.mjs +0 -1
  53. package/dist/type-guards-BJXKlA6x.mjs +0 -1
@@ -1,7 +1,7 @@
1
- import{i as e,t}from"../navigate-DuyUa6qD.mjs";import{d as n,h as r,i,n as a,v as o}from"../type-guards-BJXKlA6x.mjs";import{r as s}from"../path-CTEC1xmy.mjs";import{t as ee}from"../serialize-router-state-uOGGpmBr.mjs";import{t as c}from"../form-state-DAygOjc8.mjs";import{c as l}from"react/compiler-runtime";import{useEffect as u,useLayoutEffect as d,useRef as f,useState as p}from"react";function m(e,t,n={}){let r=null,i=0,a=0,o=null,s=null,{leading:ee=!1,trailing:c=!0,maxWait:l}=n;function u(t){let n=o,r=s;o=null,s=null,a=t,e.apply(r,n)}function d(e){let n=e-i,r=e-a;return i===0||n>=t||n<0||l!==void 0&&r>=l}function f(){let e=Date.now();if(d(e)){m(e);return}let n=e-i,o=e-a,s=t-n,ee=l===void 0?1/0:l-o;r=setTimeout(f,Math.min(s,ee))}function p(e){a=e,r=setTimeout(f,t),ee&&u(e)}function m(e){if(r=null,c&&o){u(e);return}o=null,s=null}function h(){r!==null&&clearTimeout(r),a=0,o=null,i=0,s=null,r=null}function g(){r!==null&&m(Date.now())}function _(){return r!==null}function v(...e){let n=Date.now(),a=d(n);if(o=e,s=this,i=n,a){if(r===null){p(i);return}
1
+ import{i as e,t}from"../navigate-DuyUa6qD.mjs";import{d as n,g as r,h as i,i as a,n as o,s}from"../type-guards-BLY2PlGR.mjs";import{r as c}from"../path-CTEC1xmy.mjs";import{a as ee}from"../route-cache-D2iIKQIU.mjs";import{t as l}from"../form-state-DAygOjc8.mjs";import{c as u}from"react/compiler-runtime";import{useEffect as d,useLayoutEffect as f,useRef as p,useState as m}from"react";function h(e,t,n={}){let r=null,i=0,a=0,o=null,s=null,{leading:c=!1,trailing:ee=!0,maxWait:l}=n;function u(t){let n=o,r=s;o=null,s=null,a=t,e.apply(r,n)}function d(e){let n=e-i,r=e-a;return i===0||n>=t||n<0||l!==void 0&&r>=l}function f(){let e=Date.now();if(d(e)){m(e);return}let n=e-i,o=e-a,s=t-n,c=l===void 0?1/0:l-o;r=setTimeout(f,Math.min(s,c))}function p(e){a=e,r=setTimeout(f,t),c&&u(e)}function m(e){if(r=null,ee&&o){u(e);return}o=null,s=null}function h(){r!==null&&clearTimeout(r),a=0,o=null,i=0,s=null,r=null}function g(){r!==null&&m(Date.now())}function _(){return r!==null}function v(...e){let n=Date.now(),a=d(n);if(o=e,s=this,i=n,a){if(r===null){p(i);return}
2
2
  /* v8 ignore start - edge case: isInvoking true with existing timeout and maxWait defined */
3
- if(l!==void 0){r=setTimeout(f,t),u(i);return}}r??=setTimeout(f,t)}return v.cancel=h,v.flush=g,v.pending=_,v}const h=/fetch|networkerror|load failed/i;function g(e,t){return{type:`abort`,message:`Navigation was cancelled`,originalError:e,url:t,timestamp:Date.now(),retryable:!1}}function _(e,t){return{type:`timeout`,message:`Navigation request timed out`,originalError:e,url:t,timestamp:Date.now(),retryable:!0}}function v(e,t,n){if(t===404)return{type:`not-found`,message:`Page not found`,originalError:e,statusCode:t,url:n,timestamp:Date.now(),retryable:!1};if(t>=500)return{type:`server-error`,message:`Server error: ${t}`,originalError:e,statusCode:t,url:n,timestamp:Date.now(),retryable:!0};let r=t===408||t===429;return{type:`fetch-error`,message:`HTTP error: ${t}`,originalError:e,statusCode:t,url:n,timestamp:Date.now(),retryable:r}}function y(e,t){return{type:`network-error`,message:`Network error - check your connection`,originalError:e,url:t,timestamp:Date.now(),retryable:!0}}function b(e,t){return{type:`parse-error`,message:`Failed to parse server response`,
3
+ if(l!==void 0){r=setTimeout(f,t),u(i);return}}r??=setTimeout(f,t)}return v.cancel=h,v.flush=g,v.pending=_,v}const g=/fetch|networkerror|load failed/i;function _(e,t){return{type:`abort`,message:`Navigation was cancelled`,originalError:e,url:t,timestamp:Date.now(),retryable:!1}}function v(e,t){return{type:`timeout`,message:`Navigation request timed out`,originalError:e,url:t,timestamp:Date.now(),retryable:!0}}function y(e,t,n){if(t===404)return{type:`not-found`,message:`Page not found`,originalError:e,statusCode:t,url:n,timestamp:Date.now(),retryable:!1};if(t>=500)return{type:`server-error`,message:`Server error: ${t}`,originalError:e,statusCode:t,url:n,timestamp:Date.now(),retryable:!0};let r=t===408||t===429;return{type:`fetch-error`,message:`HTTP error: ${t}`,originalError:e,statusCode:t,url:n,timestamp:Date.now(),retryable:r}}function b(e,t){return{type:`network-error`,message:`Network error - check your connection`,originalError:e,url:t,timestamp:Date.now(),retryable:!0}}function x(e,t){return{type:`parse-error`,message:`Failed to parse server response`,
4
4
  /* v8 ignore next - defensive check for non-Error values from parse-related condition */
5
- originalError:a(e),url:t,timestamp:Date.now(),retryable:!1}}function x(e,t){return{type:`fetch-error`,message:a(e)?.message??`Unknown error occurred`,originalError:a(e),url:t,timestamp:Date.now(),retryable:!1}}function S(e,t){if(n(e)&&e.name===`AbortError`)return g(e,t);if(n(e)&&(e.name===`TimeoutError`||e.message.includes(`timeout`)))return _(e,t);if(n(e)&&`status`in e){let n=e.status;return typeof n==`number`?v(e,n,t):x(e,t)}return e instanceof TypeError&&h.test(e.message)?y(e,t):e instanceof SyntaxError||n(e)&&e.message.includes(`parse`)?b(e,t):x(e,t)}var te=class{onError;constructor(e={}){
5
+ originalError:o(e),url:t,timestamp:Date.now(),retryable:!1}}function S(e,t){return{type:`fetch-error`,message:o(e)?.message??`Unknown error occurred`,originalError:o(e),url:t,timestamp:Date.now(),retryable:!1}}function C(e,t){if(s(e))return _(o(e)??/* @__PURE__ */ Error(`Aborted`),t);if(n(e)&&(e.name===`TimeoutError`||e.message.includes(`timeout`)))return v(e,t);if(n(e)&&`status`in e){let n=e.status;return typeof n==`number`?y(e,n,t):S(e,t)}return e instanceof TypeError&&g.test(e.message)?b(e,t):e instanceof SyntaxError||n(e)&&e.message.includes(`parse`)?x(e,t):S(e,t)}var te=class{onError;constructor(e={}){
6
6
  /* v8 ignore next - default no-op callback */
7
- this.onError=e.onError??(()=>{})}handleError(e,t){let n=S(e,t);return this.onError(n),console.error(`[rari] Navigation:`,n.type,n.message,{url:n.url,statusCode:n.statusCode,retryable:n.retryable}),n}};function ne(e,t){try{let n=t!=null&&t!==``?t:window.location.origin,r=typeof URL.parse==`function`?URL.parse(e,n):new URL(e,n);return r!=null&&r.origin!==n}catch{return!1}}function re(e){try{let t=typeof URL.parse==`function`?URL.parse(e,window.location.origin):new URL(e,window.location.origin);return t==null?e:`${t.pathname}${t.search}${t.hash}`}catch{return e}}var ie=class{stateHistory;routeAccessOrder;maxHistorySize;scrollableSelector;constructor(e={}){this.stateHistory=/* @__PURE__ */ new Map,this.routeAccessOrder=[],this.maxHistorySize=e.maxHistorySize!=null&&e.maxHistorySize!==0?e.maxHistorySize:50,this.scrollableSelector=e.scrollableSelector!=null&&e.scrollableSelector!==``?e.scrollableSelector:`[data-scrollable], .scrollable, [style*="overflow"]`}captureState(e){let t={scrollPositions:this.captureScrollPositions(),formData:this.captureFormData(),focusedElement:this.captureFocusedElement()};return this.storeState(e,t),t}captureScrollPositions(){let e=/* @__PURE__ */ new Map;try{e.set(`window`,{x:window.scrollX,y:window.scrollY,element:`window`}),document.querySelectorAll(this.scrollableSelector).forEach((t,n)=>{if(t instanceof HTMLElement){let r=t.id||`scrollable-${n}`;(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&e.set(r,{x:t.scrollLeft,y:t.scrollTop,element:r})}})}catch{}return e}captureFormData(){let e=/* @__PURE__ */ new Map;try{document.querySelectorAll(`form`).forEach((t,n)=>{let r=t.id||t.name||`form-${n}`,i=new FormData(t);i.entries().next().done||e.set(r,i)})}catch{}return e}captureFocusedElement(){try{let e=document.activeElement;if(e&&e!==document.body){if(e.id)return`#${e.id}`;if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.name)return`[name="${e.name}"]`}}catch{}return null}storeState(e,t){let n=this.routeAccessOrder.indexOf(e);for(n!==-1&&this.routeAccessOrder.splice(n,1),this.routeAccessOrder.push(e),this.stateHistory.set(e,t);this.routeAccessOrder.length>this.maxHistorySize;){let e=this.routeAccessOrder.shift();e!=null&&e!==``&&this.stateHistory.delete(e)}}restoreState(e){let t=this.stateHistory.get(e);if(!t)return!1;let n=!0;return this.restoreScrollPositions(t.scrollPositions)||(n=!1),this.restoreFormData(t.formData)||(n=!1),t.focusedElement!=null&&t.focusedElement!==``&&this.restoreFocus(t.focusedElement),n}restoreScrollPositions(e){let t=!0;try{e.forEach((e,n)=>{try{if(n===`window`)window.scrollTo(e.x,e.y);else{let r=document.getElementById(n)??document.querySelector(`[data-scrollable-id="${n}"]`);r instanceof HTMLElement?(r.scrollLeft=e.x,r.scrollTop=e.y):t=!1}}catch{t=!1}})}catch(e){console.error(`[rari] Router: Failed to restore scroll positions:`,e),t=!1}return t}restoreFormData(e){let t=!0;try{e.forEach((e,n)=>{try{let r=document.getElementById(n),i=r instanceof HTMLFormElement?r:document.querySelector(`form[name="${n}"]`)??document.querySelectorAll(`form`)[Number.parseInt(n.replace(`form-`,``),10)];i instanceof HTMLFormElement&&c(i,e)||(t=!1)}catch{t=!1}})}catch(e){console.error(`[rari] Router: Failed to restore form data:`,e),t=!1}return t}restoreFocus(e){try{let t=document.querySelector(e);t instanceof HTMLElement&&requestAnimationFrame(()=>{try{t.focus()}catch{}})}catch{}}};function C(e){return o(e)&&typeof e.navigationId==`number`}function w(e){return o(e)&&typeof e.navigationId==`number`&&`error`in e}function ae(e){let t=e.headers.get(`x-rari-metadata`);if(t!=null&&t!==``)try{let e=JSON.parse(decodeURIComponent(t));if(!o(e))return;if(typeof e.title==`string`&&e.title!==``&&(document.title=e.title),typeof e.description==`string`&&e.description!==``){let t=document.querySelector(`meta[name="description"]`);t||(t=document.createElement(`meta`),t.setAttribute(`name`,`description`),document.head.appendChild(t)),t.setAttribute(`content`,e.description)}}catch{}}async function oe(e,t){return t.aborted?{error:new DOMException(`Aborted`,`AbortError`)}:new Promise(n=>{function r(){window.removeEventListener(`rari:navigate-committed`,a),window.removeEventListener(`rari:navigate-error`,o),t.removeEventListener(`abort`,s)}function a(t){i(t,C)?.navigationId===e&&(r(),n(`committed`))}function o(t){let a=i(t,w);a?.navigationId===e&&(r(),n({error:a.error}))}function s(){r(),n({error:new DOMException(`Aborted`,`AbortError`)})}window.addEventListener(`rari:navigate-committed`,a),window.addEventListener(`rari:navigate-error`,o),t.addEventListener(`abort`,s,{once:!0})})}function T(i){let a=l(35),{children:o,initialRoute:c}=i,h;a[0]===c?h=a[1]:(h=()=>({currentRoute:typeof window<`u`?`${window.location.pathname}${window.location.search}`:s(c),navigationId:0,error:null}),a[0]=c,a[1]=h);let[g,_]=p(h),v=f(null),y=f(!0),b;a[2]===c?b=a[3]:(b=typeof window<`u`?`${window.location.pathname}${window.location.search}`:s(c),a[2]=c,a[3]=b);let x=f(b),S;a[4]===c?S=a[5]:(S=typeof window<`u`?`${window.location.pathname}${window.location.search}${window.location.hash}`:s(c),a[4]=c,a[5]=S);let C=f(S),w=f(0),T;a[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=new te({onError:le}),a[6]=T):T=a[6];let ue=f(T),E;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=/* @__PURE__ */ new Map,a[7]=E):E=a[7];let D=f(E),O;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=new ie({maxHistorySize:50}),a[8]=O):O=a[8];let k=f(O),de=ce,A;a[9]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{v.current&&=(v.current.abort(),null)},a[9]=A):A=a[9];let fe=A,j;a[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{for(let[,e]of D.current.entries())e.abortController.abort();D.current.clear()},a[10]=j):j=a[10];let pe=j,M;a[11]===g?M=a[12]:(M=(e,t)=>{D.current.delete(e),y.current&&g.navigationId===t&&_(se)},a[11]=g,a[12]=M);let N=M,P;a[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(e,t)=>{let n=t===void 0?{}:t,r=`${window.location.pathname}${window.location.search}`,i=e?`${r}#${e}`:r;if(e){let t=document.getElementById(e);t&&t.scrollIntoView({behavior:`smooth`,block:`start`})}i!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&(n.replace?window.history.replaceState(window.history.state,``,i):window.history.pushState(window.history.state,``,i)),C.current=i},a[13]=P):P=a[13];let me=P,F;if(a[14]===Symbol.for(`react.memo_cache_sentinel`)){let e=(e,t,n)=>{n.historyKey!=null&&n.historyKey!==``?requestAnimationFrame(()=>{k.current.restoreState(e)}):t&&requestAnimationFrame(()=>{let e=n=>{let r=n===void 0?0:n,i=document.getElementById(t);i?i.scrollIntoView({behavior:`smooth`,block:`start`}):r<10&&setTimeout(e,50,r+1)};e()})};F=(t,n,r,i,a)=>{y.current&&w.current===i&&(x.current=t,C.current=a,_(e=>({...e,currentRoute:t,navigationId:i,error:null})),e(t,n,r))},a[14]=F}else F=a[14];let he=F,I;a[15]===N?I=a[16]:(I=(e,t,r,i,a)=>{let o=a===void 0?{}:a;if(n(e)&&e.name===`AbortError`){N(t,r);return}let s=ue.current.handleError(e,t);y.current&&(_(e=>({...e,error:s})),window.history.replaceState(window.history.state,``,i)),D.current.delete(t),o.emitEvent!==!1&&window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{from:i,to:t,error:s,navigationId:r}}))},a[15]=N,a[16]=I);let L=I,R;a[17]!==N||a[18]!==L?(R=async(e,t)=>{let n=t===void 0?{}:t;if(!e||typeof e!=`string`)return;let[r,i]=e.includes(`#`)?e.split(`#`):[e,``],a=s(r);if(a===x.current){me(i,{replace:n.replace===!0});return}let o=D.current.get(a);if(o)return o.promise;pe(),fe();let c=new AbortController;v.current=c,w.current+=1;let l=w.current;window.dispatchEvent(new CustomEvent(`rari:navigation-start`,{detail:{navigationId:l,targetPath:a}}));let u=(async()=>{let e=C.current;try{(n.historyKey==null||n.historyKey===``)&&k.current.captureState(x.current);let t=n.historyKey!=null&&n.historyKey!==``?n.historyKey:de(),r=window.location.origin+a,o={route:a,navigationId:l,scrollPosition:{x:window.scrollX,y:window.scrollY},timestamp:Date.now(),key:t},s=await fetch(r,{headers:{Accept:`text/x-component`,"rari-navigation-id":String(l),"rari-router-state":ee()},cache:`no-store`,signal:c.signal});if(!s.ok&&s.status!==404){L(/* @__PURE__ */ Error(`Failed to fetch: ${s.status}`),a,l,e);return}if(c.signal.aborted){N(a,l);return}let u=new URL(s.url),d=u.pathname,f=`${u.pathname}${u.search}`,p={...o,route:f},m=`${f}${i?`#${i}`:``}`;if(w.current!==l)return;let h=oe(l,c.signal);if(window.dispatchEvent(new CustomEvent(`rari:navigate`,{detail:{from:e,to:d,navigationId:l,options:n,abortSignal:c.signal,rscResponse:s,pendingHistory:{url:m,state:p,replace:n.replace===!0}}})),w.current!==l){c.abort();return}let g=await h;if(w.current!==l)return;if(g!==`committed`){L(g.error,a,l,e,{emitEvent:!1});return}he(f,i,n,l,m),ae(s),D.current.delete(a)}catch(t){L(t,a,l,e)}})();return D.current.set(a,{targetPath:a,navigationId:l,promise:u,abortController:c}),u},a[17]=N,a[18]=L,a[19]=R):R=a[19];let z=R,B=f(z),V;a[20]===z?V=a[21]:(V=()=>(B.current=z,()=>{B.current=null}),a[20]=z,a[21]=V),d(V);let ge=f(null),H,U;a[22]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>{ge.current??=m((e,t)=>{B.current?.(e,t)},50,{leading:!0,trailing:!0,maxWait:200})},U=[],a[22]=H,a[23]=U):(H=a[22],U=a[23]),d(H,U);let W;a[24]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>{if(e.button!==0||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;let t=e.target instanceof Element?e.target:null;for(;t&&!(t instanceof HTMLAnchorElement);)t=t.parentElement;if(!(t instanceof HTMLAnchorElement))return;let n=t;if(n.target&&n.target!==`_self`||n.hasAttribute(`download`))return;let r=n.getAttribute(`href`);if(r==null||r===``||ne(r))return;if(r.startsWith(`#`)){e.preventDefault();let t=r.slice(1),n=document.getElementById(t);if(n){n.scrollIntoView({behavior:`smooth`,block:`start`});let e=`${window.location.pathname}${window.location.search}#${t}`;window.history.pushState(window.history.state,``,e),C.current=e}return}e.preventDefault();let i=re(r);ge.current?.(i,{replace:!1})},a[24]=W):W=a[24];let _e=W,G;a[25]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{let t=`${window.location.pathname}${window.location.search}${window.location.hash}`,n=r(e.state)?e.state:null;B.current&&B.current(t,{replace:!0,scroll:!1,historyKey:n?.key})},a[25]=G):G=a[25];let ve=G,K;a[26]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>{let e=r(window.history.state)?window.history.state:null;if(e?.key==null||e.key===``){let e={route:`${window.location.pathname}${window.location.search}`,navigationId:0,scrollPosition:{x:window.scrollX,y:window.scrollY},timestamp:Date.now(),key:de()};window.history.replaceState(e,``,window.location.pathname+window.location.search+window.location.hash)}},a[26]=K):K=a[26];let q;a[27]===c?q=a[28]:(q=[c],a[27]=c,a[28]=q),u(K,q);let J;a[29]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>{if(e.persisted){let e=window.location.pathname;k.current.captureState(e)}},a[29]=J):J=a[29];let ye=J,Y;a[30]===Symbol.for(`react.memo_cache_sentinel`)?(Y=e=>{if(e.persisted){let e=window.location.pathname,t=r(window.history.state)?window.history.state:null;requestAnimationFrame(()=>{k.current.restoreState(e),t?.scrollPosition&&window.scrollTo(t.scrollPosition.x,t.scrollPosition.y)})}},a[30]=Y):Y=a[30];let be=Y,X,Z;a[31]===Symbol.for(`react.memo_cache_sentinel`)?(X=()=>(document.addEventListener(`click`,_e),window.addEventListener(`popstate`,ve),window.addEventListener(`pagehide`,ye),window.addEventListener(`pageshow`,be),()=>{document.removeEventListener(`click`,_e),window.removeEventListener(`popstate`,ve),window.removeEventListener(`pagehide`,ye),window.removeEventListener(`pageshow`,be)}),Z=[],a[31]=X,a[32]=Z):(X=a[31],Z=a[32]),u(X,Z);let Q,$;return a[33]===Symbol.for(`react.memo_cache_sentinel`)?(Q=()=>(y.current=!0,e(async(e,t)=>B.current?.(e,t)??Promise.resolve()),()=>{y.current=!1,t(),fe(),pe(),ge.current?.cancel()}),$=[],a[33]=Q,a[34]=$):(Q=a[33],$=a[34]),u(Q,$),o}function se(e){return{...e}}function ce(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`hk-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`}function le(e){console.error(`[rari] Router: Navigation error:`,e)}export{T as ClientRouter};
7
+ this.onError=e.onError??(()=>{})}handleError(e,t){let n=C(e,t);return this.onError(n),console.error(`[rari] Navigation:`,n.type,n.message,{url:n.url,statusCode:n.statusCode,retryable:n.retryable}),n}};function ne(e,t){try{let n=t!=null&&t!==``?t:window.location.origin,r=typeof URL.parse==`function`?URL.parse(e,n):new URL(e,n);return r!=null&&r.origin!==n}catch{return!1}}function re(e){try{let t=typeof URL.parse==`function`?URL.parse(e,window.location.origin):new URL(e,window.location.origin);return t==null?e:`${t.pathname}${t.search}${t.hash}`}catch{return e}}var ie=class{stateHistory;routeAccessOrder;maxHistorySize;scrollableSelector;constructor(e={}){this.stateHistory=/* @__PURE__ */ new Map,this.routeAccessOrder=[],this.maxHistorySize=e.maxHistorySize!=null&&e.maxHistorySize!==0?e.maxHistorySize:50,this.scrollableSelector=e.scrollableSelector!=null&&e.scrollableSelector!==``?e.scrollableSelector:`[data-scrollable], .scrollable, [style*="overflow"]`}captureState(e){let t={scrollPositions:this.captureScrollPositions(),formData:this.captureFormData(),focusedElement:this.captureFocusedElement()};return this.storeState(e,t),t}captureScrollPositions(){let e=/* @__PURE__ */ new Map;try{e.set(`window`,{x:window.scrollX,y:window.scrollY,element:`window`}),document.querySelectorAll(this.scrollableSelector).forEach((t,n)=>{if(t instanceof HTMLElement){let r=t.id||`scrollable-${n}`;(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&e.set(r,{x:t.scrollLeft,y:t.scrollTop,element:r})}})}catch{}return e}captureFormData(){let e=/* @__PURE__ */ new Map;try{document.querySelectorAll(`form`).forEach((t,n)=>{let r=t.id||t.name||`form-${n}`,i=new FormData(t);i.entries().next().done||e.set(r,i)})}catch{}return e}captureFocusedElement(){try{let e=document.activeElement;if(e&&e!==document.body){if(e.id)return`#${e.id}`;if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.name)return`[name="${e.name}"]`}}catch{}return null}storeState(e,t){let n=this.routeAccessOrder.indexOf(e);for(n!==-1&&this.routeAccessOrder.splice(n,1),this.routeAccessOrder.push(e),this.stateHistory.set(e,t);this.routeAccessOrder.length>this.maxHistorySize;){let e=this.routeAccessOrder.shift();e!=null&&e!==``&&this.stateHistory.delete(e)}}restoreState(e){let t=this.stateHistory.get(e);if(!t)return!1;let n=!0;return this.restoreScrollPositions(t.scrollPositions)||(n=!1),this.restoreFormData(t.formData)||(n=!1),t.focusedElement!=null&&t.focusedElement!==``&&this.restoreFocus(t.focusedElement),n}restoreScrollPositions(e){let t=!0;try{e.forEach((e,n)=>{try{if(n===`window`)window.scrollTo(e.x,e.y);else{let r=document.getElementById(n)??document.querySelector(`[data-scrollable-id="${n}"]`);r instanceof HTMLElement?(r.scrollLeft=e.x,r.scrollTop=e.y):t=!1}}catch{t=!1}})}catch(e){console.error(`[rari] Router: Failed to restore scroll positions:`,e),t=!1}return t}restoreFormData(e){let t=!0;try{e.forEach((e,n)=>{try{let r=document.getElementById(n),i=r instanceof HTMLFormElement?r:document.querySelector(`form[name="${n}"]`)??document.querySelectorAll(`form`)[Number.parseInt(n.replace(`form-`,``),10)];i instanceof HTMLFormElement&&l(i,e)||(t=!1)}catch{t=!1}})}catch(e){console.error(`[rari] Router: Failed to restore form data:`,e),t=!1}return t}restoreFocus(e){try{let t=document.querySelector(e);t instanceof HTMLElement&&requestAnimationFrame(()=>{try{t.focus()}catch{}})}catch{}}};function w(e){return r(e)&&typeof e.navigationId==`number`}function T(e){return r(e)&&typeof e.navigationId==`number`&&`error`in e}function ae(e){let t=e.headers.get(`x-rari-metadata`);if(t!=null&&t!==``)try{let e=JSON.parse(decodeURIComponent(t));if(!r(e))return;if(typeof e.title==`string`&&e.title!==``&&(document.title=e.title),typeof e.description==`string`&&e.description!==``){let t=document.querySelector(`meta[name="description"]`);t||(t=document.createElement(`meta`),t.setAttribute(`name`,`description`),document.head.appendChild(t)),t.setAttribute(`content`,e.description)}}catch{}}async function oe(e,t){return t.aborted?{error:new DOMException(`Aborted`,`AbortError`)}:new Promise(n=>{function r(){window.removeEventListener(`rari:navigate-committed`,i),window.removeEventListener(`rari:navigate-error`,o),t.removeEventListener(`abort`,s)}function i(t){a(t,w)?.navigationId===e&&(r(),n(`committed`))}function o(t){let i=a(t,T);i?.navigationId===e&&(r(),n({error:i.error}))}function s(){r(),n({error:new DOMException(`Aborted`,`AbortError`)})}window.addEventListener(`rari:navigate-committed`,i),window.addEventListener(`rari:navigate-error`,o),t.addEventListener(`abort`,s,{once:!0})})}function se(n){let r=u(35),{children:a,initialRoute:o}=n,l;r[0]===o?l=r[1]:(l=()=>({currentRoute:typeof window<`u`?`${window.location.pathname}${window.location.search}`:c(o),navigationId:0,error:null}),r[0]=o,r[1]=l);let[g,_]=m(l),v=p(null),y=p(!0),b;r[2]===o?b=r[3]:(b=typeof window<`u`?`${window.location.pathname}${window.location.search}`:c(o),r[2]=o,r[3]=b);let x=p(b),S;r[4]===o?S=r[5]:(S=typeof window<`u`?`${window.location.pathname}${window.location.search}${window.location.hash}`:c(o),r[4]=o,r[5]=S);let C=p(S),w=p(0),T;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=new te({onError:ue}),r[6]=T):T=r[6];let se=p(T),E;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=/* @__PURE__ */ new Map,r[7]=E):E=r[7];let D=p(E),O;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=new ie({maxHistorySize:50}),r[8]=O):O=r[8];let k=p(O),de=le,A;r[9]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{v.current&&=(v.current.abort(),null)},r[9]=A):A=r[9];let fe=A,j;r[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{for(let[,e]of D.current.entries())e.bodyHandedOff?window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{navigationId:e.navigationId,error:new DOMException(`Aborted`,`AbortError`)}})):e.abortController.abort();D.current.clear()},r[10]=j):j=r[10];let pe=j,M;r[11]===g?M=r[12]:(M=(e,t)=>{D.current.delete(e),y.current&&g.navigationId===t&&_(ce)},r[11]=g,r[12]=M);let N=M,P;r[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(e,t)=>{let n=t===void 0?{}:t,r=`${window.location.pathname}${window.location.search}`,i=e?`${r}#${e}`:r;if(e){let t=document.getElementById(e);t&&t.scrollIntoView({behavior:`smooth`,block:`start`})}i!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&(n.replace?window.history.replaceState(window.history.state,``,i):window.history.pushState(window.history.state,``,i)),C.current=i},r[13]=P):P=r[13];let me=P,F;if(r[14]===Symbol.for(`react.memo_cache_sentinel`)){let e=(e,t,n)=>{n.historyKey!=null&&n.historyKey!==``?requestAnimationFrame(()=>{k.current.restoreState(e)}):t&&requestAnimationFrame(()=>{let e=n=>{let r=n===void 0?0:n,i=document.getElementById(t);i?i.scrollIntoView({behavior:`smooth`,block:`start`}):r<10&&setTimeout(e,50,r+1)};e()})};F=(t,n,r,i,a)=>{y.current&&w.current===i&&(x.current=t,C.current=a,_(e=>({...e,currentRoute:t,navigationId:i,error:null})),e(t,n,r))},r[14]=F}else F=r[14];let he=F,I;r[15]===N?I=r[16]:(I=(e,t,n,r,i)=>{let a=i===void 0?{}:i;if(s(e)){N(t,n);return}let o=se.current.handleError(e,t);y.current&&(_(e=>({...e,error:o})),window.history.replaceState(window.history.state,``,r)),D.current.delete(t),a.emitEvent!==!1&&window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{from:r,to:t,error:o,navigationId:n}}))},r[15]=N,r[16]=I);let L=I,R;r[17]!==N||r[18]!==L?(R=async(e,t)=>{let n=t===void 0?{}:t;if(!e||typeof e!=`string`)return;let[r,i]=e.includes(`#`)?e.split(`#`):[e,``],a=c(r);if(a===x.current){me(i,{replace:n.replace===!0});return}let o=D.current.get(a);if(o)return o.promise;pe(),fe();let s=new AbortController;v.current=s,w.current+=1;let l=w.current;window.dispatchEvent(new CustomEvent(`rari:navigation-start`,{detail:{navigationId:l,targetPath:a}}));let u=(async()=>{let e=C.current;try{(n.historyKey==null||n.historyKey===``)&&k.current.captureState(x.current);let t=n.historyKey!=null&&n.historyKey!==``?n.historyKey:de(),r=window.location.origin+a,o={route:a,navigationId:l,scrollPosition:{x:window.scrollX,y:window.scrollY},timestamp:Date.now(),key:t},c=await fetch(r,{headers:{Accept:`text/x-component`,"rari-navigation-id":String(l),"rari-router-state":ee()},cache:`no-store`,signal:s.signal});if(!c.ok&&c.status!==404){L(/* @__PURE__ */ Error(`Failed to fetch: ${c.status}`),a,l,e);return}if(s.signal.aborted){N(a,l);return}let u=new URL(c.url),d=u.pathname,f=`${u.pathname}${u.search}`,p={...o,route:f},m=`${f}${i?`#${i}`:``}`;if(w.current!==l)return;let h=oe(l,s.signal),g=D.current.get(a);if(g!=null&&(g.bodyHandedOff=!0),v.current===s&&(v.current=null),window.dispatchEvent(new CustomEvent(`rari:navigate`,{detail:{from:new URL(e,window.location.origin).pathname,to:d,navigationId:l,options:n,abortSignal:s.signal,rscResponse:c,pendingHistory:{url:m,state:p,replace:n.replace===!0}}})),w.current!==l){window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{navigationId:l,error:new DOMException(`Aborted`,`AbortError`)}}));return}let _=await h;if(w.current!==l)return;if(_!==`committed`){L(_.error,a,l,e,{emitEvent:!1});return}he(f,i,n,l,m),ae(c),D.current.delete(a)}catch(t){L(t,a,l,e)}})();return D.current.set(a,{targetPath:a,navigationId:l,promise:u,abortController:s,bodyHandedOff:!1}),u},r[17]=N,r[18]=L,r[19]=R):R=r[19];let z=R,B=p(z),V;r[20]===z?V=r[21]:(V=()=>(B.current=z,()=>{B.current=null}),r[20]=z,r[21]=V),f(V);let ge=p(null),H,U;r[22]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>{ge.current??=h((e,t)=>{B.current?.(e,t)},50,{leading:!0,trailing:!0,maxWait:200})},U=[],r[22]=H,r[23]=U):(H=r[22],U=r[23]),f(H,U);let W;r[24]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>{if(e.button!==0||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;let t=e.target instanceof Element?e.target:null;for(;t&&!(t instanceof HTMLAnchorElement);)t=t.parentElement;if(!(t instanceof HTMLAnchorElement))return;let n=t;if(n.target&&n.target!==`_self`||n.hasAttribute(`download`))return;let r=n.getAttribute(`href`);if(r==null||r===``||ne(r))return;if(r.startsWith(`#`)){e.preventDefault();let t=r.slice(1),n=document.getElementById(t);if(n){n.scrollIntoView({behavior:`smooth`,block:`start`});let e=`${window.location.pathname}${window.location.search}#${t}`;window.history.pushState(window.history.state,``,e),C.current=e}return}e.preventDefault();let i=re(r);ge.current?.(i,{replace:!1})},r[24]=W):W=r[24];let _e=W,G;r[25]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{let t=`${window.location.pathname}${window.location.search}${window.location.hash}`,n=i(e.state)?e.state:null;B.current&&B.current(t,{replace:!0,scroll:!1,historyKey:n?.key})},r[25]=G):G=r[25];let ve=G,K;r[26]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>{let e=i(window.history.state)?window.history.state:null;if(e?.key==null||e.key===``){let e={route:`${window.location.pathname}${window.location.search}`,navigationId:0,scrollPosition:{x:window.scrollX,y:window.scrollY},timestamp:Date.now(),key:de()};window.history.replaceState(e,``,window.location.pathname+window.location.search+window.location.hash)}},r[26]=K):K=r[26];let q;r[27]===o?q=r[28]:(q=[o],r[27]=o,r[28]=q),d(K,q);let J;r[29]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>{if(e.persisted){let e=window.location.pathname;k.current.captureState(e)}},r[29]=J):J=r[29];let ye=J,Y;r[30]===Symbol.for(`react.memo_cache_sentinel`)?(Y=e=>{if(e.persisted){let e=window.location.pathname,t=i(window.history.state)?window.history.state:null;requestAnimationFrame(()=>{k.current.restoreState(e),t?.scrollPosition&&window.scrollTo(t.scrollPosition.x,t.scrollPosition.y)})}},r[30]=Y):Y=r[30];let be=Y,X,Z;r[31]===Symbol.for(`react.memo_cache_sentinel`)?(X=()=>(document.addEventListener(`click`,_e),window.addEventListener(`popstate`,ve),window.addEventListener(`pagehide`,ye),window.addEventListener(`pageshow`,be),()=>{document.removeEventListener(`click`,_e),window.removeEventListener(`popstate`,ve),window.removeEventListener(`pagehide`,ye),window.removeEventListener(`pageshow`,be)}),Z=[],r[31]=X,r[32]=Z):(X=r[31],Z=r[32]),d(X,Z);let Q,$;return r[33]===Symbol.for(`react.memo_cache_sentinel`)?(Q=()=>(y.current=!0,e(async(e,t)=>B.current?.(e,t)??Promise.resolve()),()=>{y.current=!1,t(),fe(),pe(),ge.current?.cancel()}),$=[],r[33]=Q,r[34]=$):(Q=r[33],$=r[34]),d(Q,$),a}function ce(e){return{...e}}function le(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`hk-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`}function ue(e){console.error(`[rari] Router: Navigation error:`,e)}export{se as ClientRouter};
@@ -1,5 +1,4 @@
1
- import * as React from "react";
2
- import { Component, ReactNode } from "react";
1
+ import { Component, ComponentType, ErrorInfo, ReactNode } from "react";
3
2
  //#region src/runtime/boundaries/error-boundary-wrapper.d.ts
4
3
  interface ErrorBoundaryWrapperProps {
5
4
  readonly errorComponentId: string;
@@ -8,7 +7,7 @@ interface ErrorBoundaryWrapperProps {
8
7
  interface ErrorBoundaryWrapperState {
9
8
  hasError: boolean;
10
9
  error: Error | null;
11
- ErrorComponent: React.ComponentType<{
10
+ ErrorComponent: ComponentType<{
12
11
  error: Error;
13
12
  reset: () => void;
14
13
  }> | null;
@@ -20,7 +19,7 @@ export declare class ErrorBoundaryWrapper extends Component<ErrorBoundaryWrapper
20
19
  static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryWrapperState>;
21
20
  componentDidMount(): void;
22
21
  componentWillUnmount(): void;
23
- componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
22
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
24
23
  reset: () => void;
25
24
  render(): ReactNode;
26
25
  }
@@ -1 +1 @@
1
- import{u as e,v as t}from"../type-guards-BJXKlA6x.mjs";import{t as n}from"../timer-Duul5JHq.mjs";import{r}from"../rari-global-5vGzhToD.mjs";import{Component as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(n){if(e(n))return n;if(t(n)){let t=n.default??n;return e(t)?t:null}return null}var c=class extends i{_isMounted=!1;_pendingTimer=null;constructor(e){super(e),this.state={hasError:!1,error:null,ErrorComponent:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1,this._pendingTimer=n(this._pendingTimer)}componentDidCatch(e,t){console.error(`[rari] Error boundary caught error:`,e,t);let n=this.props.errorComponentId;if(n!==``){let e=r();if(n in e){let t=e[n],r=s(t.component);r?this.setState({ErrorComponent:r}):t.loader&&!t.loading&&(t.loading=!0,t.loader().then(e=>{let n=s(e);n&&(t.component=n,t.registered=!0,this.setState({ErrorComponent:n})),t.loading=!1}).catch(e=>{t.loading=!1,console.error(`[rari] Failed to load error component ${n}:`,e)}))}}}reset=()=>{this._pendingTimer=n(this._pendingTimer),this._pendingTimer=setTimeout(()=>{this._isMounted&&this.setState({hasError:!1,error:null,ErrorComponent:null}),this._pendingTimer=null},50)};render(){if(this.state.hasError&&this.state.error){let{ErrorComponent:e}=this.state;return e?/* @__PURE__ */ a(e,{error:this.state.error,reset:this.reset}):/* @__PURE__ */ o(`div`,{className:`rari-error`,role:`alert`,style:{color:`red`,border:`1px solid red`,padding:`10px`,borderRadius:`4px`,backgroundColor:`#fff5f5`},children:[/* @__PURE__ */ a(`strong`,{children:`Error loading content: `}),this.state.error.message]})}return this.props.children}};export{c as ErrorBoundaryWrapper};
1
+ import{g as e,s as t,u as n}from"../type-guards-BLY2PlGR.mjs";import{t as r}from"../timer-Duul5JHq.mjs";import{r as i}from"../rari-global-5vGzhToD.mjs";import{Component as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(t){if(n(t))return t;if(e(t)){let e=t.default??t;return n(e)?e:null}return null}var l=class extends a{_isMounted=!1;_pendingTimer=null;constructor(e){super(e),this.state={hasError:!1,error:null,ErrorComponent:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1,this._pendingTimer=r(this._pendingTimer)}componentDidCatch(e,n){if(t(e))return;console.error(`[rari] Error boundary caught error:`,e,n);let r=this.props.errorComponentId;if(r!==``){let e=i();if(r in e){let t=e[r],n=c(t.component);n?this.setState({ErrorComponent:n}):t.loader&&!t.loading&&(t.loading=!0,t.loader().then(e=>{let n=c(e);n&&(t.component=n,t.registered=!0,this.setState({ErrorComponent:n})),t.loading=!1}).catch(e=>{t.loading=!1,console.error(`[rari] Failed to load error component ${r}:`,e)}))}}}reset=()=>{this._pendingTimer=r(this._pendingTimer),this._pendingTimer=setTimeout(()=>{this._isMounted&&this.setState({hasError:!1,error:null,ErrorComponent:null}),this._pendingTimer=null},50)};render(){if(this.state.hasError&&this.state.error){if(t(this.state.error))return null;let{ErrorComponent:e}=this.state;return e?/* @__PURE__ */ o(e,{error:this.state.error,reset:this.reset}):/* @__PURE__ */ s(`div`,{className:`rari-error`,role:`alert`,style:{color:`red`,border:`1px solid red`,padding:`10px`,borderRadius:`4px`,backgroundColor:`#fff5f5`},children:[/* @__PURE__ */ o(`strong`,{children:`Error loading content: `}),this.state.error.message]})}return this.props.children}};export{l as ErrorBoundaryWrapper};
@@ -1 +1 @@
1
- import{g as e,p as t,r as n,v as r}from"../type-guards-BJXKlA6x.mjs";import{ActionDidNotRevalidate as i,ActionDidRevalidateDynamicOnly as a,ActionDidRevalidateStaticAndDynamic as o,parseActionRevalidationKind as s}from"./action-revalidation-kind.mjs";function c(e){return r(e)?`redirect`in e||`~rariSkipRefresh`in e||`~rariFormState`in e:!1}function l(n){return e(n)||t(n)}function u(e){return e==null||e===``?null:e instanceof Promise?e.then(e=>e==null||e===``?null:e):e}function d(e,t,r){typeof globalThis.dispatchEvent==`function`&&(c(r)||(async()=>{let n=u(t.f),r=n instanceof Promise?await n:n;if(r==null||!l(r))return;let i=s(e.headers.get(`x-action-revalidated`));if(i===0)return;let a=e.headers.get(`x-action-revalidated-path`)??void 0,o=()=>{globalThis.dispatchEvent(new CustomEvent(`rari:action-flight-refresh`,{detail:{element:r,revalidationKind:i,revalidatedPath:a}}))};if(typeof requestAnimationFrame==`function`){requestAnimationFrame(()=>{requestAnimationFrame(o)});return}queueMicrotask(o)})().catch(e=>{console.error(`[rari] Action flight refresh failed:`,n(e,String(e)))}))}export{i as ActionDidNotRevalidate,a as ActionDidRevalidateDynamicOnly,o as ActionDidRevalidateStaticAndDynamic,d as scheduleActionFlightRefresh};
1
+ import{g as e,p as t,r as n}from"../type-guards-BLY2PlGR.mjs";import{ActionDidNotRevalidate as r,ActionDidRevalidateDynamicOnly as i,ActionDidRevalidateStaticAndDynamic as a,parseActionRevalidationKind as o}from"./action-revalidation-kind.mjs";import{isValidElement as s}from"react";function c(t){return e(t)?`redirect`in t||`~rariSkipRefresh`in t||`~rariFormState`in t:!1}function l(e){return s(e)||t(e)}function u(e){return e==null||e===``?null:e instanceof Promise?e.then(e=>e==null||e===``?null:e):e}function d(e,t,r){typeof globalThis.dispatchEvent==`function`&&(c(r)||(async()=>{let n=u(t.f),r=n instanceof Promise?await n:n;if(r==null||!l(r))return;let i=o(e.headers.get(`x-action-revalidated`));if(i===0)return;let a=e.headers.get(`x-action-revalidated-path`)??void 0,s=()=>{globalThis.dispatchEvent(new CustomEvent(`rari:action-flight-refresh`,{detail:{element:r,revalidationKind:i,revalidatedPath:a}}))};if(typeof requestAnimationFrame==`function`){requestAnimationFrame(()=>{requestAnimationFrame(s)});return}queueMicrotask(s)})().catch(e=>{console.error(`[rari] Action flight refresh failed:`,n(e,String(e)))}))}export{r as ActionDidNotRevalidate,i as ActionDidRevalidateDynamicOnly,a as ActionDidRevalidateStaticAndDynamic,d as scheduleActionFlightRefresh};
@@ -1 +1 @@
1
- import{d as e,v as t}from"../type-guards-BJXKlA6x.mjs";import{t as n}from"../serialize-router-state-uOGGpmBr.mjs";import{scheduleActionFlightRefresh as r}from"./action-flight-refresh.mjs";import{createFromFetch as i,createTemporaryReferenceSet as a,encodeReply as o}from"virtual:react-flight-client";const s=3e4;function c(e){if(!t(e))return e;let{"~rariSkipRefresh":n,...r}=e;return r}function l(){return typeof window<`u`?window.location.pathname+window.location.search:`/`}const u=/* @__PURE__ */ new Set([`http:`,`https:`]);function d(e){if(typeof window<`u`)try{let t=new URL(e,window.location.href);if(!u.has(t.protocol))return;t.href!==window.location.href&&(window.location.href=t.href)}catch{}}async function f(e,t){let s=a(),{headers:l,body:u}=p(await o(t,{temporaryReferences:s}));l.Accept=`text/x-component`,l[`rsc-action-id`]=e,l[`rari-router-state`]=n();let d=await m(e,l,u),_=h(d);if(_!=null)return _;await g(e,d);let v=await i(Promise.resolve(d),{callServer:f,temporaryReferences:s}),y=v.a,b=y instanceof Promise?await y:y;return r(d,v,b),c(b)}function p(e){let t={};return typeof e==`string`&&(t[`Content-Type`]=`text/plain;charset=UTF-8`),{headers:t,body:e}}async function m(t,n,r){try{return await fetch(l(),{method:`POST`,headers:n,body:r,signal:AbortSignal.timeout(s)})}catch(n){throw n instanceof DOMException&&n.name===`TimeoutError`||e(n)&&n.name===`AbortError`?Error(`Server action "${t}" timed out after ${s}ms`):n}}function h(e){let t=e.headers.get(`x-action-redirect`);if(t==null||t===``)return null;let[n=``]=t.split(`;`);return n!==``&&d(n),{redirect:n}}async function g(e,t){let n=t.headers.get(`content-type`),r=n!=null&&n!==``?n:``;if(r.startsWith(`text/x-component`))return;let i=t.status>=400&&r.startsWith(`text/plain`)?await t.text().catch(()=>t.statusText):`Server action "${e}" failed with status ${t.status}: ${t.statusText}`;throw Error(i)}export{f as callServer};
1
+ import{d as e,g as t}from"../type-guards-BLY2PlGR.mjs";import{a as n}from"../route-cache-D2iIKQIU.mjs";import{scheduleActionFlightRefresh as r}from"./action-flight-refresh.mjs";import{createFromFetch as i,createTemporaryReferenceSet as a,encodeReply as o}from"virtual:react-flight-client";const s=3e4;function c(e){if(!t(e))return e;let{"~rariSkipRefresh":n,...r}=e;return r}function l(){return typeof window<`u`?window.location.pathname+window.location.search:`/`}const u=/* @__PURE__ */ new Set([`http:`,`https:`]);function d(e){if(typeof window<`u`)try{let t=new URL(e,window.location.href);if(!u.has(t.protocol))return;t.href!==window.location.href&&(window.location.href=t.href)}catch{}}async function f(e,t){let s=a(),{headers:l,body:u}=p(await o(t,{temporaryReferences:s}));l.Accept=`text/x-component`,l[`rsc-action-id`]=e,l[`rari-router-state`]=n();let d=await m(e,l,u),_=h(d);if(_!=null)return _;await g(e,d);let v=await i(Promise.resolve(d),{callServer:f,temporaryReferences:s}),y=v.a,b=y instanceof Promise?await y:y;return r(d,v,b),c(b)}function p(e){let t={};return typeof e==`string`&&(t[`Content-Type`]=`text/plain;charset=UTF-8`),{headers:t,body:e}}async function m(t,n,r){try{return await fetch(l(),{method:`POST`,headers:n,body:r,signal:AbortSignal.timeout(s)})}catch(n){throw n instanceof DOMException&&n.name===`TimeoutError`||e(n)&&n.name===`AbortError`?Error(`Server action "${t}" timed out after ${s}ms`):n}}function h(e){let t=e.headers.get(`x-action-redirect`);if(t==null||t===``)return null;let[n=``]=t.split(`;`);return n!==``&&d(n),{redirect:n}}async function g(e,t){let n=t.headers.get(`content-type`),r=n!=null&&n!==``?n:``;if(r.startsWith(`text/x-component`))return;let i=t.status>=400&&r.startsWith(`text/plain`)?await t.text().catch(()=>t.statusText):`Server action "${e}" failed with status ${t.status}: ${t.statusText}`;throw Error(i)}export{f as callServer};
@@ -1,5 +1,5 @@
1
- import{i as e,n as t,p as n,r,v as i}from"../type-guards-BJXKlA6x.mjs";import{t as a}from"../router-Cl4J7j1A.mjs";import{a as o,n as s,r as c}from"../rari-global-5vGzhToD.mjs";import{n as l,t as u}from"../preload-modules-Dv_GzGCm.mjs";import*as d from"react";import{createFromFetch as f,createFromReadableStream as p}from"virtual:react-flight-client";import{createRoot as m,hydrateRoot as h}from"react-dom/client";import{AppRouterProvider as g}from"virtual:app-router-provider";import{ClientRouter as _}from"virtual:client-router";import"virtual:rsc-integration.ts";function v(e,t){if(e.querySelector(`.rari-error[data-rari-hydration-failure]`))return;let n=document.createElement(`div`);n.className=`rari-error`,n.setAttribute(`data-rari-hydration-failure`,`true`),n.setAttribute(`role`,`alert`),n.style.cssText=`color:red;border:1px solid red;padding:10px;border-radius:4px;background-color:#fff5f5;margin:10px 0;`;let r=document.createElement(`strong`);r.textContent=`Failed to load page: `,n.append(r,document.createTextNode(t)),e.prepend(n)}function y(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(;t.nextNode();){let e=t.currentNode;if(e.nodeType===8&&`data`in e){let t=e.data;if(t===`$`||t===`$?`||t===`/$`)return!0}}return!!(e.querySelector(`[data-reactroot]`)||e.querySelectorAll(`template[data-rri]`).length>0)}function b(e){let t=e.tagName;if(t===`SCRIPT`||t===`STYLE`||t===`LINK`||t===`META`||t===`NOSCRIPT`)return!0;let n=typeof e.getAttribute==`function`?e.getAttribute.bind(e):null;return n==null?!1:n(`data-rari-nav-transition`)!=null||n(`aria-hidden`)===`true`}function x(e){let t=e.firstElementChild;for(;t!=null&&b(t);)t=t.nextElementSibling;return t}function S(e){if(y(e))return!0;let t=x(e);return t!==null&&!t.classList.contains(`rari-error`)}function C(e){return y(e)}function w(e){e.querySelectorAll(`.rari-error:not([data-rari-hydration-failure])`).forEach(e=>{e.remove()})}function T(e,t,n){return d.createElement(e,t,n)}async function E(e){let t=l(e);for(let e=0;e<10&&n(t);e+=1)t=l(await t);if(n(t))throw Error(`[rari] Failed to resolve Flight element to a React node`);return t}function D(e){return d.isValidElement(e)&&(e.type===`html`||e.type===`HTML`)}function O(e){if(!D(e))return v(document.body,`RSC payload did not resolve to an <html> document root. Try refreshing the page.`),console.error(`[rari] Hydration skipped: Flight content is not a document root`),!1;let t=d.createElement(g,{initialPayload:{element:e}});return t=T(_,{initialRoute:window.location.pathname},t),t=T(a,{initialPathname:window.location.pathname},t),j(t),!0}function k(){Reflect.set(globalThis,`__rari_client_ready`,!0),window.dispatchEvent(new CustomEvent(`rari:client-ready`))}function A(e){if(e===``)return;let t=()=>{document.title.trim()===``&&(document.title=e)};t(),queueMicrotask(t),requestAnimationFrame(()=>{t(),requestAnimationFrame(t)})}function j(e){let t=document.documentElement,n=document.title.trim();C(t)?(w(t),h(document,e,{onRecoverableError(e){import.meta.env.DEV&&console.warn(`[rari] Hydration mismatch:`,e)}})):m(document).render(e),A(n),k()}
1
+ import{g as e,i as t,n,p as r,r as i}from"../type-guards-BLY2PlGR.mjs";import{t as a}from"../router-Cc9lVbtA.mjs";import{a as o,n as s,r as c}from"../rari-global-5vGzhToD.mjs";import{r as l}from"../react-helpers-duOBWuYF.mjs";import{n as u,t as d}from"../preload-modules-BDQFWAlZ.mjs";import{createElement as f}from"react";import{createFromFetch as p,createFromReadableStream as m}from"virtual:react-flight-client";import{createRoot as h,hydrateRoot as g}from"react-dom/client";import{AppRouterProvider as _}from"virtual:app-router-provider";import{ClientRouter as v}from"virtual:client-router";import"virtual:rsc-integration.ts";function y(e,t){if(e.querySelector(`.rari-error[data-rari-hydration-failure]`))return;let n=document.createElement(`div`);n.className=`rari-error`,n.setAttribute(`data-rari-hydration-failure`,`true`),n.setAttribute(`role`,`alert`),n.style.cssText=`color:red;border:1px solid red;padding:10px;border-radius:4px;background-color:#fff5f5;margin:10px 0;`;let r=document.createElement(`strong`);r.textContent=`Failed to load page: `,n.append(r,document.createTextNode(t)),e.prepend(n)}function b(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(;t.nextNode();){let e=t.currentNode;if(e.nodeType===8&&`data`in e){let t=e.data;if(t===`$`||t===`$?`||t===`/$`)return!0}}return!!(e.querySelector(`[data-reactroot]`)||e.querySelectorAll(`template[data-rri]`).length>0)}function x(e){let t=e.tagName;if(t===`SCRIPT`||t===`STYLE`||t===`LINK`||t===`META`||t===`NOSCRIPT`)return!0;let n=typeof e.getAttribute==`function`?e.getAttribute.bind(e):null;return n==null?!1:n(`data-rari-nav-transition`)!=null||n(`aria-hidden`)===`true`}function S(e){let t=e.firstElementChild;for(;t!=null&&x(t);)t=t.nextElementSibling;return t}function C(e){if(b(e))return!0;let t=S(e);return t!==null&&!t.classList.contains(`rari-error`)}function w(e){return b(e)}function T(e){e.querySelectorAll(`.rari-error:not([data-rari-hydration-failure])`).forEach(e=>{e.remove()})}async function E(e){let t=u(e);for(let e=0;e<10&&r(t);e+=1)t=u(await t);if(r(t))throw Error(`[rari] Failed to resolve Flight element to a React node`);return t}function D(e){if(!l(e))return y(document.body,`RSC payload did not resolve to an <html> document root. Try refreshing the page.`),console.error(`[rari] Hydration skipped: Flight content is not a document root`),!1;let t=f(_,{initialPayload:{element:e}});return t=f(v,{initialRoute:window.location.pathname},t),t=f(a,{initialPathname:window.location.pathname},t),A(t),!0}function O(){Reflect.set(globalThis,`__rari_client_ready`,!0),window.dispatchEvent(new CustomEvent(`rari:client-ready`))}function k(e){if(e===``)return;let t=()=>{document.title.trim()===``&&(document.title=e)};t(),queueMicrotask(t),requestAnimationFrame(()=>{t(),requestAnimationFrame(t)})}function A(e){let t=document.documentElement,n=document.title.trim();w(t)?(T(t),g(document,e,{onRecoverableError(e){import.meta.env.DEV&&console.warn(`[rari] Hydration mismatch:`,e)}})):h(document).render(e),k(n),O()}
2
2
  /*! @preserve CLIENT_COMPONENT_IMPORTS_PLACEHOLDER */
3
3
  c(),s();
4
4
  /*! @preserve CLIENT_COMPONENT_REGISTRATIONS_PLACEHOLDER */
5
- function M(){let e=Reflect.get(globalThis,`__rari_f`);if(Array.isArray(e))return e}function N(e){return i(e)&&typeof e.rscRow==`string`}function P(e){return Array.isArray(e)&&typeof e[1]==`string`}function F(){return!!M()?.some(e=>e!==0)}function I(){let e=M();if(e?.length==null||e.length===0)return null;let t=``,n=[];for(let r of e)r!==0&&(typeof r==`string`?t+=r:P(r)&&n.push(r[1]));if(n.length>0){let e=n.map(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0))),t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t),i=0;for(let t of e)r.set(t,i),i+=t.length;return r}return t?new TextEncoder().encode(t):null}async function L(t,n){let r=new TextDecoder().decode(t);await u(r);let i=o(),a=i.streaming,s=!!(a?.bufferedRows&&a.bufferedRows.length>0);if(n.streaming&&(a?.complete===void 0||s)){let n=new ReadableStream({start(n){let r=!1;n.enqueue(t);let a=t=>{if(r)return;let i=e(t,N);i&&n.enqueue(new TextEncoder().encode(`\n${i.rscRow}`))},o=()=>{r||(r=!0,n.close(),window.removeEventListener(`rari:html-stream-row`,a),window.removeEventListener(`rari:stream-complete`,o))};if(window.addEventListener(`rari:html-stream-row`,a),window.addEventListener(`rari:stream-complete`,o),i.streaming?.bufferedRows){let e=[...i.streaming.bufferedRows];for(let t of e)n.enqueue(new TextEncoder().encode(`\n${t}`));i.streaming.bufferedRows=[]}i.streaming?.complete&&o()}});return p(n)}let c=new ReadableStream({start(e){e.enqueue(t),e.close()}});return p(c)}async function R(e){let t=`Could not load interactive page data.`,n;try{n=await L(e,{streaming:!1})}catch(e){t=r(e,`Failed to parse embedded RSC payload.`);try{let e=window.location.pathname+window.location.search,r=await fetch(e,{headers:{Accept:`text/x-component`},cache:`no-store`});r.ok?n=await f(Promise.resolve(r)):t=`Failed to fetch RSC payload fallback: HTTP ${r.status}.`}catch(e){t=r(e,`Failed to fetch RSC payload fallback.`),console.error(`[rari] Failed to fetch RSC payload fallback:`,e)}}return n==null?(v(document.body,`${t} Try refreshing the page.`),console.error(`[rari] Hydration skipped: failed to load RSC payload`),{ok:!1,errorMessage:t}):(O(await E(n)),{ok:!0,errorMessage:t})}async function z(){try{let e=window.location.pathname+window.location.search,t=await fetch(e,{headers:{Accept:`text/x-component`},cache:`no-store`});if(!t.ok&&t.status!==404)throw Error(`Failed to fetch RSC data: ${t.status}`);if(!t.body)throw Error(`RSC response has no body`);return await f(Promise.resolve(t))}catch(e){if(e instanceof Promise)throw e;return console.error(`[rari] Failed to fetch initial RSC data:`,e),null}}function B(){return new ReadableStream({start(t){let n=n=>{let r=e(n,N);r&&t.enqueue(new TextEncoder().encode(`${r.rscRow}\n`))},r=()=>{t.close(),window.removeEventListener(`rari:html-stream-row`,n),window.removeEventListener(`rari:stream-complete`,r)};window.addEventListener(`rari:html-stream-row`,n),window.addEventListener(`rari:stream-complete`,r);let i=o();if(i.streaming?.bufferedRows){let e=[...i.streaming.bufferedRows];i.streaming.bufferedRows=[];for(let n of e)t.enqueue(new TextEncoder().encode(`${n}\n`))}i.streaming?.complete&&r()}})}async function V(){try{return await p(B())}catch(e){return console.error(`[rari] Failed to process streaming RSC payload:`,e),null}}async function H(e){try{return await L(e,{streaming:!0})}catch(e){return console.error(`[rari] Failed to parse embedded RSC payload:`,e),console.error(`[rari] Error stack:`,t(e)?.stack??`no stack`),null}}async function U(){let e=F(),t=I(),n=document.documentElement,r=S(document.body)||y(n),i=o().streaming,a=!!(i?.bufferedRows&&i.bufferedRows.length>0);try{if(r&&e&&t){await R(t);return}let n=!e&&!a&&!r,i;if(n?i=await z():e&&t?i=await H(t):a&&(i=await V()),i==null)throw Error(`No RSC data available for hydration`);O(await E(i))}catch(e){console.error(`[rari] Error rendering app:`,e)}}function W(){let e=import.meta.hot;if(!e)return{};let t=e.data;return i(t)?{hasRendered:t.hasRendered===!0}:{}}function G(){let e=import.meta.hot;if(!e)return;let t=e.data;i(t)&&(t.hasRendered=!0)}(!import.meta.hot||W().hasRendered!==!0)&&(U().catch(e=>{console.error(`[rari] Fatal error:`,e)}),G());export{U as renderApp};
5
+ function j(){let e=Reflect.get(globalThis,`__rari_f`);if(Array.isArray(e))return e}function M(t){return e(t)&&typeof t.rscRow==`string`}function N(e){return Array.isArray(e)&&typeof e[1]==`string`}function P(){return!!j()?.some(e=>e!==0)}function F(){let e=j();if(e?.length==null||e.length===0)return null;let t=``,n=[];for(let r of e)r!==0&&(typeof r==`string`?t+=r:N(r)&&n.push(r[1]));if(n.length>0){let e=n.map(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0))),t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t),i=0;for(let t of e)r.set(t,i),i+=t.length;return r}return t?new TextEncoder().encode(t):null}async function I(e,n){let r=new TextDecoder().decode(e);await d(r);let i=o(),a=i.streaming,s=!!(a?.bufferedRows&&a.bufferedRows.length>0);if(n.streaming&&(a?.complete===void 0||s)){let n=new ReadableStream({start(n){let r=!1;n.enqueue(e);let a=e=>{if(r)return;let i=t(e,M);i&&n.enqueue(new TextEncoder().encode(`\n${i.rscRow}`))},o=()=>{r||(r=!0,n.close(),window.removeEventListener(`rari:html-stream-row`,a),window.removeEventListener(`rari:stream-complete`,o))};if(window.addEventListener(`rari:html-stream-row`,a),window.addEventListener(`rari:stream-complete`,o),i.streaming?.bufferedRows){let e=[...i.streaming.bufferedRows];for(let t of e)n.enqueue(new TextEncoder().encode(`\n${t}`));i.streaming.bufferedRows=[]}i.streaming?.complete&&o()}});return m(n)}let c=new ReadableStream({start(t){t.enqueue(e),t.close()}});return m(c)}async function L(e){let t=`Could not load interactive page data.`,n;try{n=await I(e,{streaming:!1})}catch(e){t=i(e,`Failed to parse embedded RSC payload.`);try{let e=window.location.pathname+window.location.search,r=await fetch(e,{headers:{Accept:`text/x-component`},cache:`no-store`});r.ok?n=await p(Promise.resolve(r)):t=`Failed to fetch RSC payload fallback: HTTP ${r.status}.`}catch(e){t=i(e,`Failed to fetch RSC payload fallback.`),console.error(`[rari] Failed to fetch RSC payload fallback:`,e)}}return n==null?(y(document.body,`${t} Try refreshing the page.`),console.error(`[rari] Hydration skipped: failed to load RSC payload`),{ok:!1,errorMessage:t}):(D(await E(n)),{ok:!0,errorMessage:t})}async function R(){try{let e=window.location.pathname+window.location.search,t=await fetch(e,{headers:{Accept:`text/x-component`},cache:`no-store`});if(!t.ok&&t.status!==404)throw Error(`Failed to fetch RSC data: ${t.status}`);if(!t.body)throw Error(`RSC response has no body`);return await p(Promise.resolve(t))}catch(e){if(e instanceof Promise)throw e;return console.error(`[rari] Failed to fetch initial RSC data:`,e),null}}function z(){return new ReadableStream({start(e){let n=n=>{let r=t(n,M);r&&e.enqueue(new TextEncoder().encode(`${r.rscRow}\n`))},r=()=>{e.close(),window.removeEventListener(`rari:html-stream-row`,n),window.removeEventListener(`rari:stream-complete`,r)};window.addEventListener(`rari:html-stream-row`,n),window.addEventListener(`rari:stream-complete`,r);let i=o();if(i.streaming?.bufferedRows){let t=[...i.streaming.bufferedRows];i.streaming.bufferedRows=[];for(let n of t)e.enqueue(new TextEncoder().encode(`${n}\n`))}i.streaming?.complete&&r()}})}async function B(){try{return await m(z())}catch(e){return console.error(`[rari] Failed to process streaming RSC payload:`,e),null}}async function V(e){try{return await I(e,{streaming:!0})}catch(e){return console.error(`[rari] Failed to parse embedded RSC payload:`,e),console.error(`[rari] Error stack:`,n(e)?.stack??`no stack`),null}}async function H(){let e=P(),t=F(),n=document.documentElement,r=C(document.body)||b(n),i=o().streaming,a=!!(i?.bufferedRows&&i.bufferedRows.length>0);try{if(r&&e&&t){await L(t);return}let n=!e&&!a&&!r,i;if(n?i=await R():e&&t?i=await V(t):a&&(i=await B()),i==null)throw Error(`No RSC data available for hydration`);D(await E(i))}catch(e){console.error(`[rari] Error rendering app:`,e)}}function U(){let t=import.meta.hot;if(!t)return{};let n=t.data;return e(n)?{hasRendered:n.hasRendered===!0}:{}}function W(){let t=import.meta.hot;if(!t)return;let n=t.data;e(n)&&(n.hasRendered=!0)}(!import.meta.hot||U().hasRendered!==!0)&&(H().catch(e=>{console.error(`[rari] Fatal error:`,e)}),W());export{H as renderApp};
@@ -1,9 +1,9 @@
1
- import * as React from "react";
1
+ import { t as FlightContent } from "../react-helpers-GTRYJwF2.mjs";
2
+ import { ReactElement, ReactNode } from "react";
2
3
  //#region src/runtime/flight/merge-refresh.d.ts
3
- export declare const LAYOUT_REUSE_ELEMENT = "rari-layout-reuse";
4
- export declare const LAYOUT_REUSE_PATH_PROP = "data-rari-layout-path";
5
- export declare function isLayoutReuseMarker(element: React.ReactElement): boolean;
6
- export declare function unwrapFulfilledFlightNode(node: React.ReactNode | PromiseLike<React.ReactNode>): React.ReactNode;
7
- export declare function spliceLayoutReuseChildren(current: React.ReactNode, nextPage: React.ReactNode, layoutPath?: string): React.ReactNode;
8
- export declare function mergeFlightRefresh(current: React.ReactNode, refresh: React.ReactNode): React.ReactNode;
4
+ export declare function isLayoutReuseMarker(element: ReactElement): boolean;
5
+ export declare function layoutPathOf(element: ReactElement): string | undefined;
6
+ export declare function setChildrenAtLayoutPath(document: ReactElement, layoutPath: string, nextChildren: ReactNode): ReactElement | null;
7
+ export declare function unwrapFulfilledFlightNode(node: FlightContent): ReactNode;
8
+ export declare function mergeFlightRefresh(current: ReactNode, refresh: ReactNode): ReactNode;
9
9
  //#endregion
@@ -1 +1 @@
1
- import{l as e,o as t,p as n,s as r,v as i}from"../type-guards-BJXKlA6x.mjs";import*as a from"react";const o=`rari-layout-reuse`,s=`data-rari-layout-path`;function c(e){return a.isValidElement(e)}function l(t){return e(t.type)}function u(e){return e.type===`head`||e.type===`HEAD`}function d(e){return e.type===`html`||e.type===`HTML`}function f(e){return e.type===`body`||e.type===`BODY`}function p(e){return e.type===o}function m(e){let t=h(e)[s];return typeof t==`string`&&t!==``?t:void 0}function ee(e){let t={...e};return delete t.children,t}function h(e){return t(e)}function g(e,t){if(!l(e)||!l(t))return!1;let n=r(e.type)?e.type.$$id:void 0,i=r(t.type)?t.type.$$id:void 0;return n==null||n===``||i==null||i===``||n!==i?!1:(e.key??null)===(t.key??null)}function _(e){return v(h(e).children)}function te(e){return Array.isArray(e)&&e.some(e=>Array.isArray(e))}function ne(e,t){let n=e.key,r=typeof n==`string`&&n!==``?`${t}:${n.replace(/^\.+/,``)}`:t;return a.cloneElement(e,{key:r})}function re(e,t,n){return Array.isArray(e)?ie(e,t==null?`.${n}`:`${t}:${n}`):e==null||e===!1||e===!0?[]:c(e)&&t!=null?[ne(e,`${t}:${n}`)]:[e]}function ie(e,t){if(!Array.isArray(e))return e==null||e===!1||e===!0?[]:c(e)&&t!=null?[ne(e,t)]:[e];let n=[];for(let r=0;r<e.length;r+=1)n.push(...re(e[r],t,r));return n}function v(e){return e==null||e===!1||e===!0?[]:c(e)||typeof e==`string`||typeof e==`number`?[e]:Array.isArray(e)?ie(e,null):n(e)?[e]:a.Children.toArray(e)}function y(e){return c(e)?p(e)?!0:v(h(e).children).some(e=>y(e)):!1}function ae(e){let t=e.type;return t===`title`||t===`TITLE`||t===`meta`||t===`META`||t===`link`||t===`LINK`}function b(e){if(e.type!==`link`&&e.type!==`LINK`)return!1;let t=h(e).rel;if(typeof t!=`string`||t===``)return!1;let n=t.toLowerCase();return n===`stylesheet`||n===`preload`||n===`modulepreload`||n===`preconnect`||n===`dns-prefetch`||n===`icon`||n===`shortcut icon`||n===`apple-touch-icon`}function x(e){return e.type===a.Fragment}function S(e){return e.type===a.Suspense}function C(e){return e}function oe(e){if(i(e)){if(e.status===`fulfilled`)return e.value;if(i(e._payload)&&e._payload.status===`fulfilled`)return e._payload.value}}function w(e){let t=e;for(let e=0;e<10;e+=1){if(!n(t)&&(!i(t)||!i(t._payload)))return C(t);let e=oe(t);if(e===void 0)return C(t);if(e==null||e===!1||e===!0)return e;t=e}return C(t)}function T(e){let t=w(e);if(Array.isArray(t)){let e=[];for(let n of t)e.push(...T(C(n)));return e}return c(t)&&x(t)?se(_(t)):t==null||t===!1||t===!0?[]:[t]}function se(e){let t=[];for(let n of e)t.push(...T(n));return t}function E(e){return se(_(e))}function D(e){let t=w(e);return Array.isArray(t)?!0:c(t)&&x(t)}function O(e,t){let n=w(e);if(Array.isArray(n)){let e=[];for(let t of n)e.push(...T(C(t)));let r=v(Be(e,t));return a.createElement(a.Fragment,null,...r.length===0?[null]:r)}return c(n)&&x(n)?P(n,h(n),Be(_(n),t)):c(n)?Y(n,t):t}function k(e){let t=[];for(let n of e){if(c(n)&&x(n)){t.push(...k(_(n)));continue}t.push(n)}return t}function A(e){if(e.type!==`meta`&&e.type!==`META`)return!1;let t=h(e);return t.charSet!=null||t.charset!=null||typeof t.httpEquiv==`string`&&t.httpEquiv.toLowerCase()===`content-type`||typeof t.name==`string`&&t.name.toLowerCase()===`viewport`}function ce(e,t){let n=h(e);return k(t).some(e=>{if(!c(e)||!A(e))return!1;let t=h(e);return n.charSet!=null||n.charset!=null?t.charSet!=null||t.charset!=null:typeof n.httpEquiv==`string`&&n.httpEquiv.toLowerCase()===`content-type`?typeof t.httpEquiv==`string`&&t.httpEquiv.toLowerCase()===`content-type`:typeof t.name==`string`&&t.name.toLowerCase()===`viewport`})}function le(e){return e.type===`title`||e.type===`TITLE`}function ue(e){if(e.type!==`meta`&&e.type!==`META`)return!1;let t=h(e).name;return typeof t==`string`&&t.toLowerCase()===`description`}function de(e){return k(e).some(e=>c(e)&&le(e))}function fe(e){return k(e).some(e=>c(e)&&ue(e))}function pe(e,t){let n=h(e),r=k(_(e)),i=_(t),a=k(i),o=de(a),s=fe(a);return P(e,n,[...r.filter(e=>{if(!c(e))return!0;if(le(e))return!o;if(e.type===`meta`||e.type===`META`)return A(e)?!ce(e,i):ue(e)?!s:!1;if(!b(e))return!ae(e);let t=h(e);return!a.some(e=>{if(!c(e)||!b(e))return!1;let n=h(e);return t.rel!=null&&t.rel===n.rel&&t.href===n.href})}),...a])}function j(e){return e.length===0?null:e.length===1?e[0]:[...e]}function M(e){let t=[];for(let n of v(e))t.push(N(n));return t}function N(e){if(Array.isArray(e))return j(M(e));if(!c(e))return e;if(p(e))return j(M(h(e).children));let t=h(e),n=v(t.children);if(n.length===0)return e;let r=M(n);return!te(t.children)&&r.every((e,t)=>e===n[t])?e:P(e,t,j(r))}function me(e,t){if(e.length===0)return[N(t)];if(e.length===1)return[$(e[0],t)];let n=[],r=!1;for(let i of e)!r&&c(i)?(r=!0,n.push($(i,t))):n.push(i);return r?n:[N(t)]}function he(e,t){let n=[],r=0;for(let i of t){if(c(i)&&p(i)){n.push(...me(e.slice(r),i)),r=e.length;continue}let t=e[r];n.push(t===void 0?N(i):$(t,i)),r+=1}return r<e.length&&n.push(...e.slice(r)),j(n)}function ge(e,t){let n=v(e),r=v(t);return n.length===0||r.length===0?N(t):r.some(e=>c(e)&&p(e))?he(n,r):n.length===r.length?j(n.map((e,t)=>$(e,r[t]))):N(t)}function P(e,t,n){let r=v(n);return a.cloneElement(e,ee(t),...r.length===0?[null]:r)}function _e(e,t){for(let n=0;n<e.length;n+=1){let r=e[n];if(c(r)&&m(r)===t)return n;for(let e of T(r))if(c(e)&&m(e)===t)return n}return-1}function ve(e,t){let n=_(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(c(i)){let e=F(i,t);if(e!=null)return e;continue}let a=w(i);if(c(a)&&F(a,t)!=null)return{parent:e,slotIndex:r}}return null}function F(e,t){let n=_e(_(e),t);return n>=0?{parent:e,slotIndex:n}:ve(e,t)}function I(e){return H(e)?!0:E(e).some(e=>{let t=G(e);return t!=null&&I(t)})}const L=/* @__PURE__ */ new Set([.../* @__PURE__ */ new Set(/* @__PURE__ */ `area.base.br.col.embed.hr.img.input.link.meta.param.source.track.wbr.AREA.BASE.BR.COL.EMBED.HR.IMG.INPUT.LINK.META.PARAM.SOURCE.TRACK.WBR`.split(`.`)),`script`,`style`,`iframe`,`textarea`,`noscript`,`template`,`canvas`,`video`,`audio`,`object`,`embed`,`svg`,`math`,`select`,`title`,`SCRIPT`,`STYLE`,`IFRAME`,`TEXTAREA`,`NOSCRIPT`,`TEMPLATE`,`CANVAS`,`VIDEO`,`AUDIO`,`OBJECT`,`EMBED`,`SVG`,`MATH`,`SELECT`,`TITLE`]);function ye(e){return typeof e.type!=`string`||L.has(e.type)?!1:E(e).length===0}function be(e,t){return g(e,t)?!0:e.type===t.type&&(e.key??null)===(t.key??null)}function R(e){let t=e.type;return t===`nav`||t===`NAV`||t===`header`||t===`HEADER`||t===`footer`||t===`FOOTER`||t===`aside`||t===`ASIDE`}const xe=/^(?:app|page|site|main|mobile|top)?(?:footer|header|navbar|navigation|sidebar|sidenav|topbar|aside|nav)$/,Se=/^(?:app|page|site|main|mobile|top)?footer$/;function Ce(e){return e.replace(/[^a-z0-9]+/gi,``).toLowerCase()}function we(e){if(!r(e.type))return;let t=e.type.$$id,n=t.split(`#`)[0]??t;return(n.split(`/`).pop()??n).replace(/\.(?:tsx|jsx|ts|js)$/i,``)}function z(e){let t=we(e);return t==null?void 0:Ce(t)}function B(e){if(!l(e))return!1;let t=z(e);return t!=null&&xe.test(t)}function Te(e){return R(e)||B(e)}function V(e){if(S(e)){let t=E(e);return t.length===1&&c(t[0])&&V(t[0])}if(B(e)){let t=z(e);return t!=null&&Se.test(t)}let t=e.type;return t===`footer`||t===`FOOTER`}function H(e){return e.type===`main`||e.type===`MAIN`}function Ee(e){let t=h(e).role;if(typeof t!=`string`||t===``)return!1;let n=t.toLowerCase();return n===`status`||n===`alert`||n===`alertdialog`||n===`log`}function U(e){return typeof e.type==`string`&&!L.has(e.type)&&!R(e)&&!Ee(e)}function W(e){return B(e)?!1:l(e)||x(e)}function De(e){let t=E(e);return t.some(e=>c(e)&&Te(e))?!0:t.some(e=>{let t=G(e);return t!=null&&(H(t)||I(t))})}function Oe(e,t){return Ee(e)?!1:U(t)?U(e):W(t)?W(e):!1}function G(e){let t=w(e);return c(t)?t:null}function ke(e){return(S(e)||U(e))&&I(e)}function Ae(e,t){for(let n=e.length-1;n>=0;--n){let r=G(e[n]);if(r!=null&&t(r))return n}return-1}function K(e){let t=e.findIndex(e=>{let t=G(e);return t!=null&&H(t)});if(t>=0)return t;for(let t=0;t<e.length;t+=1){let n=G(e[t]);if(n!=null&&ke(n))return t}let n=Ae(e,U);return n>=0?n:Ae(e,W)}function je(e){return T(e).some(e=>{let t=G(e);return t!=null&&(H(t)||ke(t)||I(t))})}function Me(e,t){for(let n=0;n<e.length;n+=1){let r=T(e[n]);if(r.length!==1)continue;let i=G(r[0]);if(i!=null&&t(i))return n}return-1}function Ne(e,t){for(let n=e.length-1;n>=0;--n){let r=T(e[n]);if(r.length!==1)continue;let i=G(r[0]);if(i!=null&&t(i))return n}return-1}function Pe(e){for(let t=e.length-1;t>=0;--t)if(D(e[t])&&K(T(e[t]))>=0)return t;return-1}function Fe(e){let t=Me(e,H);if(t>=0)return t;for(let t=0;t<e.length;t+=1)if(je(e[t]))return t;let n=Ne(e,U);if(n>=0)return n;let r=Ne(e,W);return r>=0?r:Pe(e)}function Ie(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n!=null&&n!==!1&&n!==!0&&!c(n)&&(typeof n==`string`||typeof n==`number`))return t}return-1}function Le(e){return H(e)||I(e)?!0:E(e).some(e=>{let t=G(e);return t!=null&&U(t)})}function Re(e,t){let n=e.length;for(let t=e.length-1;t>=0;--t){let r=e[t];if(c(r)&&V(r)){n=t;continue}break}return[...e.slice(0,n),t,...e.slice(n)]}function ze(e,t){let n=e.findIndex(e=>c(e)&&be(e,t));if(n>=0){let r=[...e];return r[n]=$(e[n],t),r}let r=K(e);if(r<0)return null;let i=e[r],a=w(i);return c(a)&&(H(a)||I(a))?q(e,r,i,a,t):null}function q(e,t,n,r,i){let a=[...e],o=Y(r,i);return a[t]=c(n)&&n===r?P(n,h(n),o):o,a}function J(e,t,n,r){let i=c(n)&&(!W(n)||Le(n)),a=[];for(let o=0;o<e.length;o+=1){let s=e[o];if(o===t){a.push(i?P(n,h(n),r):r);continue}c(n)&&c(s)&&Oe(s,n)||a.push(s)}return a}function Be(e,t){if(e.length===1&&c(e[0]))return $(e[0],t);if(e.length===0)return t;if(c(t)){let n=ze(e,t);if(n!=null)return n}let n=K(e);if(n<0){let n=Ie(e);return n>=0?J(e,n,e[n],t):Re(e,t)}let r=e[n],i=w(r);return c(i)&&(H(i)||I(i))?q(e,n,r,i,t):J(e,n,r,t)}function Ve(e,t){if(c(e))return $(e,t);if(D(e))return O(e,t);let n=w(e);return n==null||n===!1||n===!0?t:c(n)?$(n,t):null}function Y(e,t){let n=_(e);if(n.length===1){let e=Ve(n[0],t);if(e!=null)return e}if(n.length===0||E(e).length===0)return t;if(c(t)){let e=ze(n,t);if(e!=null)return e}let r=Fe(n);if(r<0){let e=Ie(n);return e>=0?J(n,e,n[e],t):Re(n,t)}let i=n[r];if(D(i)){let e=[...n];return e[r]=O(i,t),e}let a=w(i);return c(a)&&(H(a)||I(a))?q(n,r,i,a,t):J(n,r,i,t)}function He(e,t,n){let r=w(e);if(Array.isArray(r)){let e=[];for(let t of r)e.push(...T(C(t)));return Z(a.createElement(a.Fragment,null,...e.length===0?[null]:e),t,n)}return c(r)?Z(r,t,n):t}function Ue(e,t,r){let i=F(e,r);if(i==null)return null;let a=h(i.parent),o=_(i.parent),s=[...o],l=o[i.slotIndex];return D(l)||!c(l)&&n(l)?s[i.slotIndex]=He(l,t,r):c(l)?s[i.slotIndex]=P(l,h(l),Y(l,t)):s[i.slotIndex]=t,qe(e,i.parent,P(i.parent,a,s))}function X(e,t,n,r,i){let a=[...n];return a[r]=i,P(e,t,a)}function We(e,t,n,r,i){for(let a=0;a<n.length;a+=1){let o=n[a];if(D(o)){if(!je(o))continue;return X(e,t,n,a,O(o,r))}let s=w(o);if(c(s)&&I(s))return X(e,t,n,a,Z(s,r,i))}return null}function Ge(e,t,n,r){for(let i=0;i<n.length;i+=1){let a=n[i];if(c(a)&&ye(a))return X(e,t,n,i,P(a,h(a),Y(a,r)))}return null}function Ke(e,t,n){let r=h(e),i=_(e);if(e.type===`main`||e.type===`MAIN`)return P(e,r,Y(e,t));if(i.length===1&&c(i[0]))return P(e,r,Z(i[0],t,n));if(i.length===1&&D(i[0]))return P(e,r,O(i[0],t));let a=i.findIndex(e=>{let t=G(e);return t!=null&&H(t)});if(a>=0){let o=i[a],s=w(o);return X(e,r,i,a,Z(c(s)?s:o,t,n))}return We(e,r,i,t,n)??Ge(e,r,i,t)??P(e,r,Y(e,t))}function Z(e,t,n){if(!c(e))return t;if(c(t)&&p(t)){let r=m(t);return Z(e,h(t).children,r??n)}if(n!=null&&n!==``){let r=Ue(e,t,n);if(r!=null)return r}return Ke(e,t,n)}function qe(e,t,n){if(e===t)return n;let r=h(e),i=_(e),a=[],o=!1;for(let e of i){if(!c(e)){a.push(e);continue}if(e===t){o=!0,a.push(n);continue}let r=qe(e,t,n);r!==e&&(o=!0),a.push(r)}return o?P(e,r,a):e}function Je(e,t){let n=h(e),r=_(e),i=_(t),a=r.find(e=>c(e)&&u(e)),o=i.find(e=>c(e)&&u(e)),s=r.find(e=>c(e)&&f(e)),l=i.find(e=>c(e)&&f(e)),d=c(a)&&c(o)?pe(a,o):c(a)?a:o,p=c(s)&&c(l)?$(s,l):c(s)?s:l,m=[];return d!=null&&m.push(d),p!=null&&m.push(p),P(e,n,m)}function Ye(e,t,n){let r=h(e),i=_(e),a=i.findIndex(e=>c(e)&&f(e)),o=a>=0?i[a]:void 0,s=c(o)?Z(o,t.children,n):Z(e,t.children,n);if(c(o)&&a>=0){let t=[...i];return t[a]=s,P(e,r,t)}return P(e,r,s)}function Q(e,t){let n=h(e),r=h(t),i=v(r.children);if(i.length===1&&c(i[0])&&p(i[0])){let t=i[0];return Z(e,h(t).children,m(t))}let a=ge(n.children,r.children);return a===r.children?t:y(t)?P(e,n,a):P(t,r,a)}function Xe(e,t){if(y(t))return Q(e,t);let n=_(e),r=_(t);return n.length!==r.length&&De(e)&&r.length>0?P(t,h(t),Y(e,j(r))):Q(e,t)}function $(e,t){if(e==null)return N(t);if(t==null)return e;if(!c(e)||!c(t))return t;if(p(t)){let n=h(t),r=m(t);return d(e)?Ye(e,n,r):Z(e,n.children,r)}return d(e)&&d(t)&&y(t)?Je(e,t):u(e)||u(t)?t:g(e,t)?Xe(e,t):e.type===t.type?Q(e,t):t}export{o as LAYOUT_REUSE_ELEMENT,s as LAYOUT_REUSE_PATH_PROP,p as isLayoutReuseMarker,$ as mergeFlightRefresh,Z as spliceLayoutReuseChildren,w as unwrapFulfilledFlightNode};
1
+ import{g as e,l as t,o as n,p as r}from"../type-guards-BLY2PlGR.mjs";import{Children as i,Fragment as a,cloneElement as o,createElement as s,isValidElement as c}from"react";function l(e){return t(e.type)}function u(e){return e.type===`head`||e.type===`HEAD`}function d(e){return e.type===`html`||e.type===`HTML`}function f(e){return e.type===`body`||e.type===`BODY`}function p(e){return e.type===`rari-layout-reuse`}function m(e){let t=e.props[`data-rari-layout-path`];return typeof t==`string`&&t!==``?t:void 0}function ee(e,t,n){if(m(e)===t)return W(e,e.props,n);let r=q(e,t);if(r==null)return null;let i=r.parent.props,a=_(r.parent),o=a[r.slotIndex];if(!c(o))return null;let s=[...a];s[r.slotIndex]=W(o,o.props,n);let l=Q(e,r.parent,W(r.parent,i,s));return c(l)?l:null}function h(e){let t={...e};return delete t.children,t}function g(e,t){if(!l(e)||!l(t))return!1;let r=n(e.type)?e.type.$$id:void 0,i=n(t.type)?t.type.$$id:void 0;return r==null||r===``||i==null||i===``||r!==i?!1:(e.key??null)===(t.key??null)}function _(e){return S(e.props.children)}function v(e){return Array.isArray(e)&&e.some(e=>Array.isArray(e))}function y(e,t){let n=e.key,r=typeof n==`string`&&n!==``?`${t}:${n.replace(/^\.+/,``)}`:t;return o(e,{key:r})}function b(e,t,n){return Array.isArray(e)?x(e,t==null?`.${n}`:`${t}:${n}`):e==null||e===!1||e===!0?[]:c(e)&&t!=null?[y(e,`${t}:${n}`)]:[e]}function x(e,t){if(!Array.isArray(e))return e==null||e===!1||e===!0?[]:c(e)&&t!=null?[y(e,t)]:[e];let n=[];for(let r=0;r<e.length;r+=1)n.push(...b(e[r],t,r));return n}function S(e){return e==null||e===!1||e===!0?[]:c(e)||typeof e==`string`||typeof e==`number`?[e]:Array.isArray(e)?x(e,null):r(e)?[e]:i.toArray(e)}function C(e){return c(e)?p(e)?!0:S(e.props.children).some(e=>C(e)):!1}function te(e){let t=e.type;return t===`title`||t===`TITLE`||t===`meta`||t===`META`||t===`link`||t===`LINK`}function w(e){if(e.type!==`link`&&e.type!==`LINK`)return!1;let t=e.props.rel;if(typeof t!=`string`||t===``)return!1;let n=t.toLowerCase();return n===`stylesheet`||n===`preload`||n===`modulepreload`||n===`preconnect`||n===`dns-prefetch`||n===`icon`||n===`shortcut icon`||n===`apple-touch-icon`}function T(t){if(e(t)){if(t.status===`fulfilled`)return t.value;if(e(t._payload)&&t._payload.status===`fulfilled`)return t._payload.value}}function E(t){let n=t;for(let t=0;t<10;t+=1){if(!r(n)&&(!e(n)||!e(n._payload)))return n;let t=T(n);if(t===void 0)return n;if(t==null||t===!1||t===!0)return t;n=t}return n}function D(e){let t=E(e);if(Array.isArray(t)){let e=[];for(let n of t)e.push(...D(n));return e}return c(t)&&t.type===a?O(_(t)):t==null||t===!1||t===!0?[]:[t]}function O(e){let t=[];for(let n of e)t.push(...D(n));return t}function k(e){let t=E(e);return Array.isArray(t)?!0:c(t)&&t.type===a}function A(e){let t=[];for(let n of e){if(c(n)&&n.type===a){t.push(...A(_(n)));continue}t.push(n)}return t}function j(e){if(e.type!==`meta`&&e.type!==`META`)return!1;let t=e.props;return t.charSet!=null||t.charset!=null||typeof t.httpEquiv==`string`&&t.httpEquiv.toLowerCase()===`content-type`||typeof t.name==`string`&&t.name.toLowerCase()===`viewport`}function M(e,t){let n=e.props;return A(t).some(e=>{if(!c(e)||!j(e))return!1;let t=e.props;return n.charSet!=null||n.charset!=null?t.charSet!=null||t.charset!=null:typeof n.httpEquiv==`string`&&n.httpEquiv.toLowerCase()===`content-type`?typeof t.httpEquiv==`string`&&t.httpEquiv.toLowerCase()===`content-type`:typeof t.name==`string`&&t.name.toLowerCase()===`viewport`})}function N(e){return e.type===`title`||e.type===`TITLE`}function P(e){if(e.type!==`meta`&&e.type!==`META`)return!1;let t=e.props.name;return typeof t==`string`&&t.toLowerCase()===`description`}function F(e){return A(e).some(e=>c(e)&&N(e))}function I(e){return A(e).some(e=>c(e)&&P(e))}function L(e,t){let n=e.props,r=A(_(e)),i=_(t),a=A(i),o=F(a),s=I(a);return W(e,n,[...r.filter(e=>{if(!c(e))return!0;if(N(e))return!o;if(e.type===`meta`||e.type===`META`)return j(e)?!M(e,i):P(e)?!s:!1;if(!w(e))return!te(e);let t=e.props;return!a.some(e=>{if(!c(e)||!w(e))return!1;let n=e.props;return t.rel!=null&&t.rel===n.rel&&t.href===n.href})}),...a])}function R(e){return e.length===0?null:e.length===1?e[0]:[...e]}function z(e){let t=[];for(let n of S(e))t.push(B(n));return t}function B(e){if(Array.isArray(e))return R(z(e));if(!c(e))return e;if(p(e))return R(z(e.props.children));let t=e.props,n=S(t.children);if(n.length===0)return e;let r=z(n);return!v(t.children)&&r.every((e,t)=>e===n[t])?e:W(e,t,R(r))}function V(e,t){if(e.length===0)return[B(t)];if(e.length===1)return[$(e[0],t)];let n=[],r=!1;for(let i of e)!r&&c(i)?(r=!0,n.push($(i,t))):n.push(i);return r?n:[B(t)]}function H(e,t){let n=[],r=0;for(let i of t){if(c(i)&&p(i)){n.push(...V(e.slice(r),i)),r=e.length;continue}let t=e[r];n.push(t===void 0?B(i):$(t,i)),r+=1}return r<e.length&&n.push(...e.slice(r)),R(n)}function U(e,t){let n=S(e),r=S(t);return n.length===0||r.length===0?B(t):r.some(e=>c(e)&&p(e))?H(n,r):n.length===r.length?R(n.map((e,t)=>$(e,r[t]))):B(t)}function W(e,t,n){let r=S(n);return o(e,h(t),...r.length===0?[null]:r)}function G(e,t){for(let n=0;n<e.length;n+=1){let r=e[n];if(c(r)&&m(r)===t)return n;for(let e of D(r))if(c(e)&&m(e)===t)return n}return-1}function K(e,t){let n=_(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(c(i)){let e=q(i,t);if(e!=null)return e;continue}let a=E(i);if(c(a)&&q(a,t)!=null)return{parent:e,slotIndex:r}}return null}function q(e,t){let n=G(_(e),t);return n>=0?{parent:e,slotIndex:n}:K(e,t)}function J(e,t,n){let r=E(e);if(Array.isArray(r)){let e=[];for(let t of r)e.push(...D(t));return Z(s(a,null,...e.length===0?[null]:e),t,n)}return c(r)?Z(r,t,n):t}function Y(e,t){if(t==null||t===!1||t===!0)return t;let n=_(e);return n.length===1?$(n[0],t):t}function X(e,t,n){if(m(e)===n)return W(e,e.props,Y(e,t));let i=q(e,n);if(i==null)return null;let a=i.parent.props,o=_(i.parent),s=[...o],l=o[i.slotIndex];return k(l)||!c(l)&&r(l)?s[i.slotIndex]=J(l,t,n):c(l)?s[i.slotIndex]=W(l,l.props,Y(l,t)):s[i.slotIndex]=t,Q(e,i.parent,W(i.parent,a,s))}function Z(e,t,n){if(!c(e))return t;if(c(t)&&p(t)){let r=m(t);return Z(e,t.props.children,r??n)}return n!=null&&n!==``?X(e,t,n)??e:e}function Q(e,t,n){if(e===t)return n;let r=e.props,i=_(e),a=[],o=!1;for(let e of i){if(!c(e)){a.push(e);continue}if(e===t){o=!0,a.push(n);continue}let r=Q(e,t,n);r!==e&&(o=!0),a.push(r)}return o?W(e,r,a):e}function ne(e,t){let n=e.props,r=_(e),i=_(t),a=r.find(e=>c(e)&&u(e)),o=i.find(e=>c(e)&&u(e)),s=r.find(e=>c(e)&&f(e)),l=i.find(e=>c(e)&&f(e)),d=c(a)&&c(o)?L(a,o):c(a)?a:o,p=c(s)&&c(l)?$(s,l):c(s)?s:l;if(d===a&&p===s)return e;let m=[];return d!=null&&m.push(d),p!=null&&m.push(p),W(e,n,m)}function re(e,t,n){let r=e.props,i=_(e),a=i.findIndex(e=>c(e)&&f(e)),o=a>=0?i[a]:void 0,s=c(o)?Z(o,t.children,n):Z(e,t.children,n);if(s===o||s===e)return e;if(c(o)&&a>=0){let t=[...i];return t[a]=s,W(e,r,t)}return W(e,r,s)}function ie(e,t){let n=e.props,r=t.props,i=S(r.children);if(i.length===1&&c(i[0])&&p(i[0])){let t=i[0];return Z(e,t.props.children,m(t))}let a=U(n.children,r.children);return a===r.children?t:C(t)?W(e,n,a):W(t,r,a)}function $(e,t){if(e==null)return B(t);if(t==null)return e;if(!c(e)||!c(t))return t;if(p(t)){let n=t.props,r=m(t);return d(e)?re(e,n,r):Z(e,n.children,r)}return d(e)&&d(t)&&C(t)?ne(e,t):u(e)||u(t)?t:g(e,t)||e.type===t.type?ie(e,t):t}export{p as isLayoutReuseMarker,m as layoutPathOf,$ as mergeFlightRefresh,ee as setChildrenAtLayoutPath,E as unwrapFulfilledFlightNode};
@@ -1 +1 @@
1
- import{v as e}from"../type-guards-BJXKlA6x.mjs";import{a as t,i as n,n as r,r as i,t as a}from"../rari-global-5vGzhToD.mjs";import{n as o,r as s}from"../get-client-component-s7qprTUa.mjs";if(n().isDevelopment=process.env.NODE_ENV!==`production`,i(),a(),r(),typeof window<`u`&&(o(),Reflect.set(globalThis,`__rari_rsc_require__`,s)),typeof window<`u`){let e=t();e.streaming??={bufferedRows:[]}}if(import.meta.hot){function t(e){if(!e)return!1;try{return n().serverComponents?.has(e)===!0}catch{return!1}}let r=!1,i=[],a=/* @__PURE__ */ new Map;function o(e,t,n){a.set(e,async e=>{n(e)&&await t(e)}),import.meta.hot.on(e,t=>{(async()=>{if(!r){i.push({event:e,data:t});return}try{let n=a.get(e);n&&await n(t)}catch(t){console.error(`[rari] HMR: Error in handler for '${e}':`,t)}})()})}function s(t){return e(t)&&typeof t.filePath==`string`&&t.filePath!==``}function c(t){return e(t)&&Array.isArray(t.serverComponents)}function l(t){return e(t)&&typeof t.path==`string`&&t.path!==``}function u(t){return e(t)}function d(t){return e(t)&&typeof t.filePath==`string`&&t.filePath!==``}function f(t){return e(t)&&typeof t.filePath==`string`&&t.filePath!==``}o(`rari:register-server-component`,e=>{let t=n();t.serverComponents??=/* @__PURE__ */ new Set,t.serverComponents.add(e.filePath)},s),o(`rari:server-components-registry`,e=>{let t=n();t.serverComponents??=/* @__PURE__ */ new Set;for(let n of e.serverComponents)t.serverComponents.add(n)},c),o(`vite:beforeFullReload`,e=>{t(e.path)&&window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{filePath:e.path}}))},l),o(`rari:server-component-updated`,e=>{let n=e.id!=null&&e.id!==``?e.id:e.componentId,r=e.t!=null&&e.t!==0?e.t:e.timestamp;n!=null&&n!==``?window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{componentId:n,filePath:e.filePath!=null&&e.filePath!==``?e.filePath:e.file,type:`server-component`,timestamp:r}})):e.path!=null&&e.path!==``&&t(e.path)&&window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{filePath:e.path}}))},u);function p(e){if(e.title!=null&&e.title!==``&&(document.title=e.title),e.description==null||e.description===``)return;let t=document.querySelector(`meta[name="description"]`);t||(t=document.createElement(`meta`),t.setAttribute(`name`,`description`),document.head.appendChild(t)),t.setAttribute(`content`,e.description)}function m(t){let n=e(t)&&t.success===!0,r=e(t)&&t.reloaded===!0,i=e(t)&&t.content_unchanged===!0,a=e(t)&&typeof t.error==`string`?t.error:`Component reload unsuccessful`;return{ok:n||r,contentUnchanged:i,errorMessage:a}}async function h(e){if(e.routePath!=null&&e.routePath!==``||e.affectedRoutes!=null&&e.affectedRoutes.length!==0)try{let t=await fetch(`/_rari/hmr`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`register`,file_path:e.filePath})});if(!t.ok)throw Error(`Component reload failed: ${t.status}`);let n=m(await t.json());if(!n.ok)throw Error(n.errorMessage);if(n.contentUnchanged)return;await fetch(`/_rari/hmr`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`invalidate`,componentId:e.routePath!=null&&e.routePath!==``?e.routePath:e.filePath,filePath:e.filePath})}),e.metadataChanged&&e.metadata&&p(e.metadata),window.dispatchEvent(new CustomEvent(`rari:app-router-rerender`,{detail:{routePath:e.routePath,affectedRoutes:e.affectedRoutes??(e.routePath==null?[]:[e.routePath]),currentPath:window.location.pathname,preserveParams:!0}}))}catch(e){console.error(`[rari] HMR: App router update failed:`,e)}}o(`rari:app-router-updated`,h,d),o(`rari:server-action-updated`,e=>{window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{filePath:e.filePath,type:`server-action`}}))},f),i.length>0?(async()=>{try{let e=[...i];i.length=0;for(let{event:t,data:n}of e){let e=a.get(t);e&&await e(n)}}catch(e){console.error(`[rari] HMR: Error during event replay:`,e)}finally{r=!0}})():r=!0}export{};
1
+ import{g as e}from"../type-guards-BLY2PlGR.mjs";import{a as t,i as n,n as r,r as i,t as a}from"../rari-global-5vGzhToD.mjs";import{n as o,r as s}from"../get-client-component-D2K213pV.mjs";if(n().isDevelopment=process.env.NODE_ENV!==`production`,i(),a(),r(),typeof window<`u`&&(o(),Reflect.set(globalThis,`__rari_rsc_require__`,s)),typeof window<`u`){let e=t();e.streaming??={bufferedRows:[]}}if(import.meta.hot){function t(e){if(!e)return!1;try{return n().serverComponents?.has(e)===!0}catch{return!1}}let r=!1,i=[],a=/* @__PURE__ */ new Map;function o(e,t,n){a.set(e,async e=>{n(e)&&await t(e)}),import.meta.hot.on(e,t=>{(async()=>{if(!r){i.push({event:e,data:t});return}try{let n=a.get(e);n&&await n(t)}catch(t){console.error(`[rari] HMR: Error in handler for '${e}':`,t)}})()})}function s(t){return e(t)&&typeof t.filePath==`string`&&t.filePath!==``}function c(t){return e(t)&&Array.isArray(t.serverComponents)}function l(t){return e(t)&&typeof t.path==`string`&&t.path!==``}function u(t){return e(t)}function d(t){return e(t)&&typeof t.filePath==`string`&&t.filePath!==``}function f(t){return e(t)&&typeof t.filePath==`string`&&t.filePath!==``}o(`rari:register-server-component`,e=>{let t=n();t.serverComponents??=/* @__PURE__ */ new Set,t.serverComponents.add(e.filePath)},s),o(`rari:server-components-registry`,e=>{let t=n();t.serverComponents??=/* @__PURE__ */ new Set;for(let n of e.serverComponents)t.serverComponents.add(n)},c),o(`vite:beforeFullReload`,e=>{t(e.path)&&window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{filePath:e.path}}))},l),o(`rari:server-component-updated`,e=>{let n=e.id!=null&&e.id!==``?e.id:e.componentId,r=e.t!=null&&e.t!==0?e.t:e.timestamp;n!=null&&n!==``?window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{componentId:n,filePath:e.filePath!=null&&e.filePath!==``?e.filePath:e.file,type:`server-component`,timestamp:r}})):e.path!=null&&e.path!==``&&t(e.path)&&window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{filePath:e.path}}))},u);function p(e){if(e.title!=null&&e.title!==``&&(document.title=e.title),e.description==null||e.description===``)return;let t=document.querySelector(`meta[name="description"]`);t||(t=document.createElement(`meta`),t.setAttribute(`name`,`description`),document.head.appendChild(t)),t.setAttribute(`content`,e.description)}function m(t){let n=e(t)&&t.success===!0,r=e(t)&&t.reloaded===!0,i=e(t)&&t.content_unchanged===!0,a=e(t)&&typeof t.error==`string`?t.error:`Component reload unsuccessful`;return{ok:n||r,contentUnchanged:i,errorMessage:a}}async function h(e){if(e.routePath!=null&&e.routePath!==``||e.affectedRoutes!=null&&e.affectedRoutes.length!==0)try{let t=await fetch(`/_rari/hmr`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`register`,file_path:e.filePath})});if(!t.ok)throw Error(`Component reload failed: ${t.status}`);let n=m(await t.json());if(!n.ok)throw Error(n.errorMessage);if(n.contentUnchanged)return;await fetch(`/_rari/hmr`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`invalidate`,componentId:e.routePath!=null&&e.routePath!==``?e.routePath:e.filePath,filePath:e.filePath})}),e.metadataChanged&&e.metadata&&p(e.metadata),window.dispatchEvent(new CustomEvent(`rari:app-router-rerender`,{detail:{routePath:e.routePath,affectedRoutes:e.affectedRoutes??(e.routePath==null?[]:[e.routePath]),currentPath:window.location.pathname,preserveParams:!0}}))}catch(e){console.error(`[rari] HMR: App router update failed:`,e)}}o(`rari:app-router-updated`,h,d),o(`rari:server-action-updated`,e=>{window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{filePath:e.filePath,type:`server-action`}}))},f),i.length>0?(async()=>{try{let e=[...i];i.length=0;for(let{event:t,data:n}of e){let e=a.get(t);e&&await e(n)}}catch(e){console.error(`[rari] HMR: Error during event replay:`,e)}finally{r=!0}})():r=!0}export{};
@@ -1,4 +1,4 @@
1
- import{v as e}from"./type-guards-BJXKlA6x.mjs";import{t}from"./xml-DPsk9WTz.mjs";import{i as n,n as r,t as i}from"./execute-CbhDMAQ3.mjs";import{promises as a}from"node:fs";import o from"node:path";const s=/[^\w-]/g;function c(e){return(typeof e==`string`?new Date(e):e).toISOString()}function l(e){return[` <image:image>`,` <image:loc>${t(e)}</image:loc>`,` </image:image>`].join(`
1
+ import{g as e}from"./type-guards-BLY2PlGR.mjs";import{t}from"./xml-DPsk9WTz.mjs";import{i as n,n as r,t as i}from"./execute-DJ7w3uhW.mjs";import{promises as a}from"node:fs";import o from"node:path";const s=/[^\w-]/g;function c(e){return(typeof e==`string`?new Date(e):e).toISOString()}function l(e){return[` <image:image>`,` <image:loc>${t(e)}</image:loc>`,` </image:image>`].join(`
2
2
  `)}function u(e){let n=[` <image:image>`,` <image:loc>${t(e.loc)}</image:loc>`];return e.title!=null&&e.title!==``&&n.push(` <image:title>${t(e.title)}</image:title>`),e.caption!=null&&e.caption!==``&&n.push(` <image:caption>${t(e.caption)}</image:caption>`),e.geoLocation!=null&&e.geoLocation!==``&&n.push(` <image:geo_location>${t(e.geoLocation)}</image:geo_location>`),e.license!=null&&e.license!==``&&n.push(` <image:license>${t(e.license)}</image:license>`),n.push(` </image:image>`),n.join(`
3
3
  `)}function d(e){let t=[];for(let n of e)typeof n==`string`?t.push(l(n)):t.push(u(n));return t.join(`
4
4
  `)}function f(e){return[` <video:video>`,` <video:title>${t(e.title)}</video:title>`,` <video:thumbnail_loc>${t(e.thumbnail_loc)}</video:thumbnail_loc>`,` <video:description>${t(e.description)}</video:description>`,...p(e),...m(e),...h(e),...g(e),` </video:video>`].join(`
@@ -1,3 +1,4 @@
1
+ import { CSSProperties, SyntheticEvent } from "react";
1
2
  //#region src/image/image.d.ts
2
3
  interface ImageProps {
3
4
  readonly src: string | StaticImageData;
@@ -11,10 +12,10 @@ interface ImageProps {
11
12
  readonly blurDataURL?: string;
12
13
  readonly fill?: boolean;
13
14
  readonly sizes?: string;
14
- readonly style?: React.CSSProperties;
15
+ readonly style?: CSSProperties;
15
16
  readonly className?: string;
16
- readonly onLoad?: (event: React.SyntheticEvent<HTMLImageElement>) => void;
17
- readonly onError?: (event: React.SyntheticEvent<HTMLImageElement>) => void;
17
+ readonly onLoad?: (event: SyntheticEvent<HTMLImageElement>) => void;
18
+ readonly onError?: (event: SyntheticEvent<HTMLImageElement>) => void;
18
19
  readonly unoptimized?: boolean;
19
20
  readonly loader?: (props: Readonly<{
20
21
  src: string;
@@ -0,0 +1 @@
1
+ function e(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function t(t){return e(t)&&typeof t.then==`function`}function n(e){return r(e)&&`code`in e}function r(e){return typeof Error.isError==`function`?Error.isError(e):e instanceof Error}function i(t){return e(t)&&t.name===`AbortError`}function a(e){return r(e)?e:void 0}function o(e){return a(e)??Error(String(e))}function s(e,t=`Unknown error`){return r(e)?e.message:typeof e==`string`?e:t}function c(e){return typeof e==`function`}function l(t){try{let n=JSON.parse(t);return e(n)?n:null}catch{return null}}function u(e){let t=e.packageManager;return typeof t==`string`?t.startsWith(`pnpm`)?`pnpm`:t.startsWith(`yarn`)?`yarn`:t.startsWith(`bun`)?`bun`:t.startsWith(`npm`)?`npm`:null:null}function d(t){let n=e(t.dependencies)?t.dependencies:{},r=e(t.devDependencies)?t.devDependencies:{},i={...n,...r};return typeof i[`vite-plus`]==`string`?`vp`:typeof i.vite==`string`?`vite`:null}function f(e,t){if(!(e instanceof CustomEvent))return;let n=e.detail;if(t(n))return n}function p(e){return n(e)?e.code:void 0}function m(t,n){let r=l(t);if(!r)return null;let i=r[n];return Array.isArray(i)?i.filter(e):null}function h(t){return Array.isArray(t)?t.every(t=>{if(!e(t))return!1;let{find:n,replacement:r}=t;return(typeof n==`string`||n instanceof RegExp)&&typeof r==`string`}):!1}function g(t){return typeof t==`function`||e(t)&&(`$$typeof`in t||`render`in t)}function _(e){return Array.isArray(e)&&typeof e[0]==`string`}function v(t){return e(t)&&t.$$typeof===Symbol.for(`react.client.reference`)}function y(t){return e(t)&&typeof t.$$id==`string`}function b(e){return Object.entries(e).flatMap(([e,t])=>typeof t==`string`?[{find:e,replacement:t}]:[])}function x(t){return e(t)&&typeof t.route==`string`&&typeof t.navigationId==`number`&&typeof t.timestamp==`number`&&typeof t.key==`string`}function S(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function C(t){return Array.isArray(t)?t.every(t=>e(t)?Object.values(t).every(e=>typeof e==`string`||S(e)):!1):!1}function w(e){console.warn(`[rari] generateStaticParams() in ${e} returned invalid params. Expected Array<Record<string, string | string[]>> (e.g. [{ slug: "post" }]). Static routes for this page will not be generated.`)}export{w as C,o as S,C as _,p as a,u as b,h as c,r as d,_ as f,e as g,x as h,f as i,v as l,c as m,a as n,y as o,t as p,s as r,i as s,b as t,g as u,m as v,d as x,l as y};
@@ -1,12 +1,9 @@
1
1
  /// <reference types="vite-plus/client" />
2
- import { ReactNode } from "react";
2
+ import { ReactNode as ReactNode$1 } from "react";
3
3
  //#region src/ambient.d.ts
4
4
  declare module 'virtual:react-flight-client' {
5
- export interface Thenable<T> extends Promise<T> {
6
- readonly status?: 'pending' | 'fulfilled' | 'rejected';
7
- readonly value?: T;
8
- readonly reason?: unknown;
9
- }
5
+ import type { ReactPromise } from 'react';
6
+ export type Thenable<T> = ReactPromise<T> & Promise<T>;
10
7
  export function createServerReference<A extends unknown[] = unknown[], R = unknown>(id: string, callServer?: (id: string, args: A) => Promise<R>, encodeFormAction?: (args: A) => Promise<FormData | string>, findSourceMapURL?: (filename: string, environmentName: string) => string | null, functionName?: string): unknown;
11
8
  export function createFromReadableStream<T>(stream: ReadableStream<Uint8Array>, options?: Readonly<{
12
9
  readonly callServer?: (id: string, args: readonly unknown[]) => Promise<unknown>;
@@ -26,25 +23,24 @@ declare module 'virtual:react-flight-client' {
26
23
  }>): Promise<FormData | string>;
27
24
  }
28
25
  declare module 'virtual:client-router' {
29
- import type * as React from 'react';
26
+ import type { ReactNode } from 'react';
30
27
  export interface ClientRouterProps {
31
- readonly children: React.ReactNode;
28
+ readonly children: ReactNode;
32
29
  readonly initialRoute: string;
33
30
  }
34
- export function ClientRouter(props: ClientRouterProps): React.ReactNode;
31
+ export function ClientRouter(props: ClientRouterProps): ReactNode;
35
32
  }
36
33
  declare module 'virtual:app-router-provider' {
37
- import type * as React from 'react';
34
+ import type { ReactNode } from 'react';
38
35
  export interface AppRouterProviderProps {
39
- readonly children?: React.ReactNode;
36
+ readonly children?: ReactNode;
40
37
  readonly initialPayload?: {
41
38
  readonly element: unknown;
42
- readonly rawElement?: unknown;
43
39
  readonly flightProtocol?: string;
44
40
  };
45
41
  readonly onNavigate?: (detail: Readonly<Record<string, unknown>>) => void;
46
42
  }
47
- export function AppRouterProvider(props: AppRouterProviderProps): React.ReactNode;
43
+ export function AppRouterProvider(props: AppRouterProviderProps): ReactNode;
48
44
  }
49
45
  declare module 'react-server-dom-webpack/client' {
50
46
  export type { Thenable } from 'virtual:react-flight-client';
@@ -318,7 +314,7 @@ interface PageProps<TParams extends RouteParams = RouteParams, TSearchParams ext
318
314
  readonly searchParams: TSearchParams;
319
315
  }
320
316
  interface LayoutProps<TParams extends RouteParams = RouteParams> {
321
- readonly children: ReactNode;
317
+ readonly children: ReactNode$1;
322
318
  readonly params?: TParams;
323
319
  readonly pathname?: string;
324
320
  }
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as RouteSegmentType, D as RouteContext, E as ApiRouteHandlers, O as RouteHandler, S as RouteSegment, T as ApiResponse, _ as LayoutProps, a as Sitemap, b as NotFoundEntry, c as SitemapVideo, d as AppRouteMatch, f as ErrorEntry, g as LayoutEntry, h as GenerateStaticParams, i as RobotsRule, l as AppRouteEntry, m as GenerateMetadata, o as SitemapEntry, p as ErrorProps, r as Robots, s as SitemapImage, u as AppRouteManifest, v as LoadingEntry, w as TemplateEntry, x as PageProps, y as Metadata } from "./types-CkJ_86mo.mjs";
1
+ import { C as RouteSegmentType, D as RouteContext, E as ApiRouteHandlers, O as RouteHandler, S as RouteSegment, T as ApiResponse, _ as LayoutProps, a as Sitemap, b as NotFoundEntry, c as SitemapVideo, d as AppRouteMatch, f as ErrorEntry, g as LayoutEntry, h as GenerateStaticParams, i as RobotsRule, l as AppRouteEntry, m as GenerateMetadata, o as SitemapEntry, p as ErrorProps, r as Robots, s as SitemapImage, u as AppRouteManifest, v as LoadingEntry, w as TemplateEntry, x as PageProps, y as Metadata } from "./types-Cp7dbLe7.mjs";
2
2
  import { a as ProxyModule, c as RariURL, i as ProxyMatcher, l as RequestCookies, n as ProxyConfig, o as ProxyResult, r as ProxyFunction, s as RariFetchEvent, t as CookieOptions, u as ResponseCookies } from "./types-DAdRjhuk.mjs";
3
3
  import { UserConfig } from "vite-plus";
4
4
  import { ReactCompilerOptions as ReactCompilerOptions$1 } from "oxc-transform-react";