├── .DS_Store ├── .eslintrc ├── .gitignore ├── README.md ├── app ├── entry.client.tsx ├── entry.server.tsx ├── root.tsx └── routes │ └── index.tsx ├── bun.lockb ├── functions └── [[path]].js ├── package.json ├── public └── favicon.ico ├── remix.config.js ├── remix.env.d.ts ├── start.ts └── tsconfig.json /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacob-ebey/remix-bun/64e228cb1e3df4baeeac3245d1a41e9a155d758e/.DS_Store -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | /.cache 4 | /build 5 | /public/build 6 | .env 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to Remix! 2 | 3 | - [Remix Docs](https://remix.run/docs) 4 | 5 | ## Development 6 | 7 | From your terminal: 8 | 9 | ```sh 10 | npm run dev 11 | ``` 12 | 13 | This starts your app in development mode, rebuilding assets on file changes. 14 | 15 | ## Deployment 16 | 17 | First, build your app for production: 18 | 19 | ```sh 20 | npm run build 21 | ``` 22 | 23 | Then run the app in production mode: 24 | 25 | ```sh 26 | npm start 27 | ``` 28 | 29 | Now you'll need to pick a host to deploy it to. 30 | 31 | ### DIY 32 | 33 | If you're familiar with deploying node applications, the built-in Remix app server is production-ready. 34 | 35 | Make sure to deploy the output of `remix build` 36 | 37 | - `build/` 38 | - `public/build/` 39 | 40 | ### Using a Template 41 | 42 | When you ran `npx create-remix@latest` there were a few choices for hosting. You can run that again to create a new project, then copy over your `app/` folder to the new project that's pre-configured for your target server. 43 | 44 | ```sh 45 | cd .. 46 | # create a new project, and pick a pre-configured host 47 | npx create-remix@latest 48 | cd my-new-remix-app 49 | # remove the new project's app (not the old one!) 50 | rm -rf app 51 | # copy your app over 52 | cp -R ../my-old-remix-app/app app 53 | ``` 54 | -------------------------------------------------------------------------------- /app/entry.client.tsx: -------------------------------------------------------------------------------- 1 | import { hydrate } from "react-dom"; 2 | import { RemixBrowser } from "remix"; 3 | 4 | hydrate(, document); 5 | -------------------------------------------------------------------------------- /app/entry.server.tsx: -------------------------------------------------------------------------------- 1 | import { renderToString } from "react-dom/server"; 2 | import { RemixServer } from "remix"; 3 | import type { EntryContext } from "remix"; 4 | 5 | export default function handleRequest( 6 | request: Request, 7 | responseStatusCode: number, 8 | responseHeaders: Headers, 9 | remixContext: EntryContext 10 | ) { 11 | let markup = renderToString( 12 | 13 | ); 14 | 15 | responseHeaders.set("Content-Type", "text/html"); 16 | 17 | return new Response("" + markup, { 18 | status: responseStatusCode, 19 | headers: responseHeaders, 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /app/root.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | Links, 3 | LiveReload, 4 | Meta, 5 | Outlet, 6 | Scripts, 7 | ScrollRestoration, 8 | } from "remix"; 9 | import type { MetaFunction } from "remix"; 10 | 11 | export const meta: MetaFunction = () => ({ 12 | charset: "utf-8", 13 | title: "New Remix App", 14 | viewport: "width=device-width,initial-scale=1", 15 | }); 16 | 17 | export default function App() { 18 | return ( 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ); 32 | } 33 | -------------------------------------------------------------------------------- /app/routes/index.tsx: -------------------------------------------------------------------------------- 1 | export default function Index() { 2 | return ( 3 |
4 |

Welcome to Remix

5 | 30 |
31 | ); 32 | } 33 | -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacob-ebey/remix-bun/64e228cb1e3df4baeeac3245d1a41e9a155d758e/bun.lockb -------------------------------------------------------------------------------- /functions/[[path]].js: -------------------------------------------------------------------------------- 1 | var su=Object.create;var gt=Object.defineProperty,lu=Object.defineProperties,cu=Object.getOwnPropertyDescriptor,fu=Object.getOwnPropertyDescriptors,hu=Object.getOwnPropertyNames,Ut=Object.getOwnPropertySymbols,du=Object.getPrototypeOf,jr=Object.prototype.hasOwnProperty,ni=Object.prototype.propertyIsEnumerable;var ri=(e,t,r)=>t in e?gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,it=(e,t)=>{for(var r in t||(t={}))jr.call(t,r)&&ri(e,r,t[r]);if(Ut)for(var r of Ut(t))ni.call(t,r)&&ri(e,r,t[r]);return e},jt=(e,t)=>lu(e,fu(t)),ii=e=>gt(e,"__esModule",{value:!0});var Le=(e,t)=>{var r={};for(var n in e)jr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ut)for(var n of Ut(e))t.indexOf(n)<0&&ni.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var He=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$t=(e,t)=>{for(var r in t)gt(e,r,{get:t[r],enumerable:!0})},oi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of hu(t))!jr.call(e,i)&&(r||i!=="default")&>(e,i,{get:()=>t[i],enumerable:!(n=cu(t,i))||n.enumerable});return e},we=(e,t)=>oi(ii(gt(e!=null?su(du(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),pu=(e=>(t,r)=>e&&e.get(t)||(r=oi(ii({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var $r=He((mf,ui)=>{"use strict";m();var ai=Object.getOwnPropertySymbols,mu=Object.prototype.hasOwnProperty,yu=Object.prototype.propertyIsEnumerable;function gu(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function vu(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(o){i[o]=o}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}ui.exports=vu()?Object.assign:function(e,t){for(var r,n=gu(e),i,o=1;o{"use strict";m();var Wr=$r(),ot=60103,ci=60106;C.Fragment=60107;C.StrictMode=60108;C.Profiler=60114;var fi=60109,hi=60110,di=60112;C.Suspense=60113;var pi=60115,mi=60116;typeof Symbol=="function"&&Symbol.for&&(ne=Symbol.for,ot=ne("react.element"),ci=ne("react.portal"),C.Fragment=ne("react.fragment"),C.StrictMode=ne("react.strict_mode"),C.Profiler=ne("react.profiler"),fi=ne("react.provider"),hi=ne("react.context"),di=ne("react.forward_ref"),C.Suspense=ne("react.suspense"),pi=ne("react.memo"),mi=ne("react.lazy"));var ne,si=typeof Symbol=="function"&&Symbol.iterator;function wu(e){return e===null||typeof e!="object"?null:(e=si&&e[si]||e["@@iterator"],typeof e=="function"?e:null)}function vt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r{"use strict";m();Si.exports=bi()});var R,m=Z(()=>{R=we(de())});function Ce(){}function P(){P.init.call(this)}function _i(e){return e._maxListeners===void 0?P.defaultMaxListeners:e._maxListeners}function Su(e,t,r){if(t)e.call(r);else for(var n=e.length,i=wt(e,n),o=0;o0&&a.length>i)){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,Pu(u)}return e}function Pu(e){typeof console.warn=="function"?console.warn(e):console.log(e)}function Ci(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function ki(e){var t=this._events;if(t){var r=t[e];if(typeof r=="function")return 1;if(r)return r.length}return 0}function Nu(e,t){for(var r=t,n=r+1,i=e.length;n{"use strict";m();Ce.prototype=Object.create(null);ke=P;P.EventEmitter=P;P.usingDomains=!1;P.prototype.domain=void 0;P.prototype._events=void 0;P.prototype._maxListeners=void 0;P.defaultMaxListeners=10;P.init=function(){this.domain=null,P.usingDomains&&Jr.active&&!(this instanceof Jr.Domain)&&(this.domain=Jr.active),(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new Ce,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};P.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this};P.prototype.getMaxListeners=function(){return _i(this)};P.prototype.emit=function(t){var r,n,i,o,a,u,s,l=!1,c=t==="error";if(u=this._events,u)c=c&&u.error==null;else if(!c)return!1;if(s=this.domain,c){if(r=arguments[1],s)r||(r=new Error('Uncaught, unspecified "error" event')),r.domainEmitter=this,r.domain=s,r.domainThrown=!1,s.emit("error",r);else{if(r instanceof Error)throw r;var p=new Error('Uncaught, unspecified "error" event. ('+r+")");throw p.context=r,p}return!1}if(n=u[t],!n)return!1;var d=typeof n=="function";switch(i=arguments.length,i){case 1:Su(n,d,this);break;case 2:_u(n,d,this,arguments[1]);break;case 3:Lu(n,d,this,arguments[1],arguments[2]);break;case 4:Cu(n,d,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(i-1),a=1;a0;)if(n[a]===r||n[a].listener&&n[a].listener===r){u=n[a].listener,o=a;break}if(o<0)return this;if(n.length===1){if(n[0]=void 0,--this._eventsCount===0)return this._events=new Ce,this;delete i[t]}else Nu(n,o);i.removeListener&&this.emit("removeListener",t,u||r)}return this};P.prototype.removeAllListeners=function(t){var r,n;if(n=this._events,!n)return this;if(!n.removeListener)return arguments.length===0?(this._events=new Ce,this._eventsCount=0):n[t]&&(--this._eventsCount===0?this._events=new Ce:delete n[t]),this;if(arguments.length===0){for(var i=Object.keys(n),o=0,a;o0?Reflect.ownKeys(this._events):[]}});function Pi(){throw new Error("setTimeout has not been defined")}function Ni(){throw new Error("clearTimeout has not been defined")}function Fi(e){if(Pe===setTimeout)return setTimeout(e,0);if((Pe===Pi||!Pe)&&setTimeout)return Pe=setTimeout,setTimeout(e,0);try{return Pe(e,0)}catch{try{return Pe.call(null,e,0)}catch{return Pe.call(this,e,0)}}}function Du(e){if(Ne===clearTimeout)return clearTimeout(e);if((Ne===Ni||!Ne)&&clearTimeout)return Ne=clearTimeout,clearTimeout(e);try{return Ne(e)}catch{try{return Ne.call(null,e)}catch{return Ne.call(this,e)}}}function Mu(){!st||!We||(st=!1,We.length?Re=We.concat(Re):qt=-1,Re.length&&Di())}function Di(){if(!st){var e=Fi(Mu);st=!0;for(var t=Re.length;t;){for(We=Re,Re=[];++qt1)for(var r=1;r{m();Pe=Pi,Ne=Ni;typeof globalThis.setTimeout=="function"&&(Pe=setTimeout);typeof globalThis.clearTimeout=="function"&&(Ne=clearTimeout);Re=[],st=!1,qt=-1;Mi.prototype.run=function(){this.fun.apply(null,this.array)};Tu="browser",Au="browser",Ou=!0,Iu={},Bu=[],Uu="",ju={},$u={},Hu={};Wu=Ve,Vu=Ve,qu=Ve,Yu=Ve,zu=Ve,Ju=Ve,Gu=Ve;ut=globalThis.performance||{},es=ut.now||ut.mozNow||ut.msNow||ut.oNow||ut.webkitNow||function(){return new Date().getTime()};rs=new Date;is={nextTick:z,title:Tu,browser:Ou,env:Iu,argv:Bu,version:Uu,versions:ju,on:Wu,addListener:Vu,once:qu,off:Yu,removeListener:zu,removeAllListeners:Ju,emit:Gu,binding:Ku,cwd:Xu,chdir:Zu,umask:Qu,hrtime:ts,platform:Au,release:$u,config:Hu,uptime:ns},xt=is});var Gr,te,Ti=Z(()=>{m();typeof Object.create=="function"?Gr=function(t,r){t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:Gr=function(t,r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t};te=Gr});function as(e){if(!on(e)){for(var t=[],r=0;r=i)return u;switch(u){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return u}}),a=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Ii(t)?r.showHidden=t:t&&ms(r,t),Fe(r.showHidden)&&(r.showHidden=!1),Fe(r.depth)&&(r.depth=2),Fe(r.colors)&&(r.colors=!1),Fe(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=us),zt(r,e,r.depth)}function us(e,t){var r=De.styles[t];return r?"\x1B["+De.colors[r][0]+"m"+e+"\x1B["+De.colors[r][1]+"m":e}function ss(e,t){return e}function ls(e){var t={};return e.forEach(function(r,n){t[r]=!0}),t}function zt(e,t,r){if(e.customInspect&&t&&en(t.inspect)&&t.inspect!==De&&!(t.constructor&&t.constructor.prototype===t)){var n=t.inspect(r,e);return on(n)||(n=zt(e,n,r)),n}var i=cs(e,t);if(i)return i;var o=Object.keys(t),a=ls(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Qr(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Xr(t);if(o.length===0){if(en(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(Zr(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Ai(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Qr(t))return Xr(t)}var s="",l=!1,c=["{","}"];if(ds(t)&&(l=!0,c=["[","]"]),en(t)){var p=t.name?": "+t.name:"";s=" [Function"+p+"]"}if(Zr(t)&&(s=" "+RegExp.prototype.toString.call(t)),Ai(t)&&(s=" "+Date.prototype.toUTCString.call(t)),Qr(t)&&(s=" "+Xr(t)),o.length===0&&(!l||t.length==0))return c[0]+s+c[1];if(r<0)return Zr(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var d;return l?d=fs(e,t,r,a,o):d=o.map(function(f){return tn(e,t,r,a,f,l)}),e.seen.pop(),hs(d,s,c)}function cs(e,t){if(Fe(t))return e.stylize("undefined","undefined");if(on(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(ps(t))return e.stylize(""+t,"number");if(Ii(t))return e.stylize(""+t,"boolean");if(nn(t))return e.stylize("null","null")}function Xr(e){return"["+Error.prototype.toString.call(e)+"]"}function fs(e,t,r,n,i){for(var o=[],a=0,u=t.length;a-1&&(o?u=u.split(` 3 | `).map(function(l){return" "+l}).join(` 4 | `).substr(2):u=` 5 | `+u.split(` 6 | `).map(function(l){return" "+l}).join(` 7 | `))):u=e.stylize("[Circular]","special")),Fe(a)){if(o&&i.match(/^\d+$/))return u;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function hs(e,t,r){var n=0,i=e.reduce(function(o,a){return n++,a.indexOf(` 8 | `)>=0&&n++,o+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(t===""?"":t+` 9 | `)+" "+e.join(`, 10 | `)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function ds(e){return Array.isArray(e)}function Ii(e){return typeof e=="boolean"}function nn(e){return e===null}function ps(e){return typeof e=="number"}function on(e){return typeof e=="string"}function Fe(e){return e===void 0}function Zr(e){return Et(e)&&an(e)==="[object RegExp]"}function Et(e){return typeof e=="object"&&e!==null}function Ai(e){return Et(e)&&an(e)==="[object Date]"}function Qr(e){return Et(e)&&(an(e)==="[object Error]"||e instanceof Error)}function en(e){return typeof e=="function"}function an(e){return Object.prototype.toString.call(e)}function ms(e,t){if(!t||!Et(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function Bi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var os,Yt,Kr,qe=Z(()=>{m();Rt();Ti();os=/%[sdj%]/g;Yt={};De.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};De.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"}});function Hi(){sn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[u-2]==="="?2:e[u-1]==="="?1:0,a=new ys(u*3/4-o),n=o>0?u-4:u;var s=0;for(t=0,r=0;t>16&255,a[s++]=i>>8&255,a[s++]=i&255;return o===2?(i=ie[e.charCodeAt(t)]<<2|ie[e.charCodeAt(t+1)]>>4,a[s++]=i&255):o===1&&(i=ie[e.charCodeAt(t)]<<10|ie[e.charCodeAt(t+1)]<<4|ie[e.charCodeAt(t+2)]>>2,a[s++]=i>>8&255,a[s++]=i&255),a}function vs(e){return pe[e>>18&63]+pe[e>>12&63]+pe[e>>6&63]+pe[e&63]}function ws(e,t,r){for(var n,i=[],o=t;os?s:u+a));return n===1?(t=e[r-1],i+=pe[t>>2],i+=pe[t<<4&63],i+="=="):n===2&&(t=(e[r-2]<<8)+e[r-1],i+=pe[t>>10],i+=pe[t>>4&63],i+=pe[t<<2&63],i+="="),o.push(i),o.join("")}function Kt(e,t,r,n,i){var o,a,u=i*8-n-1,s=(1<>1,c=-7,p=r?i-1:0,d=r?-1:1,f=e[t+p];for(p+=d,o=f&(1<<-c)-1,f>>=-c,c+=u;c>0;o=o*256+e[t+p],p+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+e[t+p],p+=d,c-=8);if(o===0)o=1-l;else{if(o===s)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-l}return(f?-1:1)*a*Math.pow(2,o-n)}function Wi(e,t,r,n,i,o){var a,u,s,l=o*8-i-1,c=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,w=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),a+p>=1?t+=d/s:t+=d*Math.pow(2,1-p),t*s>=2&&(a++,s/=2),a+p>=c?(u=0,a=c):a+p>=1?(u=(t*s-1)*Math.pow(2,i),a=a+p):(u=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=u&255,f+=w,u/=256,i-=8);for(a=a<0;e[r+f]=a&255,f+=w,a/=256,l-=8);e[r+f-w]|=_*128}function Jt(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ee(e,t){if(Jt()=Jt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Jt().toString(16)+" bytes");return e|0}function me(e){return!!(e!=null&&e._isBuffer)}function zi(e,t){if(me(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var r=e.length;if(r===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Gt(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return eo(e).length;default:if(n)return Gt(e).length;t=(""+t).toLowerCase(),n=!0}}function Ls(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Os(this,t,r);case"utf8":case"utf-8":return Ki(this,t,r);case"ascii":return Ts(this,t,r);case"latin1":case"binary":return As(this,t,r);case"base64":return Ds(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Is(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Ye(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function Ji(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=h.from(t,n)),me(t))return t.length===0?-1:ji(e,t,r,n,i);if(typeof t=="number")return t=t&255,h.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):ji(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function ji(e,t,r,n,i){var o=1,a=e.length,u=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,r/=2}function s(f,w){return o===1?f[w]:f.readUInt16BE(w*o)}var l;if(i){var c=-1;for(l=r;la&&(r=a-u),l=r;l>=0;l--){for(var p=!0,d=0;di&&(n=i)):n=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+u<=r){var s,l,c,p;switch(u){case 1:o<128&&(a=o);break;case 2:s=e[i+1],(s&192)===128&&(p=(o&31)<<6|s&63,p>127&&(a=p));break;case 3:s=e[i+1],l=e[i+2],(s&192)===128&&(l&192)===128&&(p=(o&15)<<12|(s&63)<<6|l&63,p>2047&&(p<55296||p>57343)&&(a=p));break;case 4:s=e[i+1],l=e[i+2],c=e[i+3],(s&192)===128&&(l&192)===128&&(c&192)===128&&(p=(o&15)<<18|(s&63)<<12|(l&63)<<6|c&63,p>65535&&p<1114112&&(a=p))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=u}return Ms(n)}function Ms(e){var t=e.length;if(t<=$i)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function Q(e,t,r,n,i,o){if(!me(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function Xt(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>(n?i:1-i)*8}function Zt(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}function Xi(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Zi(e,t,r,n,i){return i||Xi(e,t,r,4),Wi(e,t,r,n,23,4),r+4}function Qi(e,t,r,n,i){return i||Xi(e,t,r,8),Wi(e,t,r,n,52,8),r+8}function Us(e){if(e=js(e).replace(Bs,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function js(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function $s(e){return e<16?"0"+e.toString(16):e.toString(16)}function Gt(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Hs(e){for(var t=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function eo(e){return gs(Us(e))}function Qt(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Vs(e){return e!==e}function qs(e){return e!=null&&(!!e._isBuffer||to(e)||Ys(e))}function to(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Ys(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&to(e.slice(0,0))}var pe,ie,ys,sn,xs,Vi,Rs,_f,$i,Bs,er=Z(()=>{m();pe=[],ie=[],ys=typeof Uint8Array<"u"?Uint8Array:Array,sn=!1;xs={}.toString,Vi=Array.isArray||function(e){return xs.call(e)=="[object Array]"};Rs=50;h.TYPED_ARRAY_SUPPORT=globalThis.TYPED_ARRAY_SUPPORT!==void 0?globalThis.TYPED_ARRAY_SUPPORT:!0;_f=Jt();h.poolSize=8192;h._augment=function(e){return e.__proto__=h.prototype,e};h.from=function(e,t,r){return qi(null,e,t,r)};h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array);h.alloc=function(e,t,r){return Es(null,e,t,r)};h.allocUnsafe=function(e){return ln(null,e)};h.allocUnsafeSlow=function(e){return ln(null,e)};h.isBuffer=qs;h.compare=function(t,r){if(!me(t)||!me(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,o=0,a=Math.min(n,i);o0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""};h.prototype.compare=function(t,r,n,i,o){if(!me(t))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;for(var a=o-i,u=n-r,s=Math.min(a,u),l=this.slice(i,o),c=t.slice(r,n),p=0;po)&&(n=o),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return Cs(this,t,r,n);case"utf8":case"utf-8":return ks(this,t,r,n);case"ascii":return Gi(this,t,r,n);case"latin1":case"binary":return Ps(this,t,r,n);case"base64":return Ns(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fs(this,t,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};$i=4096;h.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r0&&(o*=256);)i+=this[t+--r]*o;return i};h.prototype.readUInt8=function(t,r){return r||j(t,1,this.length),this[t]};h.prototype.readUInt16LE=function(t,r){return r||j(t,2,this.length),this[t]|this[t+1]<<8};h.prototype.readUInt16BE=function(t,r){return r||j(t,2,this.length),this[t]<<8|this[t+1]};h.prototype.readUInt32LE=function(t,r){return r||j(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};h.prototype.readUInt32BE=function(t,r){return r||j(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};h.prototype.readIntLE=function(t,r,n){t=t|0,r=r|0,n||j(t,r,this.length);for(var i=this[t],o=1,a=0;++a=o&&(i-=Math.pow(2,8*r)),i};h.prototype.readIntBE=function(t,r,n){t=t|0,r=r|0,n||j(t,r,this.length);for(var i=r,o=1,a=this[t+--i];i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};h.prototype.readInt8=function(t,r){return r||j(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};h.prototype.readInt16LE=function(t,r){r||j(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};h.prototype.readInt16BE=function(t,r){r||j(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};h.prototype.readInt32LE=function(t,r){return r||j(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};h.prototype.readInt32BE=function(t,r){return r||j(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};h.prototype.readFloatLE=function(t,r){return r||j(t,4,this.length),Kt(this,t,!0,23,4)};h.prototype.readFloatBE=function(t,r){return r||j(t,4,this.length),Kt(this,t,!1,23,4)};h.prototype.readDoubleLE=function(t,r){return r||j(t,8,this.length),Kt(this,t,!0,52,8)};h.prototype.readDoubleBE=function(t,r){return r||j(t,8,this.length),Kt(this,t,!1,52,8)};h.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;Q(this,t,r,n,o,0)}var a=1,u=0;for(this[r]=t&255;++u=0&&(u*=256);)this[r+a]=t/u&255;return r+n};h.prototype.writeUInt8=function(t,r,n){return t=+t,r=r|0,n||Q(this,t,r,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=t&255,r+1};h.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r|0,n||Q(this,t,r,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):Xt(this,t,r,!0),r+2};h.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r|0,n||Q(this,t,r,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):Xt(this,t,r,!1),r+2};h.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r|0,n||Q(this,t,r,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255):Zt(this,t,r,!0),r+4};h.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r|0,n||Q(this,t,r,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):Zt(this,t,r,!1),r+4};h.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r|0,!i){var o=Math.pow(2,8*n-1);Q(this,t,r,n,o-1,-o)}var a=0,u=1,s=0;for(this[r]=t&255;++a>0)-s&255;return r+n};h.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r|0,!i){var o=Math.pow(2,8*n-1);Q(this,t,r,n,o-1,-o)}var a=n-1,u=1,s=0;for(this[r+a]=t&255;--a>=0&&(u*=256);)t<0&&s===0&&this[r+a+1]!==0&&(s=1),this[r+a]=(t/u>>0)-s&255;return r+n};h.prototype.writeInt8=function(t,r,n){return t=+t,r=r|0,n||Q(this,t,r,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=t&255,r+1};h.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r|0,n||Q(this,t,r,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):Xt(this,t,r,!0),r+2};h.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r|0,n||Q(this,t,r,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):Xt(this,t,r,!1),r+2};h.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r|0,n||Q(this,t,r,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):Zt(this,t,r,!0),r+4};h.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r|0,n||Q(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):Zt(this,t,r,!1),r+4};h.prototype.writeFloatLE=function(t,r,n){return Zi(this,t,r,!0,n)};h.prototype.writeFloatBE=function(t,r,n){return Zi(this,t,r,!1,n)};h.prototype.writeDoubleLE=function(t,r,n){return Qi(this,t,r,!0,n)};h.prototype.writeDoubleBE=function(t,r,n){return Qi(this,t,r,!1,n)};h.prototype.copy=function(t,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r=0;--a)t[a+r]=this[a+n];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(a=0;a>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var a;if(typeof t=="number")for(a=r;a{m();er();ro=ze;ze.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length};ze.prototype.unshift=function(e){var t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length};ze.prototype.shift=function(){if(this.length!==0){var e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}};ze.prototype.clear=function(){this.head=this.tail=null,this.length=0};ze.prototype.join=function(e){if(this.length===0)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r};ze.prototype.concat=function(e){if(this.length===0)return h.alloc(0);if(this.length===1)return this.head.data;for(var t=h.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t}});function Js(e){if(e&&!zs(e))throw new Error("Unknown encoding: "+e)}function lt(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),Js(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=Ks;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=Xs;break;default:this.write=Gs;return}this.charBuffer=new h(6),this.charReceived=0,this.charLength=0}function Gs(e){return e.toString(this.encoding)}function Ks(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function Xs(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var zs,io=Z(()=>{m();er();zs=h.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};lt.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize,t="";continue}if(this.charReceived=this.charLength=0,e.length===0)return t;break}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived),t+=e.toString(this.encoding,0,n);var n=t.length-1,i=t.charCodeAt(n);if(i>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t};lt.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};lt.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}});function Zs(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function Qs(e,t){return e.listeners(t).length}function so(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof $&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16*1024;this.highWaterMark=r||r===0?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new ro,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new lt(e.encoding),this.encoding=e.encoding)}function A(e){if(!(this instanceof A))return new A(e);this._readableState=new so(e,this),this.readable=!0,e&&typeof e.read=="function"&&(this._read=e.read),ke.call(this)}function lo(e,t,r,n,i){var o=rl(t,r);if(o)e.emit("error",o);else if(r===null)t.reading=!1,nl(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else{var s;t.decoder&&!i&&!n&&(r=t.decoder.write(r),s=!t.objectMode&&r.length===0),i||(t.reading=!1),s||(t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&tr(e))),il(e,t)}else i||(t.reading=!1);return el(t)}function el(e){return!e.ended&&(e.needReadable||e.length=oo?e=oo:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function ao(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=tl(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function rl(e,t){var r=null;return!Buffer.isBuffer(t)&&typeof t!="string"&&t!==null&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function nl(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,tr(e)}}function tr(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(N("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?z(uo,e):uo(e))}function uo(e){N("emit readable"),e.emit("readable"),hn(e)}function il(e,t){t.readingMore||(t.readingMore=!0,z(ol,e,t))}function ol(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=cl(e,t.buffer,t.decoder),r}function cl(e,t,r){var n;return eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),e-=a,e===0){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}function hl(e,t){var r=Buffer.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),e-=a,e===0){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}function fn(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,z(dl,t,e))}function dl(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function pl(e,t){for(var r=0,n=e.length;r{"use strict";m();Vt();qe();no();io();bt();Rt();A.ReadableState=so;N=Oi("stream");te(A,ke);A.prototype.push=function(e,t){var r=this._readableState;return!r.objectMode&&typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Buffer.from(e,t),t="")),lo(this,r,e,t,!1)};A.prototype.unshift=function(e){var t=this._readableState;return lo(this,t,e,"",!0)};A.prototype.isPaused=function(){return this._readableState.flowing===!1};A.prototype.setEncoding=function(e){return this._readableState.decoder=new lt(e),this._readableState.encoding=e,this};oo=8388608;A.prototype.read=function(e){N("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return N("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?fn(this):tr(this),null;if(e=ao(e,t),e===0&&t.ended)return t.length===0&&fn(this),null;var n=t.needReadable;N("need readable",n),(t.length===0||t.length-e0?i=co(e,t):i=null,i===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&fn(this)),i!==null&&this.emit("data",i),i};A.prototype._read=function(e){this.emit("error",new Error("not implemented"))};A.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,N("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||t.end!==!1,o=i?u:c;n.endEmitted?z(o):r.once("end",o),e.on("unpipe",a);function a(S){N("onunpipe"),S===r&&c()}function u(){N("onend"),e.end()}var s=al(r);e.on("drain",s);var l=!1;function c(){N("cleanup"),e.removeListener("close",w),e.removeListener("finish",_),e.removeListener("drain",s),e.removeListener("error",f),e.removeListener("unpipe",a),r.removeListener("end",u),r.removeListener("end",c),r.removeListener("data",d),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&s()}var p=!1;r.on("data",d);function d(S){N("ondata"),p=!1;var I=e.write(S);I===!1&&!p&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&fo(n.pipes,e)!==-1)&&!l&&(N("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function f(S){N("onerror",S),F(),e.removeListener("error",f),Qs(e,"error")===0&&e.emit("error",S)}Zs(e,"error",f);function w(){e.removeListener("finish",_),F()}e.once("close",w);function _(){N("onfinish"),e.removeListener("close",w),F()}e.once("finish",_);function F(){N("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(N("pipe resume"),r.resume()),e};A.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i{m();qe();er();Vt();bt();Rt();U.WritableState=mn;te(U,P);mn.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};U.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};U.prototype.write=function(e,t,r){var n=this._writableState,i=!1;return typeof t=="function"&&(r=t,t=null),h.isBuffer(e)?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=ml),n.ended?gl(this,r):vl(this,n,e,r)&&(n.pendingcb++,i=xl(this,n,e,t,r)),i};U.prototype.cork=function(){var e=this._writableState;e.corked++};U.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest&&mo(this,e))};U.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};U.prototype._write=function(e,t,r){r(new Error("not implemented"))};U.prototype._writev=null;U.prototype.end=function(e,t,r){var n=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),!n.ending&&!n.finished&&_l(this,n,r)}});function $(e){if(!(this instanceof $))return new $(e);A.call(this,e),U.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",Ll)}function Ll(){this.allowHalfOpen||this._writableState.ended||z(Cl,this)}function Cl(e){e.end()}var wo,nr,rr,bt=Z(()=>{m();qe();Rt();dn();yn();te($,A);wo=Object.keys(U.prototype);for(rr=0;rr{m();bt();qe();te(re,$);re.prototype.push=function(e,t){return this._transformState.needTransform=!1,$.prototype.push.call(this,e,t)};re.prototype._transform=function(e,t,r){throw new Error("Not implemented")};re.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length{m();gn();qe();te(Je,re);Je.prototype._transform=function(e,t,r){r(null,e)}});var Eo={};$t(Eo,{Duplex:()=>$,PassThrough:()=>Je,Readable:()=>A,Stream:()=>le,Transform:()=>re,Writable:()=>U,default:()=>Nl});function le(){ke.call(this)}var Nl,bo=Z(()=>{m();Vt();qe();bt();dn();yn();gn();Ro();te(le,ke);le.Readable=A;le.Writable=U;le.Duplex=$;le.Transform=re;le.PassThrough=Je;le.Stream=le;Nl=le;le.prototype.pipe=function(e,t){var r=this;function n(c){e.writable&&e.write(c)===!1&&r.pause&&r.pause()}r.on("data",n);function i(){r.readable&&r.resume&&r.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(r.on("end",a),r.on("close",u));var o=!1;function a(){o||(o=!0,e.end())}function u(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}function s(c){if(l(),ke.listenerCount(this,"error")===0)throw c}r.on("error",s),e.on("error",s);function l(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",s),e.removeListener("error",s),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}});var So=He((sh,ir)=>{m();var Ge=(bo(),pu(Eo));if(Ge&&Ge.default){ir.exports=Ge.default;for(let e in Ge)ir.exports[e]=Ge[e]}else Ge&&(ir.exports=Ge)});var zo=He(ct=>{"use strict";m();var ce=$r(),be=de(),Fl=So();function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;rSt;St++)W[St]=St+1;var W,St;W[15]=0;var Tl=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,_o=Object.prototype.hasOwnProperty,Lo={},Co={};function $o(e){return _o.call(Co,e)?!0:_o.call(Lo,e)?!1:Tl.test(e)?Co[e]=!0:(Lo[e]=!0,!1)}function Al(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ol(e,t,r,n){if(t===null||typeof t>"u"||Al(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function K(e,t,r,n,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var V={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){V[e]=new K(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];V[t]=new K(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){V[e]=new K(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){V[e]=new K(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){V[e]=new K(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){V[e]=new K(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){V[e]=new K(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){V[e]=new K(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){V[e]=new K(e,5,!1,e.toLowerCase(),null,!1,!1)});var Pn=/[\-:]([a-z])/g;function Nn(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Pn,Nn);V[t]=new K(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Pn,Nn);V[t]=new K(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Pn,Nn);V[t]=new K(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){V[e]=new K(e,1,!1,e.toLowerCase(),null,!1,!1)});V.xlinkHref=new K("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){V[e]=new K(e,1,!1,e.toLowerCase(),null,!0,!0)});var Il=/["'&<>]/;function Ke(e){if(typeof e=="boolean"||typeof e=="number")return""+e;e=""+e;var t=Il.exec(e);if(t){var r="",n,i=0;for(n=t.index;ncr))throw Error(B(301));if(e===ye)if(lr=!0,e={action:r,next:null},Te===null&&(Te=new Map),r=Te.get(t),r===void 0)Te.set(t,e);else{for(t=r;t.next!==null;)t=t.next;t.next=e}}function vn(){}var Ze=null,Hl={readContext:function(e){var t=Ze.threadID;return kt(e,t),e[t]},useContext:function(e){Xe();var t=Ze.threadID;return kt(e,t),e[t]},useMemo:No,useReducer:Po,useRef:function(e){ye=Xe(),M=Fn();var t=M.memoizedState;return t===null?(e={current:e},M.memoizedState=e):t},useState:function(e){return Po(Vo,e)},useLayoutEffect:function(){},useCallback:function(e,t){return No(function(){return e},t)},useImperativeHandle:vn,useEffect:vn,useDebugValue:vn,useDeferredValue:function(e){return Xe(),e},useTransition:function(){return Xe(),[function(e){e()},!1]},useOpaqueIdentifier:function(){return(Ze.identifierPrefix||"")+"R:"+(Ze.uniqueID++).toString(36)},useMutableSource:function(e,t){return Xe(),t(e._source)}},Fo={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Do(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var qo={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Wl=ce({menuitem:!0},qo),Ct={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Vl=["Webkit","ms","Moz","O"];Object.keys(Ct).forEach(function(e){Vl.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ct[t]=Ct[e]})});var ql=/([A-Z])/g,Yl=/^ms-/,Me=be.Children.toArray,wn=Dl.ReactCurrentDispatcher,zl={listing:!0,pre:!0,textarea:!0},Jl=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Mo={},xn={};function Gl(e){if(e==null)return e;var t="";return be.Children.forEach(e,function(r){r!=null&&(t+=r)}),t}var Kl=Object.prototype.hasOwnProperty,Xl={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function To(e,t){if(e===void 0)throw Error(B(152,Lt(t)||"Component"))}function Zl(e,t,r){function n(a,u){var s=u.prototype&&u.prototype.isReactComponent,l=Ml(u,t,r,s),c=[],p=!1,d={isMounted:function(){return!1},enqueueForceUpdate:function(){if(c===null)return null},enqueueReplaceState:function(he,T){p=!0,c=[T]},enqueueSetState:function(he,T){if(c===null)return null;c.push(T)}};if(s){if(s=new u(a.props,l,d),typeof u.getDerivedStateFromProps=="function"){var f=u.getDerivedStateFromProps.call(null,a.props,s.state);f!=null&&(s.state=ce({},s.state,f))}}else if(ye={},s=u(a.props,l,d),s=Ho(u,a.props,s,l),s==null||s.render==null){e=s,To(e,u);return}if(s.props=a.props,s.context=l,s.updater=d,d=s.state,d===void 0&&(s.state=d=null),typeof s.UNSAFE_componentWillMount=="function"||typeof s.componentWillMount=="function")if(typeof s.componentWillMount=="function"&&typeof u.getDerivedStateFromProps!="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&typeof u.getDerivedStateFromProps!="function"&&s.UNSAFE_componentWillMount(),c.length){d=c;var w=p;if(c=null,p=!1,w&&d.length===1)s.state=d[0];else{f=w?d[0]:s.state;var _=!0;for(w=w?1:0;w=u))throw Error(B(304));var s=new Uint16Array(u);for(s.set(a),W=s,W[0]=o+1,a=o;a=s.children.length){var l=s.footer;if(l!==""&&(this.previousWasTextNode=!1),this.stack.pop(),s.type==="select")this.currentSelectValue=null;else if(s.type!=null&&s.type.type!=null&&s.type.type.$$typeof===ur)this.popProvider(s.type);else if(s.type===sr){this.suspenseDepth--;var c=o.pop();if(a){a=!1;var p=s.fallbackFrame;if(!p)throw Error(B(303));this.stack.push(p),o[this.suspenseDepth]+="";continue}else o[this.suspenseDepth]+=c}o[this.suspenseDepth]+=l}else{var d=s.children[s.childIndex++],f="";try{f+=this.render(d,s.context,s.domNamespace)}catch(w){throw w!=null&&typeof w.then=="function"?Error(B(294)):w}finally{}o.length<=this.suspenseDepth&&o.push(""),o[this.suspenseDepth]+=f}}return o[0]}finally{wn.current=i,Ze=n,Wo()}},t.render=function(r,n,i){if(typeof r=="string"||typeof r=="number")return i=""+r,i===""?"":this.makeStaticMarkup?Ke(i):this.previousWasTextNode?""+Ke(i):(this.previousWasTextNode=!0,Ke(i));if(n=Zl(r,n,this.threadID),r=n.child,n=n.context,r===null||r===!1)return"";if(!be.isValidElement(r)){if(r!=null&&r.$$typeof!=null)throw i=r.$$typeof,Error(i===Rn?B(257):B(258,i.toString()));return r=Me(r),this.stack.push({type:null,domNamespace:i,children:r,childIndex:0,context:n,footer:""}),""}var o=r.type;if(typeof o=="string")return this.renderDOM(r,n,i);switch(o){case Uo:case Bo:case En:case bn:case Ln:case ar:return r=Me(r.props.children),this.stack.push({type:null,domNamespace:i,children:r,childIndex:0,context:n,footer:""}),"";case sr:throw Error(B(294));case Io:throw Error(B(343))}if(typeof o=="object"&&o!==null)switch(o.$$typeof){case _n:ye={};var a=o.render(r.props,r.ref);return a=Ho(o.render,r.props,a,r.ref),a=Me(a),this.stack.push({type:null,domNamespace:i,children:a,childIndex:0,context:n,footer:""}),"";case Cn:return r=[be.createElement(o.type,ce({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:i,children:r,childIndex:0,context:n,footer:""}),"";case ur:return o=Me(r.props.children),i={type:r,domNamespace:i,children:o,childIndex:0,context:n,footer:""},this.pushProvider(r),this.stack.push(i),"";case Sn:o=r.type,a=r.props;var u=this.threadID;return kt(o,u),o=Me(a.children(o[u])),this.stack.push({type:r,domNamespace:i,children:o,childIndex:0,context:n,footer:""}),"";case Oo:throw Error(B(338));case kn:return o=r.type,a=o._init,o=a(o._payload),r=[be.createElement(o,ce({ref:r.ref},r.props))],this.stack.push({type:null,domNamespace:i,children:r,childIndex:0,context:n,footer:""}),""}throw Error(B(130,o==null?o:typeof o,""))},t.renderDOM=function(r,n,i){var o=r.type.toLowerCase();if(i===Fo.html&&Do(o),!Mo.hasOwnProperty(o)){if(!Jl.test(o))throw Error(B(65,o));Mo[o]=!0}var a=r.props;if(o==="input")a=ce({type:void 0},a,{defaultChecked:void 0,defaultValue:void 0,value:a.value!=null?a.value:a.defaultValue,checked:a.checked!=null?a.checked:a.defaultChecked});else if(o==="textarea"){var u=a.value;if(u==null){u=a.defaultValue;var s=a.children;if(s!=null){if(u!=null)throw Error(B(92));if(Array.isArray(s)){if(!(1>=s.length))throw Error(B(93));s=s[0]}u=""+s}u==null&&(u="")}a=ce({},a,{value:void 0,children:""+u})}else if(o==="select")this.currentSelectValue=a.value!=null?a.value:a.defaultValue,a=ce({},a,{value:void 0});else if(o==="option"){s=this.currentSelectValue;var l=Gl(a.children);if(s!=null){var c=a.value!=null?a.value+"":l;if(u=!1,Array.isArray(s)){for(var p=0;p":(T+=">",u="");e:{if(s=a.dangerouslySetInnerHTML,s!=null){if(s.__html!=null){s=s.__html;break e}}else if(s=a.children,typeof s=="string"||typeof s=="number"){s=Ke(s);break e}s=null}return s!=null?(a=[],zl.hasOwnProperty(o)&&s.charAt(0)===` 11 | `&&(T+=` 12 | `),T+=s):a=Me(a.children),r=r.type,i=i==null||i==="http://www.w3.org/1999/xhtml"?Do(r):i==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":i,this.stack.push({domNamespace:i,type:o,children:a,childIndex:0,context:n,footer:u}),this.previousWasTextNode=!1,T},e}();function Ql(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Yo=function(e){function t(n,i,o){var a=e.call(this,{})||this;return a.partialRenderer=new Dn(n,i,o),a}Ql(t,e);var r=t.prototype;return r._destroy=function(n,i){this.partialRenderer.destroy(),i(n)},r._read=function(n){try{this.push(this.partialRenderer.read(n))}catch(i){this.destroy(i)}},t}(Fl.Readable);ct.renderToNodeStream=function(e,t){return new Yo(e,!1,t)};ct.renderToStaticMarkup=function(e,t){e=new Dn(e,!0,t);try{return e.read(1/0)}finally{e.destroy()}};ct.renderToStaticNodeStream=function(e,t){return new Yo(e,!0,t)};ct.renderToString=function(e,t){e=new Dn(e,!1,t);try{return e.read(1/0)}finally{e.destroy()}};ct.version="17.0.2"});var Go=He((ch,Jo)=>{"use strict";m();Jo.exports=zo()});var Xo=He((fh,Ko)=>{"use strict";m();Ko.exports=Go()});m();m();var Kn={};$t(Kn,{default:()=>Ya});m();var qa=we(Xo());m();m();m();m();var fr=new TextEncoder;async function Zo(e,t){let r=await crypto.subtle.importKey("raw",fr.encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),n=fr.encode(e),i=await crypto.subtle.sign("HMAC",r,n),o=btoa(String.fromCharCode(...new Uint8Array(i))).replace(/=+$/,"");return e+"."+o}async function Qo(e,t){let r=await crypto.subtle.importKey("raw",fr.encode(t),{name:"HMAC",hash:"SHA-256"},!1,["verify"]),n=e.slice(0,e.lastIndexOf(".")),i=e.slice(e.lastIndexOf(".")+1),o=fr.encode(n),a=ec(atob(i));return await crypto.subtle.verify("HMAC",r,a,o)?n:!1}function ec(e){let t=new Uint8Array(e.length);for(let r=0;r=0&&(t.hash=e.substr(r),e=e.substr(0,r));var n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}m();var L=we(de());function Oe(e,t){if(!e)throw new Error(t)}var hr=(0,L.createContext)(null),dr=(0,L.createContext)(null),ft=(0,L.createContext)({outlet:null,matches:[]});function Pt(e){return mr(e.context)}function pr(e){let{basename:t="/",children:r=null,location:n,navigationType:i=ge.Pop,navigator:o,static:a=!1}=e;ht()&&Oe(!1);let u=ua(t),s=(0,L.useMemo)(()=>({basename:u,navigator:o,static:a}),[u,o,a]);typeof n=="string"&&(n=fe(n));let{pathname:l="/",search:c="",hash:p="",state:d=null,key:f="default"}=n,w=(0,L.useMemo)(()=>{let _=aa(l,u);return _==null?null:{pathname:_,search:c,hash:p,state:d,key:f}},[u,l,c,p,d,f]);return w==null?null:(0,L.createElement)(hr.Provider,{value:s},(0,L.createElement)(dr.Provider,{children:r,value:{location:w,navigationType:i}}))}function Ie(e){ht()||Oe(!1);let{basename:t,navigator:r}=(0,L.useContext)(hr),{hash:n,pathname:i,search:o}=Se(e),a=i;if(t!=="/"){let u=yc(e),s=u!=null&&u.endsWith("/");a=i==="/"?t+(s?"/":""):Ae([t,i])}return r.createHref({pathname:a,search:o,hash:n})}function ht(){return(0,L.useContext)(dr)!=null}function X(){return ht()||Oe(!1),(0,L.useContext)(dr).location}function et(){ht()||Oe(!1);let{basename:e,navigator:t}=(0,L.useContext)(hr),{matches:r}=(0,L.useContext)(ft),{pathname:n}=X(),i=JSON.stringify(r.map(u=>u.pathnameBase)),o=(0,L.useRef)(!1);return(0,L.useEffect)(()=>{o.current=!0}),(0,L.useCallback)(function(u,s){if(s===void 0&&(s={}),!o.current)return;if(typeof u=="number"){t.go(u);return}let l=oa(u,JSON.parse(i),n);e!=="/"&&(l.pathname=Ae([e,l.pathname])),(s.replace?t.replace:t.push)(l,s.state)},[e,t,i,n])}var tc=(0,L.createContext)(null);function mr(e){let t=(0,L.useContext)(ft).outlet;return t&&(0,L.createElement)(tc.Provider,{value:e},t)}function Se(e){let{matches:t}=(0,L.useContext)(ft),{pathname:r}=X(),n=JSON.stringify(t.map(i=>i.pathnameBase));return(0,L.useMemo)(()=>oa(e,JSON.parse(n),r),[e,n,r])}function Mn(e,t){ht()||Oe(!1);let{matches:r}=(0,L.useContext)(ft),n=r[r.length-1],i=n?n.params:{},o=n?n.pathname:"/",a=n?n.pathnameBase:"/",u=n&&n.route,s=X(),l;if(t){var c;let w=typeof t=="string"?fe(t):t;a==="/"||((c=w.pathname)==null?void 0:c.startsWith(a))||Oe(!1),l=w}else l=s;let p=l.pathname||"/",d=a==="/"?p:p.slice(a.length)||"/",f=yr(e,{pathname:d});return hc(f&&f.map(w=>Object.assign({},w,{params:Object.assign({},i,w.params),pathname:Ae([a,w.pathname]),pathnameBase:w.pathnameBase==="/"?a:Ae([a,w.pathnameBase])})),r)}function yr(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?fe(t):t,i=aa(n.pathname||"/",r);if(i==null)return null;let o=ra(e);rc(o);let a=null;for(let u=0;a==null&&u{let a={relativePath:i.path||"",caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};a.relativePath.startsWith("/")&&(a.relativePath.startsWith(n)||Oe(!1),a.relativePath=a.relativePath.slice(n.length));let u=Ae([n,a.relativePath]),s=r.concat(a);i.children&&i.children.length>0&&(i.index===!0&&Oe(!1),ra(i.children,t,s,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:lc(u,i.index),routesMeta:s})}),t}function rc(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:cc(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var nc=/^:\w+$/,ic=3,oc=2,ac=1,uc=10,sc=-2,ta=e=>e==="*";function lc(e,t){let r=e.split("/"),n=r.length;return r.some(ta)&&(n+=sc),t&&(n+=oc),r.filter(i=>!ta(i)).reduce((i,o)=>i+(nc.test(o)?ic:o===""?ac:uc),n)}function cc(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function fc(e,t){let{routesMeta:r}=e,n={},i="/",o=[];for(let a=0;a(0,L.createElement)(ft.Provider,{children:n.route.element!==void 0?n.route.element:r,value:{outlet:r,matches:t.concat(e.slice(0,i+1))}}),null)}function na(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=dc(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:n.reduce((l,c,p)=>{if(c==="*"){let d=u[p]||"";a=o.slice(0,o.length-d.length).replace(/(.)\/+$/,"$1")}return l[c]=pc(u[p]||"",c),l},{}),pathname:o,pathnameBase:a,pattern:e}}function dc(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0);let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,(a,u)=>(n.push(u),"([^\\/]+)"));return e.endsWith("*")?(n.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i+=r?"\\/*$":"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)",[new RegExp(i,t?void 0:"i"),n]}function pc(e,t){try{return decodeURIComponent(e)}catch{return e}}function ia(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?fe(e):e;return{pathname:r?r.startsWith("/")?r:mc(r,t):t,search:gc(n),hash:vc(i)}}function mc(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function oa(e,t,r){let n=typeof e=="string"?fe(e):e,i=e===""||n.pathname===""?"/":n.pathname,o;if(i==null)o=r;else{let u=t.length-1;if(i.startsWith("..")){let s=i.split("/");for(;s[0]==="..";)s.shift(),u-=1;n.pathname=s.join("/")}o=u>=0?t[u]:"/"}let a=ia(n,o);return i&&i!=="/"&&i.endsWith("/")&&!a.pathname.endsWith("/")&&(a.pathname+="/"),a}function yc(e){return e===""||e.pathname===""?"/":typeof e=="string"?fe(e).pathname:e.pathname}function aa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=e.charAt(t.length);return r&&r!=="/"?null:e.slice(t.length)||"/"}var Ae=e=>e.join("/").replace(/\/\/+/g,"/"),ua=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),gc=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vc=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function gr(){return gr=Object.assign||function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}var wc=["onClick","reloadDocument","replace","state","target","to"],xc=["aria-current","caseSensitive","className","end","style","to","children"];function Rc(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Tn=(0,oe.forwardRef)(function(t,r){let{onClick:n,reloadDocument:i,replace:o=!1,state:a,target:u,to:s}=t,l=fa(t,wc),c=Ie(s),p=Ec(s,{replace:o,state:a,target:u});function d(f){n&&n(f),!f.defaultPrevented&&!i&&p(f)}return(0,oe.createElement)("a",gr({},l,{href:c,onClick:d,ref:r,target:u}))}),ha=(0,oe.forwardRef)(function(t,r){let{"aria-current":n="page",caseSensitive:i=!1,className:o="",end:a=!1,style:u,to:s,children:l}=t,c=fa(t,xc),p=X(),d=Se(s),f=p.pathname,w=d.pathname;i||(f=f.toLowerCase(),w=w.toLowerCase());let _=f===w||!a&&f.startsWith(w)&&f.charAt(w.length)==="/",F=_?n:void 0,S;typeof o=="function"?S=o({isActive:_}):S=[o,_?"active":null].filter(Boolean).join(" ");let I=typeof u=="function"?u({isActive:_}):u;return(0,oe.createElement)(Tn,gr({},c,{"aria-current":F,className:S,ref:r,style:I,to:s}),typeof l=="function"?l({isActive:_}):l)});function Ec(e,t){let{target:r,replace:n,state:i}=t===void 0?{}:t,o=et(),a=X(),u=Se(e);return(0,oe.useCallback)(s=>{if(s.button===0&&(!r||r==="_self")&&!Rc(s)){s.preventDefault();let l=!!n||Qe(a)===Qe(u);o(e,{replace:l,state:i})}},[a,o,u,n,i,r,e])}m();ea();m();m();m();function q(){return q=Object.assign||function(e){for(var t=1;t"u")throw new Error(t)}m();m();async function wr(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch{return window.location.reload(),new Promise(()=>{})}}function ga(e,t,r){let n=e.map(o=>{var a;let u=t[o.route.id];return((a=u.links)===null||a===void 0?void 0:a.call(u))||[]}).flat(1),i=Lc(e,r);return Cc(n,i)}async function va(e){if(!e.links)return;let t=e.links();if(!t)return;let r=[];for(let i of t)!xr(i)&&i.rel==="stylesheet"&&r.push(jt(it({},i),{rel:"preload",as:"style"}));let n=r.filter(i=>!i.media||window.matchMedia(i.media).matches);await Promise.all(n.map(Sc))}async function Sc(e){return new Promise(t=>{let r=document.createElement("link");Object.assign(r,e);function n(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function xr(e){return e!=null&&typeof e.page=="string"}function _c(e){return e!=null&&typeof e.rel=="string"&&typeof e.href=="string"}async function wa(e,t){return(await Promise.all(e.map(async n=>{let i=await wr(n.route,t);return i.links?i.links():[]}))).flat(1).filter(_c).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(o=>{var a=o,{rel:n}=a,i=Le(a,["rel"]);return it(n==="preload"?{rel:"prefetch"}:{rel:"prefetch",as:"style"},i)})}function On(e,t,r,n,i){let o=Ea(e),a=(l,c)=>r[c]?l.route.id!==r[c].route.id:!0,u=(l,c)=>{var p;return r[c].pathname!==l.pathname||((p=r[c].route.path)===null||p===void 0?void 0:p.endsWith("*"))&&r[c].params["*"]!==l.params["*"]};return i==="data"&&n.search!==o.search?t.filter((l,c)=>l.route.hasLoader?a(l,c)||u(l,c)?!0:l.route.shouldReload?l.route.shouldReload({params:l.params,prevUrl:new URL(n.pathname+n.search+n.hash,window.origin),url:new URL(e,window.origin)}):!0:!1):t.filter((l,c)=>(i==="assets"||l.route.hasLoader)&&(a(l,c)||u(l,c)))}function xa(e,t,r){let n=Ea(e);return In(t.filter(i=>r.routes[i.route.id].hasLoader).map(i=>{let{pathname:o,search:a}=n,u=new URLSearchParams(a);return u.set("_data",i.route.id),`${o}?${u}`}))}function Ra(e,t){return In(e.map(r=>{let n=t.routes[r.route.id],i=[n.module];return n.imports&&(i=i.concat(n.imports)),i}).flat(1))}function Lc(e,t){return In(e.map(r=>{let n=t.routes[r.route.id],i=[n.module];return n.imports&&(i=i.concat(n.imports)),i}).flat(1))}function In(e){return[...new Set(e)]}function Cc(e,t){let r=new Set,n=new Set(t);return e.reduce((i,o)=>{if(!xr(o)&&o.as==="script"&&o.href&&n.has(o.href))return i;let u=JSON.stringify(o);return r.has(u)||(r.add(u),i.push(o)),i},[])}function Ea(e){let t=fe(e);return t.search===void 0&&(t.search=""),t}m();function Bn(e){return{__html:e}}m();var Da=we(de());m();function Un(e){return e instanceof Response&&e.headers.get("X-Remix-Catch")!=null}function kc(e){return e instanceof Response&&e.headers.get("X-Remix-Error")!=null}function ba(e){return e instanceof Response&&e.headers.get("X-Remix-Redirect")!=null}async function jn(e,t,r,n){e.searchParams.set("_data",t);let i=n?Pc(n,r):{credentials:"same-origin",signal:r},o=await fetch(e.href,i);if(kc(o)){let a=await o.json(),u=new Error(a.message);return u.stack=a.stack,u}return o}async function Nt(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.json():e.text()}function Pc(e,t){let{encType:r,method:n,formData:i}=e,o,a=i;if(r==="application/x-www-form-urlencoded"){a=new URLSearchParams;for(let[u,s]of i)Y(typeof s=="string",'File inputs are not supported with encType "application/x-www-form-urlencoded", please use "multipart/form-data" instead.'),a.append(u,s);o={"Content-Type":r}}return{method:n,body:a,signal:t,credentials:"same-origin",headers:o}}m();m();function tt(e,t){let r=yr(e,t);return r?r.map(n=>({params:n.params,pathname:n.pathname,route:n.route})):null}var Mt=class{constructor(t,r,n){this.status=t,this.statusText=r,this.data=n}};function Sa(e){return["POST","PUT","PATCH","DELETE"].includes(e.method)}function _a(e){return e.method==="GET"}function Sr(e){return Boolean(e.state)&&e.state.isRedirect}function Nc(e){return Sr(e)&&e.state.type==="loader"}function Fc(e){return Sr(e)&&e.state.type==="action"}function Dc(e){return Sr(e)&&e.state.type==="fetchAction"}function Mc(e){return Sr(e)&&e.state.type==="loaderSubmission"}var _r=class{constructor(t){this.location=typeof t=="string"?t:t.pathname+t.search}},Be={state:"idle",submission:void 0,location:void 0,type:"idle"},Tc={state:"idle",type:"init",data:void 0,submission:void 0};function Na(e){let{routes:t}=e,r,n=new Map,i=0,o=-1,a=new Map,u=new Set,s=tt(t,e.location);s||(s=[{params:{},pathname:"",route:t[0]}]);let l={location:e.location,loaderData:e.loaderData||{},actionData:e.actionData,catch:e.catch,error:e.error,catchBoundaryId:e.catchBoundaryId||null,errorBoundaryId:e.errorBoundaryId||null,matches:s,nextMatches:void 0,transition:Be,fetchers:new Map};function c(g){g.transition&&g.transition===Be&&(r=void 0),l=Object.assign({},l,g),e.onChange(l)}function p(){return l}function d(g){return l.fetchers.get(g)||Tc}function f(g,y){l.fetchers.set(g,y)}function w(g){n.has(g)&&Br(g),a.delete(g),u.delete(g),l.fetchers.delete(g)}async function _(g){switch(g.type){case"navigation":{let{action:y,location:x,submission:E}=g,b=tt(t,x);b?!E&&nu(x)?await Za(x,b):y===ge.Pop?await Qn(x,b):E&&Sa(E)?await Ka(x,E,b):E&&_a(E)?await Xa(x,E,b):Fc(x)?await ru(x,b):Mc(x)?await eu(x,b):Nc(x)?await Qa(x,b):Dc(x)?await tu(x,b):await Qn(x,b):(b=[{params:{},pathname:"",route:t[0]}],await Ga(x,b)),o=-1;break}case"fetcher":{let{key:y,submission:x,href:E}=g,b=tt(t,E);Y(b,"No matches found"),n.has(y)&&Br(y);let O=I(new URL(E,window.location.href),b);x&&Sa(x)?await he(y,x,O):x&&_a(x)?await It(E,y,x,O):await Bt(E,y,O);break}default:throw new Error(`Unknown data event type: ${g.type}`)}}function F(){ue();for(let[,g]of n)g.abort()}function S(g){for(let y of g.searchParams.getAll("index"))if(y==="")return!0;return!1}function I(g,y){let x=y.slice(-1)[0];return!S(g)&&x.route.id.endsWith("/index")?y.slice(-2)[0]:x}async function he(g,y,x){let E=l.fetchers.get(g),b={state:"submitting",type:"actionSubmission",submission:y,data:(E==null?void 0:E.data)||void 0};f(g,b),c({fetchers:new Map(l.fetchers)});let O=new AbortController;n.set(g,O);let k=await Ca(y,x,O.signal);if(O.signal.aborted)return;if(Ft(k)){let $e={isRedirect:!0,type:"fetchAction"};u.add(g),e.onRedirect(k.value.location,$e),f(g,{state:"loading",type:"actionRedirect",submission:y,data:void 0}),c({fetchers:new Map(l.fetchers)});return}if(Ir(x,g,k)||await Or(x,g,k))return;let J={state:"loading",type:"actionReload",data:k.value,submission:y};f(g,J),c({fetchers:new Map(l.fetchers)});let G=Er(k)?k:void 0,se=Dt(k)?k:void 0,mt=++i;a.set(g,mt);let yt=l.nextMatches||l.matches,Ur=rt(l.transition.location||l.location),je=await La(l,dt(Ur),yt,O.signal,G,se,y,x.route.id,J);if(O.signal.aborted)return;a.delete(g),n.delete(g);let nt=ka(je);if(nt){let $e={isRedirect:!0,type:"loader"};e.onRedirect(nt.location,$e);return}let[_e,ei]=Pa(je,l.matches,G),[ou,au]=await $n(je,l.matches,se),uu={state:"idle",type:"done",data:k.value,submission:void 0};f(g,uu);let ti=ae(mt);if(ti&&pt(ti),T(mt)){let{transition:$e}=l;Y($e.state==="loading","Expected loading transition"),c({location:$e.location,matches:l.nextMatches,error:_e,errorBoundaryId:ei,catch:ou,catchBoundaryId:au,loaderData:Hn(l,je,yt),actionData:$e.type==="actionReload"?l.actionData:void 0,transition:Be,fetchers:new Map(l.fetchers)})}else c({fetchers:new Map(l.fetchers),error:_e,errorBoundaryId:ei,loaderData:Hn(l,je,yt)})}function T(g){return l.transition.state==="loading"&&o"u")throw new Error("handleLoaderFetch was called during the server render, but it shouldn't be. You are likely calling useFetcher.load() in the body of your component. Try moving it to a useEffect or a callback.");let E=l.fetchers.get(y),b={state:"loading",type:"normalLoad",submission:void 0,data:(E==null?void 0:E.data)||void 0};f(y,b),c({fetchers:new Map(l.fetchers)});let O=new AbortController;n.set(y,O);let k=await Wn(x,dt(g),O.signal);if(O.signal.aborted)return;if(n.delete(y),Ft(k)){let G={isRedirect:!0,type:"loader"};e.onRedirect(k.value.location,G);return}if(Ir(x,y,k)||await Or(x,y,k))return;let J={state:"idle",type:"done",data:k.value,submission:void 0};f(y,J),c({fetchers:new Map(l.fetchers)})}async function Or(g,y,x){if(Dt(x)){let E=br(g,l.matches);return l.fetchers.delete(y),c({transition:Be,fetchers:new Map(l.fetchers),catch:{data:x.value.data,status:x.value.status,statusText:x.value.statusText},catchBoundaryId:E}),!0}return!1}function Ir(g,y,x){if(Er(x)){let E=Rr(g,l.matches);return l.fetchers.delete(y),c({fetchers:new Map(l.fetchers),error:x.value,errorBoundaryId:E}),!0}return!1}async function Ga(g,y){ue(),c({transition:{state:"loading",type:"normalLoad",submission:void 0,location:g},nextMatches:y}),await Promise.resolve();let E=br(y[0],y);c({location:g,matches:y,catch:{data:null,status:404,statusText:"Not Found"},catchBoundaryId:E,transition:Be})}async function Ka(g,y,x){ue(),c({transition:{state:"submitting",type:"actionSubmission",submission:y,location:g},nextMatches:x});let b=new AbortController;r=b,!Ac(y.action)&&x[x.length-1].route.id.endsWith("/index")&&(x=x.slice(0,-1));let O=x.slice(-1)[0],k=await Ca(y,O,b.signal);if(b.signal.aborted)return;if(Ft(k)){let G={isRedirect:!0,type:"action"};e.onRedirect(k.value.location,G);return}if(Dt(k)){let[G,se]=await $n([k],x,k);c({transition:Be,catch:G,catchBoundaryId:se});return}c({transition:{state:"loading",type:"actionReload",submission:y,location:g},actionData:{[O.route.id]:k.value}}),await Ue(g,x,y,O.route.id,k)}async function Xa(g,y,x){ue(),c({transition:{state:"submitting",type:"loaderSubmission",submission:y,location:g},nextMatches:x}),await Ue(g,x,y)}async function Za(g,y){ue(),c({transition:{state:"loading",type:"normalLoad",submission:void 0,location:g},nextMatches:y}),await Promise.resolve(),c({location:g,matches:y,transition:Be})}async function Qn(g,y){ue(),c({transition:{state:"loading",type:"normalLoad",submission:void 0,location:g},nextMatches:y}),await Ue(g,y)}async function Qa(g,y){ue(),c({transition:{state:"loading",type:"normalRedirect",submission:void 0,location:g},nextMatches:y}),await Ue(g,y)}async function eu(g,y){ue(),Y(l.transition.type==="loaderSubmission",`Unexpected transition: ${JSON.stringify(l.transition)}`);let{submission:x}=l.transition;c({transition:{state:"loading",type:"loaderSubmissionRedirect",submission:x,location:g},nextMatches:y}),await Ue(g,y,x)}async function tu(g,y){ue(),c({transition:{state:"loading",type:"fetchActionRedirect",submission:void 0,location:g},nextMatches:y}),await Ue(g,y)}async function ru(g,y){ue(),Y(l.transition.type==="actionSubmission"||l.transition.type==="actionReload",`Unexpected transition: ${JSON.stringify(l.transition)}`);let{submission:x}=l.transition;c({transition:{state:"loading",type:"actionRedirect",submission:x,location:g},nextMatches:y}),await Ue(g,y,x)}function nu(g){return rt(l.location)===rt(g)&&l.location.hash!==g.hash}async function Ue(g,y,x,E,b){let O=b&&Er(b)?b:void 0,k=b&&Dt(b)?b:void 0,J=new AbortController;r=J,o=++i;let G=await La(l,dt(rt(g)),y,J.signal,O,k,x,E);if(J.signal.aborted)return;let se=ka(G);if(se){if(l.transition.type==="actionReload"){let _e={isRedirect:!0,type:"action"};e.onRedirect(se.location,_e)}else if(l.transition.type==="loaderSubmission"){let _e={isRedirect:!0,type:"loaderSubmission"};e.onRedirect(se.location,_e)}else{let _e={isRedirect:!0,type:"loader"};e.onRedirect(se.location,_e)}return}let[mt,yt]=Pa(G,y,O),[Ur,je]=await $n(G,y,O);iu();let nt=ae(o);nt&&pt(nt),c({location:g,matches:y,error:mt,errorBoundaryId:yt,catch:Ur,catchBoundaryId:je,loaderData:Hn(l,G,y),actionData:l.transition.type==="actionReload"?l.actionData:void 0,transition:Be,fetchers:nt?new Map(l.fetchers):l.fetchers})}function ue(){r&&r.abort()}function Br(g){let y=n.get(g);Y(y,`Expected fetch controller: ${g}`),y.abort(),n.delete(g)}function iu(){let g=[];for(let y of u){let x=l.fetchers.get(y);Y(x,`Expected fetcher: ${y}`),x.type==="actionRedirect"&&(u.delete(y),g.push(y))}pt(g)}return{send:_,getState:p,getFetcher:d,deleteFetcher:w,dispose:F,get _internalFetchControllers(){return n}}}function Ac(e){let t=!1,r=new URLSearchParams(e.split("?",2)[1]||"");for(let n of r.getAll("index"))n||(t=!0);return t}async function La(e,t,r,n,i,o,a,u,s){let l=Oc(e,t,r,i,o,a,u,s);return Promise.all(l.map(c=>Wn(c,t,n)))}async function Wn(e,t,r){Y(e.route.loader,`Expected loader for ${e.route.id}`);try{let{params:n}=e,i=await e.route.loader({params:n,url:t,signal:r});return{match:e,value:i}}catch(n){return{match:e,value:n}}}async function Ca(e,t,r){if(!t.route.action)throw new Error(`Route "${t.route.id}" does not have an action, but you are trying to submit to it. To fix this, please add an \`action\` function to the route`);try{let n=await t.route.action({url:dt(e.action),params:t.params,submission:e,signal:r});return{match:t,value:n}}catch(n){return{match:t,value:n}}}function Oc(e,t,r,n,i,o,a,u){if(a&&(i||n)){let d=!1;r=r.filter(f=>d?!1:f.route.id===a?(d=!0,!1):!0)}let s=(d,f)=>e.matches[f]?d.route.id!==e.matches[f].route.id:!0,l=(d,f)=>{var w;return e.matches[f].pathname!==d.pathname||((w=e.matches[f].route.path)===null||w===void 0?void 0:w.endsWith("*"))&&e.matches[f].params["*"]!==d.params["*"]},c=(d,f)=>{if(!d.route.loader)return!1;if(s(d,f)||l(d,f))return!0;if(d.route.shouldReload){let w=dt(rt(e.location));return d.route.shouldReload({prevUrl:w,url:t,submission:o,params:d.params})}return!0};return e.matches.length===1?r.filter(d=>!!d.route.loader):(u==null?void 0:u.type)==="actionReload"||e.transition.type==="actionReload"||e.transition.type==="actionRedirect"||rt(t)===rt(e.location)||t.searchParams.toString()!==e.location.search.substring(1)?r.filter(c):r.filter((d,f,w)=>(n||i)&&w.length-1===f?!1:d.route.loader&&(s(d,f)||l(d,f)))}function Ft(e){return e.value instanceof _r}function rt(e){return e.pathname+e.search}function ka(e){for(let t of e)if(Ft(t))return t.value;return null}async function $n(e,t,r){let n;for(let o of e)if(Dt(o)){n=o;break}let i=async o=>({status:o.status,statusText:o.statusText,data:o.data});if(r&&n){let o=br(n.match,t);return[await i(r.value),o]}if(n){let o=br(n.match,t);return[await i(n.value),o]}return[void 0,void 0]}function Pa(e,t,r){let n;for(let i of e)if(Er(i)){n=i;break}if(r&&n){let i=Rr(n.match,t);return[r.value,i]}if(r){let i=Rr(r.match,t);return[r.value,i]}if(n){let i=Rr(n.match,t);return[n.value,i]}return[void 0,void 0]}function br(e,t){let r=null;for(let n of t)if(n.route.CatchBoundary&&(r=n.route.id),n===e)break;return r}function Rr(e,t){let r=null;for(let n of t)if(n.route.ErrorBoundary&&(r=n.route.id),n===e)break;return r}function Hn(e,t,r){let n={};for(let{match:o,value:a}of t)n[o.route.id]=a;let i={};for(let{route:o}of r){let a=n[o.id]!==void 0?n[o.id]:e.loaderData[o.id];a!==void 0&&(i[o.id]=a)}return i}function Dt(e){return e.value instanceof Mt}function Er(e){return e.value instanceof Error}function dt(e){return new URL(e,window.location.origin)}function Ic(e,t,r){return{caseSensitive:!!e.caseSensitive,element:Da.createElement(r,{id:e.id}),id:e.id,path:e.path,index:e.index,module:e.module,loader:Uc(e,t),action:jc(e),shouldReload:Bc(e,t),ErrorBoundary:e.hasErrorBoundary,CatchBoundary:e.hasCatchBoundary,hasLoader:e.hasLoader}}function Vn(e,t,r,n){return Object.keys(e).filter(i=>e[i].parentId===n).map(i=>{let o=Ic(e[i],t,r),a=Vn(e,t,r,o.id);return a.length>0&&(o.children=a),o})}function Bc(e,t){return n=>{let i=t[e.id];return Y(i,`Expected route module to be loaded for ${e.id}`),i.unstable_shouldReload?i.unstable_shouldReload(n):!0}}async function Fa(e,t){let r=await wr(e,t);return await va(r),r}function Uc(e,t){return async({url:n,signal:i,submission:o})=>{if(e.hasLoader){let[a]=await Promise.all([jn(n,e.id,i,o),Fa(e,t)]);if(a instanceof Error)throw a;let u=await Ma(a);if(u)return u;if(Un(a))throw new Mt(a.status,a.statusText,await Nt(a.clone()));return Nt(a)}else await Fa(e,t)}}function jc(e){return e.hasAction?async({url:r,signal:n,submission:i})=>{let o=await jn(r,e.id,n,i);if(o instanceof Error)throw o;let a=await Ma(o);if(a)return a;if(Un(o))throw new Mt(o.status,o.statusText,await Nt(o.clone()));return Nt(o)}:void 0}async function Ma(e){if(ba(e)){let t=new URL(e.headers.get("X-Remix-Redirect"),window.location.origin);if(t.origin!==window.location.origin)await new Promise(()=>{window.location.replace(t.href)});else return new _r(t.pathname+t.search)}return null}var Ia=v.createContext(void 0);function ve(){let e=v.useContext(Ia);return Y(e,"You must render this element inside a element"),e}function Ba({context:e,action:t,location:r,navigator:n,static:i=!1}){let{manifest:o,routeData:a,actionData:u,routeModules:s,serverHandoffString:l,appState:c}=e,p=v.useMemo(()=>Vn(o.routes,s,Vc),[o,s]),[d,f]=v.useState(c),[w]=v.useState(()=>Na({routes:p,actionData:u,loaderData:a,location:r,catch:c.catch,catchBoundaryId:c.catchBoundaryRouteId,onRedirect:n.replace,onChange:ae=>{f({catch:ae.catch,error:ae.error,catchBoundaryRouteId:ae.catchBoundaryId,loaderBoundaryRouteId:ae.errorBoundaryId,renderBoundaryRouteId:null,trackBoundaries:!1,trackCatchBoundaries:!1})}})),_=v.useMemo(()=>{let ae=(It,Bt)=>w.getState().transition.state!=="idle"?n.replace(It,Bt):n.push(It,Bt);return jt(it({},n),{push:ae})},[n,w]),{location:F,matches:S,loaderData:I,actionData:he}=w.getState();v.useEffect(()=>{let{location:ae}=w.getState();r!==ae&&w.send({type:"navigation",location:r,submission:Kc(),action:t})},[w,r,t]);let T=d.error&&d.renderBoundaryRouteId===null&&d.loaderBoundaryRouteId===null?Ua(d.error):void 0,pt=d.catch&&d.catchBoundaryRouteId===null?d.catch:void 0;return v.createElement(Ia.Provider,{value:{matches:S,manifest:o,appState:d,routeModules:s,serverHandoffString:l,clientRoutes:p,routeData:I,actionData:he,transitionManager:w}},v.createElement(vr,{location:F,component:da,error:T},v.createElement(An,{location:F,component:ya,catch:pt},v.createElement(pr,{navigationType:t,location:F,navigator:_,static:i},v.createElement($c,null)))))}function Ua(e){let t=new Error(e.message);return t.stack=e.stack,t}function $c(){let{clientRoutes:e}=ve();return Mn(e)||e[0].element}var ja=v.createContext(void 0);function Hc(){let e=v.useContext(ja);return Y(e,"You must render this element in a remix route element"),e}function Wc({id:e}){throw new Error(`Route "${e}" has no component! Please go add a \`default\` export in the route module file. 21 | If you were trying to navigate or submit to a resource route, use \`\` instead of \`\` or \`
\`.`)}function Vc({id:e}){let t=X(),{routeData:r,routeModules:n,appState:i}=ve(),o=r[e],{default:a,CatchBoundary:u,ErrorBoundary:s}=n[e],l=a?v.createElement(a,null):v.createElement(Wc,{id:e}),c={data:o,id:e};if(u){let p=i.catch&&i.catchBoundaryRouteId===e?i.catch:void 0;i.trackCatchBoundaries&&(i.catchBoundaryRouteId=e),c=p?{id:e,get data(){console.error("You cannot `useLoaderData` in a catch boundary.")}}:{id:e,data:o},l=v.createElement(An,{location:t,component:u,catch:p},l)}if(s){let p=i.error&&(i.renderBoundaryRouteId===e||i.loaderBoundaryRouteId===e)?Ua(i.error):void 0;i.trackBoundaries&&(i.renderBoundaryRouteId=e),c=p?{id:e,get data(){console.error("You cannot `useLoaderData` in an error boundary.")}}:{id:e,data:o},l=v.createElement(vr,{location:t,component:s,error:p},l)}return v.createElement(ja.Provider,{value:c},l)}function $a(e,t){let[r,n]=v.useState(!1),[i,o]=v.useState(!1),{onFocus:a,onBlur:u,onMouseEnter:s,onMouseLeave:l,onTouchStart:c}=t;v.useEffect(()=>{e==="render"&&o(!0)},[e]);let p=()=>{e==="intent"&&n(!0)},d=()=>{e==="intent"&&n(!1)};return v.useEffect(()=>{if(r){let f=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(f)}}},[r]),[i,{onFocus:Tt(a,p),onBlur:Tt(u,d),onMouseEnter:Tt(s,p),onMouseLeave:Tt(l,d),onTouchStart:Tt(c,p)}]}var Yn=v.forwardRef((i,n)=>{var o=i,{to:e,prefetch:t="none"}=o,r=Le(o,["to","prefetch"]);let a=Ie(e),[u,s]=$a(t,r);return v.createElement(v.Fragment,null,v.createElement(ha,q({ref:n,to:e},r,s)),u?v.createElement(At,{page:a}):null)});Yn.displayName="NavLink";var zn=v.forwardRef((i,n)=>{var o=i,{to:e,prefetch:t="none"}=o,r=Le(o,["to","prefetch"]);let a=Ie(e),[u,s]=$a(t,r);return v.createElement(v.Fragment,null,v.createElement(Tn,q({ref:n,to:e},r,s)),u?v.createElement(At,{page:a}):null)});zn.displayName="Link";function Tt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Lr(){let{matches:e,routeModules:t,manifest:r}=ve(),n=v.useMemo(()=>ga(e,t,r),[e,t,r]);return v.createElement(v.Fragment,null,n.map(i=>xr(i)?v.createElement(At,q({key:i.page},i)):v.createElement("link",q({key:i.rel+i.href},i))))}function At(r){var n=r,{page:e}=n,t=Le(n,["page"]);let{clientRoutes:i}=ve(),o=v.useMemo(()=>tt(i,e),[i,e]);return o?v.createElement(Yc,q({page:e,matches:o},t)):(console.warn(`Tried to prefetch ${e} but no routes matched.`),null)}function qc(e){let{routeModules:t}=ve(),[r,n]=v.useState([]);return v.useEffect(()=>{let i=!1;return wa(e,t).then(o=>{i||n(o)}),()=>{i=!0}},[e,t]),r}function Yc(n){var i=n,{page:e,matches:t}=i,r=Le(i,["page","matches"]);let o=X(),{matches:a,manifest:u}=ve(),s=v.useMemo(()=>On(e,t,a,o,"data"),[e,t,a,o]),l=v.useMemo(()=>On(e,t,a,o,"assets"),[e,t,a,o]),c=v.useMemo(()=>xa(e,s,u),[s,e,u]),p=v.useMemo(()=>Ra(l,u),[l,u]),d=qc(l);return v.createElement(v.Fragment,null,c.map(f=>v.createElement("link",q({key:f,rel:"prefetch",as:"fetch",href:f},r))),p.map(f=>v.createElement("link",q({key:f,rel:"modulepreload",href:f},r))),d.map(f=>v.createElement("link",q({key:f.href},f))))}function Cr(){let{matches:e,routeData:t,routeModules:r}=ve(),n=X(),i={},o={};for(let a of e){let u=a.route.id,s=t[u],l=a.params,c=r[u];if(c.meta){let p=typeof c.meta=="function"?c.meta({data:s,parentsData:o,params:l,location:n}):c.meta;Object.assign(i,p)}o[u]=s}return v.createElement(v.Fragment,null,Object.entries(i).map(([a,u])=>{let s=a.startsWith("og:");return a==="title"?v.createElement("title",{key:"title"},u):["charset","charSet"].includes(a)?v.createElement("meta",{key:"charset",charSet:u}):Array.isArray(u)?u.map(l=>s?v.createElement("meta",{key:a+l,property:a,content:l}):v.createElement("meta",{key:a+l,name:a,content:l})):s?v.createElement("meta",{key:a,property:a,content:u}):v.createElement("meta",{key:a,name:a,content:u})}))}var Ta=!1;function kr(e){let{manifest:t,matches:r,pendingLocation:n,clientRoutes:i,serverHandoffString:o}=ve();v.useEffect(()=>{Ta=!0},[]);let a=v.useMemo(()=>{let c=o?`window.__remixContext = ${o};`:"",p=`${r.map((d,f)=>`import * as route${f} from ${JSON.stringify(t.routes[d.route.id].module)};`).join(` 22 | `)} 23 | window.__remixRouteModules = {${r.map((d,f)=>`${JSON.stringify(d.route.id)}:route${f}`).join(",")}};`;return v.createElement(v.Fragment,null,v.createElement("script",q({},e,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:Bn(c)})),v.createElement("script",q({},e,{src:t.url})),v.createElement("script",q({},e,{dangerouslySetInnerHTML:Bn(p),type:"module"})),v.createElement("script",q({},e,{src:t.entry.module,type:"module"})))},[]),u=v.useMemo(()=>{if(n){let c=tt(i,n);return Y(c,`No routes match path "${n.pathname}"`),c}return[]},[n,i]),s=r.concat(u).map(c=>{let p=t.routes[c.route.id];return(p.imports||[]).concat([p.module])}).flat(1),l=t.entry.imports.concat(s);return v.createElement(v.Fragment,null,zc(l).map(c=>v.createElement("link",{key:c,rel:"modulepreload",href:c,crossOrigin:e.crossOrigin})),Ta?null:a)}function zc(e){return[...new Set(e)]}var Jn=v.forwardRef((e,t)=>v.createElement(Ha,q({},e,{ref:t})));Jn.displayName="Form";var Ha=v.forwardRef((l,s)=>{var c=l,{reloadDocument:e=!1,replace:t=!1,method:r="get",action:n=".",encType:i="application/x-www-form-urlencoded",fetchKey:o,onSubmit:a}=c,u=Le(c,["reloadDocument","replace","method","action","encType","fetchKey","onSubmit"]);let p=Jc(o),d=r.toLowerCase()==="get"?"get":"post",f=Pr(n),w=v.useRef(),_=ef(s,w),F=v.useRef();return v.useEffect(()=>{let S=w.current;if(!S)return;function I(he){if(!(he.target instanceof Element))return;let T=he.target.closest("button,input[type=submit]");T&&T.form===S&&T.type==="submit"&&(F.current=T)}return window.addEventListener("click",I),()=>{window.removeEventListener("click",I)}},[]),v.createElement("form",q({ref:_,method:d,action:f,encType:i,onSubmit:e?void 0:S=>{a&&a(S),!S.defaultPrevented&&(S.preventDefault(),p(F.current||S.currentTarget,{method:r,replace:t}),F.current=null)}},u))});Ha.displayName="FormImpl";function Pr(e=".",t="get"){let{id:r}=Hc(),n=Se(e),i=n.search,o=r.endsWith("/index");return e==="."&&o&&(i=i?i.replace(/^\?/,"?index&"):"?index"),n.pathname+i}var Aa="get",Oa="application/x-www-form-urlencoded";function Jc(e){let t=et(),r=Pr(),{transitionManager:n}=ve();return v.useCallback((i,o={})=>{let a,u,s,l;if(Zc(i)){let w=o.submissionTrigger;a=o.method||i.getAttribute("method")||Aa,u=o.action||i.getAttribute("action")||r,s=o.encType||i.getAttribute("enctype")||Oa,l=new FormData(i),w&&w.name&&l.append(w.name,w.value)}else if(Xc(i)||Qc(i)&&(i.type==="submit"||i.type==="image")){let w=i.form;if(w==null)throw new Error("Cannot submit a