@uniweb/runtime 0.6.14 → 0.6.15

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 (35) hide show
  1. package/dist/app/_importmap/@uniweb-core.js +2 -0
  2. package/dist/app/_importmap/@uniweb-core.js.map +1 -0
  3. package/dist/app/_importmap/react-dom.js +2 -0
  4. package/dist/app/_importmap/react-dom.js.map +1 -0
  5. package/dist/app/_importmap/react-jsx-dev-runtime.js +2 -0
  6. package/dist/app/_importmap/react-jsx-dev-runtime.js.map +1 -0
  7. package/dist/app/_importmap/react-jsx-runtime.js +2 -0
  8. package/dist/app/_importmap/react-jsx-runtime.js.map +1 -0
  9. package/dist/app/_importmap/react.js +2 -0
  10. package/dist/app/_importmap/react.js.map +1 -0
  11. package/dist/app/assets/_commonjsHelpers-CqkleIqs.js +2 -0
  12. package/dist/app/assets/_commonjsHelpers-CqkleIqs.js.map +1 -0
  13. package/dist/app/assets/_importmap_react-dWoQamCw.js +2 -0
  14. package/dist/app/assets/_importmap_react-dWoQamCw.js.map +1 -0
  15. package/dist/app/assets/index-C0udIITE.js +9 -0
  16. package/dist/app/assets/index-C0udIITE.js.map +1 -0
  17. package/dist/app/assets/index-C6TPxGbh.js +133 -0
  18. package/dist/app/assets/index-C6TPxGbh.js.map +1 -0
  19. package/dist/app/assets/index-CsyMBO9p.js +8 -0
  20. package/dist/app/assets/index-CsyMBO9p.js.map +1 -0
  21. package/dist/app/assets/index-kA4PVysc.js +2 -0
  22. package/dist/app/assets/index-kA4PVysc.js.map +1 -0
  23. package/dist/app/assets/jsx-runtime-C3x2e0aW.js +2 -0
  24. package/dist/app/assets/jsx-runtime-C3x2e0aW.js.map +1 -0
  25. package/dist/app/index.html +31 -0
  26. package/dist/app/manifest.json +19 -0
  27. package/dist/ssr.js +7 -6
  28. package/dist/ssr.js.map +1 -1
  29. package/package.json +7 -4
  30. package/src/components/PageRenderer.jsx +12 -9
  31. package/src/foundation-loader.js +3 -0
  32. package/src/index.jsx +3 -4
  33. package/src/shell/index.html +12 -0
  34. package/src/shell/main.js +16 -0
  35. package/src/ssr-renderer.js +15 -9
@@ -0,0 +1,8 @@
1
+ import{j as p}from"./jsx-runtime-C3x2e0aW.js";import{r as u,R as V}from"./_importmap_react-dWoQamCw.js";import{r as et}from"./index-C0udIITE.js";import{a as tt,n as nt,c as rt}from"./index-C6TPxGbh.js";import"./_commonjsHelpers-CqkleIqs.js";import"./index-kA4PVysc.js";function ot(e){if(!e)return!1;const{colors:t,foundationStyles:n}=e;if(n&&Object.keys(n).length>0)return!0;if(!t)return!1;const r=t.colors?.light&&Object.keys(t.colors.light).length>0,o=t.elements&&Object.values(t.elements).some(a=>a&&Object.keys(a).length>0);return r||o}function at(e){if(!e||Object.keys(e).length===0)return[];const t=[],n=tt(e);for(const[r,o]of Object.entries(n))for(const[a,i]of Object.entries(o))t.push(` --${r}-${a}: ${i};`);return t}function ne(e){if(!e||Object.keys(e).length===0)return[];const t=[];for(const[n,r]of Object.entries(e))r===""||r==null||t.push(` --${n}: ${nt(r)};`);return t}function W(e){if(!e||Object.keys(e).length===0)return[];const t=[];for(const[n,r]of Object.entries(e))r===""||r==null||typeof r=="object"||t.push(` --foundation-${n}: ${r};`);return t}function it(e){if(!e||Object.keys(e).length===0)return{flat:{},contexts:{}};const t={},n={};for(const[r,o]of Object.entries(e))if(o!=null)if(typeof o=="object")for(const[a,i]of Object.entries(o))i===""||i==null||(n[a]||(n[a]={}),n[a][r]=i);else t[r]=o;return{flat:t,contexts:n}}function q(e,t){return t.length===0?"":`${e} {
2
+ ${t.join(`
3
+ `)}
4
+ }
5
+ `}function st(e,t={}){if(!e||e.length===0)return"";let n="";for(const r of e){const o=ot(r.standardOptions),a=r.componentVars&&Object.keys(r.componentVars).length>0;if(!o&&!a)continue;const{colors:i,foundationStyles:s}=r.standardOptions||{},c=`#section-${r.stableId||r.id}`,f=!r.themeName,d=t.allowToggle,h=at(i?.colors?.light),{flat:m,contexts:b}=it(s),v=W(m),y=W(r.componentVars);if(f&&d){const w=ne(i?.elements?.light),g=ne(i?.elements?.dark),x=W(b.light),C=W(b.dark),R=[...h,...v,...y];n+=q(c,R),n+=q(`:root:not(.scheme-dark) ${c}`,[...w,...x]),n+=q(`.scheme-dark ${c}`,[...g,...C])}else{const w=d&&r.themeName||"light",g=ne(i?.elements?.[w]),x=W(b[w]),C=[...h,...g,...v,...y,...x];n+=q(c,C)}}return n}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();var J={},be;function lt(){if(be)return J;be=1;var e=et();return J.createRoot=e.createRoot,J.hydrateRoot=e.hydrateRoot,J}var we=lt();var xe="popstate";function ut(e={}){function t(r,o){let{pathname:a,search:i,hash:s}=r.location;return se("",{pathname:a,search:i,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:U(o)}return dt(t,n,null,e)}function E(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function L(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ct(){return Math.random().toString(36).substring(2,10)}function Ee(e,t){return{usr:e.state,key:e.key,idx:t}}function se(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?A(t):t,state:n,key:t&&t.key||r||ct()}}function U({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function A(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function dt(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:a=!1}=r,i=o.history,s="POP",l=null,c=f();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function f(){return(i.state||{idx:null}).idx}function d(){s="POP";let y=f(),w=y==null?null:y-c;c=y,l&&l({action:s,location:v.location,delta:w})}function h(y,w){s="PUSH";let g=se(v.location,y,w);c=f()+1;let x=Ee(g,c),C=v.createHref(g);try{i.pushState(x,"",C)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;o.location.assign(C)}a&&l&&l({action:s,location:v.location,delta:1})}function m(y,w){s="REPLACE";let g=se(v.location,y,w);c=f();let x=Ee(g,c),C=v.createHref(g);i.replaceState(x,"",C),a&&l&&l({action:s,location:v.location,delta:0})}function b(y){return ft(y)}let v={get action(){return s},get location(){return e(o,i)},listen(y){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(xe,d),l=y,()=>{o.removeEventListener(xe,d),l=null}},createHref(y){return t(o,y)},createURL:b,encodeLocation(y){let w=b(y);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:h,replace:m,go(y){return i.go(y)}};return v}function ft(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),E(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:U(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function je(e,t,n="/"){return ht(e,t,n,!1)}function ht(e,t,n,r){let o=typeof t=="string"?A(t):t,a=T(o.pathname||"/",n);if(a==null)return null;let i=Oe(e);pt(i);let s=null;for(let l=0;s==null&&l<i.length;++l){let c=kt(a);s=Rt(i[l],c,r)}return s}function Oe(e,t=[],n=[],r="",o=!1){let a=(i,s,l=o,c)=>{let f={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&l)return;E(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let d=N([r,f.relativePath]),h=n.concat(f);i.children&&i.children.length>0&&(E(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Oe(i.children,t,h,d,l)),!(i.path==null&&!i.index)&&t.push({path:d,score:xt(d,i.index),routesMeta:h})};return e.forEach((i,s)=>{if(i.path===""||!i.path?.includes("?"))a(i,s);else for(let l of Ne(i.path))a(i,s,!0,l)}),t}function Ne(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return o?[a,""]:[a];let i=Ne(r.join("/")),s=[];return s.push(...i.map(l=>l===""?a:[a,l].join("/"))),o&&s.push(...i),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function pt(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Et(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var mt=/^:[\w-]+$/,gt=3,yt=2,vt=1,bt=10,wt=-2,Re=e=>e==="*";function xt(e,t){let n=e.split("/"),r=n.length;return n.some(Re)&&(r+=wt),t&&(r+=yt),n.filter(o=>!Re(o)).reduce((o,a)=>o+(mt.test(a)?gt:a===""?vt:bt),r)}function Et(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Rt(e,t,n=!1){let{routesMeta:r}=e,o={},a="/",i=[];for(let s=0;s<r.length;++s){let l=r[s],c=s===r.length-1,f=a==="/"?t:t.slice(a.length)||"/",d=Z({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},f),h=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Z({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},f)),!d)return null;Object.assign(o,d.params),i.push({params:o,pathname:N([a,d.pathname]),pathnameBase:Lt(N([a,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(a=N([a,d.pathnameBase]))}return i}function Z(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ct(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:r.reduce((c,{paramName:f,isOptional:d},h)=>{if(f==="*"){let b=s[h]||"";i=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const m=s[h];return d&&!m?c[f]=void 0:c[f]=(m||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:i,pattern:e}}function Ct(e,t=!1,n=!0){L(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function kt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return L(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function T(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var Te=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,St=e=>Te.test(e);function Pt(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?A(e):e,a;if(n)if(St(n))a=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),L(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?a=Ce(n.substring(1),"/"):a=Ce(n,t)}else a=t;return{pathname:a,search:jt(r),hash:Ot(o)}}function Ce(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function re(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function $t(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ie(e){let t=$t(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Fe(e,t,n,r=!1){let o;typeof e=="string"?o=A(e):(o={...e},E(!o.pathname||!o.pathname.includes("?"),re("?","pathname","search",o)),E(!o.pathname||!o.pathname.includes("#"),re("#","pathname","hash",o)),E(!o.search||!o.search.includes("#"),re("#","search","hash",o)));let a=e===""||o.pathname==="",i=a?"/":o.pathname,s;if(i==null)s=n;else{let d=t.length-1;if(!r&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),d-=1;o.pathname=h.join("/")}s=d>=0?t[d]:"/"}let l=Pt(o,s),c=i&&i!=="/"&&i.endsWith("/"),f=(a||i===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}var N=e=>e.join("/").replace(/\/\/+/g,"/"),Lt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),jt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ot=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Nt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Tt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function It(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ae=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function De(e,t){let n=e;if(typeof n!="string"||!Te.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,o=!1;if(Ae)try{let a=new URL(window.location.href),i=n.startsWith("//")?new URL(a.protocol+n):new URL(n),s=T(i.pathname,t);i.origin===a.origin&&s!=null?n=s+i.search+i.hash:o=!0}catch{L(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Be=["POST","PUT","PATCH","DELETE"];new Set(Be);var Ft=["GET",...Be];new Set(Ft);var D=u.createContext(null);D.displayName="DataRouter";var ee=u.createContext(null);ee.displayName="DataRouterState";var At=u.createContext(!1),Me=u.createContext({isTransitioning:!1});Me.displayName="ViewTransition";var Dt=u.createContext(new Map);Dt.displayName="Fetchers";var Bt=u.createContext(null);Bt.displayName="Await";var $=u.createContext(null);$.displayName="Navigation";var B=u.createContext(null);B.displayName="Location";var O=u.createContext({outlet:null,matches:[],isDataRoute:!1});O.displayName="Route";var fe=u.createContext(null);fe.displayName="RouteError";var We="REACT_ROUTER_ERROR",Mt="REDIRECT",Wt="ROUTE_ERROR_RESPONSE";function _t(e){if(e.startsWith(`${We}:${Mt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Ut(e){if(e.startsWith(`${We}:${Wt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Nt(t.status,t.statusText,t.data)}catch{}}function Vt(e,{relative:t}={}){E(H(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=u.useContext($),{hash:o,pathname:a,search:i}=z(e,{relative:t}),s=a;return n!=="/"&&(s=a==="/"?n:N([n,a])),r.createHref({pathname:s,search:i,hash:o})}function H(){return u.useContext(B)!=null}function j(){return E(H(),"useLocation() may be used only in the context of a <Router> component."),u.useContext(B).location}function Ht(){return u.useContext(B).navigationType}var _e="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ue(e){u.useContext($).static||u.useLayoutEffect(e)}function he(){let{isDataRoute:e}=u.useContext(O);return e?on():zt()}function zt(){E(H(),"useNavigate() may be used only in the context of a <Router> component.");let e=u.useContext(D),{basename:t,navigator:n}=u.useContext($),{matches:r}=u.useContext(O),{pathname:o}=j(),a=JSON.stringify(Ie(r)),i=u.useRef(!1);return Ue(()=>{i.current=!0}),u.useCallback((l,c={})=>{if(L(i.current,_e),!i.current)return;if(typeof l=="number"){n.go(l);return}let f=Fe(l,JSON.parse(a),o,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:N([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,a,o,e])}u.createContext(null);function qt(){let{matches:e}=u.useContext(O),t=e[e.length-1];return t?t.params:{}}function z(e,{relative:t}={}){let{matches:n}=u.useContext(O),{pathname:r}=j(),o=JSON.stringify(Ie(n));return u.useMemo(()=>Fe(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function Jt(e,t){return Ve(e,t)}function Ve(e,t,n,r,o){E(H(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=u.useContext($),{matches:i}=u.useContext(O),s=i[i.length-1],l=s?s.params:{},c=s?s.pathname:"/",f=s?s.pathnameBase:"/",d=s&&s.route;{let g=d&&d.path||"";ze(c,!d||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
6
+
7
+ Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let h=j(),m;if(t){let g=typeof t=="string"?A(t):t;E(f==="/"||g.pathname?.startsWith(f),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${g.pathname}" was given in the \`location\` prop.`),m=g}else m=h;let b=m.pathname||"/",v=b;if(f!=="/"){let g=f.replace(/^\//,"").split("/");v="/"+b.replace(/^\//,"").split("/").slice(g.length).join("/")}let y=je(e,{pathname:v});L(d||y!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),L(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=Zt(y&&y.map(g=>Object.assign({},g,{params:Object.assign({},l,g.params),pathname:N([f,a.encodeLocation?a.encodeLocation(g.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?f:N([f,a.encodeLocation?a.encodeLocation(g.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),i,n,r,o);return t&&w?u.createElement(B.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...m},navigationType:"POP"}},w):w}function Gt(){let e=rn(),t=Tt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=u.createElement(u.Fragment,null,u.createElement("p",null,"💿 Hey developer 👋"),u.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",u.createElement("code",{style:a},"ErrorBoundary")," or"," ",u.createElement("code",{style:a},"errorElement")," prop on your route.")),u.createElement(u.Fragment,null,u.createElement("h2",null,"Unexpected Application Error!"),u.createElement("h3",{style:{fontStyle:"italic"}},t),n?u.createElement("pre",{style:o},n):null,i)}var Kt=u.createElement(Gt,null),He=class extends u.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Ut(e.digest);n&&(e=n)}let t=e!==void 0?u.createElement(O.Provider,{value:this.props.routeContext},u.createElement(fe.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?u.createElement(Yt,{error:e},t):t}};He.contextType=At;var oe=new WeakMap;function Yt({children:e,error:t}){let{basename:n}=u.useContext($);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=_t(t.digest);if(r){let o=oe.get(t);if(o)throw o;let a=De(r.location,n);if(Ae&&!oe.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw oe.set(t,i),i}return u.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Xt({routeContext:e,match:t,children:n}){let r=u.useContext(D);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),u.createElement(O.Provider,{value:e},n)}function Zt(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=n?.errors;if(i!=null){let f=a.findIndex(d=>d.route.id&&i?.[d.route.id]!==void 0);E(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let s=!1,l=-1;if(n)for(let f=0;f<a.length;f++){let d=a[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=f),d.route.id){let{loaderData:h,errors:m}=n,b=d.route.loader&&!h.hasOwnProperty(d.route.id)&&(!m||m[d.route.id]===void 0);if(d.route.lazy||b){s=!0,l>=0?a=a.slice(0,l+1):a=[a[0]];break}}}let c=n&&r?(f,d)=>{r(f,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:It(n.matches),errorInfo:d})}:void 0;return a.reduceRight((f,d,h)=>{let m,b=!1,v=null,y=null;n&&(m=i&&d.route.id?i[d.route.id]:void 0,v=d.route.errorElement||Kt,s&&(l<0&&h===0?(ze("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,y=null):l===h&&(b=!0,y=d.route.hydrateFallbackElement||null)));let w=t.concat(a.slice(0,h+1)),g=()=>{let x;return m?x=v:b?x=y:d.route.Component?x=u.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,u.createElement(Xt,{match:d,routeContext:{outlet:f,matches:w,isDataRoute:n!=null},children:x})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?u.createElement(He,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:g(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:c}):g()},null)}function pe(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qt(e){let t=u.useContext(D);return E(t,pe(e)),t}function en(e){let t=u.useContext(ee);return E(t,pe(e)),t}function tn(e){let t=u.useContext(O);return E(t,pe(e)),t}function me(e){let t=tn(e),n=t.matches[t.matches.length-1];return E(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function nn(){return me("useRouteId")}function rn(){let e=u.useContext(fe),t=en("useRouteError"),n=me("useRouteError");return e!==void 0?e:t.errors?.[n]}function on(){let{router:e}=Qt("useNavigate"),t=me("useNavigate"),n=u.useRef(!1);return Ue(()=>{n.current=!0}),u.useCallback(async(o,a={})=>{L(n.current,_e),n.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...a}))},[e,t])}var ke={};function ze(e,t,n){!t&&!ke[e]&&(ke[e]=!0,L(!1,n))}u.memo(an);function an({routes:e,future:t,state:n,onError:r}){return Ve(e,void 0,n,r,t)}function qe(e){E(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function sn({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:a=!1,unstable_useTransitions:i}){E(!H(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=u.useMemo(()=>({basename:s,navigator:o,static:a,unstable_useTransitions:i,future:{}}),[s,o,a,i]);typeof n=="string"&&(n=A(n));let{pathname:c="/",search:f="",hash:d="",state:h=null,key:m="default"}=n,b=u.useMemo(()=>{let v=T(c,s);return v==null?null:{location:{pathname:v,search:f,hash:d,state:h,key:m},navigationType:r}},[s,c,f,d,h,m,r]);return L(b!=null,`<Router basename="${s}"> is not able to match the URL "${c}${f}${d}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:u.createElement($.Provider,{value:l},u.createElement(B.Provider,{children:t,value:b}))}function ln({children:e,location:t}){return Jt(le(e),t)}function le(e,t=[]){let n=[];return u.Children.forEach(e,(r,o)=>{if(!u.isValidElement(r))return;let a=[...t,o];if(r.type===u.Fragment){n.push.apply(n,le(r.props.children,a));return}E(r.type===qe,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),E(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=le(r.props.children,a)),n.push(i)}),n}var Y="get",X="application/x-www-form-urlencoded";function te(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function un(e){return te(e)&&e.tagName.toLowerCase()==="button"}function cn(e){return te(e)&&e.tagName.toLowerCase()==="form"}function dn(e){return te(e)&&e.tagName.toLowerCase()==="input"}function fn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hn(e,t){return e.button===0&&(!t||t==="_self")&&!fn(e)}var G=null;function pn(){if(G===null)try{new FormData(document.createElement("form"),0),G=!1}catch{G=!0}return G}var mn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ae(e){return e!=null&&!mn.has(e)?(L(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${X}"`),null):e}function gn(e,t){let n,r,o,a,i;if(cn(e)){let s=e.getAttribute("action");r=s?T(s,t):null,n=e.getAttribute("method")||Y,o=ae(e.getAttribute("enctype"))||X,a=new FormData(e)}else if(un(e)||dn(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(r=l?T(l,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||Y,o=ae(e.getAttribute("formenctype"))||ae(s.getAttribute("enctype"))||X,a=new FormData(s,e),!pn()){let{name:c,type:f,value:d}=e;if(f==="image"){let h=c?`${c}.`:"";a.append(`${h}x`,"0"),a.append(`${h}y`,"0")}else c&&a.append(c,d)}}else{if(te(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Y,r=null,o=X,i=e}return a&&o==="text/plain"&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ge(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function yn(e,t,n,r){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:o.pathname==="/"?o.pathname=`_root.${r}`:t&&T(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${r}`,o}async function vn(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function bn(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function wn(e,t,n){let r=await Promise.all(e.map(async o=>{let a=t.routes[o.route.id];if(a){let i=await vn(a,n);return i.links?i.links():[]}return[]}));return Cn(r.flat(1).filter(bn).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Se(e,t,n,r,o,a){let i=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,s=(l,c)=>n[c].pathname!==l.pathname||n[c].route.path?.endsWith("*")&&n[c].params["*"]!==l.params["*"];return a==="assets"?t.filter((l,c)=>i(l,c)||s(l,c)):a==="data"?t.filter((l,c)=>{let f=r.routes[l.route.id];if(!f||!f.hasLoader)return!1;if(i(l,c)||s(l,c))return!0;if(l.route.shouldRevalidate){let d=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function xn(e,t,{includeHydrateFallback:n}={}){return En(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let a=[o.module];return o.clientActionModule&&(a=a.concat(o.clientActionModule)),o.clientLoaderModule&&(a=a.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(a=a.concat(o.hydrateFallbackModule)),o.imports&&(a=a.concat(o.imports)),a}).flat(1))}function En(e){return[...new Set(e)]}function Rn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Cn(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let a=JSON.stringify(Rn(o));return n.has(a)||(n.add(a),r.push({key:a,link:o})),r},[])}function Je(){let e=u.useContext(D);return ge(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function kn(){let e=u.useContext(ee);return ge(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ye=u.createContext(void 0);ye.displayName="FrameworkContext";function Ge(){let e=u.useContext(ye);return ge(e,"You must render this element inside a <HydratedRouter> element"),e}function Sn(e,t){let n=u.useContext(ye),[r,o]=u.useState(!1),[a,i]=u.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:c,onMouseLeave:f,onTouchStart:d}=t,h=u.useRef(null);u.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let v=w=>{w.forEach(g=>{i(g.isIntersecting)})},y=new IntersectionObserver(v,{threshold:.5});return h.current&&y.observe(h.current),()=>{y.disconnect()}}},[e]),u.useEffect(()=>{if(r){let v=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(v)}}},[r]);let m=()=>{o(!0)},b=()=>{o(!1),i(!1)};return n?e!=="intent"?[a,h,{}]:[a,h,{onFocus:_(s,m),onBlur:_(l,b),onMouseEnter:_(c,m),onMouseLeave:_(f,b),onTouchStart:_(d,m)}]:[!1,h,{}]}function _(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Pn({page:e,...t}){let{router:n}=Je(),r=u.useMemo(()=>je(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?u.createElement(Ln,{page:e,matches:r,...t}):null}function $n(e){let{manifest:t,routeModules:n}=Ge(),[r,o]=u.useState([]);return u.useEffect(()=>{let a=!1;return wn(e,t,n).then(i=>{a||o(i)}),()=>{a=!0}},[e,t,n]),r}function Ln({page:e,matches:t,...n}){let r=j(),{future:o,manifest:a,routeModules:i}=Ge(),{basename:s}=Je(),{loaderData:l,matches:c}=kn(),f=u.useMemo(()=>Se(e,t,c,a,r,"data"),[e,t,c,a,r]),d=u.useMemo(()=>Se(e,t,c,a,r,"assets"),[e,t,c,a,r]),h=u.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,y=!1;if(t.forEach(g=>{let x=a.routes[g.route.id];!x||!x.hasLoader||(!f.some(C=>C.route.id===g.route.id)&&g.route.id in l&&i[g.route.id]?.shouldRevalidate||x.hasClientLoader?y=!0:v.add(g.route.id))}),v.size===0)return[];let w=yn(e,s,o.unstable_trailingSlashAwareDataRequests,"data");return y&&v.size>0&&w.searchParams.set("_routes",t.filter(g=>v.has(g.route.id)).map(g=>g.route.id).join(",")),[w.pathname+w.search]},[s,o.unstable_trailingSlashAwareDataRequests,l,r,a,f,t,e,i]),m=u.useMemo(()=>xn(d,a),[d,a]),b=$n(d);return u.createElement(u.Fragment,null,h.map(v=>u.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),m.map(v=>u.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),b.map(({key:v,link:y})=>u.createElement("link",{key:v,nonce:n.nonce,...y})))}function jn(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var On=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{On&&(window.__reactRouterVersion="7.12.0")}catch{}function Nn({basename:e,children:t,unstable_useTransitions:n,window:r}){let o=u.useRef();o.current==null&&(o.current=ut({window:r,v5Compat:!0}));let a=o.current,[i,s]=u.useState({action:a.action,location:a.location}),l=u.useCallback(c=>{n===!1?s(c):u.startTransition(()=>s(c))},[n]);return u.useLayoutEffect(()=>a.listen(l),[a,l]),u.createElement(sn,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:a,unstable_useTransitions:n})}var Ke=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ve=u.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:a,replace:i,state:s,target:l,to:c,preventScrollReset:f,viewTransition:d,unstable_defaultShouldRevalidate:h,...m},b){let{basename:v,unstable_useTransitions:y}=u.useContext($),w=typeof c=="string"&&Ke.test(c),g=De(c,v);c=g.to;let x=Vt(c,{relative:o}),[C,R,k]=Sn(r,m),S=An(c,{replace:i,state:s,target:l,preventScrollReset:f,relative:o,viewTransition:d,unstable_defaultShouldRevalidate:h,unstable_useTransitions:y});function I(M){t&&t(M),M.defaultPrevented||S(M)}let F=u.createElement("a",{...m,...k,href:g.absoluteURL||x,onClick:g.isExternal||a?t:I,ref:jn(b,R),target:l,"data-discover":!w&&n==="render"?"true":void 0});return C&&!w?u.createElement(u.Fragment,null,F,u.createElement(Pn,{page:x})):F});ve.displayName="Link";var Tn=u.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:a,to:i,viewTransition:s,children:l,...c},f){let d=z(i,{relative:c.relative}),h=j(),m=u.useContext(ee),{navigator:b,basename:v}=u.useContext($),y=m!=null&&_n(d)&&s===!0,w=b.encodeLocation?b.encodeLocation(d).pathname:d.pathname,g=h.pathname,x=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;n||(g=g.toLowerCase(),x=x?x.toLowerCase():null,w=w.toLowerCase()),x&&v&&(x=T(x,v)||x);const C=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let R=g===w||!o&&g.startsWith(w)&&g.charAt(C)==="/",k=x!=null&&(x===w||!o&&x.startsWith(w)&&x.charAt(w.length)==="/"),S={isActive:R,isPending:k,isTransitioning:y},I=R?t:void 0,F;typeof r=="function"?F=r(S):F=[r,R?"active":null,k?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let M=typeof a=="function"?a(S):a;return u.createElement(ve,{...c,"aria-current":I,className:F,ref:f,style:M,to:i,viewTransition:s},typeof l=="function"?l(S):l)});Tn.displayName="NavLink";var In=u.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:a,method:i=Y,action:s,onSubmit:l,relative:c,preventScrollReset:f,viewTransition:d,unstable_defaultShouldRevalidate:h,...m},b)=>{let{unstable_useTransitions:v}=u.useContext($),y=Mn(),w=Wn(s,{relative:c}),g=i.toLowerCase()==="get"?"get":"post",x=typeof s=="string"&&Ke.test(s),C=R=>{if(l&&l(R),R.defaultPrevented)return;R.preventDefault();let k=R.nativeEvent.submitter,S=k?.getAttribute("formmethod")||i,I=()=>y(k||R.currentTarget,{fetcherKey:t,method:S,navigate:n,replace:o,state:a,relative:c,preventScrollReset:f,viewTransition:d,unstable_defaultShouldRevalidate:h});v&&n!==!1?u.startTransition(()=>I()):I()};return u.createElement("form",{ref:b,method:g,action:w,onSubmit:r?l:C,...m,"data-discover":!x&&e==="render"?"true":void 0})});In.displayName="Form";function Fn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ye(e){let t=u.useContext(D);return E(t,Fn(e)),t}function An(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:s,unstable_useTransitions:l}={}){let c=he(),f=j(),d=z(e,{relative:a});return u.useCallback(h=>{if(hn(h,t)){h.preventDefault();let m=n!==void 0?n:U(f)===U(d),b=()=>c(e,{replace:m,state:r,preventScrollReset:o,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:s});l?u.startTransition(()=>b()):b()}},[f,c,d,n,r,t,e,o,a,i,s,l])}var Dn=0,Bn=()=>`__${String(++Dn)}__`;function Mn(){let{router:e}=Ye("useSubmit"),{basename:t}=u.useContext($),n=nn(),r=e.fetch,o=e.navigate;return u.useCallback(async(a,i={})=>{let{action:s,method:l,encType:c,formData:f,body:d}=gn(a,t);if(i.navigate===!1){let h=i.fetcherKey||Bn();await r(h,n,i.action||s,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:f,body:d,formMethod:i.method||l,formEncType:i.encType||c,flushSync:i.flushSync})}else await o(i.action||s,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:f,body:d,formMethod:i.method||l,formEncType:i.encType||c,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[r,o,t,n])}function Wn(e,{relative:t}={}){let{basename:n}=u.useContext($),r=u.useContext(O);E(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),a={...z(e||".",{relative:t})},i=j();if(e==null){a.search=i.search;let s=new URLSearchParams(a.search),l=s.getAll("index");if(l.some(f=>f==="")){s.delete("index"),l.filter(d=>d).forEach(d=>s.append("index",d));let f=s.toString();a.search=f?`?${f}`:""}}return(!e||e===".")&&o.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:N([n,a.pathname])),U(a)}function _n(e,{relative:t}={}){let n=u.useContext(Me);E(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ye("useViewTransitionState"),o=z(e,{relative:t});if(!n.isTransitioning)return!1;let a=T(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=T(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Z(o.pathname,i)!=null||Z(o.pathname,a)!=null}function Un(e){return{title:e.title||"",pretitle:e.pretitle||"",subtitle:e.subtitle||"",paragraphs:e.paragraphs||[],links:e.links||[],images:e.images||[],lists:e.lists||[],icons:e.icons||[],videos:e.videos||[],snippets:e.snippets||[],buttons:e.buttons||[],data:e.data||{},cards:e.cards||[],documents:e.documents||[],forms:e.forms||[],quotes:e.quotes||[],headings:e.headings||[]}}function Vn(e){const t=e||{};return{title:t.title||"",pretitle:t.pretitle||"",subtitle:t.subtitle||"",alignment:t.alignment||null,paragraphs:t.paragraphs||[],links:t.links||[],images:t.images||[],lists:t.lists||[],icons:t.icons||[],videos:t.videos||[],insets:t.insets||[],snippets:t.snippets||[],buttons:t.buttons||[],data:t.data||{},cards:t.cards||[],documents:t.documents||[],forms:t.forms||[],quotes:t.quotes||[],headings:t.headings||[],items:(t.items||[]).map(Un),sequence:t.sequence||[],raw:t.raw}}function Q(e,t){if(!e||typeof e!="object"||Array.isArray(e))return e;const n={...e};for(const[r,o]of Object.entries(t)){const a=typeof o=="object"?o.default:void 0;n[r]===void 0&&a!==void 0&&(n[r]=a),typeof o=="object"&&o.options&&Array.isArray(o.options)&&n[r]!==void 0&&!o.options.includes(n[r])&&a!==void 0&&(n[r]=a),typeof o=="object"&&o.type==="object"&&o.schema&&n[r]&&(n[r]=Q(n[r],o.schema)),typeof o=="object"&&o.type==="array"&&o.of&&n[r]&&typeof o.of=="object"&&(n[r]=n[r].map(i=>Q(i,o.of)))}return n}function Hn(e,t){return Array.isArray(e)?e.map(n=>Q(n,t)):Q(e,t)}function zn(e,t){if(!t||!e||typeof e!="object")return e||{};const n={...e};for(const[r,o]of Object.entries(e)){const a=t[r];a&&(n[r]=Hn(o,a))}return n}function qn(e,t){return!t||Object.keys(t).length===0?e||{}:{...t,...e||{}}}function Jn(e,t){const n=t?.defaults||{},r=qn(e.properties,n),o=Vn(e.parsedContent),a=t?.schemas||null;return a&&o.data&&(o.data=zn(o.data,a)),{content:o,params:r}}function Gn(e){return globalThis.uniweb?.getComponentMeta?.(e)||null}const K={COLOR:"color",GRADIENT:"gradient",IMAGE:"image",VIDEO:"video"};function ue(e){if(!e||!e.startsWith("/"))return e;const t=globalThis.uniweb?.activeWebsite?.basePath||"";return!t||e.startsWith(t+"/")||e===t?e:t+e}function Kn({gradient:e,opacity:t=.5}){const{start:n="rgba(0,0,0,0.7)",end:r="rgba(0,0,0,0)",angle:o=180,startPosition:a=0,endPosition:i=100}=e,s={position:"absolute",inset:0,background:`linear-gradient(${o}deg, ${n} ${a}%, ${r} ${i}%)`,opacity:t,pointerEvents:"none"};return p.jsx("div",{className:"background-overlay background-overlay--gradient",style:s,"aria-hidden":"true"})}function Yn({type:e="dark",opacity:t=.5}){const r={position:"absolute",inset:0,backgroundColor:`rgba(${e==="light"?"255, 255, 255":"0, 0, 0"}, ${t})`,pointerEvents:"none"};return p.jsx("div",{className:"background-overlay background-overlay--solid",style:r,"aria-hidden":"true"})}function Xn({overlay:e}){return e?.enabled?e.gradient?p.jsx(Kn,{gradient:e.gradient,opacity:e.opacity}):p.jsx(Yn,{type:e.type,opacity:e.opacity}):null}function Zn({color:e}){if(!e)return null;const t={position:"absolute",inset:0,backgroundColor:e};return p.jsx("div",{className:"background-color",style:t,"aria-hidden":"true"})}function Qn({gradient:e}){if(!e)return null;if(typeof e=="string"){const d={position:"absolute",inset:0,background:e};return p.jsx("div",{className:"background-gradient",style:d,"aria-hidden":"true"})}const{start:t="transparent",end:n="transparent",angle:r=0,startPosition:o=0,endPosition:a=100,startOpacity:i=1,endOpacity:s=1}=e,l=i<1?Pe(t,i):t,c=s<1?Pe(n,s):n,f={position:"absolute",inset:0,background:`linear-gradient(${r}deg, ${l} ${o}%, ${c} ${a}%)`};return p.jsx("div",{className:"background-gradient",style:f,"aria-hidden":"true"})}function Pe(e,t){if(e.startsWith("#")){const n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),o=parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${o}, ${t})`}if(e.startsWith("rgb")){const n=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(n)return`rgba(${n[1]}, ${n[2]}, ${n[3]}, ${t})`}return e}function Xe({image:e}){if(!e?.src)return null;const{src:t,position:n="center",size:r="cover",lazy:o=!0}=e,a={position:"absolute",inset:0,backgroundImage:`url(${ue(t)})`,backgroundPosition:n,backgroundSize:r,backgroundRepeat:"no-repeat"};return p.jsx("div",{className:"background-image",style:a,"aria-hidden":"true"})}function er(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function tr({video:e}){if(!e?.src)return null;const{src:t,sources:n,poster:r,loop:o=!0,muted:a=!0}=e;if(er()&&r)return p.jsx(Xe,{image:{src:r,size:"cover",position:"center"}});const i={position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"},s=(n||nr(t)).map(l=>({...l,src:ue(l.src)}));return p.jsx("video",{className:"background-video",style:i,autoPlay:!0,loop:o,muted:a,playsInline:!0,poster:ue(r),"aria-hidden":"true",children:s.map(({src:l,type:c},f)=>p.jsx("source",{src:l,type:c},f))})}function nr(e){const t=[],n=e.split(".").pop()?.toLowerCase(),r=e.slice(0,e.lastIndexOf("."));return n==="mp4"?(t.push({src:`${r}.webm`,type:"video/webm"}),t.push({src:e,type:"video/mp4"})):n==="webm"?(t.push({src:e,type:"video/webm"}),t.push({src:`${r}.mp4`,type:"video/mp4"})):t.push({src:e,type:rr(e)}),t}function rr(e){return e.endsWith(".webm")?"video/webm":e.endsWith(".ogg")||e.endsWith(".ogv")?"video/ogg":"video/mp4"}function or({mode:e,color:t,gradient:n,image:r,video:o,overlay:a,className:i=""}){if(!e)return null;const s={position:"absolute",inset:0,overflow:"hidden",zIndex:0};return p.jsxs("div",{className:`background background--${e} ${i}`.trim(),style:s,"aria-hidden":"true",children:[e===K.COLOR&&p.jsx(Zn,{color:t}),e===K.GRADIENT&&p.jsx(Qn,{gradient:n}),e===K.IMAGE&&p.jsx(Xe,{image:r}),e===K.VIDEO&&p.jsx(tr,{video:o}),p.jsx(Xn,{overlay:a})]})}const ar=["light","medium","dark"],ir=e=>{const t=e.themeName,n=e.state?.className||"";let r="";t&&ar.includes(t)&&(r=`context-${t}`);let o=r;n&&(o=o?`${o} ${n}`:n);const{background:a={}}=e.standardOptions,i={};if(a.mode&&(i.position="relative",i.isolation="isolate"),e.contextOverrides)for(const[l,c]of Object.entries(e.contextOverrides))i[`--${l}`]=c;return{id:`section-${e.stableId||e.id}`,style:i,className:o,background:a}};function Ze({block:e,pure:t=!1,as:n="section",extra:r={}}){const o=e.initComponent(),a=e.website.entityStore,i=Gn(e.type),s=a.resolve(e,i),[l,c]=u.useState(null);u.useEffect(()=>{c(null)},[e]),u.useEffect(()=>{if(s.status!=="pending")return;let k=!1;return a.fetch(e,i).then(S=>{!k&&S.data&&c(S.data)}),()=>{k=!0}},[e]);const f=s.status==="ready"?s.data:l;if(e.dataLoading=s.status==="pending"&&!f,!o)return p.jsxs("div",{className:"block-error",style:{padding:"1rem",background:"#fef2f2",color:"#dc2626"},children:["Component not found: ",e.type]});const d=Jn(e,i);let h=d.params,m={...d.content,...e.properties};if(f){const k={...m.data};for(const S of Object.keys(f))k[S]===void 0&&(k[S]=f[S]);m.data=k}const{background:b,...v}=ir(e),y=o.className;y&&(v.className=v.className?`${v.className} ${y}`:y);const w=b?.mode&&i?.background!=="self";e.hasBackground=w;const g={content:m,params:h,block:e};if(t)return p.jsx(o,{...g,extra:r});const x=o.as,C=n===!1?V.Fragment:n!=="section"?n:x||"section",R=n===!1?{}:v;return w?p.jsxs(C,{...R,children:[p.jsx(or,{mode:b.mode,color:b.color,gradient:b.gradient,image:b.image,video:b.video,overlay:b.overlay}),p.jsx("div",{style:{position:"relative",zIndex:10},children:p.jsx(o,{...g})})]}):p.jsx(C,{...R,children:p.jsx(o,{...g})})}function $e({blocks:e,extra:t={}}){return!e||e.length===0?null:e.map((n,r)=>p.jsx(V.Fragment,{children:p.jsx(Ze,{block:n,extra:t})},n.id||r))}function sr({header:e,body:t,footer:n}){return p.jsxs(p.Fragment,{children:[e&&p.jsx("header",{children:e}),t&&p.jsx("main",{children:t}),n&&p.jsx("footer",{children:n})]})}function lr(...e){for(const t of e)if(t)for(const n of t)n.initComponent()}function ur(e={},t={}){return{...t,...e}}function cr({page:e,website:t}){const n=e.getLayoutName(),r=t.getRemoteLayout(n),o=t.getLayoutMeta(n),a=e.getBodyBlocks(),i=e.getLayoutAreas(),s=[a,...Object.values(i)];lr(...s);const l=a?p.jsx($e,{blocks:a}):null,c={};for(const[f,d]of Object.entries(i))c[f]=p.jsx($e,{blocks:d});if(r){const f=ur(e.getLayoutParams(),o?.defaults);return p.jsx(r,{page:e,website:t,params:f,body:l,...c},n)}return p.jsx(sr,{body:l,...c})}const dr={description:{name:"description"},keywords:{name:"keywords"},robots:{name:"robots"},"og:title":{property:"og:title"},"og:description":{property:"og:description"},"og:image":{property:"og:image"},"og:url":{property:"og:url"},"og:type":{property:"og:type"},"twitter:card":{name:"twitter:card"},"twitter:title":{name:"twitter:title"},"twitter:description":{name:"twitter:description"},"twitter:image":{name:"twitter:image"}};function fr(e){const t=dr[e];if(!t)return null;const n=t.property?`meta[property="${t.property}"]`:`meta[name="${t.name}"]`;let r=document.querySelector(n);return r||(r=document.createElement("meta"),t.property?r.setAttribute("property",t.property):r.setAttribute("name",t.name),document.head.appendChild(r)),r}function hr(e){let t=document.querySelector(`link[rel="${e}"]`);return t||(t=document.createElement("link"),t.setAttribute("rel",e),document.head.appendChild(t)),t}function P(e,t){const n=fr(e);n&&(t?n.setAttribute("content",t):n.remove())}function pr(e,t={}){const{siteName:n="",titleSeparator:r=" | "}=t;u.useRef([]),u.useEffect(()=>{if(!e)return;if(e.title){const a=n?`${e.title}${r}${n}`:e.title;document.title=a}P("description",e.description||null);const o=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;if(P("keywords",o||null),P("robots",e.robots||null),e.og&&(P("og:title",e.og.title||e.title||null),P("og:description",e.og.description||e.description||null),P("og:image",e.og.image||null),P("og:url",e.og.url||null),P("og:type","website"),P("twitter:card",e.og.image?"summary_large_image":"summary"),P("twitter:title",e.og.title||e.title||null),P("twitter:description",e.og.description||e.description||null),P("twitter:image",e.og.image||null)),e.canonical)hr("canonical").setAttribute("href",e.canonical);else{const a=document.querySelector('link[rel="canonical"]');a&&a.remove()}return()=>{document.title=n||"Website"}},[e?.title,e?.description,e?.keywords,e?.canonical,e?.robots,e?.og?.title,e?.og?.description,e?.og?.image,e?.og?.url,n,r])}function mr({blocks:e,from:t,pure:n=!1,as:r="div",extra:o={}}){return(e||t?.childBlocks||[]).map((i,s)=>p.jsx(V.Fragment,{children:p.jsx(Ze,{block:i,pure:n,as:r,extra:o})},i.id||s))}function gr({page:e,appearance:t}){const n=u.useRef(null),r=u.useMemo(()=>{if(!e)return"";const o=e.getPageBlocks();return st(o,t)},[e,t]);return u.useEffect(()=>{if(!r){n.current&&(n.current.remove(),n.current=null);return}if(!n.current){n.current=document.createElement("style"),n.current.id="uniweb-page-overrides";const o=document.getElementById("uniweb-theme");o&&o.nextSibling?o.parentNode.insertBefore(n.current,o.nextSibling):o?o.parentNode.appendChild(n.current):document.head.appendChild(n.current)}return n.current.textContent=r,()=>{n.current&&(n.current.remove(),n.current=null)}},[r]),null}function yr(){const e=j(),n=globalThis.uniweb?.activeWebsite,r=n?.name||"";let o=n?.getPage(e.pathname);o&&n&&n.setActivePage(e.pathname);const a=!o;a&&(o=n?.getNotFoundPage?.()||null);const i=o?.getHeadMeta?.()||{title:a?"Page Not Found":o?.title||"Website",description:o?.description||""};if(pr(i,{siteName:r}),!o)return e.pathname,p.jsxs("div",{className:"page-not-found",style:{padding:"4rem 2rem",textAlign:"center"},children:[p.jsx("h1",{style:{fontSize:"3rem",fontWeight:"bold",color:"#1f2937",marginBottom:"1rem"},children:"404"}),p.jsx("p",{style:{color:"#64748b",marginBottom:"2rem"},children:"Page not found"}),p.jsx("a",{href:"/",style:{color:"#3b82f6",textDecoration:"underline"},children:"Go to homepage"}),!1]});const s=n?.themeData?.appearance;return p.jsxs(p.Fragment,{children:[p.jsx(gr,{page:o,appearance:s}),p.jsx(cr,{page:o,website:n})]})}function vr(e,t){if(!e||!t)return e;const n=t.split(".");let r=e;for(const o of n){if(r==null)return;r=r[o]}return r}async function br(e){if(!e)return{data:null};const{path:t,url:n,transform:r}=e;try{let o=t||n;if(!o)return{data:[],error:"No path or url specified"};o.startsWith("/")&&!o.startsWith("//")&&(o="/".replace(/\/$/,"")+o);const a=await fetch(o);if(!a.ok)throw new Error(`HTTP ${a.status}: ${a.statusText}`);const i=a.headers.get("content-type")||"";let s;if(i.includes("application/json"))s=await a.json();else{const l=await a.text();try{s=JSON.parse(l)}catch{console.warn("[data-fetcher] Response is not JSON, returning as text"),s=l}}return r&&s&&(s=vr(s,r)),{data:s??[]}}catch(o){return console.warn(`[data-fetcher] Client fetch failed: ${o.message}`),{data:[],error:o.message}}}const wr={lucide:"lu",heroicons:"hi",heroicons2:"hi2",phosphor:"pi",tabler:"tb",feather:"fi",fa:"fa",fa6:"fa6",bootstrap:"bs","material-design":"md","ant-design":"ai",remix:"ri","simple-icons":"si",ionicons:"io5",boxicons:"bi",vscode:"vsc",weather:"wi",game:"gi",lu:"lu",hi:"hi",hi2:"hi2",pi:"pi",tb:"tb",fi:"fi",bs:"bs",md:"md",ai:"ai",ri:"ri",io5:"io5",bi:"bi",si:"si",vsc:"vsc",wi:"wi",gi:"gi"};function xr(e={}){const t=e.cdnUrl||"https://uniweb.github.io/icons",n=e.cdn!==!1,r=new Map;return async function(a,i){const s=wr[a.toLowerCase()];if(!s)return console.warn(`[icons] Unknown family "${a}"`),null;const l=`${s}:${i}`;if(r.has(l))return r.get(l);if(!n)return r.set(l,null),null;try{const c=`${s}-${i}`,f=`${t}/${s}/${c}.svg`,d=await fetch(f);if(!d.ok)throw new Error(`HTTP ${d.status}`);const h=await d.text();return r.set(l,h),h}catch(c){return console.warn(`[icons] Failed to load ${a}:${i}`,c.message),r.set(l,null),null}}}function Er(e){const t=rt(e);if(e.fetchedData&&t.activeWebsite?.dataStore)for(const n of e.fetchedData)t.activeWebsite.dataStore.set(n.config,n.data);if(t.childBlockRenderer=mr,t.routingComponents={Link:ve,useNavigate:he,useParams:qt,useLocation:j},t.iconResolver=xr(e.icons),typeof document<"u")try{const n=document.getElementById("__ICON_CACHE__");if(n){const r=JSON.parse(n.textContent);for(const[o,a]of Object.entries(r))t.iconCache.set(o,a)}}catch{}return t.activeWebsite?.dataStore&&t.activeWebsite.dataStore.registerFetcher(br),t}function Rr(e,t){e.setFoundation(t),t.default?.capabilities&&e.setFoundationConfig(t.default.capabilities),t.default?.layoutMeta&&e.foundationConfig&&(e.foundationConfig.layoutMeta=t.default.layoutMeta)}async function Cr(){const e=document.getElementById("__DATA__");if(!e?.textContent)return null;const t=e.textContent;if(e.type==="application/json")try{return JSON.parse(t)}catch{return null}if(typeof DecompressionStream<"u")try{const n=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),r=new DecompressionStream("gzip"),o=r.writable.getWriter();o.write(n),o.close();const a=await new Response(r.readable).text();return JSON.parse(a)}catch{return null}try{return JSON.parse(t)}catch{return null}}async function kr(e){if(e)return new Promise(t=>{const n=document.createElement("link");n.rel="stylesheet",n.href=e,n.onload=()=>{console.log("[Runtime] Foundation CSS loaded"),t()},n.onerror=()=>{console.warn("[Runtime] Could not load foundation CSS from:",e),t()},document.head.appendChild(n)})}async function Qe(e){const t=typeof e=="string"?e:e.url,n=typeof e=="object"?e.cssUrl:t.replace(/[^/]+\.js$/,"assets/foundation.css");console.log(`[Runtime] Loading foundation from: ${t}`);try{const[,r]=await Promise.all([n?kr(n):Promise.resolve(),import(t)]),o=Object.keys(r).filter(a=>a!=="default");return console.log("[Runtime] Foundation loaded. Available components:",o),r}catch(r){throw console.error("[Runtime] Failed to load foundation:",r),r}}async function Sr(e,t){if(!e?.length)return;function n(o){return o}const r=await Promise.allSettled(e.map(o=>Qe(o)));for(let o=0;o<r.length;o++)r[o].status==="fulfilled"?(t.registerExtension(r[o].value),console.log(`[Runtime] Extension loaded: ${e[o]}`)):console.warn(`[Runtime] Extension failed to load: ${e[o]}`,r[o].reason)}const ce="uniweb-theme";function Pr(){return typeof document>"u"?!1:document.getElementById(ce)!==null}function $r({css:e,children:t}){const n=u.useRef(null);return u.useEffect(()=>{if(!e||Pr())return;const r=document.createElement("style");return r.id=ce,r.textContent=e,document.head.appendChild(r),n.current=r,()=>{n.current&&n.current.parentNode&&(n.current.parentNode.removeChild(n.current),n.current=null)}},[e]),u.useEffect(()=>{if(!e)return;const r=document.getElementById(ce);r&&r.textContent!==e&&(r.textContent=e)},[e]),p.jsx(p.Fragment,{children:t})}function Lr(e={}){const{enabled:t=!0,resetBlockStates:n=!0,scrollDelay:r=0}=e,o=j(),a=Ht(),i=u.useRef(o.pathname),s=u.useRef(!0);u.useEffect(()=>{if(!t)return;const c=globalThis.uniweb?.activeWebsite;if(!c)return;const f=i.current,d=o.pathname,h=c.activePage;if(s.current){s.current=!1,i.current=d;return}if(f===d)return;const m=c.getPage(f);if(m&&(m.scrollY=window.scrollY),h){const b=a==="POP"&&h.scrollY||0;n&&typeof h.resetBlockStates=="function"&&h.resetBlockStates();const v=()=>{window.scrollTo(0,b)};r>0?setTimeout(v,r):requestAnimationFrame(v)}i.current=d},[o.pathname,a,t,n,r]),u.useEffect(()=>{if(!t)return;const l=()=>{const f=globalThis.uniweb?.activeWebsite?.activePage;f&&(f.scrollY=window.scrollY)};return window.addEventListener("beforeunload",l),()=>window.removeEventListener("beforeunload",l)},[t])}function jr(e){if(!e)return!1;if(e.startsWith("#")||e.startsWith("/")&&!e.startsWith("//"))return!0;try{return new URL(e,window.location.origin).origin===window.location.origin}catch{return!0}}function Or(e){return!(e.defaultPrevented||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.button!==0)}function Nr(e){let t=e;for(;t&&t!==document.body;){if(t.tagName==="A")return t;t=t.parentElement}return null}function de(e,t=5){const n=document.getElementById(e);if(n){n.scrollIntoView({behavior:"smooth"});return}t>0&&requestAnimationFrame(()=>{setTimeout(()=>de(e,t-1),50)})}function Tr(e={}){const{enabled:t=!0}=e,n=he(),r=j();u.useEffect(()=>{if(!t||!r.hash)return;const o=r.hash.slice(1);o&&requestAnimationFrame(()=>{de(o)})},[t,r.pathname,r.hash]),u.useEffect(()=>{if(!t)return;function o(a){if(!Or(a))return;const i=Nr(a.target);if(!i)return;const s=i.getAttribute("href");if(!s||!jr(s)||i.hasAttribute("download"))return;const l=i.getAttribute("target");if(l&&l!=="_self")return;const c=globalThis.uniweb?.activeWebsite,f=c?.basePath||"";let d=s;if(f&&s.startsWith(f)&&(d=s.slice(f.length)||"/"),c?.hasMultipleLocales()){const h=c.getActiveLocale(),m=c.getDefaultLocale(),b=c.getLocales().map(g=>g.code),y=d.match(/^\/([a-z]{2,3}(?:-[A-Z]{2})?)(?:\/|$)/)?.[1];let w=!1;if(y&&b.includes(y)?w=y!==h:w=h!==m,w)return}if(a.preventDefault(),d.startsWith("#")){const h=d.slice(1);h&&(de(h),window.history.pushState(null,"",s));return}n(d)}return document.addEventListener("click",o),()=>{document.removeEventListener("click",o)}},[t,n])}function Ir(){const e=globalThis.uniweb?.activeWebsite;if(u.useEffect(()=>{const n=e?.themeData?.appearance;if(!n)return;const r=n.default||"light",o=document.documentElement;r==="dark"?(o.classList.add("scheme-dark"),o.classList.remove("scheme-light")):r==="system"?(o.classList.remove("scheme-dark"),o.classList.remove("scheme-light")):o.classList.remove("scheme-dark")},[e?.themeData?.appearance?.default]),Tr({enabled:!0}),Lr({enabled:!0}),!e)return p.jsx("div",{className:"website-loading",style:{padding:"2rem",textAlign:"center",color:"#64748b"},children:"Loading website..."});const t=e.themeData?.css;return p.jsx($r,{css:t,children:p.jsx(yr,{})})}class Le extends V.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("[Runtime] Error caught by boundary:",t,n)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:p.jsxs("div",{style:{padding:"2rem",margin:"1rem",background:"#fef2f2",border:"1px solid #fecaca",borderRadius:"0.5rem",color:"#dc2626"},children:[p.jsx("h2",{style:{margin:"0 0 1rem"},children:"Something went wrong"}),p.jsx("p",{children:this.state.error?.message||"An unexpected error occurred"}),!1]}):this.props.children}}function Fr({basename:e,development:t=!1,externalRouter:n=!1}){const r=globalThis.uniweb?.activeWebsite;if(!r)return null;r.setBasePath&&r.setBasePath(e||"");const o=p.jsx(ln,{children:p.jsx(qe,{path:"/*",element:p.jsx(Ir,{})})}),a=n?p.jsx(Le,{children:o}):p.jsx(Le,{children:p.jsx(Nn,{basename:e,children:o})});return t?p.jsx(V.StrictMode,{children:a}):a}async function ie(e,t={}){const{development:n=!1,configData:r=null,basename:o}=t,a=r??JSON.parse(document.getElementById("__SITE_CONTENT__")?.textContent||"null")??globalThis.__SITE_CONTENT__;if(!a){console.error("[Runtime] No site configuration found");return}const i=Er(a);try{let s;if(typeof e=="string"||e&&typeof e.url=="string")s=await Qe(e);else if(e&&typeof e.then=="function"){const m=await e;s=m?.default?.default?m.default:m}else e&&typeof e=="object"&&(s=e);if(!s)throw new Error("Failed to load foundation");Rr(i,s);const l=a?.config?.extensions;l?.length&&await Sr(l,i);const c=o??void 0,f=i.activeWebsite;if(f&&typeof window<"u"){const m=window.location.pathname,b=c||"",v=b&&m.startsWith(b)?m.slice(b.length)||"/":m;f.setActivePage(v)}const d=document.getElementById("root");if(!d){console.error("[Runtime] Root element not found");return}we.createRoot(d).render(p.jsx(Fr,{basename:c,development:n})),n||console.log("%c<%c>%c Uniweb Runtime","color: #FA8400; font-weight: bold; font-size: 18px;","color: #00ADFE; font-weight: bold; font-size: 18px;","color: #333; font-size: 18px; font-family: system-ui, sans-serif;")}catch(s){console.error("[Runtime] Initialization failed:",s);const l=document.getElementById("root");l&&we.createRoot(l).render(p.jsxs("div",{style:{padding:"2rem",margin:"1rem",background:"#fef2f2",borderRadius:"0.5rem",color:"#dc2626"},children:[p.jsx("h2",{children:"Runtime Error"}),p.jsx("p",{children:s.message}),n&&p.jsx("pre",{style:{fontSize:"0.75rem",overflow:"auto"},children:s.stack})]}))}}async function Ar({config:e,foundation:t,styles:n}={}){const r=await Cr();if(r){const a=r.content?.config?.base,i=a?a.endsWith("/")?a.slice(0,-1):a:void 0;return ie({url:r.foundation.url,cssUrl:r.foundation.cssUrl},{configData:r.content,basename:i})}if((e?.mode??"bundled")==="runtime")return ie({url:e.url,cssUrl:e.cssUrl});{const[a]=await Promise.all([t,n]);return ie(a)}}Ar({config:null});
8
+ //# sourceMappingURL=index-CsyMBO9p.js.map