@qwik.dev/router 2.0.0-beta.10 → 2.0.0-beta.11

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 (36) hide show
  1. package/lib/adapters/azure-swa/vite/index.cjs +2 -2
  2. package/lib/adapters/azure-swa/vite/index.mjs +73 -69
  3. package/lib/adapters/bun-server/vite/index.cjs +2 -2
  4. package/lib/adapters/bun-server/vite/index.mjs +77 -73
  5. package/lib/adapters/cloud-run/vite/index.cjs +2 -2
  6. package/lib/adapters/cloud-run/vite/index.mjs +104 -100
  7. package/lib/adapters/cloudflare-pages/vite/{index-DwovcBp3.js → index-Bg_9YkM5.js} +1 -1
  8. package/lib/adapters/cloudflare-pages/vite/{index-C455V8_A.cjs → index-C1aDmh1S.cjs} +1 -1
  9. package/lib/adapters/cloudflare-pages/vite/index-CHT9Y93A.js +254 -0
  10. package/lib/adapters/cloudflare-pages/vite/{index-DKcVHRBy.cjs → index-Ck7KvpK1.cjs} +1 -1
  11. package/lib/adapters/cloudflare-pages/vite/{index-D3HITboM.js → index-Cp1cjAds.js} +1 -1
  12. package/lib/adapters/cloudflare-pages/vite/index-D9RL9dvJ.cjs +5 -0
  13. package/lib/adapters/cloudflare-pages/vite/index.cjs +1 -1
  14. package/lib/adapters/cloudflare-pages/vite/index.mjs +1 -1
  15. package/lib/adapters/deno-server/vite/index.cjs +2 -2
  16. package/lib/adapters/deno-server/vite/index.mjs +81 -77
  17. package/lib/adapters/netlify-edge/vite/index.cjs +3 -3
  18. package/lib/adapters/netlify-edge/vite/index.mjs +119 -115
  19. package/lib/adapters/node-server/vite/index.cjs +2 -2
  20. package/lib/adapters/node-server/vite/index.mjs +78 -74
  21. package/lib/adapters/shared/vite/index.cjs +2 -2
  22. package/lib/adapters/shared/vite/index.mjs +108 -104
  23. package/lib/adapters/ssg/vite/index.cjs +2 -2
  24. package/lib/adapters/ssg/vite/index.mjs +100 -96
  25. package/lib/adapters/vercel-edge/vite/index.cjs +2 -2
  26. package/lib/adapters/vercel-edge/vite/index.mjs +114 -110
  27. package/lib/index.qwik.cjs +39 -33
  28. package/lib/index.qwik.mjs +39 -33
  29. package/lib/middleware/request-handler/index.cjs +8 -8
  30. package/lib/middleware/request-handler/index.mjs +598 -587
  31. package/lib/vite/index.cjs +17 -17
  32. package/lib/vite/index.d.ts +3 -3
  33. package/lib/vite/index.mjs +242 -230
  34. package/package.json +4 -4
  35. package/lib/adapters/cloudflare-pages/vite/index-BIeHg2Cj.cjs +0 -5
  36. package/lib/adapters/cloudflare-pages/vite/index-bogwy7wh.js +0 -250
@@ -1,35 +1,35 @@
1
- "use strict";var de=Object.create;var B=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var me=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var ye=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pe(t))!ge.call(e,s)&&s!==r&&B(e,s,{get:()=>t[s],enumerable:!(n=he(t,s))||n.enumerable});return e};var I=(e,t,r)=>(r=e!=null?de(me(e)):{},ye(t||!e||!e.__esModule?B(r,"default",{value:e,enumerable:!0}):r,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("vite"),b=require("node:fs"),m=require("node:path"),we=require("marked"),ve=require("source-map"),x=require("unist-util-visit"),be=require("yaml"),Pe=require("github-slugger"),Se=require("estree-util-value-to-estree"),X=require("hast-util-heading-rank"),C=require("hast-util-to-string"),M=require("refractor"),xe=require("refractor/lang/tsx.js"),ke=require("svgo");function Ee(e,t){return async r=>{let n=await e;typeof n=="function"&&(n=await n(r));let s=await t;return typeof s=="function"&&(s=await s(r)),Y.mergeConfig(n,s)}}const Ie='"serviceWorker"in navigator?(navigator.serviceWorker.register("__url").catch(e=>console.error(e)),"caches"in window&&caches.keys().then(e=>{const r=e.find(e=>e.startsWith("QwikBuild"));r&&caches.delete(r).catch(console.error)}).catch(console.error)):console.log("Service worker not supported in this browser.")';function Re(e){return e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}function Z(e,t){e.diagnostics.push({type:"error",message:t?String(t.stack||t):"Error"})}function Ne(e,t){e.diagnostics.push({type:"warn",message:String(t)})}function ee(e,t){if(typeof e=="string"&&(e=e.trim(),e!==""))try{if(e=e.replace(/\/+/g,"/"),e.startsWith("/")&&(e=e.slice(1)),e=new URL(t+e,"https://qwik.dev").pathname,e!==t){if(globalThis.__NO_TRAILING_SLASH__)e.endsWith("/")&&(e=e.slice(0,e.length-1));else if(!e.endsWith("/")){const r=e.split("/");r[r.length-1].includes(".")||(e+="/")}}return e}catch(r){console.error(r)}return null}function te(e){if(typeof e=="string"&&(e=e.trim(),e!=="")){const t=e.charAt(0);if(t!=="/"&&t!=="."){if(t==="#")return!1;const r=e.indexOf(":");if(r>-1){const n=e.slice(0,r).toLowerCase();return!$e[n]}}return!0}return!1}const $e={https:!0,http:!0,about:!0,javascript:!0,file:!0};function _e(e){let t="";const r=e.endsWith("!");r&&(e=e.slice(0,e.length-1));const n=e.split("@");return n.length>1&&(n.shift(),t=n.join("@")),{layoutName:t,layoutStop:r}}function W(e,t){const r=m.relative(e.routesDir,t);let n=w(r);return n=ee(n,e.basePathname).split("/").filter(s=>!He(s)).join("/"),n===""?"/":n}function Oe(e,t){let r=w(m.relative(e.routesDir,t));r="/"+w(m.dirname(r));let n=ee(r,e.basePathname);return n.endsWith("/")||(n+="/"),n}function N(e){if(typeof e=="string"){const t=e.trim().toLowerCase().split(".");if(t.length>1){const r=t.pop().split("?")[0].split("#")[0];return r==="ts"&&t.pop()==="d"?".d.ts":"."+r}}return""}function P(e){if(typeof e=="string"){e=e.trim();const t=N(e);return e.slice(0,e.length-t.length)}return""}function w(e){return De(m.normalize(e))}function De(e){const t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r||(e=e.replace(/\\/g,"/"),e.endsWith("/")&&(e=e.slice(0,e.length-1))),e}function k(e,t,r){const n=[];for(let s=0;s<25;s++){let i=P(m.basename(t));if(i=i.replace(/[\W_]+/g,""),i===""?i="Q"+s:isNaN(i.charAt(0))||(i="Q"+i),n.push(Re(i)),t=w(m.dirname(t)),t===e)break}return n.length>1&&n[0]==="Index"&&n.shift(),n.reverse().join("").concat(r||"")}const re={".tsx":!0,".jsx":!0},Te={".ts":!0,".js":!0},ne={".md":!0,".mdx":!0};function je(e){return/^index(|!|@.+)$/.test(e)}function We(e){return/^plugin(|@.+)$/.test(e)}function Ae(e){return/^layout(|!|-.+)$/.test(e)}function se(e){return e in re}function L(e){return e in Te}function q(e){return e in ne}function Me(e){return e in re||e in ne}function ie(e){return e==="menu.md"}function Ce(e){return e==="service-worker"}function Le(e){return e==="entry"}function qe(e){try{const t=parseInt(e,10);return t>=400&&t<=599}catch{}return!1}function He(e,t=!0){return e.startsWith("__")?(t&&console.warn(`Grouped (pathless) layout "${e}" should use the "(${e.slice(2)})" directory name instead. Prefixing a directory with "__" has been deprecated and will be removed in future versions.`),!0):e.startsWith("(")&&e.endsWith(")")}function oe(e){const t=N(e),r=P(e),n=se(t),s=L(t),i=q(t);let o=null;return(je(r)||qe(r))&&(n||s||i)?o="route":Ae(r)&&(n||s)?o="layout":Le(r)&&s?o="entry":ie(e)?o="menu":s&&Ce(r)&&(o="service-worker"),o!==null?{type:o,extlessName:r,ext:t}:null}function j(e,t,r,n){if(typeof r!="string"||!te(r))return r;const s=r.split("?"),i=r.split("#"),o=r.split("?")[0].split("#")[0],a=N(o);if(q(a)){const u=o.startsWith("/"),c=w(o).split("/").filter(h=>h.length>0),l=u?m.join(e.routesDir,...c):m.join(m.dirname(t),...c);n&&!b.existsSync(l)&&console.warn(`
1
+ "use strict";var de=Object.create;var J=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var me=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var ye=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pe(t))!ge.call(e,s)&&s!==r&&J(e,s,{get:()=>t[s],enumerable:!(n=he(t,s))||n.enumerable});return e};var N=(e,t,r)=>(r=e!=null?de(me(e)):{},ye(t||!e||!e.__esModule?J(r,"default",{value:e,enumerable:!0}):r,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("vite"),S=require("node:fs"),h=require("node:path"),we=require("marked"),ve=require("source-map"),I=require("unist-util-visit"),be=require("yaml"),Pe=require("github-slugger"),xe=require("estree-util-value-to-estree"),X=require("hast-util-heading-rank"),q=require("hast-util-to-string"),L=require("refractor"),Se=require("refractor/lang/tsx.js"),ke=require("svgo");function Ee(e,t){return async r=>{let n=await e;typeof n=="function"&&(n=await n(r));let s=await t;return typeof s=="function"&&(s=await s(r)),Y.mergeConfig(n,s)}}const Ie='"serviceWorker"in navigator?(navigator.serviceWorker.register("__url").catch(e=>console.error(e)),"caches"in window&&caches.keys().then(e=>{const r=e.find(e=>e.startsWith("QwikBuild"));r&&caches.delete(r).catch(console.error)}).catch(console.error)):console.log("Service worker not supported in this browser.")';function Re(e){return e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}function Z(e,t){e.diagnostics.push({type:"error",message:t?String(t.stack||t):"Error"})}function Ne(e,t){e.diagnostics.push({type:"warn",message:String(t)})}function ee(e,t){if(typeof e=="string"&&(e=e.trim(),e!==""))try{if(e=e.replace(/\/+/g,"/"),e.startsWith("/")&&(e=e.slice(1)),e=new URL(t+e,"https://qwik.dev").pathname,e!==t){if(globalThis.__NO_TRAILING_SLASH__)e.endsWith("/")&&(e=e.slice(0,e.length-1));else if(!e.endsWith("/")){const r=e.split("/");r[r.length-1].includes(".")||(e+="/")}}return e}catch(r){console.error(r)}return null}function te(e){if(typeof e=="string"&&(e=e.trim(),e!=="")){const t=e.charAt(0);if(t!=="/"&&t!=="."){if(t==="#")return!1;const r=e.indexOf(":");if(r>-1){const n=e.slice(0,r).toLowerCase();return!$e[n]}}return!0}return!1}const $e={https:!0,http:!0,about:!0,javascript:!0,file:!0};function _e(e){let t="";const r=e.endsWith("!");r&&(e=e.slice(0,e.length-1));const n=e.split("@");return n.length>1&&(n.shift(),t=n.join("@")),{layoutName:t,layoutStop:r}}function C(e,t){const r=h.relative(e.routesDir,t);let n=b(r);return n=ee(n,e.basePathname).split("/").filter(s=>!He(s)).join("/"),n===""?"/":n}function De(e,t){let r=b(h.relative(e.routesDir,t));r="/"+b(h.dirname(r));let n=ee(r,e.basePathname);return n.endsWith("/")||(n+="/"),n}function _(e){if(typeof e=="string"){const t=e.trim().toLowerCase().split(".");if(t.length>1){const r=t.pop().split("?")[0].split("#")[0];return r==="ts"&&t.pop()==="d"?".d.ts":"."+r}}return""}function k(e){if(typeof e=="string"){e=e.trim();const t=_(e);return e.slice(0,e.length-t.length)}return""}function b(e){return Oe(h.normalize(e))}function Oe(e){const t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r||(e=e.replace(/\\/g,"/"),e.endsWith("/")&&(e=e.slice(0,e.length-1))),e}function R(e,t,r){const n=[];for(let s=0;s<25;s++){let i=k(h.basename(t));if(i=i.replace(/[\W_]+/g,""),i===""?i="Q"+s:isNaN(i.charAt(0))||(i="Q"+i),n.push(Re(i)),t=b(h.dirname(t)),t===e)break}return n.length>1&&n[0]==="Index"&&n.shift(),n.reverse().join("").concat(r||"")}const re={".tsx":!0,".jsx":!0},Te={".ts":!0,".js":!0},ne={".md":!0,".mdx":!0};function je(e){return/^index(|!|@.+)$/.test(e)}function We(e){return/^plugin(|@.+)$/.test(e)}function Ae(e){return/^layout(|!|-.+)$/.test(e)}function se(e){return e in re}function H(e){return e in Te}function F(e){return e in ne}function Ce(e){return e in re||e in ne}function ie(e){return e==="menu.md"}function Me(e){return e==="service-worker"}function Le(e){return e==="entry"}function qe(e){try{const t=parseInt(e,10);return t>=400&&t<=599}catch{}return!1}function He(e,t=!0){return e.startsWith("__")?(t&&console.warn(`Grouped (pathless) layout "${e}" should use the "(${e.slice(2)})" directory name instead. Prefixing a directory with "__" has been deprecated and will be removed in future versions.`),!0):e.startsWith("(")&&e.endsWith(")")}function oe(e){const t=_(e),r=k(e),n=se(t),s=H(t),i=F(t);let o=null;return(je(r)||qe(r))&&(n||s||i)?o="route":Ae(r)&&(n||s)?o="layout":Le(r)&&s?o="entry":ie(e)?o="menu":s&&Me(r)&&(o="service-worker"),o!==null?{type:o,extlessName:r,ext:t}:null}function A(e,t,r,n){if(typeof r!="string"||!te(r))return r;const s=r.split("?"),i=r.split("#"),o=r.split("?")[0].split("#")[0],a=_(o);if(F(a)){const u=o.startsWith("/"),c=b(o).split("/").filter(v=>v.length>0),l=u?h.join(e.routesDir,...c):h.join(h.dirname(t),...c);n&&!S.existsSync(l)&&console.warn(`
2
2
  The link "${r}", found within "${t}" does not have a matching source file.
3
- `);const f=m.basename(l);if(oe(f)){const h=m.dirname(l);let p=W(e,h);return s.length>1?p+="?"+s[1]:i.length>1&&(p+="#"+i[1]),p}}else a===""&&(r.endsWith("/")?globalThis.__NO_TRAILING_SLASH__&&(r=r.slice(0,-1)):globalThis.__NO_TRAILING_SLASH__||(r+="/"));return r}function Fe(e,t){return{pathname:Oe(e,t),filePath:t}}function Ue(e,t){return Fe(e,t.filePath)}async function Be(e,t,r){const n=Je(e,t,r),s=k(e.routesDir,t);return`${`const ${s} = ${JSON.stringify(n,null,2)};`} export default ${s}`}function Je(e,t,r,n=!0){const s=we.marked.lexer(r,{});let i=0;const o=[];for(const a of s)if(a.type==="heading"){const u=i-a.depth;if(u>=0&&(o.length-=u+1),u<-1)throw new Error(`Menu hierarchy skipped a level, went from <h${"#".repeat(i)}> to <h${"#".repeat(a.depth)}>, in menu: ${t}`);i=a.depth;const c=o[o.length-1];for(const l of a.tokens||[]){const f={text:""};if(l.type==="text")f.text=l.text;else if(l.type==="link")f.text=l.text,f.href=j(e,t,l.href,n);else throw new Error(`Headings can only be a text or link. Received "${l.type}", value "${l.raw}", in menu: ${t}`);c&&(c.items=c.items||[],c.items.push(f)),o.push(f)}}else if(a.type==="list"){const u=o[o.length-1];u.items=u.items||[];for(const c of a.items)if(c.type==="list_item")for(const l of c.tokens)if(l.type==="text")for(const f of l.tokens)if(f.type==="text")u.items.push({text:f.text});else if(f.type==="link")u.items.push({text:f.text,href:j(e,t,f.href,n)});else throw new Error(`List items can only be a text or link. Received "${f.type}", value "${f.raw}", in menu: ${t}`);else if(l.type==="link")u.items.push({text:l.text,href:j(e,t,l.href,n)});else throw new Error(`List items can only be a text or link. Received "${l.type}", value "${l.raw}", in menu: ${t}`);else throw new Error(`Only list items can be used in lists. Received "${c.type}", value "${c.raw}", in menu: ${t}`)}else{if(a.type==="space")continue;throw new Error(`Menu has a "${a.type}" with the value "${a.raw}". However, only headings and lists can be used in the menu: ${t}`)}if(o.length===0)throw new Error(`Menu must start with an h1 in the index: ${t}`);return o[0]}function H(e,t){if(t===e)return{pattern:new RegExp("^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$"),routeName:t,paramNames:[],segments:[[{content:"",dynamic:!1,rest:!1}]]};t=t.slice(1);const r=t.split("/"),n=[];return{pattern:new RegExp(`^${r.filter(i=>i.length>0).map(i=>{const o=decodeURI(i),a=/^\[\.\.\.(\w+)?\]$/.exec(o);return a?(n.push(a[1]),"(?:/(.*))?"):"/"+o.split(ze).map((u,c)=>{if(c%2){const l=Ge.exec(u);if(l){const[,f,d]=l;return n.push(d),f?"(.*?)":"([^/]+?)"}}return encodeURI(u).normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}/?$`),routeName:t,paramNames:n,segments:r.map(i=>{const o=[];return i.split(/\[(.+?)\]/).map((a,u)=>{if(a){const c=!!(u%2);o.push({content:a,dynamic:c,rest:c&&a.startsWith("...")})}}),o})}}const Ge=/^(\.\.\.)?(\w+)?$/,ze=/\[(.+?)\]/;function Qe(e,t){const r=Math.max(e.segments.length,t.segments.length);for(let n=0;n<r;n+=1){const s=e.segments[n],i=t.segments[n];if(!s)return e.pathname.includes("[...")?1:-1;if(!i)return t.pathname.includes("[...")?-1:1;const o=Math.max(s.length,i.length);for(let a=0;a<o;a+=1){const u=s[a],c=i[a];if(u===void 0)return c.dynamic?-1:1;if(c===void 0||u.dynamic!==c.dynamic)return u.dynamic?1:-1;if(u.dynamic&&u.rest!==c.rest)return u.rest?1:-1}}return e.pathname===t.pathname?e.ext>t.ext?-1:1:e.pathname<t.pathname?-1:1}function Ke(e,t){const r=t.filter(l=>l.type==="layout").map(l=>Ve(e,l)).sort((l,f)=>l.id<f.id?-1:1),n=t.filter(l=>l.type==="route").map(l=>Ze(e,r,l)).sort(Qe),s=t.filter(l=>l.type==="entry").map(l=>et(e,l)).sort((l,f)=>l.chunkFileName<f.chunkFileName?-1:1),i=t.filter(l=>l.type==="service-worker").map(l=>tt(e,l)).sort((l,f)=>l.chunkFileName<f.chunkFileName?-1:1),o=t.filter(l=>l.type==="menu").map(l=>Ue(e,l)).sort((l,f)=>l.pathname<f.pathname?-1:1);let a=0;const u=new Set,c=l=>{for(const f of l){let d=f.id;for(;u.has(d);)d=`${f.id}_${a++}`;f.id=d,u.add(d)}};return c(r),c(n),c(s),c(i),{layouts:r,routes:n,entries:s,menus:o,serviceWorkers:i}}function Ve(e,t){let r=t.extlessName;const n=t.filePath,s=t.dirPath;let i,o;return r.endsWith(Xe)?(o="top",r=r.slice(0,r.length-1)):o="nested",r.startsWith(J)?i=r.slice(J.length):i="",{id:k(e.routesDir,n),filePath:n,dirPath:s,layoutType:o,layoutName:i}}const Ye="layout",J=Ye+"-",Xe="!";function Ze(e,t,r){const n=r.filePath,s=[],i=e.routesDir,{layoutName:o,layoutStop:a}=_e(r.extlessName);let u=W(e,r.dirPath);if(r.extlessName==="404"&&(u+=r.extlessName+".html"),!a){let l=w(m.dirname(n)),f=!1;const d=o!=="";for(let h=0;h<20;h++){let p;if(d&&!f?(p=t.find(y=>y.dirPath===l&&y.layoutName===o),p&&(f=!0)):p=t.find(y=>y.dirPath===l&&y.layoutName===""),p&&(s.push(p),p.layoutType==="top")||l===i)break;l=w(m.dirname(l))}}return{id:k(e.routesDir,n,"Route"),filePath:n,pathname:u,layouts:s.reverse(),ext:r.ext,...H(e.basePathname,u)}}function et(e,t){const r=W(e,t.dirPath),n=r.slice(e.basePathname.length);return{id:k(e.routesDir,t.filePath,"Route"),filePath:t.filePath,chunkFileName:n,...H(e.basePathname,r)}}function tt(e,t){const n=W(e,t.dirPath)+t.extlessName+".js",s=n.slice(e.basePathname.length);return{id:k(e.routesDir,t.filePath,"ServiceWorker"),filePath:t.filePath,chunkFileName:s,...H(e.basePathname,n)}}async function rt(e){const t=[];return await ae(t,w(e),m.basename(e)),t}async function ae(e,t,r){const n=await b.promises.readdir(t);await Promise.all(n.map(async s=>{const i=w(m.join(t,s));if((await b.promises.stat(i)).isDirectory())await ae(e,i,s);else{const a=oe(s);a!==null&&e.push({...a,fileName:s,filePath:i,dirName:r,dirPath:t})}}))}async function nt(e){const t=e.serverPluginsDir,r=await b.promises.readdir(t),n=[];return await Promise.all(r.map(async s=>{const i=w(m.join(t,s)),o=N(s),a=P(s);(L(o)||se(o))&&We(a)&&n.push({id:k(e.serverPluginsDir,i,"Plugin"),filePath:i,ext:o})})),n}async function ue(e){try{await st(e),at(e)}catch(t){Z(e,t)}for(const t of e.diagnostics){if(t.type==="error")throw new Error(t.message);console.warn(t.message)}}async function st(e){return e.activeBuild||(e.activeBuild=new Promise((t,r)=>{nt(e.opts).then(n=>(e.serverPlugins=n,rt(e.opts.routesDir))).then(n=>{const s=Ke(e.opts,n);it(e,s),e.layouts=s.layouts,e.routes=s.routes,e.entries=s.entries,e.serviceWorkers=s.serviceWorkers,e.menus=s.menus,t()},r).finally(()=>{e.activeBuild=null})})),e.activeBuild}function it(e,t){if(!e.opts.rewriteRoutes||!t.routes)return;const r=[];let n=e.opts.rewriteRoutes.flatMap(s=>Object.keys(s.paths||{}));n=Array.from(new Set(n)),t.routes.forEach(s=>{r.push(s),(s.pathname.split("/").some(a=>n.includes(a))||s.pathname==="/")&&e.opts.rewriteRoutes.forEach((a,u)=>{if(s.pathname==="/"&&!a.prefix)return;const c=ot(s,a,u);r.some(l=>l.pathname===c.pathname&&l.routeName===c.routeName)||r.push(c)})}),t.routes=r}function ot(e,t,r){const n=_=>(t.paths||{})[_]??_,s=t.prefix?"/"+t.prefix:"",i=t.prefix?t.prefix+"/":"",o=t.prefix?.toUpperCase().replace(/-/g,""),a=t.prefix?[t.prefix]:[],c=e.pathname.split("/").map(n),f=e.routeName.split("/").map(n),d=e.pattern.toString().split("\\/"),[h,...p]=d.map(n),v=[h,...a,...p].join("\\/"),g=v.substring(1,e.pathname==="/"?v.length-1:v.length-2),S=e.segments.map(_=>_.map(U=>({...U,content:n(U.content)})));t.prefix&&S.splice(0,0,[{content:t.prefix,dynamic:!1,rest:!1}]);const $=c.join("/"),E=f.join("/");return{...e,id:e.id+(o||r),pathname:s+$,routeName:i+(E!=="/"?E:""),pattern:new RegExp(g),segments:S}}function at(e){const t=Array.from(new Set(e.routes.map(r=>r.pathname))).sort();for(const r of t){const n=e.routes.filter(s=>s.pathname===r);n.length>1&&Z(e,`More than one route has been found for pathname "${r}". Please narrow it down to only one of these:
3
+ `);const f=h.basename(l);if(oe(f)){const v=h.dirname(l);let d=C(e,v);return s.length>1?d+="?"+s[1]:i.length>1&&(d+="#"+i[1]),d}}else a===""&&(r.endsWith("/")?globalThis.__NO_TRAILING_SLASH__&&(r=r.slice(0,-1)):globalThis.__NO_TRAILING_SLASH__||(r+="/"));return r}function Fe(e,t){return{pathname:De(e,t),filePath:t}}function Ue(e,t){return Fe(e,t.filePath)}async function Be(e,t,r){const n=Je(e,t,r),s=R(e.routesDir,t);return`${`const ${s} = ${JSON.stringify(n,null,2)};`} export default ${s}`}function Je(e,t,r,n=!0){const s=we.marked.lexer(r,{});let i=0;const o=[];for(const a of s)if(a.type==="heading"){const u=i-a.depth;if(u>=0&&(o.length-=u+1),u<-1)throw new Error(`Menu hierarchy skipped a level, went from <h${"#".repeat(i)}> to <h${"#".repeat(a.depth)}>, in menu: ${t}`);i=a.depth;const c=o[o.length-1];for(const l of a.tokens||[]){const f={text:""};if(l.type==="text")f.text=l.text;else if(l.type==="link")f.text=l.text,f.href=A(e,t,l.href,n);else throw new Error(`Headings can only be a text or link. Received "${l.type}", value "${l.raw}", in menu: ${t}`);c&&(c.items=c.items||[],c.items.push(f)),o.push(f)}}else if(a.type==="list"){const u=o[o.length-1];u.items=u.items||[];for(const c of a.items)if(c.type==="list_item")for(const l of c.tokens)if(l.type==="text")for(const f of l.tokens)if(f.type==="text")u.items.push({text:f.text});else if(f.type==="link")u.items.push({text:f.text,href:A(e,t,f.href,n)});else throw new Error(`List items can only be a text or link. Received "${f.type}", value "${f.raw}", in menu: ${t}`);else if(l.type==="link")u.items.push({text:l.text,href:A(e,t,l.href,n)});else throw new Error(`List items can only be a text or link. Received "${l.type}", value "${l.raw}", in menu: ${t}`);else throw new Error(`Only list items can be used in lists. Received "${c.type}", value "${c.raw}", in menu: ${t}`)}else{if(a.type==="space")continue;throw new Error(`Menu has a "${a.type}" with the value "${a.raw}". However, only headings and lists can be used in the menu: ${t}`)}if(o.length===0)throw new Error(`Menu must start with an h1 in the index: ${t}`);return o[0]}function U(e,t){if(t===e)return{pattern:new RegExp("^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"$"),routeName:t,paramNames:[],segments:[[{content:"",dynamic:!1,rest:!1}]]};t=t.slice(1);const r=t.split("/"),n=[];return{pattern:new RegExp(`^${r.filter(i=>i.length>0).map(i=>{const o=decodeURI(i),a=/^\[\.\.\.(\w+)?\]$/.exec(o);return a?(n.push(a[1]),"(?:/(.*))?"):"/"+o.split(ze).map((u,c)=>{if(c%2){const l=Ge.exec(u);if(l){const[,f,m]=l;return n.push(m),f?"(.*?)":"([^/]+?)"}}return encodeURI(u).normalize().replace(/%5[Bb]/g,"[").replace(/%5[Dd]/g,"]").replace(/#/g,"%23").replace(/\?/g,"%3F").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("")}).join("")}/?$`),routeName:t,paramNames:n,segments:r.map(i=>{const o=[];return i.split(/\[(.+?)\]/).map((a,u)=>{if(a){const c=!!(u%2);o.push({content:a,dynamic:c,rest:c&&a.startsWith("...")})}}),o})}}const Ge=/^(\.\.\.)?(\w+)?$/,ze=/\[(.+?)\]/;function Qe(e,t){const r=Math.max(e.segments.length,t.segments.length);for(let n=0;n<r;n+=1){const s=e.segments[n],i=t.segments[n];if(!s)return e.pathname.includes("[...")?1:-1;if(!i)return t.pathname.includes("[...")?-1:1;const o=Math.max(s.length,i.length);for(let a=0;a<o;a+=1){const u=s[a],c=i[a];if(u===void 0)return c.dynamic?-1:1;if(c===void 0||u.dynamic!==c.dynamic)return u.dynamic?1:-1;if(u.dynamic&&u.rest!==c.rest)return u.rest?1:-1}}return e.pathname===t.pathname?e.ext>t.ext?-1:1:e.pathname<t.pathname?-1:1}function Ke(e,t){const r=t.filter(l=>l.type==="layout").map(l=>Ve(e,l)).sort((l,f)=>l.id<f.id?-1:1),n=t.filter(l=>l.type==="route").map(l=>Ze(e,r,l)).sort(Qe),s=t.filter(l=>l.type==="entry").map(l=>et(e,l)).sort((l,f)=>l.chunkFileName<f.chunkFileName?-1:1),i=t.filter(l=>l.type==="service-worker").map(l=>tt(e,l)).sort((l,f)=>l.chunkFileName<f.chunkFileName?-1:1),o=t.filter(l=>l.type==="menu").map(l=>Ue(e,l)).sort((l,f)=>l.pathname<f.pathname?-1:1);let a=0;const u=new Set,c=l=>{for(const f of l){let m=f.id;for(;u.has(m);)m=`${f.id}_${a++}`;f.id=m,u.add(m)}};return c(r),c(n),c(s),c(i),{layouts:r,routes:n,entries:s,menus:o,serviceWorkers:i}}function Ve(e,t){let r=t.extlessName;const n=t.filePath,s=t.dirPath;let i,o;return r.endsWith(Xe)?(o="top",r=r.slice(0,r.length-1)):o="nested",r.startsWith(G)?i=r.slice(G.length):i="",{id:R(e.routesDir,n),filePath:n,dirPath:s,layoutType:o,layoutName:i}}const Ye="layout",G=Ye+"-",Xe="!";function Ze(e,t,r){const n=r.filePath,s=[],i=e.routesDir,{layoutName:o,layoutStop:a}=_e(r.extlessName);let u=C(e,r.dirPath);if(r.extlessName==="404"&&(u+=r.extlessName+".html"),!a){let l=b(h.dirname(n)),f=!1;const m=o!=="";for(let v=0;v<20;v++){let d;if(m&&!f?(d=t.find(p=>p.dirPath===l&&p.layoutName===o),d&&(f=!0)):d=t.find(p=>p.dirPath===l&&p.layoutName===""),d&&(s.push(d),d.layoutType==="top")||l===i)break;l=b(h.dirname(l))}}return{id:R(e.routesDir,n,"Route"),filePath:n,pathname:u,layouts:s.reverse(),ext:r.ext,...U(e.basePathname,u)}}function et(e,t){const r=C(e,t.dirPath),n=r.slice(e.basePathname.length);return{id:R(e.routesDir,t.filePath,"Route"),filePath:t.filePath,chunkFileName:n,...U(e.basePathname,r)}}function tt(e,t){const n=C(e,t.dirPath)+t.extlessName+".js",s=n.slice(e.basePathname.length);return{id:R(e.routesDir,t.filePath,"ServiceWorker"),filePath:t.filePath,chunkFileName:s,...U(e.basePathname,n)}}async function rt(e){const t=[];return await ae(t,b(e),h.basename(e)),t}async function ae(e,t,r){const n=await S.promises.readdir(t);await Promise.all(n.map(async s=>{const i=b(h.join(t,s));if((await S.promises.stat(i)).isDirectory())await ae(e,i,s);else{const a=oe(s);a!==null&&e.push({...a,fileName:s,filePath:i,dirName:r,dirPath:t})}}))}async function nt(e){const t=e.serverPluginsDir,r=await S.promises.readdir(t),n=[];return await Promise.all(r.map(async s=>{const i=b(h.join(t,s)),o=_(s),a=k(s);(H(o)||se(o))&&We(a)&&n.push({id:R(e.serverPluginsDir,i,"Plugin"),filePath:i,ext:o})})),n}async function ue(e){try{await st(e),at(e)}catch(t){Z(e,t)}for(const t of e.diagnostics){if(t.type==="error")throw new Error(t.message);console.warn(t.message)}}async function st(e){return e.activeBuild||(e.activeBuild=new Promise((t,r)=>{nt(e.opts).then(n=>(e.serverPlugins=n,rt(e.opts.routesDir))).then(n=>{const s=Ke(e.opts,n);it(e,s),e.layouts=s.layouts,e.routes=s.routes,e.entries=s.entries,e.serviceWorkers=s.serviceWorkers,e.menus=s.menus,t()},r).finally(()=>{e.activeBuild=null})})),e.activeBuild}function it(e,t){if(!e.opts.rewriteRoutes||!t.routes)return;const r=[];let n=e.opts.rewriteRoutes.flatMap(s=>Object.keys(s.paths||{}));n=Array.from(new Set(n)),t.routes.forEach(s=>{r.push(s),(s.pathname.split("/").some(a=>n.includes(a))||s.pathname==="/")&&e.opts.rewriteRoutes.forEach((a,u)=>{if(s.pathname==="/"&&!a.prefix)return;const c=ot(s,a,u);r.some(l=>l.pathname===c.pathname&&l.routeName===c.routeName)||r.push(c)})}),t.routes=r}function ot(e,t,r){const n=E=>(t.paths||{})[E]??E,s=t.prefix?"/"+t.prefix:"",i=t.prefix?t.prefix+"/":"",o=t.prefix?.toUpperCase().replace(/-/g,""),a=t.prefix?[t.prefix]:[],c=e.pathname.split("/").map(n),f=e.routeName.split("/").map(n),m=e.pattern.toString().split("\\/"),[v,...d]=m.map(n),g=[v,...a,...d].join("\\/"),y=g.substring(1,e.pathname==="/"?g.length-1:g.length-2),P=e.segments.map(E=>E.map(W=>({...W,content:n(W.content)})));t.prefix&&P.splice(0,0,[{content:t.prefix,dynamic:!1,rest:!1}]);const x=c.join("/"),w=f.join("/");return{...e,id:e.id+(o||r),pathname:s+x,routeName:i+(w!=="/"?w:""),pattern:new RegExp(y),segments:P}}function at(e){const t=Array.from(new Set(e.routes.map(r=>r.pathname))).sort();for(const r of t){const n=e.routes.filter(s=>s.pathname===r);n.length>1&&Z(e,`More than one route has been found for pathname "${r}". Please narrow it down to only one of these:
4
4
  ${n.map(s=>` - ${s.filePath}`).join(`
5
- `)}`)}e.layouts.filter(r=>r.layoutType==="top").forEach(r=>{Ne(e,`The "top" layout feature, which is used by "${r.filePath}" has been deprecated and will be removed from future versions. In most cases the "group" layout feature can be used in its place: https://qwik.dev/docs/advanced/routing/`)})}function ut(e,t,r,n,s){return{rootDir:w(e),opts:ct(e,t,r),routes:[],serverPlugins:[],layouts:[],entries:[],serviceWorkers:[],menus:[],diagnostics:[],frontmatter:new Map,target:n||"ssr",dynamicImports:n==="client"||!!s,isDirty:!0,activeBuild:null}}function lt(e){e&&(e.routes.length=0,e.layouts.length=0,e.entries.length=0,e.menus.length=0,e.diagnostics.length=0,e.frontmatter.clear(),e.isDirty=!0)}function ct(e,t,r){t.startsWith("/")&&t.endsWith("/")||(console.error("warning: vite's config.base must begin and end with /. This will be an error in v2. If you have a valid use case, please open an issue."),t.endsWith("/")||(t+="/"));const n={...r};typeof n.routesDir!="string"?n.routesDir=m.resolve(e,"src","routes"):m.isAbsolute(n.routesDir)||(n.routesDir=m.resolve(e,n.routesDir)),n.routesDir=w(n.routesDir),typeof n.serverPluginsDir!="string"?n.serverPluginsDir=n.routesDir:m.isAbsolute(n.serverPluginsDir)||(n.serverPluginsDir=m.resolve(e,n.serverPluginsDir)),n.serverPluginsDir=w(n.serverPluginsDir),typeof n.baseUrl=="string"&&(n.basePathname=n.baseUrl),typeof n.basePathname!="string"&&(n.basePathname=t),n.basePathname.endsWith("/")||(console.error("Warning: qwik-router plugin basePathname must end with /. This will be an error in v2"),n.basePathname+="/");const s=new URL(n.basePathname,"https://qwik.dev/");return n.basePathname=s.pathname,n.mdx=n.mdx||{},n.platform=n.platform||{},n}function ft(e){return(t,r)=>{const n={};x.visit(t,"yaml",s=>{const i=dt(s.value);for(const o in i)n[o]=i[o]}),Object.keys(n).length>0&&e.frontmatter.set(w(r.path),n)}}function dt(e){return typeof e=="string"&&(e=e.trim(),e!=="")?be.parse(e):null}const ht={author:!0,creator:!0,"color-scheme":!0,description:!0,generator:!0,keywords:!0,publisher:!0,referrer:!0,robots:!0,"theme-color":!0,viewport:!0};function pt(e){if(e!=null&&typeof e=="object"){const t=Object.keys(e);if(t.length>0){const r={title:"",meta:[],styles:[],links:[],scripts:[],frontmatter:{}};for(const n of t){const s=e[n];if(s!=null)if(n==="title")r.title=s.toString(),r.title=r.title.replace(/\\@/g,"@");else if(n==="og"||n==="opengraph"){if(typeof s=="object"){for(const i of Array.isArray(s)?s:[s])if(i!=null&&typeof i=="object"&&!Array.isArray(i))for(const[o,a]of Object.entries(i))(o==="title"||o==="description")&&a===!0?t.includes(o)&&r.meta.push({property:`og:${o}`,content:e[o]?.toString()}):r.meta.push({property:`og:${o}`,content:a?.toString()})}}else ht[n]?r.meta.push({name:n,content:s.toString()}):r.frontmatter[n]=s}return r}}return null}function mt(){return e=>{const t=e,r=new Pe;x.visit(t,"element",n=>{if(X.headingRank(n)&&n.properties){const i=C.toString(n);le(n,"id")||(n.properties.id=r.slug(i))}})}}function gt(e){return(t,r)=>{const n=t,s=w(r.path);vt(n,e.opts,s),bt(e,n,s),Pt(e,n,s),St(n)}}function yt(){return e=>{const t=e;x.visit(t,"element",r=>{r.properties&&r.properties.className&&(r.properties.class=r.properties.className,r.properties.className=void 0)})}}function wt(){return e=>{const t=e;x.visit(t,"element",r=>{if(r.tagName==="table"&&!r.done){const n={...r};n.done=!0,r.tagName="div",r.properties={className:"table-wrapper"},r.children=[n]}})}}function vt(e,t,r){x.visit(e,"element",n=>{if((n&&n.type==="element"&&n.tagName.toLowerCase())==="a"){const i=(n.properties&&n.properties.href||"").trim();if(te(i)){const o=N(i);q(o)&&(n.properties.href=j(t,r,n.properties.href,!0))}}})}function bt(e,t,r){const n=e.frontmatter.get(r);F(t,"frontmatter",n)}function Pt(e,t,r){const n=e.frontmatter.get(r),s=pt(n);s&&F(t,"head",s)}function St(e){const t=[];x.visit(e,"element",r=>{const n=X.headingRank(r);if(n&&r.properties&&le(r,"id")){const s=C.toString(r);t.push({text:s,id:r.properties.id,level:n})}}),t.length>0&&F(e,"headings",t)}function F(e,t,r){const n={type:"mdxjsEsm",value:"",data:{estree:{type:"Program",sourceType:"module",body:[{type:"ExportNamedDeclaration",source:null,specifiers:[],attributes:[],declaration:{type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:t},init:Se.valueToEstree(r)}]}}]}}};e.children.unshift(n)}const xt={}.hasOwnProperty;function le(e,t){const r=e&&typeof e=="object"&&e.type==="element"&&e.properties&&xt.call(e.properties,t)&&e.properties[t];return r!=null&&r!==!1}function kt(){return M.refractor.register(xe),async e=>{x.visit(e,"element",(t,r,n)=>{if(!(!n||n.tagName!=="pre"||t.tagName!=="code"||!Array.isArray(t.properties.className)))for(let s=0;s<t.properties.className.length;s++){const i=t.properties.className[s],o=It(i);if(o&&M.refractor.registered(o)){t.properties.className[s]="language-"+o,Et(t,o);return}}})}}function Et(e,t){const r=C.toString(e),n=M.refractor.highlight(r,t);n&&Array.isArray(e.children)&&(e.children=n.children)}function It(e){return typeof e=="string"&&(e=e.toLowerCase(),e.startsWith("language-"))?e.slice(9):null}async function Rt(e){const{compile:t}=await import("@mdx-js/mdx"),{default:r}=await import("remark-frontmatter"),{default:n}=await import("remark-gfm"),{default:s}=await import("rehype-autolink-headings"),{VFile:i}=await import("vfile"),o=e.opts.mdx,a=o.remarkPlugins||[],u=o.rehypePlugins||[],c=e.opts.mdxPlugins,l=[];(typeof c?.remarkGfm>"u"||c.remarkGfm)&&l.push(n);const f=[];(typeof c?.rehypeSyntaxHighlight>"u"||c.rehypeSyntaxHighlight)&&f.push(kt),(typeof c?.rehypeAutolinkHeadings>"u"||c.rehypeAutolinkHeadings)&&f.push(s);const d={SourceMapGenerator:ve.SourceMapGenerator,jsxImportSource:"@qwik.dev/core",...o,elementAttributeNameCase:"html",remarkPlugins:[...a,...l,r,[ft,e]],rehypePlugins:[mt,...u,...f,[gt,e],yt,wt]};return async function(h,p){const y=N(p);if([".mdx",".md",".markdown"].includes(y)){const v=new i({value:h,path:p}),g=await t(v,d),S=String(g.value),$=`import { jsx } from '@qwik.dev/core';
6
- `,E=`
5
+ `)}`)}e.layouts.filter(r=>r.layoutType==="top").forEach(r=>{Ne(e,`The "top" layout feature, which is used by "${r.filePath}" has been deprecated and will be removed from future versions. In most cases the "group" layout feature can be used in its place: https://qwik.dev/docs/advanced/routing/`)})}function ut(e,t,r,n,s){return{rootDir:b(e),opts:ct(e,t,r),routes:[],serverPlugins:[],layouts:[],entries:[],serviceWorkers:[],menus:[],diagnostics:[],frontmatter:new Map,target:n||"ssr",dynamicImports:n==="client"||!!s,isDirty:!0,activeBuild:null}}function lt(e){e&&(e.routes.length=0,e.layouts.length=0,e.entries.length=0,e.menus.length=0,e.diagnostics.length=0,e.frontmatter.clear(),e.isDirty=!0)}function ct(e,t,r){t.startsWith("/")&&t.endsWith("/")||(console.error("warning: vite's config.base must begin and end with /. This will be an error in v2. If you have a valid use case, please open an issue."),t.endsWith("/")||(t+="/"));const n={...r};typeof n.routesDir!="string"?n.routesDir=h.resolve(e,"src","routes"):h.isAbsolute(n.routesDir)||(n.routesDir=h.resolve(e,n.routesDir)),n.routesDir=b(n.routesDir),typeof n.serverPluginsDir!="string"?n.serverPluginsDir=n.routesDir:h.isAbsolute(n.serverPluginsDir)||(n.serverPluginsDir=h.resolve(e,n.serverPluginsDir)),n.serverPluginsDir=b(n.serverPluginsDir),typeof n.baseUrl=="string"&&(n.basePathname=n.baseUrl),typeof n.basePathname!="string"&&(n.basePathname=t),n.basePathname.endsWith("/")||(console.error("Warning: qwik-router plugin basePathname must end with /. This will be an error in v2"),n.basePathname+="/");const s=new URL(n.basePathname,"https://qwik.dev/");return n.basePathname=s.pathname,n.mdx=n.mdx||{},n.platform=n.platform||{},n}function ft(e){return(t,r)=>{const n={};I.visit(t,"yaml",s=>{const i=dt(s.value);for(const o in i)n[o]=i[o]}),Object.keys(n).length>0&&e.frontmatter.set(b(r.path),n)}}function dt(e){return typeof e=="string"&&(e=e.trim(),e!=="")?be.parse(e):null}const ht={author:!0,creator:!0,"color-scheme":!0,description:!0,generator:!0,keywords:!0,publisher:!0,referrer:!0,robots:!0,"theme-color":!0,viewport:!0};function pt(e){if(e!=null&&typeof e=="object"){const t=Object.keys(e);if(t.length>0){const r={title:"",meta:[],styles:[],links:[],scripts:[],frontmatter:{}};for(const n of t){const s=e[n];if(s!=null)if(n==="title")r.title=s.toString(),r.title=r.title.replace(/\\@/g,"@");else if(n==="og"||n==="opengraph"){if(typeof s=="object"){for(const i of Array.isArray(s)?s:[s])if(i!=null&&typeof i=="object"&&!Array.isArray(i))for(const[o,a]of Object.entries(i))(o==="title"||o==="description")&&a===!0?t.includes(o)&&r.meta.push({property:`og:${o}`,content:e[o]?.toString()}):r.meta.push({property:`og:${o}`,content:a?.toString()})}}else ht[n]?r.meta.push({name:n,content:s.toString()}):r.frontmatter[n]=s}return r}}return null}function mt(){return e=>{const t=e,r=new Pe;I.visit(t,"element",n=>{if(X.headingRank(n)&&n.properties){const i=q.toString(n);le(n,"id")||(n.properties.id=r.slug(i))}})}}function gt(e){return(t,r)=>{const n=t,s=b(r.path);vt(n,e.opts,s),bt(e,n,s),Pt(e,n,s),xt(n)}}function yt(){return e=>{const t=e;I.visit(t,"element",r=>{r.properties&&r.properties.className&&(r.properties.class=r.properties.className,r.properties.className=void 0)})}}function wt(){return e=>{const t=e;I.visit(t,"element",r=>{if(r.tagName==="table"&&!r.done){const n={...r};n.done=!0,r.tagName="div",r.properties={className:"table-wrapper"},r.children=[n]}})}}function vt(e,t,r){I.visit(e,"element",n=>{if((n&&n.type==="element"&&n.tagName.toLowerCase())==="a"){const i=(n.properties&&n.properties.href||"").trim();if(te(i)){const o=_(i);F(o)&&(n.properties.href=A(t,r,n.properties.href,!0))}}})}function bt(e,t,r){const n=e.frontmatter.get(r);B(t,"frontmatter",n)}function Pt(e,t,r){const n=e.frontmatter.get(r),s=pt(n);s&&B(t,"head",s)}function xt(e){const t=[];I.visit(e,"element",r=>{const n=X.headingRank(r);if(n&&r.properties&&le(r,"id")){const s=q.toString(r);t.push({text:s,id:r.properties.id,level:n})}}),t.length>0&&B(e,"headings",t)}function B(e,t,r){const n={type:"mdxjsEsm",value:"",data:{estree:{type:"Program",sourceType:"module",body:[{type:"ExportNamedDeclaration",source:null,specifiers:[],attributes:[],declaration:{type:"VariableDeclaration",kind:"const",declarations:[{type:"VariableDeclarator",id:{type:"Identifier",name:t},init:xe.valueToEstree(r)}]}}]}}};e.children.unshift(n)}const St={}.hasOwnProperty;function le(e,t){const r=e&&typeof e=="object"&&e.type==="element"&&e.properties&&St.call(e.properties,t)&&e.properties[t];return r!=null&&r!==!1}function kt(){return L.refractor.register(Se),async e=>{I.visit(e,"element",(t,r,n)=>{if(!(!n||n.tagName!=="pre"||t.tagName!=="code"||!Array.isArray(t.properties.className)))for(let s=0;s<t.properties.className.length;s++){const i=t.properties.className[s],o=It(i);if(o&&L.refractor.registered(o)){t.properties.className[s]="language-"+o,Et(t,o);return}}})}}function Et(e,t){const r=q.toString(e),n=L.refractor.highlight(r,t);n&&Array.isArray(e.children)&&(e.children=n.children)}function It(e){return typeof e=="string"&&(e=e.toLowerCase(),e.startsWith("language-"))?e.slice(9):null}async function Rt(e){const{compile:t}=await import("@mdx-js/mdx"),{default:r}=await import("remark-frontmatter"),{default:n}=await import("remark-gfm"),{default:s}=await import("rehype-autolink-headings"),{VFile:i}=await import("vfile"),o=e.opts.mdx,a=o.remarkPlugins||[],u=o.rehypePlugins||[],c=e.opts.mdxPlugins,l=[];(typeof c?.remarkGfm>"u"||c.remarkGfm)&&l.push(n);const f=[];(typeof c?.rehypeSyntaxHighlight>"u"||c.rehypeSyntaxHighlight)&&f.push(kt),(typeof c?.rehypeAutolinkHeadings>"u"||c.rehypeAutolinkHeadings)&&f.push(s);const m={SourceMapGenerator:ve.SourceMapGenerator,jsxImportSource:"@qwik.dev/core",...o,elementAttributeNameCase:"html",remarkPlugins:[...a,...l,r,[ft,e]],rehypePlugins:[mt,...u,...f,[gt,e],yt,wt]};return async function(v,d){const p=_(d);if([".mdx",".md",".markdown"].includes(p)){const g=new i({value:v,path:d}),y=await t(g,m),P=String(y.value),x=`import { jsx } from '@qwik.dev/core';
6
+ `,w=`
7
7
  function _missingMdxReference(id, component, place) {
8
- throw new Error("${p}: Expected " + (component ? "component" : "object") + " \`" + id + "\` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\\nIt’s referenced in your code at \`" + place + "\`" : ""));
8
+ throw new Error("${d}: Expected " + (component ? "component" : "object") + " \`" + id + "\` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\\nIt’s referenced in your code at \`" + place + "\`" : ""));
9
9
  }
10
10
  const WrappedMdxContent = () => {
11
11
  const content = _createMdxContent({});
12
12
  return typeof MDXLayout === 'function' ? jsx(MDXLayout, {children: content}) : content;
13
13
  };
14
14
  export default WrappedMdxContent;
15
- `,A=S.lastIndexOf("export default ");if(A===-1)throw new Error("Could not find default export in mdx output");return{code:$+S.slice(0,A)+E,map:g.map}}}}function Nt(e,t){const r=e.target==="client",n=[...e.entries,...e.serviceWorkers];r&&n.length>0&&(t.push(`
15
+ `,D=P.lastIndexOf("export default ");if(D===-1)throw new Error("Could not find default export in mdx output");return{code:x+P.slice(0,D)+w,map:y.map}}}}function Nt(e,t){const r=e.target==="client",n=[...e.entries,...e.serviceWorkers];r&&n.length>0&&(t.push(`
16
16
  /** Qwik Router Entries Entry */`),t.push(`export const e = () => import("@qwik-router-entries");
17
17
  `))}function $t(e){const t=[],r=[...e.entries,...e.serviceWorkers];t.push(`
18
18
  /** Qwik Router Entries (${r.length}) */`);for(let n=0;n<r.length;n++){const s=r[n];t.push(`export const ${s.id} = () => import(${JSON.stringify(s.filePath)});`)}return t.join(`
19
19
  `)+`
20
- `}function T(e){const t=e.toLowerCase();return t.endsWith(".tsx")||t.endsWith(".jsx")?e.slice(0,e.length-4):t.endsWith(".ts")?e.slice(0,e.length-3):e}function _t(e,t,r,n){t.push(`
21
- /** Qwik Router Menus (${e.menus.length}) */`),t.push("export const menus = [");const s=!n,i=e.opts.routesDir;for(const o of e.menus){const a=JSON.stringify(T(o.filePath));if(s)t.push(` [${JSON.stringify(o.pathname)}, ()=>import(${a})],`);else{const u=k(i,o.filePath);r.push(`import * as ${u} from ${a};`),t.push(` [${JSON.stringify(o.pathname)}, ()=>${u}],`)}}t.push("];")}function Ot(e,t,r,n,s){const i=s,o=e.dynamicImports;if(e.layouts.length>0){r.push(`
22
- /** Qwik Router Layouts (${e.layouts.length}) */`);for(const a of e.layouts){const u=JSON.stringify(T(a.filePath));o?r.push(`const ${a.id} = ()=>import(${u});`):(n.push(`import * as ${a.id}_ from ${u};`),r.push(`const ${a.id} = ()=>${a.id}_;`))}}r.push(`
23
- /** Qwik Router Routes (${e.routes.length}) */`),r.push("export const routes = [");for(const a of e.routes){const u=[];if(Me(a.ext)){for(const l of a.layouts)u.push(l.id);const c=T(a.filePath);o?u.push(`()=>import(${JSON.stringify(c)})`):(n.push(`import * as ${a.id} from ${JSON.stringify(c)};`),u.push(`()=>${a.id}`))}else if(i&&L(a.ext)){const c=T(a.filePath);n.push(`import * as ${a.id} from ${JSON.stringify(c)};`);for(const l of a.layouts)u.push(l.id);u.push(`()=>${a.id}`)}u.length>0&&r.push(` ${Dt(t,a,u,s)},`)}r.push("];")}function Dt(e,t,r,n){const s=JSON.stringify(t.routeName),i=`[ ${r.join(", ")} ]`;if(n){const o=JSON.stringify(t.pathname),a=JSON.stringify(Tt(e,t));return`[ ${s}, ${i}, ${o}, ${a} ]`}return`[ ${s}, ${i} ]`}function Tt(e,t){const r=[],n=e.api.getManifest();if(n){const s=Object.keys(n.bundles),i=o=>{o=P(o);for(const a of s){const u=n.bundles[a];if(u.origins)for(const c of u.origins){const l=P(c);o.endsWith(l)&&(r.includes(a)||r.push(a))}}};for(const o of t.layouts)i(o.filePath);i(t.filePath)}return r}function jt(e,t,r,n,s){if(r.push(`
24
- /** Qwik Router ServerPlugins (${e.serverPlugins.length}) */`),r.push("export const serverPlugins = ["),s){for(const i of e.serverPlugins){const o=JSON.stringify(T(i.filePath));n.push(`import * as ${i.id} from ${o};`)}for(const i of e.serverPlugins)r.push(` ${i.id},`)}r.push("];")}function Wt(e,t,r){const n=[],s=[];return s.push(`
20
+ `}function j(e){const t=e.toLowerCase();return t.endsWith(".tsx")||t.endsWith(".jsx")?e.slice(0,e.length-4):t.endsWith(".ts")?e.slice(0,e.length-3):e}function _t(e,t,r,n){t.push(`
21
+ /** Qwik Router Menus (${e.menus.length}) */`),t.push("export const menus = [");const s=!n,i=e.opts.routesDir;for(const o of e.menus){const a=JSON.stringify(j(o.filePath));if(s)t.push(` [${JSON.stringify(o.pathname)}, ()=>import(${a})],`);else{const u=R(i,o.filePath);r.push(`import * as ${u} from ${a};`),t.push(` [${JSON.stringify(o.pathname)}, ()=>${u}],`)}}t.push("];")}function Dt(e,t,r,n,s){const i=s,o=e.dynamicImports;if(e.layouts.length>0){r.push(`
22
+ /** Qwik Router Layouts (${e.layouts.length}) */`);for(const a of e.layouts){const u=JSON.stringify(j(a.filePath));o?r.push(`const ${a.id} = ()=>import(${u});`):(n.push(`import * as ${a.id}_ from ${u};`),r.push(`const ${a.id} = ()=>${a.id}_;`))}}r.push(`
23
+ /** Qwik Router Routes (${e.routes.length}) */`),r.push("export const routes = [");for(const a of e.routes){const u=[];if(Ce(a.ext)){for(const l of a.layouts)u.push(l.id);const c=j(a.filePath);o?u.push(`()=>import(${JSON.stringify(c)})`):(n.push(`import * as ${a.id} from ${JSON.stringify(c)};`),u.push(`()=>${a.id}`))}else if(i&&H(a.ext)){const c=j(a.filePath);n.push(`import * as ${a.id} from ${JSON.stringify(c)};`);for(const l of a.layouts)u.push(l.id);u.push(`()=>${a.id}`)}u.length>0&&r.push(` ${Ot(t,a,u,s)},`)}r.push("];")}function Ot(e,t,r,n){const s=JSON.stringify(t.routeName),i=`[ ${r.join(", ")} ]`;if(n){const o=JSON.stringify(t.pathname),a=JSON.stringify(Tt(e,t));return`[ ${s}, ${i}, ${o}, ${a} ]`}return`[ ${s}, ${i} ]`}function Tt(e,t){const r=[],n=e.api.getManifest();if(n){const s=Object.keys(n.bundles),i=o=>{o=k(o);for(const a of s){const u=n.bundles[a];if(u.origins)for(const c of u.origins){const l=k(c);o.endsWith(l)&&(r.includes(a)||r.push(a))}}};for(const o of t.layouts)i(o.filePath);i(t.filePath)}return r}function jt(e,t,r,n,s){if(r.push(`
24
+ /** Qwik Router ServerPlugins (${e.serverPlugins.length}) */`),r.push("export const serverPlugins = ["),s){for(const i of e.serverPlugins){const o=JSON.stringify(j(i.filePath));n.push(`import * as ${i.id} from ${o};`)}for(const i of e.serverPlugins)r.push(` ${i.id},`)}r.push("];")}function Wt(e,t,r){const n=[],s=[];return s.push(`
25
25
  /** Qwik Router Config */`),s.push(`
26
- import { isDev } from '@qwik.dev/core/build';`),jt(e,t,s,n,r),Ot(e,t,s,n,r),_t(e,s,n,r),Nt(e,s),s.push(`export const trailingSlash = ${JSON.stringify(!globalThis.__NO_TRAILING_SLASH__)};`),s.push(`export const basePathname = ${JSON.stringify(e.opts.basePathname)};`),s.push("export const cacheModules = !isDev;"),s.push("export default { routes, serverPlugins, menus, trailingSlash, basePathname, cacheModules };"),n.join(`
26
+ import { isDev } from '@qwik.dev/core/build';`),jt(e,t,s,n,r),Dt(e,t,s,n,r),_t(e,s,n,r),Nt(e,s),s.push(`export const trailingSlash = ${JSON.stringify(!globalThis.__NO_TRAILING_SLASH__)};`),s.push(`export const basePathname = ${JSON.stringify(e.opts.basePathname)};`),s.push("export const cacheModules = !isDev;"),s.push("export default { routes, serverPlugins, menus, trailingSlash, basePathname, cacheModules };"),n.join(`
27
27
  `)+s.join(`
28
- `)}function At(e,t){let r,n="/service-worker.js";if(e.serviceWorkers.length===0)r=Mt;else{r=t;const s=e.serviceWorkers.sort((i,o)=>i.chunkFileName.length<o.chunkFileName.length?-1:1)[0];n=e.opts.basePathname+s.chunkFileName}return r=r.replace("__url",n),`export default ${JSON.stringify(r)};`}const Mt=`
28
+ `)}function At(e,t){let r,n="/service-worker.js";if(e.serviceWorkers.length===0)r=Ct;else{r=t;const s=e.serviceWorkers.sort((i,o)=>i.chunkFileName.length<o.chunkFileName.length?-1:1)[0];n=e.opts.basePathname+s.chunkFileName}return r=r.replace("__url",n),`export default ${JSON.stringify(r)};`}const Ct=`
29
29
  "serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(r=>{for(const e of r){const c='__url'.split("/").pop();e.active?.scriptURL.endsWith(c||"service-worker.js")&&e.unregister().catch(console.error)}}),"caches"in window&&caches.keys().then(r=>{const e=r.find(c=>c.startsWith("QwikBuild"));e&&caches.delete(e).catch(console.error)}).catch(console.error)
30
- `;function Ct(e,t){const r={};e.forEach(n=>{const s=P(n.filePath),i=n.layouts?n.layouts.map(u=>P(u.filePath)):[],o=[s,...i],a=[];for(const[u,c]of Object.entries(t.bundles))Lt(c,o)&&a.push(u);a.length>0&&(r[n.routeName]={dynamicImports:a})});for(const n of Object.keys(t.bundles)){const s=t.bundles[n];if(s.origins?.some(i=>i.endsWith(R))){r[n]={...s,dynamicImports:s.dynamicImports?.filter(i=>t.bundles[i].origins?.some(o=>o.endsWith("menu.md")))};break}}return r}function Lt(e,t){if(!e.origins)return!1;for(const r of e.origins){const n=P(r);return t.some(s=>s.endsWith(n))}}const qt=e=>{const t=e.stack;if(typeof t=="string"){const r=t.split(`
31
- `).filter(n=>!n.includes("/node_modules/")&&!n.includes("(node:"));for(let n=1;n<r.length;n++){const s=r[n].replace("file:///","/");if(/^\s+at/.test(s)){const i=s.indexOf("/"),o=s.lastIndexOf(")",i);if(i>0){const u=s.slice(i,o).split(":"),c=G(u[u.length-1]),l=G(u[u.length-2]);return typeof c=="number"&&typeof l=="number"?(u.length-=2,{file:u.join(":"),line:l,column:c}):typeof c=="number"?(u.length-=1,{file:u.join(":"),line:c,column:void 0}):{file:u.join(":"),line:void 0,column:void 0}}}}}},G=e=>{try{return parseInt(e,10)}catch{return}},ce=/\r?\n/,z=2;function Ht(e,t){if(typeof t=="number")return t;if(t.lo!=null)return t.lo;const r=e.split(ce),{line:n,column:s}=t;let i=0;for(let o=0;o<n-1&&o<r.length;o++)i+=r[o].length+1;return i+s}function Ft(e,t=0,r){t=Ht(e,t),r=r||t;const n=e.split(ce);let s=0;const i=[];for(let o=0;o<n.length;o++)if(s+=n[o].length+1,s>=t){for(let a=o-z;a<=o+z||r>s;a++){if(a<0||a>=n.length)continue;const u=a+1;i.push(`${u}${" ".repeat(Math.max(3-String(u).length,0))}| ${n[a]}`);const c=n[a].length;if(a===o){const l=Math.max(t-(s-c)+1,0),f=Math.max(1,r>s?c-l:r-t);i.push(" | "+" ".repeat(l)+"^".repeat(f))}else if(a>o){if(r>s){const l=Math.max(Math.min(r-s,c),1);i.push(" | "+"^".repeat(l))}s+=c+1}}break}return i.join(`
32
- `)}function Q(e){const[t,r]=e.split("?"),n=r||"";return{originalId:e,pathId:t,query:n?`?${r}`:"",params:new URLSearchParams(n)}}function Ut(e){const t=[".jpg",".jpeg",".png",".webp",".gif",".avif",".tiff"];return[import("vite-imagetools").then(({imagetools:r})=>r({exclude:[],extendOutputFormats(n){return{...n,jsx:()=>i=>{const o=i.map(c=>`${c.src} ${c.width}w`).join(", ");let a,u=0;for(let c=0;c<i.length;c++){const l=i[c];l.width>u&&(a=l,u=l.width)}return{srcSet:o,width:a?.width,height:a?.height}}}},defaultDirectives:n=>{if(n.searchParams.has("jsx")){const{jsx:s,...i}=Object.fromEntries(n.searchParams.entries());return new URLSearchParams({format:"webp",quality:"75",w:"200;400;600;800;1200",withoutEnlargement:"",...e?.imageOptimization?.jsxDirectives,...i,as:"jsx"})}return new URLSearchParams}})).catch(r=>(console.error("Error loading vite-imagetools, image imports are not available",r),null)),{name:"qwik-router-image-jsx",load:{order:"pre",handler:async r=>{const{params:n,pathId:s}=Q(r);if(m.extname(s).toLowerCase()===".svg"&&n.has("jsx"))return{code:await b.promises.readFile(s,"utf-8"),moduleSideEffects:!1}}},transform(r,n){n=n.toLowerCase();const{params:s,pathId:i}=Q(n);if(s.has("jsx")){const o=m.extname(i).toLowerCase();if(t.includes(o)){r.includes("srcSet")||this.error(`Image '${n}' could not be optimized to JSX`);const a=r.indexOf("export default");return{code:r.slice(0,a)+`
30
+ `;function Mt(e,t){const r={};e.forEach(n=>{const s=k(n.filePath),i=n.layouts?n.layouts.map(u=>k(u.filePath)):[],o=[s,...i],a=[];for(const[u,c]of Object.entries(t.bundles))Lt(c,o)&&a.push(u);a.length>0&&(r[n.routeName]={dynamicImports:a})});for(const n of Object.keys(t.bundles)){const s=t.bundles[n];if(s.origins?.some(i=>i.endsWith($))){r[n]={...s,dynamicImports:s.dynamicImports?.filter(i=>t.bundles[i].origins?.some(o=>o.endsWith("menu.md")))};break}}return r}function Lt(e,t){if(!e.origins)return!1;for(const r of e.origins){const n=k(r);return t.some(s=>s.endsWith(n))}}const qt=e=>{const t=e.stack;if(typeof t=="string"){const r=t.split(`
31
+ `).filter(n=>!n.includes("/node_modules/")&&!n.includes("(node:"));for(let n=1;n<r.length;n++){const s=r[n].replace("file:///","/");if(/^\s+at/.test(s)){const i=s.indexOf("/"),o=s.lastIndexOf(")",i);if(i>0){const u=s.slice(i,o).split(":"),c=z(u[u.length-1]),l=z(u[u.length-2]);return typeof c=="number"&&typeof l=="number"?(u.length-=2,{file:u.join(":"),line:l,column:c}):typeof c=="number"?(u.length-=1,{file:u.join(":"),line:c,column:void 0}):{file:u.join(":"),line:void 0,column:void 0}}}}}},z=e=>{try{return parseInt(e,10)}catch{return}},ce=/\r?\n/,Q=2;function Ht(e,t){if(typeof t=="number")return t;if(t.lo!=null)return t.lo;const r=e.split(ce),{line:n,column:s}=t;let i=0;for(let o=0;o<n-1&&o<r.length;o++)i+=r[o].length+1;return i+s}function Ft(e,t=0,r){t=Ht(e,t),r=r||t;const n=e.split(ce);let s=0;const i=[];for(let o=0;o<n.length;o++)if(s+=n[o].length+1,s>=t){for(let a=o-Q;a<=o+Q||r>s;a++){if(a<0||a>=n.length)continue;const u=a+1;i.push(`${u}${" ".repeat(Math.max(3-String(u).length,0))}| ${n[a]}`);const c=n[a].length;if(a===o){const l=Math.max(t-(s-c)+1,0),f=Math.max(1,r>s?c-l:r-t);i.push(" | "+" ".repeat(l)+"^".repeat(f))}else if(a>o){if(r>s){const l=Math.max(Math.min(r-s,c),1);i.push(" | "+"^".repeat(l))}s+=c+1}}break}return i.join(`
32
+ `)}function K(e){const[t,r]=e.split("?"),n=r||"";return{originalId:e,pathId:t,query:n?`?${r}`:"",params:new URLSearchParams(n)}}function Ut(e){const t=[".jpg",".jpeg",".png",".webp",".gif",".avif",".tiff"];return[import("vite-imagetools").then(({imagetools:r})=>r({exclude:[],extendOutputFormats(n){return{...n,jsx:()=>i=>{const o=i.map(c=>`${c.src} ${c.width}w`).join(", ");let a,u=0;for(let c=0;c<i.length;c++){const l=i[c];l.width>u&&(a=l,u=l.width)}return{srcSet:o,width:a?.width,height:a?.height}}}},defaultDirectives:n=>{if(n.searchParams.has("jsx")){const{jsx:s,...i}=Object.fromEntries(n.searchParams.entries());return new URLSearchParams({format:"webp",quality:"75",w:"200;400;600;800;1200",withoutEnlargement:"",...e?.imageOptimization?.jsxDirectives,...i,as:"jsx"})}return new URLSearchParams}})).catch(r=>(console.error("Error loading vite-imagetools, image imports are not available",r),null)),{name:"qwik-router-image-jsx",load:{order:"pre",handler:async r=>{const{params:n,pathId:s}=K(r);if(h.extname(s).toLowerCase()===".svg"&&n.has("jsx"))return{code:await S.promises.readFile(s,"utf-8"),moduleSideEffects:!1}}},transform(r,n){n=n.toLowerCase();const{params:s,pathId:i}=K(n);if(s.has("jsx")){const o=h.extname(i).toLowerCase();if(t.includes(o)){r.includes("srcSet")||this.error(`Image '${n}' could not be optimized to JSX`);const a=r.indexOf("export default");return{code:r.slice(0,a)+`
33
33
  import { _jsxSorted } from '@qwik.dev/core';
34
34
  const PROPS = {srcSet, width, height};
35
35
  export default function (props, key, _, dev) {
@@ -39,4 +39,4 @@ import { isDev } from '@qwik.dev/core/build';`),jt(e,t,s,n,r),Ot(e,t,s,n,r),_t(e
39
39
  const PROPS = ${JSON.stringify(a)};
40
40
  export default function (props, key, _, dev) {
41
41
  return _jsxSorted('svg', props, PROPS, undefined, 3, key, dev);
42
- }`,map:null}}}return null}}]}function Bt({code:e,path:t},r){const n={},s=r?.imageOptimization?.svgo?.prefixIds,i=s!==!1?[{name:"prefixIds",params:s}]:[],o=r?.imageOptimization?.svgo?.plugins?.filter(u=>u==="preset-default"||typeof u=="object"&&u.name==="preset-default"?(console.warn("You are trying to use the preset-default SVGO plugin. This plugin is already included by default, you can customize it through the defaultPresetOverrides option."),!1):u==="prefixIds"||typeof u=="object"&&u.name==="prefixIds"?(console.warn("You are trying to use the preset-default SVGO plugin. This plugin is already included by default, you can customize it through the prefixIds option."),!1):!0)||[],a=ke.optimize(e,{floatPrecision:r?.imageOptimization?.svgo?.floatPrecision,multipass:r?.imageOptimization?.svgo?.multipass,path:t,plugins:[{name:"preset-default",params:{overrides:{removeViewBox:!1,...r?.imageOptimization?.svgo?.defaultPresetOverrides}}},{name:"customPluginName",fn:()=>({element:{exit:u=>{u.name==="svg"&&(u.name="g",Object.assign(n,u.attributes),u.attributes={})}}})},...i,...o]}).data;return n.dangerouslySetInnerHTML=a.slice(3,-4),{data:a,svgAttributes:n}}async function Jt(e){if(typeof e.routesDir!="string")throw new Error('qwikRouter plugin "routesDir" option missing');if(!m.isAbsolute(e.routesDir))throw new Error(`qwikRouter plugin "routesDir" option must be an absolute path: ${e.routesDir}`);try{if(!(await b.promises.stat(e.routesDir)).isDirectory())throw new Error(`qwikRouter plugin "routesDir" option must be a directory: ${e.routesDir}`)}catch(t){throw new Error(`qwikRouter plugin "routesDir" not found: ${t}`)}}function Gt(e){if(e instanceof Error){const t=e;let r=t.loc;if(!t.frame&&!t.plugin&&(r||(r=qt(t)),r&&(t.loc=r,r.file))){t.id=w(t.loc.file);try{const n=b.readFileSync(t.loc.file,"utf-8");t.frame=Ft(n,t.loc)}catch{}}}return e}class zt{state=0;buffer="";headInnerIndex=-1;bodyInnerIndex=-1;isHtmlResponse=!1;bodyPostContent="";response;server;request;origWrite;origEnd;origSetHeader;origWriteHead;processingPromise=null;constructor(t,r,n){this.request=t,this.response=r,this.server=n,this.origWrite=this.response.write.bind(this.response),this.origEnd=this.response.end.bind(this.response),this.origSetHeader=this.response.setHeader.bind(this.response),this.origWriteHead=this.response.writeHead.bind(this.response),this.response.setHeader=(s,i)=>{if(s.toLowerCase()==="content-type"){const o=String(i).toLowerCase();this.isHtmlResponse=o.includes("text/html")}return this.origSetHeader(s,i)},this.response.writeHead=(s,i,o)=>{if(o&&typeof o=="object"){for(const[a,u]of Object.entries(o))if(a.toLowerCase()==="content-type"){const c=String(u).toLowerCase();this.isHtmlResponse=c.includes("text/html")}}return this.origWriteHead(s,i,o)},this.response.write=this.handleWrite.bind(this),this.response.end=(s,i,o)=>(this.handleEnd(s,i,o).catch(a=>{console.error("Error in handleEnd:",a),this.transitionToPassthrough(),this.origEnd(s,i,o)}),this.response)}handleWrite(t,r,n){if(!this.isHtmlResponse||this.state===3)return this.origWrite(t,r,n);typeof r=="function"&&(n=r,r=void 0);let s;switch(t instanceof ArrayBuffer||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array?s=new TextDecoder().decode(t):Buffer.isBuffer(t)?s=t.toString(r||"utf8"):typeof t=="string"?s=t:s=t?.toString()||"",this.buffer+=s,this.state){case 0:if(this.headInnerIndex===-1){const i=this.buffer.match(/<head[^>]*>/i);if(i){const o=this.buffer.indexOf(i[0]);this.headInnerIndex=o+i[0].length}}if(this.headInnerIndex!==-1){const i=this.buffer.slice(this.headInnerIndex).match(/<body[^>]*>/i);if(i){this.state=1;const o=this.buffer.indexOf(i[0]);this.bodyInnerIndex=o+i[0].length,this.processingPromise=this.processHead()}}break;case 1:break;case 2:this.handleStreamingBodyState();break;default:throw new Error(`Invalid state: ${this.state}`)}return n?.(),!0}async processHead(){try{const r=await this.server.transformIndexHtml(this.request.url||"/","<html><head>[FAKE_HEAD]</head><body>[FAKE_BODY]</body></html>"),n=r.indexOf("[FAKE_HEAD]"),s=r.indexOf("</head>",n);if(n===-1||s===-1)throw new Error("Transformed HTML does not contain [FAKE_HEAD]...</head>");const i=r.slice(12,n),o=r.slice(n+11,s),a=r.indexOf("<body>",s),u=r.indexOf("[FAKE_BODY]",a),c=r.indexOf("</body>",u);if(u===-1||c===-1)throw new Error("Transformed HTML does not contain [FAKE_BODY]...</body>");const l=r.slice(a+6,u);this.bodyPostContent=r.slice(u+11,c);const f=this.buffer.indexOf("</head>",this.headInnerIndex);if(f===-1)throw new Error("Buffered HTML does not contain </head>");if(this.buffer=this.buffer.slice(0,this.headInnerIndex)+i+this.buffer.slice(this.headInnerIndex,f)+o+this.buffer.slice(f,this.bodyInnerIndex)+l+this.buffer.slice(this.bodyInnerIndex),this.bodyPostContent.length>0){this.state=2,this.handleStreamingBodyState();return}this.transitionToPassthrough();return}catch(t){console.error("Error transforming HTML:",t),this.transitionToPassthrough();return}}handleStreamingBodyState(){const t=this.buffer.match(/<\/body>/i);if(t){const r=this.buffer.indexOf(t[0]);this.buffer=this.buffer.slice(0,r)+this.bodyPostContent+this.buffer.slice(r),this.transitionToPassthrough();return}this.flushBuffer(6)}transitionToPassthrough(){this.state=3,this.flushBuffer()}flushBuffer(t=0){this.buffer.length>t&&(t>0?(this.origWrite(this.buffer.slice(0,-t)),this.buffer=this.buffer.slice(-t)):(this.origWrite(this.buffer),this.buffer=""))}async handleEnd(t,r,n){typeof r=="function"&&(n=r,r=void 0),t&&this.handleWrite(t,r),await this.processingPromise,this.flushBuffer(),this.origEnd(n)}}function Qt(e,t,r){return new zt(e,t,r),t}const Kt=(e,t)=>async(r,n,s)=>{const i=await e.ssrLoadModule("src/entry.ssr");if(!i.default)return console.error("No default export found in src/entry.ssr"),s();const o=i.default;t.isDirty&&(await ue(t),t.isDirty=!1);const a=t.entries.find(c=>r.url===`${e.config.base}${c.chunkFileName}`);if(a){const c=await e.transformRequest(`/@fs${a.filePath.startsWith("/")?"":"/"}${a.filePath}`);c?(n.setHeader("Content-Type","text/javascript"),n.end(c.code)):s();return}if(r.url===`${e.config.base}service-worker.js`){n.setHeader("Content-Type","text/javascript"),n.end("/* Qwik Router Dev Service Worker */self.addEventListener('install', () => self.skipWaiting());self.addEventListener('activate', (ev) => ev.waitUntil(self.clients.claim()));");return}const{createQwikRouter:u}=await e.ssrLoadModule("@qwik.dev/router/middleware/node");try{const c=(async p=>await o(p)),{router:l,staticFile:f,notFound:d}=u({render:c}),h=Qt(r,n,e);f(r,h,()=>{l(r,h,()=>{d(r,h,s)})})}catch(c){c instanceof Error&&(e.ssrFixStacktrace(c),Gt(c)),s(c);return}},Vt=[".css",".scss",".sass",".less",".styl",".stylus"],Yt=/\.[mc]?[tj]sx?$/,K=e=>Vt.some(t=>e.endsWith(t)),Xt=e=>{const t=new Set,r=new Set;return Array.from(e.moduleGraph.fileToModulesMap.entries()).forEach(([n,s])=>{s.forEach(i=>{const[o,a]=i.url.split("?");if(!a&&K(o)){const u=i.importers.size===0,c=Array.from(i.importers).some(f=>{const d=f.url||f.file,h=d&&K(d);return h&&i.url&&r.add(i.url),h}),l=Array.from(i.importers).some(f=>{const d=f.url||f.file;return d&&Yt.test(d)});(u||l)&&!c&&!r.has(i.url)&&t.add(i)}})}),[...t].map(({url:n,lastHMRTimestamp:s})=>`${n}${s?`?t=${s}`:""}`)},Zt=e=>Xt(e).map(r=>({tag:"link",attrs:{rel:"stylesheet",href:r}})),R="@qwik-router-config",O="@qwik-router-entries",V="@qwik.dev/router",D="@qwik-router-sw-register";function er(e){return fe(e)}function fe(e){return[tr(e),...Ut(e)]}function tr(e){let t=null,r=null,n=null,s,i="esm",o=null,a,u=null,c=e?.devSsrServer;return{name:"vite-plugin-qwik-router",enforce:"pre",api:{getBasePathname:()=>t?.opts.basePathname??"/",getRoutes:()=>t?.routes.slice()??[],getServiceWorkers:()=>t?.serviceWorkers.slice()??[]},async config(d,h){return a=h.command,{define:{"globalThis.__DEFAULT_LOADERS_SERIALIZATION_STRATEGY__":JSON.stringify(e?.defaultLoadersSerializationStrategy||"never"),"globalThis.__NO_TRAILING_SLASH__":JSON.stringify(e?.trailingSlash===!1)},appType:"custom",resolve:{alias:[{find:"@builder.io/qwik-city",replacement:"@qwik.dev/router"},{find:/^@builder\.io\/qwik-city\/(.*)/,replacement:"@qwik.dev/router/$1"},{find:"@qwik-city-plan",replacement:R},{find:"@qwik-city-entries",replacement:O},{find:"@qwik-city-sw-register",replacement:D}]},optimizeDeps:{exclude:[V,R,O,D]},ssr:{external:["node:async_hooks"],noExternal:[V,R,O,D]},server:{watch:{disableGlobbing:!1}}}},async configResolved(d){Object.assign(process.env,Y.loadEnv(d.mode,process.cwd(),"")),n=m.resolve(d.root);const h=d.build?.ssr||d.mode==="ssr"?"ssr":"client";if(t=ut(n,d.base,e,h,!e?.staticImportRoutes),await Jt(t.opts),r=await Rt(t),s=d.plugins.find(p=>p.name==="vite-plugin-qwik"),!s)throw new Error("Missing vite-plugin-qwik");typeof c!="boolean"&&(c=s.api._oldDevSsrServer()),s.api.registerBundleGraphAdder?.(p=>Ct(t.routes,p)),d.ssr?.format==="cjs"&&(i="cjs"),o=d.build?.outDir},async configureServer(d){u=d;const h=m.resolve(n,"src/routes/**/{index,layout,entry,service-worker}{.,@,-}*");if(d.watcher.add(h),await new Promise(p=>setTimeout(p,1e3)),d.watcher.on("change",p=>{if(!/\/(index[.@]|layout[.-]|entry\.|service-worker\.)[^/]*$/.test(p))return;t.isDirty=!0;const y=d.environments?.ssr?.moduleGraph;if(y){const v=y.getModuleById("@qwik-router-config");v&&y.invalidateModule(v)}}),e?.devSsrServer!==!1)return()=>{d.middlewares.use(Kt(d,t))}},transformIndexHtml(){if(a==="serve")return Zt(u)},buildStart(){lt(t)},resolveId(d){return d===R||d===O?{id:d,moduleSideEffects:"no-treeshake"}:d===D?d:null},async load(d,h){if(t){if(d.endsWith(O))return $t(t);const p=d.endsWith(R),y=d.endsWith(D);if(p||y){if(t.isDirty&&(await ue(t),t.isDirty=!1,t.diagnostics.forEach(v=>{this.warn(v.message)})),p)return Wt(t,s,h?.ssr??!1);if(y)return At(t,Ie)}}return null},async transform(d,h){if(h.startsWith("\0"))return;const p=m.extname(h).toLowerCase();if(t&&(p===".md"||p===".mdx")){const v=m.basename(h);if(ie(v))return{code:await Be(t.opts,h,d),map:null};if(r)try{return await r(d,h)}catch(g){if(g&&typeof g=="object"&&"position"in g&&"reason"in g){const S=g.position?.start.column,$=g.position?.start.line,E=Object.assign(new Error(g.reason),{id:h,plugin:"qwik-router-mdx",loc:{column:S,line:$},stack:""});this.error(E)}else g instanceof Error?this.error(g):this.error(String(g))}}return null},generateBundle(d,h){if(t?.target==="client"){const p=[...t.entries,...t.serviceWorkers].map(y=>({chunkFileName:y.chunkFileName,extensionlessFilePath:P(y.filePath)}));for(const y of p)for(const v in h){const g=h[v];if(g.type==="chunk"&&g.isDynamicEntry&&g.facadeModuleId){const S=P(w(g.facadeModuleId));if(y.extensionlessFilePath===S){g.fileName=y.chunkFileName;continue}}}}},closeBundle:{sequential:!0,async handler(){t?.target==="ssr"&&o&&await rr(o,i)}}}}async function rr(e,t){await b.promises.mkdir(e,{recursive:!0});const r=m.join(e,"package.json");let n={};if(b.existsSync(r)){const i=await b.promises.readFile(r,"utf-8");n={...JSON.parse(i)}}n={...n,type:t=="cjs"?"commonjs":"module"};const s=JSON.stringify(n,null,2);await b.promises.writeFile(r,s)}exports.extendConfig=Ee;exports.qwikCity=er;exports.qwikRouter=fe;
42
+ }`,map:null}}}return null}}]}function Bt({code:e,path:t},r){const n={},s=r?.imageOptimization?.svgo?.prefixIds,i=s!==!1?[{name:"prefixIds",params:s}]:[],o=r?.imageOptimization?.svgo?.plugins?.filter(u=>u==="preset-default"||typeof u=="object"&&u.name==="preset-default"?(console.warn("You are trying to use the preset-default SVGO plugin. This plugin is already included by default, you can customize it through the defaultPresetOverrides option."),!1):u==="prefixIds"||typeof u=="object"&&u.name==="prefixIds"?(console.warn("You are trying to use the preset-default SVGO plugin. This plugin is already included by default, you can customize it through the prefixIds option."),!1):!0)||[],a=ke.optimize(e,{floatPrecision:r?.imageOptimization?.svgo?.floatPrecision,multipass:r?.imageOptimization?.svgo?.multipass,path:t,plugins:[{name:"preset-default",params:{overrides:{removeViewBox:!1,...r?.imageOptimization?.svgo?.defaultPresetOverrides}}},{name:"customPluginName",fn:()=>({element:{exit:u=>{u.name==="svg"&&(u.name="g",Object.assign(n,u.attributes),u.attributes={})}}})},...i,...o]}).data;return n.dangerouslySetInnerHTML=a.slice(3,-4),{data:a,svgAttributes:n}}async function Jt(e){if(typeof e.routesDir!="string")throw new Error('qwikRouter plugin "routesDir" option missing');if(!h.isAbsolute(e.routesDir))throw new Error(`qwikRouter plugin "routesDir" option must be an absolute path: ${e.routesDir}`);try{if(!(await S.promises.stat(e.routesDir)).isDirectory())throw new Error(`qwikRouter plugin "routesDir" option must be a directory: ${e.routesDir}`)}catch(t){throw new Error(`qwikRouter plugin "routesDir" not found: ${t}`)}}function Gt(e){if(e instanceof Error){const t=e;let r=t.loc;if(!t.frame&&!t.plugin&&(r||(r=qt(t)),r&&(t.loc=r,r.file))){t.id=b(t.loc.file);try{const n=S.readFileSync(t.loc.file,"utf-8");t.frame=Ft(n,t.loc)}catch{}}}return e}class zt{state=0;buffer="";headInnerIndex=-1;bodyInnerIndex=-1;isHtmlResponse=!1;bodyPostContent="";response;server;request;origWrite;origEnd;origSetHeader;origWriteHead;processingPromise=null;constructor(t,r,n){this.request=t,this.response=r,this.server=n,this.origWrite=this.response.write.bind(this.response),this.origEnd=this.response.end.bind(this.response),this.origSetHeader=this.response.setHeader.bind(this.response),this.origWriteHead=this.response.writeHead.bind(this.response),this.response.setHeader=(s,i)=>{if(s.toLowerCase()==="content-type"){const o=String(i).toLowerCase();this.isHtmlResponse=o.includes("text/html")}return this.origSetHeader(s,i)},this.response.writeHead=(s,i,o)=>{if(typeof i=="object"&&i!==null&&(o=i,i=void 0),o&&typeof o=="object"){for(const[a,u]of Object.entries(o))if(a.toLowerCase()==="content-type"){const c=String(u).toLowerCase();this.isHtmlResponse=c.includes("text/html")}}return this.origWriteHead(s,i,o)},this.response.write=this.handleWrite.bind(this),this.response.end=(s,i,o)=>(this.handleEnd(s,i,o).catch(a=>{console.error("Error in handleEnd:",a),this.transitionToPassthrough(),this.origEnd(s,i,o)}),this.response)}handleWrite(t,r,n){if(!this.isHtmlResponse||this.state===3)return this.origWrite(t,r,n);typeof r=="function"&&(n=r,r=void 0);let s;switch(t instanceof ArrayBuffer||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array?s=new TextDecoder().decode(t):Buffer.isBuffer(t)?s=t.toString(r||"utf8"):typeof t=="string"?s=t:s=t?.toString()||"",this.buffer+=s,this.state){case 0:if(this.headInnerIndex===-1){const i=this.buffer.match(/<head[^>]*>/i);if(i){const o=this.buffer.indexOf(i[0]);this.headInnerIndex=o+i[0].length}}if(this.headInnerIndex!==-1){const i=this.buffer.slice(this.headInnerIndex).match(/<body[^>]*>/i);if(i){this.state=1;const o=this.buffer.indexOf(i[0]);this.bodyInnerIndex=o+i[0].length,this.processingPromise=this.processHead()}}break;case 1:break;case 2:this.handleStreamingBodyState();break;default:throw new Error(`Invalid state: ${this.state}`)}return n?.(),!0}async processHead(){try{const r=await this.server.transformIndexHtml(this.request.url||"/","<html><head>[FAKE_HEAD]</head><body>[FAKE_BODY]</body></html>"),n=r.indexOf("[FAKE_HEAD]"),s=r.indexOf("</head>",n);if(n===-1||s===-1)throw new Error("Transformed HTML does not contain [FAKE_HEAD]...</head>");const i=r.slice(12,n).trim(),o=r.slice(n+11,s),a=r.indexOf("<body>",s),u=r.indexOf("[FAKE_BODY]",a),c=r.indexOf("</body>",u);if(u===-1||c===-1)throw new Error("Transformed HTML does not contain [FAKE_BODY]...</body>");const l=r.slice(a+6,u);this.bodyPostContent=r.slice(u+11,c);const f=this.buffer.indexOf("</head>",this.headInnerIndex);if(f===-1)throw new Error("Buffered HTML does not contain </head>");if(this.buffer=this.buffer.slice(0,this.headInnerIndex)+i+this.buffer.slice(this.headInnerIndex,f)+o+this.buffer.slice(f,this.bodyInnerIndex)+l+this.buffer.slice(this.bodyInnerIndex),this.bodyPostContent.length>0){this.state=2,this.handleStreamingBodyState();return}this.transitionToPassthrough();return}catch(t){console.error("Error transforming HTML:",t),this.transitionToPassthrough();return}}handleStreamingBodyState(){const t=this.buffer.match(/<\/body>/i);if(t){const r=this.buffer.indexOf(t[0]);this.buffer=this.buffer.slice(0,r)+this.bodyPostContent+this.buffer.slice(r),this.transitionToPassthrough();return}this.flushBuffer(6)}transitionToPassthrough(){this.state=3,this.flushBuffer()}flushBuffer(t=0){this.buffer.length>t&&(t>0?(this.origWrite(this.buffer.slice(0,-t)),this.buffer=this.buffer.slice(-t)):(this.origWrite(this.buffer),this.buffer=""))}async handleEnd(t,r,n){typeof r=="function"&&(n=r,r=void 0),t&&this.handleWrite(t,r),await this.processingPromise,this.flushBuffer(),this.origEnd(n)}}function Qt(e,t,r){return new zt(e,t,r),t}const Kt=(e,t)=>async(r,n,s)=>{const i=await e.ssrLoadModule("src/entry.ssr");if(!i.default)return console.error("No default export found in src/entry.ssr"),s();const o=i.default;t.isDirty&&(await ue(t),t.isDirty=!1);const a=t.entries.find(c=>r.url===`${e.config.base}${c.chunkFileName}`);if(a){const c=await e.transformRequest(`/@fs${a.filePath.startsWith("/")?"":"/"}${a.filePath}`);c?(n.setHeader("Content-Type","text/javascript"),n.end(c.code)):s();return}if(r.url===`${e.config.base}service-worker.js`){n.setHeader("Content-Type","text/javascript"),n.end("/* Qwik Router Dev Service Worker */self.addEventListener('install', () => self.skipWaiting());self.addEventListener('activate', (ev) => ev.waitUntil(self.clients.claim()));");return}globalThis.__qwik=void 0;const{createQwikRouter:u}=await e.ssrLoadModule("@qwik.dev/router/middleware/node");try{const c=(async d=>await o(d)),{router:l,staticFile:f,notFound:m}=u({render:c}),v=Qt(r,n,e);f(r,v,()=>{l(r,v,()=>{m(r,v,s)})})}catch(c){c instanceof Error&&(e.ssrFixStacktrace(c),Gt(c)),s(c);return}},Vt=[".css",".scss",".sass",".less",".styl",".stylus"],Yt=/\.[mc]?[tj]sx?$/,V=e=>Vt.some(t=>e.endsWith(t)),Xt=e=>{const t=new Set,r=new Set;return Array.from(e.moduleGraph.fileToModulesMap.entries()).forEach(([n,s])=>{s.forEach(i=>{const[o,a]=i.url.split("?");if(!a&&V(o)){const u=i.importers.size===0,c=Array.from(i.importers).some(f=>{const m=f.url||f.file,v=m&&V(m);return v&&i.url&&r.add(i.url),v}),l=Array.from(i.importers).some(f=>{const m=f.url||f.file;return m&&Yt.test(m)});(u||l)&&!c&&!r.has(i.url)&&t.add(i)}})}),[...t].map(({url:n,lastHMRTimestamp:s})=>`${n}${s?`?t=${s}`:""}`)},Zt=e=>Xt(e).map(r=>({tag:"link",attrs:{rel:"stylesheet",href:r}})),$="@qwik-router-config",O="@qwik-router-entries",M="@qwik.dev/router",T="@qwik-router-sw-register";function er(e){return fe(e)}function fe(e){return[tr(e),...Ut(e)]}function tr(e){let t=null,r=null,n=null,s,i="esm",o=null,a,u=null,c=e?.devSsrServer;const l=e?.routesDir??"src/routes",f=e?.serverPluginsDir??l;return{name:"vite-plugin-qwik-router",enforce:"pre",api:{getBasePathname:()=>t?.opts.basePathname??"/",getRoutes:()=>t?.routes.slice()??[],getServiceWorkers:()=>t?.serviceWorkers.slice()??[]},async config(d,p){return a=p.command,{define:{"globalThis.__DEFAULT_LOADERS_SERIALIZATION_STRATEGY__":JSON.stringify(e?.defaultLoadersSerializationStrategy||"never"),"globalThis.__NO_TRAILING_SLASH__":JSON.stringify(e?.trailingSlash===!1)},appType:"custom",resolve:{dedupe:[M,"@builder.io/qwik-city"],alias:[{find:"@builder.io/qwik-city",replacement:"@qwik.dev/router"},{find:/^@builder\.io\/qwik-city\/(.*)/,replacement:"@qwik.dev/router/$1"},{find:"@qwik-city-plan",replacement:$},{find:"@qwik-city-entries",replacement:O},{find:"@qwik-city-sw-register",replacement:T}]},optimizeDeps:{entries:[`${l}/**/index*`,`${l}/**/layout*`,`${f}/plugin@*`],exclude:[M,$,O,T]},ssr:{external:["node:async_hooks"],noExternal:[M,$,O,T]},server:{watch:{disableGlobbing:!1}}}},async configResolved(d){Object.assign(process.env,Y.loadEnv(d.mode,process.cwd(),"")),n=h.resolve(d.root);const p=d.build?.ssr||d.mode==="ssr"?"ssr":"client";if(t=ut(n,d.base,e,p,!e?.staticImportRoutes),await Jt(t.opts),r=await Rt(t),s=d.plugins.find(g=>g.name==="vite-plugin-qwik"),!s)throw new Error("Missing vite-plugin-qwik");typeof c!="boolean"&&(c=s.api._oldDevSsrServer()),s.api.registerBundleGraphAdder?.(g=>Mt(t.routes,g)),d.ssr?.format==="cjs"&&(i="cjs"),o=d.build?.outDir},async configureServer(d){u=d;const p=h.resolve(n,"src/routes/**/{index,layout,entry,service-worker}{.,@,-}*");if(d.watcher.add(p),await new Promise(g=>setTimeout(g,1e3)),d.watcher.on("change",g=>{if(!/\/(index[.@]|layout[.-]|entry\.|service-worker\.)[^/]*$/.test(g))return;t.isDirty=!0;const y=d.environments?.ssr?.moduleGraph;if(y){const P=y.getModuleById("@qwik-router-config");P&&y.invalidateModule(P)}}),e?.devSsrServer!==!1)return()=>{d.middlewares.use(Kt(d,t))}},transformIndexHtml(){if(a==="serve")return Zt(u)},buildStart(){lt(t)},resolveId(d){return d===$||d===O?{id:d,moduleSideEffects:"no-treeshake"}:d===T?d:null},async load(d,p){if(t){if(d.endsWith(O))return $t(t);const g=d.endsWith($),y=d.endsWith(T);if(g||y){if(t.isDirty&&(await ue(t),t.isDirty=!1,t.diagnostics.forEach(P=>{this.warn(P.message)})),g)return Wt(t,s,p?.ssr??!1);if(y)return At(t,Ie)}}return null},async transform(d,p){if(p.startsWith("\0"))return;const y=h.extname(p).toLowerCase();if(t&&(y===".md"||y===".mdx")){const x=h.basename(p);if(ie(x))return{code:await Be(t.opts,p,d),map:null};if(r)try{return await r(d,p)}catch(w){if(w&&typeof w=="object"&&"position"in w&&"reason"in w){const D=w.position?.start.column,E=w.position?.start.line,W=Object.assign(new Error(w.reason),{id:p,plugin:"qwik-router-mdx",loc:{column:D,line:E},stack:""});this.error(W)}else w instanceof Error?this.error(w):this.error(String(w))}}return null},generateBundle(d,p){if(t?.target==="client"){const g=[...t.entries,...t.serviceWorkers].map(y=>({chunkFileName:y.chunkFileName,extensionlessFilePath:k(y.filePath)}));for(const y of g)for(const P in p){const x=p[P];if(x.type==="chunk"&&x.isDynamicEntry&&x.facadeModuleId){const w=k(b(x.facadeModuleId));if(y.extensionlessFilePath===w){x.fileName=y.chunkFileName;continue}}}}},closeBundle:{sequential:!0,async handler(){t?.target==="ssr"&&o&&await rr(o,i)}}}}async function rr(e,t){await S.promises.mkdir(e,{recursive:!0});const r=h.join(e,"package.json");let n={};if(S.existsSync(r)){const i=await S.promises.readFile(r,"utf-8");n={...JSON.parse(i)}}n={...n,type:t=="cjs"?"commonjs":"module"};const s=JSON.stringify(n,null,2);await S.promises.writeFile(r,s)}exports.extendConfig=Ee;exports.qwikCity=er;exports.qwikRouter=fe;
@@ -81,13 +81,13 @@ declare interface PathnameSegmentPart {
81
81
 
82
82
  /** @public */
83
83
  declare interface PluginOptions {
84
- /** Directory of the `routes`. Defaults to `src/routes`. */
84
+ /** Directory of the `routes`. Defaults to `"src/routes"`. */
85
85
  routesDir?: string;
86
- /** Directory of the `server plugins`. Defaults to `src/server-plugins`. */
86
+ /** Directory of the `server plugins`. Defaults to `routesDir`. */
87
87
  serverPluginsDir?: string;
88
88
  /**
89
89
  * The base pathname is used to create absolute URL paths up to the `hostname`, and must always
90
- * start and end with a `/`. Defaults to `/`.
90
+ * start and end with a `/`. Defaults to `"/""`.
91
91
  */
92
92
  basePathname?: string;
93
93
  /**