@mcp-use/inspector 0.14.3-canary.1 → 0.14.3

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.
@@ -1,4 +1,4 @@
1
- import{c as je,s as ee,b as Ee,r as k,F as te,R as ze,S as Ce,d as qe,u as Ve,e as A,E as L,m as be,f as K,g as We,h as Xe,i as Je,j as Ke,k as xe,l as se,n as oe,o as Q,q as P,w as _e,t as Qe,v as Ge,x as Ye,y as Ze,z as et,O as tt,A as rt,B as at,C as I,D as nt,G as st,H as ot,I as $,J as it,K as ie,L as lt,M as re,N as U,P as ut,Q as dt,T as ct}from"./index-BAVnedrl.js";import{U as wr,V as gr,W as Rr,X as Sr,Y as vr,Z as Er,$ as Cr,a0 as br,a1 as xr,a2 as _r,a3 as kr,a4 as Ar,a5 as Dr,a6 as Tr,a7 as Hr,a8 as Fr,a9 as Pr,aa as Nr,ab as Ur,ac as Or,ad as Lr,ae as Ir,af as Br,ag as Mr,ah as $r,ai as jr,aj as zr,ak as qr,al as Vr,am as Wr,an as Xr,ao as Jr,ap as Kr,aq as Qr,ar as Gr,as as Yr,at as Zr,au as ea,av as ta,aw as ra,ax as aa,ay as na,az as sa,aA as oa,aB as ia,aC as la,aD as ua,aE as da,aF as ca,aG as fa,aH as ha,aI as pa,aJ as ma,aK as ya,aL as wa,aM as ga,aN as Ra,aO as Sa,aP as va,aQ as Ea,aR as Ca,aS as ba,aT as xa,aU as _a,aV as ka,aW as Aa,aX as Da,aY as Ta,aZ as Ha,a_ as Fa,a$ as Pa,b0 as Na,b1 as Ua,b2 as Oa,b3 as La,b4 as Ia,b5 as Ba,b6 as Ma,b7 as $a,b8 as ja,b9 as za,ba as qa,bb as Va,bc as Wa,bd as Xa,be as Ja,bf as Ka,bg as Qa,bh as Ga,bi as Ya}from"./index-BAVnedrl.js";var H={},le;function ft(){if(le)return H;le=1,Object.defineProperty(H,"__esModule",{value:!0}),H.parseCookie=u,H.parse=u,H.stringifyCookie=s,H.stringifySetCookie=i,H.serialize=i,H.parseSetCookie=l,H.stringifySetCookie=i,H.serialize=i;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,n=/^-?\d+$/,o=Object.prototype.toString,d=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function u(f,v){const m=new d,c=f.length;if(c<2)return m;const R=v?.decode||y;let S=0;do{const b=p(f,S,c);if(b===-1)break;const E=h(f,S,c);if(b>E){S=f.lastIndexOf(";",b-1)+1;continue}const _=w(f,S,b);m[_]===void 0&&(m[_]=R(w(f,b+1,E))),S=E+1}while(S<c);return m}function s(f,v){const m=v?.encode||encodeURIComponent,c=[];for(const R of Object.keys(f)){const S=f[R];if(S===void 0)continue;if(!e.test(R))throw new TypeError(`cookie name is invalid: ${R}`);const b=m(S);if(!t.test(b))throw new TypeError(`cookie val is invalid: ${S}`);c.push(`${R}=${b}`)}return c.join("; ")}function i(f,v,m){const c=typeof f=="object"?f:{...m,name:f,value:String(v)},S=(typeof v=="object"?v:m)?.encode||encodeURIComponent;if(!e.test(c.name))throw new TypeError(`argument name is invalid: ${c.name}`);const b=c.value?S(c.value):"";if(!t.test(b))throw new TypeError(`argument val is invalid: ${c.value}`);let E=c.name+"="+b;if(c.maxAge!==void 0){if(!Number.isInteger(c.maxAge))throw new TypeError(`option maxAge is invalid: ${c.maxAge}`);E+="; Max-Age="+c.maxAge}if(c.domain){if(!r.test(c.domain))throw new TypeError(`option domain is invalid: ${c.domain}`);E+="; Domain="+c.domain}if(c.path){if(!a.test(c.path))throw new TypeError(`option path is invalid: ${c.path}`);E+="; Path="+c.path}if(c.expires){if(!g(c.expires)||!Number.isFinite(c.expires.valueOf()))throw new TypeError(`option expires is invalid: ${c.expires}`);E+="; Expires="+c.expires.toUTCString()}if(c.httpOnly&&(E+="; HttpOnly"),c.secure&&(E+="; Secure"),c.partitioned&&(E+="; Partitioned"),c.priority)switch(typeof c.priority=="string"?c.priority.toLowerCase():void 0){case"low":E+="; Priority=Low";break;case"medium":E+="; Priority=Medium";break;case"high":E+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${c.priority}`)}if(c.sameSite)switch(typeof c.sameSite=="string"?c.sameSite.toLowerCase():c.sameSite){case!0:case"strict":E+="; SameSite=Strict";break;case"lax":E+="; SameSite=Lax";break;case"none":E+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${c.sameSite}`)}return E}function l(f,v){const m=v?.decode||y,c=f.length,R=h(f,0,c),S=p(f,0,R),b=S===-1?{name:"",value:m(w(f,0,R))}:{name:w(f,0,S),value:m(w(f,S+1,R))};let E=R+1;for(;E<c;){const _=h(f,E,c),F=p(f,E,_),x=F===-1?w(f,E,_):w(f,E,F),C=F===-1?void 0:w(f,F+1,_);switch(x.toLowerCase()){case"httponly":b.httpOnly=!0;break;case"secure":b.secure=!0;break;case"partitioned":b.partitioned=!0;break;case"domain":b.domain=C;break;case"path":b.path=C;break;case"max-age":C&&n.test(C)&&(b.maxAge=Number(C));break;case"expires":if(!C)break;const D=new Date(C);Number.isFinite(D.valueOf())&&(b.expires=D);break;case"priority":if(!C)break;const T=C.toLowerCase();(T==="low"||T==="medium"||T==="high")&&(b.priority=T);break;case"samesite":if(!C)break;const M=C.toLowerCase();(M==="lax"||M==="strict"||M==="none")&&(b.sameSite=M);break}E=_+1}return b}function h(f,v,m){const c=f.indexOf(";",v);return c===-1?m:c}function p(f,v,m){const c=f.indexOf("=",v);return c<m?c:-1}function w(f,v,m){let c=v,R=m;do{const S=f.charCodeAt(c);if(S!==32&&S!==9)break}while(++c<R);for(;R>c;){const S=f.charCodeAt(R-1);if(S!==32&&S!==9)break;R--}return f.slice(c,R)}function y(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function g(f){return o.call(f)==="[object Date]"}return H}var ue=ft(),O={exports:{}},de;function ht(){if(de)return O.exports;de=1;var e={decodeValues:!0,map:!1,silent:!1};function t(s){return typeof s!="string"||s in{}}function r(){return Object.create(null)}function a(s){return typeof s=="string"&&!!s.trim()}function n(s,i){var l=s.split(";").filter(a),h=l.shift(),p=o(h),w=p.name,y=p.value;if(i=i?Object.assign({},e,i):e,t(w))return null;try{y=i.decodeValues?decodeURIComponent(y):y}catch(f){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",f)}var g=r();return g.name=w,g.value=y,l.forEach(function(f){var v=f.split("="),m=v.shift().trimLeft().toLowerCase();if(!t(m)){var c=v.join("=");if(m==="expires")g.expires=new Date(c);else if(m==="max-age"){var R=parseInt(c,10);Number.isNaN(R)||(g.maxAge=R)}else m==="secure"?g.secure=!0:m==="httponly"?g.httpOnly=!0:m==="samesite"?g.sameSite=c:m==="partitioned"?g.partitioned=!0:m&&(g[m]=c)}}),g}function o(s){var i="",l="",h=s.split("=");return h.length>1?(i=h.shift(),l=h.join("=")):l=s,{name:i,value:l}}function d(s,i){if(i=i?Object.assign({},e,i):e,!s)return i.map?r():[];if(s.headers)if(typeof s.headers.getSetCookie=="function")s=s.headers.getSetCookie();else if(s.headers["set-cookie"])s=s.headers["set-cookie"];else{var l=s.headers[Object.keys(s.headers).find(function(p){return p.toLowerCase()==="set-cookie"})];!l&&s.headers.cookie&&!i.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),s=l}if(Array.isArray(s)||(s=[s]),i.map){var h=r();return s.filter(a).reduce(function(p,w){var y=n(w,i);return y&&!t(y.name)&&(p[y.name]=y),p},h)}else return s.filter(a).map(function(p){return n(p,i)}).filter(Boolean)}function u(s){if(Array.isArray(s))return s;if(typeof s!="string")return[];var i=[],l=0,h,p,w,y,g;function f(){for(;l<s.length&&/\s/.test(s.charAt(l));)l+=1;return l<s.length}function v(){return p=s.charAt(l),p!=="="&&p!==";"&&p!==","}for(;l<s.length;){for(h=l,g=!1;f();)if(p=s.charAt(l),p===","){for(w=l,l+=1,f(),y=l;l<s.length&&v();)l+=1;l<s.length&&s.charAt(l)==="="?(g=!0,l=y,i.push(s.substring(h,w)),h=l):l=w+1}else l+=1;(!g||l>=s.length)&&i.push(s.substring(h,s.length))}return i}return O.exports=d,O.exports.parse=d,O.exports.parseString=n,O.exports.splitCookiesString=u,O.exports}var pt=ht(),mt={};function rr({context:e,url:t,nonce:r}){typeof t=="string"&&(t=new URL(t));let{manifest:a,routeModules:n,criticalCss:o,serverHandoffString:d}=e,u=je(a.routes,n,e.future,e.isSpaMode);e.staticHandlerContext.loaderData={...e.staticHandlerContext.loaderData};for(let i of e.staticHandlerContext.matches){let l=i.route.id,h=n[l],p=e.manifest.routes[l];h&&p&&ee(l,h.clientLoader,p.hasLoader,e.isSpaMode)&&(h.HydrateFallback||!p.hasLoader)&&delete e.staticHandlerContext.loaderData[l]}let s=Ee(u,e.staticHandlerContext);return k.createElement(k.Fragment,null,k.createElement(te.Provider,{value:{manifest:a,routeModules:n,criticalCss:o,serverHandoffString:d,future:e.future,ssr:e.ssr,isSpaMode:e.isSpaMode,routeDiscovery:e.routeDiscovery,serializeError:e.serializeError,renderMeta:e.renderMeta}},k.createElement(ze,{location:s.state.location},k.createElement(Ce,{router:s,context:e.staticHandlerContext,hydrate:!1}))),e.serverHandoffStream?k.createElement(k.Suspense,null,k.createElement(qe,{context:e,identifier:0,reader:e.serverHandoffStream.getReader(),textDecoder:new TextDecoder,nonce:r})):null)}function ar(e,t){return function({initialEntries:a,initialIndex:n,hydrationData:o,future:d}){let u=k.useRef(),s=k.useRef();if(u.current==null){s.current={future:{unstable_subResourceIntegrity:d?.unstable_subResourceIntegrity===!0,v8_middleware:d?.v8_middleware===!0,unstable_trailingSlashAwareDataRequests:d?.unstable_trailingSlashAwareDataRequests===!0},manifest:{routes:{},entry:{imports:[],module:""},url:"",version:""},routeModules:{},ssr:!1,isSpaMode:!1,routeDiscovery:{mode:"lazy",manifestPath:"/__manifest"}};let i=ke(We(e,l=>l),t!==void 0?t:d?.v8_middleware?new K:{},s.current.manifest,s.current.routeModules);u.current=Xe(i,{initialEntries:a,initialIndex:n,hydrationData:o})}return k.createElement(te.Provider,{value:s.current},k.createElement(Je,{router:u.current}))}}function ke(e,t,r,a,n){return e.map(o=>{if(!o.id)throw new Error("Expected a route.id in react-router processRoutes() function");let d={id:o.id,path:o.path,index:o.index,Component:o.Component?et(o.Component):void 0,HydrateFallback:o.HydrateFallback?Ze(o.HydrateFallback):void 0,ErrorBoundary:o.ErrorBoundary?Ye(o.ErrorBoundary):void 0,action:o.action?s=>o.action({...s,context:t}):void 0,loader:o.loader?s=>o.loader({...s,context:t}):void 0,middleware:o.middleware?o.middleware.map(s=>(...i)=>s({...i[0],context:t},i[1])):void 0,handle:o.handle,shouldRevalidate:o.shouldRevalidate},u={id:o.id,path:o.path,index:o.index,parentId:n,hasAction:o.action!=null,hasLoader:o.loader!=null,hasClientAction:!1,hasClientLoader:!1,hasClientMiddleware:!1,hasErrorBoundary:o.ErrorBoundary!=null,module:"build/stub-path-to-module.js",clientActionModule:void 0,clientLoaderModule:void 0,clientMiddlewareModule:void 0,hydrateFallbackModule:void 0};return r.routes[d.id]=u,a[o.id]={default:d.Component||tt,ErrorBoundary:d.ErrorBoundary||void 0,handle:o.handle,links:o.links,meta:o.meta,shouldRevalidate:o.shouldRevalidate},o.children&&(d.children=ke(o.children,t,r,a,d.id)),d})}var ae=new TextEncoder,yt=async(e,t)=>{let r=ae.encode(e),a=await Ae(t,["sign"]),n=await crypto.subtle.sign("HMAC",a,r),o=btoa(String.fromCharCode(...new Uint8Array(n))).replace(/=+$/,"");return e+"."+o},wt=async(e,t)=>{let r=e.lastIndexOf("."),a=e.slice(0,r),n=e.slice(r+1),o=ae.encode(a),d=await Ae(t,["verify"]);try{let u=gt(atob(n));return await crypto.subtle.verify("HMAC",d,u,o)?a:!1}catch{return!1}},Ae=async(e,t)=>crypto.subtle.importKey("raw",ae.encode(e),{name:"HMAC",hash:"SHA-256"},!1,t);function gt(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}var De=(e,t={})=>{let{secrets:r=[],...a}={path:"/",sameSite:"lax",...t};return bt(e,a.expires),{get name(){return e},get isSigned(){return r.length>0},get expires(){return typeof a.maxAge<"u"?new Date(Date.now()+a.maxAge*1e3):a.expires},async parse(n,o){if(!n)return null;let d=ue.parse(n,{...a,...o});if(e in d){let u=d[e];return typeof u=="string"&&u!==""?await St(u,r):""}else return null},async serialize(n,o){return ue.serialize(e,n===""?"":await Rt(n,r),{...a,...o})}}},Te=e=>e!=null&&typeof e.name=="string"&&typeof e.isSigned=="boolean"&&typeof e.parse=="function"&&typeof e.serialize=="function";async function Rt(e,t){let r=vt(e);return t.length>0&&(r=await yt(r,t[0])),r}async function St(e,t){if(t.length>0){for(let r of t){let a=await wt(e,r);if(a!==!1)return ce(a)}return null}return ce(e)}function vt(e){return btoa(Ct(encodeURIComponent(JSON.stringify(e))))}function ce(e){try{return JSON.parse(decodeURIComponent(Et(atob(e))))}catch{return{}}}function Et(e){let t=e.toString(),r="",a=0,n,o;for(;a<t.length;)n=t.charAt(a++),/[\w*+\-./@]/.exec(n)?r+=n:(o=n.charCodeAt(0),o<256?r+="%"+fe(o,2):r+="%u"+fe(o,4).toUpperCase());return r}function fe(e,t){let r=e.toString(16);for(;r.length<t;)r="0"+r;return r}function Ct(e){let t=e.toString(),r="",a=0,n,o;for(;a<t.length;){if(n=t.charAt(a++),n==="%"){if(t.charAt(a)==="u"){if(o=t.slice(a+1,a+5),/^[\da-f]{4}$/i.exec(o)){r+=String.fromCharCode(parseInt(o,16)),a+=5;continue}}else if(o=t.slice(a,a+2),/^[\da-f]{2}$/i.exec(o)){r+=String.fromCharCode(parseInt(o,16)),a+=2;continue}}r+=n}return r}function bt(e,t){_e(!t,`The "${e}" cookie has an "expires" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \`commitSession(session, { expires })\` if using a session storage object, or \`cookie.serialize("value", { expires })\` if you're using the cookie directly.`)}function xt(e){return Object.keys(e).reduce((t,r)=>{let a=e[r];return a&&(t[r]=a.module),t},{})}var _t=(e=>(e.Development="development",e.Production="production",e.Test="test",e))(_t||{});function kt(e){return e==="development"||e==="production"||e==="test"}function V(e,t){if(e instanceof Error&&t!=="development"){let r=new Error("Unexpected Server Error");return r.stack=void 0,r}return e}function z(e,t){return Object.entries(e).reduce((r,[a,n])=>Object.assign(r,{[a]:V(n,t)}),{})}function He(e,t){let r=V(e,t);return{message:r.message,stack:r.stack}}function he(e,t){if(!e)return null;let r=Object.entries(e),a={};for(let[n,o]of r)if(P(o))a[n]={...o,__type:"RouteErrorResponse"};else if(o instanceof Error){let d=V(o,t);a[n]={message:d.message,stack:d.stack,__type:"Error",...d.name!=="Error"?{__subType:d.name}:{}}}else a[n]=o;return a}function G(e,t,r){let a=be(e,t,r);return a?a.map(n=>({params:n.params,pathname:n.pathname,route:n.route})):null}async function pe(e,t){let r=await e({request:Dt(At(t.request)),params:t.params,context:t.context,unstable_pattern:t.unstable_pattern});if(lt(r)&&r.init&&r.init.status&&re(r.init.status))throw new Response(null,r.init);return r}function At(e){let t=new URL(e.url),r=t.searchParams.getAll("index");t.searchParams.delete("index");let a=[];for(let o of r)o&&a.push(o);for(let o of a)t.searchParams.append("index",o);let n={method:e.method,body:e.body,headers:e.headers,signal:e.signal};return n.body&&(n.duplex="half"),new Request(t.href,n)}function Dt(e){let t=new URL(e.url);t.searchParams.delete("_routes");let r={method:e.method,body:e.body,headers:e.headers,signal:e.signal};return r.body&&(r.duplex="half"),new Request(t.href,r)}function j(e,t){if(e===!1||e===null||typeof e>"u")throw console.error("The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose"),new Error(t)}var Fe="__reactRouterDevServerHooks";function nr(e){globalThis[Fe]=e}function W(){return globalThis[Fe]}function Pe(e,t){if(typeof process<"u")try{if(mt?.IS_RR_BUILD_REQUEST==="yes")return e.headers.get(t)}catch{}return null}function Ne(e){let t={};return Object.values(e).forEach(r=>{if(r){let a=r.parentId||"";t[a]||(t[a]=[]),t[a].push(r)}}),t}function Ue(e,t="",r=Ne(e)){return(r[t]||[]).map(a=>({...a,children:Ue(e,a.id,r)}))}function Oe(e,t,r="",a=Ne(e)){return(a[r]||[]).map(n=>{let o={hasErrorBoundary:n.id==="root"||n.module.ErrorBoundary!=null,id:n.id,path:n.path,middleware:n.module.middleware,loader:n.module.loader?async d=>{let u=Pe(d.request,"X-React-Router-Prerender-Data");if(u!=null){let i=u&&decodeURI(u);j(i,"Missing prerendered data for route");let l=new TextEncoder().encode(i),h=new ReadableStream({start(y){y.enqueue(l),y.close()}}),w=(await at(h,globalThis)).value;if(w&&I in w){let y=w[I],g={status:y.status};throw y.reload?nt(y.redirect,g):y.replace?st(y.redirect,g):ot(y.redirect,g)}else{j(w&&n.id in w,"Unable to decode prerendered data");let y=w[n.id];return j("data"in y,"Unable to process prerendered data"),y.data}}return await pe(n.module.loader,d)}:void 0,action:n.module.action?d=>pe(n.module.action,d):void 0,handle:n.module.handle};return n.index?{index:!0,...o}:{caseSensitive:n.caseSensitive,children:Oe(e,t,n.id,a),...o}})}function me(e){return Q(JSON.stringify(e))}function ne(e,t){return Tt(e,r=>{let a=t.routes[r.route.id];return j(a,`Route with id "${r.route.id}" not found in build`),a.module.headers})}function Tt(e,t,r){let a=e.errors?e.matches.findIndex(u=>e.errors[u.route.id]):-1,n=a>=0?e.matches.slice(0,a+1):e.matches,o;if(a>=0){let{actionHeaders:u,actionData:s,loaderHeaders:i,loaderData:l}=e;e.matches.slice(a).some(h=>{let p=h.route.id;return u[p]&&(!s||!s.hasOwnProperty(p))?o=u[p]:i[p]&&!l.hasOwnProperty(p)&&(o=i[p]),o!=null})}const d=new Headers(r);return n.reduce((u,s,i)=>{let{id:l}=s.route,h=e.loaderHeaders[l]||new Headers,p=e.actionHeaders[l]||new Headers,w=o!=null&&i===n.length-1,y=w&&o!==h&&o!==p,g=t(s);if(g==null){let v=new Headers(u);return y&&N(o,v),N(p,v),N(h,v),v}let f=new Headers(typeof g=="function"?g({loaderHeaders:h,parentHeaders:u,actionHeaders:p,errorHeaders:w?o:void 0}):g);return y&&N(o,f),N(p,f),N(h,f),N(u,f),f},new Headers(d))}function N(e,t){let r=e.get("Set-Cookie");if(r){let a=pt.splitCookiesString(r),n=new Set(t.getSetCookie());a.forEach(o=>{n.has(o)||t.append("Set-Cookie",o)})}}function Le(e,t){let r=e.get("origin"),a=typeof r=="string"&&r!=="null"?new URL(r).host:r,n=Pt(e);if(a&&(!n||a!==n.value)&&!Ft(a,t))throw n?new Error(`${n.type} header does not match \`origin\` header from a forwarded action request. Aborting the action.`):new Error("`x-forwarded-host` or `host` headers are not provided. One of these is needed to compare the `origin` header from a forwarded action request. Aborting the action.")}function Ht(e,t){const r=e.split("."),a=t.split(".");if(a.length<1||r.length<a.length||a.length===1&&(a[0]==="*"||a[0]==="**"))return!1;for(;a.length;){const n=a.pop(),o=r.pop();switch(n){case"":return!1;case"*":{if(o)continue;return!1}case"**":return a.length>0?!1:o!==void 0;case void 0:default:if(o!==n)return!1}}return r.length===0}function Ft(e,t=[]){return t.some(r=>r&&(r===e||Ht(e,r)))}function Pt(e){let r=e.get("x-forwarded-host")?.split(",")[0]?.trim(),a=e.get("host");return r?{type:"x-forwarded-host",value:r}:a?{type:"host",value:a}:void 0}var Ie=new Set([...dt,304]);async function Nt(e,t,r,a,n,o,d){try{Le(a.headers,Array.isArray(e.allowedActionOrigins)?e.allowedActionOrigins:[]);let l=new Request(n,{method:a.method,body:a.body,headers:a.headers,signal:a.signal,...a.body?{duplex:"half"}:void 0}),h=await r.query(l,{requestContext:o,skipLoaderErrorBubbling:!0,skipRevalidation:!0,generateMiddlewareResponse:e.future.v8_middleware?async p=>{try{let w=await p(l);return u(w)}catch(w){return s(w)}}:void 0});return u(h)}catch(l){return s(l)}function u(l){return U(l)?l:i(l)}function s(l){return d(l),B(a,e,t,{result:{error:l},headers:new Headers,status:500})}function i(l){let h=ne(l,e);if(re(l.statusCode)&&h.has("Location"))return new Response(null,{status:l.statusCode,headers:h});l.errors&&(Object.values(l.errors).forEach(w=>{(!P(w)||w.error)&&d(w)}),l.errors=z(l.errors,t));let p;return l.errors?p={error:Object.values(l.errors)[0]}:p={data:Object.values(l.actionData||{})[0]},B(a,e,t,{result:p,headers:h,status:l.statusCode})}}async function Ut(e,t,r,a,n,o,d){let u=new URL(a.url).searchParams.get("_routes"),s=u?new Set(u.split(",")):null;try{let p=new Request(n,{headers:a.headers,signal:a.signal}),w=await r.query(p,{requestContext:o,filterMatchesToLoad:y=>!s||s.has(y.route.id),skipLoaderErrorBubbling:!0,generateMiddlewareResponse:e.future.v8_middleware?async y=>{try{let g=await y(p);return i(g)}catch(g){return l(g)}}:void 0});return i(w)}catch(p){return l(p)}function i(p){return U(p)?p:h(p)}function l(p){return d(p),B(a,e,t,{result:{error:p},headers:new Headers,status:500})}function h(p){let w=ne(p,e);if(re(p.statusCode)&&w.has("Location"))return new Response(null,{status:p.statusCode,headers:w});p.errors&&(Object.values(p.errors).forEach(f=>{(!P(f)||f.error)&&d(f)}),p.errors=z(p.errors,t));let y={},g=new Set(p.matches.filter(f=>s?s.has(f.route.id):f.route.loader!=null).map(f=>f.route.id));if(p.errors)for(let[f,v]of Object.entries(p.errors))y[f]={error:v};for(let[f,v]of Object.entries(p.loaderData))!(f in y)&&g.has(f)&&(y[f]={data:v});return B(a,e,t,{result:y,headers:w,status:p.statusCode})}}function B(e,t,r,{result:a,headers:n,status:o}){let d=new Headers(n);return d.set("X-Remix-Response","yes"),Ie.has(o)?new Response(null,{status:o,headers:d}):(d.set("Content-Type","text/x-script"),d.delete("Content-Length"),new Response(Y(a,e.signal,t.entry.module.streamTimeout,r),{status:o||200,headers:d}))}function ye(e,t,r,a){let n=Ot(e.status,e.headers,r.basename),o=new Headers(e.headers);return o.delete("Location"),o.set("Content-Type","text/x-script"),B(t,r,a,{result:t.method==="GET"?{[I]:n}:n,headers:o,status:xe})}function Ot(e,t,r){let a=t.get("Location");return r&&(a=$(a,r)||a),{redirect:a,status:e,revalidate:t.has("X-Remix-Revalidate")||t.has("Set-Cookie"),reload:t.has("X-Remix-Reload-Document"),replace:t.has("X-Remix-Replace")}}function Y(e,t,r,a){let n=new AbortController,o=setTimeout(()=>n.abort(new Error("Server Timeout")),typeof r=="number"?r:4950);return t.addEventListener("abort",()=>clearTimeout(o)),ct(e,{signal:n.signal,plugins:[d=>{if(d instanceof Error){let{name:u,message:s,stack:i}=a==="production"?V(d,a):d;return["SanitizedError",u,s,i]}if(d instanceof L){let{data:u,status:s,statusText:i}=d;return["ErrorResponse",u,s,i]}if(d&&typeof d=="object"&&I in d)return["SingleFetchRedirect",d[I]]}],postPlugins:[d=>{if(d&&typeof d=="object")return["SingleFetchClassInstance",Object.fromEntries(Object.entries(d))]},()=>["SingleFetchFallback"]]})}function we(e,t){let r=Ue(e.routes),a=Oe(e.routes,e.future),n=kt(t)?t:"production",o=Qe(a,{basename:e.basename,unstable_instrumentations:e.entry.module.unstable_instrumentations}),d=e.entry.module.handleError||((s,{request:i})=>{n!=="test"&&!i.signal.aborted&&console.error(P(s)&&s.error?s.error:s)}),u=async(s,i)=>{let l={},h,p=R=>{t==="development"&&W()?.processRequestError?.(R),d(R,{context:h,params:l,request:s})};if(e.future.v8_middleware){if(i&&!(i instanceof K)){let R=new Error("Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function.");return p(R),q(R,n)}h=i||new K}else h=i||{};let w=new URL(s.url),y=e.basename||"/",g=w.pathname;e.future.unstable_trailingSlashAwareDataRequests?g.endsWith("/_.data")?g=g.replace(/_.data$/,""):g=g.replace(/\.data$/,""):($(g,y)==="/_root.data"?g=y:g.endsWith(".data")&&(g=g.replace(/\.data$/,"")),$(g,y)!=="/"&&g.endsWith("/")&&(g=g.slice(0,-1)));let f=Pe(s,"X-React-Router-SPA-Mode")==="yes";if(!e.ssr){let R=decodeURI(g);if(y!=="/"){let S=$(R,y);if(S==null)return d(new L(404,"Not Found",`Refusing to prerender the \`${R}\` path because it does not start with the basename \`${y}\``),{context:h,params:l,request:s}),new Response("Not Found",{status:404,statusText:"Not Found"});R=S}if(e.prerender.length===0)f=!0;else if(!e.prerender.includes(R)&&!e.prerender.includes(R+"/")){if(w.pathname.endsWith(".data"))return d(new L(404,"Not Found",`Refusing to SSR the path \`${R}\` because \`ssr:false\` is set and the path is not included in the \`prerender\` config, so in production the path will be a 404.`),{context:h,params:l,request:s}),new Response("Not Found",{status:404,statusText:"Not Found"});f=!0}}let v=it(e.routeDiscovery.manifestPath,y);if(w.pathname===v)try{return await Lt(e,r,w)}catch(R){return p(R),new Response("Unknown Server Error",{status:500})}let m=G(r,g,e.basename);m&&m.length>0&&Object.assign(l,m[0].params);let c;if(w.pathname.endsWith(".data")){let R=new URL(s.url);R.pathname=g;let S=G(r,R.pathname,e.basename);c=await It(n,e,o,s,R,h,p),ie(c)&&(c=ye(c,s,e,n)),e.entry.module.handleDataRequest&&(c=await e.entry.module.handleDataRequest(c,{context:h,params:S?S[0].params:{},request:s}),ie(c)&&(c=ye(c,s,e,n)))}else if(!f&&m&&m[m.length-1].route.module.default==null&&m[m.length-1].route.module.ErrorBoundary==null)c=await Mt(n,e,o,m.slice(-1)[0].route.id,s,h,p);else{let{pathname:R}=w,S;e.unstable_getCriticalCss?S=await e.unstable_getCriticalCss({pathname:R}):t==="development"&&W()?.getCriticalCss&&(S=await W()?.getCriticalCss?.(R)),c=await Bt(n,e,o,s,h,p,f,S)}return s.method==="HEAD"?new Response(null,{headers:c.headers,status:c.status,statusText:c.statusText}):c};return e.entry.module.unstable_instrumentations&&(u=Ge(u,e.entry.module.unstable_instrumentations.map(s=>s.handler).filter(Boolean))),{routes:r,dataRoutes:a,serverMode:n,staticHandler:o,errorHandler:d,requestHandler:u}}var sr=(e,t)=>{let r,a,n,o,d,u;return async function(i,l){if(r=typeof e=="function"?await e():e,typeof e=="function"){let h=we(r,t);a=h.routes,n=h.serverMode,o=h.staticHandler,d=h.errorHandler,u=h.requestHandler}else if(!a||!n||!o||!d||!u){let h=we(r,t);a=h.routes,n=h.serverMode,o=h.staticHandler,d=h.errorHandler,u=h.requestHandler}return u(i,l)}};async function Lt(e,t,r){if(e.assets.version!==r.searchParams.get("version"))return new Response(null,{status:204,headers:{"X-Remix-Reload-Document":"true"}});let a={};if(r.searchParams.has("paths")){let n=new Set;(r.searchParams.get("paths")||"").split(",").filter(Boolean).forEach(u=>{u.startsWith("/")||(u=`/${u}`);let s=u.split("/").slice(1);s.forEach((i,l)=>{let h=s.slice(0,l+1).join("/");n.add(`/${h}`)})});for(let u of n){let s=G(t,u,e.basename);if(s)for(let i of s){let l=i.route.id,h=e.assets.routes[l];h&&(a[l]=h)}}return Response.json(a,{headers:{"Cache-Control":"public, max-age=31536000, immutable"}})}return new Response("Invalid Request",{status:400})}async function It(e,t,r,a,n,o,d){return a.method!=="GET"?await Nt(t,e,r,a,n,o,d):await Ut(t,e,r,a,n,o,d)}async function Bt(e,t,r,a,n,o,d,u){try{a.method==="POST"&&Le(a.headers,Array.isArray(t.allowedActionOrigins)?t.allowedActionOrigins:[]);let i=await r.query(a,{requestContext:n,generateMiddlewareResponse:t.future.v8_middleware?async l=>{try{let h=await l(a);return U(h)||(h=await s(h,d)),h}catch(h){return o(h),new Response(null,{status:500})}}:void 0});return U(i)||(i=await s(i,d)),i}catch(i){return o(i),new Response(null,{status:500})}async function s(i,l){let h=ne(i,t);if(Ie.has(i.statusCode))return new Response(null,{status:i.statusCode,headers:h});i.errors&&(Object.values(i.errors).forEach(f=>{(!P(f)||f.error)&&o(f)}),i.errors=z(i.errors,e));let p={loaderData:i.loaderData,actionData:i.actionData,errors:he(i.errors,e)},w={basename:t.basename,future:t.future,routeDiscovery:t.routeDiscovery,ssr:t.ssr,isSpaMode:l},y={manifest:t.assets,routeModules:xt(t.routes),staticHandlerContext:i,criticalCss:u,serverHandoffString:me({...w,criticalCss:u}),serverHandoffStream:Y(p,a.signal,t.entry.module.streamTimeout,e),renderMeta:{},future:t.future,ssr:t.ssr,routeDiscovery:t.routeDiscovery,isSpaMode:l,serializeError:f=>He(f,e)},g=t.entry.module.default;try{return await g(a,i.statusCode,h,y,n)}catch(f){o(f);let v=f;if(U(f))try{let c=await jt(f);v=new L(f.status,f.statusText,c)}catch{}i=ut(r.dataRoutes,i,v),i.errors&&(i.errors=z(i.errors,e));let m={loaderData:i.loaderData,actionData:i.actionData,errors:he(i.errors,e)};y={...y,staticHandlerContext:i,serverHandoffString:me(w),serverHandoffStream:Y(m,a.signal,t.entry.module.streamTimeout,e),renderMeta:{}};try{return await g(a,i.statusCode,h,y,n)}catch(c){return o(c),q(c,e)}}}}async function Mt(e,t,r,a,n,o,d){try{let i=await r.queryRoute(n,{routeId:a,requestContext:o,generateMiddlewareResponse:t.future.v8_middleware?async l=>{try{let h=await l(n);return u(h)}catch(h){return s(h)}}:void 0});return u(i)}catch(i){return s(i)}function u(i){return U(i)?i:typeof i=="string"?new Response(i):Response.json(i)}function s(i){if(U(i))return i;if(P(i))return d(i),$t(i,e);if(i instanceof Error&&i.message==="Expected a response from queryRoute"){let l=new Error("Expected a Response to be returned from resource route handler");return d(l),q(l,e)}return d(i),q(i,e)}}function $t(e,t){return Response.json(He(e.error||new Error("Unexpected Server Error"),t),{status:e.status,statusText:e.statusText})}function q(e,t){let r="Unexpected Server Error";return t!=="production"&&(r+=`
1
+ import{c as je,s as ee,b as Ee,r as k,F as te,R as ze,S as Ce,d as qe,u as Ve,e as A,E as L,m as be,f as K,g as We,h as Xe,i as Je,j as Ke,k as xe,l as se,n as oe,o as Q,q as P,w as _e,t as Qe,v as Ge,x as Ye,y as Ze,z as et,O as tt,A as rt,B as at,C as I,D as nt,G as st,H as ot,I as $,J as it,K as ie,L as lt,M as re,N as U,P as ut,Q as dt,T as ct}from"./index-DjkfvIWz.js";import{U as wr,V as gr,W as Rr,X as Sr,Y as vr,Z as Er,$ as Cr,a0 as br,a1 as xr,a2 as _r,a3 as kr,a4 as Ar,a5 as Dr,a6 as Tr,a7 as Hr,a8 as Fr,a9 as Pr,aa as Nr,ab as Ur,ac as Or,ad as Lr,ae as Ir,af as Br,ag as Mr,ah as $r,ai as jr,aj as zr,ak as qr,al as Vr,am as Wr,an as Xr,ao as Jr,ap as Kr,aq as Qr,ar as Gr,as as Yr,at as Zr,au as ea,av as ta,aw as ra,ax as aa,ay as na,az as sa,aA as oa,aB as ia,aC as la,aD as ua,aE as da,aF as ca,aG as fa,aH as ha,aI as pa,aJ as ma,aK as ya,aL as wa,aM as ga,aN as Ra,aO as Sa,aP as va,aQ as Ea,aR as Ca,aS as ba,aT as xa,aU as _a,aV as ka,aW as Aa,aX as Da,aY as Ta,aZ as Ha,a_ as Fa,a$ as Pa,b0 as Na,b1 as Ua,b2 as Oa,b3 as La,b4 as Ia,b5 as Ba,b6 as Ma,b7 as $a,b8 as ja,b9 as za,ba as qa,bb as Va,bc as Wa,bd as Xa,be as Ja,bf as Ka,bg as Qa,bh as Ga,bi as Ya}from"./index-DjkfvIWz.js";var H={},le;function ft(){if(le)return H;le=1,Object.defineProperty(H,"__esModule",{value:!0}),H.parseCookie=u,H.parse=u,H.stringifyCookie=s,H.stringifySetCookie=i,H.serialize=i,H.parseSetCookie=l,H.stringifySetCookie=i,H.serialize=i;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,n=/^-?\d+$/,o=Object.prototype.toString,d=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function u(f,v){const m=new d,c=f.length;if(c<2)return m;const R=v?.decode||y;let S=0;do{const b=p(f,S,c);if(b===-1)break;const E=h(f,S,c);if(b>E){S=f.lastIndexOf(";",b-1)+1;continue}const _=w(f,S,b);m[_]===void 0&&(m[_]=R(w(f,b+1,E))),S=E+1}while(S<c);return m}function s(f,v){const m=v?.encode||encodeURIComponent,c=[];for(const R of Object.keys(f)){const S=f[R];if(S===void 0)continue;if(!e.test(R))throw new TypeError(`cookie name is invalid: ${R}`);const b=m(S);if(!t.test(b))throw new TypeError(`cookie val is invalid: ${S}`);c.push(`${R}=${b}`)}return c.join("; ")}function i(f,v,m){const c=typeof f=="object"?f:{...m,name:f,value:String(v)},S=(typeof v=="object"?v:m)?.encode||encodeURIComponent;if(!e.test(c.name))throw new TypeError(`argument name is invalid: ${c.name}`);const b=c.value?S(c.value):"";if(!t.test(b))throw new TypeError(`argument val is invalid: ${c.value}`);let E=c.name+"="+b;if(c.maxAge!==void 0){if(!Number.isInteger(c.maxAge))throw new TypeError(`option maxAge is invalid: ${c.maxAge}`);E+="; Max-Age="+c.maxAge}if(c.domain){if(!r.test(c.domain))throw new TypeError(`option domain is invalid: ${c.domain}`);E+="; Domain="+c.domain}if(c.path){if(!a.test(c.path))throw new TypeError(`option path is invalid: ${c.path}`);E+="; Path="+c.path}if(c.expires){if(!g(c.expires)||!Number.isFinite(c.expires.valueOf()))throw new TypeError(`option expires is invalid: ${c.expires}`);E+="; Expires="+c.expires.toUTCString()}if(c.httpOnly&&(E+="; HttpOnly"),c.secure&&(E+="; Secure"),c.partitioned&&(E+="; Partitioned"),c.priority)switch(typeof c.priority=="string"?c.priority.toLowerCase():void 0){case"low":E+="; Priority=Low";break;case"medium":E+="; Priority=Medium";break;case"high":E+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${c.priority}`)}if(c.sameSite)switch(typeof c.sameSite=="string"?c.sameSite.toLowerCase():c.sameSite){case!0:case"strict":E+="; SameSite=Strict";break;case"lax":E+="; SameSite=Lax";break;case"none":E+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${c.sameSite}`)}return E}function l(f,v){const m=v?.decode||y,c=f.length,R=h(f,0,c),S=p(f,0,R),b=S===-1?{name:"",value:m(w(f,0,R))}:{name:w(f,0,S),value:m(w(f,S+1,R))};let E=R+1;for(;E<c;){const _=h(f,E,c),F=p(f,E,_),x=F===-1?w(f,E,_):w(f,E,F),C=F===-1?void 0:w(f,F+1,_);switch(x.toLowerCase()){case"httponly":b.httpOnly=!0;break;case"secure":b.secure=!0;break;case"partitioned":b.partitioned=!0;break;case"domain":b.domain=C;break;case"path":b.path=C;break;case"max-age":C&&n.test(C)&&(b.maxAge=Number(C));break;case"expires":if(!C)break;const D=new Date(C);Number.isFinite(D.valueOf())&&(b.expires=D);break;case"priority":if(!C)break;const T=C.toLowerCase();(T==="low"||T==="medium"||T==="high")&&(b.priority=T);break;case"samesite":if(!C)break;const M=C.toLowerCase();(M==="lax"||M==="strict"||M==="none")&&(b.sameSite=M);break}E=_+1}return b}function h(f,v,m){const c=f.indexOf(";",v);return c===-1?m:c}function p(f,v,m){const c=f.indexOf("=",v);return c<m?c:-1}function w(f,v,m){let c=v,R=m;do{const S=f.charCodeAt(c);if(S!==32&&S!==9)break}while(++c<R);for(;R>c;){const S=f.charCodeAt(R-1);if(S!==32&&S!==9)break;R--}return f.slice(c,R)}function y(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function g(f){return o.call(f)==="[object Date]"}return H}var ue=ft(),O={exports:{}},de;function ht(){if(de)return O.exports;de=1;var e={decodeValues:!0,map:!1,silent:!1};function t(s){return typeof s!="string"||s in{}}function r(){return Object.create(null)}function a(s){return typeof s=="string"&&!!s.trim()}function n(s,i){var l=s.split(";").filter(a),h=l.shift(),p=o(h),w=p.name,y=p.value;if(i=i?Object.assign({},e,i):e,t(w))return null;try{y=i.decodeValues?decodeURIComponent(y):y}catch(f){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",f)}var g=r();return g.name=w,g.value=y,l.forEach(function(f){var v=f.split("="),m=v.shift().trimLeft().toLowerCase();if(!t(m)){var c=v.join("=");if(m==="expires")g.expires=new Date(c);else if(m==="max-age"){var R=parseInt(c,10);Number.isNaN(R)||(g.maxAge=R)}else m==="secure"?g.secure=!0:m==="httponly"?g.httpOnly=!0:m==="samesite"?g.sameSite=c:m==="partitioned"?g.partitioned=!0:m&&(g[m]=c)}}),g}function o(s){var i="",l="",h=s.split("=");return h.length>1?(i=h.shift(),l=h.join("=")):l=s,{name:i,value:l}}function d(s,i){if(i=i?Object.assign({},e,i):e,!s)return i.map?r():[];if(s.headers)if(typeof s.headers.getSetCookie=="function")s=s.headers.getSetCookie();else if(s.headers["set-cookie"])s=s.headers["set-cookie"];else{var l=s.headers[Object.keys(s.headers).find(function(p){return p.toLowerCase()==="set-cookie"})];!l&&s.headers.cookie&&!i.silent&&console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),s=l}if(Array.isArray(s)||(s=[s]),i.map){var h=r();return s.filter(a).reduce(function(p,w){var y=n(w,i);return y&&!t(y.name)&&(p[y.name]=y),p},h)}else return s.filter(a).map(function(p){return n(p,i)}).filter(Boolean)}function u(s){if(Array.isArray(s))return s;if(typeof s!="string")return[];var i=[],l=0,h,p,w,y,g;function f(){for(;l<s.length&&/\s/.test(s.charAt(l));)l+=1;return l<s.length}function v(){return p=s.charAt(l),p!=="="&&p!==";"&&p!==","}for(;l<s.length;){for(h=l,g=!1;f();)if(p=s.charAt(l),p===","){for(w=l,l+=1,f(),y=l;l<s.length&&v();)l+=1;l<s.length&&s.charAt(l)==="="?(g=!0,l=y,i.push(s.substring(h,w)),h=l):l=w+1}else l+=1;(!g||l>=s.length)&&i.push(s.substring(h,s.length))}return i}return O.exports=d,O.exports.parse=d,O.exports.parseString=n,O.exports.splitCookiesString=u,O.exports}var pt=ht(),mt={};function rr({context:e,url:t,nonce:r}){typeof t=="string"&&(t=new URL(t));let{manifest:a,routeModules:n,criticalCss:o,serverHandoffString:d}=e,u=je(a.routes,n,e.future,e.isSpaMode);e.staticHandlerContext.loaderData={...e.staticHandlerContext.loaderData};for(let i of e.staticHandlerContext.matches){let l=i.route.id,h=n[l],p=e.manifest.routes[l];h&&p&&ee(l,h.clientLoader,p.hasLoader,e.isSpaMode)&&(h.HydrateFallback||!p.hasLoader)&&delete e.staticHandlerContext.loaderData[l]}let s=Ee(u,e.staticHandlerContext);return k.createElement(k.Fragment,null,k.createElement(te.Provider,{value:{manifest:a,routeModules:n,criticalCss:o,serverHandoffString:d,future:e.future,ssr:e.ssr,isSpaMode:e.isSpaMode,routeDiscovery:e.routeDiscovery,serializeError:e.serializeError,renderMeta:e.renderMeta}},k.createElement(ze,{location:s.state.location},k.createElement(Ce,{router:s,context:e.staticHandlerContext,hydrate:!1}))),e.serverHandoffStream?k.createElement(k.Suspense,null,k.createElement(qe,{context:e,identifier:0,reader:e.serverHandoffStream.getReader(),textDecoder:new TextDecoder,nonce:r})):null)}function ar(e,t){return function({initialEntries:a,initialIndex:n,hydrationData:o,future:d}){let u=k.useRef(),s=k.useRef();if(u.current==null){s.current={future:{unstable_subResourceIntegrity:d?.unstable_subResourceIntegrity===!0,v8_middleware:d?.v8_middleware===!0,unstable_trailingSlashAwareDataRequests:d?.unstable_trailingSlashAwareDataRequests===!0},manifest:{routes:{},entry:{imports:[],module:""},url:"",version:""},routeModules:{},ssr:!1,isSpaMode:!1,routeDiscovery:{mode:"lazy",manifestPath:"/__manifest"}};let i=ke(We(e,l=>l),t!==void 0?t:d?.v8_middleware?new K:{},s.current.manifest,s.current.routeModules);u.current=Xe(i,{initialEntries:a,initialIndex:n,hydrationData:o})}return k.createElement(te.Provider,{value:s.current},k.createElement(Je,{router:u.current}))}}function ke(e,t,r,a,n){return e.map(o=>{if(!o.id)throw new Error("Expected a route.id in react-router processRoutes() function");let d={id:o.id,path:o.path,index:o.index,Component:o.Component?et(o.Component):void 0,HydrateFallback:o.HydrateFallback?Ze(o.HydrateFallback):void 0,ErrorBoundary:o.ErrorBoundary?Ye(o.ErrorBoundary):void 0,action:o.action?s=>o.action({...s,context:t}):void 0,loader:o.loader?s=>o.loader({...s,context:t}):void 0,middleware:o.middleware?o.middleware.map(s=>(...i)=>s({...i[0],context:t},i[1])):void 0,handle:o.handle,shouldRevalidate:o.shouldRevalidate},u={id:o.id,path:o.path,index:o.index,parentId:n,hasAction:o.action!=null,hasLoader:o.loader!=null,hasClientAction:!1,hasClientLoader:!1,hasClientMiddleware:!1,hasErrorBoundary:o.ErrorBoundary!=null,module:"build/stub-path-to-module.js",clientActionModule:void 0,clientLoaderModule:void 0,clientMiddlewareModule:void 0,hydrateFallbackModule:void 0};return r.routes[d.id]=u,a[o.id]={default:d.Component||tt,ErrorBoundary:d.ErrorBoundary||void 0,handle:o.handle,links:o.links,meta:o.meta,shouldRevalidate:o.shouldRevalidate},o.children&&(d.children=ke(o.children,t,r,a,d.id)),d})}var ae=new TextEncoder,yt=async(e,t)=>{let r=ae.encode(e),a=await Ae(t,["sign"]),n=await crypto.subtle.sign("HMAC",a,r),o=btoa(String.fromCharCode(...new Uint8Array(n))).replace(/=+$/,"");return e+"."+o},wt=async(e,t)=>{let r=e.lastIndexOf("."),a=e.slice(0,r),n=e.slice(r+1),o=ae.encode(a),d=await Ae(t,["verify"]);try{let u=gt(atob(n));return await crypto.subtle.verify("HMAC",d,u,o)?a:!1}catch{return!1}},Ae=async(e,t)=>crypto.subtle.importKey("raw",ae.encode(e),{name:"HMAC",hash:"SHA-256"},!1,t);function gt(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}var De=(e,t={})=>{let{secrets:r=[],...a}={path:"/",sameSite:"lax",...t};return bt(e,a.expires),{get name(){return e},get isSigned(){return r.length>0},get expires(){return typeof a.maxAge<"u"?new Date(Date.now()+a.maxAge*1e3):a.expires},async parse(n,o){if(!n)return null;let d=ue.parse(n,{...a,...o});if(e in d){let u=d[e];return typeof u=="string"&&u!==""?await St(u,r):""}else return null},async serialize(n,o){return ue.serialize(e,n===""?"":await Rt(n,r),{...a,...o})}}},Te=e=>e!=null&&typeof e.name=="string"&&typeof e.isSigned=="boolean"&&typeof e.parse=="function"&&typeof e.serialize=="function";async function Rt(e,t){let r=vt(e);return t.length>0&&(r=await yt(r,t[0])),r}async function St(e,t){if(t.length>0){for(let r of t){let a=await wt(e,r);if(a!==!1)return ce(a)}return null}return ce(e)}function vt(e){return btoa(Ct(encodeURIComponent(JSON.stringify(e))))}function ce(e){try{return JSON.parse(decodeURIComponent(Et(atob(e))))}catch{return{}}}function Et(e){let t=e.toString(),r="",a=0,n,o;for(;a<t.length;)n=t.charAt(a++),/[\w*+\-./@]/.exec(n)?r+=n:(o=n.charCodeAt(0),o<256?r+="%"+fe(o,2):r+="%u"+fe(o,4).toUpperCase());return r}function fe(e,t){let r=e.toString(16);for(;r.length<t;)r="0"+r;return r}function Ct(e){let t=e.toString(),r="",a=0,n,o;for(;a<t.length;){if(n=t.charAt(a++),n==="%"){if(t.charAt(a)==="u"){if(o=t.slice(a+1,a+5),/^[\da-f]{4}$/i.exec(o)){r+=String.fromCharCode(parseInt(o,16)),a+=5;continue}}else if(o=t.slice(a,a+2),/^[\da-f]{2}$/i.exec(o)){r+=String.fromCharCode(parseInt(o,16)),a+=2;continue}}r+=n}return r}function bt(e,t){_e(!t,`The "${e}" cookie has an "expires" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \`commitSession(session, { expires })\` if using a session storage object, or \`cookie.serialize("value", { expires })\` if you're using the cookie directly.`)}function xt(e){return Object.keys(e).reduce((t,r)=>{let a=e[r];return a&&(t[r]=a.module),t},{})}var _t=(e=>(e.Development="development",e.Production="production",e.Test="test",e))(_t||{});function kt(e){return e==="development"||e==="production"||e==="test"}function V(e,t){if(e instanceof Error&&t!=="development"){let r=new Error("Unexpected Server Error");return r.stack=void 0,r}return e}function z(e,t){return Object.entries(e).reduce((r,[a,n])=>Object.assign(r,{[a]:V(n,t)}),{})}function He(e,t){let r=V(e,t);return{message:r.message,stack:r.stack}}function he(e,t){if(!e)return null;let r=Object.entries(e),a={};for(let[n,o]of r)if(P(o))a[n]={...o,__type:"RouteErrorResponse"};else if(o instanceof Error){let d=V(o,t);a[n]={message:d.message,stack:d.stack,__type:"Error",...d.name!=="Error"?{__subType:d.name}:{}}}else a[n]=o;return a}function G(e,t,r){let a=be(e,t,r);return a?a.map(n=>({params:n.params,pathname:n.pathname,route:n.route})):null}async function pe(e,t){let r=await e({request:Dt(At(t.request)),params:t.params,context:t.context,unstable_pattern:t.unstable_pattern});if(lt(r)&&r.init&&r.init.status&&re(r.init.status))throw new Response(null,r.init);return r}function At(e){let t=new URL(e.url),r=t.searchParams.getAll("index");t.searchParams.delete("index");let a=[];for(let o of r)o&&a.push(o);for(let o of a)t.searchParams.append("index",o);let n={method:e.method,body:e.body,headers:e.headers,signal:e.signal};return n.body&&(n.duplex="half"),new Request(t.href,n)}function Dt(e){let t=new URL(e.url);t.searchParams.delete("_routes");let r={method:e.method,body:e.body,headers:e.headers,signal:e.signal};return r.body&&(r.duplex="half"),new Request(t.href,r)}function j(e,t){if(e===!1||e===null||typeof e>"u")throw console.error("The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose"),new Error(t)}var Fe="__reactRouterDevServerHooks";function nr(e){globalThis[Fe]=e}function W(){return globalThis[Fe]}function Pe(e,t){if(typeof process<"u")try{if(mt?.IS_RR_BUILD_REQUEST==="yes")return e.headers.get(t)}catch{}return null}function Ne(e){let t={};return Object.values(e).forEach(r=>{if(r){let a=r.parentId||"";t[a]||(t[a]=[]),t[a].push(r)}}),t}function Ue(e,t="",r=Ne(e)){return(r[t]||[]).map(a=>({...a,children:Ue(e,a.id,r)}))}function Oe(e,t,r="",a=Ne(e)){return(a[r]||[]).map(n=>{let o={hasErrorBoundary:n.id==="root"||n.module.ErrorBoundary!=null,id:n.id,path:n.path,middleware:n.module.middleware,loader:n.module.loader?async d=>{let u=Pe(d.request,"X-React-Router-Prerender-Data");if(u!=null){let i=u&&decodeURI(u);j(i,"Missing prerendered data for route");let l=new TextEncoder().encode(i),h=new ReadableStream({start(y){y.enqueue(l),y.close()}}),w=(await at(h,globalThis)).value;if(w&&I in w){let y=w[I],g={status:y.status};throw y.reload?nt(y.redirect,g):y.replace?st(y.redirect,g):ot(y.redirect,g)}else{j(w&&n.id in w,"Unable to decode prerendered data");let y=w[n.id];return j("data"in y,"Unable to process prerendered data"),y.data}}return await pe(n.module.loader,d)}:void 0,action:n.module.action?d=>pe(n.module.action,d):void 0,handle:n.module.handle};return n.index?{index:!0,...o}:{caseSensitive:n.caseSensitive,children:Oe(e,t,n.id,a),...o}})}function me(e){return Q(JSON.stringify(e))}function ne(e,t){return Tt(e,r=>{let a=t.routes[r.route.id];return j(a,`Route with id "${r.route.id}" not found in build`),a.module.headers})}function Tt(e,t,r){let a=e.errors?e.matches.findIndex(u=>e.errors[u.route.id]):-1,n=a>=0?e.matches.slice(0,a+1):e.matches,o;if(a>=0){let{actionHeaders:u,actionData:s,loaderHeaders:i,loaderData:l}=e;e.matches.slice(a).some(h=>{let p=h.route.id;return u[p]&&(!s||!s.hasOwnProperty(p))?o=u[p]:i[p]&&!l.hasOwnProperty(p)&&(o=i[p]),o!=null})}const d=new Headers(r);return n.reduce((u,s,i)=>{let{id:l}=s.route,h=e.loaderHeaders[l]||new Headers,p=e.actionHeaders[l]||new Headers,w=o!=null&&i===n.length-1,y=w&&o!==h&&o!==p,g=t(s);if(g==null){let v=new Headers(u);return y&&N(o,v),N(p,v),N(h,v),v}let f=new Headers(typeof g=="function"?g({loaderHeaders:h,parentHeaders:u,actionHeaders:p,errorHeaders:w?o:void 0}):g);return y&&N(o,f),N(p,f),N(h,f),N(u,f),f},new Headers(d))}function N(e,t){let r=e.get("Set-Cookie");if(r){let a=pt.splitCookiesString(r),n=new Set(t.getSetCookie());a.forEach(o=>{n.has(o)||t.append("Set-Cookie",o)})}}function Le(e,t){let r=e.get("origin"),a=typeof r=="string"&&r!=="null"?new URL(r).host:r,n=Pt(e);if(a&&(!n||a!==n.value)&&!Ft(a,t))throw n?new Error(`${n.type} header does not match \`origin\` header from a forwarded action request. Aborting the action.`):new Error("`x-forwarded-host` or `host` headers are not provided. One of these is needed to compare the `origin` header from a forwarded action request. Aborting the action.")}function Ht(e,t){const r=e.split("."),a=t.split(".");if(a.length<1||r.length<a.length||a.length===1&&(a[0]==="*"||a[0]==="**"))return!1;for(;a.length;){const n=a.pop(),o=r.pop();switch(n){case"":return!1;case"*":{if(o)continue;return!1}case"**":return a.length>0?!1:o!==void 0;case void 0:default:if(o!==n)return!1}}return r.length===0}function Ft(e,t=[]){return t.some(r=>r&&(r===e||Ht(e,r)))}function Pt(e){let r=e.get("x-forwarded-host")?.split(",")[0]?.trim(),a=e.get("host");return r?{type:"x-forwarded-host",value:r}:a?{type:"host",value:a}:void 0}var Ie=new Set([...dt,304]);async function Nt(e,t,r,a,n,o,d){try{Le(a.headers,Array.isArray(e.allowedActionOrigins)?e.allowedActionOrigins:[]);let l=new Request(n,{method:a.method,body:a.body,headers:a.headers,signal:a.signal,...a.body?{duplex:"half"}:void 0}),h=await r.query(l,{requestContext:o,skipLoaderErrorBubbling:!0,skipRevalidation:!0,generateMiddlewareResponse:e.future.v8_middleware?async p=>{try{let w=await p(l);return u(w)}catch(w){return s(w)}}:void 0});return u(h)}catch(l){return s(l)}function u(l){return U(l)?l:i(l)}function s(l){return d(l),B(a,e,t,{result:{error:l},headers:new Headers,status:500})}function i(l){let h=ne(l,e);if(re(l.statusCode)&&h.has("Location"))return new Response(null,{status:l.statusCode,headers:h});l.errors&&(Object.values(l.errors).forEach(w=>{(!P(w)||w.error)&&d(w)}),l.errors=z(l.errors,t));let p;return l.errors?p={error:Object.values(l.errors)[0]}:p={data:Object.values(l.actionData||{})[0]},B(a,e,t,{result:p,headers:h,status:l.statusCode})}}async function Ut(e,t,r,a,n,o,d){let u=new URL(a.url).searchParams.get("_routes"),s=u?new Set(u.split(",")):null;try{let p=new Request(n,{headers:a.headers,signal:a.signal}),w=await r.query(p,{requestContext:o,filterMatchesToLoad:y=>!s||s.has(y.route.id),skipLoaderErrorBubbling:!0,generateMiddlewareResponse:e.future.v8_middleware?async y=>{try{let g=await y(p);return i(g)}catch(g){return l(g)}}:void 0});return i(w)}catch(p){return l(p)}function i(p){return U(p)?p:h(p)}function l(p){return d(p),B(a,e,t,{result:{error:p},headers:new Headers,status:500})}function h(p){let w=ne(p,e);if(re(p.statusCode)&&w.has("Location"))return new Response(null,{status:p.statusCode,headers:w});p.errors&&(Object.values(p.errors).forEach(f=>{(!P(f)||f.error)&&d(f)}),p.errors=z(p.errors,t));let y={},g=new Set(p.matches.filter(f=>s?s.has(f.route.id):f.route.loader!=null).map(f=>f.route.id));if(p.errors)for(let[f,v]of Object.entries(p.errors))y[f]={error:v};for(let[f,v]of Object.entries(p.loaderData))!(f in y)&&g.has(f)&&(y[f]={data:v});return B(a,e,t,{result:y,headers:w,status:p.statusCode})}}function B(e,t,r,{result:a,headers:n,status:o}){let d=new Headers(n);return d.set("X-Remix-Response","yes"),Ie.has(o)?new Response(null,{status:o,headers:d}):(d.set("Content-Type","text/x-script"),d.delete("Content-Length"),new Response(Y(a,e.signal,t.entry.module.streamTimeout,r),{status:o||200,headers:d}))}function ye(e,t,r,a){let n=Ot(e.status,e.headers,r.basename),o=new Headers(e.headers);return o.delete("Location"),o.set("Content-Type","text/x-script"),B(t,r,a,{result:t.method==="GET"?{[I]:n}:n,headers:o,status:xe})}function Ot(e,t,r){let a=t.get("Location");return r&&(a=$(a,r)||a),{redirect:a,status:e,revalidate:t.has("X-Remix-Revalidate")||t.has("Set-Cookie"),reload:t.has("X-Remix-Reload-Document"),replace:t.has("X-Remix-Replace")}}function Y(e,t,r,a){let n=new AbortController,o=setTimeout(()=>n.abort(new Error("Server Timeout")),typeof r=="number"?r:4950);return t.addEventListener("abort",()=>clearTimeout(o)),ct(e,{signal:n.signal,plugins:[d=>{if(d instanceof Error){let{name:u,message:s,stack:i}=a==="production"?V(d,a):d;return["SanitizedError",u,s,i]}if(d instanceof L){let{data:u,status:s,statusText:i}=d;return["ErrorResponse",u,s,i]}if(d&&typeof d=="object"&&I in d)return["SingleFetchRedirect",d[I]]}],postPlugins:[d=>{if(d&&typeof d=="object")return["SingleFetchClassInstance",Object.fromEntries(Object.entries(d))]},()=>["SingleFetchFallback"]]})}function we(e,t){let r=Ue(e.routes),a=Oe(e.routes,e.future),n=kt(t)?t:"production",o=Qe(a,{basename:e.basename,unstable_instrumentations:e.entry.module.unstable_instrumentations}),d=e.entry.module.handleError||((s,{request:i})=>{n!=="test"&&!i.signal.aborted&&console.error(P(s)&&s.error?s.error:s)}),u=async(s,i)=>{let l={},h,p=R=>{t==="development"&&W()?.processRequestError?.(R),d(R,{context:h,params:l,request:s})};if(e.future.v8_middleware){if(i&&!(i instanceof K)){let R=new Error("Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function.");return p(R),q(R,n)}h=i||new K}else h=i||{};let w=new URL(s.url),y=e.basename||"/",g=w.pathname;e.future.unstable_trailingSlashAwareDataRequests?g.endsWith("/_.data")?g=g.replace(/_.data$/,""):g=g.replace(/\.data$/,""):($(g,y)==="/_root.data"?g=y:g.endsWith(".data")&&(g=g.replace(/\.data$/,"")),$(g,y)!=="/"&&g.endsWith("/")&&(g=g.slice(0,-1)));let f=Pe(s,"X-React-Router-SPA-Mode")==="yes";if(!e.ssr){let R=decodeURI(g);if(y!=="/"){let S=$(R,y);if(S==null)return d(new L(404,"Not Found",`Refusing to prerender the \`${R}\` path because it does not start with the basename \`${y}\``),{context:h,params:l,request:s}),new Response("Not Found",{status:404,statusText:"Not Found"});R=S}if(e.prerender.length===0)f=!0;else if(!e.prerender.includes(R)&&!e.prerender.includes(R+"/")){if(w.pathname.endsWith(".data"))return d(new L(404,"Not Found",`Refusing to SSR the path \`${R}\` because \`ssr:false\` is set and the path is not included in the \`prerender\` config, so in production the path will be a 404.`),{context:h,params:l,request:s}),new Response("Not Found",{status:404,statusText:"Not Found"});f=!0}}let v=it(e.routeDiscovery.manifestPath,y);if(w.pathname===v)try{return await Lt(e,r,w)}catch(R){return p(R),new Response("Unknown Server Error",{status:500})}let m=G(r,g,e.basename);m&&m.length>0&&Object.assign(l,m[0].params);let c;if(w.pathname.endsWith(".data")){let R=new URL(s.url);R.pathname=g;let S=G(r,R.pathname,e.basename);c=await It(n,e,o,s,R,h,p),ie(c)&&(c=ye(c,s,e,n)),e.entry.module.handleDataRequest&&(c=await e.entry.module.handleDataRequest(c,{context:h,params:S?S[0].params:{},request:s}),ie(c)&&(c=ye(c,s,e,n)))}else if(!f&&m&&m[m.length-1].route.module.default==null&&m[m.length-1].route.module.ErrorBoundary==null)c=await Mt(n,e,o,m.slice(-1)[0].route.id,s,h,p);else{let{pathname:R}=w,S;e.unstable_getCriticalCss?S=await e.unstable_getCriticalCss({pathname:R}):t==="development"&&W()?.getCriticalCss&&(S=await W()?.getCriticalCss?.(R)),c=await Bt(n,e,o,s,h,p,f,S)}return s.method==="HEAD"?new Response(null,{headers:c.headers,status:c.status,statusText:c.statusText}):c};return e.entry.module.unstable_instrumentations&&(u=Ge(u,e.entry.module.unstable_instrumentations.map(s=>s.handler).filter(Boolean))),{routes:r,dataRoutes:a,serverMode:n,staticHandler:o,errorHandler:d,requestHandler:u}}var sr=(e,t)=>{let r,a,n,o,d,u;return async function(i,l){if(r=typeof e=="function"?await e():e,typeof e=="function"){let h=we(r,t);a=h.routes,n=h.serverMode,o=h.staticHandler,d=h.errorHandler,u=h.requestHandler}else if(!a||!n||!o||!d||!u){let h=we(r,t);a=h.routes,n=h.serverMode,o=h.staticHandler,d=h.errorHandler,u=h.requestHandler}return u(i,l)}};async function Lt(e,t,r){if(e.assets.version!==r.searchParams.get("version"))return new Response(null,{status:204,headers:{"X-Remix-Reload-Document":"true"}});let a={};if(r.searchParams.has("paths")){let n=new Set;(r.searchParams.get("paths")||"").split(",").filter(Boolean).forEach(u=>{u.startsWith("/")||(u=`/${u}`);let s=u.split("/").slice(1);s.forEach((i,l)=>{let h=s.slice(0,l+1).join("/");n.add(`/${h}`)})});for(let u of n){let s=G(t,u,e.basename);if(s)for(let i of s){let l=i.route.id,h=e.assets.routes[l];h&&(a[l]=h)}}return Response.json(a,{headers:{"Cache-Control":"public, max-age=31536000, immutable"}})}return new Response("Invalid Request",{status:400})}async function It(e,t,r,a,n,o,d){return a.method!=="GET"?await Nt(t,e,r,a,n,o,d):await Ut(t,e,r,a,n,o,d)}async function Bt(e,t,r,a,n,o,d,u){try{a.method==="POST"&&Le(a.headers,Array.isArray(t.allowedActionOrigins)?t.allowedActionOrigins:[]);let i=await r.query(a,{requestContext:n,generateMiddlewareResponse:t.future.v8_middleware?async l=>{try{let h=await l(a);return U(h)||(h=await s(h,d)),h}catch(h){return o(h),new Response(null,{status:500})}}:void 0});return U(i)||(i=await s(i,d)),i}catch(i){return o(i),new Response(null,{status:500})}async function s(i,l){let h=ne(i,t);if(Ie.has(i.statusCode))return new Response(null,{status:i.statusCode,headers:h});i.errors&&(Object.values(i.errors).forEach(f=>{(!P(f)||f.error)&&o(f)}),i.errors=z(i.errors,e));let p={loaderData:i.loaderData,actionData:i.actionData,errors:he(i.errors,e)},w={basename:t.basename,future:t.future,routeDiscovery:t.routeDiscovery,ssr:t.ssr,isSpaMode:l},y={manifest:t.assets,routeModules:xt(t.routes),staticHandlerContext:i,criticalCss:u,serverHandoffString:me({...w,criticalCss:u}),serverHandoffStream:Y(p,a.signal,t.entry.module.streamTimeout,e),renderMeta:{},future:t.future,ssr:t.ssr,routeDiscovery:t.routeDiscovery,isSpaMode:l,serializeError:f=>He(f,e)},g=t.entry.module.default;try{return await g(a,i.statusCode,h,y,n)}catch(f){o(f);let v=f;if(U(f))try{let c=await jt(f);v=new L(f.status,f.statusText,c)}catch{}i=ut(r.dataRoutes,i,v),i.errors&&(i.errors=z(i.errors,e));let m={loaderData:i.loaderData,actionData:i.actionData,errors:he(i.errors,e)};y={...y,staticHandlerContext:i,serverHandoffString:me(w),serverHandoffStream:Y(m,a.signal,t.entry.module.streamTimeout,e),renderMeta:{}};try{return await g(a,i.statusCode,h,y,n)}catch(c){return o(c),q(c,e)}}}}async function Mt(e,t,r,a,n,o,d){try{let i=await r.queryRoute(n,{routeId:a,requestContext:o,generateMiddlewareResponse:t.future.v8_middleware?async l=>{try{let h=await l(n);return u(h)}catch(h){return s(h)}}:void 0});return u(i)}catch(i){return s(i)}function u(i){return U(i)?i:typeof i=="string"?new Response(i):Response.json(i)}function s(i){if(U(i))return i;if(P(i))return d(i),$t(i,e);if(i instanceof Error&&i.message==="Expected a response from queryRoute"){let l=new Error("Expected a Response to be returned from resource route handler");return d(l),q(l,e)}return d(i),q(i,e)}}function $t(e,t){return Response.json(He(e.error||new Error("Unexpected Server Error"),t),{status:e.status,statusText:e.statusText})}function q(e,t){let r="Unexpected Server Error";return t!=="production"&&(r+=`
2
2
 
3
3
  ${String(e)}`),new Response(r,{status:500,headers:{"Content-Type":"text/plain"}})}function jt(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}function X(e){return`__flash_${e}__`}var Be=(e={},t="")=>{let r=new Map(Object.entries(e));return{get id(){return t},get data(){return Object.fromEntries(r)},has(a){return r.has(a)||r.has(X(a))},get(a){if(r.has(a))return r.get(a);let n=X(a);if(r.has(n)){let o=r.get(n);return r.delete(n),o}},set(a,n){r.set(a,n)},flash(a,n){r.set(X(a),n)},unset(a){r.delete(a)}}},or=e=>e!=null&&typeof e.id=="string"&&typeof e.data<"u"&&typeof e.has=="function"&&typeof e.get=="function"&&typeof e.set=="function"&&typeof e.flash=="function"&&typeof e.unset=="function";function zt({cookie:e,createData:t,readData:r,updateData:a,deleteData:n}){let o=Te(e)?e:De(e?.name||"__session",e);return Me(o),{async getSession(d,u){let s=d&&await o.parse(d,u),i=s&&await r(s);return Be(i||{},s||"")},async commitSession(d,u){let{id:s,data:i}=d,l=u?.maxAge!=null?new Date(Date.now()+u.maxAge*1e3):u?.expires!=null?u.expires:o.expires;return s?await a(s,i,l):s=await t(i,l),o.serialize(s,u)},async destroySession(d,u){return await n(d.id),o.serialize("",{...u,maxAge:void 0,expires:new Date(0)})}}}function Me(e){_e(e.isSigned,`The "${e.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.`)}function ir({cookie:e}={}){let t=Te(e)?e:De(e?.name||"__session",e);return Me(t),{async getSession(r,a){return Be(r&&await t.parse(r,a)||{})},async commitSession(r,a){let n=await t.serialize(r.data,a);if(n.length>4096)throw new Error("Cookie length will exceed browser maximum. Length: "+n.length);return n},async destroySession(r,a){return t.serialize("",{...a,maxAge:void 0,expires:new Date(0)})}}}function lr({cookie:e}={}){let t=new Map;return zt({cookie:e,async createData(r,a){let n=Math.random().toString(36).substring(2,10);return t.set(n,{data:r,expires:a}),n},async readData(r){if(t.has(r)){let{data:a,expires:n}=t.get(r);if(!n||n>new Date)return a;n&&t.delete(r)}return null},async updateData(r,a,n){t.set(r,{data:a,expires:n})},async deleteData(r){t.delete(r)}})}function ur(e,...t){let r=t[0],a=qt(e).replace(/\/:([\w-]+)(\?)?/g,(n,o,d)=>{const u=d===void 0,s=r?.[o];if(u&&s===void 0)throw new Error(`Path '${e}' requires param '${o}' but it was not provided`);return s===void 0?"":"/"+s});if(e.endsWith("*")){const n=r?.["*"];n!==void 0&&(a+="/"+n)}return a||"/"}function qt(e){let t=e.length-1,r=e[t];if(r!=="*"&&r!=="/")return e;for(t--;t>=0&&e[t]==="/";t--);return e.slice(0,t+1)}var Z=new TextEncoder,ge="</body></html>";function Re(e){let t=new TextDecoder,r,a=new Promise(s=>r=s),n=!1,o=[],d=null;function u(s){for(let i of o){let l=t.decode(i,{stream:!0});l.endsWith(ge)&&(l=l.slice(0,-ge.length)),s.enqueue(Z.encode(l))}o.length=0,d=null}return new TransformStream({transform(s,i){o.push(s),!d&&(d=setTimeout(async()=>{u(i),n||(n=!0,Vt(e,i).catch(l=>i.error(l)).then(r))},0))},async flush(s){await a,d&&(clearTimeout(d),u(s)),s.enqueue(Z.encode("</body></html>"))}})}async function Vt(e,t){let r=new TextDecoder("utf-8",{fatal:!0});const a=e.getReader();try{let o;for(;(o=await a.read())&&!o.done;){const d=o.value;try{J(JSON.stringify(r.decode(d,{stream:!0})),t)}catch{let s=JSON.stringify(btoa(String.fromCodePoint(...d)));J(`Uint8Array.from(atob(${s}), m => m.codePointAt(0))`,t)}}}finally{a.releaseLock()}let n=r.decode();n.length&&J(JSON.stringify(n),t)}function J(e,t){t.enqueue(Z.encode(`<script>${Wt(`(self.__FLIGHT_DATA||=[]).push(${e})`)}<\/script>`))}function Wt(e){return e.replace(/<!--/g,"<\\!--").replace(/<\/(script)/gi,"</\\$1")}var Xt=class extends A.Component{constructor(e){super(e),this.state={error:null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:null,location:e.location}:{error:t.error,location:t.location}}render(){return this.state.error?A.createElement($e,{error:this.state.error,renderAppShell:!0}):this.props.children}};function Se({renderAppShell:e,title:t,children:r}){return e?A.createElement("html",{lang:"en"},A.createElement("head",null,A.createElement("meta",{charSet:"utf-8"}),A.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),A.createElement("title",null,t)),A.createElement("body",null,A.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},r))):r}function $e({error:e,renderAppShell:t}){console.error(e);let r=A.createElement("script",{dangerouslySetInnerHTML:{__html:`
4
4
  console.log(
@@ -1,4 +1,4 @@
1
- import{N as Ue,O as je,P as J,Q as ae,i as Ae,S as H,y as le,g as U,U as Nt,V as kt,W as xt,X as Pt,Y as Mt,Z as Rt,$ as Ft,a0 as Lt,a1 as Dt,a2 as Bt,h as Ut,a3 as jt,a4 as Vt,a5 as zt,b as Gt,a6 as Zt,a7 as $t,a8 as Ht,a9 as Wt,aa as Jt,r as Xt,ab as Yt,a as $e,ac as Kt,ad as He,ae as qt,af as Qt,ag as ea,ah as Se,ai as ta,aj as aa,ak as sa,q as We,al as re,e as oe,am as Je,an as Xe,x as ce,L as na,C as ye,ao as Ve,w as ra,R as ze,z as X,t as ia,ap as Ie,E as oa,M as Ye,aq as ca,ar as ua,as as la,B as Ke,at as ie,k as G,au as qe,av as ha,aw as Qe,ax as pa,l as ga,m as ma,ay as fa,az as da,aA as ba,aB as ya,aC as _a,aD as Ta,aE as va,aF as Ea,D as Ge,aG as wa,G as Ca,aH as Aa,o as et,s as tt,aI as Sa,aJ as ve,u as Ia}from"./index-CzON1LlU.js";import{bl as Oa}from"./index-BAVnedrl.js";function at(e,a,n,r,i){if(a!==e){typeof a.toJSON=="function"&&(a=a.toJSON());for(var c=Ue(a),h=Ue(e),l=!1,b=h.length-1;b>=0;b--){var f=h[b],T=e[f];if(je(a,f)&&!(a[f]===void 0&&T!==void 0&&Array.isArray(a)===!1)){var _=a[f];typeof T=="object"&&T!=null&&typeof _=="object"&&_!=null&&Array.isArray(T)===Array.isArray(_)?at(T,_,n,r+"/"+J(f),i):T!==_&&(i&&n.push({op:"test",path:r+"/"+J(f),value:ae(T)}),n.push({op:"replace",path:r+"/"+J(f),value:ae(_)}))}else Array.isArray(e)===Array.isArray(a)?(i&&n.push({op:"test",path:r+"/"+J(f),value:ae(T)}),n.push({op:"remove",path:r+"/"+J(f)}),l=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:a}))}if(!(!l&&c.length==h.length))for(var b=0;b<c.length;b++){var f=c[b];!je(e,f)&&a[f]!==void 0&&n.push({op:"add",path:r+"/"+J(f),value:ae(a[f])})}}}function Oe(e,a,n=!1){var r=[];return at(e,a,r,"",n),r}function st(e){return e!==void 0&&Array.isArray(e.lc_namespace)}function nt(e){return e!==void 0&&H.isRunnable(e)&&"lc_name"in e.constructor&&typeof e.constructor.lc_name=="function"&&e.constructor.lc_name()==="RunnableToolLike"}function rt(e){return!!e&&typeof e=="object"&&"name"in e&&"schema"in e&&(Ae(e.schema)||e.schema!=null&&typeof e.schema=="object"&&"type"in e.schema&&typeof e.schema.type=="string"&&["null","boolean","object","array","number","string"].includes(e.schema.type))}function it(e){return rt(e)||nt(e)||st(e)}var Na={};U(Na,{convertToOpenAIFunction:()=>ot,convertToOpenAITool:()=>ka,isLangChainTool:()=>it,isRunnableToolLike:()=>nt,isStructuredTool:()=>st,isStructuredToolParams:()=>rt});function ot(e,a){const n=typeof a=="number"?void 0:a;return{name:e.name,description:e.description,parameters:le(e.schema),...n?.strict!==void 0?{strict:n.strict}:{}}}function ka(e,a){const n=typeof a=="number"?void 0:a;let r;return it(e)?r={type:"function",function:ot(e)}:r=e,n?.strict!==void 0&&(r.function.strict=n.strict),r}var xa={};U(xa,{extendInteropZodObject:()=>ea,getInteropZodDefaultGetter:()=>Qt,getInteropZodObjectShape:()=>qt,getSchemaDescription:()=>He,interopParse:()=>Kt,interopParseAsync:()=>$e,interopSafeParse:()=>Yt,interopSafeParseAsync:()=>Xt,interopZodObjectMakeFieldsOptional:()=>Jt,interopZodObjectPartial:()=>Wt,interopZodObjectPassthrough:()=>Ht,interopZodObjectStrict:()=>$t,interopZodTransformInputSchema:()=>Zt,isInteropZodError:()=>Gt,isInteropZodLiteral:()=>zt,isInteropZodObject:()=>Vt,isInteropZodSchema:()=>Ae,isShapelessZodSchema:()=>jt,isSimpleStringZodSchema:()=>Ut,isZodArrayV4:()=>Bt,isZodLiteralV3:()=>Dt,isZodLiteralV4:()=>Lt,isZodNullableV4:()=>Ft,isZodObjectV3:()=>Rt,isZodObjectV4:()=>Mt,isZodOptionalV4:()=>Pt,isZodSchema:()=>xt,isZodSchemaV3:()=>kt,isZodSchemaV4:()=>Nt});var Pa={};U(Pa,{BasePromptValue:()=>he,ChatPromptValue:()=>ut,ImagePromptValue:()=>Ma,StringPromptValue:()=>ct});var he=class extends aa{},ct=class extends he{static lc_name(){return"StringPromptValue"}lc_namespace=["langchain_core","prompt_values"];lc_serializable=!0;value;constructor(e){super({value:e}),this.value=e}toString(){return this.value}toChatMessages(){return[new Se(this.value)]}},ut=class extends he{lc_namespace=["langchain_core","prompt_values"];lc_serializable=!0;static lc_name(){return"ChatPromptValue"}messages;constructor(e){Array.isArray(e)&&(e={messages:e}),super(e),this.messages=e.messages}toString(){return ta(this.messages)}toChatMessages(){return this.messages}},Ma=class extends he{lc_namespace=["langchain_core","prompt_values"];lc_serializable=!0;static lc_name(){return"ImagePromptValue"}imageUrl;value;constructor(e){"imageUrl"in e||(e={imageUrl:e}),super(e),this.imageUrl=e.imageUrl}toString(){return this.imageUrl.url}toChatMessages(){return[new Se({content:[{type:"image_url",image_url:{detail:this.imageUrl.detail,url:this.imageUrl.url}}]})]}},y="0123456789abcdef".split(""),Ra=[-2147483648,8388608,32768,128],D=[24,16,8,0],se=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],M=[];function B(e,a){a?(M[0]=M[16]=M[1]=M[2]=M[3]=M[4]=M[5]=M[6]=M[7]=M[8]=M[9]=M[10]=M[11]=M[12]=M[13]=M[14]=M[15]=0,this.blocks=M):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}B.prototype.update=function(e){if(!this.finalized){var a,n=typeof e;if(n!=="string"){if(n==="object"){if(e===null)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR)}else throw new Error(ERROR);a=!0}for(var r,i=0,c,h=e.length,l=this.blocks;i<h;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,this.block=l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),a)for(c=this.start;i<h&&c<64;++i)l[c>>>2]|=e[i]<<D[c++&3];else for(c=this.start;i<h&&c<64;++i)r=e.charCodeAt(i),r<128?l[c>>>2]|=r<<D[c++&3]:r<2048?(l[c>>>2]|=(192|r>>>6)<<D[c++&3],l[c>>>2]|=(128|r&63)<<D[c++&3]):r<55296||r>=57344?(l[c>>>2]|=(224|r>>>12)<<D[c++&3],l[c>>>2]|=(128|r>>>6&63)<<D[c++&3],l[c>>>2]|=(128|r&63)<<D[c++&3]):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),l[c>>>2]|=(240|r>>>18)<<D[c++&3],l[c>>>2]|=(128|r>>>12&63)<<D[c++&3],l[c>>>2]|=(128|r>>>6&63)<<D[c++&3],l[c>>>2]|=(128|r&63)<<D[c++&3]);this.lastByteIndex=c,this.bytes+=c-this.start,c>=64?(this.block=l[16],this.start=c-64,this.hash(),this.hashed=!0):this.start=c}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}};B.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,a=this.lastByteIndex;e[16]=this.block,e[a>>>2]|=Ra[a&3],this.block=e[16],a>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}};B.prototype.hash=function(){var e=this.h0,a=this.h1,n=this.h2,r=this.h3,i=this.h4,c=this.h5,h=this.h6,l=this.h7,b=this.blocks,f,T,_,E,g,d,m,v,w,A,C;for(f=16;f<64;++f)g=b[f-15],T=(g>>>7|g<<25)^(g>>>18|g<<14)^g>>>3,g=b[f-2],_=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,b[f]=b[f-16]+T+b[f-7]+_<<0;for(C=a&n,f=0;f<64;f+=4)this.first?(this.is224?(v=300032,g=b[0]-1413257819,l=g-150054599<<0,r=g+24177077<<0):(v=704751109,g=b[0]-210244248,l=g-1521486534<<0,r=g+143694565<<0),this.first=!1):(T=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),_=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),v=e&a,E=v^e&n^C,m=i&c^~i&h,g=l+_+m+se[f]+b[f],d=T+E,l=r+g<<0,r=g+d<<0),T=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),_=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),w=r&e,E=w^r&a^v,m=h&l^~h&i,g=c+_+m+se[f+1]+b[f+1],d=T+E,h=n+g<<0,n=g+d<<0,T=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),_=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),A=n&r,E=A^n&e^w,m=c&h^~c&l,g=i+_+m+se[f+2]+b[f+2],d=T+E,c=a+g<<0,a=g+d<<0,T=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),_=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),C=a&n,E=C^a&r^A,m=c&h^~c&l,g=i+_+m+se[f+3]+b[f+3],d=T+E,i=e+g<<0,e=g+d<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+e<<0,this.h1=this.h1+a<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0,this.h4=this.h4+i<<0,this.h5=this.h5+c<<0,this.h6=this.h6+h<<0,this.h7=this.h7+l<<0};B.prototype.hex=function(){this.finalize();var e=this.h0,a=this.h1,n=this.h2,r=this.h3,i=this.h4,c=this.h5,h=this.h6,l=this.h7,b=y[e>>>28&15]+y[e>>>24&15]+y[e>>>20&15]+y[e>>>16&15]+y[e>>>12&15]+y[e>>>8&15]+y[e>>>4&15]+y[e&15]+y[a>>>28&15]+y[a>>>24&15]+y[a>>>20&15]+y[a>>>16&15]+y[a>>>12&15]+y[a>>>8&15]+y[a>>>4&15]+y[a&15]+y[n>>>28&15]+y[n>>>24&15]+y[n>>>20&15]+y[n>>>16&15]+y[n>>>12&15]+y[n>>>8&15]+y[n>>>4&15]+y[n&15]+y[r>>>28&15]+y[r>>>24&15]+y[r>>>20&15]+y[r>>>16&15]+y[r>>>12&15]+y[r>>>8&15]+y[r>>>4&15]+y[r&15]+y[i>>>28&15]+y[i>>>24&15]+y[i>>>20&15]+y[i>>>16&15]+y[i>>>12&15]+y[i>>>8&15]+y[i>>>4&15]+y[i&15]+y[c>>>28&15]+y[c>>>24&15]+y[c>>>20&15]+y[c>>>16&15]+y[c>>>12&15]+y[c>>>8&15]+y[c>>>4&15]+y[c&15]+y[h>>>28&15]+y[h>>>24&15]+y[h>>>20&15]+y[h>>>16&15]+y[h>>>12&15]+y[h>>>8&15]+y[h>>>4&15]+y[h&15];return this.is224||(b+=y[l>>>28&15]+y[l>>>24&15]+y[l>>>20&15]+y[l>>>16&15]+y[l>>>12&15]+y[l>>>8&15]+y[l>>>4&15]+y[l&15]),b};B.prototype.toString=B.prototype.hex;B.prototype.digest=function(){this.finalize();var e=this.h0,a=this.h1,n=this.h2,r=this.h3,i=this.h4,c=this.h5,h=this.h6,l=this.h7,b=[e>>>24&255,e>>>16&255,e>>>8&255,e&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255];return this.is224||b.push(l>>>24&255,l>>>16&255,l>>>8&255,l&255),b};B.prototype.array=B.prototype.digest;B.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),a=new DataView(e);return a.setUint32(0,this.h0),a.setUint32(4,this.h1),a.setUint32(8,this.h2),a.setUint32(12,this.h3),a.setUint32(16,this.h4),a.setUint32(20,this.h5),a.setUint32(24,this.h6),this.is224||a.setUint32(28,this.h7),e};const lt=(...e)=>new B(!1,!0).update(e.join("")).hex();var Fa={};U(Fa,{sha256:()=>lt});var La={};U(La,{BaseCache:()=>pt,InMemoryCache:()=>gt,defaultHashKeyEncoder:()=>ht,deserializeStoredGeneration:()=>Da,serializeGeneration:()=>Ba});const ht=(...e)=>lt(e.join("_"));function Da(e){return e.message!==void 0?{text:e.text,message:sa(e.message)}:{text:e.text}}function Ba(e){const a={text:e.text};return e.message!==void 0&&(a.message=e.message.toDict()),a}var pt=class{keyEncoder=ht;makeDefaultKeyEncoder(e){this.keyEncoder=e}};const Ua=new Map;var gt=class mt extends pt{cache;constructor(a){super(),this.cache=a??new Map}lookup(a,n){return Promise.resolve(this.cache.get(this.keyEncoder(a,n))??null)}async update(a,n,r){this.cache.set(this.keyEncoder(a,n),r)}static global(){return new mt(Ua)}},q={},Ze;function ja(){if(Ze)return q;Ze=1,q.byteLength=l,q.toByteArray=f,q.fromByteArray=E;for(var e=[],a=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,c=r.length;i<c;++i)e[i]=r[i],a[r.charCodeAt(i)]=i;a[45]=62,a[95]=63;function h(g){var d=g.length;if(d%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var m=g.indexOf("=");m===-1&&(m=d);var v=m===d?0:4-m%4;return[m,v]}function l(g){var d=h(g),m=d[0],v=d[1];return(m+v)*3/4-v}function b(g,d,m){return(d+m)*3/4-m}function f(g){var d,m=h(g),v=m[0],w=m[1],A=new n(b(g,v,w)),C=0,P=w>0?v-4:v,O;for(O=0;O<P;O+=4)d=a[g.charCodeAt(O)]<<18|a[g.charCodeAt(O+1)]<<12|a[g.charCodeAt(O+2)]<<6|a[g.charCodeAt(O+3)],A[C++]=d>>16&255,A[C++]=d>>8&255,A[C++]=d&255;return w===2&&(d=a[g.charCodeAt(O)]<<2|a[g.charCodeAt(O+1)]>>4,A[C++]=d&255),w===1&&(d=a[g.charCodeAt(O)]<<10|a[g.charCodeAt(O+1)]<<4|a[g.charCodeAt(O+2)]>>2,A[C++]=d>>8&255,A[C++]=d&255),A}function T(g){return e[g>>18&63]+e[g>>12&63]+e[g>>6&63]+e[g&63]}function _(g,d,m){for(var v,w=[],A=d;A<m;A+=3)v=(g[A]<<16&16711680)+(g[A+1]<<8&65280)+(g[A+2]&255),w.push(T(v));return w.join("")}function E(g){for(var d,m=g.length,v=m%3,w=[],A=16383,C=0,P=m-v;C<P;C+=A)w.push(_(g,C,C+A>P?P:C+A));return v===1?(d=g[m-1],w.push(e[d>>2]+e[d<<4&63]+"==")):v===2&&(d=(g[m-2]<<8)+g[m-1],w.push(e[d>>10]+e[d>>4&63]+e[d<<2&63]+"=")),w.join("")}return q}var Va=ja();const za=Oa(Va);var Ga=Object.defineProperty,Za=(e,a,n)=>a in e?Ga(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,$a=(e,a,n)=>(Za(e,a+"",n),n);function Ha(e,a){let n=Array.from({length:e.length},(r,i)=>({start:i,end:i+1}));for(;n.length>1;){let r=null;for(let i=0;i<n.length-1;i++){const c=e.slice(n[i].start,n[i+1].end),h=a.get(c.join(","));h!=null&&(r==null||h<r[0])&&(r=[h,i])}if(r!=null){const i=r[1];n[i]={start:n[i].start,end:n[i+1].end},n.splice(i+1,1)}else break}return n}function Wa(e,a){return e.length===1?[a.get(e.join(","))]:Ha(e,a).map(n=>a.get(e.slice(n.start,n.end).join(","))).filter(n=>n!=null)}function Ja(e){return e.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}var Ee=class{specialTokens;inverseSpecialTokens;patStr;textEncoder=new TextEncoder;textDecoder=new TextDecoder("utf-8");rankMap=new Map;textMap=new Map;constructor(e,a){this.patStr=e.pat_str;const n=e.bpe_ranks.split(`
1
+ import{N as Ue,O as je,P as J,Q as ae,i as Ae,S as H,y as le,g as U,U as Nt,V as kt,W as xt,X as Pt,Y as Mt,Z as Rt,$ as Ft,a0 as Lt,a1 as Dt,a2 as Bt,h as Ut,a3 as jt,a4 as Vt,a5 as zt,b as Gt,a6 as Zt,a7 as $t,a8 as Ht,a9 as Wt,aa as Jt,r as Xt,ab as Yt,a as $e,ac as Kt,ad as He,ae as qt,af as Qt,ag as ea,ah as Se,ai as ta,aj as aa,ak as sa,q as We,al as re,e as oe,am as Je,an as Xe,x as ce,L as na,C as ye,ao as Ve,w as ra,R as ze,z as X,t as ia,ap as Ie,E as oa,M as Ye,aq as ca,ar as ua,as as la,B as Ke,at as ie,k as G,au as qe,av as ha,aw as Qe,ax as pa,l as ga,m as ma,ay as fa,az as da,aA as ba,aB as ya,aC as _a,aD as Ta,aE as va,aF as Ea,D as Ge,aG as wa,G as Ca,aH as Aa,o as et,s as tt,aI as Sa,aJ as ve,u as Ia}from"./index-D7mhOTIc.js";import{bl as Oa}from"./index-DjkfvIWz.js";function at(e,a,n,r,i){if(a!==e){typeof a.toJSON=="function"&&(a=a.toJSON());for(var c=Ue(a),h=Ue(e),l=!1,b=h.length-1;b>=0;b--){var f=h[b],T=e[f];if(je(a,f)&&!(a[f]===void 0&&T!==void 0&&Array.isArray(a)===!1)){var _=a[f];typeof T=="object"&&T!=null&&typeof _=="object"&&_!=null&&Array.isArray(T)===Array.isArray(_)?at(T,_,n,r+"/"+J(f),i):T!==_&&(i&&n.push({op:"test",path:r+"/"+J(f),value:ae(T)}),n.push({op:"replace",path:r+"/"+J(f),value:ae(_)}))}else Array.isArray(e)===Array.isArray(a)?(i&&n.push({op:"test",path:r+"/"+J(f),value:ae(T)}),n.push({op:"remove",path:r+"/"+J(f)}),l=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:a}))}if(!(!l&&c.length==h.length))for(var b=0;b<c.length;b++){var f=c[b];!je(e,f)&&a[f]!==void 0&&n.push({op:"add",path:r+"/"+J(f),value:ae(a[f])})}}}function Oe(e,a,n=!1){var r=[];return at(e,a,r,"",n),r}function st(e){return e!==void 0&&Array.isArray(e.lc_namespace)}function nt(e){return e!==void 0&&H.isRunnable(e)&&"lc_name"in e.constructor&&typeof e.constructor.lc_name=="function"&&e.constructor.lc_name()==="RunnableToolLike"}function rt(e){return!!e&&typeof e=="object"&&"name"in e&&"schema"in e&&(Ae(e.schema)||e.schema!=null&&typeof e.schema=="object"&&"type"in e.schema&&typeof e.schema.type=="string"&&["null","boolean","object","array","number","string"].includes(e.schema.type))}function it(e){return rt(e)||nt(e)||st(e)}var Na={};U(Na,{convertToOpenAIFunction:()=>ot,convertToOpenAITool:()=>ka,isLangChainTool:()=>it,isRunnableToolLike:()=>nt,isStructuredTool:()=>st,isStructuredToolParams:()=>rt});function ot(e,a){const n=typeof a=="number"?void 0:a;return{name:e.name,description:e.description,parameters:le(e.schema),...n?.strict!==void 0?{strict:n.strict}:{}}}function ka(e,a){const n=typeof a=="number"?void 0:a;let r;return it(e)?r={type:"function",function:ot(e)}:r=e,n?.strict!==void 0&&(r.function.strict=n.strict),r}var xa={};U(xa,{extendInteropZodObject:()=>ea,getInteropZodDefaultGetter:()=>Qt,getInteropZodObjectShape:()=>qt,getSchemaDescription:()=>He,interopParse:()=>Kt,interopParseAsync:()=>$e,interopSafeParse:()=>Yt,interopSafeParseAsync:()=>Xt,interopZodObjectMakeFieldsOptional:()=>Jt,interopZodObjectPartial:()=>Wt,interopZodObjectPassthrough:()=>Ht,interopZodObjectStrict:()=>$t,interopZodTransformInputSchema:()=>Zt,isInteropZodError:()=>Gt,isInteropZodLiteral:()=>zt,isInteropZodObject:()=>Vt,isInteropZodSchema:()=>Ae,isShapelessZodSchema:()=>jt,isSimpleStringZodSchema:()=>Ut,isZodArrayV4:()=>Bt,isZodLiteralV3:()=>Dt,isZodLiteralV4:()=>Lt,isZodNullableV4:()=>Ft,isZodObjectV3:()=>Rt,isZodObjectV4:()=>Mt,isZodOptionalV4:()=>Pt,isZodSchema:()=>xt,isZodSchemaV3:()=>kt,isZodSchemaV4:()=>Nt});var Pa={};U(Pa,{BasePromptValue:()=>he,ChatPromptValue:()=>ut,ImagePromptValue:()=>Ma,StringPromptValue:()=>ct});var he=class extends aa{},ct=class extends he{static lc_name(){return"StringPromptValue"}lc_namespace=["langchain_core","prompt_values"];lc_serializable=!0;value;constructor(e){super({value:e}),this.value=e}toString(){return this.value}toChatMessages(){return[new Se(this.value)]}},ut=class extends he{lc_namespace=["langchain_core","prompt_values"];lc_serializable=!0;static lc_name(){return"ChatPromptValue"}messages;constructor(e){Array.isArray(e)&&(e={messages:e}),super(e),this.messages=e.messages}toString(){return ta(this.messages)}toChatMessages(){return this.messages}},Ma=class extends he{lc_namespace=["langchain_core","prompt_values"];lc_serializable=!0;static lc_name(){return"ImagePromptValue"}imageUrl;value;constructor(e){"imageUrl"in e||(e={imageUrl:e}),super(e),this.imageUrl=e.imageUrl}toString(){return this.imageUrl.url}toChatMessages(){return[new Se({content:[{type:"image_url",image_url:{detail:this.imageUrl.detail,url:this.imageUrl.url}}]})]}},y="0123456789abcdef".split(""),Ra=[-2147483648,8388608,32768,128],D=[24,16,8,0],se=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],M=[];function B(e,a){a?(M[0]=M[16]=M[1]=M[2]=M[3]=M[4]=M[5]=M[6]=M[7]=M[8]=M[9]=M[10]=M[11]=M[12]=M[13]=M[14]=M[15]=0,this.blocks=M):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}B.prototype.update=function(e){if(!this.finalized){var a,n=typeof e;if(n!=="string"){if(n==="object"){if(e===null)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR)}else throw new Error(ERROR);a=!0}for(var r,i=0,c,h=e.length,l=this.blocks;i<h;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,this.block=l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),a)for(c=this.start;i<h&&c<64;++i)l[c>>>2]|=e[i]<<D[c++&3];else for(c=this.start;i<h&&c<64;++i)r=e.charCodeAt(i),r<128?l[c>>>2]|=r<<D[c++&3]:r<2048?(l[c>>>2]|=(192|r>>>6)<<D[c++&3],l[c>>>2]|=(128|r&63)<<D[c++&3]):r<55296||r>=57344?(l[c>>>2]|=(224|r>>>12)<<D[c++&3],l[c>>>2]|=(128|r>>>6&63)<<D[c++&3],l[c>>>2]|=(128|r&63)<<D[c++&3]):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),l[c>>>2]|=(240|r>>>18)<<D[c++&3],l[c>>>2]|=(128|r>>>12&63)<<D[c++&3],l[c>>>2]|=(128|r>>>6&63)<<D[c++&3],l[c>>>2]|=(128|r&63)<<D[c++&3]);this.lastByteIndex=c,this.bytes+=c-this.start,c>=64?(this.block=l[16],this.start=c-64,this.hash(),this.hashed=!0):this.start=c}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}};B.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,a=this.lastByteIndex;e[16]=this.block,e[a>>>2]|=Ra[a&3],this.block=e[16],a>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}};B.prototype.hash=function(){var e=this.h0,a=this.h1,n=this.h2,r=this.h3,i=this.h4,c=this.h5,h=this.h6,l=this.h7,b=this.blocks,f,T,_,E,g,d,m,v,w,A,C;for(f=16;f<64;++f)g=b[f-15],T=(g>>>7|g<<25)^(g>>>18|g<<14)^g>>>3,g=b[f-2],_=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,b[f]=b[f-16]+T+b[f-7]+_<<0;for(C=a&n,f=0;f<64;f+=4)this.first?(this.is224?(v=300032,g=b[0]-1413257819,l=g-150054599<<0,r=g+24177077<<0):(v=704751109,g=b[0]-210244248,l=g-1521486534<<0,r=g+143694565<<0),this.first=!1):(T=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),_=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),v=e&a,E=v^e&n^C,m=i&c^~i&h,g=l+_+m+se[f]+b[f],d=T+E,l=r+g<<0,r=g+d<<0),T=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),_=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),w=r&e,E=w^r&a^v,m=h&l^~h&i,g=c+_+m+se[f+1]+b[f+1],d=T+E,h=n+g<<0,n=g+d<<0,T=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),_=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),A=n&r,E=A^n&e^w,m=c&h^~c&l,g=i+_+m+se[f+2]+b[f+2],d=T+E,c=a+g<<0,a=g+d<<0,T=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),_=(c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7),C=a&n,E=C^a&r^A,m=c&h^~c&l,g=i+_+m+se[f+3]+b[f+3],d=T+E,i=e+g<<0,e=g+d<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+e<<0,this.h1=this.h1+a<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0,this.h4=this.h4+i<<0,this.h5=this.h5+c<<0,this.h6=this.h6+h<<0,this.h7=this.h7+l<<0};B.prototype.hex=function(){this.finalize();var e=this.h0,a=this.h1,n=this.h2,r=this.h3,i=this.h4,c=this.h5,h=this.h6,l=this.h7,b=y[e>>>28&15]+y[e>>>24&15]+y[e>>>20&15]+y[e>>>16&15]+y[e>>>12&15]+y[e>>>8&15]+y[e>>>4&15]+y[e&15]+y[a>>>28&15]+y[a>>>24&15]+y[a>>>20&15]+y[a>>>16&15]+y[a>>>12&15]+y[a>>>8&15]+y[a>>>4&15]+y[a&15]+y[n>>>28&15]+y[n>>>24&15]+y[n>>>20&15]+y[n>>>16&15]+y[n>>>12&15]+y[n>>>8&15]+y[n>>>4&15]+y[n&15]+y[r>>>28&15]+y[r>>>24&15]+y[r>>>20&15]+y[r>>>16&15]+y[r>>>12&15]+y[r>>>8&15]+y[r>>>4&15]+y[r&15]+y[i>>>28&15]+y[i>>>24&15]+y[i>>>20&15]+y[i>>>16&15]+y[i>>>12&15]+y[i>>>8&15]+y[i>>>4&15]+y[i&15]+y[c>>>28&15]+y[c>>>24&15]+y[c>>>20&15]+y[c>>>16&15]+y[c>>>12&15]+y[c>>>8&15]+y[c>>>4&15]+y[c&15]+y[h>>>28&15]+y[h>>>24&15]+y[h>>>20&15]+y[h>>>16&15]+y[h>>>12&15]+y[h>>>8&15]+y[h>>>4&15]+y[h&15];return this.is224||(b+=y[l>>>28&15]+y[l>>>24&15]+y[l>>>20&15]+y[l>>>16&15]+y[l>>>12&15]+y[l>>>8&15]+y[l>>>4&15]+y[l&15]),b};B.prototype.toString=B.prototype.hex;B.prototype.digest=function(){this.finalize();var e=this.h0,a=this.h1,n=this.h2,r=this.h3,i=this.h4,c=this.h5,h=this.h6,l=this.h7,b=[e>>>24&255,e>>>16&255,e>>>8&255,e&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255];return this.is224||b.push(l>>>24&255,l>>>16&255,l>>>8&255,l&255),b};B.prototype.array=B.prototype.digest;B.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),a=new DataView(e);return a.setUint32(0,this.h0),a.setUint32(4,this.h1),a.setUint32(8,this.h2),a.setUint32(12,this.h3),a.setUint32(16,this.h4),a.setUint32(20,this.h5),a.setUint32(24,this.h6),this.is224||a.setUint32(28,this.h7),e};const lt=(...e)=>new B(!1,!0).update(e.join("")).hex();var Fa={};U(Fa,{sha256:()=>lt});var La={};U(La,{BaseCache:()=>pt,InMemoryCache:()=>gt,defaultHashKeyEncoder:()=>ht,deserializeStoredGeneration:()=>Da,serializeGeneration:()=>Ba});const ht=(...e)=>lt(e.join("_"));function Da(e){return e.message!==void 0?{text:e.text,message:sa(e.message)}:{text:e.text}}function Ba(e){const a={text:e.text};return e.message!==void 0&&(a.message=e.message.toDict()),a}var pt=class{keyEncoder=ht;makeDefaultKeyEncoder(e){this.keyEncoder=e}};const Ua=new Map;var gt=class mt extends pt{cache;constructor(a){super(),this.cache=a??new Map}lookup(a,n){return Promise.resolve(this.cache.get(this.keyEncoder(a,n))??null)}async update(a,n,r){this.cache.set(this.keyEncoder(a,n),r)}static global(){return new mt(Ua)}},q={},Ze;function ja(){if(Ze)return q;Ze=1,q.byteLength=l,q.toByteArray=f,q.fromByteArray=E;for(var e=[],a=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,c=r.length;i<c;++i)e[i]=r[i],a[r.charCodeAt(i)]=i;a[45]=62,a[95]=63;function h(g){var d=g.length;if(d%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var m=g.indexOf("=");m===-1&&(m=d);var v=m===d?0:4-m%4;return[m,v]}function l(g){var d=h(g),m=d[0],v=d[1];return(m+v)*3/4-v}function b(g,d,m){return(d+m)*3/4-m}function f(g){var d,m=h(g),v=m[0],w=m[1],A=new n(b(g,v,w)),C=0,P=w>0?v-4:v,O;for(O=0;O<P;O+=4)d=a[g.charCodeAt(O)]<<18|a[g.charCodeAt(O+1)]<<12|a[g.charCodeAt(O+2)]<<6|a[g.charCodeAt(O+3)],A[C++]=d>>16&255,A[C++]=d>>8&255,A[C++]=d&255;return w===2&&(d=a[g.charCodeAt(O)]<<2|a[g.charCodeAt(O+1)]>>4,A[C++]=d&255),w===1&&(d=a[g.charCodeAt(O)]<<10|a[g.charCodeAt(O+1)]<<4|a[g.charCodeAt(O+2)]>>2,A[C++]=d>>8&255,A[C++]=d&255),A}function T(g){return e[g>>18&63]+e[g>>12&63]+e[g>>6&63]+e[g&63]}function _(g,d,m){for(var v,w=[],A=d;A<m;A+=3)v=(g[A]<<16&16711680)+(g[A+1]<<8&65280)+(g[A+2]&255),w.push(T(v));return w.join("")}function E(g){for(var d,m=g.length,v=m%3,w=[],A=16383,C=0,P=m-v;C<P;C+=A)w.push(_(g,C,C+A>P?P:C+A));return v===1?(d=g[m-1],w.push(e[d>>2]+e[d<<4&63]+"==")):v===2&&(d=(g[m-2]<<8)+g[m-1],w.push(e[d>>10]+e[d>>4&63]+e[d<<2&63]+"=")),w.join("")}return q}var Va=ja();const za=Oa(Va);var Ga=Object.defineProperty,Za=(e,a,n)=>a in e?Ga(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,$a=(e,a,n)=>(Za(e,a+"",n),n);function Ha(e,a){let n=Array.from({length:e.length},(r,i)=>({start:i,end:i+1}));for(;n.length>1;){let r=null;for(let i=0;i<n.length-1;i++){const c=e.slice(n[i].start,n[i+1].end),h=a.get(c.join(","));h!=null&&(r==null||h<r[0])&&(r=[h,i])}if(r!=null){const i=r[1];n[i]={start:n[i].start,end:n[i+1].end},n.splice(i+1,1)}else break}return n}function Wa(e,a){return e.length===1?[a.get(e.join(","))]:Ha(e,a).map(n=>a.get(e.slice(n.start,n.end).join(","))).filter(n=>n!=null)}function Ja(e){return e.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}var Ee=class{specialTokens;inverseSpecialTokens;patStr;textEncoder=new TextEncoder;textDecoder=new TextDecoder("utf-8");rankMap=new Map;textMap=new Map;constructor(e,a){this.patStr=e.pat_str;const n=e.bpe_ranks.split(`
2
2
  `).filter(Boolean).reduce((r,i)=>{const[c,h,...l]=i.split(" "),b=Number.parseInt(h,10);return l.forEach((f,T)=>r[f]=b+T),r},{});for(const[r,i]of Object.entries(n)){const c=za.toByteArray(r);this.rankMap.set(c.join(","),i),this.textMap.set(i,c)}this.specialTokens={...e.special_tokens,...a},this.inverseSpecialTokens=Object.entries(this.specialTokens).reduce((r,[i,c])=>(r[c]=this.textEncoder.encode(i),r),{})}encode(e,a=[],n="all"){const r=new RegExp(this.patStr,"ug"),i=Ee.specialTokenRegex(Object.keys(this.specialTokens)),c=[],h=new Set(a==="all"?Object.keys(this.specialTokens):a),l=new Set(n==="all"?Object.keys(this.specialTokens).filter(f=>!h.has(f)):n);if(l.size>0){const f=Ee.specialTokenRegex([...l]),T=e.match(f);if(T!=null)throw new Error(`The text contains a special token that is not allowed: ${T[0]}`)}let b=0;for(;;){let f=null,T=b;for(;i.lastIndex=T,f=i.exec(e),!(f==null||h.has(f[0]));)T=f.index+1;const _=f?.index??e.length;for(const g of e.substring(b,_).matchAll(r)){const d=this.textEncoder.encode(g[0]),m=this.rankMap.get(d.join(","));if(m!=null){c.push(m);continue}c.push(...Wa(d,this.rankMap))}if(f==null)break;let E=this.specialTokens[f[0]];c.push(E),b=f.index+f[0].length}return c}decode(e){const a=[];let n=0;for(let c=0;c<e.length;++c){const h=e[c],l=this.textMap.get(h)??this.inverseSpecialTokens[h];l!=null&&(a.push(l),n+=l.length)}const r=new Uint8Array(n);let i=0;for(const c of a)r.set(c,i),i+=c.length;return this.textDecoder.decode(r)}},ft=Ee;$a(ft,"specialTokenRegex",e=>new RegExp(e.map(a=>Ja(a)).join("|"),"g"));function Xa(e){switch(e){case"gpt2":return"gpt2";case"code-cushman-001":case"code-cushman-002":case"code-davinci-001":case"code-davinci-002":case"cushman-codex":case"davinci-codex":case"davinci-002":case"text-davinci-002":case"text-davinci-003":return"p50k_base";case"code-davinci-edit-001":case"text-davinci-edit-001":return"p50k_edit";case"ada":case"babbage":case"babbage-002":case"code-search-ada-code-001":case"code-search-babbage-code-001":case"curie":case"davinci":case"text-ada-001":case"text-babbage-001":case"text-curie-001":case"text-davinci-001":case"text-search-ada-doc-001":case"text-search-babbage-doc-001":case"text-search-curie-doc-001":case"text-search-davinci-doc-001":case"text-similarity-ada-001":case"text-similarity-babbage-001":case"text-similarity-curie-001":case"text-similarity-davinci-001":return"r50k_base";case"gpt-3.5-turbo-instruct-0914":case"gpt-3.5-turbo-instruct":case"gpt-3.5-turbo-16k-0613":case"gpt-3.5-turbo-16k":case"gpt-3.5-turbo-0613":case"gpt-3.5-turbo-0301":case"gpt-3.5-turbo":case"gpt-4-32k-0613":case"gpt-4-32k-0314":case"gpt-4-32k":case"gpt-4-0613":case"gpt-4-0314":case"gpt-4":case"gpt-3.5-turbo-1106":case"gpt-35-turbo":case"gpt-4-1106-preview":case"gpt-4-vision-preview":case"gpt-3.5-turbo-0125":case"gpt-4-turbo":case"gpt-4-turbo-2024-04-09":case"gpt-4-turbo-preview":case"gpt-4-0125-preview":case"text-embedding-ada-002":case"text-embedding-3-small":case"text-embedding-3-large":return"cl100k_base";case"gpt-4o":case"gpt-4o-2024-05-13":case"gpt-4o-2024-08-06":case"gpt-4o-2024-11-20":case"gpt-4o-mini-2024-07-18":case"gpt-4o-mini":case"gpt-4o-search-preview":case"gpt-4o-search-preview-2025-03-11":case"gpt-4o-mini-search-preview":case"gpt-4o-mini-search-preview-2025-03-11":case"gpt-4o-audio-preview":case"gpt-4o-audio-preview-2024-12-17":case"gpt-4o-audio-preview-2024-10-01":case"gpt-4o-mini-audio-preview":case"gpt-4o-mini-audio-preview-2024-12-17":case"o1":case"o1-2024-12-17":case"o1-mini":case"o1-mini-2024-09-12":case"o1-preview":case"o1-preview-2024-09-12":case"o1-pro":case"o1-pro-2025-03-19":case"o3":case"o3-2025-04-16":case"o3-mini":case"o3-mini-2025-01-31":case"o4-mini":case"o4-mini-2025-04-16":case"chatgpt-4o-latest":case"gpt-4o-realtime":case"gpt-4o-realtime-preview-2024-10-01":case"gpt-4o-realtime-preview-2024-12-17":case"gpt-4o-mini-realtime-preview":case"gpt-4o-mini-realtime-preview-2024-12-17":case"gpt-4.1":case"gpt-4.1-2025-04-14":case"gpt-4.1-mini":case"gpt-4.1-mini-2025-04-14":case"gpt-4.1-nano":case"gpt-4.1-nano-2025-04-14":case"gpt-4.5-preview":case"gpt-4.5-preview-2025-02-27":case"gpt-5":case"gpt-5-2025-08-07":case"gpt-5-nano":case"gpt-5-nano-2025-08-07":case"gpt-5-mini":case"gpt-5-mini-2025-08-07":case"gpt-5-chat-latest":return"o200k_base";default:throw new Error("Unknown model")}}var Ya={};U(Ya,{encodingForModel:()=>Ne,getEncoding:()=>dt});const ne={},Ka=new We({});async function dt(e){return e in ne||(ne[e]=Ka.fetch(`https://tiktoken.pages.dev/js/${e}.json`).then(a=>a.json()).then(a=>new ft(a)).catch(a=>{throw delete ne[e],a})),await ne[e]}async function Ne(e){return dt(Xa(e))}var qa={};U(qa,{BaseLangChain:()=>yt,BaseLanguageModel:()=>_t,calculateMaxTokens:()=>ts,getEmbeddingContextSize:()=>Qa,getModelContextSize:()=>bt,getModelNameForTiktoken:()=>pe,isOpenAITool:()=>es});const pe=e=>e.startsWith("gpt-5")?"gpt-5":e.startsWith("gpt-3.5-turbo-16k")?"gpt-3.5-turbo-16k":e.startsWith("gpt-3.5-turbo-")?"gpt-3.5-turbo":e.startsWith("gpt-4-32k")?"gpt-4-32k":e.startsWith("gpt-4-")?"gpt-4":e.startsWith("gpt-4o")?"gpt-4o":e,Qa=e=>{switch(e){case"text-embedding-ada-002":return 8191;default:return 2046}},bt=e=>{switch(pe(e)){case"gpt-5":case"gpt-5-turbo":case"gpt-5-turbo-preview":return 4e5;case"gpt-4o":case"gpt-4o-mini":case"gpt-4o-2024-05-13":case"gpt-4o-2024-08-06":return 128e3;case"gpt-4-turbo":case"gpt-4-turbo-preview":case"gpt-4-turbo-2024-04-09":case"gpt-4-0125-preview":case"gpt-4-1106-preview":return 128e3;case"gpt-4-32k":case"gpt-4-32k-0314":case"gpt-4-32k-0613":return 32768;case"gpt-4":case"gpt-4-0314":case"gpt-4-0613":return 8192;case"gpt-3.5-turbo-16k":case"gpt-3.5-turbo-16k-0613":return 16384;case"gpt-3.5-turbo":case"gpt-3.5-turbo-0301":case"gpt-3.5-turbo-0613":case"gpt-3.5-turbo-1106":case"gpt-3.5-turbo-0125":return 4096;case"text-davinci-003":case"text-davinci-002":return 4097;case"text-davinci-001":return 2049;case"text-curie-001":case"text-babbage-001":case"text-ada-001":return 2048;case"code-davinci-002":case"code-davinci-001":return 8e3;case"code-cushman-001":return 2048;case"claude-3-5-sonnet-20241022":case"claude-3-5-sonnet-20240620":case"claude-3-opus-20240229":case"claude-3-sonnet-20240229":case"claude-3-haiku-20240307":case"claude-2.1":return 2e5;case"claude-2.0":case"claude-instant-1.2":return 1e5;case"gemini-1.5-pro":case"gemini-1.5-pro-latest":case"gemini-1.5-flash":case"gemini-1.5-flash-latest":return 1e6;case"gemini-pro":case"gemini-pro-vision":return 32768;default:return 4097}};function es(e){return typeof e!="object"||!e?!1:!!("type"in e&&e.type==="function"&&"function"in e&&typeof e.function=="object"&&e.function&&"name"in e.function&&"parameters"in e.function)}const ts=async({prompt:e,modelName:a})=>{let n;try{n=(await Ne(pe(a))).encode(e).length}catch{console.warn("Failed to calculate number of tokens, falling back to approximate count"),n=Math.ceil(e.length/4)}return bt(a)-n},as=()=>!1;var yt=class extends H{verbose;callbacks;tags;metadata;get lc_attributes(){return{callbacks:void 0,verbose:void 0}}constructor(e){super(e),this.verbose=e.verbose??as(),this.callbacks=e.callbacks,this.tags=e.tags??[],this.metadata=e.metadata??{}}},_t=class extends yt{get callKeys(){return["stop","timeout","signal","tags","metadata","callbacks"]}caller;cache;constructor({callbacks:e,callbackManager:a,...n}){const{cache:r,...i}=n;super({callbacks:e??a,...i}),typeof r=="object"?this.cache=r:r?this.cache=gt.global():this.cache=void 0,this.caller=new We(n??{})}_encoding;async getNumTokens(e){let a;typeof e=="string"?a=e:a=e.map(r=>typeof r=="string"?r:r.type==="text"&&"text"in r?r.text:"").join("");let n=Math.ceil(a.length/4);if(!this._encoding)try{this._encoding=await Ne("modelName"in this?pe(this.modelName):"gpt2")}catch(r){console.warn("Failed to calculate number of tokens, falling back to approximate count",r)}if(this._encoding)try{n=this._encoding.encode(a).length}catch(r){console.warn("Failed to calculate number of tokens, falling back to approximate count",r)}return n}static _convertInputToPromptValue(e){return typeof e=="string"?new ct(e):Array.isArray(e)?new ut(e.map(re)):e}_identifyingParams(){return{}}_getSerializedCacheKeyParametersForCall({config:e,...a}){const n={...this._identifyingParams(),...a,_type:this._llmType(),_model:this._modelType()};return Object.entries(n).filter(([c,h])=>h!==void 0).map(([c,h])=>`${c}:${JSON.stringify(h)}`).sort().join(",")}serialize(){return{...this._identifyingParams(),_type:this._llmType(),_model:this._modelType()}}static async deserialize(e){throw new Error("Use .toJSON() instead")}get profile(){return{}}},ue=class extends H{static lc_name(){return"RunnablePassthrough"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;func;constructor(e){super(e),e&&(this.func=e.func)}async invoke(e,a){const n=oe(a);return this.func&&await this.func(e,n),this._callWithConfig(r=>Promise.resolve(r),e,n)}async*transform(e,a){const n=oe(a);let r,i=!0;for await(const c of this._transformStreamWithConfig(e,h=>h,n))if(yield c,i)if(r===void 0)r=c;else try{r=ce(r,c)}catch{r=void 0,i=!1}this.func&&r!==void 0&&await this.func(r,n)}static assign(e){return new Je(new Xe({steps:e}))}};const ss=e=>e();function _e(e){const a=e.constructor;return new a({...e,content:e.contentBlocks,response_metadata:{...e.response_metadata,output_version:"v1"}})}var ns={};U(ns,{BaseChatModel:()=>Tt,SimpleChatModel:()=>rs});function Te(e){const a=[];for(const n of e){let r=n;if(Array.isArray(n.content))for(let i=0;i<n.content.length;i++){const c=n.content[i];(ca(c)||ua(c))&&r===n&&(r=new n.constructor({...r,content:[...n.content.slice(0,i),la(c),...n.content.slice(i+1)]}))}a.push(r)}return a}var Tt=class Z extends _t{lc_namespace=["langchain","chat_models",this._llmType()];disableStreaming=!1;outputVersion;get callKeys(){return[...super.callKeys,"outputVersion"]}constructor(a){super(a),this.outputVersion=ss(()=>{const n=a.outputVersion??na("LC_OUTPUT_VERSION");return n&&["v0","v1"].includes(n)?n:"v0"})}_separateRunnableConfigFromCallOptionsCompat(a){const[n,r]=super._separateRunnableConfigFromCallOptions(a);return r.signal=n.signal,[n,r]}async invoke(a,n){const r=Z._convertInputToPromptValue(a);return(await this.generatePrompt([r],n,n?.callbacks)).generations[0][0].message}async*_streamResponseChunks(a,n,r){throw new Error("Not implemented.")}async*_streamIterator(a,n){if(this._streamResponseChunks===Z.prototype._streamResponseChunks||this.disableStreaming)yield this.invoke(a,n);else{const i=Z._convertInputToPromptValue(a).toChatMessages(),[c,h]=this._separateRunnableConfigFromCallOptionsCompat(n),l={...c.metadata,...this.getLsParams(h)},b=await ye.configure(c.callbacks,this.callbacks,c.tags,this.tags,l,this.metadata,{verbose:this.verbose}),f={options:h,invocation_params:this?.invocationParams(h),batch_size:1},T=h.outputVersion??this.outputVersion,_=await b?.handleChatModelStart(this.toJSON(),[Te(i)],c.runId,void 0,f,void 0,void 0,c.runName);let E,g;try{for await(const d of this._streamResponseChunks(i,h,_?.[0])){if(d.message.id==null){const m=_?.at(0)?.runId;m!=null&&d.message._updateId(`run-${m}`)}d.message.response_metadata={...d.generationInfo,...d.message.response_metadata},T==="v1"?yield _e(d.message):yield d.message,E?E=E.concat(d):E=d,Ve(d.message)&&d.message.usage_metadata!==void 0&&(g={tokenUsage:{promptTokens:d.message.usage_metadata.input_tokens,completionTokens:d.message.usage_metadata.output_tokens,totalTokens:d.message.usage_metadata.total_tokens}})}}catch(d){throw await Promise.all((_??[]).map(m=>m?.handleLLMError(d))),d}await Promise.all((_??[]).map(d=>d?.handleLLMEnd({generations:[[E]],llmOutput:g})))}}getLsParams(a){const n=this.getName().startsWith("Chat")?this.getName().replace("Chat",""):this.getName();return{ls_model_type:"chat",ls_stop:a.stop,ls_provider:n}}async _generateUncached(a,n,r,i){const c=a.map(E=>E.map(re));let h;if(i!==void 0&&i.length===c.length)h=i;else{const E={...r.metadata,...this.getLsParams(n)},g=await ye.configure(r.callbacks,this.callbacks,r.tags,this.tags,E,this.metadata,{verbose:this.verbose}),d={options:n,invocation_params:this?.invocationParams(n),batch_size:1};h=await g?.handleChatModelStart(this.toJSON(),c.map(Te),r.runId,void 0,d,void 0,void 0,r.runName)}const l=n.outputVersion??this.outputVersion,b=[],f=[];if(!!h?.[0].handlers.find(ra)&&!this.disableStreaming&&c.length===1&&this._streamResponseChunks!==Z.prototype._streamResponseChunks)try{const E=await this._streamResponseChunks(c[0],n,h?.[0]);let g,d;for await(const m of E){if(m.message.id==null){const v=h?.at(0)?.runId;v!=null&&m.message._updateId(`run-${v}`)}g===void 0?g=m:g=ce(g,m),Ve(m.message)&&m.message.usage_metadata!==void 0&&(d={tokenUsage:{promptTokens:m.message.usage_metadata.input_tokens,completionTokens:m.message.usage_metadata.output_tokens,totalTokens:m.message.usage_metadata.total_tokens}})}if(g===void 0)throw new Error("Received empty response from chat model call.");b.push([g]),await h?.[0].handleLLMEnd({generations:b,llmOutput:d})}catch(E){throw await h?.[0].handleLLMError(E),E}else{const E=await Promise.allSettled(c.map(async(g,d)=>{const m=await this._generate(g,{...n,promptIndex:d},h?.[d]);if(l==="v1")for(const v of m.generations)v.message=_e(v.message);return m}));await Promise.all(E.map(async(g,d)=>{if(g.status==="fulfilled"){const m=g.value;for(const v of m.generations){if(v.message.id==null){const w=h?.at(0)?.runId;w!=null&&v.message._updateId(`run-${w}`)}v.message.response_metadata={...v.generationInfo,...v.message.response_metadata}}return m.generations.length===1&&(m.generations[0].message.response_metadata={...m.llmOutput,...m.generations[0].message.response_metadata}),b[d]=m.generations,f[d]=m.llmOutput,h?.[d]?.handleLLMEnd({generations:[m.generations],llmOutput:m.llmOutput})}else return await h?.[d]?.handleLLMError(g.reason),Promise.reject(g.reason)}))}const _={generations:b,llmOutput:f.length?this._combineLLMOutput?.(...f):void 0};return Object.defineProperty(_,ze,{value:h?{runIds:h?.map(E=>E.runId)}:void 0,configurable:!0}),_}async _generateCached({messages:a,cache:n,llmStringKey:r,parsedOptions:i,handledOptions:c}){const h=a.map(w=>w.map(re)),l={...c.metadata,...this.getLsParams(i)},b=await ye.configure(c.callbacks,this.callbacks,c.tags,this.tags,l,this.metadata,{verbose:this.verbose}),f={options:i,invocation_params:this?.invocationParams(i),batch_size:1},T=await b?.handleChatModelStart(this.toJSON(),h.map(Te),c.runId,void 0,f,void 0,void 0,c.runName),_=[],g=(await Promise.allSettled(h.map(async(w,A)=>{const C=Z._convertInputToPromptValue(w).toString(),P=await n.lookup(C,r);return P==null&&_.push(A),P}))).map((w,A)=>({result:w,runManager:T?.[A]})).filter(({result:w})=>w.status==="fulfilled"&&w.value!=null||w.status==="rejected"),d=i.outputVersion??this.outputVersion,m=[];await Promise.all(g.map(async({result:w,runManager:A},C)=>{if(w.status==="fulfilled"){const P=w.value;return m[C]=P.map(O=>("message"in O&&X(O.message)&&ia(O.message)&&(O.message.usage_metadata={input_tokens:0,output_tokens:0,total_tokens:0},d==="v1"&&(O.message=_e(O.message))),O.generationInfo={...O.generationInfo,tokenUsage:{}},O)),P.length&&await A?.handleLLMNewToken(P[0].text),A?.handleLLMEnd({generations:[P]},void 0,void 0,void 0,{cached:!0})}else return await A?.handleLLMError(w.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject(w.reason)}));const v={generations:m,missingPromptIndices:_,startedRunManagers:T};return Object.defineProperty(v,ze,{value:T?{runIds:T?.map(w=>w.runId)}:void 0,configurable:!0}),v}async generate(a,n,r){let i;Array.isArray(n)?i={stop:n}:i=n;const c=a.map(d=>d.map(re)),[h,l]=this._separateRunnableConfigFromCallOptionsCompat(i);if(h.callbacks=h.callbacks??r,!this.cache)return this._generateUncached(c,l,h);const{cache:b}=this,f=this._getSerializedCacheKeyParametersForCall(l),{generations:T,missingPromptIndices:_,startedRunManagers:E}=await this._generateCached({messages:c,cache:b,llmStringKey:f,parsedOptions:l,handledOptions:h});let g={};if(_.length>0){const d=await this._generateUncached(_.map(m=>c[m]),l,h,E!==void 0?_.map(m=>E?.[m]):void 0);await Promise.all(d.generations.map(async(m,v)=>{const w=_[v];T[w]=m;const A=Z._convertInputToPromptValue(c[w]).toString();return b.update(A,f,m)})),g=d.llmOutput??{}}return{generations:T,llmOutput:g}}invocationParams(a){return{}}_modelType(){return"base_chat_model"}async generatePrompt(a,n,r){const i=a.map(c=>c.toChatMessages());return this.generate(i,n,r)}withStructuredOutput(a,n){if(typeof this.bindTools!="function")throw new Error('Chat model must implement ".bindTools()" to use withStructuredOutput.');if(n?.strict)throw new Error('"strict" mode is not supported for this model by default.');const r=a,i=n?.name,c=He(r)??"A function available to call.",h=n?.method,l=n?.includeRaw;if(h==="jsonMode")throw new Error('Base withStructuredOutput implementation only supports "functionCalling" as a method.');let b=i??"extract",f;Ae(r)?f=[{type:"function",function:{name:b,description:c,parameters:le(r)}}]:("name"in r&&(b=r.name),f=[{type:"function",function:{name:b,description:c,parameters:r}}]);const T=this.bindTools(f),_=Ie.from(m=>{if(!oa.isInstance(m))throw new Error("Input is not an AIMessageChunk.");if(!m.tool_calls||m.tool_calls.length===0)throw new Error("No tool calls found in the response.");const v=m.tool_calls.find(w=>w.name===b);if(!v)throw new Error(`No tool call found with name ${b}.`);return v.args});if(!l)return T.pipe(_).withConfig({runName:"StructuredOutput"});const E=ue.assign({parsed:(m,v)=>_.invoke(m.raw,v)}),g=ue.assign({parsed:()=>null}),d=E.withFallbacks({fallbacks:[g]});return Ye.from([{raw:T},d]).withConfig({runName:"StructuredOutputRunnable"})}},rs=class extends Tt{async _generate(e,a,n){const r=await this._call(e,a,n),i=new Ke(r);if(typeof i.content!="string")throw new Error("Cannot generate with a simple chat model when output is not a string.");return{generations:[{text:i.content,message:i}]}}},is=class extends H{static lc_name(){return"RouterRunnable"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;runnables;constructor(e){super(e),this.runnables=e.runnables}async invoke(e,a){const{key:n,input:r}=e,i=this.runnables[n];if(i===void 0)throw new Error(`No runnable associated with key "${n}".`);return i.invoke(r,oe(a))}async batch(e,a,n){const r=e.map(_=>_.key),i=e.map(_=>_.input);if(r.find(_=>this.runnables[_]===void 0)!==void 0)throw new Error("One or more keys do not have a corresponding runnable.");const h=r.map(_=>this.runnables[_]),l=this._getOptionsList(a??{},e.length),b=l[0]?.maxConcurrency??n?.maxConcurrency,f=b&&b>0?b:e.length,T=[];for(let _=0;_<i.length;_+=f){const E=i.slice(_,_+f).map((d,m)=>h[m].invoke(d,l[m])),g=await Promise.all(E);T.push(g)}return T.flat()}async stream(e,a){const{key:n,input:r}=e,i=this.runnables[n];if(i===void 0)throw new Error(`No runnable associated with key "${n}".`);return i.stream(r,a)}},os=class extends H{static lc_name(){return"RunnableBranch"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;default;branches;constructor(e){super(e),this.branches=e.branches,this.default=e.default}static from(e){if(e.length<1)throw new Error("RunnableBranch requires at least one branch");const n=e.slice(0,-1).map(([i,c])=>[ie(i),ie(c)]),r=ie(e[e.length-1]);return new this({branches:n,default:r})}async _invoke(e,a,n){let r;for(let i=0;i<this.branches.length;i+=1){const[c,h]=this.branches[i];if(await c.invoke(e,G(a,{callbacks:n?.getChild(`condition:${i+1}`)}))){r=await h.invoke(e,G(a,{callbacks:n?.getChild(`branch:${i+1}`)}));break}}return r||(r=await this.default.invoke(e,G(a,{callbacks:n?.getChild("branch:default")}))),r}async invoke(e,a={}){return this._callWithConfig(this._invoke,e,a)}async*_streamIterator(e,a){const r=await(await qe(a))?.handleChainStart(this.toJSON(),ha(e,"input"),a?.runId,void 0,void 0,void 0,a?.runName);let i,c=!0,h;try{for(let l=0;l<this.branches.length;l+=1){const[b,f]=this.branches[l];if(await b.invoke(e,G(a,{callbacks:r?.getChild(`condition:${l+1}`)}))){h=await f.stream(e,G(a,{callbacks:r?.getChild(`branch:${l+1}`)}));for await(const _ of h)if(yield _,c)if(i===void 0)i=_;else try{i=ce(i,_)}catch{i=void 0,c=!1}break}}if(h===void 0){h=await this.default.stream(e,G(a,{callbacks:r?.getChild("branch:default")}));for await(const l of h)if(yield l,c)if(i===void 0)i=l;else try{i=ce(i,l)}catch{i=void 0,c=!1}}}catch(l){throw await r?.handleChainError(l),l}await r?.handleChainEnd(i??{})}},cs=class extends Qe{runnable;inputMessagesKey;outputMessagesKey;historyMessagesKey;getMessageHistory;constructor(e){let a=Ie.from((c,h)=>this._enterHistory(c,h??{})).withConfig({runName:"loadHistory"});const n=e.historyMessagesKey??e.inputMessagesKey;n&&(a=ue.assign({[n]:a}).withConfig({runName:"insertHistory"}));const r=a.pipe(e.runnable.withListeners({onEnd:(c,h)=>this._exitHistory(c,h??{})})).withConfig({runName:"RunnableWithMessageHistory"}),i=e.config??{};super({...e,config:i,bound:r}),this.runnable=e.runnable,this.getMessageHistory=e.getMessageHistory,this.inputMessagesKey=e.inputMessagesKey,this.outputMessagesKey=e.outputMessagesKey,this.historyMessagesKey=e.historyMessagesKey}_getInputMessages(e){let a;if(typeof e=="object"&&!Array.isArray(e)&&!X(e)){let n;this.inputMessagesKey?n=this.inputMessagesKey:Object.keys(e).length===1?n=Object.keys(e)[0]:n="input",Array.isArray(e[n])&&Array.isArray(e[n][0])?a=e[n][0]:a=e[n]}else a=e;if(typeof a=="string")return[new Se(a)];if(Array.isArray(a))return a;if(X(a))return[a];throw new Error(`Expected a string, BaseMessage, or array of BaseMessages.
3
3
  Got ${JSON.stringify(a,null,2)}`)}_getOutputMessages(e){let a;if(!Array.isArray(e)&&!X(e)&&typeof e!="string"){let n;this.outputMessagesKey!==void 0?n=this.outputMessagesKey:Object.keys(e).length===1?n=Object.keys(e)[0]:n="output",e.generations!==void 0?a=e.generations[0][0].message:a=e[n]}else a=e;if(typeof a=="string")return[new Ke(a)];if(Array.isArray(a))return a;if(X(a))return[a];throw new Error(`Expected a string, BaseMessage, or array of BaseMessages. Received: ${JSON.stringify(a,null,2)}`)}async _enterHistory(e,a){const r=await(a?.configurable?.messageHistory).getMessages();return this.historyMessagesKey===void 0?r.concat(this._getInputMessages(e)):r}async _exitHistory(e,a){const n=a.configurable?.messageHistory;let r;Array.isArray(e.inputs)&&Array.isArray(e.inputs[0])?r=e.inputs[0]:r=e.inputs;let i=this._getInputMessages(r);if(this.historyMessagesKey===void 0){const l=await n.getMessages();i=i.slice(l.length)}const c=e.outputs;if(!c)throw new Error(`Output values from 'Run' undefined. Run: ${JSON.stringify(e,null,2)}`);const h=this._getOutputMessages(c);await n.addMessages([...i,...h])}async _mergeConfig(...e){const a=await super._mergeConfig(...e);if(!a.configurable||!a.configurable.sessionId){const r={[this.inputMessagesKey??"input"]:"foo"},i={configurable:{sessionId:"123"}};throw new Error(`sessionId is required. Pass it in as part of the config argument to .invoke() or .stream()
4
4
  eg. chain.invoke(${JSON.stringify(r)}, ${JSON.stringify(i)})`)}const{sessionId:n}=a.configurable;return a.configurable.messageHistory=await this.getMessageHistory(n),a}},us={};U(us,{RouterRunnable:()=>is,Runnable:()=>H,RunnableAssign:()=>Je,RunnableBinding:()=>Qe,RunnableBranch:()=>os,RunnableEach:()=>Ta,RunnableLambda:()=>Ie,RunnableMap:()=>Xe,RunnableParallel:()=>_a,RunnablePassthrough:()=>ue,RunnablePick:()=>ya,RunnableRetry:()=>ba,RunnableSequence:()=>Ye,RunnableToolLike:()=>da,RunnableWithFallbacks:()=>fa,RunnableWithMessageHistory:()=>cs,_coerceToRunnable:()=>ie,ensureConfig:()=>oe,getCallbackManagerForConfig:()=>qe,mergeConfigs:()=>ma,patchConfig:()=>G,pickRunnableConfigKeys:()=>ga,raceWithSignal:()=>pa});var vt=class extends H{parseResultWithPrompt(e,a,n){return this.parseResult(e,n)}_baseMessageToString(e){return typeof e.content=="string"?e.content:this._baseMessageContentToString(e.content)}_baseMessageContentToString(e){return JSON.stringify(e)}async invoke(e,a){return typeof e=="string"?this._callWithConfig(async(n,r)=>this.parseResult([{text:n}],r?.callbacks),e,{...a,runType:"parser"}):this._callWithConfig(async(n,r)=>this.parseResult([{message:n,text:this._baseMessageToString(n)}],r?.callbacks),e,{...a,runType:"parser"})}},ge=class extends vt{parseResult(e,a){return this.parse(e[0].text,a)}async parseWithPrompt(e,a,n){return this.parse(e,n)}_type(){throw new Error("_type not implemented")}},$=class extends Error{llmOutput;observation;sendToLLM;constructor(e,a,n,r=!1){if(super(e),this.llmOutput=a,this.observation=n,this.sendToLLM=r,r&&(n===void 0||a===void 0))throw new Error("Arguments 'observation' & 'llmOutput' are required if 'sendToLlm' is true");va(this,"OUTPUT_PARSING_FAILURE")}},Q=class extends ge{async*_transform(e){for await(const a of e)typeof a=="string"?yield this.parseResult([{text:a}]):yield this.parseResult([{message:a,text:this._baseMessageToString(a)}])}async*transform(e,a){yield*this._transformStreamWithConfig(e,this._transform.bind(this),{...a,runType:"parser"})}},ke=class extends Q{diff=!1;constructor(e){super(e),this.diff=e?.diff??this.diff}async*_transform(e){let a,n;for await(const r of e){if(typeof r!="string"&&typeof r.content!="string")throw new Error("Cannot handle non-string output.");let i;if(Ea(r)){if(typeof r.content!="string")throw new Error("Cannot handle non-string message output.");i=new Ge({message:r,text:r.content})}else if(X(r)){if(typeof r.content!="string")throw new Error("Cannot handle non-string message output.");i=new Ge({message:wa(r),text:r.content})}else i=new Ca({text:r});n===void 0?n=i:n=n.concat(i);const c=await this.parsePartialResult([n]);c!=null&&!Aa(c,a)&&(this.diff?yield this._diff(a,c):yield c,a=c)}}getFormatInstructions(){return""}},ls=class extends Q{static lc_name(){return"BytesOutputParser"}lc_namespace=["langchain_core","output_parsers","bytes"];lc_serializable=!0;textEncoder=new TextEncoder;parse(e){return Promise.resolve(this.textEncoder.encode(e))}getFormatInstructions(){return""}},ee=class extends Q{re;async*_transform(e){let a="";for await(const n of e)if(typeof n=="string"?a+=n:a+=n.content,this.re){const r=[...a.matchAll(this.re)];if(r.length>1){let i=0;for(const c of r.slice(0,-1))yield[c[1]],i+=(c.index??0)+c[0].length;a=a.slice(i)}}else{const r=await this.parse(a);if(r.length>1){for(const i of r.slice(0,-1))yield[i];a=r[r.length-1]}}for(const n of await this.parse(a))yield[n]}},hs=class extends ee{static lc_name(){return"CommaSeparatedListOutputParser"}lc_namespace=["langchain_core","output_parsers","list"];lc_serializable=!0;async parse(e){try{return e.trim().split(",").map(a=>a.trim())}catch{throw new $(`Could not parse output: ${e}`,e)}}getFormatInstructions(){return"Your response should be a list of comma separated values, eg: `foo, bar, baz`"}},ps=class extends ee{lc_namespace=["langchain_core","output_parsers","list"];length;separator;constructor({length:e,separator:a}){super(...arguments),this.length=e,this.separator=a||","}async parse(e){try{const a=e.trim().split(this.separator).map(n=>n.trim());if(this.length!==void 0&&a.length!==this.length)throw new $(`Incorrect number of items. Expected ${this.length}, got ${a.length}.`);return a}catch(a){throw Object.getPrototypeOf(a)===$.prototype?a:new $(`Could not parse output: ${e}`)}}getFormatInstructions(){return`Your response should be a list of ${this.length===void 0?"":`${this.length} `}items separated by "${this.separator}" (eg: \`foo${this.separator} bar${this.separator} baz\`)`}},gs=class extends ee{static lc_name(){return"NumberedListOutputParser"}lc_namespace=["langchain_core","output_parsers","list"];lc_serializable=!0;getFormatInstructions(){return`Your response should be a numbered list with each item on a new line. For example:
@@ -1,2 +1,2 @@
1
- import{r as O,t as M,u as R,g as b,C as L,G as N,w as x,x as J,R as P}from"./index-CzON1LlU.js";import{O as k,d as E,e as T}from"./index-YgJNrSvw.js";function C(n,e){if(n.function===void 0)return;let t;if(e?.partial)try{t=R(n.function.arguments??"{}")}catch{return}else try{t=JSON.parse(n.function.arguments)}catch(r){throw new k([`Function "${n.function.name}" arguments:`,"",n.function.arguments,"","are not valid JSON.",`Error: ${r.message}`].join(`
1
+ import{r as O,t as M,u as R,g as b,C as L,G as N,w as x,x as J,R as P}from"./index-D7mhOTIc.js";import{O as k,d as E,e as T}from"./index-o8LZS9ZF.js";function C(n,e){if(n.function===void 0)return;let t;if(e?.partial)try{t=R(n.function.arguments??"{}")}catch{return}else try{t=JSON.parse(n.function.arguments)}catch(r){throw new k([`Function "${n.function.name}" arguments:`,"",n.function.arguments,"","are not valid JSON.",`Error: ${r.message}`].join(`
2
2
  `))}const s={name:n.function.name,args:t,type:"tool_call"};return e?.returnId&&(s.id=n.id),s}function z(n){if(n.id===void 0)throw new Error('All OpenAI tool calls must have an "id" field.');return{id:n.id,type:"function",function:{name:n.name,arguments:JSON.stringify(n.args)}}}function A(n,e){return{name:n.function?.name,args:n.function?.arguments,id:n.id,error:e,type:"invalid_tool_call"}}var S=class extends E{static lc_name(){return"JsonOutputToolsParser"}returnId=!1;lc_namespace=["langchain","output_parsers","openai_tools"];lc_serializable=!0;constructor(n){super(n),this.returnId=n?.returnId??this.returnId}_diff(){throw new Error("Not supported.")}async parse(){throw new Error("Not implemented.")}async parseResult(n){return await this.parsePartialResult(n,!1)}async parsePartialResult(n,e=!0){const t=n[0].message;let s;if(M(t)&&t.tool_calls?.length?s=t.tool_calls.map(a=>{const{id:l,...u}=a;return this.returnId?{id:l,...u}:u}):t.additional_kwargs.tool_calls!==void 0&&(s=JSON.parse(JSON.stringify(t.additional_kwargs.tool_calls)).map(l=>C(l,{returnId:this.returnId,partial:e}))),!s)return[];const r=[];for(const a of s)if(a!==void 0){const l={type:a.name,args:a.args,id:a.id};r.push(l)}return r}},F=class extends S{static lc_name(){return"JsonOutputKeyToolsParser"}lc_namespace=["langchain","output_parsers","openai_tools"];lc_serializable=!0;returnId=!1;keyName;returnSingle=!1;zodSchema;constructor(n){super(n),this.keyName=n.keyName,this.returnSingle=n.returnSingle??this.returnSingle,this.zodSchema=n.zodSchema}async _validateResult(n){if(this.zodSchema===void 0)return n;const e=await O(this.zodSchema,n);if(e.success)return e.data;throw new k(`Failed to parse. Text: "${JSON.stringify(n,null,2)}". Error: ${JSON.stringify(e.error?.issues)}`,JSON.stringify(n,null,2))}async parsePartialResult(n){const t=(await super.parsePartialResult(n)).filter(r=>r.type===this.keyName);let s=t;if(t.length)return this.returnId||(s=t.map(r=>r.args)),this.returnSingle?s[0]:s}async parseResult(n){const t=(await super.parsePartialResult(n,!1)).filter(a=>a.type===this.keyName);let s=t;return t.length?(this.returnId||(s=t.map(a=>a.args)),this.returnSingle?this._validateResult(s[0]):await Promise.all(s.map(a=>this._validateResult(a)))):void 0}},K={};b(K,{JsonOutputKeyToolsParser:()=>F,JsonOutputToolsParser:()=>S,convertLangChainToolCallToOpenAI:()=>z,makeInvalidToolCall:()=>A,parseToolCall:()=>C});var U={};b(U,{BaseLLM:()=>I,LLM:()=>j});var I=class f extends T{lc_namespace=["langchain","llms",this._llmType()];async invoke(e,t){const s=f._convertInputToPromptValue(e);return(await this.generatePrompt([s],t,t?.callbacks)).generations[0][0].text}async*_streamResponseChunks(e,t,s){throw new Error("Not implemented.")}_separateRunnableConfigFromCallOptionsCompat(e){const[t,s]=super._separateRunnableConfigFromCallOptions(e);return s.signal=t.signal,[t,s]}async*_streamIterator(e,t){if(this._streamResponseChunks===f.prototype._streamResponseChunks)yield this.invoke(e,t);else{const s=f._convertInputToPromptValue(e),[r,a]=this._separateRunnableConfigFromCallOptionsCompat(t),l=await L.configure(r.callbacks,this.callbacks,r.tags,this.tags,r.metadata,this.metadata,{verbose:this.verbose}),u={options:a,invocation_params:this?.invocationParams(a),batch_size:1},h=await l?.handleLLMStart(this.toJSON(),[s.toString()],r.runId,void 0,u,void 0,void 0,r.runName);let o=new N({text:""});try{for await(const i of this._streamResponseChunks(s.toString(),a,h?.[0]))o?o=o.concat(i):o=i,typeof i.text=="string"&&(yield i.text)}catch(i){throw await Promise.all((h??[]).map(d=>d?.handleLLMError(i))),i}await Promise.all((h??[]).map(i=>i?.handleLLMEnd({generations:[[o]]})))}}async generatePrompt(e,t,s){const r=e.map(a=>a.toString());return this.generate(r,t,s)}invocationParams(e){return{}}_flattenLLMResult(e){const t=[];for(let s=0;s<e.generations.length;s+=1){const r=e.generations[s];if(s===0)t.push({generations:[r],llmOutput:e.llmOutput});else{const a=e.llmOutput?{...e.llmOutput,tokenUsage:{}}:void 0;t.push({generations:[r],llmOutput:a})}}return t}async _generateUncached(e,t,s,r){let a;if(r!==void 0&&r.length===e.length)a=r;else{const o=await L.configure(s.callbacks,this.callbacks,s.tags,this.tags,s.metadata,this.metadata,{verbose:this.verbose}),i={options:t,invocation_params:this?.invocationParams(t),batch_size:e.length};a=await o?.handleLLMStart(this.toJSON(),e,s.runId,void 0,i,void 0,void 0,s?.runName)}const l=!!a?.[0].handlers.find(x);let u;if(l&&e.length===1&&this._streamResponseChunks!==f.prototype._streamResponseChunks)try{const o=await this._streamResponseChunks(e[0],t,a?.[0]);let i;for await(const d of o)i===void 0?i=d:i=J(i,d);if(i===void 0)throw new Error("Received empty response from chat model call.");u={generations:[[i]],llmOutput:{}},await a?.[0].handleLLMEnd(u)}catch(o){throw await a?.[0].handleLLMError(o),o}else{try{u=await this._generate(e,t,a?.[0])}catch(i){throw await Promise.all((a??[]).map(d=>d?.handleLLMError(i))),i}const o=this._flattenLLMResult(u);await Promise.all((a??[]).map((i,d)=>i?.handleLLMEnd(o[d])))}const h=a?.map(o=>o.runId)||void 0;return Object.defineProperty(u,P,{value:h?{runIds:h}:void 0,configurable:!0}),u}async _generateCached({prompts:e,cache:t,llmStringKey:s,parsedOptions:r,handledOptions:a,runId:l}){const u=await L.configure(a.callbacks,this.callbacks,a.tags,this.tags,a.metadata,this.metadata,{verbose:this.verbose}),h={options:r,invocation_params:this?.invocationParams(r),batch_size:e.length},o=await u?.handleLLMStart(this.toJSON(),e,l,void 0,h,void 0,void 0,a?.runName),i=[],v=(await Promise.allSettled(e.map(async(c,m)=>{const _=await t.lookup(c,s);return _==null&&i.push(m),_}))).map((c,m)=>({result:c,runManager:o?.[m]})).filter(({result:c})=>c.status==="fulfilled"&&c.value!=null||c.status==="rejected"),p=[];await Promise.all(v.map(async({result:c,runManager:m},_)=>{if(c.status==="fulfilled"){const y=c.value;return p[_]=y.map(w=>(w.generationInfo={...w.generationInfo,tokenUsage:{}},w)),y.length&&await m?.handleLLMNewToken(y[0].text),m?.handleLLMEnd({generations:[y]},void 0,void 0,void 0,{cached:!0})}else return await m?.handleLLMError(c.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject(c.reason)}));const g={generations:p,missingPromptIndices:i,startedRunManagers:o};return Object.defineProperty(g,P,{value:o?{runIds:o?.map(c=>c.runId)}:void 0,configurable:!0}),g}async generate(e,t,s){if(!Array.isArray(e))throw new Error("Argument 'prompts' is expected to be a string[]");let r;Array.isArray(t)?r={stop:t}:r=t;const[a,l]=this._separateRunnableConfigFromCallOptionsCompat(r);if(a.callbacks=a.callbacks??s,!this.cache)return this._generateUncached(e,l,a);const{cache:u}=this,h=this._getSerializedCacheKeyParametersForCall(l),{generations:o,missingPromptIndices:i,startedRunManagers:d}=await this._generateCached({prompts:e,cache:u,llmStringKey:h,parsedOptions:l,handledOptions:a,runId:a.runId});let v={};if(i.length>0){const p=await this._generateUncached(i.map(g=>e[g]),l,a,d!==void 0?i.map(g=>d?.[g]):void 0);await Promise.all(p.generations.map(async(g,c)=>{const m=i[c];return o[m]=g,u.update(e[m],h,g)})),v=p.llmOutput??{}}return{generations:o,llmOutput:v}}_identifyingParams(){return{}}_modelType(){return"base_llm"}},j=class extends I{async _generate(n,e,t){return{generations:await Promise.all(n.map((r,a)=>this._call(r,{...e,promptIndex:a},t).then(l=>[{text:l}])))}}};export{F as J,j as L,z as c,U as l,A as m,K as o,C as p};
@@ -27,9 +27,9 @@
27
27
  rel="stylesheet"
28
28
  />
29
29
  <title>Inspector | mcp-use</title>
30
- <script type="module" crossorigin src="/inspector/assets/index-BAVnedrl.js"></script>
30
+ <script type="module" crossorigin src="/inspector/assets/index-DjkfvIWz.js"></script>
31
31
  <link rel="stylesheet" crossorigin href="/inspector/assets/index-DlhqMiEp.css">
32
- <script>window.__INSPECTOR_VERSION__ = "0.14.3-canary.1";</script>
32
+ <script>window.__INSPECTOR_VERSION__ = "0.14.3";</script>
33
33
  </head>
34
34
  <body>
35
35
  <script>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mcp-use/inspector",
3
3
  "type": "module",
4
- "version": "0.14.3-canary.1",
4
+ "version": "0.14.3",
5
5
  "description": "MCP Inspector - A tool for inspecting and debugging MCP servers",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -90,7 +90,7 @@
90
90
  "sonner": "^2.0.7",
91
91
  "tailwind-merge": "^3.4.0",
92
92
  "vite-express": "^0.21.1",
93
- "mcp-use": "1.12.3-canary.1"
93
+ "mcp-use": "1.12.3"
94
94
  },
95
95
  "publishConfig": {
96
96
  "access": "public"