@devwareng/vanilla-ts 1.4.13 → 1.4.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.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -144,8 +144,6 @@ declare const useTSHashAnchor: () => void;
|
|
|
144
144
|
type AnchorInput = NodeListOf<HTMLAnchorElement> | HTMLAnchorElement[] | HTMLAnchorElement | null | undefined;
|
|
145
145
|
declare const useAnchor: (anchors?: AnchorInput) => void;
|
|
146
146
|
|
|
147
|
-
declare const useTSFilebasedRouter: () => Promise<void>;
|
|
148
|
-
|
|
149
147
|
type RouteCallback = (errorElement?: HTMLElement, params?: Record<string, string>, query?: Record<string, string>) => void;
|
|
150
148
|
interface RouteConfig {
|
|
151
149
|
path: string;
|
|
@@ -168,4 +166,6 @@ declare class TSRouter {
|
|
|
168
166
|
addRoute(route: RouteConfig): void;
|
|
169
167
|
}
|
|
170
168
|
|
|
169
|
+
declare const useTSFilebasedRouter: () => Promise<any>;
|
|
170
|
+
|
|
171
171
|
export { TSRouter, createEffect, createSignal, html, loadPyFiles, mapper, renderChildRoutes, useAnchor, useAnchorSingle, useInitialDOM, useTSAnchorMount, useTSAuth, useTSCollection, useTSComponent, useTSElementEach, useTSElements, useTSEvent, useTSEventAll, useTSExtractParams, useTSFilebasedRouter, useTSHashAnchor, useTSLazy, useTSMetaData, useTSNavigate, useTSNoReload, useTSOutlet, useTSParams, useTSPurifier, useTSSSRHydration, useTSSelect, useTSloadBrython };
|
package/dist/index.d.ts
CHANGED
|
@@ -144,8 +144,6 @@ declare const useTSHashAnchor: () => void;
|
|
|
144
144
|
type AnchorInput = NodeListOf<HTMLAnchorElement> | HTMLAnchorElement[] | HTMLAnchorElement | null | undefined;
|
|
145
145
|
declare const useAnchor: (anchors?: AnchorInput) => void;
|
|
146
146
|
|
|
147
|
-
declare const useTSFilebasedRouter: () => Promise<void>;
|
|
148
|
-
|
|
149
147
|
type RouteCallback = (errorElement?: HTMLElement, params?: Record<string, string>, query?: Record<string, string>) => void;
|
|
150
148
|
interface RouteConfig {
|
|
151
149
|
path: string;
|
|
@@ -168,4 +166,6 @@ declare class TSRouter {
|
|
|
168
166
|
addRoute(route: RouteConfig): void;
|
|
169
167
|
}
|
|
170
168
|
|
|
169
|
+
declare const useTSFilebasedRouter: () => Promise<any>;
|
|
170
|
+
|
|
171
171
|
export { TSRouter, createEffect, createSignal, html, loadPyFiles, mapper, renderChildRoutes, useAnchor, useAnchorSingle, useInitialDOM, useTSAnchorMount, useTSAuth, useTSCollection, useTSComponent, useTSElementEach, useTSElements, useTSEvent, useTSEventAll, useTSExtractParams, useTSFilebasedRouter, useTSHashAnchor, useTSLazy, useTSMetaData, useTSNavigate, useTSNoReload, useTSOutlet, useTSParams, useTSPurifier, useTSSSRHydration, useTSSelect, useTSloadBrython };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function oe(s){return(s==null?"":String(s)).replace(/<\s*(script|iframe|object|embed|link|style)[^>]*>.*?<\s*\/\s*\1\s*>/gi,"").replace(/<\s*(script|iframe|object|embed|link|style)[^>]*>/gi,"").replace(/\son\w+\s*=\s*(['"]).*?\1/gi,"").replace(/\s(href|src)\s*=\s*(['"])\s*javascript:[^'"]*\2/gi,"")}function lt(s,...t){return s.reduce((e,n,r)=>{let i=r<t.length?oe(t[r]):"";return e+n+i},"")}function M(){let s=new Set;document.querySelectorAll("*").forEach(t=>{let e=t.tagName.toLowerCase();e.includes("-")&&s.add(e)}),s.forEach(t=>{customElements.get(t)||customElements.define(t,class extends HTMLElement{connectedCallback(){this.innerHTML=`<div style="padding:10px;background:#eee;">${t} (Auto)</div>`}})})}var ae=s=>s.replace(/<\/?(script|iframe|object|embed|link|meta|style)[^>]*>/gi,"").replace(/\s+on[a-z]+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/\s+(href|src)\s*=\s*(['"]?)\s*javascript:[^'"\s>]*/gi,""),ce=s=>s?.map(t=>ae(t)).join("")??"";import ut from"dompurify";var dt=(s,t)=>{let n={...{ADD_TAGS:["my-custom-tag"]},...t};return typeof s=="string"?ut.sanitize(s,n):ut.sanitize(s.innerHTML,n)};var ht=(s,t,e)=>{if(typeof s=="string"){let n=document.getElementById(s);n?n.addEventListener(t,e):console.warn(`Element with id '${s}' not found.`)}else s===document?document.addEventListener(t,e):console.warn("Invalid id parameter provided.")};import{createStore as le}from"zustand/vanilla";import ft from"dompurify";function ue(s,t){let e=[],n=s.replace(/:[^/]+/g,o=>(e.push(o.slice(1)),"([^/]+)")),r=new RegExp(`^${n}$`),i=t.match(r),a={};return i&&e.forEach((o,c)=>{a[o]=ft.sanitize(i[c+1]??"")}),a}function de(s){let t={},e=new URLSearchParams(s);for(let[n,r]of e.entries())t[n]=ft.sanitize(r);return t}var b=le((s,t)=>({params:{},query:{},setFromPattern:e=>{let n=window.location.pathname,r=ue(e,n),i=de(window.location.search);s({params:r,query:i})},getParam:e=>t().params[e],getQuery:e=>t().query[e]}));function mt(s){let t=b.getState();t.setFromPattern(s);let e=t.params,n=t.query;return{...e,...n}}var pt=(s,t,e)=>{let n=document.querySelectorAll(s);return n.forEach(r=>{r.addEventListener(t,e)}),()=>{n.forEach(r=>{r.removeEventListener(t,e)})}};import V from"dompurify";var gt=(s,t,e,n={})=>{let r={USE_PROFILES:{svg:!0,html:!0},ALLOWED_TAGS:["svg","path","circle","rect","line","polyline","polygon","g","main","div","h1","h2","h3","h4","h5","h6","p","button","span","a","img","input","ul","li","i"],ALLOWED_ATTR:["class","id","href","src","alt","fill","stroke","stroke-width","viewBox","xmlns","d","x","y","cx","cy","r","width","height","data-onclick","data-onchange","data-onselect"],FORBID_TAGS:["script","iframe"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|tel|ftp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,...e};V.addHook("uponSanitizeElement",(a,o)=>{let c=o.tagName.toLowerCase();c.includes("-")&&(o.allowedTags[c]=!0)}),V.addHook("uponSanitizeAttribute",(a,o)=>{o.attrName&&o.attrName.toLowerCase().startsWith("on")&&(o.keepAttr=!1)});let i=V.sanitize(t,r);s.innerHTML=i,s.querySelectorAll("[data-onclick]").forEach(a=>{let o=a.dataset.onclick;n[o]&&a.addEventListener("click",n[o])}),s.querySelectorAll("[data-onchange]").forEach(a=>{let o=a.dataset.onchange;n[o]&&a.addEventListener("change",n[o])}),s.querySelectorAll("[data-onselect]").forEach(a=>{let o=a.dataset.onselect;n[o]&&a.addEventListener("select",n[o])})};import he from"dompurify";var O=null,Et=(s,t)=>{if(typeof document>"u")return;let e=document.getElementById(s);if(!e)return;let n=e.innerHTML,i=he.sanitize(n,{ALLOWED_TAGS:["div","span","p","h1","h2","h3","h4","h5","h6","ul","ol","li","strong","em","a","img","br"],ALLOWED_ATTR:["href","src","alt","title","class","id","data-onclick","data-onchange"],ALLOW_DATA_ATTR:!1,KEEP_CONTENT:!1}).replace(/\b(href|src)=["']?(?!https?:|mailto:|\/|#)/gi,'$1="#"');if(O!==null&&i!==O){let a=document.createElement("div");t(a),e.innerHTML=O}else O=i,e.innerHTML=i,t(e)};import wt from"dompurify";typeof window<"u"&&!window.__anchorSinglePopstateHandlerAttached&&(window.addEventListener("popstate",s=>{let t=s.state;t?.scrollPosition!==void 0&&window.scrollTo(0,t.scrollPosition)}),window.__anchorSinglePopstateHandlerAttached=!0);var yt=(s,t,e,n="",r=null)=>{if(!s)return;let i=wt.sanitize(t,{ALLOWED_URI_REGEXP:/^(https?:|\/)/}),a=wt.sanitize(e,{USE_PROFILES:{html:!1}});s.setAttribute("href",i),s.setAttribute("aria-label",a),n&&(s.className=n.trim()),r&&s.replaceChildren(r),typeof window<"u"&&s.addEventListener("click",o=>{o.preventDefault();let l=o.currentTarget.getAttribute("href");if(l){let u=window.scrollY;window.scrollTo(0,0),window.history.pushState({scrollPosition:u},"",l),dispatchEvent(new PopStateEvent("popstate"))}})};import R from"dompurify";var Tt=(s="'self' 'nonce-rAnd0m123' 'unsafe-inline' 'unsafe-eval'",t="'self' 'nonce-rAnd0m123'",e="'none'",n="'self' https://fonts.googleapis.com https://fonts.gstatic.com",r="'self' https://blogger.googleusercontent.com",i=["'self'","https://fonts.googleapis.com","https://fonts.gstatic.com","https://www.google.com/maps/"],a="'self' https://www.youtube.com",o="'self'",c="/csp-report",l=!1)=>{let u=()=>{try{let d=document.querySelector('meta[http-equiv="Content-Security-Policy"]');d||(d=document.createElement("meta"),d.setAttribute("http-equiv","Content-Security-Policy"),document.head.appendChild(d));let h=l?`report-uri ${c};`:"";d.setAttribute("content",`default-src 'self'; script-src ${s}; style-src ${t}; object-src ${e}; font-src ${n}; img-src ${r}; connect-src ${i.join(" ")}; frame-src ${a}; base-uri ${o}; ${h}`)}catch(d){console.error("Error adding CSP meta element:",d)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u()};var _t=(s,t)=>{let e={name:R.sanitize(s.name||""),description:R.sanitize(s.description||"Default description"),author:R.sanitize(s.author||"")},n=f=>{e.name=R.sanitize(f),d("name",e.name)},r=f=>{e.description=R.sanitize(f),d("description",e.description)},i=f=>{e.author=R.sanitize(f),d("author",e.author)},a=()=>e.name,o=()=>e.description,c=()=>e.author,l=()=>e,u=(f,p)=>{let g=document.createElement("meta");g.setAttribute("name",f),g.setAttribute("content",p),document.head.appendChild(g)},d=(f,p)=>{let g=document.querySelector(`meta[name="${f}"]`);g?g.setAttribute("content",p):u(f,p)},h=()=>{d("name",e.name),d("description",e.description),d("author",e.author)};return t&&Tt(t.scriptSrc,t.styleSrc,t.objectSrc,Array.isArray(t.connectSrc)?t.connectSrc.join(" "):t.connectSrc,t.reportOnly!==void 0?String(t.reportOnly):void 0),h(),{setName:n,setDescription:r,setAuthor:i,getName:a,getDescription:o,getAuthor:c,getAllMetaData:l,appendMetaTagsToHead:h}};import fe from"dompurify";var C=(s,t,e,n,r)=>{let i=`#${s}`,a=t.querySelectorAll(i);if(a.length===0)throw new Error(`[useTSComponent] No element found with id '${s}' in the given parent.`);if(a.length>1)throw new Error(`[useTSComponent] Duplicate id '${s}' detected. Found ${a.length} elements.`);let o=a[0];o.innerHTML=fe.sanitize(o.innerHTML,{USE_PROFILES:{html:!0}}),e(o,n,r)};var St=(s,t,e,n=[])=>{let r=new Set;s.forEach((i,a)=>{if(r.has(i)){console.warn(`[useTSCollection] Duplicate ID in collection array: "${i}" \u2014 skipping.`);return}r.add(i);let o=t.querySelectorAll(`#${i}`);if(o.length>1){console.warn(`[useTSCollection] Duplicate ID in DOM: "${i}" (${o.length} elements found) \u2014 skipping component mount.`);return}let c=e[a],l=Array.isArray(n)?n[a]:void 0;typeof c=="function"?C(i,t,c,l):console.warn(`[useTSCollection] No valid component function found for ID: "${i}"`)})};var Pt=(s,t)=>{let n=(t??document).querySelectorAll(s);if(n.length===0)return process.env.NODE_ENV!=="production"&&console.warn(`[useTSSelect] No element found for selector: '${s}'`),null;if(s.startsWith("#")&&n.length>1){if(process.env.NODE_ENV!=="production")throw new Error(`[useTSSelect] Duplicate ID detected: '${s}'. Found ${n.length} elements with this ID.`);return n[0]}return n.length>1&&process.env.NODE_ENV!=="production"&&console.warn(`[useTSSelect] Multiple elements found for selector: '${s}'. Returning the first one.`),n[0]};import{jwtDecode as me}from"jwt-decode";var vt=(s,t)=>{let e=localStorage.getItem("token");if(!e)return window.location.href=t,null;try{let n=me(e),r=Date.now()/1e3;return n.exp&&n.exp<r&&(console.error("Token has expired"),window.localStorage.removeItem("token"),window.location.href=t),null}catch(n){return console.error("Invalid token:",n),window.location.href=t,null}};var I=(s,t,e)=>{s.forEach(n=>{t.forEach(r=>{n.addEventListener(r,i=>{e(n,i)})})})};var Rt=()=>({back:()=>window.history.back(),forward:()=>window.history.forward()});var Lt=(s,t)=>{let e=document.querySelector(`#${s}`)||document.querySelector(`.${s}`);if(!e)return;let n=window.location.pathname.replace(/\/$/,"");for(let r of t){let i=r.path.replace(/\/$/,"");if(n===i||n.startsWith(`${i}/`)){r.component(e);break}}};function Dt(s,t){let e=window.location.pathname.replace(/\/$/,"");t.routes.forEach(n=>{n.children?.length&&n.children.forEach(r=>{let i=r.path.replace(/\/$/,"");if(e===i||e.startsWith(`${i}/`)){let a=s.querySelector(`#${r.outlet}`)||s.querySelector(`.${r.outlet}`);a instanceof HTMLElement&&r.element&&r.element(a)}})})}import{createStore as pe}from"zustand/vanilla";function xt(s){let t=pe(()=>({value:s})),e=new Set;return{get:()=>t.getState().value,set:n=>{t.setState({value:n}),e.forEach(r=>r(n))},subscribe:n=>(e.add(n),n(t.getState().value),()=>e.delete(n))}}function At(s){let t=s();typeof t=="function"&&t()}var H=()=>{let s=document.querySelectorAll('a[href^="#"]');I(s,["click"],(t,e)=>{e.preventDefault();let n=t.getAttribute("href")?.substring(1),r=n?document.getElementById(n):null;r&&r.scrollIntoView({behavior:"smooth",block:"start"})})};import{debounce as ge}from"lodash-es";var K=s=>s;typeof window<"u"&&typeof document<"u"&&(K=s=>{let t=document.createElement("div");return t.innerText=s,t.innerHTML});var Ee=s=>{(s?Array.isArray(s)?s:s instanceof HTMLAnchorElement?[s]:Array.from(s):Array.from(document.querySelectorAll("a"))).forEach(e=>{if(!e||e.dataset.anchorEnhanced==="true")return;e.dataset.anchorEnhanced="true";let n=e.getAttribute("class")||"";e.setAttribute("class",K(n));let r=e.getAttribute("aria-label");r&&e.setAttribute("aria-label",K(r));let i=e.querySelector(":scope > *");i&&(e.innerHTML="",e.appendChild(i));let a=e.getAttribute("href")||"";if(!a.startsWith("#")){try{if(new URL(a,window.location.href).origin!==window.location.origin)return}catch{return}e.addEventListener("click",o=>{o.preventDefault();let c=e.getAttribute("href")||"";try{let l=new URL(c,window.location.href);window.history.pushState({},"",l.pathname+l.search+l.hash),window.dispatchEvent(new PopStateEvent("popstate"))}catch(l){console.error("Invalid URL in anchor:",c,l)}})}})},we=ge(Ee,50),F=s=>{we(s)};var N=s=>{let t=s.querySelectorAll("a");F(t)};var Mt=s=>{H(),N(s)};var bt=async()=>{let s="https://cdn.jsdelivr.net/npm/brython@3/brython.min.js",t="https://cdn.jsdelivr.net/npm/brython@3/brython_stdlib.js",e=n=>new Promise((r,i)=>{let a=document.createElement("script");a.src=n,a.onload=()=>r(),a.onerror=()=>i(new Error(`Failed to load ${n}`)),document.head.appendChild(a)});await e(s),await e(t),typeof window.brython=="function"?window.brython():console.error("Brython did not load correctly.")},Ot=s=>new Promise((t,e)=>{let n=document.createElement("script");n.type="text/python",n.src=`/src/python/${s}`,n.onload=()=>t(),n.onerror=()=>e(new Error(`Failed to load ${s}`)),document.body.appendChild(n)});function Ct(s){let t=null;return async(e,n)=>{try{if(!t){let r=await s();t=r.default||r}if(typeof t=="function")return t(e,n);if(t instanceof HTMLElement){e?.appendChild(t);return}if(t&&typeof t.render=="function")return t.render(e,n);console.warn("useTSLazy: Unsupported module type",t)}catch(r){console.error("useTSLazy failed:",r)}}}var It=s=>typeof window>"u"?{isDOM:null}:{isDOM:s||document.body};import v from"fs/promises";import _ from"path";import{stat as Ve}from"fs";import{stat as Ke,readdir as Qe}from"fs/promises";import{EventEmitter as Je}from"events";import*as m from"path";import{stat as ye,lstat as Ht,readdir as Te,realpath as _e}from"fs/promises";import{Readable as Se}from"stream";import{resolve as Ft,relative as Pe,join as ve,sep as Re}from"path";var y={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Q={root:".",fileFilter:s=>!0,directoryFilter:s=>!0,type:y.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Q);var Wt="READDIRP_RECURSIVE_ERROR",Le=new Set(["ENOENT","EPERM","EACCES","ELOOP",Wt]),Nt=[y.DIR_TYPE,y.EVERYTHING_TYPE,y.FILE_DIR_TYPE,y.FILE_TYPE],De=new Set([y.DIR_TYPE,y.EVERYTHING_TYPE,y.FILE_DIR_TYPE]),xe=new Set([y.EVERYTHING_TYPE,y.FILE_DIR_TYPE,y.FILE_TYPE]),Ae=s=>Le.has(s.code),Me=process.platform==="win32",kt=s=>!0,zt=s=>{if(s===void 0)return kt;if(typeof s=="function")return s;if(typeof s=="string"){let t=s.trim();return e=>e.basename===t}if(Array.isArray(s)){let t=s.map(e=>e.trim());return e=>t.some(n=>e.basename===n)}return kt},J=class extends Se{constructor(t={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:t.highWaterMark});let e={...Q,...t},{root:n,type:r}=e;this._fileFilter=zt(e.fileFilter),this._directoryFilter=zt(e.directoryFilter);let i=e.lstat?Ht:ye;Me?this._stat=a=>i(a,{bigint:!0}):this._stat=i,this._maxDepth=e.depth??Q.depth,this._wantsDir=r?De.has(r):!1,this._wantsFile=r?xe.has(r):!1,this._wantsEverything=r===y.EVERYTHING_TYPE,this._root=Ft(n),this._isDirent=!e.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(t){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&t>0;){let e=this.parent,n=e&&e.files;if(n&&n.length>0){let{path:r,depth:i}=e,a=n.splice(0,t).map(c=>this._formatEntry(c,r)),o=await Promise.all(a);for(let c of o){if(!c)continue;if(this.destroyed)return;let l=await this._getEntryType(c);l==="directory"&&this._directoryFilter(c)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(c.fullPath,i+1)),this._wantsDir&&(this.push(c),t--)):(l==="file"||this._includeAsFile(c))&&this._fileFilter(c)&&this._wantsFile&&(this.push(c),t--)}}else{let r=this.parents.pop();if(!r){this.push(null);break}if(this.parent=await r,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(t,e){let n;try{n=await Te(t,this._rdOptions)}catch(r){this._onError(r)}return{files:n,depth:e,path:t}}async _formatEntry(t,e){let n,r=this._isDirent?t.name:t;try{let i=Ft(ve(e,r));n={path:Pe(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?t:await this._stat(i)}catch(i){this._onError(i);return}return n}_onError(t){Ae(t)&&!this.destroyed?this.emit("warn",t):this.destroy(t)}async _getEntryType(t){if(!t&&this._statsProp in t)return"";let e=t[this._statsProp];if(e.isFile())return"file";if(e.isDirectory())return"directory";if(e&&e.isSymbolicLink()){let n=t.fullPath;try{let r=await _e(n),i=await Ht(r);if(i.isFile())return"file";if(i.isDirectory()){let a=r.length;if(n.startsWith(r)&&n.substr(a,1)===Re){let o=new Error(`Circular symlink detected: "${n}" points to "${r}"`);return o.code=Wt,this._onError(o)}return"directory"}}catch(r){return this._onError(r),""}}}_includeAsFile(t){let e=t&&t[this._statsProp];return e&&this._wantsEverything&&!e.isDirectory()}};function $t(s,t={}){let e=t.entryType||t.type;if(e==="both"&&(e=y.FILE_DIR_TYPE),e&&(t.type=e),s){if(typeof s!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(e&&!Nt.includes(e))throw new Error(`readdirp: Invalid type passed. Use one of ${Nt.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return t.root=s,new J(t)}import{watchFile as be,unwatchFile as jt,watch as Oe}from"fs";import{open as Ce,stat as qt,lstat as Ie,realpath as X}from"fs/promises";import*as E from"path";import{type as He}from"os";var Fe="data",et="end",Yt="close",j=()=>{};var U=process.platform,st=U==="win32",Ne=U==="darwin",ke=U==="linux",ze=U==="freebsd",Gt=He()==="OS400",w={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},T=w,We="watch",$e={lstat:Ie,stat:qt},P="listeners",k="errHandlers",L="rawEmitters",je=[P,k,L],Ue=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),qe=s=>Ue.has(E.extname(s).slice(1).toLowerCase()),tt=(s,t)=>{s instanceof Set?s.forEach(t):t(s)},x=(s,t,e)=>{let n=s[t];n instanceof Set||(s[t]=n=new Set([n])),n.add(e)},Ye=s=>t=>{let e=s[t];e instanceof Set?e.clear():delete s[t]},A=(s,t,e)=>{let n=s[t];n instanceof Set?n.delete(e):n===e&&delete s[t]},Bt=s=>s instanceof Set?s.size===0:!s,z=new Map;function Ut(s,t,e,n,r){let i=(a,o)=>{e(s),r(a,o,{watchedPath:s}),o&&s!==o&&W(E.resolve(s,o),P,E.join(s,o))};try{return Oe(s,{persistent:t.persistent},i)}catch(a){n(a);return}}var W=(s,t,e,n,r)=>{let i=z.get(s);i&&tt(i[t],a=>{a(e,n,r)})},Ge=(s,t,e,n)=>{let{listener:r,errHandler:i,rawEmitter:a}=n,o=z.get(t),c;if(!e.persistent)return c=Ut(s,e,r,i,a),c?c.close.bind(c):void 0;if(o)x(o,P,r),x(o,k,i),x(o,L,a);else{if(c=Ut(s,e,W.bind(null,t,P),i,W.bind(null,t,L)),!c)return;c.on(T.ERROR,async l=>{let u=W.bind(null,t,k);if(o&&(o.watcherUnusable=!0),st&&l.code==="EPERM")try{await(await Ce(s,"r")).close(),u(l)}catch{}else u(l)}),o={listeners:r,errHandlers:i,rawEmitters:a,watcher:c},z.set(t,o)}return()=>{A(o,P,r),A(o,k,i),A(o,L,a),Bt(o.listeners)&&(o.watcher.close(),z.delete(t),je.forEach(Ye(o)),o.watcher=void 0,Object.freeze(o))}},Z=new Map,Be=(s,t,e,n)=>{let{listener:r,rawEmitter:i}=n,a=Z.get(t),o=a&&a.options;return o&&(o.persistent<e.persistent||o.interval>e.interval)&&(jt(t),a=void 0),a?(x(a,P,r),x(a,L,i)):(a={listeners:r,rawEmitters:i,options:e,watcher:be(t,e,(c,l)=>{tt(a.rawEmitters,d=>{d(T.CHANGE,t,{curr:c,prev:l})});let u=c.mtimeMs;(c.size!==l.size||u>l.mtimeMs||u===0)&&tt(a.listeners,d=>d(s,c))})},Z.set(t,a)),()=>{A(a,P,r),A(a,L,i),Bt(a.listeners)&&(Z.delete(t),jt(t),a.options=a.watcher=void 0,Object.freeze(a))}},$=class{constructor(t){this.fsw=t,this._boundHandleError=e=>t._handleError(e)}_watchWithNodeFs(t,e){let n=this.fsw.options,r=E.dirname(t),i=E.basename(t);this.fsw._getWatchedDir(r).add(i);let o=E.resolve(t),c={persistent:n.persistent};e||(e=j);let l;if(n.usePolling){let u=n.interval!==n.binaryInterval;c.interval=u&&qe(i)?n.binaryInterval:n.interval,l=Be(t,o,c,{listener:e,rawEmitter:this.fsw._emitRaw})}else l=Ge(t,o,c,{listener:e,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return l}_handleFile(t,e,n){if(this.fsw.closed)return;let r=E.dirname(t),i=E.basename(t),a=this.fsw._getWatchedDir(r),o=e;if(a.has(i))return;let c=async(u,d)=>{if(this.fsw._throttle(We,t,5)){if(!d||d.mtimeMs===0)try{let h=await qt(t);if(this.fsw.closed)return;let f=h.atimeMs,p=h.mtimeMs;if((!f||f<=p||p!==o.mtimeMs)&&this.fsw._emit(T.CHANGE,t,h),(Ne||ke||ze)&&o.ino!==h.ino){this.fsw._closeFile(u),o=h;let g=this._watchWithNodeFs(t,c);g&&this.fsw._addPathCloser(u,g)}else o=h}catch{this.fsw._remove(r,i)}else if(a.has(i)){let h=d.atimeMs,f=d.mtimeMs;(!h||h<=f||f!==o.mtimeMs)&&this.fsw._emit(T.CHANGE,t,d),o=d}}},l=this._watchWithNodeFs(t,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(T.ADD,t,0))return;this.fsw._emit(T.ADD,t,e)}return l}async _handleSymlink(t,e,n,r){if(this.fsw.closed)return;let i=t.fullPath,a=this.fsw._getWatchedDir(e);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let o;try{o=await X(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==o&&(this.fsw._symlinkPaths.set(i,o),this.fsw._emit(T.CHANGE,n,t.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,o),this.fsw._emit(T.ADD,n,t.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(t,e,n,r,i,a,o){if(t=E.join(t,""),o=this.fsw._throttle("readdir",t,1e3),!o)return;let c=this.fsw._getWatchedDir(n.path),l=new Set,u=this.fsw._readdirp(t,{fileFilter:d=>n.filterPath(d),directoryFilter:d=>n.filterDir(d)});if(u)return u.on(Fe,async d=>{if(this.fsw.closed){u=void 0;return}let h=d.path,f=E.join(t,h);if(l.add(h),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,t,f,h))){if(this.fsw.closed){u=void 0;return}(h===r||!r&&!c.has(h))&&(this.fsw._incrReadyCount(),f=E.join(i,E.relative(i,f)),this._addToNodeFs(f,e,n,a+1))}}).on(T.ERROR,this._boundHandleError),new Promise((d,h)=>{if(!u)return h();u.once(et,()=>{if(this.fsw.closed){u=void 0;return}let f=o?o.clear():!1;d(void 0),c.getChildren().filter(p=>p!==t&&!l.has(p)).forEach(p=>{this.fsw._remove(t,p)}),u=void 0,f&&this._handleRead(t,!1,n,r,i,a,o)})})}async _handleDir(t,e,n,r,i,a,o){let c=this.fsw._getWatchedDir(E.dirname(t)),l=c.has(E.basename(t));!(n&&this.fsw.options.ignoreInitial)&&!i&&!l&&this.fsw._emit(T.ADD_DIR,t,e),c.add(E.basename(t)),this.fsw._getWatchedDir(t);let u,d,h=this.fsw.options.depth;if((h==null||r<=h)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(t,n,a,i,t,r,u),this.fsw.closed))return;d=this._watchWithNodeFs(t,(f,p)=>{p&&p.mtimeMs===0||this._handleRead(f,!1,a,i,t,r,u)})}return d}async _addToNodeFs(t,e,n,r,i){let a=this.fsw._emitReady;if(this.fsw._isIgnored(t)||this.fsw.closed)return a(),!1;let o=this.fsw._getWatchHelpers(t);n&&(o.filterPath=c=>n.filterPath(c),o.filterDir=c=>n.filterDir(c));try{let c=await $e[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,c))return a(),!1;let l=this.fsw.options.followSymlinks,u;if(c.isDirectory()){let d=E.resolve(t),h=l?await X(t):t;if(this.fsw.closed||(u=await this._handleDir(o.watchPath,c,e,r,i,o,h),this.fsw.closed))return;d!==h&&h!==void 0&&this.fsw._symlinkPaths.set(d,h)}else if(c.isSymbolicLink()){let d=l?await X(t):t;if(this.fsw.closed)return;let h=E.dirname(o.watchPath);if(this.fsw._getWatchedDir(h).add(o.watchPath),this.fsw._emit(T.ADD,o.watchPath,c),u=await this._handleDir(h,c,e,r,t,o,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(E.resolve(t),d)}else u=this._handleFile(o.watchPath,c,e);return a(),u&&this.fsw._addPathCloser(t,u),!1}catch(c){if(this.fsw._handleError(c))return a(),t}}};var nt="/",Xe="//",Zt=".",Ze="..",ts="string",es=/\\/g,Vt=/\/\//,ss=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,ns=/^\.[/\\]/;function q(s){return Array.isArray(s)?s:[s]}var rt=s=>typeof s=="object"&&s!==null&&!(s instanceof RegExp);function rs(s){return typeof s=="function"?s:typeof s=="string"?t=>s===t:s instanceof RegExp?t=>s.test(t):typeof s=="object"&&s!==null?t=>{if(s.path===t)return!0;if(s.recursive){let e=m.relative(s.path,t);return e?!e.startsWith("..")&&!m.isAbsolute(e):!1}return!1}:()=>!1}function is(s){if(typeof s!="string")throw new Error("string expected");s=m.normalize(s),s=s.replace(/\\/g,"/");let t=!1;s.startsWith("//")&&(t=!0);let e=/\/\//;for(;s.match(e);)s=s.replace(e,"/");return t&&(s="/"+s),s}function Kt(s,t,e){let n=is(t);for(let r=0;r<s.length;r++){let i=s[r];if(i(n,e))return!0}return!1}function os(s,t){if(s==null)throw new TypeError("anymatch: specify first argument");let n=q(s).map(r=>rs(r));return t==null?(r,i)=>Kt(n,r,i):Kt(n,t)}var Qt=s=>{let t=q(s).flat();if(!t.every(e=>typeof e===ts))throw new TypeError(`Non-string provided as watch path: ${t}`);return t.map(te)},Jt=s=>{let t=s.replace(es,nt),e=!1;for(t.startsWith(Xe)&&(e=!0);t.match(Vt);)t=t.replace(Vt,nt);return e&&(t=nt+t),t},te=s=>Jt(m.normalize(Jt(s))),Xt=(s="")=>t=>typeof t=="string"?te(m.isAbsolute(t)?t:m.join(s,t)):t,as=(s,t)=>m.isAbsolute(s)?s:m.join(t,s),cs=Object.freeze(new Set),it=class{constructor(t,e){this.path=t,this._removeWatcher=e,this.items=new Set}add(t){let{items:e}=this;e&&t!==Zt&&t!==Ze&&e.add(t)}async remove(t){let{items:e}=this;if(!e||(e.delete(t),e.size>0))return;let n=this.path;try{await Qe(n)}catch{this._removeWatcher&&this._removeWatcher(m.dirname(n),m.basename(n))}}has(t){let{items:e}=this;if(e)return e.has(t)}getChildren(){let{items:t}=this;return t?[...t.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=j,this.items=cs,Object.freeze(this)}},ls="stat",us="lstat",ot=class{constructor(t,e,n){this.fsw=n;let r=t;this.path=t=t.replace(ns,""),this.watchPath=r,this.fullWatchPath=m.resolve(r),this.dirParts=[],this.dirParts.forEach(i=>{i.length>1&&i.pop()}),this.followSymlinks=e,this.statMethod=e?ls:us}entryPath(t){return m.join(this.watchPath,m.relative(this.watchPath,t.fullPath))}filterPath(t){let{stats:e}=t;if(e&&e.isSymbolicLink())return this.filterDir(t);let n=this.entryPath(t);return this.fsw._isntIgnored(n,e)&&this.fsw._hasReadPermissions(e)}filterDir(t){return this.fsw._isntIgnored(this.entryPath(t),t.stats)}},Y=class extends Je{constructor(t={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let e=t.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...t,ignored:t.ignored?q(t.ignored):q([]),awaitWriteFinish:e===!0?n:typeof e=="object"?{...n,...e}:!1};Gt&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let c=i.toLowerCase();c==="false"||c==="0"?r.usePolling=!1:c==="true"||c==="1"?r.usePolling=!0:r.usePolling=!!c}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=j,this._readyEmitted=!0,process.nextTick(()=>this.emit(w.READY)))},this._emitRaw=(...c)=>this.emit(w.RAW,...c),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new $(this),Object.freeze(r)}_addIgnoredPath(t){if(rt(t)){for(let e of this._ignoredPaths)if(rt(e)&&e.path===t.path&&e.recursive===t.recursive)return}this._ignoredPaths.add(t)}_removeIgnoredPath(t){if(this._ignoredPaths.delete(t),typeof t=="string")for(let e of this._ignoredPaths)rt(e)&&e.path===t&&this._ignoredPaths.delete(e)}add(t,e,n){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let i=Qt(t);return r&&(i=i.map(a=>as(a,r))),i.forEach(a=>{this._removeIgnoredPath(a)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async a=>{let o=await this._nodeFsHandler._addToNodeFs(a,!n,void 0,0,e);return o&&this._emitReady(),o})).then(a=>{this.closed||a.forEach(o=>{o&&this.add(m.dirname(o),m.basename(e||o))})}),this}unwatch(t){if(this.closed)return this;let e=Qt(t),{cwd:n}=this.options;return e.forEach(r=>{!m.isAbsolute(r)&&!this._closers.has(r)&&(n&&(r=m.join(n,r)),r=m.resolve(r)),this._closePath(r),this._addIgnoredPath(r),this._watched.has(r)&&this._addIgnoredPath({path:r,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let t=[];return this._closers.forEach(e=>e.forEach(n=>{let r=n();r instanceof Promise&&t.push(r)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=t.length?Promise.all(t).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let t={};return this._watched.forEach((e,n)=>{let i=(this.options.cwd?m.relative(this.options.cwd,n):n)||Zt;t[i]=e.getChildren().sort()}),t}emitWithAll(t,e){this.emit(t,...e),t!==w.ERROR&&this.emit(w.ALL,t,...e)}async _emit(t,e,n){if(this.closed)return;let r=this.options;st&&(e=m.normalize(e)),r.cwd&&(e=m.relative(r.cwd,e));let i=[e];n!=null&&i.push(n);let a=r.awaitWriteFinish,o;if(a&&(o=this._pendingWrites.get(e)))return o.lastChange=new Date,this;if(r.atomic){if(t===w.UNLINK)return this._pendingUnlinks.set(e,[t,...i]),setTimeout(()=>{this._pendingUnlinks.forEach((c,l)=>{this.emit(...c),this.emit(w.ALL,...c),this._pendingUnlinks.delete(l)})},typeof r.atomic=="number"?r.atomic:100),this;t===w.ADD&&this._pendingUnlinks.has(e)&&(t=w.CHANGE,this._pendingUnlinks.delete(e))}if(a&&(t===w.ADD||t===w.CHANGE)&&this._readyEmitted){let c=(l,u)=>{l?(t=w.ERROR,i[0]=l,this.emitWithAll(t,i)):u&&(i.length>1?i[1]=u:i.push(u),this.emitWithAll(t,i))};return this._awaitWriteFinish(e,a.stabilityThreshold,t,c),this}if(t===w.CHANGE&&!this._throttle(w.CHANGE,e,50))return this;if(r.alwaysStat&&n===void 0&&(t===w.ADD||t===w.ADD_DIR||t===w.CHANGE)){let c=r.cwd?m.join(r.cwd,e):e,l;try{l=await Ke(c)}catch{}if(!l||this.closed)return;i.push(l)}return this.emitWithAll(t,i),this}_handleError(t){let e=t&&t.code;return t&&e!=="ENOENT"&&e!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||e!=="EPERM"&&e!=="EACCES")&&this.emit(w.ERROR,t),t||this.closed}_throttle(t,e,n){this._throttled.has(t)||this._throttled.set(t,new Map);let r=this._throttled.get(t);if(!r)throw new Error("invalid throttle");let i=r.get(e);if(i)return i.count++,!1;let a,o=()=>{let l=r.get(e),u=l?l.count:0;return r.delete(e),clearTimeout(a),l&&clearTimeout(l.timeoutObject),u};a=setTimeout(o,n);let c={timeoutObject:a,clear:o,count:0};return r.set(e,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(t,e,n,r){let i=this.options.awaitWriteFinish;if(typeof i!="object")return;let a=i.pollInterval,o,c=t;this.options.cwd&&!m.isAbsolute(t)&&(c=m.join(this.options.cwd,t));let l=new Date,u=this._pendingWrites;function d(h){Ve(c,(f,p)=>{if(f||!u.has(t)){f&&f.code!=="ENOENT"&&r(f);return}let g=Number(new Date);h&&p.size!==h.size&&(u.get(t).lastChange=g);let B=u.get(t);g-B.lastChange>=e?(u.delete(t),r(void 0,p)):o=setTimeout(d,a,p)})}u.has(t)||(u.set(t,{lastChange:l,cancelWait:()=>(u.delete(t),clearTimeout(o),n)}),o=setTimeout(d,a))}_isIgnored(t,e){if(this.options.atomic&&ss.test(t))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=(this.options.ignored||[]).map(Xt(n)),o=[...[...this._ignoredPaths].map(Xt(n)),...i];this._userIgnored=os(o,void 0)}return this._userIgnored(t,e)}_isntIgnored(t,e){return!this._isIgnored(t,e)}_getWatchHelpers(t){return new ot(t,this.options.followSymlinks,this)}_getWatchedDir(t){let e=m.resolve(t);return this._watched.has(e)||this._watched.set(e,new it(e,this._boundRemove)),this._watched.get(e)}_hasReadPermissions(t){return this.options.ignorePermissionErrors?!0:!!(Number(t.mode)&256)}_remove(t,e,n){let r=m.join(t,e),i=m.resolve(r);if(n=n??(this._watched.has(r)||this._watched.has(i)),!this._throttle("remove",r,100))return;!n&&this._watched.size===1&&this.add(t,e,!0),this._getWatchedDir(r).getChildren().forEach(h=>this._remove(r,h));let c=this._getWatchedDir(t),l=c.has(e);c.remove(e),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let u=r;if(this.options.cwd&&(u=m.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===w.ADD)return;this._watched.delete(r),this._watched.delete(i);let d=n?w.UNLINK_DIR:w.UNLINK;l&&!this._isIgnored(r)&&this._emit(d,r),this._closePath(r)}_closePath(t){this._closeFile(t);let e=m.dirname(t);this._getWatchedDir(e).remove(m.basename(t))}_closeFile(t){let e=this._closers.get(t);e&&(e.forEach(n=>n()),this._closers.delete(t))}_addPathCloser(t,e){if(!e)return;let n=this._closers.get(t);n||(n=[],this._closers.set(t,n)),n.push(e)}_readdirp(t,e){if(this.closed)return;let n={type:w.ALL,alwaysStat:!0,lstat:!0,...e,depth:0},r=$t(t,n);return this._streams.add(r),r.once(Yt,()=>{r=void 0}),r.once(et,()=>{r&&(this._streams.delete(r),r=void 0)}),r}};function ds(s,t={}){let e=new Y(t);return e.add(s),e}var at={watch:ds,FSWatcher:Y};var D=_.resolve("src/pages"),ee=_.resolve("src/gen"),se=_.resolve("src/routes"),hs=_.join(ee,"tsrouter.gen.ts"),G=_.join(se,"__root.ts"),ne=async()=>{async function s(c){try{await v.mkdir(c,{recursive:!0})}catch{}}await s(ee),await s(se);function t(c,l){let u="/"+_.relative(l,c).replace(/\\/g,"/");return u=u.replace(/\.ts$/,""),u=u.replace(/\/index$/,"")||"/",u=u.replace(/\[(.+?)\]/g,":$1"),u}function e(c){return c.replace(/^\//,"").split("/").map(l=>l.startsWith(":")?l.slice(1):l).filter(Boolean).join("-")||"index"}function n(c,l){let d=_.relative(l,c).replace(/\\/g,"/").split("/").filter(Boolean),h=d[d.length-1].replace(".ts",""),f=d.length>1?d[d.length-2]:"";if(h.startsWith("[")&&h.endsWith("]")){let p=h.slice(1,-1);return f.charAt(0).toUpperCase()+f.slice(1)+p.charAt(0).toUpperCase()+p.slice(1)+"Param"}else return h.charAt(0).toUpperCase()+h.slice(1)}async function r(c){let l=await v.readdir(c,{withFileTypes:!0}),u=[];for(let d of l){let h=_.join(c,d.name);if(d.isDirectory())u=u.concat(await r(h));else if(d.isFile()&&d.name.endsWith(".ts")){let f=t(h,D),p=e(f),g=n(h,D);u.push({file:h,route:f,routeName:p,importName:g})}}return u}function i(c,l){return`import { html, useTSElements, useTSExtractParams, useTSMetaData } from '@devwareng/vanilla-ts'
|
|
1
|
+
function ie(s){return(s==null?"":String(s)).replace(/<\s*(script|iframe|object|embed|link|style)[^>]*>.*?<\s*\/\s*\1\s*>/gi,"").replace(/<\s*(script|iframe|object|embed|link|style)[^>]*>/gi,"").replace(/\son\w+\s*=\s*(['"]).*?\1/gi,"").replace(/\s(href|src)\s*=\s*(['"])\s*javascript:[^'"]*\2/gi,"")}function lt(s,...t){return s.reduce((e,n,r)=>{let i=r<t.length?ie(t[r]):"";return e+n+i},"")}function M(){let s=new Set;document.querySelectorAll("*").forEach(t=>{let e=t.tagName.toLowerCase();e.includes("-")&&s.add(e)}),s.forEach(t=>{customElements.get(t)||customElements.define(t,class extends HTMLElement{connectedCallback(){this.innerHTML=`<div style="padding:10px;background:#eee;">${t} (Auto)</div>`}})})}var oe=s=>s.replace(/<\/?(script|iframe|object|embed|link|meta|style)[^>]*>/gi,"").replace(/\s+on[a-z]+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/\s+(href|src)\s*=\s*(['"]?)\s*javascript:[^'"\s>]*/gi,""),ae=s=>s?.map(t=>oe(t)).join("")??"";import ut from"dompurify";var dt=(s,t)=>{let n={...{ADD_TAGS:["my-custom-tag"]},...t};return typeof s=="string"?ut.sanitize(s,n):ut.sanitize(s.innerHTML,n)};var ht=(s,t,e)=>{if(typeof s=="string"){let n=document.getElementById(s);n?n.addEventListener(t,e):console.warn(`Element with id '${s}' not found.`)}else s===document?document.addEventListener(t,e):console.warn("Invalid id parameter provided.")};import{createStore as ce}from"zustand/vanilla";import ft from"dompurify";function le(s,t){let e=[],n=s.replace(/:[^/]+/g,o=>(e.push(o.slice(1)),"([^/]+)")),r=new RegExp(`^${n}$`),i=t.match(r),a={};return i&&e.forEach((o,c)=>{a[o]=ft.sanitize(i[c+1]??"")}),a}function ue(s){let t={},e=new URLSearchParams(s);for(let[n,r]of e.entries())t[n]=ft.sanitize(r);return t}var b=ce((s,t)=>({params:{},query:{},setFromPattern:e=>{let n=window.location.pathname,r=le(e,n),i=ue(window.location.search);s({params:r,query:i})},getParam:e=>t().params[e],getQuery:e=>t().query[e]}));function mt(s){let t=b.getState();t.setFromPattern(s);let e=t.params,n=t.query;return{...e,...n}}var pt=(s,t,e)=>{let n=document.querySelectorAll(s);return n.forEach(r=>{r.addEventListener(t,e)}),()=>{n.forEach(r=>{r.removeEventListener(t,e)})}};import V from"dompurify";var gt=(s,t,e,n={})=>{let r={USE_PROFILES:{svg:!0,html:!0},ALLOWED_TAGS:["svg","path","circle","rect","line","polyline","polygon","g","main","div","h1","h2","h3","h4","h5","h6","p","button","span","a","img","input","ul","li","i"],ALLOWED_ATTR:["class","id","href","src","alt","fill","stroke","stroke-width","viewBox","xmlns","d","x","y","cx","cy","r","width","height","data-onclick","data-onchange","data-onselect"],FORBID_TAGS:["script","iframe"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|tel|ftp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,...e};V.addHook("uponSanitizeElement",(a,o)=>{let c=o.tagName.toLowerCase();c.includes("-")&&(o.allowedTags[c]=!0)}),V.addHook("uponSanitizeAttribute",(a,o)=>{o.attrName&&o.attrName.toLowerCase().startsWith("on")&&(o.keepAttr=!1)});let i=V.sanitize(t,r);s.innerHTML=i,s.querySelectorAll("[data-onclick]").forEach(a=>{let o=a.dataset.onclick;n[o]&&a.addEventListener("click",n[o])}),s.querySelectorAll("[data-onchange]").forEach(a=>{let o=a.dataset.onchange;n[o]&&a.addEventListener("change",n[o])}),s.querySelectorAll("[data-onselect]").forEach(a=>{let o=a.dataset.onselect;n[o]&&a.addEventListener("select",n[o])})};import de from"dompurify";var O=null,Et=(s,t)=>{if(typeof document>"u")return;let e=document.getElementById(s);if(!e)return;let n=e.innerHTML,i=de.sanitize(n,{ALLOWED_TAGS:["div","span","p","h1","h2","h3","h4","h5","h6","ul","ol","li","strong","em","a","img","br"],ALLOWED_ATTR:["href","src","alt","title","class","id","data-onclick","data-onchange"],ALLOW_DATA_ATTR:!1,KEEP_CONTENT:!1}).replace(/\b(href|src)=["']?(?!https?:|mailto:|\/|#)/gi,'$1="#"');if(O!==null&&i!==O){let a=document.createElement("div");t(a),e.innerHTML=O}else O=i,e.innerHTML=i,t(e)};import wt from"dompurify";typeof window<"u"&&!window.__anchorSinglePopstateHandlerAttached&&(window.addEventListener("popstate",s=>{let t=s.state;t?.scrollPosition!==void 0&&window.scrollTo(0,t.scrollPosition)}),window.__anchorSinglePopstateHandlerAttached=!0);var yt=(s,t,e,n="",r=null)=>{if(!s)return;let i=wt.sanitize(t,{ALLOWED_URI_REGEXP:/^(https?:|\/)/}),a=wt.sanitize(e,{USE_PROFILES:{html:!1}});s.setAttribute("href",i),s.setAttribute("aria-label",a),n&&(s.className=n.trim()),r&&s.replaceChildren(r),typeof window<"u"&&s.addEventListener("click",o=>{o.preventDefault();let l=o.currentTarget.getAttribute("href");if(l){let u=window.scrollY;window.scrollTo(0,0),window.history.pushState({scrollPosition:u},"",l),dispatchEvent(new PopStateEvent("popstate"))}})};import R from"dompurify";var Tt=(s="'self' 'nonce-rAnd0m123' 'unsafe-inline' 'unsafe-eval'",t="'self' 'nonce-rAnd0m123'",e="'none'",n="'self' https://fonts.googleapis.com https://fonts.gstatic.com",r="'self' https://blogger.googleusercontent.com",i=["'self'","https://fonts.googleapis.com","https://fonts.gstatic.com","https://www.google.com/maps/"],a="'self' https://www.youtube.com",o="'self'",c="/csp-report",l=!1)=>{let u=()=>{try{let d=document.querySelector('meta[http-equiv="Content-Security-Policy"]');d||(d=document.createElement("meta"),d.setAttribute("http-equiv","Content-Security-Policy"),document.head.appendChild(d));let h=l?`report-uri ${c};`:"";d.setAttribute("content",`default-src 'self'; script-src ${s}; style-src ${t}; object-src ${e}; font-src ${n}; img-src ${r}; connect-src ${i.join(" ")}; frame-src ${a}; base-uri ${o}; ${h}`)}catch(d){console.error("Error adding CSP meta element:",d)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u()};var _t=(s,t)=>{let e={name:R.sanitize(s.name||""),description:R.sanitize(s.description||"Default description"),author:R.sanitize(s.author||"")},n=f=>{e.name=R.sanitize(f),d("name",e.name)},r=f=>{e.description=R.sanitize(f),d("description",e.description)},i=f=>{e.author=R.sanitize(f),d("author",e.author)},a=()=>e.name,o=()=>e.description,c=()=>e.author,l=()=>e,u=(f,p)=>{let g=document.createElement("meta");g.setAttribute("name",f),g.setAttribute("content",p),document.head.appendChild(g)},d=(f,p)=>{let g=document.querySelector(`meta[name="${f}"]`);g?g.setAttribute("content",p):u(f,p)},h=()=>{d("name",e.name),d("description",e.description),d("author",e.author)};return t&&Tt(t.scriptSrc,t.styleSrc,t.objectSrc,Array.isArray(t.connectSrc)?t.connectSrc.join(" "):t.connectSrc,t.reportOnly!==void 0?String(t.reportOnly):void 0),h(),{setName:n,setDescription:r,setAuthor:i,getName:a,getDescription:o,getAuthor:c,getAllMetaData:l,appendMetaTagsToHead:h}};import he from"dompurify";var C=(s,t,e,n,r)=>{let i=`#${s}`,a=t.querySelectorAll(i);if(a.length===0)throw new Error(`[useTSComponent] No element found with id '${s}' in the given parent.`);if(a.length>1)throw new Error(`[useTSComponent] Duplicate id '${s}' detected. Found ${a.length} elements.`);let o=a[0];o.innerHTML=he.sanitize(o.innerHTML,{USE_PROFILES:{html:!0}}),e(o,n,r)};var St=(s,t,e,n=[])=>{let r=new Set;s.forEach((i,a)=>{if(r.has(i)){console.warn(`[useTSCollection] Duplicate ID in collection array: "${i}" \u2014 skipping.`);return}r.add(i);let o=t.querySelectorAll(`#${i}`);if(o.length>1){console.warn(`[useTSCollection] Duplicate ID in DOM: "${i}" (${o.length} elements found) \u2014 skipping component mount.`);return}let c=e[a],l=Array.isArray(n)?n[a]:void 0;typeof c=="function"?C(i,t,c,l):console.warn(`[useTSCollection] No valid component function found for ID: "${i}"`)})};var Pt=(s,t)=>{let n=(t??document).querySelectorAll(s);if(n.length===0)return process.env.NODE_ENV!=="production"&&console.warn(`[useTSSelect] No element found for selector: '${s}'`),null;if(s.startsWith("#")&&n.length>1){if(process.env.NODE_ENV!=="production")throw new Error(`[useTSSelect] Duplicate ID detected: '${s}'. Found ${n.length} elements with this ID.`);return n[0]}return n.length>1&&process.env.NODE_ENV!=="production"&&console.warn(`[useTSSelect] Multiple elements found for selector: '${s}'. Returning the first one.`),n[0]};import{jwtDecode as fe}from"jwt-decode";var vt=(s,t)=>{let e=localStorage.getItem("token");if(!e)return window.location.href=t,null;try{let n=fe(e),r=Date.now()/1e3;return n.exp&&n.exp<r&&(console.error("Token has expired"),window.localStorage.removeItem("token"),window.location.href=t),null}catch(n){return console.error("Invalid token:",n),window.location.href=t,null}};var I=(s,t,e)=>{s.forEach(n=>{t.forEach(r=>{n.addEventListener(r,i=>{e(n,i)})})})};var Rt=()=>({back:()=>window.history.back(),forward:()=>window.history.forward()});var Lt=(s,t)=>{let e=document.querySelector(`#${s}`)||document.querySelector(`.${s}`);if(!e)return;let n=window.location.pathname.replace(/\/$/,"");for(let r of t){let i=r.path.replace(/\/$/,"");if(n===i||n.startsWith(`${i}/`)){r.component(e);break}}};function Dt(s,t){let e=window.location.pathname.replace(/\/$/,"");t.routes.forEach(n=>{n.children?.length&&n.children.forEach(r=>{let i=r.path.replace(/\/$/,"");if(e===i||e.startsWith(`${i}/`)){let a=s.querySelector(`#${r.outlet}`)||s.querySelector(`.${r.outlet}`);a instanceof HTMLElement&&r.element&&r.element(a)}})})}import{createStore as me}from"zustand/vanilla";function xt(s){let t=me(()=>({value:s})),e=new Set;return{get:()=>t.getState().value,set:n=>{t.setState({value:n}),e.forEach(r=>r(n))},subscribe:n=>(e.add(n),n(t.getState().value),()=>e.delete(n))}}function At(s){let t=s();typeof t=="function"&&t()}var H=()=>{let s=document.querySelectorAll('a[href^="#"]');I(s,["click"],(t,e)=>{e.preventDefault();let n=t.getAttribute("href")?.substring(1),r=n?document.getElementById(n):null;r&&r.scrollIntoView({behavior:"smooth",block:"start"})})};import{debounce as pe}from"lodash-es";var K=s=>s;typeof window<"u"&&typeof document<"u"&&(K=s=>{let t=document.createElement("div");return t.innerText=s,t.innerHTML});var ge=s=>{(s?Array.isArray(s)?s:s instanceof HTMLAnchorElement?[s]:Array.from(s):Array.from(document.querySelectorAll("a"))).forEach(e=>{if(!e||e.dataset.anchorEnhanced==="true")return;e.dataset.anchorEnhanced="true";let n=e.getAttribute("class")||"";e.setAttribute("class",K(n));let r=e.getAttribute("aria-label");r&&e.setAttribute("aria-label",K(r));let i=e.querySelector(":scope > *");i&&(e.innerHTML="",e.appendChild(i));let a=e.getAttribute("href")||"";if(!a.startsWith("#")){try{if(new URL(a,window.location.href).origin!==window.location.origin)return}catch{return}e.addEventListener("click",o=>{o.preventDefault();let c=e.getAttribute("href")||"";try{let l=new URL(c,window.location.href);window.history.pushState({},"",l.pathname+l.search+l.hash),window.dispatchEvent(new PopStateEvent("popstate"))}catch(l){console.error("Invalid URL in anchor:",c,l)}})}})},Ee=pe(ge,50),N=s=>{Ee(s)};var F=s=>{let t=s.querySelectorAll("a");N(t)};var Mt=s=>{H(),F(s)};var bt=async()=>{let s="https://cdn.jsdelivr.net/npm/brython@3/brython.min.js",t="https://cdn.jsdelivr.net/npm/brython@3/brython_stdlib.js",e=n=>new Promise((r,i)=>{let a=document.createElement("script");a.src=n,a.onload=()=>r(),a.onerror=()=>i(new Error(`Failed to load ${n}`)),document.head.appendChild(a)});await e(s),await e(t),typeof window.brython=="function"?window.brython():console.error("Brython did not load correctly.")},Ot=s=>new Promise((t,e)=>{let n=document.createElement("script");n.type="text/python",n.src=`/src/python/${s}`,n.onload=()=>t(),n.onerror=()=>e(new Error(`Failed to load ${s}`)),document.body.appendChild(n)});function Ct(s){let t=null;return async(e,n)=>{try{if(!t){let r=await s();t=r.default||r}if(typeof t=="function")return t(e,n);if(t instanceof HTMLElement){e?.appendChild(t);return}if(t&&typeof t.render=="function")return t.render(e,n);console.warn("useTSLazy: Unsupported module type",t)}catch(r){console.error("useTSLazy failed:",r)}}}var It=s=>typeof window>"u"?{isDOM:null}:{isDOM:s||document.body};import Nt from"dompurify";import{createStore as we}from"zustand/vanilla";import ye from"dompurify";var S=we(s=>({params:{},query:{},setParams:t=>s(()=>({params:Ht(t)})),setQuery:t=>s(()=>({query:Ht(t)}))}));function Ht(s){let t={};for(let e in s)t[e]=ye.sanitize(s[e]);return t}var Q=class{constructor(t,e){this.routes=[];this.routes=t,this.expectedParams=new Set(e),window.addEventListener("popstate",this.handlePopState.bind(this)),this.handlePopState()}handlePopState(){let t=window.location.pathname,e=window.location.search,n=this.parseQueryParams(e),r=this.findMatchingRoute(t,this.routes);if(r){if(r.routeto){this.navigate(r.routeto);return}let i=this.filterAndSanitizeParams(r.params);S.getState().setParams(i),S.getState().setQuery(n);let a=document.createElement("div");if(r.element?.(a,i,n),r.children){let o=t.slice(r.path.length),c=a.querySelector("#child");c&&this.renderChildren(r.children,o,c,i,n)}}else{let i=this.findMatchingRoute("*",this.routes);if(i){let a=this.filterAndSanitizeParams(i.params);S.getState().setParams(a),S.getState().setQuery(n);let o=document.createElement("div");i.element?.(o,a,n)}}}renderChildren(t,e,n,r,i){if(!t||t.length===0){let o=n.querySelector("#child");o&&o.remove();return}let a=this.findMatchingRoute(e,t);if(a){let o=document.createElement("div");o.id="child";let c={...r,...a.params},l=this.filterAndSanitizeParams(c);if(S.getState().setParams(l),S.getState().setQuery(i),a.element?.(o,l,i),n.appendChild(o),a.children){let u=e.slice(a.path.length);this.renderChildren(a.children,u,o,l,i)}}}parseQueryParams(t){let e={},n=new URLSearchParams(t);for(let[r,i]of n.entries())this.expectedParams.has(r)&&(e[r]=Nt.sanitize(i));return e}findMatchingRoute(t,e,n={}){for(let r of e){let i=r.path;if(i==="*")return r;{let o=[],c=i.replace(/:[^\s/]+/g,d=>(o.push(d.substring(1)),"([^\\s/]+)")),l=new RegExp(`^${c}(?:/|$)`),u=t.match(l);if(u){let d={...n};if(o.forEach((h,f)=>{d[h]=u[f+1]??""}),r.children){let h=t.slice(u[0].length),f=this.findMatchingRoute(h,r.children,d);if(f)return f}return{...r,params:d}}}}}filterAndSanitizeParams(t){if(!t)return{};let e={};for(let n in t)this.expectedParams.has(n)&&(e[n]=Nt.sanitize(t[n]??""));return e}navigate(t){history.pushState(null,"",t),this.handlePopState()}addRoute(t){this.routes.push(t)}};import v from"fs/promises";import _ from"path";import{stat as Ke}from"fs";import{stat as Qe,readdir as Je}from"fs/promises";import{EventEmitter as Xe}from"events";import*as m from"path";import{stat as Te,lstat as Ft,readdir as _e,realpath as Se}from"fs/promises";import{Readable as Pe}from"stream";import{resolve as kt,relative as ve,join as Re,sep as Le}from"path";var y={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},J={root:".",fileFilter:s=>!0,directoryFilter:s=>!0,type:y.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(J);var jt="READDIRP_RECURSIVE_ERROR",De=new Set(["ENOENT","EPERM","EACCES","ELOOP",jt]),zt=[y.DIR_TYPE,y.EVERYTHING_TYPE,y.FILE_DIR_TYPE,y.FILE_TYPE],xe=new Set([y.DIR_TYPE,y.EVERYTHING_TYPE,y.FILE_DIR_TYPE]),Ae=new Set([y.EVERYTHING_TYPE,y.FILE_DIR_TYPE,y.FILE_TYPE]),Me=s=>De.has(s.code),be=process.platform==="win32",Wt=s=>!0,$t=s=>{if(s===void 0)return Wt;if(typeof s=="function")return s;if(typeof s=="string"){let t=s.trim();return e=>e.basename===t}if(Array.isArray(s)){let t=s.map(e=>e.trim());return e=>t.some(n=>e.basename===n)}return Wt},X=class extends Pe{constructor(t={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:t.highWaterMark});let e={...J,...t},{root:n,type:r}=e;this._fileFilter=$t(e.fileFilter),this._directoryFilter=$t(e.directoryFilter);let i=e.lstat?Ft:Te;be?this._stat=a=>i(a,{bigint:!0}):this._stat=i,this._maxDepth=e.depth??J.depth,this._wantsDir=r?xe.has(r):!1,this._wantsFile=r?Ae.has(r):!1,this._wantsEverything=r===y.EVERYTHING_TYPE,this._root=kt(n),this._isDirent=!e.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(t){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&t>0;){let e=this.parent,n=e&&e.files;if(n&&n.length>0){let{path:r,depth:i}=e,a=n.splice(0,t).map(c=>this._formatEntry(c,r)),o=await Promise.all(a);for(let c of o){if(!c)continue;if(this.destroyed)return;let l=await this._getEntryType(c);l==="directory"&&this._directoryFilter(c)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(c.fullPath,i+1)),this._wantsDir&&(this.push(c),t--)):(l==="file"||this._includeAsFile(c))&&this._fileFilter(c)&&this._wantsFile&&(this.push(c),t--)}}else{let r=this.parents.pop();if(!r){this.push(null);break}if(this.parent=await r,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(t,e){let n;try{n=await _e(t,this._rdOptions)}catch(r){this._onError(r)}return{files:n,depth:e,path:t}}async _formatEntry(t,e){let n,r=this._isDirent?t.name:t;try{let i=kt(Re(e,r));n={path:ve(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?t:await this._stat(i)}catch(i){this._onError(i);return}return n}_onError(t){Me(t)&&!this.destroyed?this.emit("warn",t):this.destroy(t)}async _getEntryType(t){if(!t&&this._statsProp in t)return"";let e=t[this._statsProp];if(e.isFile())return"file";if(e.isDirectory())return"directory";if(e&&e.isSymbolicLink()){let n=t.fullPath;try{let r=await Se(n),i=await Ft(r);if(i.isFile())return"file";if(i.isDirectory()){let a=r.length;if(n.startsWith(r)&&n.substr(a,1)===Le){let o=new Error(`Circular symlink detected: "${n}" points to "${r}"`);return o.code=jt,this._onError(o)}return"directory"}}catch(r){return this._onError(r),""}}}_includeAsFile(t){let e=t&&t[this._statsProp];return e&&this._wantsEverything&&!e.isDirectory()}};function Ut(s,t={}){let e=t.entryType||t.type;if(e==="both"&&(e=y.FILE_DIR_TYPE),e&&(t.type=e),s){if(typeof s!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(e&&!zt.includes(e))throw new Error(`readdirp: Invalid type passed. Use one of ${zt.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return t.root=s,new X(t)}import{watchFile as Oe,unwatchFile as qt,watch as Ce}from"fs";import{open as Ie,stat as Gt,lstat as He,realpath as Z}from"fs/promises";import*as E from"path";import{type as Ne}from"os";var Fe="data",st="end",Bt="close",j=()=>{};var U=process.platform,nt=U==="win32",ke=U==="darwin",ze=U==="linux",We=U==="freebsd",Vt=Ne()==="OS400",w={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},T=w,$e="watch",je={lstat:He,stat:Gt},P="listeners",k="errHandlers",L="rawEmitters",Ue=[P,k,L],qe=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Ye=s=>qe.has(E.extname(s).slice(1).toLowerCase()),et=(s,t)=>{s instanceof Set?s.forEach(t):t(s)},x=(s,t,e)=>{let n=s[t];n instanceof Set||(s[t]=n=new Set([n])),n.add(e)},Ge=s=>t=>{let e=s[t];e instanceof Set?e.clear():delete s[t]},A=(s,t,e)=>{let n=s[t];n instanceof Set?n.delete(e):n===e&&delete s[t]},Kt=s=>s instanceof Set?s.size===0:!s,z=new Map;function Yt(s,t,e,n,r){let i=(a,o)=>{e(s),r(a,o,{watchedPath:s}),o&&s!==o&&W(E.resolve(s,o),P,E.join(s,o))};try{return Ce(s,{persistent:t.persistent},i)}catch(a){n(a);return}}var W=(s,t,e,n,r)=>{let i=z.get(s);i&&et(i[t],a=>{a(e,n,r)})},Be=(s,t,e,n)=>{let{listener:r,errHandler:i,rawEmitter:a}=n,o=z.get(t),c;if(!e.persistent)return c=Yt(s,e,r,i,a),c?c.close.bind(c):void 0;if(o)x(o,P,r),x(o,k,i),x(o,L,a);else{if(c=Yt(s,e,W.bind(null,t,P),i,W.bind(null,t,L)),!c)return;c.on(T.ERROR,async l=>{let u=W.bind(null,t,k);if(o&&(o.watcherUnusable=!0),nt&&l.code==="EPERM")try{await(await Ie(s,"r")).close(),u(l)}catch{}else u(l)}),o={listeners:r,errHandlers:i,rawEmitters:a,watcher:c},z.set(t,o)}return()=>{A(o,P,r),A(o,k,i),A(o,L,a),Kt(o.listeners)&&(o.watcher.close(),z.delete(t),Ue.forEach(Ge(o)),o.watcher=void 0,Object.freeze(o))}},tt=new Map,Ve=(s,t,e,n)=>{let{listener:r,rawEmitter:i}=n,a=tt.get(t),o=a&&a.options;return o&&(o.persistent<e.persistent||o.interval>e.interval)&&(qt(t),a=void 0),a?(x(a,P,r),x(a,L,i)):(a={listeners:r,rawEmitters:i,options:e,watcher:Oe(t,e,(c,l)=>{et(a.rawEmitters,d=>{d(T.CHANGE,t,{curr:c,prev:l})});let u=c.mtimeMs;(c.size!==l.size||u>l.mtimeMs||u===0)&&et(a.listeners,d=>d(s,c))})},tt.set(t,a)),()=>{A(a,P,r),A(a,L,i),Kt(a.listeners)&&(tt.delete(t),qt(t),a.options=a.watcher=void 0,Object.freeze(a))}},$=class{constructor(t){this.fsw=t,this._boundHandleError=e=>t._handleError(e)}_watchWithNodeFs(t,e){let n=this.fsw.options,r=E.dirname(t),i=E.basename(t);this.fsw._getWatchedDir(r).add(i);let o=E.resolve(t),c={persistent:n.persistent};e||(e=j);let l;if(n.usePolling){let u=n.interval!==n.binaryInterval;c.interval=u&&Ye(i)?n.binaryInterval:n.interval,l=Ve(t,o,c,{listener:e,rawEmitter:this.fsw._emitRaw})}else l=Be(t,o,c,{listener:e,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return l}_handleFile(t,e,n){if(this.fsw.closed)return;let r=E.dirname(t),i=E.basename(t),a=this.fsw._getWatchedDir(r),o=e;if(a.has(i))return;let c=async(u,d)=>{if(this.fsw._throttle($e,t,5)){if(!d||d.mtimeMs===0)try{let h=await Gt(t);if(this.fsw.closed)return;let f=h.atimeMs,p=h.mtimeMs;if((!f||f<=p||p!==o.mtimeMs)&&this.fsw._emit(T.CHANGE,t,h),(ke||ze||We)&&o.ino!==h.ino){this.fsw._closeFile(u),o=h;let g=this._watchWithNodeFs(t,c);g&&this.fsw._addPathCloser(u,g)}else o=h}catch{this.fsw._remove(r,i)}else if(a.has(i)){let h=d.atimeMs,f=d.mtimeMs;(!h||h<=f||f!==o.mtimeMs)&&this.fsw._emit(T.CHANGE,t,d),o=d}}},l=this._watchWithNodeFs(t,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(T.ADD,t,0))return;this.fsw._emit(T.ADD,t,e)}return l}async _handleSymlink(t,e,n,r){if(this.fsw.closed)return;let i=t.fullPath,a=this.fsw._getWatchedDir(e);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let o;try{o=await Z(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==o&&(this.fsw._symlinkPaths.set(i,o),this.fsw._emit(T.CHANGE,n,t.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,o),this.fsw._emit(T.ADD,n,t.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(t,e,n,r,i,a,o){if(t=E.join(t,""),o=this.fsw._throttle("readdir",t,1e3),!o)return;let c=this.fsw._getWatchedDir(n.path),l=new Set,u=this.fsw._readdirp(t,{fileFilter:d=>n.filterPath(d),directoryFilter:d=>n.filterDir(d)});if(u)return u.on(Fe,async d=>{if(this.fsw.closed){u=void 0;return}let h=d.path,f=E.join(t,h);if(l.add(h),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,t,f,h))){if(this.fsw.closed){u=void 0;return}(h===r||!r&&!c.has(h))&&(this.fsw._incrReadyCount(),f=E.join(i,E.relative(i,f)),this._addToNodeFs(f,e,n,a+1))}}).on(T.ERROR,this._boundHandleError),new Promise((d,h)=>{if(!u)return h();u.once(st,()=>{if(this.fsw.closed){u=void 0;return}let f=o?o.clear():!1;d(void 0),c.getChildren().filter(p=>p!==t&&!l.has(p)).forEach(p=>{this.fsw._remove(t,p)}),u=void 0,f&&this._handleRead(t,!1,n,r,i,a,o)})})}async _handleDir(t,e,n,r,i,a,o){let c=this.fsw._getWatchedDir(E.dirname(t)),l=c.has(E.basename(t));!(n&&this.fsw.options.ignoreInitial)&&!i&&!l&&this.fsw._emit(T.ADD_DIR,t,e),c.add(E.basename(t)),this.fsw._getWatchedDir(t);let u,d,h=this.fsw.options.depth;if((h==null||r<=h)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(t,n,a,i,t,r,u),this.fsw.closed))return;d=this._watchWithNodeFs(t,(f,p)=>{p&&p.mtimeMs===0||this._handleRead(f,!1,a,i,t,r,u)})}return d}async _addToNodeFs(t,e,n,r,i){let a=this.fsw._emitReady;if(this.fsw._isIgnored(t)||this.fsw.closed)return a(),!1;let o=this.fsw._getWatchHelpers(t);n&&(o.filterPath=c=>n.filterPath(c),o.filterDir=c=>n.filterDir(c));try{let c=await je[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,c))return a(),!1;let l=this.fsw.options.followSymlinks,u;if(c.isDirectory()){let d=E.resolve(t),h=l?await Z(t):t;if(this.fsw.closed||(u=await this._handleDir(o.watchPath,c,e,r,i,o,h),this.fsw.closed))return;d!==h&&h!==void 0&&this.fsw._symlinkPaths.set(d,h)}else if(c.isSymbolicLink()){let d=l?await Z(t):t;if(this.fsw.closed)return;let h=E.dirname(o.watchPath);if(this.fsw._getWatchedDir(h).add(o.watchPath),this.fsw._emit(T.ADD,o.watchPath,c),u=await this._handleDir(h,c,e,r,t,o,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(E.resolve(t),d)}else u=this._handleFile(o.watchPath,c,e);return a(),u&&this.fsw._addPathCloser(t,u),!1}catch(c){if(this.fsw._handleError(c))return a(),t}}};var rt="/",Ze="//",ee=".",ts="..",es="string",ss=/\\/g,Qt=/\/\//,ns=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,rs=/^\.[/\\]/;function q(s){return Array.isArray(s)?s:[s]}var it=s=>typeof s=="object"&&s!==null&&!(s instanceof RegExp);function is(s){return typeof s=="function"?s:typeof s=="string"?t=>s===t:s instanceof RegExp?t=>s.test(t):typeof s=="object"&&s!==null?t=>{if(s.path===t)return!0;if(s.recursive){let e=m.relative(s.path,t);return e?!e.startsWith("..")&&!m.isAbsolute(e):!1}return!1}:()=>!1}function os(s){if(typeof s!="string")throw new Error("string expected");s=m.normalize(s),s=s.replace(/\\/g,"/");let t=!1;s.startsWith("//")&&(t=!0);let e=/\/\//;for(;s.match(e);)s=s.replace(e,"/");return t&&(s="/"+s),s}function Jt(s,t,e){let n=os(t);for(let r=0;r<s.length;r++){let i=s[r];if(i(n,e))return!0}return!1}function as(s,t){if(s==null)throw new TypeError("anymatch: specify first argument");let n=q(s).map(r=>is(r));return t==null?(r,i)=>Jt(n,r,i):Jt(n,t)}var Xt=s=>{let t=q(s).flat();if(!t.every(e=>typeof e===es))throw new TypeError(`Non-string provided as watch path: ${t}`);return t.map(se)},Zt=s=>{let t=s.replace(ss,rt),e=!1;for(t.startsWith(Ze)&&(e=!0);t.match(Qt);)t=t.replace(Qt,rt);return e&&(t=rt+t),t},se=s=>Zt(m.normalize(Zt(s))),te=(s="")=>t=>typeof t=="string"?se(m.isAbsolute(t)?t:m.join(s,t)):t,cs=(s,t)=>m.isAbsolute(s)?s:m.join(t,s),ls=Object.freeze(new Set),ot=class{constructor(t,e){this.path=t,this._removeWatcher=e,this.items=new Set}add(t){let{items:e}=this;e&&t!==ee&&t!==ts&&e.add(t)}async remove(t){let{items:e}=this;if(!e||(e.delete(t),e.size>0))return;let n=this.path;try{await Je(n)}catch{this._removeWatcher&&this._removeWatcher(m.dirname(n),m.basename(n))}}has(t){let{items:e}=this;if(e)return e.has(t)}getChildren(){let{items:t}=this;return t?[...t.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=j,this.items=ls,Object.freeze(this)}},us="stat",ds="lstat",at=class{constructor(t,e,n){this.fsw=n;let r=t;this.path=t=t.replace(rs,""),this.watchPath=r,this.fullWatchPath=m.resolve(r),this.dirParts=[],this.dirParts.forEach(i=>{i.length>1&&i.pop()}),this.followSymlinks=e,this.statMethod=e?us:ds}entryPath(t){return m.join(this.watchPath,m.relative(this.watchPath,t.fullPath))}filterPath(t){let{stats:e}=t;if(e&&e.isSymbolicLink())return this.filterDir(t);let n=this.entryPath(t);return this.fsw._isntIgnored(n,e)&&this.fsw._hasReadPermissions(e)}filterDir(t){return this.fsw._isntIgnored(this.entryPath(t),t.stats)}},Y=class extends Xe{constructor(t={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let e=t.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...t,ignored:t.ignored?q(t.ignored):q([]),awaitWriteFinish:e===!0?n:typeof e=="object"?{...n,...e}:!1};Vt&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let c=i.toLowerCase();c==="false"||c==="0"?r.usePolling=!1:c==="true"||c==="1"?r.usePolling=!0:r.usePolling=!!c}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=j,this._readyEmitted=!0,process.nextTick(()=>this.emit(w.READY)))},this._emitRaw=(...c)=>this.emit(w.RAW,...c),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new $(this),Object.freeze(r)}_addIgnoredPath(t){if(it(t)){for(let e of this._ignoredPaths)if(it(e)&&e.path===t.path&&e.recursive===t.recursive)return}this._ignoredPaths.add(t)}_removeIgnoredPath(t){if(this._ignoredPaths.delete(t),typeof t=="string")for(let e of this._ignoredPaths)it(e)&&e.path===t&&this._ignoredPaths.delete(e)}add(t,e,n){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let i=Xt(t);return r&&(i=i.map(a=>cs(a,r))),i.forEach(a=>{this._removeIgnoredPath(a)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async a=>{let o=await this._nodeFsHandler._addToNodeFs(a,!n,void 0,0,e);return o&&this._emitReady(),o})).then(a=>{this.closed||a.forEach(o=>{o&&this.add(m.dirname(o),m.basename(e||o))})}),this}unwatch(t){if(this.closed)return this;let e=Xt(t),{cwd:n}=this.options;return e.forEach(r=>{!m.isAbsolute(r)&&!this._closers.has(r)&&(n&&(r=m.join(n,r)),r=m.resolve(r)),this._closePath(r),this._addIgnoredPath(r),this._watched.has(r)&&this._addIgnoredPath({path:r,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let t=[];return this._closers.forEach(e=>e.forEach(n=>{let r=n();r instanceof Promise&&t.push(r)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=t.length?Promise.all(t).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let t={};return this._watched.forEach((e,n)=>{let i=(this.options.cwd?m.relative(this.options.cwd,n):n)||ee;t[i]=e.getChildren().sort()}),t}emitWithAll(t,e){this.emit(t,...e),t!==w.ERROR&&this.emit(w.ALL,t,...e)}async _emit(t,e,n){if(this.closed)return;let r=this.options;nt&&(e=m.normalize(e)),r.cwd&&(e=m.relative(r.cwd,e));let i=[e];n!=null&&i.push(n);let a=r.awaitWriteFinish,o;if(a&&(o=this._pendingWrites.get(e)))return o.lastChange=new Date,this;if(r.atomic){if(t===w.UNLINK)return this._pendingUnlinks.set(e,[t,...i]),setTimeout(()=>{this._pendingUnlinks.forEach((c,l)=>{this.emit(...c),this.emit(w.ALL,...c),this._pendingUnlinks.delete(l)})},typeof r.atomic=="number"?r.atomic:100),this;t===w.ADD&&this._pendingUnlinks.has(e)&&(t=w.CHANGE,this._pendingUnlinks.delete(e))}if(a&&(t===w.ADD||t===w.CHANGE)&&this._readyEmitted){let c=(l,u)=>{l?(t=w.ERROR,i[0]=l,this.emitWithAll(t,i)):u&&(i.length>1?i[1]=u:i.push(u),this.emitWithAll(t,i))};return this._awaitWriteFinish(e,a.stabilityThreshold,t,c),this}if(t===w.CHANGE&&!this._throttle(w.CHANGE,e,50))return this;if(r.alwaysStat&&n===void 0&&(t===w.ADD||t===w.ADD_DIR||t===w.CHANGE)){let c=r.cwd?m.join(r.cwd,e):e,l;try{l=await Qe(c)}catch{}if(!l||this.closed)return;i.push(l)}return this.emitWithAll(t,i),this}_handleError(t){let e=t&&t.code;return t&&e!=="ENOENT"&&e!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||e!=="EPERM"&&e!=="EACCES")&&this.emit(w.ERROR,t),t||this.closed}_throttle(t,e,n){this._throttled.has(t)||this._throttled.set(t,new Map);let r=this._throttled.get(t);if(!r)throw new Error("invalid throttle");let i=r.get(e);if(i)return i.count++,!1;let a,o=()=>{let l=r.get(e),u=l?l.count:0;return r.delete(e),clearTimeout(a),l&&clearTimeout(l.timeoutObject),u};a=setTimeout(o,n);let c={timeoutObject:a,clear:o,count:0};return r.set(e,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(t,e,n,r){let i=this.options.awaitWriteFinish;if(typeof i!="object")return;let a=i.pollInterval,o,c=t;this.options.cwd&&!m.isAbsolute(t)&&(c=m.join(this.options.cwd,t));let l=new Date,u=this._pendingWrites;function d(h){Ke(c,(f,p)=>{if(f||!u.has(t)){f&&f.code!=="ENOENT"&&r(f);return}let g=Number(new Date);h&&p.size!==h.size&&(u.get(t).lastChange=g);let B=u.get(t);g-B.lastChange>=e?(u.delete(t),r(void 0,p)):o=setTimeout(d,a,p)})}u.has(t)||(u.set(t,{lastChange:l,cancelWait:()=>(u.delete(t),clearTimeout(o),n)}),o=setTimeout(d,a))}_isIgnored(t,e){if(this.options.atomic&&ns.test(t))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=(this.options.ignored||[]).map(te(n)),o=[...[...this._ignoredPaths].map(te(n)),...i];this._userIgnored=as(o,void 0)}return this._userIgnored(t,e)}_isntIgnored(t,e){return!this._isIgnored(t,e)}_getWatchHelpers(t){return new at(t,this.options.followSymlinks,this)}_getWatchedDir(t){let e=m.resolve(t);return this._watched.has(e)||this._watched.set(e,new ot(e,this._boundRemove)),this._watched.get(e)}_hasReadPermissions(t){return this.options.ignorePermissionErrors?!0:!!(Number(t.mode)&256)}_remove(t,e,n){let r=m.join(t,e),i=m.resolve(r);if(n=n??(this._watched.has(r)||this._watched.has(i)),!this._throttle("remove",r,100))return;!n&&this._watched.size===1&&this.add(t,e,!0),this._getWatchedDir(r).getChildren().forEach(h=>this._remove(r,h));let c=this._getWatchedDir(t),l=c.has(e);c.remove(e),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let u=r;if(this.options.cwd&&(u=m.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===w.ADD)return;this._watched.delete(r),this._watched.delete(i);let d=n?w.UNLINK_DIR:w.UNLINK;l&&!this._isIgnored(r)&&this._emit(d,r),this._closePath(r)}_closePath(t){this._closeFile(t);let e=m.dirname(t);this._getWatchedDir(e).remove(m.basename(t))}_closeFile(t){let e=this._closers.get(t);e&&(e.forEach(n=>n()),this._closers.delete(t))}_addPathCloser(t,e){if(!e)return;let n=this._closers.get(t);n||(n=[],this._closers.set(t,n)),n.push(e)}_readdirp(t,e){if(this.closed)return;let n={type:w.ALL,alwaysStat:!0,lstat:!0,...e,depth:0},r=Ut(t,n);return this._streams.add(r),r.once(Bt,()=>{r=void 0}),r.once(st,()=>{r&&(this._streams.delete(r),r=void 0)}),r}};function hs(s,t={}){let e=new Y(t);return e.add(s),e}var ct={watch:hs,FSWatcher:Y};var D=_.resolve("src/pages"),ne=_.resolve("src/gen"),re=_.resolve("src/routes"),fs=_.join(ne,"tsrouter.gen.ts"),G=_.join(re,"__root.ts"),ms=async()=>{async function s(c){try{await v.mkdir(c,{recursive:!0})}catch{}}await s(ne),await s(re);function t(c,l){let u="/"+_.relative(l,c).replace(/\\/g,"/");return u=u.replace(/\.ts$/,""),u=u.replace(/\/index$/,"")||"/",u=u.replace(/\[(.+?)\]/g,":$1"),u}function e(c){return c.replace(/^\//,"").split("/").map(l=>l.startsWith(":")?l.slice(1):l).filter(Boolean).join("-")||"index"}function n(c,l){let d=_.relative(l,c).replace(/\\/g,"/").split("/").filter(Boolean),h=d[d.length-1].replace(".ts",""),f=d.length>1?d[d.length-2]:"";if(h.startsWith("[")&&h.endsWith("]")){let p=h.slice(1,-1);return f.charAt(0).toUpperCase()+f.slice(1)+p.charAt(0).toUpperCase()+p.slice(1)+"Param"}else return h.charAt(0).toUpperCase()+h.slice(1)}async function r(c){let l=await v.readdir(c,{withFileTypes:!0}),u=[];for(let d of l){let h=_.join(c,d.name);if(d.isDirectory())u=u.concat(await r(h));else if(d.isFile()&&d.name.endsWith(".ts")){let f=t(h,D),p=e(f),g=n(h,D);u.push({file:h,route:f,routeName:p,importName:g})}}return u}function i(c,l){return`import { html, useTSElements, useTSExtractParams, useTSMetaData } from '@devwareng/vanilla-ts'
|
|
2
2
|
|
|
3
3
|
export default function ${c}(DOM: HTMLElement) {
|
|
4
4
|
useTSMetaData({
|
|
@@ -91,7 +91,7 @@ export function createRouter(DOM: HTMLElement) {
|
|
|
91
91
|
|
|
92
92
|
return { navigate, routes: routeTree }
|
|
93
93
|
}
|
|
94
|
-
`;await v.writeFile(
|
|
94
|
+
`;await v.writeFile(fs,p,"utf-8"),await v.writeFile(G,a(),"utf-8"),console.log("\u2705 Generated router and __root.ts")}console.log("\u{1F440} Watching for changes in /src/pages and /src/routes/__root.ts..."),ct.watch(D).on("all",async(c,l)=>{if(c==="add"&&l.endsWith(".ts")){let u=_.basename(l,".ts"),d=u.replace(/\[|\]/g,"Param").replace(/(^\w|-\w)/g,p=>p.replace("-","").toUpperCase()),h=t(l,D);(await v.readFile(l,"utf-8")).trim()||(await v.writeFile(l,i(d,h),"utf-8"),console.log(`\u{1F4DD} Scaffolded page: ${u}.ts`))}await o()}),ct.watch(G).on("unlink",async()=>{console.log("\u26A0\uFE0F __root.ts deleted. Recreating..."),await v.writeFile(G,a(),"utf-8"),console.log("\u{1F7E2} Recreated:",G)}),console.log("\u{1F7E2} TS Filebased Router Mounted Successfully...")};typeof window<"u"&&(window.addEventListener("popstate",()=>{M()}),document.addEventListener("DOMContentLoaded",M));export{Q as TSRouter,At as createEffect,xt as createSignal,lt as html,Ot as loadPyFiles,ae as mapper,Dt as renderChildRoutes,N as useAnchor,yt as useAnchorSingle,Et as useInitialDOM,Mt as useTSAnchorMount,vt as useTSAuth,St as useTSCollection,C as useTSComponent,I as useTSElementEach,gt as useTSElements,ht as useTSEvent,pt as useTSEventAll,mt as useTSExtractParams,ms as useTSFilebasedRouter,H as useTSHashAnchor,Ct as useTSLazy,_t as useTSMetaData,Rt as useTSNavigate,F as useTSNoReload,Lt as useTSOutlet,b as useTSParams,dt as useTSPurifier,It as useTSSSRHydration,Pt as useTSSelect,bt as useTSloadBrython};
|
|
95
95
|
/*! Bundled license information:
|
|
96
96
|
|
|
97
97
|
chokidar/esm/index.js:
|