From 90652a8e80e992b8f72fdc1358b91ca71e9b569a Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 6 Sep 2026 17:27:30 -0700 Subject: [PATCH 1/8] fix(observability): headline metrics cover the window they are labelled with MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The service performance card showed Operations, P95 and Error rate taken from points.at(-1) — the newest five-minute bucket — while its own footer labelled the card with the whole window. On demo.fanout.run the frontend card read "1,281 operations, P95 48.2ms, healthy" for a window that actually held 15,283 spans at a P95 of 13.7s, which the card's own Compare tab printed correctly one tab away. The newest bucket is also still filling when it is read, so the headline understated both traffic and latency. Performance now carries Totals for the whole scope. The two comparison halves already tile the window, so folding them together reproduces what performanceAggregateQuery returns over the full scope — sum the spans, weight the averages by span count, take the larger P95 — without a third query. Reported in #232 (P0 item 1). Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk --- internal/mcp/apps/performance.html | 2 +- internal/observability/contracts.go | 13 +++++++++++++ internal/observability/performance.go | 16 ++++++++++++++++ internal/observability/service_test.go | 8 ++++++++ ui/apps/src/performance.tsx | 10 +++++++--- ui/contracts.ts | 8 ++++++++ 6 files changed, 53 insertions(+), 4 deletions(-) diff --git a/internal/mcp/apps/performance.html b/internal/mcp/apps/performance.html index d9478339e..dd0051030 100644 --- a/internal/mcp/apps/performance.html +++ b/internal/mcp/apps/performance.html @@ -122,7 +122,7 @@ - omitted: host decides border`)}),Z({method:Q(`ui/request-display-mode`),params:Z({mode:G9.describe(`The display mode being requested.`)})});var poe=Z({mode:G9.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),moe=$6([Q(`model`),Q(`app`)]).describe(`Tool visibility scope - who can access the tool.`);Z({resourceUri:X().optional(),visibility:Y6(moe).optional().describe(`Who can access this tool. Default: ["model", "app"] - "model": Tool visible to and callable by the agent - "app": Tool callable by the app from this server only`),csp:K6().optional(),permissions:K6().optional()}),Z({mimeTypes:Y6(X()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Z({method:Q(`ui/download-file`),params:Z({contents:Y6($6([D9,O9])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),Z({method:Q(`ui/message`),params:Z({role:Q(`user`).describe(`Message role, currently only "user" is supported.`),content:Y6(k9).describe(`Message content blocks (text, image, etc.).`)})}),Z({method:Q(`ui/notifications/sandbox-resource-ready`),params:Z({html:X().describe(`HTML content to load into the inner iframe.`),sandbox:X().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:K9.optional().describe(`CSP configuration from resource metadata.`),permissions:q9.optional().describe(`Sandbox permissions from resource metadata.`)})});var hoe=Z({method:Q(`ui/notifications/tool-result`),params:M9.describe(`Standard MCP tool execution result.`)}),Y9=Z({toolInfo:Z({id:H7.optional().describe(`JSON-RPC id of the tools/call request.`),tool:A9.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:eoe.optional().describe(`Current color theme preference.`),styles:loe.optional().describe(`Style configuration for theming the app.`),displayMode:G9.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:Y6(G9).optional().describe(`Display modes the host supports.`),containerDimensions:$6([Z({height:j6().describe(`Fixed container height in pixels.`)}),Z({maxHeight:$6([j6(),H6()]).optional().describe(`Maximum container height in pixels.`)})]).and($6([Z({width:j6().describe(`Fixed container width in pixels.`)}),Z({maxWidth:$6([j6(),H6()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other -container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:X().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:X().optional().describe(`User's timezone in IANA format.`),userAgent:X().optional().describe(`Host application identifier.`),platform:$6([Q(`web`),Q(`desktop`),Q(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:Z({touch:L6().optional().describe(`Whether the device supports touch input.`),hover:L6().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:Z({top:j6().describe(`Top safe area inset in pixels.`),right:j6().describe(`Right safe area inset in pixels.`),bottom:j6().describe(`Bottom safe area inset in pixels.`),left:j6().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),goe=Z({method:Q(`ui/notifications/host-context-changed`),params:Y9.describe(`Partial context update containing only changed fields.`)});Z({method:Q(`ui/update-model-context`),params:Z({content:Y6(k9).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:i8(X(),G6().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Z({method:Q(`ui/initialize`),params:Z({appInfo:e9.describe(`App identification (name and version).`),appCapabilities:foe.describe(`Features and capabilities this app provides.`),protocolVersion:X().describe(`Protocol version this app supports.`)})});var _oe=Z({protocolVersion:X().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:e9.describe(`Host application identification and version.`),hostCapabilities:doe.describe(`Features and capabilities provided by the host.`),hostContext:Y9.describe(`Rich context about the host environment.`)}).passthrough(),voe={target:`draft-2020-12`};async function X9(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](voe);if(n.vendor===`zod`){let{z:n}=await Zae(async()=>{let{z:e}=await Promise.resolve().then(()=>(A7(),vie));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Z9(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}var yoe=class e extends Qae{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:aoe,toolinputpartial:ooe,toolresult:hoe,toolcancelled:soe,hostcontextchanged:goe};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||MW({jitless:!0}),this.setRequestHandler(t9,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=Jae(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await Z9(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Z9(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await X9(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await X9(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(uoe,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(N9,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(j9,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},M9,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},C9,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},x9,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?L9:I9;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},ioe,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},X7,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},noe,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},roe,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},poe,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new W9(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:$ae}},_oe,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function boe({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,W.useState)(null),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null);return(0,W.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new W9(window.parent,window.parent);if(s=new yoe(e,t,{autoResize:r,strict:i}),n?.(s),await s.connect(l),!a){s.close();return}o(s),c(!0),u(null)}catch(e){a&&(o(null),c(!1),u(e instanceof Error?e:Error(`Failed to connect`)))}}return l(),()=>{a=!1,s?.close()}},[]),{app:a,isConnected:s,error:l}}function xoe(e){let[t,n]=(0,W.useState)(null),[r,i]=(0,W.useState)({}),[a,o]=(0,W.useState)(),[s,c]=(0,W.useState)(null);function l(e){if(e.isError){c(`This view could not be refreshed. Please try again.`);return}c(null),n(e.structuredContent)}let u=boe({appInfo:{name:e,version:`1.0.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>{i(e.arguments??{})},e.ontoolresult=l,e.onhostcontextchanged=e=>o(t=>({...t,...e})),e.onerror=e=>{console.error(`MCP app error`,e),c(`This view could not be refreshed. Please try again.`)}}});(0,W.useEffect)(()=>{u.app&&o(u.app.getHostContext())},[u.app]);async function d(e){if(u.app)try{l(await u.app.callServerTool({name:e,arguments:r}))}catch(t){console.error(`Tool call ${e} failed`,t),c(`This view could not be refreshed. Please try again.`)}}return{...u,result:t,toolInput:r,host:a,toolError:s,callTool:d}}async function Soe(e,t){e&&await e.sendMessage({role:`user`,content:[{type:`text`,text:t}]})}VE([ib,bO]);function Coe(){let{app:e,callTool:t,error:n,host:r,result:i,toolError:a}=xoe(`Fanout service performance`),[o,s]=(0,W.useState)(`activity`),c=r?.theme===`dark`;return(0,G.jsxs)(ER,{dark:c,children:[(0,G.jsx)(DR,{title:i?.data.service||`System performance`,summary:i?`Traffic, latency, and errors ${i.data.service?`for ${i.data.service}`:`across all services`}`:void 0,onRefresh:()=>t(`service_performance`),disabled:!e}),(0,G.jsx)(OR,{error:a??(n?`This view could not be loaded. Please try again.`:null),loading:!i&&!n&&!a?`Loading performance signals…`:void 0,retry:()=>void t(`service_performance`)}),i&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(kR,{active:o,onChange:s,items:[{id:`activity`,label:`Activity`},{id:`latency`,label:`Latency map`},{id:`endpoints`,label:`Endpoints`,count:i.data.endpoints.length},{id:`compare`,label:`Compare`}]}),o===`activity`&&(0,G.jsx)(woe,{data:i.data,dark:c,window:i.provenance.window}),o===`latency`&&(0,G.jsx)(Toe,{data:i.data,dark:c,window:i.provenance.window}),o===`endpoints`&&(0,G.jsx)(Eoe,{endpoints:i.data.endpoints,onEndpoint:t=>Soe(e,`Investigate ${t.method} ${t.path}. Explain its latency and errors.`)}),o===`compare`&&(0,G.jsx)(Doe,{data:i.data}),(0,G.jsx)(jR,{left:SU(i.provenance.window),right:`Updated ${new Date(i.provenance.generated_at).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`})]})]})}function woe({data:e,dark:t,window:n}){let r=e.points.at(-1);if(!r)return(0,G.jsx)(AR,{tall:!0,icon:(0,G.jsx)(lR,{size:20,weight:`duotone`}),title:`No activity in this window`,children:`Trends will appear as activity is recorded.`});let i=e.points.map(e=>e.time);return(0,G.jsxs)(dL,{px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,G.jsxs)(cL,{cols:{base:1,xs:3},spacing:`sm`,children:[(0,G.jsx)(MR,{label:`Operations`,value:yU.format(r.spans)}),(0,G.jsx)(MR,{label:`P95 latency`,value:xU(r.p95_ms),color:r.p95_ms>=750?`warn`:`ok`}),(0,G.jsx)(MR,{label:`Error rate`,value:bU(r.error_rate),color:r.error_rate>=.01?`bad`:`ok`})]}),(0,G.jsx)(Q9,{dark:t,labels:i,title:`Traffic and logs`,window:n,series:[{name:`Operations`,data:e.points.map(e=>e.spans),color:RR(`operations`,t)},{name:`Logs`,data:e.points.map(e=>e.log_count),color:RR(`logs`,t)}]}),(0,G.jsx)(Q9,{dark:t,labels:i,title:`Latency and error correlation`,window:n,series:[{name:`P95 latency`,data:e.points.map(e=>e.p95_ms),color:LR(t).warn},{name:`Error rate × 1000`,data:e.points.map(e=>e.error_rate*1e3),color:LR(t).bad}]})]})}function Q9({labels:e,title:t,series:n,dark:r,window:i}){let a=(0,W.useMemo)(()=>{let t=IR(r);return{color:n.map(e=>e.color),grid:{left:42,right:18,top:42,bottom:30},legend:{top:5,left:0,textStyle:{color:t.muted,fontSize:10},icon:`circle`,itemWidth:7,itemHeight:7},tooltip:{trigger:`axis`,backgroundColor:t.surface,borderColor:t.border,textStyle:{color:t.text,fontSize:10}},xAxis:{type:`category`,data:e.map(e=>CU(e,i)),boundaryGap:!1,axisLine:{lineStyle:{color:t.border}},axisTick:{show:!1},axisLabel:{color:t.muted,fontSize:9,hideOverlap:!0}},yAxis:{type:`value`,splitLine:{lineStyle:{color:t.grid}},axisLabel:{color:t.muted,fontSize:9}},series:n.map(e=>({name:e.name,type:`line`,data:e.data,smooth:.22,showSymbol:!1,lineStyle:{width:2},areaStyle:{opacity:.045}}))}},[r,e,n,i]);return(0,G.jsxs)(mF,{withBorder:!0,radius:`md`,p:`sm`,children:[(0,G.jsx)(hI,{fw:650,size:`sm`,mb:`xs`,children:t}),(0,G.jsx)(vU,{option:a,height:210,label:t})]})}function Toe({data:e,dark:t,window:n}){let r=(0,W.useMemo)(()=>({services:[...new Set(e.heatmap.map(e=>e.service))],times:[...new Set(e.heatmap.map(e=>e.time))],values:new Map(e.heatmap.map(e=>[`${e.service}\u0000${e.time}`,e.p95_ms])),max:Math.max(...e.heatmap.map(e=>e.p95_ms),1)}),[e.heatmap]);if(r.services.length===0)return(0,G.jsx)(AR,{tall:!0,icon:(0,G.jsx)(sR,{size:20,weight:`duotone`}),title:`No latency samples yet`,children:`The heatmap will compare service latency across time buckets.`});let i=IR(t),a={grid:{left:105,right:20,top:20,bottom:45},tooltip:{position:`top`,backgroundColor:i.surface,borderColor:i.border,textStyle:{color:i.text,fontSize:10},formatter:e=>`${r.services[e.data[1]]}
${xU(e.data[2])}`},xAxis:{type:`category`,data:r.times.map(e=>CU(e,n)),splitArea:{show:!0},axisLabel:{color:i.muted,fontSize:9,hideOverlap:!0},axisLine:{lineStyle:{color:i.border}}},yAxis:{type:`category`,data:r.services,splitArea:{show:!0},axisLabel:{color:i.text,fontSize:9},axisLine:{lineStyle:{color:i.border}}},visualMap:{min:0,max:r.max,calculable:!0,orient:`horizontal`,left:`center`,bottom:0,textStyle:{color:i.muted,fontSize:8},inRange:{color:[i.grid,LR(t).warn,LR(t).bad]}},series:[{type:`heatmap`,data:r.services.flatMap((e,t)=>r.times.map((n,i)=>[i,t,r.values.get(`${e}\u0000${n}`)??0]))}]};return(0,G.jsx)(mF,{withBorder:!0,radius:`md`,mx:{base:`md`,sm:`lg`},mb:`md`,p:`xs`,children:(0,G.jsx)(vU,{option:a,height:Math.max(280,r.services.length*32+110),label:`Service P95 latency heatmap`})})}function Eoe({endpoints:e,onEndpoint:t}){let n=NR(e,8);return e.length===0?(0,G.jsx)(AR,{tall:!0,icon:(0,G.jsx)(rR,{size:20,weight:`duotone`}),title:`No endpoints detected`,children:`HTTP routes and span operations will appear here as traffic arrives.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(EL.ScrollContainer,{minWidth:700,children:(0,G.jsxs)(EL,{striped:!0,highlightOnHover:!0,verticalSpacing:`sm`,children:[(0,G.jsx)(EL.Thead,{children:(0,G.jsxs)(EL.Tr,{children:[(0,G.jsx)(EL.Th,{children:`Endpoint`}),(0,G.jsx)(EL.Th,{ta:`right`,children:`Calls`}),(0,G.jsx)(EL.Th,{ta:`right`,children:`P50`}),(0,G.jsx)(EL.Th,{ta:`right`,children:`P95`}),(0,G.jsx)(EL.Th,{ta:`right`,children:`P99`}),(0,G.jsx)(EL.Th,{ta:`right`,children:`Errors`})]})}),(0,G.jsx)(EL.Tbody,{children:n.pageItems.map(e=>(0,G.jsxs)(EL.Tr,{tabIndex:0,onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&t(e)},style:{cursor:`pointer`},children:[(0,G.jsxs)(EL.Td,{children:[(0,G.jsx)(vI,{variant:`light`,mr:`xs`,children:e.method}),(0,G.jsx)(hI,{component:`span`,ff:`monospace`,size:`sm`,children:e.path})]}),(0,G.jsx)(EL.Td,{ta:`right`,children:yU.format(e.calls)}),(0,G.jsx)(EL.Td,{ta:`right`,children:xU(e.p50_ms)}),(0,G.jsx)(EL.Td,{ta:`right`,children:xU(e.p95_ms)}),(0,G.jsx)(EL.Td,{ta:`right`,children:xU(e.p99_ms)}),(0,G.jsx)(EL.Td,{ta:`right`,children:(0,G.jsx)(hI,{c:FR(e.health),children:bU(e.error_rate)})})]},`${e.method}-${e.path}`))})]})}),(0,G.jsx)(PR,{...n,onChange:n.setPage})]})}function Doe({data:e}){return e.comparison.length===0?(0,G.jsx)(AR,{tall:!0,icon:(0,G.jsx)(aR,{size:20,weight:`duotone`}),title:`Nothing to compare yet`,children:`Fanout compares the first and second half of the selected window.`}):(0,G.jsx)(EL.ScrollContainer,{minWidth:620,children:(0,G.jsxs)(EL,{striped:!0,verticalSpacing:`sm`,children:[(0,G.jsx)(EL.Thead,{children:(0,G.jsxs)(EL.Tr,{children:[(0,G.jsx)(EL.Th,{children:`Signal`}),(0,G.jsx)(EL.Th,{children:`Earlier`}),(0,G.jsx)(EL.Th,{children:`Change`}),(0,G.jsx)(EL.Th,{children:`Recent`})]})}),(0,G.jsx)(EL.Tbody,{children:e.comparison.map(e=>(0,G.jsxs)(EL.Tr,{children:[(0,G.jsxs)(EL.Td,{children:[(0,G.jsx)(hI,{fw:650,children:e.label}),(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,children:e.unit})]}),(0,G.jsx)(EL.Td,{children:$9(e.before,e.unit)}),(0,G.jsxs)(EL.Td,{children:[(0,G.jsxs)(vI,{color:e.direction===`improvement`?`ok`:e.direction===`regression`?`bad`:`gray`,variant:`light`,children:[e.change_pct>0?`↑`:e.change_pct<0?`↓`:`→`,` `,Math.abs(e.change_pct).toFixed(1),`%`]}),e.significant&&(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,mt:3,children:`notable`})]}),(0,G.jsx)(EL.Td,{children:$9(e.after,e.unit)})]},e.label))})]})})}function $9(e,t){return t===`ms`?xU(e):t===`%`?`${e.toFixed(2)}%`:yU.format(e)}(0,pR.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(W.StrictMode,{children:(0,G.jsx)(Coe,{})})); +container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:X().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:X().optional().describe(`User's timezone in IANA format.`),userAgent:X().optional().describe(`Host application identifier.`),platform:$6([Q(`web`),Q(`desktop`),Q(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:Z({touch:L6().optional().describe(`Whether the device supports touch input.`),hover:L6().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:Z({top:j6().describe(`Top safe area inset in pixels.`),right:j6().describe(`Right safe area inset in pixels.`),bottom:j6().describe(`Bottom safe area inset in pixels.`),left:j6().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),goe=Z({method:Q(`ui/notifications/host-context-changed`),params:Y9.describe(`Partial context update containing only changed fields.`)});Z({method:Q(`ui/update-model-context`),params:Z({content:Y6(k9).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:i8(X(),G6().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Z({method:Q(`ui/initialize`),params:Z({appInfo:e9.describe(`App identification (name and version).`),appCapabilities:foe.describe(`Features and capabilities this app provides.`),protocolVersion:X().describe(`Protocol version this app supports.`)})});var _oe=Z({protocolVersion:X().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:e9.describe(`Host application identification and version.`),hostCapabilities:doe.describe(`Features and capabilities provided by the host.`),hostContext:Y9.describe(`Rich context about the host environment.`)}).passthrough(),voe={target:`draft-2020-12`};async function X9(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](voe);if(n.vendor===`zod`){let{z:n}=await Zae(async()=>{let{z:e}=await Promise.resolve().then(()=>(A7(),vie));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function Z9(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}var yoe=class e extends Qae{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:aoe,toolinputpartial:ooe,toolresult:hoe,toolcancelled:soe,hostcontextchanged:goe};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||MW({jitless:!0}),this.setRequestHandler(t9,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=Jae(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await Z9(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Z9(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await X9(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await X9(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(uoe,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(N9,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(j9,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},M9,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},C9,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},x9,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?L9:I9;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},ioe,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},X7,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},noe,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},roe,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},poe,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new W9(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:$ae}},_oe,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function boe({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,W.useState)(null),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null);return(0,W.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new W9(window.parent,window.parent);if(s=new yoe(e,t,{autoResize:r,strict:i}),n?.(s),await s.connect(l),!a){s.close();return}o(s),c(!0),u(null)}catch(e){a&&(o(null),c(!1),u(e instanceof Error?e:Error(`Failed to connect`)))}}return l(),()=>{a=!1,s?.close()}},[]),{app:a,isConnected:s,error:l}}function xoe(e){let[t,n]=(0,W.useState)(null),[r,i]=(0,W.useState)({}),[a,o]=(0,W.useState)(),[s,c]=(0,W.useState)(null);function l(e){if(e.isError){c(`This view could not be refreshed. Please try again.`);return}c(null),n(e.structuredContent)}let u=boe({appInfo:{name:e,version:`1.0.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>{i(e.arguments??{})},e.ontoolresult=l,e.onhostcontextchanged=e=>o(t=>({...t,...e})),e.onerror=e=>{console.error(`MCP app error`,e),c(`This view could not be refreshed. Please try again.`)}}});(0,W.useEffect)(()=>{u.app&&o(u.app.getHostContext())},[u.app]);async function d(e){if(u.app)try{l(await u.app.callServerTool({name:e,arguments:r}))}catch(t){console.error(`Tool call ${e} failed`,t),c(`This view could not be refreshed. Please try again.`)}}return{...u,result:t,toolInput:r,host:a,toolError:s,callTool:d}}async function Soe(e,t){e&&await e.sendMessage({role:`user`,content:[{type:`text`,text:t}]})}VE([ib,bO]);function Coe(){let{app:e,callTool:t,error:n,host:r,result:i,toolError:a}=xoe(`Fanout service performance`),[o,s]=(0,W.useState)(`activity`),c=r?.theme===`dark`;return(0,G.jsxs)(ER,{dark:c,children:[(0,G.jsx)(DR,{title:i?.data.service||`System performance`,summary:i?`Traffic, latency, and errors ${i.data.service?`for ${i.data.service}`:`across all services`}`:void 0,onRefresh:()=>t(`service_performance`),disabled:!e}),(0,G.jsx)(OR,{error:a??(n?`This view could not be loaded. Please try again.`:null),loading:!i&&!n&&!a?`Loading performance signals…`:void 0,retry:()=>void t(`service_performance`)}),i&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(kR,{active:o,onChange:s,items:[{id:`activity`,label:`Activity`},{id:`latency`,label:`Latency map`},{id:`endpoints`,label:`Endpoints`,count:i.data.endpoints.length},{id:`compare`,label:`Compare`}]}),o===`activity`&&(0,G.jsx)(woe,{data:i.data,dark:c,window:i.provenance.window}),o===`latency`&&(0,G.jsx)(Toe,{data:i.data,dark:c,window:i.provenance.window}),o===`endpoints`&&(0,G.jsx)(Eoe,{endpoints:i.data.endpoints,onEndpoint:t=>Soe(e,`Investigate ${t.method} ${t.path}. Explain its latency and errors.`)}),o===`compare`&&(0,G.jsx)(Doe,{data:i.data}),(0,G.jsx)(jR,{left:SU(i.provenance.window),right:`Updated ${new Date(i.provenance.generated_at).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`})]})]})}function woe({data:e,dark:t,window:n}){if(e.points.length===0)return(0,G.jsx)(AR,{tall:!0,icon:(0,G.jsx)(lR,{size:20,weight:`duotone`}),title:`No activity in this window`,children:`Trends will appear as activity is recorded.`});let{totals:r}=e,i=e.points.map(e=>e.time);return(0,G.jsxs)(dL,{px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,G.jsxs)(cL,{cols:{base:1,xs:3},spacing:`sm`,children:[(0,G.jsx)(MR,{label:`Operations`,value:yU.format(r.spans)}),(0,G.jsx)(MR,{label:`P95 latency`,value:xU(r.p95_ms),color:r.p95_ms>=750?`warn`:`ok`}),(0,G.jsx)(MR,{label:`Error rate`,value:bU(r.error_rate),color:r.error_rate>=.01?`bad`:`ok`})]}),(0,G.jsx)(Q9,{dark:t,labels:i,title:`Traffic and logs`,window:n,series:[{name:`Operations`,data:e.points.map(e=>e.spans),color:RR(`operations`,t)},{name:`Logs`,data:e.points.map(e=>e.log_count),color:RR(`logs`,t)}]}),(0,G.jsx)(Q9,{dark:t,labels:i,title:`Latency and error correlation`,window:n,series:[{name:`P95 latency`,data:e.points.map(e=>e.p95_ms),color:LR(t).warn},{name:`Error rate × 1000`,data:e.points.map(e=>e.error_rate*1e3),color:LR(t).bad}]})]})}function Q9({labels:e,title:t,series:n,dark:r,window:i}){let a=(0,W.useMemo)(()=>{let t=IR(r);return{color:n.map(e=>e.color),grid:{left:42,right:18,top:42,bottom:30},legend:{top:5,left:0,textStyle:{color:t.muted,fontSize:10},icon:`circle`,itemWidth:7,itemHeight:7},tooltip:{trigger:`axis`,backgroundColor:t.surface,borderColor:t.border,textStyle:{color:t.text,fontSize:10}},xAxis:{type:`category`,data:e.map(e=>CU(e,i)),boundaryGap:!1,axisLine:{lineStyle:{color:t.border}},axisTick:{show:!1},axisLabel:{color:t.muted,fontSize:9,hideOverlap:!0}},yAxis:{type:`value`,splitLine:{lineStyle:{color:t.grid}},axisLabel:{color:t.muted,fontSize:9}},series:n.map(e=>({name:e.name,type:`line`,data:e.data,smooth:.22,showSymbol:!1,lineStyle:{width:2},areaStyle:{opacity:.045}}))}},[r,e,n,i]);return(0,G.jsxs)(mF,{withBorder:!0,radius:`md`,p:`sm`,children:[(0,G.jsx)(hI,{fw:650,size:`sm`,mb:`xs`,children:t}),(0,G.jsx)(vU,{option:a,height:210,label:t})]})}function Toe({data:e,dark:t,window:n}){let r=(0,W.useMemo)(()=>({services:[...new Set(e.heatmap.map(e=>e.service))],times:[...new Set(e.heatmap.map(e=>e.time))],values:new Map(e.heatmap.map(e=>[`${e.service}\u0000${e.time}`,e.p95_ms])),max:Math.max(...e.heatmap.map(e=>e.p95_ms),1)}),[e.heatmap]);if(r.services.length===0)return(0,G.jsx)(AR,{tall:!0,icon:(0,G.jsx)(sR,{size:20,weight:`duotone`}),title:`No latency samples yet`,children:`The heatmap will compare service latency across time buckets.`});let i=IR(t),a={grid:{left:105,right:20,top:20,bottom:45},tooltip:{position:`top`,backgroundColor:i.surface,borderColor:i.border,textStyle:{color:i.text,fontSize:10},formatter:e=>`${r.services[e.data[1]]}
${xU(e.data[2])}`},xAxis:{type:`category`,data:r.times.map(e=>CU(e,n)),splitArea:{show:!0},axisLabel:{color:i.muted,fontSize:9,hideOverlap:!0},axisLine:{lineStyle:{color:i.border}}},yAxis:{type:`category`,data:r.services,splitArea:{show:!0},axisLabel:{color:i.text,fontSize:9},axisLine:{lineStyle:{color:i.border}}},visualMap:{min:0,max:r.max,calculable:!0,orient:`horizontal`,left:`center`,bottom:0,textStyle:{color:i.muted,fontSize:8},inRange:{color:[i.grid,LR(t).warn,LR(t).bad]}},series:[{type:`heatmap`,data:r.services.flatMap((e,t)=>r.times.map((n,i)=>[i,t,r.values.get(`${e}\u0000${n}`)??0]))}]};return(0,G.jsx)(mF,{withBorder:!0,radius:`md`,mx:{base:`md`,sm:`lg`},mb:`md`,p:`xs`,children:(0,G.jsx)(vU,{option:a,height:Math.max(280,r.services.length*32+110),label:`Service P95 latency heatmap`})})}function Eoe({endpoints:e,onEndpoint:t}){let n=NR(e,8);return e.length===0?(0,G.jsx)(AR,{tall:!0,icon:(0,G.jsx)(rR,{size:20,weight:`duotone`}),title:`No endpoints detected`,children:`HTTP routes and span operations will appear here as traffic arrives.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(EL.ScrollContainer,{minWidth:700,children:(0,G.jsxs)(EL,{striped:!0,highlightOnHover:!0,verticalSpacing:`sm`,children:[(0,G.jsx)(EL.Thead,{children:(0,G.jsxs)(EL.Tr,{children:[(0,G.jsx)(EL.Th,{children:`Endpoint`}),(0,G.jsx)(EL.Th,{ta:`right`,children:`Calls`}),(0,G.jsx)(EL.Th,{ta:`right`,children:`P50`}),(0,G.jsx)(EL.Th,{ta:`right`,children:`P95`}),(0,G.jsx)(EL.Th,{ta:`right`,children:`P99`}),(0,G.jsx)(EL.Th,{ta:`right`,children:`Errors`})]})}),(0,G.jsx)(EL.Tbody,{children:n.pageItems.map(e=>(0,G.jsxs)(EL.Tr,{tabIndex:0,onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&t(e)},style:{cursor:`pointer`},children:[(0,G.jsxs)(EL.Td,{children:[(0,G.jsx)(vI,{variant:`light`,mr:`xs`,children:e.method}),(0,G.jsx)(hI,{component:`span`,ff:`monospace`,size:`sm`,children:e.path})]}),(0,G.jsx)(EL.Td,{ta:`right`,children:yU.format(e.calls)}),(0,G.jsx)(EL.Td,{ta:`right`,children:xU(e.p50_ms)}),(0,G.jsx)(EL.Td,{ta:`right`,children:xU(e.p95_ms)}),(0,G.jsx)(EL.Td,{ta:`right`,children:xU(e.p99_ms)}),(0,G.jsx)(EL.Td,{ta:`right`,children:(0,G.jsx)(hI,{c:FR(e.health),children:bU(e.error_rate)})})]},`${e.method}-${e.path}`))})]})}),(0,G.jsx)(PR,{...n,onChange:n.setPage})]})}function Doe({data:e}){return e.comparison.length===0?(0,G.jsx)(AR,{tall:!0,icon:(0,G.jsx)(aR,{size:20,weight:`duotone`}),title:`Nothing to compare yet`,children:`Fanout compares the first and second half of the selected window.`}):(0,G.jsx)(EL.ScrollContainer,{minWidth:620,children:(0,G.jsxs)(EL,{striped:!0,verticalSpacing:`sm`,children:[(0,G.jsx)(EL.Thead,{children:(0,G.jsxs)(EL.Tr,{children:[(0,G.jsx)(EL.Th,{children:`Signal`}),(0,G.jsx)(EL.Th,{children:`Earlier`}),(0,G.jsx)(EL.Th,{children:`Change`}),(0,G.jsx)(EL.Th,{children:`Recent`})]})}),(0,G.jsx)(EL.Tbody,{children:e.comparison.map(e=>(0,G.jsxs)(EL.Tr,{children:[(0,G.jsxs)(EL.Td,{children:[(0,G.jsx)(hI,{fw:650,children:e.label}),(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,children:e.unit})]}),(0,G.jsx)(EL.Td,{children:$9(e.before,e.unit)}),(0,G.jsxs)(EL.Td,{children:[(0,G.jsxs)(vI,{color:e.direction===`improvement`?`ok`:e.direction===`regression`?`bad`:`gray`,variant:`light`,children:[e.change_pct>0?`↑`:e.change_pct<0?`↓`:`→`,` `,Math.abs(e.change_pct).toFixed(1),`%`]}),e.significant&&(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,mt:3,children:`notable`})]}),(0,G.jsx)(EL.Td,{children:$9(e.after,e.unit)})]},e.label))})]})})}function $9(e,t){return t===`ms`?xU(e):t===`%`?`${e.toFixed(2)}%`:yU.format(e)}(0,pR.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(W.StrictMode,{children:(0,G.jsx)(Coe,{})}));
diff --git a/internal/observability/contracts.go b/internal/observability/contracts.go index 44946c233..a1d5827e3 100644 --- a/internal/observability/contracts.go +++ b/internal/observability/contracts.go @@ -136,8 +136,21 @@ type ComparisonMetric struct { Significant bool `json:"significant"` } +// PerformanceTotals covers the whole requested window, so a headline figure +// agrees with the window the view is labelled with. Points are per-bucket and +// the last one is still filling, so reading a headline off it reports a +// fraction of the traffic and whatever latency the final seconds happened to +// see. +type PerformanceTotals struct { + Spans int64 `json:"spans"` + ErrorRate float64 `json:"error_rate"` + P50MS float64 `json:"p50_ms"` + P95MS float64 `json:"p95_ms"` +} + type Performance struct { Service string `json:"service,omitempty"` + Totals PerformanceTotals `json:"totals"` Points []PerformancePoint `json:"points"` Endpoints []Endpoint `json:"endpoints"` Heatmap []HeatmapPoint `json:"heatmap"` diff --git a/internal/observability/performance.go b/internal/observability/performance.go index 197b06d99..8c3fdeaad 100644 --- a/internal/observability/performance.go +++ b/internal/observability/performance.go @@ -282,6 +282,7 @@ func (s *Service) Performance(ctx context.Context, scope Scope, service string, if err != nil { return Result[Performance]{}, err } + data.Totals = totalsOf(before, after) data.Comparison = []ComparisonMetric{ comparisonMetric("Throughput", "spans", before.Spans, after.Spans, false), comparisonMetric("Error rate", "%", before.ErrorRate*100, after.ErrorRate*100, true), @@ -410,6 +411,21 @@ func (s *Service) performanceAggregate(ctx context.Context, scope Scope, service return value, rows.Err() } +// totalsOf folds the two comparison halves back into one window rather than +// running a third aggregate query: the halves tile the window exactly, so +// summing spans, weighting the averages by span count and taking the larger +// P95 reproduces what performanceAggregateQuery would return over the whole +// scope. Keep these three rules in step with that query. +func totalsOf(before, after performanceAggregate) PerformanceTotals { + spans := before.Spans + after.Spans + totals := PerformanceTotals{Spans: int64(spans), P95MS: math.Max(before.P95MS, after.P95MS)} + if spans > 0 { + totals.ErrorRate = (before.ErrorRate*before.Spans + after.ErrorRate*after.Spans) / spans + totals.P50MS = (before.P50MS*before.Spans + after.P50MS*after.Spans) / spans + } + return totals +} + func comparisonMetric(label, unit string, before, after float64, lowerIsBetter bool) ComparisonMetric { change := 0.0 if before != 0 { diff --git a/internal/observability/service_test.go b/internal/observability/service_test.go index 240859d9d..a68349795 100644 --- a/internal/observability/service_test.go +++ b/internal/observability/service_test.go @@ -3,6 +3,7 @@ package observability import ( "context" "errors" + "math" "regexp" "strings" "testing" @@ -205,6 +206,13 @@ func TestPerformanceReturnsAllVisualizationDatasets(t *testing.T) { if result.Data.Comparison[1].Direction != "improvement" { t.Fatalf("error-rate comparison = %#v", result.Data.Comparison[1]) } + // Totals cover the window, so they are the two halves folded together and + // not the newest bucket: a headline read off that bucket would say 220ms + // here, and the window's worst P95 is 240ms. + totals := result.Data.Totals + if totals.Spans != 120 || math.Abs(totals.ErrorRate-0.085) > 1e-9 || math.Abs(totals.P50MS-78.333333) > 1e-6 || totals.P95MS != 240 { + t.Fatalf("performance totals = %#v", totals) + } if err := mock.ExpectationsWereMet(); err != nil { t.Fatal(err) } diff --git a/ui/apps/src/performance.tsx b/ui/apps/src/performance.tsx index d9a5c90a4..8d49a1f33 100644 --- a/ui/apps/src/performance.tsx +++ b/ui/apps/src/performance.tsx @@ -33,11 +33,15 @@ function PerformanceApp() { } function ActivityView({ data, dark, window }: { data: Performance; dark: boolean; window: string }) { - const last = data.points.at(-1); - if (!last) return } title="No activity in this window">Trends will appear as activity is recorded.; + if (data.points.length === 0) return } title="No activity in this window">Trends will appear as activity is recorded.; + // The tiles read totals, not points.at(-1): the footer labels this card with + // the whole window, and the newest bucket is both a fraction of it and still + // filling, so a headline taken from it disagrees with the chart underneath it + // and with the Compare tab beside it. + const { totals } = data; const labels = data.points.map((point) => point.time); return - = 750 ? "warn" : "ok"} />= .01 ? "bad" : "ok"} /> + = 750 ? "warn" : "ok"} />= .01 ? "bad" : "ok"} /> point.spans), color: seriesColor("operations", dark) }, { name: "Logs", data: data.points.map((point) => point.log_count), color: seriesColor("logs", dark) }]} /> point.p95_ms), color: statusHex(dark).warn }, { name: "Error rate × 1000", data: data.points.map((point) => point.error_rate * 1000), color: statusHex(dark).bad }]} /> ; diff --git a/ui/contracts.ts b/ui/contracts.ts index 01dcf9878..c19481199 100644 --- a/ui/contracts.ts +++ b/ui/contracts.ts @@ -86,8 +86,16 @@ export interface ComparisonMetric { significant: boolean; } +export interface PerformanceTotals { + spans: number; + error_rate: number; + p50_ms: number; + p95_ms: number; +} + export interface Performance { service?: string; + totals: PerformanceTotals; points: PerformancePoint[]; endpoints: Endpoint[]; heatmap: HeatmapPoint[]; From b6523181a3b3c3bbaa8fe0b32dd9780089e6e486 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 6 Sep 2026 17:35:25 -0700 Subject: [PATCH 2/8] fix(observability): an empty window reports no data, not health MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit overallHealth returned "healthy" whenever no service was unhealthy or degraded — including when no service reported at all. Typing a namespace that matches nothing rendered "Health: Healthy · 0 services · Error rate 0.00%" over an empty distribution bar: the same answer a genuinely clean system gets. The summary the model reads said "0 services: 0 unhealthy, 0 degraded, 0 healthy", which reads as a pass rather than as silence. Health gains an "unknown" state for a window with nothing in it. The overview summary says so in words, the dashboard tile reads "No data" with a neutral colour, and the rate and distribution — neither of which has anything to describe — are withheld rather than shown as zero. Reported in #232 (P0 item 2). Stacked on fix/performance-window-totals. Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk --- internal/mcp/apps/overview.html | 4 +-- internal/mcp/apps/performance.html | 2 +- internal/observability/contracts.go | 5 ++++ internal/observability/overview.go | 9 ++++++- internal/observability/service.go | 3 +++ internal/observability/service_test.go | 26 +++++++++++++++++++ .../{chat-BWEtId3_.js => chat-D-J8SUFh.js} | 6 ++--- .../ui/dist/assets/chat._threadId-DC_eOz23.js | 1 - .../ui/dist/assets/chat._threadId-DSIYq_x1.js | 1 + .../ui/dist/assets/chat.index-DC_eOz23.js | 1 - .../ui/dist/assets/chat.index-DSIYq_x1.js | 1 + .../{copy-BcWHRdqc.js => copy-CUb9ms1Q.js} | 2 +- ...oard-DFF2_SFC.js => dashboard-Dl2pFM2h.js} | 4 +-- ...js => dashboards._dashboardId-Dlv44ftW.js} | 2 +- ...3GETbb.js => dashboards.index-BuFeceag.js} | 2 +- .../{index-DYcEv4SB.js => index-BxnvJp0Y.js} | 4 +-- ...-T5JN5RKZ.js => mcp-app-frame-D0PVhqdW.js} | 2 +- ...{routes-BNP_b_GZ.js => routes-DdP3ZNeG.js} | 2 +- internal/ui/dist/index.html | 2 +- ui/apps/src/overview.tsx | 10 ++++--- ui/chart.ts | 7 ++++- ui/contracts.ts | 4 ++- ui/host/src/widgets/overview.tsx | 12 ++++++--- ui/host/src/widgets/widgets.test.tsx | 16 ++++++++++++ 24 files changed, 100 insertions(+), 28 deletions(-) rename internal/ui/dist/assets/{chat-BWEtId3_.js => chat-D-J8SUFh.js} (99%) delete mode 100644 internal/ui/dist/assets/chat._threadId-DC_eOz23.js create mode 100644 internal/ui/dist/assets/chat._threadId-DSIYq_x1.js delete mode 100644 internal/ui/dist/assets/chat.index-DC_eOz23.js create mode 100644 internal/ui/dist/assets/chat.index-DSIYq_x1.js rename internal/ui/dist/assets/{copy-BcWHRdqc.js => copy-CUb9ms1Q.js} (98%) rename internal/ui/dist/assets/{dashboard-DFF2_SFC.js => dashboard-Dl2pFM2h.js} (97%) rename internal/ui/dist/assets/{dashboards._dashboardId-BxKDNXp-.js => dashboards._dashboardId-Dlv44ftW.js} (69%) rename internal/ui/dist/assets/{dashboards.index-DY3GETbb.js => dashboards.index-BuFeceag.js} (82%) rename internal/ui/dist/assets/{index-DYcEv4SB.js => index-BxnvJp0Y.js} (99%) rename internal/ui/dist/assets/{mcp-app-frame-T5JN5RKZ.js => mcp-app-frame-D0PVhqdW.js} (99%) rename internal/ui/dist/assets/{routes-BNP_b_GZ.js => routes-DdP3ZNeG.js} (84%) diff --git a/internal/mcp/apps/overview.html b/internal/mcp/apps/overview.html index ac1392c16..783685563 100644 --- a/internal/mcp/apps/overview.html +++ b/internal/mcp/apps/overview.html @@ -8,7 +8,7 @@ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ye(n):``}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return ye(e.type);case 16:return ye(`Lazy`);case 13:return e.child!==t&&t!==null?ye(`Suspense Fallback`):ye(`Suspense`);case 19:return ye(`SuspenseList`);case 0:case 15:return xe(e.type,!1);case 11:return xe(e.type.render,!1);case 1:return xe(e.type,!0);case 31:return ye(`Activity`);default:return``}}function Ce(e){try{var t=``,n=null;do t+=Se(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` `+e.stack}}var we=Object.prototype.hasOwnProperty,Ee=t.unstable_scheduleCallback,De=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,je=t.unstable_getCurrentPriorityLevel,Me=t.unstable_ImmediatePriority,Ne=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Fe=t.unstable_LowPriority,Ie=t.unstable_IdlePriority,Le=t.log,Re=t.unstable_setDisableYieldValue,ze=null,Be=null;function Ve(e){if(typeof Le==`function`&&Re(e),Be&&typeof Be.setStrictMode==`function`)try{Be.setStrictMode(ze,e)}catch{}}var He=Math.clz32?Math.clz32:Ge,Ue=Math.log,We=Math.LN2;function Ge(e){return e>>>=0,e===0?32:31-(Ue(e)/We|0)|0}var Ke=256,qe=262144,Je=4194304;function Ye(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Xe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ye(n))):i=Ye(o):i=Ye(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ye(n))):i=Ye(o)):i=Ye(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $e(){var e=Je;return Je<<=1,!(Je&62914560)&&(Je=4194304),e}function et(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),pn=!1;if(fn)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){pn=!0}}),window.addEventListener(`test`,mn,mn),window.removeEventListener(`test`,mn,mn)}catch{pn=!1}var hn=null,gn=null,_n=null;function vn(){if(_n)return _n;var e,t=gn,n=t.length,r,i=`value`in hn?hn.value:hn.textContent,a=i.length;for(e=0;e=F),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return Jn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Yn&&er(e,t)?(e=vn(),_n=gn=hn=null,nr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Er(n)}}function Or(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Or(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bt(e.document)}return t}function Ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var jr=fn&&`documentMode`in document&&11>=document.documentMode,Mr=null,Nr=null,Pr=null,Fr=!1;function Ir(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fr||Mr==null||Mr!==Bt(r)||(r=Mr,`selectionStart`in r&&Ar(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Pr&&Tr(Pr,r)||(Pr=r,r=Ld(Nr,`onSelect`),0>=o,i-=o,Oi=1<<32-He(t)+i|n<m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Li&&Ai(i,m),l;if(d===null){for(;mh?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Li&&Ai(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Li&&Ai(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Li&&Ai(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&ja(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ra(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=hi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=mi(o.type,o.key,o.props,null,e.mode,c),Ra(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=vi(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=ja(o),x(e,r,o,c)}if(A(o))return v(e,r,o,c);if(O(o)){if(l=O(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,La(o),c);if(o.$$typeof===b)return x(e,r,aa(e,o),c);za(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=gi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ia=0;var i=x(e,t,n,r);return Fa=null,i}catch(t){if(t===Ta||t===Da)throw t;var a=ui(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Va=Ba(!0),Ha=Ba(!1),Ua=!1;function Wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ga(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,L&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=si(e),oi(e,null,n),t}return ri(e,r,t,n),si(e)}function Ja(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}function Ya(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Xa=!1;function Za(){if(Xa){var e=ga;if(e!==null)throw e}}function Qa(e,t,n,r){Xa=!1;var i=e.updateQueue;Ua=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Yl&p)===p:(r&p)===p){p!==0&&p===ha&&(Xa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ua=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ru|=o,e.lanes=o,e.memoizedState=d}}function $a(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function eo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=j.T,s={};j.T=s,Bs(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?zs(e,t,ya(c,r),Eu(e)):zs(e,t,r,Eu(e))}catch(n){zs(e,t,{then:function(){},status:`rejected`,reason:n},Eu())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function ks(){}function As(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=js(e).queue;Os(e,a,t,re,n===null?ks:function(){return Ms(e),n(r)})}function js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ms(e){var t=js(e);t.next===null&&(t=e.alternate.memoizedState),zs(e,t.next.queue,{},Eu())}function Ns(){return ia(cp)}function Ps(){return Io().memoizedState}function Fs(){return Io().memoizedState}function Is(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Eu();e=Ka(n);var r=qa(t,e,n);r!==null&&(Ou(r,t,n),Ja(r,t,n)),t={cache:da()},e.payload=t;return}t=t.return}}function Ls(e,t,n){var r=Eu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Vs(e)?Hs(t,n):(n=ii(e,t,n,r),n!==null&&(Ou(n,e,r),Us(n,t,r)))}function Rs(e,t,n){zs(e,t,n,Eu())}function zs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vs(e))Hs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,wr(s,o))return ri(e,t,i,0),ql===null&&ni(),!1}catch{}if(n=ii(e,t,i,r),n!==null)return Ou(n,e,r),Us(n,t,r),!0}return!1}function Bs(e,t,n,r){if(r={lane:2,revertLane:Sd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Vs(e)){if(t)throw Error(i(479))}else t=ii(e,n,r,2),t!==null&&Ou(t,e,2)}function Vs(e){var t=e.alternate;return e===I||t!==null&&t===I}function Hs(e,t){bo=yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Us(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}var Ws={readContext:ia,use:zo,useCallback:Eo,useContext:Eo,useEffect:Eo,useImperativeHandle:Eo,useLayoutEffect:Eo,useInsertionEffect:Eo,useMemo:Eo,useReducer:Eo,useRef:Eo,useState:Eo,useDebugValue:Eo,useDeferredValue:Eo,useTransition:Eo,useSyncExternalStore:Eo,useId:Eo,useHostTransitionStatus:Eo,useFormState:Eo,useActionState:Eo,useOptimistic:Eo,useMemoCache:Eo,useCacheRefresh:Eo};Ws.useEffectEvent=Eo;var Gs={readContext:ia,use:zo,useCallback:function(e,t){return Fo().memoizedState=[e,t===void 0?null:t],e},useContext:ia,useEffect:hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ps(4194308,4,xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){ps(4,2,e,t)},useMemo:function(e,t){var n=Fo();t=t===void 0?null:t;var r=e();if(xo){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Fo();if(n!==void 0){var i=n(t);if(xo){Ve(!0);try{n(t)}finally{Ve(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ls.bind(null,I,e),[r.memoizedState,e]},useRef:function(e){var t=Fo();return e={current:e},t.memoizedState=e},useState:function(e){e=Zo(e);var t=e.queue,n=Rs.bind(null,I,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Cs,useDeferredValue:function(e,t){return Es(Fo(),e,t)},useTransition:function(){var e=Zo(!1);return e=Os.bind(null,I,e.queue,!0,!1),Fo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=I,a=Fo();if(Li){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ql===null)throw Error(i(349));Yl&127||Ko(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,hs(Jo.bind(null,r,o,e),[e]),r.flags|=2048,ds(9,{destroy:void 0},qo.bind(null,r,o,n,t),null),n},useId:function(){var e=Fo(),t=ql.identifierPrefix;if(Li){var n=ki,r=Oi;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=So++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[dt]=t,o[ft]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Kd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&zc(t)}}return Wc(t),Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=de.current,Wi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Fi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ud(e.nodeValue,n)),e||Vi(t,!0)}else e=Qd(e).createTextNode(r),e[dt]=t,t.stateNode=e}return Wc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Wi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[dt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wc(t),e=!1}else n=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(po(t),t):(po(t),null);if(t.flags&128)throw Error(i(558))}return Wc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Wi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[dt]=t}else Gi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wc(t),a=!1}else a=Ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(po(t),t):(po(t),null)}return po(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Hc(t,t.updateQueue),Wc(t),null);case 4:return me(),e===null&&Nd(t.stateNode.containerInfo),Wc(t),null;case 10:return Qi(t.type),Wc(t),null;case 19:if(se(mo),r=t.memoizedState,r===null)return Wc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Uc(r,!1);else{if(nu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ho(e),o!==null){for(t.flags|=128,Uc(r,!1),e=o.updateQueue,t.updateQueue=e,Hc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)pi(n,e),n=n.sibling;return ce(mo,mo.current&1|2),Li&&Ai(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>mu&&(t.flags|=128,a=!0,Uc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=ho(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Hc(t,e),Uc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Li)return Wc(t),null}else 2*Ae()-r.renderingStartTime>mu&&n!==536870912&&(t.flags|=128,a=!0,Uc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Wc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,n=mo.current,ce(mo,a?n&1|2:n&1),Li&&Ai(t,r.treeForkCount),e);case 22:case 23:return po(t),ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Wc(t),t.subtreeFlags&6&&(t.flags|=8192)):Wc(t),n=t.updateQueue,n!==null&&Hc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&se(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qi(ua),Wc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Kc(e,t){switch(Ni(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(ua),me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ge(t),null;case 31:if(t.memoizedState!==null){if(po(t),t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(po(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Gi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(mo),null;case 4:return me(),null;case 10:return Qi(t.type),null;case 22:case 23:return po(t),ao(),e!==null&&se(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qi(ua),null;case 25:return null;default:return null}}function qc(e,t){switch(Ni(t),t.tag){case 3:Qi(ua),me();break;case 26:case 27:case 5:ge(t);break;case 4:me();break;case 31:t.memoizedState!==null&&po(t);break;case 13:po(t);break;case 19:se(mo);break;case 10:Qi(t.type);break;case 22:case 23:po(t),ao(),e!==null&&se(xa);break;case 24:Qi(ua)}}function Jc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){rd(t,t.return,e)}}function Yc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){rd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){rd(t,t.return,e)}}function Xc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{eo(t,n)}catch(t){rd(e,e.return,t)}}}function Zc(e,t,n){n.props=Qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){rd(e,t,n)}}function Qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){rd(e,t,n)}}function $c(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){rd(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){rd(e,t,n)}else n.current=null}}function el(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){rd(e,e.return,t)}}function tl(e,t,n){try{var r=e.stateNode;qd(r,e.type,n,t),r[ft]=t}catch(t){rd(e,e.return,t)}}function nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&lf(e.type)||e.tag===4}function rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&lf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nn));else if(r!==4&&(r===27&&lf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&lf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(al(e,t,n),e=e.sibling;e!==null;)al(e,t,n),e=e.sibling}function ol(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Kd(t,r,n),t[dt]=e,t[ft]=n}catch(t){rd(e,e.return,t)}}var sl=!1,cl=!1,ll=!1,ul=typeof WeakSet==`function`?WeakSet:Set,dl=null;function fl(e,t){if(e=e.containerInfo,Xd=_p,e=kr(e),Ar(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Zd={focusedElem:e,selectionRange:n},_p=!1,dl=t;dl!==null;)if(t=dl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,dl=e;else for(;dl!==null;){switch(t=dl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Kd(o,r,n),o[dt]=e,wt(o),r=o;break a;case`link`:var s=Zf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Dr(s,h),v=Dr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,j.T=null,n=Su,Su=null;var o=vu,s=bu;if(_u=0,yu=vu=null,bu=0,L&6)throw Error(i(331));var c=L;if(L|=4,Hl(o.current),Pl(o,o.current,s,n),L=c,hd(0,!1),Be&&typeof Be.onPostCommitFiberRoot==`function`)try{Be.onPostCommitFiberRoot(ze,o)}catch{}return!0}finally{M.p=a,j.T=r,$u(e,t)}}function nd(e,t,n){t=bi(n,t),t=ic(e.stateNode,t,2),e=qa(e,t,2),e!==null&&(tt(e,2),B(e))}function rd(e,t,n){if(e.tag===3)nd(e,e,n);else for(;t!==null;){if(t.tag===3){nd(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gu===null||!gu.has(r))){e=bi(n,e),n=ac(2),r=qa(t,n,2),r!==null&&(oc(n,r,t,e),tt(r,2),B(r));break}}t=t.return}}function id(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Kl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(eu=!0,i.add(n),e=ad.bind(null,e,t,n),t.then(e,e))}function ad(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ql===e&&(Yl&n)===n&&(nu===4||nu===3&&(Yl&62914560)===Yl&&300>Ae()-du?!(L&2)&&Fu(e,0):au|=n,su===Yl&&(su=0)),B(e)}function od(e,t){t===0&&(t=$e()),e=ai(e,t),e!==null&&(tt(e,t),B(e))}function sd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),od(e,n)}function cd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),od(e,n)}function ld(e,t){return Ee(e,t)}var ud=null,dd=null,fd=!1,pd=!1,z=!1,md=0;function B(e){e!==dd&&e.next===null&&(dd===null?ud=dd=e:dd=dd.next=e),pd=!0,fd||(fd=!0,xd())}function hd(e,t){if(!z&&pd){z=!0;do for(var n=!1,r=ud;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-He(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,bd(r,a))}else a=Yl,a=Xe(r,r===ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ze(r,a)||(n=!0,bd(r,a))}r=r.next}while(n);z=!1}}function gd(){_d()}function _d(){pd=fd=!1;var e=0;md!==0&&rf()&&(e=md);for(var t=Ae(),n=null,r=ud;r!==null;){var i=r.next,a=vd(r,t);a===0?(r.next=null,n===null?ud=i:n.next=i,i===null&&(dd=n)):(n=r,(e!==0||a&3)&&(pd=!0)),r=i}_u!==0&&_u!==5||hd(e,!1),md!==0&&(md=0)}function vd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Jd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function jf(e,t,n){var r=Af;if(r&&typeof t==`string`&&t){var i=Ht(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tf.has(i)||(Tf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Kd(t,`link`,e),wt(t),r.head.appendChild(t)))}}function Mf(e){Df.D(e),jf(`dns-prefetch`,e,null)}function Nf(e,t){Df.C(e,t),jf(`preconnect`,e,t)}function Pf(e,t,n){Df.L(e,t,n);var r=Af;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ht(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ht(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ht(n.imageSizes)+`"]`)):i+=`[href="`+Ht(e)+`"]`;var a=i;switch(t){case`style`:a=Bf(e);break;case`script`:a=Wf(e)}wf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vf(a))||t===`script`&&r.querySelector(Gf(a))||(t=r.createElement(`link`),Kd(t,`link`,e),wt(t),r.head.appendChild(t)))}}function Ff(e,t){Df.m(e,t);var n=Af;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ht(r)+`"][href="`+Ht(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wf(e)}if(!wf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),wf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gf(a)))return}r=n.createElement(`link`),Kd(r,`link`,e),wt(r),n.head.appendChild(r)}}}function If(e,t,n){Df.S(e,t,n);var r=Af;if(r&&e){var i=Ct(r).hoistableStyles,a=Bf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wf.get(a))&&Jf(e,n);var c=o=r.createElement(`link`);wt(c),Kd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lf(e,t){Df.X(e,t);var n=Af;if(n&&e){var r=Ct(n).hoistableScripts,i=Wf(e),a=r.get(i);a||(a=n.querySelector(Gf(i)),a||(e=f({src:e,async:!0},t),(t=wf.get(i))&&Yf(e,t),a=n.createElement(`script`),wt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t){Df.M(e,t);var n=Af;if(n&&e){var r=Ct(n).hoistableScripts,i=Wf(e),a=r.get(i);a||(a=n.querySelector(Gf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=wf.get(i))&&Yf(e,t),a=n.createElement(`script`),wt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t,n,r){var a=(a=de.current)?Ef(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Bf(n.href),n=Ct(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bf(n.href);var o=Ct(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),wf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wf.set(e,n),o||Uf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Wf(n),n=Ct(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bf(e){return`href="`+Ht(e)+`"`}function Vf(e){return`link[rel="stylesheet"][`+e+`]`}function Hf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Uf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Kd(t,`link`,n),wt(t),e.head.appendChild(t))}function Wf(e){return`[src="`+Ht(e)+`"]`}function Gf(e){return`script[async]`+e}function Kf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ht(n.href)+`"]`);if(r)return t.instance=r,wt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),wt(r),Kd(r,`style`,a),qf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bf(n.href);var o=e.querySelector(Vf(a));if(o)return t.state.loading|=4,t.instance=o,wt(o),o;r=Hf(n),(a=wf.get(a))&&Jf(r,a),o=(e.ownerDocument||e).createElement(`link`),wt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Kd(o,`link`,r),t.state.loading|=4,qf(o,n.precedence,e),t.instance=o;case`script`:return o=Wf(n.src),(a=e.querySelector(Gf(o)))?(t.instance=a,wt(a),a):(r=n,(a=wf.get(o))&&(r=f({},n),Yf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),wt(a),Kd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qf(r,n.precedence,e));return t.instance}function qf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function $f(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ep(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function tp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bf(r.href),a=t.querySelector(Vf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ip.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,wt(a);return}a=t.ownerDocument||t,r=Hf(r),(i=wf.get(i))&&Jf(r,i),a=a.createElement(`link`),wt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Kd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ip.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var np=0;function rp(e,t){return e.stylesheets&&e.count===0&&op(e,e.stylesheets),0np?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ip(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)op(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ap=null;function op(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ap=new Map,t.forEach(sp,e),ap=null,ip.call(e))}function sp(e,t){if(!(t.state.loading&4)){var n=ap.get(e);if(n)var r=n.get(null);else{n=new Map,ap.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=pu()}))(),hu=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],gu=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],_u=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],vu=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],yu=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],bu=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],xu={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},Su={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},Cu={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:hu,brand:gu,ok:_u,warn:vu,bad:yu,info:bu},defaultRadius:`md`,fontFamily:Su.body,fontFamilyMonospace:Su.display,headings:{fontFamily:Su.body,fontWeight:`600`},cursorType:`pointer`},wu=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":xu.light.muted},dark:{}}),Tu=Gt(Cu);function Eu({dark:e,children:t}){return(0,N.jsx)(Wt,{theme:Tu,cssVariablesResolver:wu,forceColorScheme:e?`dark`:`light`,children:(0,N.jsx)(ls,{withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:t})})}function Du({title:e,summary:t,onRefresh:n,disabled:r}){return(0,N.jsxs)(nc,{justify:`space-between`,align:`flex-start`,wrap:`nowrap`,px:{base:`md`,sm:`lg`},pt:`sm`,pb:`xs`,children:[(0,N.jsxs)(F,{miw:0,children:[(0,N.jsx)(nu,{order:2,fz:`lg`,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e}),t&&(0,N.jsx)(uc,{c:`dimmed`,size:`sm`,mt:2,children:t})]}),(0,N.jsx)(yl,{label:`Refresh this view`,children:(0,N.jsx)(Ks,{variant:`default`,size:`md`,"aria-label":`Refresh this view`,onClick:()=>void n(),disabled:r,children:(0,N.jsx)(cu,{size:15,weight:`bold`})})})]})}function Ou({error:e,loading:t,retry:n}){return e?(0,N.jsx)(ac,{color:`bad`,m:`md`,radius:`md`,children:(0,N.jsxs)(nc,{justify:`space-between`,children:[(0,N.jsx)(uc,{size:`sm`,children:e}),n&&(0,N.jsx)(Sc,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:n,children:`Retry`})]})}):t?(0,N.jsxs)(wc,{mih:160,p:`xl`,children:[(0,N.jsx)(Rs,{size:`sm`}),(0,N.jsx)(uc,{c:`dimmed`,size:`sm`,ml:`sm`,children:t})]}):null}function ku({icon:e,title:t,children:n,tall:r=!1}){return(0,N.jsx)(wc,{mih:r?220:130,p:`xl`,children:(0,N.jsxs)(nc,{wrap:`nowrap`,children:[(0,N.jsx)(Yl,{variant:`light`,size:`xl`,radius:`md`,children:e}),(0,N.jsxs)(F,{children:[(0,N.jsx)(uc,{fw:700,size:`sm`,children:t}),(0,N.jsx)(uc,{c:`dimmed`,size:`xs`,mt:3,children:n})]})]})})}function Au({left:e,right:t}){return(0,N.jsxs)(nc,{justify:`space-between`,px:{base:`md`,sm:`lg`},py:`xs`,style:{borderTop:`1px solid var(--mantine-color-default-border)`},children:[(0,N.jsx)(uc,{c:`dimmed`,size:`xs`,children:e}),(0,N.jsx)(uc,{c:`dimmed`,size:`xs`,ta:`right`,children:t})]})}function ju({label:e,value:t,color:n}){return(0,N.jsxs)(ls,{withBorder:!0,radius:`md`,p:`sm`,children:[(0,N.jsx)(uc,{c:`dimmed`,size:`xs`,children:e}),(0,N.jsx)(uc,{fw:700,fz:`xl`,c:n,mt:3,children:t})]})}function Mu(e,t=8){let[n,r]=(0,E.useState)(1),i=Math.max(1,Math.ceil(e.length/t));(0,E.useEffect)(()=>{n>i&&r(i)},[n,i]);let a=(n-1)*t;return{page:n,setPage:r,totalPages:i,pageItems:e.slice(a,a+t),from:e.length===0?0:a+1,to:Math.min(a+t,e.length),total:e.length}}function Nu({page:e,totalPages:t,from:n,to:r,total:i,onChange:a}){return t<=1?null:(0,N.jsxs)(nc,{justify:`space-between`,gap:`sm`,px:{base:`md`,sm:`lg`},py:`xs`,style:{borderTop:`1px solid var(--mantine-color-default-border)`},children:[(0,N.jsxs)(uc,{c:`dimmed`,size:`xs`,children:[n,`–`,r,` of `,i]}),(0,N.jsx)(Xc,{value:e,total:t,onChange:a,size:`xs`,withEdges:!0,"aria-label":`Table pages`})]})}function Pu(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:`bad`}var Fu=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function Iu(e){return`${(e*100).toFixed(e>=.1?1:2)}%`}function Lu(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:`${e.toFixed(e>=100?0:1)}ms`}function Ru(e){let[t,n]=e.split(`/`),r=new Date(t),i=new Date(n);if(Number.isNaN(r.valueOf())||Number.isNaN(i.valueOf()))return e;let a=Math.round((i.valueOf()-r.valueOf())/6e4);return a>=60&&a%60==0?`Last ${a/60}h`:`Last ${Math.max(a,1)}m`}var zu=c({BIGINT_FORMAT_RANGES:()=>tf,CONSTANT_CATCH:()=>cf,Class:()=>rf,NUMBER_FORMAT_RANGES:()=>ef,aborted:()=>Cd,allowsEval:()=>Xd,assert:()=>Gu,assertEqual:()=>Bu,assertIs:()=>Uu,assertNever:()=>Wu,assertNotEqual:()=>Vu,assignProp:()=>ed,attachSchema:()=>Dd,base64ToUint8Array:()=>Pd,base64urlToUint8Array:()=>Id,cached:()=>Ju,captureStackTrace:()=>Yd,cleanEnum:()=>Nd,cleanRegex:()=>Xu,clone:()=>pd,cloneDef:()=>nd,codePointLength:()=>Ad,constantCatch:()=>qd,createTransparentProxy:()=>md,defineLazy:()=>Qu,defineLazyInternal:()=>Gd,esc:()=>od,escapeRegex:()=>fd,explicitlyAborted:()=>wd,extend:()=>vd,finalizeIssue:()=>Od,floatSafeRemainder:()=>Zu,getElementAtPath:()=>rd,getEnumValues:()=>Ku,getLengthableOrigin:()=>jd,getParsedType:()=>Zd,getSizableOrigin:()=>kd,hexToUint8Array:()=>Rd,hide:()=>Hd,installLazyProp:()=>Kd,isObject:()=>cd,isPlainObject:()=>ld,issue:()=>Md,joinValues:()=>R,jsonStringifyReplacer:()=>qu,members:()=>Bd,merge:()=>bd,mergeDefs:()=>td,normalizeParams:()=>z,nullish:()=>Yu,numKeys:()=>dd,objectClone:()=>$u,omit:()=>_d,optionalKeys:()=>hd,own:()=>Vd,parsedType:()=>V,partial:()=>xd,pick:()=>gd,prefixIssues:()=>Td,primitiveTypes:()=>$d,promiseAllObject:()=>id,propertyKeyTypes:()=>Qd,randomString:()=>ad,required:()=>Sd,safeExtend:()=>yd,shallowClone:()=>ud,slugify:()=>sd,stringifyPrimitive:()=>B,toZod:()=>Hu,uint8ArrayToBase64:()=>Fd,uint8ArrayToBase64url:()=>Ld,uint8ArrayToHex:()=>zd,unwrapMessage:()=>Ed});function Bu(e){return e}function Vu(e){return e}function Hu(){return e=>e}function Uu(e){}function Wu(e){throw Error(`Unexpected value in exhaustive check`)}function Gu(e){}function Ku(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function R(e,t=`|`){return e.map(e=>B(e)).join(t)}function qu(e,t){return typeof t==`bigint`?t.toString():t}function Ju(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Yu(e){return e==null}function Xu(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Zu(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)e?.[t],e):e}function id(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;rt};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function md(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function B(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function hd(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}function gd(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return pd(e,td(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&ed(e,r,n.shape[r])}return ed(this,`shape`,e),e},checks:[]}))}function _d(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return pd(e,td(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return ed(this,`shape`,r),r},checks:[]}))}function vd(e,t){if(!ld(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return pd(e,td(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ed(this,`shape`,n),n}}))}function yd(e,t){if(!ld(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return pd(e,td(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ed(this,`shape`,n),n}}))}function bd(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return pd(e,td(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ed(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function xd(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return pd(t,td(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ed(this,`shape`,i),i},checks:[]}))}function Sd(e,t,n){return pd(t,td(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return ed(this,`shape`,i),i}}))}function Cd(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ed(e){return typeof e==`string`?e:e?.message}function Dd(e,t,n){var r;for(let i=t;iNumber.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Pd(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;ee.toString(16).padStart(2,`0`)).join(``)}function Bd(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ud(e,n,r.value)}}function Vd(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Hd(e,t,n){return Vd(e,t,n,!1)}function Ud(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Vd(this,t,n.bind(this))},set(e){Vd(this,t,e)}})}function Wd(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}function Gd(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&af!==e._zod){af=void 0;return}af=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,sf);let e=of;of=!1;try{let r=n(this);return of?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),of||=e,r}catch(n){throw delete this[t],of||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Kd(e,t,n,r){let i=Wd(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function qd(e){let t=()=>e;return t[cf]=!0,t}var Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf,cf,H=o((()=>{yf(),Jd=Symbol(`evaluating`),Yd=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},Xd=Ju(()=>{if(vf.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),Zd=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Qd=new Set([`string`,`number`,`symbol`]),$d=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),ef={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},tf={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},nf=/[\uD800-\uDBFF]/,rf=class{constructor(...e){}},of=!1,sf={configurable:!0,get(){of=!0}},cf=`~constantCatch`}));function lf(e){let t=mf;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return mf=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function U(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){pf.value=new a(r);try{Object.defineProperty(n,"_zod",pf)}finally{pf.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Bd(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?lf(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}function uf(e){return e&&Object.assign(vf,e),vf}var df,ff,pf,mf,hf,gf,_f,vf,yf=o((()=>{H(),ff=Object.freeze({status:`aborted`}),pf={value:void 0,enumerable:!1},mf=`captureStackTrace`in Error?Error:null,hf=Symbol(`zod_brand`),gf=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},_f=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(df=globalThis).__zod_globalConfig??(df.__zod_globalConfig={}),vf=globalThis.__zod_globalConfig}));function bf(){let e=this._zod;return e.message??=JSON.stringify(e.def,qu,2),e.message}function xf(e){this._zod.message=e}function Sf(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Cf(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Sf(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function wf(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;ie.message){let n={errors:[]},r=(e,i=[])=>{var a;for(let o of e.issues)if(o.code===`invalid_union`&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if(o.code===`invalid_key`)r({issues:o.issues},[...i,...o.path]);else if(o.code===`invalid_element`)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(e.length===0){n.errors.push(t(o));continue}let r=n,s=0;for(;stypeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function Df(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Ef(e.path)}`);return t.join(` +`).replace(Vd,``)}function Ud(e,t){return t=Hd(t),Hd(e)===t}function Wd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Jt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Jt(e,``+r);break;case`className`:Nt(e,`class`,r);break;case`tabIndex`:Nt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Nt(e,n,r);break;case`style`:Zt(e,r,o);break;case`data`:if(t!==`object`){Nt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Wd(e,t,`name`,a.name,a,null),Wd(e,t,`formEncType`,a.formEncType,a,null),Wd(e,t,`formMethod`,a.formMethod,a,null),Wd(e,t,`formTarget`,a.formTarget,a,null)):(Wd(e,t,`encType`,a.encType,a,null),Wd(e,t,`method`,a.method,a,null),Wd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=tn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=nn);break;case`onScroll`:r!=null&&jd(`scroll`,e);break;case`onScrollEnd`:r!=null&&jd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=tn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:jd(`beforetoggle`,e),jd(`toggle`,e),Mt(e,`popover`,r);break;case`xlinkActuate`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Mt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2s)break;var u=c.transferSize,d=c.initiatorType;u&&Jd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function jf(e,t,n){var r=Af;if(r&&typeof t==`string`&&t){var i=Ht(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tf.has(i)||(Tf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Kd(t,`link`,e),wt(t),r.head.appendChild(t)))}}function Mf(e){Df.D(e),jf(`dns-prefetch`,e,null)}function Nf(e,t){Df.C(e,t),jf(`preconnect`,e,t)}function Pf(e,t,n){Df.L(e,t,n);var r=Af;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ht(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ht(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ht(n.imageSizes)+`"]`)):i+=`[href="`+Ht(e)+`"]`;var a=i;switch(t){case`style`:a=Bf(e);break;case`script`:a=Wf(e)}wf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vf(a))||t===`script`&&r.querySelector(Gf(a))||(t=r.createElement(`link`),Kd(t,`link`,e),wt(t),r.head.appendChild(t)))}}function Ff(e,t){Df.m(e,t);var n=Af;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ht(r)+`"][href="`+Ht(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wf(e)}if(!wf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),wf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gf(a)))return}r=n.createElement(`link`),Kd(r,`link`,e),wt(r),n.head.appendChild(r)}}}function If(e,t,n){Df.S(e,t,n);var r=Af;if(r&&e){var i=Ct(r).hoistableStyles,a=Bf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wf.get(a))&&Jf(e,n);var c=o=r.createElement(`link`);wt(c),Kd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lf(e,t){Df.X(e,t);var n=Af;if(n&&e){var r=Ct(n).hoistableScripts,i=Wf(e),a=r.get(i);a||(a=n.querySelector(Gf(i)),a||(e=f({src:e,async:!0},t),(t=wf.get(i))&&Yf(e,t),a=n.createElement(`script`),wt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t){Df.M(e,t);var n=Af;if(n&&e){var r=Ct(n).hoistableScripts,i=Wf(e),a=r.get(i);a||(a=n.querySelector(Gf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=wf.get(i))&&Yf(e,t),a=n.createElement(`script`),wt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t,n,r){var a=(a=de.current)?Ef(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Bf(n.href),n=Ct(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bf(n.href);var o=Ct(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),wf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wf.set(e,n),o||Uf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Wf(n),n=Ct(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bf(e){return`href="`+Ht(e)+`"`}function Vf(e){return`link[rel="stylesheet"][`+e+`]`}function Hf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Uf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Kd(t,`link`,n),wt(t),e.head.appendChild(t))}function Wf(e){return`[src="`+Ht(e)+`"]`}function Gf(e){return`script[async]`+e}function Kf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ht(n.href)+`"]`);if(r)return t.instance=r,wt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),wt(r),Kd(r,`style`,a),qf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bf(n.href);var o=e.querySelector(Vf(a));if(o)return t.state.loading|=4,t.instance=o,wt(o),o;r=Hf(n),(a=wf.get(a))&&Jf(r,a),o=(e.ownerDocument||e).createElement(`link`),wt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Kd(o,`link`,r),t.state.loading|=4,qf(o,n.precedence,e),t.instance=o;case`script`:return o=Wf(n.src),(a=e.querySelector(Gf(o)))?(t.instance=a,wt(a),a):(r=n,(a=wf.get(o))&&(r=f({},n),Yf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),wt(a),Kd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qf(r,n.precedence,e));return t.instance}function qf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function $f(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ep(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function tp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bf(r.href),a=t.querySelector(Vf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ip.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,wt(a);return}a=t.ownerDocument||t,r=Hf(r),(i=wf.get(i))&&Jf(r,i),a=a.createElement(`link`),wt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Kd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ip.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var np=0;function rp(e,t){return e.stylesheets&&e.count===0&&op(e,e.stylesheets),0np?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ip(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)op(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ap=null;function op(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ap=new Map,t.forEach(sp,e),ap=null,ip.call(e))}function sp(e,t){if(!(t.state.loading&4)){var n=ap.get(e);if(n)var r=n.get(null);else{n=new Map,ap.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=pu()}))(),hu=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],gu=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],_u=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],vu=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],yu=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],bu=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],xu={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},Su={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},Cu={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:hu,brand:gu,ok:_u,warn:vu,bad:yu,info:bu},defaultRadius:`md`,fontFamily:Su.body,fontFamilyMonospace:Su.display,headings:{fontFamily:Su.body,fontWeight:`600`},cursorType:`pointer`},wu=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":xu.light.muted},dark:{}}),Tu=Gt(Cu);function Eu({dark:e,children:t}){return(0,N.jsx)(Wt,{theme:Tu,cssVariablesResolver:wu,forceColorScheme:e?`dark`:`light`,children:(0,N.jsx)(ls,{withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:t})})}function Du({title:e,summary:t,onRefresh:n,disabled:r}){return(0,N.jsxs)(nc,{justify:`space-between`,align:`flex-start`,wrap:`nowrap`,px:{base:`md`,sm:`lg`},pt:`sm`,pb:`xs`,children:[(0,N.jsxs)(F,{miw:0,children:[(0,N.jsx)(nu,{order:2,fz:`lg`,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e}),t&&(0,N.jsx)(uc,{c:`dimmed`,size:`sm`,mt:2,children:t})]}),(0,N.jsx)(yl,{label:`Refresh this view`,children:(0,N.jsx)(Ks,{variant:`default`,size:`md`,"aria-label":`Refresh this view`,onClick:()=>void n(),disabled:r,children:(0,N.jsx)(cu,{size:15,weight:`bold`})})})]})}function Ou({error:e,loading:t,retry:n}){return e?(0,N.jsx)(ac,{color:`bad`,m:`md`,radius:`md`,children:(0,N.jsxs)(nc,{justify:`space-between`,children:[(0,N.jsx)(uc,{size:`sm`,children:e}),n&&(0,N.jsx)(Sc,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:n,children:`Retry`})]})}):t?(0,N.jsxs)(wc,{mih:160,p:`xl`,children:[(0,N.jsx)(Rs,{size:`sm`}),(0,N.jsx)(uc,{c:`dimmed`,size:`sm`,ml:`sm`,children:t})]}):null}function ku({icon:e,title:t,children:n,tall:r=!1}){return(0,N.jsx)(wc,{mih:r?220:130,p:`xl`,children:(0,N.jsxs)(nc,{wrap:`nowrap`,children:[(0,N.jsx)(Yl,{variant:`light`,size:`xl`,radius:`md`,children:e}),(0,N.jsxs)(F,{children:[(0,N.jsx)(uc,{fw:700,size:`sm`,children:t}),(0,N.jsx)(uc,{c:`dimmed`,size:`xs`,mt:3,children:n})]})]})})}function Au({left:e,right:t}){return(0,N.jsxs)(nc,{justify:`space-between`,px:{base:`md`,sm:`lg`},py:`xs`,style:{borderTop:`1px solid var(--mantine-color-default-border)`},children:[(0,N.jsx)(uc,{c:`dimmed`,size:`xs`,children:e}),(0,N.jsx)(uc,{c:`dimmed`,size:`xs`,ta:`right`,children:t})]})}function ju({label:e,value:t,color:n}){return(0,N.jsxs)(ls,{withBorder:!0,radius:`md`,p:`sm`,children:[(0,N.jsx)(uc,{c:`dimmed`,size:`xs`,children:e}),(0,N.jsx)(uc,{fw:700,fz:`xl`,c:n,mt:3,children:t})]})}function Mu(e,t=8){let[n,r]=(0,E.useState)(1),i=Math.max(1,Math.ceil(e.length/t));(0,E.useEffect)(()=>{n>i&&r(i)},[n,i]);let a=(n-1)*t;return{page:n,setPage:r,totalPages:i,pageItems:e.slice(a,a+t),from:e.length===0?0:a+1,to:Math.min(a+t,e.length),total:e.length}}function Nu({page:e,totalPages:t,from:n,to:r,total:i,onChange:a}){return t<=1?null:(0,N.jsxs)(nc,{justify:`space-between`,gap:`sm`,px:{base:`md`,sm:`lg`},py:`xs`,style:{borderTop:`1px solid var(--mantine-color-default-border)`},children:[(0,N.jsxs)(uc,{c:`dimmed`,size:`xs`,children:[n,`–`,r,` of `,i]}),(0,N.jsx)(Xc,{value:e,total:t,onChange:a,size:`xs`,withEdges:!0,"aria-label":`Table pages`})]})}function Pu(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:e===`unknown`?`gray`:`bad`}var Fu=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function Iu(e){return`${(e*100).toFixed(e>=.1?1:2)}%`}function Lu(e){return e>=1e3?`${(e/1e3).toFixed(2)}s`:`${e.toFixed(e>=100?0:1)}ms`}function Ru(e){let[t,n]=e.split(`/`),r=new Date(t),i=new Date(n);if(Number.isNaN(r.valueOf())||Number.isNaN(i.valueOf()))return e;let a=Math.round((i.valueOf()-r.valueOf())/6e4);return a>=60&&a%60==0?`Last ${a/60}h`:`Last ${Math.max(a,1)}m`}var zu=c({BIGINT_FORMAT_RANGES:()=>tf,CONSTANT_CATCH:()=>cf,Class:()=>rf,NUMBER_FORMAT_RANGES:()=>ef,aborted:()=>Cd,allowsEval:()=>Xd,assert:()=>Gu,assertEqual:()=>Bu,assertIs:()=>Uu,assertNever:()=>Wu,assertNotEqual:()=>Vu,assignProp:()=>ed,attachSchema:()=>Dd,base64ToUint8Array:()=>Pd,base64urlToUint8Array:()=>Id,cached:()=>Ju,captureStackTrace:()=>Yd,cleanEnum:()=>Nd,cleanRegex:()=>Xu,clone:()=>pd,cloneDef:()=>nd,codePointLength:()=>Ad,constantCatch:()=>qd,createTransparentProxy:()=>md,defineLazy:()=>Qu,defineLazyInternal:()=>Gd,esc:()=>od,escapeRegex:()=>fd,explicitlyAborted:()=>wd,extend:()=>vd,finalizeIssue:()=>Od,floatSafeRemainder:()=>Zu,getElementAtPath:()=>rd,getEnumValues:()=>Ku,getLengthableOrigin:()=>jd,getParsedType:()=>Zd,getSizableOrigin:()=>kd,hexToUint8Array:()=>Rd,hide:()=>Hd,installLazyProp:()=>Kd,isObject:()=>cd,isPlainObject:()=>ld,issue:()=>Md,joinValues:()=>R,jsonStringifyReplacer:()=>qu,members:()=>Bd,merge:()=>bd,mergeDefs:()=>td,normalizeParams:()=>z,nullish:()=>Yu,numKeys:()=>dd,objectClone:()=>$u,omit:()=>_d,optionalKeys:()=>hd,own:()=>Vd,parsedType:()=>V,partial:()=>xd,pick:()=>gd,prefixIssues:()=>Td,primitiveTypes:()=>$d,promiseAllObject:()=>id,propertyKeyTypes:()=>Qd,randomString:()=>ad,required:()=>Sd,safeExtend:()=>yd,shallowClone:()=>ud,slugify:()=>sd,stringifyPrimitive:()=>B,toZod:()=>Hu,uint8ArrayToBase64:()=>Fd,uint8ArrayToBase64url:()=>Ld,uint8ArrayToHex:()=>zd,unwrapMessage:()=>Ed});function Bu(e){return e}function Vu(e){return e}function Hu(){return e=>e}function Uu(e){}function Wu(e){throw Error(`Unexpected value in exhaustive check`)}function Gu(e){}function Ku(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function R(e,t=`|`){return e.map(e=>B(e)).join(t)}function qu(e,t){return typeof t==`bigint`?t.toString():t}function Ju(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Yu(e){return e==null}function Xu(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Zu(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)e?.[t],e):e}function id(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;rt};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function md(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function B(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function hd(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}function gd(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return pd(e,td(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&ed(e,r,n.shape[r])}return ed(this,`shape`,e),e},checks:[]}))}function _d(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return pd(e,td(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return ed(this,`shape`,r),r},checks:[]}))}function vd(e,t){if(!ld(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return pd(e,td(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ed(this,`shape`,n),n}}))}function yd(e,t){if(!ld(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return pd(e,td(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ed(this,`shape`,n),n}}))}function bd(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return pd(e,td(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ed(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function xd(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return pd(t,td(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ed(this,`shape`,i),i},checks:[]}))}function Sd(e,t,n){return pd(t,td(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return ed(this,`shape`,i),i}}))}function Cd(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ed(e){return typeof e==`string`?e:e?.message}function Dd(e,t,n){var r;for(let i=t;iNumber.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Pd(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;ee.toString(16).padStart(2,`0`)).join(``)}function Bd(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ud(e,n,r.value)}}function Vd(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Hd(e,t,n){return Vd(e,t,n,!1)}function Ud(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Vd(this,t,n.bind(this))},set(e){Vd(this,t,e)}})}function Wd(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}function Gd(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&af!==e._zod){af=void 0;return}af=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,sf);let e=of;of=!1;try{let r=n(this);return of?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),of||=e,r}catch(n){throw delete this[t],of||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Kd(e,t,n,r){let i=Wd(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function qd(e){let t=()=>e;return t[cf]=!0,t}var Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af,of,sf,cf,H=o((()=>{yf(),Jd=Symbol(`evaluating`),Yd=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},Xd=Ju(()=>{if(vf.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),Zd=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Qd=new Set([`string`,`number`,`symbol`]),$d=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),ef={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},tf={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},nf=/[\uD800-\uDBFF]/,rf=class{constructor(...e){}},of=!1,sf={configurable:!0,get(){of=!0}},cf=`~constantCatch`}));function lf(e){let t=mf;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return mf=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function U(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){pf.value=new a(r);try{Object.defineProperty(n,"_zod",pf)}finally{pf.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Bd(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?lf(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}function uf(e){return e&&Object.assign(vf,e),vf}var df,ff,pf,mf,hf,gf,_f,vf,yf=o((()=>{H(),ff=Object.freeze({status:`aborted`}),pf={value:void 0,enumerable:!1},mf=`captureStackTrace`in Error?Error:null,hf=Symbol(`zod_brand`),gf=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},_f=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(df=globalThis).__zod_globalConfig??(df.__zod_globalConfig={}),vf=globalThis.__zod_globalConfig}));function bf(){let e=this._zod;return e.message??=JSON.stringify(e.def,qu,2),e.message}function xf(e){this._zod.message=e}function Sf(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Cf(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Sf(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function wf(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;ie.message){let n={errors:[]},r=(e,i=[])=>{var a;for(let o of e.issues)if(o.code===`invalid_union`&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if(o.code===`invalid_key`)r({issues:o.issues},[...i,...o.path]);else if(o.code===`invalid_element`)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(e.length===0){n.errors.push(t(o));continue}let r=n,s=0;for(;stypeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function Df(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Ef(e.path)}`);return t.join(` `)}var Of,kf,Af,jf,Mf,Nf,Pf,Ff=o((()=>{yf(),H(),Of={get:bf,set:xf,enumerable:!0,configurable:!0},kf={value:void 0,enumerable:!1},Af={value:void 0,enumerable:!1},jf=new WeakSet([Object.prototype,Error.prototype]),Mf=(e,t)=>{e.name=`$ZodError`,kf.value=e._zod,Object.defineProperty(e,"_zod",kf),Af.value=t,Object.defineProperty(e,"issues",Af),kf.value=void 0,Af.value=void 0,Object.defineProperty(e,"message",Of);let n=Object.getPrototypeOf(e);jf.has(n)||(jf.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Nf=U(`$ZodError`,Mf),Pf=U(`$ZodError`,Mf,void 0,{Parent:Error})}));function If(e,t){return{callee:t?.callee??e,Err:t?.Err}}function Lf(e,t,n){let r=n?{...n,async:!1}:{async:!1},i=e._zod.bag.fallbackRun,a;if(i?(r[qf]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new gf;return a.issues.length===0}var Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf,Yf,Xf,Zf,Qf,$f,ep,tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp=o((()=>{yf(),Ff(),H(),Rf=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new gf;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Od(e,o,uf())));throw Yd(n,a?.callee??t),n}return s.value};return t},zf=Rf(Pf),Bf=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Od(e,o,uf())));throw Yd(n,a?.callee??t),n}return s.value};return t},Vf=Bf(Pf),Hf=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new gf;return a.issues.length?{success:!1,error:new(e??Nf)(a.issues.map(e=>Od(e,i,uf())))}:{success:!0,data:a.value}},Uf=Hf(Pf),Wf=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Od(e,i,uf())))}:{success:!0,data:a.value}},Gf=Wf(Pf),Kf=Symbol.for(`zod.compile.invalid`),qf=Symbol.for(`zod.compile.fallback`),Jf=((e,t,n)=>{let r=e._zod.bag.validator;return r!==void 0&&r(t)!==Kf||Lf(e,t,n)}),Yf=async(e,t,n)=>{let r=n?{...n,async:!0}:{async:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Xf=e=>{let t=Rf(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,If(n,a))};return n},Zf=Xf(Pf),Qf=e=>{let t=Rf(e),n=(e,r,i,a)=>t(e,r,i,If(n,a));return n},$f=Qf(Pf),ep=e=>{let t=Bf(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,If(n,a))};return n},tp=ep(Pf),np=e=>{let t=Bf(e),n=async(e,r,i,a)=>await t(e,r,i,If(n,a));return n},rp=np(Pf),ip=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Hf(e)(t,n,i)},ap=ip(Pf),op=e=>(t,n,r)=>Hf(e)(t,n,r),sp=op(Pf),cp=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Wf(e)(t,n,i)},lp=cp(Pf),up=e=>async(t,n,r)=>Wf(e)(t,n,r),dp=up(Pf)})),pp=c({base64:()=>qp,base64url:()=>Jp,bigint:()=>rm,boolean:()=>om,browserEmail:()=>Bp,cidrv4:()=>Gp,cidrv6:()=>Kp,creditCard:()=>$p,cuid:()=>Sp,cuid2:()=>Cp,date:()=>tm,datetime:()=>yp,domain:()=>Xp,duration:()=>Op,e164:()=>Qp,email:()=>Fp,emoji:()=>hp,extendedDuration:()=>kp,guid:()=>Ap,hex:()=>dm,hostname:()=>Yp,html5Email:()=>Ip,httpProtocol:()=>Zp,idnEmail:()=>zp,integer:()=>im,ipv4:()=>Hp,ipv6:()=>Up,ksuid:()=>Ep,lowercase:()=>lm,mac:()=>Wp,md5_base64:()=>pm,md5_base64url:()=>mm,md5_hex:()=>fm,nanoid:()=>Dp,nanoidOfLength:()=>mp,null:()=>sm,number:()=>am,rfc5322Email:()=>Lp,sha1_base64:()=>gm,sha1_base64url:()=>_m,sha1_hex:()=>hm,sha256_base64:()=>ym,sha256_base64url:()=>bm,sha256_hex:()=>vm,sha384_base64:()=>Sm,sha384_base64url:()=>Cm,sha384_hex:()=>xm,sha512_base64:()=>Tm,sha512_base64url:()=>Em,sha512_hex:()=>wm,string:()=>nm,time:()=>vp,ulid:()=>wp,undefined:()=>cm,unicodeEmail:()=>Rp,uppercase:()=>um,uuid:()=>jp,uuid4:()=>Mp,uuid6:()=>Np,uuid7:()=>Pp,xid:()=>Tp});function mp(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}function hp(){return new RegExp(Vp,`u`)}function gp(e){return RegExp(`^${e}$`)}function _p(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vp(e){return RegExp(`^${_p(e)}$`)}function yp(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${_p({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${_p({precision:e.precision})}`:n;return RegExp(`^${em}T(?:${r})$`)}function bp(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function xp(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Sp,Cp,wp,Tp,Ep,Dp,Op,kp,Ap,jp,Mp,Np,Pp,Fp,Ip,Lp,Rp,zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp,Yp,Xp,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm=o((()=>{H(),Sp=/^[cC][0-9a-z]{6,}$/,Cp=/^[0-9a-z]+$/,wp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Tp=/^[0-9a-vA-V]{20}$/,Ep=/^[A-Za-z0-9]{27}$/,Dp=/^[a-zA-Z0-9_-]{21}$/,Op=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kp=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ap=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,jp=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Mp=jp(4),Np=jp(6),Pp=jp(7),Fp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ip=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Lp=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Rp=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,zp=Rp,Bp=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Vp=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,Hp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Up=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Wp=e=>{let t=fd(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Gp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Kp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Jp=/^[A-Za-z0-9_-]*$/,Yp=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Xp=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Zp=/^https?$/,Qp=/^\+[1-9]\d{6,14}$/,$p=/^\d(?:[ -]?\d){11,18}$/,em=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,tm=gp(em),nm=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},rm=/^-?\d+n?$/,im=/^-?\d+$/,am=/^-?\d+(?:\.\d+)?$/,om=/^(?:true|false)$/i,sm=/^null$/i,cm=/^undefined$/i,lm=/^[^A-Z]*$/,um=/^[^a-z]*$/,dm=/^[0-9a-fA-F]*$/,fm=/^[0-9a-fA-F]{32}$/,pm=bp(22,`==`),mm=xp(22),hm=/^[0-9a-fA-F]{40}$/,gm=bp(27,`=`),_m=xp(27),vm=/^[0-9a-fA-F]{64}$/,ym=bp(43,`=`),bm=xp(43),xm=/^[0-9a-fA-F]{96}$/,Sm=bp(64,``),Cm=xp(64),wm=/^[0-9a-fA-F]{128}$/,Tm=bp(86,`==`),Em=xp(86)}));function Om(e,t,n){e.issues.length&&t.issues.push(...Td(n,e.issues))}var km,Am,jm,Mm,Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh=o((()=>{yf(),Dm(),H(),km=U(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Am=e=>{let t=e.value;return!Yu(t)&&t.size!==void 0},jm=e=>{let t=e.value;return!Yu(t)&&t.length!==void 0},Mm={number:`number`,bigint:`bigint`,object:`date`},Nm=U(`$ZodCheckLessThan`,(e,t)=>{km.init(e,t);let n=Mm[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{km.init(e,t);let n=Mm[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Mm[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fm=U(`$ZodCheckMultipleOf`,(e,t)=>{km.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Zu(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Im=U(`$ZodCheckNumberFormat`,(e,t)=>{km.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ef[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=im)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Lm=U(`$ZodCheckBigIntFormat`,(e,t)=>{km.init(e,t);let[n,r]=tf[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;ar&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Rm=U(`$ZodCheckMaxSize`,(e,t)=>{var n;km.init(e,t),(n=e._zod.def).when??(n.when=Am),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value;r.size<=t.maximum||n.issues.push({origin:kd(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zm=U(`$ZodCheckMinSize`,(e,t)=>{var n;km.init(e,t),(n=e._zod.def).when??(n.when=Am),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:kd(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bm=U(`$ZodCheckSizeEquals`,(e,t)=>{var n;km.init(e,t),(n=e._zod.def).when??(n.when=Am),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:kd(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Vm=U(`$ZodCheckMaxLength`,(e,t)=>{var n;km.init(e,t),(n=e._zod.def).when??(n.when=jm),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ad(r):i)<=t.maximum)return;let a=jd(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Hm=U(`$ZodCheckMinLength`,(e,t)=>{var n;km.init(e,t),(n=e._zod.def).when??(n.when=jm),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=jd(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Um=U(`$ZodCheckLengthEquals`,(e,t)=>{var n;km.init(e,t),(n=e._zod.def).when??(n.when=jm),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ad(r):i;if(a===t.length)return;let o=jd(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Wm=U(`$ZodCheckStringFormat`,(e,t)=>{var n,r;km.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Gm=U(`$ZodCheckRegex`,(e,t)=>{Wm.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Km=U(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=lm,Wm.init(e,t)}),qm=U(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=um,Wm.init(e,t)}),Jm=U(`$ZodCheckIncludes`,(e,t)=>{km.init(e,t);let n=fd(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ym=U(`$ZodCheckStartsWith`,(e,t)=>{km.init(e,t);let n=RegExp(`^${fd(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Xm=U(`$ZodCheckEndsWith`,(e,t)=>{km.init(e,t);let n=RegExp(`.*${fd(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Zm=U(`$ZodCheckProperty`,(e,t)=>{km.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>Om(n,e,t.property));Om(n,e,t.property)}}),Qm=U(`$ZodCheckMimeType`,(e,t)=>{km.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),$m=U(`$ZodCheckOverwrite`,(e,t)=>{km.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),th,nh=o((()=>{th=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(` `)}\n};`)(...Object.values(this.closed))}}})),rh,ih=o((()=>{rh={major:4,minor:5,patch:4}}));function ah(e){return{validate:t=>{try{return Bh(Uf(e,t))}catch{return Gf(e,t).then(Bh)}},vendor:`zod`,version:1}}function oh(e,t){if(!t.normalize&&t.protocol?.source===Zp.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}function sh(e){return e.replace(Kh,``)}function ch(e,t){return t.lastIndex=0,t.test(e.hostname)}function lh(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}function uh(e){if(!og.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}function dh(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:uh(n)}function fh(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function ph(e){if(!Jp.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return fh(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function mh(e){let t=e.length,n=1,r=0;for(;t;){let i=+e[--t];n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][i]:i}return r%10==0}function hh(e){return $p.test(e)?mh(e.replace(mg,``)):!1}function gh(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function _h(e,t,n){e.issues.length&&t.issues.push(...Td(n,e.issues)),t.value[n]=e.value}function vh(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Td(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}function yh(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Mg,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=hd(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function bh(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>vh(e,n,i,t,u,d))):vh(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}function xh(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Cd(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Od(e,r,uf())))}),t)}function Sh(e,t,n,r){let i=[];for(let t=0;te.issues.map(e=>Od(e,r,uf())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1,matches:i}),t)}function Ch(e,t){let n=e._zod,r=n.bag.optionsMap;if(!r){r=new Map;let{options:e,discriminator:t}=n.def;for(let n of e)for(let e of n._zod.propValues?.[t]??[])r.has(e)||r.set(e,n);n.bag.optionsMap=r}return r.get(t)}function wh(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ld(e)&&ld(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=wh(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=wh(t.value,n.value);if(!c.valid){if(Cd(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}function Eh(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function Dh(e,t,n){e.issues.length&&t.issues.push(...Td(n,e.issues)),t.value[n]=e.value}function Oh(e,t,n,r,i){for(let a=0;a=i&&n[a]._zod.optin===`optional`){t.value.length=a;break}if(o.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...Td(a,o.issues))}t.value[a]=o.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}function kh(e,t,n,r,i,a,o){e.issues.length&&(Qd.has(typeof r)?n.issues.push(...Td(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>Od(e,o,uf()))})),t.issues.length&&(Qd.has(typeof r)?n.issues.push(...Td(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>Od(e,o,uf()))})),n.value.set(e.value,t.value)}function Ah(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function jh(e,t){return e.value=t.issues.length?void 0:t.value,e}function Mh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Nh(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Ph(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Od(e,r,uf()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}function Fh(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function Ih(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Lh(e,r,t.out,n)):Lh(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Lh(e,r,t.in,n)):Lh(e,r,t.in,n)}}function Lh(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}function Rh(e){return e.memo||(e.value=Object.freeze(e.value)),e}function zh(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Md(e))}}var W,Bh,Vh,Hh,Uh,Wh,Gh,Kh,qh,Jh,Yh,Xh,Zh,Qh,$h,eg,tg,ng,rg,ig,ag,og,sg,cg,lg,ug,dg,fg,pg,mg,hg,gg,_g,vg,yg,bg,xg,Sg,Cg,wg,Tg,Eg,Dg,Og,kg,Ag,jg,Mg,Ng,Pg,Fg,Ig,Lg,Rg,zg,Bg,Vg,Hg,Ug,Wg,Gg,Kg,qg,Jg,Yg,Xg,Zg,Qg,$g,e_,t_,n_,r_,i_,a_,o_,s_,c_,l_,u_,d_,f_=o((()=>{eh(),yf(),nh(),fp(),Dm(),H(),ih(),W=U(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rh;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Cd(t),a;for(let o of n){if(o._zod.def.when){if(wd(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new gf;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Dd(t.issues,n,e),i||=Cd(t,n))});else{if(t.issues.length===n)continue;Dd(t.issues,n,e),i||=Cd(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Cd(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new gf;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new gf;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Hd(this,`~standard`,ah(this))},set"~standard"(e){Vd(this,`~standard`,e)}}),Bh=e=>e.success?{value:e.data}:{issues:e.error?.issues},Vh=U(`$ZodString`,(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??nm(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Hh=U(`$ZodStringFormat`,(e,t)=>{Wm.init(e,t),Vh.init(e,t)}),Uh=U(`$ZodGUID`,(e,t)=>{t.pattern??=Ap,Hh.init(e,t)}),Wh=U(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=jp(e)}else t.pattern??=jp();Hh.init(e,t)}),Gh=U(`$ZodEmail`,(e,t)=>{t.pattern??=Fp,Hh.init(e,t)}),Kh=/[\t\n\r]/g,qh=U(`$ZodURL`,(e,t)=>{Hh.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=oh(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!ch(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!lh(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:sh(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Jh=U(`$ZodEmoji`,(e,t)=>{t.pattern??=hp(),Hh.init(e,t)}),Yh=U(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Dp:mp(t.length),Hh.init(e,t)}),Xh=U(`$ZodCUID`,(e,t)=>{t.pattern??=Sp,Hh.init(e,t)}),Zh=U(`$ZodCUID2`,(e,t)=>{t.pattern??=Cp,Hh.init(e,t)}),Qh=U(`$ZodULID`,(e,t)=>{t.pattern??=wp,Hh.init(e,t)}),$h=U(`$ZodXID`,(e,t)=>{t.pattern??=Tp,Hh.init(e,t)}),eg=U(`$ZodKSUID`,(e,t)=>{t.pattern??=Ep,Hh.init(e,t)}),tg=U(`$ZodISODateTime`,(e,t)=>{t.pattern??=yp(t),Hh.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),ng=U(`$ZodISODate`,(e,t)=>{t.pattern??=tm,Hh.init(e,t)}),rg=U(`$ZodISOTime`,(e,t)=>{t.pattern??=vp(t),Hh.init(e,t)}),ig=U(`$ZodISODuration`,(e,t)=>{t.pattern??=Op,Hh.init(e,t)}),ag=U(`$ZodIPv4`,(e,t)=>{t.pattern??=Hp,Hh.init(e,t),e._zod.bag.format=`ipv4`}),og=/^[0-9a-fA-F:.]+$/,sg=U(`$ZodIPv6`,(e,t)=>{t.pattern??=Up,Hh.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{uh(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),cg=U(`$ZodMAC`,(e,t)=>{t.pattern??=Wp(t.delimiter),Hh.init(e,t),e._zod.bag.format=`mac`}),lg=U(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Gp,Hh.init(e,t)}),ug=U(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Kp,Hh.init(e,t),e._zod.check=n=>{dh(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}),dg=U(`$ZodBase64`,(e,t)=>{t.pattern??=qp,Hh.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{fh(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),fg=U(`$ZodBase64URL`,(e,t)=>{t.pattern??=Jp,Hh.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ph(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),pg=U(`$ZodE164`,(e,t)=>{t.pattern??=Qp,Hh.init(e,t)}),mg=/[- ]/g,hg=U(`$ZodCreditCard`,(e,t)=>{t.pattern??=$p,Hh.init(e,t),e._zod.check=n=>{hh(n.value)||n.issues.push({code:`invalid_format`,format:`credit_card`,input:n.value,inst:e,continue:!t.abort})}}),gg=U(`$ZodJWT`,(e,t)=>{Hh.init(e,t),e._zod.check=n=>{gh(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),_g=U(`$ZodCustomStringFormat`,(e,t)=>{Hh.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),vg=U(`$ZodNumber`,(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??am,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),yg=U(`$ZodNumberFormat`,(e,t)=>{Im.init(e,t),vg.init(e,t)}),bg=U(`$ZodBoolean`,(e,t)=>{W.init(e,t),e._zod.pattern=om,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),xg=U(`$ZodBigInt`,(e,t)=>{W.init(e,t),e._zod.pattern=rm,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),Sg=U(`$ZodBigIntFormat`,(e,t)=>{Lm.init(e,t),xg.init(e,t)}),Cg=U(`$ZodSymbol`,(e,t)=>{W.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),wg=U(`$ZodUndefined`,(e,t)=>{W.init(e,t),e._zod.pattern=cm,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Tg=U(`$ZodNull`,(e,t)=>{W.init(e,t),e._zod.pattern=sm,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Eg=U(`$ZodAny`,(e,t)=>{W.init(e,t),e._zod.parse=e=>e}),Dg=U(`$ZodUnknown`,(e,t)=>{W.init(e,t),e._zod.parse=e=>e}),Og=U(`$ZodNever`,(e,t)=>{W.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),kg=U(`$ZodVoid`,(e,t)=>{W.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Ag=U(`$ZodDate`,(e,t)=>{W.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}}),jg=U(`$ZodArray`,(e,t)=>{W.init(e,t);let n=vf.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;e_h(t,r,e))):_h(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}}),Mg=[],Ng=new WeakMap,Pg=U(`$ZodObject`,(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Ng.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),Ng.set(t,n),n}})}let n=Ju(()=>yh(t));Gd(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||ed(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=cd,i=t.catchall,a,o=vf.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>vh(n,t,e,c,r,i))):vh(a,t,e,c,r,i)}return i?bh(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),Fg=U(`$ZodObjectJIT`,(e,t)=>{Pg.init(e,t);let n=e._zod.parse,r=Ju(()=>yh(t)),i=vf.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new th([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>` @@ -105,7 +105,7 @@ - omitted: host decides border`)}),X({method:Z(`ui/request-display-mode`),params:X({mode:wN.describe(`The display mode being requested.`)})});var BN=X({mode:wN.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),VN=AD([Z(`model`),Z(`app`)]).describe(`Tool visibility scope - who can access the tool.`);X({resourceUri:q().optional(),visibility:Y(VN).optional().describe(`Who can access this tool. Default: ["model", "app"] - "model": Tool visible to and callable by the agent - "app": Tool callable by the app from this server only`),csp:wD().optional(),permissions:wD().optional()}),X({mimeTypes:Y(q()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),X({method:Z(`ui/download-file`),params:X({contents:Y(AD([fM,pM])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),X({method:Z(`ui/message`),params:X({role:Z(`user`).describe(`Message role, currently only "user" is supported.`),content:Y(mM).describe(`Message content blocks (text, image, etc.).`)})}),X({method:Z(`ui/notifications/sandbox-resource-ready`),params:X({html:q().describe(`HTML content to load into the inner iframe.`),sandbox:q().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:kN.optional().describe(`CSP configuration from resource metadata.`),permissions:AN.optional().describe(`Sandbox permissions from resource metadata.`)})});var HN=X({method:Z(`ui/notifications/tool-result`),params:CM.describe(`Standard MCP tool execution result.`)}),UN=X({toolInfo:X({id:HA.optional().describe(`JSON-RPC id of the tools/call request.`),tool:bM.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:CN.optional().describe(`Current color theme preference.`),styles:FN.optional().describe(`Style configuration for theming the app.`),displayMode:wN.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:Y(wN).optional().describe(`Display modes the host supports.`),containerDimensions:AD([X({height:J().describe(`Fixed container height in pixels.`)}),X({maxHeight:AD([J(),bD()]).optional().describe(`Maximum container height in pixels.`)})]).and(AD([X({width:J().describe(`Fixed container width in pixels.`)}),X({maxWidth:AD([J(),bD()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other -container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:q().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:q().optional().describe(`User's timezone in IANA format.`),userAgent:q().optional().describe(`Host application identifier.`),platform:AD([Z(`web`),Z(`desktop`),Z(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:X({touch:hD().optional().describe(`Whether the device supports touch input.`),hover:hD().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:X({top:J().describe(`Top safe area inset in pixels.`),right:J().describe(`Right safe area inset in pixels.`),bottom:J().describe(`Bottom safe area inset in pixels.`),left:J().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),WN=X({method:Z(`ui/notifications/host-context-changed`),params:UN.describe(`Partial context update containing only changed fields.`)});X({method:Z(`ui/update-model-context`),params:X({content:Y(mM).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:FD(q(),CD().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),X({method:Z(`ui/initialize`),params:X({appInfo:ij.describe(`App identification (name and version).`),appCapabilities:zN.describe(`Features and capabilities this app provides.`),protocolVersion:q().describe(`Protocol version this app supports.`)})});var GN=X({protocolVersion:q().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:ij.describe(`Host application identification and version.`),hostCapabilities:RN.describe(`Features and capabilities provided by the host.`),hostContext:UN.describe(`Rich context about the host environment.`)}).passthrough(),KN={target:`draft-2020-12`};async function qN(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](KN);if(n.vendor===`zod`){let{z:n}=await yN(async()=>{let{z:e}=await Promise.resolve().then(()=>(DA(),EA));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function JN(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}var YN=class e extends bN{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:jN,toolinputpartial:MN,toolresult:HN,toolcancelled:NN,hostcontextchanged:WN};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||uf({jitless:!0}),this.setRequestHandler(mj,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=hN(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await JN(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await JN(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await qN(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await qN(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(IN,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(TM,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(xM,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},CM,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},Jj,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},Hj,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?VM:BM;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},ON,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},$A,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},EN,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},DN,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},BN,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new SN(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:xN}},GN,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function XN({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,E.useState)(null),[s,c]=(0,E.useState)(!1),[l,u]=(0,E.useState)(null);return(0,E.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new SN(window.parent,window.parent);if(s=new YN(e,t,{autoResize:r,strict:i}),n?.(s),await s.connect(l),!a){s.close();return}o(s),c(!0),u(null)}catch(e){a&&(o(null),c(!1),u(e instanceof Error?e:Error(`Failed to connect`)))}}return l(),()=>{a=!1,s?.close()}},[]),{app:a,isConnected:s,error:l}}function ZN(e){let[t,n]=(0,E.useState)(null),[r,i]=(0,E.useState)({}),[a,o]=(0,E.useState)(),[s,c]=(0,E.useState)(null);function l(e){if(e.isError){c(`This view could not be refreshed. Please try again.`);return}c(null),n(e.structuredContent)}let u=XN({appInfo:{name:e,version:`1.0.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>{i(e.arguments??{})},e.ontoolresult=l,e.onhostcontextchanged=e=>o(t=>({...t,...e})),e.onerror=e=>{console.error(`MCP app error`,e),c(`This view could not be refreshed. Please try again.`)}}});(0,E.useEffect)(()=>{u.app&&o(u.app.getHostContext())},[u.app]);async function d(e){if(u.app)try{l(await u.app.callServerTool({name:e,arguments:r}))}catch(t){console.error(`Tool call ${e} failed`,t),c(`This view could not be refreshed. Please try again.`)}}return{...u,result:t,toolInput:r,host:a,toolError:s,callTool:d}}async function QN(e,t){e&&await e.sendMessage({role:`user`,content:[{type:`text`,text:t}]})}function $N(){let{app:e,callTool:t,error:n,host:r,result:i,toolError:a}=ZN(`Fanout system health`);return(0,N.jsxs)(Eu,{dark:r?.theme===`dark`,children:[(0,N.jsx)(Du,{title:`System health`,summary:i?.summary,onRefresh:()=>t(`observability_overview`),disabled:!e}),(0,N.jsx)(Ou,{error:a??(n?`This view could not be loaded. Please try again.`:null),loading:!i&&!n&&!a?`Loading system health…`:void 0,retry:()=>void t(`observability_overview`)}),i&&(0,N.jsx)(eP,{result:i,onService:t=>QN(e,`Investigate the ${t} service. Explain its errors and latency.`)})]})}function eP({result:e,onService:t}){let{data:n}=e,r=Math.max(n.service_count,1),i=Mu(n.services,6);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ol,{cols:{base:3},spacing:`sm`,px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,N.jsx)(ju,{label:`Services`,value:Fu.format(n.service_count)}),(0,N.jsx)(ju,{label:`Operations`,value:Fu.format(n.total_spans)}),(0,N.jsx)(ju,{label:`Error rate`,value:Iu(n.error_rate),color:Pu(n.health)})]}),(0,N.jsxs)(F,{px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,N.jsxs)(al.Root,{size:`lg`,"aria-label":`Service health distribution`,children:[(0,N.jsx)(al.Section,{value:n.counts.healthy/r*100,color:`ok`,children:(0,N.jsx)(al.Label,{children:n.counts.healthy})}),(0,N.jsx)(al.Section,{value:n.counts.degraded/r*100,color:`warn`,children:(0,N.jsx)(al.Label,{children:n.counts.degraded})}),(0,N.jsx)(al.Section,{value:n.counts.unhealthy/r*100,color:`bad`,children:(0,N.jsx)(al.Label,{children:n.counts.unhealthy})})]}),(0,N.jsxs)(nc,{mt:`xs`,gap:`lg`,children:[(0,N.jsx)(tP,{color:`ok`,text:`${n.counts.healthy} healthy`}),(0,N.jsx)(tP,{color:`warn`,text:`${n.counts.degraded} degraded`}),(0,N.jsx)(tP,{color:`bad`,text:`${n.counts.unhealthy} unhealthy`})]})]}),n.services.length===0?(0,N.jsx)(ku,{icon:(0,N.jsx)(uu,{size:20,weight:`duotone`}),title:`No activity in this window`,children:`Services will appear as data begins to arrive.`}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(L.ScrollContainer,{minWidth:560,children:(0,N.jsxs)(L,{striped:!0,highlightOnHover:!0,verticalSpacing:`sm`,children:[(0,N.jsx)(L.Thead,{children:(0,N.jsxs)(L.Tr,{children:[(0,N.jsx)(L.Th,{children:`Service`}),(0,N.jsx)(L.Th,{ta:`right`,children:`Traffic`}),(0,N.jsx)(L.Th,{ta:`right`,children:`P95`}),(0,N.jsx)(L.Th,{ta:`right`,children:`Errors`})]})}),(0,N.jsx)(L.Tbody,{children:i.pageItems.map(e=>(0,N.jsx)(nP,{service:e,onClick:()=>t(e.service)},e.service))})]})}),(0,N.jsx)(Nu,{...i,onChange:i.setPage})]}),(0,N.jsx)(Au,{left:Ru(e.provenance.window),right:`Updated ${new Date(e.provenance.generated_at).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`})]})}function tP({color:e,text:t}){return(0,N.jsxs)(nc,{gap:6,children:[(0,N.jsx)(F,{w:8,h:8,bg:e,style:{borderRadius:`50%`}}),(0,N.jsx)(uc,{c:`dimmed`,size:`xs`,children:t})]})}function nP({service:e,onClick:t}){return(0,N.jsxs)(L.Tr,{onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&t()},tabIndex:0,style:{cursor:`pointer`},children:[(0,N.jsx)(L.Td,{children:(0,N.jsx)(pc,{color:Pu(e.health),variant:`light`,tt:`none`,children:e.service})}),(0,N.jsx)(L.Td,{ta:`right`,children:Fu.format(e.spans)}),(0,N.jsx)(L.Td,{ta:`right`,children:Lu(e.p95_ms)}),(0,N.jsx)(L.Td,{ta:`right`,children:Iu(e.error_rate)})]})}(0,mu.createRoot)(document.getElementById(`root`)).render((0,N.jsx)(E.StrictMode,{children:(0,N.jsx)($N,{})})); +container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:q().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:q().optional().describe(`User's timezone in IANA format.`),userAgent:q().optional().describe(`Host application identifier.`),platform:AD([Z(`web`),Z(`desktop`),Z(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:X({touch:hD().optional().describe(`Whether the device supports touch input.`),hover:hD().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:X({top:J().describe(`Top safe area inset in pixels.`),right:J().describe(`Right safe area inset in pixels.`),bottom:J().describe(`Bottom safe area inset in pixels.`),left:J().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),WN=X({method:Z(`ui/notifications/host-context-changed`),params:UN.describe(`Partial context update containing only changed fields.`)});X({method:Z(`ui/update-model-context`),params:X({content:Y(mM).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:FD(q(),CD().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),X({method:Z(`ui/initialize`),params:X({appInfo:ij.describe(`App identification (name and version).`),appCapabilities:zN.describe(`Features and capabilities this app provides.`),protocolVersion:q().describe(`Protocol version this app supports.`)})});var GN=X({protocolVersion:q().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:ij.describe(`Host application identification and version.`),hostCapabilities:RN.describe(`Features and capabilities provided by the host.`),hostContext:UN.describe(`Rich context about the host environment.`)}).passthrough(),KN={target:`draft-2020-12`};async function qN(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](KN);if(n.vendor===`zod`){let{z:n}=await yN(async()=>{let{z:e}=await Promise.resolve().then(()=>(DA(),EA));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function JN(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}var YN=class e extends bN{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:jN,toolinputpartial:MN,toolresult:HN,toolcancelled:NN,hostcontextchanged:WN};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||uf({jitless:!0}),this.setRequestHandler(mj,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=hN(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await JN(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await JN(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await qN(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await qN(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(IN,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(TM,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(xM,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},CM,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},Jj,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},Hj,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?VM:BM;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},ON,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},$A,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},EN,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},DN,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},BN,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new SN(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:xN}},GN,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function XN({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,E.useState)(null),[s,c]=(0,E.useState)(!1),[l,u]=(0,E.useState)(null);return(0,E.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new SN(window.parent,window.parent);if(s=new YN(e,t,{autoResize:r,strict:i}),n?.(s),await s.connect(l),!a){s.close();return}o(s),c(!0),u(null)}catch(e){a&&(o(null),c(!1),u(e instanceof Error?e:Error(`Failed to connect`)))}}return l(),()=>{a=!1,s?.close()}},[]),{app:a,isConnected:s,error:l}}function ZN(e){let[t,n]=(0,E.useState)(null),[r,i]=(0,E.useState)({}),[a,o]=(0,E.useState)(),[s,c]=(0,E.useState)(null);function l(e){if(e.isError){c(`This view could not be refreshed. Please try again.`);return}c(null),n(e.structuredContent)}let u=XN({appInfo:{name:e,version:`1.0.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>{i(e.arguments??{})},e.ontoolresult=l,e.onhostcontextchanged=e=>o(t=>({...t,...e})),e.onerror=e=>{console.error(`MCP app error`,e),c(`This view could not be refreshed. Please try again.`)}}});(0,E.useEffect)(()=>{u.app&&o(u.app.getHostContext())},[u.app]);async function d(e){if(u.app)try{l(await u.app.callServerTool({name:e,arguments:r}))}catch(t){console.error(`Tool call ${e} failed`,t),c(`This view could not be refreshed. Please try again.`)}}return{...u,result:t,toolInput:r,host:a,toolError:s,callTool:d}}async function QN(e,t){e&&await e.sendMessage({role:`user`,content:[{type:`text`,text:t}]})}function $N(){let{app:e,callTool:t,error:n,host:r,result:i,toolError:a}=ZN(`Fanout system health`);return(0,N.jsxs)(Eu,{dark:r?.theme===`dark`,children:[(0,N.jsx)(Du,{title:`System health`,summary:i?.summary,onRefresh:()=>t(`observability_overview`),disabled:!e}),(0,N.jsx)(Ou,{error:a??(n?`This view could not be loaded. Please try again.`:null),loading:!i&&!n&&!a?`Loading system health…`:void 0,retry:()=>void t(`observability_overview`)}),i&&(0,N.jsx)(eP,{result:i,onService:t=>QN(e,`Investigate the ${t} service. Explain its errors and latency.`)})]})}function eP({result:e,onService:t}){let{data:n}=e,r=Math.max(n.service_count,1),i=Mu(n.services,6),a=n.health===`unknown`;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ol,{cols:{base:3},spacing:`sm`,px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,N.jsx)(ju,{label:`Services`,value:Fu.format(n.service_count)}),(0,N.jsx)(ju,{label:`Operations`,value:Fu.format(n.total_spans)}),(0,N.jsx)(ju,{label:`Error rate`,value:a?`—`:Iu(n.error_rate),color:Pu(n.health)})]}),!a&&(0,N.jsxs)(F,{px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,N.jsxs)(al.Root,{size:`lg`,"aria-label":`Service health distribution`,children:[(0,N.jsx)(al.Section,{value:n.counts.healthy/r*100,color:`ok`,children:(0,N.jsx)(al.Label,{children:n.counts.healthy})}),(0,N.jsx)(al.Section,{value:n.counts.degraded/r*100,color:`warn`,children:(0,N.jsx)(al.Label,{children:n.counts.degraded})}),(0,N.jsx)(al.Section,{value:n.counts.unhealthy/r*100,color:`bad`,children:(0,N.jsx)(al.Label,{children:n.counts.unhealthy})})]}),(0,N.jsxs)(nc,{mt:`xs`,gap:`lg`,children:[(0,N.jsx)(tP,{color:`ok`,text:`${n.counts.healthy} healthy`}),(0,N.jsx)(tP,{color:`warn`,text:`${n.counts.degraded} degraded`}),(0,N.jsx)(tP,{color:`bad`,text:`${n.counts.unhealthy} unhealthy`})]})]}),n.services.length===0?(0,N.jsx)(ku,{icon:(0,N.jsx)(uu,{size:20,weight:`duotone`}),title:`No activity in this window`,children:`Services will appear as data begins to arrive.`}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(L.ScrollContainer,{minWidth:560,children:(0,N.jsxs)(L,{striped:!0,highlightOnHover:!0,verticalSpacing:`sm`,children:[(0,N.jsx)(L.Thead,{children:(0,N.jsxs)(L.Tr,{children:[(0,N.jsx)(L.Th,{children:`Service`}),(0,N.jsx)(L.Th,{ta:`right`,children:`Traffic`}),(0,N.jsx)(L.Th,{ta:`right`,children:`P95`}),(0,N.jsx)(L.Th,{ta:`right`,children:`Errors`})]})}),(0,N.jsx)(L.Tbody,{children:i.pageItems.map(e=>(0,N.jsx)(nP,{service:e,onClick:()=>t(e.service)},e.service))})]})}),(0,N.jsx)(Nu,{...i,onChange:i.setPage})]}),(0,N.jsx)(Au,{left:Ru(e.provenance.window),right:`Updated ${new Date(e.provenance.generated_at).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`})]})}function tP({color:e,text:t}){return(0,N.jsxs)(nc,{gap:6,children:[(0,N.jsx)(F,{w:8,h:8,bg:e,style:{borderRadius:`50%`}}),(0,N.jsx)(uc,{c:`dimmed`,size:`xs`,children:t})]})}function nP({service:e,onClick:t}){return(0,N.jsxs)(L.Tr,{onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&t()},tabIndex:0,style:{cursor:`pointer`},children:[(0,N.jsx)(L.Td,{children:(0,N.jsx)(pc,{color:Pu(e.health),variant:`light`,tt:`none`,children:e.service})}),(0,N.jsx)(L.Td,{ta:`right`,children:Fu.format(e.spans)}),(0,N.jsx)(L.Td,{ta:`right`,children:Lu(e.p95_ms)}),(0,N.jsx)(L.Td,{ta:`right`,children:Iu(e.error_rate)})]})}(0,mu.createRoot)(document.getElementById(`root`)).render((0,N.jsx)(E.StrictMode,{children:(0,N.jsx)($N,{})})); diff --git a/internal/mcp/apps/performance.html b/internal/mcp/apps/performance.html index dd0051030..62d50bd2b 100644 --- a/internal/mcp/apps/performance.html +++ b/internal/mcp/apps/performance.html @@ -19,7 +19,7 @@ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?de(n):``}function B(e,t){switch(e.tag){case 26:case 27:case 5:return de(e.type);case 16:return de(`Lazy`);case 13:return e.child!==t&&t!==null?de(`Suspense Fallback`):de(`Suspense`);case 19:return de(`SuspenseList`);case 0:case 15:return pe(e.type,!1);case 11:return pe(e.type.render,!1);case 1:return pe(e.type,!0);case 31:return de(`Activity`);default:return``}}function me(e){try{var t=``,n=null;do t+=B(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` `+e.stack}}var V=Object.prototype.hasOwnProperty,he=t.unstable_scheduleCallback,ge=t.unstable_cancelCallback,_e=t.unstable_shouldYield,ve=t.unstable_requestPaint,ye=t.unstable_now,be=t.unstable_getCurrentPriorityLevel,xe=t.unstable_ImmediatePriority,Se=t.unstable_UserBlockingPriority,Ce=t.unstable_NormalPriority,we=t.unstable_LowPriority,Te=t.unstable_IdlePriority,Ee=t.log,De=t.unstable_setDisableYieldValue,Oe=null,ke=null;function Ae(e){if(typeof Ee==`function`&&De(e),ke&&typeof ke.setStrictMode==`function`)try{ke.setStrictMode(Oe,e)}catch{}}var je=Math.clz32?Math.clz32:Pe,Me=Math.log,Ne=Math.LN2;function Pe(e){return e>>>=0,e===0?32:31-(Me(e)/Ne|0)|0}var Fe=256,Ie=262144,Le=4194304;function Re(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Re(n))):i=Re(o):i=Re(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Re(n))):i=Re(o)):i=Re(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Be(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ve(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function He(){var e=Le;return Le<<=1,!(Le&62914560)&&(Le=4194304),e}function Ue(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function We(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ge(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),rn=!1;if(nn)try{var an={};Object.defineProperty(an,"passive",{get:function(){rn=!0}}),window.addEventListener(`test`,an,an),window.removeEventListener(`test`,an,an)}catch{rn=!1}var on=null,sn=null,cn=null;function ln(){if(cn)return cn;var e,t=sn,n=t.length,r,i=`value`in on?on.value:on.textContent,a=i.length;for(e=0;e=Vn),Wn=` `,Gn=!1;function Kn(e,t){switch(e){case`keyup`:return zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return qn(t);case`keypress`:return t.which===32?(Gn=!0,Wn):null;case`textInput`:return e=t.data,e===Wn&&Gn?null:e;default:return null}}function Xn(e,t){if(Jn)return e===`compositionend`||!Bn&&Kn(e,t)?(e=ln(),cn=sn=on=null,Jn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=vr(n)}}function br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=At(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=At(e.document)}return t}function Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Cr=nn&&`documentMode`in document&&11>=document.documentMode,wr=null,Tr=null,Er=null,Dr=!1;function Or(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||wr==null||wr!==At(r)||(r=wr,`selectionStart`in r&&Sr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Er&&_r(Er,r)||(Er=r,r=Pd(Tr,`onSelect`),0>=o,i-=o,bi=1<<32-je(t)+i|n<m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),ki&&Si(i,m),l;if(d===null){for(;mh?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),ki&&Si(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return ki&&Si(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),ki&&Si(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Ca(l)===r.type){n(e,r.sibling),c=a(r,o.props),Aa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===g?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),Aa(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Ca(o),x(e,r,o,c)}if(ee(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,ka(o),c);if(o.$$typeof===b)return x(e,r,Zi(e,o),c);ja(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Oa=0;var i=x(e,t,n,r);return Da=null,i}catch(t){if(t===_a||t===ya)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Na=Ma(!0),Pa=Ma(!1),Fa=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function La(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Bl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function Ba(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}function Va(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ha=!1;function Ua(){if(Ha){var e=ca;if(e!==null)throw e}}function Wa(e,t,n,r){Ha=!1;var i=e.updateQueue;Fa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Ul&p)===p:(r&p)===p){p!==0&&p===sa&&(Ha=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Fa=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Zl|=o,e.lanes=o,e.memoizedState=d}}function Ga(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ka(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=M.T,s={};M.T=s,Ns(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ms(e,t,da(c,r),yu(e)):Ms(e,t,r,yu(e))}catch(n){Ms(e,t,{then:function(){},status:`rejected`,reason:n},yu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function Ss(){}function Cs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ws(e).queue;xs(e,a,t,te,n===null?Ss:function(){return Ts(e),n(r)})}function ws(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ts(e){var t=ws(e);t.next===null&&(t=e.alternate.memoizedState),Ms(e,t.next.queue,{},yu())}function Es(){return Xi(sp)}function Ds(){return ko().memoizedState}function Os(){return ko().memoizedState}function ks(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=yu();e=Ra(n);var r=za(t,e,n);r!==null&&(xu(r,t,n),Ba(r,t,n)),t={cache:ra()},e.payload=t;return}t=t.return}}function As(e,t,n){var r=yu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ps(e)?Fs(t,n):(n=Xr(e,t,n,r),n!==null&&(xu(n,e,r),Is(n,t,r)))}function js(e,t,n){Ms(e,t,n,yu())}function Ms(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ps(e))Fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,gr(s,o))return Yr(e,t,i,0),Vl===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return xu(n,e,r),Is(n,t,r),!0}return!1}function Ns(e,t,n,r){if(r={lane:2,revertLane:vd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&xu(t,e,2)}function Ps(e){var t=e.alternate;return e===co||t!==null&&t===co}function Fs(e,t){po=fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Is(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qe(e,n)}}var Ls={readContext:Xi,use:Mo,useCallback:yo,useContext:yo,useEffect:yo,useImperativeHandle:yo,useLayoutEffect:yo,useInsertionEffect:yo,useMemo:yo,useReducer:yo,useRef:yo,useState:yo,useDebugValue:yo,useDeferredValue:yo,useTransition:yo,useSyncExternalStore:yo,useId:yo,useHostTransitionStatus:yo,useFormState:yo,useActionState:yo,useOptimistic:yo,useMemoCache:yo,useCacheRefresh:yo};Ls.useEffectEvent=yo;var Rs={readContext:Xi,use:Mo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:Xi,useEffect:cs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),os(4194308,4,ms.bind(null,t,e),n)},useLayoutEffect:function(e,t){return os(4194308,4,e,t)},useInsertionEffect:function(e,t){os(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=t===void 0?null:t;var r=e();if(mo){Ae(!0);try{e()}finally{Ae(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(n!==void 0){var i=n(t);if(mo){Ae(!0);try{n(t)}finally{Ae(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=As.bind(null,co,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:function(e){e=Wo(e);var t=e.queue,n=js.bind(null,co,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(e,t){return ys(Oo(),e,t)},useTransition:function(){var e=Wo(!1);return e=xs.bind(null,co,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=co,a=Oo();if(ki){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Vl===null)throw Error(i(349));Ul&127||zo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,cs(Vo.bind(null,r,o,e),[e]),r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=Vl.identifierPrefix;if(ki){var n=xi,r=bi;n=(r&~(1<<32-je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ho++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[et]=t,o[tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Ud(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return Lc(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ae.current,Ii(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Bd(e.nodeValue,n)),e||Ni(t,!0)}else e=Yd(e).createTextNode(r),e[et]=t,t.stateNode=e}return Lc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ii(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[et]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),e=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(io(t),t):(io(t),null);if(t.flags&128)throw Error(i(558))}return Lc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ii(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[et]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),a=!1}else a=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(io(t),t):(io(t),null)}return io(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fc(t,t.updateQueue),Lc(t),null);case 4:return z(),e===null&&Ad(t.stateNode.containerInfo),Lc(t),null;case 10:return Wi(t.type),Lc(t),null;case 19:if(ne(ao),r=t.memoizedState,r===null)return Lc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Ic(r,!1);else{if(Xl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=oo(e),o!==null){for(t.flags|=128,Ic(r,!1),e=o.updateQueue,t.updateQueue=e,Fc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return L(ao,ao.current&1|2),ki&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ye()>su&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}}else{if(!a){if(e=oo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Fc(t,e),Ic(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!ki)return Lc(t),null}else 2*ye()-r.renderingStartTime>su&&n!==536870912&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Lc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ye(),e.sibling=null,n=ao.current,L(ao,a?n&1|2:n&1),ki&&Si(t,r.treeForkCount),e);case 22:case 23:return io(t),Za(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Lc(t),t.subtreeFlags&6&&(t.flags|=8192)):Lc(t),n=t.updateQueue,n!==null&&Fc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ne(pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wi(na),Lc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zc(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(na),z(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ce(t),null;case 31:if(t.memoizedState!==null){if(io(t),t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ne(ao),null;case 4:return z(),null;case 10:return Wi(t.type),null;case 22:case 23:return io(t),Za(),e!==null&&ne(pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wi(na),null;case 25:return null;default:return null}}function Bc(e,t){switch(Ti(t),t.tag){case 3:Wi(na),z();break;case 26:case 27:case 5:ce(t);break;case 4:z();break;case 31:t.memoizedState!==null&&io(t);break;case 13:io(t);break;case 19:ne(ao);break;case 10:Wi(t.type);break;case 22:case 23:io(t),Za(),e!==null&&ne(pa);break;case 24:Wi(na)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Zu(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Zu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Zu(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ka(t,n)}catch(t){Zu(e,e.return,t)}}}function Wc(e,t,n){n.props=Gs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Zu(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Zu(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Zu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Zu(e,t,n)}else n.current=null}}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Zu(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;Wd(r,e.type,n,t),r[tt]=t}catch(t){Zu(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&sf(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&sf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qt));else if(r!==4&&(r===27&&sf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&sf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ud(t,r,n),t[et]=e,t[tt]=n}catch(t){Zu(e,e.return,t)}}var el=!1,tl=!1,nl=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,qd=gp,e=xr(e),Sr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Jd={focusedElem:e,selectionRange:n},gp=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Ud(o,r,n),o[et]=e,pt(o),r=o;break a;case`link`:var s=Xf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=yr(s,h),v=yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,M.T=null,n=hu,hu=null;var o=du,s=pu;if(uu=0,fu=du=null,pu=0,Bl&6)throw Error(i(331));var c=Bl;if(Bl|=4,Fl(o.current),Dl(o,o.current,s,n),Bl=c,dd(0,!1),ke&&typeof ke.onPostCommitFiberRoot==`function`)try{ke.onPostCommitFiberRoot(Oe,o)}catch{}return!0}finally{N.p=a,M.T=r,qu(e,t)}}function Xu(e,t,n){t=fi(n,t),t=Zs(e.stateNode,t,2),e=za(e,t,2),e!==null&&(We(e,2),ud(e))}function Zu(e,t,n){if(e.tag===3)Xu(e,e,n);else for(;t!==null;){if(t.tag===3){Xu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(lu===null||!lu.has(r))){e=fi(n,e),n=Qs(2),r=za(t,n,2),r!==null&&($s(n,r,t,e),We(r,2),ud(r));break}}t=t.return}}function Qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Jl=!0,i.add(n),e=$u.bind(null,e,t,n),t.then(e,e))}function $u(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Vl===e&&(Ul&n)===n&&(Xl===4||Xl===3&&(Ul&62914560)===Ul&&300>ye()-au?!(Bl&2)&&Ou(e,0):$l|=n,tu===Ul&&(tu=0)),ud(e)}function ed(e,t){t===0&&(t=He()),e=Zr(e,t),e!==null&&(We(e,t),ud(e))}function td(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ed(e,n)}function nd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),ed(e,n)}function rd(e,t){return he(e,t)}var id=null,ad=null,od=!1,sd=!1,cd=!1,ld=0;function ud(e){e!==ad&&e.next===null&&(ad===null?id=ad=e:ad=ad.next=e),sd=!0,od||(od=!0,_d())}function dd(e,t){if(!cd&&sd){cd=!0;do for(var n=!1,r=id;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,gd(r,a))}else a=Ul,a=ze(r,r===Vl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Be(r,a)||(n=!0,gd(r,a))}r=r.next}while(n);cd=!1}}function fd(){pd()}function pd(){sd=od=!1;var e=0;ld!==0&&ef()&&(e=ld);for(var t=ye(),n=null,r=id;r!==null;){var i=r.next,a=md(r,t);a===0?(r.next=null,n===null?id=i:n.next=i,i===null&&(ad=n)):(n=r,(e!==0||a&3)&&(sd=!0)),r=i}uu!==0&&uu!==5||dd(e,!1),ld!==0&&(ld=0)}function md(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Gd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function Af(e,t,n){var r=kf;if(r&&typeof t==`string`&&t){var i=Mt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wf.has(i)||(wf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ud(t,`link`,e),pt(t),r.head.appendChild(t)))}}function jf(e){Ef.D(e),Af(`dns-prefetch`,e,null)}function Mf(e,t){Ef.C(e,t),Af(`preconnect`,e,t)}function Nf(e,t,n){Ef.L(e,t,n);var r=kf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Mt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Mt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Mt(n.imageSizes)+`"]`)):i+=`[href="`+Mt(e)+`"]`;var a=i;switch(t){case`style`:a=zf(e);break;case`script`:a=Uf(e)}Cf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bf(a))||t===`script`&&r.querySelector(Wf(a))||(t=r.createElement(`link`),Ud(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Pf(e,t){Ef.m(e,t);var n=kf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Mt(r)+`"][href="`+Mt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Uf(e)}if(!Cf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),Cf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wf(a)))return}r=n.createElement(`link`),Ud(r,`link`,e),pt(r),n.head.appendChild(r)}}}function Ff(e,t,n){Ef.S(e,t,n);var r=kf;if(r&&e){var i=ft(r).hoistableStyles,a=zf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cf.get(a))&&qf(e,n);var c=o=r.createElement(`link`);pt(c),Ud(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Kf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function If(e,t){Ef.X(e,t);var n=kf;if(n&&e){var r=ft(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=f({src:e,async:!0},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),pt(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t){Ef.M(e,t);var n=kf;if(n&&e){var r=ft(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),pt(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t,n,r){var a=(a=ae.current)?Tf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=zf(n.href),n=ft(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=zf(n.href);var o=ft(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Bf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Cf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cf.set(e,n),o||Hf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Uf(n),n=ft(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zf(e){return`href="`+Mt(e)+`"`}function Bf(e){return`link[rel="stylesheet"][`+e+`]`}function Vf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Hf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ud(t,`link`,n),pt(t),e.head.appendChild(t))}function Uf(e){return`[src="`+Mt(e)+`"]`}function Wf(e){return`script[async]`+e}function Gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Mt(n.href)+`"]`);if(r)return t.instance=r,pt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),pt(r),Ud(r,`style`,a),Kf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zf(n.href);var o=e.querySelector(Bf(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=Vf(n),(a=Cf.get(a))&&qf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ud(o,`link`,r),t.state.loading|=4,Kf(o,n.precedence,e),t.instance=o;case`script`:return o=Uf(n.src),(a=e.querySelector(Wf(o)))?(t.instance=a,pt(a),a):(r=n,(a=Cf.get(o))&&(r=f({},n),Jf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),Ud(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Kf(r,n.precedence,e));return t.instance}function Kf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Qf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function $f(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ep(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=zf(r.href),a=t.querySelector(Bf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=Vf(r),(i=Cf.get(i))&&qf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ud(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=rp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var tp=0;function np(e,t){return e.stylesheets&&e.count===0&&ap(e,e.stylesheets),0tp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ap(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ip=null;function ap(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ip=new Map,t.forEach(op,e),ip=null,rp.call(e))}function op(e,t){if(!(t.state.loading&4)){var n=ip.get(e);if(n)var r=n.get(null);else{n=new Map,ip.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=fR()}))(),mR=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],hR=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],gR=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],_R=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],vR=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],yR=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],bR={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},xR={dark:[`#66d0ee`,`#a97ce0`,`#5fe8ce`,`#cb55e8`,`#41b6f8`,`#d2a6ff`],light:[`#2b93b5`,`#7c4dcc`,`#1a9c86`,`#a12fbf`,`#2f7fd4`,`#9163d6`]},SR={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},CR={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:mR,brand:hR,ok:gR,warn:_R,bad:vR,info:yR},defaultRadius:`md`,fontFamily:SR.body,fontFamilyMonospace:SR.display,headings:{fontFamily:SR.body,fontWeight:`600`},cursorType:`pointer`},wR=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":bR.light.muted},dark:{}}),TR=BA(CR);function ER({dark:e,children:t}){return(0,G.jsx)(RA,{theme:TR,cssVariablesResolver:wR,forceColorScheme:e?`dark`:`light`,children:(0,G.jsx)(mF,{withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:t})})}function DR({title:e,summary:t,onRefresh:n,disabled:r}){return(0,G.jsxs)(sI,{justify:`space-between`,align:`flex-start`,wrap:`nowrap`,px:{base:`md`,sm:`lg`},pt:`sm`,pb:`xs`,children:[(0,G.jsxs)(Pj,{miw:0,children:[(0,G.jsx)(KL,{order:2,fz:`lg`,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e}),t&&(0,G.jsx)(hI,{c:`dimmed`,size:`sm`,mt:2,children:t})]}),(0,G.jsx)(iL,{label:`Refresh this view`,children:(0,G.jsx)(ZF,{variant:`default`,size:`md`,"aria-label":`Refresh this view`,onClick:()=>void n(),disabled:r,children:(0,G.jsx)(tR,{size:15,weight:`bold`})})})]})}function OR({error:e,loading:t,retry:n}){return e?(0,G.jsx)(uI,{color:`bad`,m:`md`,radius:`md`,children:(0,G.jsxs)(sI,{justify:`space-between`,children:[(0,G.jsx)(hI,{size:`sm`,children:e}),n&&(0,G.jsx)(DI,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:n,children:`Retry`})]})}):t?(0,G.jsxs)(kI,{mih:160,p:`xl`,children:[(0,G.jsx)(UF,{size:`sm`}),(0,G.jsx)(hI,{c:`dimmed`,size:`sm`,ml:`sm`,children:t})]}):null}function kR({active:e,items:t,onChange:n}){return(0,G.jsx)(sF,{type:`auto`,offsetScrollbars:!0,scrollbarSize:6,children:(0,G.jsx)(IL,{value:e,onChange:e=>e&&n(e),variant:`pills`,px:{base:`md`,sm:`lg`},pb:`sm`,children:(0,G.jsx)(IL.List,{style:{flexWrap:`nowrap`},children:t.map(e=>(0,G.jsx)(IL.Tab,{value:e.id,rightSection:e.count===void 0?void 0:(0,G.jsx)(vI,{size:`xs`,variant:`light`,children:e.count}),children:e.label},e.id))})})})}function AR({icon:e,title:t,children:n,tall:r=!1}){return(0,G.jsx)(kI,{mih:r?220:130,p:`xl`,children:(0,G.jsxs)(sI,{wrap:`nowrap`,children:[(0,G.jsx)(zL,{variant:`light`,size:`xl`,radius:`md`,children:e}),(0,G.jsxs)(Pj,{children:[(0,G.jsx)(hI,{fw:700,size:`sm`,children:t}),(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,mt:3,children:n})]})]})})}function jR({left:e,right:t}){return(0,G.jsxs)(sI,{justify:`space-between`,px:{base:`md`,sm:`lg`},py:`xs`,style:{borderTop:`1px solid var(--mantine-color-default-border)`},children:[(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,children:e}),(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,ta:`right`,children:t})]})}function MR({label:e,value:t,color:n}){return(0,G.jsxs)(mF,{withBorder:!0,radius:`md`,p:`sm`,children:[(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,children:e}),(0,G.jsx)(hI,{fw:700,fz:`xl`,c:n,mt:3,children:t})]})}function NR(e,t=8){let[n,r]=(0,W.useState)(1),i=Math.max(1,Math.ceil(e.length/t));(0,W.useEffect)(()=>{n>i&&r(i)},[n,i]);let a=(n-1)*t;return{page:n,setPage:r,totalPages:i,pageItems:e.slice(a,a+t),from:e.length===0?0:a+1,to:Math.min(a+t,e.length),total:e.length}}function PR({page:e,totalPages:t,from:n,to:r,total:i,onChange:a}){return t<=1?null:(0,G.jsxs)(sI,{justify:`space-between`,gap:`sm`,px:{base:`md`,sm:`lg`},py:`xs`,style:{borderTop:`1px solid var(--mantine-color-default-border)`},children:[(0,G.jsxs)(hI,{c:`dimmed`,size:`xs`,children:[n,`–`,r,` of `,i]}),(0,G.jsx)(ZI,{value:e,total:t,onChange:a,size:`xs`,withEdges:!0,"aria-label":`Table pages`})]})}function FR(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:`bad`}function IR(e){return bR[e?`dark`:`light`]}function LR(e){let t=e?5:7;return{ok:gR[t],warn:_R[t],bad:vR[t],info:yR[t]}}function RR(e,t){let n=xR[t?`dark`:`light`],r=0;for(let t of e)r=r*31+t.charCodeAt(0)|0;return n[Math.abs(r)%n.length]}var zR=Ec(),BR=P,VR=fe,HR=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get(`value`),a=t.get(`status`);if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==a){this._lastValue=i,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||a===`hide`){o&&o.hide(),s&&s.hide();return}o&&o.show(),s&&s.show();var c={};this.makeElOption(c,i,e,t,n);var l=c.graphicKey;l!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=l;var u=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new Hu,this.createPointerEl(o,c,e,t),this.createLabelEl(o,c,e,t),n.getZr().add(o);else{var d=pe(UR,t,u);this.updatePointerEl(o,c,d),this.updateLabelEl(o,c,d,t)}qR(o,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get(`animation`),r=e.axis,i=r.type===`category`,a=t.get(`snap`);if(!a&&!i)return!1;if(n===`auto`||n==null){var o=this.animationThreshold;if(i&&Ub(r).w>o)return!0;if(a){var s=jD(e).seriesDataCount,c=r.getExtent();return Math.abs(c[0]-c[1])/s>o}return!1}return n===!0},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var a=zR(e).pointerEl=new Qd[i.type](BR(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=zR(e).labelEl=new Xo(BR(t.label));e.add(i),GR(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=zR(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=zR(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),GR(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t=this._axisPointerModel,n=this._api.getZr(),r=this._handle,i=t.getModel(`handle`),a=t.get(`status`);if(!i.get(`show`)||!a||a===`hide`){r&&n.remove(r),this._handle=null;return}var o;this._handle||(o=!0,r=this._handle=wf(i.get(`icon`),{cursor:`move`,draggable:!0,onmousemove:function(e){qx(e.event)},onmousedown:VR(this._onHandleDragMove,this,0,0),drift:VR(this._onHandleDragMove,this),ondragend:VR(this._onHandleDragEnd,this)}),n.add(r)),qR(r,t,!1),r.setStyle(i.getItemStyle(null,[`color`,`borderColor`,`borderWidth`,`opacity`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`]));var s=i.get(`size`);B(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,Rx(this,`_doDispatchAxisPointer`,i.get(`throttle`)||0,`fixRate`),this._moveHandleToValue(e,o)}},e.prototype._moveHandleToValue=function(e,t){UR(this._axisPointerModel,!t&&this._moveAnimation,this._handle,KR(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(KR(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(KR(r)),zR(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:`updateAxisPointer`,x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get(`value`);this._moveHandleToValue(e),this._api.dispatchAction({type:`hideTip`})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),zx(this,`_doDispatchAxisPointer`)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},e}();function UR(e,t,n,r){WR(zR(n).lastProp,r)||(zR(n).lastProp=r,t?Gd(n,r,e):(n.stopAnimation(),n.attr(r)))}function WR(e,t){if(_e(e)&&_e(t)){var n=!0;return R(t,function(t,r){n&&=WR(e[r],t)}),!!n}return e===t}function GR(e,t){e[t.get([`label`,`show`])?`show`:`hide`]()}function KR(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function qR(e,t,n){var r=t.get(`z`),i=t.get(`zlevel`);e&&e.traverse(function(e){e.type!==`group`&&(r!=null&&(e.z=r),i!=null&&(e.zlevel=i),e.silent=n)})}function JR(e){var t=e.get(`type`),n=e.getModel(t+`Style`),r;return t===`line`?(r=n.getLineStyle(),r.fill=null):t===`shadow`&&(r=n.getAreaStyle(),r.stroke=null),r}function YR(e,t,n,r,i){var a=ZR(n.get(`value`),t.axis,t.ecModel,n.get(`seriesDataIndices`),{precision:n.get([`label`,`precision`]),formatter:n.get([`label`,`formatter`])}),o=n.getModel(`label`),s=Cg(o.get(`padding`)||0),c=o.getFont(),l=yn(a,c),u=i.position,d=l.width+s[1]+s[3],f=l.height+s[0]+s[2],p=i.align;p===`right`&&(u[0]-=d),p===`center`&&(u[0]-=d/2);var m=i.verticalAlign;m===`bottom`&&(u[1]-=f),m===`middle`&&(u[1]-=f/2),XR(u,d,f,r);var h=o.get(`backgroundColor`);(!h||h===`auto`)&&(h=t.get([`axisLine`,`lineStyle`,`color`])),e.label={x:u[0],y:u[1],style:Qf(o,{text:a,font:c,fill:o.getTextColor(),padding:s,backgroundColor:h}),z2:10}}function XR(e,t,n,r){var i=r.getWidth(),a=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function ZR(e,t,n,r,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:Ey(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};R(r,function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)}),V(o)?a=o.replace(`{value}`,a):me(o)&&(a=o(s))}return a}function QR(e,t,n){var r=_t();return St(r,r,n.rotation),xt(r,r,n.position),_f([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function $R(e,t,n,r,i,a){var o=fx.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get([`label`,`margin`]),YR(t,r,i,a,{position:QR(r.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function ez(e,t,n){return n||=0,{x1:e[n],y1:e[1-n],x2:t[n],y2:t[1-n]}}function tz(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}}function nz(e,t,n){return Ub(e,{fromStat:{sers:z(t,function(e){return n.getSeriesByIndex(e.seriesIndex)})},min:1}).w}function rz(e,t,n){return[ms(ps(t[0],t[1]),e-n/2),ps(e+n/2,ms(t[0],t[1]))]}var iz=function(e){p(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.grid,s=r.get(`type`),c=a.getGlobalExtent(),l=az(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&s!==`none`){var d=JR(r),f=oz[s](a,u,c,l,r.get(`seriesDataIndices`),r.ecModel);f.style=d,e.graphicKey=f.type,e.pointer=f}$R(t,e,xx(o.getRect(),n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=xx(t.axis.grid.getRect(),t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=QR(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.grid,o=i.getGlobalExtent(!0),s=az(a,i).getOtherAxis(i).getGlobalExtent(),c=i.dim===`x`?0:1,l=[e.x,e.y];l[c]+=t[c],l[c]=ps(o[1],l[c]),l[c]=ms(o[0],l[c]);var u=(s[1]+s[0])/2,d=[u,u];return d[c]=l[c],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:`middle`},{align:`center`}][c]}},t}(HR);function az(e,t){var n={};return n[t.dim+`AxisIndex`]=t.index,e.getCartesian(n)}var oz={line:function(e,t,n,r){return{type:`Line`,subPixelOptimize:!0,shape:ez([t,r[0]],[t,r[1]],sz(e))}},shadow:function(e,t,n,r,i,a){var o=nz(e,i,a),s=r[1]-r[0],c=rz(t,n,o),l=c[0],u=c[1];return{type:`Rect`,shape:tz([l,r[0]],[u-l,s],sz(e))}}};function sz(e){return e.dim===`x`?0:1}var cz=function(e){p(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`axisPointer`,t.defaultOption={show:`auto`,z:50,type:`line`,snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:g_.color.border,width:1,type:`dashed`},shadowStyle:{color:g_.color.shadowTint},label:{show:!0,formatter:null,precision:`auto`,margin:3,color:g_.color.neutral00,padding:[5,7,5,7],backgroundColor:g_.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:`M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z`,size:45,margin:50,color:g_.color.accent40,throttle:40}},t}(Vg),lz=Ec(),uz=R;function dz(e,t,n){if(!We.node){var r=t.getZr();lz(r).records||(lz(r).records={}),fz(r,t);var i=lz(r).records[e]||(lz(r).records[e]={});i.handler=n}}function fz(e,t){if(lz(e).initialized)return;lz(e).initialized=!0,n(`click`,pe(hz,`click`)),n(`mousemove`,pe(hz,`mousemove`)),n(`mousewheel`,pe(hz,`mousewheel`)),n(`globalout`,mz);function n(n,r){e.on(n,function(n){var i=gz(t);uz(lz(e).records,function(e){e&&r(e,n,i.dispatchAction)}),pz(i.pendings,t)})}}function pz(e,t){var n=e.showTip.length,r=e.hideTip.length,i;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function mz(e,t,n){e.handler(`leave`,null,n)}function hz(e,t,n,r){t.handler(e,n,r)}function gz(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}function _z(e,t){if(!We.node){var n=t.getZr();(lz(n).records||{})[e]&&(lz(n).records[e]=null)}}var vz=function(e){p(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=t.getComponent(`tooltip`),i=e.get(`triggerOn`)||r&&r.get(`triggerOn`)||`mousemove|click|mousewheel`;dz(`axisPointer`,n,function(e,t,n){i!==`none`&&(e===`leave`||i.indexOf(e)>=0)&&n({type:`updateAxisPointer`,currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){_z(`axisPointer`,t)},t.prototype.dispose=function(e,t){_z(`axisPointer`,t)},t.type=`axisPointer`,t}(LC);function yz(e,t){var n=[],r=e.seriesIndex,i;if(r==null||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=Tc(a,e);if(o==null||o<0||B(o))return{point:[]};var s=a.getItemGraphicEl(o),c=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(c&&c.dataToPoint){if(e.isStacked){var l=c.getBaseAxis(),u=c.getOtherAxis(l).dim,d=l.dim,f=+(u===`x`||u===`radius`),p=a.mapDimension(d),m=[];m[f]=a.get(p,o),m[1-f]=a.get(a.getCalculationInfo(`stackResultDimension`),o),n=c.dataToPoint(m)||[]}else n=c.dataToPoint(a.getValues(z(c.dimensions,function(e){return a.mapDimension(e)}),o))||[]}else if(s){var h=s.getBoundingRect().clone();h.applyTransform(s.transform),n=[h.x+h.width/2,h.y+h.height/2]}return{point:n,el:s}}var bz=Ec();function xz(e,t,n){var r=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||fe(n.dispatchAction,n),s=t.getComponent(`axisPointer`).coordSysAxesInfo;if(s){jz(i)&&(i=yz({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var c=jz(i),l=a.axesInfo,u=s.axesInfo,d=r===`leave`||jz(i),f={},p={},m={list:[],map:{}},h={showPointer:pe(wz,p),showTooltip:pe(Tz,m)};R(s.coordSysMap,function(e,t){var n=c||e.containPoint(i);R(s.coordSysAxesInfo[t],function(e,t){var r=e.axis,a=kz(l,e);if(!d&&n&&(!l||a)){var o=a&&a.value;o==null&&!c&&(o=r.pointToData(i)),o!=null&&Sz(e,o,h,!1,f)}})});var g={};return R(u,function(e,t){var n=e.linkGroup;n&&!p[t]&&R(n.axesInfo,function(t,r){var i=p[r];if(t!==e&&i){var a=i.value;n.mapper&&(a=e.axis.scale.parse(n.mapper(a,Az(t),Az(e)))),g[e.key]=a}})}),R(g,function(e,t){Sz(u[t],e,h,!0,f)}),Ez(p,u,f),Dz(m,i,e,o),Oz(u,o,n),f}}function Sz(e,t,n,r,i){var a=e.axis;if(!a.scale.isBlank()&&a.containData(t)){if(!e.involveSeries){n.showPointer(e,t);return}var o=Cz(t,e),s=o.payloadBatch,c=o.snapToValue;s[0]&&i.seriesIndex==null&&I(i,s[0]),!r&&e.snap&&a.containData(c)&&c!=null&&(t=c),n.showPointer(e,t,s),n.showTooltip(e,o,c)}}function Cz(e,t){var n=t.axis,r=n.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return R(t.seriesModels,function(t,c){var l=t.getData().mapDimensionsAll(r),u,d;if(t.getAxisTooltipData){var f=t.getAxisTooltipData(l,e,n);d=f.dataIndices,u=f.nestestValue}else{if(d=t.indicesOfNearest(r,l[0],e,n.type===`category`?.5:null),!d.length)return;u=t.getData().get(l[0],d[0])}if(Ys(u)){var p=e-u,m=Math.abs(p);m<=o&&((m=0&&s<0)&&(o=m,s=p,i=u,a.length=0),R(d,function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})}))}}),{payloadBatch:a,snapToValue:i}}function wz(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function Tz(e,t,n,r){var i=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var c=t.coordSys.model,l=PD(c),u=e.map[l];u||(u=e.map[l]={coordSysId:c.id,coordSysIndex:c.componentIndex,coordSysType:c.type,coordSysMainType:c.mainType,dataByAxis:[]},e.list.push(u)),u.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get([`label`,`precision`]),formatter:s.get([`label`,`formatter`])},seriesDataIndices:i.slice()})}}function Ez(e,t,n){var r=n.axesInfo=[];R(t,function(t,n){var i=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(i.status=`show`),i.value=a.value,i.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(i.status=`hide`),i.status===`show`&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}function Dz(e,t,n,r){if(jz(t)||!e.list.length){r({type:`hideTip`});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:`showTip`,escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function Oz(e,t,n){var r=n.getZr(),i=`axisPointerLastHighlights`,a=bz(r)[i]||{},o=bz(r)[i]={};R(e,function(e,t){var n=e.axisPointerModel.option;n.status===`show`&&e.triggerEmphasis&&R(n.seriesDataIndices,function(e){o[e.seriesIndex+`|`+e.dataIndex]=e})});var s=[],c=[];function l(e){return{seriesIndex:e.seriesIndex,dataIndex:e.dataIndex}}R(a,function(e,t){!o[t]&&c.push(l(e))}),R(o,function(e,t){!a[t]&&s.push(l(e))}),c.length&&n.dispatchAction({type:`downplay`,escapeConnect:!0,notBlur:!0,batch:c}),s.length&&n.dispatchAction({type:`highlight`,escapeConnect:!0,notBlur:!0,batch:s})}function kz(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}function Az(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+`AxisIndex`]=t.componentIndex,n.axisName=n[r+`AxisName`]=t.name,n.axisId=n[r+`AxisId`]=t.id,n}function jz(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function Mz(e){ID.registerAxisPointerClass(`CartesianAxisPointer`,iz),e.registerComponentModel(cz),e.registerComponentView(vz),e.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!B(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(e,t){e.getComponent(`axisPointer`).coordSysAxesInfo=wD(e,t)}}),e.registerAction({type:`updateAxisPointer`,event:`updateAxisPointer`,update:`:updateAxisPointer`},xz)}function Nz(e){VE(qD),VE(Mz)}function Pz(e,t){var n=Cg(t.get(`padding`)),r=t.getItemStyle([`color`,`opacity`]);return r.fill=t.get(`backgroundColor`),new Go({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get(`borderRadius`)},style:r,silent:!0,z2:-1})}var Fz=function(e){p(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`tooltip`,t.dependencies=[`axisPointer`],t.defaultOption={z:60,show:!0,showContent:!0,trigger:`item`,triggerOn:`mousemove|click|mousewheel`,alwaysShowContent:!1,renderMode:`auto`,confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:g_.color.neutral00,shadowBlur:10,shadowColor:`rgba(0, 0, 0, .2)`,shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:g_.color.border,padding:null,extraCssText:``,axisPointer:{type:`line`,axis:`auto`,animation:`auto`,animationDurationUpdate:200,animationEasingUpdate:`exponentialOut`,crossStyle:{color:g_.color.borderShade,width:1,type:`dashed`,textStyle:{}}},textStyle:{color:g_.color.tertiary,fontSize:14}},t}(Vg);function Iz(e){var t=e.get(`confine`);return t==null?e.get(`renderMode`)===`richText`:!!t}function Lz(e){if(We.domSupported){for(var t=document.documentElement.style,n=0,r=e.length;n-1?(s+=`top:50%`,c+=`translateY(-50%) rotate(`+(l=a===`left`?-225:-45)+`deg)`):(s+=`left:50%`,c+=`translateX(-50%) rotate(`+(l=a===`top`?225:45)+`deg)`);var u=l*Math.PI/180,d=o+i,f=d*Math.abs(Math.cos(u))+d*Math.abs(Math.sin(u)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-d)/2)*100)/100;s+=`;`+a+`:-`+p+`px`;var m=t+` solid `+i+`px;`;return`
`}function qz(e,t,n){var r=`cubic-bezier(0.23,1,0.32,1)`,i=``,a=``;return n&&(i=` `+e/2+`s `+r,a=`opacity`+i+`,visibility`+i),t||(i=` `+e+`s `+r,a+=(a.length?`,`:``)+(We.transformSupported?``+Uz+i:`,left`+i+`,top`+i)),Hz+`:`+a}function Jz(e,t,n){var r=e.toFixed(0)+`px`,i=t.toFixed(0)+`px`;if(!We.transformSupported)return n?`top:`+i+`;left:`+r+`;`:[[`top`,i],[`left`,r]];var a=We.transform3dSupported,o=`translate`+(a?`3d`:``)+`(`+r+`,`+i+(a?`,0`:``)+`)`;return n?`top:0;left:0;`+Uz+`:`+o+`;`:[[`top`,0],[`left`,0],[Rz,o]]}function Yz(e){var t=[],n=e.get(`fontSize`),r=e.getTextColor();r&&t.push(`color:`+r),t.push(`font:`+e.getFont());var i=we(e.get(`lineHeight`),Math.round(n*3/2));n&&t.push(`line-height:`+i+`px`);var a=e.get(`textShadowColor`),o=e.get(`textShadowBlur`)||0,s=e.get(`textShadowOffsetX`)||0,c=e.get(`textShadowOffsetY`)||0;return a&&o&&t.push(`text-shadow:`+s+`px `+c+`px `+o+`px `+a),R([`decoration`,`align`],function(n){var r=e.get(n);r&&t.push(`text-`+n+`:`+r)}),t.join(`;`)}function Xz(e,t,n,r){var i=[],a=e.get(`transitionDuration`),o=e.get(`backgroundColor`),s=e.get(`shadowBlur`),c=e.get(`shadowColor`),l=e.get(`shadowOffsetX`),u=e.get(`shadowOffsetY`),d=e.getModel(`textStyle`),f=A_(e,`html`),p=l+`px `+u+`px `+s+`px `+c;return i.push(`box-shadow:`+p),t&&a>0&&i.push(qz(a,n,r)),o&&i.push(`background-color:`+o),R([`width`,`color`,`radius`],function(t){var n=`border-`+t,r=Sg(n),a=e.get(r);a!=null&&i.push(n+`:`+a+(t===`color`?``:`px`))}),i.push(Yz(d)),f!=null&&i.push(`padding:`+Cg(f).join(`px `)+`px`),i.join(`;`)+`;`}function Zz(e,t,n,r,i){var a=t&&t.painter;if(n){var o=a&&a.getViewportRoot();o&&see(e,o,n,r,i)}else{e[0]=r,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var Qz=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,We.wxa)return null;var n=document.createElement(`div`);n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,a=i&&(V(i)?document.querySelector(i):be(i)?i:me(i)&&i(e.getDom()));Zz(this._styleCoord,r,a,e.getWidth()/2,e.getHeight()/2),(a||e.getDom()).appendChild(n),this._api=e,this._container=a;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e||=window.event,!o._enterable){var t=r.handler;Kx(r.painter.getViewportRoot(),e,!0),t.dispatch(`mousemove`,e)}},n.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=Vz(t,`position`),r=t.style;r.position!==`absolute`&&n!==`absolute`&&(r.position=`relative`)}var i=e.get(`alwaysShowContent`);i&&this._moveIfResized(),this._alwaysShowContent=i,this._enableDisplayTransition=e.get(`displayTransition`)&&e.get(`transitionDuration`)>0,this.el.className=e.get(`className`)||``},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=Wz+Xz(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+Jz(i[0],i[1],!0)+(`border-color:`+kg(t)+`;`)+(e.get(`extraCssText`)||``)+(`;pointer-events:`+(this._enterable?`auto`:`none`)):r.display=`none`,this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,r,i){var a=this.el;if(e==null){a.innerHTML=``;return}var o=``;if(V(i)&&n.get(`trigger`)===`item`&&!Iz(n)&&(o=Kz(n,r,i)),V(e))a.innerHTML=e+o;else if(e){a.innerHTML=``,B(e)||(e=[e]);for(var s=0;s=0?this._tryShow(n,r):t===`leave`&&this._hide(r))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get(`triggerOn`);if(e.get(`trigger`)!==`axis`&&(this._lastDataByCoordSys=null,this._cbParamsList=null),this._lastX!=null&&this._lastY!=null&&r!==`none`&&r!==`click`){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,t,n,r){if(r.from!==this.uid&&!We.node&&n.getDom()){var i=oB(r,n);this._ticket=``;var a=r.dataByCoordSys,o=dB(r,t,n);if(o){var s=o.el.getBoundingRect().clone();s.applyTransform(o.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:o.el,position:r.position,positionDefault:`bottom`},i)}else if(r.tooltip&&r.x!=null&&r.y!=null){var c=rB;c.x=r.x,c.y=r.y,c.update(),el(c).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:c},i)}else if(a)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:a,tooltipOption:r.tooltipOption},i);else if(r.seriesIndex!=null){if(this._manuallyAxisShowTip(e,t,n,r))return;var l=yz(r,t),u=l.point[0],d=l.point[1];u!=null&&d!=null&&this._tryShow({offsetX:u,offsetY:d,target:l.el,position:r.position,positionDefault:`bottom`},i)}else r.x!=null&&r.y!=null&&(n.dispatchAction({type:`updateAxisPointer`,x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get(`hideDelay`)),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,r.from!==this.uid&&this._hide(oB(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,a=r.dataIndex,o=t.getComponent(`axisPointer`).coordSysAxesInfo;if(i!=null&&a!=null&&o!=null){var s=t.getSeriesByIndex(i);if(s&&aB([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model],this._tooltipModel).get(`trigger`)===`axis`)return n.dispatchAction({type:`updateAxisPointer`,seriesIndex:i,dataIndex:a,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r=e.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,e);else if(n){if(el(n).ssrType===`legend`)return;this._lastDataByCoordSys=null,this._cbParamsList=null;var i,a;pw(n,function(e){if(e.tooltipDisabled)return i=a=null,!0;i||a||(el(e).dataIndex==null?el(e).tooltipConfig!=null&&(a=e):i=e)},!0),i?this._showSeriesItemTooltip(e,i,t):a?this._showComponentItemTooltip(e,a,t):this._hide(t)}else this._lastDataByCoordSys=null,this._cbParamsList=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get(`showDelay`);t=fe(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],a=aB([t.tooltipOption],r),o=this._renderMode,s=[],c=C_(`section`,{blocks:[],noHeader:!0}),l=[],u=new j_;R(e,function(e){R(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+`Axis`,e.axisIndex),i=e.value,a=t.axis,d=a.scale.parse(i);if(t&&i!=null){var f=ZR(i,a,n,e.seriesDataIndices,e.valueLabelOpt),p=C_(`section`,{header:f,noHeader:!ke(f),sortBlocks:!0,blocks:[]});c.blocks.push(p),R(e.seriesDataIndices,function(i){var a=n.getSeriesByIndex(i.seriesIndex),c=i.dataIndexInside,m=a.getDataParams(c);if(!(m.dataIndex<0)){m.axisDim=e.axisDim,m.axisIndex=e.axisIndex,m.axisType=e.axisType,m.axisId=e.axisId,m.axisValue=Ey(t.axis,{value:d}),m.axisValueLabel=f,m.marker=u.makeTooltipMarker(`item`,kg(m.color),o);var h=Qg(a.formatTooltip(c,!0,null)),g=h.frag;if(g){var _=aB([a],r).get(`valueFormatter`);p.blocks.push(_?I({valueFormatter:_},g):g)}h.text&&l.push(h.text),s.push(m)}})}})}),c.blocks.reverse(),l.reverse();var d=t.position,f=D_(c,u,o,a.get(`order`),n.get(`useUTC`),a.get(`textStyle`));f&&l.unshift(f);var p=o===`richText`?` +`).replace(Rd,``)}function Bd(e,t){return t=zd(t),zd(e)===t}function Vd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&zt(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:Ht(e,r,o);break;case`data`:if(t!==`object`){Ct(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Vd(e,t,`name`,a.name,a,null),Vd(e,t,`formEncType`,a.formEncType,a,null),Vd(e,t,`formMethod`,a.formMethod,a,null),Vd(e,t,`formTarget`,a.formTarget,a,null)):(Vd(e,t,`encType`,a.encType,a,null),Vd(e,t,`method`,a.method,a,null),Vd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Kt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=qt);break;case`onScroll`:r!=null&&Dd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Dd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Kt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Dd(`beforetoggle`,e),Dd(`toggle`,e),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2s)break;var u=c.transferSize,d=c.initiatorType;u&&Gd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function Af(e,t,n){var r=kf;if(r&&typeof t==`string`&&t){var i=Mt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),wf.has(i)||(wf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ud(t,`link`,e),pt(t),r.head.appendChild(t)))}}function jf(e){Ef.D(e),Af(`dns-prefetch`,e,null)}function Mf(e,t){Ef.C(e,t),Af(`preconnect`,e,t)}function Nf(e,t,n){Ef.L(e,t,n);var r=kf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Mt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Mt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Mt(n.imageSizes)+`"]`)):i+=`[href="`+Mt(e)+`"]`;var a=i;switch(t){case`style`:a=zf(e);break;case`script`:a=Uf(e)}Cf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Cf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Bf(a))||t===`script`&&r.querySelector(Wf(a))||(t=r.createElement(`link`),Ud(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Pf(e,t){Ef.m(e,t);var n=kf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Mt(r)+`"][href="`+Mt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Uf(e)}if(!Cf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),Cf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Wf(a)))return}r=n.createElement(`link`),Ud(r,`link`,e),pt(r),n.head.appendChild(r)}}}function Ff(e,t,n){Ef.S(e,t,n);var r=kf;if(r&&e){var i=ft(r).hoistableStyles,a=zf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Bf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Cf.get(a))&&qf(e,n);var c=o=r.createElement(`link`);pt(c),Ud(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Kf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function If(e,t){Ef.X(e,t);var n=kf;if(n&&e){var r=ft(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=f({src:e,async:!0},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),pt(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t){Ef.M(e,t);var n=kf;if(n&&e){var r=ft(n).hoistableScripts,i=Uf(e),a=r.get(i);a||(a=n.querySelector(Wf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=Cf.get(i))&&Jf(e,t),a=n.createElement(`script`),pt(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t,n,r){var a=(a=ae.current)?Tf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=zf(n.href),n=ft(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=zf(n.href);var o=ft(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Bf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Cf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Cf.set(e,n),o||Hf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Uf(n),n=ft(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function zf(e){return`href="`+Mt(e)+`"`}function Bf(e){return`link[rel="stylesheet"][`+e+`]`}function Vf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Hf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ud(t,`link`,n),pt(t),e.head.appendChild(t))}function Uf(e){return`[src="`+Mt(e)+`"]`}function Wf(e){return`script[async]`+e}function Gf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Mt(n.href)+`"]`);if(r)return t.instance=r,pt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),pt(r),Ud(r,`style`,a),Kf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=zf(n.href);var o=e.querySelector(Bf(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=Vf(n),(a=Cf.get(a))&&qf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ud(o,`link`,r),t.state.loading|=4,Kf(o,n.precedence,e),t.instance=o;case`script`:return o=Uf(n.src),(a=e.querySelector(Wf(o)))?(t.instance=a,pt(a),a):(r=n,(a=Cf.get(o))&&(r=f({},n),Jf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),Ud(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Kf(r,n.precedence,e));return t.instance}function Kf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Qf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function $f(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ep(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=zf(r.href),a=t.querySelector(Bf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=Vf(r),(i=Cf.get(i))&&qf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ud(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=rp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var tp=0;function np(e,t){return e.stylesheets&&e.count===0&&ap(e,e.stylesheets),0tp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ap(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ip=null;function ap(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ip=new Map,t.forEach(op,e),ip=null,rp.call(e))}function op(e,t){if(!(t.state.loading&4)){var n=ip.get(e);if(n)var r=n.get(null);else{n=new Map,ip.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=fR()}))(),mR=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],hR=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],gR=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],_R=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],vR=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],yR=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],bR={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},xR={dark:[`#66d0ee`,`#a97ce0`,`#5fe8ce`,`#cb55e8`,`#41b6f8`,`#d2a6ff`],light:[`#2b93b5`,`#7c4dcc`,`#1a9c86`,`#a12fbf`,`#2f7fd4`,`#9163d6`]},SR={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},CR={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:mR,brand:hR,ok:gR,warn:_R,bad:vR,info:yR},defaultRadius:`md`,fontFamily:SR.body,fontFamilyMonospace:SR.display,headings:{fontFamily:SR.body,fontWeight:`600`},cursorType:`pointer`},wR=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":bR.light.muted},dark:{}}),TR=BA(CR);function ER({dark:e,children:t}){return(0,G.jsx)(RA,{theme:TR,cssVariablesResolver:wR,forceColorScheme:e?`dark`:`light`,children:(0,G.jsx)(mF,{withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:t})})}function DR({title:e,summary:t,onRefresh:n,disabled:r}){return(0,G.jsxs)(sI,{justify:`space-between`,align:`flex-start`,wrap:`nowrap`,px:{base:`md`,sm:`lg`},pt:`sm`,pb:`xs`,children:[(0,G.jsxs)(Pj,{miw:0,children:[(0,G.jsx)(KL,{order:2,fz:`lg`,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e}),t&&(0,G.jsx)(hI,{c:`dimmed`,size:`sm`,mt:2,children:t})]}),(0,G.jsx)(iL,{label:`Refresh this view`,children:(0,G.jsx)(ZF,{variant:`default`,size:`md`,"aria-label":`Refresh this view`,onClick:()=>void n(),disabled:r,children:(0,G.jsx)(tR,{size:15,weight:`bold`})})})]})}function OR({error:e,loading:t,retry:n}){return e?(0,G.jsx)(uI,{color:`bad`,m:`md`,radius:`md`,children:(0,G.jsxs)(sI,{justify:`space-between`,children:[(0,G.jsx)(hI,{size:`sm`,children:e}),n&&(0,G.jsx)(DI,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:n,children:`Retry`})]})}):t?(0,G.jsxs)(kI,{mih:160,p:`xl`,children:[(0,G.jsx)(UF,{size:`sm`}),(0,G.jsx)(hI,{c:`dimmed`,size:`sm`,ml:`sm`,children:t})]}):null}function kR({active:e,items:t,onChange:n}){return(0,G.jsx)(sF,{type:`auto`,offsetScrollbars:!0,scrollbarSize:6,children:(0,G.jsx)(IL,{value:e,onChange:e=>e&&n(e),variant:`pills`,px:{base:`md`,sm:`lg`},pb:`sm`,children:(0,G.jsx)(IL.List,{style:{flexWrap:`nowrap`},children:t.map(e=>(0,G.jsx)(IL.Tab,{value:e.id,rightSection:e.count===void 0?void 0:(0,G.jsx)(vI,{size:`xs`,variant:`light`,children:e.count}),children:e.label},e.id))})})})}function AR({icon:e,title:t,children:n,tall:r=!1}){return(0,G.jsx)(kI,{mih:r?220:130,p:`xl`,children:(0,G.jsxs)(sI,{wrap:`nowrap`,children:[(0,G.jsx)(zL,{variant:`light`,size:`xl`,radius:`md`,children:e}),(0,G.jsxs)(Pj,{children:[(0,G.jsx)(hI,{fw:700,size:`sm`,children:t}),(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,mt:3,children:n})]})]})})}function jR({left:e,right:t}){return(0,G.jsxs)(sI,{justify:`space-between`,px:{base:`md`,sm:`lg`},py:`xs`,style:{borderTop:`1px solid var(--mantine-color-default-border)`},children:[(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,children:e}),(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,ta:`right`,children:t})]})}function MR({label:e,value:t,color:n}){return(0,G.jsxs)(mF,{withBorder:!0,radius:`md`,p:`sm`,children:[(0,G.jsx)(hI,{c:`dimmed`,size:`xs`,children:e}),(0,G.jsx)(hI,{fw:700,fz:`xl`,c:n,mt:3,children:t})]})}function NR(e,t=8){let[n,r]=(0,W.useState)(1),i=Math.max(1,Math.ceil(e.length/t));(0,W.useEffect)(()=>{n>i&&r(i)},[n,i]);let a=(n-1)*t;return{page:n,setPage:r,totalPages:i,pageItems:e.slice(a,a+t),from:e.length===0?0:a+1,to:Math.min(a+t,e.length),total:e.length}}function PR({page:e,totalPages:t,from:n,to:r,total:i,onChange:a}){return t<=1?null:(0,G.jsxs)(sI,{justify:`space-between`,gap:`sm`,px:{base:`md`,sm:`lg`},py:`xs`,style:{borderTop:`1px solid var(--mantine-color-default-border)`},children:[(0,G.jsxs)(hI,{c:`dimmed`,size:`xs`,children:[n,`–`,r,` of `,i]}),(0,G.jsx)(ZI,{value:e,total:t,onChange:a,size:`xs`,withEdges:!0,"aria-label":`Table pages`})]})}function FR(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:e===`unknown`?`gray`:`bad`}function IR(e){return bR[e?`dark`:`light`]}function LR(e){let t=e?5:7;return{ok:gR[t],warn:_R[t],bad:vR[t],info:yR[t]}}function RR(e,t){let n=xR[t?`dark`:`light`],r=0;for(let t of e)r=r*31+t.charCodeAt(0)|0;return n[Math.abs(r)%n.length]}var zR=Ec(),BR=P,VR=fe,HR=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get(`value`),a=t.get(`status`);if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==a){this._lastValue=i,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||a===`hide`){o&&o.hide(),s&&s.hide();return}o&&o.show(),s&&s.show();var c={};this.makeElOption(c,i,e,t,n);var l=c.graphicKey;l!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=l;var u=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new Hu,this.createPointerEl(o,c,e,t),this.createLabelEl(o,c,e,t),n.getZr().add(o);else{var d=pe(UR,t,u);this.updatePointerEl(o,c,d),this.updateLabelEl(o,c,d,t)}qR(o,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get(`animation`),r=e.axis,i=r.type===`category`,a=t.get(`snap`);if(!a&&!i)return!1;if(n===`auto`||n==null){var o=this.animationThreshold;if(i&&Ub(r).w>o)return!0;if(a){var s=jD(e).seriesDataCount,c=r.getExtent();return Math.abs(c[0]-c[1])/s>o}return!1}return n===!0},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var a=zR(e).pointerEl=new Qd[i.type](BR(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=zR(e).labelEl=new Xo(BR(t.label));e.add(i),GR(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=zR(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=zR(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),GR(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t=this._axisPointerModel,n=this._api.getZr(),r=this._handle,i=t.getModel(`handle`),a=t.get(`status`);if(!i.get(`show`)||!a||a===`hide`){r&&n.remove(r),this._handle=null;return}var o;this._handle||(o=!0,r=this._handle=wf(i.get(`icon`),{cursor:`move`,draggable:!0,onmousemove:function(e){qx(e.event)},onmousedown:VR(this._onHandleDragMove,this,0,0),drift:VR(this._onHandleDragMove,this),ondragend:VR(this._onHandleDragEnd,this)}),n.add(r)),qR(r,t,!1),r.setStyle(i.getItemStyle(null,[`color`,`borderColor`,`borderWidth`,`opacity`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`]));var s=i.get(`size`);B(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,Rx(this,`_doDispatchAxisPointer`,i.get(`throttle`)||0,`fixRate`),this._moveHandleToValue(e,o)}},e.prototype._moveHandleToValue=function(e,t){UR(this._axisPointerModel,!t&&this._moveAnimation,this._handle,KR(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(KR(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(KR(r)),zR(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:`updateAxisPointer`,x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get(`value`);this._moveHandleToValue(e),this._api.dispatchAction({type:`hideTip`})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),zx(this,`_doDispatchAxisPointer`)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},e}();function UR(e,t,n,r){WR(zR(n).lastProp,r)||(zR(n).lastProp=r,t?Gd(n,r,e):(n.stopAnimation(),n.attr(r)))}function WR(e,t){if(_e(e)&&_e(t)){var n=!0;return R(t,function(t,r){n&&=WR(e[r],t)}),!!n}return e===t}function GR(e,t){e[t.get([`label`,`show`])?`show`:`hide`]()}function KR(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function qR(e,t,n){var r=t.get(`z`),i=t.get(`zlevel`);e&&e.traverse(function(e){e.type!==`group`&&(r!=null&&(e.z=r),i!=null&&(e.zlevel=i),e.silent=n)})}function JR(e){var t=e.get(`type`),n=e.getModel(t+`Style`),r;return t===`line`?(r=n.getLineStyle(),r.fill=null):t===`shadow`&&(r=n.getAreaStyle(),r.stroke=null),r}function YR(e,t,n,r,i){var a=ZR(n.get(`value`),t.axis,t.ecModel,n.get(`seriesDataIndices`),{precision:n.get([`label`,`precision`]),formatter:n.get([`label`,`formatter`])}),o=n.getModel(`label`),s=Cg(o.get(`padding`)||0),c=o.getFont(),l=yn(a,c),u=i.position,d=l.width+s[1]+s[3],f=l.height+s[0]+s[2],p=i.align;p===`right`&&(u[0]-=d),p===`center`&&(u[0]-=d/2);var m=i.verticalAlign;m===`bottom`&&(u[1]-=f),m===`middle`&&(u[1]-=f/2),XR(u,d,f,r);var h=o.get(`backgroundColor`);(!h||h===`auto`)&&(h=t.get([`axisLine`,`lineStyle`,`color`])),e.label={x:u[0],y:u[1],style:Qf(o,{text:a,font:c,fill:o.getTextColor(),padding:s,backgroundColor:h}),z2:10}}function XR(e,t,n,r){var i=r.getWidth(),a=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function ZR(e,t,n,r,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:Ey(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};R(r,function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)}),V(o)?a=o.replace(`{value}`,a):me(o)&&(a=o(s))}return a}function QR(e,t,n){var r=_t();return St(r,r,n.rotation),xt(r,r,n.position),_f([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function $R(e,t,n,r,i,a){var o=fx.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get([`label`,`margin`]),YR(t,r,i,a,{position:QR(r.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function ez(e,t,n){return n||=0,{x1:e[n],y1:e[1-n],x2:t[n],y2:t[1-n]}}function tz(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}}function nz(e,t,n){return Ub(e,{fromStat:{sers:z(t,function(e){return n.getSeriesByIndex(e.seriesIndex)})},min:1}).w}function rz(e,t,n){return[ms(ps(t[0],t[1]),e-n/2),ps(e+n/2,ms(t[0],t[1]))]}var iz=function(e){p(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.grid,s=r.get(`type`),c=a.getGlobalExtent(),l=az(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&s!==`none`){var d=JR(r),f=oz[s](a,u,c,l,r.get(`seriesDataIndices`),r.ecModel);f.style=d,e.graphicKey=f.type,e.pointer=f}$R(t,e,xx(o.getRect(),n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=xx(t.axis.grid.getRect(),t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=QR(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.grid,o=i.getGlobalExtent(!0),s=az(a,i).getOtherAxis(i).getGlobalExtent(),c=i.dim===`x`?0:1,l=[e.x,e.y];l[c]+=t[c],l[c]=ps(o[1],l[c]),l[c]=ms(o[0],l[c]);var u=(s[1]+s[0])/2,d=[u,u];return d[c]=l[c],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:`middle`},{align:`center`}][c]}},t}(HR);function az(e,t){var n={};return n[t.dim+`AxisIndex`]=t.index,e.getCartesian(n)}var oz={line:function(e,t,n,r){return{type:`Line`,subPixelOptimize:!0,shape:ez([t,r[0]],[t,r[1]],sz(e))}},shadow:function(e,t,n,r,i,a){var o=nz(e,i,a),s=r[1]-r[0],c=rz(t,n,o),l=c[0],u=c[1];return{type:`Rect`,shape:tz([l,r[0]],[u-l,s],sz(e))}}};function sz(e){return e.dim===`x`?0:1}var cz=function(e){p(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`axisPointer`,t.defaultOption={show:`auto`,z:50,type:`line`,snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:g_.color.border,width:1,type:`dashed`},shadowStyle:{color:g_.color.shadowTint},label:{show:!0,formatter:null,precision:`auto`,margin:3,color:g_.color.neutral00,padding:[5,7,5,7],backgroundColor:g_.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:`M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z`,size:45,margin:50,color:g_.color.accent40,throttle:40}},t}(Vg),lz=Ec(),uz=R;function dz(e,t,n){if(!We.node){var r=t.getZr();lz(r).records||(lz(r).records={}),fz(r,t);var i=lz(r).records[e]||(lz(r).records[e]={});i.handler=n}}function fz(e,t){if(lz(e).initialized)return;lz(e).initialized=!0,n(`click`,pe(hz,`click`)),n(`mousemove`,pe(hz,`mousemove`)),n(`mousewheel`,pe(hz,`mousewheel`)),n(`globalout`,mz);function n(n,r){e.on(n,function(n){var i=gz(t);uz(lz(e).records,function(e){e&&r(e,n,i.dispatchAction)}),pz(i.pendings,t)})}}function pz(e,t){var n=e.showTip.length,r=e.hideTip.length,i;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function mz(e,t,n){e.handler(`leave`,null,n)}function hz(e,t,n,r){t.handler(e,n,r)}function gz(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}function _z(e,t){if(!We.node){var n=t.getZr();(lz(n).records||{})[e]&&(lz(n).records[e]=null)}}var vz=function(e){p(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=t.getComponent(`tooltip`),i=e.get(`triggerOn`)||r&&r.get(`triggerOn`)||`mousemove|click|mousewheel`;dz(`axisPointer`,n,function(e,t,n){i!==`none`&&(e===`leave`||i.indexOf(e)>=0)&&n({type:`updateAxisPointer`,currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){_z(`axisPointer`,t)},t.prototype.dispose=function(e,t){_z(`axisPointer`,t)},t.type=`axisPointer`,t}(LC);function yz(e,t){var n=[],r=e.seriesIndex,i;if(r==null||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=Tc(a,e);if(o==null||o<0||B(o))return{point:[]};var s=a.getItemGraphicEl(o),c=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(c&&c.dataToPoint){if(e.isStacked){var l=c.getBaseAxis(),u=c.getOtherAxis(l).dim,d=l.dim,f=+(u===`x`||u===`radius`),p=a.mapDimension(d),m=[];m[f]=a.get(p,o),m[1-f]=a.get(a.getCalculationInfo(`stackResultDimension`),o),n=c.dataToPoint(m)||[]}else n=c.dataToPoint(a.getValues(z(c.dimensions,function(e){return a.mapDimension(e)}),o))||[]}else if(s){var h=s.getBoundingRect().clone();h.applyTransform(s.transform),n=[h.x+h.width/2,h.y+h.height/2]}return{point:n,el:s}}var bz=Ec();function xz(e,t,n){var r=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||fe(n.dispatchAction,n),s=t.getComponent(`axisPointer`).coordSysAxesInfo;if(s){jz(i)&&(i=yz({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var c=jz(i),l=a.axesInfo,u=s.axesInfo,d=r===`leave`||jz(i),f={},p={},m={list:[],map:{}},h={showPointer:pe(wz,p),showTooltip:pe(Tz,m)};R(s.coordSysMap,function(e,t){var n=c||e.containPoint(i);R(s.coordSysAxesInfo[t],function(e,t){var r=e.axis,a=kz(l,e);if(!d&&n&&(!l||a)){var o=a&&a.value;o==null&&!c&&(o=r.pointToData(i)),o!=null&&Sz(e,o,h,!1,f)}})});var g={};return R(u,function(e,t){var n=e.linkGroup;n&&!p[t]&&R(n.axesInfo,function(t,r){var i=p[r];if(t!==e&&i){var a=i.value;n.mapper&&(a=e.axis.scale.parse(n.mapper(a,Az(t),Az(e)))),g[e.key]=a}})}),R(g,function(e,t){Sz(u[t],e,h,!0,f)}),Ez(p,u,f),Dz(m,i,e,o),Oz(u,o,n),f}}function Sz(e,t,n,r,i){var a=e.axis;if(!a.scale.isBlank()&&a.containData(t)){if(!e.involveSeries){n.showPointer(e,t);return}var o=Cz(t,e),s=o.payloadBatch,c=o.snapToValue;s[0]&&i.seriesIndex==null&&I(i,s[0]),!r&&e.snap&&a.containData(c)&&c!=null&&(t=c),n.showPointer(e,t,s),n.showTooltip(e,o,c)}}function Cz(e,t){var n=t.axis,r=n.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return R(t.seriesModels,function(t,c){var l=t.getData().mapDimensionsAll(r),u,d;if(t.getAxisTooltipData){var f=t.getAxisTooltipData(l,e,n);d=f.dataIndices,u=f.nestestValue}else{if(d=t.indicesOfNearest(r,l[0],e,n.type===`category`?.5:null),!d.length)return;u=t.getData().get(l[0],d[0])}if(Ys(u)){var p=e-u,m=Math.abs(p);m<=o&&((m=0&&s<0)&&(o=m,s=p,i=u,a.length=0),R(d,function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})}))}}),{payloadBatch:a,snapToValue:i}}function wz(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function Tz(e,t,n,r){var i=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var c=t.coordSys.model,l=PD(c),u=e.map[l];u||(u=e.map[l]={coordSysId:c.id,coordSysIndex:c.componentIndex,coordSysType:c.type,coordSysMainType:c.mainType,dataByAxis:[]},e.list.push(u)),u.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get([`label`,`precision`]),formatter:s.get([`label`,`formatter`])},seriesDataIndices:i.slice()})}}function Ez(e,t,n){var r=n.axesInfo=[];R(t,function(t,n){var i=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(i.status=`show`),i.value=a.value,i.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(i.status=`hide`),i.status===`show`&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}function Dz(e,t,n,r){if(jz(t)||!e.list.length){r({type:`hideTip`});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:`showTip`,escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function Oz(e,t,n){var r=n.getZr(),i=`axisPointerLastHighlights`,a=bz(r)[i]||{},o=bz(r)[i]={};R(e,function(e,t){var n=e.axisPointerModel.option;n.status===`show`&&e.triggerEmphasis&&R(n.seriesDataIndices,function(e){o[e.seriesIndex+`|`+e.dataIndex]=e})});var s=[],c=[];function l(e){return{seriesIndex:e.seriesIndex,dataIndex:e.dataIndex}}R(a,function(e,t){!o[t]&&c.push(l(e))}),R(o,function(e,t){!a[t]&&s.push(l(e))}),c.length&&n.dispatchAction({type:`downplay`,escapeConnect:!0,notBlur:!0,batch:c}),s.length&&n.dispatchAction({type:`highlight`,escapeConnect:!0,notBlur:!0,batch:s})}function kz(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}function Az(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+`AxisIndex`]=t.componentIndex,n.axisName=n[r+`AxisName`]=t.name,n.axisId=n[r+`AxisId`]=t.id,n}function jz(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function Mz(e){ID.registerAxisPointerClass(`CartesianAxisPointer`,iz),e.registerComponentModel(cz),e.registerComponentView(vz),e.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!B(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(e,t){e.getComponent(`axisPointer`).coordSysAxesInfo=wD(e,t)}}),e.registerAction({type:`updateAxisPointer`,event:`updateAxisPointer`,update:`:updateAxisPointer`},xz)}function Nz(e){VE(qD),VE(Mz)}function Pz(e,t){var n=Cg(t.get(`padding`)),r=t.getItemStyle([`color`,`opacity`]);return r.fill=t.get(`backgroundColor`),new Go({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get(`borderRadius`)},style:r,silent:!0,z2:-1})}var Fz=function(e){p(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`tooltip`,t.dependencies=[`axisPointer`],t.defaultOption={z:60,show:!0,showContent:!0,trigger:`item`,triggerOn:`mousemove|click|mousewheel`,alwaysShowContent:!1,renderMode:`auto`,confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:g_.color.neutral00,shadowBlur:10,shadowColor:`rgba(0, 0, 0, .2)`,shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:g_.color.border,padding:null,extraCssText:``,axisPointer:{type:`line`,axis:`auto`,animation:`auto`,animationDurationUpdate:200,animationEasingUpdate:`exponentialOut`,crossStyle:{color:g_.color.borderShade,width:1,type:`dashed`,textStyle:{}}},textStyle:{color:g_.color.tertiary,fontSize:14}},t}(Vg);function Iz(e){var t=e.get(`confine`);return t==null?e.get(`renderMode`)===`richText`:!!t}function Lz(e){if(We.domSupported){for(var t=document.documentElement.style,n=0,r=e.length;n-1?(s+=`top:50%`,c+=`translateY(-50%) rotate(`+(l=a===`left`?-225:-45)+`deg)`):(s+=`left:50%`,c+=`translateX(-50%) rotate(`+(l=a===`top`?225:45)+`deg)`);var u=l*Math.PI/180,d=o+i,f=d*Math.abs(Math.cos(u))+d*Math.abs(Math.sin(u)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-d)/2)*100)/100;s+=`;`+a+`:-`+p+`px`;var m=t+` solid `+i+`px;`;return`
`}function qz(e,t,n){var r=`cubic-bezier(0.23,1,0.32,1)`,i=``,a=``;return n&&(i=` `+e/2+`s `+r,a=`opacity`+i+`,visibility`+i),t||(i=` `+e+`s `+r,a+=(a.length?`,`:``)+(We.transformSupported?``+Uz+i:`,left`+i+`,top`+i)),Hz+`:`+a}function Jz(e,t,n){var r=e.toFixed(0)+`px`,i=t.toFixed(0)+`px`;if(!We.transformSupported)return n?`top:`+i+`;left:`+r+`;`:[[`top`,i],[`left`,r]];var a=We.transform3dSupported,o=`translate`+(a?`3d`:``)+`(`+r+`,`+i+(a?`,0`:``)+`)`;return n?`top:0;left:0;`+Uz+`:`+o+`;`:[[`top`,0],[`left`,0],[Rz,o]]}function Yz(e){var t=[],n=e.get(`fontSize`),r=e.getTextColor();r&&t.push(`color:`+r),t.push(`font:`+e.getFont());var i=we(e.get(`lineHeight`),Math.round(n*3/2));n&&t.push(`line-height:`+i+`px`);var a=e.get(`textShadowColor`),o=e.get(`textShadowBlur`)||0,s=e.get(`textShadowOffsetX`)||0,c=e.get(`textShadowOffsetY`)||0;return a&&o&&t.push(`text-shadow:`+s+`px `+c+`px `+o+`px `+a),R([`decoration`,`align`],function(n){var r=e.get(n);r&&t.push(`text-`+n+`:`+r)}),t.join(`;`)}function Xz(e,t,n,r){var i=[],a=e.get(`transitionDuration`),o=e.get(`backgroundColor`),s=e.get(`shadowBlur`),c=e.get(`shadowColor`),l=e.get(`shadowOffsetX`),u=e.get(`shadowOffsetY`),d=e.getModel(`textStyle`),f=A_(e,`html`),p=l+`px `+u+`px `+s+`px `+c;return i.push(`box-shadow:`+p),t&&a>0&&i.push(qz(a,n,r)),o&&i.push(`background-color:`+o),R([`width`,`color`,`radius`],function(t){var n=`border-`+t,r=Sg(n),a=e.get(r);a!=null&&i.push(n+`:`+a+(t===`color`?``:`px`))}),i.push(Yz(d)),f!=null&&i.push(`padding:`+Cg(f).join(`px `)+`px`),i.join(`;`)+`;`}function Zz(e,t,n,r,i){var a=t&&t.painter;if(n){var o=a&&a.getViewportRoot();o&&see(e,o,n,r,i)}else{e[0]=r,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var Qz=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,We.wxa)return null;var n=document.createElement(`div`);n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,a=i&&(V(i)?document.querySelector(i):be(i)?i:me(i)&&i(e.getDom()));Zz(this._styleCoord,r,a,e.getWidth()/2,e.getHeight()/2),(a||e.getDom()).appendChild(n),this._api=e,this._container=a;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e||=window.event,!o._enterable){var t=r.handler;Kx(r.painter.getViewportRoot(),e,!0),t.dispatch(`mousemove`,e)}},n.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=Vz(t,`position`),r=t.style;r.position!==`absolute`&&n!==`absolute`&&(r.position=`relative`)}var i=e.get(`alwaysShowContent`);i&&this._moveIfResized(),this._alwaysShowContent=i,this._enableDisplayTransition=e.get(`displayTransition`)&&e.get(`transitionDuration`)>0,this.el.className=e.get(`className`)||``},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=Wz+Xz(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+Jz(i[0],i[1],!0)+(`border-color:`+kg(t)+`;`)+(e.get(`extraCssText`)||``)+(`;pointer-events:`+(this._enterable?`auto`:`none`)):r.display=`none`,this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,r,i){var a=this.el;if(e==null){a.innerHTML=``;return}var o=``;if(V(i)&&n.get(`trigger`)===`item`&&!Iz(n)&&(o=Kz(n,r,i)),V(e))a.innerHTML=e+o;else if(e){a.innerHTML=``,B(e)||(e=[e]);for(var s=0;s=0?this._tryShow(n,r):t===`leave`&&this._hide(r))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get(`triggerOn`);if(e.get(`trigger`)!==`axis`&&(this._lastDataByCoordSys=null,this._cbParamsList=null),this._lastX!=null&&this._lastY!=null&&r!==`none`&&r!==`click`){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,t,n,r){if(r.from!==this.uid&&!We.node&&n.getDom()){var i=oB(r,n);this._ticket=``;var a=r.dataByCoordSys,o=dB(r,t,n);if(o){var s=o.el.getBoundingRect().clone();s.applyTransform(o.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:o.el,position:r.position,positionDefault:`bottom`},i)}else if(r.tooltip&&r.x!=null&&r.y!=null){var c=rB;c.x=r.x,c.y=r.y,c.update(),el(c).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:c},i)}else if(a)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:a,tooltipOption:r.tooltipOption},i);else if(r.seriesIndex!=null){if(this._manuallyAxisShowTip(e,t,n,r))return;var l=yz(r,t),u=l.point[0],d=l.point[1];u!=null&&d!=null&&this._tryShow({offsetX:u,offsetY:d,target:l.el,position:r.position,positionDefault:`bottom`},i)}else r.x!=null&&r.y!=null&&(n.dispatchAction({type:`updateAxisPointer`,x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get(`hideDelay`)),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,r.from!==this.uid&&this._hide(oB(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,a=r.dataIndex,o=t.getComponent(`axisPointer`).coordSysAxesInfo;if(i!=null&&a!=null&&o!=null){var s=t.getSeriesByIndex(i);if(s&&aB([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model],this._tooltipModel).get(`trigger`)===`axis`)return n.dispatchAction({type:`updateAxisPointer`,seriesIndex:i,dataIndex:a,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r=e.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,e);else if(n){if(el(n).ssrType===`legend`)return;this._lastDataByCoordSys=null,this._cbParamsList=null;var i,a;pw(n,function(e){if(e.tooltipDisabled)return i=a=null,!0;i||a||(el(e).dataIndex==null?el(e).tooltipConfig!=null&&(a=e):i=e)},!0),i?this._showSeriesItemTooltip(e,i,t):a?this._showComponentItemTooltip(e,a,t):this._hide(t)}else this._lastDataByCoordSys=null,this._cbParamsList=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get(`showDelay`);t=fe(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],a=aB([t.tooltipOption],r),o=this._renderMode,s=[],c=C_(`section`,{blocks:[],noHeader:!0}),l=[],u=new j_;R(e,function(e){R(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+`Axis`,e.axisIndex),i=e.value,a=t.axis,d=a.scale.parse(i);if(t&&i!=null){var f=ZR(i,a,n,e.seriesDataIndices,e.valueLabelOpt),p=C_(`section`,{header:f,noHeader:!ke(f),sortBlocks:!0,blocks:[]});c.blocks.push(p),R(e.seriesDataIndices,function(i){var a=n.getSeriesByIndex(i.seriesIndex),c=i.dataIndexInside,m=a.getDataParams(c);if(!(m.dataIndex<0)){m.axisDim=e.axisDim,m.axisIndex=e.axisIndex,m.axisType=e.axisType,m.axisId=e.axisId,m.axisValue=Ey(t.axis,{value:d}),m.axisValueLabel=f,m.marker=u.makeTooltipMarker(`item`,kg(m.color),o);var h=Qg(a.formatTooltip(c,!0,null)),g=h.frag;if(g){var _=aB([a],r).get(`valueFormatter`);p.blocks.push(_?I({valueFormatter:_},g):g)}h.text&&l.push(h.text),s.push(m)}})}})}),c.blocks.reverse(),l.reverse();var d=t.position,f=D_(c,u,o,a.get(`order`),n.get(`useUTC`),a.get(`textStyle`));f&&l.unshift(f);var p=o===`richText`?` `:`
`,m=l.join(p);this._showOrMove(a,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(a,d,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(a,m,s,Math.random()+``,i[0],i[1],d,null,u)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=el(t),a=i.seriesIndex,o=r.getSeriesByIndex(a),s=i.dataModel||o,c=i.dataIndex,l=i.dataType,u=s.getData(l),d=this._renderMode,f=e.positionDefault,p=aB([u.getItemModel(c),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),m=p.get(`trigger`);if(m==null||m===`item`){var h=s.getDataParams(c,l),g=new j_;h.marker=g.makeTooltipMarker(`item`,kg(h.color),d);var _=Qg(s.formatTooltip(c,!1,l)),v=p.get(`order`),y=p.get(`valueFormatter`),b=_.frag,x=b?D_(y?I({valueFormatter:y},b):b,g,d,v,r.get(`useUTC`),p.get(`textStyle`)):_.text,S=`item_`+s.name+`_`+c;this._showOrMove(p,function(){this._showTooltipContent(p,x,h,S,e.offsetX,e.offsetY,e.position,e.target,g)}),n({type:`showTip`,dataIndexInside:c,dataIndex:u.getRawIndex(c),seriesIndex:a,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r=this._renderMode===`html`,i=el(t),a=i.tooltipConfig.option||{},o=a.encodeHTMLContent;if(V(a)){var s=a;a={content:s,formatter:s},o=!0}o&&r&&a.content&&(a=P(a),a.content=Th(a.content));var c=[a],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&c.push(l),c.push({formatter:a.content});var u=e.positionDefault,d=aB(c,this._tooltipModel,u?{position:u}:null),f=d.get(`content`),p=Math.random()+``,m=new j_;this._showOrMove(d,function(){var n=P(d.get(`formatterParams`)||{});this._showTooltipContent(d,f,n,p,e.offsetX,e.offsetY,e.position,t,m)}),n({type:`showTip`,from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,a,o,s,c){if(this._ticket=``,e.get(`showContent`)&&e.get(`show`)){var l=this._tooltipContent;l.setEnterable(e.get(`enterable`));var u=e.get(`formatter`);o||=e.get(`position`);var d=t,f=this._getNearestPoint([i,a],n,e.get(`trigger`),e.get(`borderColor`),e.get(`defaultBorderColor`,!0)).color;if(u){if(V(u)){var p=e.ecModel.get(`useUTC`),m=B(n)?n[0]:n,h=m&&m.axisType&&m.axisType.indexOf(`time`)>=0;d=u,h&&(d=rg(m.axisValue,d,p)),d=Dg(d,n,!0)}else if(me(u)){var g=fe(function(t,r){t===this._ticket&&(l.setContent(r,c,e,f,o),this._updatePosition(e,o,i,a,l,n,s))},this);this._ticket=r,d=u(n,r,g)}else d=u}l.setContent(d,c,e,f,o),l.show(e,f),this._updatePosition(e,o,i,a,l,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r,i){if(n===`axis`||B(t))return{color:r||i};if(!B(t))return{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,a,o){var s=this._api.getWidth(),c=this._api.getHeight();t||=e.get(`position`);var l=i.getSize(),u=e.get(`align`),d=e.get(`verticalAlign`),f=o&&o.getBoundingRect().clone();if(o&&f.applyTransform(o.transform),me(t)&&(t=t([n,r],a,i.el,f,{viewSize:[s,c],contentSize:l.slice()})),B(t))n=Ts(t[0],s),r=Ts(t[1],c);else if(_e(t)){var p=t;p.width=l[0],p.height=l[1];var m=Fg(p,{width:s,height:c});n=m.x,r=m.y,u=null,d=null}else if(V(t)&&o){var h=lB(t,f,l,e.get(`borderWidth`));n=h[0],r=h[1]}else{var h=sB(n,r,i,s,c,u?null:20,d?null:20);n=h[0],r=h[1]}if(u&&(n-=uB(u)?l[0]/2:u===`right`?l[0]:0),d&&(r-=uB(d)?l[1]/2:d===`bottom`?l[1]:0),Iz(e)){var h=cB(n,r,i,s,c);n=h[0],r=h[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&R(n,function(n,a){var o=n.dataByAxis||[],s=(e[a]||{}).dataByAxis||[];i&&=o.length===s.length,i&&R(o,function(e,n){var a=s[n]||{},o=e.seriesDataIndices||[],c=a.seriesDataIndices||[];i=i&&e.value===a.value&&e.axisType===a.axisType&&e.axisId===a.axisId&&o.length===c.length,i&&R(o,function(e,t){var n=c[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&R(e.seriesDataIndices,function(e){var n=e.seriesIndex,a=t[n],o=r[n];a&&o&&o.data!==a.data&&(i=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,this._cbParamsList=null,e({type:`hideTip`,from:this.uid})},t.prototype.dispose=function(e,t){!We.node&&t.getDom()&&(zx(this,`_updatePosition`),this._tooltipContent.dispose(),_z(`itemTooltip`,t),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},t.type=`tooltip`,t}(LC);function aB(e,t,n){var r=t.ecModel,i;n?(i=new yp(n,r,r),i=new yp(t.option,i,r)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof yp&&(o=o.get(`tooltip`,!0)),V(o)&&(o={formatter:o}),o&&(i=new yp(o,i,r)))}return i}function oB(e,t){return e.dispatchAction||fe(t.dispatchAction,t)}function sB(e,t,n,r,i,a,o){var s=n.getSize(),c=s[0],l=s[1];return a!=null&&(e+c+a+2>r?e-=c+a:e+=a),o!=null&&(t+l+o>i?t-=l+o:t+=o),[e,t]}function cB(e,t,n,r,i){var a=n.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,r)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function lB(e,t,n,r){var i=n[0],a=n[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,c=0,l=t.width,u=t.height;switch(e){case`inside`:s=t.x+l/2-i/2,c=t.y+u/2-a/2;break;case`top`:s=t.x+l/2-i/2,c=t.y-a-o;break;case`bottom`:s=t.x+l/2-i/2,c=t.y+u+o;break;case`left`:s=t.x-i-o,c=t.y+u/2-a/2;break;case`right`:s=t.x+l+o,c=t.y+u/2-a/2}return[s,c]}function uB(e){return e===`center`||e===`middle`}function dB(e,t,n){var r=kc(e).queryOptionMap,i=r.keys()[0];if(i&&i!==`series`){var a=jc(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a){var o=n.getViewOfComponentModel(a),s;if(o.group.traverse(function(t){var n=el(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}}}function fB(e){VE(Mz),e.registerComponentModel(Fz),e.registerComponentView(iB),e.registerAction({type:`showTip`,event:`showTip`,update:`tooltip:manuallyShowTip`},Ve),e.registerAction({type:`hideTip`,event:`hideTip`,update:`tooltip:manuallyHideTip`},Ve)}var pB=R;function mB(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function hB(e,t,n){var r={};return pB(t,function(t){var a=r[t]=i();pB(e[t],function(e,r){if(ZD.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),a[r]=new ZD(i),r===`opacity`&&(i=P(i),i.type=`colorAlpha`,a.__hidden.__alphaForOpacity=new ZD(i))}})}),r;function i(){var e=function(){};return e.prototype.__hidden=e.prototype,new e}}function gB(e,t,n){var r;R(n,function(e){t.hasOwnProperty(e)&&mB(t[e])&&(r=!0)}),r&&R(n,function(n){t.hasOwnProperty(n)&&mB(t[n])?e[n]=P(t[n]):delete e[n]})}function _B(e,t,n,r){var i={};return R(e,function(e){i[e]=ZD.prepareVisualTypes(t[e])}),{progress:function(e,a){var o;r!=null&&(o=a.getDimensionIndex(r));function s(e){return uw(a,l,e)}function c(e,t){fw(a,l,e,t)}for(var l,u=a.getStore();(l=e.next())!=null;){var d=a.getRawDataItem(l);if(!(d&&d.visualMap===!1))for(var f=r==null?l:u.get(o,l),p=n(f),m=t[p],h=i[p],g=0,_=h.length;g<_;g++){var v=h[g];m[v]&&m[v].applyVisual(f,s,c)}}}}}var vB=function(e,t){if(t===`all`)return{type:`all`,title:e.getLocaleModel().get([`legend`,`selector`,`all`])};if(t===`inverse`)return{type:`inverse`,title:e.getLocaleModel().get([`legend`,`selector`,`inverse`])}},yB=function(e){p(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;t===!0&&(t=e.selector=[`all`,`inverse`]),B(t)&&R(t,function(e,r){V(e)&&(e={type:e}),t[r]=F(e,vB(n,e.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get(`selectedMode`)===`single`){for(var t=!1,n=0;n=0},t.prototype.getOrient=function(){return this.get(`orient`)===`vertical`?{index:1,name:`vertical`}:{index:0,name:`horizontal`}},t.type=`legend.plain`,t.dependencies=[`series`],t.defaultOption={z:4,show:!0,orient:`horizontal`,left:`center`,bottom:g_.size.m,align:`auto`,backgroundColor:g_.color.transparent,borderColor:g_.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:`inherit`,symbolKeepAspect:!0,inactiveColor:g_.color.disabled,inactiveBorderColor:g_.color.disabled,inactiveBorderWidth:`auto`,itemStyle:{color:`inherit`,opacity:`inherit`,borderColor:`inherit`,borderWidth:`auto`,borderCap:`inherit`,borderJoin:`inherit`,borderDashOffset:`inherit`,borderMiterLimit:`inherit`},lineStyle:{width:`auto`,color:`inherit`,inactiveColor:g_.color.disabled,inactiveWidth:2,opacity:`inherit`,type:`inherit`,cap:`inherit`,join:`inherit`,dashOffset:`inherit`,miterLimit:`inherit`},textStyle:{color:g_.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:`sans-serif`,color:g_.color.tertiary,borderWidth:1,borderColor:g_.color.border},emphasis:{selectorLabel:{show:!0,color:g_.color.quaternary}},selectorPosition:`auto`,selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(Vg),bB=pe,xB=R,SB=Hu,CB=function(e){p(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return t.prototype.init=function(){this.group.add(this._contentGroup=new SB),this.group.add(this._selectorGroup=new SB),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get(`show`,!0)){var i=e.get(`align`),a=e.get(`orient`);(!i||i===`auto`)&&(i=e.get(`left`)===`right`&&a===`vertical`?`right`:`left`);var o=e.get(`selector`,!0),s=e.get(`selectorPosition`,!0);o&&(!s||s===`auto`)&&(s=a===`horizontal`?`end`:`start`),this.renderInner(i,e,t,n,o,a,s);var c=Lg(e,n).refContainer,l=e.getBoxLayoutParams(),u=e.get(`padding`),d=Fg(l,c,u),f=this.layoutInner(e,i,d,r,o,s),p=Fg(L({width:f.width,height:f.height},l),c,u);this.group.x=p.x-f.x,this.group.y=p.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=Pz(f,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,a,o){var s=this.getContentGroup(),c=Le(),l=t.get(`selectedMode`),u=t.get(`triggerEvent`),d=[];n.eachRawSeries(function(e){!e.get(`legendHoverLink`)&&d.push(e.id)}),xB(t.getData(),function(i,a){var o=this,f=i.get(`name`);if(!this.newlineDisabled&&(f===``||f===` `)){var p=new SB;p.newline=!0,s.add(p);return}var m=n.getSeriesByName(f)[0];if(!c.get(f)){if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,bB(EB,f,null,r,d)).on(`mouseover`,bB(DB,m.name,null,r,d)).on(`mouseout`,bB(OB,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=el(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=Kr(h.fill);_&&_[3]===0&&(_[3]=.2,h=I(I({},h),{fill:ei(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,bB(EB,null,f,r,d)).on(`mouseover`,bB(DB,null,f,r,d)).on(`mouseout`,bB(OB,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=el(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};el(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();xB(e,function(e){var r=e.type,i=new Xo({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),Xf(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),su(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=wB(c,r,o,s,d,m,u),y=new SB,b=r.getModel(`textStyle`);if(me(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(TB({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;V(w)&&w?T=w.replace(`{name}`,t??``):me(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new Xo({style:Qf(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new Go({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Mf({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),su(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();Pg(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){Pg(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(LC);function wB(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),xB(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:rT(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function TB(e){var t=e.icon||`roundRect`,n=z_(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=g_.color.neutral00,n.style.lineWidth=2),n}function EB(e,t,n,r){OB(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),DB(e,t,n,r)}function DB(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function OB(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function kB(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),AB(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){R(i,function(t,n){e[t?`select`:`unSelect`](n)}),AB(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function AB(e,t){var n=t||{};return R(e.getData(),function(t){var r=t.get(`name`);if(r!==` diff --git a/internal/observability/contracts.go b/internal/observability/contracts.go index a1d5827e3..19112a43c 100644 --- a/internal/observability/contracts.go +++ b/internal/observability/contracts.go @@ -47,6 +47,11 @@ const ( HealthHealthy Health = "healthy" HealthDegraded Health = "degraded" HealthUnhealthy Health = "unhealthy" + // HealthUnknown is what a window with no telemetry reports. Silence is not + // health: a namespace filter that matches nothing, an agent that stopped + // exporting and an interval before onboarding all land here, and calling + // any of them "healthy" states the opposite of what is known. + HealthUnknown Health = "unknown" ) type ServiceHealth struct { diff --git a/internal/observability/overview.go b/internal/observability/overview.go index 9d4150d66..8f9c96e99 100644 --- a/internal/observability/overview.go +++ b/internal/observability/overview.go @@ -54,9 +54,16 @@ func (s *Service) Overview(ctx context.Context, scope Scope, limit int) (Result[ } data.Health = overallHealth(data.Counts) + // An empty window is reported as such rather than as a clean bill of + // health, so a model reading the summary cannot conclude the system is + // fine from the absence of evidence that it is. + summary := fmt.Sprintf("%d services: %d unhealthy, %d degraded, %d healthy", data.ServiceCount, data.Counts.Unhealthy, data.Counts.Degraded, data.Counts.Healthy) + if data.ServiceCount == 0 { + summary = "no services reported telemetry in this window" + } return Result[Overview]{ Schema: OverviewSchema, - Summary: fmt.Sprintf("%d services: %d unhealthy, %d degraded, %d healthy", data.ServiceCount, data.Counts.Unhealthy, data.Counts.Degraded, data.Counts.Healthy), + Summary: summary, Data: data, Provenance: s.provenance(scope), }, nil diff --git a/internal/observability/service.go b/internal/observability/service.go index f34b533cb..f78cc5eb6 100644 --- a/internal/observability/service.go +++ b/internal/observability/service.go @@ -127,5 +127,8 @@ func overallHealth(counts HealthCounts) Health { if counts.Degraded > 0 { return HealthDegraded } + if counts.Healthy == 0 { + return HealthUnknown + } return HealthHealthy } diff --git a/internal/observability/service_test.go b/internal/observability/service_test.go index a68349795..7c98660df 100644 --- a/internal/observability/service_test.go +++ b/internal/observability/service_test.go @@ -136,6 +136,32 @@ func TestOverviewReturnsCanonicalEnvelope(t *testing.T) { } } +func TestOverviewReportsEmptyWindowAsUnknownNotHealthy(t *testing.T) { + svc, mock, _ := newMockService(t) + start := time.Date(2026, 7, 20, 11, 0, 0, 0, time.UTC) + end := start.Add(time.Hour) + mock.ExpectQuery(regexp.QuoteMeta(overviewQuery)). + WithArgs(start, end, "nonexistent", "nonexistent", 100). + WillReturnRows(sqlmock.NewRows([]string{"service", "spans", "error_rate", "p50_ms", "p95_ms", "log_count", "metric_count"})) + + result, err := svc.Overview(context.Background(), Scope{Namespace: "nonexistent", Start: start, End: end}, 0) + if err != nil { + t.Fatalf("Overview: %v", err) + } + if result.Data.Health != HealthUnknown { + t.Fatalf("health = %q, want %q: an empty window is not a clean bill of health", result.Data.Health, HealthUnknown) + } + if result.Data.ServiceCount != 0 || result.Data.Counts.Healthy != 0 { + t.Fatalf("unexpected counts: %#v", result.Data) + } + if !strings.Contains(result.Summary, "no services reported") { + t.Fatalf("summary = %q, want it to state the window is empty", result.Summary) + } + if err := mock.ExpectationsWereMet(); err != nil { + t.Fatal(err) + } +} + func TestTopologyUsesSharedNodesAndTypedEdges(t *testing.T) { svc, mock, _ := newMockService(t) start := time.Date(2026, 7, 20, 11, 0, 0, 0, time.UTC) diff --git a/internal/ui/dist/assets/chat-BWEtId3_.js b/internal/ui/dist/assets/chat-D-J8SUFh.js similarity index 99% rename from internal/ui/dist/assets/chat-BWEtId3_.js rename to internal/ui/dist/assets/chat-D-J8SUFh.js index f400ba109..8d0ad45be 100644 --- a/internal/ui/dist/assets/chat-BWEtId3_.js +++ b/internal/ui/dist/assets/chat-D-J8SUFh.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-T5JN5RKZ.js","assets/brand-CCB4_HD8.js","assets/index-DYcEv4SB.js","assets/index-DQPTd0xk.css"])))=>i.map(i=>d[i]); -import{C as e,Q as t,_ as n,a as r,c as i,d as a,f as o,gt as s,h as c,ht as l,i as u,j as d,k as f,l as p,n as m,o as h,p as g,pt as _,r as v,s as y,u as b,vt as x,x as S,xt as C,y as w}from"./brand-CCB4_HD8.js";import{n as T,t as E}from"./copy-BcWHRdqc.js";import{P as D,c as O,k,u as ee}from"./index-DYcEv4SB.js";function te(){return`development`}var A=C(l(),1),j=_(),ne=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],re={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function M(e){Object.keys(re).forEach(t=>{e.style.setProperty(t,re[t],`important`)})}function ie(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ne)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var N=null;function ae(e,t,n=1,r=1/0){N||(N=document.createElement(`textarea`),N.setAttribute(`tabindex`,`-1`),N.setAttribute(`aria-hidden`,`true`),N.setAttribute(`aria-label`,`autosize measurement`),M(N)),N.parentNode===null&&document.body.appendChild(N);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{N.style[e]=o[e]}),M(N),N.value=t;let c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i;N.value=t,c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i,N.value=`x`;let l=N.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function oe({maxRows:e,minRows:n,onChange:r,ref:i,...a}){let o=a.value!==void 0,s=(0,A.useRef)(null),c=t(s,i),l=(0,A.useRef)(0),u=(0,A.useRef)(0),d=()=>{let t=s.current;if(!t)return;let r=ie(t);if(!r)return;let[i]=ae(r,t.value||t.placeholder||`x`,n,e);l.current!==i&&(l.current=i,t.style.setProperty(`height`,`${i}px`,`important`))},f=e=>{o||d(),r?.(e)};return(0,A.useLayoutEffect)(d),(0,A.useEffect)(()=>{let e=()=>d();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,A.useEffect)(()=>{let e=s.current;if(!e||typeof ResizeObserver>`u`)return;u.current=e.offsetWidth;let t=new ResizeObserver(()=>{s.current&&s.current.offsetWidth!==u.current&&(u.current=s.current.offsetWidth,d())});return t.observe(e),()=>t.disconnect()},[]),(0,A.useEffect)(()=>{let e=()=>d();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,A.useEffect)(()=>{let e=e=>{if(s.current?.form===e.target&&!o){let e=s.current.value;requestAnimationFrame(()=>{s.current&&e!==s.current.value&&d()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[o]),(0,j.jsx)(`textarea`,{rows:n,...a,onChange:f,ref:c})}var se=e(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:a,bottomSection:o,bottomSectionProps:s,...c}=d([`Input`,`InputWrapper`,`Textarea`],null,e),l=t&&te()!==`test`,u=l?{maxRows:n,minRows:r}:{};return(0,j.jsx)(g,{component:l?oe:`textarea`,...c,__staticSelector:i||`Textarea`,__bottomSection:o,__bottomSectionProps:s,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":a},...u})});se.classes=g.classes,se.displayName=`@mantine/core/Textarea`;var ce={root:`m_d08caa0`},le=e(e=>{let t=d(`Typography`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,attributes:s,...c}=t;return(0,j.jsx)(S,{...f({name:`Typography`,classes:ce,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:s})(`root`),...c})});le.classes=ce,le.displayName=`@mantine/core/Typography`;var ue=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),de=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),fe=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:ue}));fe.displayName=`PaperPlaneTiltIcon`;var pe=fe,me=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:de}));me.displayName=`StopIcon`;var he=me;function ge(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var _e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ve=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ye={};function be(e,t){return((t||ye).jsx?ve:_e).test(e)}var xe=/[ \t\n\f\r]/g;function Se(e){return typeof e==`object`?e.type===`text`&&Ce(e.value):Ce(e)}function Ce(e){return e.replace(xe,``)===``}var we=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};we.prototype.normal={},we.prototype.property={},we.prototype.space=void 0;function Te(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new we(n,r,t)}function Ee(e){return e.toLowerCase()}var P=class{constructor(e,t){this.attribute=t,this.property=e}};P.prototype.attribute=``,P.prototype.booleanish=!1,P.prototype.boolean=!1,P.prototype.commaOrSpaceSeparated=!1,P.prototype.commaSeparated=!1,P.prototype.defined=!1,P.prototype.mustUseProperty=!1,P.prototype.number=!1,P.prototype.overloadedBoolean=!1,P.prototype.property=``,P.prototype.spaceSeparated=!1,P.prototype.space=void 0;var De=x({boolean:()=>F,booleanish:()=>I,commaOrSpaceSeparated:()=>z,commaSeparated:()=>Ae,number:()=>L,overloadedBoolean:()=>ke,spaceSeparated:()=>R}),Oe=0,F=je(),I=je(),ke=je(),L=je(),R=je(),Ae=je(),z=je();function je(){return 2**++Oe}var Me=Object.keys(De),Ne=class extends P{constructor(e,t,n,r){let i=-1;if(super(e,t),Pe(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&qe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ke,Xe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ke.test(e)){let n=e.replace(Ge,Ye);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ne}return new i(r,t)}function Ye(e){return`-`+e.toLowerCase()}function Xe(e){return e.charAt(1).toUpperCase()}var Ze=Te([Ie,ze,Ve,He,Ue],`html`),Qe=Te([Ie,Be,Ve,He,Ue],`svg`);function $e(e){return e.join(` `).trim()}var et=s(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-D0PVhqdW.js","assets/brand-CCB4_HD8.js","assets/index-BxnvJp0Y.js","assets/index-DQPTd0xk.css"])))=>i.map(i=>d[i]); +import{C as e,Q as t,_ as n,a as r,c as i,d as a,f as o,gt as s,h as c,ht as l,i as u,j as d,k as f,l as p,n as m,o as h,p as g,pt as _,r as v,s as y,u as b,vt as x,x as S,xt as C,y as w}from"./brand-CCB4_HD8.js";import{n as T,t as E}from"./copy-CUb9ms1Q.js";import{P as D,c as O,k,u as ee}from"./index-BxnvJp0Y.js";function te(){return`development`}var A=C(l(),1),j=_(),ne=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],re={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function M(e){Object.keys(re).forEach(t=>{e.style.setProperty(t,re[t],`important`)})}function ie(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ne)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var N=null;function ae(e,t,n=1,r=1/0){N||(N=document.createElement(`textarea`),N.setAttribute(`tabindex`,`-1`),N.setAttribute(`aria-hidden`,`true`),N.setAttribute(`aria-label`,`autosize measurement`),M(N)),N.parentNode===null&&document.body.appendChild(N);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{N.style[e]=o[e]}),M(N),N.value=t;let c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i;N.value=t,c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i,N.value=`x`;let l=N.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function oe({maxRows:e,minRows:n,onChange:r,ref:i,...a}){let o=a.value!==void 0,s=(0,A.useRef)(null),c=t(s,i),l=(0,A.useRef)(0),u=(0,A.useRef)(0),d=()=>{let t=s.current;if(!t)return;let r=ie(t);if(!r)return;let[i]=ae(r,t.value||t.placeholder||`x`,n,e);l.current!==i&&(l.current=i,t.style.setProperty(`height`,`${i}px`,`important`))},f=e=>{o||d(),r?.(e)};return(0,A.useLayoutEffect)(d),(0,A.useEffect)(()=>{let e=()=>d();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,A.useEffect)(()=>{let e=s.current;if(!e||typeof ResizeObserver>`u`)return;u.current=e.offsetWidth;let t=new ResizeObserver(()=>{s.current&&s.current.offsetWidth!==u.current&&(u.current=s.current.offsetWidth,d())});return t.observe(e),()=>t.disconnect()},[]),(0,A.useEffect)(()=>{let e=()=>d();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,A.useEffect)(()=>{let e=e=>{if(s.current?.form===e.target&&!o){let e=s.current.value;requestAnimationFrame(()=>{s.current&&e!==s.current.value&&d()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[o]),(0,j.jsx)(`textarea`,{rows:n,...a,onChange:f,ref:c})}var se=e(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:a,bottomSection:o,bottomSectionProps:s,...c}=d([`Input`,`InputWrapper`,`Textarea`],null,e),l=t&&te()!==`test`,u=l?{maxRows:n,minRows:r}:{};return(0,j.jsx)(g,{component:l?oe:`textarea`,...c,__staticSelector:i||`Textarea`,__bottomSection:o,__bottomSectionProps:s,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":a},...u})});se.classes=g.classes,se.displayName=`@mantine/core/Textarea`;var ce={root:`m_d08caa0`},le=e(e=>{let t=d(`Typography`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,attributes:s,...c}=t;return(0,j.jsx)(S,{...f({name:`Typography`,classes:ce,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:s})(`root`),...c})});le.classes=ce,le.displayName=`@mantine/core/Typography`;var ue=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),de=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),fe=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:ue}));fe.displayName=`PaperPlaneTiltIcon`;var pe=fe,me=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:de}));me.displayName=`StopIcon`;var he=me;function ge(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var _e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ve=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ye={};function be(e,t){return((t||ye).jsx?ve:_e).test(e)}var xe=/[ \t\n\f\r]/g;function Se(e){return typeof e==`object`?e.type===`text`&&Ce(e.value):Ce(e)}function Ce(e){return e.replace(xe,``)===``}var we=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};we.prototype.normal={},we.prototype.property={},we.prototype.space=void 0;function Te(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new we(n,r,t)}function Ee(e){return e.toLowerCase()}var P=class{constructor(e,t){this.attribute=t,this.property=e}};P.prototype.attribute=``,P.prototype.booleanish=!1,P.prototype.boolean=!1,P.prototype.commaOrSpaceSeparated=!1,P.prototype.commaSeparated=!1,P.prototype.defined=!1,P.prototype.mustUseProperty=!1,P.prototype.number=!1,P.prototype.overloadedBoolean=!1,P.prototype.property=``,P.prototype.spaceSeparated=!1,P.prototype.space=void 0;var De=x({boolean:()=>F,booleanish:()=>I,commaOrSpaceSeparated:()=>z,commaSeparated:()=>Ae,number:()=>L,overloadedBoolean:()=>ke,spaceSeparated:()=>R}),Oe=0,F=je(),I=je(),ke=je(),L=je(),R=je(),Ae=je(),z=je();function je(){return 2**++Oe}var Me=Object.keys(De),Ne=class extends P{constructor(e,t,n,r){let i=-1;if(super(e,t),Pe(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&qe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ke,Xe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ke.test(e)){let n=e.replace(Ge,Ye);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ne}return new i(r,t)}function Ye(e){return`-`+e.toLowerCase()}function Xe(e){return e.charAt(1).toUpperCase()}var Ze=Te([Ie,ze,Ve,He,Ue],`html`),Qe=Te([Ie,Be,Ve,He,Ue],`svg`);function $e(e){return e.join(` `).trim()}var et=s(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),tt=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(et());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),nt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),rt=s(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(tt()),r=nt();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),it=ot(`end`),at=ot(`start`);function ot(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function st(e){let t=at(e),n=it(e);if(t&&n)return{start:t,end:n}}function ct(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ut(e.position):`start`in e||`end`in e?ut(e):`line`in e||`column`in e?lt(e):``}function lt(e){return dt(e&&e.line)+`:`+dt(e&&e.column)}function ut(e){return lt(e&&e.start)+`-`+lt(e&&e.end)}function dt(e){return e&&typeof e==`number`?e:1}var B=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=ct(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};B.prototype.file=``,B.prototype.name=``,B.prototype.reason=``,B.prototype.message=``,B.prototype.stack=``,B.prototype.column=void 0,B.prototype.line=void 0,B.prototype.ancestors=void 0,B.prototype.cause=void 0,B.prototype.fatal=void 0,B.prototype.place=void 0,B.prototype.ruleId=void 0,B.prototype.source=void 0;var ft=C(rt(),1),pt={}.hasOwnProperty,mt=new Map,ht=/[A-Z]/g,gt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),_t=new Set([`td`,`th`]),vt=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function yt(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=At(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=kt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Qe:Ze,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=bt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function bt(e,t,n){if(t.type===`element`)return xt(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return St(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return wt(e,t,n);if(t.type===`mdxjsEsm`)return Ct(e,t);if(t.type===`root`)return Tt(e,t,n);if(t.type===`text`)return Et(e,t)}function xt(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Qe,e.schema=i),e.ancestors.push(t);let a=It(e,t.tagName,!1),o=jt(e,t),s=Nt(e,t);return gt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Se(e)})),Dt(e,o,a,t),Ot(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function St(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Lt(e,t.position)}function Ct(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lt(e,t.position)}function wt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Qe,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:It(e,t.name,!0),o=Mt(e,t),s=Nt(e,t);return Dt(e,o,a,t),Ot(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Tt(e,t,n){let r={};return Ot(r,Nt(e,t)),e.create(t,e.Fragment,r,n)}function Et(e,t){return t.value}function Dt(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ot(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function kt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function At(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=at(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function jt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&pt.call(t.properties,i)){let a=Pt(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&_t.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Mt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Lt(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Lt(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Nt(e,t){let n=[],r=-1,i=e.passKeys?new Map:mt;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(V(e,e.length,0,t),e):t}var Yt={}.hasOwnProperty;function Xt(e){let t={},n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function U(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var W=cn(/[A-Za-z]/),G=cn(/[\dA-Za-z]/),en=cn(/[#-'*+\--9=?A-Z^-~]/);function tn(e){return e!==null&&(e<32||e===127)}var nn=cn(/\d/),rn=cn(/[\dA-Fa-f]/),an=cn(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function q(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}var on=cn(/\p{P}|\p{S}/u),sn=cn(/\s/);function cn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ln(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Y(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return J(r)?(e.enter(n),s(r)):t(r)}function s(r){return J(r)&&a++o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;er;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function hn(e,t,n){return Y(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function gn(e){if(e===null||q(e)||sn(e))return 1;if(on(e))return 2}function _n(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};xn(d,-c),xn(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=H(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=H(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=H(l,_n(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=H(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=H(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,V(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n0&&J(t)?Y(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||K(t)?e.check(Pn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||K(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),J(t)?Y(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),J(t)?Y(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||K(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Ln(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Rn={name:`codeIndented`,tokenize:Bn},zn={partial:!0,tokenize:Vn};function Bn(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Y(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):K(t)?e.attempt(zn,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||K(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Vn(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Y(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):K(e)?i(e):n(e)}}var Hn={name:`codeText`,previous:Wn,resolve:Un,tokenize:Gn};function Un(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&qn(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),qn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),qn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function tr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||tn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||K(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||q(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):K(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||K(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!J(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function rr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||K(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function ir(e,t){let n;return r;function r(i){return K(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):J(i)?Y(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var ar={name:`definition`,tokenize:sr},or={partial:!0,tokenize:cr};function sr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return nr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=U(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return q(t)?ir(e,l)(t):l(t)}function l(t){return tr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(or,d,d)(t)}function d(t){return J(t)?Y(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||K(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function cr(e,t,n){return r;function r(t){return q(t)?ir(e,i)(t):n(t)}function i(t){return rr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return J(t)?Y(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||K(e)?t(e):n(e)}}var lr={name:`hardBreakEscape`,tokenize:ur};function ur(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return K(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var dr={name:`headingAtx`,resolve:fr,tokenize:pr};function fr(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},V(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function pr(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||q(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||K(n)?(e.exit(`atxHeading`),t(n)):J(n)?Y(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||q(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var mr=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),hr=[`pre`,`script`,`style`,`textarea`],gr={concrete:!0,name:`htmlFlow`,resolveTo:yr,tokenize:br},_r={partial:!0,tokenize:Sr},vr={partial:!0,tokenize:xr};function yr(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function br(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:M):W(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):W(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:M):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return W(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||q(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&hr.includes(l)?(i=1,r.interrupt?t(s):O(s)):mr.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||G(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return J(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||W(t)?(e.consume(t),b):J(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):J(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):J(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||K(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||q(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||J(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||K(t)?O(t):J(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),M):t===93&&i===5?(e.consume(t),re):K(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(_r,N,k)(t)):t===null||K(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(vr,ee,N)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||K(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),M):O(t)}function j(t){return t===47?(e.consume(t),o=``,ne):O(t)}function ne(t){if(t===62){let n=o.toLowerCase();return hr.includes(n)?(e.consume(t),ie):O(t)}return W(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function re(t){return t===93?(e.consume(t),M):O(t)}function M(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),M):O(t)}function ie(t){return t===null||K(t)?(e.exit(`htmlFlowData`),N(t)):(e.consume(t),ie)}function N(n){return e.exit(`htmlFlow`),t(n)}}function xr(e,t,n){let r=this;return i;function i(t){return K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Sr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(wn,t,n)}}var Cr={name:`htmlText`,tokenize:wr};function wr(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):W(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):W(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):K(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):K(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):K(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):K(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return W(t)?(e.consume(t),S):n(t)}function S(t){return t===45||G(t)?(e.consume(t),S):C(t)}function C(t){return K(t)?(o=C,j(t)):J(t)?(e.consume(t),C):A(t)}function w(t){return t===45||G(t)?(e.consume(t),w):t===47||t===62||q(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||W(t)?(e.consume(t),E):K(t)?(o=T,j(t)):J(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):K(t)?(o=D,j(t)):J(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):K(t)?(o=O,j(t)):J(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):K(t)?(o=k,j(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||q(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||q(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return J(t)?Y(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}var Tr={name:`labelEnd`,resolveAll:kr,resolveTo:Ar,tokenize:jr},Er={tokenize:Mr},Dr={tokenize:Nr},Or={tokenize:Pr};function kr(e){let t=-1,n=[];for(;++t=3&&(a===null||K(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),J(t)?Y(e,s,`whitespace`)(t):s(t))}}var X={continuation:{tokenize:Kr},exit:Jr,name:`list`,tokenize:Gr},Ur={partial:!0,tokenize:Yr},Wr={partial:!0,tokenize:qr};function Gr(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:nn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Vr,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return nn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(wn,r.interrupt?n:u,e.attempt(Ur,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return J(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Kr(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(wn,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Y(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!J(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Wr,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Y(e,e.attempt(X,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function qr(e,t,n){let r=this;return Y(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Jr(e){e.exit(this.containerState.type)}function Yr(e,t,n){let r=this;return Y(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!J(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Xr={name:`setextUnderline`,resolveTo:Zr,tokenize:Qr};function Zr(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Qr(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),J(t)?Y(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||K(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var $r={tokenize:ei};function ei(e){let t=this,n=e.attempt(wn,r,e.attempt(this.parser.constructs.flowInitial,i,Y(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Xn,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ti={resolveAll:ai()},ni=ii(`string`),ri=ii(`text`);function ii(e){return{resolveAll:ai(e===`text`?oi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++ihi,contentInitial:()=>li,disable:()=>gi,document:()=>ci,flow:()=>di,flowInitial:()=>ui,insideSpan:()=>mi,string:()=>fi,text:()=>pi}),ci={42:X,43:X,45:X,48:X,49:X,50:X,51:X,52:X,53:X,54:X,55:X,56:X,57:X,62:En},li={91:ar},ui={[-2]:Rn,[-1]:Rn,32:Rn},di={35:dr,42:Vr,45:[Xr,Vr],60:gr,61:Xr,95:Vr,96:Fn,126:Fn},fi={38:Mn,92:An},pi={[-5]:zr,[-4]:zr,[-3]:zr,33:Fr,38:Mn,42:vn,60:[Sn,Cr],91:Lr,92:[lr,An],93:Tr,95:vn,96:Hn},mi={null:[vn,ti]},hi={null:[42,95]},gi={null:[]};function _i(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=H(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=_n(a,l.events,l),l.events):[]}function f(e,t){return yi(p(e),t)}function p(e){return vi(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function yi(e,t){let n=-1,r=[],i;for(;++n0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ni).call(a,void 0,e[0])}for(r.position={start:Ai(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Ai(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function ic(){return`!`}ac.peek=oc;function ac(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function oc(){return`!`}sc.peek=cc;function sc(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a\u007F]/.test(e.url))}uc.peek=dc;function uc(e,t,n,r){let i=Ks(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(lc(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function dc(e,t,n){return lc(e,n)?`<`:`[`}fc.peek=pc;function fc(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function pc(){return`[`}function mc(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function hc(e){let t=mc(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gc(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function _c(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vc(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?gc(n):mc(n),s=e.ordered?o===`.`?`)`:`.`:hc(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),_c(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function xc(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Sc=Aa([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Cc(e,t,n,r){return(e.children.some(function(e){return Sc(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wc(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Tc.peek=Ec;function Tc(e,t,n,r){let i=wc(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Xs(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Ys(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Xs(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Ys(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ec(e,t,n){return n.options.strong||`*`}function Dc(e,t,n,r){return n.safe(e.value,r)}function Oc(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function kc(e,t,n){let r=(_c(n)+(n.options.ruleSpaces?` `:``)).repeat(Oc(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Ac={blockquote:Is,break:Bs,code:Ws,definition:qs,emphasis:Zs,hardBreak:Bs,heading:ec,html:tc,image:rc,imageReference:ac,inlineCode:sc,link:uc,linkReference:fc,list:vc,listItem:bc,paragraph:xc,root:Cc,strong:Tc,text:Dc,thematicBreak:kc};function jc(){return{enter:{table:Mc,tableData:Ic,tableHeader:Ic,tableRow:Pc},exit:{codeText:Lc,table:Nc,tableData:Fc,tableHeader:Fc,tableRow:Fc}}}function Mc(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Nc(e){this.exit(e),this.data.inTable=void 0}function Pc(e){this.enter({type:`tableRow`,children:[]},e)}function Fc(e){this.exit(e)}function Ic(e){this.enter({type:`tableCell`,children:[]},e)}function Lc(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Rc));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Rc(e,t){return t===`|`?t:e}function zc(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:` `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` -`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Ns(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var hl={tokenize:Cl,partial:!0};function gl(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:bl,continuation:{tokenize:xl},exit:Sl}},text:{91:{name:`gfmFootnoteCall`,tokenize:yl},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_l,resolveTo:vl}}}}function _l(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=U(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function vl(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function yl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||q(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(U(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return q(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function bl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||q(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=U(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return q(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xl(e,t,n){return e.check(wn,t,e.attempt(hl,t,n))}function Sl(e){e.exit(`gfmFootnoteDefinition`)}function Cl(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function wl(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=gn(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Tl=class{constructor(){this.map=[]}add(e,t,n){El(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function El(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||q(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||q(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Al(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Tl;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Nl(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ml(e,t,n,r,i){let a=[],o=Nl(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Nl(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Pl={name:`tasklistCheck`,tokenize:Il};function Fl(){return{text:{91:Pl}}}function Il(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return q(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):J(r)?e.check({tokenize:Ll},t,n)(r):n(r)}}function Ll(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Rl(e){return Xt([el(),gl(),wl(e),Ol(),Fl()])}var zl={};function Bl(e){let t=this,n=e||zl,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Rl(n)),a.push(Gc()),o.push(Kc(n))}var Vl=(0,A.lazy)(()=>O(()=>import(`./mcp-app-frame-T5JN5RKZ.js`),__vite__mapDeps([0,1,2,3]))),Hl=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Ul(e){return{observability_overview:`System health`,service_topology:`Service map`,service_performance:`Performance`,trace_detail:`Trace analysis`,search_logs:`Logs`}[e]??`System analysis`}function Wl(){let{agentAvailable:e,messages:t,messageTimes:r,ready:s,running:l,activity:u,error:d,threadMissing:f,bottomRef:m,send:g,retry:_,reloadThread:v,newThread:x}=ee();if(!e)return(0,j.jsx)(i,{size:`sm`,py:96,children:(0,j.jsx)(w,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,j.jsxs)(y,{gap:`md`,children:[(0,j.jsx)(a,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,j.jsx)(h,{order:1,fz:28,children:`Chat is not configured`}),(0,j.jsx)(a,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,j.jsx)(b,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let C=t.filter(e=>e.role!==`tool`);return(0,j.jsxs)(S,{className:`chat-pane`,children:[(0,j.jsx)(S,{className:`chat-scroll`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,children:[f&&(0,j.jsx)(o,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,j.jsxs)(c,{justify:`space-between`,children:[(0,j.jsx)(a,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,onClick:x,children:`New chat`})]})}),!f&&!s&&d&&(0,j.jsx)(Gl,{message:d,onRetry:v,onNewThread:x}),!f&&!s&&!d&&(0,j.jsxs)(p,{mih:`40vh`,children:[(0,j.jsx)(n,{size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!f&&s&&(0,j.jsxs)(j.Fragment,{children:[C.length===0&&(0,j.jsx)(ql,{onSelect:g}),(0,j.jsxs)(y,{gap:`lg`,"aria-live":`polite`,children:[C.map(e=>(0,j.jsx)(Jl,{message:e,time:r[e.id],send:g},e.id)),l&&(0,j.jsxs)(c,{gap:`xs`,children:[(0,j.jsx)(n,{type:`dots`,size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,children:u||`Analyzing your system`})]}),d&&(0,j.jsx)(Gl,{message:d,onRetry:_}),(0,j.jsx)(`div`,{ref:m})]})]})]})}),!f&&(0,j.jsx)(Kl,{})]})}function Gl({message:e,onRetry:t,onNewThread:n}){return(0,j.jsx)(o,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,j.jsxs)(c,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,j.jsx)(a,{size:`sm`,children:e}),(0,j.jsxs)(c,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,j.jsx)(b,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Kl(){let{input:e,setInput:t,inputRef:n,submit:r,send:o,stop:s,ready:l,running:u}=ee();return(0,j.jsx)(S,{className:`chat-composer`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},children:[(0,j.jsx)(w,{component:`form`,onSubmit:r,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,j.jsxs)(c,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,j.jsx)(se,{ref:n,"aria-label":`Message Fanout`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),o(e))},placeholder:u?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!l,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),u?(0,j.jsx)(k,{label:`Stop`,children:(0,j.jsx)(D,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,j.jsx)(he,{size:16,weight:`fill`})})}):(0,j.jsx)(D,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!l,"aria-label":`Send message`,children:(0,j.jsx)(pe,{size:17,weight:`fill`})})]})}),(0,j.jsx)(a,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function ql({onSelect:e}){return(0,j.jsxs)(y,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,j.jsx)(m,{size:`large`}),(0,j.jsx)(h,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,j.jsx)(c,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:Hl.map(t=>(0,j.jsx)(b,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Jl({message:e,time:t,send:r}){if(e.role===`activity`){let t=e;return t.activityType===`mcp-app`?(0,j.jsx)(w,{withBorder:!0,radius:`lg`,style:{overflow:`hidden`},"aria-label":Ul(t.content.toolName),children:(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(p,{mih:180,children:(0,j.jsx)(n,{size:`sm`})}),children:(0,j.jsx)(Vl,{content:t.content,onMessage:r})})}):null}let i=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!i&&e.role===`assistant`)return null;let o=e.role===`user`,s=t?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(t)):``;return(0,j.jsxs)(S,{className:`chat-message`,"data-role":o?`user`:`assistant`,children:[o?(0,j.jsx)(w,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,j.jsx)(a,{style:{whiteSpace:`pre-wrap`},children:i})}):(0,j.jsx)(le,{className:`chat-markdown`,children:(0,j.jsx)(Ro,{remarkPlugins:[Bl],components:Xl,children:i})}),(0,j.jsxs)(c,{className:`chat-message-meta`,gap:6,justify:o?`flex-end`:`flex-start`,mt:4,children:[s&&(0,j.jsx)(a,{c:`dimmed`,size:`xs`,children:s}),!o&&(0,j.jsx)(Yl,{text:i,label:`Copy message`})]})]})}function Yl({text:e,label:t}){let{state:n,copy:r}=E();return(0,j.jsx)(k,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,j.jsx)(D,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,j.jsx)(u,{size:13,weight:`bold`}):(0,j.jsx)(v,{size:13})})})}var Xl={table:({children:e})=>(0,j.jsx)(S,{className:`chat-table`,children:(0,j.jsx)(T,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,j.jsx)(T.Thead,{children:e}),tbody:({children:e})=>(0,j.jsx)(T.Tbody,{children:e}),tr:({children:e})=>(0,j.jsx)(T.Tr,{children:e}),th:({children:e})=>(0,j.jsx)(T.Th,{children:e}),td:({children:e})=>(0,j.jsx)(T.Td,{children:e}),pre:({children:e})=>(0,j.jsx)(Zl,{children:e}),a:({href:e,children:t})=>(0,j.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Zl({children:e}){let t=Ql(e);return(0,j.jsxs)(S,{className:`chat-code`,pos:`relative`,children:[(0,j.jsx)(S,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,j.jsx)(Yl,{text:t,label:`Copy code`})}),(0,j.jsx)(`pre`,{children:e})]})}function Ql(e){return typeof e==`string`?e:Array.isArray(e)?e.map(Ql).join(``):e&&typeof e==`object`&&`props`in e?Ql(e.props.children):``}export{Wl as t}; \ No newline at end of file +`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Ns(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var hl={tokenize:Cl,partial:!0};function gl(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:bl,continuation:{tokenize:xl},exit:Sl}},text:{91:{name:`gfmFootnoteCall`,tokenize:yl},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_l,resolveTo:vl}}}}function _l(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=U(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function vl(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function yl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||q(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(U(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return q(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function bl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||q(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=U(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return q(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xl(e,t,n){return e.check(wn,t,e.attempt(hl,t,n))}function Sl(e){e.exit(`gfmFootnoteDefinition`)}function Cl(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function wl(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=gn(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Tl=class{constructor(){this.map=[]}add(e,t,n){El(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function El(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||q(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||q(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Al(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Tl;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Nl(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ml(e,t,n,r,i){let a=[],o=Nl(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Nl(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Pl={name:`tasklistCheck`,tokenize:Il};function Fl(){return{text:{91:Pl}}}function Il(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return q(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):J(r)?e.check({tokenize:Ll},t,n)(r):n(r)}}function Ll(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Rl(e){return Xt([el(),gl(),wl(e),Ol(),Fl()])}var zl={};function Bl(e){let t=this,n=e||zl,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Rl(n)),a.push(Gc()),o.push(Kc(n))}var Vl=(0,A.lazy)(()=>O(()=>import(`./mcp-app-frame-D0PVhqdW.js`),__vite__mapDeps([0,1,2,3]))),Hl=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Ul(e){return{observability_overview:`System health`,service_topology:`Service map`,service_performance:`Performance`,trace_detail:`Trace analysis`,search_logs:`Logs`}[e]??`System analysis`}function Wl(){let{agentAvailable:e,messages:t,messageTimes:r,ready:s,running:l,activity:u,error:d,threadMissing:f,bottomRef:m,send:g,retry:_,reloadThread:v,newThread:x}=ee();if(!e)return(0,j.jsx)(i,{size:`sm`,py:96,children:(0,j.jsx)(w,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,j.jsxs)(y,{gap:`md`,children:[(0,j.jsx)(a,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,j.jsx)(h,{order:1,fz:28,children:`Chat is not configured`}),(0,j.jsx)(a,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,j.jsx)(b,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let C=t.filter(e=>e.role!==`tool`);return(0,j.jsxs)(S,{className:`chat-pane`,children:[(0,j.jsx)(S,{className:`chat-scroll`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,children:[f&&(0,j.jsx)(o,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,j.jsxs)(c,{justify:`space-between`,children:[(0,j.jsx)(a,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,onClick:x,children:`New chat`})]})}),!f&&!s&&d&&(0,j.jsx)(Gl,{message:d,onRetry:v,onNewThread:x}),!f&&!s&&!d&&(0,j.jsxs)(p,{mih:`40vh`,children:[(0,j.jsx)(n,{size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!f&&s&&(0,j.jsxs)(j.Fragment,{children:[C.length===0&&(0,j.jsx)(ql,{onSelect:g}),(0,j.jsxs)(y,{gap:`lg`,"aria-live":`polite`,children:[C.map(e=>(0,j.jsx)(Jl,{message:e,time:r[e.id],send:g},e.id)),l&&(0,j.jsxs)(c,{gap:`xs`,children:[(0,j.jsx)(n,{type:`dots`,size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,children:u||`Analyzing your system`})]}),d&&(0,j.jsx)(Gl,{message:d,onRetry:_}),(0,j.jsx)(`div`,{ref:m})]})]})]})}),!f&&(0,j.jsx)(Kl,{})]})}function Gl({message:e,onRetry:t,onNewThread:n}){return(0,j.jsx)(o,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,j.jsxs)(c,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,j.jsx)(a,{size:`sm`,children:e}),(0,j.jsxs)(c,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,j.jsx)(b,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Kl(){let{input:e,setInput:t,inputRef:n,submit:r,send:o,stop:s,ready:l,running:u}=ee();return(0,j.jsx)(S,{className:`chat-composer`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},children:[(0,j.jsx)(w,{component:`form`,onSubmit:r,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,j.jsxs)(c,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,j.jsx)(se,{ref:n,"aria-label":`Message Fanout`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),o(e))},placeholder:u?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!l,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),u?(0,j.jsx)(k,{label:`Stop`,children:(0,j.jsx)(D,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,j.jsx)(he,{size:16,weight:`fill`})})}):(0,j.jsx)(D,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!l,"aria-label":`Send message`,children:(0,j.jsx)(pe,{size:17,weight:`fill`})})]})}),(0,j.jsx)(a,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function ql({onSelect:e}){return(0,j.jsxs)(y,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,j.jsx)(m,{size:`large`}),(0,j.jsx)(h,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,j.jsx)(c,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:Hl.map(t=>(0,j.jsx)(b,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Jl({message:e,time:t,send:r}){if(e.role===`activity`){let t=e;return t.activityType===`mcp-app`?(0,j.jsx)(w,{withBorder:!0,radius:`lg`,style:{overflow:`hidden`},"aria-label":Ul(t.content.toolName),children:(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(p,{mih:180,children:(0,j.jsx)(n,{size:`sm`})}),children:(0,j.jsx)(Vl,{content:t.content,onMessage:r})})}):null}let i=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!i&&e.role===`assistant`)return null;let o=e.role===`user`,s=t?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(t)):``;return(0,j.jsxs)(S,{className:`chat-message`,"data-role":o?`user`:`assistant`,children:[o?(0,j.jsx)(w,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,j.jsx)(a,{style:{whiteSpace:`pre-wrap`},children:i})}):(0,j.jsx)(le,{className:`chat-markdown`,children:(0,j.jsx)(Ro,{remarkPlugins:[Bl],components:Xl,children:i})}),(0,j.jsxs)(c,{className:`chat-message-meta`,gap:6,justify:o?`flex-end`:`flex-start`,mt:4,children:[s&&(0,j.jsx)(a,{c:`dimmed`,size:`xs`,children:s}),!o&&(0,j.jsx)(Yl,{text:i,label:`Copy message`})]})]})}function Yl({text:e,label:t}){let{state:n,copy:r}=E();return(0,j.jsx)(k,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,j.jsx)(D,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,j.jsx)(u,{size:13,weight:`bold`}):(0,j.jsx)(v,{size:13})})})}var Xl={table:({children:e})=>(0,j.jsx)(S,{className:`chat-table`,children:(0,j.jsx)(T,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,j.jsx)(T.Thead,{children:e}),tbody:({children:e})=>(0,j.jsx)(T.Tbody,{children:e}),tr:({children:e})=>(0,j.jsx)(T.Tr,{children:e}),th:({children:e})=>(0,j.jsx)(T.Th,{children:e}),td:({children:e})=>(0,j.jsx)(T.Td,{children:e}),pre:({children:e})=>(0,j.jsx)(Zl,{children:e}),a:({href:e,children:t})=>(0,j.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Zl({children:e}){let t=Ql(e);return(0,j.jsxs)(S,{className:`chat-code`,pos:`relative`,children:[(0,j.jsx)(S,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,j.jsx)(Yl,{text:t,label:`Copy code`})}),(0,j.jsx)(`pre`,{children:e})]})}function Ql(e){return typeof e==`string`?e:Array.isArray(e)?e.map(Ql).join(``):e&&typeof e==`object`&&`props`in e?Ql(e.props.children):``}export{Wl as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-DC_eOz23.js b/internal/ui/dist/assets/chat._threadId-DC_eOz23.js deleted file mode 100644 index dfa35d99a..000000000 --- a/internal/ui/dist/assets/chat._threadId-DC_eOz23.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-BWEtId3_.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-DSIYq_x1.js b/internal/ui/dist/assets/chat._threadId-DSIYq_x1.js new file mode 100644 index 000000000..849dadfd0 --- /dev/null +++ b/internal/ui/dist/assets/chat._threadId-DSIYq_x1.js @@ -0,0 +1 @@ +import{t as e}from"./chat-D-J8SUFh.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-DC_eOz23.js b/internal/ui/dist/assets/chat.index-DC_eOz23.js deleted file mode 100644 index dfa35d99a..000000000 --- a/internal/ui/dist/assets/chat.index-DC_eOz23.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-BWEtId3_.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-DSIYq_x1.js b/internal/ui/dist/assets/chat.index-DSIYq_x1.js new file mode 100644 index 000000000..849dadfd0 --- /dev/null +++ b/internal/ui/dist/assets/chat.index-DSIYq_x1.js @@ -0,0 +1 @@ +import{t as e}from"./chat-D-J8SUFh.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/copy-BcWHRdqc.js b/internal/ui/dist/assets/copy-CUb9ms1Q.js similarity index 98% rename from internal/ui/dist/assets/copy-BcWHRdqc.js rename to internal/ui/dist/assets/copy-CUb9ms1Q.js index d6d88ef1f..3a59c0011 100644 --- a/internal/ui/dist/assets/copy-BcWHRdqc.js +++ b/internal/ui/dist/assets/copy-CUb9ms1Q.js @@ -1 +1 @@ -import{C as e,G as t,Y as n,ht as r,j as i,k as a,pt as o,st as s,ut as c,x as l,xt as u}from"./brand-CCB4_HD8.js";import{I as d,U as f}from"./index-DYcEv4SB.js";var[p,m]=f(`Table component was not found in the tree`),h={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`},g=o();function _(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function v(t,n){let r=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,a=e(e=>{let a=i(r,{},e),{classNames:o,className:s,style:c,styles:u,...d}=a,f=m();return(0,g.jsx)(l,{component:t,..._(f,n),...f.getStyles(t,{className:s,classNames:o,style:c,styles:u,props:a}),...d})});return a.displayName=`@mantine/core/${r}`,a.classes=h,a}var y=v(`th`,{columnBorder:!0}),b=v(`td`,{columnBorder:!0}),x=v(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),S=v(`thead`,{stickyHeader:!0}),C=v(`tbody`),w=v(`tfoot`),T=v(`caption`,{captionSide:!0}),E={type:`scrollarea`},D=n((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":c(t),"--table-max-height":c(n),"--table-overflow":r===`native`?`auto`:void 0}})),O=e(e=>{let t=i(`TableScrollContainer`,E,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,children:f,minWidth:p,maxHeight:m,type:_,scrollAreaProps:v,attributes:y,...b}=t,x=a({name:`TableScrollContainer`,classes:h,props:t,className:r,style:o,classNames:n,styles:s,unstyled:c,attributes:y,vars:u,varsResolver:D,rootSelector:`scrollContainer`});return(0,g.jsx)(l,{component:_===`scrollarea`?d:`div`,..._===`scrollarea`?m?{offsetScrollbars:`xy`,...v}:{offsetScrollbars:`x`,...v}:{},...x(`scrollContainer`),...b,children:(0,g.jsx)(`div`,{...x(`scrollContainerInner`),children:f})})});O.classes=h,O.varsResolver=D,O.displayName=`@mantine/core/TableScrollContainer`;function k({data:e}){return(0,g.jsxs)(g.Fragment,{children:[e.caption&&(0,g.jsx)(T,{children:e.caption}),e.head&&(0,g.jsx)(S,{children:(0,g.jsx)(x,{children:e.head.map((e,t)=>(0,g.jsx)(y,{children:e},t))})}),e.body&&(0,g.jsx)(C,{children:e.body.map((e,t)=>(0,g.jsx)(x,{children:e.map((e,t)=>(0,g.jsx)(b,{children:e},t))},t))}),e.foot&&(0,g.jsx)(w,{children:(0,g.jsx)(x,{children:e.foot.map((e,t)=>(0,g.jsx)(y,{children:e},t))})})]})}k.displayName=`@mantine/core/TableDataRenderer`;var A={withRowBorders:!0,verticalSpacing:7},j=n((e,{layout:n,captionSide:r,horizontalSpacing:i,verticalSpacing:a,borderColor:o,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:f,stickyHeaderOffset:p,stickyHeader:m})=>({table:{"--table-layout":n,"--table-caption-side":r,"--table-horizontal-spacing":s(i),"--table-vertical-spacing":s(a),"--table-border-color":o?t(o,e):void 0,"--table-striped-color":d&&l?t(l,e):void 0,"--table-highlight-on-hover-color":f&&u?t(u,e):void 0,"--table-sticky-header-offset":m?c(p):void 0}})),M=e(e=>{let t=i(`Table`,A,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,horizontalSpacing:d,verticalSpacing:f,captionSide:m,stripedColor:_,highlightOnHoverColor:v,striped:y,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,withTableBorder:C,borderColor:w,layout:T,data:E,children:D,stickyHeader:O,stickyHeaderOffset:M,mod:N,tabularNums:P,attributes:F,...I}=t,L=a({name:`Table`,props:t,className:r,style:o,classes:h,classNames:n,styles:s,unstyled:c,attributes:F,rootSelector:`table`,vars:u,varsResolver:j});return(0,g.jsx)(p,{value:{getStyles:L,stickyHeader:O,striped:y===!0?`odd`:y||void 0,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,captionSide:m||`bottom`},children:(0,g.jsx)(l,{component:`table`,mod:[{"data-with-table-border":C,"data-tabular-nums":P},N],...L(`table`),...I,children:D||!!E&&(0,g.jsx)(k,{data:E})})})});M.classes=h,M.varsResolver=j,M.displayName=`@mantine/core/Table`,M.Td=b,M.Th=y,M.Tr=x,M.Thead=S,M.Tbody=C,M.Tfoot=w,M.Caption=T,M.ScrollContainer=O,M.DataRenderer=k;var N=u(r(),1);function P(e=1500){let[t,n]=(0,N.useState)(`idle`),r=(0,N.useRef)(null);(0,N.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}export{M as n,P as t}; \ No newline at end of file +import{C as e,G as t,Y as n,ht as r,j as i,k as a,pt as o,st as s,ut as c,x as l,xt as u}from"./brand-CCB4_HD8.js";import{I as d,U as f}from"./index-BxnvJp0Y.js";var[p,m]=f(`Table component was not found in the tree`),h={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`},g=o();function _(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function v(t,n){let r=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,a=e(e=>{let a=i(r,{},e),{classNames:o,className:s,style:c,styles:u,...d}=a,f=m();return(0,g.jsx)(l,{component:t,..._(f,n),...f.getStyles(t,{className:s,classNames:o,style:c,styles:u,props:a}),...d})});return a.displayName=`@mantine/core/${r}`,a.classes=h,a}var y=v(`th`,{columnBorder:!0}),b=v(`td`,{columnBorder:!0}),x=v(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),S=v(`thead`,{stickyHeader:!0}),C=v(`tbody`),w=v(`tfoot`),T=v(`caption`,{captionSide:!0}),E={type:`scrollarea`},D=n((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":c(t),"--table-max-height":c(n),"--table-overflow":r===`native`?`auto`:void 0}})),O=e(e=>{let t=i(`TableScrollContainer`,E,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,children:f,minWidth:p,maxHeight:m,type:_,scrollAreaProps:v,attributes:y,...b}=t,x=a({name:`TableScrollContainer`,classes:h,props:t,className:r,style:o,classNames:n,styles:s,unstyled:c,attributes:y,vars:u,varsResolver:D,rootSelector:`scrollContainer`});return(0,g.jsx)(l,{component:_===`scrollarea`?d:`div`,..._===`scrollarea`?m?{offsetScrollbars:`xy`,...v}:{offsetScrollbars:`x`,...v}:{},...x(`scrollContainer`),...b,children:(0,g.jsx)(`div`,{...x(`scrollContainerInner`),children:f})})});O.classes=h,O.varsResolver=D,O.displayName=`@mantine/core/TableScrollContainer`;function k({data:e}){return(0,g.jsxs)(g.Fragment,{children:[e.caption&&(0,g.jsx)(T,{children:e.caption}),e.head&&(0,g.jsx)(S,{children:(0,g.jsx)(x,{children:e.head.map((e,t)=>(0,g.jsx)(y,{children:e},t))})}),e.body&&(0,g.jsx)(C,{children:e.body.map((e,t)=>(0,g.jsx)(x,{children:e.map((e,t)=>(0,g.jsx)(b,{children:e},t))},t))}),e.foot&&(0,g.jsx)(w,{children:(0,g.jsx)(x,{children:e.foot.map((e,t)=>(0,g.jsx)(y,{children:e},t))})})]})}k.displayName=`@mantine/core/TableDataRenderer`;var A={withRowBorders:!0,verticalSpacing:7},j=n((e,{layout:n,captionSide:r,horizontalSpacing:i,verticalSpacing:a,borderColor:o,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:f,stickyHeaderOffset:p,stickyHeader:m})=>({table:{"--table-layout":n,"--table-caption-side":r,"--table-horizontal-spacing":s(i),"--table-vertical-spacing":s(a),"--table-border-color":o?t(o,e):void 0,"--table-striped-color":d&&l?t(l,e):void 0,"--table-highlight-on-hover-color":f&&u?t(u,e):void 0,"--table-sticky-header-offset":m?c(p):void 0}})),M=e(e=>{let t=i(`Table`,A,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,horizontalSpacing:d,verticalSpacing:f,captionSide:m,stripedColor:_,highlightOnHoverColor:v,striped:y,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,withTableBorder:C,borderColor:w,layout:T,data:E,children:D,stickyHeader:O,stickyHeaderOffset:M,mod:N,tabularNums:P,attributes:F,...I}=t,L=a({name:`Table`,props:t,className:r,style:o,classes:h,classNames:n,styles:s,unstyled:c,attributes:F,rootSelector:`table`,vars:u,varsResolver:j});return(0,g.jsx)(p,{value:{getStyles:L,stickyHeader:O,striped:y===!0?`odd`:y||void 0,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,captionSide:m||`bottom`},children:(0,g.jsx)(l,{component:`table`,mod:[{"data-with-table-border":C,"data-tabular-nums":P},N],...L(`table`),...I,children:D||!!E&&(0,g.jsx)(k,{data:E})})})});M.classes=h,M.varsResolver=j,M.displayName=`@mantine/core/Table`,M.Td=b,M.Th=y,M.Tr=x,M.Thead=S,M.Tbody=C,M.Tfoot=w,M.Caption=T,M.ScrollContainer=O,M.DataRenderer=k;var N=u(r(),1);function P(e=1500){let[t,n]=(0,N.useState)(`idle`),r=(0,N.useRef)(null);(0,N.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}export{M as n,P as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboard-DFF2_SFC.js b/internal/ui/dist/assets/dashboard-Dl2pFM2h.js similarity index 97% rename from internal/ui/dist/assets/dashboard-DFF2_SFC.js rename to internal/ui/dist/assets/dashboard-Dl2pFM2h.js index 5aad07693..5c0453273 100644 --- a/internal/ui/dist/assets/dashboard-DFF2_SFC.js +++ b/internal/ui/dist/assets/dashboard-Dl2pFM2h.js @@ -1,4 +1,4 @@ -import{$ as e,A as t,C as n,D as r,E as i,G as a,J as o,N as s,O as c,Q as l,R as u,S as d,T as f,Y as p,_ as m,a as h,ct as g,d as _,f as v,ft as y,gt as b,h as x,ht as S,i as C,it as w,j as T,k as E,l as D,m as O,mt as k,o as A,ot as j,p as ee,pt as M,r as te,rt as ne,s as N,st as P,u as re,ut as ie,vt as ae,w as oe,x as se,xt as ce,y as le}from"./brand-CCB4_HD8.js";import{n as F,t as I}from"./copy-BcWHRdqc.js";import{A as L,B as ue,C as de,D as fe,E as pe,F as me,G as he,H as ge,I as _e,L as ve,M as ye,N as be,O as xe,P as Se,R as Ce,S as we,T as Te,U as Ee,V as De,W as Oe,_ as ke,a as Ae,b as je,d as Me,f as Ne,g as Pe,h as Fe,i as Ie,j as Le,k as Re,l as ze,m as Be,n as Ve,o as He,r as Ue,t as We,v as Ge,w as Ke,x as qe,y as Je,z as Ye}from"./index-DYcEv4SB.js";var R=ce(S(),1),z=M();function Xe(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Ze(e){let t=(0,R.useRef)(void 0);return(0,R.useEffect)(()=>{t.current=e},[e]),t.current}function Qe(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{let t=T(`Flex`,null,e),{classNames:n,className:a,style:o,styles:l,unstyled:d,vars:p,gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x,attributes:S,...C}=t,w=E({name:`Flex`,classes:rt,props:t,className:a,style:o,classNames:n,styles:l,unstyled:d,attributes:S,vars:p}),D=s(),O=f(),k=i({styleProps:{gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x},theme:D,data:nt}),A=u(),j=A&&k.hasResponsiveStyles?r(k.styles,k.media):O;return(0,z.jsxs)(z.Fragment,{children:[k.hasResponsiveStyles&&(0,z.jsx)(c,{selector:`.${j}`,styles:k.styles,media:k.media,deduplicate:A}),(0,z.jsx)(se,{...w(`root`,{className:j,style:g(k.inlineStyles)}),...C})]})});it.classes=rt,it.displayName=`@mantine/core/Flex`;function at(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>at(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function ot(e){return e?e.map(e=>at(e)):[]}function st(e){return e.reduce((e,t)=>`group`in t?{...e,...st(t.items)}:(e[`${t.value}`]=t,e),{})}var ct={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},lt={error:null},ut=p((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":j(t,`combobox-chevron-size`),"--combobox-chevron-color":n?a(n,e):void 0}})),dt=n(e=>{let t=T(`ComboboxChevron`,lt,e),{size:n,error:r,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,attributes:u,mod:d,...f}=t,p=E({name:`ComboboxChevron`,classes:ct,props:t,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,varsResolver:ut,attributes:u,rootSelector:`chevron`});return(0,z.jsx)(se,{component:`svg`,...f,...p(`chevron`),size:n,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:r},d],children:(0,z.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});dt.classes=ct,dt.varsResolver=ut,dt.displayName=`@mantine/core/ComboboxChevron`;var[ft,pt]=Ee(`Combobox component was not found in tree`);function mt({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,z.jsx)(O.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}mt.displayName=`@mantine/core/ComboboxClearButton`;var ht=n(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=T(`ComboboxDropdown`,null,e),s=pt();return(0,z.jsx)(me.Dropdown,{...o,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":s.floatingHeight||void 0,...s.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});ht.classes=ct,ht.displayName=`@mantine/core/ComboboxDropdown`;var gt={refProp:`ref`},_t=n(e=>{let{children:t,refProp:n,ref:r}=T(`ComboboxDropdownTarget`,gt,e);if(pt(),!Oe(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,z.jsx)(me.Target,{ref:r,refProp:n,children:t})});_t.displayName=`@mantine/core/ComboboxDropdownTarget`;var vt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxEmpty`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...o})});vt.classes=ct,vt.displayName=`@mantine/core/ComboboxEmpty`;function yt({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=pt(),[c,l]=(0,R.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var bt={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},xt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxEventsTarget`,bt,e),d=Ye(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=pt();return(0,R.cloneElement)(d,{...yt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u,[n]:l(c,f.store.targetRef,ue(d))})});xt.displayName=`@mantine/core/ComboboxEventsTarget`;var St=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxFooter`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});St.classes=ct,St.displayName=`@mantine/core/ComboboxFooter`;var Ct=n(t=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,label:c,id:l,...u}=T(`ComboboxGroup`,null,t),d=pt(),f=e(l),p=c!=null&&c!==!1&&c!==``;return(0,z.jsxs)(se,{role:`group`,"aria-labelledby":p?f:void 0,...d.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...u,children:[p&&(0,z.jsx)(`div`,{id:f,...d.getStyles(`groupLabel`,{classNames:n,styles:a}),children:c}),s]})});Ct.classes=ct,Ct.displayName=`@mantine/core/ComboboxGroup`;var wt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxHeader`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});wt.classes=ct,wt.displayName=`@mantine/core/ComboboxHeader`;function Tt({value:e,valuesDivider:t=`,`,...n}){return(0,z.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Tt.displayName=`@mantine/core/ComboboxHiddenInput`;var Et=n(e=>{let t=T(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:o,onClick:s,id:c,active:l,onMouseDown:u,onMouseOver:d,disabled:f,selected:p,mod:m,...h}=t,g=pt(),_=(0,R.useId)(),v=c||_;return(0,z.jsx)(se,{...g.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),...h,id:v,mod:[`combobox-option`,{"combobox-active":l,"combobox-disabled":f,"combobox-selected":p},m],role:`option`,onClick:e=>{f?e.preventDefault():(g.onOptionSubmit?.(t.value,t),s?.(e))},onMouseDown:e=>{e.preventDefault(),u?.(e)},onMouseOver:e=>{g.resetSelectionOnOptionHover&&g.store.resetSelectedOption(),d?.(e)}})});Et.classes=ct,Et.displayName=`@mantine/core/ComboboxOption`;var Dt=n(t=>{let{classNames:n,className:r,style:i,styles:a,id:o,onMouseDown:s,labelledBy:c,...l}=T(`ComboboxOptions`,null,t),u=pt(),d=e(o);return(0,R.useEffect)(()=>{u.store.setListId(d)},[d]),(0,z.jsx)(se,{...u.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...l,id:d,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});Dt.classes=ct,Dt.displayName=`@mantine/core/ComboboxOptions`;var Ot={withAriaAttributes:!0,withKeyboardNavigation:!0},kt=n(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:o,onClick:s,withKeyboardNavigation:c,size:u,ref:d,...f}=T(`ComboboxSearch`,Ot,e),p=pt(),m=p.getStyles(`search`),h=yt({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:s,autoComplete:`off`});return(0,z.jsx)(O,{ref:l(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});kt.classes=ct,kt.displayName=`@mantine/core/ComboboxSearch`;var At={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},jt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxTarget`,At,e),d=Ye(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=pt(),p=(0,R.cloneElement)(d,{...yt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u});return(0,z.jsx)(me.Target,{refProp:n,ref:l(c,f.store.targetRef),children:p})});jt.displayName=`@mantine/core/ComboboxTarget`;function Mt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Nt(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,R.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,R.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,R.useCallback)(()=>{let e=et(f.current),t=Qe(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,R.useCallback)(e=>{let t=et(f.current),n=Qe(`#${l.current}`,t),r=n?$e(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,R.useCallback)(()=>{let e=et(f.current),t=Qe(`#${l.current} [data-combobox-active]`,e);if(t){let n=$e(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Nt(u.current,t,a))},[b,a]),C=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Mt(u.current,t,a))},[b,a]),w=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Pt(t))},[b]),T=(0,R.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=et(f.current),r=$e(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=et(f.current),r=$e(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,R.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,R.useCallback)(()=>{let e=et(f.current);($e(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,R.useCallback)(e=>{l.current=e},[]),k=(0,R.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,R.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,R.useCallback)(()=>u.current,[]);return(0,R.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var It={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Lt=p((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":ne(t),"--combobox-option-padding":j(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:ie(n),"--combobox-option-fz":ne(t),"--combobox-option-padding":j(t,`combobox-option-padding`)}})),Rt=e=>{let t=T(`Combobox`,It,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:l,size:u,dropdownPadding:d,resetSelectionOnOptionHover:f,__staticSelector:p,readOnly:m,attributes:h,floatingHeight:g,middlewares:_,...v}=t,y=g===`viewport`?{..._,flip:!1,size:{...typeof _?.size==`object`?_.size:{},padding:typeof _?.size==`object`&&_.size.padding!==void 0?_.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=_?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:_,b=Ft(),x=o||b,S=E({name:p||`Combobox`,classes:ct,props:t,classNames:n,styles:r,unstyled:i,attributes:h,vars:s,varsResolver:Lt}),C=()=>{l?.(),x.closeDropdown()};return(0,z.jsx)(ft,{value:{getStyles:S,store:x,onOptionSubmit:c,size:u,resetSelectionOnOptionHover:f,readOnly:m,floatingHeight:g},children:(0,z.jsx)(me,{opened:x.dropdownOpened,...v,middlewares:y,onChange:e=>!e&&C(),withRoles:!1,unstyled:i,children:a})})};Rt.extend=e=>e,Rt.classes=ct,Rt.varsResolver=Lt,Rt.displayName=`@mantine/core/Combobox`,Rt.Target=jt,Rt.Dropdown=ht,Rt.Options=Dt,Rt.Option=Et,Rt.Search=kt,Rt.Empty=vt,Rt.Chevron=dt,Rt.Footer=St,Rt.Header=wt,Rt.EventsTarget=xt,Rt.DropdownTarget=_t,Rt.Group=Ct,Rt.ClearButton=mt,Rt.HiddenInput=Tt;function zt(e){return`group`in e}function Bt({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function Ht(e,t=new Set){if(Array.isArray(e))for(let n of e)if(zt(n))Ht(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function Ut(e,t){return Array.isArray(e)?e.includes(t):e===t}function Wt({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:s}){if(!zt(e)){let c=Ut(r,e.value),l=t&&(c?(0,z.jsx)(be,{className:ct.optionsDropdownCheckIcon}):n?(0,z.jsx)(`div`,{className:ct.optionsDropdownCheckPlaceholder}):null),u=(0,z.jsxs)(z.Fragment,{children:[i===`left`&&l,(0,z.jsx)(`span`,{children:e.label}),i===`right`&&l]});return(0,z.jsx)(Rt.Option,{value:e.value,disabled:e.disabled,className:o({[ct.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof s==`function`?s({option:e,checked:c}):u})}let c=e.items.map(e=>(0,z.jsx)(Wt,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:s},`${e.value}`));return(0,z.jsx)(Rt.Group,{label:e.group,children:c})}function Gt({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=pt();Ht(e);let x=typeof i==`string`?(r||Bt)({options:e,search:l?i:``,limit:a??1/0}):e,S=Vt(x),C=x.map((e,t)=>(0,z.jsx)(Wt,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},zt(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,z.jsx)(Rt.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,z.jsxs)(Rt.Options,{labelledBy:g,"aria-label":y,children:[c?(0,z.jsx)(_e.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,z.jsx)(Rt.Empty,{children:m})]})})}function Kt(e){let t=e.currentTarget;return et(t).activeElement!==t}function qt(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}var[Jt,Yt]=Ee(`Progress.Root component was not found in tree`),Xt={root:`m_db6d6462`,section:`m_2242eb65`,"stripes-animation":`m_81a374bd`,"stripes-animation-vertical":`m_e0fb7a86`,label:`m_91e40b74`},Zt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ProgressLabel`,null,e);return(0,z.jsx)(se,{...Yt().getStyles(`label`,{className:n,style:r,classNames:t,styles:i}),...o})});Zt.classes=Xt,Zt.displayName=`@mantine/core/ProgressLabel`;var Qt=p((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":j(t,`progress-size`),"--progress-radius":n===void 0?void 0:w(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),$t=n(e=>{let t=T(`ProgressRoot`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,autoContrast:c,transitionDuration:l,orientation:u,attributes:d,mod:f,...p}=t,m=E({name:`Progress`,classes:Xt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s,varsResolver:Qt});return(0,z.jsx)(Jt,{value:{getStyles:m,autoContrast:c},children:(0,z.jsx)(se,{mod:[{orientation:u},f],...m(`root`),...p})})});$t.classes=Xt,$t.varsResolver=Qt,$t.displayName=`@mantine/core/ProgressRoot`;var en={withAria:!0},tn=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,value:c,withAria:l,color:u,striped:d,animated:f,mod:p,...m}=T(`ProgressSection`,en,e),h=Yt(),g=s(),_=l?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":c,"aria-valuetext":`${c}%`}:{};return(0,z.jsx)(se,{...h.getStyles(`section`,{className:n,classNames:t,styles:i,style:r}),...m,..._,mod:[{striped:d||f,animated:f},p],__vars:{"--progress-section-size":`${c}%`,"--progress-section-color":a(u,g),"--progress-label-color":tt(h.autoContrast,g)?Ce({color:u,theme:g,autoContrast:h.autoContrast}):void 0}})});tn.classes=Xt,tn.displayName=`@mantine/core/ProgressSection`;var nn=n(e=>{let n=T(`Progress`,null,e),{value:r,classNames:i,styles:a,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=n,{resolvedClassNames:f,resolvedStyles:p}=t({classNames:i,styles:a,props:n});return(0,z.jsx)($t,{classNames:f,styles:p,vars:o,...d,children:(0,z.jsx)(tn,{value:r,color:s,striped:c,animated:l,"aria-label":u})})});nn.classes=Xt,nn.displayName=`@mantine/core/Progress`,nn.Section=tn,nn.Root=$t,nn.Label=Zt;var rn={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},an=oe(n=>{let r=T([`Input`,`InputWrapper`,`Select`],rn,n),{classNames:i,styles:a,unstyled:o,vars:s,dropdownOpened:c,defaultDropdownOpened:l,onDropdownClose:u,onDropdownOpen:d,onFocus:f,onBlur:p,onClick:m,onChange:h,data:g,value:_,defaultValue:v,selectFirstOptionOnChange:y,selectFirstOptionOnDropdownOpen:b,onOptionSubmit:x,comboboxProps:S,readOnly:C,disabled:w,filter:E,limit:D,withScrollArea:O,maxDropdownHeight:k,floatingHeight:A,size:j,searchable:M,rightSection:te,checkIconPosition:ne,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:re,name:ie,form:ae,searchValue:oe,defaultSearchValue:se,onSearchChange:ce,allowDeselect:le,error:F,rightSectionPointerEvents:I,id:L,clearable:ue,clearSectionMode:de,clearButtonProps:fe,hiddenInputProps:pe,renderOption:me,onClear:he,autoComplete:ge,scrollAreaProps:_e,__defaultRightSection:ve,__clearSection:ye,__clearable:be,chevronColor:xe,autoSelectOnBlur:Se,openOnFocus:Ce,attributes:we,...Te}=r,Ee=(0,R.useMemo)(()=>ot(g),[g]),Oe=(0,R.useRef)({}),ke=(0,R.useMemo)(()=>st(Ee),[Ee]),Ae=e(L),[je,Me,Ne]=De({value:_,defaultValue:v,finalValue:null,onChange:h}),Pe=je==null?void 0:`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`],Fe=Ze(Pe),[Ie,Le,Re]=De({value:oe,defaultValue:se,finalValue:Pe?Pe.label:``,onChange:ce}),ze=Ft({opened:c,defaultOpened:l,onDropdownOpen:()=>{d?.(),b?ze.selectFirstOption():ze.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{u?.(),setTimeout(ze.resetSelectedOption,0)}}),Be=e=>{Le(e),ze.resetSelectedOption()},{resolvedClassNames:Ve,resolvedStyles:He}=t({props:r,styles:a,classNames:i});(0,R.useEffect)(()=>{y&&ze.selectFirstOption()},[y,Ie]),(0,R.useEffect)(()=>{_===null&&Be(``),_!=null&&Pe&&(Fe?.value!==Pe.value||Fe?.label!==Pe.label)&&Be(Pe.label)},[_,Pe]),(0,R.useEffect)(()=>{!Ne&&!Re&&Be(je==null?``:`${je}`in ke?ke[`${je}`]?.label:Oe.current[`${je}`]?.label||``)},[ke,je]),(0,R.useEffect)(()=>{je&&`${je}`in ke&&(Oe.current[`${je}`]=ke[`${je}`])},[ke,je]);let Ue=(0,z.jsx)(Rt.ClearButton,{...fe,onClear:()=>{Me(null,null),Be(``),he?.()}}),We=ue&&je!=null&&!w&&!C;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Rt,{store:ze,__staticSelector:`Select`,classNames:Ve,styles:He,unstyled:o,readOnly:C,size:j,attributes:we,floatingHeight:A,keepMounted:Se,onOptionSubmit:e=>{x?.(e);let t=le&&`${ke[e].value}`==`${je}`?null:ke[e],n=t?t.value:null;n!==je&&Me(n,t),!Ne&&Be(n==null?``:t?.label||``),ze.closeDropdown()},...S,children:[(0,z.jsx)(Rt.Target,{targetType:M?`input`:`button`,autoComplete:ge,withExpandedAttribute:!0,children:(0,z.jsx)(ee,{id:Ae,__defaultRightSection:(0,z.jsx)(Rt.Chevron,{size:j,error:F,unstyled:o,color:xe}),__clearSection:Ue,__clearable:We,__clearSectionMode:de,rightSection:te,rightSectionPointerEvents:I||`none`,...Te,size:j,__staticSelector:`Select`,disabled:w,readOnly:C||!M,value:Ie,onChange:e=>{if(Kt(e)){if(!C){let t=qt(ke,e.currentTarget.value);t&&`${t.value}`!=`${je}`&&(Me(t.value,t),!Ne&&Be(t.label))}return}Be(e.currentTarget.value),ze.openDropdown(),y&&ze.selectFirstOption()},onFocus:e=>{Ce&&M&&ze.openDropdown(),f?.(e)},onBlur:e=>{Se&&ze.clickSelectedOption(),M&&ze.closeDropdown();let t=je!=null&&(`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`]);Be(t&&t.label||``),p?.(e)},onClick:e=>{M?ze.openDropdown():ze.toggleDropdown(),m?.(e)},classNames:Ve,styles:He,unstyled:o,pointer:!M,error:F,attributes:we})}),(0,z.jsx)(Gt,{data:Ee,hidden:C||w,filter:E,search:Ie,limit:D,hiddenWhenEmpty:!re,withScrollArea:O,maxDropdownHeight:k,filterOptions:!!M&&Pe?.label!==Ie,value:je,checkIconPosition:ne,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:re,unstyled:o,labelId:Te.label?`${Ae}-label`:void 0,"aria-label":Te.label?void 0:Te[`aria-label`],renderOption:me,scrollAreaProps:_e})]}),(0,z.jsx)(Rt.HiddenInput,{value:je,name:ie,form:ae,disabled:w,...pe})]})});an.classes={...ee.classes,...Rt.classes},an.displayName=`@mantine/core/Select`;function on(e){if(e!==void 0)return typeof e==`number`?ie(e):e}function sn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=s(),l=t===void 0?e:t,u=r!==void 0,d=g({"--sg-spacing-x":P(Xe(e)),"--sg-spacing-y":P(Xe(l)),"--sg-auto-rows":i,...u?{"--sg-min-col-width":on(r)}:{"--sg-cols":Xe(n)?.toString()}}),f=y(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=P(e[r])),typeof l==`object`&&l[r]!==void 0&&(t[r][`--sg-spacing-y`]=P(l[r])),!u&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:d,media:ge(y(f),o.breakpoints).filter(e=>y(f[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:f[e.value]})),selector:a})}function cn(e){return typeof e==`object`&&e?y(e):[]}function ln(e){return e.sort((e,t)=>he(e)-he(t))}function un({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return ln(Array.from(new Set([...cn(e),...cn(t),...r===void 0?cn(n):[]])))}function dn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,l=g({"--sg-spacing-x":P(Xe(e)),"--sg-spacing-y":P(Xe(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":on(r)}:{"--sg-cols":Xe(n)?.toString()}}),u=un({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),d=u.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=P(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=P(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:l,container:u.map(e=>({query:`simple-grid (min-width: ${e})`,styles:d[e]})),selector:a})}var fn={container:`m_925c2d2c`,root:`m_2415a157`},pn={cols:1,spacing:`md`,type:`media`},mn=n(e=>{let t=T(`SimpleGrid`,pn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,cols:c,verticalSpacing:l,spacing:u,type:d,minColWidth:p,autoFlow:m,autoRows:h,attributes:g,..._}=t,v=E({name:`SimpleGrid`,classes:fn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:g,vars:s}),y=f(),b=p===void 0?void 0:m||`auto-fill`;return d===`container`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(dn,{...t,selector:`.${y}`}),(0,z.jsx)(`div`,{...v(`container`),children:(0,z.jsx)(se,{...v(`root`,{className:y}),..._,"data-auto-cols":b})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(sn,{...t,selector:`.${y}`}),(0,z.jsx)(se,{...v(`root`,{className:y}),..._,"data-auto-cols":b})]})});mn.classes=fn,mn.displayName=`@mantine/core/SimpleGrid`;var hn=class extends we{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Te(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&de(t.mutationKey)!==de(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??je();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){qe.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function gn(e,t){let n=fe(t),[r]=R.useState(()=>new hn(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);let i=R.useSyncExternalStore(R.useCallback(e=>r.subscribe(qe.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=R.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Ke)},[r]);if(i.error&&pe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var _n=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),vn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),yn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),bn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z`}))]]),xn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),Sn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:_n}));Sn.displayName=`ArrowUpRightIcon`;var Cn=Sn,wn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:vn}));wn.displayName=`CaretDownIcon`;var Tn=wn,En=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:yn}));En.displayName=`ListMagnifyingGlassIcon`;var Dn=En,On=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:bn}));On.displayName=`SlidersHorizontalIcon`;var kn=On,An=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:xn}));An.displayName=`WarningCircleIcon`;var jn=An;function Mn(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Nn(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Pn(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=Mn(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Nn(r,u,s[0]),f=Nn(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Fn(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=Mn(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=Rn(d,0,s-r),f=Rn(f,0,l-i),{x:d,y:f}}function In(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=Mn(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Ln(e,t,n){let{margin:r,rowHeight:i}=e,a=Mn(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function Rn(e,t,n){return Math.max(Math.min(e,n),t)}function zn(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Bn(e,t){for(let n=0;nzn(e,t))}function Hn(e,t){return t===`horizontal`?Wn(e):t===`vertical`||t===`wrap`?Un(e):[...e]}function Un(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function Wn(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function Gn(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function Kn(e,t){for(let n=0;ne.static===!0)}function Jn(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function Yn(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Bn(n,i);)i.y++}}return e}function $n(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=Hn(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=Vn(d,t),p=f.length>0;if(p&&c)return Yn(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return $n(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return $n(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return $n(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:$n(e,n,l,u,r,c,i)}function tr(e,t,n){return Math.max(t,Math.min(n,e))}var nr=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:tr(t,0,Math.max(0,r-e.w)),y:tr(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:tr(t,1,Math.max(1,o)),h:tr(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:tr(t,e.minW??1,e.maxW??1/0),h:tr(n,e.minH??1,e.maxH??1/0)}}}];function rr(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ir(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ar({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function or({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function sr(e){return e*100+`%`}function cr(e,t,n,r){return e+n>r?t:n}function lr(e,t,n){return e<0?t:n}function ur(e){return Math.max(0,e)}function dr(e){return Math.max(0,e)}var fr=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:lr(o,e.height,i),top:dr(o)}},pr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:cr(e.left,e.width,o,n),left:ur(i)}},mr=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:dr(r),left:0}:{height:i,width:a,top:dr(r),left:o}},hr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:lr(r,e.height,a),top:dr(r)}},gr={n:fr,ne:(e,t,n)=>fr(e,pr(e,t,n)),e:pr,se:(e,t,n)=>hr(e,pr(e,t,n)),s:hr,sw:(e,t,n)=>hr(e,mr(e,t)),w:mr,nw:(e,t,n)=>fr(e,mr(e,t))};function _r(e,t,n,r){let i=gr[e];return i?i(t,{...t,...n},r):n}var vr={type:`transform`,scale:1,calcStyle(e){return ar(e)}},yr={type:`absolute`,scale:1,calcStyle(e){return or(e)}};function br(e){return{type:`transform`,scale:e,calcStyle(e){return ar(e)},calcDragPosition(t,n,r,i){return{left:(t-r)/e,top:(n-i)/e}}}}var xr=vr,Sr={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Cr={enabled:!0,bounded:!1,threshold:3},wr={enabled:!0,handles:[`se`]},Tr={enabled:!1,defaultItem:{w:1,h:1}};function Er(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??qn(e).length>0;for(let i=o+1;it.y+t.h)break;zn(t,o)&&Er(e,o,n+t[a],r,s)}}t[r]=n}function Dr(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Bn(e,t);)t.y--;let i;for(;(i=Bn(e,t))!==void 0;)Er(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Or(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Bn(e,t);)t.x--;let i;for(;(i=Bn(e,t))!==void 0;)if(Er(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Bn(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var kr={type:`vertical`,allowOverlap:!1,compact(e,t){let n=qn(e),r=Gn(n),i=Un(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Lr(e,t){let n=Ir(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Rr(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function zr(e,t,n,r,i,a){let o=e[n];if(o)return Yn(o);let s=e[r],c=Ir(t),l=c.slice(c.indexOf(n));for(let t=0;t{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Hr=b(((e,t)=>{var n=Vr();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Ur=b(((e,t)=>{t.exports=Hr()()})),Wr=ce(Ur(),1),Gr=ce(k(),1);function Kr(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&Kr(e.changedTouches,e=>t===e.identifier)}function gi(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function _i(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function vi(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??_i();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +import{$ as e,A as t,C as n,D as r,E as i,G as a,J as o,N as s,O as c,Q as l,R as u,S as d,T as f,Y as p,_ as m,a as h,ct as g,d as _,f as v,ft as y,gt as b,h as x,ht as S,i as C,it as w,j as T,k as E,l as D,m as O,mt as k,o as A,ot as j,p as ee,pt as M,r as te,rt as ne,s as N,st as P,u as re,ut as ie,vt as ae,w as oe,x as se,xt as ce,y as le}from"./brand-CCB4_HD8.js";import{n as F,t as I}from"./copy-CUb9ms1Q.js";import{A as L,B as ue,C as de,D as fe,E as pe,F as me,G as he,H as ge,I as _e,L as ve,M as ye,N as be,O as xe,P as Se,R as Ce,S as we,T as Te,U as Ee,V as De,W as Oe,_ as ke,a as Ae,b as je,d as Me,f as Ne,g as Pe,h as Fe,i as Ie,j as Le,k as Re,l as ze,m as Be,n as Ve,o as He,r as Ue,t as We,v as Ge,w as Ke,x as qe,y as Je,z as Ye}from"./index-BxnvJp0Y.js";var R=ce(S(),1),z=M();function Xe(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Ze(e){let t=(0,R.useRef)(void 0);return(0,R.useEffect)(()=>{t.current=e},[e]),t.current}function Qe(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{let t=T(`Flex`,null,e),{classNames:n,className:a,style:o,styles:l,unstyled:d,vars:p,gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x,attributes:S,...C}=t,w=E({name:`Flex`,classes:rt,props:t,className:a,style:o,classNames:n,styles:l,unstyled:d,attributes:S,vars:p}),D=s(),O=f(),k=i({styleProps:{gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x},theme:D,data:nt}),A=u(),j=A&&k.hasResponsiveStyles?r(k.styles,k.media):O;return(0,z.jsxs)(z.Fragment,{children:[k.hasResponsiveStyles&&(0,z.jsx)(c,{selector:`.${j}`,styles:k.styles,media:k.media,deduplicate:A}),(0,z.jsx)(se,{...w(`root`,{className:j,style:g(k.inlineStyles)}),...C})]})});it.classes=rt,it.displayName=`@mantine/core/Flex`;function at(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>at(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function ot(e){return e?e.map(e=>at(e)):[]}function st(e){return e.reduce((e,t)=>`group`in t?{...e,...st(t.items)}:(e[`${t.value}`]=t,e),{})}var ct={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},lt={error:null},ut=p((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":j(t,`combobox-chevron-size`),"--combobox-chevron-color":n?a(n,e):void 0}})),dt=n(e=>{let t=T(`ComboboxChevron`,lt,e),{size:n,error:r,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,attributes:u,mod:d,...f}=t,p=E({name:`ComboboxChevron`,classes:ct,props:t,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,varsResolver:ut,attributes:u,rootSelector:`chevron`});return(0,z.jsx)(se,{component:`svg`,...f,...p(`chevron`),size:n,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:r},d],children:(0,z.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});dt.classes=ct,dt.varsResolver=ut,dt.displayName=`@mantine/core/ComboboxChevron`;var[ft,pt]=Ee(`Combobox component was not found in tree`);function mt({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,z.jsx)(O.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}mt.displayName=`@mantine/core/ComboboxClearButton`;var ht=n(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=T(`ComboboxDropdown`,null,e),s=pt();return(0,z.jsx)(me.Dropdown,{...o,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":s.floatingHeight||void 0,...s.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});ht.classes=ct,ht.displayName=`@mantine/core/ComboboxDropdown`;var gt={refProp:`ref`},_t=n(e=>{let{children:t,refProp:n,ref:r}=T(`ComboboxDropdownTarget`,gt,e);if(pt(),!Oe(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,z.jsx)(me.Target,{ref:r,refProp:n,children:t})});_t.displayName=`@mantine/core/ComboboxDropdownTarget`;var vt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxEmpty`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...o})});vt.classes=ct,vt.displayName=`@mantine/core/ComboboxEmpty`;function yt({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=pt(),[c,l]=(0,R.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var bt={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},xt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxEventsTarget`,bt,e),d=Ye(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=pt();return(0,R.cloneElement)(d,{...yt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u,[n]:l(c,f.store.targetRef,ue(d))})});xt.displayName=`@mantine/core/ComboboxEventsTarget`;var St=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxFooter`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});St.classes=ct,St.displayName=`@mantine/core/ComboboxFooter`;var Ct=n(t=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,label:c,id:l,...u}=T(`ComboboxGroup`,null,t),d=pt(),f=e(l),p=c!=null&&c!==!1&&c!==``;return(0,z.jsxs)(se,{role:`group`,"aria-labelledby":p?f:void 0,...d.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...u,children:[p&&(0,z.jsx)(`div`,{id:f,...d.getStyles(`groupLabel`,{classNames:n,styles:a}),children:c}),s]})});Ct.classes=ct,Ct.displayName=`@mantine/core/ComboboxGroup`;var wt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxHeader`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});wt.classes=ct,wt.displayName=`@mantine/core/ComboboxHeader`;function Tt({value:e,valuesDivider:t=`,`,...n}){return(0,z.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Tt.displayName=`@mantine/core/ComboboxHiddenInput`;var Et=n(e=>{let t=T(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:o,onClick:s,id:c,active:l,onMouseDown:u,onMouseOver:d,disabled:f,selected:p,mod:m,...h}=t,g=pt(),_=(0,R.useId)(),v=c||_;return(0,z.jsx)(se,{...g.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),...h,id:v,mod:[`combobox-option`,{"combobox-active":l,"combobox-disabled":f,"combobox-selected":p},m],role:`option`,onClick:e=>{f?e.preventDefault():(g.onOptionSubmit?.(t.value,t),s?.(e))},onMouseDown:e=>{e.preventDefault(),u?.(e)},onMouseOver:e=>{g.resetSelectionOnOptionHover&&g.store.resetSelectedOption(),d?.(e)}})});Et.classes=ct,Et.displayName=`@mantine/core/ComboboxOption`;var Dt=n(t=>{let{classNames:n,className:r,style:i,styles:a,id:o,onMouseDown:s,labelledBy:c,...l}=T(`ComboboxOptions`,null,t),u=pt(),d=e(o);return(0,R.useEffect)(()=>{u.store.setListId(d)},[d]),(0,z.jsx)(se,{...u.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...l,id:d,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});Dt.classes=ct,Dt.displayName=`@mantine/core/ComboboxOptions`;var Ot={withAriaAttributes:!0,withKeyboardNavigation:!0},kt=n(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:o,onClick:s,withKeyboardNavigation:c,size:u,ref:d,...f}=T(`ComboboxSearch`,Ot,e),p=pt(),m=p.getStyles(`search`),h=yt({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:s,autoComplete:`off`});return(0,z.jsx)(O,{ref:l(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});kt.classes=ct,kt.displayName=`@mantine/core/ComboboxSearch`;var At={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},jt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxTarget`,At,e),d=Ye(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=pt(),p=(0,R.cloneElement)(d,{...yt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u});return(0,z.jsx)(me.Target,{refProp:n,ref:l(c,f.store.targetRef),children:p})});jt.displayName=`@mantine/core/ComboboxTarget`;function Mt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Nt(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,R.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,R.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,R.useCallback)(()=>{let e=et(f.current),t=Qe(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,R.useCallback)(e=>{let t=et(f.current),n=Qe(`#${l.current}`,t),r=n?$e(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,R.useCallback)(()=>{let e=et(f.current),t=Qe(`#${l.current} [data-combobox-active]`,e);if(t){let n=$e(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Nt(u.current,t,a))},[b,a]),C=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Mt(u.current,t,a))},[b,a]),w=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Pt(t))},[b]),T=(0,R.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=et(f.current),r=$e(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=et(f.current),r=$e(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,R.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,R.useCallback)(()=>{let e=et(f.current);($e(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,R.useCallback)(e=>{l.current=e},[]),k=(0,R.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,R.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,R.useCallback)(()=>u.current,[]);return(0,R.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var It={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Lt=p((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":ne(t),"--combobox-option-padding":j(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:ie(n),"--combobox-option-fz":ne(t),"--combobox-option-padding":j(t,`combobox-option-padding`)}})),Rt=e=>{let t=T(`Combobox`,It,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:l,size:u,dropdownPadding:d,resetSelectionOnOptionHover:f,__staticSelector:p,readOnly:m,attributes:h,floatingHeight:g,middlewares:_,...v}=t,y=g===`viewport`?{..._,flip:!1,size:{...typeof _?.size==`object`?_.size:{},padding:typeof _?.size==`object`&&_.size.padding!==void 0?_.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=_?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:_,b=Ft(),x=o||b,S=E({name:p||`Combobox`,classes:ct,props:t,classNames:n,styles:r,unstyled:i,attributes:h,vars:s,varsResolver:Lt}),C=()=>{l?.(),x.closeDropdown()};return(0,z.jsx)(ft,{value:{getStyles:S,store:x,onOptionSubmit:c,size:u,resetSelectionOnOptionHover:f,readOnly:m,floatingHeight:g},children:(0,z.jsx)(me,{opened:x.dropdownOpened,...v,middlewares:y,onChange:e=>!e&&C(),withRoles:!1,unstyled:i,children:a})})};Rt.extend=e=>e,Rt.classes=ct,Rt.varsResolver=Lt,Rt.displayName=`@mantine/core/Combobox`,Rt.Target=jt,Rt.Dropdown=ht,Rt.Options=Dt,Rt.Option=Et,Rt.Search=kt,Rt.Empty=vt,Rt.Chevron=dt,Rt.Footer=St,Rt.Header=wt,Rt.EventsTarget=xt,Rt.DropdownTarget=_t,Rt.Group=Ct,Rt.ClearButton=mt,Rt.HiddenInput=Tt;function zt(e){return`group`in e}function Bt({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function Ht(e,t=new Set){if(Array.isArray(e))for(let n of e)if(zt(n))Ht(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function Ut(e,t){return Array.isArray(e)?e.includes(t):e===t}function Wt({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:s}){if(!zt(e)){let c=Ut(r,e.value),l=t&&(c?(0,z.jsx)(be,{className:ct.optionsDropdownCheckIcon}):n?(0,z.jsx)(`div`,{className:ct.optionsDropdownCheckPlaceholder}):null),u=(0,z.jsxs)(z.Fragment,{children:[i===`left`&&l,(0,z.jsx)(`span`,{children:e.label}),i===`right`&&l]});return(0,z.jsx)(Rt.Option,{value:e.value,disabled:e.disabled,className:o({[ct.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof s==`function`?s({option:e,checked:c}):u})}let c=e.items.map(e=>(0,z.jsx)(Wt,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:s},`${e.value}`));return(0,z.jsx)(Rt.Group,{label:e.group,children:c})}function Gt({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=pt();Ht(e);let x=typeof i==`string`?(r||Bt)({options:e,search:l?i:``,limit:a??1/0}):e,S=Vt(x),C=x.map((e,t)=>(0,z.jsx)(Wt,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},zt(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,z.jsx)(Rt.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,z.jsxs)(Rt.Options,{labelledBy:g,"aria-label":y,children:[c?(0,z.jsx)(_e.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,z.jsx)(Rt.Empty,{children:m})]})})}function Kt(e){let t=e.currentTarget;return et(t).activeElement!==t}function qt(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}var[Jt,Yt]=Ee(`Progress.Root component was not found in tree`),Xt={root:`m_db6d6462`,section:`m_2242eb65`,"stripes-animation":`m_81a374bd`,"stripes-animation-vertical":`m_e0fb7a86`,label:`m_91e40b74`},Zt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ProgressLabel`,null,e);return(0,z.jsx)(se,{...Yt().getStyles(`label`,{className:n,style:r,classNames:t,styles:i}),...o})});Zt.classes=Xt,Zt.displayName=`@mantine/core/ProgressLabel`;var Qt=p((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":j(t,`progress-size`),"--progress-radius":n===void 0?void 0:w(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),$t=n(e=>{let t=T(`ProgressRoot`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,autoContrast:c,transitionDuration:l,orientation:u,attributes:d,mod:f,...p}=t,m=E({name:`Progress`,classes:Xt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s,varsResolver:Qt});return(0,z.jsx)(Jt,{value:{getStyles:m,autoContrast:c},children:(0,z.jsx)(se,{mod:[{orientation:u},f],...m(`root`),...p})})});$t.classes=Xt,$t.varsResolver=Qt,$t.displayName=`@mantine/core/ProgressRoot`;var en={withAria:!0},tn=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,value:c,withAria:l,color:u,striped:d,animated:f,mod:p,...m}=T(`ProgressSection`,en,e),h=Yt(),g=s(),_=l?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":c,"aria-valuetext":`${c}%`}:{};return(0,z.jsx)(se,{...h.getStyles(`section`,{className:n,classNames:t,styles:i,style:r}),...m,..._,mod:[{striped:d||f,animated:f},p],__vars:{"--progress-section-size":`${c}%`,"--progress-section-color":a(u,g),"--progress-label-color":tt(h.autoContrast,g)?Ce({color:u,theme:g,autoContrast:h.autoContrast}):void 0}})});tn.classes=Xt,tn.displayName=`@mantine/core/ProgressSection`;var nn=n(e=>{let n=T(`Progress`,null,e),{value:r,classNames:i,styles:a,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=n,{resolvedClassNames:f,resolvedStyles:p}=t({classNames:i,styles:a,props:n});return(0,z.jsx)($t,{classNames:f,styles:p,vars:o,...d,children:(0,z.jsx)(tn,{value:r,color:s,striped:c,animated:l,"aria-label":u})})});nn.classes=Xt,nn.displayName=`@mantine/core/Progress`,nn.Section=tn,nn.Root=$t,nn.Label=Zt;var rn={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},an=oe(n=>{let r=T([`Input`,`InputWrapper`,`Select`],rn,n),{classNames:i,styles:a,unstyled:o,vars:s,dropdownOpened:c,defaultDropdownOpened:l,onDropdownClose:u,onDropdownOpen:d,onFocus:f,onBlur:p,onClick:m,onChange:h,data:g,value:_,defaultValue:v,selectFirstOptionOnChange:y,selectFirstOptionOnDropdownOpen:b,onOptionSubmit:x,comboboxProps:S,readOnly:C,disabled:w,filter:E,limit:D,withScrollArea:O,maxDropdownHeight:k,floatingHeight:A,size:j,searchable:M,rightSection:te,checkIconPosition:ne,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:re,name:ie,form:ae,searchValue:oe,defaultSearchValue:se,onSearchChange:ce,allowDeselect:le,error:F,rightSectionPointerEvents:I,id:L,clearable:ue,clearSectionMode:de,clearButtonProps:fe,hiddenInputProps:pe,renderOption:me,onClear:he,autoComplete:ge,scrollAreaProps:_e,__defaultRightSection:ve,__clearSection:ye,__clearable:be,chevronColor:xe,autoSelectOnBlur:Se,openOnFocus:Ce,attributes:we,...Te}=r,Ee=(0,R.useMemo)(()=>ot(g),[g]),Oe=(0,R.useRef)({}),ke=(0,R.useMemo)(()=>st(Ee),[Ee]),Ae=e(L),[je,Me,Ne]=De({value:_,defaultValue:v,finalValue:null,onChange:h}),Pe=je==null?void 0:`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`],Fe=Ze(Pe),[Ie,Le,Re]=De({value:oe,defaultValue:se,finalValue:Pe?Pe.label:``,onChange:ce}),ze=Ft({opened:c,defaultOpened:l,onDropdownOpen:()=>{d?.(),b?ze.selectFirstOption():ze.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{u?.(),setTimeout(ze.resetSelectedOption,0)}}),Be=e=>{Le(e),ze.resetSelectedOption()},{resolvedClassNames:Ve,resolvedStyles:He}=t({props:r,styles:a,classNames:i});(0,R.useEffect)(()=>{y&&ze.selectFirstOption()},[y,Ie]),(0,R.useEffect)(()=>{_===null&&Be(``),_!=null&&Pe&&(Fe?.value!==Pe.value||Fe?.label!==Pe.label)&&Be(Pe.label)},[_,Pe]),(0,R.useEffect)(()=>{!Ne&&!Re&&Be(je==null?``:`${je}`in ke?ke[`${je}`]?.label:Oe.current[`${je}`]?.label||``)},[ke,je]),(0,R.useEffect)(()=>{je&&`${je}`in ke&&(Oe.current[`${je}`]=ke[`${je}`])},[ke,je]);let Ue=(0,z.jsx)(Rt.ClearButton,{...fe,onClear:()=>{Me(null,null),Be(``),he?.()}}),We=ue&&je!=null&&!w&&!C;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Rt,{store:ze,__staticSelector:`Select`,classNames:Ve,styles:He,unstyled:o,readOnly:C,size:j,attributes:we,floatingHeight:A,keepMounted:Se,onOptionSubmit:e=>{x?.(e);let t=le&&`${ke[e].value}`==`${je}`?null:ke[e],n=t?t.value:null;n!==je&&Me(n,t),!Ne&&Be(n==null?``:t?.label||``),ze.closeDropdown()},...S,children:[(0,z.jsx)(Rt.Target,{targetType:M?`input`:`button`,autoComplete:ge,withExpandedAttribute:!0,children:(0,z.jsx)(ee,{id:Ae,__defaultRightSection:(0,z.jsx)(Rt.Chevron,{size:j,error:F,unstyled:o,color:xe}),__clearSection:Ue,__clearable:We,__clearSectionMode:de,rightSection:te,rightSectionPointerEvents:I||`none`,...Te,size:j,__staticSelector:`Select`,disabled:w,readOnly:C||!M,value:Ie,onChange:e=>{if(Kt(e)){if(!C){let t=qt(ke,e.currentTarget.value);t&&`${t.value}`!=`${je}`&&(Me(t.value,t),!Ne&&Be(t.label))}return}Be(e.currentTarget.value),ze.openDropdown(),y&&ze.selectFirstOption()},onFocus:e=>{Ce&&M&&ze.openDropdown(),f?.(e)},onBlur:e=>{Se&&ze.clickSelectedOption(),M&&ze.closeDropdown();let t=je!=null&&(`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`]);Be(t&&t.label||``),p?.(e)},onClick:e=>{M?ze.openDropdown():ze.toggleDropdown(),m?.(e)},classNames:Ve,styles:He,unstyled:o,pointer:!M,error:F,attributes:we})}),(0,z.jsx)(Gt,{data:Ee,hidden:C||w,filter:E,search:Ie,limit:D,hiddenWhenEmpty:!re,withScrollArea:O,maxDropdownHeight:k,filterOptions:!!M&&Pe?.label!==Ie,value:je,checkIconPosition:ne,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:re,unstyled:o,labelId:Te.label?`${Ae}-label`:void 0,"aria-label":Te.label?void 0:Te[`aria-label`],renderOption:me,scrollAreaProps:_e})]}),(0,z.jsx)(Rt.HiddenInput,{value:je,name:ie,form:ae,disabled:w,...pe})]})});an.classes={...ee.classes,...Rt.classes},an.displayName=`@mantine/core/Select`;function on(e){if(e!==void 0)return typeof e==`number`?ie(e):e}function sn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=s(),l=t===void 0?e:t,u=r!==void 0,d=g({"--sg-spacing-x":P(Xe(e)),"--sg-spacing-y":P(Xe(l)),"--sg-auto-rows":i,...u?{"--sg-min-col-width":on(r)}:{"--sg-cols":Xe(n)?.toString()}}),f=y(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=P(e[r])),typeof l==`object`&&l[r]!==void 0&&(t[r][`--sg-spacing-y`]=P(l[r])),!u&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:d,media:ge(y(f),o.breakpoints).filter(e=>y(f[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:f[e.value]})),selector:a})}function cn(e){return typeof e==`object`&&e?y(e):[]}function ln(e){return e.sort((e,t)=>he(e)-he(t))}function un({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return ln(Array.from(new Set([...cn(e),...cn(t),...r===void 0?cn(n):[]])))}function dn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,l=g({"--sg-spacing-x":P(Xe(e)),"--sg-spacing-y":P(Xe(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":on(r)}:{"--sg-cols":Xe(n)?.toString()}}),u=un({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),d=u.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=P(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=P(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:l,container:u.map(e=>({query:`simple-grid (min-width: ${e})`,styles:d[e]})),selector:a})}var fn={container:`m_925c2d2c`,root:`m_2415a157`},pn={cols:1,spacing:`md`,type:`media`},mn=n(e=>{let t=T(`SimpleGrid`,pn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,cols:c,verticalSpacing:l,spacing:u,type:d,minColWidth:p,autoFlow:m,autoRows:h,attributes:g,..._}=t,v=E({name:`SimpleGrid`,classes:fn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:g,vars:s}),y=f(),b=p===void 0?void 0:m||`auto-fill`;return d===`container`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(dn,{...t,selector:`.${y}`}),(0,z.jsx)(`div`,{...v(`container`),children:(0,z.jsx)(se,{...v(`root`,{className:y}),..._,"data-auto-cols":b})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(sn,{...t,selector:`.${y}`}),(0,z.jsx)(se,{...v(`root`,{className:y}),..._,"data-auto-cols":b})]})});mn.classes=fn,mn.displayName=`@mantine/core/SimpleGrid`;var hn=class extends we{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Te(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&de(t.mutationKey)!==de(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??je();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){qe.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function gn(e,t){let n=fe(t),[r]=R.useState(()=>new hn(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);let i=R.useSyncExternalStore(R.useCallback(e=>r.subscribe(qe.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=R.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Ke)},[r]);if(i.error&&pe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var _n=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),vn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),yn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),bn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z`}))]]),xn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),Sn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:_n}));Sn.displayName=`ArrowUpRightIcon`;var Cn=Sn,wn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:vn}));wn.displayName=`CaretDownIcon`;var Tn=wn,En=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:yn}));En.displayName=`ListMagnifyingGlassIcon`;var Dn=En,On=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:bn}));On.displayName=`SlidersHorizontalIcon`;var kn=On,An=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:xn}));An.displayName=`WarningCircleIcon`;var jn=An;function Mn(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Nn(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Pn(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=Mn(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Nn(r,u,s[0]),f=Nn(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Fn(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=Mn(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=Rn(d,0,s-r),f=Rn(f,0,l-i),{x:d,y:f}}function In(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=Mn(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Ln(e,t,n){let{margin:r,rowHeight:i}=e,a=Mn(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function Rn(e,t,n){return Math.max(Math.min(e,n),t)}function zn(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Bn(e,t){for(let n=0;nzn(e,t))}function Hn(e,t){return t===`horizontal`?Wn(e):t===`vertical`||t===`wrap`?Un(e):[...e]}function Un(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function Wn(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function Gn(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function Kn(e,t){for(let n=0;ne.static===!0)}function Jn(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function Yn(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Bn(n,i);)i.y++}}return e}function $n(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=Hn(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=Vn(d,t),p=f.length>0;if(p&&c)return Yn(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return $n(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return $n(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return $n(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:$n(e,n,l,u,r,c,i)}function tr(e,t,n){return Math.max(t,Math.min(n,e))}var nr=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:tr(t,0,Math.max(0,r-e.w)),y:tr(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:tr(t,1,Math.max(1,o)),h:tr(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:tr(t,e.minW??1,e.maxW??1/0),h:tr(n,e.minH??1,e.maxH??1/0)}}}];function rr(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ir(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ar({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function or({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function sr(e){return e*100+`%`}function cr(e,t,n,r){return e+n>r?t:n}function lr(e,t,n){return e<0?t:n}function ur(e){return Math.max(0,e)}function dr(e){return Math.max(0,e)}var fr=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:lr(o,e.height,i),top:dr(o)}},pr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:cr(e.left,e.width,o,n),left:ur(i)}},mr=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:dr(r),left:0}:{height:i,width:a,top:dr(r),left:o}},hr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:lr(r,e.height,a),top:dr(r)}},gr={n:fr,ne:(e,t,n)=>fr(e,pr(e,t,n)),e:pr,se:(e,t,n)=>hr(e,pr(e,t,n)),s:hr,sw:(e,t,n)=>hr(e,mr(e,t)),w:mr,nw:(e,t,n)=>fr(e,mr(e,t))};function _r(e,t,n,r){let i=gr[e];return i?i(t,{...t,...n},r):n}var vr={type:`transform`,scale:1,calcStyle(e){return ar(e)}},yr={type:`absolute`,scale:1,calcStyle(e){return or(e)}};function br(e){return{type:`transform`,scale:e,calcStyle(e){return ar(e)},calcDragPosition(t,n,r,i){return{left:(t-r)/e,top:(n-i)/e}}}}var xr=vr,Sr={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Cr={enabled:!0,bounded:!1,threshold:3},wr={enabled:!0,handles:[`se`]},Tr={enabled:!1,defaultItem:{w:1,h:1}};function Er(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??qn(e).length>0;for(let i=o+1;it.y+t.h)break;zn(t,o)&&Er(e,o,n+t[a],r,s)}}t[r]=n}function Dr(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Bn(e,t);)t.y--;let i;for(;(i=Bn(e,t))!==void 0;)Er(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Or(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Bn(e,t);)t.x--;let i;for(;(i=Bn(e,t))!==void 0;)if(Er(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Bn(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var kr={type:`vertical`,allowOverlap:!1,compact(e,t){let n=qn(e),r=Gn(n),i=Un(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Lr(e,t){let n=Ir(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Rr(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function zr(e,t,n,r,i,a){let o=e[n];if(o)return Yn(o);let s=e[r],c=Ir(t),l=c.slice(c.indexOf(n));for(let t=0;t{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Hr=b(((e,t)=>{var n=Vr();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Ur=b(((e,t)=>{t.exports=Hr()()})),Wr=ce(Ur(),1),Gr=ce(k(),1);function Kr(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&Kr(e.changedTouches,e=>t===e.identifier)}function gi(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function _i(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function vi(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??_i();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} `,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&xi(e.body,`react-draggable-transparent-selection`)}function yi(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{bi(e)}):bi(e)}function bi(e){if(e)try{e.body&&Si(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function xi(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Si(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function Ci(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Ai(r);let i=ji(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+Yr(s.paddingLeft)+Yr(o.marginLeft),top:-i.offsetTop+Yr(s.paddingTop)+Yr(o.marginTop),right:ui(a)-ci(i)-i.offsetLeft+Yr(s.paddingRight)-Yr(o.marginRight),bottom:li(a)-si(i)-i.offsetTop+Yr(s.paddingBottom)-Yr(o.marginBottom)}}return Jr(r.right)&&(t=Math.min(t,r.right)),Jr(r.bottom)&&(n=Math.min(n,r.bottom)),Jr(r.left)&&(t=Math.max(t,r.left)),Jr(r.top)&&(n=Math.max(n,r.top)),[t,n]}function wi(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function Ti(e){return e.props.axis===`both`||e.props.axis===`x`}function Ei(e){return e.props.axis===`both`||e.props.axis===`y`}function Di(e,t,n){let r=typeof t==`number`?hi(e,t):null;if(typeof t==`number`&&!r)return null;let i=ji(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return di(r||e,a,n.props.scale)}function Oi(e,t,n){let r=!Jr(e.lastX),i=ji(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function ki(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Ai(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function ji(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var Mi=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Ni={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Pi=Ni.mouse,Fi=class extends R.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!ii(e.target,this.props.handle,t)||this.props.cancel&&ii(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=gi(e);this.touchIdentifier=r;let i=Di(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=Oi(this,a,o);Mi(`DraggableCore: handleDragStart: %j`,s),Mi(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&vi(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,ai(n,Pi.move,this.handleDrag),ai(n,Pi.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Di(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=wi(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=Oi(this,n,r);if(Mi(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=Di(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=wi(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=Oi(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&yi(a.ownerDocument),Mi(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Mi(`DraggableCore: Removing handlers`),oi(a.ownerDocument,Pi.move,this.handleDrag),oi(a.ownerDocument,Pi.stop,this.handleDragStop))},this.onMouseDown=e=>(Pi=Ni.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Pi=Ni.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Pi=Ni.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Pi=Ni.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&ai(e,Ni.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;oi(t,Ni.mouse.move,this.handleDrag),oi(t,Ni.touch.move,this.handleDrag),oi(t,Ni.mouse.stop,this.handleDragStop),oi(t,Ni.touch.stop,this.handleDragStop),oi(e,Ni.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&yi(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gr.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Mi(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return R.cloneElement(R.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Fi.displayName=`DraggableCore`,Fi.propTypes={allowAnyClick:Wr.default.bool,allowMobileScroll:Wr.default.bool,children:Wr.default.node.isRequired,disabled:Wr.default.bool,enableUserSelectHack:Wr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:Wr.default.arrayOf(Wr.default.number),handle:Wr.default.string,cancel:Wr.default.string,nodeRef:Wr.default.object,nonce:Wr.default.string,onStart:Wr.default.func,onDrag:Wr.default.func,onStop:Wr.default.func,onMouseDown:Wr.default.func,scale:Wr.default.number,className:Xr,style:Xr,transform:Xr},Fi.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Ii=class extends R.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Mi(`Draggable: onDragStart: %j`,t),this.props.onStart(e,ki(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Mi(`Draggable: onDrag: %j`,t);let n=ki(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=Ci(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,ki(this,t))===!1)return!1;Mi(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Mi(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gr.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:s,position:c,positionOffset:l,scale:u,...d}=this.props,f={},p=null,m=!c||this.state.dragging,h=c||r,g={x:Ti(this)&&m?this.state.x:h.x,y:Ei(this)&&m?this.state.y:h.y};this.state.isElementSVG?p=pi(g,l):f=fi(g,l);let _=R.Children.only(n),v=o(_.props.className||``,i,{[a]:this.state.dragging,[s]:this.state.dragged});return R.createElement(Fi,{...d,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},R.cloneElement(_,{className:v,style:{..._.props.style,...f},transform:p}))}};Ii.displayName=`Draggable`,Ii.propTypes={...Fi.propTypes,axis:Wr.default.oneOf([`both`,`x`,`y`,`none`]),bounds:Wr.default.oneOfType([Wr.default.shape({left:Wr.default.number,right:Wr.default.number,top:Wr.default.number,bottom:Wr.default.number}),Wr.default.string,Wr.default.oneOf([!1])]),defaultClassName:Wr.default.string,defaultClassNameDragging:Wr.default.string,defaultClassNameDragged:Wr.default.string,defaultPosition:Wr.default.shape({x:Wr.default.number,y:Wr.default.number}),positionOffset:Wr.default.shape({x:Wr.default.oneOfType([Wr.default.number,Wr.default.string]),y:Wr.default.oneOfType([Wr.default.number,Wr.default.string])}),position:Wr.default.shape({x:Wr.default.number,y:Wr.default.number}),className:Xr,style:Xr,transform:Xr},Ii.defaultProps={...Fi.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var Li=b(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},u=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),d=e=>l(r({},`__esModule`,{value:!0}),e),f={};c(f,{DraggableCore:()=>De,default:()=>Oe}),t.exports=d(f);var p=u(S()),m=u(Ur()),h=u(k()),g=Li();function _(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&_(e.changedTouches,e=>t===e.identifier)}function ce(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function le(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function F(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??le();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} @@ -21,4 +21,4 @@ import{$ as e,A as t,C as n,D as r,E as i,G as a,J as o,N as s,O as c,Q as l,R a `)){var p=new wH;p.newline=!0,s.add(p);return}var m=n.getSeriesByName(f)[0];if(!c.get(f)){if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,SH(OH,f,null,r,d)).on(`mouseover`,SH(kH,m.name,null,r,d)).on(`mouseout`,SH(AH,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=nh(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=Gl(h.fill);_&&_[3]===0&&(_[3]=.2,h=H(H({},h),{fill:$l(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,SH(OH,null,f,r,d)).on(`mouseover`,SH(kH,null,f,r,d)).on(`mouseout`,SH(AH,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=nh(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};nh(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();CH(e,function(e){var r=e.type,i=new Xf({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),$v(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),dg(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=EH(c,r,o,s,d,m,u),y=new wH,b=r.getModel(`textStyle`);if(K(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(DH({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;q(w)&&w?T=w.replace(`{name}`,t??``):K(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new Xf({style:ty(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new Gf({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Fv({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),dg(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();nC(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){nC(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(iN);function EH(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),CH(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:zP(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function DH(e){var t=e.icon||`roundRect`,n=Mw(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=Q.color.neutral00,n.style.lineWidth=2),n}function OH(e,t,n,r){AH(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),kH(e,t,n,r)}function kH(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function AH(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function jH(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),MH(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){U(i,function(t,n){e[t?`select`:`unSelect`](n)}),MH(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function MH(e,t){var n=t||{};return U(e.getData(),function(t){var r=t.get(`name`);if(r!==` `&&r!==``){var i=e.isSelected(r);n[r]=Fo(n,r)?n[r]&&i:i}}),n}function NH(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,fo(jH,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,fo(jH,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,fo(jH,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,fo(jH,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,fo(jH,`unSelect`))}var PH=th(FH);function FH(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;nn[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=Y(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new Gf({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&Y_(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;U([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,q(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=BH[i],o=VH[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(TH);function UH(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function WH(e){TI(IH),e.registerComponentModel(LH),e.registerComponentView(HH),UH(e)}function GH(e){TI(IH),TI(WH)}var KH={get:function(e,t,n){var r=V((qH[e]||{})[t]);return n&&G(r)?r[r.length-1]:r}},qH={color:{active:[`#006edd`,`#e0ffff`],inactive:[Q.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:[`circle`,`roundRect`,`diamond`],inactive:[`none`]},symbolSize:{active:[10,50],inactive:[0,0]}},JH=iz.mapVisual,YH=iz.eachVisual,XH=G,ZH=U,QH=jp,$H=wp,eU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&vH(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=uo(e,this),this.controllerVisuals=_H(this.option.controller,t,e),this.targetVisuals=_H(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this,t=this.option.seriesTargets;if(t){var n=[];return ZH(t,function(t){if(t.seriesIndex!=null)n.push(t.seriesIndex);else if(t.seriesId!=null){var r;e.ecModel.eachSeries(function(e){e.id===t.seriesId&&(r=e)}),r&&n.push(r.componentIndex)}}),n}var r=this.option.seriesId,i=this.option.seriesIndex;i==null&&r==null&&(i=`all`);var a=Mm(this.ecModel,`series`,{index:i,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return W(a,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){U(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],G(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);if(q(o))return o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c);if(K(o))return s?o(e[0],e[1]):o(e);if(s)return e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1];return c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option,t=QH([e.min,e.max]);this._dataExtent=t},t.prototype.getDimension=function(e){var t=this,n=this.option.seriesTargets;if(n){var r=so(n,function(n){return n.seriesIndex!=null&&n.seriesIndex===e||n.seriesId!=null&&n.seriesId===t.ecModel.getSeriesByIndex(e).id});if(r)return r.dimension}return this.option.dimension},t.prototype.getDataDimensionIndex=function(e){var t=e.hostModel.seriesIndex,n=this.getDimension(t);if(n!=null)return e.getDimensionIndex(n);for(var r=e.dimensions,i=r.length-1;i>=0;i--){var a=r[i],o=e.getDimensionInfo(a);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};Qa(r,n),Qa(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){XH(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},ZH(r,function(e,t){if(iz.isValidType(t)){var n=KH.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;ZH(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??(c.symbol=t&&V(t)||(a?i:[i])),c.symbolSize??(c.symbolSize=n&&V(n)||(a?s[0]:[s[0],s[0]])),c.symbol=JH(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;YH(l,function(e){e>u&&(u=e)}),c.symbolSize=JH(l,function(e){return $H(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:Q.color.transparent,borderColor:Q.color.borderTint,contentColor:Q.color.theme[0],inactiveColor:Q.color.disabled,borderWidth:0,padding:Q.size.m,textGap:10,precision:0,textStyle:{color:Q.color.secondary}},t}(mC),tU=[20,140],nU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod=`linear`,e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=tU[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=tU[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):G(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),U(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=jp((this.get(`range`)||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=n[1]||e<=t[1])?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=rU(this,`outOfRange`,this.getExtent()),n=rU(this,`inRange`,this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,c=t.length;oe[1])break;r.push({color:this.getControllerVisual(o,`color`,t),offset:a/n})}return r.push({color:this.getControllerVisual(e[1],`color`,t),offset:1}),r},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get(`inverse`);return new Kg(t===`horizontal`&&!n?{scaleX:e===`bottom`?1:-1,rotation:Math.PI/2}:t===`horizontal`&&n?{scaleX:e===`bottom`?-1:1,rotation:-Math.PI/2}:t===`vertical`&&!n?{scaleX:e===`left`?1:-1,scaleY:-1}:{scaleX:e===`left`?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,a=n.handleLabels,o=r.itemSize,s=r.getExtent(),c=this._applyTransform(`left`,n.mainGroup);lU([0,1],function(l){var u=i[l];u.setStyle(`fill`,t.handlesColor[l]),u.y=e[l];var d=cU(e[l],[0,o[1]],s,!0),f=this.getControllerVisual(d,`symbolSize`);u.scaleX=u.scaleY=f/o[0],u.x=o[0]-f/2;var p=bv(n.handleLabelPoints[l],yv(u,this.group));if(this._orient===`horizontal`){var m=c===`left`||c===`top`?(o[0]-f)/2:(o[0]-f)/-2;p[1]+=m}a[l].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:`middle`,align:this._orient===`vertical`?this._applyTransform(`left`,n.mainGroup):`center`})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,a=i.getExtent(),o=i.itemSize,s=[0,o[1]],c=this._shapes,l=c.indicator;if(l){l.attr(`invisible`,!1);var u=this.getControllerVisual(e,`color`,{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,`symbolSize`),f=cU(e,a,s,!0),p=o[0]-d/2,m={x:l.x,y:l.y};l.y=f,l.x=p;var h=bv(c.indicatorLabelPoint,yv(l,this.group)),g=c.indicatorLabel;g.attr(`invisible`,!1);var _=this._applyTransform(`left`,c.mainGroup),v=this._orient===`horizontal`;g.setStyle({text:(n||``)+i.formatValueText(t),verticalAlign:v?_:`middle`,align:v?`center`:_});var y={x:p,y:f,style:{fill:u}},b={style:{x:h[0],y:h[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var x={duration:100,easing:`cubicInOut`,additive:!0};l.x=m.x,l.y=m.y,l.animateTo(y,x),g.animateTo(b,x)}else l.attr(y),g.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;Ci[1]&&(l[1]=1/0),t&&(l[0]===-1/0?this._showIndicator(c,l[1],`< `,o):l[1]===1/0?this._showIndicator(c,l[0],`> `,o):this._showIndicator(c,c,`≈ `,o));var u=this._hoverLinkDataIndices,d=[];(t||_U(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(l));var f=Tm(u,d);this._dispatchHighDown(`downplay`,sU(f[0],n)),this._dispatchHighDown(`highlight`,sU(f[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(UN(e.target,function(e){var n=nh(e);if(n.dataIndex!=null)return t=n,!0},!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),a=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(a)||this._showIndicator(a,a)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr(`invisible`,!0),e.indicatorLabel&&e.indicatorLabel.attr(`invisible`,!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}];function SU(e,t,n,r){for(var i=t.targetVisuals[r],a=iz.prepareVisualTypes(i),o={color:VN(e.getData(),`color`)},s=0,c=a.length;s0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(yU,bU),U(xU,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(wU))}function OU(e){e.registerComponentModel(nU),e.registerComponentView(mU),DU(e)}var kU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],AU[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=V(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=W(this._pieceList,function(e){return e=V(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=iz.listVisualTypes(),i=this.isCategory();U(t.pieces,function(e){U(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),U(n,function(e,n){var r=!1;U(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&U(this.stateList,function(e){(t[e]||(t[e]={}))[n]=KH.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,U(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;U(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=V(e)},t.prototype.getValueState=function(e){var t=iz.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){iz.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return U(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=kx(eU.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:`auto`,itemWidth:20,itemHeight:14,itemSymbol:`roundRect`,pieces:null,categories:null,splitNumber:5,selectedMode:`multiple`,itemGap:10,hoverLink:!0}),t}(eU),AU={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}};function jU(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}var MU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=this._getItemAlign(),a=t.itemSize,o=this._getViewData(),s=o.endsText,c=bo(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),U(o.viewPieceList,function(o){var s=o.piece,u=new Kg;u.onclick=uo(this._onItemClick,this,s),this._enableHoverLink(u,o.indexInModelPieceList);var d=t.getRepresentValue(s);if(this._createItemSymbol(u,d,[0,0,a[0],a[1]],l),c){var f=this.visualMapModel.getValueState(d),p=r.get(`align`)||i;u.add(new Xf({style:ty(r,{x:p===`right`?-n:a[0]+n,y:a[1]/2,text:s.text,verticalAlign:r.get(`verticalAlign`)||`middle`,align:p,opacity:Y(r.get(`opacity`),f===`outOfRange`?.5:1)}),silent:l}))}e.add(u)},this),s&&this._renderEndsText(e,s[1],a,c,i),nC(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:sU(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return oU(e,this.api,e.itemSize);var n=t.align;return(!n||n===`auto`)&&(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new Kg,o=this.visualMapModel.textStyleModel;a.add(new Xf({style:ty(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=W(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=Mw(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=V(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,U(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(iU);function NU(e){e.registerComponentModel(kU),e.registerComponentView(MU),DU(e)}function PU(e){TI(OU),TI(NU)}var FU={label:{enabled:!0},decal:{show:!1}},IU=Dm(),LU=Dm(),RU=th(zU);function zU(e,t){var n=e.getModel(`aria`);if(!n.get(`enabled`))return;var r=LU(e).scope||(LU(e).scope={}),i=V(FU);Qa(i.label,e.getLocaleModel().get(`aria`),!1),Qa(n.option,i,!1),a(),o();function a(){if(n.getModel(`decal`).get(`show`)){var t=X();e.eachSeries(function(e){e.isColorBySeries()||(IU(e).scope=t.get(e.type)||t.set(e.type,{}))}),e.eachSeries(function(t){if(K(t.enableAriaDecal)){t.enableAriaDecal();return}var n=t.getData();if(t.isColorBySeries()){var i=yC(t.ecModel,t.name,r,e.getSeriesCount()),a=n.getVisual(`decal`);n.setVisual(`decal`,u(a,i))}else{var o=t.getRawData(),s={},c=IU(t).scope;n.each(function(e){var t=n.getRawIndex(e);s[t]=e});var l=o.count();o.each(function(e){var r=s[e],i=o.getName(e)||e+``,a=yC(t.ecModel,i,c,l),d=n.getItemVisual(r,`decal`);n.setItemVisual(r,`decal`,u(d,a))})}function u(e,t){var n=e?H(H({},t),e):t;return n.dirty=!0,n}})}}function o(){var r=t.getZr().dom;if(r){var i=e.getLocaleModel().get(`aria`),a=n.getModel(`label`);if(a.option=eo(a.option,i),a.get(`enabled`)){if(r.setAttribute(`role`,`img`),a.get(`description`)){r.setAttribute(`aria-label`,a.get(`description`));return}var o=e.getSeriesCount(),u=a.get([`data`,`maxCount`])||10,d=a.get([`series`,`maxCount`])||10,f=Math.min(o,d),p;if(!(o<1)){var m=c();p=m?s(a.get([`general`,`withTitle`]),{title:m}):a.get([`general`,`withoutTitle`]);var h=[],g=o>1?a.get([`series`,`multiple`,`prefix`]):a.get([`series`,`single`,`prefix`]);p+=s(g,{seriesCount:o}),e.eachSeries(function(e,t){if(t1?a.get([`series`,`multiple`,r]):a.get([`series`,`single`,r]),n=s(n,{seriesId:e.seriesIndex,seriesName:e.get(`name`),seriesType:l(e.subType)});var i=e.getData();if(i.count()>u){var c=a.get([`data`,`partialData`]);n+=s(c,{displayCnt:u})}else n+=a.get([`data`,`allData`]);for(var d=a.get([`data`,`separator`,`middle`]),p=a.get([`data`,`separator`,`end`]),m=a.get([`data`,`excludeDimensionId`]),g=[],_=0;_=GU:-c>=GU),f=c>0?c%GU:c%GU+GU,p=!1;p=d?!0:!ou(u)&&f>=WU==!!l;var m=e+n*UU(a),h=t+r*HU(a);this._start&&this._add(`M`,m,h);var g=Math.round(i*KU);if(d){var _=1/this._p,v=(l?1:-1)*(GU-_);this._add(`A`,n,r,g,1,+l,e+n*UU(a+v),t+r*HU(a+v)),_>.01&&this._add(`A`,n,r,g,0,+l,m,h)}else{var y=e+n*UU(o),b=t+r*HU(o);this._add(`A`,n,r,g,+p,+l,y,b)}},e.prototype.rect=function(e,t,n,r){this._add(`M`,e,t),this._add(`l`,n,0),this._add(`l`,0,r),this._add(`l`,-n,0),this._add(`Z`)},e.prototype.closePath=function(){this._d.length>0&&this._add(`Z`)},e.prototype._add=function(e,t,n,r,i,a,o,s,c){for(var l=[],u=this._p,d=1;d`}function lW(e){return``}function uW(e,t){t||={};var n=t.newline?` `:``;function r(e){var t=e.children,i=e.tag,a=e.attrs,o=e.text;return cW(i,a)+(i===`style`?o||``:Ux(o))+(t?``+n+W(t,function(e){return r(e)}).join(n)+n:``)+lW(i)}return r(e)}function dW(e,t,n){n||={};var r=n.newline?` -`:``,i=` {`+r,a=r+`}`,o=W(co(e),function(t){return t+i+W(co(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=W(co(t),function(e){return`@keyframes `+e+i+W(co(t[e]),function(n){return n+i+W(co(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[``].join(r)}function fW(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function pW(e,t,n,r){return sW(`svg`,`root`,{width:e,height:t,xmlns:tW,"xmlns:xlink":nW,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}var mW=0;function hW(){return mW++}var gW={cubicIn:`0.32,0,0.67,0`,cubicOut:`0.33,1,0.68,1`,cubicInOut:`0.65,0,0.35,1`,quadraticIn:`0.11,0,0.5,0`,quadraticOut:`0.5,1,0.89,1`,quadraticInOut:`0.45,0,0.55,1`,quarticIn:`0.5,0,0.75,0`,quarticOut:`0.25,1,0.5,1`,quarticInOut:`0.76,0,0.24,1`,quinticIn:`0.64,0,0.78,0`,quinticOut:`0.22,1,0.36,1`,quinticInOut:`0.83,0,0.17,1`,sinusoidalIn:`0.12,0,0.39,0`,sinusoidalOut:`0.61,1,0.88,1`,sinusoidalInOut:`0.37,0,0.63,1`,exponentialIn:`0.7,0,0.84,0`,exponentialOut:`0.16,1,0.3,1`,exponentialInOut:`0.87,0,0.13,1`,circularIn:`0.55,0,1,0.45`,circularOut:`0,0.55,0.45,1`,circularInOut:`0.85,0,0.15,1`},_W=`transform-origin`;function vW(e,t,n){var r=H({},e.shape);H(r,t),e.buildPath(n,r);var i=new qU;return i.reset(xu(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function yW(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[_W]=n+`px `+r+`px`)}var bW={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`};function xW(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function SW(e,t,n){var r=e.shape.paths,i={},a,o;if(U(r,function(e){var t=fW(n.zrId);t.animation=!0,wW(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=co(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=xW(i,n);return a.replace(o,s)}}function CW(e){return q(e)?gW[e]?`cubic-bezier(`+gW[e]+`)`:Al(e)?e:``:``}function wW(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof j_){var s=SW(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l0}).length)return xW(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+hW();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function TW(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};EW(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=nu(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),EW(r,t,n,!0)}}}function EW(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+hW(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}var DW=Math.round;function OW(e){return e&&q(e.src)}function kW(e){return e&&K(e.toDataURL)}function AW(e,t,n,r){eW(function(i,a){var o=i===`fill`||i===`stroke`;o&&yu(a)?GW(t,e,i,r):o&&gu(a)?KW(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),WW(n,e,r)}function jW(e,t){var n=aM(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[aW+`silent`]=`true`))}function MW(e){return ou(e[0]-1)&&ou(e[1])&&ou(e[2])&&ou(e[3]-1)}function NW(e){return ou(e[4])&&ou(e[5])}function PW(e,t,n){if(t&&!(NW(t)&&MW(t))){var r=n?10:1e4;e.transform=MW(t)?`translate(`+DW(t[4]*r)/r+` `+DW(t[5]*r)/r+`)`:lu(t)}}function FW(e,t,n){for(var r=e.points,i=[],a=0;a`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;wo(f,g),wo(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=ls(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=sW(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=V(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=Su(i);x&&(o.patternTransform=x);var S=sW(`pattern`,``,o,[d]),C=uW(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=sW(`pattern`,T,o,[d])),t[n]=bu(T)}}function qW(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=sW(`clipPath`,a,o,[BW(e,n)])}t[`clip-path`]=bu(a)}function JW(e){return document.createTextNode(e)}function YW(e,t,n){e.insertBefore(t,n)}function XW(e,t){e.removeChild(t)}function ZW(e,t){e.appendChild(t)}function QW(e){return e.parentNode}function $W(e){return e.nextSibling}function eG(e,t){e.textContent=t}var tG=58,nG=120,rG=sW(``,``);function iG(e){return e===void 0}function aG(e){return e!==void 0}function oG(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function sG(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function cG(e){var t,n=e.children,r=e.tag;if(aG(r)){var i=e.elm=oW(r);if(dG(rG,e),G(n))for(t=0;ta?(m=n[c+1]==null?null:n[c+1].elm,lG(e,m,n,i,c)):uG(e,t,r,a))}function pG(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(dG(e,t),iG(t.text)?aG(r)&&aG(i)?r!==i&&fG(n,r,i):aG(i)?(aG(e.text)&&eG(n,``),lG(n,null,i,0,i.length-1)):aG(r)?uG(n,r,0,r.length-1):aG(e.text)&&eG(n,``):e.text!==t.text&&(aG(r)&&uG(n,r,0,r.length-1),eG(n,t.text)))}function mG(e,t){if(sG(e,t))pG(e,t);else{var n=e.elm,r=QW(n);cG(t),r!==null&&(YW(r,t.elm,$W(n)),uG(r,[e],0,0))}return t}var hG=0,gG=function(){function e(e,t,n){if(this.type=`svg`,this.configLayer=_G(`configLayer`),this.storage=t,this._opts=n=H({},n),this.root=e,this._id=`zr`+hG++,this._oldVNode=pW(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=oW(`svg`);dG(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,mG(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return UW(e,fW(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=fW(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=vG(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=sW(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=W(co(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(sW(`defs`,`defs`,{},c)),e.animation){var l=dW(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=sW(`style`,`stl`,{},[],l);a.push(u)}}return pW(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},uW(this.renderToVNode({animation:Y(e.cssAnimation,!0),emphasis:Y(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Y(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g{if(!a.current)return;let e=aI(a.current,void 0,{renderer:`svg`});o.current=e,e.on(`click`,e=>s.current?.(e));let t=new ResizeObserver(()=>e.resize());return t.observe(a.current),()=>{t.disconnect(),e.dispose(),o.current=null}},[]),(0,R.useEffect)(()=>{o.current?.setOption({animationDuration:280,aria:{enabled:!0,decal:{show:!0},description:n},...e},{notMerge:!0})},[n,e]),(0,z.jsx)(`div`,{ref:a,className:i?`echart ${i}`:`echart`,style:{height:t,width:`100%`,minWidth:0},role:`img`,"aria-label":n})}function xG(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:`bad`}function SG(e){return Ve[e?`dark`:`light`]}function CG(e){let t=e?5:7;return{ok:Ie[t],warn:He[t],bad:We[t],info:Ue[t]}}function wG(e,t){let n=Ae[t?`dark`:`light`],r=0;for(let t of e)r=r*31+t.charCodeAt(0)|0;return n[Math.abs(r)%n.length]}function TG(e){let t=String(e).toUpperCase();return t===`ERROR`||t===`FATAL`?`bad`:t===`WARN`||t===`WARNING`?`warn`:t===`INFO`?`info`:`gray`}function EG(e,t){let n=CG(t),r=String(e).toUpperCase();return r===`ERROR`||r===`FATAL`?n.bad:r===`WARN`||r===`WARNING`?n.warn:r===`INFO`?n.info:SG(t).muted}function DG({label:e,value:t,color:n,hint:r,children:i}){return(0,z.jsxs)(le,{withBorder:!0,radius:`md`,p:`sm`,bg:`var(--mantine-color-default)`,miw:0,h:`100%`,children:[(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e}),(0,z.jsx)(_,{fw:600,fz:`xl`,c:n,mt:2,lh:1.2,truncate:!0,children:t}),r&&(0,z.jsx)(_,{c:`dimmed`,size:`xs`,mt:2,truncate:!0,children:r}),i&&(0,z.jsx)(se,{mt:4,children:i})]})}function OG({health:e,label:t}){return(0,z.jsx)(ye,{color:xG(e),variant:`light`,tt:`none`,style:{minWidth:`max-content`},children:t})}function kG({text:e}){return(0,z.jsxs)(D,{py:`xl`,children:[(0,z.jsx)(Dn,{size:20}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`xs`,children:e})]})}function AG({retry:e}){return(0,z.jsxs)(D,{py:`xl`,style:{flexDirection:`column`,gap:8},children:[(0,z.jsxs)(se,{display:`flex`,style:{alignItems:`center`,gap:8},children:[(0,z.jsx)(jn,{size:20,weight:`fill`,color:`var(--mantine-color-bad-filled)`}),(0,z.jsx)(_,{c:`bad`,fw:500,size:`sm`,children:`Couldn't load this view`})]}),(0,z.jsx)(re,{size:`compact-xs`,variant:`light`,color:`bad`,onClick:e,children:`Retry now`}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:`Retrying automatically`})]})}TI([iD]);function jG({values:e,color:t,label:n}){let r=(0,R.useMemo)(()=>({animation:!1,grid:{left:0,right:0,top:2,bottom:2},xAxis:{type:`category`,show:!1,data:e.map((e,t)=>t)},yAxis:{type:`value`,show:!1,min:0},tooltip:{show:!1},series:[{type:`line`,data:e,showSymbol:!1,smooth:.3,lineStyle:{width:1.5,color:t},areaStyle:{opacity:.12,color:t}}]}),[e,t]);return(0,z.jsx)(bG,{option:r,height:28,label:n})}var MG={unhealthy:0,degraded:1,healthy:2};function NG({widget:e,filters:t}){let n=Sa(`overview`,ya(t,e.config,[`service`]));if(n.isError)return(0,z.jsx)(AG,{retry:()=>void n.refetch()});let r=[...n.data?.data.services??[]].sort((e,t)=>(MG[e.health]??3)-(MG[t.health]??3)||t.error_rate-e.error_rate);return n.data&&r.length===0?(0,z.jsx)(kG,{text:`No recent activity`}):(0,z.jsx)(_e,{type:`auto`,offsetScrollbars:!0,h:`100%`,children:(0,z.jsxs)(F,{verticalSpacing:`xs`,fz:`sm`,highlightOnHover:!0,children:[(0,z.jsx)(F.Thead,{children:(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Th,{children:`Service`}),(0,z.jsx)(F.Th,{ta:`right`,children:`P95`}),(0,z.jsx)(F.Th,{ta:`right`,children:`Errors`})]})}),(0,z.jsx)(F.Tbody,{children:r.map(e=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Td,{children:(0,z.jsx)(OG,{health:e.health,label:e.service})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:Da(e.p95_ms)})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,c:e.error_rate>=.01?`bad`:`dimmed`,children:Ea(e.error_rate)})})]},e.service))})]})})}function PG({filters:e,agentAvailable:t,onOpenChat:n}){if(!t)return(0,z.jsx)(_,{c:`dimmed`,size:`sm`,children:`Configure an AI provider to enable this view. The rest of this dashboard remains available.`});let r=_a(e.window),i=[`Summarize the last ${r}`,`What changed in the last ${r}?`,`Which service needs attention right now?`];return(0,z.jsx)(N,{gap:`xs`,align:`flex-start`,children:i.map(e=>(0,z.jsx)(re,{variant:`default`,size:`xs`,radius:`xl`,leftSection:(0,z.jsx)(Pe,{size:13,weight:`fill`}),onClick:()=>n(e),children:e},e))})}var FG={overview:[`service`],topology:[`service`],performance:[`service`],logs:[`service`,`severity`,`search`],trace:[`trace_id`]};function IG(e){return Object.hasOwn(FG,e)?FG[e]:void 0}function LG(e){return(IG(e)?.length??0)>0}function RG({opened:e,widget:t,services:n,onClose:r,onSave:i}){let[a,o]=(0,R.useState)({service:``,severity:``,search:``,trace_id:``});(0,R.useEffect)(()=>{e&&o({service:va(t.config,`service`),severity:va(t.config,`severity`),search:va(t.config,`search`),trace_id:va(t.config,`trace_id`)})},[e,t.config]);let s=IG(t.type)??[],c=[...new Set([...n,a.service].filter(Boolean))];function l(){let e={...t.config??{}};for(let t of s){let n=a[t].trim();n?e[t]=n:delete e[t]}i(e),r()}return(0,z.jsx)(L,{opened:e,onClose:r,title:`Configure ${t.title}`,centered:!0,children:(0,z.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),l()},children:(0,z.jsxs)(N,{children:[s.includes(`service`)&&(0,z.jsx)(an,{label:`Service`,placeholder:`All services`,data:c,value:a.service||null,onChange:e=>o({...a,service:e??``}),clearable:!0,searchable:!0,"aria-label":`Service`}),s.includes(`severity`)&&(0,z.jsx)(an,{label:`Severity`,placeholder:`All severities`,data:[`ERROR`,`WARN`,`INFO`,`DEBUG`],value:a.severity||null,onChange:e=>o({...a,severity:e??``}),clearable:!0,"aria-label":`Severity`}),s.includes(`search`)&&(0,z.jsx)(xe,{label:`Search`,placeholder:`Text the log body must contain`,value:a.search,onChange:e=>o({...a,search:e.currentTarget.value}),"aria-label":`Search`}),s.includes(`trace_id`)&&(0,z.jsx)(xe,{label:`Trace id`,placeholder:`Leave empty for the most relevant recent trace`,value:a.trace_id,onChange:e=>o({...a,trace_id:e.currentTarget.value}),ff:`monospace`,"aria-label":`Trace id`}),(0,z.jsxs)(x,{justify:`flex-end`,children:[(0,z.jsx)(re,{variant:`default`,onClick:r,children:`Cancel`}),(0,z.jsx)(re,{type:`submit`,children:`Save`})]})]})})})}TI([IA]);function zG({widget:e,filters:t,dark:n}){let r=Sa(`logs`,ya(t,e.config,[`service`,`severity`,`search`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.buckets.length===0)return null;let e=SG(n),t=i.provenance.window,r=[...new Set(i.data.buckets.map(e=>e.time))],a=[...new Set(i.data.buckets.map(e=>e.severity))],o=new Map(i.data.buckets.map(e=>[`${e.time} ${e.severity}`,e.count]));return{color:a.map(e=>EG(e,n)),grid:{left:28,right:8,top:8,bottom:20},tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:r.map(e=>Oa(e,t)),axisLabel:{color:e.muted,fontSize:8,hideOverlap:!0},axisLine:{lineStyle:{color:e.border}}},yAxis:{type:`value`,minInterval:1,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:8}},series:a.map(e=>({name:e,type:`bar`,stack:`logs`,barMaxWidth:14,data:r.map(t=>o.get(`${t} ${e}`)??0),itemStyle:{borderRadius:[2,2,0,0]}}))}},[n,i]);if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});let o=(i?.data.entries??[]).slice(0,5);return i&&o.length===0?(0,z.jsx)(kG,{text:`No matching logs in this window`}):(0,z.jsxs)(N,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(se,{h:72,children:(0,z.jsx)(bG,{option:a,height:72,label:`Log volume by severity`})}),(0,z.jsx)(_e,{type:`auto`,offsetScrollbars:!0,style:{flex:1},children:(0,z.jsx)(F,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(F.Tbody,{children:o.map((e,t)=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`xs`,ff:`monospace`,c:`dimmed`,children:i?Oa(e.time,i.provenance.window,!0):e.time})}),(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(ye,{size:`xs`,color:TG(e.severity),variant:`light`,style:{minWidth:`max-content`},children:e.severity||`LOG`})}),(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`sm`,fw:600,children:e.service})}),(0,z.jsx)(F.Td,{style:{width:`100%`},children:(0,z.jsx)(_,{size:`sm`,lineClamp:1,title:e.body,children:e.body})})]},`${e.time}-${t}`))})})})]})}function BG({widget:e,filters:t,dark:n}){let r=ya(t,e.config,[`service`]),i=Sa(`overview`,r),a=Sa(`performance`,r);if(i.isError)return(0,z.jsx)(AG,{retry:()=>void i.refetch()});let o=i.data?.data,s=(a.data?.data.points??[]).map(e=>e.error_rate*100),c=Math.max(o?.service_count??0,1),l=CG(n),u=o?o.health.charAt(0).toUpperCase()+o.health.slice(1):`—`;return(0,z.jsxs)(N,{gap:`sm`,children:[(0,z.jsxs)(mn,{cols:2,spacing:`sm`,children:[(0,z.jsx)(DG,{label:`Health`,value:u,color:o?xG(o.health):void 0,hint:o?`${Ta.format(o.service_count)} services`:void 0}),(0,z.jsx)(DG,{label:`Error rate`,value:o?Ea(o.error_rate):`—`,color:o&&o.error_rate>=.01?`bad`:void 0,hint:o?`${Ta.format(o.total_spans)} operations`:void 0,children:s.length>1&&(0,z.jsx)(jG,{values:s,color:l.bad,label:`Error rate trend`})})]}),o&&(0,z.jsxs)(se,{children:[(0,z.jsxs)(nn.Root,{size:`md`,"aria-label":`Service health distribution`,children:[(0,z.jsx)(nn.Section,{value:o.counts.healthy/c*100,color:`ok`}),(0,z.jsx)(nn.Section,{value:o.counts.degraded/c*100,color:`warn`}),(0,z.jsx)(nn.Section,{value:o.counts.unhealthy/c*100,color:`bad`})]}),(0,z.jsxs)(x,{mt:6,gap:`md`,children:[(0,z.jsx)(VG,{color:`ok`,text:`${o.counts.healthy} healthy`}),(0,z.jsx)(VG,{color:`warn`,text:`${o.counts.degraded} degraded`}),(0,z.jsx)(VG,{color:`bad`,text:`${o.counts.unhealthy} unhealthy`})]})]})]})}function VG({color:e,text:t}){return(0,z.jsxs)(x,{gap:6,children:[(0,z.jsx)(se,{w:8,h:8,bg:e,style:{borderRadius:`50%`}}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:t})]})}TI([iD]);function HG({widget:e,filters:t,dark:n}){let r=Sa(`performance`,ya(t,e.config,[`service`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.points.length===0)return null;let e=SG(n),t=i.provenance.window;return{color:[wG(`operations`,n),CG(n).warn],grid:{left:36,right:40,top:24,bottom:22},legend:{top:0,left:0,textStyle:{color:e.muted,fontSize:10},icon:`circle`,itemWidth:7,itemHeight:7},tooltip:{trigger:`axis`,backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:i.data.points.map(e=>Oa(e.time,t)),boundaryGap:!1,axisLine:{lineStyle:{color:e.border}},axisTick:{show:!1},axisLabel:{color:e.muted,fontSize:9,hideOverlap:!0}},yAxis:[{type:`value`,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:9}},{type:`value`,splitLine:{show:!1},axisLabel:{color:e.muted,fontSize:9,formatter:e=>Da(e)}}],series:[{name:`Operations`,type:`line`,data:i.data.points.map(e=>e.spans),smooth:.22,showSymbol:!1,lineStyle:{width:2},areaStyle:{opacity:.05}},{name:`P95`,type:`line`,yAxisIndex:1,data:i.data.points.map(e=>e.p95_ms),smooth:.22,showSymbol:!1,lineStyle:{width:2}}]}},[n,i]);if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});if(i&&i.data.points.length===0)return(0,z.jsx)(kG,{text:`No endpoint activity in this window`});let o=(i?.data.endpoints??[]).slice(0,3);return(0,z.jsxs)(N,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(se,{style:{flex:1,minHeight:120},children:(0,z.jsx)(bG,{option:a,height:`100%`,label:`Operations and P95 latency`})}),o.length>0&&(0,z.jsx)(F,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(F.Tbody,{children:o.map(e=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsxs)(F.Td,{children:[(0,z.jsx)(ye,{variant:`light`,size:`xs`,mr:6,style:{minWidth:`max-content`},children:e.method}),(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:e.path})]}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsxs)(_,{component:`span`,size:`sm`,c:`dimmed`,children:[Ta.format(e.calls),` calls`]})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:Da(e.p95_ms)})})]},`${e.method}-${e.path}`))})})]})}TI([LB]);function UG({widget:e,filters:t,dark:n,onOpenChat:r}){let i=Sa(`topology`,ya(t,e.config,[`service`])),a=i.data?.data,o=(0,R.useMemo)(()=>{if(!a)return null;let e=SG(n),t=CG(n),r=e=>e===`unhealthy`?t.bad:e===`degraded`?t.warn:t.ok,i=[...a.nodes].sort((e,t)=>e.service.localeCompare(t.service));return{tooltip:{backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},series:[{type:`graph`,layout:`circular`,circular:{rotateLabel:!1},roam:!1,draggable:!1,label:{show:!0,position:`bottom`,color:e.text,fontSize:10},edgeSymbol:[`none`,`arrow`],edgeSymbolSize:6,data:i.map(t=>({id:t.service,name:t.service,value:t.spans,symbolSize:Math.min(34,18+Math.log10(Math.max(t.spans,1))*4),itemStyle:{color:e.surface,borderColor:r(t.health),borderWidth:3}})),links:a.edges.map(n=>({source:n.caller,target:n.callee,value:n.calls,lineStyle:{width:Math.min(4,1+Math.log10(Math.max(n.calls,1))),color:n.error_rate>=.05?t.bad:e.muted,opacity:.5,curveness:.08}})),emphasis:{focus:`adjacency`}}]}},[n,a]);return i.isError?(0,z.jsx)(AG,{retry:()=>void i.refetch()}):a&&a.nodes.length===0?(0,z.jsx)(kG,{text:`No service relationships in this window`}):(0,z.jsxs)(N,{gap:4,h:`100%`,children:[o&&(0,z.jsx)(bG,{option:o,height:`100%`,className:`widget-chart`,label:`Service dependency graph`,onClick:e=>{let t=e;t.dataType===`node`&&t.data?.id&&r(`Investigate the ${t.data.id} service. Explain its errors and latency.`)}}),a&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[a.nodes.length,` services · `,a.edges.length,` `,a.edges.length===1?`route`:`routes`]})]})}function WG(e){return e.length>12?`${e.slice(0,8)}…${e.slice(-4)}`:e}function GG({widget:e,filters:t,dark:n}){let r=Sa(`trace`,ya(t,e.config,[`trace_id`]));if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});let i=r.data?.data;if(i&&i.spans.length===0)return(0,z.jsx)(kG,{text:`No traces in this window`});let a=[...i?.spans??[]].sort((e,t)=>t.duration_ms-e.duration_ms).slice(0,6);return(0,z.jsxs)(N,{gap:`sm`,children:[(0,z.jsxs)(mn,{cols:{base:2,sm:4},spacing:`sm`,children:[(0,z.jsx)(DG,{label:`Duration`,value:i?Da(i.duration_ms):`—`}),(0,z.jsx)(DG,{label:`Spans`,value:i?Ta.format(i.spans.length):`—`}),(0,z.jsx)(DG,{label:`Services`,value:i?Ta.format(i.services.length):`—`}),(0,z.jsx)(DG,{label:`Status`,value:i?i.has_error?`Error`:`OK`:`—`,color:i?i.has_error?`bad`:`ok`:void 0})]}),a.length>0&&(0,z.jsx)(KG,{spans:a,dark:n}),i&&(0,z.jsxs)(x,{gap:4,children:[(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,ff:`monospace`,children:[`Trace `,WG(i.trace_id)]}),(0,z.jsx)(qG,{value:i.trace_id})]})]})}function KG({spans:e,dark:t}){let n=Math.min(...e.map(e=>new Date(e.start).valueOf())),r=Math.max(...e.map(e=>new Date(e.start).valueOf()+e.duration_ms)),i=Math.max(r-n,1);return(0,z.jsx)(N,{gap:4,children:e.map(e=>{let r=(new Date(e.start).valueOf()-n)/i*100,a=Math.max(e.duration_ms/i*100,.6),o=e.status.toUpperCase().includes(`ERROR`);return(0,z.jsxs)(x,{gap:`sm`,wrap:`nowrap`,children:[(0,z.jsxs)(se,{w:170,miw:0,children:[(0,z.jsx)(_,{size:`xs`,fw:600,truncate:!0,children:e.operation}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e.service})]}),(0,z.jsx)(Re,{label:`${e.service} · ${e.operation} · ${Da(e.duration_ms)}`,withArrow:!0,children:(0,z.jsx)(se,{pos:`relative`,h:10,flex:1,bg:`var(--mantine-color-default-hover)`,style:{borderRadius:`var(--mantine-radius-sm)`},children:(0,z.jsx)(se,{pos:`absolute`,left:`${r}%`,w:`${Math.min(a,100-r)}%`,h:`100%`,bg:o?`bad`:wG(e.service,t),style:{borderRadius:`var(--mantine-radius-sm)`,minWidth:3}})})}),(0,z.jsx)(_,{size:`xs`,ff:`monospace`,w:56,ta:`right`,children:Da(e.duration_ms)})]},e.span_id)})})}function qG({value:e}){let{state:t,copy:n}=I();return(0,z.jsx)(Re,{label:t===`failed`?`Could not copy`:t===`copied`?`Copied`:`Copy trace id`,children:(0,z.jsx)(Se,{variant:`subtle`,color:`gray`,size:`xs`,"aria-label":`Copy trace id`,"data-state":t===`idle`?void 0:t,onClick:()=>n(e),children:t===`copied`?(0,z.jsx)(C,{size:12,weight:`bold`}):(0,z.jsx)(te,{size:12})})})}var JG={overview:`System health`,topology:`Service map`,activity:`Recent activity`,assistant:`Ask Fanout`,performance:`Performance`,trace:`Trace focus`,logs:`Logs`},YG={overview:BG,topology:UG,activity:NG,assistant:PG,performance:HG,trace:GG,logs:zG};function XG(){return(0,z.jsx)(kG,{text:`This view type is not supported by this version`})}function ZG(e){return Object.hasOwn(YG,e)?YG[e]:XG}function QG(e){let{widget:t,services:n,onRemove:r,onConfigure:i}=e,[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),l=ZG(t.type);return(0,z.jsxs)(le,{withBorder:!0,radius:`lg`,p:`md`,h:`100%`,className:`widget-card`,style:{overflow:`hidden`},children:[(0,z.jsxs)(N,{h:`100%`,gap:`sm`,children:[(0,z.jsxs)(x,{justify:`space-between`,align:`center`,wrap:`nowrap`,className:`widget-drag`,style:{cursor:`grab`},children:[(0,z.jsx)(A,{order:2,fz:`md`,fw:500,lineClamp:1,miw:0,children:t.title}),(0,z.jsxs)(Le,{position:`bottom-end`,withinPortal:!0,opened:a,onChange:o,children:[(0,z.jsx)(Le.Target,{children:(0,z.jsx)(Se,{className:`widget-actions`,"data-open":a||void 0,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Actions for ${t.title}`,children:(0,z.jsx)(Ge,{size:18,weight:`bold`})})}),(0,z.jsxs)(Le.Dropdown,{children:[LG(t.type)&&(0,z.jsx)(Le.Item,{leftSection:(0,z.jsx)(kn,{size:15}),onClick:()=>c(!0),children:`Configure`}),(0,z.jsx)(Le.Item,{color:`bad`,leftSection:(0,z.jsx)(Fe,{size:15}),onClick:r,children:`Remove`})]})]})]}),(0,z.jsx)(`div`,{className:`widget-body`,children:(0,z.jsx)(l,{...e})})]}),(0,z.jsx)(RG,{opened:s,widget:t,services:n,onClose:()=>c(!1),onSave:i})]})}var $G=la(sa),eK=`fanout.dashboard-id`,tK={layout:[],widgets:[],filters:{window:`1h`,namespace:``}};function nK(e){return Object.hasOwn(pa,e)?pa[e]:void 0}function rK({dashboardID:e=``,agentAvailable:t,onOpenChat:n,onDashboardChange:r}){let i=fe(),a=ve(`light`)===`dark`,o=Je({queryKey:Me,queryFn:()=>Ne(`/api/dashboards`),refetchInterval:3e4}),[s,c]=(0,R.useState)(()=>e||localStorage.getItem(eK)||``),l=gn({mutationFn:async e=>{if(!u.data)throw Error(`No dashboard selected`);let t=await Be(`/api/dashboards/${encodeURIComponent(u.data.id)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:u.data.name,description:u.data.description,state:e})});if(!t.ok)throw Error(`Unable to save dashboard`);return t.json()},scope:{id:`dashboard-${s}`},onSuccess:e=>{i.setQueryData([`dashboard`,e.id],e),i.invalidateQueries({queryKey:Me})},onError:e=>console.error(`Dashboard save failed`,e)}),u=Je({queryKey:[`dashboard`,s],queryFn:()=>Ne(`/api/dashboards/${encodeURIComponent(s)}`),enabled:!!s,refetchInterval:l.isPending||l.isError?!1:3e4}),[d,f]=(0,R.useState)(tK),[p,m]=(0,R.useState)(`lg`),h=Sa(`overview`,ya(d.filters),!!u.data),g=(0,R.useMemo)(()=>(h.data?.data.services??[]).map(e=>e.service),[h.data]),y=wa();(0,R.useEffect)(()=>{e&&e!==s&&(c(e),localStorage.setItem(eK,e))},[e,s]),(0,R.useEffect)(()=>{let t=o.data?.dashboards;if(t?.length&&!(e&&t.some(t=>t.id===e))){if(!e&&s&&t.some(e=>e.id===s)){r?.(s,!0);return}S((t.find(e=>e.is_default)??t[0]).id,!0)}},[e,o.data,s]),(0,R.useEffect)(()=>{l.isPending||l.isError||u.data?.state&&f(u.data.state)},[u.data?.updated_at,l.isPending,l.isError]),(0,R.useEffect)(()=>{l.reset()},[s]);let b=(0,R.useMemo)(()=>{let e=new Map(d.widgets.map(e=>[e.id,e.type])),t=d.layout.map(t=>{let n=nK(e.get(t.i)??`overview`)??pa.overview;return{...t,h:Math.max(t.h,n.minH),minW:Math.max(t.minW??0,n.minW),minH:Math.max(t.minH??0,n.minH)}});return{lg:t,md:t,sm:da(t,6),xs:da(t,2),xxs:da(t,1)}},[d.layout,d.widgets]);function S(e,t=!1){c(e),localStorage.setItem(eK,e),r?.(e,t)}function C(e){f(e),l.mutate(e)}function w(e){let t=ze(),n=pa[e],r=ha(d.layout,n.w,n.h,12,n.minW);C({...d,widgets:[...d.widgets,{id:t,type:e,title:JG[e],enabled:!0}],layout:[...d.layout,{i:t,x:r.x,y:r.y,w:r.w,h:n.h,minW:n.minW,minH:n.minH}]})}function T(e){C({...d,widgets:d.widgets.filter(t=>t.id!==e),layout:d.layout.filter(t=>t.i!==e)})}function E(e,t){C({...d,widgets:d.widgets.map(n=>n.id===e?{...n,config:t}:n)})}if(o.isLoading||s&&u.isLoading)return(0,z.jsx)(iK,{label:`Loading your dashboard…`});if(o.isError||u.isError)return(0,z.jsx)(iK,{label:`Your dashboard is unavailable. Try refreshing.`});let D=u.data;return D?(0,z.jsxs)(se,{component:`main`,maw:1440,mx:`auto`,px:{base:`md`,sm:`xl`},pt:{base:`lg`,sm:`xl`},pb:`xl`,children:[(0,z.jsxs)(N,{gap:`md`,mb:`lg`,children:[(0,z.jsxs)(se,{children:[(0,z.jsx)(A,{order:1,fz:32,lts:`-0.03em`,children:D.name}),(0,z.jsx)(_,{c:`dimmed`,mt:2,children:D.description||`A focused view of the signals that matter now.`})]}),(0,z.jsxs)(it,{align:{base:`stretch`,md:`center`},justify:`space-between`,direction:{base:`column`,md:`row`},gap:`sm`,role:`group`,"aria-label":`Dashboard controls`,children:[(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,children:[(0,z.jsx)(an,{"aria-label":`Window`,value:d.filters.window,onChange:e=>e&&C({...d,filters:{...d.filters,window:e}}),data:ga,w:{base:`100%`,xs:150},size:`sm`}),(0,z.jsx)(xe,{"aria-label":`Namespace`,value:d.filters.namespace,onChange:e=>f({...d,filters:{...d.filters,namespace:e.currentTarget.value}}),onBlur:e=>C({...d,filters:{...d.filters,namespace:e.currentTarget.value}}),placeholder:`All namespaces`,w:{base:`100%`,xs:200},size:`sm`})]}),(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,justify:`flex-end`,children:[y&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[`Updated `,new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(y))]}),(0,z.jsxs)(Le,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,z.jsx)(Le.Target,{children:(0,z.jsx)(re,{variant:`default`,size:`sm`,leftSection:(0,z.jsx)(ke,{size:15,weight:`bold`}),rightSection:(0,z.jsx)(Tn,{size:13,weight:`bold`}),children:`Add view`})}),(0,z.jsx)(Le.Dropdown,{children:fa.filter(e=>t||e!==`assistant`).map(e=>(0,z.jsx)(Le.Item,{onClick:()=>w(e),children:JG[e]},e))})]}),t&&(0,z.jsx)(re,{variant:`subtle`,color:`gray`,size:`sm`,rightSection:(0,z.jsx)(Cn,{size:15,weight:`bold`}),onClick:()=>n(),children:`Ask Fanout`})]})]})]}),l.isError&&(0,z.jsx)(v,{color:`bad`,radius:`lg`,mb:`lg`,icon:(0,z.jsx)(jn,{size:18,weight:`fill`}),title:`Dashboard changes not saved`,children:(0,z.jsxs)(x,{justify:`space-between`,gap:`sm`,children:[(0,z.jsx)(_,{size:`sm`,children:`Your latest edits are kept on this screen but Fanout could not store them.`}),(0,z.jsx)(re,{size:`compact-sm`,color:`bad`,variant:`light`,onClick:()=>l.mutate(d),children:`Retry save`})]})}),(0,z.jsx)($G,{className:`dashboard-grid`,layouts:b,breakpoints:{lg:1100,md:800,sm:600,xs:420,xxs:0},cols:{lg:12,md:10,sm:6,xs:2,xxs:1},rowHeight:76,margin:[16,16],containerPadding:[0,0],compactType:`vertical`,draggableHandle:`.widget-drag`,draggableCancel:`button,input,select,textarea,a,label,[role=menu],[role=dialog],.widget-actions`,onBreakpointChange:m,onDragStop:e=>{p===`lg`&&C({...d,layout:[...e]})},onResizeStop:e=>{p===`lg`&&C({...d,layout:[...e]})},children:d.widgets.map(e=>(0,z.jsx)(`div`,{children:(0,z.jsx)(QG,{widget:e,filters:d.filters,dark:a,services:g,agentAvailable:t,onOpenChat:n,onRemove:()=>T(e.id),onConfigure:t=>E(e.id,t)})},e.id))})]}):(0,z.jsx)(iK,{label:`Preparing your dashboard…`})}function iK({label:e}){return(0,z.jsxs)(D,{mih:`50vh`,children:[(0,z.jsx)(m,{size:`sm`}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`sm`,children:e})]})}export{rK as t}; \ No newline at end of file +`:``,i=` {`+r,a=r+`}`,o=W(co(e),function(t){return t+i+W(co(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=W(co(t),function(e){return`@keyframes `+e+i+W(co(t[e]),function(n){return n+i+W(co(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[``].join(r)}function fW(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function pW(e,t,n,r){return sW(`svg`,`root`,{width:e,height:t,xmlns:tW,"xmlns:xlink":nW,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}var mW=0;function hW(){return mW++}var gW={cubicIn:`0.32,0,0.67,0`,cubicOut:`0.33,1,0.68,1`,cubicInOut:`0.65,0,0.35,1`,quadraticIn:`0.11,0,0.5,0`,quadraticOut:`0.5,1,0.89,1`,quadraticInOut:`0.45,0,0.55,1`,quarticIn:`0.5,0,0.75,0`,quarticOut:`0.25,1,0.5,1`,quarticInOut:`0.76,0,0.24,1`,quinticIn:`0.64,0,0.78,0`,quinticOut:`0.22,1,0.36,1`,quinticInOut:`0.83,0,0.17,1`,sinusoidalIn:`0.12,0,0.39,0`,sinusoidalOut:`0.61,1,0.88,1`,sinusoidalInOut:`0.37,0,0.63,1`,exponentialIn:`0.7,0,0.84,0`,exponentialOut:`0.16,1,0.3,1`,exponentialInOut:`0.87,0,0.13,1`,circularIn:`0.55,0,1,0.45`,circularOut:`0,0.55,0.45,1`,circularInOut:`0.85,0,0.15,1`},_W=`transform-origin`;function vW(e,t,n){var r=H({},e.shape);H(r,t),e.buildPath(n,r);var i=new qU;return i.reset(xu(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function yW(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[_W]=n+`px `+r+`px`)}var bW={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`};function xW(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function SW(e,t,n){var r=e.shape.paths,i={},a,o;if(U(r,function(e){var t=fW(n.zrId);t.animation=!0,wW(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=co(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=xW(i,n);return a.replace(o,s)}}function CW(e){return q(e)?gW[e]?`cubic-bezier(`+gW[e]+`)`:Al(e)?e:``:``}function wW(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof j_){var s=SW(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l0}).length)return xW(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+hW();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function TW(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};EW(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=nu(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),EW(r,t,n,!0)}}}function EW(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+hW(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}var DW=Math.round;function OW(e){return e&&q(e.src)}function kW(e){return e&&K(e.toDataURL)}function AW(e,t,n,r){eW(function(i,a){var o=i===`fill`||i===`stroke`;o&&yu(a)?GW(t,e,i,r):o&&gu(a)?KW(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),WW(n,e,r)}function jW(e,t){var n=aM(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[aW+`silent`]=`true`))}function MW(e){return ou(e[0]-1)&&ou(e[1])&&ou(e[2])&&ou(e[3]-1)}function NW(e){return ou(e[4])&&ou(e[5])}function PW(e,t,n){if(t&&!(NW(t)&&MW(t))){var r=n?10:1e4;e.transform=MW(t)?`translate(`+DW(t[4]*r)/r+` `+DW(t[5]*r)/r+`)`:lu(t)}}function FW(e,t,n){for(var r=e.points,i=[],a=0;a`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;wo(f,g),wo(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=ls(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=sW(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=V(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=Su(i);x&&(o.patternTransform=x);var S=sW(`pattern`,``,o,[d]),C=uW(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=sW(`pattern`,T,o,[d])),t[n]=bu(T)}}function qW(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=sW(`clipPath`,a,o,[BW(e,n)])}t[`clip-path`]=bu(a)}function JW(e){return document.createTextNode(e)}function YW(e,t,n){e.insertBefore(t,n)}function XW(e,t){e.removeChild(t)}function ZW(e,t){e.appendChild(t)}function QW(e){return e.parentNode}function $W(e){return e.nextSibling}function eG(e,t){e.textContent=t}var tG=58,nG=120,rG=sW(``,``);function iG(e){return e===void 0}function aG(e){return e!==void 0}function oG(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function sG(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function cG(e){var t,n=e.children,r=e.tag;if(aG(r)){var i=e.elm=oW(r);if(dG(rG,e),G(n))for(t=0;ta?(m=n[c+1]==null?null:n[c+1].elm,lG(e,m,n,i,c)):uG(e,t,r,a))}function pG(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(dG(e,t),iG(t.text)?aG(r)&&aG(i)?r!==i&&fG(n,r,i):aG(i)?(aG(e.text)&&eG(n,``),lG(n,null,i,0,i.length-1)):aG(r)?uG(n,r,0,r.length-1):aG(e.text)&&eG(n,``):e.text!==t.text&&(aG(r)&&uG(n,r,0,r.length-1),eG(n,t.text)))}function mG(e,t){if(sG(e,t))pG(e,t);else{var n=e.elm,r=QW(n);cG(t),r!==null&&(YW(r,t.elm,$W(n)),uG(r,[e],0,0))}return t}var hG=0,gG=function(){function e(e,t,n){if(this.type=`svg`,this.configLayer=_G(`configLayer`),this.storage=t,this._opts=n=H({},n),this.root=e,this._id=`zr`+hG++,this._oldVNode=pW(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=oW(`svg`);dG(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,mG(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return UW(e,fW(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=fW(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=vG(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=sW(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=W(co(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(sW(`defs`,`defs`,{},c)),e.animation){var l=dW(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=sW(`style`,`stl`,{},[],l);a.push(u)}}return pW(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},uW(this.renderToVNode({animation:Y(e.cssAnimation,!0),emphasis:Y(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Y(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g{if(!a.current)return;let e=aI(a.current,void 0,{renderer:`svg`});o.current=e,e.on(`click`,e=>s.current?.(e));let t=new ResizeObserver(()=>e.resize());return t.observe(a.current),()=>{t.disconnect(),e.dispose(),o.current=null}},[]),(0,R.useEffect)(()=>{o.current?.setOption({animationDuration:280,aria:{enabled:!0,decal:{show:!0},description:n},...e},{notMerge:!0})},[n,e]),(0,z.jsx)(`div`,{ref:a,className:i?`echart ${i}`:`echart`,style:{height:t,width:`100%`,minWidth:0},role:`img`,"aria-label":n})}function xG(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:e===`unknown`?`gray`:`bad`}function SG(e){return Ve[e?`dark`:`light`]}function CG(e){let t=e?5:7;return{ok:Ie[t],warn:He[t],bad:We[t],info:Ue[t]}}function wG(e,t){let n=Ae[t?`dark`:`light`],r=0;for(let t of e)r=r*31+t.charCodeAt(0)|0;return n[Math.abs(r)%n.length]}function TG(e){let t=String(e).toUpperCase();return t===`ERROR`||t===`FATAL`?`bad`:t===`WARN`||t===`WARNING`?`warn`:t===`INFO`?`info`:`gray`}function EG(e,t){let n=CG(t),r=String(e).toUpperCase();return r===`ERROR`||r===`FATAL`?n.bad:r===`WARN`||r===`WARNING`?n.warn:r===`INFO`?n.info:SG(t).muted}function DG({label:e,value:t,color:n,hint:r,children:i}){return(0,z.jsxs)(le,{withBorder:!0,radius:`md`,p:`sm`,bg:`var(--mantine-color-default)`,miw:0,h:`100%`,children:[(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e}),(0,z.jsx)(_,{fw:600,fz:`xl`,c:n,mt:2,lh:1.2,truncate:!0,children:t}),r&&(0,z.jsx)(_,{c:`dimmed`,size:`xs`,mt:2,truncate:!0,children:r}),i&&(0,z.jsx)(se,{mt:4,children:i})]})}function OG({health:e,label:t}){return(0,z.jsx)(ye,{color:xG(e),variant:`light`,tt:`none`,style:{minWidth:`max-content`},children:t})}function kG({text:e}){return(0,z.jsxs)(D,{py:`xl`,children:[(0,z.jsx)(Dn,{size:20}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`xs`,children:e})]})}function AG({retry:e}){return(0,z.jsxs)(D,{py:`xl`,style:{flexDirection:`column`,gap:8},children:[(0,z.jsxs)(se,{display:`flex`,style:{alignItems:`center`,gap:8},children:[(0,z.jsx)(jn,{size:20,weight:`fill`,color:`var(--mantine-color-bad-filled)`}),(0,z.jsx)(_,{c:`bad`,fw:500,size:`sm`,children:`Couldn't load this view`})]}),(0,z.jsx)(re,{size:`compact-xs`,variant:`light`,color:`bad`,onClick:e,children:`Retry now`}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:`Retrying automatically`})]})}TI([iD]);function jG({values:e,color:t,label:n}){let r=(0,R.useMemo)(()=>({animation:!1,grid:{left:0,right:0,top:2,bottom:2},xAxis:{type:`category`,show:!1,data:e.map((e,t)=>t)},yAxis:{type:`value`,show:!1,min:0},tooltip:{show:!1},series:[{type:`line`,data:e,showSymbol:!1,smooth:.3,lineStyle:{width:1.5,color:t},areaStyle:{opacity:.12,color:t}}]}),[e,t]);return(0,z.jsx)(bG,{option:r,height:28,label:n})}var MG={unhealthy:0,degraded:1,healthy:2};function NG({widget:e,filters:t}){let n=Sa(`overview`,ya(t,e.config,[`service`]));if(n.isError)return(0,z.jsx)(AG,{retry:()=>void n.refetch()});let r=[...n.data?.data.services??[]].sort((e,t)=>(MG[e.health]??3)-(MG[t.health]??3)||t.error_rate-e.error_rate);return n.data&&r.length===0?(0,z.jsx)(kG,{text:`No recent activity`}):(0,z.jsx)(_e,{type:`auto`,offsetScrollbars:!0,h:`100%`,children:(0,z.jsxs)(F,{verticalSpacing:`xs`,fz:`sm`,highlightOnHover:!0,children:[(0,z.jsx)(F.Thead,{children:(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Th,{children:`Service`}),(0,z.jsx)(F.Th,{ta:`right`,children:`P95`}),(0,z.jsx)(F.Th,{ta:`right`,children:`Errors`})]})}),(0,z.jsx)(F.Tbody,{children:r.map(e=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Td,{children:(0,z.jsx)(OG,{health:e.health,label:e.service})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:Da(e.p95_ms)})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,c:e.error_rate>=.01?`bad`:`dimmed`,children:Ea(e.error_rate)})})]},e.service))})]})})}function PG({filters:e,agentAvailable:t,onOpenChat:n}){if(!t)return(0,z.jsx)(_,{c:`dimmed`,size:`sm`,children:`Configure an AI provider to enable this view. The rest of this dashboard remains available.`});let r=_a(e.window),i=[`Summarize the last ${r}`,`What changed in the last ${r}?`,`Which service needs attention right now?`];return(0,z.jsx)(N,{gap:`xs`,align:`flex-start`,children:i.map(e=>(0,z.jsx)(re,{variant:`default`,size:`xs`,radius:`xl`,leftSection:(0,z.jsx)(Pe,{size:13,weight:`fill`}),onClick:()=>n(e),children:e},e))})}var FG={overview:[`service`],topology:[`service`],performance:[`service`],logs:[`service`,`severity`,`search`],trace:[`trace_id`]};function IG(e){return Object.hasOwn(FG,e)?FG[e]:void 0}function LG(e){return(IG(e)?.length??0)>0}function RG({opened:e,widget:t,services:n,onClose:r,onSave:i}){let[a,o]=(0,R.useState)({service:``,severity:``,search:``,trace_id:``});(0,R.useEffect)(()=>{e&&o({service:va(t.config,`service`),severity:va(t.config,`severity`),search:va(t.config,`search`),trace_id:va(t.config,`trace_id`)})},[e,t.config]);let s=IG(t.type)??[],c=[...new Set([...n,a.service].filter(Boolean))];function l(){let e={...t.config??{}};for(let t of s){let n=a[t].trim();n?e[t]=n:delete e[t]}i(e),r()}return(0,z.jsx)(L,{opened:e,onClose:r,title:`Configure ${t.title}`,centered:!0,children:(0,z.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),l()},children:(0,z.jsxs)(N,{children:[s.includes(`service`)&&(0,z.jsx)(an,{label:`Service`,placeholder:`All services`,data:c,value:a.service||null,onChange:e=>o({...a,service:e??``}),clearable:!0,searchable:!0,"aria-label":`Service`}),s.includes(`severity`)&&(0,z.jsx)(an,{label:`Severity`,placeholder:`All severities`,data:[`ERROR`,`WARN`,`INFO`,`DEBUG`],value:a.severity||null,onChange:e=>o({...a,severity:e??``}),clearable:!0,"aria-label":`Severity`}),s.includes(`search`)&&(0,z.jsx)(xe,{label:`Search`,placeholder:`Text the log body must contain`,value:a.search,onChange:e=>o({...a,search:e.currentTarget.value}),"aria-label":`Search`}),s.includes(`trace_id`)&&(0,z.jsx)(xe,{label:`Trace id`,placeholder:`Leave empty for the most relevant recent trace`,value:a.trace_id,onChange:e=>o({...a,trace_id:e.currentTarget.value}),ff:`monospace`,"aria-label":`Trace id`}),(0,z.jsxs)(x,{justify:`flex-end`,children:[(0,z.jsx)(re,{variant:`default`,onClick:r,children:`Cancel`}),(0,z.jsx)(re,{type:`submit`,children:`Save`})]})]})})})}TI([IA]);function zG({widget:e,filters:t,dark:n}){let r=Sa(`logs`,ya(t,e.config,[`service`,`severity`,`search`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.buckets.length===0)return null;let e=SG(n),t=i.provenance.window,r=[...new Set(i.data.buckets.map(e=>e.time))],a=[...new Set(i.data.buckets.map(e=>e.severity))],o=new Map(i.data.buckets.map(e=>[`${e.time} ${e.severity}`,e.count]));return{color:a.map(e=>EG(e,n)),grid:{left:28,right:8,top:8,bottom:20},tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:r.map(e=>Oa(e,t)),axisLabel:{color:e.muted,fontSize:8,hideOverlap:!0},axisLine:{lineStyle:{color:e.border}}},yAxis:{type:`value`,minInterval:1,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:8}},series:a.map(e=>({name:e,type:`bar`,stack:`logs`,barMaxWidth:14,data:r.map(t=>o.get(`${t} ${e}`)??0),itemStyle:{borderRadius:[2,2,0,0]}}))}},[n,i]);if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});let o=(i?.data.entries??[]).slice(0,5);return i&&o.length===0?(0,z.jsx)(kG,{text:`No matching logs in this window`}):(0,z.jsxs)(N,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(se,{h:72,children:(0,z.jsx)(bG,{option:a,height:72,label:`Log volume by severity`})}),(0,z.jsx)(_e,{type:`auto`,offsetScrollbars:!0,style:{flex:1},children:(0,z.jsx)(F,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(F.Tbody,{children:o.map((e,t)=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`xs`,ff:`monospace`,c:`dimmed`,children:i?Oa(e.time,i.provenance.window,!0):e.time})}),(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(ye,{size:`xs`,color:TG(e.severity),variant:`light`,style:{minWidth:`max-content`},children:e.severity||`LOG`})}),(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`sm`,fw:600,children:e.service})}),(0,z.jsx)(F.Td,{style:{width:`100%`},children:(0,z.jsx)(_,{size:`sm`,lineClamp:1,title:e.body,children:e.body})})]},`${e.time}-${t}`))})})})]})}function BG({widget:e,filters:t,dark:n}){let r=ya(t,e.config,[`service`]),i=Sa(`overview`,r),a=Sa(`performance`,r);if(i.isError)return(0,z.jsx)(AG,{retry:()=>void i.refetch()});let o=i.data?.data,s=(a.data?.data.points??[]).map(e=>e.error_rate*100),c=Math.max(o?.service_count??0,1),l=CG(n),u=o?.health===`unknown`,d=o?u?`No data`:o.health.charAt(0).toUpperCase()+o.health.slice(1):`—`;return(0,z.jsxs)(N,{gap:`sm`,children:[(0,z.jsxs)(mn,{cols:2,spacing:`sm`,children:[(0,z.jsx)(DG,{label:`Health`,value:d,color:o?xG(o.health):void 0,hint:o?u?`Nothing reported in this window`:`${Ta.format(o.service_count)} services`:void 0}),(0,z.jsx)(DG,{label:`Error rate`,value:o&&!u?Ea(o.error_rate):`—`,color:o&&o.error_rate>=.01?`bad`:void 0,hint:o&&!u?`${Ta.format(o.total_spans)} operations`:void 0,children:s.length>1&&(0,z.jsx)(jG,{values:s,color:l.bad,label:`Error rate trend`})})]}),o&&!u&&(0,z.jsxs)(se,{children:[(0,z.jsxs)(nn.Root,{size:`md`,"aria-label":`Service health distribution`,children:[(0,z.jsx)(nn.Section,{value:o.counts.healthy/c*100,color:`ok`}),(0,z.jsx)(nn.Section,{value:o.counts.degraded/c*100,color:`warn`}),(0,z.jsx)(nn.Section,{value:o.counts.unhealthy/c*100,color:`bad`})]}),(0,z.jsxs)(x,{mt:6,gap:`md`,children:[(0,z.jsx)(VG,{color:`ok`,text:`${o.counts.healthy} healthy`}),(0,z.jsx)(VG,{color:`warn`,text:`${o.counts.degraded} degraded`}),(0,z.jsx)(VG,{color:`bad`,text:`${o.counts.unhealthy} unhealthy`})]})]})]})}function VG({color:e,text:t}){return(0,z.jsxs)(x,{gap:6,children:[(0,z.jsx)(se,{w:8,h:8,bg:e,style:{borderRadius:`50%`}}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:t})]})}TI([iD]);function HG({widget:e,filters:t,dark:n}){let r=Sa(`performance`,ya(t,e.config,[`service`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.points.length===0)return null;let e=SG(n),t=i.provenance.window;return{color:[wG(`operations`,n),CG(n).warn],grid:{left:36,right:40,top:24,bottom:22},legend:{top:0,left:0,textStyle:{color:e.muted,fontSize:10},icon:`circle`,itemWidth:7,itemHeight:7},tooltip:{trigger:`axis`,backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:i.data.points.map(e=>Oa(e.time,t)),boundaryGap:!1,axisLine:{lineStyle:{color:e.border}},axisTick:{show:!1},axisLabel:{color:e.muted,fontSize:9,hideOverlap:!0}},yAxis:[{type:`value`,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:9}},{type:`value`,splitLine:{show:!1},axisLabel:{color:e.muted,fontSize:9,formatter:e=>Da(e)}}],series:[{name:`Operations`,type:`line`,data:i.data.points.map(e=>e.spans),smooth:.22,showSymbol:!1,lineStyle:{width:2},areaStyle:{opacity:.05}},{name:`P95`,type:`line`,yAxisIndex:1,data:i.data.points.map(e=>e.p95_ms),smooth:.22,showSymbol:!1,lineStyle:{width:2}}]}},[n,i]);if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});if(i&&i.data.points.length===0)return(0,z.jsx)(kG,{text:`No endpoint activity in this window`});let o=(i?.data.endpoints??[]).slice(0,3);return(0,z.jsxs)(N,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(se,{style:{flex:1,minHeight:120},children:(0,z.jsx)(bG,{option:a,height:`100%`,label:`Operations and P95 latency`})}),o.length>0&&(0,z.jsx)(F,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(F.Tbody,{children:o.map(e=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsxs)(F.Td,{children:[(0,z.jsx)(ye,{variant:`light`,size:`xs`,mr:6,style:{minWidth:`max-content`},children:e.method}),(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:e.path})]}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsxs)(_,{component:`span`,size:`sm`,c:`dimmed`,children:[Ta.format(e.calls),` calls`]})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:Da(e.p95_ms)})})]},`${e.method}-${e.path}`))})})]})}TI([LB]);function UG({widget:e,filters:t,dark:n,onOpenChat:r}){let i=Sa(`topology`,ya(t,e.config,[`service`])),a=i.data?.data,o=(0,R.useMemo)(()=>{if(!a)return null;let e=SG(n),t=CG(n),r=e=>e===`unhealthy`?t.bad:e===`degraded`?t.warn:t.ok,i=[...a.nodes].sort((e,t)=>e.service.localeCompare(t.service));return{tooltip:{backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},series:[{type:`graph`,layout:`circular`,circular:{rotateLabel:!1},roam:!1,draggable:!1,label:{show:!0,position:`bottom`,color:e.text,fontSize:10},edgeSymbol:[`none`,`arrow`],edgeSymbolSize:6,data:i.map(t=>({id:t.service,name:t.service,value:t.spans,symbolSize:Math.min(34,18+Math.log10(Math.max(t.spans,1))*4),itemStyle:{color:e.surface,borderColor:r(t.health),borderWidth:3}})),links:a.edges.map(n=>({source:n.caller,target:n.callee,value:n.calls,lineStyle:{width:Math.min(4,1+Math.log10(Math.max(n.calls,1))),color:n.error_rate>=.05?t.bad:e.muted,opacity:.5,curveness:.08}})),emphasis:{focus:`adjacency`}}]}},[n,a]);return i.isError?(0,z.jsx)(AG,{retry:()=>void i.refetch()}):a&&a.nodes.length===0?(0,z.jsx)(kG,{text:`No service relationships in this window`}):(0,z.jsxs)(N,{gap:4,h:`100%`,children:[o&&(0,z.jsx)(bG,{option:o,height:`100%`,className:`widget-chart`,label:`Service dependency graph`,onClick:e=>{let t=e;t.dataType===`node`&&t.data?.id&&r(`Investigate the ${t.data.id} service. Explain its errors and latency.`)}}),a&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[a.nodes.length,` services · `,a.edges.length,` `,a.edges.length===1?`route`:`routes`]})]})}function WG(e){return e.length>12?`${e.slice(0,8)}…${e.slice(-4)}`:e}function GG({widget:e,filters:t,dark:n}){let r=Sa(`trace`,ya(t,e.config,[`trace_id`]));if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});let i=r.data?.data;if(i&&i.spans.length===0)return(0,z.jsx)(kG,{text:`No traces in this window`});let a=[...i?.spans??[]].sort((e,t)=>t.duration_ms-e.duration_ms).slice(0,6);return(0,z.jsxs)(N,{gap:`sm`,children:[(0,z.jsxs)(mn,{cols:{base:2,sm:4},spacing:`sm`,children:[(0,z.jsx)(DG,{label:`Duration`,value:i?Da(i.duration_ms):`—`}),(0,z.jsx)(DG,{label:`Spans`,value:i?Ta.format(i.spans.length):`—`}),(0,z.jsx)(DG,{label:`Services`,value:i?Ta.format(i.services.length):`—`}),(0,z.jsx)(DG,{label:`Status`,value:i?i.has_error?`Error`:`OK`:`—`,color:i?i.has_error?`bad`:`ok`:void 0})]}),a.length>0&&(0,z.jsx)(KG,{spans:a,dark:n}),i&&(0,z.jsxs)(x,{gap:4,children:[(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,ff:`monospace`,children:[`Trace `,WG(i.trace_id)]}),(0,z.jsx)(qG,{value:i.trace_id})]})]})}function KG({spans:e,dark:t}){let n=Math.min(...e.map(e=>new Date(e.start).valueOf())),r=Math.max(...e.map(e=>new Date(e.start).valueOf()+e.duration_ms)),i=Math.max(r-n,1);return(0,z.jsx)(N,{gap:4,children:e.map(e=>{let r=(new Date(e.start).valueOf()-n)/i*100,a=Math.max(e.duration_ms/i*100,.6),o=e.status.toUpperCase().includes(`ERROR`);return(0,z.jsxs)(x,{gap:`sm`,wrap:`nowrap`,children:[(0,z.jsxs)(se,{w:170,miw:0,children:[(0,z.jsx)(_,{size:`xs`,fw:600,truncate:!0,children:e.operation}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e.service})]}),(0,z.jsx)(Re,{label:`${e.service} · ${e.operation} · ${Da(e.duration_ms)}`,withArrow:!0,children:(0,z.jsx)(se,{pos:`relative`,h:10,flex:1,bg:`var(--mantine-color-default-hover)`,style:{borderRadius:`var(--mantine-radius-sm)`},children:(0,z.jsx)(se,{pos:`absolute`,left:`${r}%`,w:`${Math.min(a,100-r)}%`,h:`100%`,bg:o?`bad`:wG(e.service,t),style:{borderRadius:`var(--mantine-radius-sm)`,minWidth:3}})})}),(0,z.jsx)(_,{size:`xs`,ff:`monospace`,w:56,ta:`right`,children:Da(e.duration_ms)})]},e.span_id)})})}function qG({value:e}){let{state:t,copy:n}=I();return(0,z.jsx)(Re,{label:t===`failed`?`Could not copy`:t===`copied`?`Copied`:`Copy trace id`,children:(0,z.jsx)(Se,{variant:`subtle`,color:`gray`,size:`xs`,"aria-label":`Copy trace id`,"data-state":t===`idle`?void 0:t,onClick:()=>n(e),children:t===`copied`?(0,z.jsx)(C,{size:12,weight:`bold`}):(0,z.jsx)(te,{size:12})})})}var JG={overview:`System health`,topology:`Service map`,activity:`Recent activity`,assistant:`Ask Fanout`,performance:`Performance`,trace:`Trace focus`,logs:`Logs`},YG={overview:BG,topology:UG,activity:NG,assistant:PG,performance:HG,trace:GG,logs:zG};function XG(){return(0,z.jsx)(kG,{text:`This view type is not supported by this version`})}function ZG(e){return Object.hasOwn(YG,e)?YG[e]:XG}function QG(e){let{widget:t,services:n,onRemove:r,onConfigure:i}=e,[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),l=ZG(t.type);return(0,z.jsxs)(le,{withBorder:!0,radius:`lg`,p:`md`,h:`100%`,className:`widget-card`,style:{overflow:`hidden`},children:[(0,z.jsxs)(N,{h:`100%`,gap:`sm`,children:[(0,z.jsxs)(x,{justify:`space-between`,align:`center`,wrap:`nowrap`,className:`widget-drag`,style:{cursor:`grab`},children:[(0,z.jsx)(A,{order:2,fz:`md`,fw:500,lineClamp:1,miw:0,children:t.title}),(0,z.jsxs)(Le,{position:`bottom-end`,withinPortal:!0,opened:a,onChange:o,children:[(0,z.jsx)(Le.Target,{children:(0,z.jsx)(Se,{className:`widget-actions`,"data-open":a||void 0,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Actions for ${t.title}`,children:(0,z.jsx)(Ge,{size:18,weight:`bold`})})}),(0,z.jsxs)(Le.Dropdown,{children:[LG(t.type)&&(0,z.jsx)(Le.Item,{leftSection:(0,z.jsx)(kn,{size:15}),onClick:()=>c(!0),children:`Configure`}),(0,z.jsx)(Le.Item,{color:`bad`,leftSection:(0,z.jsx)(Fe,{size:15}),onClick:r,children:`Remove`})]})]})]}),(0,z.jsx)(`div`,{className:`widget-body`,children:(0,z.jsx)(l,{...e})})]}),(0,z.jsx)(RG,{opened:s,widget:t,services:n,onClose:()=>c(!1),onSave:i})]})}var $G=la(sa),eK=`fanout.dashboard-id`,tK={layout:[],widgets:[],filters:{window:`1h`,namespace:``}};function nK(e){return Object.hasOwn(pa,e)?pa[e]:void 0}function rK({dashboardID:e=``,agentAvailable:t,onOpenChat:n,onDashboardChange:r}){let i=fe(),a=ve(`light`)===`dark`,o=Je({queryKey:Me,queryFn:()=>Ne(`/api/dashboards`),refetchInterval:3e4}),[s,c]=(0,R.useState)(()=>e||localStorage.getItem(eK)||``),l=gn({mutationFn:async e=>{if(!u.data)throw Error(`No dashboard selected`);let t=await Be(`/api/dashboards/${encodeURIComponent(u.data.id)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:u.data.name,description:u.data.description,state:e})});if(!t.ok)throw Error(`Unable to save dashboard`);return t.json()},scope:{id:`dashboard-${s}`},onSuccess:e=>{i.setQueryData([`dashboard`,e.id],e),i.invalidateQueries({queryKey:Me})},onError:e=>console.error(`Dashboard save failed`,e)}),u=Je({queryKey:[`dashboard`,s],queryFn:()=>Ne(`/api/dashboards/${encodeURIComponent(s)}`),enabled:!!s,refetchInterval:l.isPending||l.isError?!1:3e4}),[d,f]=(0,R.useState)(tK),[p,m]=(0,R.useState)(`lg`),h=Sa(`overview`,ya(d.filters),!!u.data),g=(0,R.useMemo)(()=>(h.data?.data.services??[]).map(e=>e.service),[h.data]),y=wa();(0,R.useEffect)(()=>{e&&e!==s&&(c(e),localStorage.setItem(eK,e))},[e,s]),(0,R.useEffect)(()=>{let t=o.data?.dashboards;if(t?.length&&!(e&&t.some(t=>t.id===e))){if(!e&&s&&t.some(e=>e.id===s)){r?.(s,!0);return}S((t.find(e=>e.is_default)??t[0]).id,!0)}},[e,o.data,s]),(0,R.useEffect)(()=>{l.isPending||l.isError||u.data?.state&&f(u.data.state)},[u.data?.updated_at,l.isPending,l.isError]),(0,R.useEffect)(()=>{l.reset()},[s]);let b=(0,R.useMemo)(()=>{let e=new Map(d.widgets.map(e=>[e.id,e.type])),t=d.layout.map(t=>{let n=nK(e.get(t.i)??`overview`)??pa.overview;return{...t,h:Math.max(t.h,n.minH),minW:Math.max(t.minW??0,n.minW),minH:Math.max(t.minH??0,n.minH)}});return{lg:t,md:t,sm:da(t,6),xs:da(t,2),xxs:da(t,1)}},[d.layout,d.widgets]);function S(e,t=!1){c(e),localStorage.setItem(eK,e),r?.(e,t)}function C(e){f(e),l.mutate(e)}function w(e){let t=ze(),n=pa[e],r=ha(d.layout,n.w,n.h,12,n.minW);C({...d,widgets:[...d.widgets,{id:t,type:e,title:JG[e],enabled:!0}],layout:[...d.layout,{i:t,x:r.x,y:r.y,w:r.w,h:n.h,minW:n.minW,minH:n.minH}]})}function T(e){C({...d,widgets:d.widgets.filter(t=>t.id!==e),layout:d.layout.filter(t=>t.i!==e)})}function E(e,t){C({...d,widgets:d.widgets.map(n=>n.id===e?{...n,config:t}:n)})}if(o.isLoading||s&&u.isLoading)return(0,z.jsx)(iK,{label:`Loading your dashboard…`});if(o.isError||u.isError)return(0,z.jsx)(iK,{label:`Your dashboard is unavailable. Try refreshing.`});let D=u.data;return D?(0,z.jsxs)(se,{component:`main`,maw:1440,mx:`auto`,px:{base:`md`,sm:`xl`},pt:{base:`lg`,sm:`xl`},pb:`xl`,children:[(0,z.jsxs)(N,{gap:`md`,mb:`lg`,children:[(0,z.jsxs)(se,{children:[(0,z.jsx)(A,{order:1,fz:32,lts:`-0.03em`,children:D.name}),(0,z.jsx)(_,{c:`dimmed`,mt:2,children:D.description||`A focused view of the signals that matter now.`})]}),(0,z.jsxs)(it,{align:{base:`stretch`,md:`center`},justify:`space-between`,direction:{base:`column`,md:`row`},gap:`sm`,role:`group`,"aria-label":`Dashboard controls`,children:[(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,children:[(0,z.jsx)(an,{"aria-label":`Window`,value:d.filters.window,onChange:e=>e&&C({...d,filters:{...d.filters,window:e}}),data:ga,w:{base:`100%`,xs:150},size:`sm`}),(0,z.jsx)(xe,{"aria-label":`Namespace`,value:d.filters.namespace,onChange:e=>f({...d,filters:{...d.filters,namespace:e.currentTarget.value}}),onBlur:e=>C({...d,filters:{...d.filters,namespace:e.currentTarget.value}}),placeholder:`All namespaces`,w:{base:`100%`,xs:200},size:`sm`})]}),(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,justify:`flex-end`,children:[y&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[`Updated `,new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(y))]}),(0,z.jsxs)(Le,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,z.jsx)(Le.Target,{children:(0,z.jsx)(re,{variant:`default`,size:`sm`,leftSection:(0,z.jsx)(ke,{size:15,weight:`bold`}),rightSection:(0,z.jsx)(Tn,{size:13,weight:`bold`}),children:`Add view`})}),(0,z.jsx)(Le.Dropdown,{children:fa.filter(e=>t||e!==`assistant`).map(e=>(0,z.jsx)(Le.Item,{onClick:()=>w(e),children:JG[e]},e))})]}),t&&(0,z.jsx)(re,{variant:`subtle`,color:`gray`,size:`sm`,rightSection:(0,z.jsx)(Cn,{size:15,weight:`bold`}),onClick:()=>n(),children:`Ask Fanout`})]})]})]}),l.isError&&(0,z.jsx)(v,{color:`bad`,radius:`lg`,mb:`lg`,icon:(0,z.jsx)(jn,{size:18,weight:`fill`}),title:`Dashboard changes not saved`,children:(0,z.jsxs)(x,{justify:`space-between`,gap:`sm`,children:[(0,z.jsx)(_,{size:`sm`,children:`Your latest edits are kept on this screen but Fanout could not store them.`}),(0,z.jsx)(re,{size:`compact-sm`,color:`bad`,variant:`light`,onClick:()=>l.mutate(d),children:`Retry save`})]})}),(0,z.jsx)($G,{className:`dashboard-grid`,layouts:b,breakpoints:{lg:1100,md:800,sm:600,xs:420,xxs:0},cols:{lg:12,md:10,sm:6,xs:2,xxs:1},rowHeight:76,margin:[16,16],containerPadding:[0,0],compactType:`vertical`,draggableHandle:`.widget-drag`,draggableCancel:`button,input,select,textarea,a,label,[role=menu],[role=dialog],.widget-actions`,onBreakpointChange:m,onDragStop:e=>{p===`lg`&&C({...d,layout:[...e]})},onResizeStop:e=>{p===`lg`&&C({...d,layout:[...e]})},children:d.widgets.map(e=>(0,z.jsx)(`div`,{children:(0,z.jsx)(QG,{widget:e,filters:d.filters,dark:a,services:g,agentAvailable:t,onOpenChat:n,onRemove:()=>T(e.id),onConfigure:t=>E(e.id,t)})},e.id))})]}):(0,z.jsx)(iK,{label:`Preparing your dashboard…`})}function iK({label:e}){return(0,z.jsxs)(D,{mih:`50vh`,children:[(0,z.jsx)(m,{size:`sm`}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`sm`,children:e})]})}export{rK as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards._dashboardId-BxKDNXp-.js b/internal/ui/dist/assets/dashboards._dashboardId-Dlv44ftW.js similarity index 69% rename from internal/ui/dist/assets/dashboards._dashboardId-BxKDNXp-.js rename to internal/ui/dist/assets/dashboards._dashboardId-Dlv44ftW.js index 3f106abb7..c3607b6e4 100644 --- a/internal/ui/dist/assets/dashboards._dashboardId-BxKDNXp-.js +++ b/internal/ui/dist/assets/dashboards._dashboardId-Dlv44ftW.js @@ -1 +1 @@ -import{pt as e}from"./brand-CCB4_HD8.js";import{t}from"./dashboard-DFF2_SFC.js";import{q as n,s as r,u as i}from"./index-DYcEv4SB.js";var a=e();function o(){let{dashboardId:e}=r.useParams(),o=n(),{agentAvailable:s,openChat:c}=i();return(0,a.jsx)(t,{dashboardID:e,agentAvailable:s,onOpenChat:c,onDashboardChange:(e,t)=>void o({to:`/dashboards/$dashboardId`,params:{dashboardId:e},replace:t})})}export{o as component}; \ No newline at end of file +import{pt as e}from"./brand-CCB4_HD8.js";import{t}from"./dashboard-Dl2pFM2h.js";import{q as n,s as r,u as i}from"./index-BxnvJp0Y.js";var a=e();function o(){let{dashboardId:e}=r.useParams(),o=n(),{agentAvailable:s,openChat:c}=i();return(0,a.jsx)(t,{dashboardID:e,agentAvailable:s,onOpenChat:c,onDashboardChange:(e,t)=>void o({to:`/dashboards/$dashboardId`,params:{dashboardId:e},replace:t})})}export{o as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-DY3GETbb.js b/internal/ui/dist/assets/dashboards.index-BuFeceag.js similarity index 82% rename from internal/ui/dist/assets/dashboards.index-DY3GETbb.js rename to internal/ui/dist/assets/dashboards.index-BuFeceag.js index 9f0d96cbb..b43d23f2b 100644 --- a/internal/ui/dist/assets/dashboards.index-DY3GETbb.js +++ b/internal/ui/dist/assets/dashboards.index-BuFeceag.js @@ -1 +1 @@ -import{pt as e}from"./brand-CCB4_HD8.js";import{t}from"./dashboard-DFF2_SFC.js";import{q as n,u as r}from"./index-DYcEv4SB.js";var i=e();function a(){let e=n(),{agentAvailable:a,openChat:o}=r();return(0,i.jsx)(t,{agentAvailable:a,onOpenChat:o,onDashboardChange:t=>void e({to:`/dashboards/$dashboardId`,params:{dashboardId:t},replace:!0})})}export{a as component}; \ No newline at end of file +import{pt as e}from"./brand-CCB4_HD8.js";import{t}from"./dashboard-Dl2pFM2h.js";import{q as n,u as r}from"./index-BxnvJp0Y.js";var i=e();function a(){let e=n(),{agentAvailable:a,openChat:o}=r();return(0,i.jsx)(t,{agentAvailable:a,onOpenChat:o,onDashboardChange:t=>void e({to:`/dashboards/$dashboardId`,params:{dashboardId:t},replace:!0})})}export{a as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-DYcEv4SB.js b/internal/ui/dist/assets/index-BxnvJp0Y.js similarity index 99% rename from internal/ui/dist/assets/index-DYcEv4SB.js rename to internal/ui/dist/assets/index-BxnvJp0Y.js index 53942fb5d..0ba2ab16e 100644 --- a/internal/ui/dist/assets/index-DYcEv4SB.js +++ b/internal/ui/dist/assets/index-BxnvJp0Y.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-BNP_b_GZ.js","assets/brand-CCB4_HD8.js","assets/chat.index-DC_eOz23.js","assets/chat-BWEtId3_.js","assets/copy-BcWHRdqc.js","assets/chat._threadId-DC_eOz23.js","assets/dashboards.index-DY3GETbb.js","assets/dashboard-DFF2_SFC.js","assets/dashboards._dashboardId-BxKDNXp-.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-DdP3ZNeG.js","assets/brand-CCB4_HD8.js","assets/chat.index-DSIYq_x1.js","assets/chat-D-J8SUFh.js","assets/copy-CUb9ms1Q.js","assets/chat._threadId-DSIYq_x1.js","assets/dashboards.index-BuFeceag.js","assets/dashboard-Dl2pFM2h.js","assets/dashboards._dashboardId-Dlv44ftW.js"])))=>i.map(i=>d[i]); import{$ as e,A as t,B as n,C as r,F as i,G as a,H as o,I as s,J as c,K as l,L as u,M as d,N as f,O as p,P as m,Q as h,S as g,U as _,V as v,W as y,X as b,Y as x,Z as S,_ as C,a as w,at as T,b as E,c as D,d as O,dt as k,et as A,f as ee,ft as j,g as M,gt as N,h as te,ht as ne,i as re,it as ie,j as P,k as ae,l as oe,lt as se,m as ce,mt as le,nt as ue,o as de,ot as fe,p as pe,pt as me,q as he,r as ge,rt as _e,s as F,st as ve,t as ye,tt as be,u as xe,ut as I,v as Se,vt as Ce,x as we,xt as Te,y as Ee,z as De}from"./brand-CCB4_HD8.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Oe=N((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ke=N(((e,t)=>{t.exports=Oe()})),Ae=N((e=>{var t=ke(),n=ne(),r=le();function i(e){var t=`https://react.dev/errors/`+e;if(1ie||(e.current=re[ie],re[ie]=null,ie--)}function oe(e,t){ie++,re[ie]=e.current,e.current=t}var se=P(null),ce=P(null),ue=P(null),de=P(null);function fe(e,t){switch(oe(ue,t),oe(ce,e),oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nf(t),e=rf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(se),oe(se,e)}function pe(){ae(se),ae(ce),ae(ue)}function me(e){e.memoizedState!==null&&oe(de,e);var t=se.current,n=rf(t,e.type);t!==n&&(oe(ce,e),oe(se,n))}function he(e){ce.current===e&&(ae(se),ae(ce)),de.current===e&&(ae(de),pp._currentValue=te)}var ge,_e;function F(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1)`:-1=0}function Xx(e){for(var t=[`topLevel`],n=0,r,i,a,o=function(e){return t.push(e)},s=function(e){return t[t.length-1]=e},c=function(e){r??(r=n,i=t.length,a=e)},l=function(e){e===a&&(r=void 0,i=void 0,a=void 0)},u=function(){return t.pop()},d=function(){return n--},f=function(e){if(`0`<=e&&e<=`9`){o(`number`);return}switch(e){case`"`:o(`string`);return;case`-`:o(`numberNeedsDigit`);return;case`t`:o(`true`);return;case`f`:o(`false`);return;case`n`:o(`null`);return;case`[`:o(`arrayNeedsValue`);return;case`{`:o(`objectNeedsKey`);return}},p=e.length;n`9`)&&(d(),u());break;case`numberNeedsDigit`:s(`number`);break;case`numberNeedsExponent`:s(m===`+`||m===`-`?`numberNeedsDigit`:`number`);break;case`true`:case`false`:case`null`:(m<`a`||m>`z`)&&(d(),u());break;case`arrayNeedsValue`:m===`]`?u():Yx(m)||(l(`collectionItem`),s(`arrayNeedsComma`),f(m));break;case`arrayNeedsComma`:m===`]`?u():m===`,`&&(c(`collectionItem`),s(`arrayNeedsValue`));break;case`objectNeedsKey`:m===`}`?u():m===`"`&&(c(`collectionItem`),s(`objectNeedsColon`),o(`string`));break;case`objectNeedsColon`:m===`:`&&s(`objectNeedsValue`);break;case`objectNeedsValue`:Yx(m)||(l(`collectionItem`),s(`objectNeedsComma`),f(m));break;case`objectNeedsComma`:m===`}`?u():m===`,`&&(c(`collectionItem`),s(`objectNeedsKey`))}}i!=null&&(t.length=i);for(var h=[r==null?e:e.slice(0,r)],g=function(t){return h.push(t.slice(e.length-e.lastIndexOf(t[0])))},_=t.length-1;_>=0;_--)switch(t[_]){case`string`:h.push(`"`);break;case`numberNeedsDigit`:case`numberNeedsExponent`:h.push(`0`);break;case`true`:g(`true`);break;case`false`:g(`false`);break;case`null`:g(`null`);break;case`arrayNeedsValue`:case`arrayNeedsComma`:h.push(`]`);break;case`objectNeedsKey`:case`objectNeedsColon`:case`objectNeedsValue`:case`objectNeedsComma`:h.push(`}`)}return h.join(``)}function Zx(){let e=this.buf,t=this.pos,n=0,r=0;for(let i=0;i<28;i+=7){let a=e[t++];if(n|=(a&127)<>4,!(i&128)){this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;return}for(let i=3;i<=31;i+=7){let a=e[t++];if(r|=(a&127)<=Qx&&(i+=r/Qx|0,r%=Qx)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?iS(r,i):rS(r,i)}function eS(e,t){let n=rS(e,t),r=n.hi&2147483648;r&&(n=iS(n.lo,n.hi));let i=tS(n.lo,n.hi);return r?`-`+i:i}function tS(e,t){if({lo:e,hi:t}=nS(e,t),t<=2097151)return String(Qx*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+aS(o)+aS(a)}function nS(e,t){return{lo:e>>>0,hi:t>>>0}}function rS(e,t){return{lo:e|0,hi:t|0}}function iS(e,t){return t=~t,e?e=~e+1:t+=1,rS(e,t)}var aS=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function oS(){let e=this.buf[this.pos++];if(!(e&128))return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var sS=cS();function cS(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||ta.call(e)),fS(i)}return dS}function mS(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var hS;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(hS||={});var gS=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?mS(e):pS().encodeUtf8Into,this.buffer=yS,this.viewCache=bS,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||_S;for(;e0&&n.set(this.buffer),this.buffer=n}}view(){let e=this.buffer,t=this.viewCache;if(t.byteLength===e.byteLength)return t;let n=new DataView(e.buffer);return this.viewCache=n,n}finish(){let e=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],e}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(vS),this.buffer[this.pos++]=0,this}join(){let e=this.stackPos.pop();if(e===void 0)throw Error(`invalid state, fork stack empty`);let t=this.pos-e-vS,n=SS(t);return n>vS&&(this.ensureCapacity(n-vS),this.buffer.copyWithin(e+n,e+vS,this.pos)),this.pos=e,this.uint32(t),this.pos+=t,this}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.ensureCapacity(e.length),this.buffer.set(e,this.pos),this.pos+=e.length,this}uint32(e){if(wS(e),this.ensureCapacity(5),e<128)return this.buffer[this.pos++]=e,this;for(;e>127;)this.buffer[this.pos++]=e&127|128,e>>>=7;return this.buffer[this.pos++]=e,this}int32(e){if(CS(e),e>=0)return this.uint32(e);this.ensureCapacity(10);for(let t=0;t<9;t++)this.buffer[this.pos++]=e&127|128,e>>=7;return this.buffer[this.pos++]=1,this}bool(e){return this.ensureCapacity(1),this.buffer[this.pos++]=+!!e,this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){typeof e!=`string`&&(e=String(e));let t=e.length;if(t<=xS){this.ensureCapacity(t+1);let n=this.buffer,r=this.pos;n[r++]=t;let i=0;for(;i127)break;n[r++]=t}if(i==t)return this.pos=r,this}this.ensureCapacity(t*3+5);let n=SS(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=SS(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return TS(e),this.ensureCapacity(4),this.view().setFloat32(this.pos,e,!0),this.pos+=4,this}double(e){return this.ensureCapacity(8),this.view().setFloat64(this.pos,e,!0),this.pos+=8,this}fixed32(e){return wS(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return CS(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return CS(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=sS.enc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}fixed64(e){let t=sS.uEnc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}int64(e){let t=sS.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=sS.enc(e),n=t.hi>>31,r=t.lo<<1^n,i=(t.hi<<1|t.lo>>>31)^n;return this.writeVarint64(r,i)}uint64(e){let t=sS.uEnc(e);return this.writeVarint64(t.lo,t.hi)}writeVarint64(e,t){this.ensureCapacity(10);let n=this.buffer,r=this.pos;for(let i=0;i<28;i+=7){let a=e>>>i,o=!(!(a>>>7)&&t==0);if(n[r++]=(o?a|128:a)&255,!o)return this.pos=r,this}let i=e>>>28&15|(t&7)<<4,a=!!(t>>3);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this;for(let e=3;e<31;e+=7){let i=t>>>e,a=!!(i>>>7);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this}return n[r++]=t>>>31&1,this.pos=r,this}},_S=128,vS=1,yS=new Uint8Array,bS=new DataView(yS.buffer),xS=32;function SS(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var q=class{constructor(e,t=pS().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=Zx,this.uint32=oS,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case hS.Varint:for(;this.buf[this.pos++]&128;);break;case hS.Bit64:this.pos+=4;case hS.Bit32:this.pos+=4;break;case hS.LengthDelimited:let r=this.uint32();this.pos+=r;break;case hS.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===hS.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return this.varint64(),sS.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),sS.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let e=this.varint64Lo,t=this.varint64Hi,n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,sS.dec(e,t)}bool(){let e=this.buf[this.pos];return e<128?(this.pos++,e!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return sS.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return sS.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){let t=this.bytes(),n=t.length;if(n<=xS){let r=Array(n);for(let i=0;i127)return this.decodeUtf8(t,e);r[i]=n}return String.fromCharCode.apply(String,r)}return this.decodeUtf8(t,e)}};function CS(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function wS(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function TS(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}var ES=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function DS(){return{fields:{}}}var OS={encode(e,t=new gS){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&AS.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=DS();for(;n.pos>>3){case 1:{if(e!==10)break;let t=AS.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return OS.fromPartial(e??{})},fromPartial(e){let t=DS();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=DS();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function kS(){return{key:``,value:void 0}}var AS={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(J.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=kS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return AS.fromPartial(e??{})},fromPartial(e){let t=kS();return t.key=e.key??``,t.value=e.value??void 0,t}};function jS(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var J={encode(e,t=new gS){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&OS.encode(OS.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&NS.encode(NS.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=jS();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=OS.unwrap(OS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=NS.unwrap(NS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return J.fromPartial(e??{})},fromPartial(e){let t=jS();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=jS();if(e===null)t.nullValue=ES.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function MS(){return{values:[]}}var NS={encode(e,t=new gS){for(let n of e.values)J.encode(J.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=MS();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(J.unwrap(J.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return NS.fromPartial(e??{})},fromPartial(e){let t=MS();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=MS();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},PS=function(e){return e[e.ADD=0]=`ADD`,e[e.REMOVE=1]=`REMOVE`,e[e.REPLACE=2]=`REPLACE`,e[e.MOVE=3]=`MOVE`,e[e.COPY=4]=`COPY`,e[e.TEST=5]=`TEST`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function FS(){return{op:0,path:``,from:void 0,value:void 0}}var IS={encode(e,t=new gS){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==``&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&J.encode(J.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=FS();for(;n.pos>>3){case 1:if(e!==8)break;i.op=n.int32();continue;case 2:if(e!==18)break;i.path=n.string();continue;case 3:if(e!==26)break;i.from=n.string();continue;case 4:if(e!==34)break;i.value=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return IS.fromPartial(e??{})},fromPartial(e){let t=FS();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function LS(){return{id:``,type:``,function:void 0,metadata:void 0}}var RS={encode(e,t=new gS){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&BS.encode(e.function,t.uint32(26).fork()).join(),e.metadata!==void 0&&OS.encode(OS.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=LS();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.type=n.string();continue;case 3:if(e!==26)break;i.function=BS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.metadata=OS.unwrap(OS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return RS.fromPartial(e??{})},fromPartial(e){let t=LS();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?BS.fromPartial(e.function):void 0,t.metadata=e.metadata??void 0,t}};function zS(){return{name:``,arguments:``}}var BS={encode(e,t=new gS){return e.name!==``&&t.uint32(10).string(e.name),e.arguments!==``&&t.uint32(18).string(e.arguments),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=zS();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.arguments=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return BS.fromPartial(e??{})},fromPartial(e){let t=zS();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function VS(){return{value:``,mimeType:``}}var HS={encode(e,t=new gS){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==``&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=VS();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return HS.fromPartial(e??{})},fromPartial(e){let t=VS();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function US(){return{value:``,mimeType:void 0}}var WS={encode(e,t=new gS){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=US();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return WS.fromPartial(e??{})},fromPartial(e){let t=US();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function GS(){return{data:void 0,url:void 0}}var KS={encode(e,t=new gS){return e.data!==void 0&&HS.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&WS.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=GS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=HS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=WS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return KS.fromPartial(e??{})},fromPartial(e){let t=GS();return t.data=e.data!==void 0&&e.data!==null?HS.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?WS.fromPartial(e.url):void 0,t}};function qS(){return{text:``}}var JS={encode(e,t=new gS){return e.text!==``&&t.uint32(10).string(e.text),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=qS();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return JS.fromPartial(e??{})},fromPartial(e){let t=qS();return t.text=e.text??``,t}};function YS(){return{source:void 0,metadata:void 0}}var XS={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=YS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return XS.fromPartial(e??{})},fromPartial(e){let t=YS();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function ZS(){return{source:void 0,metadata:void 0}}var QS={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=ZS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return QS.fromPartial(e??{})},fromPartial(e){let t=ZS();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function $S(){return{source:void 0,metadata:void 0}}var eC={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=$S();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return eC.fromPartial(e??{})},fromPartial(e){let t=$S();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function tC(){return{source:void 0,metadata:void 0}}var nC={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=tC();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nC.fromPartial(e??{})},fromPartial(e){let t=tC();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function rC(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var iC={encode(e,t=new gS){return e.text!==void 0&&JS.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&XS.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&QS.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&eC.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&nC.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=rC();for(;n.pos>>3){case 1:if(e!==10)break;i.text=JS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=XS.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=QS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=eC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=nC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return iC.fromPartial(e??{})},fromPartial(e){let t=rC();return t.text=e.text!==void 0&&e.text!==null?JS.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?XS.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?QS.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?eC.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?nC.fromPartial(e.document):void 0,t}};function aC(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[],metadata:void 0,subagentRunId:void 0}}var oC={encode(e,t=new gS){e.id!==``&&t.uint32(10).string(e.id),e.role!==``&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let n of e.toolCalls)RS.encode(n,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let n of e.contentParts)iC.encode(n,t.uint32(66).fork()).join();return e.metadata!==void 0&&OS.encode(OS.wrap(e.metadata),t.uint32(74).fork()).join(),e.subagentRunId!==void 0&&t.uint32(82).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=aC();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.role=n.string();continue;case 3:if(e!==26)break;i.content=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.toolCalls.push(RS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.toolCallId=n.string();continue;case 7:if(e!==58)break;i.error=n.string();continue;case 8:if(e!==66)break;i.contentParts.push(iC.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.metadata=OS.unwrap(OS.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return oC.fromPartial(e??{})},fromPartial(e){let t=aC();return t.id=e.id??``,t.role=e.role??``,t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(e=>RS.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>iC.fromPartial(e))||[],t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function sC(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0,subagentRunId:void 0}}var cC={encode(e,t=new gS){return e.id!==``&&t.uint32(10).string(e.id),e.reason!==``&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&J.encode(J.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(58).fork()).join(),e.subagentRunId!==void 0&&t.uint32(66).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=sC();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.reason=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.responseSchema=J.unwrap(J.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cC.fromPartial(e??{})},fromPartial(e){let t=sC();return t.id=e.id??``,t.reason=e.reason??``,t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}},lC=function(e){return e[e.TEXT_MESSAGE_START=0]=`TEXT_MESSAGE_START`,e[e.TEXT_MESSAGE_CONTENT=1]=`TEXT_MESSAGE_CONTENT`,e[e.TEXT_MESSAGE_END=2]=`TEXT_MESSAGE_END`,e[e.TOOL_CALL_START=3]=`TOOL_CALL_START`,e[e.TOOL_CALL_ARGS=4]=`TOOL_CALL_ARGS`,e[e.TOOL_CALL_END=5]=`TOOL_CALL_END`,e[e.STATE_SNAPSHOT=6]=`STATE_SNAPSHOT`,e[e.STATE_DELTA=7]=`STATE_DELTA`,e[e.MESSAGES_SNAPSHOT=8]=`MESSAGES_SNAPSHOT`,e[e.RAW=9]=`RAW`,e[e.CUSTOM=10]=`CUSTOM`,e[e.RUN_STARTED=11]=`RUN_STARTED`,e[e.RUN_FINISHED=12]=`RUN_FINISHED`,e[e.RUN_ERROR=13]=`RUN_ERROR`,e[e.STEP_STARTED=14]=`STEP_STARTED`,e[e.STEP_FINISHED=15]=`STEP_FINISHED`,e[e.SUBAGENT_STARTED=16]=`SUBAGENT_STARTED`,e[e.SUBAGENT_FINISHED=17]=`SUBAGENT_FINISHED`,e[e.SUBAGENT_ERROR=18]=`SUBAGENT_ERROR`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function uC(){return{type:0,timestamp:void 0,rawEvent:void 0,metadata:void 0}}var Y={encode(e,t=new gS){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&J.encode(J.wrap(e.rawEvent),t.uint32(26).fork()).join(),e.metadata!==void 0&&OS.encode(OS.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=uC();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=rw(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=J.unwrap(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=OS.unwrap(OS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Y.fromPartial(e??{})},fromPartial(e){let t=uC();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t.metadata=e.metadata??void 0,t}};function dC(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0,subagentRunId:void 0}}var fC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=dC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fC.fromPartial(e??{})},fromPartial(e){let t=dC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function pC(){return{baseEvent:void 0,messageId:``,delta:``,subagentRunId:void 0}}var mC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=pC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mC.fromPartial(e??{})},fromPartial(e){let t=pC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function hC(){return{baseEvent:void 0,messageId:``,subagentRunId:void 0}}var gC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=hC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gC.fromPartial(e??{})},fromPartial(e){let t=hC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function _C(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0,subagentRunId:void 0}}var vC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.toolCallName!==``&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=_C();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vC.fromPartial(e??{})},fromPartial(e){let t=_C();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function yC(){return{baseEvent:void 0,toolCallId:``,delta:``,subagentRunId:void 0}}var bC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=yC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bC.fromPartial(e??{})},fromPartial(e){let t=yC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function xC(){return{baseEvent:void 0,toolCallId:``,subagentRunId:void 0}}var SC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=xC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return SC.fromPartial(e??{})},fromPartial(e){let t=xC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function CC(){return{baseEvent:void 0,snapshot:void 0,subagentRunId:void 0}}var wC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&J.encode(J.wrap(e.snapshot),t.uint32(18).fork()).join(),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=CC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=J.unwrap(J.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wC.fromPartial(e??{})},fromPartial(e){let t=CC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function TC(){return{baseEvent:void 0,delta:[],subagentRunId:void 0}}var EC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)IS.encode(n,t.uint32(18).fork()).join();return e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=TC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(IS.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return EC.fromPartial(e??{})},fromPartial(e){let t=TC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>IS.fromPartial(e))||[],t.subagentRunId=e.subagentRunId??void 0,t}};function DC(){return{baseEvent:void 0,messages:[]}}var OC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)oC.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=DC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(oC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return OC.fromPartial(e??{})},fromPartial(e){let t=DC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>oC.fromPartial(e))||[],t}};function kC(){return{baseEvent:void 0,event:void 0,source:void 0,subagentRunId:void 0}}var AC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&J.encode(J.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=kC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=J.unwrap(J.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return AC.fromPartial(e??{})},fromPartial(e){let t=kC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function jC(){return{baseEvent:void 0,name:``,value:void 0,subagentRunId:void 0}}var MC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&J.encode(J.wrap(e.value),t.uint32(26).fork()).join(),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=jC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=J.unwrap(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return MC.fromPartial(e??{})},fromPartial(e){let t=jC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function NC(){return{baseEvent:void 0,threadId:``,runId:``}}var PC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=NC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return PC.fromPartial(e??{})},fromPartial(e){let t=NC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t}};function FC(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0}}var IC={encode(e,t=new gS){return e.provider!==void 0&&t.uint32(10).string(e.provider),e.model!==void 0&&t.uint32(18).string(e.model),e.inputTokens!==void 0&&t.uint32(24).int64(e.inputTokens),e.outputTokens!==void 0&&t.uint32(32).int64(e.outputTokens),e.totalTokens!==void 0&&t.uint32(40).int64(e.totalTokens),e.reasoningTokens!==void 0&&t.uint32(48).int64(e.reasoningTokens),e.cachedInputTokens!==void 0&&t.uint32(56).int64(e.cachedInputTokens),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=FC();for(;n.pos>>3){case 1:if(e!==10)break;i.provider=n.string();continue;case 2:if(e!==18)break;i.model=n.string();continue;case 3:if(e!==24)break;i.inputTokens=rw(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=rw(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=rw(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=rw(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=rw(n.int64());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return IC.fromPartial(e??{})},fromPartial(e){let t=FC();return t.provider=e.provider??void 0,t.model=e.model??void 0,t.inputTokens=e.inputTokens??void 0,t.outputTokens=e.outputTokens??void 0,t.totalTokens=e.totalTokens??void 0,t.reasoningTokens=e.reasoningTokens??void 0,t.cachedInputTokens=e.cachedInputTokens??void 0,t}};function LC(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[]}}var RC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.result!==void 0&&J.encode(J.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)cC.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)IC.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=LC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.result=J.unwrap(J.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.outcome=n.string();continue;case 6:if(e!==50)break;i.interrupts.push(cC.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(IC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return RC.fromPartial(e??{})},fromPartial(e){let t=LC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interrupts=e.interrupts?.map(e=>cC.fromPartial(e))||[],t.usage=e.usage?.map(e=>IC.fromPartial(e))||[],t}};function zC(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var BC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==``&&t.uint32(26).string(e.message);for(let n of e.usage)IC.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=zC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.code=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.usage.push(IC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return BC.fromPartial(e??{})},fromPartial(e){let t=zC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>IC.fromPartial(e))||[],t}};function VC(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var HC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=VC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return HC.fromPartial(e??{})},fromPartial(e){let t=VC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function UC(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var WC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=UC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return WC.fromPartial(e??{})},fromPartial(e){let t=UC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function GC(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0,subagentRunId:void 0}}var KC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=GC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue;case 5:if(e!==42)break;i.name=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return KC.fromPartial(e??{})},fromPartial(e){let t=GC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function qC(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0,subagentRunId:void 0}}var JC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=qC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.delta=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return JC.fromPartial(e??{})},fromPartial(e){let t=qC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function YC(){return{baseEvent:void 0,subagentRunId:``,name:``,description:void 0,parentSubagentRunId:void 0,parentToolCallId:void 0,parentMessageId:void 0}}var XC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.name!==``&&t.uint32(26).string(e.name),e.description!==void 0&&t.uint32(34).string(e.description),e.parentSubagentRunId!==void 0&&t.uint32(42).string(e.parentSubagentRunId),e.parentToolCallId!==void 0&&t.uint32(50).string(e.parentToolCallId),e.parentMessageId!==void 0&&t.uint32(58).string(e.parentMessageId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=YC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.name=n.string();continue;case 4:if(e!==34)break;i.description=n.string();continue;case 5:if(e!==42)break;i.parentSubagentRunId=n.string();continue;case 6:if(e!==50)break;i.parentToolCallId=n.string();continue;case 7:if(e!==58)break;i.parentMessageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return XC.fromPartial(e??{})},fromPartial(e){let t=YC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.name=e.name??``,t.description=e.description??void 0,t.parentSubagentRunId=e.parentSubagentRunId??void 0,t.parentToolCallId=e.parentToolCallId??void 0,t.parentMessageId=e.parentMessageId??void 0,t}};function ZC(){return{baseEvent:void 0,subagentRunId:``,result:void 0,outcome:``,interruptIds:[]}}var QC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.result!==void 0&&J.encode(J.wrap(e.result),t.uint32(26).fork()).join(),e.outcome!==``&&t.uint32(34).string(e.outcome);for(let n of e.interruptIds)t.uint32(42).string(n);return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=ZC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.result=J.unwrap(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.outcome=n.string();continue;case 5:if(e!==42)break;i.interruptIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return QC.fromPartial(e??{})},fromPartial(e){let t=ZC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interruptIds=e.interruptIds?.map(e=>e)||[],t}};function $C(){return{baseEvent:void 0,subagentRunId:``,message:``,code:void 0}}var ew={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.message!==``&&t.uint32(26).string(e.message),e.code!==void 0&&t.uint32(34).string(e.code),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=$C();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.code=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ew.fromPartial(e??{})},fromPartial(e){let t=$C();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.message=e.message??``,t.code=e.code??void 0,t}};function tw(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0,subagentStarted:void 0,subagentFinished:void 0,subagentError:void 0}}var nw={encode(e,t=new gS){return e.textMessageStart!==void 0&&fC.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&mC.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&gC.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&vC.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&bC.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&SC.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&wC.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&EC.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&OC.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&AC.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&MC.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&PC.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&RC.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&BC.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&HC.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&WC.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&KC.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&JC.encode(e.toolCallChunk,t.uint32(146).fork()).join(),e.subagentStarted!==void 0&&XC.encode(e.subagentStarted,t.uint32(154).fork()).join(),e.subagentFinished!==void 0&&QC.encode(e.subagentFinished,t.uint32(162).fork()).join(),e.subagentError!==void 0&&ew.encode(e.subagentError,t.uint32(170).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=tw();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=fC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=mC.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=gC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=vC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=bC.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=SC.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=wC.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=EC.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=OC.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=AC.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=MC.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=PC.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=RC.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=BC.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=HC.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=WC.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=KC.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=JC.decode(n,n.uint32());continue;case 19:if(e!==154)break;i.subagentStarted=XC.decode(n,n.uint32());continue;case 20:if(e!==162)break;i.subagentFinished=QC.decode(n,n.uint32());continue;case 21:if(e!==170)break;i.subagentError=ew.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nw.fromPartial(e??{})},fromPartial(e){let t=tw();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?fC.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?mC.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?gC.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?vC.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?bC.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?SC.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?wC.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?EC.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?OC.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?AC.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?MC.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?PC.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?RC.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?BC.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?HC.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?WC.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?KC.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?JC.fromPartial(e.toolCallChunk):void 0,t.subagentStarted=e.subagentStarted!==void 0&&e.subagentStarted!==null?XC.fromPartial(e.subagentStarted):void 0,t.subagentFinished=e.subagentFinished!==void 0&&e.subagentFinished!==null?QC.fromPartial(e.subagentFinished):void 0,t.subagentError=e.subagentError!==void 0&&e.subagentError!==null?ew.fromPartial(e.subagentError):void 0,t}};function rw(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(te&&typeof e==`object`?e:void 0,aw=e=>{let t=iw(e);if(t){if(t.data){let e=t.data;return{type:`data`,value:e.value,mimeType:e.mimeType}}if(t.url){let e=t.url;return{type:`url`,value:e.value,mimeType:e.mimeType}}}},ow=e=>{let t=iw(e);if(t){if(t.text)return{type:`text`,text:t.text.text};if(t.image){let e=t.image;return{type:`image`,source:aw(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return{type:`audio`,source:aw(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return{type:`video`,source:aw(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return{type:`document`,source:aw(e.source),metadata:e.metadata}}}};function sw(e){let t=nw.decode(e),n=Object.values(t).find(e=>e!==void 0);if(!n)throw Error(`Invalid event`);if(n.type=lC[n.baseEvent.type],n.timestamp=n.baseEvent.timestamp,n.rawEvent=n.baseEvent.rawEvent,n.baseEvent.metadata!==void 0&&(n.metadata=n.baseEvent.metadata),delete n.baseEvent,n.type===G.MESSAGES_SNAPSHOT)for(let e of n.messages){let t=e;if(t.role===`user`&&Array.isArray(t.contentParts)){let e=t.contentParts.map(e=>ow(e)).filter(e=>e!==void 0);e.length>0&&(t.content=e)}Array.isArray(t.contentParts)&&t.contentParts.length===0&&(t.contentParts=void 0),t.toolCalls?.length===0&&(t.toolCalls=void 0)}if(n.type===G.RUN_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interrupts)?e.interrupts:[];delete e.interrupts,t===`interrupt`?e.outcome={type:`interrupt`,interrupts:r}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if(n.type===G.SUBAGENT_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interruptIds)?e.interruptIds:[];delete e.interruptIds,t===`suspended`?e.outcome={type:`suspended`,...r.length>0&&{interruptIds:r}}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if((n.type===G.RUN_FINISHED||n.type===G.RUN_ERROR)&&Array.isArray(n.usage)&&n.usage.length===0&&delete n.usage,n.type===G.STATE_DELTA)for(let e of n.delta)e.op=PS[e.op].toLowerCase(),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]});return Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),gy.parse(n)}var cw;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(cw||={});var lw;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(lw||={});var X=cw.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),uw=e=>{switch(typeof e){case`undefined`:return X.undefined;case`string`:return X.string;case`number`:return Number.isNaN(e)?X.nan:X.number;case`boolean`:return X.boolean;case`function`:return X.function;case`bigint`:return X.bigint;case`symbol`:return X.symbol;case`object`:return Array.isArray(e)?X.array:e===null?X.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?X.promise:typeof Map<`u`&&e instanceof Map?X.map:typeof Set<`u`&&e instanceof Set?X.set:typeof Date<`u`&&e instanceof Date?X.date:X.object;default:return X.unknown}},Z=cw.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),dw=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};dw.create=e=>new dw(e);var fw=(e,t)=>{let n;switch(e.code){case Z.invalid_type:n=e.received===X.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,cw.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${cw.joinValues(e.keys,`, `)}`;break;case Z.invalid_union:n=`Invalid input`;break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${cw.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${cw.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n=`Invalid function arguments`;break;case Z.invalid_return_type:n=`Invalid function return type`;break;case Z.invalid_date:n=`Invalid date`;break;case Z.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:cw.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case Z.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case Z.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case Z.custom:n=`Invalid input`;break;case Z.invalid_intersection_types:n=`Intersection results could not be merged`;break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,cw.assertNever(e)}return{message:n}},pw=fw;function mw(){return pw}var hw=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function Q(e,t){let n=mw(),r=hw({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===fw?void 0:fw].filter(e=>!!e)});e.common.issues.push(r)}var gw=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return _w;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return _w;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},_w=Object.freeze({status:`aborted`}),vw=e=>({status:`dirty`,value:e}),yw=e=>({status:`valid`,value:e}),bw=e=>e.status===`aborted`,xw=e=>e.status===`dirty`,Sw=e=>e.status===`valid`,Cw=e=>typeof Promise<`u`&&e instanceof Promise,$;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})($||={});var ww=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Tw=(e,t)=>{if(Sw(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new dw(e.common.issues);return this._error=t,this._error}}};function Ew(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Dw=class{get description(){return this._def.description}_getType(e){return uw(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:uw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new gw,ctx:{common:e.parent.common,data:e.data,parsedType:uw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Cw(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uw(e)};return Tw(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uw(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Sw(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Sw(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uw(e)},r=this._parse({data:e,path:n.path,parent:n});return Tw(n,await(Cw(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:Z.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new AT({schema:this,typeName:zT.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return jT.create(this,this._def)}nullable(){return MT.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dT.create(this)}promise(){return kT.create(this,this._def)}or(e){return mT.create([this,e],this._def)}and(e){return vT.create(this,e,this._def)}transform(e){return new AT({...Ew(this._def),schema:this,typeName:zT.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new NT({...Ew(this._def),innerType:this,defaultValue:t,typeName:zT.ZodDefault})}brand(){return new IT({typeName:zT.ZodBranded,type:this,...Ew(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new PT({...Ew(this._def),innerType:this,catchValue:t,typeName:zT.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return LT.create(this,e)}readonly(){return RT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ow=/^c[^\s-]{8,}$/i,kw=/^[0-9a-z]+$/,Aw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Mw=/^[a-z0-9_-]{21}$/i,Nw=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Pw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Fw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Iw=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Lw,Rw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Bw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Vw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Uw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ww=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Gw=RegExp(`^${Ww}$`);function Kw(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function qw(e){return RegExp(`^${Kw(e)}$`)}function Jw(e){let t=`${Ww}T${Kw(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Yw(e,t){return!((t!==`v4`&&t||!Rw.test(e))&&(t!==`v6`&&t||!Bw.test(e)))}function Xw(e,t){if(!Nw.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Zw(e,t){return!((t!==`v4`&&t||!zw.test(e))&&(t!==`v6`&&t||!Vw.test(e)))}var Qw=class e extends Dw{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==X.string){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.string,received:t.parsedType}),_w}let t=new gw,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.lengthe.test(t),{validation:t,code:Z.invalid_string,...$.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...$.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...$.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...$.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...$.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...$.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...$.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...$.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...$.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...$.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...$.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...$.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...$.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...$.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...$.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...$.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...$.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...$.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...$.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...$.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...$.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...$.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...$.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...$.errToObj(t)})}nonempty(e){return this.min(1,$.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Qw({checks:[],typeName:zT.ZodString,coerce:e?.coerce??!1,...Ew(e)});function $w(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var eT=class e extends Dw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==X.number){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.number,received:t.parsedType}),_w}let t,n=new gw;for(let r of this._def.checks)r.kind===`int`?cw.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?$w(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_finite,message:r.message}),n.dirty()):cw.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,$.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,$.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,$.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,$.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:$.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:$.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:$.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:$.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:$.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:$.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuee.kind===`int`||e.kind===`multipleOf`&&cw.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew eT({checks:[],typeName:zT.ZodNumber,coerce:e?.coerce||!1,...Ew(e)});var tT=class e extends Dw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==X.bigint)return this._getInvalidInput(e);let t,n=new gw;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):cw.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.bigint,received:t.parsedType}),_w}gte(e,t){return this.setLimit(`min`,e,!0,$.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,$.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,$.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,$.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:$.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:$.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew tT({checks:[],typeName:zT.ZodBigInt,coerce:e?.coerce??!1,...Ew(e)});var nT=class extends Dw{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==X.boolean){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.boolean,received:t.parsedType}),_w}return yw(e.data)}};nT.create=e=>new nT({typeName:zT.ZodBoolean,coerce:e?.coerce||!1,...Ew(e)});var rT=class e extends Dw{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==X.date){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.date,received:t.parsedType}),_w}if(Number.isNaN(e.data.getTime()))return Q(this._getOrReturnCtx(e),{code:Z.invalid_date}),_w;let t=new gw,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):cw.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:$.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:$.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew rT({checks:[],coerce:e?.coerce||!1,typeName:zT.ZodDate,...Ew(e)});var iT=class extends Dw{_parse(e){if(this._getType(e)!==X.symbol){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.symbol,received:t.parsedType}),_w}return yw(e.data)}};iT.create=e=>new iT({typeName:zT.ZodSymbol,...Ew(e)});var aT=class extends Dw{_parse(e){if(this._getType(e)!==X.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.undefined,received:t.parsedType}),_w}return yw(e.data)}};aT.create=e=>new aT({typeName:zT.ZodUndefined,...Ew(e)});var oT=class extends Dw{_parse(e){if(this._getType(e)!==X.null){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.null,received:t.parsedType}),_w}return yw(e.data)}};oT.create=e=>new oT({typeName:zT.ZodNull,...Ew(e)});var sT=class extends Dw{constructor(){super(...arguments),this._any=!0}_parse(e){return yw(e.data)}};sT.create=e=>new sT({typeName:zT.ZodAny,...Ew(e)});var cT=class extends Dw{constructor(){super(...arguments),this._unknown=!0}_parse(e){return yw(e.data)}};cT.create=e=>new cT({typeName:zT.ZodUnknown,...Ew(e)});var lT=class extends Dw{_parse(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.never,received:t.parsedType}),_w}};lT.create=e=>new lT({typeName:zT.ZodNever,...Ew(e)});var uT=class extends Dw{_parse(e){if(this._getType(e)!==X.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.void,received:t.parsedType}),_w}return yw(e.data)}};uT.create=e=>new uT({typeName:zT.ZodVoid,...Ew(e)});var dT=class e extends Dw{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==X.array)return Q(t,{code:Z.invalid_type,expected:X.array,received:t.parsedType}),_w;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(Q(t,{code:Z.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new ww(t,e,t.path,n)))).then(e=>gw.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new ww(t,e,t.path,n)));return gw.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:$.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:$.toString(n)}})}nonempty(e){return this.min(1,e)}};dT.create=(e,t)=>new dT({type:e,minLength:null,maxLength:null,exactLength:null,typeName:zT.ZodArray,...Ew(t)});function fT(e){if(e instanceof pT){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=jT.create(fT(r))}return new pT({...e._def,shape:()=>t})}return e instanceof dT?new dT({...e._def,type:fT(e.element)}):e instanceof jT?jT.create(fT(e.unwrap())):e instanceof MT?MT.create(fT(e.unwrap())):e instanceof yT?yT.create(e.items.map(e=>fT(e))):e}var pT=class e extends Dw{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=cw.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==X.object){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.object,received:t.parsedType}),_w}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof lT&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new ww(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof lT){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(Q(n,{code:Z.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new ww(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>gw.mergeObjectSync(t,e)):gw.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return $.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:$.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:zT.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of cw.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of cw.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return fT(this)}partial(t){let n={};for(let e of cw.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of cw.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof jT;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return ET(cw.objectKeys(this.shape))}};pT.create=(e,t)=>new pT({shape:()=>e,unknownKeys:`strip`,catchall:lT.create(),typeName:zT.ZodObject,...Ew(t)}),pT.strictCreate=(e,t)=>new pT({shape:()=>e,unknownKeys:`strict`,catchall:lT.create(),typeName:zT.ZodObject,...Ew(t)}),pT.lazycreate=(e,t)=>new pT({shape:e,unknownKeys:`strip`,catchall:lT.create(),typeName:zT.ZodObject,...Ew(t)});var mT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new dw(e.ctx.common.issues));return Q(t,{code:Z.invalid_union,unionErrors:n}),_w}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new dw(e));return Q(t,{code:Z.invalid_union,unionErrors:i}),_w}}get options(){return this._def.options}};mT.create=(e,t)=>new mT({options:e,typeName:zT.ZodUnion,...Ew(t)});var hT=e=>e instanceof wT?hT(e.schema):e instanceof AT?hT(e.innerType()):e instanceof TT?[e.value]:e instanceof DT?e.options:e instanceof OT?cw.objectValues(e.enum):e instanceof NT?hT(e._def.innerType):e instanceof aT?[void 0]:e instanceof oT?[null]:e instanceof jT?[void 0,...hT(e.unwrap())]:e instanceof MT?[null,...hT(e.unwrap())]:e instanceof IT||e instanceof RT?hT(e.unwrap()):e instanceof PT?hT(e._def.innerType):[],gT=class e extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==X.object)return Q(t,{code:Z.invalid_type,expected:X.object,received:t.parsedType}),_w;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Q(t,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),_w)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=hT(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:zT.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Ew(r)})}};function _T(e,t){let n=uw(e),r=uw(t);if(e===t)return{valid:!0,data:e};if(n===X.object&&r===X.object){let n=cw.objectKeys(t),r=cw.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=_T(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===X.array&&r===X.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r{if(bw(e)||bw(r))return _w;let i=_T(e.value,r.value);return i.valid?((xw(e)||xw(r))&&t.dirty(),{status:t.value,value:i.data}):(Q(n,{code:Z.invalid_intersection_types}),_w)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};vT.create=(e,t,n)=>new vT({left:e,right:t,typeName:zT.ZodIntersection,...Ew(n)});var yT=class e extends Dw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.array)return Q(n,{code:Z.invalid_type,expected:X.array,received:n.parsedType}),_w;if(n.data.lengththis._def.items.length&&(Q(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new ww(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>gw.mergeArray(t,e)):gw.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};yT.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new yT({items:e,typeName:zT.ZodTuple,rest:null,...Ew(t)})};var bT=class e extends Dw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.object)return Q(n,{code:Z.invalid_type,expected:X.object,received:n.parsedType}),_w;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new ww(n,e,n.path,e)),value:a._parse(new ww(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?gw.mergeObjectAsync(t,r):gw.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Dw?new e({keyType:t,valueType:n,typeName:zT.ZodRecord,...Ew(r)}):new e({keyType:Qw.create(),valueType:t,typeName:zT.ZodRecord,...Ew(n)})}},xT=class extends Dw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.map)return Q(n,{code:Z.invalid_type,expected:X.map,received:n.parsedType}),_w;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new ww(n,e,n.path,[a,`key`])),value:i._parse(new ww(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return _w;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return _w;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};xT.create=(e,t,n)=>new xT({valueType:t,keyType:e,typeName:zT.ZodMap,...Ew(n)});var ST=class e extends Dw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.set)return Q(n,{code:Z.invalid_type,expected:X.set,received:n.parsedType}),_w;let r=this._def;r.minSize!==null&&n.data.sizer.maxSize.value&&(Q(n,{code:Z.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return _w;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new ww(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:$.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ST.create=(e,t)=>new ST({valueType:e,minSize:null,maxSize:null,typeName:zT.ZodSet,...Ew(t)});var CT=class e extends Dw{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==X.function)return Q(t,{code:Z.invalid_type,expected:X.function,received:t.parsedType}),_w;function n(e,n){return hw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,mw(),fw].filter(e=>!!e),issueData:{code:Z.invalid_arguments,argumentsError:n}})}function r(e,n){return hw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,mw(),fw].filter(e=>!!e),issueData:{code:Z.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof kT){let e=this;return yw(async function(...t){let o=new dw([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return yw(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new dw([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new dw([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:yT.create(t).rest(cT.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||yT.create([]).rest(cT.create()),returns:n||cT.create(),typeName:zT.ZodFunction,...Ew(r)})}},wT=class extends Dw{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};wT.create=(e,t)=>new wT({getter:e,typeName:zT.ZodLazy,...Ew(t)});var TT=class extends Dw{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Q(t,{received:t.data,code:Z.invalid_literal,expected:this._def.value}),_w}return{status:`valid`,value:e.data}}get value(){return this._def.value}};TT.create=(e,t)=>new TT({value:e,typeName:zT.ZodLiteral,...Ew(t)});function ET(e,t){return new DT({values:e,typeName:zT.ZodEnum,...Ew(t)})}var DT=class e extends Dw{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{expected:cw.joinValues(n),received:t.parsedType,code:Z.invalid_type}),_w}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{received:t.data,code:Z.invalid_enum_value,options:n}),_w}return yw(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};DT.create=ET;var OT=class extends Dw{_parse(e){let t=cw.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==X.string&&n.parsedType!==X.number){let e=cw.objectValues(t);return Q(n,{expected:cw.joinValues(e),received:n.parsedType,code:Z.invalid_type}),_w}if(this._cache||=new Set(cw.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=cw.objectValues(t);return Q(n,{received:n.data,code:Z.invalid_enum_value,options:e}),_w}return yw(e.data)}get enum(){return this._def.values}};OT.create=(e,t)=>new OT({values:e,typeName:zT.ZodNativeEnum,...Ew(t)});var kT=class extends Dw{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==X.promise&&t.common.async===!1?(Q(t,{code:Z.invalid_type,expected:X.promise,received:t.parsedType}),_w):yw((t.parsedType===X.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};kT.create=(e,t)=>new kT({type:e,typeName:zT.ZodPromise,...Ew(t)});var AT=class extends Dw{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===zT.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{Q(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return _w;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?_w:r.status===`dirty`||t.value===`dirty`?vw(r.value):r});{if(t.value===`aborted`)return _w;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?_w:r.status===`dirty`||t.value===`dirty`?vw(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?_w:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?_w:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Sw(e))return _w;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Sw(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):_w)}cw.assertNever(r)}};AT.create=(e,t,n)=>new AT({schema:e,typeName:zT.ZodEffects,effect:t,...Ew(n)}),AT.createWithPreprocess=(e,t,n)=>new AT({schema:t,effect:{type:`preprocess`,transform:e},typeName:zT.ZodEffects,...Ew(n)});var jT=class extends Dw{_parse(e){return this._getType(e)===X.undefined?yw(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};jT.create=(e,t)=>new jT({innerType:e,typeName:zT.ZodOptional,...Ew(t)});var MT=class extends Dw{_parse(e){return this._getType(e)===X.null?yw(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};MT.create=(e,t)=>new MT({innerType:e,typeName:zT.ZodNullable,...Ew(t)});var NT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===X.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};NT.create=(e,t)=>new NT({innerType:e,typeName:zT.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...Ew(t)});var PT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Cw(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new dw(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new dw(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};PT.create=(e,t)=>new PT({innerType:e,typeName:zT.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...Ew(t)});var FT=class extends Dw{_parse(e){if(this._getType(e)!==X.nan){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.nan,received:t.parsedType}),_w}return{status:`valid`,value:e.data}}};FT.create=e=>new FT({typeName:zT.ZodNaN,...Ew(e)});var IT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},LT=class e extends Dw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?_w:e.status===`dirty`?(t.dirty(),vw(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?_w:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:zT.ZodPipeline})}},RT=class extends Dw{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Sw(e)&&(e.value=Object.freeze(e.value)),e);return Cw(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};RT.create=(e,t)=>new RT({innerType:e,typeName:zT.ZodReadonly,...Ew(t)}),pT.lazycreate;var zT;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(zT||={});var BT=Qw.create;eT.create,FT.create,tT.create;var VT=nT.create;rT.create,iT.create,aT.create,oT.create;var HT=sT.create;cT.create,lT.create,uT.create,dT.create;var UT=pT.create;pT.strictCreate,mT.create;var WT=gT.create;vT.create,yT.create,bT.create,xT.create,ST.create,CT.create,wT.create;var GT=TT.create,KT=DT.create;OT.create,kT.create,AT.create,jT.create,MT.create,AT.createWithPreprocess,LT.create;var qT=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,JT=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(qT);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},YT=e=>e===`*`||e===`x`||e===`X`,XT=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},ZT=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],QT=(e,t)=>{if(YT(e)||YT(t))return 0;let[n,r]=ZT(XT(e),XT(t));return n>r?1:n{for(let n=0;n{let n=JT(e),r=JT(t),i=n.pop(),a=r.pop(),o=$T(n,r);return o===0?i&&a?$T(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},tE=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function nE(){return rg()}function rE(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&rE(t);return e}var iE=524288;function aE(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;tn)return!0;i.push(e[o])}}}}return!1}async function oE(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!aE(t,n,iE),c=s?tE(t):t,l=s?tE(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(rE(c),rE(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=tE(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=tE(e.state),d=!0,n=!0),s&&n&&aE(c,l,iE)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(o&&e instanceof TypeError){if(a)throw e;console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e)}else a||console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?tE(c):c}:{},...d?{state:Object.isFrozen(l)?tE(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function sE(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,n=e.lifecycle??!0,r=e.verbose??!1;return{enabled:t||n,events:t,lifecycle:n,verbose:r}}function cE(e){if(e instanceof lE)return e;if(e===!0)return new lE(sE(!0))}var lE=class{constructor(e){this.config=e}event(e,t,n,r){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof n==`string`?n:JSON.stringify(n)):console.debug(`[${e}] ${t}`,r??n))}lifecycle(e,t,n){this.config.lifecycle&&(n?console.debug(`[${e}] ${t}`,n):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function uE(e){return e.enabled?new lE(e):void 0}function dE(e,t,n){if(t){let r=e.find(e=>e.id===t);if(r?.role===`assistant`)return r;r&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${r.role}' message, not assistant — falling back to toolCallId`);let i={id:r?n:t,role:`assistant`,toolCalls:[]};return e.push(i),i}let r={id:n,role:`assistant`,toolCalls:[]};return e.push(r),r}function fE(e,t){return!e||t.metadata===void 0?!1:(e.metadata=Y_(e.metadata,tE(t.metadata)),!0)}var pE=(e,t,n,r,i)=>{let a=cE(i),o=tE(n.messages),s=tE(e.state),c={},l=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},u=()=>{let e=tE(c);return c={},e.messages!==void 0||e.state!==void 0?Nx(e):ex};return t.pipe(Ux(async t=>{let i=await oE(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(l(i),i.stopPropagation===!0?a?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):a?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return u();switch(t.type){case G.TEXT_MESSAGE_START:{let i=await oE(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r,subagentRunId:i}=t,a=o.find(t=>t.id===e);if(a?.role===`activity`)return console.warn(`TEXT_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and text messages`),u();let s=a;if(!s){let t={id:e,role:n,content:``,...r!==void 0&&{name:r},...i!=null&&{subagentRunId:i}};o.push(t),s=t}let c=fE(s,t);(!a||c)&&l({messages:o})}return u()}case G.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),u();if(c.role===`activity`)return console.warn(`TEXT_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),u();let d=await oE(r,o,s,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof c.content==`string`?c.content:``}));return l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,fE(c,t),l({messages:o})),u()}case G.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),u();if(a.role===`activity`)return console.warn(`TEXT_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),u();let c=await oE(r,o,s,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}));return l(c),c.stopPropagation!==!0&&fE(a,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()}case G.TOOL_CALL_START:{let i=await oE(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t,a=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(a){let r=a.function.name!==n;return r&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${a.function.name}' — updating it to '${n}'`),a.function.name=n),(fE(a,t)||r)&&l({messages:o}),u()}let s=new Set(o.map(e=>e.id)),c=dE(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let d={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(d),fE(d,t),l({messages:o})}return u()}case G.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,c=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!c)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),u();let d=c.toolCalls?.find(e=>e.id===i);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),u();let f=await oE(r,o,s,(r,i,a)=>{let o=d.function.arguments,s=d.function.name,c={};try{c=Xx(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return l(f),f.stopPropagation!==!0&&(d.function.arguments+=a,fE(d,t),l({messages:o})),u()}case G.TOOL_CALL_END:{let{toolCallId:i}=t,a=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),u();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),u();let d=await oE(r,o,s,(r,i,a)=>{let o=c.function.arguments,s=c.function.name,l={};try{l=JSON.parse(o)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:s,toolCallArgs:l})});return l(d),d.stopPropagation!==!0&&fE(c,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),u()}case G.TOOL_CALL_RESULT:{let i=await oE(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:u,subagentRunId:d}=t,f={id:i,toolCallId:a,role:u||`tool`,content:c,...d!=null&&{subagentRunId:d}};fE(f,t);let p=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(p===-1)o.push(f);else{let e=p+1;for(;e{t.onNewMessage?.({message:f,messages:o,state:s,agent:n,input:e})})),l({messages:o})}return u()}case G.STATE_SNAPSHOT:{let i=await oE(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,l({state:s})}return u()}case G.STATE_DELTA:{let i=await oE(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=Qy.applyPatch(s,e,!0,!1).newDocument,l({state:s})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(s,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return u()}case G.MESSAGES_SNAPSHOT:{let i=await oE(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messages:e}=t,n=e.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}),r=new Map(n.map(e=>[e.id,e])),i=n.some(e=>e.role===`activity`),a=n.some(e=>e.role===`reasoning`),s=e=>e.role===`activity`&&!i||e.role===`reasoning`&&!a;o=o.filter(e=>s(e)||r.has(e.id)).map(e=>s(e)?e:r.get(e.id));let c=new Set(o.map(e=>e.id));for(let e of n)c.has(e.id)||o.push(e);l({messages:o})}return u()}case G.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,d=c?.role===`activity`?c:void 0,f=i.replace??!0,p=await oE(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d,existingMessage:c}));if(l(p),p.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:tE(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,u;a===-1?(o.push(t),c=t,u=t):d?(f&&(o[a]={...d,activityType:i.activityType,content:tE(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),u=o[a]):f&&(o[a]=t,c=t,u=t),fE(u,i),l({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return u()}case G.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return u();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),u();let d=c,f=await oE(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d}));if(l(f),f.stopPropagation!==!0)try{fE(d,i)&&l({messages:o});let e=tE(d.content??{}),t=Qy.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...d,content:tE(t),activityType:i.activityType},l({messages:o})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return u()}case G.RAW:return l(await oE(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.CUSTOM:return l(await oE(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.RUN_STARTED:{let i=await oE(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages){let e=t;if(t.subagentRunId===null){let n={...t};delete n.subagentRunId,e=n}o.find(t=>t.id===e.id)||o.push(e)}l({messages:o})}}return u()}case G.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:{event:i,outcome:`success`,result:i.result},c=await oE(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return l(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?a.interrupts.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}):[]),u()}case G.RUN_ERROR:return l(await oE(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.STEP_STARTED:return l(await oE(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.STEP_FINISHED:return l(await oE(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case G.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case G.THINKING_START:return u();case G.THINKING_END:return u();case G.THINKING_TEXT_MESSAGE_START:return u();case G.THINKING_TEXT_MESSAGE_CONTENT:return u();case G.THINKING_TEXT_MESSAGE_END:return u();case G.REASONING_START:return l(await oE(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.REASONING_MESSAGE_START:{let i=await oE(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e),i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=fE(i,t);(!r||a)&&l({messages:o})}return u()}case G.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),u();let d=await oE(r,o,s,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof c.content==`string`?c.content:``}));return l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,fE(c,t),l({messages:o})),u()}case G.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),u();let c=await oE(r,o,s,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}));return l(c),c.stopPropagation!==!0&&fE(a,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()}case G.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case G.REASONING_END:return l(await oE(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:d}=t,f=await oE(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(f),f.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of o)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=d,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=d,e=!0)}e&&(c.messages=o)}return u()}case G.SUBAGENT_STARTED:return l(await oE(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.SUBAGENT_FINISHED:return l(await oE(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.SUBAGENT_ERROR:return l(await oE(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u()}return t.type,u()}),zx(),r.length>0?Wx({}):e=>e)},mE=e=>t=>{let n=cE(e),r=new Set,i=new Set,a=new Set,o={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},s=!1,c=!1,l=!1,u=new Map,d=e=>{let t=u.get(e);return t||(t=new Map,u.set(e,t)),t},f=()=>{for(let e of u.values())if(e.size>0)return!0;return!1},p=new Map,m=new Set,h=!1,g=!1,_=!1,v=()=>{r.clear(),i.clear(),a.clear(),o.message.clear(),o.toolCall.clear(),o.activity.clear(),o.reasoning.clear(),u.clear(),p.clear(),m.clear(),h=!1,g=!1,s=!1,c=!1,_=!0},y=(e,t)=>{let n=e??[];if(Array.isArray(n))for(let e of n){if(!e||typeof e.id!=`string`)continue;if(e.subagentRunId===null)return new hv(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?o.reasoning:e.role===`activity`?o.activity:o.message;(t||!n.has(e.id))&&n.set(e.id,{subagentRunId:e.subagentRunId});for(let n of e.toolCalls??[])n&&typeof n.id==`string`&&(t||!o.toolCall.has(n.id))&&o.toolCall.set(n.id,{subagentRunId:e.subagentRunId??void 0})}},b=(e,t,n,r,i)=>{if(t!==void 0&&n&&n.subagentRunId!==t)return new hv(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(Rx(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),c&&t!==G.RUN_STARTED)return K(()=>new hv(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(s&&t!==G.RUN_ERROR&&t!==G.RUN_STARTED)return K(()=>new hv(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!l){if(l=!0,t!==G.RUN_STARTED&&t!==G.RUN_ERROR)return K(()=>new hv(`First event must be 'RUN_STARTED'`))}else if(t===G.RUN_STARTED){if(_&&!s&&!c)return K(()=>new hv(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(s||c)&&v()}if(e.subagentRunId===null)return K(()=>new hv(`Cannot send '${t}' with 'subagentRunId: null'. The field is optional — omit it entirely.`));if(t===G.SUBAGENT_STARTED||t===G.SUBAGENT_FINISHED||t===G.SUBAGENT_ERROR){let n=t===G.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===G.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return K(()=>new hv(`Cannot send '${t}' with '${r}: null'. The field is optional — omit it entirely.`));let r=e.outcome;if(r!=null&&r.type!==`success`&&r.type!==`suspended`)return K(()=>new hv(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return K(()=>new hv(`Cannot send '${t}' with 'outcome.interruptIds: null'. The field is optional — omit it entirely.`));if(r&&Array.isArray(r.interruptIds)&&r.interruptIds.some(e=>typeof e!=`string`))return K(()=>new hv(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===G.RUN_FINISHED){let t=e.outcome;if(t?.type===`interrupt`&&Array.isArray(t.interrupts)){for(let e of t.interrupts)if(e&&e.subagentRunId===null)return K(()=>new hv(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case G.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return K(()=>new hv(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${n}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`));let i=o.message.get(n);if(i){let r=b(t,e.subagentRunId,i,`message`,n);if(r)return K(()=>r)}return r.add(n),i||o.message.set(n,{subagentRunId:e.subagentRunId}),Nx(e)}case G.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return K(()=>new hv(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${n}'. Start a text message with 'TEXT_MESSAGE_START' first.`));let i=b(t,e.subagentRunId,o.message.get(n),`message`,n);return i?K(()=>i):Nx(e)}case G.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return K(()=>new hv(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${n}'. A 'TEXT_MESSAGE_START' event must be sent first.`));let i=b(t,e.subagentRunId,o.message.get(n),`message`,n);return i?K(()=>i):(r.delete(n),Nx(e))}case G.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return K(()=>new hv(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${n}' is already in progress. Complete it with 'TOOL_CALL_END' first.`));let r=e.parentMessageId,a=e.subagentRunId,s;if(r!==void 0){let e=o.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return K(()=>new hv(`Cannot send 'TOOL_CALL_START': subagentRunId '${a}' does not match its parent message '${r}' owner '${e.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`));s=e}}let c=o.toolCall.get(n);if(c){let e=b(t,a,c,`tool call`,n);if(e)return K(()=>e);if(a===void 0&&s&&s.subagentRunId!==c.subagentRunId)return K(()=>new hv(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${s.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||o.toolCall.set(n,a===void 0?s??{subagentRunId:void 0}:{subagentRunId:a}),Nx(e)}case G.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return K(()=>new hv(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${n}'. Start a tool call with 'TOOL_CALL_START' first.`));let r=b(t,e.subagentRunId,o.toolCall.get(n),`tool call`,n);return r?K(()=>r):Nx(e)}case G.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return K(()=>new hv(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${n}'. A 'TOOL_CALL_START' event must be sent first.`));let r=b(t,e.subagentRunId,o.toolCall.get(n),`tool call`,n);return r?K(()=>r):(i.delete(n),Nx(e))}case G.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return d(n).has(t)?K(()=>new hv(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(d(n).set(t,!0),Nx(e))}case G.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!d(n).has(t)){let e,r=!1;for(let[i,a]of u)if(i!==n&&a.has(t)){e=i,r=!0;break}return K(r?()=>new hv(`Cannot send 'STEP_FINISHED' for step "${t}" attributed to ${n===void 0?`the parent agent`:`subagent '${n}'`}: that step is open under ${e===void 0?`the parent agent`:`subagent '${e}'`}. A step must be finished by whoever started it.`):()=>new hv(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return d(n).delete(t),Nx(e)}case G.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!o.activity.has(t)||e.replace!==!1)&&o.activity.set(t,{subagentRunId:e.subagentRunId}),Nx(e)}case G.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&o.message.set(t,{subagentRunId:e.subagentRunId}),Nx(e)}case G.REASONING_START:case G.REASONING_MESSAGE_START:{let n=e.messageId,r=o.reasoning.get(n);if(r){let i=b(t,e.subagentRunId,r,`reasoning message`,n);if(i)return K(()=>i)}return a.add(n),r||o.reasoning.set(n,{subagentRunId:e.subagentRunId}),Nx(e)}case G.REASONING_MESSAGE_CONTENT:case G.REASONING_MESSAGE_END:case G.REASONING_END:{let n=e.messageId,r=b(t,e.subagentRunId,o.reasoning.get(n),`reasoning message`,n);return r?K(()=>r):(t===G.REASONING_END&&a.delete(n),Nx(e))}case G.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?o.toolCall.get(n):r===`message`?o.message.get(n)??o.reasoning.get(n):o.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,s=b(t,e.subagentRunId,i,a,n);return s?K(()=>s):Nx(e)}case G.ACTIVITY_DELTA:{let n=e.messageId,r=b(t,e.subagentRunId,o.activity.get(n),`activity`,n);return r?K(()=>r):Nx(e)}case G.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return K(()=>new hv(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return K(()=>new hv(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return p.has(t)?K(()=>new hv(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):m.has(t)?K(()=>new hv(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!p.has(n)&&!m.has(n)?K(()=>new hv(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(p.set(t,!0),Nx(e))}case G.SUBAGENT_FINISHED:case G.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return K(()=>new hv(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===G.SUBAGENT_ERROR&&typeof e.message!=`string`)return K(()=>new hv(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return p.has(n)?(p.delete(n),m.add(n),Nx(e)):K(()=>new hv(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case G.MESSAGES_SNAPSHOT:{let t=y(e.messages,!0);if(t)return K(()=>t)}return Nx(e);case G.RUN_STARTED:_=!0;{let t=y((e.input??{}).messages,!1);if(t)return K(()=>t)}return Nx(e);case G.RUN_FINISHED:if(f()){let e=[];for(let[t,n]of u)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(p.size>0){let e=Array.from(p.keys()).join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return s=!0,Nx(e);case G.RUN_ERROR:return c=!0,Nx(e);case G.CUSTOM:return Nx(e);case G.THINKING_TEXT_MESSAGE_START:return h?g?K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.`)):(g=!0,Nx(e)):K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first.`));case G.THINKING_TEXT_MESSAGE_CONTENT:return g?Nx(e):K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first.`));case G.THINKING_TEXT_MESSAGE_END:return g?(g=!1,Nx(e)):K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first.`));case G.THINKING_START:return h?K(()=>new hv(`Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.`)):(h=!0,Nx(e));case G.THINKING_END:return h?(h=!1,Nx(e)):K(()=>new hv(`Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first.`));default:return Nx(e)}}))},hE=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),gE=e=>Bx(()=>Mx(e())).pipe(Kx(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return Mx(e.text()).pipe(Rx(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,K(()=>i)}))}let t={type:hE.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new Vb(e=>(e.next(t),(async()=>{try{for(;;){let{done:t,value:r}=await n.read();if(t)break;let i={type:hE.DATA,data:r};e.next(i)}e.complete()}catch(t){e.error(t)}})(),()=>{n.cancel().catch(e=>{if(e?.name!==`AbortError`)throw e})})):K(()=>Error(`Failed to getReader() from response`))})),_E=(e,t)=>{let n=cE(t),r=new Xb,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==hE.HEADERS&&e.type===hE.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e)}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(` `),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(` `),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},vE=e=>{let t=new Xb,n=new Uint8Array;e.subscribe({next:e=>{if(e.type!==hE.HEADERS&&e.type===hE.DATA&&e.data){let t=new Uint8Array(n.length+e.data.length);t.set(n,0),t.set(e.data,n.length),n=t,r()}},error:e=>t.error(e),complete:()=>{if(n.length>0)try{r()}catch{console.warn(`Incomplete or invalid protocol buffer data at stream end`)}t.complete()}});function r(){for(;n.length>=4;){let e=4+new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(n.length{let n=cE(t),r=new Xb,i=new $b,a=!1;return e.subscribe({next:e=>{if(i.next(e),e.type===hE.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?vE(i).subscribe({next:e=>r.next(e),error:e=>r.error(e),complete:()=>r.complete()}):_E(i,n).subscribe({next:e=>{try{let t=gy.parse(e);n?.event(`HTTP`,`Event validated:`,t,{type:t.type,valid:!0}),r.next(t)}catch(t){n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),r.error(t)}},error:e=>{if(e?.name===`AbortError`){r.next({type:G.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),r.complete();return}return r.error(e)},complete:()=>r.complete()})}else a||r.error(Error(`No headers event received before data events`))},error:e=>{i.error(e),r.error(e)},complete:()=>{i.complete()}}),r.asObservable()},bE=KT([`TextMessageStart`,`TextMessageContent`,`TextMessageEnd`,`ActionExecutionStart`,`ActionExecutionArgs`,`ActionExecutionEnd`,`ActionExecutionResult`,`AgentStateMessage`,`MetaEvent`,`RunStarted`,`RunFinished`,`RunError`,`NodeStarted`,`NodeFinished`]),xE=KT([`LangGraphInterruptEvent`,`PredictState`,`Exit`]);WT(`type`,[UT({type:GT(bE.enum.TextMessageStart),messageId:BT(),parentMessageId:BT().optional(),role:BT().optional()}),UT({type:GT(bE.enum.TextMessageContent),messageId:BT(),content:BT()}),UT({type:GT(bE.enum.TextMessageEnd),messageId:BT()}),UT({type:GT(bE.enum.ActionExecutionStart),actionExecutionId:BT(),actionName:BT(),parentMessageId:BT().optional()}),UT({type:GT(bE.enum.ActionExecutionArgs),actionExecutionId:BT(),args:BT()}),UT({type:GT(bE.enum.ActionExecutionEnd),actionExecutionId:BT()}),UT({type:GT(bE.enum.ActionExecutionResult),actionName:BT(),actionExecutionId:BT(),result:BT()}),UT({type:GT(bE.enum.AgentStateMessage),threadId:BT(),agentName:BT(),nodeName:BT(),runId:BT(),active:VT(),role:BT(),state:BT(),running:VT()}),UT({type:GT(bE.enum.MetaEvent),name:xE,value:HT()}),UT({type:GT(bE.enum.RunError),message:BT(),code:BT().optional()})]),UT({id:BT(),role:BT(),content:BT(),parentMessageId:BT().optional()}),UT({id:BT(),name:BT(),arguments:HT(),parentMessageId:BT().optional()}),UT({id:BT(),result:HT(),actionExecutionId:BT(),actionName:BT()});var SE=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(` -`)},CE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Rx(r=>{switch(r.type){case G.TEXT_MESSAGE_START:{let e=r;return[{type:bE.enum.TextMessageStart,messageId:e.messageId,role:e.role}]}case G.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:bE.enum.TextMessageContent,messageId:e.messageId,content:e.delta}]}case G.TEXT_MESSAGE_END:{let e=r;return[{type:bE.enum.TextMessageEnd,messageId:e.messageId}]}case G.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:bE.enum.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case G.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let p=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(Xx(d.function.arguments));e.tool_argument&&e.tool_argument in t?(f({...i,[e.state_key]:t[e.tool_argument]}),p=!0):e.tool_argument||(f({...i,[e.state_key]:t}),p=!0)}catch{}}return[{type:bE.enum.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...p?[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case G.TOOL_CALL_END:{let e=r;return[{type:bE.enum.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case G.TOOL_CALL_RESULT:{let e=r;return[{type:bE.enum.ActionExecutionResult,actionExecutionId:e.toolCallId,result:e.content,actionName:d[e.toolCallId]||`unknown`}]}case G.RAW:return[];case G.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:bE.enum.MetaEvent,name:e.name,value:e.value}]}case G.STATE_SNAPSHOT:return f(r.snapshot),[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case G.STATE_DELTA:{let c=r,l=Qy.applyPatch(i,c.delta,!0,!1);return l?(f(l.newDocument),[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]):[]}case G.MESSAGES_SNAPSHOT:return c=r.messages,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case G.RUN_STARTED:return[];case G.RUN_FINISHED:return c&&(i.messages=c),Object.keys(i).length===0?[]:[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:wE(c)}:{}}),active:!1}];case G.RUN_ERROR:{let e=r;return[{type:bE.enum.RunError,message:e.message,code:e.code}]}case G.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case G.STEP_FINISHED:return u=[],l=null,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function wE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=SE(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r={id:e.id,name:e.function.name,arguments:JSON.parse(e.function.arguments),parentMessageId:n.id};t.push(r)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:n.content,actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var TE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,EE=e=>e===`tool`?`toolCallId`:`messageId`,DE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},OE=e=>t=>{let n=cE(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:G.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:G.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:G.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&TE(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${EE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(Rx(e=>{switch(e.type){case G.TEXT_MESSAGE_START:case G.TEXT_MESSAGE_CONTENT:case G.TEXT_MESSAGE_END:case G.TOOL_CALL_START:case G.TOOL_CALL_ARGS:case G.TOOL_CALL_END:case G.TOOL_CALL_RESULT:case G.STATE_SNAPSHOT:case G.STATE_DELTA:case G.CUSTOM:case G.STEP_STARTED:case G.STEP_FINISHED:case G.THINKING_START:case G.THINKING_END:case G.THINKING_TEXT_MESSAGE_START:case G.THINKING_TEXT_MESSAGE_CONTENT:case G.THINKING_TEXT_MESSAGE_END:case G.REASONING_START:case G.REASONING_MESSAGE_START:case G.REASONING_MESSAGE_CONTENT:case G.REASONING_MESSAGE_END:case G.REASONING_END:return[...i(e.subagentRunId??void 0),e];case G.RUN_STARTED:case G.RUN_FINISHED:case G.RUN_ERROR:case G.MESSAGES_SNAPSHOT:return[...a(),e];case G.RAW:case G.ACTIVITY_SNAPSHOT:case G.ACTIVITY_DELTA:case G.REASONING_ENCRYPTED_VALUE:case G.SUBAGENT_STARTED:return[e];case G.SUBAGENT_FINISHED:case G.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case G.TEXT_MESSAGE_CHUNK:{let t=e,a=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),o=r.get(a),c=[],l;if(o?.kind===`text`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,name:t.name,subagentRunId:t.subagentRunId},r.set(a,{kind:`text`,fields:l});let e=DE({type:G.TEXT_MESSAGE_START,messageId:t.messageId,role:t.role||`assistant`,...t.name!==void 0&&{name:t.name},...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case G.TOOL_CALL_CHUNK:{let t=e,a=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),o=r.get(a),c=[],l;if(o?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===o.fields.toolCallId))l=o.fields;else{if(c.push(...i(a)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);l={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`tool`,fields:l});let e=DE({type:G.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:l.toolCallId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case G.REASONING_MESSAGE_CHUNK:{let t=e,a=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),o=r.get(a),c=[],l;if(o?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`reasoning`,fields:l});let e=DE({type:G.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}}return e.type,[]}),Gx(()=>{a()}))};function kE(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}var AE=class{runNext(e,t){return t.run(e).pipe(OE(!1))}runNextWithState(e,t){let n=tE(e.messages||[]),r=tE(e.state||{}),i=new $b;return pE(e,i,t,[]).subscribe(e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)}),this.runNext(e,t).pipe(Ux(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:tE(n),state:tE(r)})))}},jE=class extends AE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function ME(e){let t=e.content;if(Array.isArray(t)){let n=t.filter(e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``);return{...e,content:n}}return typeof t==`string`?e:{...e,content:``}}var NE=class extends AE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(ME)};return this.runNext(i,t)}},PE=`THINKING_START`,FE=`THINKING_END`,IE=`THINKING_TEXT_MESSAGE_START`,LE=`THINKING_TEXT_MESSAGE_CONTENT`,RE=`THINKING_TEXT_MESSAGE_END`,zE=class extends AE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(Ix(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case PE:{this.currentReasoningId=nE();let{title:t,...n}=e;return this.warnAboutTransformation(PE,G.REASONING_START),{...n,type:G.REASONING_START,messageId:this.currentReasoningId}}case IE:return this.currentMessageId=nE(),this.warnAboutTransformation(IE,G.REASONING_MESSAGE_START),{...e,type:G.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`assistant`};case LE:{let{delta:t,...n}=e;return this.warnAboutTransformation(LE,G.REASONING_MESSAGE_CONTENT),{...n,type:G.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??nE(),delta:t}}case RE:{let t=this.currentMessageId??nE();return this.warnAboutTransformation(RE,G.REASONING_MESSAGE_END),{...e,type:G.REASONING_MESSAGE_END,messageId:t}}case FE:{let t=this.currentReasoningId??nE();return this.warnAboutTransformation(FE,G.REASONING_END),{...e,type:G.REASONING_END,messageId:t}}default:return e}}};function BE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function VE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function HE(e){let t=BE(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e}function UE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>VE(e)?HE(e):e);return{...e,content:n}}var WE=class extends AE{run(e,t){let n={...e,messages:e.messages.map(UE)};return this.runNext(n,t)}},GE=`SUBAGENT_STARTED`,KE=`SUBAGENT_FINISHED`,qE=`SUBAGENT_ERROR`;function JE(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function YE(e){return e.map(e=>JE(e))}var XE=class extends AE{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>JE(e))};return this.runNext(n,t).pipe(Jx(e=>{let t=e.type;(t===GE||t===KE||t===qE)&&this.warnDroppedLifecycleEvent(t)}),Vx(e=>{let t=e.type;return t!==GE&&t!==KE&&t!==qE}),Ix(e=>{let t=JE(e);if(t.type===G.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:YE(e.messages)}}if(t.type===G.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>JE(e))}}}if(t.type===G.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:YE(e.input.messages)}}}return t}))}},ZE=`0.0.59`,QE=class{get maxVersion(){return ZE}get debug(){return this._debug}set debug(e){this._debug=sE(e),this._debugLogger=uE(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?uE(sE(!0)):void 0:e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??``,this.threadId=n??rg(),this.messages=tE(r??[]),this.state=tE(i??{}),this._debug=sE(a),this._debugLogger=uE(this._debug),eE(this.maxVersion,`0.0.39`)<=0&&this.middlewares.unshift(new NE),eE(this.maxVersion,`0.0.45`)<=0&&this.middlewares.unshift(new zE),eE(this.maxVersion,`0.0.47`)<=0&&this.middlewares.unshift(new WE),eE(this.maxVersion,`0.0.57`)<=0&&this.middlewares.unshift(new XE)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new jE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??rg();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Fx(zb(()=>this.middlewares.length===0?this.run(n):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),OE(this.debugLogger),mE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),Gx(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)));let s=tE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new gv}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??rg();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Fx(zb(()=>Bx(()=>this.connect(n)),OE(this.debugLogger),mE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.isRunning=!1,e instanceof gv?ex:this.onError(n,e,a))),Gx(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)),{defaultValue:void 0});let s=tE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return pE(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Jx(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=tE(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||rg(),tools:tE(e?.tools??[]),context:tE(e?.context??[]),forwardedProps:tE(e?.forwardedProps??{}),state:tE(this.state),messages:n,...e?.resume===void 0?{}:{resume:tE(e.resume)}}}async onInitialize(e,t){if(this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new hv(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let e of this.pendingInterrupts)if(kE(e))throw new hv(`Interrupt ${e.id} expired at ${e.expiresAt}`)}let n=await oE(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return Mx(oE(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Ix(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await oE(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=tE(this.messages),e.state=tE(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=tE(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=tE(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=tE(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??rg();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t)).pipe(OE(this.debugLogger),mE(this.debugLogger),CE(this.threadId,t.runId,this.agentId),e=>e.pipe(Ix(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function $E(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var eD=class extends QE{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify($E(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=tE(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return yE(gE(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=tE(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},tD=L.createContext(void 0),nD=e=>{let t=L.useContext(tD);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},rD=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(tD.Provider,{value:e,children:t})),iD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},aD=new class{#e=iD;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function oD(e){setTimeout(e,0)}var sD=typeof window>`u`||`Deno`in globalThis;function cD(){}function lD(e,t){return typeof e==`function`?e(t):e}function uD(e){return typeof e==`number`&&e>=0&&e!==1/0}function dD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fD(e,t){return typeof e==`function`?e(t):e}function pD(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==hD(o,t.options))return!1}else if(!_D(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function mD(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(gD(t.options.mutationKey)!==gD(a))return!1}else if(!_D(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function hD(e,t){return(t?.queryKeyHashFn||gD)(e)}function gD(e){return JSON.stringify(e,(e,t)=>SD(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function _D(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n500)return t;let r=xD(e)&&xD(t);if(!r&&!(SD(e)&&SD(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{aD.setTimeout(t,e)})}function TD(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:yD(e,t)}function ED(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function DD(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var OD=Symbol();function kD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===OD?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function AD(e,t){return typeof e==`function`?e(...t):!!e}function jD(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var MD=()=>sD,ND=()=>MD(),PD=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},FD=new class extends PD{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ID=oD;function LD(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ID,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var RD=LD(),zD=new class extends PD{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function BD(e){return Math.min(1e3*2**e,3e4)}function VD(e){return(e??`online`)!==`online`||zD.isOnline()}var HD=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function UD(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(cD);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new HD(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>FD.isFocused()&&(e.networkMode===`always`||zD.isOnline())&&e.canRun(),p=()=>VD(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ND()?0:3),a=e.retryDelay??BD,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nf()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var WD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uD(this.gcTime)&&(this.#e=aD.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ND()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(aD.clearTimeout(this.#e),this.#e=void 0)}};function GD(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{jD(e,()=>t.signal,()=>n=!0)},u=kD(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?DD:ED;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?qD:KD,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:KD(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function KD(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function qD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function JD(e,t){return t?KD(e,t)!=null:!1}function YD(e,t){return!t||!e.getPreviousPageParam?!1:qD(e,t)!=null}var XD=class extends WD{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=$D(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=$D(this.options);e.data!==void 0&&(this.setState(QD(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=TD(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(cD).catch(cD):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>fD(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===OD||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>fD(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!dD(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=kD(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?GD(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=UD({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof HD&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof HD){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ZD(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...QD(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),RD.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ZD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:VD(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function QD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function $D(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var eO=class extends PD{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),nO(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rO(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rO(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof fD(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!bD(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&iO(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||fD(this.options.enabled,this.#t)!==fD(t.enabled,this.#t)||fD(this.options.staleTime,this.#t)!==fD(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||fD(this.options.enabled,this.#t)!==fD(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return bD(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(cD)),t}#h(e){return!ND()&&fD(this.options.enabled,this.#t)!==!1&&uD(e)}#g(){this.#b();let e=fD(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=dD(this.#r.dataUpdatedAt,e)+1;this.#u=aD.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=aD.setInterval(()=>{(this.options.refetchIntervalInBackground||FD.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(aD.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(aD.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&nO(e,t),o=i&&iO(e,n,t,r);(a||o)&&(l={...l,...ZD(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=TD(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=TD(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:aO(e,t),refetch:this.refetch,isEnabled:fD(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),bD(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();RD.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function tO(e,t){return fD(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||fD(t.retryOnMount,e)!==!1)}function nO(e,t){return tO(e,t)||e.state.data!==void 0&&rO(e,t,t.refetchOnMount)}function rO(e,t,n){if(fD(t.enabled,e)!==!1&&fD(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&aO(e,t)}return!1}function iO(e,t,n,r){return(e!==t||fD(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&aO(e,n)}function aO(e,t){return fD(t.enabled,e)!==!1&&e.isStaleByTime(fD(t.staleTime,e))}var oO=class extends eO{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:JD(t,n.data),hasPreviousPage:YD(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},sO=class extends WD{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||cO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=UD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),RD.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function cO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var lO=class extends PD{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new sO({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=uO(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){RD.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>mD(t,e))}findAll(e={}){return this.getAll().filter(t=>mD(e,t))}notify(e){RD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return RD.batch(()=>Promise.all(e.map(e=>e.continue().catch(cD))))}};function uO(e){return e.options.scope?.id}var dO=class extends PD{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??hD(r,t),a=this.get(i);return a||(a=new XD({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){RD.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>pD(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>pD(e,t)):t}notify(e){RD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){RD.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){RD.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fO=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new dO,this.#t=e.mutationCache||new lO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=FD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=zD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fD(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=lD(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return RD.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;RD.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return RD.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=RD.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(cD).catch(cD)}invalidateQueries(e,t={}){return RD.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=RD.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(cD)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(cD)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(fD(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(fD(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cD).catch(cD)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cD).catch(cD)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return zD.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(gD(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{_D(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(gD(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{_D(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=hD(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===OD&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},pO=L.createContext(!1),mO=()=>L.useContext(pO);pO.Provider;function hO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gO=L.createContext(hO()),_O=()=>L.useContext(gO),vO=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?AD(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},yO=e=>{L.useEffect(()=>{e.clearReset()},[e])},bO=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||AD(n,[e.error,r])),xO=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},SO=(e,t)=>e?.suspense&&t.isPending,CO=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wO(e,t,n){let r=mO(),i=_O(),a=nD(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,xO(o),vO(o,i,s),yO(i);let[l]=L.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(L.useSyncExternalStore(L.useCallback(e=>{let t=d?l.subscribe(RD.batchCalls(e)):cD;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),L.useEffect(()=>{l.setOptions(o)},[o,l]),SO(o,u))throw CO(o,l,i);if(bO({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function TO(e,t){return wO(e,eO,t)}function EO(e,t){return wO(e,oO,t)}var DO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),OO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),kO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),AO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z`}))]]),jO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm84,108a83.64,83.64,0,0,1-4.47,27L167,130a19.65,19.65,0,0,0-7.8-2.78l-22.82-3.08A20.14,20.14,0,0,0,117.72,132h-4.07l-2.71-5.6a19.88,19.88,0,0,0-13.8-10.84L94.46,115l4-7h14.39a20,20,0,0,0,9.66-2.49l12.25-6.76a20.57,20.57,0,0,0,3.74-2.68l26.92-24.33A20,20,0,0,0,172,56.49,84,84,0,0,1,212,128ZM140.76,45l6.2,11.1L122.75,78l-10.93,6H96.14A20.05,20.05,0,0,0,78.78,94.06l-4.49,7.85L67.68,84.28l9.91-23.42A83.91,83.91,0,0,1,140.76,45ZM44,128a83.52,83.52,0,0,1,4.4-26.77l7.74,20.65a19.89,19.89,0,0,0,14.52,12.53l19.53,4.2,3,6.1a20.11,20.11,0,0,0,13.55,10.77l-5,11.12a20,20,0,0,0,3.58,21.71l.21.22,18.16,18.7-.89,4.59A84.09,84.09,0,0,1,44,128Zm103.65,81.66a20.11,20.11,0,0,0-5-17.3l-.21-.22-17.72-18.25,11.37-25.52,19,2.56,41.43,25.48A84.2,84.2,0,0,1,147.65,209.66Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M213.09,172.48a96,96,0,0,1-80.41,51.41l3.17-16.44a8,8,0,0,0-2-6.95l-19.74-20.33a8,8,0,0,1-1.44-8.69l13.7-30.74a8,8,0,0,1,8.38-4.67l22.82,3.08a8.11,8.11,0,0,1,3.12,1.11ZM116.71,95,129,88.24a7.46,7.46,0,0,0,1.5-1.07l26.91-24.33A8,8,0,0,0,159,53l-10.5-18.81A96.62,96.62,0,0,0,128,32,95.61,95.61,0,0,0,67.78,53.23L56,81.08A8,8,0,0,0,55.88,87l11.5,30.67a8,8,0,0,0,5.81,5l2.69.58L89.2,100a8,8,0,0,1,6.94-4h16.71A7.9,7.9,0,0,0,116.71,95Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm90,102a89.55,89.55,0,0,1-7.46,35.86l-46.69-28.71a13.94,13.94,0,0,0-5.46-2l-22.82-3.07A14.06,14.06,0,0,0,121.06,138h-9.92a2,2,0,0,1-1.8-1.13l-3.8-7.86a13.94,13.94,0,0,0-9.66-7.59l-10.71-2.3L94.4,103a2,2,0,0,1,1.74-1h16.71a13.9,13.9,0,0,0,6.76-1.75l12.25-6.75a14.73,14.73,0,0,0,2.62-1.88l26.91-24.33a13.93,13.93,0,0,0,2.83-17.21L161,44.25A90.16,90.16,0,0,1,218,128ZM144.6,39.54l9.15,16.39a2,2,0,0,1-.41,2.46L126.43,82.72a1.84,1.84,0,0,1-.37.27l-12.25,6.76a2,2,0,0,1-1,.25H96.14A14,14,0,0,0,84,97L73.18,115.91a2,2,0,0,1-.19-.35L61.5,84.89a2,2,0,0,1,0-1.48L72.68,57.06A89.9,89.9,0,0,1,144.6,39.54ZM38,128A89.52,89.52,0,0,1,49.38,84.23a13.85,13.85,0,0,0,.89,4.87l11.49,30.67a13.94,13.94,0,0,0,10.16,8.78l21.44,4.6a2,2,0,0,1,1.38,1.09l3.8,7.86a14.07,14.07,0,0,0,12.6,7.9h4.56l-8.49,19a14,14,0,0,0,2.51,15.2l.1.11,19.68,20.26a2,2,0,0,1,.46,1.7L127.7,218A90.1,90.1,0,0,1,38,128Zm102.08,89.19,1.67-8.6a14.07,14.07,0,0,0-3.47-12.16l-.1-.11L118.5,176.06a2,2,0,0,1-.33-2.14l13.7-30.73A2,2,0,0,1,134,142l22.82,3.08a2,2,0,0,1,.78.27L205,174.55A90.18,90.18,0,0,1,140.08,217.19Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm92,100a91.44,91.44,0,0,1-8.58,38.76L162.8,136.85a12.07,12.07,0,0,0-4.68-1.67l-22.82-3.07a12,12,0,0,0-12.56,7l-.4.88h-11.2a4,4,0,0,1-3.6-2.26l-3.8-7.86a11.93,11.93,0,0,0-8.28-6.5L82.07,120.5,92.67,102a4,4,0,0,1,3.47-2h16.71a12,12,0,0,0,5.8-1.5l12.24-6.76a11.79,11.79,0,0,0,2.25-1.6L160.05,65.8a12,12,0,0,0,2.43-14.75l-5.86-10.49A92.17,92.17,0,0,1,220,128ZM145.89,37.75l9.6,17.2a4,4,0,0,1-.81,4.92L127.77,84.21a4.41,4.41,0,0,1-.75.53L114.78,91.5a4,4,0,0,1-1.93.5H96.14a12,12,0,0,0-10.41,6l-11.86,20.7a4,4,0,0,1-2.75-2.47L59.63,85.6a4,4,0,0,1,.06-3L71,55.81A91.51,91.51,0,0,1,128,36,92.53,92.53,0,0,1,145.89,37.75ZM36,128A91.52,91.52,0,0,1,56,70.77l-3.71,8.75a12,12,0,0,0-.18,8.88l11.49,30.67a11.93,11.93,0,0,0,8.72,7.52l21.43,4.61a4,4,0,0,1,2.76,2.17l3.8,7.86a12.07,12.07,0,0,0,10.8,6.77h7.64L109,169.85A12,12,0,0,0,111.26,183l19.68,20.26a4,4,0,0,1,1,3.47L129.36,220,128,220A92.1,92.1,0,0,1,36,128Zm101.6,91.5,2.18-11.29a12.08,12.08,0,0,0-3-10.49l-19.68-20.26a4,4,0,0,1-.71-4.35l13.7-30.74a4,4,0,0,1,4.18-2.33l22.82,3.07a4.12,4.12,0,0,1,1.56.56l49.11,30.2A92.12,92.12,0,0,1,137.6,219.5Z`}))]]),MO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),NO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),PO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),FO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),IO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),LO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),RO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),zO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),BO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),VO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:DO}));VO.displayName=`ArrowLeftIcon`;var HO=VO,UO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:OO}));UO.displayName=`ArrowRightIcon`;var WO=UO,GO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:kO}));GO.displayName=`DotsThreeIcon`;var KO=GO,qO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:AO}));qO.displayName=`GithubLogoIcon`;var JO=qO,YO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:jO}));YO.displayName=`GlobeHemisphereWestIcon`;var XO=YO,ZO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:MO}));ZO.displayName=`MagnifyingGlassIcon`;var QO=ZO,$O=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:NO}));$O.displayName=`MoonIcon`;var ek=$O,tk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:PO}));tk.displayName=`PencilSimpleIcon`;var nk=tk,rk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:FO}));rk.displayName=`PlusIcon`;var ik=rk,ak=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:IO}));ak.displayName=`SignOutIcon`;var ok=ak,sk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:LO}));sk.displayName=`SparkleIcon`;var ck=sk,lk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:RO}));lk.displayName=`SunIcon`;var uk=lk,dk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:zO}));dk.displayName=`TrashIcon`;var fk=dk,pk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:BO}));pk.displayName=`UserPlusIcon`;var mk=pk,hk=`fanout.access-token`,gk=`fanout:unauthorized`;function _k(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`?``:`${t.pathname}${t.search}`}function vk(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function yk(){localStorage.removeItem(hk)}function bk(){yk(),window.dispatchEvent(new Event(gk))}async function xk(e,t={}){let n=new Headers(t.headers);n.set(`Fanout-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&bk(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw Error(e.message??e.error??`You do not have permission to perform this action.`)}return r}async function Sk(){let e=await xk(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&bk(),window.location.assign(`/`)}var Ck=(0,L.createContext)(null);function wk(){let e=(0,L.useContext)(Ck);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var Tk=(0,L.createContext)(null);function Ek(){let e=(0,L.useContext)(Tk);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function Dk(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``?null:{id:t.id,email:typeof t.email==`string`?t.email:``,name:typeof t.name==`string`?t.name:``,role:typeof t.role==`string`?t.role:``}}async function Ok(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??r.error??`Request failed (${n.status})`);return r}function kk({children:e,wide:t=!1}){return(0,R.jsx)(we,{mih:`100dvh`,style:{background:`radial-gradient(circle at 50% -12%, var(--mantine-color-brand-light), transparent 38%), linear-gradient(180deg, var(--mantine-color-default-hover), var(--mantine-color-body) 62%)`},children:(0,R.jsx)(oe,{mih:`100dvh`,px:`md`,py:48,children:(0,R.jsx)(D,{size:t?680:480,w:`100%`,children:(0,R.jsx)(Ee,{radius:28,p:{base:24,sm:40},style:{background:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-default-border)`,boxShadow:`var(--mantine-shadow-xl)`},children:e})})})})}function Ak(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function jk(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function Mk({children:e}){let t=bi(),[n,r]=(0,L.useState)(null),[i,a]=(0,L.useState)(!1),[o,s]=(0,L.useState)(`none`),[c,l]=(0,L.useState)(null),[u,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(``),[g,_]=(0,L.useState)(Ak),[v,y]=(0,L.useState)(jk),[b,x]=(0,L.useState)(``),[S,w]=(0,L.useState)(!1),[T,E]=(0,L.useState)(0),[D,k]=(0,L.useState)(()=>Date.now()),[A,j]=(0,L.useState)(!1),[M,N]=(0,L.useState)(``),[ne,ie]=(0,L.useState)(null),[P,ae]=(0,L.useState)(!1),se=(0,L.useRef)(null),ce=_k(),le=o===`user`;async function ue(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){s(`none`),l(null);return}let t=await e.json().catch(()=>null);s(vk(t)),l(Dk(t))}async function fe(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;l(Dk(await e.json().catch(()=>null)))}catch{}}(0,L.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),t({href:e.pathname+e.search+e.hash,replace:!0}))},[t]),(0,L.useEffect)(()=>{yk(),Ok(`/api/auth/status`).then(r).catch(e=>N(String(e))).finally(()=>a(!0)),ue().catch(()=>s(`none`)).finally(()=>d(!0));let e=()=>{s(`none`),l(null)};return window.addEventListener(gk,e),()=>window.removeEventListener(gk,e)},[]),(0,L.useEffect)(()=>{u&&o===`none`&&v&&(j(!0),N(``),Ok(`/api/auth/login-link`,{token:v}).then(()=>{s(`user`),fe()}).catch(e=>N(e instanceof Error?e.message:String(e))).finally(()=>{y(``),j(!1)}))},[v,u,o]),(0,L.useEffect)(()=>{le&&u&&ce&&window.location.replace(ce)},[le,ce,u]),(0,L.useEffect)(()=>{if(T<=Date.now())return;let e=setInterval(()=>{k(Date.now()),Date.now()>=T&&clearInterval(e)},1e3);return()=>clearInterval(e)},[T]);let pe=Math.max(0,Math.ceil((T-D)/1e3));(0,L.useEffect)(()=>{S&&!A&&M&&se.current?.querySelector(`input`)?.focus()},[A,S,M]);async function me(e){try{await navigator.clipboard.writeText(e),ae(!0)}catch{N(`Clipboard access failed. Select and copy the token manually.`)}}if(ne?.ingest_token)return(0,R.jsx)(kk,{wide:!0,children:(0,R.jsxs)(F,{gap:`lg`,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,R.jsx)(de,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,R.jsx)(O,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,R.jsx)(am,{block:!0,children:ne.suggested_endpoint??`${window.location.hostname}:4317`})]}),(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`Header`}),(0,R.jsxs)(am,{block:!0,children:[ne.ingest_header_name??`Authorization`,`: Bearer `,ne.ingest_token]})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),(0,R.jsxs)(te,{grow:!0,align:`stretch`,children:[(0,R.jsx)(xe,{variant:`light`,radius:`md`,leftSection:P?(0,R.jsx)(re,{size:16,weight:`bold`}):(0,R.jsx)(ge,{size:16}),onClick:()=>void me(`${ne.ingest_header_name??`Authorization`}: Bearer ${ne.ingest_token}`),children:P?`Copied`:`Copy header`}),(0,R.jsx)(xe,{radius:`md`,rightSection:(0,R.jsx)(WO,{size:16,weight:`bold`}),onClick:()=>{s(`user`),ie(null),fe()},children:`Continue to Fanout`})]}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,onClick:()=>void me(ne.ingest_token??``),children:`Copy token only`})]})});if(!u||!i||v)return(0,R.jsx)(oe,{mih:`100dvh`,children:(0,R.jsx)(C,{size:`sm`})});if(!n)return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:`lg`,children:[(0,R.jsx)(ye,{}),(0,R.jsx)(de,{order:1,children:`Fanout is unavailable`}),(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M||`Authentication status could not be loaded.`})]})});if(le&&ce)return null;if(le)return(0,R.jsx)(Ck.Provider,{value:n,children:(0,R.jsx)(Tk.Provider,{value:c??{id:``,email:f,name:m,role:``},children:e})});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=ce?`/api/auth/oidc/start?return_to=${encodeURIComponent(ce)}`:`/api/auth/oidc/start`;return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:28,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(F,{gap:10,children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,R.jsx)(de,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,R.jsx)(O,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),(0,R.jsx)(xe,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function he(){j(!0),N(``);try{await Ok(`/api/auth/start`,{email:f}),w(!0),x(``),E(Date.now()+3e4),k(Date.now())}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}}async function _e(e){j(!0),N(``);try{await Ok(`/api/auth/verify`,{email:f,code:e}),s(`user`),w(!1),x(``),E(0),fe()}catch(e){x(``),N(e instanceof Error?e.message:String(e))}finally{j(!1)}}function ve(){w(!1),x(``),N(``)}async function be(e){e.preventDefault(),j(!0),N(``);try{if(n?.setup_required){let e=await Ok(`/api/auth/setup`,{email:f,name:m,setup_token:g});e.ingest_token?ie(e):(s(`user`),fe())}else if(S){await _e(b);return}else{await he();return}}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}}let I=S&&!n?.setup_required,Se=n?.setup_required?`Create the first admin`:I?`Check your email`:n?.self_signup?`Sign in or create an account`:`Sign in`,Ce=n?.setup_required?`Use the one-time token printed by the Fanout process.`:n?.smtp_configured?I?`We sent a code to ${f}.`:n?.self_signup?`Enter your email to sign in or create a viewer account. No password needed.`:`Enter your email and we’ll send a short verification code. No password needed.`:`Email delivery is not configured. Ask the operator to run fanout login-link with your email address.`;return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:28,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(F,{gap:10,children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:n?.setup_required?`One-time setup`:`Secure workspace`}),(0,R.jsx)(de,{order:1,fz:{base:28,sm:32},lh:1.08,children:Se}),Ce&&(0,R.jsx)(O,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:Ce})]}),(0,R.jsx)(`form`,{onSubmit:be,children:(0,R.jsxs)(F,{gap:`md`,children:[(0,R.jsx)(Xh,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:f,onChange:e=>p(e.currentTarget.value),disabled:S,variant:`filled`,radius:`md`,size:`md`,autoFocus:!S}),n?.setup_required&&(0,R.jsx)(Xh,{label:`Name`,placeholder:`Your name`,value:m,onChange:e=>h(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),n?.setup_required&&(0,R.jsx)(Xh,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:g,onChange:e=>_(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),I&&(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`Verification code`}),(0,R.jsx)(we,{ref:se,children:(0,R.jsx)(Fh,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:b,onChange:x,onComplete:e=>void _e(e),disabled:A,error:!!M,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,R.jsxs)(te,{justify:`space-between`,gap:`xs`,children:[(0,R.jsxs)(O,{c:`dimmed`,size:`xs`,children:[`Sent to `,f]}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,leftSection:(0,R.jsx)(HO,{size:12,weight:`bold`}),onClick:ve,disabled:A,children:`Change email`})]}),(0,R.jsxs)(te,{justify:`space-between`,gap:`xs`,children:[(0,R.jsx)(O,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,onClick:()=>void he(),disabled:A||pe>0,children:pe>0?`Resend in ${pe}s`:`Resend code`})]})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),I?(0,R.jsx)(xe,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:A||b.length<6,rightSection:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:`Verify code`}):(0,R.jsx)(xe,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:!n||!n.setup_required&&!n.smtp_configured,leftSection:n?.setup_required?(0,R.jsx)(mk,{size:17,weight:`bold`}):void 0,rightSection:n?.setup_required?void 0:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:n?.setup_required?`Create admin`:`Send code`})]})})]})})}var Nk=[`dashboards`],Pk=[`agent-threads`];async function Fk(e){let t=await xk(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var Ik=(0,L.createContext)(null);function Lk(){let e=(0,L.useContext)(Ik);if(!e)throw Error(`Fanout app context is unavailable`);return e}var Rk=`Create a new dashboard for me. First ask what I want to monitor, then design it when you have enough context.`,zk={observability_overview:`Checking system health…`,service_topology:`Mapping service dependencies…`,service_performance:`Reading performance signals…`,trace_detail:`Inspecting a trace…`,search_logs:`Searching logs…`,intelligence_snapshot:`Reviewing detected anomalies…`};function Bk(e){return zk[e]??`Working on it…`}var Vk=[];for(let e=0;e<256;++e)Vk.push((e+256).toString(16).slice(1));function Hk(e,t=0){return(Vk[e[t+0]]+Vk[e[t+1]]+Vk[e[t+2]]+Vk[e[t+3]]+`-`+Vk[e[t+4]]+Vk[e[t+5]]+`-`+Vk[e[t+6]]+Vk[e[t+7]]+`-`+Vk[e[t+8]]+Vk[e[t+9]]+`-`+Vk[e[t+10]]+Vk[e[t+11]]+Vk[e[t+12]]+Vk[e[t+13]]+Vk[e[t+14]]+Vk[e[t+15]]).toLowerCase()}var Uk=new Uint8Array(16);function Wk(){return crypto.getRandomValues(Uk)}var Gk={};function Kk(e,t,n){let r;if(e)r=Jk(e.random??e.rng?.()??Wk(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=Wk();qk(Gk,e,i),r=Jk(i,Gk.msecs,Gk.seq,t,n)}return t??Hk(r)}function qk(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=Yk(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function Jk(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=Yk(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function Yk(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function Xk(){return Kk()}async function Zk(e,t){let n=new URLSearchParams({limit:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await xk(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function Qk({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,ref:l}){let u=nD(),[d,f]=(0,L.useState)(``),[p]=Na(d.trim(),250),[m,h]=(0,L.useState)(null),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(``),[S,w]=(0,L.useState)(!1),T=(0,L.useRef)(null);(0,L.useImperativeHandle)(l,()=>({focusSearch:()=>T.current?.focus()}),[]),(0,L.useEffect)(()=>{r&&requestAnimationFrame(()=>T.current?.focus())},[r]);let D=EO({queryKey:[...Pk,p],queryFn:({pageParam:e})=>Zk(p,e),initialPageParam:``,getNextPageParam:e=>e.nextCursor||void 0,enabled:e}),k=TO({queryKey:Nk,queryFn:()=>Fk(`/api/dashboards`),refetchInterval:3e4}),A=(0,L.useMemo)(()=>D.data?.pages.flatMap(e=>e.threads)??[],[D.data]),j=(0,L.useMemo)(()=>iA(A),[A]),M=(0,L.useMemo)(()=>{let e=k.data?.dashboards??[],t=p.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[k.data,p]);function N(e){x(``),y(e.title),h(e)}async function ne(){if(m&&v.trim()){w(!0),x(``);try{let e=await xk(`/api/agent/threads/${encodeURIComponent(m.threadId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:v.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await u.invalidateQueries({queryKey:Pk}),h(null)}catch(e){x(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{w(!1)}}}async function re(){if(g){w(!0),x(``);try{let e=await xk(`/api/agent/threads/${encodeURIComponent(g.threadId)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=g.threadId;_(null),await u.invalidateQueries({queryKey:Pk}),o(t)}catch(e){x(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{w(!1)}}}return(0,R.jsxs)(F,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,R.jsx)(xe,{leftSection:(0,R.jsx)(ik,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,R.jsx)(Ku,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,R.jsxs)(F,{gap:`lg`,pb:`sm`,children:[e&&(0,R.jsxs)(F,{gap:4,children:[(0,R.jsx)($k,{children:`Chats`}),D.isLoading&&(0,R.jsx)(oe,{py:`md`,children:(0,R.jsx)(C,{size:`xs`})}),D.isError&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!D.isLoading&&!D.isError&&A.length===0&&(0,R.jsx)(O,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:p?`No matching chats`:`No chats yet`}),j.map(e=>(0,R.jsxs)(F,{gap:2,children:[j.length>1&&(0,R.jsx)(O,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,R.jsx)(eA,{thread:e,active:e.threadId===t,onSelect:()=>a(e.threadId),onRename:()=>N(e),onDelete:()=>{x(``),_(e)}},e.threadId))]},e.label)),D.hasNextPage&&(0,R.jsx)(xe,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:D.isFetchingNextPage,onClick:()=>void D.fetchNextPage(),children:`See all`})]}),(0,R.jsxs)(F,{gap:4,children:[(0,R.jsx)($k,{children:`Dashboards`}),k.isLoading&&(0,R.jsx)(oe,{py:`md`,children:(0,R.jsx)(C,{size:`xs`})}),k.isError&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!k.isLoading&&!k.isError&&p&&M.length===0&&(0,R.jsx)(O,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),M.map(e=>{let t=e.id===n;return(0,R.jsx)(E,{className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:()=>s(e.id),children:(0,R.jsxs)(te,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(O,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,R.jsx)($p,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})},e.id)}),e&&(0,R.jsx)(xe,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,R.jsx)(ck,{size:14,weight:`fill`}),onClick:c,children:`Create with AI`})]})]})}),(0,R.jsx)(Xh,{ref:T,value:d,onChange:e=>f(e.currentTarget.value),leftSection:(0,R.jsx)(QO,{size:15}),rightSection:(0,R.jsx)(Om,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats and dashboards`,size:`sm`}),(0,R.jsx)(kh,{opened:m!==null,onClose:()=>!S&&h(null),title:`Rename chat`,centered:!0,children:(0,R.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),ne()},children:(0,R.jsxs)(F,{children:[(0,R.jsx)(Xh,{label:`Name`,value:v,onChange:e=>y(e.currentTarget.value),maxLength:120,autoFocus:!0}),b&&(0,R.jsx)(ee,{color:`bad`,children:b}),(0,R.jsxs)(te,{justify:`flex-end`,children:[(0,R.jsx)(xe,{variant:`default`,onClick:()=>h(null),disabled:S,children:`Cancel`}),(0,R.jsx)(xe,{type:`submit`,loading:S,disabled:!v.trim(),children:`Save`})]})]})})}),(0,R.jsx)(kh,{opened:g!==null,onClose:()=>!S&&_(null),title:`Delete chat?`,centered:!0,children:(0,R.jsxs)(F,{children:[(0,R.jsxs)(O,{size:`sm`,children:[`This permanently removes `,(0,R.jsx)(O,{span:!0,fw:650,children:g?.title}),` and its saved messages.`]}),b&&(0,R.jsx)(ee,{color:`bad`,children:b}),(0,R.jsxs)(te,{justify:`flex-end`,children:[(0,R.jsx)(xe,{variant:`default`,onClick:()=>_(null),disabled:S,children:`Cancel`}),(0,R.jsx)(xe,{color:`bad`,loading:S,onClick:()=>void re(),children:`Delete`})]})]})})]})}function $k({children:e}){return(0,R.jsx)(O,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function eA({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,R.jsx)(we,{"data-active":t||void 0,className:`rail-row`,children:(0,R.jsxs)(te,{gap:2,wrap:`nowrap`,children:[(0,R.jsx)(E,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,R.jsxs)(F,{gap:0,children:[(0,R.jsx)(O,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,R.jsx)(O,{c:`dimmed`,size:`xs`,children:aA(e.updatedAt)})]})}),(0,R.jsxs)(ph,{position:`bottom-end`,withinPortal:!0,children:[(0,R.jsx)(ph.Target,{children:(0,R.jsx)(zd,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,R.jsx)(KO,{size:18,weight:`bold`})})}),(0,R.jsxs)(ph.Dropdown,{children:[(0,R.jsx)(ph.Item,{leftSection:(0,R.jsx)(nk,{size:15}),onClick:r,children:`Rename`}),(0,R.jsx)(ph.Item,{color:`bad`,leftSection:(0,R.jsx)(fk,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function tA(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function nA(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var rA=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function iA(e){let t=nA(new Date),n=new Map;for(let r of e){let e=Math.floor((t-nA(tA(r.updatedAt)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return rA.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function aA(e){let t=tA(e),n=nA(new Date);return Math.floor((n-nA(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function oA({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=Lk(),s=bi(),c=ua({select:e=>e.location.pathname}),{dashboardId:l}=vi({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=qa(!1),[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(``),_=(0,L.useRef)(null),v=ue(`(max-width: 62em)`),y=(0,L.useRef)(v);y.current=v,(0,L.useEffect)(()=>{f.close()},[c]),(0,L.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e}}),onCreateDashboard:()=>o(Rk)};return(0,R.jsxs)(Rp,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,R.jsx)(Rp.Header,{children:(0,R.jsxs)(te,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsxs)(te,{gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(nm,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,R.jsx)(ye,{size:`small`})]}),(0,R.jsxs)(te,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(sA,{}),(0,R.jsx)(cA,{onError:g})]})]})}),(0,R.jsx)(Rp.Navbar,{p:`sm`,children:(0,R.jsx)(Qk,{ref:_,...b})}),(0,R.jsx)(Tm,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,R.jsx)(ye,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,R.jsx)(Qk,{...b,autoFocusSearch:d&&p})}),(0,R.jsxs)(Rp.Main,{children:[h&&(0,R.jsx)(ee,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function sA(){let{setColorScheme:e}=co(),t=fo(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`;return(0,R.jsx)(Yh,{label:`Switch to ${n} theme`,children:(0,R.jsx)(zd,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onClick:()=>e(n),children:t===`dark`?(0,R.jsx)(uk,{size:17,weight:`bold`}):(0,R.jsx)(ek,{size:17,weight:`bold`})})})}function cA({onError:e}){let t=Ek(),n=(t.name.trim()||t.email.trim()||`?`).charAt(0).toUpperCase();return(0,R.jsxs)(ph,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(ph.Target,{children:(0,R.jsx)(zd,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,R.jsx)(Xp,{size:26,radius:`xl`,color:`brand`,children:n})})}),(0,R.jsxs)(ph.Dropdown,{children:[(0,R.jsx)(ph.Label,{children:t.email||`Signed in`}),(0,R.jsx)(ph.Item,{component:`a`,href:`https://github.com/labstack/fanout`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(JO,{size:15,weight:`bold`}),children:`Fanout on GitHub`}),(0,R.jsx)(ph.Item,{component:`a`,href:`https://labstack.com`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(XO,{size:15}),children:`LabStack`}),(0,R.jsx)(ph.Divider,{}),(0,R.jsx)(ph.Item,{leftSection:(0,R.jsx)(ok,{size:15}),onClick:()=>void Sk().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function lA(){let{agent_available:e}=wk(),t=bi(),n=nD(),{threadId:r}=vi({strict:!1}),[i,a]=(0,L.useState)(Xk),o=(0,L.useRef)(new Set),s=r??i,[c,l]=(0,L.useState)([]),[u,d]=(0,L.useState)({}),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(``),[S,C]=(0,L.useState)(``),[w,T]=(0,L.useState)(0),E=(0,L.useRef)(``),D=(0,L.useRef)(null),O=(0,L.useRef)(null),k=(0,L.useRef)(0),A=(0,L.useMemo)(()=>new eD({url:`/api/agent`,threadId:s,fetch:(e,t)=>xk(e,t)}),[s]),ee=!e||f===s;function j(){k.current=0,y(``)}(0,L.useEffect)(()=>{let t=!0;if(l([]),d({}),p(``),h(!1),_(!1),j(),C(``),!e){p(s);return}!r||o.current.has(s)?(A.setMessages([]),p(s)):xk(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}A.setMessages(e.messages??[]),l([...e.messages??[]]),p(s)}}).catch(()=>{t&&(E.current=``,C(`This chat could not be restored. Start a new chat or try again.`))});let i=A.subscribe({onEvent:({messages:e})=>l([...e]),onRunInitialized:()=>{_(!0),C(``)},onToolCallStartEvent:({event:e})=>{k.current+=1,y(Bk(e.toolCallName))},onToolCallEndEvent:()=>{k.current=Math.max(0,k.current-1),k.current===0&&y(``)},onRunFinalized:({messages:e})=>{let t=[...e];l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),j(),o.current.delete(s),n.invalidateQueries({queryKey:Pk})},onRunFailed:e=>{console.error(`Agent run failed`,e),C(`Fanout could not complete this analysis.`),_(!1),j(),o.current.delete(s),n.invalidateQueries({queryKey:Pk})}});return()=>{t=!1,i.unsubscribe(),A.abortRun()}},[A,e,n,w,s]),(0,L.useEffect)(()=>{D.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[c,g]),(0,L.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>O.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>O.current?.focus()))),e.key===`Escape`&&n===O.current&&(x(``),O.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function M(){_(!0),C(``);try{await A.runAgent()}catch(e){console.error(`Agent run failed`,e),C(`Fanout could not complete this analysis.`),_(!1),j(),o.current.delete(s)}}async function N(n){let i=n.trim();if(!e||!i||g||!ee||m)return;r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let a={id:Xk(),role:`user`,content:i};A.addMessage(a),l([...A.messages]),d(e=>({...e,[a.id]:Date.now()})),x(``),await M()}(0,L.useEffect)(()=>{let e=E.current;ee&&r&&e&&(E.current=``,N(e))},[ee,r,s]);function te(e){e.preventDefault(),N(b)}function ne(){A.abortRun(),_(!1),j(),o.current.delete(s)}function re(){!g&&A.messages.some(e=>e.role===`user`)&&M()}function ie(n){if(!e)return;let r=Xk();o.current.add(r),E.current=n??``,t({to:`/chat/$threadId`,params:{threadId:r}})}function P(){A.abortRun(),E.current=``,a(Xk()),t({to:`/chat`})}function ae(e){t({to:`/chat/$threadId`,params:{threadId:e}})}function oe(){T(e=>e+1)}return(0,R.jsx)(Ik.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:ee,running:g,activity:v,input:b,setInput:x,error:S,bottomRef:D,inputRef:O,send:N,submit:te,stop:ne,retry:re,reloadThread:oe,openChat:ie,newThread:P,selectThread:ae},children:(0,R.jsx)(oA,{children:(0,R.jsx)(ea,{})})})}function uA(){let e=(0,L.useMemo)(()=>new fO,[]);return(0,R.jsx)(rD,{client:e,children:(0,R.jsx)(Mk,{children:(0,R.jsx)(lA,{})})})}var dA=Vi({component:uA,notFoundComponent:()=>(0,R.jsx)(xi,{to:`/`,replace:!0})}),fA=`modulepreload`,pA=function(e){return`/`+e},mA={},hA=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=pA(t,n),t=s(t),t in mA)return;mA[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:fA,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},gA=Hi(`/`)({component:Ui(()=>hA(()=>import(`./routes-BNP_b_GZ.js`),__vite__mapDeps([0,1])),`component`)}),_A=Hi(`/chat/`)({component:Ui(()=>hA(()=>import(`./chat.index-DC_eOz23.js`),__vite__mapDeps([2,3,1,4])),`component`)}),vA=Hi(`/chat/$threadId`)({component:Ui(()=>hA(()=>import(`./chat._threadId-DC_eOz23.js`),__vite__mapDeps([5,3,1,4])),`component`)}),yA=Hi(`/dashboards/`)({component:Ui(()=>hA(()=>import(`./dashboards.index-DY3GETbb.js`),__vite__mapDeps([6,1,7,4])),`component`)}),bA=Hi(`/dashboards/$dashboardId`)({component:Ui(()=>hA(()=>import(`./dashboards._dashboardId-BxKDNXp-.js`),__vite__mapDeps([8,1,7,4])),`component`)}),xA=gA.update({id:`/`,path:`/`,getParentRoute:()=>dA}),SA=_A.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>dA}),CA=vA.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>dA}),wA=yA.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>dA}),TA={IndexRoute:xA,ChatThreadIdRoute:CA,DashboardsDashboardIdRoute:bA.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>dA}),ChatIndexRoute:SA,DashboardsIndexRoute:wA},EA=oa({routeTree:dA._addFileChildren(TA)._addFileTypes(),defaultPreload:`intent`,scrollRestoration:!0}),DA=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],OA=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],kA=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],AA=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],jA=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],MA=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],NA={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},PA={dark:[`#66d0ee`,`#a97ce0`,`#5fe8ce`,`#cb55e8`,`#41b6f8`,`#d2a6ff`],light:[`#2b93b5`,`#7c4dcc`,`#1a9c86`,`#a12fbf`,`#2f7fd4`,`#9163d6`]},FA={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},IA={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:DA,brand:OA,ok:kA,warn:AA,bad:jA,info:MA},defaultRadius:`md`,fontFamily:FA.body,fontFamilyMonospace:FA.display,headings:{fontFamily:FA.body,fontWeight:`600`},cursorType:`pointer`},LA=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":NA.light.muted},dark:{}}),RA=Eo(IA);(0,q_.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(To,{theme:RA,defaultColorScheme:`auto`,cssVariablesResolver:LA,children:(0,R.jsx)(la,{router:EA})})}));export{kh as A,eo as B,gD as C,nD as D,AD as E,jd as F,fa as G,Ea as H,Ku as I,xi as K,fo as L,$p as M,zp as N,Xh as O,zd as P,io as R,PD as S,bD as T,ma as U,Ka as V,pa as W,ik as _,PA as a,cO as b,hA as c,Nk as d,Fk as f,ck as g,fk as h,kA as i,ph as j,Yh as k,Xk as l,xk as m,NA as n,AA as o,wk as p,bi as q,MA as r,bA as s,jA as t,Lk as u,KO as v,cD as w,RD as x,TO as y,to as z}; \ No newline at end of file +`)},CE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Rx(r=>{switch(r.type){case G.TEXT_MESSAGE_START:{let e=r;return[{type:bE.enum.TextMessageStart,messageId:e.messageId,role:e.role}]}case G.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:bE.enum.TextMessageContent,messageId:e.messageId,content:e.delta}]}case G.TEXT_MESSAGE_END:{let e=r;return[{type:bE.enum.TextMessageEnd,messageId:e.messageId}]}case G.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:bE.enum.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case G.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let p=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(Xx(d.function.arguments));e.tool_argument&&e.tool_argument in t?(f({...i,[e.state_key]:t[e.tool_argument]}),p=!0):e.tool_argument||(f({...i,[e.state_key]:t}),p=!0)}catch{}}return[{type:bE.enum.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...p?[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case G.TOOL_CALL_END:{let e=r;return[{type:bE.enum.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case G.TOOL_CALL_RESULT:{let e=r;return[{type:bE.enum.ActionExecutionResult,actionExecutionId:e.toolCallId,result:e.content,actionName:d[e.toolCallId]||`unknown`}]}case G.RAW:return[];case G.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:bE.enum.MetaEvent,name:e.name,value:e.value}]}case G.STATE_SNAPSHOT:return f(r.snapshot),[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case G.STATE_DELTA:{let c=r,l=Qy.applyPatch(i,c.delta,!0,!1);return l?(f(l.newDocument),[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]):[]}case G.MESSAGES_SNAPSHOT:return c=r.messages,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case G.RUN_STARTED:return[];case G.RUN_FINISHED:return c&&(i.messages=c),Object.keys(i).length===0?[]:[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:wE(c)}:{}}),active:!1}];case G.RUN_ERROR:{let e=r;return[{type:bE.enum.RunError,message:e.message,code:e.code}]}case G.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case G.STEP_FINISHED:return u=[],l=null,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function wE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=SE(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r={id:e.id,name:e.function.name,arguments:JSON.parse(e.function.arguments),parentMessageId:n.id};t.push(r)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:n.content,actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var TE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,EE=e=>e===`tool`?`toolCallId`:`messageId`,DE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},OE=e=>t=>{let n=cE(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:G.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:G.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:G.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&TE(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${EE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(Rx(e=>{switch(e.type){case G.TEXT_MESSAGE_START:case G.TEXT_MESSAGE_CONTENT:case G.TEXT_MESSAGE_END:case G.TOOL_CALL_START:case G.TOOL_CALL_ARGS:case G.TOOL_CALL_END:case G.TOOL_CALL_RESULT:case G.STATE_SNAPSHOT:case G.STATE_DELTA:case G.CUSTOM:case G.STEP_STARTED:case G.STEP_FINISHED:case G.THINKING_START:case G.THINKING_END:case G.THINKING_TEXT_MESSAGE_START:case G.THINKING_TEXT_MESSAGE_CONTENT:case G.THINKING_TEXT_MESSAGE_END:case G.REASONING_START:case G.REASONING_MESSAGE_START:case G.REASONING_MESSAGE_CONTENT:case G.REASONING_MESSAGE_END:case G.REASONING_END:return[...i(e.subagentRunId??void 0),e];case G.RUN_STARTED:case G.RUN_FINISHED:case G.RUN_ERROR:case G.MESSAGES_SNAPSHOT:return[...a(),e];case G.RAW:case G.ACTIVITY_SNAPSHOT:case G.ACTIVITY_DELTA:case G.REASONING_ENCRYPTED_VALUE:case G.SUBAGENT_STARTED:return[e];case G.SUBAGENT_FINISHED:case G.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case G.TEXT_MESSAGE_CHUNK:{let t=e,a=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),o=r.get(a),c=[],l;if(o?.kind===`text`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,name:t.name,subagentRunId:t.subagentRunId},r.set(a,{kind:`text`,fields:l});let e=DE({type:G.TEXT_MESSAGE_START,messageId:t.messageId,role:t.role||`assistant`,...t.name!==void 0&&{name:t.name},...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case G.TOOL_CALL_CHUNK:{let t=e,a=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),o=r.get(a),c=[],l;if(o?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===o.fields.toolCallId))l=o.fields;else{if(c.push(...i(a)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);l={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`tool`,fields:l});let e=DE({type:G.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:l.toolCallId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case G.REASONING_MESSAGE_CHUNK:{let t=e,a=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),o=r.get(a),c=[],l;if(o?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`reasoning`,fields:l});let e=DE({type:G.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}}return e.type,[]}),Gx(()=>{a()}))};function kE(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}var AE=class{runNext(e,t){return t.run(e).pipe(OE(!1))}runNextWithState(e,t){let n=tE(e.messages||[]),r=tE(e.state||{}),i=new $b;return pE(e,i,t,[]).subscribe(e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)}),this.runNext(e,t).pipe(Ux(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:tE(n),state:tE(r)})))}},jE=class extends AE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function ME(e){let t=e.content;if(Array.isArray(t)){let n=t.filter(e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``);return{...e,content:n}}return typeof t==`string`?e:{...e,content:``}}var NE=class extends AE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(ME)};return this.runNext(i,t)}},PE=`THINKING_START`,FE=`THINKING_END`,IE=`THINKING_TEXT_MESSAGE_START`,LE=`THINKING_TEXT_MESSAGE_CONTENT`,RE=`THINKING_TEXT_MESSAGE_END`,zE=class extends AE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(Ix(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case PE:{this.currentReasoningId=nE();let{title:t,...n}=e;return this.warnAboutTransformation(PE,G.REASONING_START),{...n,type:G.REASONING_START,messageId:this.currentReasoningId}}case IE:return this.currentMessageId=nE(),this.warnAboutTransformation(IE,G.REASONING_MESSAGE_START),{...e,type:G.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`assistant`};case LE:{let{delta:t,...n}=e;return this.warnAboutTransformation(LE,G.REASONING_MESSAGE_CONTENT),{...n,type:G.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??nE(),delta:t}}case RE:{let t=this.currentMessageId??nE();return this.warnAboutTransformation(RE,G.REASONING_MESSAGE_END),{...e,type:G.REASONING_MESSAGE_END,messageId:t}}case FE:{let t=this.currentReasoningId??nE();return this.warnAboutTransformation(FE,G.REASONING_END),{...e,type:G.REASONING_END,messageId:t}}default:return e}}};function BE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function VE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function HE(e){let t=BE(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e}function UE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>VE(e)?HE(e):e);return{...e,content:n}}var WE=class extends AE{run(e,t){let n={...e,messages:e.messages.map(UE)};return this.runNext(n,t)}},GE=`SUBAGENT_STARTED`,KE=`SUBAGENT_FINISHED`,qE=`SUBAGENT_ERROR`;function JE(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function YE(e){return e.map(e=>JE(e))}var XE=class extends AE{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>JE(e))};return this.runNext(n,t).pipe(Jx(e=>{let t=e.type;(t===GE||t===KE||t===qE)&&this.warnDroppedLifecycleEvent(t)}),Vx(e=>{let t=e.type;return t!==GE&&t!==KE&&t!==qE}),Ix(e=>{let t=JE(e);if(t.type===G.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:YE(e.messages)}}if(t.type===G.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>JE(e))}}}if(t.type===G.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:YE(e.input.messages)}}}return t}))}},ZE=`0.0.59`,QE=class{get maxVersion(){return ZE}get debug(){return this._debug}set debug(e){this._debug=sE(e),this._debugLogger=uE(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?uE(sE(!0)):void 0:e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??``,this.threadId=n??rg(),this.messages=tE(r??[]),this.state=tE(i??{}),this._debug=sE(a),this._debugLogger=uE(this._debug),eE(this.maxVersion,`0.0.39`)<=0&&this.middlewares.unshift(new NE),eE(this.maxVersion,`0.0.45`)<=0&&this.middlewares.unshift(new zE),eE(this.maxVersion,`0.0.47`)<=0&&this.middlewares.unshift(new WE),eE(this.maxVersion,`0.0.57`)<=0&&this.middlewares.unshift(new XE)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new jE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??rg();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Fx(zb(()=>this.middlewares.length===0?this.run(n):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),OE(this.debugLogger),mE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),Gx(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)));let s=tE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new gv}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??rg();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Fx(zb(()=>Bx(()=>this.connect(n)),OE(this.debugLogger),mE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.isRunning=!1,e instanceof gv?ex:this.onError(n,e,a))),Gx(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)),{defaultValue:void 0});let s=tE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return pE(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Jx(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=tE(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||rg(),tools:tE(e?.tools??[]),context:tE(e?.context??[]),forwardedProps:tE(e?.forwardedProps??{}),state:tE(this.state),messages:n,...e?.resume===void 0?{}:{resume:tE(e.resume)}}}async onInitialize(e,t){if(this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new hv(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let e of this.pendingInterrupts)if(kE(e))throw new hv(`Interrupt ${e.id} expired at ${e.expiresAt}`)}let n=await oE(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return Mx(oE(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Ix(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await oE(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=tE(this.messages),e.state=tE(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=tE(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=tE(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=tE(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??rg();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t)).pipe(OE(this.debugLogger),mE(this.debugLogger),CE(this.threadId,t.runId,this.agentId),e=>e.pipe(Ix(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function $E(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var eD=class extends QE{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify($E(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=tE(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return yE(gE(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=tE(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},tD=L.createContext(void 0),nD=e=>{let t=L.useContext(tD);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},rD=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(tD.Provider,{value:e,children:t})),iD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},aD=new class{#e=iD;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function oD(e){setTimeout(e,0)}var sD=typeof window>`u`||`Deno`in globalThis;function cD(){}function lD(e,t){return typeof e==`function`?e(t):e}function uD(e){return typeof e==`number`&&e>=0&&e!==1/0}function dD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fD(e,t){return typeof e==`function`?e(t):e}function pD(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==hD(o,t.options))return!1}else if(!_D(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function mD(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(gD(t.options.mutationKey)!==gD(a))return!1}else if(!_D(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function hD(e,t){return(t?.queryKeyHashFn||gD)(e)}function gD(e){return JSON.stringify(e,(e,t)=>SD(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function _D(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n500)return t;let r=xD(e)&&xD(t);if(!r&&!(SD(e)&&SD(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{aD.setTimeout(t,e)})}function TD(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:yD(e,t)}function ED(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function DD(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var OD=Symbol();function kD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===OD?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function AD(e,t){return typeof e==`function`?e(...t):!!e}function jD(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var MD=()=>sD,ND=()=>MD(),PD=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},FD=new class extends PD{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ID=oD;function LD(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ID,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var RD=LD(),zD=new class extends PD{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function BD(e){return Math.min(1e3*2**e,3e4)}function VD(e){return(e??`online`)!==`online`||zD.isOnline()}var HD=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function UD(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(cD);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new HD(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>FD.isFocused()&&(e.networkMode===`always`||zD.isOnline())&&e.canRun(),p=()=>VD(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ND()?0:3),a=e.retryDelay??BD,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nf()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var WD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uD(this.gcTime)&&(this.#e=aD.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ND()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(aD.clearTimeout(this.#e),this.#e=void 0)}};function GD(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{jD(e,()=>t.signal,()=>n=!0)},u=kD(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?DD:ED;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?qD:KD,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:KD(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function KD(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function qD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function JD(e,t){return t?KD(e,t)!=null:!1}function YD(e,t){return!t||!e.getPreviousPageParam?!1:qD(e,t)!=null}var XD=class extends WD{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=$D(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=$D(this.options);e.data!==void 0&&(this.setState(QD(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=TD(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(cD).catch(cD):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>fD(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===OD||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>fD(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!dD(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=kD(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?GD(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=UD({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof HD&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof HD){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ZD(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...QD(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),RD.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ZD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:VD(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function QD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function $D(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var eO=class extends PD{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),nO(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rO(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rO(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof fD(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!bD(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&iO(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||fD(this.options.enabled,this.#t)!==fD(t.enabled,this.#t)||fD(this.options.staleTime,this.#t)!==fD(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||fD(this.options.enabled,this.#t)!==fD(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return bD(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(cD)),t}#h(e){return!ND()&&fD(this.options.enabled,this.#t)!==!1&&uD(e)}#g(){this.#b();let e=fD(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=dD(this.#r.dataUpdatedAt,e)+1;this.#u=aD.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=aD.setInterval(()=>{(this.options.refetchIntervalInBackground||FD.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(aD.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(aD.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&nO(e,t),o=i&&iO(e,n,t,r);(a||o)&&(l={...l,...ZD(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=TD(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=TD(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:aO(e,t),refetch:this.refetch,isEnabled:fD(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),bD(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();RD.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function tO(e,t){return fD(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||fD(t.retryOnMount,e)!==!1)}function nO(e,t){return tO(e,t)||e.state.data!==void 0&&rO(e,t,t.refetchOnMount)}function rO(e,t,n){if(fD(t.enabled,e)!==!1&&fD(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&aO(e,t)}return!1}function iO(e,t,n,r){return(e!==t||fD(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&aO(e,n)}function aO(e,t){return fD(t.enabled,e)!==!1&&e.isStaleByTime(fD(t.staleTime,e))}var oO=class extends eO{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:JD(t,n.data),hasPreviousPage:YD(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},sO=class extends WD{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||cO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=UD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),RD.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function cO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var lO=class extends PD{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new sO({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=uO(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){RD.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>mD(t,e))}findAll(e={}){return this.getAll().filter(t=>mD(e,t))}notify(e){RD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return RD.batch(()=>Promise.all(e.map(e=>e.continue().catch(cD))))}};function uO(e){return e.options.scope?.id}var dO=class extends PD{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??hD(r,t),a=this.get(i);return a||(a=new XD({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){RD.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>pD(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>pD(e,t)):t}notify(e){RD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){RD.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){RD.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fO=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new dO,this.#t=e.mutationCache||new lO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=FD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=zD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fD(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=lD(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return RD.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;RD.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return RD.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=RD.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(cD).catch(cD)}invalidateQueries(e,t={}){return RD.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=RD.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(cD)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(cD)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(fD(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(fD(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cD).catch(cD)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cD).catch(cD)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return zD.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(gD(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{_D(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(gD(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{_D(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=hD(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===OD&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},pO=L.createContext(!1),mO=()=>L.useContext(pO);pO.Provider;function hO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gO=L.createContext(hO()),_O=()=>L.useContext(gO),vO=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?AD(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},yO=e=>{L.useEffect(()=>{e.clearReset()},[e])},bO=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||AD(n,[e.error,r])),xO=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},SO=(e,t)=>e?.suspense&&t.isPending,CO=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wO(e,t,n){let r=mO(),i=_O(),a=nD(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,xO(o),vO(o,i,s),yO(i);let[l]=L.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(L.useSyncExternalStore(L.useCallback(e=>{let t=d?l.subscribe(RD.batchCalls(e)):cD;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),L.useEffect(()=>{l.setOptions(o)},[o,l]),SO(o,u))throw CO(o,l,i);if(bO({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function TO(e,t){return wO(e,eO,t)}function EO(e,t){return wO(e,oO,t)}var DO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),OO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),kO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),AO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z`}))]]),jO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm84,108a83.64,83.64,0,0,1-4.47,27L167,130a19.65,19.65,0,0,0-7.8-2.78l-22.82-3.08A20.14,20.14,0,0,0,117.72,132h-4.07l-2.71-5.6a19.88,19.88,0,0,0-13.8-10.84L94.46,115l4-7h14.39a20,20,0,0,0,9.66-2.49l12.25-6.76a20.57,20.57,0,0,0,3.74-2.68l26.92-24.33A20,20,0,0,0,172,56.49,84,84,0,0,1,212,128ZM140.76,45l6.2,11.1L122.75,78l-10.93,6H96.14A20.05,20.05,0,0,0,78.78,94.06l-4.49,7.85L67.68,84.28l9.91-23.42A83.91,83.91,0,0,1,140.76,45ZM44,128a83.52,83.52,0,0,1,4.4-26.77l7.74,20.65a19.89,19.89,0,0,0,14.52,12.53l19.53,4.2,3,6.1a20.11,20.11,0,0,0,13.55,10.77l-5,11.12a20,20,0,0,0,3.58,21.71l.21.22,18.16,18.7-.89,4.59A84.09,84.09,0,0,1,44,128Zm103.65,81.66a20.11,20.11,0,0,0-5-17.3l-.21-.22-17.72-18.25,11.37-25.52,19,2.56,41.43,25.48A84.2,84.2,0,0,1,147.65,209.66Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M213.09,172.48a96,96,0,0,1-80.41,51.41l3.17-16.44a8,8,0,0,0-2-6.95l-19.74-20.33a8,8,0,0,1-1.44-8.69l13.7-30.74a8,8,0,0,1,8.38-4.67l22.82,3.08a8.11,8.11,0,0,1,3.12,1.11ZM116.71,95,129,88.24a7.46,7.46,0,0,0,1.5-1.07l26.91-24.33A8,8,0,0,0,159,53l-10.5-18.81A96.62,96.62,0,0,0,128,32,95.61,95.61,0,0,0,67.78,53.23L56,81.08A8,8,0,0,0,55.88,87l11.5,30.67a8,8,0,0,0,5.81,5l2.69.58L89.2,100a8,8,0,0,1,6.94-4h16.71A7.9,7.9,0,0,0,116.71,95Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm90,102a89.55,89.55,0,0,1-7.46,35.86l-46.69-28.71a13.94,13.94,0,0,0-5.46-2l-22.82-3.07A14.06,14.06,0,0,0,121.06,138h-9.92a2,2,0,0,1-1.8-1.13l-3.8-7.86a13.94,13.94,0,0,0-9.66-7.59l-10.71-2.3L94.4,103a2,2,0,0,1,1.74-1h16.71a13.9,13.9,0,0,0,6.76-1.75l12.25-6.75a14.73,14.73,0,0,0,2.62-1.88l26.91-24.33a13.93,13.93,0,0,0,2.83-17.21L161,44.25A90.16,90.16,0,0,1,218,128ZM144.6,39.54l9.15,16.39a2,2,0,0,1-.41,2.46L126.43,82.72a1.84,1.84,0,0,1-.37.27l-12.25,6.76a2,2,0,0,1-1,.25H96.14A14,14,0,0,0,84,97L73.18,115.91a2,2,0,0,1-.19-.35L61.5,84.89a2,2,0,0,1,0-1.48L72.68,57.06A89.9,89.9,0,0,1,144.6,39.54ZM38,128A89.52,89.52,0,0,1,49.38,84.23a13.85,13.85,0,0,0,.89,4.87l11.49,30.67a13.94,13.94,0,0,0,10.16,8.78l21.44,4.6a2,2,0,0,1,1.38,1.09l3.8,7.86a14.07,14.07,0,0,0,12.6,7.9h4.56l-8.49,19a14,14,0,0,0,2.51,15.2l.1.11,19.68,20.26a2,2,0,0,1,.46,1.7L127.7,218A90.1,90.1,0,0,1,38,128Zm102.08,89.19,1.67-8.6a14.07,14.07,0,0,0-3.47-12.16l-.1-.11L118.5,176.06a2,2,0,0,1-.33-2.14l13.7-30.73A2,2,0,0,1,134,142l22.82,3.08a2,2,0,0,1,.78.27L205,174.55A90.18,90.18,0,0,1,140.08,217.19Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm92,100a91.44,91.44,0,0,1-8.58,38.76L162.8,136.85a12.07,12.07,0,0,0-4.68-1.67l-22.82-3.07a12,12,0,0,0-12.56,7l-.4.88h-11.2a4,4,0,0,1-3.6-2.26l-3.8-7.86a11.93,11.93,0,0,0-8.28-6.5L82.07,120.5,92.67,102a4,4,0,0,1,3.47-2h16.71a12,12,0,0,0,5.8-1.5l12.24-6.76a11.79,11.79,0,0,0,2.25-1.6L160.05,65.8a12,12,0,0,0,2.43-14.75l-5.86-10.49A92.17,92.17,0,0,1,220,128ZM145.89,37.75l9.6,17.2a4,4,0,0,1-.81,4.92L127.77,84.21a4.41,4.41,0,0,1-.75.53L114.78,91.5a4,4,0,0,1-1.93.5H96.14a12,12,0,0,0-10.41,6l-11.86,20.7a4,4,0,0,1-2.75-2.47L59.63,85.6a4,4,0,0,1,.06-3L71,55.81A91.51,91.51,0,0,1,128,36,92.53,92.53,0,0,1,145.89,37.75ZM36,128A91.52,91.52,0,0,1,56,70.77l-3.71,8.75a12,12,0,0,0-.18,8.88l11.49,30.67a11.93,11.93,0,0,0,8.72,7.52l21.43,4.61a4,4,0,0,1,2.76,2.17l3.8,7.86a12.07,12.07,0,0,0,10.8,6.77h7.64L109,169.85A12,12,0,0,0,111.26,183l19.68,20.26a4,4,0,0,1,1,3.47L129.36,220,128,220A92.1,92.1,0,0,1,36,128Zm101.6,91.5,2.18-11.29a12.08,12.08,0,0,0-3-10.49l-19.68-20.26a4,4,0,0,1-.71-4.35l13.7-30.74a4,4,0,0,1,4.18-2.33l22.82,3.07a4.12,4.12,0,0,1,1.56.56l49.11,30.2A92.12,92.12,0,0,1,137.6,219.5Z`}))]]),MO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),NO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),PO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),FO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),IO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),LO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),RO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),zO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),BO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),VO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:DO}));VO.displayName=`ArrowLeftIcon`;var HO=VO,UO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:OO}));UO.displayName=`ArrowRightIcon`;var WO=UO,GO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:kO}));GO.displayName=`DotsThreeIcon`;var KO=GO,qO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:AO}));qO.displayName=`GithubLogoIcon`;var JO=qO,YO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:jO}));YO.displayName=`GlobeHemisphereWestIcon`;var XO=YO,ZO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:MO}));ZO.displayName=`MagnifyingGlassIcon`;var QO=ZO,$O=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:NO}));$O.displayName=`MoonIcon`;var ek=$O,tk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:PO}));tk.displayName=`PencilSimpleIcon`;var nk=tk,rk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:FO}));rk.displayName=`PlusIcon`;var ik=rk,ak=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:IO}));ak.displayName=`SignOutIcon`;var ok=ak,sk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:LO}));sk.displayName=`SparkleIcon`;var ck=sk,lk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:RO}));lk.displayName=`SunIcon`;var uk=lk,dk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:zO}));dk.displayName=`TrashIcon`;var fk=dk,pk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:BO}));pk.displayName=`UserPlusIcon`;var mk=pk,hk=`fanout.access-token`,gk=`fanout:unauthorized`;function _k(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`?``:`${t.pathname}${t.search}`}function vk(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function yk(){localStorage.removeItem(hk)}function bk(){yk(),window.dispatchEvent(new Event(gk))}async function xk(e,t={}){let n=new Headers(t.headers);n.set(`Fanout-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&bk(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw Error(e.message??e.error??`You do not have permission to perform this action.`)}return r}async function Sk(){let e=await xk(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&bk(),window.location.assign(`/`)}var Ck=(0,L.createContext)(null);function wk(){let e=(0,L.useContext)(Ck);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var Tk=(0,L.createContext)(null);function Ek(){let e=(0,L.useContext)(Tk);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function Dk(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``?null:{id:t.id,email:typeof t.email==`string`?t.email:``,name:typeof t.name==`string`?t.name:``,role:typeof t.role==`string`?t.role:``}}async function Ok(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??r.error??`Request failed (${n.status})`);return r}function kk({children:e,wide:t=!1}){return(0,R.jsx)(we,{mih:`100dvh`,style:{background:`radial-gradient(circle at 50% -12%, var(--mantine-color-brand-light), transparent 38%), linear-gradient(180deg, var(--mantine-color-default-hover), var(--mantine-color-body) 62%)`},children:(0,R.jsx)(oe,{mih:`100dvh`,px:`md`,py:48,children:(0,R.jsx)(D,{size:t?680:480,w:`100%`,children:(0,R.jsx)(Ee,{radius:28,p:{base:24,sm:40},style:{background:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-default-border)`,boxShadow:`var(--mantine-shadow-xl)`},children:e})})})})}function Ak(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function jk(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function Mk({children:e}){let t=bi(),[n,r]=(0,L.useState)(null),[i,a]=(0,L.useState)(!1),[o,s]=(0,L.useState)(`none`),[c,l]=(0,L.useState)(null),[u,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(``),[g,_]=(0,L.useState)(Ak),[v,y]=(0,L.useState)(jk),[b,x]=(0,L.useState)(``),[S,w]=(0,L.useState)(!1),[T,E]=(0,L.useState)(0),[D,k]=(0,L.useState)(()=>Date.now()),[A,j]=(0,L.useState)(!1),[M,N]=(0,L.useState)(``),[ne,ie]=(0,L.useState)(null),[P,ae]=(0,L.useState)(!1),se=(0,L.useRef)(null),ce=_k(),le=o===`user`;async function ue(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){s(`none`),l(null);return}let t=await e.json().catch(()=>null);s(vk(t)),l(Dk(t))}async function fe(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;l(Dk(await e.json().catch(()=>null)))}catch{}}(0,L.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),t({href:e.pathname+e.search+e.hash,replace:!0}))},[t]),(0,L.useEffect)(()=>{yk(),Ok(`/api/auth/status`).then(r).catch(e=>N(String(e))).finally(()=>a(!0)),ue().catch(()=>s(`none`)).finally(()=>d(!0));let e=()=>{s(`none`),l(null)};return window.addEventListener(gk,e),()=>window.removeEventListener(gk,e)},[]),(0,L.useEffect)(()=>{u&&o===`none`&&v&&(j(!0),N(``),Ok(`/api/auth/login-link`,{token:v}).then(()=>{s(`user`),fe()}).catch(e=>N(e instanceof Error?e.message:String(e))).finally(()=>{y(``),j(!1)}))},[v,u,o]),(0,L.useEffect)(()=>{le&&u&&ce&&window.location.replace(ce)},[le,ce,u]),(0,L.useEffect)(()=>{if(T<=Date.now())return;let e=setInterval(()=>{k(Date.now()),Date.now()>=T&&clearInterval(e)},1e3);return()=>clearInterval(e)},[T]);let pe=Math.max(0,Math.ceil((T-D)/1e3));(0,L.useEffect)(()=>{S&&!A&&M&&se.current?.querySelector(`input`)?.focus()},[A,S,M]);async function me(e){try{await navigator.clipboard.writeText(e),ae(!0)}catch{N(`Clipboard access failed. Select and copy the token manually.`)}}if(ne?.ingest_token)return(0,R.jsx)(kk,{wide:!0,children:(0,R.jsxs)(F,{gap:`lg`,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,R.jsx)(de,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,R.jsx)(O,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,R.jsx)(am,{block:!0,children:ne.suggested_endpoint??`${window.location.hostname}:4317`})]}),(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`Header`}),(0,R.jsxs)(am,{block:!0,children:[ne.ingest_header_name??`Authorization`,`: Bearer `,ne.ingest_token]})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),(0,R.jsxs)(te,{grow:!0,align:`stretch`,children:[(0,R.jsx)(xe,{variant:`light`,radius:`md`,leftSection:P?(0,R.jsx)(re,{size:16,weight:`bold`}):(0,R.jsx)(ge,{size:16}),onClick:()=>void me(`${ne.ingest_header_name??`Authorization`}: Bearer ${ne.ingest_token}`),children:P?`Copied`:`Copy header`}),(0,R.jsx)(xe,{radius:`md`,rightSection:(0,R.jsx)(WO,{size:16,weight:`bold`}),onClick:()=>{s(`user`),ie(null),fe()},children:`Continue to Fanout`})]}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,onClick:()=>void me(ne.ingest_token??``),children:`Copy token only`})]})});if(!u||!i||v)return(0,R.jsx)(oe,{mih:`100dvh`,children:(0,R.jsx)(C,{size:`sm`})});if(!n)return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:`lg`,children:[(0,R.jsx)(ye,{}),(0,R.jsx)(de,{order:1,children:`Fanout is unavailable`}),(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M||`Authentication status could not be loaded.`})]})});if(le&&ce)return null;if(le)return(0,R.jsx)(Ck.Provider,{value:n,children:(0,R.jsx)(Tk.Provider,{value:c??{id:``,email:f,name:m,role:``},children:e})});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=ce?`/api/auth/oidc/start?return_to=${encodeURIComponent(ce)}`:`/api/auth/oidc/start`;return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:28,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(F,{gap:10,children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,R.jsx)(de,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,R.jsx)(O,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),(0,R.jsx)(xe,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function he(){j(!0),N(``);try{await Ok(`/api/auth/start`,{email:f}),w(!0),x(``),E(Date.now()+3e4),k(Date.now())}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}}async function _e(e){j(!0),N(``);try{await Ok(`/api/auth/verify`,{email:f,code:e}),s(`user`),w(!1),x(``),E(0),fe()}catch(e){x(``),N(e instanceof Error?e.message:String(e))}finally{j(!1)}}function ve(){w(!1),x(``),N(``)}async function be(e){e.preventDefault(),j(!0),N(``);try{if(n?.setup_required){let e=await Ok(`/api/auth/setup`,{email:f,name:m,setup_token:g});e.ingest_token?ie(e):(s(`user`),fe())}else if(S){await _e(b);return}else{await he();return}}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}}let I=S&&!n?.setup_required,Se=n?.setup_required?`Create the first admin`:I?`Check your email`:n?.self_signup?`Sign in or create an account`:`Sign in`,Ce=n?.setup_required?`Use the one-time token printed by the Fanout process.`:n?.smtp_configured?I?`We sent a code to ${f}.`:n?.self_signup?`Enter your email to sign in or create a viewer account. No password needed.`:`Enter your email and we’ll send a short verification code. No password needed.`:`Email delivery is not configured. Ask the operator to run fanout login-link with your email address.`;return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:28,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(F,{gap:10,children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:n?.setup_required?`One-time setup`:`Secure workspace`}),(0,R.jsx)(de,{order:1,fz:{base:28,sm:32},lh:1.08,children:Se}),Ce&&(0,R.jsx)(O,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:Ce})]}),(0,R.jsx)(`form`,{onSubmit:be,children:(0,R.jsxs)(F,{gap:`md`,children:[(0,R.jsx)(Xh,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:f,onChange:e=>p(e.currentTarget.value),disabled:S,variant:`filled`,radius:`md`,size:`md`,autoFocus:!S}),n?.setup_required&&(0,R.jsx)(Xh,{label:`Name`,placeholder:`Your name`,value:m,onChange:e=>h(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),n?.setup_required&&(0,R.jsx)(Xh,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:g,onChange:e=>_(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),I&&(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`Verification code`}),(0,R.jsx)(we,{ref:se,children:(0,R.jsx)(Fh,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:b,onChange:x,onComplete:e=>void _e(e),disabled:A,error:!!M,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,R.jsxs)(te,{justify:`space-between`,gap:`xs`,children:[(0,R.jsxs)(O,{c:`dimmed`,size:`xs`,children:[`Sent to `,f]}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,leftSection:(0,R.jsx)(HO,{size:12,weight:`bold`}),onClick:ve,disabled:A,children:`Change email`})]}),(0,R.jsxs)(te,{justify:`space-between`,gap:`xs`,children:[(0,R.jsx)(O,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,onClick:()=>void he(),disabled:A||pe>0,children:pe>0?`Resend in ${pe}s`:`Resend code`})]})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),I?(0,R.jsx)(xe,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:A||b.length<6,rightSection:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:`Verify code`}):(0,R.jsx)(xe,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:!n||!n.setup_required&&!n.smtp_configured,leftSection:n?.setup_required?(0,R.jsx)(mk,{size:17,weight:`bold`}):void 0,rightSection:n?.setup_required?void 0:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:n?.setup_required?`Create admin`:`Send code`})]})})]})})}var Nk=[`dashboards`],Pk=[`agent-threads`];async function Fk(e){let t=await xk(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var Ik=(0,L.createContext)(null);function Lk(){let e=(0,L.useContext)(Ik);if(!e)throw Error(`Fanout app context is unavailable`);return e}var Rk=`Create a new dashboard for me. First ask what I want to monitor, then design it when you have enough context.`,zk={observability_overview:`Checking system health…`,service_topology:`Mapping service dependencies…`,service_performance:`Reading performance signals…`,trace_detail:`Inspecting a trace…`,search_logs:`Searching logs…`,intelligence_snapshot:`Reviewing detected anomalies…`};function Bk(e){return zk[e]??`Working on it…`}var Vk=[];for(let e=0;e<256;++e)Vk.push((e+256).toString(16).slice(1));function Hk(e,t=0){return(Vk[e[t+0]]+Vk[e[t+1]]+Vk[e[t+2]]+Vk[e[t+3]]+`-`+Vk[e[t+4]]+Vk[e[t+5]]+`-`+Vk[e[t+6]]+Vk[e[t+7]]+`-`+Vk[e[t+8]]+Vk[e[t+9]]+`-`+Vk[e[t+10]]+Vk[e[t+11]]+Vk[e[t+12]]+Vk[e[t+13]]+Vk[e[t+14]]+Vk[e[t+15]]).toLowerCase()}var Uk=new Uint8Array(16);function Wk(){return crypto.getRandomValues(Uk)}var Gk={};function Kk(e,t,n){let r;if(e)r=Jk(e.random??e.rng?.()??Wk(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=Wk();qk(Gk,e,i),r=Jk(i,Gk.msecs,Gk.seq,t,n)}return t??Hk(r)}function qk(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=Yk(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function Jk(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=Yk(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function Yk(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function Xk(){return Kk()}async function Zk(e,t){let n=new URLSearchParams({limit:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await xk(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function Qk({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,ref:l}){let u=nD(),[d,f]=(0,L.useState)(``),[p]=Na(d.trim(),250),[m,h]=(0,L.useState)(null),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(``),[S,w]=(0,L.useState)(!1),T=(0,L.useRef)(null);(0,L.useImperativeHandle)(l,()=>({focusSearch:()=>T.current?.focus()}),[]),(0,L.useEffect)(()=>{r&&requestAnimationFrame(()=>T.current?.focus())},[r]);let D=EO({queryKey:[...Pk,p],queryFn:({pageParam:e})=>Zk(p,e),initialPageParam:``,getNextPageParam:e=>e.nextCursor||void 0,enabled:e}),k=TO({queryKey:Nk,queryFn:()=>Fk(`/api/dashboards`),refetchInterval:3e4}),A=(0,L.useMemo)(()=>D.data?.pages.flatMap(e=>e.threads)??[],[D.data]),j=(0,L.useMemo)(()=>iA(A),[A]),M=(0,L.useMemo)(()=>{let e=k.data?.dashboards??[],t=p.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[k.data,p]);function N(e){x(``),y(e.title),h(e)}async function ne(){if(m&&v.trim()){w(!0),x(``);try{let e=await xk(`/api/agent/threads/${encodeURIComponent(m.threadId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:v.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await u.invalidateQueries({queryKey:Pk}),h(null)}catch(e){x(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{w(!1)}}}async function re(){if(g){w(!0),x(``);try{let e=await xk(`/api/agent/threads/${encodeURIComponent(g.threadId)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=g.threadId;_(null),await u.invalidateQueries({queryKey:Pk}),o(t)}catch(e){x(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{w(!1)}}}return(0,R.jsxs)(F,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,R.jsx)(xe,{leftSection:(0,R.jsx)(ik,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,R.jsx)(Ku,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,R.jsxs)(F,{gap:`lg`,pb:`sm`,children:[e&&(0,R.jsxs)(F,{gap:4,children:[(0,R.jsx)($k,{children:`Chats`}),D.isLoading&&(0,R.jsx)(oe,{py:`md`,children:(0,R.jsx)(C,{size:`xs`})}),D.isError&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!D.isLoading&&!D.isError&&A.length===0&&(0,R.jsx)(O,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:p?`No matching chats`:`No chats yet`}),j.map(e=>(0,R.jsxs)(F,{gap:2,children:[j.length>1&&(0,R.jsx)(O,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,R.jsx)(eA,{thread:e,active:e.threadId===t,onSelect:()=>a(e.threadId),onRename:()=>N(e),onDelete:()=>{x(``),_(e)}},e.threadId))]},e.label)),D.hasNextPage&&(0,R.jsx)(xe,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:D.isFetchingNextPage,onClick:()=>void D.fetchNextPage(),children:`See all`})]}),(0,R.jsxs)(F,{gap:4,children:[(0,R.jsx)($k,{children:`Dashboards`}),k.isLoading&&(0,R.jsx)(oe,{py:`md`,children:(0,R.jsx)(C,{size:`xs`})}),k.isError&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!k.isLoading&&!k.isError&&p&&M.length===0&&(0,R.jsx)(O,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),M.map(e=>{let t=e.id===n;return(0,R.jsx)(E,{className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:()=>s(e.id),children:(0,R.jsxs)(te,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(O,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,R.jsx)($p,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})},e.id)}),e&&(0,R.jsx)(xe,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,R.jsx)(ck,{size:14,weight:`fill`}),onClick:c,children:`Create with AI`})]})]})}),(0,R.jsx)(Xh,{ref:T,value:d,onChange:e=>f(e.currentTarget.value),leftSection:(0,R.jsx)(QO,{size:15}),rightSection:(0,R.jsx)(Om,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats and dashboards`,size:`sm`}),(0,R.jsx)(kh,{opened:m!==null,onClose:()=>!S&&h(null),title:`Rename chat`,centered:!0,children:(0,R.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),ne()},children:(0,R.jsxs)(F,{children:[(0,R.jsx)(Xh,{label:`Name`,value:v,onChange:e=>y(e.currentTarget.value),maxLength:120,autoFocus:!0}),b&&(0,R.jsx)(ee,{color:`bad`,children:b}),(0,R.jsxs)(te,{justify:`flex-end`,children:[(0,R.jsx)(xe,{variant:`default`,onClick:()=>h(null),disabled:S,children:`Cancel`}),(0,R.jsx)(xe,{type:`submit`,loading:S,disabled:!v.trim(),children:`Save`})]})]})})}),(0,R.jsx)(kh,{opened:g!==null,onClose:()=>!S&&_(null),title:`Delete chat?`,centered:!0,children:(0,R.jsxs)(F,{children:[(0,R.jsxs)(O,{size:`sm`,children:[`This permanently removes `,(0,R.jsx)(O,{span:!0,fw:650,children:g?.title}),` and its saved messages.`]}),b&&(0,R.jsx)(ee,{color:`bad`,children:b}),(0,R.jsxs)(te,{justify:`flex-end`,children:[(0,R.jsx)(xe,{variant:`default`,onClick:()=>_(null),disabled:S,children:`Cancel`}),(0,R.jsx)(xe,{color:`bad`,loading:S,onClick:()=>void re(),children:`Delete`})]})]})})]})}function $k({children:e}){return(0,R.jsx)(O,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function eA({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,R.jsx)(we,{"data-active":t||void 0,className:`rail-row`,children:(0,R.jsxs)(te,{gap:2,wrap:`nowrap`,children:[(0,R.jsx)(E,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,R.jsxs)(F,{gap:0,children:[(0,R.jsx)(O,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,R.jsx)(O,{c:`dimmed`,size:`xs`,children:aA(e.updatedAt)})]})}),(0,R.jsxs)(ph,{position:`bottom-end`,withinPortal:!0,children:[(0,R.jsx)(ph.Target,{children:(0,R.jsx)(zd,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,R.jsx)(KO,{size:18,weight:`bold`})})}),(0,R.jsxs)(ph.Dropdown,{children:[(0,R.jsx)(ph.Item,{leftSection:(0,R.jsx)(nk,{size:15}),onClick:r,children:`Rename`}),(0,R.jsx)(ph.Item,{color:`bad`,leftSection:(0,R.jsx)(fk,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function tA(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function nA(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var rA=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function iA(e){let t=nA(new Date),n=new Map;for(let r of e){let e=Math.floor((t-nA(tA(r.updatedAt)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return rA.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function aA(e){let t=tA(e),n=nA(new Date);return Math.floor((n-nA(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function oA({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=Lk(),s=bi(),c=ua({select:e=>e.location.pathname}),{dashboardId:l}=vi({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=qa(!1),[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(``),_=(0,L.useRef)(null),v=ue(`(max-width: 62em)`),y=(0,L.useRef)(v);y.current=v,(0,L.useEffect)(()=>{f.close()},[c]),(0,L.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e}}),onCreateDashboard:()=>o(Rk)};return(0,R.jsxs)(Rp,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,R.jsx)(Rp.Header,{children:(0,R.jsxs)(te,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsxs)(te,{gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(nm,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,R.jsx)(ye,{size:`small`})]}),(0,R.jsxs)(te,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(sA,{}),(0,R.jsx)(cA,{onError:g})]})]})}),(0,R.jsx)(Rp.Navbar,{p:`sm`,children:(0,R.jsx)(Qk,{ref:_,...b})}),(0,R.jsx)(Tm,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,R.jsx)(ye,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,R.jsx)(Qk,{...b,autoFocusSearch:d&&p})}),(0,R.jsxs)(Rp.Main,{children:[h&&(0,R.jsx)(ee,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function sA(){let{setColorScheme:e}=co(),t=fo(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`;return(0,R.jsx)(Yh,{label:`Switch to ${n} theme`,children:(0,R.jsx)(zd,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onClick:()=>e(n),children:t===`dark`?(0,R.jsx)(uk,{size:17,weight:`bold`}):(0,R.jsx)(ek,{size:17,weight:`bold`})})})}function cA({onError:e}){let t=Ek(),n=(t.name.trim()||t.email.trim()||`?`).charAt(0).toUpperCase();return(0,R.jsxs)(ph,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(ph.Target,{children:(0,R.jsx)(zd,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,R.jsx)(Xp,{size:26,radius:`xl`,color:`brand`,children:n})})}),(0,R.jsxs)(ph.Dropdown,{children:[(0,R.jsx)(ph.Label,{children:t.email||`Signed in`}),(0,R.jsx)(ph.Item,{component:`a`,href:`https://github.com/labstack/fanout`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(JO,{size:15,weight:`bold`}),children:`Fanout on GitHub`}),(0,R.jsx)(ph.Item,{component:`a`,href:`https://labstack.com`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(XO,{size:15}),children:`LabStack`}),(0,R.jsx)(ph.Divider,{}),(0,R.jsx)(ph.Item,{leftSection:(0,R.jsx)(ok,{size:15}),onClick:()=>void Sk().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function lA(){let{agent_available:e}=wk(),t=bi(),n=nD(),{threadId:r}=vi({strict:!1}),[i,a]=(0,L.useState)(Xk),o=(0,L.useRef)(new Set),s=r??i,[c,l]=(0,L.useState)([]),[u,d]=(0,L.useState)({}),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(``),[S,C]=(0,L.useState)(``),[w,T]=(0,L.useState)(0),E=(0,L.useRef)(``),D=(0,L.useRef)(null),O=(0,L.useRef)(null),k=(0,L.useRef)(0),A=(0,L.useMemo)(()=>new eD({url:`/api/agent`,threadId:s,fetch:(e,t)=>xk(e,t)}),[s]),ee=!e||f===s;function j(){k.current=0,y(``)}(0,L.useEffect)(()=>{let t=!0;if(l([]),d({}),p(``),h(!1),_(!1),j(),C(``),!e){p(s);return}!r||o.current.has(s)?(A.setMessages([]),p(s)):xk(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}A.setMessages(e.messages??[]),l([...e.messages??[]]),p(s)}}).catch(()=>{t&&(E.current=``,C(`This chat could not be restored. Start a new chat or try again.`))});let i=A.subscribe({onEvent:({messages:e})=>l([...e]),onRunInitialized:()=>{_(!0),C(``)},onToolCallStartEvent:({event:e})=>{k.current+=1,y(Bk(e.toolCallName))},onToolCallEndEvent:()=>{k.current=Math.max(0,k.current-1),k.current===0&&y(``)},onRunFinalized:({messages:e})=>{let t=[...e];l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),j(),o.current.delete(s),n.invalidateQueries({queryKey:Pk})},onRunFailed:e=>{console.error(`Agent run failed`,e),C(`Fanout could not complete this analysis.`),_(!1),j(),o.current.delete(s),n.invalidateQueries({queryKey:Pk})}});return()=>{t=!1,i.unsubscribe(),A.abortRun()}},[A,e,n,w,s]),(0,L.useEffect)(()=>{D.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[c,g]),(0,L.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>O.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>O.current?.focus()))),e.key===`Escape`&&n===O.current&&(x(``),O.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function M(){_(!0),C(``);try{await A.runAgent()}catch(e){console.error(`Agent run failed`,e),C(`Fanout could not complete this analysis.`),_(!1),j(),o.current.delete(s)}}async function N(n){let i=n.trim();if(!e||!i||g||!ee||m)return;r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let a={id:Xk(),role:`user`,content:i};A.addMessage(a),l([...A.messages]),d(e=>({...e,[a.id]:Date.now()})),x(``),await M()}(0,L.useEffect)(()=>{let e=E.current;ee&&r&&e&&(E.current=``,N(e))},[ee,r,s]);function te(e){e.preventDefault(),N(b)}function ne(){A.abortRun(),_(!1),j(),o.current.delete(s)}function re(){!g&&A.messages.some(e=>e.role===`user`)&&M()}function ie(n){if(!e)return;let r=Xk();o.current.add(r),E.current=n??``,t({to:`/chat/$threadId`,params:{threadId:r}})}function P(){A.abortRun(),E.current=``,a(Xk()),t({to:`/chat`})}function ae(e){t({to:`/chat/$threadId`,params:{threadId:e}})}function oe(){T(e=>e+1)}return(0,R.jsx)(Ik.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:ee,running:g,activity:v,input:b,setInput:x,error:S,bottomRef:D,inputRef:O,send:N,submit:te,stop:ne,retry:re,reloadThread:oe,openChat:ie,newThread:P,selectThread:ae},children:(0,R.jsx)(oA,{children:(0,R.jsx)(ea,{})})})}function uA(){let e=(0,L.useMemo)(()=>new fO,[]);return(0,R.jsx)(rD,{client:e,children:(0,R.jsx)(Mk,{children:(0,R.jsx)(lA,{})})})}var dA=Vi({component:uA,notFoundComponent:()=>(0,R.jsx)(xi,{to:`/`,replace:!0})}),fA=`modulepreload`,pA=function(e){return`/`+e},mA={},hA=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=pA(t,n),t=s(t),t in mA)return;mA[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:fA,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},gA=Hi(`/`)({component:Ui(()=>hA(()=>import(`./routes-DdP3ZNeG.js`),__vite__mapDeps([0,1])),`component`)}),_A=Hi(`/chat/`)({component:Ui(()=>hA(()=>import(`./chat.index-DSIYq_x1.js`),__vite__mapDeps([2,3,1,4])),`component`)}),vA=Hi(`/chat/$threadId`)({component:Ui(()=>hA(()=>import(`./chat._threadId-DSIYq_x1.js`),__vite__mapDeps([5,3,1,4])),`component`)}),yA=Hi(`/dashboards/`)({component:Ui(()=>hA(()=>import(`./dashboards.index-BuFeceag.js`),__vite__mapDeps([6,1,7,4])),`component`)}),bA=Hi(`/dashboards/$dashboardId`)({component:Ui(()=>hA(()=>import(`./dashboards._dashboardId-Dlv44ftW.js`),__vite__mapDeps([8,1,7,4])),`component`)}),xA=gA.update({id:`/`,path:`/`,getParentRoute:()=>dA}),SA=_A.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>dA}),CA=vA.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>dA}),wA=yA.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>dA}),TA={IndexRoute:xA,ChatThreadIdRoute:CA,DashboardsDashboardIdRoute:bA.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>dA}),ChatIndexRoute:SA,DashboardsIndexRoute:wA},EA=oa({routeTree:dA._addFileChildren(TA)._addFileTypes(),defaultPreload:`intent`,scrollRestoration:!0}),DA=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],OA=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],kA=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],AA=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],jA=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],MA=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],NA={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},PA={dark:[`#66d0ee`,`#a97ce0`,`#5fe8ce`,`#cb55e8`,`#41b6f8`,`#d2a6ff`],light:[`#2b93b5`,`#7c4dcc`,`#1a9c86`,`#a12fbf`,`#2f7fd4`,`#9163d6`]},FA={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},IA={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:DA,brand:OA,ok:kA,warn:AA,bad:jA,info:MA},defaultRadius:`md`,fontFamily:FA.body,fontFamilyMonospace:FA.display,headings:{fontFamily:FA.body,fontWeight:`600`},cursorType:`pointer`},LA=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":NA.light.muted},dark:{}}),RA=Eo(IA);(0,q_.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(To,{theme:RA,defaultColorScheme:`auto`,cssVariablesResolver:LA,children:(0,R.jsx)(la,{router:EA})})}));export{kh as A,eo as B,gD as C,nD as D,AD as E,jd as F,fa as G,Ea as H,Ku as I,xi as K,fo as L,$p as M,zp as N,Xh as O,zd as P,io as R,PD as S,bD as T,ma as U,Ka as V,pa as W,ik as _,PA as a,cO as b,hA as c,Nk as d,Fk as f,ck as g,fk as h,kA as i,ph as j,Yh as k,Xk as l,xk as m,NA as n,AA as o,wk as p,bi as q,MA as r,bA as s,jA as t,Lk as u,KO as v,cD as w,RD as x,TO as y,to as z}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-T5JN5RKZ.js b/internal/ui/dist/assets/mcp-app-frame-D0PVhqdW.js similarity index 99% rename from internal/ui/dist/assets/mcp-app-frame-T5JN5RKZ.js rename to internal/ui/dist/assets/mcp-app-frame-D0PVhqdW.js index acc0caaaa..37ab0934d 100644 --- a/internal/ui/dist/assets/mcp-app-frame-T5JN5RKZ.js +++ b/internal/ui/dist/assets/mcp-app-frame-D0PVhqdW.js @@ -1,4 +1,4 @@ -import{_ as e,_t as t,bt as n,d as r,f as i,gt as a,ht as o,l as s,pt as c,vt as l,x as u,xt as d,yt as f}from"./brand-CCB4_HD8.js";import{L as p,m}from"./index-DYcEv4SB.js";function h(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function g(e,t=`|`){return e.map(e=>se(e)).join(t)}function _(e,t){return typeof t==`bigint`?t.toString():t}function v(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function y(e){return e==null}function b(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function x(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){};function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var re=v(()=>{if(Ke.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function T(e){if(w(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return w(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ie(e){return T(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ae=new Set([`string`,`number`,`symbol`]);function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function se(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var le={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ue(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&S(e,r,n.shape[r])}return S(this,`shape`,e),e},checks:[]}))}function de(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return S(this,`shape`,r),r},checks:[]}))}function fe(e,t){if(!T(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function pe(e,t){if(!T(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function me(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return S(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function he(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return S(this,`shape`,i),i},checks:[]}))}function ge(e,t,n){return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return S(this,`shape`,i),i}}))}function _e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function be(e){return typeof e==`string`?e:e?.message}function xe(e,t,n){var r;for(let i=t;ie;return t[Le]=!0,t}var ze,Be=Object.freeze({status:`aborted`}),Ve={value:void 0,enumerable:!1},He=`captureStackTrace`in Error?Error:null;function Ue(e){let t=He;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return He=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function k(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Oe(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ue(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var We=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ge=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ze=globalThis).__zod_globalConfig??(ze.__zod_globalConfig={});var Ke=globalThis.__zod_globalConfig;function qe(e){return e&&Object.assign(Ke,e),Ke}function Je(){let e=this._zod;return e.message??=JSON.stringify(e.def,_,2),e.message}function Ye(e){this._zod.message=e}var Xe={get:Je,set:Ye,enumerable:!0,configurable:!0},Ze={value:void 0,enumerable:!1},Qe={value:void 0,enumerable:!1},$e=new WeakSet([Object.prototype,Error.prototype]),et=(e,t)=>{e.name=`$ZodError`,Ze.value=e._zod,Object.defineProperty(e,"_zod",Ze),Qe.value=t,Object.defineProperty(e,"issues",Qe),Ze.value=void 0,Qe.value=void 0,Object.defineProperty(e,"message",Xe);let n=Object.getPrototypeOf(e);$e.has(n)||($e.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},tt=k(`$ZodError`,et),nt=k(`$ZodError`,et,void 0,{Parent:Error});function rt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function it(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?rt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function at(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new We;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},ct=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},lt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new We;return a.issues.length?{success:!1,error:new(e??tt)(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ut=lt(nt),dt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ft=dt(nt),pt=e=>{let t=st(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ot(n,a))};return n},mt=e=>{let t=st(e),n=(e,r,i,a)=>t(e,r,i,ot(n,a));return n},ht=e=>{let t=ct(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ot(n,a))};return n},gt=e=>{let t=ct(e),n=async(e,r,i,a)=>await t(e,r,i,ot(n,a));return n},_t=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lt(e)(t,n,i)},vt=e=>(t,n,r)=>lt(e)(t,n,r),yt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dt(e)(t,n,i)},bt=e=>async(t,n,r)=>dt(e)(t,n,r),xt=/^[cC][0-9a-z]{6,}$/,St=/^[0-9a-z]+$/,Ct=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wt=/^[0-9a-vA-V]{20}$/,Tt=/^[A-Za-z0-9]{27}$/,Et=/^[a-zA-Z0-9_-]{21}$/;function Dt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ot=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,At=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mt=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Nt(){return new RegExp(Mt,`u`)}var Pt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,It=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Lt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zt=/^[A-Za-z0-9_-]*$/,Bt=/^https?$/,Vt=/^\+[1-9]\d{6,14}$/,Ht=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Ut(e){return RegExp(`^${e}$`)}var Wt=Ut(Ht);function Gt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kt(e){return RegExp(`^${Gt(e)}$`)}function qt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Gt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Gt({precision:e.precision})}`:n;return RegExp(`^${Ht}T(?:${r})$`)}var Jt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Yt=/^-?\d+$/,Xt=/^-?\d+(?:\.\d+)?$/,Zt=/^(?:true|false)$/i,Qt=/^null$/i,$t=/^undefined$/i,en=/^[^A-Z]*$/,tn=/^[^a-z]*$/,nn=k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rn=e=>{let t=e.value;return!y(t)&&t.length!==void 0},an={number:`number`,bigint:`bigint`,object:`date`},on=k(`$ZodCheckLessThan`,(e,t)=>{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:an[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cn=k(`$ZodCheckMultipleOf`,(e,t)=>{nn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):x(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ln=k(`$ZodCheckNumberFormat`,(e,t)=>{nn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=le[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Yt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),un=k(`$ZodCheckMaxLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?we(r):i)<=t.maximum)return;let a=Te(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),dn=k(`$ZodCheckMinLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=Te(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fn=k(`$ZodCheckLengthEquals`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?we(r):i;if(a===t.length)return;let o=Te(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),pn=k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;nn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),mn=k(`$ZodCheckRegex`,(e,t)=>{pn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hn=k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=en,pn.init(e,t)}),gn=k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=tn,pn.init(e,t)}),_n=k(`$ZodCheckIncludes`,(e,t)=>{nn.init(e,t);let n=oe(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),vn=k(`$ZodCheckStartsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`^${oe(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),yn=k(`$ZodCheckEndsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`.*${oe(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),bn=k(`$ZodCheckOverwrite`,(e,t)=>{nn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),xn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` +import{_ as e,_t as t,bt as n,d as r,f as i,gt as a,ht as o,l as s,pt as c,vt as l,x as u,xt as d,yt as f}from"./brand-CCB4_HD8.js";import{L as p,m}from"./index-BxnvJp0Y.js";function h(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function g(e,t=`|`){return e.map(e=>se(e)).join(t)}function _(e,t){return typeof t==`bigint`?t.toString():t}function v(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function y(e){return e==null}function b(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function x(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){};function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var re=v(()=>{if(Ke.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function T(e){if(w(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return w(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ie(e){return T(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ae=new Set([`string`,`number`,`symbol`]);function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function se(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var le={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ue(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&S(e,r,n.shape[r])}return S(this,`shape`,e),e},checks:[]}))}function de(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return S(this,`shape`,r),r},checks:[]}))}function fe(e,t){if(!T(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function pe(e,t){if(!T(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function me(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return S(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function he(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return S(this,`shape`,i),i},checks:[]}))}function ge(e,t,n){return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return S(this,`shape`,i),i}}))}function _e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function be(e){return typeof e==`string`?e:e?.message}function xe(e,t,n){var r;for(let i=t;ie;return t[Le]=!0,t}var ze,Be=Object.freeze({status:`aborted`}),Ve={value:void 0,enumerable:!1},He=`captureStackTrace`in Error?Error:null;function Ue(e){let t=He;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return He=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function k(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Oe(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ue(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var We=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ge=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ze=globalThis).__zod_globalConfig??(ze.__zod_globalConfig={});var Ke=globalThis.__zod_globalConfig;function qe(e){return e&&Object.assign(Ke,e),Ke}function Je(){let e=this._zod;return e.message??=JSON.stringify(e.def,_,2),e.message}function Ye(e){this._zod.message=e}var Xe={get:Je,set:Ye,enumerable:!0,configurable:!0},Ze={value:void 0,enumerable:!1},Qe={value:void 0,enumerable:!1},$e=new WeakSet([Object.prototype,Error.prototype]),et=(e,t)=>{e.name=`$ZodError`,Ze.value=e._zod,Object.defineProperty(e,"_zod",Ze),Qe.value=t,Object.defineProperty(e,"issues",Qe),Ze.value=void 0,Qe.value=void 0,Object.defineProperty(e,"message",Xe);let n=Object.getPrototypeOf(e);$e.has(n)||($e.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},tt=k(`$ZodError`,et),nt=k(`$ZodError`,et,void 0,{Parent:Error});function rt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function it(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?rt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function at(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new We;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},ct=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},lt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new We;return a.issues.length?{success:!1,error:new(e??tt)(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ut=lt(nt),dt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ft=dt(nt),pt=e=>{let t=st(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ot(n,a))};return n},mt=e=>{let t=st(e),n=(e,r,i,a)=>t(e,r,i,ot(n,a));return n},ht=e=>{let t=ct(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ot(n,a))};return n},gt=e=>{let t=ct(e),n=async(e,r,i,a)=>await t(e,r,i,ot(n,a));return n},_t=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lt(e)(t,n,i)},vt=e=>(t,n,r)=>lt(e)(t,n,r),yt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dt(e)(t,n,i)},bt=e=>async(t,n,r)=>dt(e)(t,n,r),xt=/^[cC][0-9a-z]{6,}$/,St=/^[0-9a-z]+$/,Ct=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wt=/^[0-9a-vA-V]{20}$/,Tt=/^[A-Za-z0-9]{27}$/,Et=/^[a-zA-Z0-9_-]{21}$/;function Dt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ot=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,At=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mt=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Nt(){return new RegExp(Mt,`u`)}var Pt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,It=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Lt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zt=/^[A-Za-z0-9_-]*$/,Bt=/^https?$/,Vt=/^\+[1-9]\d{6,14}$/,Ht=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Ut(e){return RegExp(`^${e}$`)}var Wt=Ut(Ht);function Gt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kt(e){return RegExp(`^${Gt(e)}$`)}function qt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Gt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Gt({precision:e.precision})}`:n;return RegExp(`^${Ht}T(?:${r})$`)}var Jt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Yt=/^-?\d+$/,Xt=/^-?\d+(?:\.\d+)?$/,Zt=/^(?:true|false)$/i,Qt=/^null$/i,$t=/^undefined$/i,en=/^[^A-Z]*$/,tn=/^[^a-z]*$/,nn=k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rn=e=>{let t=e.value;return!y(t)&&t.length!==void 0},an={number:`number`,bigint:`bigint`,object:`date`},on=k(`$ZodCheckLessThan`,(e,t)=>{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:an[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cn=k(`$ZodCheckMultipleOf`,(e,t)=>{nn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):x(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ln=k(`$ZodCheckNumberFormat`,(e,t)=>{nn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=le[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Yt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),un=k(`$ZodCheckMaxLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?we(r):i)<=t.maximum)return;let a=Te(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),dn=k(`$ZodCheckMinLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=Te(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fn=k(`$ZodCheckLengthEquals`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?we(r):i;if(a===t.length)return;let o=Te(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),pn=k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;nn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),mn=k(`$ZodCheckRegex`,(e,t)=>{pn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hn=k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=en,pn.init(e,t)}),gn=k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=tn,pn.init(e,t)}),_n=k(`$ZodCheckIncludes`,(e,t)=>{nn.init(e,t);let n=oe(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),vn=k(`$ZodCheckStartsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`^${oe(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),yn=k(`$ZodCheckEndsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`.*${oe(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),bn=k(`$ZodCheckOverwrite`,(e,t)=>{nn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),xn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(` `)}\n};`)(...Object.values(this.closed))}},Sn={major:4,minor:5,patch:4},A=k(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Sn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=_e(t),a;for(let o of n){if(o._zod.def.when){if(ve(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new We;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(xe(t.issues,n,e),i||=_e(t,n))});else{if(t.issues.length===n)continue;xe(t.issues,n,e),i||=_e(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(_e(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new We;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new We;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Ae(this,`~standard`,wn(this))},set"~standard"(e){ke(this,`~standard`,e)}}),Cn=e=>e.success?{value:e.data}:{issues:e.error?.issues};function wn(e){return{validate:t=>{try{return Cn(ut(e,t))}catch{return ft(e,t).then(Cn)}},vendor:`zod`,version:1}}var Tn=k(`$ZodString`,(e,t)=>{A.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Jt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),j=k(`$ZodStringFormat`,(e,t)=>{pn.init(e,t),Tn.init(e,t)}),En=k(`$ZodGUID`,(e,t)=>{t.pattern??=kt,j.init(e,t)}),Dn=k(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=At(e)}else t.pattern??=At();j.init(e,t)}),On=k(`$ZodEmail`,(e,t)=>{t.pattern??=jt,j.init(e,t)});function kn(e,t){if(!t.normalize&&t.protocol?.source===Bt.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var An=/[\t\n\r]/g;function jn(e){return e.replace(An,``)}function Mn(e,t){return t.lastIndex=0,t.test(e.hostname)}function Nn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Pn=k(`$ZodURL`,(e,t)=>{j.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=kn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Mn(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Nn(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:jn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Fn=k(`$ZodEmoji`,(e,t)=>{t.pattern??=Nt(),j.init(e,t)}),In=k(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Et:Dt(t.length),j.init(e,t)}),Ln=k(`$ZodCUID`,(e,t)=>{t.pattern??=xt,j.init(e,t)}),Rn=k(`$ZodCUID2`,(e,t)=>{t.pattern??=St,j.init(e,t)}),zn=k(`$ZodULID`,(e,t)=>{t.pattern??=Ct,j.init(e,t)}),Bn=k(`$ZodXID`,(e,t)=>{t.pattern??=wt,j.init(e,t)}),Vn=k(`$ZodKSUID`,(e,t)=>{t.pattern??=Tt,j.init(e,t)}),Hn=k(`$ZodISODateTime`,(e,t)=>{t.pattern??=qt(t),j.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),Un=k(`$ZodISODate`,(e,t)=>{t.pattern??=Wt,j.init(e,t)}),Wn=k(`$ZodISOTime`,(e,t)=>{t.pattern??=Kt(t),j.init(e,t)}),Gn=k(`$ZodISODuration`,(e,t)=>{t.pattern??=Ot,j.init(e,t)}),Kn=k(`$ZodIPv4`,(e,t)=>{t.pattern??=Pt,j.init(e,t),e._zod.bag.format=`ipv4`}),qn=/^[0-9a-fA-F:.]+$/;function Jn(e){if(!qn.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Yn=k(`$ZodIPv6`,(e,t)=>{t.pattern??=Ft,j.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Xn=k(`$ZodCIDRv4`,(e,t)=>{t.pattern??=It,j.init(e,t)});function Zn(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Jn(n)}var Qn=k(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Lt,j.init(e,t),e._zod.check=n=>{Zn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function $n(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var er=k(`$ZodBase64`,(e,t)=>{t.pattern??=Rt,j.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{$n(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function tr(e){if(!zt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return $n(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var nr=k(`$ZodBase64URL`,(e,t)=>{t.pattern??=zt,j.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{tr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),rr=k(`$ZodE164`,(e,t)=>{t.pattern??=Vt,j.init(e,t)});function ir(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var ar=k(`$ZodJWT`,(e,t)=>{j.init(e,t),e._zod.check=n=>{ir(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),or=k(`$ZodNumber`,(e,t)=>{A.init(e,t),e._zod.pattern=e._zod.bag.pattern??Xt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),sr=k(`$ZodNumberFormat`,(e,t)=>{ln.init(e,t),or.init(e,t)}),cr=k(`$ZodBoolean`,(e,t)=>{A.init(e,t),e._zod.pattern=Zt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),lr=k(`$ZodUndefined`,(e,t)=>{A.init(e,t),e._zod.pattern=$t,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),ur=k(`$ZodNull`,(e,t)=>{A.init(e,t),e._zod.pattern=Qt,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),dr=k(`$ZodAny`,(e,t)=>{A.init(e,t),e._zod.parse=e=>e}),fr=k(`$ZodUnknown`,(e,t)=>{A.init(e,t),e._zod.parse=e=>e}),pr=k(`$ZodNever`,(e,t)=>{A.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function mr(e,t,n){e.issues.length&&t.issues.push(...ye(n,e.issues)),t.value[n]=e.value}var hr=k(`$ZodArray`,(e,t)=>{A.init(e,t);let n=Ke.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;emr(t,r,e))):mr(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function gr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...ye(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}var _r=[];function vr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:_r,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ce(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function yr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>gr(e,n,i,t,u,d))):gr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var br=new WeakMap,xr=k(`$ZodObject`,(e,t)=>{if(A.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;br.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),br.set(t,n),n}})}let n=v(()=>vr(t));O(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||S(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=w,i=t.catchall,a,o=Ke.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>gr(n,t,e,c,r,i))):gr(a,t,e,c,r,i)}return i?yr(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),Sr=k(`$ZodObjectJIT`,(e,t)=>{xr.init(e,t);let n=e._zod.parse,r=v(()=>vr(t)),i=Ke.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new xn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>` for (let i = 0; i < ${e}.issues.length; i++) { diff --git a/internal/ui/dist/assets/routes-BNP_b_GZ.js b/internal/ui/dist/assets/routes-DdP3ZNeG.js similarity index 84% rename from internal/ui/dist/assets/routes-BNP_b_GZ.js rename to internal/ui/dist/assets/routes-DdP3ZNeG.js index 46ded26a1..133cbeee2 100644 --- a/internal/ui/dist/assets/routes-BNP_b_GZ.js +++ b/internal/ui/dist/assets/routes-DdP3ZNeG.js @@ -1 +1 @@ -import{pt as e}from"./brand-CCB4_HD8.js";import{K as t,p as n}from"./index-DYcEv4SB.js";var r=e();function i(){let{agent_available:e}=n();if(!e)return(0,r.jsx)(t,{to:`/dashboards`,replace:!0});let i=localStorage.getItem(`fanout.thread-id`);return i?(localStorage.removeItem(`fanout.thread-id`),(0,r.jsx)(t,{to:`/chat/$threadId`,params:{threadId:i},replace:!0})):(0,r.jsx)(t,{to:`/chat`,replace:!0})}export{i as component}; \ No newline at end of file +import{pt as e}from"./brand-CCB4_HD8.js";import{K as t,p as n}from"./index-BxnvJp0Y.js";var r=e();function i(){let{agent_available:e}=n();if(!e)return(0,r.jsx)(t,{to:`/dashboards`,replace:!0});let i=localStorage.getItem(`fanout.thread-id`);return i?(localStorage.removeItem(`fanout.thread-id`),(0,r.jsx)(t,{to:`/chat/$threadId`,params:{threadId:i},replace:!0})):(0,r.jsx)(t,{to:`/chat`,replace:!0})}export{i as component}; \ No newline at end of file diff --git a/internal/ui/dist/index.html b/internal/ui/dist/index.html index 01867d758..7251795c3 100644 --- a/internal/ui/dist/index.html +++ b/internal/ui/dist/index.html @@ -21,7 +21,7 @@ document.documentElement.setAttribute("data-mantine-color-scheme", computed); } catch (e) {} - + diff --git a/ui/apps/src/overview.tsx b/ui/apps/src/overview.tsx index 5224d5c5a..712d7f17b 100644 --- a/ui/apps/src/overview.tsx +++ b/ui/apps/src/overview.tsx @@ -22,20 +22,24 @@ function OverviewBody({ result, onService }: { result: Result; onServi const { data } = result; const total = Math.max(data.service_count, 1); const services = usePagedItems(data.services, 6); + // With nothing reported there is no rate to state and no distribution to + // draw; an em dash and the empty state below say that, where "0.00%" over an + // all-grey bar reads as a system running cleanly. + const empty = data.health === "unknown"; return <> - + - + {!empty && {data.counts.healthy} {data.counts.degraded} {data.counts.unhealthy} - + } {data.services.length === 0 ? } title="No activity in this window">Services will appear as data begins to arrive. : <>ServiceTrafficP95Errors{services.pageItems.map((service) => onService(service.service)} />)} diff --git a/ui/chart.ts b/ui/chart.ts index 873d0a427..be12d8832 100644 --- a/ui/chart.ts +++ b/ui/chart.ts @@ -3,8 +3,13 @@ * nothing here may import a package. */ import { bad, chart, info, ok, series, warn } from "./tokens"; +/* "unknown" is neutral, not alarming: an empty window has nothing to grade, and + painting it red claims a failure as confidently as green claimed health. */ export function healthColor(health: string) { - return health === "healthy" ? "ok" : health === "degraded" ? "warn" : "bad"; + if (health === "healthy") return "ok"; + if (health === "degraded") return "warn"; + if (health === "unknown") return "gray"; + return "bad"; } /* A chart is drawn into a canvas or SVG that cannot read CSS custom diff --git a/ui/contracts.ts b/ui/contracts.ts index c19481199..65dfa7968 100644 --- a/ui/contracts.ts +++ b/ui/contracts.ts @@ -1,4 +1,6 @@ -export type Health = "healthy" | "degraded" | "unhealthy"; +/** "unknown" is an empty window — no telemetry rather than good news. Mirrors + * the Health constants in internal/observability/contracts.go; keep in sync. */ +export type Health = "healthy" | "degraded" | "unhealthy" | "unknown"; export interface Provenance { query_id: string; diff --git a/ui/host/src/widgets/overview.tsx b/ui/host/src/widgets/overview.tsx index 32d1f2868..8dcb13391 100644 --- a/ui/host/src/widgets/overview.tsx +++ b/ui/host/src/widgets/overview.tsx @@ -15,15 +15,19 @@ export default function OverviewWidget({ widget, filters, dark }: WidgetBodyProp const errorTrend = (performance.data?.data.points ?? []).map((point) => point.error_rate * 100); const total = Math.max(data?.service_count ?? 0, 1); const status = statusHex(dark); - const healthWord = data ? data.health.charAt(0).toUpperCase() + data.health.slice(1) : "—"; + // An empty window says so. "Healthy · 0 services" is the one reading this + // tile must never produce: it is the answer a mistyped namespace filter gets, + // and it looks exactly like a system that is fine. + const empty = data?.health === "unknown"; + const healthWord = !data ? "—" : empty ? "No data" : data.health.charAt(0).toUpperCase() + data.health.slice(1); return - - = 0.01 ? "bad" : undefined} hint={data ? `${integer.format(data.total_spans)} operations` : undefined}> + + = 0.01 ? "bad" : undefined} hint={data && !empty ? `${integer.format(data.total_spans)} operations` : undefined}> {errorTrend.length > 1 && } - {data && + {data && !empty && diff --git a/ui/host/src/widgets/widgets.test.tsx b/ui/host/src/widgets/widgets.test.tsx index d2cdb82a4..5e3aafe9d 100644 --- a/ui/host/src/widgets/widgets.test.tsx +++ b/ui/host/src/widgets/widgets.test.tsx @@ -70,6 +70,22 @@ describe("widgets", () => { await act(async () => root.unmount()); }); + it("overview reports an empty window as no data rather than healthy", async () => { + fetchMock.mockImplementation(async (input) => { + const url = new URL(String(input), "http://localhost"); + if (url.pathname === "/api/observability/overview") { + return json({ schema: "test", summary: "no services reported telemetry in this window", provenance, data: { health: "unknown", counts: { healthy: 0, degraded: 0, unhealthy: 0 }, total_spans: 0, error_rate: 0, services: [], service_count: 0 } }); + } + return respond(input); + }); + const root = await mount({ id: "w1b", type: "overview", title: "System health", enabled: true }); + await vi.waitFor(() => expect(document.body.textContent).toContain("No data")); + expect(document.body.textContent).not.toContain("Healthy"); + expect(document.body.textContent).not.toContain("0 healthy"); + expect(document.body.textContent).not.toContain("0.00%"); + await act(async () => root.unmount()); + }); + it("topology draws a graph and counts routes", async () => { const root = await mount({ id: "w2", type: "topology", title: "Service map", enabled: true }); await vi.waitFor(() => expect(document.body.textContent).toContain("2 services · 1 route")); From 9526ba79f2ec7bd1b51075041bbdce488cee8a16 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 6 Sep 2026 17:38:03 -0700 Subject: [PATCH 3/8] fix(ingest): canonicalize log severity so a level means one thing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit normalizeSeverity upper-cased SeverityText and returned it, so the store held INFO, INFORMATION and "" for the same level: .NET writes "Information", Envoy's access logs carry no severity at all, and each spelling answered a different query. On the demo that left zero ERROR or WARN logs across a six-hour window in which the platform reported a 1.77% error rate — the 504s were in Envoy's unlabelled access logs, which no severity filter could reach. severity_number now decides when it is set, since the specification makes it authoritative and the text a display form. Text is mapped otherwise, covering OTel's numbered short names, the syslog names and the long forms from .NET and Python; an unrecognised word is kept, since it is the only grading the record carries. A record with neither is stored as UNSPECIFIED, which the log-bucket query already labels that way — a level visible in the chart should be one you can filter on. This corrects what is written from here on; rows already in Parquet keep the spelling they arrived with. Reported in #232 (P0 item 3). Stacked on fix/empty-window-not-healthy. Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk --- internal/ingest/server.go | 45 +++++++++++++++++++++++++++++----- internal/ingest/server_test.go | 25 +++++++++++++++++++ 2 files changed, 64 insertions(+), 6 deletions(-) diff --git a/internal/ingest/server.go b/internal/ingest/server.go index 3dbdf4b89..c1b82e23c 100644 --- a/internal/ingest/server.go +++ b/internal/ingest/server.go @@ -701,11 +701,18 @@ func anyValueString(v *common.AnyValue) string { // normalizeSeverity returns uppercase severity text. If text is empty, // derives it from the OTel severity number (1-24). +// normalizeSeverity maps a record onto the six OTel severity names, so that a +// search for ERROR finds every error however its emitter spelled it. +// +// Passing SeverityText through unchanged is what produced a store holding +// INFO, INFORMATION and "" for the same level: .NET writes "Information", +// Envoy's access logs carry no severity at all, and each spelling then answered +// a different query. severity_number is preferred because the specification +// makes it the authoritative field and the text the display form, and a record +// that carries neither is stored as UNSPECIFIED rather than as an empty string +// — the log-bucket query already labels that case UNSPECIFIED, and a level you +// can see in the chart should be one you can filter on. func normalizeSeverity(text string, number int32) string { - s := strings.ToUpper(text) - if s != "" { - return s - } switch { case number >= 21: return "FATAL" @@ -719,9 +726,35 @@ func normalizeSeverity(text string, number int32) string { return "DEBUG" case number >= 1: return "TRACE" - default: - return "" } + return severityFromText(text) +} + +// severityFromText canonicalizes the spellings emitters use when they send no +// severity_number: OTel's own numbered short names (INFO2, WARN3), the syslog +// names, and the long forms favoured by .NET and Python. +func severityFromText(text string) string { + name := strings.ToUpper(strings.TrimSpace(text)) + name = strings.TrimRight(name, "0123456789") + switch name { + case "FATAL", "CRIT", "CRITICAL", "EMERG", "EMERGENCY", "ALERT", "PANIC": + return "FATAL" + case "ERROR", "ERR", "SEVERE", "EXCEPTION": + return "ERROR" + case "WARN", "WARNING": + return "WARN" + case "INFO", "INFORMATION", "INFORMATIONAL", "NOTICE": + return "INFO" + case "DEBUG", "DBG", "FINE": + return "DEBUG" + case "TRACE", "VERBOSE", "FINEST": + return "TRACE" + case "": + return "UNSPECIFIED" + } + // An unrecognised level is still the emitter's own word for it, and + // discarding it would lose the only grading the record carries. + return name } func getServiceName(r *resourcepb.Resource) string { diff --git a/internal/ingest/server_test.go b/internal/ingest/server_test.go index 2894cd2fa..6e639439f 100644 --- a/internal/ingest/server_test.go +++ b/internal/ingest/server_test.go @@ -550,3 +550,28 @@ func TestTraceExportContextCancellation(t *testing.T) { t.Errorf("expected context.Canceled, got %v", err) } } + +func TestNormalizeSeverityCanonicalizesEmitterSpellings(t *testing.T) { + tests := []struct { + name string + text string + number int32 + want string + }{ + {"otel short name", "INFO", 9, "INFO"}, + {"number wins over display text", "Information", 9, "INFO"}, + {"dotnet long form without a number", "Information", 0, "INFO"}, + {"python style warning", "WARNING", 0, "WARN"}, + {"syslog critical", "crit", 0, "FATAL"}, + {"numbered short name", "ERROR2", 0, "ERROR"}, + {"envoy access log carries neither", "", 0, "UNSPECIFIED"}, + {"unrecognised level is kept", "audit", 0, "AUDIT"}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := normalizeSeverity(tt.text, tt.number); got != tt.want { + t.Errorf("normalizeSeverity(%q, %d) = %q, want %q", tt.text, tt.number, got, tt.want) + } + }) + } +} From 3bd7c31ae28fa23c2541233864b441b3b3474296 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 6 Sep 2026 17:40:08 -0700 Subject: [PATCH 4/8] fix(dashboard): the trace widget honours the service it is scoped to MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TraceWidget forwarded only trace_id, so a widget stored with {"service": "checkout"} — which is what the dashboard generator writes, and what /api/observability/trace accepts — asked for the worst trace anywhere in the window instead. The generated "Slow PlaceOrder Trace" card on the demo showed a two-span flagd evaluation between recommendation and flagd: the longest trace in the window, and nothing to do with checkout. The service reaches the query now, and the configure dialog offers it for trace widgets so a stored scope is visible and editable rather than silently dropped. Reported in #232 (P0 item 4). Stacked on fix/canonical-log-severity. Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk --- .../assets/{chat-D-J8SUFh.js => chat-XnnwteRX.js} | 6 +++--- internal/ui/dist/assets/chat._threadId-DSIYq_x1.js | 1 - internal/ui/dist/assets/chat._threadId-u0MOvyAV.js | 1 + internal/ui/dist/assets/chat.index-DSIYq_x1.js | 1 - internal/ui/dist/assets/chat.index-u0MOvyAV.js | 1 + .../assets/{copy-CUb9ms1Q.js => copy-DGK5qe2D.js} | 2 +- .../{dashboard-Dl2pFM2h.js => dashboard-qOWEIeHc.js} | 4 ++-- ...lv44ftW.js => dashboards._dashboardId-DCQxYJDK.js} | 2 +- ...index-BuFeceag.js => dashboards.index-D-Z1PEHh.js} | 2 +- .../assets/{index-BxnvJp0Y.js => index-DSdcpqnK.js} | 4 ++-- ...pp-frame-D0PVhqdW.js => mcp-app-frame-BOSJ7bPK.js} | 2 +- .../assets/{routes-DdP3ZNeG.js => routes-C2A3xwKL.js} | 2 +- internal/ui/dist/index.html | 2 +- ui/host/src/widgets/configure.tsx | 2 +- ui/host/src/widgets/trace.tsx | 5 ++++- ui/host/src/widgets/widgets.test.tsx | 11 +++++++++++ 16 files changed, 31 insertions(+), 17 deletions(-) rename internal/ui/dist/assets/{chat-D-J8SUFh.js => chat-XnnwteRX.js} (99%) delete mode 100644 internal/ui/dist/assets/chat._threadId-DSIYq_x1.js create mode 100644 internal/ui/dist/assets/chat._threadId-u0MOvyAV.js delete mode 100644 internal/ui/dist/assets/chat.index-DSIYq_x1.js create mode 100644 internal/ui/dist/assets/chat.index-u0MOvyAV.js rename internal/ui/dist/assets/{copy-CUb9ms1Q.js => copy-DGK5qe2D.js} (98%) rename internal/ui/dist/assets/{dashboard-Dl2pFM2h.js => dashboard-qOWEIeHc.js} (97%) rename internal/ui/dist/assets/{dashboards._dashboardId-Dlv44ftW.js => dashboards._dashboardId-DCQxYJDK.js} (69%) rename internal/ui/dist/assets/{dashboards.index-BuFeceag.js => dashboards.index-D-Z1PEHh.js} (82%) rename internal/ui/dist/assets/{index-BxnvJp0Y.js => index-DSdcpqnK.js} (99%) rename internal/ui/dist/assets/{mcp-app-frame-D0PVhqdW.js => mcp-app-frame-BOSJ7bPK.js} (99%) rename internal/ui/dist/assets/{routes-DdP3ZNeG.js => routes-C2A3xwKL.js} (84%) diff --git a/internal/ui/dist/assets/chat-D-J8SUFh.js b/internal/ui/dist/assets/chat-XnnwteRX.js similarity index 99% rename from internal/ui/dist/assets/chat-D-J8SUFh.js rename to internal/ui/dist/assets/chat-XnnwteRX.js index 8d0ad45be..f714ad8c6 100644 --- a/internal/ui/dist/assets/chat-D-J8SUFh.js +++ b/internal/ui/dist/assets/chat-XnnwteRX.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-D0PVhqdW.js","assets/brand-CCB4_HD8.js","assets/index-BxnvJp0Y.js","assets/index-DQPTd0xk.css"])))=>i.map(i=>d[i]); -import{C as e,Q as t,_ as n,a as r,c as i,d as a,f as o,gt as s,h as c,ht as l,i as u,j as d,k as f,l as p,n as m,o as h,p as g,pt as _,r as v,s as y,u as b,vt as x,x as S,xt as C,y as w}from"./brand-CCB4_HD8.js";import{n as T,t as E}from"./copy-CUb9ms1Q.js";import{P as D,c as O,k,u as ee}from"./index-BxnvJp0Y.js";function te(){return`development`}var A=C(l(),1),j=_(),ne=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],re={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function M(e){Object.keys(re).forEach(t=>{e.style.setProperty(t,re[t],`important`)})}function ie(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ne)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var N=null;function ae(e,t,n=1,r=1/0){N||(N=document.createElement(`textarea`),N.setAttribute(`tabindex`,`-1`),N.setAttribute(`aria-hidden`,`true`),N.setAttribute(`aria-label`,`autosize measurement`),M(N)),N.parentNode===null&&document.body.appendChild(N);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{N.style[e]=o[e]}),M(N),N.value=t;let c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i;N.value=t,c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i,N.value=`x`;let l=N.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function oe({maxRows:e,minRows:n,onChange:r,ref:i,...a}){let o=a.value!==void 0,s=(0,A.useRef)(null),c=t(s,i),l=(0,A.useRef)(0),u=(0,A.useRef)(0),d=()=>{let t=s.current;if(!t)return;let r=ie(t);if(!r)return;let[i]=ae(r,t.value||t.placeholder||`x`,n,e);l.current!==i&&(l.current=i,t.style.setProperty(`height`,`${i}px`,`important`))},f=e=>{o||d(),r?.(e)};return(0,A.useLayoutEffect)(d),(0,A.useEffect)(()=>{let e=()=>d();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,A.useEffect)(()=>{let e=s.current;if(!e||typeof ResizeObserver>`u`)return;u.current=e.offsetWidth;let t=new ResizeObserver(()=>{s.current&&s.current.offsetWidth!==u.current&&(u.current=s.current.offsetWidth,d())});return t.observe(e),()=>t.disconnect()},[]),(0,A.useEffect)(()=>{let e=()=>d();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,A.useEffect)(()=>{let e=e=>{if(s.current?.form===e.target&&!o){let e=s.current.value;requestAnimationFrame(()=>{s.current&&e!==s.current.value&&d()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[o]),(0,j.jsx)(`textarea`,{rows:n,...a,onChange:f,ref:c})}var se=e(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:a,bottomSection:o,bottomSectionProps:s,...c}=d([`Input`,`InputWrapper`,`Textarea`],null,e),l=t&&te()!==`test`,u=l?{maxRows:n,minRows:r}:{};return(0,j.jsx)(g,{component:l?oe:`textarea`,...c,__staticSelector:i||`Textarea`,__bottomSection:o,__bottomSectionProps:s,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":a},...u})});se.classes=g.classes,se.displayName=`@mantine/core/Textarea`;var ce={root:`m_d08caa0`},le=e(e=>{let t=d(`Typography`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,attributes:s,...c}=t;return(0,j.jsx)(S,{...f({name:`Typography`,classes:ce,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:s})(`root`),...c})});le.classes=ce,le.displayName=`@mantine/core/Typography`;var ue=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),de=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),fe=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:ue}));fe.displayName=`PaperPlaneTiltIcon`;var pe=fe,me=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:de}));me.displayName=`StopIcon`;var he=me;function ge(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var _e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ve=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ye={};function be(e,t){return((t||ye).jsx?ve:_e).test(e)}var xe=/[ \t\n\f\r]/g;function Se(e){return typeof e==`object`?e.type===`text`&&Ce(e.value):Ce(e)}function Ce(e){return e.replace(xe,``)===``}var we=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};we.prototype.normal={},we.prototype.property={},we.prototype.space=void 0;function Te(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new we(n,r,t)}function Ee(e){return e.toLowerCase()}var P=class{constructor(e,t){this.attribute=t,this.property=e}};P.prototype.attribute=``,P.prototype.booleanish=!1,P.prototype.boolean=!1,P.prototype.commaOrSpaceSeparated=!1,P.prototype.commaSeparated=!1,P.prototype.defined=!1,P.prototype.mustUseProperty=!1,P.prototype.number=!1,P.prototype.overloadedBoolean=!1,P.prototype.property=``,P.prototype.spaceSeparated=!1,P.prototype.space=void 0;var De=x({boolean:()=>F,booleanish:()=>I,commaOrSpaceSeparated:()=>z,commaSeparated:()=>Ae,number:()=>L,overloadedBoolean:()=>ke,spaceSeparated:()=>R}),Oe=0,F=je(),I=je(),ke=je(),L=je(),R=je(),Ae=je(),z=je();function je(){return 2**++Oe}var Me=Object.keys(De),Ne=class extends P{constructor(e,t,n,r){let i=-1;if(super(e,t),Pe(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&qe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ke,Xe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ke.test(e)){let n=e.replace(Ge,Ye);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ne}return new i(r,t)}function Ye(e){return`-`+e.toLowerCase()}function Xe(e){return e.charAt(1).toUpperCase()}var Ze=Te([Ie,ze,Ve,He,Ue],`html`),Qe=Te([Ie,Be,Ve,He,Ue],`svg`);function $e(e){return e.join(` `).trim()}var et=s(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-BOSJ7bPK.js","assets/brand-CCB4_HD8.js","assets/index-DSdcpqnK.js","assets/index-DQPTd0xk.css"])))=>i.map(i=>d[i]); +import{C as e,Q as t,_ as n,a as r,c as i,d as a,f as o,gt as s,h as c,ht as l,i as u,j as d,k as f,l as p,n as m,o as h,p as g,pt as _,r as v,s as y,u as b,vt as x,x as S,xt as C,y as w}from"./brand-CCB4_HD8.js";import{n as T,t as E}from"./copy-DGK5qe2D.js";import{P as D,c as O,k,u as ee}from"./index-DSdcpqnK.js";function te(){return`development`}var A=C(l(),1),j=_(),ne=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],re={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function M(e){Object.keys(re).forEach(t=>{e.style.setProperty(t,re[t],`important`)})}function ie(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of ne)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var N=null;function ae(e,t,n=1,r=1/0){N||(N=document.createElement(`textarea`),N.setAttribute(`tabindex`,`-1`),N.setAttribute(`aria-hidden`,`true`),N.setAttribute(`aria-label`,`autosize measurement`),M(N)),N.parentNode===null&&document.body.appendChild(N);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{N.style[e]=o[e]}),M(N),N.value=t;let c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i;N.value=t,c=s===`border-box`?N.scrollHeight+a:N.scrollHeight-i,N.value=`x`;let l=N.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function oe({maxRows:e,minRows:n,onChange:r,ref:i,...a}){let o=a.value!==void 0,s=(0,A.useRef)(null),c=t(s,i),l=(0,A.useRef)(0),u=(0,A.useRef)(0),d=()=>{let t=s.current;if(!t)return;let r=ie(t);if(!r)return;let[i]=ae(r,t.value||t.placeholder||`x`,n,e);l.current!==i&&(l.current=i,t.style.setProperty(`height`,`${i}px`,`important`))},f=e=>{o||d(),r?.(e)};return(0,A.useLayoutEffect)(d),(0,A.useEffect)(()=>{let e=()=>d();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,A.useEffect)(()=>{let e=s.current;if(!e||typeof ResizeObserver>`u`)return;u.current=e.offsetWidth;let t=new ResizeObserver(()=>{s.current&&s.current.offsetWidth!==u.current&&(u.current=s.current.offsetWidth,d())});return t.observe(e),()=>t.disconnect()},[]),(0,A.useEffect)(()=>{let e=()=>d();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,A.useEffect)(()=>{let e=e=>{if(s.current?.form===e.target&&!o){let e=s.current.value;requestAnimationFrame(()=>{s.current&&e!==s.current.value&&d()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[o]),(0,j.jsx)(`textarea`,{rows:n,...a,onChange:f,ref:c})}var se=e(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:a,bottomSection:o,bottomSectionProps:s,...c}=d([`Input`,`InputWrapper`,`Textarea`],null,e),l=t&&te()!==`test`,u=l?{maxRows:n,minRows:r}:{};return(0,j.jsx)(g,{component:l?oe:`textarea`,...c,__staticSelector:i||`Textarea`,__bottomSection:o,__bottomSectionProps:s,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":a},...u})});se.classes=g.classes,se.displayName=`@mantine/core/Textarea`;var ce={root:`m_d08caa0`},le=e(e=>{let t=d(`Typography`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,attributes:s,...c}=t;return(0,j.jsx)(S,{...f({name:`Typography`,classes:ce,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:s})(`root`),...c})});le.classes=ce,le.displayName=`@mantine/core/Typography`;var ue=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),de=new Map([[`bold`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,A.createElement(A.Fragment,null,A.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),fe=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:ue}));fe.displayName=`PaperPlaneTiltIcon`;var pe=fe,me=A.forwardRef((e,t)=>A.createElement(r,{ref:t,...e,weights:de}));me.displayName=`StopIcon`;var he=me;function ge(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var _e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ve=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ye={};function be(e,t){return((t||ye).jsx?ve:_e).test(e)}var xe=/[ \t\n\f\r]/g;function Se(e){return typeof e==`object`?e.type===`text`&&Ce(e.value):Ce(e)}function Ce(e){return e.replace(xe,``)===``}var we=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};we.prototype.normal={},we.prototype.property={},we.prototype.space=void 0;function Te(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new we(n,r,t)}function Ee(e){return e.toLowerCase()}var P=class{constructor(e,t){this.attribute=t,this.property=e}};P.prototype.attribute=``,P.prototype.booleanish=!1,P.prototype.boolean=!1,P.prototype.commaOrSpaceSeparated=!1,P.prototype.commaSeparated=!1,P.prototype.defined=!1,P.prototype.mustUseProperty=!1,P.prototype.number=!1,P.prototype.overloadedBoolean=!1,P.prototype.property=``,P.prototype.spaceSeparated=!1,P.prototype.space=void 0;var De=x({boolean:()=>F,booleanish:()=>I,commaOrSpaceSeparated:()=>z,commaSeparated:()=>Ae,number:()=>L,overloadedBoolean:()=>ke,spaceSeparated:()=>R}),Oe=0,F=je(),I=je(),ke=je(),L=je(),R=je(),Ae=je(),z=je();function je(){return 2**++Oe}var Me=Object.keys(De),Ne=class extends P{constructor(e,t,n,r){let i=-1;if(super(e,t),Pe(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&qe.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ke,Xe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ke.test(e)){let n=e.replace(Ge,Ye);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ne}return new i(r,t)}function Ye(e){return`-`+e.toLowerCase()}function Xe(e){return e.charAt(1).toUpperCase()}var Ze=Te([Ie,ze,Ve,He,Ue],`html`),Qe=Te([Ie,Be,Ve,He,Ue],`svg`);function $e(e){return e.join(` `).trim()}var et=s(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),tt=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(et());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),nt=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),rt=s(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(tt()),r=nt();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),it=ot(`end`),at=ot(`start`);function ot(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function st(e){let t=at(e),n=it(e);if(t&&n)return{start:t,end:n}}function ct(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ut(e.position):`start`in e||`end`in e?ut(e):`line`in e||`column`in e?lt(e):``}function lt(e){return dt(e&&e.line)+`:`+dt(e&&e.column)}function ut(e){return lt(e&&e.start)+`-`+lt(e&&e.end)}function dt(e){return e&&typeof e==`number`?e:1}var B=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=ct(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};B.prototype.file=``,B.prototype.name=``,B.prototype.reason=``,B.prototype.message=``,B.prototype.stack=``,B.prototype.column=void 0,B.prototype.line=void 0,B.prototype.ancestors=void 0,B.prototype.cause=void 0,B.prototype.fatal=void 0,B.prototype.place=void 0,B.prototype.ruleId=void 0,B.prototype.source=void 0;var ft=C(rt(),1),pt={}.hasOwnProperty,mt=new Map,ht=/[A-Z]/g,gt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),_t=new Set([`td`,`th`]),vt=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function yt(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=At(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=kt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Qe:Ze,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=bt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function bt(e,t,n){if(t.type===`element`)return xt(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return St(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return wt(e,t,n);if(t.type===`mdxjsEsm`)return Ct(e,t);if(t.type===`root`)return Tt(e,t,n);if(t.type===`text`)return Et(e,t)}function xt(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Qe,e.schema=i),e.ancestors.push(t);let a=It(e,t.tagName,!1),o=jt(e,t),s=Nt(e,t);return gt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Se(e)})),Dt(e,o,a,t),Ot(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function St(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Lt(e,t.position)}function Ct(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Lt(e,t.position)}function wt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Qe,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:It(e,t.name,!0),o=Mt(e,t),s=Nt(e,t);return Dt(e,o,a,t),Ot(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Tt(e,t,n){let r={};return Ot(r,Nt(e,t)),e.create(t,e.Fragment,r,n)}function Et(e,t){return t.value}function Dt(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ot(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function kt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function At(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=at(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function jt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&pt.call(t.properties,i)){let a=Pt(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&_t.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Mt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Lt(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Lt(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Nt(e,t){let n=[],r=-1,i=e.passKeys?new Map:mt;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(V(e,e.length,0,t),e):t}var Yt={}.hasOwnProperty;function Xt(e){let t={},n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function U(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var W=cn(/[A-Za-z]/),G=cn(/[\dA-Za-z]/),en=cn(/[#-'*+\--9=?A-Z^-~]/);function tn(e){return e!==null&&(e<32||e===127)}var nn=cn(/\d/),rn=cn(/[\dA-Fa-f]/),an=cn(/[!-/:-@[-`{-~]/);function K(e){return e!==null&&e<-2}function q(e){return e!==null&&(e<0||e===32)}function J(e){return e===-2||e===-1||e===32}var on=cn(/\p{P}|\p{S}/u),sn=cn(/\s/);function cn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ln(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Y(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return J(r)?(e.enter(n),s(r)):t(r)}function s(r){return J(r)&&a++o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;er;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function hn(e,t,n){return Y(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function gn(e){if(e===null||q(e)||sn(e))return 1;if(on(e))return 2}function _n(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};xn(d,-c),xn(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=H(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=H(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=H(l,_n(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=H(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=H(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,V(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n0&&J(t)?Y(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||K(t)?e.check(Pn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||K(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),J(t)?Y(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),J(t)?Y(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||K(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Ln(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Rn={name:`codeIndented`,tokenize:Bn},zn={partial:!0,tokenize:Vn};function Bn(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Y(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):K(t)?e.attempt(zn,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||K(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Vn(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Y(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):K(e)?i(e):n(e)}}var Hn={name:`codeText`,previous:Wn,resolve:Un,tokenize:Gn};function Un(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&qn(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),qn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),qn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function tr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||tn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||K(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||q(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):K(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||K(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!J(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function rr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||K(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function ir(e,t){let n;return r;function r(i){return K(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):J(i)?Y(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var ar={name:`definition`,tokenize:sr},or={partial:!0,tokenize:cr};function sr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return nr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=U(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return q(t)?ir(e,l)(t):l(t)}function l(t){return tr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(or,d,d)(t)}function d(t){return J(t)?Y(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||K(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function cr(e,t,n){return r;function r(t){return q(t)?ir(e,i)(t):n(t)}function i(t){return rr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return J(t)?Y(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||K(e)?t(e):n(e)}}var lr={name:`hardBreakEscape`,tokenize:ur};function ur(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return K(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var dr={name:`headingAtx`,resolve:fr,tokenize:pr};function fr(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},V(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function pr(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||q(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||K(n)?(e.exit(`atxHeading`),t(n)):J(n)?Y(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||q(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var mr=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),hr=[`pre`,`script`,`style`,`textarea`],gr={concrete:!0,name:`htmlFlow`,resolveTo:yr,tokenize:br},_r={partial:!0,tokenize:Sr},vr={partial:!0,tokenize:xr};function yr(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function br(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:M):W(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):W(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:M):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return W(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||q(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&hr.includes(l)?(i=1,r.interrupt?t(s):O(s)):mr.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||G(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return J(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||W(t)?(e.consume(t),b):J(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):J(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):J(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||K(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||q(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||J(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||K(t)?O(t):J(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),M):t===93&&i===5?(e.consume(t),re):K(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(_r,N,k)(t)):t===null||K(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(vr,ee,N)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||K(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),M):O(t)}function j(t){return t===47?(e.consume(t),o=``,ne):O(t)}function ne(t){if(t===62){let n=o.toLowerCase();return hr.includes(n)?(e.consume(t),ie):O(t)}return W(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function re(t){return t===93?(e.consume(t),M):O(t)}function M(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),M):O(t)}function ie(t){return t===null||K(t)?(e.exit(`htmlFlowData`),N(t)):(e.consume(t),ie)}function N(n){return e.exit(`htmlFlow`),t(n)}}function xr(e,t,n){let r=this;return i;function i(t){return K(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Sr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(wn,t,n)}}var Cr={name:`htmlText`,tokenize:wr};function wr(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):W(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):W(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):K(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):K(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):K(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):K(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return W(t)?(e.consume(t),S):n(t)}function S(t){return t===45||G(t)?(e.consume(t),S):C(t)}function C(t){return K(t)?(o=C,j(t)):J(t)?(e.consume(t),C):A(t)}function w(t){return t===45||G(t)?(e.consume(t),w):t===47||t===62||q(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||W(t)?(e.consume(t),E):K(t)?(o=T,j(t)):J(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||G(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):K(t)?(o=D,j(t)):J(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):K(t)?(o=O,j(t)):J(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):K(t)?(o=k,j(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||q(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||q(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return J(t)?Y(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}var Tr={name:`labelEnd`,resolveAll:kr,resolveTo:Ar,tokenize:jr},Er={tokenize:Mr},Dr={tokenize:Nr},Or={tokenize:Pr};function kr(e){let t=-1,n=[];for(;++t=3&&(a===null||K(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),J(t)?Y(e,s,`whitespace`)(t):s(t))}}var X={continuation:{tokenize:Kr},exit:Jr,name:`list`,tokenize:Gr},Ur={partial:!0,tokenize:Yr},Wr={partial:!0,tokenize:qr};function Gr(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:nn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Vr,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return nn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(wn,r.interrupt?n:u,e.attempt(Ur,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return J(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Kr(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(wn,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Y(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!J(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Wr,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Y(e,e.attempt(X,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function qr(e,t,n){let r=this;return Y(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Jr(e){e.exit(this.containerState.type)}function Yr(e,t,n){let r=this;return Y(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!J(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Xr={name:`setextUnderline`,resolveTo:Zr,tokenize:Qr};function Zr(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Qr(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),J(t)?Y(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||K(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var $r={tokenize:ei};function ei(e){let t=this,n=e.attempt(wn,r,e.attempt(this.parser.constructs.flowInitial,i,Y(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Xn,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ti={resolveAll:ai()},ni=ii(`string`),ri=ii(`text`);function ii(e){return{resolveAll:ai(e===`text`?oi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++ihi,contentInitial:()=>li,disable:()=>gi,document:()=>ci,flow:()=>di,flowInitial:()=>ui,insideSpan:()=>mi,string:()=>fi,text:()=>pi}),ci={42:X,43:X,45:X,48:X,49:X,50:X,51:X,52:X,53:X,54:X,55:X,56:X,57:X,62:En},li={91:ar},ui={[-2]:Rn,[-1]:Rn,32:Rn},di={35:dr,42:Vr,45:[Xr,Vr],60:gr,61:Xr,95:Vr,96:Fn,126:Fn},fi={38:Mn,92:An},pi={[-5]:zr,[-4]:zr,[-3]:zr,33:Fr,38:Mn,42:vn,60:[Sn,Cr],91:Lr,92:[lr,An],93:Tr,95:vn,96:Hn},mi={null:[vn,ti]},hi={null:[42,95]},gi={null:[]};function _i(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=H(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=_n(a,l.events,l),l.events):[]}function f(e,t){return yi(p(e),t)}function p(e){return vi(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function yi(e,t){let n=-1,r=[],i;for(;++n0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ni).call(a,void 0,e[0])}for(r.position={start:Ai(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Ai(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function ic(){return`!`}ac.peek=oc;function ac(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function oc(){return`!`}sc.peek=cc;function sc(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a\u007F]/.test(e.url))}uc.peek=dc;function uc(e,t,n,r){let i=Ks(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(lc(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function dc(e,t,n){return lc(e,n)?`<`:`[`}fc.peek=pc;function fc(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function pc(){return`[`}function mc(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function hc(e){let t=mc(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gc(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function _c(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vc(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?gc(n):mc(n),s=e.ordered?o===`.`?`)`:`.`:hc(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),_c(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function xc(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Sc=Aa([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Cc(e,t,n,r){return(e.children.some(function(e){return Sc(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function wc(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Tc.peek=Ec;function Tc(e,t,n,r){let i=wc(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Xs(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Ys(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Xs(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Ys(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ec(e,t,n){return n.options.strong||`*`}function Dc(e,t,n,r){return n.safe(e.value,r)}function Oc(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function kc(e,t,n){let r=(_c(n)+(n.options.ruleSpaces?` `:``)).repeat(Oc(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Ac={blockquote:Is,break:Bs,code:Ws,definition:qs,emphasis:Zs,hardBreak:Bs,heading:ec,html:tc,image:rc,imageReference:ac,inlineCode:sc,link:uc,linkReference:fc,list:vc,listItem:bc,paragraph:xc,root:Cc,strong:Tc,text:Dc,thematicBreak:kc};function jc(){return{enter:{table:Mc,tableData:Ic,tableHeader:Ic,tableRow:Pc},exit:{codeText:Lc,table:Nc,tableData:Fc,tableHeader:Fc,tableRow:Fc}}}function Mc(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Nc(e){this.exit(e),this.data.inTable=void 0}function Pc(e){this.enter({type:`tableRow`,children:[]},e)}function Fc(e){this.exit(e)}function Ic(e){this.enter({type:`tableCell`,children:[]},e)}function Lc(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Rc));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Rc(e,t){return t===`|`?t:e}function zc(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:` `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` -`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Ns(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var hl={tokenize:Cl,partial:!0};function gl(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:bl,continuation:{tokenize:xl},exit:Sl}},text:{91:{name:`gfmFootnoteCall`,tokenize:yl},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_l,resolveTo:vl}}}}function _l(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=U(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function vl(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function yl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||q(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(U(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return q(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function bl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||q(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=U(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return q(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xl(e,t,n){return e.check(wn,t,e.attempt(hl,t,n))}function Sl(e){e.exit(`gfmFootnoteDefinition`)}function Cl(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function wl(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=gn(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Tl=class{constructor(){this.map=[]}add(e,t,n){El(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function El(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||q(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||q(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Al(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Tl;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Nl(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ml(e,t,n,r,i){let a=[],o=Nl(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Nl(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Pl={name:`tasklistCheck`,tokenize:Il};function Fl(){return{text:{91:Pl}}}function Il(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return q(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):J(r)?e.check({tokenize:Ll},t,n)(r):n(r)}}function Ll(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Rl(e){return Xt([el(),gl(),wl(e),Ol(),Fl()])}var zl={};function Bl(e){let t=this,n=e||zl,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Rl(n)),a.push(Gc()),o.push(Kc(n))}var Vl=(0,A.lazy)(()=>O(()=>import(`./mcp-app-frame-D0PVhqdW.js`),__vite__mapDeps([0,1,2,3]))),Hl=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Ul(e){return{observability_overview:`System health`,service_topology:`Service map`,service_performance:`Performance`,trace_detail:`Trace analysis`,search_logs:`Logs`}[e]??`System analysis`}function Wl(){let{agentAvailable:e,messages:t,messageTimes:r,ready:s,running:l,activity:u,error:d,threadMissing:f,bottomRef:m,send:g,retry:_,reloadThread:v,newThread:x}=ee();if(!e)return(0,j.jsx)(i,{size:`sm`,py:96,children:(0,j.jsx)(w,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,j.jsxs)(y,{gap:`md`,children:[(0,j.jsx)(a,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,j.jsx)(h,{order:1,fz:28,children:`Chat is not configured`}),(0,j.jsx)(a,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,j.jsx)(b,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let C=t.filter(e=>e.role!==`tool`);return(0,j.jsxs)(S,{className:`chat-pane`,children:[(0,j.jsx)(S,{className:`chat-scroll`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,children:[f&&(0,j.jsx)(o,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,j.jsxs)(c,{justify:`space-between`,children:[(0,j.jsx)(a,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,onClick:x,children:`New chat`})]})}),!f&&!s&&d&&(0,j.jsx)(Gl,{message:d,onRetry:v,onNewThread:x}),!f&&!s&&!d&&(0,j.jsxs)(p,{mih:`40vh`,children:[(0,j.jsx)(n,{size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!f&&s&&(0,j.jsxs)(j.Fragment,{children:[C.length===0&&(0,j.jsx)(ql,{onSelect:g}),(0,j.jsxs)(y,{gap:`lg`,"aria-live":`polite`,children:[C.map(e=>(0,j.jsx)(Jl,{message:e,time:r[e.id],send:g},e.id)),l&&(0,j.jsxs)(c,{gap:`xs`,children:[(0,j.jsx)(n,{type:`dots`,size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,children:u||`Analyzing your system`})]}),d&&(0,j.jsx)(Gl,{message:d,onRetry:_}),(0,j.jsx)(`div`,{ref:m})]})]})]})}),!f&&(0,j.jsx)(Kl,{})]})}function Gl({message:e,onRetry:t,onNewThread:n}){return(0,j.jsx)(o,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,j.jsxs)(c,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,j.jsx)(a,{size:`sm`,children:e}),(0,j.jsxs)(c,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,j.jsx)(b,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Kl(){let{input:e,setInput:t,inputRef:n,submit:r,send:o,stop:s,ready:l,running:u}=ee();return(0,j.jsx)(S,{className:`chat-composer`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},children:[(0,j.jsx)(w,{component:`form`,onSubmit:r,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,j.jsxs)(c,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,j.jsx)(se,{ref:n,"aria-label":`Message Fanout`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),o(e))},placeholder:u?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!l,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),u?(0,j.jsx)(k,{label:`Stop`,children:(0,j.jsx)(D,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,j.jsx)(he,{size:16,weight:`fill`})})}):(0,j.jsx)(D,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!l,"aria-label":`Send message`,children:(0,j.jsx)(pe,{size:17,weight:`fill`})})]})}),(0,j.jsx)(a,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function ql({onSelect:e}){return(0,j.jsxs)(y,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,j.jsx)(m,{size:`large`}),(0,j.jsx)(h,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,j.jsx)(c,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:Hl.map(t=>(0,j.jsx)(b,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Jl({message:e,time:t,send:r}){if(e.role===`activity`){let t=e;return t.activityType===`mcp-app`?(0,j.jsx)(w,{withBorder:!0,radius:`lg`,style:{overflow:`hidden`},"aria-label":Ul(t.content.toolName),children:(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(p,{mih:180,children:(0,j.jsx)(n,{size:`sm`})}),children:(0,j.jsx)(Vl,{content:t.content,onMessage:r})})}):null}let i=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!i&&e.role===`assistant`)return null;let o=e.role===`user`,s=t?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(t)):``;return(0,j.jsxs)(S,{className:`chat-message`,"data-role":o?`user`:`assistant`,children:[o?(0,j.jsx)(w,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,j.jsx)(a,{style:{whiteSpace:`pre-wrap`},children:i})}):(0,j.jsx)(le,{className:`chat-markdown`,children:(0,j.jsx)(Ro,{remarkPlugins:[Bl],components:Xl,children:i})}),(0,j.jsxs)(c,{className:`chat-message-meta`,gap:6,justify:o?`flex-end`:`flex-start`,mt:4,children:[s&&(0,j.jsx)(a,{c:`dimmed`,size:`xs`,children:s}),!o&&(0,j.jsx)(Yl,{text:i,label:`Copy message`})]})]})}function Yl({text:e,label:t}){let{state:n,copy:r}=E();return(0,j.jsx)(k,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,j.jsx)(D,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,j.jsx)(u,{size:13,weight:`bold`}):(0,j.jsx)(v,{size:13})})})}var Xl={table:({children:e})=>(0,j.jsx)(S,{className:`chat-table`,children:(0,j.jsx)(T,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,j.jsx)(T.Thead,{children:e}),tbody:({children:e})=>(0,j.jsx)(T.Tbody,{children:e}),tr:({children:e})=>(0,j.jsx)(T.Tr,{children:e}),th:({children:e})=>(0,j.jsx)(T.Th,{children:e}),td:({children:e})=>(0,j.jsx)(T.Td,{children:e}),pre:({children:e})=>(0,j.jsx)(Zl,{children:e}),a:({href:e,children:t})=>(0,j.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Zl({children:e}){let t=Ql(e);return(0,j.jsxs)(S,{className:`chat-code`,pos:`relative`,children:[(0,j.jsx)(S,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,j.jsx)(Yl,{text:t,label:`Copy code`})}),(0,j.jsx)(`pre`,{children:e})]})}function Ql(e){return typeof e==`string`?e:Array.isArray(e)?e.map(Ql).join(``):e&&typeof e==`object`&&`props`in e?Ql(e.props.children):``}export{Wl as t}; \ No newline at end of file +`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Ns(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var hl={tokenize:Cl,partial:!0};function gl(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:bl,continuation:{tokenize:xl},exit:Sl}},text:{91:{name:`gfmFootnoteCall`,tokenize:yl},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:_l,resolveTo:vl}}}}function _l(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=U(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function vl(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function yl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||q(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(U(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return q(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function bl(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||q(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=U(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return q(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function xl(e,t,n){return e.check(wn,t,e.attempt(hl,t,n))}function Sl(e){e.exit(`gfmFootnoteDefinition`)}function Cl(e,t,n){let r=this;return Y(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function wl(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=gn(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Tl=class{constructor(){this.map=[]}add(e,t,n){El(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function El(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):K(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):J(t)?Y(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||q(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,J(t)?Y(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return J(t)?Y(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||K(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return J(t)?Y(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||K(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||K(n)?(e.exit(`tableRow`),t(n)):J(n)?Y(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||q(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Al(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Tl;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Nl(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ml(e,t,n,r,i){let a=[],o=Nl(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Nl(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Pl={name:`tasklistCheck`,tokenize:Il};function Fl(){return{text:{91:Pl}}}function Il(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return q(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return K(r)?t(r):J(r)?e.check({tokenize:Ll},t,n)(r):n(r)}}function Ll(e,t,n){return Y(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Rl(e){return Xt([el(),gl(),wl(e),Ol(),Fl()])}var zl={};function Bl(e){let t=this,n=e||zl,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Rl(n)),a.push(Gc()),o.push(Kc(n))}var Vl=(0,A.lazy)(()=>O(()=>import(`./mcp-app-frame-BOSJ7bPK.js`),__vite__mapDeps([0,1,2,3]))),Hl=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function Ul(e){return{observability_overview:`System health`,service_topology:`Service map`,service_performance:`Performance`,trace_detail:`Trace analysis`,search_logs:`Logs`}[e]??`System analysis`}function Wl(){let{agentAvailable:e,messages:t,messageTimes:r,ready:s,running:l,activity:u,error:d,threadMissing:f,bottomRef:m,send:g,retry:_,reloadThread:v,newThread:x}=ee();if(!e)return(0,j.jsx)(i,{size:`sm`,py:96,children:(0,j.jsx)(w,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,j.jsxs)(y,{gap:`md`,children:[(0,j.jsx)(a,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,j.jsx)(h,{order:1,fz:28,children:`Chat is not configured`}),(0,j.jsx)(a,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,j.jsx)(b,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let C=t.filter(e=>e.role!==`tool`);return(0,j.jsxs)(S,{className:`chat-pane`,children:[(0,j.jsx)(S,{className:`chat-scroll`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,children:[f&&(0,j.jsx)(o,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,j.jsxs)(c,{justify:`space-between`,children:[(0,j.jsx)(a,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,onClick:x,children:`New chat`})]})}),!f&&!s&&d&&(0,j.jsx)(Gl,{message:d,onRetry:v,onNewThread:x}),!f&&!s&&!d&&(0,j.jsxs)(p,{mih:`40vh`,children:[(0,j.jsx)(n,{size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!f&&s&&(0,j.jsxs)(j.Fragment,{children:[C.length===0&&(0,j.jsx)(ql,{onSelect:g}),(0,j.jsxs)(y,{gap:`lg`,"aria-live":`polite`,children:[C.map(e=>(0,j.jsx)(Jl,{message:e,time:r[e.id],send:g},e.id)),l&&(0,j.jsxs)(c,{gap:`xs`,children:[(0,j.jsx)(n,{type:`dots`,size:`sm`}),(0,j.jsx)(a,{c:`dimmed`,size:`sm`,children:u||`Analyzing your system`})]}),d&&(0,j.jsx)(Gl,{message:d,onRetry:_}),(0,j.jsx)(`div`,{ref:m})]})]})]})}),!f&&(0,j.jsx)(Kl,{})]})}function Gl({message:e,onRetry:t,onNewThread:n}){return(0,j.jsx)(o,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,j.jsxs)(c,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,j.jsx)(a,{size:`sm`,children:e}),(0,j.jsxs)(c,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,j.jsx)(b,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,j.jsx)(b,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function Kl(){let{input:e,setInput:t,inputRef:n,submit:r,send:o,stop:s,ready:l,running:u}=ee();return(0,j.jsx)(S,{className:`chat-composer`,children:(0,j.jsxs)(i,{size:880,px:{base:`md`,sm:`xl`},children:[(0,j.jsx)(w,{component:`form`,onSubmit:r,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,j.jsxs)(c,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,j.jsx)(se,{ref:n,"aria-label":`Message Fanout`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),o(e))},placeholder:u?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!l,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),u?(0,j.jsx)(k,{label:`Stop`,children:(0,j.jsx)(D,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:s,children:(0,j.jsx)(he,{size:16,weight:`fill`})})}):(0,j.jsx)(D,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!l,"aria-label":`Send message`,children:(0,j.jsx)(pe,{size:17,weight:`fill`})})]})}),(0,j.jsx)(a,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function ql({onSelect:e}){return(0,j.jsxs)(y,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,j.jsx)(m,{size:`large`}),(0,j.jsx)(h,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,j.jsx)(c,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:Hl.map(t=>(0,j.jsx)(b,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Jl({message:e,time:t,send:r}){if(e.role===`activity`){let t=e;return t.activityType===`mcp-app`?(0,j.jsx)(w,{withBorder:!0,radius:`lg`,style:{overflow:`hidden`},"aria-label":Ul(t.content.toolName),children:(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(p,{mih:180,children:(0,j.jsx)(n,{size:`sm`})}),children:(0,j.jsx)(Vl,{content:t.content,onMessage:r})})}):null}let i=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!i&&e.role===`assistant`)return null;let o=e.role===`user`,s=t?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(t)):``;return(0,j.jsxs)(S,{className:`chat-message`,"data-role":o?`user`:`assistant`,children:[o?(0,j.jsx)(w,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,j.jsx)(a,{style:{whiteSpace:`pre-wrap`},children:i})}):(0,j.jsx)(le,{className:`chat-markdown`,children:(0,j.jsx)(Ro,{remarkPlugins:[Bl],components:Xl,children:i})}),(0,j.jsxs)(c,{className:`chat-message-meta`,gap:6,justify:o?`flex-end`:`flex-start`,mt:4,children:[s&&(0,j.jsx)(a,{c:`dimmed`,size:`xs`,children:s}),!o&&(0,j.jsx)(Yl,{text:i,label:`Copy message`})]})]})}function Yl({text:e,label:t}){let{state:n,copy:r}=E();return(0,j.jsx)(k,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,j.jsx)(D,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,j.jsx)(u,{size:13,weight:`bold`}):(0,j.jsx)(v,{size:13})})})}var Xl={table:({children:e})=>(0,j.jsx)(S,{className:`chat-table`,children:(0,j.jsx)(T,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,j.jsx)(T.Thead,{children:e}),tbody:({children:e})=>(0,j.jsx)(T.Tbody,{children:e}),tr:({children:e})=>(0,j.jsx)(T.Tr,{children:e}),th:({children:e})=>(0,j.jsx)(T.Th,{children:e}),td:({children:e})=>(0,j.jsx)(T.Td,{children:e}),pre:({children:e})=>(0,j.jsx)(Zl,{children:e}),a:({href:e,children:t})=>(0,j.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Zl({children:e}){let t=Ql(e);return(0,j.jsxs)(S,{className:`chat-code`,pos:`relative`,children:[(0,j.jsx)(S,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,j.jsx)(Yl,{text:t,label:`Copy code`})}),(0,j.jsx)(`pre`,{children:e})]})}function Ql(e){return typeof e==`string`?e:Array.isArray(e)?e.map(Ql).join(``):e&&typeof e==`object`&&`props`in e?Ql(e.props.children):``}export{Wl as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-DSIYq_x1.js b/internal/ui/dist/assets/chat._threadId-DSIYq_x1.js deleted file mode 100644 index 849dadfd0..000000000 --- a/internal/ui/dist/assets/chat._threadId-DSIYq_x1.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-D-J8SUFh.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-u0MOvyAV.js b/internal/ui/dist/assets/chat._threadId-u0MOvyAV.js new file mode 100644 index 000000000..f19511b86 --- /dev/null +++ b/internal/ui/dist/assets/chat._threadId-u0MOvyAV.js @@ -0,0 +1 @@ +import{t as e}from"./chat-XnnwteRX.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-DSIYq_x1.js b/internal/ui/dist/assets/chat.index-DSIYq_x1.js deleted file mode 100644 index 849dadfd0..000000000 --- a/internal/ui/dist/assets/chat.index-DSIYq_x1.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-D-J8SUFh.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-u0MOvyAV.js b/internal/ui/dist/assets/chat.index-u0MOvyAV.js new file mode 100644 index 000000000..f19511b86 --- /dev/null +++ b/internal/ui/dist/assets/chat.index-u0MOvyAV.js @@ -0,0 +1 @@ +import{t as e}from"./chat-XnnwteRX.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/copy-CUb9ms1Q.js b/internal/ui/dist/assets/copy-DGK5qe2D.js similarity index 98% rename from internal/ui/dist/assets/copy-CUb9ms1Q.js rename to internal/ui/dist/assets/copy-DGK5qe2D.js index 3a59c0011..ca71b59f2 100644 --- a/internal/ui/dist/assets/copy-CUb9ms1Q.js +++ b/internal/ui/dist/assets/copy-DGK5qe2D.js @@ -1 +1 @@ -import{C as e,G as t,Y as n,ht as r,j as i,k as a,pt as o,st as s,ut as c,x as l,xt as u}from"./brand-CCB4_HD8.js";import{I as d,U as f}from"./index-BxnvJp0Y.js";var[p,m]=f(`Table component was not found in the tree`),h={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`},g=o();function _(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function v(t,n){let r=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,a=e(e=>{let a=i(r,{},e),{classNames:o,className:s,style:c,styles:u,...d}=a,f=m();return(0,g.jsx)(l,{component:t,..._(f,n),...f.getStyles(t,{className:s,classNames:o,style:c,styles:u,props:a}),...d})});return a.displayName=`@mantine/core/${r}`,a.classes=h,a}var y=v(`th`,{columnBorder:!0}),b=v(`td`,{columnBorder:!0}),x=v(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),S=v(`thead`,{stickyHeader:!0}),C=v(`tbody`),w=v(`tfoot`),T=v(`caption`,{captionSide:!0}),E={type:`scrollarea`},D=n((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":c(t),"--table-max-height":c(n),"--table-overflow":r===`native`?`auto`:void 0}})),O=e(e=>{let t=i(`TableScrollContainer`,E,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,children:f,minWidth:p,maxHeight:m,type:_,scrollAreaProps:v,attributes:y,...b}=t,x=a({name:`TableScrollContainer`,classes:h,props:t,className:r,style:o,classNames:n,styles:s,unstyled:c,attributes:y,vars:u,varsResolver:D,rootSelector:`scrollContainer`});return(0,g.jsx)(l,{component:_===`scrollarea`?d:`div`,..._===`scrollarea`?m?{offsetScrollbars:`xy`,...v}:{offsetScrollbars:`x`,...v}:{},...x(`scrollContainer`),...b,children:(0,g.jsx)(`div`,{...x(`scrollContainerInner`),children:f})})});O.classes=h,O.varsResolver=D,O.displayName=`@mantine/core/TableScrollContainer`;function k({data:e}){return(0,g.jsxs)(g.Fragment,{children:[e.caption&&(0,g.jsx)(T,{children:e.caption}),e.head&&(0,g.jsx)(S,{children:(0,g.jsx)(x,{children:e.head.map((e,t)=>(0,g.jsx)(y,{children:e},t))})}),e.body&&(0,g.jsx)(C,{children:e.body.map((e,t)=>(0,g.jsx)(x,{children:e.map((e,t)=>(0,g.jsx)(b,{children:e},t))},t))}),e.foot&&(0,g.jsx)(w,{children:(0,g.jsx)(x,{children:e.foot.map((e,t)=>(0,g.jsx)(y,{children:e},t))})})]})}k.displayName=`@mantine/core/TableDataRenderer`;var A={withRowBorders:!0,verticalSpacing:7},j=n((e,{layout:n,captionSide:r,horizontalSpacing:i,verticalSpacing:a,borderColor:o,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:f,stickyHeaderOffset:p,stickyHeader:m})=>({table:{"--table-layout":n,"--table-caption-side":r,"--table-horizontal-spacing":s(i),"--table-vertical-spacing":s(a),"--table-border-color":o?t(o,e):void 0,"--table-striped-color":d&&l?t(l,e):void 0,"--table-highlight-on-hover-color":f&&u?t(u,e):void 0,"--table-sticky-header-offset":m?c(p):void 0}})),M=e(e=>{let t=i(`Table`,A,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,horizontalSpacing:d,verticalSpacing:f,captionSide:m,stripedColor:_,highlightOnHoverColor:v,striped:y,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,withTableBorder:C,borderColor:w,layout:T,data:E,children:D,stickyHeader:O,stickyHeaderOffset:M,mod:N,tabularNums:P,attributes:F,...I}=t,L=a({name:`Table`,props:t,className:r,style:o,classes:h,classNames:n,styles:s,unstyled:c,attributes:F,rootSelector:`table`,vars:u,varsResolver:j});return(0,g.jsx)(p,{value:{getStyles:L,stickyHeader:O,striped:y===!0?`odd`:y||void 0,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,captionSide:m||`bottom`},children:(0,g.jsx)(l,{component:`table`,mod:[{"data-with-table-border":C,"data-tabular-nums":P},N],...L(`table`),...I,children:D||!!E&&(0,g.jsx)(k,{data:E})})})});M.classes=h,M.varsResolver=j,M.displayName=`@mantine/core/Table`,M.Td=b,M.Th=y,M.Tr=x,M.Thead=S,M.Tbody=C,M.Tfoot=w,M.Caption=T,M.ScrollContainer=O,M.DataRenderer=k;var N=u(r(),1);function P(e=1500){let[t,n]=(0,N.useState)(`idle`),r=(0,N.useRef)(null);(0,N.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}export{M as n,P as t}; \ No newline at end of file +import{C as e,G as t,Y as n,ht as r,j as i,k as a,pt as o,st as s,ut as c,x as l,xt as u}from"./brand-CCB4_HD8.js";import{I as d,U as f}from"./index-DSdcpqnK.js";var[p,m]=f(`Table component was not found in the tree`),h={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`},g=o();function _(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function v(t,n){let r=`Table${t.charAt(0).toUpperCase()}${t.slice(1)}`,a=e(e=>{let a=i(r,{},e),{classNames:o,className:s,style:c,styles:u,...d}=a,f=m();return(0,g.jsx)(l,{component:t,..._(f,n),...f.getStyles(t,{className:s,classNames:o,style:c,styles:u,props:a}),...d})});return a.displayName=`@mantine/core/${r}`,a.classes=h,a}var y=v(`th`,{columnBorder:!0}),b=v(`td`,{columnBorder:!0}),x=v(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),S=v(`thead`,{stickyHeader:!0}),C=v(`tbody`),w=v(`tfoot`),T=v(`caption`,{captionSide:!0}),E={type:`scrollarea`},D=n((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":c(t),"--table-max-height":c(n),"--table-overflow":r===`native`?`auto`:void 0}})),O=e(e=>{let t=i(`TableScrollContainer`,E,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,children:f,minWidth:p,maxHeight:m,type:_,scrollAreaProps:v,attributes:y,...b}=t,x=a({name:`TableScrollContainer`,classes:h,props:t,className:r,style:o,classNames:n,styles:s,unstyled:c,attributes:y,vars:u,varsResolver:D,rootSelector:`scrollContainer`});return(0,g.jsx)(l,{component:_===`scrollarea`?d:`div`,..._===`scrollarea`?m?{offsetScrollbars:`xy`,...v}:{offsetScrollbars:`x`,...v}:{},...x(`scrollContainer`),...b,children:(0,g.jsx)(`div`,{...x(`scrollContainerInner`),children:f})})});O.classes=h,O.varsResolver=D,O.displayName=`@mantine/core/TableScrollContainer`;function k({data:e}){return(0,g.jsxs)(g.Fragment,{children:[e.caption&&(0,g.jsx)(T,{children:e.caption}),e.head&&(0,g.jsx)(S,{children:(0,g.jsx)(x,{children:e.head.map((e,t)=>(0,g.jsx)(y,{children:e},t))})}),e.body&&(0,g.jsx)(C,{children:e.body.map((e,t)=>(0,g.jsx)(x,{children:e.map((e,t)=>(0,g.jsx)(b,{children:e},t))},t))}),e.foot&&(0,g.jsx)(w,{children:(0,g.jsx)(x,{children:e.foot.map((e,t)=>(0,g.jsx)(y,{children:e},t))})})]})}k.displayName=`@mantine/core/TableDataRenderer`;var A={withRowBorders:!0,verticalSpacing:7},j=n((e,{layout:n,captionSide:r,horizontalSpacing:i,verticalSpacing:a,borderColor:o,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:f,stickyHeaderOffset:p,stickyHeader:m})=>({table:{"--table-layout":n,"--table-caption-side":r,"--table-horizontal-spacing":s(i),"--table-vertical-spacing":s(a),"--table-border-color":o?t(o,e):void 0,"--table-striped-color":d&&l?t(l,e):void 0,"--table-highlight-on-hover-color":f&&u?t(u,e):void 0,"--table-sticky-header-offset":m?c(p):void 0}})),M=e(e=>{let t=i(`Table`,A,e),{classNames:n,className:r,style:o,styles:s,unstyled:c,vars:u,horizontalSpacing:d,verticalSpacing:f,captionSide:m,stripedColor:_,highlightOnHoverColor:v,striped:y,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,withTableBorder:C,borderColor:w,layout:T,data:E,children:D,stickyHeader:O,stickyHeaderOffset:M,mod:N,tabularNums:P,attributes:F,...I}=t,L=a({name:`Table`,props:t,className:r,style:o,classes:h,classNames:n,styles:s,unstyled:c,attributes:F,rootSelector:`table`,vars:u,varsResolver:j});return(0,g.jsx)(p,{value:{getStyles:L,stickyHeader:O,striped:y===!0?`odd`:y||void 0,highlightOnHover:b,withColumnBorders:x,withRowBorders:S,captionSide:m||`bottom`},children:(0,g.jsx)(l,{component:`table`,mod:[{"data-with-table-border":C,"data-tabular-nums":P},N],...L(`table`),...I,children:D||!!E&&(0,g.jsx)(k,{data:E})})})});M.classes=h,M.varsResolver=j,M.displayName=`@mantine/core/Table`,M.Td=b,M.Th=y,M.Tr=x,M.Thead=S,M.Tbody=C,M.Tfoot=w,M.Caption=T,M.ScrollContainer=O,M.DataRenderer=k;var N=u(r(),1);function P(e=1500){let[t,n]=(0,N.useState)(`idle`),r=(0,N.useRef)(null);(0,N.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}export{M as n,P as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboard-Dl2pFM2h.js b/internal/ui/dist/assets/dashboard-qOWEIeHc.js similarity index 97% rename from internal/ui/dist/assets/dashboard-Dl2pFM2h.js rename to internal/ui/dist/assets/dashboard-qOWEIeHc.js index 5c0453273..97c1072c1 100644 --- a/internal/ui/dist/assets/dashboard-Dl2pFM2h.js +++ b/internal/ui/dist/assets/dashboard-qOWEIeHc.js @@ -1,4 +1,4 @@ -import{$ as e,A as t,C as n,D as r,E as i,G as a,J as o,N as s,O as c,Q as l,R as u,S as d,T as f,Y as p,_ as m,a as h,ct as g,d as _,f as v,ft as y,gt as b,h as x,ht as S,i as C,it as w,j as T,k as E,l as D,m as O,mt as k,o as A,ot as j,p as ee,pt as M,r as te,rt as ne,s as N,st as P,u as re,ut as ie,vt as ae,w as oe,x as se,xt as ce,y as le}from"./brand-CCB4_HD8.js";import{n as F,t as I}from"./copy-CUb9ms1Q.js";import{A as L,B as ue,C as de,D as fe,E as pe,F as me,G as he,H as ge,I as _e,L as ve,M as ye,N as be,O as xe,P as Se,R as Ce,S as we,T as Te,U as Ee,V as De,W as Oe,_ as ke,a as Ae,b as je,d as Me,f as Ne,g as Pe,h as Fe,i as Ie,j as Le,k as Re,l as ze,m as Be,n as Ve,o as He,r as Ue,t as We,v as Ge,w as Ke,x as qe,y as Je,z as Ye}from"./index-BxnvJp0Y.js";var R=ce(S(),1),z=M();function Xe(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Ze(e){let t=(0,R.useRef)(void 0);return(0,R.useEffect)(()=>{t.current=e},[e]),t.current}function Qe(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{let t=T(`Flex`,null,e),{classNames:n,className:a,style:o,styles:l,unstyled:d,vars:p,gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x,attributes:S,...C}=t,w=E({name:`Flex`,classes:rt,props:t,className:a,style:o,classNames:n,styles:l,unstyled:d,attributes:S,vars:p}),D=s(),O=f(),k=i({styleProps:{gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x},theme:D,data:nt}),A=u(),j=A&&k.hasResponsiveStyles?r(k.styles,k.media):O;return(0,z.jsxs)(z.Fragment,{children:[k.hasResponsiveStyles&&(0,z.jsx)(c,{selector:`.${j}`,styles:k.styles,media:k.media,deduplicate:A}),(0,z.jsx)(se,{...w(`root`,{className:j,style:g(k.inlineStyles)}),...C})]})});it.classes=rt,it.displayName=`@mantine/core/Flex`;function at(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>at(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function ot(e){return e?e.map(e=>at(e)):[]}function st(e){return e.reduce((e,t)=>`group`in t?{...e,...st(t.items)}:(e[`${t.value}`]=t,e),{})}var ct={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},lt={error:null},ut=p((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":j(t,`combobox-chevron-size`),"--combobox-chevron-color":n?a(n,e):void 0}})),dt=n(e=>{let t=T(`ComboboxChevron`,lt,e),{size:n,error:r,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,attributes:u,mod:d,...f}=t,p=E({name:`ComboboxChevron`,classes:ct,props:t,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,varsResolver:ut,attributes:u,rootSelector:`chevron`});return(0,z.jsx)(se,{component:`svg`,...f,...p(`chevron`),size:n,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:r},d],children:(0,z.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});dt.classes=ct,dt.varsResolver=ut,dt.displayName=`@mantine/core/ComboboxChevron`;var[ft,pt]=Ee(`Combobox component was not found in tree`);function mt({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,z.jsx)(O.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}mt.displayName=`@mantine/core/ComboboxClearButton`;var ht=n(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=T(`ComboboxDropdown`,null,e),s=pt();return(0,z.jsx)(me.Dropdown,{...o,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":s.floatingHeight||void 0,...s.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});ht.classes=ct,ht.displayName=`@mantine/core/ComboboxDropdown`;var gt={refProp:`ref`},_t=n(e=>{let{children:t,refProp:n,ref:r}=T(`ComboboxDropdownTarget`,gt,e);if(pt(),!Oe(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,z.jsx)(me.Target,{ref:r,refProp:n,children:t})});_t.displayName=`@mantine/core/ComboboxDropdownTarget`;var vt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxEmpty`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...o})});vt.classes=ct,vt.displayName=`@mantine/core/ComboboxEmpty`;function yt({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=pt(),[c,l]=(0,R.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var bt={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},xt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxEventsTarget`,bt,e),d=Ye(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=pt();return(0,R.cloneElement)(d,{...yt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u,[n]:l(c,f.store.targetRef,ue(d))})});xt.displayName=`@mantine/core/ComboboxEventsTarget`;var St=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxFooter`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});St.classes=ct,St.displayName=`@mantine/core/ComboboxFooter`;var Ct=n(t=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,label:c,id:l,...u}=T(`ComboboxGroup`,null,t),d=pt(),f=e(l),p=c!=null&&c!==!1&&c!==``;return(0,z.jsxs)(se,{role:`group`,"aria-labelledby":p?f:void 0,...d.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...u,children:[p&&(0,z.jsx)(`div`,{id:f,...d.getStyles(`groupLabel`,{classNames:n,styles:a}),children:c}),s]})});Ct.classes=ct,Ct.displayName=`@mantine/core/ComboboxGroup`;var wt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxHeader`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});wt.classes=ct,wt.displayName=`@mantine/core/ComboboxHeader`;function Tt({value:e,valuesDivider:t=`,`,...n}){return(0,z.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Tt.displayName=`@mantine/core/ComboboxHiddenInput`;var Et=n(e=>{let t=T(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:o,onClick:s,id:c,active:l,onMouseDown:u,onMouseOver:d,disabled:f,selected:p,mod:m,...h}=t,g=pt(),_=(0,R.useId)(),v=c||_;return(0,z.jsx)(se,{...g.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),...h,id:v,mod:[`combobox-option`,{"combobox-active":l,"combobox-disabled":f,"combobox-selected":p},m],role:`option`,onClick:e=>{f?e.preventDefault():(g.onOptionSubmit?.(t.value,t),s?.(e))},onMouseDown:e=>{e.preventDefault(),u?.(e)},onMouseOver:e=>{g.resetSelectionOnOptionHover&&g.store.resetSelectedOption(),d?.(e)}})});Et.classes=ct,Et.displayName=`@mantine/core/ComboboxOption`;var Dt=n(t=>{let{classNames:n,className:r,style:i,styles:a,id:o,onMouseDown:s,labelledBy:c,...l}=T(`ComboboxOptions`,null,t),u=pt(),d=e(o);return(0,R.useEffect)(()=>{u.store.setListId(d)},[d]),(0,z.jsx)(se,{...u.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...l,id:d,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});Dt.classes=ct,Dt.displayName=`@mantine/core/ComboboxOptions`;var Ot={withAriaAttributes:!0,withKeyboardNavigation:!0},kt=n(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:o,onClick:s,withKeyboardNavigation:c,size:u,ref:d,...f}=T(`ComboboxSearch`,Ot,e),p=pt(),m=p.getStyles(`search`),h=yt({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:s,autoComplete:`off`});return(0,z.jsx)(O,{ref:l(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});kt.classes=ct,kt.displayName=`@mantine/core/ComboboxSearch`;var At={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},jt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxTarget`,At,e),d=Ye(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=pt(),p=(0,R.cloneElement)(d,{...yt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u});return(0,z.jsx)(me.Target,{refProp:n,ref:l(c,f.store.targetRef),children:p})});jt.displayName=`@mantine/core/ComboboxTarget`;function Mt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Nt(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,R.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,R.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,R.useCallback)(()=>{let e=et(f.current),t=Qe(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,R.useCallback)(e=>{let t=et(f.current),n=Qe(`#${l.current}`,t),r=n?$e(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,R.useCallback)(()=>{let e=et(f.current),t=Qe(`#${l.current} [data-combobox-active]`,e);if(t){let n=$e(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Nt(u.current,t,a))},[b,a]),C=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Mt(u.current,t,a))},[b,a]),w=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Pt(t))},[b]),T=(0,R.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=et(f.current),r=$e(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=et(f.current),r=$e(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,R.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,R.useCallback)(()=>{let e=et(f.current);($e(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,R.useCallback)(e=>{l.current=e},[]),k=(0,R.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,R.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,R.useCallback)(()=>u.current,[]);return(0,R.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var It={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Lt=p((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":ne(t),"--combobox-option-padding":j(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:ie(n),"--combobox-option-fz":ne(t),"--combobox-option-padding":j(t,`combobox-option-padding`)}})),Rt=e=>{let t=T(`Combobox`,It,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:l,size:u,dropdownPadding:d,resetSelectionOnOptionHover:f,__staticSelector:p,readOnly:m,attributes:h,floatingHeight:g,middlewares:_,...v}=t,y=g===`viewport`?{..._,flip:!1,size:{...typeof _?.size==`object`?_.size:{},padding:typeof _?.size==`object`&&_.size.padding!==void 0?_.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=_?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:_,b=Ft(),x=o||b,S=E({name:p||`Combobox`,classes:ct,props:t,classNames:n,styles:r,unstyled:i,attributes:h,vars:s,varsResolver:Lt}),C=()=>{l?.(),x.closeDropdown()};return(0,z.jsx)(ft,{value:{getStyles:S,store:x,onOptionSubmit:c,size:u,resetSelectionOnOptionHover:f,readOnly:m,floatingHeight:g},children:(0,z.jsx)(me,{opened:x.dropdownOpened,...v,middlewares:y,onChange:e=>!e&&C(),withRoles:!1,unstyled:i,children:a})})};Rt.extend=e=>e,Rt.classes=ct,Rt.varsResolver=Lt,Rt.displayName=`@mantine/core/Combobox`,Rt.Target=jt,Rt.Dropdown=ht,Rt.Options=Dt,Rt.Option=Et,Rt.Search=kt,Rt.Empty=vt,Rt.Chevron=dt,Rt.Footer=St,Rt.Header=wt,Rt.EventsTarget=xt,Rt.DropdownTarget=_t,Rt.Group=Ct,Rt.ClearButton=mt,Rt.HiddenInput=Tt;function zt(e){return`group`in e}function Bt({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function Ht(e,t=new Set){if(Array.isArray(e))for(let n of e)if(zt(n))Ht(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function Ut(e,t){return Array.isArray(e)?e.includes(t):e===t}function Wt({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:s}){if(!zt(e)){let c=Ut(r,e.value),l=t&&(c?(0,z.jsx)(be,{className:ct.optionsDropdownCheckIcon}):n?(0,z.jsx)(`div`,{className:ct.optionsDropdownCheckPlaceholder}):null),u=(0,z.jsxs)(z.Fragment,{children:[i===`left`&&l,(0,z.jsx)(`span`,{children:e.label}),i===`right`&&l]});return(0,z.jsx)(Rt.Option,{value:e.value,disabled:e.disabled,className:o({[ct.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof s==`function`?s({option:e,checked:c}):u})}let c=e.items.map(e=>(0,z.jsx)(Wt,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:s},`${e.value}`));return(0,z.jsx)(Rt.Group,{label:e.group,children:c})}function Gt({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=pt();Ht(e);let x=typeof i==`string`?(r||Bt)({options:e,search:l?i:``,limit:a??1/0}):e,S=Vt(x),C=x.map((e,t)=>(0,z.jsx)(Wt,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},zt(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,z.jsx)(Rt.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,z.jsxs)(Rt.Options,{labelledBy:g,"aria-label":y,children:[c?(0,z.jsx)(_e.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,z.jsx)(Rt.Empty,{children:m})]})})}function Kt(e){let t=e.currentTarget;return et(t).activeElement!==t}function qt(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}var[Jt,Yt]=Ee(`Progress.Root component was not found in tree`),Xt={root:`m_db6d6462`,section:`m_2242eb65`,"stripes-animation":`m_81a374bd`,"stripes-animation-vertical":`m_e0fb7a86`,label:`m_91e40b74`},Zt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ProgressLabel`,null,e);return(0,z.jsx)(se,{...Yt().getStyles(`label`,{className:n,style:r,classNames:t,styles:i}),...o})});Zt.classes=Xt,Zt.displayName=`@mantine/core/ProgressLabel`;var Qt=p((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":j(t,`progress-size`),"--progress-radius":n===void 0?void 0:w(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),$t=n(e=>{let t=T(`ProgressRoot`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,autoContrast:c,transitionDuration:l,orientation:u,attributes:d,mod:f,...p}=t,m=E({name:`Progress`,classes:Xt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s,varsResolver:Qt});return(0,z.jsx)(Jt,{value:{getStyles:m,autoContrast:c},children:(0,z.jsx)(se,{mod:[{orientation:u},f],...m(`root`),...p})})});$t.classes=Xt,$t.varsResolver=Qt,$t.displayName=`@mantine/core/ProgressRoot`;var en={withAria:!0},tn=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,value:c,withAria:l,color:u,striped:d,animated:f,mod:p,...m}=T(`ProgressSection`,en,e),h=Yt(),g=s(),_=l?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":c,"aria-valuetext":`${c}%`}:{};return(0,z.jsx)(se,{...h.getStyles(`section`,{className:n,classNames:t,styles:i,style:r}),...m,..._,mod:[{striped:d||f,animated:f},p],__vars:{"--progress-section-size":`${c}%`,"--progress-section-color":a(u,g),"--progress-label-color":tt(h.autoContrast,g)?Ce({color:u,theme:g,autoContrast:h.autoContrast}):void 0}})});tn.classes=Xt,tn.displayName=`@mantine/core/ProgressSection`;var nn=n(e=>{let n=T(`Progress`,null,e),{value:r,classNames:i,styles:a,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=n,{resolvedClassNames:f,resolvedStyles:p}=t({classNames:i,styles:a,props:n});return(0,z.jsx)($t,{classNames:f,styles:p,vars:o,...d,children:(0,z.jsx)(tn,{value:r,color:s,striped:c,animated:l,"aria-label":u})})});nn.classes=Xt,nn.displayName=`@mantine/core/Progress`,nn.Section=tn,nn.Root=$t,nn.Label=Zt;var rn={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},an=oe(n=>{let r=T([`Input`,`InputWrapper`,`Select`],rn,n),{classNames:i,styles:a,unstyled:o,vars:s,dropdownOpened:c,defaultDropdownOpened:l,onDropdownClose:u,onDropdownOpen:d,onFocus:f,onBlur:p,onClick:m,onChange:h,data:g,value:_,defaultValue:v,selectFirstOptionOnChange:y,selectFirstOptionOnDropdownOpen:b,onOptionSubmit:x,comboboxProps:S,readOnly:C,disabled:w,filter:E,limit:D,withScrollArea:O,maxDropdownHeight:k,floatingHeight:A,size:j,searchable:M,rightSection:te,checkIconPosition:ne,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:re,name:ie,form:ae,searchValue:oe,defaultSearchValue:se,onSearchChange:ce,allowDeselect:le,error:F,rightSectionPointerEvents:I,id:L,clearable:ue,clearSectionMode:de,clearButtonProps:fe,hiddenInputProps:pe,renderOption:me,onClear:he,autoComplete:ge,scrollAreaProps:_e,__defaultRightSection:ve,__clearSection:ye,__clearable:be,chevronColor:xe,autoSelectOnBlur:Se,openOnFocus:Ce,attributes:we,...Te}=r,Ee=(0,R.useMemo)(()=>ot(g),[g]),Oe=(0,R.useRef)({}),ke=(0,R.useMemo)(()=>st(Ee),[Ee]),Ae=e(L),[je,Me,Ne]=De({value:_,defaultValue:v,finalValue:null,onChange:h}),Pe=je==null?void 0:`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`],Fe=Ze(Pe),[Ie,Le,Re]=De({value:oe,defaultValue:se,finalValue:Pe?Pe.label:``,onChange:ce}),ze=Ft({opened:c,defaultOpened:l,onDropdownOpen:()=>{d?.(),b?ze.selectFirstOption():ze.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{u?.(),setTimeout(ze.resetSelectedOption,0)}}),Be=e=>{Le(e),ze.resetSelectedOption()},{resolvedClassNames:Ve,resolvedStyles:He}=t({props:r,styles:a,classNames:i});(0,R.useEffect)(()=>{y&&ze.selectFirstOption()},[y,Ie]),(0,R.useEffect)(()=>{_===null&&Be(``),_!=null&&Pe&&(Fe?.value!==Pe.value||Fe?.label!==Pe.label)&&Be(Pe.label)},[_,Pe]),(0,R.useEffect)(()=>{!Ne&&!Re&&Be(je==null?``:`${je}`in ke?ke[`${je}`]?.label:Oe.current[`${je}`]?.label||``)},[ke,je]),(0,R.useEffect)(()=>{je&&`${je}`in ke&&(Oe.current[`${je}`]=ke[`${je}`])},[ke,je]);let Ue=(0,z.jsx)(Rt.ClearButton,{...fe,onClear:()=>{Me(null,null),Be(``),he?.()}}),We=ue&&je!=null&&!w&&!C;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Rt,{store:ze,__staticSelector:`Select`,classNames:Ve,styles:He,unstyled:o,readOnly:C,size:j,attributes:we,floatingHeight:A,keepMounted:Se,onOptionSubmit:e=>{x?.(e);let t=le&&`${ke[e].value}`==`${je}`?null:ke[e],n=t?t.value:null;n!==je&&Me(n,t),!Ne&&Be(n==null?``:t?.label||``),ze.closeDropdown()},...S,children:[(0,z.jsx)(Rt.Target,{targetType:M?`input`:`button`,autoComplete:ge,withExpandedAttribute:!0,children:(0,z.jsx)(ee,{id:Ae,__defaultRightSection:(0,z.jsx)(Rt.Chevron,{size:j,error:F,unstyled:o,color:xe}),__clearSection:Ue,__clearable:We,__clearSectionMode:de,rightSection:te,rightSectionPointerEvents:I||`none`,...Te,size:j,__staticSelector:`Select`,disabled:w,readOnly:C||!M,value:Ie,onChange:e=>{if(Kt(e)){if(!C){let t=qt(ke,e.currentTarget.value);t&&`${t.value}`!=`${je}`&&(Me(t.value,t),!Ne&&Be(t.label))}return}Be(e.currentTarget.value),ze.openDropdown(),y&&ze.selectFirstOption()},onFocus:e=>{Ce&&M&&ze.openDropdown(),f?.(e)},onBlur:e=>{Se&&ze.clickSelectedOption(),M&&ze.closeDropdown();let t=je!=null&&(`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`]);Be(t&&t.label||``),p?.(e)},onClick:e=>{M?ze.openDropdown():ze.toggleDropdown(),m?.(e)},classNames:Ve,styles:He,unstyled:o,pointer:!M,error:F,attributes:we})}),(0,z.jsx)(Gt,{data:Ee,hidden:C||w,filter:E,search:Ie,limit:D,hiddenWhenEmpty:!re,withScrollArea:O,maxDropdownHeight:k,filterOptions:!!M&&Pe?.label!==Ie,value:je,checkIconPosition:ne,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:re,unstyled:o,labelId:Te.label?`${Ae}-label`:void 0,"aria-label":Te.label?void 0:Te[`aria-label`],renderOption:me,scrollAreaProps:_e})]}),(0,z.jsx)(Rt.HiddenInput,{value:je,name:ie,form:ae,disabled:w,...pe})]})});an.classes={...ee.classes,...Rt.classes},an.displayName=`@mantine/core/Select`;function on(e){if(e!==void 0)return typeof e==`number`?ie(e):e}function sn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=s(),l=t===void 0?e:t,u=r!==void 0,d=g({"--sg-spacing-x":P(Xe(e)),"--sg-spacing-y":P(Xe(l)),"--sg-auto-rows":i,...u?{"--sg-min-col-width":on(r)}:{"--sg-cols":Xe(n)?.toString()}}),f=y(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=P(e[r])),typeof l==`object`&&l[r]!==void 0&&(t[r][`--sg-spacing-y`]=P(l[r])),!u&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:d,media:ge(y(f),o.breakpoints).filter(e=>y(f[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:f[e.value]})),selector:a})}function cn(e){return typeof e==`object`&&e?y(e):[]}function ln(e){return e.sort((e,t)=>he(e)-he(t))}function un({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return ln(Array.from(new Set([...cn(e),...cn(t),...r===void 0?cn(n):[]])))}function dn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,l=g({"--sg-spacing-x":P(Xe(e)),"--sg-spacing-y":P(Xe(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":on(r)}:{"--sg-cols":Xe(n)?.toString()}}),u=un({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),d=u.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=P(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=P(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:l,container:u.map(e=>({query:`simple-grid (min-width: ${e})`,styles:d[e]})),selector:a})}var fn={container:`m_925c2d2c`,root:`m_2415a157`},pn={cols:1,spacing:`md`,type:`media`},mn=n(e=>{let t=T(`SimpleGrid`,pn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,cols:c,verticalSpacing:l,spacing:u,type:d,minColWidth:p,autoFlow:m,autoRows:h,attributes:g,..._}=t,v=E({name:`SimpleGrid`,classes:fn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:g,vars:s}),y=f(),b=p===void 0?void 0:m||`auto-fill`;return d===`container`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(dn,{...t,selector:`.${y}`}),(0,z.jsx)(`div`,{...v(`container`),children:(0,z.jsx)(se,{...v(`root`,{className:y}),..._,"data-auto-cols":b})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(sn,{...t,selector:`.${y}`}),(0,z.jsx)(se,{...v(`root`,{className:y}),..._,"data-auto-cols":b})]})});mn.classes=fn,mn.displayName=`@mantine/core/SimpleGrid`;var hn=class extends we{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Te(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&de(t.mutationKey)!==de(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??je();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){qe.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function gn(e,t){let n=fe(t),[r]=R.useState(()=>new hn(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);let i=R.useSyncExternalStore(R.useCallback(e=>r.subscribe(qe.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=R.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Ke)},[r]);if(i.error&&pe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var _n=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),vn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),yn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),bn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z`}))]]),xn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),Sn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:_n}));Sn.displayName=`ArrowUpRightIcon`;var Cn=Sn,wn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:vn}));wn.displayName=`CaretDownIcon`;var Tn=wn,En=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:yn}));En.displayName=`ListMagnifyingGlassIcon`;var Dn=En,On=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:bn}));On.displayName=`SlidersHorizontalIcon`;var kn=On,An=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:xn}));An.displayName=`WarningCircleIcon`;var jn=An;function Mn(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Nn(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Pn(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=Mn(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Nn(r,u,s[0]),f=Nn(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Fn(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=Mn(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=Rn(d,0,s-r),f=Rn(f,0,l-i),{x:d,y:f}}function In(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=Mn(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Ln(e,t,n){let{margin:r,rowHeight:i}=e,a=Mn(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function Rn(e,t,n){return Math.max(Math.min(e,n),t)}function zn(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Bn(e,t){for(let n=0;nzn(e,t))}function Hn(e,t){return t===`horizontal`?Wn(e):t===`vertical`||t===`wrap`?Un(e):[...e]}function Un(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function Wn(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function Gn(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function Kn(e,t){for(let n=0;ne.static===!0)}function Jn(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function Yn(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Bn(n,i);)i.y++}}return e}function $n(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=Hn(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=Vn(d,t),p=f.length>0;if(p&&c)return Yn(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return $n(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return $n(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return $n(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:$n(e,n,l,u,r,c,i)}function tr(e,t,n){return Math.max(t,Math.min(n,e))}var nr=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:tr(t,0,Math.max(0,r-e.w)),y:tr(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:tr(t,1,Math.max(1,o)),h:tr(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:tr(t,e.minW??1,e.maxW??1/0),h:tr(n,e.minH??1,e.maxH??1/0)}}}];function rr(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ir(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ar({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function or({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function sr(e){return e*100+`%`}function cr(e,t,n,r){return e+n>r?t:n}function lr(e,t,n){return e<0?t:n}function ur(e){return Math.max(0,e)}function dr(e){return Math.max(0,e)}var fr=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:lr(o,e.height,i),top:dr(o)}},pr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:cr(e.left,e.width,o,n),left:ur(i)}},mr=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:dr(r),left:0}:{height:i,width:a,top:dr(r),left:o}},hr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:lr(r,e.height,a),top:dr(r)}},gr={n:fr,ne:(e,t,n)=>fr(e,pr(e,t,n)),e:pr,se:(e,t,n)=>hr(e,pr(e,t,n)),s:hr,sw:(e,t,n)=>hr(e,mr(e,t)),w:mr,nw:(e,t,n)=>fr(e,mr(e,t))};function _r(e,t,n,r){let i=gr[e];return i?i(t,{...t,...n},r):n}var vr={type:`transform`,scale:1,calcStyle(e){return ar(e)}},yr={type:`absolute`,scale:1,calcStyle(e){return or(e)}};function br(e){return{type:`transform`,scale:e,calcStyle(e){return ar(e)},calcDragPosition(t,n,r,i){return{left:(t-r)/e,top:(n-i)/e}}}}var xr=vr,Sr={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Cr={enabled:!0,bounded:!1,threshold:3},wr={enabled:!0,handles:[`se`]},Tr={enabled:!1,defaultItem:{w:1,h:1}};function Er(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??qn(e).length>0;for(let i=o+1;it.y+t.h)break;zn(t,o)&&Er(e,o,n+t[a],r,s)}}t[r]=n}function Dr(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Bn(e,t);)t.y--;let i;for(;(i=Bn(e,t))!==void 0;)Er(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Or(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Bn(e,t);)t.x--;let i;for(;(i=Bn(e,t))!==void 0;)if(Er(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Bn(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var kr={type:`vertical`,allowOverlap:!1,compact(e,t){let n=qn(e),r=Gn(n),i=Un(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Lr(e,t){let n=Ir(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Rr(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function zr(e,t,n,r,i,a){let o=e[n];if(o)return Yn(o);let s=e[r],c=Ir(t),l=c.slice(c.indexOf(n));for(let t=0;t{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Hr=b(((e,t)=>{var n=Vr();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Ur=b(((e,t)=>{t.exports=Hr()()})),Wr=ce(Ur(),1),Gr=ce(k(),1);function Kr(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&Kr(e.changedTouches,e=>t===e.identifier)}function gi(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function _i(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function vi(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??_i();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +import{$ as e,A as t,C as n,D as r,E as i,G as a,J as o,N as s,O as c,Q as l,R as u,S as d,T as f,Y as p,_ as m,a as h,ct as g,d as _,f as v,ft as y,gt as b,h as x,ht as S,i as C,it as w,j as T,k as E,l as D,m as O,mt as k,o as A,ot as j,p as ee,pt as M,r as te,rt as ne,s as N,st as P,u as re,ut as ie,vt as ae,w as oe,x as se,xt as ce,y as le}from"./brand-CCB4_HD8.js";import{n as F,t as I}from"./copy-DGK5qe2D.js";import{A as L,B as ue,C as de,D as fe,E as pe,F as me,G as he,H as ge,I as _e,L as ve,M as ye,N as be,O as xe,P as Se,R as Ce,S as we,T as Te,U as Ee,V as De,W as Oe,_ as ke,a as Ae,b as je,d as Me,f as Ne,g as Pe,h as Fe,i as Ie,j as Le,k as Re,l as ze,m as Be,n as Ve,o as He,r as Ue,t as We,v as Ge,w as Ke,x as qe,y as Je,z as Ye}from"./index-DSdcpqnK.js";var R=ce(S(),1),z=M();function Xe(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Ze(e){let t=(0,R.useRef)(void 0);return(0,R.useEffect)(()=>{t.current=e},[e]),t.current}function Qe(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{let t=T(`Flex`,null,e),{classNames:n,className:a,style:o,styles:l,unstyled:d,vars:p,gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x,attributes:S,...C}=t,w=E({name:`Flex`,classes:rt,props:t,className:a,style:o,classNames:n,styles:l,unstyled:d,attributes:S,vars:p}),D=s(),O=f(),k=i({styleProps:{gap:m,rowGap:h,columnGap:_,align:v,justify:y,wrap:b,direction:x},theme:D,data:nt}),A=u(),j=A&&k.hasResponsiveStyles?r(k.styles,k.media):O;return(0,z.jsxs)(z.Fragment,{children:[k.hasResponsiveStyles&&(0,z.jsx)(c,{selector:`.${j}`,styles:k.styles,media:k.media,deduplicate:A}),(0,z.jsx)(se,{...w(`root`,{className:j,style:g(k.inlineStyles)}),...C})]})});it.classes=rt,it.displayName=`@mantine/core/Flex`;function at(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>at(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function ot(e){return e?e.map(e=>at(e)):[]}function st(e){return e.reduce((e,t)=>`group`in t?{...e,...st(t.items)}:(e[`${t.value}`]=t,e),{})}var ct={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},lt={error:null},ut=p((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":j(t,`combobox-chevron-size`),"--combobox-chevron-color":n?a(n,e):void 0}})),dt=n(e=>{let t=T(`ComboboxChevron`,lt,e),{size:n,error:r,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,attributes:u,mod:d,...f}=t,p=E({name:`ComboboxChevron`,classes:ct,props:t,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:l,varsResolver:ut,attributes:u,rootSelector:`chevron`});return(0,z.jsx)(se,{component:`svg`,...f,...p(`chevron`),size:n,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:r},d],children:(0,z.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});dt.classes=ct,dt.varsResolver=ut,dt.displayName=`@mantine/core/ComboboxChevron`;var[ft,pt]=Ee(`Combobox component was not found in tree`);function mt({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,z.jsx)(O.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}mt.displayName=`@mantine/core/ComboboxClearButton`;var ht=n(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=T(`ComboboxDropdown`,null,e),s=pt();return(0,z.jsx)(me.Dropdown,{...o,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":s.floatingHeight||void 0,...s.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});ht.classes=ct,ht.displayName=`@mantine/core/ComboboxDropdown`;var gt={refProp:`ref`},_t=n(e=>{let{children:t,refProp:n,ref:r}=T(`ComboboxDropdownTarget`,gt,e);if(pt(),!Oe(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,z.jsx)(me.Target,{ref:r,refProp:n,children:t})});_t.displayName=`@mantine/core/ComboboxDropdownTarget`;var vt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxEmpty`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...o})});vt.classes=ct,vt.displayName=`@mantine/core/ComboboxEmpty`;function yt({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=pt(),[c,l]=(0,R.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var bt={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},xt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxEventsTarget`,bt,e),d=Ye(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=pt();return(0,R.cloneElement)(d,{...yt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u,[n]:l(c,f.store.targetRef,ue(d))})});xt.displayName=`@mantine/core/ComboboxEventsTarget`;var St=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxFooter`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});St.classes=ct,St.displayName=`@mantine/core/ComboboxFooter`;var Ct=n(t=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,label:c,id:l,...u}=T(`ComboboxGroup`,null,t),d=pt(),f=e(l),p=c!=null&&c!==!1&&c!==``;return(0,z.jsxs)(se,{role:`group`,"aria-labelledby":p?f:void 0,...d.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...u,children:[p&&(0,z.jsx)(`div`,{id:f,...d.getStyles(`groupLabel`,{classNames:n,styles:a}),children:c}),s]})});Ct.classes=ct,Ct.displayName=`@mantine/core/ComboboxGroup`;var wt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ComboboxHeader`,null,e);return(0,z.jsx)(se,{...pt().getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});wt.classes=ct,wt.displayName=`@mantine/core/ComboboxHeader`;function Tt({value:e,valuesDivider:t=`,`,...n}){return(0,z.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Tt.displayName=`@mantine/core/ComboboxHiddenInput`;var Et=n(e=>{let t=T(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:o,onClick:s,id:c,active:l,onMouseDown:u,onMouseOver:d,disabled:f,selected:p,mod:m,...h}=t,g=pt(),_=(0,R.useId)(),v=c||_;return(0,z.jsx)(se,{...g.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),...h,id:v,mod:[`combobox-option`,{"combobox-active":l,"combobox-disabled":f,"combobox-selected":p},m],role:`option`,onClick:e=>{f?e.preventDefault():(g.onOptionSubmit?.(t.value,t),s?.(e))},onMouseDown:e=>{e.preventDefault(),u?.(e)},onMouseOver:e=>{g.resetSelectionOnOptionHover&&g.store.resetSelectedOption(),d?.(e)}})});Et.classes=ct,Et.displayName=`@mantine/core/ComboboxOption`;var Dt=n(t=>{let{classNames:n,className:r,style:i,styles:a,id:o,onMouseDown:s,labelledBy:c,...l}=T(`ComboboxOptions`,null,t),u=pt(),d=e(o);return(0,R.useEffect)(()=>{u.store.setListId(d)},[d]),(0,z.jsx)(se,{...u.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...l,id:d,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});Dt.classes=ct,Dt.displayName=`@mantine/core/ComboboxOptions`;var Ot={withAriaAttributes:!0,withKeyboardNavigation:!0},kt=n(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:o,onClick:s,withKeyboardNavigation:c,size:u,ref:d,...f}=T(`ComboboxSearch`,Ot,e),p=pt(),m=p.getStyles(`search`),h=yt({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:s,autoComplete:`off`});return(0,z.jsx)(O,{ref:l(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:u||p.size,...h,...f,__staticSelector:`Combobox`})});kt.classes=ct,kt.displayName=`@mantine/core/ComboboxSearch`;var At={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},jt=n(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...u}=T(`ComboboxTarget`,At,e),d=Ye(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=pt(),p=(0,R.cloneElement)(d,{...yt({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),...u});return(0,z.jsx)(me.Target,{refProp:n,ref:l(c,f.store.targetRef),children:p})});jt.displayName=`@mantine/core/ComboboxTarget`;function Mt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Nt(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,R.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,R.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,R.useCallback)(()=>{let e=et(f.current),t=Qe(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,R.useCallback)(e=>{let t=et(f.current),n=Qe(`#${l.current}`,t),r=n?$e(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,R.useCallback)(()=>{let e=et(f.current),t=Qe(`#${l.current} [data-combobox-active]`,e);if(t){let n=$e(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Nt(u.current,t,a))},[b,a]),C=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Mt(u.current,t,a))},[b,a]),w=(0,R.useCallback)(()=>{let e=et(f.current),t=$e(`#${l.current} [data-combobox-option]`,e);return b(Pt(t))},[b]),T=(0,R.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=et(f.current),r=$e(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=et(f.current),r=$e(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,R.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,R.useCallback)(()=>{let e=et(f.current);($e(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,R.useCallback)(e=>{l.current=e},[]),k=(0,R.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,R.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,R.useCallback)(()=>u.current,[]);return(0,R.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var It={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Lt=p((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":ne(t),"--combobox-option-padding":j(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:ie(n),"--combobox-option-fz":ne(t),"--combobox-option-padding":j(t,`combobox-option-padding`)}})),Rt=e=>{let t=T(`Combobox`,It,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:l,size:u,dropdownPadding:d,resetSelectionOnOptionHover:f,__staticSelector:p,readOnly:m,attributes:h,floatingHeight:g,middlewares:_,...v}=t,y=g===`viewport`?{..._,flip:!1,size:{...typeof _?.size==`object`?_.size:{},padding:typeof _?.size==`object`&&_.size.padding!==void 0?_.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=_?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:_,b=Ft(),x=o||b,S=E({name:p||`Combobox`,classes:ct,props:t,classNames:n,styles:r,unstyled:i,attributes:h,vars:s,varsResolver:Lt}),C=()=>{l?.(),x.closeDropdown()};return(0,z.jsx)(ft,{value:{getStyles:S,store:x,onOptionSubmit:c,size:u,resetSelectionOnOptionHover:f,readOnly:m,floatingHeight:g},children:(0,z.jsx)(me,{opened:x.dropdownOpened,...v,middlewares:y,onChange:e=>!e&&C(),withRoles:!1,unstyled:i,children:a})})};Rt.extend=e=>e,Rt.classes=ct,Rt.varsResolver=Lt,Rt.displayName=`@mantine/core/Combobox`,Rt.Target=jt,Rt.Dropdown=ht,Rt.Options=Dt,Rt.Option=Et,Rt.Search=kt,Rt.Empty=vt,Rt.Chevron=dt,Rt.Footer=St,Rt.Header=wt,Rt.EventsTarget=xt,Rt.DropdownTarget=_t,Rt.Group=Ct,Rt.ClearButton=mt,Rt.HiddenInput=Tt;function zt(e){return`group`in e}function Bt({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function Ht(e,t=new Set){if(Array.isArray(e))for(let n of e)if(zt(n))Ht(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function Ut(e,t){return Array.isArray(e)?e.includes(t):e===t}function Wt({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:s}){if(!zt(e)){let c=Ut(r,e.value),l=t&&(c?(0,z.jsx)(be,{className:ct.optionsDropdownCheckIcon}):n?(0,z.jsx)(`div`,{className:ct.optionsDropdownCheckPlaceholder}):null),u=(0,z.jsxs)(z.Fragment,{children:[i===`left`&&l,(0,z.jsx)(`span`,{children:e.label}),i===`right`&&l]});return(0,z.jsx)(Rt.Option,{value:e.value,disabled:e.disabled,className:o({[ct.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof s==`function`?s({option:e,checked:c}):u})}let c=e.items.map(e=>(0,z.jsx)(Wt,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:s},`${e.value}`));return(0,z.jsx)(Rt.Group,{label:e.group,children:c})}function Gt({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=pt();Ht(e);let x=typeof i==`string`?(r||Bt)({options:e,search:l?i:``,limit:a??1/0}):e,S=Vt(x),C=x.map((e,t)=>(0,z.jsx)(Wt,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},zt(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,z.jsx)(Rt.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,z.jsxs)(Rt.Options,{labelledBy:g,"aria-label":y,children:[c?(0,z.jsx)(_e.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,z.jsx)(Rt.Empty,{children:m})]})})}function Kt(e){let t=e.currentTarget;return et(t).activeElement!==t}function qt(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}var[Jt,Yt]=Ee(`Progress.Root component was not found in tree`),Xt={root:`m_db6d6462`,section:`m_2242eb65`,"stripes-animation":`m_81a374bd`,"stripes-animation-vertical":`m_e0fb7a86`,label:`m_91e40b74`},Zt=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=T(`ProgressLabel`,null,e);return(0,z.jsx)(se,{...Yt().getStyles(`label`,{className:n,style:r,classNames:t,styles:i}),...o})});Zt.classes=Xt,Zt.displayName=`@mantine/core/ProgressLabel`;var Qt=p((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":j(t,`progress-size`),"--progress-radius":n===void 0?void 0:w(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),$t=n(e=>{let t=T(`ProgressRoot`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,autoContrast:c,transitionDuration:l,orientation:u,attributes:d,mod:f,...p}=t,m=E({name:`Progress`,classes:Xt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s,varsResolver:Qt});return(0,z.jsx)(Jt,{value:{getStyles:m,autoContrast:c},children:(0,z.jsx)(se,{mod:[{orientation:u},f],...m(`root`),...p})})});$t.classes=Xt,$t.varsResolver=Qt,$t.displayName=`@mantine/core/ProgressRoot`;var en={withAria:!0},tn=n(e=>{let{classNames:t,className:n,style:r,styles:i,vars:o,value:c,withAria:l,color:u,striped:d,animated:f,mod:p,...m}=T(`ProgressSection`,en,e),h=Yt(),g=s(),_=l?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":c,"aria-valuetext":`${c}%`}:{};return(0,z.jsx)(se,{...h.getStyles(`section`,{className:n,classNames:t,styles:i,style:r}),...m,..._,mod:[{striped:d||f,animated:f},p],__vars:{"--progress-section-size":`${c}%`,"--progress-section-color":a(u,g),"--progress-label-color":tt(h.autoContrast,g)?Ce({color:u,theme:g,autoContrast:h.autoContrast}):void 0}})});tn.classes=Xt,tn.displayName=`@mantine/core/ProgressSection`;var nn=n(e=>{let n=T(`Progress`,null,e),{value:r,classNames:i,styles:a,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=n,{resolvedClassNames:f,resolvedStyles:p}=t({classNames:i,styles:a,props:n});return(0,z.jsx)($t,{classNames:f,styles:p,vars:o,...d,children:(0,z.jsx)(tn,{value:r,color:s,striped:c,animated:l,"aria-label":u})})});nn.classes=Xt,nn.displayName=`@mantine/core/Progress`,nn.Section=tn,nn.Root=$t,nn.Label=Zt;var rn={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},an=oe(n=>{let r=T([`Input`,`InputWrapper`,`Select`],rn,n),{classNames:i,styles:a,unstyled:o,vars:s,dropdownOpened:c,defaultDropdownOpened:l,onDropdownClose:u,onDropdownOpen:d,onFocus:f,onBlur:p,onClick:m,onChange:h,data:g,value:_,defaultValue:v,selectFirstOptionOnChange:y,selectFirstOptionOnDropdownOpen:b,onOptionSubmit:x,comboboxProps:S,readOnly:C,disabled:w,filter:E,limit:D,withScrollArea:O,maxDropdownHeight:k,floatingHeight:A,size:j,searchable:M,rightSection:te,checkIconPosition:ne,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:re,name:ie,form:ae,searchValue:oe,defaultSearchValue:se,onSearchChange:ce,allowDeselect:le,error:F,rightSectionPointerEvents:I,id:L,clearable:ue,clearSectionMode:de,clearButtonProps:fe,hiddenInputProps:pe,renderOption:me,onClear:he,autoComplete:ge,scrollAreaProps:_e,__defaultRightSection:ve,__clearSection:ye,__clearable:be,chevronColor:xe,autoSelectOnBlur:Se,openOnFocus:Ce,attributes:we,...Te}=r,Ee=(0,R.useMemo)(()=>ot(g),[g]),Oe=(0,R.useRef)({}),ke=(0,R.useMemo)(()=>st(Ee),[Ee]),Ae=e(L),[je,Me,Ne]=De({value:_,defaultValue:v,finalValue:null,onChange:h}),Pe=je==null?void 0:`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`],Fe=Ze(Pe),[Ie,Le,Re]=De({value:oe,defaultValue:se,finalValue:Pe?Pe.label:``,onChange:ce}),ze=Ft({opened:c,defaultOpened:l,onDropdownOpen:()=>{d?.(),b?ze.selectFirstOption():ze.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{u?.(),setTimeout(ze.resetSelectedOption,0)}}),Be=e=>{Le(e),ze.resetSelectedOption()},{resolvedClassNames:Ve,resolvedStyles:He}=t({props:r,styles:a,classNames:i});(0,R.useEffect)(()=>{y&&ze.selectFirstOption()},[y,Ie]),(0,R.useEffect)(()=>{_===null&&Be(``),_!=null&&Pe&&(Fe?.value!==Pe.value||Fe?.label!==Pe.label)&&Be(Pe.label)},[_,Pe]),(0,R.useEffect)(()=>{!Ne&&!Re&&Be(je==null?``:`${je}`in ke?ke[`${je}`]?.label:Oe.current[`${je}`]?.label||``)},[ke,je]),(0,R.useEffect)(()=>{je&&`${je}`in ke&&(Oe.current[`${je}`]=ke[`${je}`])},[ke,je]);let Ue=(0,z.jsx)(Rt.ClearButton,{...fe,onClear:()=>{Me(null,null),Be(``),he?.()}}),We=ue&&je!=null&&!w&&!C;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(Rt,{store:ze,__staticSelector:`Select`,classNames:Ve,styles:He,unstyled:o,readOnly:C,size:j,attributes:we,floatingHeight:A,keepMounted:Se,onOptionSubmit:e=>{x?.(e);let t=le&&`${ke[e].value}`==`${je}`?null:ke[e],n=t?t.value:null;n!==je&&Me(n,t),!Ne&&Be(n==null?``:t?.label||``),ze.closeDropdown()},...S,children:[(0,z.jsx)(Rt.Target,{targetType:M?`input`:`button`,autoComplete:ge,withExpandedAttribute:!0,children:(0,z.jsx)(ee,{id:Ae,__defaultRightSection:(0,z.jsx)(Rt.Chevron,{size:j,error:F,unstyled:o,color:xe}),__clearSection:Ue,__clearable:We,__clearSectionMode:de,rightSection:te,rightSectionPointerEvents:I||`none`,...Te,size:j,__staticSelector:`Select`,disabled:w,readOnly:C||!M,value:Ie,onChange:e=>{if(Kt(e)){if(!C){let t=qt(ke,e.currentTarget.value);t&&`${t.value}`!=`${je}`&&(Me(t.value,t),!Ne&&Be(t.label))}return}Be(e.currentTarget.value),ze.openDropdown(),y&&ze.selectFirstOption()},onFocus:e=>{Ce&&M&&ze.openDropdown(),f?.(e)},onBlur:e=>{Se&&ze.clickSelectedOption(),M&&ze.closeDropdown();let t=je!=null&&(`${je}`in ke?ke[`${je}`]:Oe.current[`${je}`]);Be(t&&t.label||``),p?.(e)},onClick:e=>{M?ze.openDropdown():ze.toggleDropdown(),m?.(e)},classNames:Ve,styles:He,unstyled:o,pointer:!M,error:F,attributes:we})}),(0,z.jsx)(Gt,{data:Ee,hidden:C||w,filter:E,search:Ie,limit:D,hiddenWhenEmpty:!re,withScrollArea:O,maxDropdownHeight:k,filterOptions:!!M&&Pe?.label!==Ie,value:je,checkIconPosition:ne,withCheckIcon:N,withAlignedLabels:P,nothingFoundMessage:re,unstyled:o,labelId:Te.label?`${Ae}-label`:void 0,"aria-label":Te.label?void 0:Te[`aria-label`],renderOption:me,scrollAreaProps:_e})]}),(0,z.jsx)(Rt.HiddenInput,{value:je,name:ie,form:ae,disabled:w,...pe})]})});an.classes={...ee.classes,...Rt.classes},an.displayName=`@mantine/core/Select`;function on(e){if(e!==void 0)return typeof e==`number`?ie(e):e}function sn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=s(),l=t===void 0?e:t,u=r!==void 0,d=g({"--sg-spacing-x":P(Xe(e)),"--sg-spacing-y":P(Xe(l)),"--sg-auto-rows":i,...u?{"--sg-min-col-width":on(r)}:{"--sg-cols":Xe(n)?.toString()}}),f=y(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=P(e[r])),typeof l==`object`&&l[r]!==void 0&&(t[r][`--sg-spacing-y`]=P(l[r])),!u&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:d,media:ge(y(f),o.breakpoints).filter(e=>y(f[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:f[e.value]})),selector:a})}function cn(e){return typeof e==`object`&&e?y(e):[]}function ln(e){return e.sort((e,t)=>he(e)-he(t))}function un({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return ln(Array.from(new Set([...cn(e),...cn(t),...r===void 0?cn(n):[]])))}function dn({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,l=g({"--sg-spacing-x":P(Xe(e)),"--sg-spacing-y":P(Xe(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":on(r)}:{"--sg-cols":Xe(n)?.toString()}}),u=un({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),d=u.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=P(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=P(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,z.jsx)(c,{styles:l,container:u.map(e=>({query:`simple-grid (min-width: ${e})`,styles:d[e]})),selector:a})}var fn={container:`m_925c2d2c`,root:`m_2415a157`},pn={cols:1,spacing:`md`,type:`media`},mn=n(e=>{let t=T(`SimpleGrid`,pn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,cols:c,verticalSpacing:l,spacing:u,type:d,minColWidth:p,autoFlow:m,autoRows:h,attributes:g,..._}=t,v=E({name:`SimpleGrid`,classes:fn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:g,vars:s}),y=f(),b=p===void 0?void 0:m||`auto-fill`;return d===`container`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(dn,{...t,selector:`.${y}`}),(0,z.jsx)(`div`,{...v(`container`),children:(0,z.jsx)(se,{...v(`root`,{className:y}),..._,"data-auto-cols":b})})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(sn,{...t,selector:`.${y}`}),(0,z.jsx)(se,{...v(`root`,{className:y}),..._,"data-auto-cols":b})]})});mn.classes=fn,mn.displayName=`@mantine/core/SimpleGrid`;var hn=class extends we{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Te(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&de(t.mutationKey)!==de(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??je();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){qe.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function gn(e,t){let n=fe(t),[r]=R.useState(()=>new hn(n,e));R.useEffect(()=>{r.setOptions(e)},[r,e]);let i=R.useSyncExternalStore(R.useCallback(e=>r.subscribe(qe.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=R.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Ke)},[r]);if(i.error&&pe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var _n=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),vn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),yn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),bn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z`}))]]),xn=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),Sn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:_n}));Sn.displayName=`ArrowUpRightIcon`;var Cn=Sn,wn=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:vn}));wn.displayName=`CaretDownIcon`;var Tn=wn,En=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:yn}));En.displayName=`ListMagnifyingGlassIcon`;var Dn=En,On=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:bn}));On.displayName=`SlidersHorizontalIcon`;var kn=On,An=R.forwardRef((e,t)=>R.createElement(h,{ref:t,...e,weights:xn}));An.displayName=`WarningCircleIcon`;var jn=An;function Mn(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Nn(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Pn(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=Mn(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Nn(r,u,s[0]),f=Nn(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Fn(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=Mn(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=Rn(d,0,s-r),f=Rn(f,0,l-i),{x:d,y:f}}function In(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=Mn(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Ln(e,t,n){let{margin:r,rowHeight:i}=e,a=Mn(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function Rn(e,t,n){return Math.max(Math.min(e,n),t)}function zn(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Bn(e,t){for(let n=0;nzn(e,t))}function Hn(e,t){return t===`horizontal`?Wn(e):t===`vertical`||t===`wrap`?Un(e):[...e]}function Un(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function Wn(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function Gn(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function Kn(e,t){for(let n=0;ne.static===!0)}function Jn(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function Yn(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Bn(n,i);)i.y++}}return e}function $n(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=Hn(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=Vn(d,t),p=f.length>0;if(p&&c)return Yn(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return $n(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return $n(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return $n(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:$n(e,n,l,u,r,c,i)}function tr(e,t,n){return Math.max(t,Math.min(n,e))}var nr=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:tr(t,0,Math.max(0,r-e.w)),y:tr(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:tr(t,1,Math.max(1,o)),h:tr(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:tr(t,e.minW??1,e.maxW??1/0),h:tr(n,e.minH??1,e.maxH??1/0)}}}];function rr(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ir(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ar({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function or({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function sr(e){return e*100+`%`}function cr(e,t,n,r){return e+n>r?t:n}function lr(e,t,n){return e<0?t:n}function ur(e){return Math.max(0,e)}function dr(e){return Math.max(0,e)}var fr=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:lr(o,e.height,i),top:dr(o)}},pr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:cr(e.left,e.width,o,n),left:ur(i)}},mr=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:dr(r),left:0}:{height:i,width:a,top:dr(r),left:o}},hr=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:lr(r,e.height,a),top:dr(r)}},gr={n:fr,ne:(e,t,n)=>fr(e,pr(e,t,n)),e:pr,se:(e,t,n)=>hr(e,pr(e,t,n)),s:hr,sw:(e,t,n)=>hr(e,mr(e,t)),w:mr,nw:(e,t,n)=>fr(e,mr(e,t))};function _r(e,t,n,r){let i=gr[e];return i?i(t,{...t,...n},r):n}var vr={type:`transform`,scale:1,calcStyle(e){return ar(e)}},yr={type:`absolute`,scale:1,calcStyle(e){return or(e)}};function br(e){return{type:`transform`,scale:e,calcStyle(e){return ar(e)},calcDragPosition(t,n,r,i){return{left:(t-r)/e,top:(n-i)/e}}}}var xr=vr,Sr={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Cr={enabled:!0,bounded:!1,threshold:3},wr={enabled:!0,handles:[`se`]},Tr={enabled:!1,defaultItem:{w:1,h:1}};function Er(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??qn(e).length>0;for(let i=o+1;it.y+t.h)break;zn(t,o)&&Er(e,o,n+t[a],r,s)}}t[r]=n}function Dr(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Bn(e,t);)t.y--;let i;for(;(i=Bn(e,t))!==void 0;)Er(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Or(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Bn(e,t);)t.x--;let i;for(;(i=Bn(e,t))!==void 0;)if(Er(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Bn(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var kr={type:`vertical`,allowOverlap:!1,compact(e,t){let n=qn(e),r=Gn(n),i=Un(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Lr(e,t){let n=Ir(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Rr(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function zr(e,t,n,r,i,a){let o=e[n];if(o)return Yn(o);let s=e[r],c=Ir(t),l=c.slice(c.indexOf(n));for(let t=0;t{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Hr=b(((e,t)=>{var n=Vr();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Ur=b(((e,t)=>{t.exports=Hr()()})),Wr=ce(Ur(),1),Gr=ce(k(),1);function Kr(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&Kr(e.changedTouches,e=>t===e.identifier)}function gi(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function _i(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function vi(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??_i();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} `,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&xi(e.body,`react-draggable-transparent-selection`)}function yi(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{bi(e)}):bi(e)}function bi(e){if(e)try{e.body&&Si(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function xi(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Si(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function Ci(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Ai(r);let i=ji(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+Yr(s.paddingLeft)+Yr(o.marginLeft),top:-i.offsetTop+Yr(s.paddingTop)+Yr(o.marginTop),right:ui(a)-ci(i)-i.offsetLeft+Yr(s.paddingRight)-Yr(o.marginRight),bottom:li(a)-si(i)-i.offsetTop+Yr(s.paddingBottom)-Yr(o.marginBottom)}}return Jr(r.right)&&(t=Math.min(t,r.right)),Jr(r.bottom)&&(n=Math.min(n,r.bottom)),Jr(r.left)&&(t=Math.max(t,r.left)),Jr(r.top)&&(n=Math.max(n,r.top)),[t,n]}function wi(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function Ti(e){return e.props.axis===`both`||e.props.axis===`x`}function Ei(e){return e.props.axis===`both`||e.props.axis===`y`}function Di(e,t,n){let r=typeof t==`number`?hi(e,t):null;if(typeof t==`number`&&!r)return null;let i=ji(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return di(r||e,a,n.props.scale)}function Oi(e,t,n){let r=!Jr(e.lastX),i=ji(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function ki(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Ai(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function ji(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var Mi=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Ni={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Pi=Ni.mouse,Fi=class extends R.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!ii(e.target,this.props.handle,t)||this.props.cancel&&ii(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=gi(e);this.touchIdentifier=r;let i=Di(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=Oi(this,a,o);Mi(`DraggableCore: handleDragStart: %j`,s),Mi(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&vi(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,ai(n,Pi.move,this.handleDrag),ai(n,Pi.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Di(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=wi(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=Oi(this,n,r);if(Mi(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=Di(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=wi(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=Oi(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&yi(a.ownerDocument),Mi(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Mi(`DraggableCore: Removing handlers`),oi(a.ownerDocument,Pi.move,this.handleDrag),oi(a.ownerDocument,Pi.stop,this.handleDragStop))},this.onMouseDown=e=>(Pi=Ni.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Pi=Ni.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Pi=Ni.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Pi=Ni.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&ai(e,Ni.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;oi(t,Ni.mouse.move,this.handleDrag),oi(t,Ni.touch.move,this.handleDrag),oi(t,Ni.mouse.stop,this.handleDragStop),oi(t,Ni.touch.stop,this.handleDragStop),oi(e,Ni.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&yi(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gr.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Mi(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return R.cloneElement(R.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Fi.displayName=`DraggableCore`,Fi.propTypes={allowAnyClick:Wr.default.bool,allowMobileScroll:Wr.default.bool,children:Wr.default.node.isRequired,disabled:Wr.default.bool,enableUserSelectHack:Wr.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:Wr.default.arrayOf(Wr.default.number),handle:Wr.default.string,cancel:Wr.default.string,nodeRef:Wr.default.object,nonce:Wr.default.string,onStart:Wr.default.func,onDrag:Wr.default.func,onStop:Wr.default.func,onMouseDown:Wr.default.func,scale:Wr.default.number,className:Xr,style:Xr,transform:Xr},Fi.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Ii=class extends R.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Mi(`Draggable: onDragStart: %j`,t),this.props.onStart(e,ki(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Mi(`Draggable: onDrag: %j`,t);let n=ki(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=Ci(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,ki(this,t))===!1)return!1;Mi(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Mi(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gr.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:s,position:c,positionOffset:l,scale:u,...d}=this.props,f={},p=null,m=!c||this.state.dragging,h=c||r,g={x:Ti(this)&&m?this.state.x:h.x,y:Ei(this)&&m?this.state.y:h.y};this.state.isElementSVG?p=pi(g,l):f=fi(g,l);let _=R.Children.only(n),v=o(_.props.className||``,i,{[a]:this.state.dragging,[s]:this.state.dragged});return R.createElement(Fi,{...d,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},R.cloneElement(_,{className:v,style:{..._.props.style,...f},transform:p}))}};Ii.displayName=`Draggable`,Ii.propTypes={...Fi.propTypes,axis:Wr.default.oneOf([`both`,`x`,`y`,`none`]),bounds:Wr.default.oneOfType([Wr.default.shape({left:Wr.default.number,right:Wr.default.number,top:Wr.default.number,bottom:Wr.default.number}),Wr.default.string,Wr.default.oneOf([!1])]),defaultClassName:Wr.default.string,defaultClassNameDragging:Wr.default.string,defaultClassNameDragged:Wr.default.string,defaultPosition:Wr.default.shape({x:Wr.default.number,y:Wr.default.number}),positionOffset:Wr.default.shape({x:Wr.default.oneOfType([Wr.default.number,Wr.default.string]),y:Wr.default.oneOfType([Wr.default.number,Wr.default.string])}),position:Wr.default.shape({x:Wr.default.number,y:Wr.default.number}),className:Xr,style:Xr,transform:Xr},Ii.defaultProps={...Fi.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var Li=b(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},u=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),d=e=>l(r({},`__esModule`,{value:!0}),e),f={};c(f,{DraggableCore:()=>De,default:()=>Oe}),t.exports=d(f);var p=u(S()),m=u(Ur()),h=u(k()),g=Li();function _(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&_(e.changedTouches,e=>t===e.identifier)}function ce(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function le(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function F(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??le();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} @@ -21,4 +21,4 @@ import{$ as e,A as t,C as n,D as r,E as i,G as a,J as o,N as s,O as c,Q as l,R a `)){var p=new wH;p.newline=!0,s.add(p);return}var m=n.getSeriesByName(f)[0];if(!c.get(f)){if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,SH(OH,f,null,r,d)).on(`mouseover`,SH(kH,m.name,null,r,d)).on(`mouseout`,SH(AH,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=nh(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=Gl(h.fill);_&&_[3]===0&&(_[3]=.2,h=H(H({},h),{fill:$l(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,SH(OH,null,f,r,d)).on(`mouseover`,SH(kH,null,f,r,d)).on(`mouseout`,SH(AH,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=nh(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};nh(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();CH(e,function(e){var r=e.type,i=new Xf({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),$v(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),dg(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=EH(c,r,o,s,d,m,u),y=new wH,b=r.getModel(`textStyle`);if(K(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(DH({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;q(w)&&w?T=w.replace(`{name}`,t??``):K(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new Xf({style:ty(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new Gf({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Fv({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),dg(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();nC(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){nC(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(iN);function EH(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),CH(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:zP(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function DH(e){var t=e.icon||`roundRect`,n=Mw(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=Q.color.neutral00,n.style.lineWidth=2),n}function OH(e,t,n,r){AH(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),kH(e,t,n,r)}function kH(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function AH(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function jH(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),MH(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){U(i,function(t,n){e[t?`select`:`unSelect`](n)}),MH(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function MH(e,t){var n=t||{};return U(e.getData(),function(t){var r=t.get(`name`);if(r!==` `&&r!==``){var i=e.isSelected(r);n[r]=Fo(n,r)?n[r]&&i:i}}),n}function NH(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,fo(jH,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,fo(jH,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,fo(jH,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,fo(jH,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,fo(jH,`unSelect`))}var PH=th(FH);function FH(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;nn[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=Y(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new Gf({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&Y_(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;U([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,q(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=BH[i],o=VH[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(TH);function UH(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function WH(e){TI(IH),e.registerComponentModel(LH),e.registerComponentView(HH),UH(e)}function GH(e){TI(IH),TI(WH)}var KH={get:function(e,t,n){var r=V((qH[e]||{})[t]);return n&&G(r)?r[r.length-1]:r}},qH={color:{active:[`#006edd`,`#e0ffff`],inactive:[Q.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:[`circle`,`roundRect`,`diamond`],inactive:[`none`]},symbolSize:{active:[10,50],inactive:[0,0]}},JH=iz.mapVisual,YH=iz.eachVisual,XH=G,ZH=U,QH=jp,$H=wp,eU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&vH(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=uo(e,this),this.controllerVisuals=_H(this.option.controller,t,e),this.targetVisuals=_H(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this,t=this.option.seriesTargets;if(t){var n=[];return ZH(t,function(t){if(t.seriesIndex!=null)n.push(t.seriesIndex);else if(t.seriesId!=null){var r;e.ecModel.eachSeries(function(e){e.id===t.seriesId&&(r=e)}),r&&n.push(r.componentIndex)}}),n}var r=this.option.seriesId,i=this.option.seriesIndex;i==null&&r==null&&(i=`all`);var a=Mm(this.ecModel,`series`,{index:i,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return W(a,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){U(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],G(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);if(q(o))return o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c);if(K(o))return s?o(e[0],e[1]):o(e);if(s)return e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1];return c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option,t=QH([e.min,e.max]);this._dataExtent=t},t.prototype.getDimension=function(e){var t=this,n=this.option.seriesTargets;if(n){var r=so(n,function(n){return n.seriesIndex!=null&&n.seriesIndex===e||n.seriesId!=null&&n.seriesId===t.ecModel.getSeriesByIndex(e).id});if(r)return r.dimension}return this.option.dimension},t.prototype.getDataDimensionIndex=function(e){var t=e.hostModel.seriesIndex,n=this.getDimension(t);if(n!=null)return e.getDimensionIndex(n);for(var r=e.dimensions,i=r.length-1;i>=0;i--){var a=r[i],o=e.getDimensionInfo(a);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};Qa(r,n),Qa(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){XH(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},ZH(r,function(e,t){if(iz.isValidType(t)){var n=KH.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;ZH(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??(c.symbol=t&&V(t)||(a?i:[i])),c.symbolSize??(c.symbolSize=n&&V(n)||(a?s[0]:[s[0],s[0]])),c.symbol=JH(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;YH(l,function(e){e>u&&(u=e)}),c.symbolSize=JH(l,function(e){return $H(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:Q.color.transparent,borderColor:Q.color.borderTint,contentColor:Q.color.theme[0],inactiveColor:Q.color.disabled,borderWidth:0,padding:Q.size.m,textGap:10,precision:0,textStyle:{color:Q.color.secondary}},t}(mC),tU=[20,140],nU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod=`linear`,e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=tU[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=tU[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):G(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),U(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=jp((this.get(`range`)||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=n[1]||e<=t[1])?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=rU(this,`outOfRange`,this.getExtent()),n=rU(this,`inRange`,this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,c=t.length;oe[1])break;r.push({color:this.getControllerVisual(o,`color`,t),offset:a/n})}return r.push({color:this.getControllerVisual(e[1],`color`,t),offset:1}),r},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get(`inverse`);return new Kg(t===`horizontal`&&!n?{scaleX:e===`bottom`?1:-1,rotation:Math.PI/2}:t===`horizontal`&&n?{scaleX:e===`bottom`?-1:1,rotation:-Math.PI/2}:t===`vertical`&&!n?{scaleX:e===`left`?1:-1,scaleY:-1}:{scaleX:e===`left`?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,a=n.handleLabels,o=r.itemSize,s=r.getExtent(),c=this._applyTransform(`left`,n.mainGroup);lU([0,1],function(l){var u=i[l];u.setStyle(`fill`,t.handlesColor[l]),u.y=e[l];var d=cU(e[l],[0,o[1]],s,!0),f=this.getControllerVisual(d,`symbolSize`);u.scaleX=u.scaleY=f/o[0],u.x=o[0]-f/2;var p=bv(n.handleLabelPoints[l],yv(u,this.group));if(this._orient===`horizontal`){var m=c===`left`||c===`top`?(o[0]-f)/2:(o[0]-f)/-2;p[1]+=m}a[l].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:`middle`,align:this._orient===`vertical`?this._applyTransform(`left`,n.mainGroup):`center`})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,a=i.getExtent(),o=i.itemSize,s=[0,o[1]],c=this._shapes,l=c.indicator;if(l){l.attr(`invisible`,!1);var u=this.getControllerVisual(e,`color`,{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,`symbolSize`),f=cU(e,a,s,!0),p=o[0]-d/2,m={x:l.x,y:l.y};l.y=f,l.x=p;var h=bv(c.indicatorLabelPoint,yv(l,this.group)),g=c.indicatorLabel;g.attr(`invisible`,!1);var _=this._applyTransform(`left`,c.mainGroup),v=this._orient===`horizontal`;g.setStyle({text:(n||``)+i.formatValueText(t),verticalAlign:v?_:`middle`,align:v?`center`:_});var y={x:p,y:f,style:{fill:u}},b={style:{x:h[0],y:h[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var x={duration:100,easing:`cubicInOut`,additive:!0};l.x=m.x,l.y=m.y,l.animateTo(y,x),g.animateTo(b,x)}else l.attr(y),g.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;Ci[1]&&(l[1]=1/0),t&&(l[0]===-1/0?this._showIndicator(c,l[1],`< `,o):l[1]===1/0?this._showIndicator(c,l[0],`> `,o):this._showIndicator(c,c,`≈ `,o));var u=this._hoverLinkDataIndices,d=[];(t||_U(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(l));var f=Tm(u,d);this._dispatchHighDown(`downplay`,sU(f[0],n)),this._dispatchHighDown(`highlight`,sU(f[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(UN(e.target,function(e){var n=nh(e);if(n.dataIndex!=null)return t=n,!0},!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),a=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(a)||this._showIndicator(a,a)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr(`invisible`,!0),e.indicatorLabel&&e.indicatorLabel.attr(`invisible`,!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}];function SU(e,t,n,r){for(var i=t.targetVisuals[r],a=iz.prepareVisualTypes(i),o={color:VN(e.getData(),`color`)},s=0,c=a.length;s0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(yU,bU),U(xU,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(wU))}function OU(e){e.registerComponentModel(nU),e.registerComponentView(mU),DU(e)}var kU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],AU[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=V(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=W(this._pieceList,function(e){return e=V(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=iz.listVisualTypes(),i=this.isCategory();U(t.pieces,function(e){U(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),U(n,function(e,n){var r=!1;U(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&U(this.stateList,function(e){(t[e]||(t[e]={}))[n]=KH.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,U(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;U(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=V(e)},t.prototype.getValueState=function(e){var t=iz.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){iz.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return U(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=kx(eU.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:`auto`,itemWidth:20,itemHeight:14,itemSymbol:`roundRect`,pieces:null,categories:null,splitNumber:5,selectedMode:`multiple`,itemGap:10,hoverLink:!0}),t}(eU),AU={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}};function jU(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}var MU=function(e){B(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=this._getItemAlign(),a=t.itemSize,o=this._getViewData(),s=o.endsText,c=bo(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),U(o.viewPieceList,function(o){var s=o.piece,u=new Kg;u.onclick=uo(this._onItemClick,this,s),this._enableHoverLink(u,o.indexInModelPieceList);var d=t.getRepresentValue(s);if(this._createItemSymbol(u,d,[0,0,a[0],a[1]],l),c){var f=this.visualMapModel.getValueState(d),p=r.get(`align`)||i;u.add(new Xf({style:ty(r,{x:p===`right`?-n:a[0]+n,y:a[1]/2,text:s.text,verticalAlign:r.get(`verticalAlign`)||`middle`,align:p,opacity:Y(r.get(`opacity`),f===`outOfRange`?.5:1)}),silent:l}))}e.add(u)},this),s&&this._renderEndsText(e,s[1],a,c,i),nC(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:sU(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return oU(e,this.api,e.itemSize);var n=t.align;return(!n||n===`auto`)&&(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new Kg,o=this.visualMapModel.textStyleModel;a.add(new Xf({style:ty(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=W(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=Mw(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=V(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,U(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(iU);function NU(e){e.registerComponentModel(kU),e.registerComponentView(MU),DU(e)}function PU(e){TI(OU),TI(NU)}var FU={label:{enabled:!0},decal:{show:!1}},IU=Dm(),LU=Dm(),RU=th(zU);function zU(e,t){var n=e.getModel(`aria`);if(!n.get(`enabled`))return;var r=LU(e).scope||(LU(e).scope={}),i=V(FU);Qa(i.label,e.getLocaleModel().get(`aria`),!1),Qa(n.option,i,!1),a(),o();function a(){if(n.getModel(`decal`).get(`show`)){var t=X();e.eachSeries(function(e){e.isColorBySeries()||(IU(e).scope=t.get(e.type)||t.set(e.type,{}))}),e.eachSeries(function(t){if(K(t.enableAriaDecal)){t.enableAriaDecal();return}var n=t.getData();if(t.isColorBySeries()){var i=yC(t.ecModel,t.name,r,e.getSeriesCount()),a=n.getVisual(`decal`);n.setVisual(`decal`,u(a,i))}else{var o=t.getRawData(),s={},c=IU(t).scope;n.each(function(e){var t=n.getRawIndex(e);s[t]=e});var l=o.count();o.each(function(e){var r=s[e],i=o.getName(e)||e+``,a=yC(t.ecModel,i,c,l),d=n.getItemVisual(r,`decal`);n.setItemVisual(r,`decal`,u(d,a))})}function u(e,t){var n=e?H(H({},t),e):t;return n.dirty=!0,n}})}}function o(){var r=t.getZr().dom;if(r){var i=e.getLocaleModel().get(`aria`),a=n.getModel(`label`);if(a.option=eo(a.option,i),a.get(`enabled`)){if(r.setAttribute(`role`,`img`),a.get(`description`)){r.setAttribute(`aria-label`,a.get(`description`));return}var o=e.getSeriesCount(),u=a.get([`data`,`maxCount`])||10,d=a.get([`series`,`maxCount`])||10,f=Math.min(o,d),p;if(!(o<1)){var m=c();p=m?s(a.get([`general`,`withTitle`]),{title:m}):a.get([`general`,`withoutTitle`]);var h=[],g=o>1?a.get([`series`,`multiple`,`prefix`]):a.get([`series`,`single`,`prefix`]);p+=s(g,{seriesCount:o}),e.eachSeries(function(e,t){if(t1?a.get([`series`,`multiple`,r]):a.get([`series`,`single`,r]),n=s(n,{seriesId:e.seriesIndex,seriesName:e.get(`name`),seriesType:l(e.subType)});var i=e.getData();if(i.count()>u){var c=a.get([`data`,`partialData`]);n+=s(c,{displayCnt:u})}else n+=a.get([`data`,`allData`]);for(var d=a.get([`data`,`separator`,`middle`]),p=a.get([`data`,`separator`,`end`]),m=a.get([`data`,`excludeDimensionId`]),g=[],_=0;_=GU:-c>=GU),f=c>0?c%GU:c%GU+GU,p=!1;p=d?!0:!ou(u)&&f>=WU==!!l;var m=e+n*UU(a),h=t+r*HU(a);this._start&&this._add(`M`,m,h);var g=Math.round(i*KU);if(d){var _=1/this._p,v=(l?1:-1)*(GU-_);this._add(`A`,n,r,g,1,+l,e+n*UU(a+v),t+r*HU(a+v)),_>.01&&this._add(`A`,n,r,g,0,+l,m,h)}else{var y=e+n*UU(o),b=t+r*HU(o);this._add(`A`,n,r,g,+p,+l,y,b)}},e.prototype.rect=function(e,t,n,r){this._add(`M`,e,t),this._add(`l`,n,0),this._add(`l`,0,r),this._add(`l`,-n,0),this._add(`Z`)},e.prototype.closePath=function(){this._d.length>0&&this._add(`Z`)},e.prototype._add=function(e,t,n,r,i,a,o,s,c){for(var l=[],u=this._p,d=1;d`}function lW(e){return``}function uW(e,t){t||={};var n=t.newline?` `:``;function r(e){var t=e.children,i=e.tag,a=e.attrs,o=e.text;return cW(i,a)+(i===`style`?o||``:Ux(o))+(t?``+n+W(t,function(e){return r(e)}).join(n)+n:``)+lW(i)}return r(e)}function dW(e,t,n){n||={};var r=n.newline?` -`:``,i=` {`+r,a=r+`}`,o=W(co(e),function(t){return t+i+W(co(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=W(co(t),function(e){return`@keyframes `+e+i+W(co(t[e]),function(n){return n+i+W(co(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[``].join(r)}function fW(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function pW(e,t,n,r){return sW(`svg`,`root`,{width:e,height:t,xmlns:tW,"xmlns:xlink":nW,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}var mW=0;function hW(){return mW++}var gW={cubicIn:`0.32,0,0.67,0`,cubicOut:`0.33,1,0.68,1`,cubicInOut:`0.65,0,0.35,1`,quadraticIn:`0.11,0,0.5,0`,quadraticOut:`0.5,1,0.89,1`,quadraticInOut:`0.45,0,0.55,1`,quarticIn:`0.5,0,0.75,0`,quarticOut:`0.25,1,0.5,1`,quarticInOut:`0.76,0,0.24,1`,quinticIn:`0.64,0,0.78,0`,quinticOut:`0.22,1,0.36,1`,quinticInOut:`0.83,0,0.17,1`,sinusoidalIn:`0.12,0,0.39,0`,sinusoidalOut:`0.61,1,0.88,1`,sinusoidalInOut:`0.37,0,0.63,1`,exponentialIn:`0.7,0,0.84,0`,exponentialOut:`0.16,1,0.3,1`,exponentialInOut:`0.87,0,0.13,1`,circularIn:`0.55,0,1,0.45`,circularOut:`0,0.55,0.45,1`,circularInOut:`0.85,0,0.15,1`},_W=`transform-origin`;function vW(e,t,n){var r=H({},e.shape);H(r,t),e.buildPath(n,r);var i=new qU;return i.reset(xu(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function yW(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[_W]=n+`px `+r+`px`)}var bW={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`};function xW(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function SW(e,t,n){var r=e.shape.paths,i={},a,o;if(U(r,function(e){var t=fW(n.zrId);t.animation=!0,wW(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=co(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=xW(i,n);return a.replace(o,s)}}function CW(e){return q(e)?gW[e]?`cubic-bezier(`+gW[e]+`)`:Al(e)?e:``:``}function wW(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof j_){var s=SW(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l0}).length)return xW(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+hW();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function TW(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};EW(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=nu(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),EW(r,t,n,!0)}}}function EW(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+hW(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}var DW=Math.round;function OW(e){return e&&q(e.src)}function kW(e){return e&&K(e.toDataURL)}function AW(e,t,n,r){eW(function(i,a){var o=i===`fill`||i===`stroke`;o&&yu(a)?GW(t,e,i,r):o&&gu(a)?KW(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),WW(n,e,r)}function jW(e,t){var n=aM(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[aW+`silent`]=`true`))}function MW(e){return ou(e[0]-1)&&ou(e[1])&&ou(e[2])&&ou(e[3]-1)}function NW(e){return ou(e[4])&&ou(e[5])}function PW(e,t,n){if(t&&!(NW(t)&&MW(t))){var r=n?10:1e4;e.transform=MW(t)?`translate(`+DW(t[4]*r)/r+` `+DW(t[5]*r)/r+`)`:lu(t)}}function FW(e,t,n){for(var r=e.points,i=[],a=0;a`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;wo(f,g),wo(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=ls(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=sW(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=V(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=Su(i);x&&(o.patternTransform=x);var S=sW(`pattern`,``,o,[d]),C=uW(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=sW(`pattern`,T,o,[d])),t[n]=bu(T)}}function qW(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=sW(`clipPath`,a,o,[BW(e,n)])}t[`clip-path`]=bu(a)}function JW(e){return document.createTextNode(e)}function YW(e,t,n){e.insertBefore(t,n)}function XW(e,t){e.removeChild(t)}function ZW(e,t){e.appendChild(t)}function QW(e){return e.parentNode}function $W(e){return e.nextSibling}function eG(e,t){e.textContent=t}var tG=58,nG=120,rG=sW(``,``);function iG(e){return e===void 0}function aG(e){return e!==void 0}function oG(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function sG(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function cG(e){var t,n=e.children,r=e.tag;if(aG(r)){var i=e.elm=oW(r);if(dG(rG,e),G(n))for(t=0;ta?(m=n[c+1]==null?null:n[c+1].elm,lG(e,m,n,i,c)):uG(e,t,r,a))}function pG(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(dG(e,t),iG(t.text)?aG(r)&&aG(i)?r!==i&&fG(n,r,i):aG(i)?(aG(e.text)&&eG(n,``),lG(n,null,i,0,i.length-1)):aG(r)?uG(n,r,0,r.length-1):aG(e.text)&&eG(n,``):e.text!==t.text&&(aG(r)&&uG(n,r,0,r.length-1),eG(n,t.text)))}function mG(e,t){if(sG(e,t))pG(e,t);else{var n=e.elm,r=QW(n);cG(t),r!==null&&(YW(r,t.elm,$W(n)),uG(r,[e],0,0))}return t}var hG=0,gG=function(){function e(e,t,n){if(this.type=`svg`,this.configLayer=_G(`configLayer`),this.storage=t,this._opts=n=H({},n),this.root=e,this._id=`zr`+hG++,this._oldVNode=pW(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=oW(`svg`);dG(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,mG(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return UW(e,fW(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=fW(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=vG(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=sW(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=W(co(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(sW(`defs`,`defs`,{},c)),e.animation){var l=dW(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=sW(`style`,`stl`,{},[],l);a.push(u)}}return pW(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},uW(this.renderToVNode({animation:Y(e.cssAnimation,!0),emphasis:Y(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Y(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g{if(!a.current)return;let e=aI(a.current,void 0,{renderer:`svg`});o.current=e,e.on(`click`,e=>s.current?.(e));let t=new ResizeObserver(()=>e.resize());return t.observe(a.current),()=>{t.disconnect(),e.dispose(),o.current=null}},[]),(0,R.useEffect)(()=>{o.current?.setOption({animationDuration:280,aria:{enabled:!0,decal:{show:!0},description:n},...e},{notMerge:!0})},[n,e]),(0,z.jsx)(`div`,{ref:a,className:i?`echart ${i}`:`echart`,style:{height:t,width:`100%`,minWidth:0},role:`img`,"aria-label":n})}function xG(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:e===`unknown`?`gray`:`bad`}function SG(e){return Ve[e?`dark`:`light`]}function CG(e){let t=e?5:7;return{ok:Ie[t],warn:He[t],bad:We[t],info:Ue[t]}}function wG(e,t){let n=Ae[t?`dark`:`light`],r=0;for(let t of e)r=r*31+t.charCodeAt(0)|0;return n[Math.abs(r)%n.length]}function TG(e){let t=String(e).toUpperCase();return t===`ERROR`||t===`FATAL`?`bad`:t===`WARN`||t===`WARNING`?`warn`:t===`INFO`?`info`:`gray`}function EG(e,t){let n=CG(t),r=String(e).toUpperCase();return r===`ERROR`||r===`FATAL`?n.bad:r===`WARN`||r===`WARNING`?n.warn:r===`INFO`?n.info:SG(t).muted}function DG({label:e,value:t,color:n,hint:r,children:i}){return(0,z.jsxs)(le,{withBorder:!0,radius:`md`,p:`sm`,bg:`var(--mantine-color-default)`,miw:0,h:`100%`,children:[(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e}),(0,z.jsx)(_,{fw:600,fz:`xl`,c:n,mt:2,lh:1.2,truncate:!0,children:t}),r&&(0,z.jsx)(_,{c:`dimmed`,size:`xs`,mt:2,truncate:!0,children:r}),i&&(0,z.jsx)(se,{mt:4,children:i})]})}function OG({health:e,label:t}){return(0,z.jsx)(ye,{color:xG(e),variant:`light`,tt:`none`,style:{minWidth:`max-content`},children:t})}function kG({text:e}){return(0,z.jsxs)(D,{py:`xl`,children:[(0,z.jsx)(Dn,{size:20}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`xs`,children:e})]})}function AG({retry:e}){return(0,z.jsxs)(D,{py:`xl`,style:{flexDirection:`column`,gap:8},children:[(0,z.jsxs)(se,{display:`flex`,style:{alignItems:`center`,gap:8},children:[(0,z.jsx)(jn,{size:20,weight:`fill`,color:`var(--mantine-color-bad-filled)`}),(0,z.jsx)(_,{c:`bad`,fw:500,size:`sm`,children:`Couldn't load this view`})]}),(0,z.jsx)(re,{size:`compact-xs`,variant:`light`,color:`bad`,onClick:e,children:`Retry now`}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:`Retrying automatically`})]})}TI([iD]);function jG({values:e,color:t,label:n}){let r=(0,R.useMemo)(()=>({animation:!1,grid:{left:0,right:0,top:2,bottom:2},xAxis:{type:`category`,show:!1,data:e.map((e,t)=>t)},yAxis:{type:`value`,show:!1,min:0},tooltip:{show:!1},series:[{type:`line`,data:e,showSymbol:!1,smooth:.3,lineStyle:{width:1.5,color:t},areaStyle:{opacity:.12,color:t}}]}),[e,t]);return(0,z.jsx)(bG,{option:r,height:28,label:n})}var MG={unhealthy:0,degraded:1,healthy:2};function NG({widget:e,filters:t}){let n=Sa(`overview`,ya(t,e.config,[`service`]));if(n.isError)return(0,z.jsx)(AG,{retry:()=>void n.refetch()});let r=[...n.data?.data.services??[]].sort((e,t)=>(MG[e.health]??3)-(MG[t.health]??3)||t.error_rate-e.error_rate);return n.data&&r.length===0?(0,z.jsx)(kG,{text:`No recent activity`}):(0,z.jsx)(_e,{type:`auto`,offsetScrollbars:!0,h:`100%`,children:(0,z.jsxs)(F,{verticalSpacing:`xs`,fz:`sm`,highlightOnHover:!0,children:[(0,z.jsx)(F.Thead,{children:(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Th,{children:`Service`}),(0,z.jsx)(F.Th,{ta:`right`,children:`P95`}),(0,z.jsx)(F.Th,{ta:`right`,children:`Errors`})]})}),(0,z.jsx)(F.Tbody,{children:r.map(e=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Td,{children:(0,z.jsx)(OG,{health:e.health,label:e.service})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:Da(e.p95_ms)})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,c:e.error_rate>=.01?`bad`:`dimmed`,children:Ea(e.error_rate)})})]},e.service))})]})})}function PG({filters:e,agentAvailable:t,onOpenChat:n}){if(!t)return(0,z.jsx)(_,{c:`dimmed`,size:`sm`,children:`Configure an AI provider to enable this view. The rest of this dashboard remains available.`});let r=_a(e.window),i=[`Summarize the last ${r}`,`What changed in the last ${r}?`,`Which service needs attention right now?`];return(0,z.jsx)(N,{gap:`xs`,align:`flex-start`,children:i.map(e=>(0,z.jsx)(re,{variant:`default`,size:`xs`,radius:`xl`,leftSection:(0,z.jsx)(Pe,{size:13,weight:`fill`}),onClick:()=>n(e),children:e},e))})}var FG={overview:[`service`],topology:[`service`],performance:[`service`],logs:[`service`,`severity`,`search`],trace:[`trace_id`]};function IG(e){return Object.hasOwn(FG,e)?FG[e]:void 0}function LG(e){return(IG(e)?.length??0)>0}function RG({opened:e,widget:t,services:n,onClose:r,onSave:i}){let[a,o]=(0,R.useState)({service:``,severity:``,search:``,trace_id:``});(0,R.useEffect)(()=>{e&&o({service:va(t.config,`service`),severity:va(t.config,`severity`),search:va(t.config,`search`),trace_id:va(t.config,`trace_id`)})},[e,t.config]);let s=IG(t.type)??[],c=[...new Set([...n,a.service].filter(Boolean))];function l(){let e={...t.config??{}};for(let t of s){let n=a[t].trim();n?e[t]=n:delete e[t]}i(e),r()}return(0,z.jsx)(L,{opened:e,onClose:r,title:`Configure ${t.title}`,centered:!0,children:(0,z.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),l()},children:(0,z.jsxs)(N,{children:[s.includes(`service`)&&(0,z.jsx)(an,{label:`Service`,placeholder:`All services`,data:c,value:a.service||null,onChange:e=>o({...a,service:e??``}),clearable:!0,searchable:!0,"aria-label":`Service`}),s.includes(`severity`)&&(0,z.jsx)(an,{label:`Severity`,placeholder:`All severities`,data:[`ERROR`,`WARN`,`INFO`,`DEBUG`],value:a.severity||null,onChange:e=>o({...a,severity:e??``}),clearable:!0,"aria-label":`Severity`}),s.includes(`search`)&&(0,z.jsx)(xe,{label:`Search`,placeholder:`Text the log body must contain`,value:a.search,onChange:e=>o({...a,search:e.currentTarget.value}),"aria-label":`Search`}),s.includes(`trace_id`)&&(0,z.jsx)(xe,{label:`Trace id`,placeholder:`Leave empty for the most relevant recent trace`,value:a.trace_id,onChange:e=>o({...a,trace_id:e.currentTarget.value}),ff:`monospace`,"aria-label":`Trace id`}),(0,z.jsxs)(x,{justify:`flex-end`,children:[(0,z.jsx)(re,{variant:`default`,onClick:r,children:`Cancel`}),(0,z.jsx)(re,{type:`submit`,children:`Save`})]})]})})})}TI([IA]);function zG({widget:e,filters:t,dark:n}){let r=Sa(`logs`,ya(t,e.config,[`service`,`severity`,`search`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.buckets.length===0)return null;let e=SG(n),t=i.provenance.window,r=[...new Set(i.data.buckets.map(e=>e.time))],a=[...new Set(i.data.buckets.map(e=>e.severity))],o=new Map(i.data.buckets.map(e=>[`${e.time} ${e.severity}`,e.count]));return{color:a.map(e=>EG(e,n)),grid:{left:28,right:8,top:8,bottom:20},tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:r.map(e=>Oa(e,t)),axisLabel:{color:e.muted,fontSize:8,hideOverlap:!0},axisLine:{lineStyle:{color:e.border}}},yAxis:{type:`value`,minInterval:1,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:8}},series:a.map(e=>({name:e,type:`bar`,stack:`logs`,barMaxWidth:14,data:r.map(t=>o.get(`${t} ${e}`)??0),itemStyle:{borderRadius:[2,2,0,0]}}))}},[n,i]);if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});let o=(i?.data.entries??[]).slice(0,5);return i&&o.length===0?(0,z.jsx)(kG,{text:`No matching logs in this window`}):(0,z.jsxs)(N,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(se,{h:72,children:(0,z.jsx)(bG,{option:a,height:72,label:`Log volume by severity`})}),(0,z.jsx)(_e,{type:`auto`,offsetScrollbars:!0,style:{flex:1},children:(0,z.jsx)(F,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(F.Tbody,{children:o.map((e,t)=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`xs`,ff:`monospace`,c:`dimmed`,children:i?Oa(e.time,i.provenance.window,!0):e.time})}),(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(ye,{size:`xs`,color:TG(e.severity),variant:`light`,style:{minWidth:`max-content`},children:e.severity||`LOG`})}),(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`sm`,fw:600,children:e.service})}),(0,z.jsx)(F.Td,{style:{width:`100%`},children:(0,z.jsx)(_,{size:`sm`,lineClamp:1,title:e.body,children:e.body})})]},`${e.time}-${t}`))})})})]})}function BG({widget:e,filters:t,dark:n}){let r=ya(t,e.config,[`service`]),i=Sa(`overview`,r),a=Sa(`performance`,r);if(i.isError)return(0,z.jsx)(AG,{retry:()=>void i.refetch()});let o=i.data?.data,s=(a.data?.data.points??[]).map(e=>e.error_rate*100),c=Math.max(o?.service_count??0,1),l=CG(n),u=o?.health===`unknown`,d=o?u?`No data`:o.health.charAt(0).toUpperCase()+o.health.slice(1):`—`;return(0,z.jsxs)(N,{gap:`sm`,children:[(0,z.jsxs)(mn,{cols:2,spacing:`sm`,children:[(0,z.jsx)(DG,{label:`Health`,value:d,color:o?xG(o.health):void 0,hint:o?u?`Nothing reported in this window`:`${Ta.format(o.service_count)} services`:void 0}),(0,z.jsx)(DG,{label:`Error rate`,value:o&&!u?Ea(o.error_rate):`—`,color:o&&o.error_rate>=.01?`bad`:void 0,hint:o&&!u?`${Ta.format(o.total_spans)} operations`:void 0,children:s.length>1&&(0,z.jsx)(jG,{values:s,color:l.bad,label:`Error rate trend`})})]}),o&&!u&&(0,z.jsxs)(se,{children:[(0,z.jsxs)(nn.Root,{size:`md`,"aria-label":`Service health distribution`,children:[(0,z.jsx)(nn.Section,{value:o.counts.healthy/c*100,color:`ok`}),(0,z.jsx)(nn.Section,{value:o.counts.degraded/c*100,color:`warn`}),(0,z.jsx)(nn.Section,{value:o.counts.unhealthy/c*100,color:`bad`})]}),(0,z.jsxs)(x,{mt:6,gap:`md`,children:[(0,z.jsx)(VG,{color:`ok`,text:`${o.counts.healthy} healthy`}),(0,z.jsx)(VG,{color:`warn`,text:`${o.counts.degraded} degraded`}),(0,z.jsx)(VG,{color:`bad`,text:`${o.counts.unhealthy} unhealthy`})]})]})]})}function VG({color:e,text:t}){return(0,z.jsxs)(x,{gap:6,children:[(0,z.jsx)(se,{w:8,h:8,bg:e,style:{borderRadius:`50%`}}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:t})]})}TI([iD]);function HG({widget:e,filters:t,dark:n}){let r=Sa(`performance`,ya(t,e.config,[`service`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.points.length===0)return null;let e=SG(n),t=i.provenance.window;return{color:[wG(`operations`,n),CG(n).warn],grid:{left:36,right:40,top:24,bottom:22},legend:{top:0,left:0,textStyle:{color:e.muted,fontSize:10},icon:`circle`,itemWidth:7,itemHeight:7},tooltip:{trigger:`axis`,backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:i.data.points.map(e=>Oa(e.time,t)),boundaryGap:!1,axisLine:{lineStyle:{color:e.border}},axisTick:{show:!1},axisLabel:{color:e.muted,fontSize:9,hideOverlap:!0}},yAxis:[{type:`value`,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:9}},{type:`value`,splitLine:{show:!1},axisLabel:{color:e.muted,fontSize:9,formatter:e=>Da(e)}}],series:[{name:`Operations`,type:`line`,data:i.data.points.map(e=>e.spans),smooth:.22,showSymbol:!1,lineStyle:{width:2},areaStyle:{opacity:.05}},{name:`P95`,type:`line`,yAxisIndex:1,data:i.data.points.map(e=>e.p95_ms),smooth:.22,showSymbol:!1,lineStyle:{width:2}}]}},[n,i]);if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});if(i&&i.data.points.length===0)return(0,z.jsx)(kG,{text:`No endpoint activity in this window`});let o=(i?.data.endpoints??[]).slice(0,3);return(0,z.jsxs)(N,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(se,{style:{flex:1,minHeight:120},children:(0,z.jsx)(bG,{option:a,height:`100%`,label:`Operations and P95 latency`})}),o.length>0&&(0,z.jsx)(F,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(F.Tbody,{children:o.map(e=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsxs)(F.Td,{children:[(0,z.jsx)(ye,{variant:`light`,size:`xs`,mr:6,style:{minWidth:`max-content`},children:e.method}),(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:e.path})]}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsxs)(_,{component:`span`,size:`sm`,c:`dimmed`,children:[Ta.format(e.calls),` calls`]})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:Da(e.p95_ms)})})]},`${e.method}-${e.path}`))})})]})}TI([LB]);function UG({widget:e,filters:t,dark:n,onOpenChat:r}){let i=Sa(`topology`,ya(t,e.config,[`service`])),a=i.data?.data,o=(0,R.useMemo)(()=>{if(!a)return null;let e=SG(n),t=CG(n),r=e=>e===`unhealthy`?t.bad:e===`degraded`?t.warn:t.ok,i=[...a.nodes].sort((e,t)=>e.service.localeCompare(t.service));return{tooltip:{backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},series:[{type:`graph`,layout:`circular`,circular:{rotateLabel:!1},roam:!1,draggable:!1,label:{show:!0,position:`bottom`,color:e.text,fontSize:10},edgeSymbol:[`none`,`arrow`],edgeSymbolSize:6,data:i.map(t=>({id:t.service,name:t.service,value:t.spans,symbolSize:Math.min(34,18+Math.log10(Math.max(t.spans,1))*4),itemStyle:{color:e.surface,borderColor:r(t.health),borderWidth:3}})),links:a.edges.map(n=>({source:n.caller,target:n.callee,value:n.calls,lineStyle:{width:Math.min(4,1+Math.log10(Math.max(n.calls,1))),color:n.error_rate>=.05?t.bad:e.muted,opacity:.5,curveness:.08}})),emphasis:{focus:`adjacency`}}]}},[n,a]);return i.isError?(0,z.jsx)(AG,{retry:()=>void i.refetch()}):a&&a.nodes.length===0?(0,z.jsx)(kG,{text:`No service relationships in this window`}):(0,z.jsxs)(N,{gap:4,h:`100%`,children:[o&&(0,z.jsx)(bG,{option:o,height:`100%`,className:`widget-chart`,label:`Service dependency graph`,onClick:e=>{let t=e;t.dataType===`node`&&t.data?.id&&r(`Investigate the ${t.data.id} service. Explain its errors and latency.`)}}),a&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[a.nodes.length,` services · `,a.edges.length,` `,a.edges.length===1?`route`:`routes`]})]})}function WG(e){return e.length>12?`${e.slice(0,8)}…${e.slice(-4)}`:e}function GG({widget:e,filters:t,dark:n}){let r=Sa(`trace`,ya(t,e.config,[`trace_id`]));if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});let i=r.data?.data;if(i&&i.spans.length===0)return(0,z.jsx)(kG,{text:`No traces in this window`});let a=[...i?.spans??[]].sort((e,t)=>t.duration_ms-e.duration_ms).slice(0,6);return(0,z.jsxs)(N,{gap:`sm`,children:[(0,z.jsxs)(mn,{cols:{base:2,sm:4},spacing:`sm`,children:[(0,z.jsx)(DG,{label:`Duration`,value:i?Da(i.duration_ms):`—`}),(0,z.jsx)(DG,{label:`Spans`,value:i?Ta.format(i.spans.length):`—`}),(0,z.jsx)(DG,{label:`Services`,value:i?Ta.format(i.services.length):`—`}),(0,z.jsx)(DG,{label:`Status`,value:i?i.has_error?`Error`:`OK`:`—`,color:i?i.has_error?`bad`:`ok`:void 0})]}),a.length>0&&(0,z.jsx)(KG,{spans:a,dark:n}),i&&(0,z.jsxs)(x,{gap:4,children:[(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,ff:`monospace`,children:[`Trace `,WG(i.trace_id)]}),(0,z.jsx)(qG,{value:i.trace_id})]})]})}function KG({spans:e,dark:t}){let n=Math.min(...e.map(e=>new Date(e.start).valueOf())),r=Math.max(...e.map(e=>new Date(e.start).valueOf()+e.duration_ms)),i=Math.max(r-n,1);return(0,z.jsx)(N,{gap:4,children:e.map(e=>{let r=(new Date(e.start).valueOf()-n)/i*100,a=Math.max(e.duration_ms/i*100,.6),o=e.status.toUpperCase().includes(`ERROR`);return(0,z.jsxs)(x,{gap:`sm`,wrap:`nowrap`,children:[(0,z.jsxs)(se,{w:170,miw:0,children:[(0,z.jsx)(_,{size:`xs`,fw:600,truncate:!0,children:e.operation}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e.service})]}),(0,z.jsx)(Re,{label:`${e.service} · ${e.operation} · ${Da(e.duration_ms)}`,withArrow:!0,children:(0,z.jsx)(se,{pos:`relative`,h:10,flex:1,bg:`var(--mantine-color-default-hover)`,style:{borderRadius:`var(--mantine-radius-sm)`},children:(0,z.jsx)(se,{pos:`absolute`,left:`${r}%`,w:`${Math.min(a,100-r)}%`,h:`100%`,bg:o?`bad`:wG(e.service,t),style:{borderRadius:`var(--mantine-radius-sm)`,minWidth:3}})})}),(0,z.jsx)(_,{size:`xs`,ff:`monospace`,w:56,ta:`right`,children:Da(e.duration_ms)})]},e.span_id)})})}function qG({value:e}){let{state:t,copy:n}=I();return(0,z.jsx)(Re,{label:t===`failed`?`Could not copy`:t===`copied`?`Copied`:`Copy trace id`,children:(0,z.jsx)(Se,{variant:`subtle`,color:`gray`,size:`xs`,"aria-label":`Copy trace id`,"data-state":t===`idle`?void 0:t,onClick:()=>n(e),children:t===`copied`?(0,z.jsx)(C,{size:12,weight:`bold`}):(0,z.jsx)(te,{size:12})})})}var JG={overview:`System health`,topology:`Service map`,activity:`Recent activity`,assistant:`Ask Fanout`,performance:`Performance`,trace:`Trace focus`,logs:`Logs`},YG={overview:BG,topology:UG,activity:NG,assistant:PG,performance:HG,trace:GG,logs:zG};function XG(){return(0,z.jsx)(kG,{text:`This view type is not supported by this version`})}function ZG(e){return Object.hasOwn(YG,e)?YG[e]:XG}function QG(e){let{widget:t,services:n,onRemove:r,onConfigure:i}=e,[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),l=ZG(t.type);return(0,z.jsxs)(le,{withBorder:!0,radius:`lg`,p:`md`,h:`100%`,className:`widget-card`,style:{overflow:`hidden`},children:[(0,z.jsxs)(N,{h:`100%`,gap:`sm`,children:[(0,z.jsxs)(x,{justify:`space-between`,align:`center`,wrap:`nowrap`,className:`widget-drag`,style:{cursor:`grab`},children:[(0,z.jsx)(A,{order:2,fz:`md`,fw:500,lineClamp:1,miw:0,children:t.title}),(0,z.jsxs)(Le,{position:`bottom-end`,withinPortal:!0,opened:a,onChange:o,children:[(0,z.jsx)(Le.Target,{children:(0,z.jsx)(Se,{className:`widget-actions`,"data-open":a||void 0,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Actions for ${t.title}`,children:(0,z.jsx)(Ge,{size:18,weight:`bold`})})}),(0,z.jsxs)(Le.Dropdown,{children:[LG(t.type)&&(0,z.jsx)(Le.Item,{leftSection:(0,z.jsx)(kn,{size:15}),onClick:()=>c(!0),children:`Configure`}),(0,z.jsx)(Le.Item,{color:`bad`,leftSection:(0,z.jsx)(Fe,{size:15}),onClick:r,children:`Remove`})]})]})]}),(0,z.jsx)(`div`,{className:`widget-body`,children:(0,z.jsx)(l,{...e})})]}),(0,z.jsx)(RG,{opened:s,widget:t,services:n,onClose:()=>c(!1),onSave:i})]})}var $G=la(sa),eK=`fanout.dashboard-id`,tK={layout:[],widgets:[],filters:{window:`1h`,namespace:``}};function nK(e){return Object.hasOwn(pa,e)?pa[e]:void 0}function rK({dashboardID:e=``,agentAvailable:t,onOpenChat:n,onDashboardChange:r}){let i=fe(),a=ve(`light`)===`dark`,o=Je({queryKey:Me,queryFn:()=>Ne(`/api/dashboards`),refetchInterval:3e4}),[s,c]=(0,R.useState)(()=>e||localStorage.getItem(eK)||``),l=gn({mutationFn:async e=>{if(!u.data)throw Error(`No dashboard selected`);let t=await Be(`/api/dashboards/${encodeURIComponent(u.data.id)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:u.data.name,description:u.data.description,state:e})});if(!t.ok)throw Error(`Unable to save dashboard`);return t.json()},scope:{id:`dashboard-${s}`},onSuccess:e=>{i.setQueryData([`dashboard`,e.id],e),i.invalidateQueries({queryKey:Me})},onError:e=>console.error(`Dashboard save failed`,e)}),u=Je({queryKey:[`dashboard`,s],queryFn:()=>Ne(`/api/dashboards/${encodeURIComponent(s)}`),enabled:!!s,refetchInterval:l.isPending||l.isError?!1:3e4}),[d,f]=(0,R.useState)(tK),[p,m]=(0,R.useState)(`lg`),h=Sa(`overview`,ya(d.filters),!!u.data),g=(0,R.useMemo)(()=>(h.data?.data.services??[]).map(e=>e.service),[h.data]),y=wa();(0,R.useEffect)(()=>{e&&e!==s&&(c(e),localStorage.setItem(eK,e))},[e,s]),(0,R.useEffect)(()=>{let t=o.data?.dashboards;if(t?.length&&!(e&&t.some(t=>t.id===e))){if(!e&&s&&t.some(e=>e.id===s)){r?.(s,!0);return}S((t.find(e=>e.is_default)??t[0]).id,!0)}},[e,o.data,s]),(0,R.useEffect)(()=>{l.isPending||l.isError||u.data?.state&&f(u.data.state)},[u.data?.updated_at,l.isPending,l.isError]),(0,R.useEffect)(()=>{l.reset()},[s]);let b=(0,R.useMemo)(()=>{let e=new Map(d.widgets.map(e=>[e.id,e.type])),t=d.layout.map(t=>{let n=nK(e.get(t.i)??`overview`)??pa.overview;return{...t,h:Math.max(t.h,n.minH),minW:Math.max(t.minW??0,n.minW),minH:Math.max(t.minH??0,n.minH)}});return{lg:t,md:t,sm:da(t,6),xs:da(t,2),xxs:da(t,1)}},[d.layout,d.widgets]);function S(e,t=!1){c(e),localStorage.setItem(eK,e),r?.(e,t)}function C(e){f(e),l.mutate(e)}function w(e){let t=ze(),n=pa[e],r=ha(d.layout,n.w,n.h,12,n.minW);C({...d,widgets:[...d.widgets,{id:t,type:e,title:JG[e],enabled:!0}],layout:[...d.layout,{i:t,x:r.x,y:r.y,w:r.w,h:n.h,minW:n.minW,minH:n.minH}]})}function T(e){C({...d,widgets:d.widgets.filter(t=>t.id!==e),layout:d.layout.filter(t=>t.i!==e)})}function E(e,t){C({...d,widgets:d.widgets.map(n=>n.id===e?{...n,config:t}:n)})}if(o.isLoading||s&&u.isLoading)return(0,z.jsx)(iK,{label:`Loading your dashboard…`});if(o.isError||u.isError)return(0,z.jsx)(iK,{label:`Your dashboard is unavailable. Try refreshing.`});let D=u.data;return D?(0,z.jsxs)(se,{component:`main`,maw:1440,mx:`auto`,px:{base:`md`,sm:`xl`},pt:{base:`lg`,sm:`xl`},pb:`xl`,children:[(0,z.jsxs)(N,{gap:`md`,mb:`lg`,children:[(0,z.jsxs)(se,{children:[(0,z.jsx)(A,{order:1,fz:32,lts:`-0.03em`,children:D.name}),(0,z.jsx)(_,{c:`dimmed`,mt:2,children:D.description||`A focused view of the signals that matter now.`})]}),(0,z.jsxs)(it,{align:{base:`stretch`,md:`center`},justify:`space-between`,direction:{base:`column`,md:`row`},gap:`sm`,role:`group`,"aria-label":`Dashboard controls`,children:[(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,children:[(0,z.jsx)(an,{"aria-label":`Window`,value:d.filters.window,onChange:e=>e&&C({...d,filters:{...d.filters,window:e}}),data:ga,w:{base:`100%`,xs:150},size:`sm`}),(0,z.jsx)(xe,{"aria-label":`Namespace`,value:d.filters.namespace,onChange:e=>f({...d,filters:{...d.filters,namespace:e.currentTarget.value}}),onBlur:e=>C({...d,filters:{...d.filters,namespace:e.currentTarget.value}}),placeholder:`All namespaces`,w:{base:`100%`,xs:200},size:`sm`})]}),(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,justify:`flex-end`,children:[y&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[`Updated `,new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(y))]}),(0,z.jsxs)(Le,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,z.jsx)(Le.Target,{children:(0,z.jsx)(re,{variant:`default`,size:`sm`,leftSection:(0,z.jsx)(ke,{size:15,weight:`bold`}),rightSection:(0,z.jsx)(Tn,{size:13,weight:`bold`}),children:`Add view`})}),(0,z.jsx)(Le.Dropdown,{children:fa.filter(e=>t||e!==`assistant`).map(e=>(0,z.jsx)(Le.Item,{onClick:()=>w(e),children:JG[e]},e))})]}),t&&(0,z.jsx)(re,{variant:`subtle`,color:`gray`,size:`sm`,rightSection:(0,z.jsx)(Cn,{size:15,weight:`bold`}),onClick:()=>n(),children:`Ask Fanout`})]})]})]}),l.isError&&(0,z.jsx)(v,{color:`bad`,radius:`lg`,mb:`lg`,icon:(0,z.jsx)(jn,{size:18,weight:`fill`}),title:`Dashboard changes not saved`,children:(0,z.jsxs)(x,{justify:`space-between`,gap:`sm`,children:[(0,z.jsx)(_,{size:`sm`,children:`Your latest edits are kept on this screen but Fanout could not store them.`}),(0,z.jsx)(re,{size:`compact-sm`,color:`bad`,variant:`light`,onClick:()=>l.mutate(d),children:`Retry save`})]})}),(0,z.jsx)($G,{className:`dashboard-grid`,layouts:b,breakpoints:{lg:1100,md:800,sm:600,xs:420,xxs:0},cols:{lg:12,md:10,sm:6,xs:2,xxs:1},rowHeight:76,margin:[16,16],containerPadding:[0,0],compactType:`vertical`,draggableHandle:`.widget-drag`,draggableCancel:`button,input,select,textarea,a,label,[role=menu],[role=dialog],.widget-actions`,onBreakpointChange:m,onDragStop:e=>{p===`lg`&&C({...d,layout:[...e]})},onResizeStop:e=>{p===`lg`&&C({...d,layout:[...e]})},children:d.widgets.map(e=>(0,z.jsx)(`div`,{children:(0,z.jsx)(QG,{widget:e,filters:d.filters,dark:a,services:g,agentAvailable:t,onOpenChat:n,onRemove:()=>T(e.id),onConfigure:t=>E(e.id,t)})},e.id))})]}):(0,z.jsx)(iK,{label:`Preparing your dashboard…`})}function iK({label:e}){return(0,z.jsxs)(D,{mih:`50vh`,children:[(0,z.jsx)(m,{size:`sm`}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`sm`,children:e})]})}export{rK as t}; \ No newline at end of file +`:``,i=` {`+r,a=r+`}`,o=W(co(e),function(t){return t+i+W(co(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=W(co(t),function(e){return`@keyframes `+e+i+W(co(t[e]),function(n){return n+i+W(co(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[``].join(r)}function fW(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function pW(e,t,n,r){return sW(`svg`,`root`,{width:e,height:t,xmlns:tW,"xmlns:xlink":nW,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}var mW=0;function hW(){return mW++}var gW={cubicIn:`0.32,0,0.67,0`,cubicOut:`0.33,1,0.68,1`,cubicInOut:`0.65,0,0.35,1`,quadraticIn:`0.11,0,0.5,0`,quadraticOut:`0.5,1,0.89,1`,quadraticInOut:`0.45,0,0.55,1`,quarticIn:`0.5,0,0.75,0`,quarticOut:`0.25,1,0.5,1`,quarticInOut:`0.76,0,0.24,1`,quinticIn:`0.64,0,0.78,0`,quinticOut:`0.22,1,0.36,1`,quinticInOut:`0.83,0,0.17,1`,sinusoidalIn:`0.12,0,0.39,0`,sinusoidalOut:`0.61,1,0.88,1`,sinusoidalInOut:`0.37,0,0.63,1`,exponentialIn:`0.7,0,0.84,0`,exponentialOut:`0.16,1,0.3,1`,exponentialInOut:`0.87,0,0.13,1`,circularIn:`0.55,0,1,0.45`,circularOut:`0,0.55,0.45,1`,circularInOut:`0.85,0,0.15,1`},_W=`transform-origin`;function vW(e,t,n){var r=H({},e.shape);H(r,t),e.buildPath(n,r);var i=new qU;return i.reset(xu(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function yW(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[_W]=n+`px `+r+`px`)}var bW={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`};function xW(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function SW(e,t,n){var r=e.shape.paths,i={},a,o;if(U(r,function(e){var t=fW(n.zrId);t.animation=!0,wW(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=co(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=xW(i,n);return a.replace(o,s)}}function CW(e){return q(e)?gW[e]?`cubic-bezier(`+gW[e]+`)`:Al(e)?e:``:``}function wW(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof j_){var s=SW(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l0}).length)return xW(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+hW();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function TW(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};EW(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=nu(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),EW(r,t,n,!0)}}}function EW(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+hW(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}var DW=Math.round;function OW(e){return e&&q(e.src)}function kW(e){return e&&K(e.toDataURL)}function AW(e,t,n,r){eW(function(i,a){var o=i===`fill`||i===`stroke`;o&&yu(a)?GW(t,e,i,r):o&&gu(a)?KW(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),WW(n,e,r)}function jW(e,t){var n=aM(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[aW+`silent`]=`true`))}function MW(e){return ou(e[0]-1)&&ou(e[1])&&ou(e[2])&&ou(e[3]-1)}function NW(e){return ou(e[4])&&ou(e[5])}function PW(e,t,n){if(t&&!(NW(t)&&MW(t))){var r=n?10:1e4;e.transform=MW(t)?`translate(`+DW(t[4]*r)/r+` `+DW(t[5]*r)/r+`)`:lu(t)}}function FW(e,t,n){for(var r=e.points,i=[],a=0;a`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;wo(f,g),wo(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=ls(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=sW(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=V(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=Su(i);x&&(o.patternTransform=x);var S=sW(`pattern`,``,o,[d]),C=uW(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=sW(`pattern`,T,o,[d])),t[n]=bu(T)}}function qW(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=sW(`clipPath`,a,o,[BW(e,n)])}t[`clip-path`]=bu(a)}function JW(e){return document.createTextNode(e)}function YW(e,t,n){e.insertBefore(t,n)}function XW(e,t){e.removeChild(t)}function ZW(e,t){e.appendChild(t)}function QW(e){return e.parentNode}function $W(e){return e.nextSibling}function eG(e,t){e.textContent=t}var tG=58,nG=120,rG=sW(``,``);function iG(e){return e===void 0}function aG(e){return e!==void 0}function oG(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function sG(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function cG(e){var t,n=e.children,r=e.tag;if(aG(r)){var i=e.elm=oW(r);if(dG(rG,e),G(n))for(t=0;ta?(m=n[c+1]==null?null:n[c+1].elm,lG(e,m,n,i,c)):uG(e,t,r,a))}function pG(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(dG(e,t),iG(t.text)?aG(r)&&aG(i)?r!==i&&fG(n,r,i):aG(i)?(aG(e.text)&&eG(n,``),lG(n,null,i,0,i.length-1)):aG(r)?uG(n,r,0,r.length-1):aG(e.text)&&eG(n,``):e.text!==t.text&&(aG(r)&&uG(n,r,0,r.length-1),eG(n,t.text)))}function mG(e,t){if(sG(e,t))pG(e,t);else{var n=e.elm,r=QW(n);cG(t),r!==null&&(YW(r,t.elm,$W(n)),uG(r,[e],0,0))}return t}var hG=0,gG=function(){function e(e,t,n){if(this.type=`svg`,this.configLayer=_G(`configLayer`),this.storage=t,this._opts=n=H({},n),this.root=e,this._id=`zr`+hG++,this._oldVNode=pW(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=oW(`svg`);dG(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,mG(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return UW(e,fW(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=fW(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=vG(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=sW(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=W(co(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(sW(`defs`,`defs`,{},c)),e.animation){var l=dW(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=sW(`style`,`stl`,{},[],l);a.push(u)}}return pW(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},uW(this.renderToVNode({animation:Y(e.cssAnimation,!0),emphasis:Y(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Y(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g{if(!a.current)return;let e=aI(a.current,void 0,{renderer:`svg`});o.current=e,e.on(`click`,e=>s.current?.(e));let t=new ResizeObserver(()=>e.resize());return t.observe(a.current),()=>{t.disconnect(),e.dispose(),o.current=null}},[]),(0,R.useEffect)(()=>{o.current?.setOption({animationDuration:280,aria:{enabled:!0,decal:{show:!0},description:n},...e},{notMerge:!0})},[n,e]),(0,z.jsx)(`div`,{ref:a,className:i?`echart ${i}`:`echart`,style:{height:t,width:`100%`,minWidth:0},role:`img`,"aria-label":n})}function xG(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:e===`unknown`?`gray`:`bad`}function SG(e){return Ve[e?`dark`:`light`]}function CG(e){let t=e?5:7;return{ok:Ie[t],warn:He[t],bad:We[t],info:Ue[t]}}function wG(e,t){let n=Ae[t?`dark`:`light`],r=0;for(let t of e)r=r*31+t.charCodeAt(0)|0;return n[Math.abs(r)%n.length]}function TG(e){let t=String(e).toUpperCase();return t===`ERROR`||t===`FATAL`?`bad`:t===`WARN`||t===`WARNING`?`warn`:t===`INFO`?`info`:`gray`}function EG(e,t){let n=CG(t),r=String(e).toUpperCase();return r===`ERROR`||r===`FATAL`?n.bad:r===`WARN`||r===`WARNING`?n.warn:r===`INFO`?n.info:SG(t).muted}function DG({label:e,value:t,color:n,hint:r,children:i}){return(0,z.jsxs)(le,{withBorder:!0,radius:`md`,p:`sm`,bg:`var(--mantine-color-default)`,miw:0,h:`100%`,children:[(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e}),(0,z.jsx)(_,{fw:600,fz:`xl`,c:n,mt:2,lh:1.2,truncate:!0,children:t}),r&&(0,z.jsx)(_,{c:`dimmed`,size:`xs`,mt:2,truncate:!0,children:r}),i&&(0,z.jsx)(se,{mt:4,children:i})]})}function OG({health:e,label:t}){return(0,z.jsx)(ye,{color:xG(e),variant:`light`,tt:`none`,style:{minWidth:`max-content`},children:t})}function kG({text:e}){return(0,z.jsxs)(D,{py:`xl`,children:[(0,z.jsx)(Dn,{size:20}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`xs`,children:e})]})}function AG({retry:e}){return(0,z.jsxs)(D,{py:`xl`,style:{flexDirection:`column`,gap:8},children:[(0,z.jsxs)(se,{display:`flex`,style:{alignItems:`center`,gap:8},children:[(0,z.jsx)(jn,{size:20,weight:`fill`,color:`var(--mantine-color-bad-filled)`}),(0,z.jsx)(_,{c:`bad`,fw:500,size:`sm`,children:`Couldn't load this view`})]}),(0,z.jsx)(re,{size:`compact-xs`,variant:`light`,color:`bad`,onClick:e,children:`Retry now`}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:`Retrying automatically`})]})}TI([iD]);function jG({values:e,color:t,label:n}){let r=(0,R.useMemo)(()=>({animation:!1,grid:{left:0,right:0,top:2,bottom:2},xAxis:{type:`category`,show:!1,data:e.map((e,t)=>t)},yAxis:{type:`value`,show:!1,min:0},tooltip:{show:!1},series:[{type:`line`,data:e,showSymbol:!1,smooth:.3,lineStyle:{width:1.5,color:t},areaStyle:{opacity:.12,color:t}}]}),[e,t]);return(0,z.jsx)(bG,{option:r,height:28,label:n})}var MG={unhealthy:0,degraded:1,healthy:2};function NG({widget:e,filters:t}){let n=Sa(`overview`,ya(t,e.config,[`service`]));if(n.isError)return(0,z.jsx)(AG,{retry:()=>void n.refetch()});let r=[...n.data?.data.services??[]].sort((e,t)=>(MG[e.health]??3)-(MG[t.health]??3)||t.error_rate-e.error_rate);return n.data&&r.length===0?(0,z.jsx)(kG,{text:`No recent activity`}):(0,z.jsx)(_e,{type:`auto`,offsetScrollbars:!0,h:`100%`,children:(0,z.jsxs)(F,{verticalSpacing:`xs`,fz:`sm`,highlightOnHover:!0,children:[(0,z.jsx)(F.Thead,{children:(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Th,{children:`Service`}),(0,z.jsx)(F.Th,{ta:`right`,children:`P95`}),(0,z.jsx)(F.Th,{ta:`right`,children:`Errors`})]})}),(0,z.jsx)(F.Tbody,{children:r.map(e=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Td,{children:(0,z.jsx)(OG,{health:e.health,label:e.service})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:Da(e.p95_ms)})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,c:e.error_rate>=.01?`bad`:`dimmed`,children:Ea(e.error_rate)})})]},e.service))})]})})}function PG({filters:e,agentAvailable:t,onOpenChat:n}){if(!t)return(0,z.jsx)(_,{c:`dimmed`,size:`sm`,children:`Configure an AI provider to enable this view. The rest of this dashboard remains available.`});let r=_a(e.window),i=[`Summarize the last ${r}`,`What changed in the last ${r}?`,`Which service needs attention right now?`];return(0,z.jsx)(N,{gap:`xs`,align:`flex-start`,children:i.map(e=>(0,z.jsx)(re,{variant:`default`,size:`xs`,radius:`xl`,leftSection:(0,z.jsx)(Pe,{size:13,weight:`fill`}),onClick:()=>n(e),children:e},e))})}var FG={overview:[`service`],topology:[`service`],performance:[`service`],logs:[`service`,`severity`,`search`],trace:[`trace_id`,`service`]};function IG(e){return Object.hasOwn(FG,e)?FG[e]:void 0}function LG(e){return(IG(e)?.length??0)>0}function RG({opened:e,widget:t,services:n,onClose:r,onSave:i}){let[a,o]=(0,R.useState)({service:``,severity:``,search:``,trace_id:``});(0,R.useEffect)(()=>{e&&o({service:va(t.config,`service`),severity:va(t.config,`severity`),search:va(t.config,`search`),trace_id:va(t.config,`trace_id`)})},[e,t.config]);let s=IG(t.type)??[],c=[...new Set([...n,a.service].filter(Boolean))];function l(){let e={...t.config??{}};for(let t of s){let n=a[t].trim();n?e[t]=n:delete e[t]}i(e),r()}return(0,z.jsx)(L,{opened:e,onClose:r,title:`Configure ${t.title}`,centered:!0,children:(0,z.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),l()},children:(0,z.jsxs)(N,{children:[s.includes(`service`)&&(0,z.jsx)(an,{label:`Service`,placeholder:`All services`,data:c,value:a.service||null,onChange:e=>o({...a,service:e??``}),clearable:!0,searchable:!0,"aria-label":`Service`}),s.includes(`severity`)&&(0,z.jsx)(an,{label:`Severity`,placeholder:`All severities`,data:[`ERROR`,`WARN`,`INFO`,`DEBUG`],value:a.severity||null,onChange:e=>o({...a,severity:e??``}),clearable:!0,"aria-label":`Severity`}),s.includes(`search`)&&(0,z.jsx)(xe,{label:`Search`,placeholder:`Text the log body must contain`,value:a.search,onChange:e=>o({...a,search:e.currentTarget.value}),"aria-label":`Search`}),s.includes(`trace_id`)&&(0,z.jsx)(xe,{label:`Trace id`,placeholder:`Leave empty for the most relevant recent trace`,value:a.trace_id,onChange:e=>o({...a,trace_id:e.currentTarget.value}),ff:`monospace`,"aria-label":`Trace id`}),(0,z.jsxs)(x,{justify:`flex-end`,children:[(0,z.jsx)(re,{variant:`default`,onClick:r,children:`Cancel`}),(0,z.jsx)(re,{type:`submit`,children:`Save`})]})]})})})}TI([IA]);function zG({widget:e,filters:t,dark:n}){let r=Sa(`logs`,ya(t,e.config,[`service`,`severity`,`search`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.buckets.length===0)return null;let e=SG(n),t=i.provenance.window,r=[...new Set(i.data.buckets.map(e=>e.time))],a=[...new Set(i.data.buckets.map(e=>e.severity))],o=new Map(i.data.buckets.map(e=>[`${e.time} ${e.severity}`,e.count]));return{color:a.map(e=>EG(e,n)),grid:{left:28,right:8,top:8,bottom:20},tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:r.map(e=>Oa(e,t)),axisLabel:{color:e.muted,fontSize:8,hideOverlap:!0},axisLine:{lineStyle:{color:e.border}}},yAxis:{type:`value`,minInterval:1,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:8}},series:a.map(e=>({name:e,type:`bar`,stack:`logs`,barMaxWidth:14,data:r.map(t=>o.get(`${t} ${e}`)??0),itemStyle:{borderRadius:[2,2,0,0]}}))}},[n,i]);if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});let o=(i?.data.entries??[]).slice(0,5);return i&&o.length===0?(0,z.jsx)(kG,{text:`No matching logs in this window`}):(0,z.jsxs)(N,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(se,{h:72,children:(0,z.jsx)(bG,{option:a,height:72,label:`Log volume by severity`})}),(0,z.jsx)(_e,{type:`auto`,offsetScrollbars:!0,style:{flex:1},children:(0,z.jsx)(F,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(F.Tbody,{children:o.map((e,t)=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`xs`,ff:`monospace`,c:`dimmed`,children:i?Oa(e.time,i.provenance.window,!0):e.time})}),(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(ye,{size:`xs`,color:TG(e.severity),variant:`light`,style:{minWidth:`max-content`},children:e.severity||`LOG`})}),(0,z.jsx)(F.Td,{style:{whiteSpace:`nowrap`},children:(0,z.jsx)(_,{component:`span`,size:`sm`,fw:600,children:e.service})}),(0,z.jsx)(F.Td,{style:{width:`100%`},children:(0,z.jsx)(_,{size:`sm`,lineClamp:1,title:e.body,children:e.body})})]},`${e.time}-${t}`))})})})]})}function BG({widget:e,filters:t,dark:n}){let r=ya(t,e.config,[`service`]),i=Sa(`overview`,r),a=Sa(`performance`,r);if(i.isError)return(0,z.jsx)(AG,{retry:()=>void i.refetch()});let o=i.data?.data,s=(a.data?.data.points??[]).map(e=>e.error_rate*100),c=Math.max(o?.service_count??0,1),l=CG(n),u=o?.health===`unknown`,d=o?u?`No data`:o.health.charAt(0).toUpperCase()+o.health.slice(1):`—`;return(0,z.jsxs)(N,{gap:`sm`,children:[(0,z.jsxs)(mn,{cols:2,spacing:`sm`,children:[(0,z.jsx)(DG,{label:`Health`,value:d,color:o?xG(o.health):void 0,hint:o?u?`Nothing reported in this window`:`${Ta.format(o.service_count)} services`:void 0}),(0,z.jsx)(DG,{label:`Error rate`,value:o&&!u?Ea(o.error_rate):`—`,color:o&&o.error_rate>=.01?`bad`:void 0,hint:o&&!u?`${Ta.format(o.total_spans)} operations`:void 0,children:s.length>1&&(0,z.jsx)(jG,{values:s,color:l.bad,label:`Error rate trend`})})]}),o&&!u&&(0,z.jsxs)(se,{children:[(0,z.jsxs)(nn.Root,{size:`md`,"aria-label":`Service health distribution`,children:[(0,z.jsx)(nn.Section,{value:o.counts.healthy/c*100,color:`ok`}),(0,z.jsx)(nn.Section,{value:o.counts.degraded/c*100,color:`warn`}),(0,z.jsx)(nn.Section,{value:o.counts.unhealthy/c*100,color:`bad`})]}),(0,z.jsxs)(x,{mt:6,gap:`md`,children:[(0,z.jsx)(VG,{color:`ok`,text:`${o.counts.healthy} healthy`}),(0,z.jsx)(VG,{color:`warn`,text:`${o.counts.degraded} degraded`}),(0,z.jsx)(VG,{color:`bad`,text:`${o.counts.unhealthy} unhealthy`})]})]})]})}function VG({color:e,text:t}){return(0,z.jsxs)(x,{gap:6,children:[(0,z.jsx)(se,{w:8,h:8,bg:e,style:{borderRadius:`50%`}}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,children:t})]})}TI([iD]);function HG({widget:e,filters:t,dark:n}){let r=Sa(`performance`,ya(t,e.config,[`service`])),i=r.data,a=(0,R.useMemo)(()=>{if(!i||i.data.points.length===0)return null;let e=SG(n),t=i.provenance.window;return{color:[wG(`operations`,n),CG(n).warn],grid:{left:36,right:40,top:24,bottom:22},legend:{top:0,left:0,textStyle:{color:e.muted,fontSize:10},icon:`circle`,itemWidth:7,itemHeight:7},tooltip:{trigger:`axis`,backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},xAxis:{type:`category`,data:i.data.points.map(e=>Oa(e.time,t)),boundaryGap:!1,axisLine:{lineStyle:{color:e.border}},axisTick:{show:!1},axisLabel:{color:e.muted,fontSize:9,hideOverlap:!0}},yAxis:[{type:`value`,splitLine:{lineStyle:{color:e.grid}},axisLabel:{color:e.muted,fontSize:9}},{type:`value`,splitLine:{show:!1},axisLabel:{color:e.muted,fontSize:9,formatter:e=>Da(e)}}],series:[{name:`Operations`,type:`line`,data:i.data.points.map(e=>e.spans),smooth:.22,showSymbol:!1,lineStyle:{width:2},areaStyle:{opacity:.05}},{name:`P95`,type:`line`,yAxisIndex:1,data:i.data.points.map(e=>e.p95_ms),smooth:.22,showSymbol:!1,lineStyle:{width:2}}]}},[n,i]);if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});if(i&&i.data.points.length===0)return(0,z.jsx)(kG,{text:`No endpoint activity in this window`});let o=(i?.data.endpoints??[]).slice(0,3);return(0,z.jsxs)(N,{gap:`xs`,h:`100%`,children:[a&&(0,z.jsx)(se,{style:{flex:1,minHeight:120},children:(0,z.jsx)(bG,{option:a,height:`100%`,label:`Operations and P95 latency`})}),o.length>0&&(0,z.jsx)(F,{verticalSpacing:4,fz:`sm`,children:(0,z.jsx)(F.Tbody,{children:o.map(e=>(0,z.jsxs)(F.Tr,{children:[(0,z.jsxs)(F.Td,{children:[(0,z.jsx)(ye,{variant:`light`,size:`xs`,mr:6,style:{minWidth:`max-content`},children:e.method}),(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:e.path})]}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsxs)(_,{component:`span`,size:`sm`,c:`dimmed`,children:[Ta.format(e.calls),` calls`]})}),(0,z.jsx)(F.Td,{ta:`right`,children:(0,z.jsx)(_,{component:`span`,size:`sm`,ff:`monospace`,children:Da(e.p95_ms)})})]},`${e.method}-${e.path}`))})})]})}TI([LB]);function UG({widget:e,filters:t,dark:n,onOpenChat:r}){let i=Sa(`topology`,ya(t,e.config,[`service`])),a=i.data?.data,o=(0,R.useMemo)(()=>{if(!a)return null;let e=SG(n),t=CG(n),r=e=>e===`unhealthy`?t.bad:e===`degraded`?t.warn:t.ok,i=[...a.nodes].sort((e,t)=>e.service.localeCompare(t.service));return{tooltip:{backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:10}},series:[{type:`graph`,layout:`circular`,circular:{rotateLabel:!1},roam:!1,draggable:!1,label:{show:!0,position:`bottom`,color:e.text,fontSize:10},edgeSymbol:[`none`,`arrow`],edgeSymbolSize:6,data:i.map(t=>({id:t.service,name:t.service,value:t.spans,symbolSize:Math.min(34,18+Math.log10(Math.max(t.spans,1))*4),itemStyle:{color:e.surface,borderColor:r(t.health),borderWidth:3}})),links:a.edges.map(n=>({source:n.caller,target:n.callee,value:n.calls,lineStyle:{width:Math.min(4,1+Math.log10(Math.max(n.calls,1))),color:n.error_rate>=.05?t.bad:e.muted,opacity:.5,curveness:.08}})),emphasis:{focus:`adjacency`}}]}},[n,a]);return i.isError?(0,z.jsx)(AG,{retry:()=>void i.refetch()}):a&&a.nodes.length===0?(0,z.jsx)(kG,{text:`No service relationships in this window`}):(0,z.jsxs)(N,{gap:4,h:`100%`,children:[o&&(0,z.jsx)(bG,{option:o,height:`100%`,className:`widget-chart`,label:`Service dependency graph`,onClick:e=>{let t=e;t.dataType===`node`&&t.data?.id&&r(`Investigate the ${t.data.id} service. Explain its errors and latency.`)}}),a&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[a.nodes.length,` services · `,a.edges.length,` `,a.edges.length===1?`route`:`routes`]})]})}function WG(e){return e.length>12?`${e.slice(0,8)}…${e.slice(-4)}`:e}function GG({widget:e,filters:t,dark:n}){let r=Sa(`trace`,ya(t,e.config,[`trace_id`,`service`]));if(r.isError)return(0,z.jsx)(AG,{retry:()=>void r.refetch()});let i=r.data?.data;if(i&&i.spans.length===0)return(0,z.jsx)(kG,{text:`No traces in this window`});let a=[...i?.spans??[]].sort((e,t)=>t.duration_ms-e.duration_ms).slice(0,6);return(0,z.jsxs)(N,{gap:`sm`,children:[(0,z.jsxs)(mn,{cols:{base:2,sm:4},spacing:`sm`,children:[(0,z.jsx)(DG,{label:`Duration`,value:i?Da(i.duration_ms):`—`}),(0,z.jsx)(DG,{label:`Spans`,value:i?Ta.format(i.spans.length):`—`}),(0,z.jsx)(DG,{label:`Services`,value:i?Ta.format(i.services.length):`—`}),(0,z.jsx)(DG,{label:`Status`,value:i?i.has_error?`Error`:`OK`:`—`,color:i?i.has_error?`bad`:`ok`:void 0})]}),a.length>0&&(0,z.jsx)(KG,{spans:a,dark:n}),i&&(0,z.jsxs)(x,{gap:4,children:[(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,ff:`monospace`,children:[`Trace `,WG(i.trace_id)]}),(0,z.jsx)(qG,{value:i.trace_id})]})]})}function KG({spans:e,dark:t}){let n=Math.min(...e.map(e=>new Date(e.start).valueOf())),r=Math.max(...e.map(e=>new Date(e.start).valueOf()+e.duration_ms)),i=Math.max(r-n,1);return(0,z.jsx)(N,{gap:4,children:e.map(e=>{let r=(new Date(e.start).valueOf()-n)/i*100,a=Math.max(e.duration_ms/i*100,.6),o=e.status.toUpperCase().includes(`ERROR`);return(0,z.jsxs)(x,{gap:`sm`,wrap:`nowrap`,children:[(0,z.jsxs)(se,{w:170,miw:0,children:[(0,z.jsx)(_,{size:`xs`,fw:600,truncate:!0,children:e.operation}),(0,z.jsx)(_,{c:`dimmed`,size:`xs`,truncate:!0,children:e.service})]}),(0,z.jsx)(Re,{label:`${e.service} · ${e.operation} · ${Da(e.duration_ms)}`,withArrow:!0,children:(0,z.jsx)(se,{pos:`relative`,h:10,flex:1,bg:`var(--mantine-color-default-hover)`,style:{borderRadius:`var(--mantine-radius-sm)`},children:(0,z.jsx)(se,{pos:`absolute`,left:`${r}%`,w:`${Math.min(a,100-r)}%`,h:`100%`,bg:o?`bad`:wG(e.service,t),style:{borderRadius:`var(--mantine-radius-sm)`,minWidth:3}})})}),(0,z.jsx)(_,{size:`xs`,ff:`monospace`,w:56,ta:`right`,children:Da(e.duration_ms)})]},e.span_id)})})}function qG({value:e}){let{state:t,copy:n}=I();return(0,z.jsx)(Re,{label:t===`failed`?`Could not copy`:t===`copied`?`Copied`:`Copy trace id`,children:(0,z.jsx)(Se,{variant:`subtle`,color:`gray`,size:`xs`,"aria-label":`Copy trace id`,"data-state":t===`idle`?void 0:t,onClick:()=>n(e),children:t===`copied`?(0,z.jsx)(C,{size:12,weight:`bold`}):(0,z.jsx)(te,{size:12})})})}var JG={overview:`System health`,topology:`Service map`,activity:`Recent activity`,assistant:`Ask Fanout`,performance:`Performance`,trace:`Trace focus`,logs:`Logs`},YG={overview:BG,topology:UG,activity:NG,assistant:PG,performance:HG,trace:GG,logs:zG};function XG(){return(0,z.jsx)(kG,{text:`This view type is not supported by this version`})}function ZG(e){return Object.hasOwn(YG,e)?YG[e]:XG}function QG(e){let{widget:t,services:n,onRemove:r,onConfigure:i}=e,[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(!1),l=ZG(t.type);return(0,z.jsxs)(le,{withBorder:!0,radius:`lg`,p:`md`,h:`100%`,className:`widget-card`,style:{overflow:`hidden`},children:[(0,z.jsxs)(N,{h:`100%`,gap:`sm`,children:[(0,z.jsxs)(x,{justify:`space-between`,align:`center`,wrap:`nowrap`,className:`widget-drag`,style:{cursor:`grab`},children:[(0,z.jsx)(A,{order:2,fz:`md`,fw:500,lineClamp:1,miw:0,children:t.title}),(0,z.jsxs)(Le,{position:`bottom-end`,withinPortal:!0,opened:a,onChange:o,children:[(0,z.jsx)(Le.Target,{children:(0,z.jsx)(Se,{className:`widget-actions`,"data-open":a||void 0,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Actions for ${t.title}`,children:(0,z.jsx)(Ge,{size:18,weight:`bold`})})}),(0,z.jsxs)(Le.Dropdown,{children:[LG(t.type)&&(0,z.jsx)(Le.Item,{leftSection:(0,z.jsx)(kn,{size:15}),onClick:()=>c(!0),children:`Configure`}),(0,z.jsx)(Le.Item,{color:`bad`,leftSection:(0,z.jsx)(Fe,{size:15}),onClick:r,children:`Remove`})]})]})]}),(0,z.jsx)(`div`,{className:`widget-body`,children:(0,z.jsx)(l,{...e})})]}),(0,z.jsx)(RG,{opened:s,widget:t,services:n,onClose:()=>c(!1),onSave:i})]})}var $G=la(sa),eK=`fanout.dashboard-id`,tK={layout:[],widgets:[],filters:{window:`1h`,namespace:``}};function nK(e){return Object.hasOwn(pa,e)?pa[e]:void 0}function rK({dashboardID:e=``,agentAvailable:t,onOpenChat:n,onDashboardChange:r}){let i=fe(),a=ve(`light`)===`dark`,o=Je({queryKey:Me,queryFn:()=>Ne(`/api/dashboards`),refetchInterval:3e4}),[s,c]=(0,R.useState)(()=>e||localStorage.getItem(eK)||``),l=gn({mutationFn:async e=>{if(!u.data)throw Error(`No dashboard selected`);let t=await Be(`/api/dashboards/${encodeURIComponent(u.data.id)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:u.data.name,description:u.data.description,state:e})});if(!t.ok)throw Error(`Unable to save dashboard`);return t.json()},scope:{id:`dashboard-${s}`},onSuccess:e=>{i.setQueryData([`dashboard`,e.id],e),i.invalidateQueries({queryKey:Me})},onError:e=>console.error(`Dashboard save failed`,e)}),u=Je({queryKey:[`dashboard`,s],queryFn:()=>Ne(`/api/dashboards/${encodeURIComponent(s)}`),enabled:!!s,refetchInterval:l.isPending||l.isError?!1:3e4}),[d,f]=(0,R.useState)(tK),[p,m]=(0,R.useState)(`lg`),h=Sa(`overview`,ya(d.filters),!!u.data),g=(0,R.useMemo)(()=>(h.data?.data.services??[]).map(e=>e.service),[h.data]),y=wa();(0,R.useEffect)(()=>{e&&e!==s&&(c(e),localStorage.setItem(eK,e))},[e,s]),(0,R.useEffect)(()=>{let t=o.data?.dashboards;if(t?.length&&!(e&&t.some(t=>t.id===e))){if(!e&&s&&t.some(e=>e.id===s)){r?.(s,!0);return}S((t.find(e=>e.is_default)??t[0]).id,!0)}},[e,o.data,s]),(0,R.useEffect)(()=>{l.isPending||l.isError||u.data?.state&&f(u.data.state)},[u.data?.updated_at,l.isPending,l.isError]),(0,R.useEffect)(()=>{l.reset()},[s]);let b=(0,R.useMemo)(()=>{let e=new Map(d.widgets.map(e=>[e.id,e.type])),t=d.layout.map(t=>{let n=nK(e.get(t.i)??`overview`)??pa.overview;return{...t,h:Math.max(t.h,n.minH),minW:Math.max(t.minW??0,n.minW),minH:Math.max(t.minH??0,n.minH)}});return{lg:t,md:t,sm:da(t,6),xs:da(t,2),xxs:da(t,1)}},[d.layout,d.widgets]);function S(e,t=!1){c(e),localStorage.setItem(eK,e),r?.(e,t)}function C(e){f(e),l.mutate(e)}function w(e){let t=ze(),n=pa[e],r=ha(d.layout,n.w,n.h,12,n.minW);C({...d,widgets:[...d.widgets,{id:t,type:e,title:JG[e],enabled:!0}],layout:[...d.layout,{i:t,x:r.x,y:r.y,w:r.w,h:n.h,minW:n.minW,minH:n.minH}]})}function T(e){C({...d,widgets:d.widgets.filter(t=>t.id!==e),layout:d.layout.filter(t=>t.i!==e)})}function E(e,t){C({...d,widgets:d.widgets.map(n=>n.id===e?{...n,config:t}:n)})}if(o.isLoading||s&&u.isLoading)return(0,z.jsx)(iK,{label:`Loading your dashboard…`});if(o.isError||u.isError)return(0,z.jsx)(iK,{label:`Your dashboard is unavailable. Try refreshing.`});let D=u.data;return D?(0,z.jsxs)(se,{component:`main`,maw:1440,mx:`auto`,px:{base:`md`,sm:`xl`},pt:{base:`lg`,sm:`xl`},pb:`xl`,children:[(0,z.jsxs)(N,{gap:`md`,mb:`lg`,children:[(0,z.jsxs)(se,{children:[(0,z.jsx)(A,{order:1,fz:32,lts:`-0.03em`,children:D.name}),(0,z.jsx)(_,{c:`dimmed`,mt:2,children:D.description||`A focused view of the signals that matter now.`})]}),(0,z.jsxs)(it,{align:{base:`stretch`,md:`center`},justify:`space-between`,direction:{base:`column`,md:`row`},gap:`sm`,role:`group`,"aria-label":`Dashboard controls`,children:[(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,children:[(0,z.jsx)(an,{"aria-label":`Window`,value:d.filters.window,onChange:e=>e&&C({...d,filters:{...d.filters,window:e}}),data:ga,w:{base:`100%`,xs:150},size:`sm`}),(0,z.jsx)(xe,{"aria-label":`Namespace`,value:d.filters.namespace,onChange:e=>f({...d,filters:{...d.filters,namespace:e.currentTarget.value}}),onBlur:e=>C({...d,filters:{...d.filters,namespace:e.currentTarget.value}}),placeholder:`All namespaces`,w:{base:`100%`,xs:200},size:`sm`})]}),(0,z.jsxs)(x,{gap:`sm`,wrap:`wrap`,justify:`flex-end`,children:[y&&(0,z.jsxs)(_,{c:`dimmed`,size:`xs`,children:[`Updated `,new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(y))]}),(0,z.jsxs)(Le,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,z.jsx)(Le.Target,{children:(0,z.jsx)(re,{variant:`default`,size:`sm`,leftSection:(0,z.jsx)(ke,{size:15,weight:`bold`}),rightSection:(0,z.jsx)(Tn,{size:13,weight:`bold`}),children:`Add view`})}),(0,z.jsx)(Le.Dropdown,{children:fa.filter(e=>t||e!==`assistant`).map(e=>(0,z.jsx)(Le.Item,{onClick:()=>w(e),children:JG[e]},e))})]}),t&&(0,z.jsx)(re,{variant:`subtle`,color:`gray`,size:`sm`,rightSection:(0,z.jsx)(Cn,{size:15,weight:`bold`}),onClick:()=>n(),children:`Ask Fanout`})]})]})]}),l.isError&&(0,z.jsx)(v,{color:`bad`,radius:`lg`,mb:`lg`,icon:(0,z.jsx)(jn,{size:18,weight:`fill`}),title:`Dashboard changes not saved`,children:(0,z.jsxs)(x,{justify:`space-between`,gap:`sm`,children:[(0,z.jsx)(_,{size:`sm`,children:`Your latest edits are kept on this screen but Fanout could not store them.`}),(0,z.jsx)(re,{size:`compact-sm`,color:`bad`,variant:`light`,onClick:()=>l.mutate(d),children:`Retry save`})]})}),(0,z.jsx)($G,{className:`dashboard-grid`,layouts:b,breakpoints:{lg:1100,md:800,sm:600,xs:420,xxs:0},cols:{lg:12,md:10,sm:6,xs:2,xxs:1},rowHeight:76,margin:[16,16],containerPadding:[0,0],compactType:`vertical`,draggableHandle:`.widget-drag`,draggableCancel:`button,input,select,textarea,a,label,[role=menu],[role=dialog],.widget-actions`,onBreakpointChange:m,onDragStop:e=>{p===`lg`&&C({...d,layout:[...e]})},onResizeStop:e=>{p===`lg`&&C({...d,layout:[...e]})},children:d.widgets.map(e=>(0,z.jsx)(`div`,{children:(0,z.jsx)(QG,{widget:e,filters:d.filters,dark:a,services:g,agentAvailable:t,onOpenChat:n,onRemove:()=>T(e.id),onConfigure:t=>E(e.id,t)})},e.id))})]}):(0,z.jsx)(iK,{label:`Preparing your dashboard…`})}function iK({label:e}){return(0,z.jsxs)(D,{mih:`50vh`,children:[(0,z.jsx)(m,{size:`sm`}),(0,z.jsx)(_,{c:`dimmed`,size:`sm`,ml:`sm`,children:e})]})}export{rK as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards._dashboardId-Dlv44ftW.js b/internal/ui/dist/assets/dashboards._dashboardId-DCQxYJDK.js similarity index 69% rename from internal/ui/dist/assets/dashboards._dashboardId-Dlv44ftW.js rename to internal/ui/dist/assets/dashboards._dashboardId-DCQxYJDK.js index c3607b6e4..a3c2ff7ef 100644 --- a/internal/ui/dist/assets/dashboards._dashboardId-Dlv44ftW.js +++ b/internal/ui/dist/assets/dashboards._dashboardId-DCQxYJDK.js @@ -1 +1 @@ -import{pt as e}from"./brand-CCB4_HD8.js";import{t}from"./dashboard-Dl2pFM2h.js";import{q as n,s as r,u as i}from"./index-BxnvJp0Y.js";var a=e();function o(){let{dashboardId:e}=r.useParams(),o=n(),{agentAvailable:s,openChat:c}=i();return(0,a.jsx)(t,{dashboardID:e,agentAvailable:s,onOpenChat:c,onDashboardChange:(e,t)=>void o({to:`/dashboards/$dashboardId`,params:{dashboardId:e},replace:t})})}export{o as component}; \ No newline at end of file +import{pt as e}from"./brand-CCB4_HD8.js";import{t}from"./dashboard-qOWEIeHc.js";import{q as n,s as r,u as i}from"./index-DSdcpqnK.js";var a=e();function o(){let{dashboardId:e}=r.useParams(),o=n(),{agentAvailable:s,openChat:c}=i();return(0,a.jsx)(t,{dashboardID:e,agentAvailable:s,onOpenChat:c,onDashboardChange:(e,t)=>void o({to:`/dashboards/$dashboardId`,params:{dashboardId:e},replace:t})})}export{o as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-BuFeceag.js b/internal/ui/dist/assets/dashboards.index-D-Z1PEHh.js similarity index 82% rename from internal/ui/dist/assets/dashboards.index-BuFeceag.js rename to internal/ui/dist/assets/dashboards.index-D-Z1PEHh.js index b43d23f2b..25a03e85c 100644 --- a/internal/ui/dist/assets/dashboards.index-BuFeceag.js +++ b/internal/ui/dist/assets/dashboards.index-D-Z1PEHh.js @@ -1 +1 @@ -import{pt as e}from"./brand-CCB4_HD8.js";import{t}from"./dashboard-Dl2pFM2h.js";import{q as n,u as r}from"./index-BxnvJp0Y.js";var i=e();function a(){let e=n(),{agentAvailable:a,openChat:o}=r();return(0,i.jsx)(t,{agentAvailable:a,onOpenChat:o,onDashboardChange:t=>void e({to:`/dashboards/$dashboardId`,params:{dashboardId:t},replace:!0})})}export{a as component}; \ No newline at end of file +import{pt as e}from"./brand-CCB4_HD8.js";import{t}from"./dashboard-qOWEIeHc.js";import{q as n,u as r}from"./index-DSdcpqnK.js";var i=e();function a(){let e=n(),{agentAvailable:a,openChat:o}=r();return(0,i.jsx)(t,{agentAvailable:a,onOpenChat:o,onDashboardChange:t=>void e({to:`/dashboards/$dashboardId`,params:{dashboardId:t},replace:!0})})}export{a as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-BxnvJp0Y.js b/internal/ui/dist/assets/index-DSdcpqnK.js similarity index 99% rename from internal/ui/dist/assets/index-BxnvJp0Y.js rename to internal/ui/dist/assets/index-DSdcpqnK.js index 0ba2ab16e..21c145fee 100644 --- a/internal/ui/dist/assets/index-BxnvJp0Y.js +++ b/internal/ui/dist/assets/index-DSdcpqnK.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-DdP3ZNeG.js","assets/brand-CCB4_HD8.js","assets/chat.index-DSIYq_x1.js","assets/chat-D-J8SUFh.js","assets/copy-CUb9ms1Q.js","assets/chat._threadId-DSIYq_x1.js","assets/dashboards.index-BuFeceag.js","assets/dashboard-Dl2pFM2h.js","assets/dashboards._dashboardId-Dlv44ftW.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-C2A3xwKL.js","assets/brand-CCB4_HD8.js","assets/chat.index-u0MOvyAV.js","assets/chat-XnnwteRX.js","assets/copy-DGK5qe2D.js","assets/chat._threadId-u0MOvyAV.js","assets/dashboards.index-D-Z1PEHh.js","assets/dashboard-qOWEIeHc.js","assets/dashboards._dashboardId-DCQxYJDK.js"])))=>i.map(i=>d[i]); import{$ as e,A as t,B as n,C as r,F as i,G as a,H as o,I as s,J as c,K as l,L as u,M as d,N as f,O as p,P as m,Q as h,S as g,U as _,V as v,W as y,X as b,Y as x,Z as S,_ as C,a as w,at as T,b as E,c as D,d as O,dt as k,et as A,f as ee,ft as j,g as M,gt as N,h as te,ht as ne,i as re,it as ie,j as P,k as ae,l as oe,lt as se,m as ce,mt as le,nt as ue,o as de,ot as fe,p as pe,pt as me,q as he,r as ge,rt as _e,s as F,st as ve,t as ye,tt as be,u as xe,ut as I,v as Se,vt as Ce,x as we,xt as Te,y as Ee,z as De}from"./brand-CCB4_HD8.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Oe=N((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ke=N(((e,t)=>{t.exports=Oe()})),Ae=N((e=>{var t=ke(),n=ne(),r=le();function i(e){var t=`https://react.dev/errors/`+e;if(1ie||(e.current=re[ie],re[ie]=null,ie--)}function oe(e,t){ie++,re[ie]=e.current,e.current=t}var se=P(null),ce=P(null),ue=P(null),de=P(null);function fe(e,t){switch(oe(ue,t),oe(ce,e),oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nf(t),e=rf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(se),oe(se,e)}function pe(){ae(se),ae(ce),ae(ue)}function me(e){e.memoizedState!==null&&oe(de,e);var t=se.current,n=rf(t,e.type);t!==n&&(oe(ce,e),oe(se,n))}function he(e){ce.current===e&&(ae(se),ae(ce)),de.current===e&&(ae(de),pp._currentValue=te)}var ge,_e;function F(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1)`:-1=0}function Xx(e){for(var t=[`topLevel`],n=0,r,i,a,o=function(e){return t.push(e)},s=function(e){return t[t.length-1]=e},c=function(e){r??(r=n,i=t.length,a=e)},l=function(e){e===a&&(r=void 0,i=void 0,a=void 0)},u=function(){return t.pop()},d=function(){return n--},f=function(e){if(`0`<=e&&e<=`9`){o(`number`);return}switch(e){case`"`:o(`string`);return;case`-`:o(`numberNeedsDigit`);return;case`t`:o(`true`);return;case`f`:o(`false`);return;case`n`:o(`null`);return;case`[`:o(`arrayNeedsValue`);return;case`{`:o(`objectNeedsKey`);return}},p=e.length;n`9`)&&(d(),u());break;case`numberNeedsDigit`:s(`number`);break;case`numberNeedsExponent`:s(m===`+`||m===`-`?`numberNeedsDigit`:`number`);break;case`true`:case`false`:case`null`:(m<`a`||m>`z`)&&(d(),u());break;case`arrayNeedsValue`:m===`]`?u():Yx(m)||(l(`collectionItem`),s(`arrayNeedsComma`),f(m));break;case`arrayNeedsComma`:m===`]`?u():m===`,`&&(c(`collectionItem`),s(`arrayNeedsValue`));break;case`objectNeedsKey`:m===`}`?u():m===`"`&&(c(`collectionItem`),s(`objectNeedsColon`),o(`string`));break;case`objectNeedsColon`:m===`:`&&s(`objectNeedsValue`);break;case`objectNeedsValue`:Yx(m)||(l(`collectionItem`),s(`objectNeedsComma`),f(m));break;case`objectNeedsComma`:m===`}`?u():m===`,`&&(c(`collectionItem`),s(`objectNeedsKey`))}}i!=null&&(t.length=i);for(var h=[r==null?e:e.slice(0,r)],g=function(t){return h.push(t.slice(e.length-e.lastIndexOf(t[0])))},_=t.length-1;_>=0;_--)switch(t[_]){case`string`:h.push(`"`);break;case`numberNeedsDigit`:case`numberNeedsExponent`:h.push(`0`);break;case`true`:g(`true`);break;case`false`:g(`false`);break;case`null`:g(`null`);break;case`arrayNeedsValue`:case`arrayNeedsComma`:h.push(`]`);break;case`objectNeedsKey`:case`objectNeedsColon`:case`objectNeedsValue`:case`objectNeedsComma`:h.push(`}`)}return h.join(``)}function Zx(){let e=this.buf,t=this.pos,n=0,r=0;for(let i=0;i<28;i+=7){let a=e[t++];if(n|=(a&127)<>4,!(i&128)){this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;return}for(let i=3;i<=31;i+=7){let a=e[t++];if(r|=(a&127)<=Qx&&(i+=r/Qx|0,r%=Qx)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?iS(r,i):rS(r,i)}function eS(e,t){let n=rS(e,t),r=n.hi&2147483648;r&&(n=iS(n.lo,n.hi));let i=tS(n.lo,n.hi);return r?`-`+i:i}function tS(e,t){if({lo:e,hi:t}=nS(e,t),t<=2097151)return String(Qx*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+aS(o)+aS(a)}function nS(e,t){return{lo:e>>>0,hi:t>>>0}}function rS(e,t){return{lo:e|0,hi:t|0}}function iS(e,t){return t=~t,e?e=~e+1:t+=1,rS(e,t)}var aS=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function oS(){let e=this.buf[this.pos++];if(!(e&128))return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var sS=cS();function cS(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||ta.call(e)),fS(i)}return dS}function mS(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var hS;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(hS||={});var gS=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?mS(e):pS().encodeUtf8Into,this.buffer=yS,this.viewCache=bS,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||_S;for(;e0&&n.set(this.buffer),this.buffer=n}}view(){let e=this.buffer,t=this.viewCache;if(t.byteLength===e.byteLength)return t;let n=new DataView(e.buffer);return this.viewCache=n,n}finish(){let e=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],e}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(vS),this.buffer[this.pos++]=0,this}join(){let e=this.stackPos.pop();if(e===void 0)throw Error(`invalid state, fork stack empty`);let t=this.pos-e-vS,n=SS(t);return n>vS&&(this.ensureCapacity(n-vS),this.buffer.copyWithin(e+n,e+vS,this.pos)),this.pos=e,this.uint32(t),this.pos+=t,this}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.ensureCapacity(e.length),this.buffer.set(e,this.pos),this.pos+=e.length,this}uint32(e){if(wS(e),this.ensureCapacity(5),e<128)return this.buffer[this.pos++]=e,this;for(;e>127;)this.buffer[this.pos++]=e&127|128,e>>>=7;return this.buffer[this.pos++]=e,this}int32(e){if(CS(e),e>=0)return this.uint32(e);this.ensureCapacity(10);for(let t=0;t<9;t++)this.buffer[this.pos++]=e&127|128,e>>=7;return this.buffer[this.pos++]=1,this}bool(e){return this.ensureCapacity(1),this.buffer[this.pos++]=+!!e,this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){typeof e!=`string`&&(e=String(e));let t=e.length;if(t<=xS){this.ensureCapacity(t+1);let n=this.buffer,r=this.pos;n[r++]=t;let i=0;for(;i127)break;n[r++]=t}if(i==t)return this.pos=r,this}this.ensureCapacity(t*3+5);let n=SS(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=SS(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return TS(e),this.ensureCapacity(4),this.view().setFloat32(this.pos,e,!0),this.pos+=4,this}double(e){return this.ensureCapacity(8),this.view().setFloat64(this.pos,e,!0),this.pos+=8,this}fixed32(e){return wS(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return CS(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return CS(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=sS.enc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}fixed64(e){let t=sS.uEnc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}int64(e){let t=sS.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=sS.enc(e),n=t.hi>>31,r=t.lo<<1^n,i=(t.hi<<1|t.lo>>>31)^n;return this.writeVarint64(r,i)}uint64(e){let t=sS.uEnc(e);return this.writeVarint64(t.lo,t.hi)}writeVarint64(e,t){this.ensureCapacity(10);let n=this.buffer,r=this.pos;for(let i=0;i<28;i+=7){let a=e>>>i,o=!(!(a>>>7)&&t==0);if(n[r++]=(o?a|128:a)&255,!o)return this.pos=r,this}let i=e>>>28&15|(t&7)<<4,a=!!(t>>3);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this;for(let e=3;e<31;e+=7){let i=t>>>e,a=!!(i>>>7);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this}return n[r++]=t>>>31&1,this.pos=r,this}},_S=128,vS=1,yS=new Uint8Array,bS=new DataView(yS.buffer),xS=32;function SS(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var q=class{constructor(e,t=pS().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=Zx,this.uint32=oS,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case hS.Varint:for(;this.buf[this.pos++]&128;);break;case hS.Bit64:this.pos+=4;case hS.Bit32:this.pos+=4;break;case hS.LengthDelimited:let r=this.uint32();this.pos+=r;break;case hS.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===hS.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return this.varint64(),sS.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),sS.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let e=this.varint64Lo,t=this.varint64Hi,n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,sS.dec(e,t)}bool(){let e=this.buf[this.pos];return e<128?(this.pos++,e!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return sS.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return sS.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){let t=this.bytes(),n=t.length;if(n<=xS){let r=Array(n);for(let i=0;i127)return this.decodeUtf8(t,e);r[i]=n}return String.fromCharCode.apply(String,r)}return this.decodeUtf8(t,e)}};function CS(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function wS(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function TS(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}var ES=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function DS(){return{fields:{}}}var OS={encode(e,t=new gS){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&AS.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=DS();for(;n.pos>>3){case 1:{if(e!==10)break;let t=AS.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return OS.fromPartial(e??{})},fromPartial(e){let t=DS();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=DS();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function kS(){return{key:``,value:void 0}}var AS={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&J.encode(J.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=kS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return AS.fromPartial(e??{})},fromPartial(e){let t=kS();return t.key=e.key??``,t.value=e.value??void 0,t}};function jS(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var J={encode(e,t=new gS){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&OS.encode(OS.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&NS.encode(NS.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=jS();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=OS.unwrap(OS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=NS.unwrap(NS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return J.fromPartial(e??{})},fromPartial(e){let t=jS();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=jS();if(e===null)t.nullValue=ES.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function MS(){return{values:[]}}var NS={encode(e,t=new gS){for(let n of e.values)J.encode(J.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=MS();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(J.unwrap(J.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return NS.fromPartial(e??{})},fromPartial(e){let t=MS();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=MS();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},PS=function(e){return e[e.ADD=0]=`ADD`,e[e.REMOVE=1]=`REMOVE`,e[e.REPLACE=2]=`REPLACE`,e[e.MOVE=3]=`MOVE`,e[e.COPY=4]=`COPY`,e[e.TEST=5]=`TEST`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function FS(){return{op:0,path:``,from:void 0,value:void 0}}var IS={encode(e,t=new gS){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==``&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&J.encode(J.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=FS();for(;n.pos>>3){case 1:if(e!==8)break;i.op=n.int32();continue;case 2:if(e!==18)break;i.path=n.string();continue;case 3:if(e!==26)break;i.from=n.string();continue;case 4:if(e!==34)break;i.value=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return IS.fromPartial(e??{})},fromPartial(e){let t=FS();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function LS(){return{id:``,type:``,function:void 0,metadata:void 0}}var RS={encode(e,t=new gS){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&BS.encode(e.function,t.uint32(26).fork()).join(),e.metadata!==void 0&&OS.encode(OS.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=LS();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.type=n.string();continue;case 3:if(e!==26)break;i.function=BS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.metadata=OS.unwrap(OS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return RS.fromPartial(e??{})},fromPartial(e){let t=LS();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?BS.fromPartial(e.function):void 0,t.metadata=e.metadata??void 0,t}};function zS(){return{name:``,arguments:``}}var BS={encode(e,t=new gS){return e.name!==``&&t.uint32(10).string(e.name),e.arguments!==``&&t.uint32(18).string(e.arguments),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=zS();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.arguments=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return BS.fromPartial(e??{})},fromPartial(e){let t=zS();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function VS(){return{value:``,mimeType:``}}var HS={encode(e,t=new gS){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==``&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=VS();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return HS.fromPartial(e??{})},fromPartial(e){let t=VS();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function US(){return{value:``,mimeType:void 0}}var WS={encode(e,t=new gS){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=US();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return WS.fromPartial(e??{})},fromPartial(e){let t=US();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function GS(){return{data:void 0,url:void 0}}var KS={encode(e,t=new gS){return e.data!==void 0&&HS.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&WS.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=GS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=HS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=WS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return KS.fromPartial(e??{})},fromPartial(e){let t=GS();return t.data=e.data!==void 0&&e.data!==null?HS.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?WS.fromPartial(e.url):void 0,t}};function qS(){return{text:``}}var JS={encode(e,t=new gS){return e.text!==``&&t.uint32(10).string(e.text),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=qS();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return JS.fromPartial(e??{})},fromPartial(e){let t=qS();return t.text=e.text??``,t}};function YS(){return{source:void 0,metadata:void 0}}var XS={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=YS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return XS.fromPartial(e??{})},fromPartial(e){let t=YS();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function ZS(){return{source:void 0,metadata:void 0}}var QS={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=ZS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return QS.fromPartial(e??{})},fromPartial(e){let t=ZS();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function $S(){return{source:void 0,metadata:void 0}}var eC={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=$S();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return eC.fromPartial(e??{})},fromPartial(e){let t=$S();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function tC(){return{source:void 0,metadata:void 0}}var nC={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=tC();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nC.fromPartial(e??{})},fromPartial(e){let t=tC();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function rC(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var iC={encode(e,t=new gS){return e.text!==void 0&&JS.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&XS.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&QS.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&eC.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&nC.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=rC();for(;n.pos>>3){case 1:if(e!==10)break;i.text=JS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=XS.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=QS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=eC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=nC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return iC.fromPartial(e??{})},fromPartial(e){let t=rC();return t.text=e.text!==void 0&&e.text!==null?JS.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?XS.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?QS.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?eC.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?nC.fromPartial(e.document):void 0,t}};function aC(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[],metadata:void 0,subagentRunId:void 0}}var oC={encode(e,t=new gS){e.id!==``&&t.uint32(10).string(e.id),e.role!==``&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let n of e.toolCalls)RS.encode(n,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let n of e.contentParts)iC.encode(n,t.uint32(66).fork()).join();return e.metadata!==void 0&&OS.encode(OS.wrap(e.metadata),t.uint32(74).fork()).join(),e.subagentRunId!==void 0&&t.uint32(82).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=aC();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.role=n.string();continue;case 3:if(e!==26)break;i.content=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.toolCalls.push(RS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.toolCallId=n.string();continue;case 7:if(e!==58)break;i.error=n.string();continue;case 8:if(e!==66)break;i.contentParts.push(iC.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.metadata=OS.unwrap(OS.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return oC.fromPartial(e??{})},fromPartial(e){let t=aC();return t.id=e.id??``,t.role=e.role??``,t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(e=>RS.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>iC.fromPartial(e))||[],t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function sC(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0,subagentRunId:void 0}}var cC={encode(e,t=new gS){return e.id!==``&&t.uint32(10).string(e.id),e.reason!==``&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&J.encode(J.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&J.encode(J.wrap(e.metadata),t.uint32(58).fork()).join(),e.subagentRunId!==void 0&&t.uint32(66).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=sC();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.reason=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.responseSchema=J.unwrap(J.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=J.unwrap(J.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cC.fromPartial(e??{})},fromPartial(e){let t=sC();return t.id=e.id??``,t.reason=e.reason??``,t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}},lC=function(e){return e[e.TEXT_MESSAGE_START=0]=`TEXT_MESSAGE_START`,e[e.TEXT_MESSAGE_CONTENT=1]=`TEXT_MESSAGE_CONTENT`,e[e.TEXT_MESSAGE_END=2]=`TEXT_MESSAGE_END`,e[e.TOOL_CALL_START=3]=`TOOL_CALL_START`,e[e.TOOL_CALL_ARGS=4]=`TOOL_CALL_ARGS`,e[e.TOOL_CALL_END=5]=`TOOL_CALL_END`,e[e.STATE_SNAPSHOT=6]=`STATE_SNAPSHOT`,e[e.STATE_DELTA=7]=`STATE_DELTA`,e[e.MESSAGES_SNAPSHOT=8]=`MESSAGES_SNAPSHOT`,e[e.RAW=9]=`RAW`,e[e.CUSTOM=10]=`CUSTOM`,e[e.RUN_STARTED=11]=`RUN_STARTED`,e[e.RUN_FINISHED=12]=`RUN_FINISHED`,e[e.RUN_ERROR=13]=`RUN_ERROR`,e[e.STEP_STARTED=14]=`STEP_STARTED`,e[e.STEP_FINISHED=15]=`STEP_FINISHED`,e[e.SUBAGENT_STARTED=16]=`SUBAGENT_STARTED`,e[e.SUBAGENT_FINISHED=17]=`SUBAGENT_FINISHED`,e[e.SUBAGENT_ERROR=18]=`SUBAGENT_ERROR`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function uC(){return{type:0,timestamp:void 0,rawEvent:void 0,metadata:void 0}}var Y={encode(e,t=new gS){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&J.encode(J.wrap(e.rawEvent),t.uint32(26).fork()).join(),e.metadata!==void 0&&OS.encode(OS.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=uC();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=rw(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=J.unwrap(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=OS.unwrap(OS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Y.fromPartial(e??{})},fromPartial(e){let t=uC();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t.metadata=e.metadata??void 0,t}};function dC(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0,subagentRunId:void 0}}var fC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=dC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fC.fromPartial(e??{})},fromPartial(e){let t=dC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function pC(){return{baseEvent:void 0,messageId:``,delta:``,subagentRunId:void 0}}var mC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=pC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mC.fromPartial(e??{})},fromPartial(e){let t=pC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function hC(){return{baseEvent:void 0,messageId:``,subagentRunId:void 0}}var gC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=hC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gC.fromPartial(e??{})},fromPartial(e){let t=hC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function _C(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0,subagentRunId:void 0}}var vC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.toolCallName!==``&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=_C();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vC.fromPartial(e??{})},fromPartial(e){let t=_C();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function yC(){return{baseEvent:void 0,toolCallId:``,delta:``,subagentRunId:void 0}}var bC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=yC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bC.fromPartial(e??{})},fromPartial(e){let t=yC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function xC(){return{baseEvent:void 0,toolCallId:``,subagentRunId:void 0}}var SC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=xC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return SC.fromPartial(e??{})},fromPartial(e){let t=xC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function CC(){return{baseEvent:void 0,snapshot:void 0,subagentRunId:void 0}}var wC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&J.encode(J.wrap(e.snapshot),t.uint32(18).fork()).join(),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=CC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=J.unwrap(J.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wC.fromPartial(e??{})},fromPartial(e){let t=CC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function TC(){return{baseEvent:void 0,delta:[],subagentRunId:void 0}}var EC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)IS.encode(n,t.uint32(18).fork()).join();return e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=TC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(IS.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return EC.fromPartial(e??{})},fromPartial(e){let t=TC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>IS.fromPartial(e))||[],t.subagentRunId=e.subagentRunId??void 0,t}};function DC(){return{baseEvent:void 0,messages:[]}}var OC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)oC.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=DC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(oC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return OC.fromPartial(e??{})},fromPartial(e){let t=DC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>oC.fromPartial(e))||[],t}};function kC(){return{baseEvent:void 0,event:void 0,source:void 0,subagentRunId:void 0}}var AC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&J.encode(J.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=kC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=J.unwrap(J.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return AC.fromPartial(e??{})},fromPartial(e){let t=kC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function jC(){return{baseEvent:void 0,name:``,value:void 0,subagentRunId:void 0}}var MC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&J.encode(J.wrap(e.value),t.uint32(26).fork()).join(),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=jC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=J.unwrap(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return MC.fromPartial(e??{})},fromPartial(e){let t=jC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function NC(){return{baseEvent:void 0,threadId:``,runId:``}}var PC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=NC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return PC.fromPartial(e??{})},fromPartial(e){let t=NC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t}};function FC(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0}}var IC={encode(e,t=new gS){return e.provider!==void 0&&t.uint32(10).string(e.provider),e.model!==void 0&&t.uint32(18).string(e.model),e.inputTokens!==void 0&&t.uint32(24).int64(e.inputTokens),e.outputTokens!==void 0&&t.uint32(32).int64(e.outputTokens),e.totalTokens!==void 0&&t.uint32(40).int64(e.totalTokens),e.reasoningTokens!==void 0&&t.uint32(48).int64(e.reasoningTokens),e.cachedInputTokens!==void 0&&t.uint32(56).int64(e.cachedInputTokens),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=FC();for(;n.pos>>3){case 1:if(e!==10)break;i.provider=n.string();continue;case 2:if(e!==18)break;i.model=n.string();continue;case 3:if(e!==24)break;i.inputTokens=rw(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=rw(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=rw(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=rw(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=rw(n.int64());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return IC.fromPartial(e??{})},fromPartial(e){let t=FC();return t.provider=e.provider??void 0,t.model=e.model??void 0,t.inputTokens=e.inputTokens??void 0,t.outputTokens=e.outputTokens??void 0,t.totalTokens=e.totalTokens??void 0,t.reasoningTokens=e.reasoningTokens??void 0,t.cachedInputTokens=e.cachedInputTokens??void 0,t}};function LC(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[]}}var RC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.result!==void 0&&J.encode(J.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)cC.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)IC.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=LC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.result=J.unwrap(J.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.outcome=n.string();continue;case 6:if(e!==50)break;i.interrupts.push(cC.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(IC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return RC.fromPartial(e??{})},fromPartial(e){let t=LC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interrupts=e.interrupts?.map(e=>cC.fromPartial(e))||[],t.usage=e.usage?.map(e=>IC.fromPartial(e))||[],t}};function zC(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var BC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==``&&t.uint32(26).string(e.message);for(let n of e.usage)IC.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=zC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.code=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.usage.push(IC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return BC.fromPartial(e??{})},fromPartial(e){let t=zC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>IC.fromPartial(e))||[],t}};function VC(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var HC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=VC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return HC.fromPartial(e??{})},fromPartial(e){let t=VC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function UC(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var WC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=UC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return WC.fromPartial(e??{})},fromPartial(e){let t=UC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function GC(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0,subagentRunId:void 0}}var KC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=GC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue;case 5:if(e!==42)break;i.name=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return KC.fromPartial(e??{})},fromPartial(e){let t=GC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function qC(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0,subagentRunId:void 0}}var JC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=qC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.delta=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return JC.fromPartial(e??{})},fromPartial(e){let t=qC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function YC(){return{baseEvent:void 0,subagentRunId:``,name:``,description:void 0,parentSubagentRunId:void 0,parentToolCallId:void 0,parentMessageId:void 0}}var XC={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.name!==``&&t.uint32(26).string(e.name),e.description!==void 0&&t.uint32(34).string(e.description),e.parentSubagentRunId!==void 0&&t.uint32(42).string(e.parentSubagentRunId),e.parentToolCallId!==void 0&&t.uint32(50).string(e.parentToolCallId),e.parentMessageId!==void 0&&t.uint32(58).string(e.parentMessageId),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=YC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.name=n.string();continue;case 4:if(e!==34)break;i.description=n.string();continue;case 5:if(e!==42)break;i.parentSubagentRunId=n.string();continue;case 6:if(e!==50)break;i.parentToolCallId=n.string();continue;case 7:if(e!==58)break;i.parentMessageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return XC.fromPartial(e??{})},fromPartial(e){let t=YC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.name=e.name??``,t.description=e.description??void 0,t.parentSubagentRunId=e.parentSubagentRunId??void 0,t.parentToolCallId=e.parentToolCallId??void 0,t.parentMessageId=e.parentMessageId??void 0,t}};function ZC(){return{baseEvent:void 0,subagentRunId:``,result:void 0,outcome:``,interruptIds:[]}}var QC={encode(e,t=new gS){e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.result!==void 0&&J.encode(J.wrap(e.result),t.uint32(26).fork()).join(),e.outcome!==``&&t.uint32(34).string(e.outcome);for(let n of e.interruptIds)t.uint32(42).string(n);return t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=ZC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.result=J.unwrap(J.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.outcome=n.string();continue;case 5:if(e!==42)break;i.interruptIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return QC.fromPartial(e??{})},fromPartial(e){let t=ZC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interruptIds=e.interruptIds?.map(e=>e)||[],t}};function $C(){return{baseEvent:void 0,subagentRunId:``,message:``,code:void 0}}var ew={encode(e,t=new gS){return e.baseEvent!==void 0&&Y.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.message!==``&&t.uint32(26).string(e.message),e.code!==void 0&&t.uint32(34).string(e.code),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=$C();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Y.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.code=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ew.fromPartial(e??{})},fromPartial(e){let t=$C();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Y.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.message=e.message??``,t.code=e.code??void 0,t}};function tw(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0,subagentStarted:void 0,subagentFinished:void 0,subagentError:void 0}}var nw={encode(e,t=new gS){return e.textMessageStart!==void 0&&fC.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&mC.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&gC.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&vC.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&bC.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&SC.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&wC.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&EC.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&OC.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&AC.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&MC.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&PC.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&RC.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&BC.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&HC.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&WC.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&KC.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&JC.encode(e.toolCallChunk,t.uint32(146).fork()).join(),e.subagentStarted!==void 0&&XC.encode(e.subagentStarted,t.uint32(154).fork()).join(),e.subagentFinished!==void 0&&QC.encode(e.subagentFinished,t.uint32(162).fork()).join(),e.subagentError!==void 0&&ew.encode(e.subagentError,t.uint32(170).fork()).join(),t},decode(e,t){let n=e instanceof q?e:new q(e),r=t===void 0?n.len:n.pos+t,i=tw();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=fC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=mC.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=gC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=vC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=bC.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=SC.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=wC.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=EC.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=OC.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=AC.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=MC.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=PC.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=RC.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=BC.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=HC.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=WC.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=KC.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=JC.decode(n,n.uint32());continue;case 19:if(e!==154)break;i.subagentStarted=XC.decode(n,n.uint32());continue;case 20:if(e!==162)break;i.subagentFinished=QC.decode(n,n.uint32());continue;case 21:if(e!==170)break;i.subagentError=ew.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nw.fromPartial(e??{})},fromPartial(e){let t=tw();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?fC.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?mC.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?gC.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?vC.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?bC.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?SC.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?wC.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?EC.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?OC.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?AC.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?MC.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?PC.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?RC.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?BC.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?HC.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?WC.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?KC.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?JC.fromPartial(e.toolCallChunk):void 0,t.subagentStarted=e.subagentStarted!==void 0&&e.subagentStarted!==null?XC.fromPartial(e.subagentStarted):void 0,t.subagentFinished=e.subagentFinished!==void 0&&e.subagentFinished!==null?QC.fromPartial(e.subagentFinished):void 0,t.subagentError=e.subagentError!==void 0&&e.subagentError!==null?ew.fromPartial(e.subagentError):void 0,t}};function rw(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(te&&typeof e==`object`?e:void 0,aw=e=>{let t=iw(e);if(t){if(t.data){let e=t.data;return{type:`data`,value:e.value,mimeType:e.mimeType}}if(t.url){let e=t.url;return{type:`url`,value:e.value,mimeType:e.mimeType}}}},ow=e=>{let t=iw(e);if(t){if(t.text)return{type:`text`,text:t.text.text};if(t.image){let e=t.image;return{type:`image`,source:aw(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return{type:`audio`,source:aw(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return{type:`video`,source:aw(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return{type:`document`,source:aw(e.source),metadata:e.metadata}}}};function sw(e){let t=nw.decode(e),n=Object.values(t).find(e=>e!==void 0);if(!n)throw Error(`Invalid event`);if(n.type=lC[n.baseEvent.type],n.timestamp=n.baseEvent.timestamp,n.rawEvent=n.baseEvent.rawEvent,n.baseEvent.metadata!==void 0&&(n.metadata=n.baseEvent.metadata),delete n.baseEvent,n.type===G.MESSAGES_SNAPSHOT)for(let e of n.messages){let t=e;if(t.role===`user`&&Array.isArray(t.contentParts)){let e=t.contentParts.map(e=>ow(e)).filter(e=>e!==void 0);e.length>0&&(t.content=e)}Array.isArray(t.contentParts)&&t.contentParts.length===0&&(t.contentParts=void 0),t.toolCalls?.length===0&&(t.toolCalls=void 0)}if(n.type===G.RUN_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interrupts)?e.interrupts:[];delete e.interrupts,t===`interrupt`?e.outcome={type:`interrupt`,interrupts:r}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if(n.type===G.SUBAGENT_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interruptIds)?e.interruptIds:[];delete e.interruptIds,t===`suspended`?e.outcome={type:`suspended`,...r.length>0&&{interruptIds:r}}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if((n.type===G.RUN_FINISHED||n.type===G.RUN_ERROR)&&Array.isArray(n.usage)&&n.usage.length===0&&delete n.usage,n.type===G.STATE_DELTA)for(let e of n.delta)e.op=PS[e.op].toLowerCase(),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]});return Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),gy.parse(n)}var cw;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(cw||={});var lw;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(lw||={});var X=cw.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),uw=e=>{switch(typeof e){case`undefined`:return X.undefined;case`string`:return X.string;case`number`:return Number.isNaN(e)?X.nan:X.number;case`boolean`:return X.boolean;case`function`:return X.function;case`bigint`:return X.bigint;case`symbol`:return X.symbol;case`object`:return Array.isArray(e)?X.array:e===null?X.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?X.promise:typeof Map<`u`&&e instanceof Map?X.map:typeof Set<`u`&&e instanceof Set?X.set:typeof Date<`u`&&e instanceof Date?X.date:X.object;default:return X.unknown}},Z=cw.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),dw=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};dw.create=e=>new dw(e);var fw=(e,t)=>{let n;switch(e.code){case Z.invalid_type:n=e.received===X.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,cw.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${cw.joinValues(e.keys,`, `)}`;break;case Z.invalid_union:n=`Invalid input`;break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${cw.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${cw.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n=`Invalid function arguments`;break;case Z.invalid_return_type:n=`Invalid function return type`;break;case Z.invalid_date:n=`Invalid date`;break;case Z.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:cw.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case Z.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case Z.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case Z.custom:n=`Invalid input`;break;case Z.invalid_intersection_types:n=`Intersection results could not be merged`;break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,cw.assertNever(e)}return{message:n}},pw=fw;function mw(){return pw}var hw=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function Q(e,t){let n=mw(),r=hw({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===fw?void 0:fw].filter(e=>!!e)});e.common.issues.push(r)}var gw=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return _w;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return _w;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},_w=Object.freeze({status:`aborted`}),vw=e=>({status:`dirty`,value:e}),yw=e=>({status:`valid`,value:e}),bw=e=>e.status===`aborted`,xw=e=>e.status===`dirty`,Sw=e=>e.status===`valid`,Cw=e=>typeof Promise<`u`&&e instanceof Promise,$;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})($||={});var ww=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Tw=(e,t)=>{if(Sw(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new dw(e.common.issues);return this._error=t,this._error}}};function Ew(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Dw=class{get description(){return this._def.description}_getType(e){return uw(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:uw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new gw,ctx:{common:e.parent.common,data:e.data,parsedType:uw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Cw(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uw(e)};return Tw(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uw(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Sw(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Sw(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:uw(e)},r=this._parse({data:e,path:n.path,parent:n});return Tw(n,await(Cw(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:Z.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new AT({schema:this,typeName:zT.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return jT.create(this,this._def)}nullable(){return MT.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dT.create(this)}promise(){return kT.create(this,this._def)}or(e){return mT.create([this,e],this._def)}and(e){return vT.create(this,e,this._def)}transform(e){return new AT({...Ew(this._def),schema:this,typeName:zT.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new NT({...Ew(this._def),innerType:this,defaultValue:t,typeName:zT.ZodDefault})}brand(){return new IT({typeName:zT.ZodBranded,type:this,...Ew(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new PT({...Ew(this._def),innerType:this,catchValue:t,typeName:zT.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return LT.create(this,e)}readonly(){return RT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ow=/^c[^\s-]{8,}$/i,kw=/^[0-9a-z]+$/,Aw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Mw=/^[a-z0-9_-]{21}$/i,Nw=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Pw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Fw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Iw=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Lw,Rw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Bw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Vw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Uw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ww=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Gw=RegExp(`^${Ww}$`);function Kw(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function qw(e){return RegExp(`^${Kw(e)}$`)}function Jw(e){let t=`${Ww}T${Kw(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Yw(e,t){return!((t!==`v4`&&t||!Rw.test(e))&&(t!==`v6`&&t||!Bw.test(e)))}function Xw(e,t){if(!Nw.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Zw(e,t){return!((t!==`v4`&&t||!zw.test(e))&&(t!==`v6`&&t||!Vw.test(e)))}var Qw=class e extends Dw{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==X.string){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.string,received:t.parsedType}),_w}let t=new gw,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.lengthe.test(t),{validation:t,code:Z.invalid_string,...$.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...$.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...$.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...$.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...$.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...$.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...$.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...$.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...$.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...$.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...$.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...$.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...$.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...$.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...$.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...$.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...$.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...$.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...$.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...$.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...$.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...$.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...$.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...$.errToObj(t)})}nonempty(e){return this.min(1,$.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Qw({checks:[],typeName:zT.ZodString,coerce:e?.coerce??!1,...Ew(e)});function $w(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var eT=class e extends Dw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==X.number){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.number,received:t.parsedType}),_w}let t,n=new gw;for(let r of this._def.checks)r.kind===`int`?cw.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?$w(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_finite,message:r.message}),n.dirty()):cw.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,$.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,$.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,$.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,$.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:$.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:$.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:$.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:$.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:$.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:$.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuee.kind===`int`||e.kind===`multipleOf`&&cw.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew eT({checks:[],typeName:zT.ZodNumber,coerce:e?.coerce||!1,...Ew(e)});var tT=class e extends Dw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==X.bigint)return this._getInvalidInput(e);let t,n=new gw;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):cw.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.bigint,received:t.parsedType}),_w}gte(e,t){return this.setLimit(`min`,e,!0,$.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,$.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,$.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,$.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:$.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:$.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:$.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:$.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:$.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:$.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew tT({checks:[],typeName:zT.ZodBigInt,coerce:e?.coerce??!1,...Ew(e)});var nT=class extends Dw{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==X.boolean){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.boolean,received:t.parsedType}),_w}return yw(e.data)}};nT.create=e=>new nT({typeName:zT.ZodBoolean,coerce:e?.coerce||!1,...Ew(e)});var rT=class e extends Dw{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==X.date){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.date,received:t.parsedType}),_w}if(Number.isNaN(e.data.getTime()))return Q(this._getOrReturnCtx(e),{code:Z.invalid_date}),_w;let t=new gw,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):cw.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:$.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:$.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew rT({checks:[],coerce:e?.coerce||!1,typeName:zT.ZodDate,...Ew(e)});var iT=class extends Dw{_parse(e){if(this._getType(e)!==X.symbol){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.symbol,received:t.parsedType}),_w}return yw(e.data)}};iT.create=e=>new iT({typeName:zT.ZodSymbol,...Ew(e)});var aT=class extends Dw{_parse(e){if(this._getType(e)!==X.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.undefined,received:t.parsedType}),_w}return yw(e.data)}};aT.create=e=>new aT({typeName:zT.ZodUndefined,...Ew(e)});var oT=class extends Dw{_parse(e){if(this._getType(e)!==X.null){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.null,received:t.parsedType}),_w}return yw(e.data)}};oT.create=e=>new oT({typeName:zT.ZodNull,...Ew(e)});var sT=class extends Dw{constructor(){super(...arguments),this._any=!0}_parse(e){return yw(e.data)}};sT.create=e=>new sT({typeName:zT.ZodAny,...Ew(e)});var cT=class extends Dw{constructor(){super(...arguments),this._unknown=!0}_parse(e){return yw(e.data)}};cT.create=e=>new cT({typeName:zT.ZodUnknown,...Ew(e)});var lT=class extends Dw{_parse(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.never,received:t.parsedType}),_w}};lT.create=e=>new lT({typeName:zT.ZodNever,...Ew(e)});var uT=class extends Dw{_parse(e){if(this._getType(e)!==X.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.void,received:t.parsedType}),_w}return yw(e.data)}};uT.create=e=>new uT({typeName:zT.ZodVoid,...Ew(e)});var dT=class e extends Dw{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==X.array)return Q(t,{code:Z.invalid_type,expected:X.array,received:t.parsedType}),_w;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(Q(t,{code:Z.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new ww(t,e,t.path,n)))).then(e=>gw.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new ww(t,e,t.path,n)));return gw.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:$.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:$.toString(n)}})}nonempty(e){return this.min(1,e)}};dT.create=(e,t)=>new dT({type:e,minLength:null,maxLength:null,exactLength:null,typeName:zT.ZodArray,...Ew(t)});function fT(e){if(e instanceof pT){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=jT.create(fT(r))}return new pT({...e._def,shape:()=>t})}return e instanceof dT?new dT({...e._def,type:fT(e.element)}):e instanceof jT?jT.create(fT(e.unwrap())):e instanceof MT?MT.create(fT(e.unwrap())):e instanceof yT?yT.create(e.items.map(e=>fT(e))):e}var pT=class e extends Dw{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=cw.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==X.object){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.object,received:t.parsedType}),_w}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof lT&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new ww(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof lT){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(Q(n,{code:Z.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new ww(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>gw.mergeObjectSync(t,e)):gw.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return $.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:$.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:zT.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of cw.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of cw.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return fT(this)}partial(t){let n={};for(let e of cw.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of cw.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof jT;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return ET(cw.objectKeys(this.shape))}};pT.create=(e,t)=>new pT({shape:()=>e,unknownKeys:`strip`,catchall:lT.create(),typeName:zT.ZodObject,...Ew(t)}),pT.strictCreate=(e,t)=>new pT({shape:()=>e,unknownKeys:`strict`,catchall:lT.create(),typeName:zT.ZodObject,...Ew(t)}),pT.lazycreate=(e,t)=>new pT({shape:e,unknownKeys:`strip`,catchall:lT.create(),typeName:zT.ZodObject,...Ew(t)});var mT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new dw(e.ctx.common.issues));return Q(t,{code:Z.invalid_union,unionErrors:n}),_w}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new dw(e));return Q(t,{code:Z.invalid_union,unionErrors:i}),_w}}get options(){return this._def.options}};mT.create=(e,t)=>new mT({options:e,typeName:zT.ZodUnion,...Ew(t)});var hT=e=>e instanceof wT?hT(e.schema):e instanceof AT?hT(e.innerType()):e instanceof TT?[e.value]:e instanceof DT?e.options:e instanceof OT?cw.objectValues(e.enum):e instanceof NT?hT(e._def.innerType):e instanceof aT?[void 0]:e instanceof oT?[null]:e instanceof jT?[void 0,...hT(e.unwrap())]:e instanceof MT?[null,...hT(e.unwrap())]:e instanceof IT||e instanceof RT?hT(e.unwrap()):e instanceof PT?hT(e._def.innerType):[],gT=class e extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==X.object)return Q(t,{code:Z.invalid_type,expected:X.object,received:t.parsedType}),_w;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Q(t,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),_w)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=hT(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:zT.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Ew(r)})}};function _T(e,t){let n=uw(e),r=uw(t);if(e===t)return{valid:!0,data:e};if(n===X.object&&r===X.object){let n=cw.objectKeys(t),r=cw.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=_T(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===X.array&&r===X.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r{if(bw(e)||bw(r))return _w;let i=_T(e.value,r.value);return i.valid?((xw(e)||xw(r))&&t.dirty(),{status:t.value,value:i.data}):(Q(n,{code:Z.invalid_intersection_types}),_w)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};vT.create=(e,t,n)=>new vT({left:e,right:t,typeName:zT.ZodIntersection,...Ew(n)});var yT=class e extends Dw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.array)return Q(n,{code:Z.invalid_type,expected:X.array,received:n.parsedType}),_w;if(n.data.lengththis._def.items.length&&(Q(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new ww(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>gw.mergeArray(t,e)):gw.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};yT.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new yT({items:e,typeName:zT.ZodTuple,rest:null,...Ew(t)})};var bT=class e extends Dw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.object)return Q(n,{code:Z.invalid_type,expected:X.object,received:n.parsedType}),_w;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new ww(n,e,n.path,e)),value:a._parse(new ww(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?gw.mergeObjectAsync(t,r):gw.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Dw?new e({keyType:t,valueType:n,typeName:zT.ZodRecord,...Ew(r)}):new e({keyType:Qw.create(),valueType:t,typeName:zT.ZodRecord,...Ew(n)})}},xT=class extends Dw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.map)return Q(n,{code:Z.invalid_type,expected:X.map,received:n.parsedType}),_w;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new ww(n,e,n.path,[a,`key`])),value:i._parse(new ww(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return _w;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return _w;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};xT.create=(e,t,n)=>new xT({valueType:t,keyType:e,typeName:zT.ZodMap,...Ew(n)});var ST=class e extends Dw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.set)return Q(n,{code:Z.invalid_type,expected:X.set,received:n.parsedType}),_w;let r=this._def;r.minSize!==null&&n.data.sizer.maxSize.value&&(Q(n,{code:Z.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return _w;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new ww(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:$.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ST.create=(e,t)=>new ST({valueType:e,minSize:null,maxSize:null,typeName:zT.ZodSet,...Ew(t)});var CT=class e extends Dw{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==X.function)return Q(t,{code:Z.invalid_type,expected:X.function,received:t.parsedType}),_w;function n(e,n){return hw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,mw(),fw].filter(e=>!!e),issueData:{code:Z.invalid_arguments,argumentsError:n}})}function r(e,n){return hw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,mw(),fw].filter(e=>!!e),issueData:{code:Z.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof kT){let e=this;return yw(async function(...t){let o=new dw([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return yw(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new dw([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new dw([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:yT.create(t).rest(cT.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||yT.create([]).rest(cT.create()),returns:n||cT.create(),typeName:zT.ZodFunction,...Ew(r)})}},wT=class extends Dw{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};wT.create=(e,t)=>new wT({getter:e,typeName:zT.ZodLazy,...Ew(t)});var TT=class extends Dw{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Q(t,{received:t.data,code:Z.invalid_literal,expected:this._def.value}),_w}return{status:`valid`,value:e.data}}get value(){return this._def.value}};TT.create=(e,t)=>new TT({value:e,typeName:zT.ZodLiteral,...Ew(t)});function ET(e,t){return new DT({values:e,typeName:zT.ZodEnum,...Ew(t)})}var DT=class e extends Dw{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{expected:cw.joinValues(n),received:t.parsedType,code:Z.invalid_type}),_w}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{received:t.data,code:Z.invalid_enum_value,options:n}),_w}return yw(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};DT.create=ET;var OT=class extends Dw{_parse(e){let t=cw.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==X.string&&n.parsedType!==X.number){let e=cw.objectValues(t);return Q(n,{expected:cw.joinValues(e),received:n.parsedType,code:Z.invalid_type}),_w}if(this._cache||=new Set(cw.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=cw.objectValues(t);return Q(n,{received:n.data,code:Z.invalid_enum_value,options:e}),_w}return yw(e.data)}get enum(){return this._def.values}};OT.create=(e,t)=>new OT({values:e,typeName:zT.ZodNativeEnum,...Ew(t)});var kT=class extends Dw{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==X.promise&&t.common.async===!1?(Q(t,{code:Z.invalid_type,expected:X.promise,received:t.parsedType}),_w):yw((t.parsedType===X.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};kT.create=(e,t)=>new kT({type:e,typeName:zT.ZodPromise,...Ew(t)});var AT=class extends Dw{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===zT.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{Q(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return _w;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?_w:r.status===`dirty`||t.value===`dirty`?vw(r.value):r});{if(t.value===`aborted`)return _w;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?_w:r.status===`dirty`||t.value===`dirty`?vw(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?_w:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?_w:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Sw(e))return _w;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Sw(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):_w)}cw.assertNever(r)}};AT.create=(e,t,n)=>new AT({schema:e,typeName:zT.ZodEffects,effect:t,...Ew(n)}),AT.createWithPreprocess=(e,t,n)=>new AT({schema:t,effect:{type:`preprocess`,transform:e},typeName:zT.ZodEffects,...Ew(n)});var jT=class extends Dw{_parse(e){return this._getType(e)===X.undefined?yw(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};jT.create=(e,t)=>new jT({innerType:e,typeName:zT.ZodOptional,...Ew(t)});var MT=class extends Dw{_parse(e){return this._getType(e)===X.null?yw(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};MT.create=(e,t)=>new MT({innerType:e,typeName:zT.ZodNullable,...Ew(t)});var NT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===X.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};NT.create=(e,t)=>new NT({innerType:e,typeName:zT.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...Ew(t)});var PT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Cw(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new dw(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new dw(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};PT.create=(e,t)=>new PT({innerType:e,typeName:zT.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...Ew(t)});var FT=class extends Dw{_parse(e){if(this._getType(e)!==X.nan){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.nan,received:t.parsedType}),_w}return{status:`valid`,value:e.data}}};FT.create=e=>new FT({typeName:zT.ZodNaN,...Ew(e)});var IT=class extends Dw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},LT=class e extends Dw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?_w:e.status===`dirty`?(t.dirty(),vw(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?_w:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:zT.ZodPipeline})}},RT=class extends Dw{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Sw(e)&&(e.value=Object.freeze(e.value)),e);return Cw(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};RT.create=(e,t)=>new RT({innerType:e,typeName:zT.ZodReadonly,...Ew(t)}),pT.lazycreate;var zT;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(zT||={});var BT=Qw.create;eT.create,FT.create,tT.create;var VT=nT.create;rT.create,iT.create,aT.create,oT.create;var HT=sT.create;cT.create,lT.create,uT.create,dT.create;var UT=pT.create;pT.strictCreate,mT.create;var WT=gT.create;vT.create,yT.create,bT.create,xT.create,ST.create,CT.create,wT.create;var GT=TT.create,KT=DT.create;OT.create,kT.create,AT.create,jT.create,MT.create,AT.createWithPreprocess,LT.create;var qT=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,JT=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(qT);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},YT=e=>e===`*`||e===`x`||e===`X`,XT=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},ZT=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],QT=(e,t)=>{if(YT(e)||YT(t))return 0;let[n,r]=ZT(XT(e),XT(t));return n>r?1:n{for(let n=0;n{let n=JT(e),r=JT(t),i=n.pop(),a=r.pop(),o=$T(n,r);return o===0?i&&a?$T(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},tE=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function nE(){return rg()}function rE(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&rE(t);return e}var iE=524288;function aE(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;tn)return!0;i.push(e[o])}}}}return!1}async function oE(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!aE(t,n,iE),c=s?tE(t):t,l=s?tE(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(rE(c),rE(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=tE(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=tE(e.state),d=!0,n=!0),s&&n&&aE(c,l,iE)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(o&&e instanceof TypeError){if(a)throw e;console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e)}else a||console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?tE(c):c}:{},...d?{state:Object.isFrozen(l)?tE(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function sE(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,n=e.lifecycle??!0,r=e.verbose??!1;return{enabled:t||n,events:t,lifecycle:n,verbose:r}}function cE(e){if(e instanceof lE)return e;if(e===!0)return new lE(sE(!0))}var lE=class{constructor(e){this.config=e}event(e,t,n,r){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof n==`string`?n:JSON.stringify(n)):console.debug(`[${e}] ${t}`,r??n))}lifecycle(e,t,n){this.config.lifecycle&&(n?console.debug(`[${e}] ${t}`,n):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function uE(e){return e.enabled?new lE(e):void 0}function dE(e,t,n){if(t){let r=e.find(e=>e.id===t);if(r?.role===`assistant`)return r;r&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${r.role}' message, not assistant — falling back to toolCallId`);let i={id:r?n:t,role:`assistant`,toolCalls:[]};return e.push(i),i}let r={id:n,role:`assistant`,toolCalls:[]};return e.push(r),r}function fE(e,t){return!e||t.metadata===void 0?!1:(e.metadata=Y_(e.metadata,tE(t.metadata)),!0)}var pE=(e,t,n,r,i)=>{let a=cE(i),o=tE(n.messages),s=tE(e.state),c={},l=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},u=()=>{let e=tE(c);return c={},e.messages!==void 0||e.state!==void 0?Nx(e):ex};return t.pipe(Ux(async t=>{let i=await oE(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(l(i),i.stopPropagation===!0?a?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):a?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return u();switch(t.type){case G.TEXT_MESSAGE_START:{let i=await oE(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r,subagentRunId:i}=t,a=o.find(t=>t.id===e);if(a?.role===`activity`)return console.warn(`TEXT_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and text messages`),u();let s=a;if(!s){let t={id:e,role:n,content:``,...r!==void 0&&{name:r},...i!=null&&{subagentRunId:i}};o.push(t),s=t}let c=fE(s,t);(!a||c)&&l({messages:o})}return u()}case G.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),u();if(c.role===`activity`)return console.warn(`TEXT_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),u();let d=await oE(r,o,s,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof c.content==`string`?c.content:``}));return l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,fE(c,t),l({messages:o})),u()}case G.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),u();if(a.role===`activity`)return console.warn(`TEXT_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),u();let c=await oE(r,o,s,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}));return l(c),c.stopPropagation!==!0&&fE(a,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()}case G.TOOL_CALL_START:{let i=await oE(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t,a=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(a){let r=a.function.name!==n;return r&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${a.function.name}' — updating it to '${n}'`),a.function.name=n),(fE(a,t)||r)&&l({messages:o}),u()}let s=new Set(o.map(e=>e.id)),c=dE(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let d={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(d),fE(d,t),l({messages:o})}return u()}case G.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,c=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!c)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),u();let d=c.toolCalls?.find(e=>e.id===i);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),u();let f=await oE(r,o,s,(r,i,a)=>{let o=d.function.arguments,s=d.function.name,c={};try{c=Xx(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return l(f),f.stopPropagation!==!0&&(d.function.arguments+=a,fE(d,t),l({messages:o})),u()}case G.TOOL_CALL_END:{let{toolCallId:i}=t,a=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),u();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),u();let d=await oE(r,o,s,(r,i,a)=>{let o=c.function.arguments,s=c.function.name,l={};try{l=JSON.parse(o)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:s,toolCallArgs:l})});return l(d),d.stopPropagation!==!0&&fE(c,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),u()}case G.TOOL_CALL_RESULT:{let i=await oE(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:u,subagentRunId:d}=t,f={id:i,toolCallId:a,role:u||`tool`,content:c,...d!=null&&{subagentRunId:d}};fE(f,t);let p=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(p===-1)o.push(f);else{let e=p+1;for(;e{t.onNewMessage?.({message:f,messages:o,state:s,agent:n,input:e})})),l({messages:o})}return u()}case G.STATE_SNAPSHOT:{let i=await oE(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,l({state:s})}return u()}case G.STATE_DELTA:{let i=await oE(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=Qy.applyPatch(s,e,!0,!1).newDocument,l({state:s})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(s,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return u()}case G.MESSAGES_SNAPSHOT:{let i=await oE(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messages:e}=t,n=e.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}),r=new Map(n.map(e=>[e.id,e])),i=n.some(e=>e.role===`activity`),a=n.some(e=>e.role===`reasoning`),s=e=>e.role===`activity`&&!i||e.role===`reasoning`&&!a;o=o.filter(e=>s(e)||r.has(e.id)).map(e=>s(e)?e:r.get(e.id));let c=new Set(o.map(e=>e.id));for(let e of n)c.has(e.id)||o.push(e);l({messages:o})}return u()}case G.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,d=c?.role===`activity`?c:void 0,f=i.replace??!0,p=await oE(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d,existingMessage:c}));if(l(p),p.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:tE(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,u;a===-1?(o.push(t),c=t,u=t):d?(f&&(o[a]={...d,activityType:i.activityType,content:tE(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),u=o[a]):f&&(o[a]=t,c=t,u=t),fE(u,i),l({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return u()}case G.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return u();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),u();let d=c,f=await oE(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d}));if(l(f),f.stopPropagation!==!0)try{fE(d,i)&&l({messages:o});let e=tE(d.content??{}),t=Qy.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...d,content:tE(t),activityType:i.activityType},l({messages:o})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return u()}case G.RAW:return l(await oE(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.CUSTOM:return l(await oE(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.RUN_STARTED:{let i=await oE(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages){let e=t;if(t.subagentRunId===null){let n={...t};delete n.subagentRunId,e=n}o.find(t=>t.id===e.id)||o.push(e)}l({messages:o})}}return u()}case G.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:{event:i,outcome:`success`,result:i.result},c=await oE(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return l(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?a.interrupts.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}):[]),u()}case G.RUN_ERROR:return l(await oE(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.STEP_STARTED:return l(await oE(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.STEP_FINISHED:return l(await oE(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case G.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case G.THINKING_START:return u();case G.THINKING_END:return u();case G.THINKING_TEXT_MESSAGE_START:return u();case G.THINKING_TEXT_MESSAGE_CONTENT:return u();case G.THINKING_TEXT_MESSAGE_END:return u();case G.REASONING_START:return l(await oE(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.REASONING_MESSAGE_START:{let i=await oE(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e),i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=fE(i,t);(!r||a)&&l({messages:o})}return u()}case G.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),u();let d=await oE(r,o,s,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof c.content==`string`?c.content:``}));return l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,fE(c,t),l({messages:o})),u()}case G.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),u();let c=await oE(r,o,s,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}));return l(c),c.stopPropagation!==!0&&fE(a,t)&&l({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()}case G.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case G.REASONING_END:return l(await oE(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:d}=t,f=await oE(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(f),f.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of o)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=d,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=d,e=!0)}e&&(c.messages=o)}return u()}case G.SUBAGENT_STARTED:return l(await oE(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.SUBAGENT_FINISHED:return l(await oE(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case G.SUBAGENT_ERROR:return l(await oE(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u()}return t.type,u()}),zx(),r.length>0?Wx({}):e=>e)},mE=e=>t=>{let n=cE(e),r=new Set,i=new Set,a=new Set,o={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},s=!1,c=!1,l=!1,u=new Map,d=e=>{let t=u.get(e);return t||(t=new Map,u.set(e,t)),t},f=()=>{for(let e of u.values())if(e.size>0)return!0;return!1},p=new Map,m=new Set,h=!1,g=!1,_=!1,v=()=>{r.clear(),i.clear(),a.clear(),o.message.clear(),o.toolCall.clear(),o.activity.clear(),o.reasoning.clear(),u.clear(),p.clear(),m.clear(),h=!1,g=!1,s=!1,c=!1,_=!0},y=(e,t)=>{let n=e??[];if(Array.isArray(n))for(let e of n){if(!e||typeof e.id!=`string`)continue;if(e.subagentRunId===null)return new hv(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?o.reasoning:e.role===`activity`?o.activity:o.message;(t||!n.has(e.id))&&n.set(e.id,{subagentRunId:e.subagentRunId});for(let n of e.toolCalls??[])n&&typeof n.id==`string`&&(t||!o.toolCall.has(n.id))&&o.toolCall.set(n.id,{subagentRunId:e.subagentRunId??void 0})}},b=(e,t,n,r,i)=>{if(t!==void 0&&n&&n.subagentRunId!==t)return new hv(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(Rx(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),c&&t!==G.RUN_STARTED)return K(()=>new hv(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(s&&t!==G.RUN_ERROR&&t!==G.RUN_STARTED)return K(()=>new hv(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!l){if(l=!0,t!==G.RUN_STARTED&&t!==G.RUN_ERROR)return K(()=>new hv(`First event must be 'RUN_STARTED'`))}else if(t===G.RUN_STARTED){if(_&&!s&&!c)return K(()=>new hv(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(s||c)&&v()}if(e.subagentRunId===null)return K(()=>new hv(`Cannot send '${t}' with 'subagentRunId: null'. The field is optional — omit it entirely.`));if(t===G.SUBAGENT_STARTED||t===G.SUBAGENT_FINISHED||t===G.SUBAGENT_ERROR){let n=t===G.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===G.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return K(()=>new hv(`Cannot send '${t}' with '${r}: null'. The field is optional — omit it entirely.`));let r=e.outcome;if(r!=null&&r.type!==`success`&&r.type!==`suspended`)return K(()=>new hv(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return K(()=>new hv(`Cannot send '${t}' with 'outcome.interruptIds: null'. The field is optional — omit it entirely.`));if(r&&Array.isArray(r.interruptIds)&&r.interruptIds.some(e=>typeof e!=`string`))return K(()=>new hv(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===G.RUN_FINISHED){let t=e.outcome;if(t?.type===`interrupt`&&Array.isArray(t.interrupts)){for(let e of t.interrupts)if(e&&e.subagentRunId===null)return K(()=>new hv(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case G.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return K(()=>new hv(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${n}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`));let i=o.message.get(n);if(i){let r=b(t,e.subagentRunId,i,`message`,n);if(r)return K(()=>r)}return r.add(n),i||o.message.set(n,{subagentRunId:e.subagentRunId}),Nx(e)}case G.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return K(()=>new hv(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${n}'. Start a text message with 'TEXT_MESSAGE_START' first.`));let i=b(t,e.subagentRunId,o.message.get(n),`message`,n);return i?K(()=>i):Nx(e)}case G.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return K(()=>new hv(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${n}'. A 'TEXT_MESSAGE_START' event must be sent first.`));let i=b(t,e.subagentRunId,o.message.get(n),`message`,n);return i?K(()=>i):(r.delete(n),Nx(e))}case G.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return K(()=>new hv(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${n}' is already in progress. Complete it with 'TOOL_CALL_END' first.`));let r=e.parentMessageId,a=e.subagentRunId,s;if(r!==void 0){let e=o.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return K(()=>new hv(`Cannot send 'TOOL_CALL_START': subagentRunId '${a}' does not match its parent message '${r}' owner '${e.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`));s=e}}let c=o.toolCall.get(n);if(c){let e=b(t,a,c,`tool call`,n);if(e)return K(()=>e);if(a===void 0&&s&&s.subagentRunId!==c.subagentRunId)return K(()=>new hv(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${s.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||o.toolCall.set(n,a===void 0?s??{subagentRunId:void 0}:{subagentRunId:a}),Nx(e)}case G.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return K(()=>new hv(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${n}'. Start a tool call with 'TOOL_CALL_START' first.`));let r=b(t,e.subagentRunId,o.toolCall.get(n),`tool call`,n);return r?K(()=>r):Nx(e)}case G.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return K(()=>new hv(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${n}'. A 'TOOL_CALL_START' event must be sent first.`));let r=b(t,e.subagentRunId,o.toolCall.get(n),`tool call`,n);return r?K(()=>r):(i.delete(n),Nx(e))}case G.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return d(n).has(t)?K(()=>new hv(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(d(n).set(t,!0),Nx(e))}case G.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!d(n).has(t)){let e,r=!1;for(let[i,a]of u)if(i!==n&&a.has(t)){e=i,r=!0;break}return K(r?()=>new hv(`Cannot send 'STEP_FINISHED' for step "${t}" attributed to ${n===void 0?`the parent agent`:`subagent '${n}'`}: that step is open under ${e===void 0?`the parent agent`:`subagent '${e}'`}. A step must be finished by whoever started it.`):()=>new hv(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return d(n).delete(t),Nx(e)}case G.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!o.activity.has(t)||e.replace!==!1)&&o.activity.set(t,{subagentRunId:e.subagentRunId}),Nx(e)}case G.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&o.message.set(t,{subagentRunId:e.subagentRunId}),Nx(e)}case G.REASONING_START:case G.REASONING_MESSAGE_START:{let n=e.messageId,r=o.reasoning.get(n);if(r){let i=b(t,e.subagentRunId,r,`reasoning message`,n);if(i)return K(()=>i)}return a.add(n),r||o.reasoning.set(n,{subagentRunId:e.subagentRunId}),Nx(e)}case G.REASONING_MESSAGE_CONTENT:case G.REASONING_MESSAGE_END:case G.REASONING_END:{let n=e.messageId,r=b(t,e.subagentRunId,o.reasoning.get(n),`reasoning message`,n);return r?K(()=>r):(t===G.REASONING_END&&a.delete(n),Nx(e))}case G.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?o.toolCall.get(n):r===`message`?o.message.get(n)??o.reasoning.get(n):o.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,s=b(t,e.subagentRunId,i,a,n);return s?K(()=>s):Nx(e)}case G.ACTIVITY_DELTA:{let n=e.messageId,r=b(t,e.subagentRunId,o.activity.get(n),`activity`,n);return r?K(()=>r):Nx(e)}case G.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return K(()=>new hv(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return K(()=>new hv(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return p.has(t)?K(()=>new hv(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):m.has(t)?K(()=>new hv(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!p.has(n)&&!m.has(n)?K(()=>new hv(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(p.set(t,!0),Nx(e))}case G.SUBAGENT_FINISHED:case G.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return K(()=>new hv(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===G.SUBAGENT_ERROR&&typeof e.message!=`string`)return K(()=>new hv(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return p.has(n)?(p.delete(n),m.add(n),Nx(e)):K(()=>new hv(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case G.MESSAGES_SNAPSHOT:{let t=y(e.messages,!0);if(t)return K(()=>t)}return Nx(e);case G.RUN_STARTED:_=!0;{let t=y((e.input??{}).messages,!1);if(t)return K(()=>t)}return Nx(e);case G.RUN_FINISHED:if(f()){let e=[];for(let[t,n]of u)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(p.size>0){let e=Array.from(p.keys()).join(`, `);return K(()=>new hv(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return s=!0,Nx(e);case G.RUN_ERROR:return c=!0,Nx(e);case G.CUSTOM:return Nx(e);case G.THINKING_TEXT_MESSAGE_START:return h?g?K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.`)):(g=!0,Nx(e)):K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first.`));case G.THINKING_TEXT_MESSAGE_CONTENT:return g?Nx(e):K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first.`));case G.THINKING_TEXT_MESSAGE_END:return g?(g=!1,Nx(e)):K(()=>new hv(`Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first.`));case G.THINKING_START:return h?K(()=>new hv(`Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.`)):(h=!0,Nx(e));case G.THINKING_END:return h?(h=!1,Nx(e)):K(()=>new hv(`Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first.`));default:return Nx(e)}}))},hE=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),gE=e=>Bx(()=>Mx(e())).pipe(Kx(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return Mx(e.text()).pipe(Rx(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,K(()=>i)}))}let t={type:hE.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new Vb(e=>(e.next(t),(async()=>{try{for(;;){let{done:t,value:r}=await n.read();if(t)break;let i={type:hE.DATA,data:r};e.next(i)}e.complete()}catch(t){e.error(t)}})(),()=>{n.cancel().catch(e=>{if(e?.name!==`AbortError`)throw e})})):K(()=>Error(`Failed to getReader() from response`))})),_E=(e,t)=>{let n=cE(t),r=new Xb,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==hE.HEADERS&&e.type===hE.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e)}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(` `),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(` `),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},vE=e=>{let t=new Xb,n=new Uint8Array;e.subscribe({next:e=>{if(e.type!==hE.HEADERS&&e.type===hE.DATA&&e.data){let t=new Uint8Array(n.length+e.data.length);t.set(n,0),t.set(e.data,n.length),n=t,r()}},error:e=>t.error(e),complete:()=>{if(n.length>0)try{r()}catch{console.warn(`Incomplete or invalid protocol buffer data at stream end`)}t.complete()}});function r(){for(;n.length>=4;){let e=4+new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(n.length{let n=cE(t),r=new Xb,i=new $b,a=!1;return e.subscribe({next:e=>{if(i.next(e),e.type===hE.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?vE(i).subscribe({next:e=>r.next(e),error:e=>r.error(e),complete:()=>r.complete()}):_E(i,n).subscribe({next:e=>{try{let t=gy.parse(e);n?.event(`HTTP`,`Event validated:`,t,{type:t.type,valid:!0}),r.next(t)}catch(t){n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),r.error(t)}},error:e=>{if(e?.name===`AbortError`){r.next({type:G.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),r.complete();return}return r.error(e)},complete:()=>r.complete()})}else a||r.error(Error(`No headers event received before data events`))},error:e=>{i.error(e),r.error(e)},complete:()=>{i.complete()}}),r.asObservable()},bE=KT([`TextMessageStart`,`TextMessageContent`,`TextMessageEnd`,`ActionExecutionStart`,`ActionExecutionArgs`,`ActionExecutionEnd`,`ActionExecutionResult`,`AgentStateMessage`,`MetaEvent`,`RunStarted`,`RunFinished`,`RunError`,`NodeStarted`,`NodeFinished`]),xE=KT([`LangGraphInterruptEvent`,`PredictState`,`Exit`]);WT(`type`,[UT({type:GT(bE.enum.TextMessageStart),messageId:BT(),parentMessageId:BT().optional(),role:BT().optional()}),UT({type:GT(bE.enum.TextMessageContent),messageId:BT(),content:BT()}),UT({type:GT(bE.enum.TextMessageEnd),messageId:BT()}),UT({type:GT(bE.enum.ActionExecutionStart),actionExecutionId:BT(),actionName:BT(),parentMessageId:BT().optional()}),UT({type:GT(bE.enum.ActionExecutionArgs),actionExecutionId:BT(),args:BT()}),UT({type:GT(bE.enum.ActionExecutionEnd),actionExecutionId:BT()}),UT({type:GT(bE.enum.ActionExecutionResult),actionName:BT(),actionExecutionId:BT(),result:BT()}),UT({type:GT(bE.enum.AgentStateMessage),threadId:BT(),agentName:BT(),nodeName:BT(),runId:BT(),active:VT(),role:BT(),state:BT(),running:VT()}),UT({type:GT(bE.enum.MetaEvent),name:xE,value:HT()}),UT({type:GT(bE.enum.RunError),message:BT(),code:BT().optional()})]),UT({id:BT(),role:BT(),content:BT(),parentMessageId:BT().optional()}),UT({id:BT(),name:BT(),arguments:HT(),parentMessageId:BT().optional()}),UT({id:BT(),result:HT(),actionExecutionId:BT(),actionName:BT()});var SE=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(` -`)},CE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Rx(r=>{switch(r.type){case G.TEXT_MESSAGE_START:{let e=r;return[{type:bE.enum.TextMessageStart,messageId:e.messageId,role:e.role}]}case G.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:bE.enum.TextMessageContent,messageId:e.messageId,content:e.delta}]}case G.TEXT_MESSAGE_END:{let e=r;return[{type:bE.enum.TextMessageEnd,messageId:e.messageId}]}case G.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:bE.enum.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case G.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let p=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(Xx(d.function.arguments));e.tool_argument&&e.tool_argument in t?(f({...i,[e.state_key]:t[e.tool_argument]}),p=!0):e.tool_argument||(f({...i,[e.state_key]:t}),p=!0)}catch{}}return[{type:bE.enum.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...p?[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case G.TOOL_CALL_END:{let e=r;return[{type:bE.enum.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case G.TOOL_CALL_RESULT:{let e=r;return[{type:bE.enum.ActionExecutionResult,actionExecutionId:e.toolCallId,result:e.content,actionName:d[e.toolCallId]||`unknown`}]}case G.RAW:return[];case G.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:bE.enum.MetaEvent,name:e.name,value:e.value}]}case G.STATE_SNAPSHOT:return f(r.snapshot),[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case G.STATE_DELTA:{let c=r,l=Qy.applyPatch(i,c.delta,!0,!1);return l?(f(l.newDocument),[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]):[]}case G.MESSAGES_SNAPSHOT:return c=r.messages,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case G.RUN_STARTED:return[];case G.RUN_FINISHED:return c&&(i.messages=c),Object.keys(i).length===0?[]:[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:wE(c)}:{}}),active:!1}];case G.RUN_ERROR:{let e=r;return[{type:bE.enum.RunError,message:e.message,code:e.code}]}case G.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case G.STEP_FINISHED:return u=[],l=null,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function wE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=SE(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r={id:e.id,name:e.function.name,arguments:JSON.parse(e.function.arguments),parentMessageId:n.id};t.push(r)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:n.content,actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var TE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,EE=e=>e===`tool`?`toolCallId`:`messageId`,DE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},OE=e=>t=>{let n=cE(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:G.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:G.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:G.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&TE(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${EE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(Rx(e=>{switch(e.type){case G.TEXT_MESSAGE_START:case G.TEXT_MESSAGE_CONTENT:case G.TEXT_MESSAGE_END:case G.TOOL_CALL_START:case G.TOOL_CALL_ARGS:case G.TOOL_CALL_END:case G.TOOL_CALL_RESULT:case G.STATE_SNAPSHOT:case G.STATE_DELTA:case G.CUSTOM:case G.STEP_STARTED:case G.STEP_FINISHED:case G.THINKING_START:case G.THINKING_END:case G.THINKING_TEXT_MESSAGE_START:case G.THINKING_TEXT_MESSAGE_CONTENT:case G.THINKING_TEXT_MESSAGE_END:case G.REASONING_START:case G.REASONING_MESSAGE_START:case G.REASONING_MESSAGE_CONTENT:case G.REASONING_MESSAGE_END:case G.REASONING_END:return[...i(e.subagentRunId??void 0),e];case G.RUN_STARTED:case G.RUN_FINISHED:case G.RUN_ERROR:case G.MESSAGES_SNAPSHOT:return[...a(),e];case G.RAW:case G.ACTIVITY_SNAPSHOT:case G.ACTIVITY_DELTA:case G.REASONING_ENCRYPTED_VALUE:case G.SUBAGENT_STARTED:return[e];case G.SUBAGENT_FINISHED:case G.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case G.TEXT_MESSAGE_CHUNK:{let t=e,a=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),o=r.get(a),c=[],l;if(o?.kind===`text`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,name:t.name,subagentRunId:t.subagentRunId},r.set(a,{kind:`text`,fields:l});let e=DE({type:G.TEXT_MESSAGE_START,messageId:t.messageId,role:t.role||`assistant`,...t.name!==void 0&&{name:t.name},...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case G.TOOL_CALL_CHUNK:{let t=e,a=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),o=r.get(a),c=[],l;if(o?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===o.fields.toolCallId))l=o.fields;else{if(c.push(...i(a)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);l={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`tool`,fields:l});let e=DE({type:G.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:l.toolCallId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case G.REASONING_MESSAGE_CHUNK:{let t=e,a=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),o=r.get(a),c=[],l;if(o?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`reasoning`,fields:l});let e=DE({type:G.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}}return e.type,[]}),Gx(()=>{a()}))};function kE(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}var AE=class{runNext(e,t){return t.run(e).pipe(OE(!1))}runNextWithState(e,t){let n=tE(e.messages||[]),r=tE(e.state||{}),i=new $b;return pE(e,i,t,[]).subscribe(e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)}),this.runNext(e,t).pipe(Ux(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:tE(n),state:tE(r)})))}},jE=class extends AE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function ME(e){let t=e.content;if(Array.isArray(t)){let n=t.filter(e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``);return{...e,content:n}}return typeof t==`string`?e:{...e,content:``}}var NE=class extends AE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(ME)};return this.runNext(i,t)}},PE=`THINKING_START`,FE=`THINKING_END`,IE=`THINKING_TEXT_MESSAGE_START`,LE=`THINKING_TEXT_MESSAGE_CONTENT`,RE=`THINKING_TEXT_MESSAGE_END`,zE=class extends AE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(Ix(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case PE:{this.currentReasoningId=nE();let{title:t,...n}=e;return this.warnAboutTransformation(PE,G.REASONING_START),{...n,type:G.REASONING_START,messageId:this.currentReasoningId}}case IE:return this.currentMessageId=nE(),this.warnAboutTransformation(IE,G.REASONING_MESSAGE_START),{...e,type:G.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`assistant`};case LE:{let{delta:t,...n}=e;return this.warnAboutTransformation(LE,G.REASONING_MESSAGE_CONTENT),{...n,type:G.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??nE(),delta:t}}case RE:{let t=this.currentMessageId??nE();return this.warnAboutTransformation(RE,G.REASONING_MESSAGE_END),{...e,type:G.REASONING_MESSAGE_END,messageId:t}}case FE:{let t=this.currentReasoningId??nE();return this.warnAboutTransformation(FE,G.REASONING_END),{...e,type:G.REASONING_END,messageId:t}}default:return e}}};function BE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function VE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function HE(e){let t=BE(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e}function UE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>VE(e)?HE(e):e);return{...e,content:n}}var WE=class extends AE{run(e,t){let n={...e,messages:e.messages.map(UE)};return this.runNext(n,t)}},GE=`SUBAGENT_STARTED`,KE=`SUBAGENT_FINISHED`,qE=`SUBAGENT_ERROR`;function JE(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function YE(e){return e.map(e=>JE(e))}var XE=class extends AE{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>JE(e))};return this.runNext(n,t).pipe(Jx(e=>{let t=e.type;(t===GE||t===KE||t===qE)&&this.warnDroppedLifecycleEvent(t)}),Vx(e=>{let t=e.type;return t!==GE&&t!==KE&&t!==qE}),Ix(e=>{let t=JE(e);if(t.type===G.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:YE(e.messages)}}if(t.type===G.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>JE(e))}}}if(t.type===G.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:YE(e.input.messages)}}}return t}))}},ZE=`0.0.59`,QE=class{get maxVersion(){return ZE}get debug(){return this._debug}set debug(e){this._debug=sE(e),this._debugLogger=uE(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?uE(sE(!0)):void 0:e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??``,this.threadId=n??rg(),this.messages=tE(r??[]),this.state=tE(i??{}),this._debug=sE(a),this._debugLogger=uE(this._debug),eE(this.maxVersion,`0.0.39`)<=0&&this.middlewares.unshift(new NE),eE(this.maxVersion,`0.0.45`)<=0&&this.middlewares.unshift(new zE),eE(this.maxVersion,`0.0.47`)<=0&&this.middlewares.unshift(new WE),eE(this.maxVersion,`0.0.57`)<=0&&this.middlewares.unshift(new XE)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new jE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??rg();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Fx(zb(()=>this.middlewares.length===0?this.run(n):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),OE(this.debugLogger),mE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),Gx(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)));let s=tE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new gv}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??rg();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Fx(zb(()=>Bx(()=>this.connect(n)),OE(this.debugLogger),mE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.isRunning=!1,e instanceof gv?ex:this.onError(n,e,a))),Gx(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)),{defaultValue:void 0});let s=tE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return pE(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Jx(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=tE(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||rg(),tools:tE(e?.tools??[]),context:tE(e?.context??[]),forwardedProps:tE(e?.forwardedProps??{}),state:tE(this.state),messages:n,...e?.resume===void 0?{}:{resume:tE(e.resume)}}}async onInitialize(e,t){if(this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new hv(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let e of this.pendingInterrupts)if(kE(e))throw new hv(`Interrupt ${e.id} expired at ${e.expiresAt}`)}let n=await oE(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return Mx(oE(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Ix(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await oE(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=tE(this.messages),e.state=tE(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=tE(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=tE(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=tE(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??rg();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t)).pipe(OE(this.debugLogger),mE(this.debugLogger),CE(this.threadId,t.runId,this.agentId),e=>e.pipe(Ix(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function $E(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var eD=class extends QE{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify($E(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=tE(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return yE(gE(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=tE(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},tD=L.createContext(void 0),nD=e=>{let t=L.useContext(tD);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},rD=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(tD.Provider,{value:e,children:t})),iD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},aD=new class{#e=iD;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function oD(e){setTimeout(e,0)}var sD=typeof window>`u`||`Deno`in globalThis;function cD(){}function lD(e,t){return typeof e==`function`?e(t):e}function uD(e){return typeof e==`number`&&e>=0&&e!==1/0}function dD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fD(e,t){return typeof e==`function`?e(t):e}function pD(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==hD(o,t.options))return!1}else if(!_D(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function mD(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(gD(t.options.mutationKey)!==gD(a))return!1}else if(!_D(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function hD(e,t){return(t?.queryKeyHashFn||gD)(e)}function gD(e){return JSON.stringify(e,(e,t)=>SD(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function _D(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n500)return t;let r=xD(e)&&xD(t);if(!r&&!(SD(e)&&SD(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{aD.setTimeout(t,e)})}function TD(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:yD(e,t)}function ED(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function DD(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var OD=Symbol();function kD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===OD?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function AD(e,t){return typeof e==`function`?e(...t):!!e}function jD(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var MD=()=>sD,ND=()=>MD(),PD=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},FD=new class extends PD{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ID=oD;function LD(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ID,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var RD=LD(),zD=new class extends PD{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function BD(e){return Math.min(1e3*2**e,3e4)}function VD(e){return(e??`online`)!==`online`||zD.isOnline()}var HD=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function UD(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(cD);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new HD(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>FD.isFocused()&&(e.networkMode===`always`||zD.isOnline())&&e.canRun(),p=()=>VD(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ND()?0:3),a=e.retryDelay??BD,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nf()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var WD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uD(this.gcTime)&&(this.#e=aD.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ND()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(aD.clearTimeout(this.#e),this.#e=void 0)}};function GD(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{jD(e,()=>t.signal,()=>n=!0)},u=kD(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?DD:ED;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?qD:KD,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:KD(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function KD(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function qD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function JD(e,t){return t?KD(e,t)!=null:!1}function YD(e,t){return!t||!e.getPreviousPageParam?!1:qD(e,t)!=null}var XD=class extends WD{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=$D(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=$D(this.options);e.data!==void 0&&(this.setState(QD(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=TD(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(cD).catch(cD):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>fD(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===OD||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>fD(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!dD(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=kD(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?GD(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=UD({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof HD&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof HD){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ZD(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...QD(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),RD.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ZD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:VD(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function QD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function $D(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var eO=class extends PD{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),nO(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rO(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rO(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof fD(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!bD(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&iO(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||fD(this.options.enabled,this.#t)!==fD(t.enabled,this.#t)||fD(this.options.staleTime,this.#t)!==fD(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||fD(this.options.enabled,this.#t)!==fD(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return bD(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(cD)),t}#h(e){return!ND()&&fD(this.options.enabled,this.#t)!==!1&&uD(e)}#g(){this.#b();let e=fD(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=dD(this.#r.dataUpdatedAt,e)+1;this.#u=aD.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=aD.setInterval(()=>{(this.options.refetchIntervalInBackground||FD.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(aD.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(aD.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&nO(e,t),o=i&&iO(e,n,t,r);(a||o)&&(l={...l,...ZD(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=TD(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=TD(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:aO(e,t),refetch:this.refetch,isEnabled:fD(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),bD(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();RD.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function tO(e,t){return fD(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||fD(t.retryOnMount,e)!==!1)}function nO(e,t){return tO(e,t)||e.state.data!==void 0&&rO(e,t,t.refetchOnMount)}function rO(e,t,n){if(fD(t.enabled,e)!==!1&&fD(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&aO(e,t)}return!1}function iO(e,t,n,r){return(e!==t||fD(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&aO(e,n)}function aO(e,t){return fD(t.enabled,e)!==!1&&e.isStaleByTime(fD(t.staleTime,e))}var oO=class extends eO{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:JD(t,n.data),hasPreviousPage:YD(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},sO=class extends WD{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||cO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=UD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),RD.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function cO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var lO=class extends PD{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new sO({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=uO(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){RD.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>mD(t,e))}findAll(e={}){return this.getAll().filter(t=>mD(e,t))}notify(e){RD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return RD.batch(()=>Promise.all(e.map(e=>e.continue().catch(cD))))}};function uO(e){return e.options.scope?.id}var dO=class extends PD{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??hD(r,t),a=this.get(i);return a||(a=new XD({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){RD.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>pD(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>pD(e,t)):t}notify(e){RD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){RD.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){RD.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fO=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new dO,this.#t=e.mutationCache||new lO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=FD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=zD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fD(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=lD(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return RD.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;RD.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return RD.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=RD.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(cD).catch(cD)}invalidateQueries(e,t={}){return RD.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=RD.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(cD)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(cD)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(fD(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(fD(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cD).catch(cD)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cD).catch(cD)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return zD.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(gD(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{_D(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(gD(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{_D(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=hD(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===OD&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},pO=L.createContext(!1),mO=()=>L.useContext(pO);pO.Provider;function hO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gO=L.createContext(hO()),_O=()=>L.useContext(gO),vO=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?AD(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},yO=e=>{L.useEffect(()=>{e.clearReset()},[e])},bO=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||AD(n,[e.error,r])),xO=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},SO=(e,t)=>e?.suspense&&t.isPending,CO=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wO(e,t,n){let r=mO(),i=_O(),a=nD(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,xO(o),vO(o,i,s),yO(i);let[l]=L.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(L.useSyncExternalStore(L.useCallback(e=>{let t=d?l.subscribe(RD.batchCalls(e)):cD;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),L.useEffect(()=>{l.setOptions(o)},[o,l]),SO(o,u))throw CO(o,l,i);if(bO({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function TO(e,t){return wO(e,eO,t)}function EO(e,t){return wO(e,oO,t)}var DO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),OO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),kO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),AO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z`}))]]),jO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm84,108a83.64,83.64,0,0,1-4.47,27L167,130a19.65,19.65,0,0,0-7.8-2.78l-22.82-3.08A20.14,20.14,0,0,0,117.72,132h-4.07l-2.71-5.6a19.88,19.88,0,0,0-13.8-10.84L94.46,115l4-7h14.39a20,20,0,0,0,9.66-2.49l12.25-6.76a20.57,20.57,0,0,0,3.74-2.68l26.92-24.33A20,20,0,0,0,172,56.49,84,84,0,0,1,212,128ZM140.76,45l6.2,11.1L122.75,78l-10.93,6H96.14A20.05,20.05,0,0,0,78.78,94.06l-4.49,7.85L67.68,84.28l9.91-23.42A83.91,83.91,0,0,1,140.76,45ZM44,128a83.52,83.52,0,0,1,4.4-26.77l7.74,20.65a19.89,19.89,0,0,0,14.52,12.53l19.53,4.2,3,6.1a20.11,20.11,0,0,0,13.55,10.77l-5,11.12a20,20,0,0,0,3.58,21.71l.21.22,18.16,18.7-.89,4.59A84.09,84.09,0,0,1,44,128Zm103.65,81.66a20.11,20.11,0,0,0-5-17.3l-.21-.22-17.72-18.25,11.37-25.52,19,2.56,41.43,25.48A84.2,84.2,0,0,1,147.65,209.66Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M213.09,172.48a96,96,0,0,1-80.41,51.41l3.17-16.44a8,8,0,0,0-2-6.95l-19.74-20.33a8,8,0,0,1-1.44-8.69l13.7-30.74a8,8,0,0,1,8.38-4.67l22.82,3.08a8.11,8.11,0,0,1,3.12,1.11ZM116.71,95,129,88.24a7.46,7.46,0,0,0,1.5-1.07l26.91-24.33A8,8,0,0,0,159,53l-10.5-18.81A96.62,96.62,0,0,0,128,32,95.61,95.61,0,0,0,67.78,53.23L56,81.08A8,8,0,0,0,55.88,87l11.5,30.67a8,8,0,0,0,5.81,5l2.69.58L89.2,100a8,8,0,0,1,6.94-4h16.71A7.9,7.9,0,0,0,116.71,95Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm90,102a89.55,89.55,0,0,1-7.46,35.86l-46.69-28.71a13.94,13.94,0,0,0-5.46-2l-22.82-3.07A14.06,14.06,0,0,0,121.06,138h-9.92a2,2,0,0,1-1.8-1.13l-3.8-7.86a13.94,13.94,0,0,0-9.66-7.59l-10.71-2.3L94.4,103a2,2,0,0,1,1.74-1h16.71a13.9,13.9,0,0,0,6.76-1.75l12.25-6.75a14.73,14.73,0,0,0,2.62-1.88l26.91-24.33a13.93,13.93,0,0,0,2.83-17.21L161,44.25A90.16,90.16,0,0,1,218,128ZM144.6,39.54l9.15,16.39a2,2,0,0,1-.41,2.46L126.43,82.72a1.84,1.84,0,0,1-.37.27l-12.25,6.76a2,2,0,0,1-1,.25H96.14A14,14,0,0,0,84,97L73.18,115.91a2,2,0,0,1-.19-.35L61.5,84.89a2,2,0,0,1,0-1.48L72.68,57.06A89.9,89.9,0,0,1,144.6,39.54ZM38,128A89.52,89.52,0,0,1,49.38,84.23a13.85,13.85,0,0,0,.89,4.87l11.49,30.67a13.94,13.94,0,0,0,10.16,8.78l21.44,4.6a2,2,0,0,1,1.38,1.09l3.8,7.86a14.07,14.07,0,0,0,12.6,7.9h4.56l-8.49,19a14,14,0,0,0,2.51,15.2l.1.11,19.68,20.26a2,2,0,0,1,.46,1.7L127.7,218A90.1,90.1,0,0,1,38,128Zm102.08,89.19,1.67-8.6a14.07,14.07,0,0,0-3.47-12.16l-.1-.11L118.5,176.06a2,2,0,0,1-.33-2.14l13.7-30.73A2,2,0,0,1,134,142l22.82,3.08a2,2,0,0,1,.78.27L205,174.55A90.18,90.18,0,0,1,140.08,217.19Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm92,100a91.44,91.44,0,0,1-8.58,38.76L162.8,136.85a12.07,12.07,0,0,0-4.68-1.67l-22.82-3.07a12,12,0,0,0-12.56,7l-.4.88h-11.2a4,4,0,0,1-3.6-2.26l-3.8-7.86a11.93,11.93,0,0,0-8.28-6.5L82.07,120.5,92.67,102a4,4,0,0,1,3.47-2h16.71a12,12,0,0,0,5.8-1.5l12.24-6.76a11.79,11.79,0,0,0,2.25-1.6L160.05,65.8a12,12,0,0,0,2.43-14.75l-5.86-10.49A92.17,92.17,0,0,1,220,128ZM145.89,37.75l9.6,17.2a4,4,0,0,1-.81,4.92L127.77,84.21a4.41,4.41,0,0,1-.75.53L114.78,91.5a4,4,0,0,1-1.93.5H96.14a12,12,0,0,0-10.41,6l-11.86,20.7a4,4,0,0,1-2.75-2.47L59.63,85.6a4,4,0,0,1,.06-3L71,55.81A91.51,91.51,0,0,1,128,36,92.53,92.53,0,0,1,145.89,37.75ZM36,128A91.52,91.52,0,0,1,56,70.77l-3.71,8.75a12,12,0,0,0-.18,8.88l11.49,30.67a11.93,11.93,0,0,0,8.72,7.52l21.43,4.61a4,4,0,0,1,2.76,2.17l3.8,7.86a12.07,12.07,0,0,0,10.8,6.77h7.64L109,169.85A12,12,0,0,0,111.26,183l19.68,20.26a4,4,0,0,1,1,3.47L129.36,220,128,220A92.1,92.1,0,0,1,36,128Zm101.6,91.5,2.18-11.29a12.08,12.08,0,0,0-3-10.49l-19.68-20.26a4,4,0,0,1-.71-4.35l13.7-30.74a4,4,0,0,1,4.18-2.33l22.82,3.07a4.12,4.12,0,0,1,1.56.56l49.11,30.2A92.12,92.12,0,0,1,137.6,219.5Z`}))]]),MO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),NO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),PO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),FO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),IO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),LO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),RO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),zO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),BO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),VO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:DO}));VO.displayName=`ArrowLeftIcon`;var HO=VO,UO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:OO}));UO.displayName=`ArrowRightIcon`;var WO=UO,GO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:kO}));GO.displayName=`DotsThreeIcon`;var KO=GO,qO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:AO}));qO.displayName=`GithubLogoIcon`;var JO=qO,YO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:jO}));YO.displayName=`GlobeHemisphereWestIcon`;var XO=YO,ZO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:MO}));ZO.displayName=`MagnifyingGlassIcon`;var QO=ZO,$O=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:NO}));$O.displayName=`MoonIcon`;var ek=$O,tk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:PO}));tk.displayName=`PencilSimpleIcon`;var nk=tk,rk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:FO}));rk.displayName=`PlusIcon`;var ik=rk,ak=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:IO}));ak.displayName=`SignOutIcon`;var ok=ak,sk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:LO}));sk.displayName=`SparkleIcon`;var ck=sk,lk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:RO}));lk.displayName=`SunIcon`;var uk=lk,dk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:zO}));dk.displayName=`TrashIcon`;var fk=dk,pk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:BO}));pk.displayName=`UserPlusIcon`;var mk=pk,hk=`fanout.access-token`,gk=`fanout:unauthorized`;function _k(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`?``:`${t.pathname}${t.search}`}function vk(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function yk(){localStorage.removeItem(hk)}function bk(){yk(),window.dispatchEvent(new Event(gk))}async function xk(e,t={}){let n=new Headers(t.headers);n.set(`Fanout-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&bk(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw Error(e.message??e.error??`You do not have permission to perform this action.`)}return r}async function Sk(){let e=await xk(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&bk(),window.location.assign(`/`)}var Ck=(0,L.createContext)(null);function wk(){let e=(0,L.useContext)(Ck);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var Tk=(0,L.createContext)(null);function Ek(){let e=(0,L.useContext)(Tk);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function Dk(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``?null:{id:t.id,email:typeof t.email==`string`?t.email:``,name:typeof t.name==`string`?t.name:``,role:typeof t.role==`string`?t.role:``}}async function Ok(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??r.error??`Request failed (${n.status})`);return r}function kk({children:e,wide:t=!1}){return(0,R.jsx)(we,{mih:`100dvh`,style:{background:`radial-gradient(circle at 50% -12%, var(--mantine-color-brand-light), transparent 38%), linear-gradient(180deg, var(--mantine-color-default-hover), var(--mantine-color-body) 62%)`},children:(0,R.jsx)(oe,{mih:`100dvh`,px:`md`,py:48,children:(0,R.jsx)(D,{size:t?680:480,w:`100%`,children:(0,R.jsx)(Ee,{radius:28,p:{base:24,sm:40},style:{background:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-default-border)`,boxShadow:`var(--mantine-shadow-xl)`},children:e})})})})}function Ak(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function jk(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function Mk({children:e}){let t=bi(),[n,r]=(0,L.useState)(null),[i,a]=(0,L.useState)(!1),[o,s]=(0,L.useState)(`none`),[c,l]=(0,L.useState)(null),[u,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(``),[g,_]=(0,L.useState)(Ak),[v,y]=(0,L.useState)(jk),[b,x]=(0,L.useState)(``),[S,w]=(0,L.useState)(!1),[T,E]=(0,L.useState)(0),[D,k]=(0,L.useState)(()=>Date.now()),[A,j]=(0,L.useState)(!1),[M,N]=(0,L.useState)(``),[ne,ie]=(0,L.useState)(null),[P,ae]=(0,L.useState)(!1),se=(0,L.useRef)(null),ce=_k(),le=o===`user`;async function ue(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){s(`none`),l(null);return}let t=await e.json().catch(()=>null);s(vk(t)),l(Dk(t))}async function fe(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;l(Dk(await e.json().catch(()=>null)))}catch{}}(0,L.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),t({href:e.pathname+e.search+e.hash,replace:!0}))},[t]),(0,L.useEffect)(()=>{yk(),Ok(`/api/auth/status`).then(r).catch(e=>N(String(e))).finally(()=>a(!0)),ue().catch(()=>s(`none`)).finally(()=>d(!0));let e=()=>{s(`none`),l(null)};return window.addEventListener(gk,e),()=>window.removeEventListener(gk,e)},[]),(0,L.useEffect)(()=>{u&&o===`none`&&v&&(j(!0),N(``),Ok(`/api/auth/login-link`,{token:v}).then(()=>{s(`user`),fe()}).catch(e=>N(e instanceof Error?e.message:String(e))).finally(()=>{y(``),j(!1)}))},[v,u,o]),(0,L.useEffect)(()=>{le&&u&&ce&&window.location.replace(ce)},[le,ce,u]),(0,L.useEffect)(()=>{if(T<=Date.now())return;let e=setInterval(()=>{k(Date.now()),Date.now()>=T&&clearInterval(e)},1e3);return()=>clearInterval(e)},[T]);let pe=Math.max(0,Math.ceil((T-D)/1e3));(0,L.useEffect)(()=>{S&&!A&&M&&se.current?.querySelector(`input`)?.focus()},[A,S,M]);async function me(e){try{await navigator.clipboard.writeText(e),ae(!0)}catch{N(`Clipboard access failed. Select and copy the token manually.`)}}if(ne?.ingest_token)return(0,R.jsx)(kk,{wide:!0,children:(0,R.jsxs)(F,{gap:`lg`,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,R.jsx)(de,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,R.jsx)(O,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,R.jsx)(am,{block:!0,children:ne.suggested_endpoint??`${window.location.hostname}:4317`})]}),(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`Header`}),(0,R.jsxs)(am,{block:!0,children:[ne.ingest_header_name??`Authorization`,`: Bearer `,ne.ingest_token]})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),(0,R.jsxs)(te,{grow:!0,align:`stretch`,children:[(0,R.jsx)(xe,{variant:`light`,radius:`md`,leftSection:P?(0,R.jsx)(re,{size:16,weight:`bold`}):(0,R.jsx)(ge,{size:16}),onClick:()=>void me(`${ne.ingest_header_name??`Authorization`}: Bearer ${ne.ingest_token}`),children:P?`Copied`:`Copy header`}),(0,R.jsx)(xe,{radius:`md`,rightSection:(0,R.jsx)(WO,{size:16,weight:`bold`}),onClick:()=>{s(`user`),ie(null),fe()},children:`Continue to Fanout`})]}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,onClick:()=>void me(ne.ingest_token??``),children:`Copy token only`})]})});if(!u||!i||v)return(0,R.jsx)(oe,{mih:`100dvh`,children:(0,R.jsx)(C,{size:`sm`})});if(!n)return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:`lg`,children:[(0,R.jsx)(ye,{}),(0,R.jsx)(de,{order:1,children:`Fanout is unavailable`}),(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M||`Authentication status could not be loaded.`})]})});if(le&&ce)return null;if(le)return(0,R.jsx)(Ck.Provider,{value:n,children:(0,R.jsx)(Tk.Provider,{value:c??{id:``,email:f,name:m,role:``},children:e})});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=ce?`/api/auth/oidc/start?return_to=${encodeURIComponent(ce)}`:`/api/auth/oidc/start`;return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:28,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(F,{gap:10,children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,R.jsx)(de,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,R.jsx)(O,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),(0,R.jsx)(xe,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function he(){j(!0),N(``);try{await Ok(`/api/auth/start`,{email:f}),w(!0),x(``),E(Date.now()+3e4),k(Date.now())}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}}async function _e(e){j(!0),N(``);try{await Ok(`/api/auth/verify`,{email:f,code:e}),s(`user`),w(!1),x(``),E(0),fe()}catch(e){x(``),N(e instanceof Error?e.message:String(e))}finally{j(!1)}}function ve(){w(!1),x(``),N(``)}async function be(e){e.preventDefault(),j(!0),N(``);try{if(n?.setup_required){let e=await Ok(`/api/auth/setup`,{email:f,name:m,setup_token:g});e.ingest_token?ie(e):(s(`user`),fe())}else if(S){await _e(b);return}else{await he();return}}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}}let I=S&&!n?.setup_required,Se=n?.setup_required?`Create the first admin`:I?`Check your email`:n?.self_signup?`Sign in or create an account`:`Sign in`,Ce=n?.setup_required?`Use the one-time token printed by the Fanout process.`:n?.smtp_configured?I?`We sent a code to ${f}.`:n?.self_signup?`Enter your email to sign in or create a viewer account. No password needed.`:`Enter your email and we’ll send a short verification code. No password needed.`:`Email delivery is not configured. Ask the operator to run fanout login-link with your email address.`;return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:28,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(F,{gap:10,children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:n?.setup_required?`One-time setup`:`Secure workspace`}),(0,R.jsx)(de,{order:1,fz:{base:28,sm:32},lh:1.08,children:Se}),Ce&&(0,R.jsx)(O,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:Ce})]}),(0,R.jsx)(`form`,{onSubmit:be,children:(0,R.jsxs)(F,{gap:`md`,children:[(0,R.jsx)(Xh,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:f,onChange:e=>p(e.currentTarget.value),disabled:S,variant:`filled`,radius:`md`,size:`md`,autoFocus:!S}),n?.setup_required&&(0,R.jsx)(Xh,{label:`Name`,placeholder:`Your name`,value:m,onChange:e=>h(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),n?.setup_required&&(0,R.jsx)(Xh,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:g,onChange:e=>_(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),I&&(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`Verification code`}),(0,R.jsx)(we,{ref:se,children:(0,R.jsx)(Fh,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:b,onChange:x,onComplete:e=>void _e(e),disabled:A,error:!!M,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,R.jsxs)(te,{justify:`space-between`,gap:`xs`,children:[(0,R.jsxs)(O,{c:`dimmed`,size:`xs`,children:[`Sent to `,f]}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,leftSection:(0,R.jsx)(HO,{size:12,weight:`bold`}),onClick:ve,disabled:A,children:`Change email`})]}),(0,R.jsxs)(te,{justify:`space-between`,gap:`xs`,children:[(0,R.jsx)(O,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,onClick:()=>void he(),disabled:A||pe>0,children:pe>0?`Resend in ${pe}s`:`Resend code`})]})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),I?(0,R.jsx)(xe,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:A||b.length<6,rightSection:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:`Verify code`}):(0,R.jsx)(xe,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:!n||!n.setup_required&&!n.smtp_configured,leftSection:n?.setup_required?(0,R.jsx)(mk,{size:17,weight:`bold`}):void 0,rightSection:n?.setup_required?void 0:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:n?.setup_required?`Create admin`:`Send code`})]})})]})})}var Nk=[`dashboards`],Pk=[`agent-threads`];async function Fk(e){let t=await xk(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var Ik=(0,L.createContext)(null);function Lk(){let e=(0,L.useContext)(Ik);if(!e)throw Error(`Fanout app context is unavailable`);return e}var Rk=`Create a new dashboard for me. First ask what I want to monitor, then design it when you have enough context.`,zk={observability_overview:`Checking system health…`,service_topology:`Mapping service dependencies…`,service_performance:`Reading performance signals…`,trace_detail:`Inspecting a trace…`,search_logs:`Searching logs…`,intelligence_snapshot:`Reviewing detected anomalies…`};function Bk(e){return zk[e]??`Working on it…`}var Vk=[];for(let e=0;e<256;++e)Vk.push((e+256).toString(16).slice(1));function Hk(e,t=0){return(Vk[e[t+0]]+Vk[e[t+1]]+Vk[e[t+2]]+Vk[e[t+3]]+`-`+Vk[e[t+4]]+Vk[e[t+5]]+`-`+Vk[e[t+6]]+Vk[e[t+7]]+`-`+Vk[e[t+8]]+Vk[e[t+9]]+`-`+Vk[e[t+10]]+Vk[e[t+11]]+Vk[e[t+12]]+Vk[e[t+13]]+Vk[e[t+14]]+Vk[e[t+15]]).toLowerCase()}var Uk=new Uint8Array(16);function Wk(){return crypto.getRandomValues(Uk)}var Gk={};function Kk(e,t,n){let r;if(e)r=Jk(e.random??e.rng?.()??Wk(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=Wk();qk(Gk,e,i),r=Jk(i,Gk.msecs,Gk.seq,t,n)}return t??Hk(r)}function qk(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=Yk(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function Jk(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=Yk(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function Yk(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function Xk(){return Kk()}async function Zk(e,t){let n=new URLSearchParams({limit:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await xk(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function Qk({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,ref:l}){let u=nD(),[d,f]=(0,L.useState)(``),[p]=Na(d.trim(),250),[m,h]=(0,L.useState)(null),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(``),[S,w]=(0,L.useState)(!1),T=(0,L.useRef)(null);(0,L.useImperativeHandle)(l,()=>({focusSearch:()=>T.current?.focus()}),[]),(0,L.useEffect)(()=>{r&&requestAnimationFrame(()=>T.current?.focus())},[r]);let D=EO({queryKey:[...Pk,p],queryFn:({pageParam:e})=>Zk(p,e),initialPageParam:``,getNextPageParam:e=>e.nextCursor||void 0,enabled:e}),k=TO({queryKey:Nk,queryFn:()=>Fk(`/api/dashboards`),refetchInterval:3e4}),A=(0,L.useMemo)(()=>D.data?.pages.flatMap(e=>e.threads)??[],[D.data]),j=(0,L.useMemo)(()=>iA(A),[A]),M=(0,L.useMemo)(()=>{let e=k.data?.dashboards??[],t=p.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[k.data,p]);function N(e){x(``),y(e.title),h(e)}async function ne(){if(m&&v.trim()){w(!0),x(``);try{let e=await xk(`/api/agent/threads/${encodeURIComponent(m.threadId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:v.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await u.invalidateQueries({queryKey:Pk}),h(null)}catch(e){x(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{w(!1)}}}async function re(){if(g){w(!0),x(``);try{let e=await xk(`/api/agent/threads/${encodeURIComponent(g.threadId)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=g.threadId;_(null),await u.invalidateQueries({queryKey:Pk}),o(t)}catch(e){x(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{w(!1)}}}return(0,R.jsxs)(F,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,R.jsx)(xe,{leftSection:(0,R.jsx)(ik,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,R.jsx)(Ku,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,R.jsxs)(F,{gap:`lg`,pb:`sm`,children:[e&&(0,R.jsxs)(F,{gap:4,children:[(0,R.jsx)($k,{children:`Chats`}),D.isLoading&&(0,R.jsx)(oe,{py:`md`,children:(0,R.jsx)(C,{size:`xs`})}),D.isError&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!D.isLoading&&!D.isError&&A.length===0&&(0,R.jsx)(O,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:p?`No matching chats`:`No chats yet`}),j.map(e=>(0,R.jsxs)(F,{gap:2,children:[j.length>1&&(0,R.jsx)(O,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,R.jsx)(eA,{thread:e,active:e.threadId===t,onSelect:()=>a(e.threadId),onRename:()=>N(e),onDelete:()=>{x(``),_(e)}},e.threadId))]},e.label)),D.hasNextPage&&(0,R.jsx)(xe,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:D.isFetchingNextPage,onClick:()=>void D.fetchNextPage(),children:`See all`})]}),(0,R.jsxs)(F,{gap:4,children:[(0,R.jsx)($k,{children:`Dashboards`}),k.isLoading&&(0,R.jsx)(oe,{py:`md`,children:(0,R.jsx)(C,{size:`xs`})}),k.isError&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!k.isLoading&&!k.isError&&p&&M.length===0&&(0,R.jsx)(O,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),M.map(e=>{let t=e.id===n;return(0,R.jsx)(E,{className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:()=>s(e.id),children:(0,R.jsxs)(te,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(O,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,R.jsx)($p,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})},e.id)}),e&&(0,R.jsx)(xe,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,R.jsx)(ck,{size:14,weight:`fill`}),onClick:c,children:`Create with AI`})]})]})}),(0,R.jsx)(Xh,{ref:T,value:d,onChange:e=>f(e.currentTarget.value),leftSection:(0,R.jsx)(QO,{size:15}),rightSection:(0,R.jsx)(Om,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats and dashboards`,size:`sm`}),(0,R.jsx)(kh,{opened:m!==null,onClose:()=>!S&&h(null),title:`Rename chat`,centered:!0,children:(0,R.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),ne()},children:(0,R.jsxs)(F,{children:[(0,R.jsx)(Xh,{label:`Name`,value:v,onChange:e=>y(e.currentTarget.value),maxLength:120,autoFocus:!0}),b&&(0,R.jsx)(ee,{color:`bad`,children:b}),(0,R.jsxs)(te,{justify:`flex-end`,children:[(0,R.jsx)(xe,{variant:`default`,onClick:()=>h(null),disabled:S,children:`Cancel`}),(0,R.jsx)(xe,{type:`submit`,loading:S,disabled:!v.trim(),children:`Save`})]})]})})}),(0,R.jsx)(kh,{opened:g!==null,onClose:()=>!S&&_(null),title:`Delete chat?`,centered:!0,children:(0,R.jsxs)(F,{children:[(0,R.jsxs)(O,{size:`sm`,children:[`This permanently removes `,(0,R.jsx)(O,{span:!0,fw:650,children:g?.title}),` and its saved messages.`]}),b&&(0,R.jsx)(ee,{color:`bad`,children:b}),(0,R.jsxs)(te,{justify:`flex-end`,children:[(0,R.jsx)(xe,{variant:`default`,onClick:()=>_(null),disabled:S,children:`Cancel`}),(0,R.jsx)(xe,{color:`bad`,loading:S,onClick:()=>void re(),children:`Delete`})]})]})})]})}function $k({children:e}){return(0,R.jsx)(O,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function eA({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,R.jsx)(we,{"data-active":t||void 0,className:`rail-row`,children:(0,R.jsxs)(te,{gap:2,wrap:`nowrap`,children:[(0,R.jsx)(E,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,R.jsxs)(F,{gap:0,children:[(0,R.jsx)(O,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,R.jsx)(O,{c:`dimmed`,size:`xs`,children:aA(e.updatedAt)})]})}),(0,R.jsxs)(ph,{position:`bottom-end`,withinPortal:!0,children:[(0,R.jsx)(ph.Target,{children:(0,R.jsx)(zd,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,R.jsx)(KO,{size:18,weight:`bold`})})}),(0,R.jsxs)(ph.Dropdown,{children:[(0,R.jsx)(ph.Item,{leftSection:(0,R.jsx)(nk,{size:15}),onClick:r,children:`Rename`}),(0,R.jsx)(ph.Item,{color:`bad`,leftSection:(0,R.jsx)(fk,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function tA(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function nA(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var rA=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function iA(e){let t=nA(new Date),n=new Map;for(let r of e){let e=Math.floor((t-nA(tA(r.updatedAt)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return rA.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function aA(e){let t=tA(e),n=nA(new Date);return Math.floor((n-nA(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function oA({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=Lk(),s=bi(),c=ua({select:e=>e.location.pathname}),{dashboardId:l}=vi({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=qa(!1),[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(``),_=(0,L.useRef)(null),v=ue(`(max-width: 62em)`),y=(0,L.useRef)(v);y.current=v,(0,L.useEffect)(()=>{f.close()},[c]),(0,L.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e}}),onCreateDashboard:()=>o(Rk)};return(0,R.jsxs)(Rp,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,R.jsx)(Rp.Header,{children:(0,R.jsxs)(te,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsxs)(te,{gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(nm,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,R.jsx)(ye,{size:`small`})]}),(0,R.jsxs)(te,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(sA,{}),(0,R.jsx)(cA,{onError:g})]})]})}),(0,R.jsx)(Rp.Navbar,{p:`sm`,children:(0,R.jsx)(Qk,{ref:_,...b})}),(0,R.jsx)(Tm,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,R.jsx)(ye,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,R.jsx)(Qk,{...b,autoFocusSearch:d&&p})}),(0,R.jsxs)(Rp.Main,{children:[h&&(0,R.jsx)(ee,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function sA(){let{setColorScheme:e}=co(),t=fo(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`;return(0,R.jsx)(Yh,{label:`Switch to ${n} theme`,children:(0,R.jsx)(zd,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onClick:()=>e(n),children:t===`dark`?(0,R.jsx)(uk,{size:17,weight:`bold`}):(0,R.jsx)(ek,{size:17,weight:`bold`})})})}function cA({onError:e}){let t=Ek(),n=(t.name.trim()||t.email.trim()||`?`).charAt(0).toUpperCase();return(0,R.jsxs)(ph,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(ph.Target,{children:(0,R.jsx)(zd,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,R.jsx)(Xp,{size:26,radius:`xl`,color:`brand`,children:n})})}),(0,R.jsxs)(ph.Dropdown,{children:[(0,R.jsx)(ph.Label,{children:t.email||`Signed in`}),(0,R.jsx)(ph.Item,{component:`a`,href:`https://github.com/labstack/fanout`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(JO,{size:15,weight:`bold`}),children:`Fanout on GitHub`}),(0,R.jsx)(ph.Item,{component:`a`,href:`https://labstack.com`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(XO,{size:15}),children:`LabStack`}),(0,R.jsx)(ph.Divider,{}),(0,R.jsx)(ph.Item,{leftSection:(0,R.jsx)(ok,{size:15}),onClick:()=>void Sk().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function lA(){let{agent_available:e}=wk(),t=bi(),n=nD(),{threadId:r}=vi({strict:!1}),[i,a]=(0,L.useState)(Xk),o=(0,L.useRef)(new Set),s=r??i,[c,l]=(0,L.useState)([]),[u,d]=(0,L.useState)({}),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(``),[S,C]=(0,L.useState)(``),[w,T]=(0,L.useState)(0),E=(0,L.useRef)(``),D=(0,L.useRef)(null),O=(0,L.useRef)(null),k=(0,L.useRef)(0),A=(0,L.useMemo)(()=>new eD({url:`/api/agent`,threadId:s,fetch:(e,t)=>xk(e,t)}),[s]),ee=!e||f===s;function j(){k.current=0,y(``)}(0,L.useEffect)(()=>{let t=!0;if(l([]),d({}),p(``),h(!1),_(!1),j(),C(``),!e){p(s);return}!r||o.current.has(s)?(A.setMessages([]),p(s)):xk(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}A.setMessages(e.messages??[]),l([...e.messages??[]]),p(s)}}).catch(()=>{t&&(E.current=``,C(`This chat could not be restored. Start a new chat or try again.`))});let i=A.subscribe({onEvent:({messages:e})=>l([...e]),onRunInitialized:()=>{_(!0),C(``)},onToolCallStartEvent:({event:e})=>{k.current+=1,y(Bk(e.toolCallName))},onToolCallEndEvent:()=>{k.current=Math.max(0,k.current-1),k.current===0&&y(``)},onRunFinalized:({messages:e})=>{let t=[...e];l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),j(),o.current.delete(s),n.invalidateQueries({queryKey:Pk})},onRunFailed:e=>{console.error(`Agent run failed`,e),C(`Fanout could not complete this analysis.`),_(!1),j(),o.current.delete(s),n.invalidateQueries({queryKey:Pk})}});return()=>{t=!1,i.unsubscribe(),A.abortRun()}},[A,e,n,w,s]),(0,L.useEffect)(()=>{D.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[c,g]),(0,L.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>O.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>O.current?.focus()))),e.key===`Escape`&&n===O.current&&(x(``),O.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function M(){_(!0),C(``);try{await A.runAgent()}catch(e){console.error(`Agent run failed`,e),C(`Fanout could not complete this analysis.`),_(!1),j(),o.current.delete(s)}}async function N(n){let i=n.trim();if(!e||!i||g||!ee||m)return;r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let a={id:Xk(),role:`user`,content:i};A.addMessage(a),l([...A.messages]),d(e=>({...e,[a.id]:Date.now()})),x(``),await M()}(0,L.useEffect)(()=>{let e=E.current;ee&&r&&e&&(E.current=``,N(e))},[ee,r,s]);function te(e){e.preventDefault(),N(b)}function ne(){A.abortRun(),_(!1),j(),o.current.delete(s)}function re(){!g&&A.messages.some(e=>e.role===`user`)&&M()}function ie(n){if(!e)return;let r=Xk();o.current.add(r),E.current=n??``,t({to:`/chat/$threadId`,params:{threadId:r}})}function P(){A.abortRun(),E.current=``,a(Xk()),t({to:`/chat`})}function ae(e){t({to:`/chat/$threadId`,params:{threadId:e}})}function oe(){T(e=>e+1)}return(0,R.jsx)(Ik.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:ee,running:g,activity:v,input:b,setInput:x,error:S,bottomRef:D,inputRef:O,send:N,submit:te,stop:ne,retry:re,reloadThread:oe,openChat:ie,newThread:P,selectThread:ae},children:(0,R.jsx)(oA,{children:(0,R.jsx)(ea,{})})})}function uA(){let e=(0,L.useMemo)(()=>new fO,[]);return(0,R.jsx)(rD,{client:e,children:(0,R.jsx)(Mk,{children:(0,R.jsx)(lA,{})})})}var dA=Vi({component:uA,notFoundComponent:()=>(0,R.jsx)(xi,{to:`/`,replace:!0})}),fA=`modulepreload`,pA=function(e){return`/`+e},mA={},hA=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=pA(t,n),t=s(t),t in mA)return;mA[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:fA,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},gA=Hi(`/`)({component:Ui(()=>hA(()=>import(`./routes-DdP3ZNeG.js`),__vite__mapDeps([0,1])),`component`)}),_A=Hi(`/chat/`)({component:Ui(()=>hA(()=>import(`./chat.index-DSIYq_x1.js`),__vite__mapDeps([2,3,1,4])),`component`)}),vA=Hi(`/chat/$threadId`)({component:Ui(()=>hA(()=>import(`./chat._threadId-DSIYq_x1.js`),__vite__mapDeps([5,3,1,4])),`component`)}),yA=Hi(`/dashboards/`)({component:Ui(()=>hA(()=>import(`./dashboards.index-BuFeceag.js`),__vite__mapDeps([6,1,7,4])),`component`)}),bA=Hi(`/dashboards/$dashboardId`)({component:Ui(()=>hA(()=>import(`./dashboards._dashboardId-Dlv44ftW.js`),__vite__mapDeps([8,1,7,4])),`component`)}),xA=gA.update({id:`/`,path:`/`,getParentRoute:()=>dA}),SA=_A.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>dA}),CA=vA.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>dA}),wA=yA.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>dA}),TA={IndexRoute:xA,ChatThreadIdRoute:CA,DashboardsDashboardIdRoute:bA.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>dA}),ChatIndexRoute:SA,DashboardsIndexRoute:wA},EA=oa({routeTree:dA._addFileChildren(TA)._addFileTypes(),defaultPreload:`intent`,scrollRestoration:!0}),DA=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],OA=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],kA=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],AA=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],jA=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],MA=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],NA={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},PA={dark:[`#66d0ee`,`#a97ce0`,`#5fe8ce`,`#cb55e8`,`#41b6f8`,`#d2a6ff`],light:[`#2b93b5`,`#7c4dcc`,`#1a9c86`,`#a12fbf`,`#2f7fd4`,`#9163d6`]},FA={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},IA={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:DA,brand:OA,ok:kA,warn:AA,bad:jA,info:MA},defaultRadius:`md`,fontFamily:FA.body,fontFamilyMonospace:FA.display,headings:{fontFamily:FA.body,fontWeight:`600`},cursorType:`pointer`},LA=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":NA.light.muted},dark:{}}),RA=Eo(IA);(0,q_.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(To,{theme:RA,defaultColorScheme:`auto`,cssVariablesResolver:LA,children:(0,R.jsx)(la,{router:EA})})}));export{kh as A,eo as B,gD as C,nD as D,AD as E,jd as F,fa as G,Ea as H,Ku as I,xi as K,fo as L,$p as M,zp as N,Xh as O,zd as P,io as R,PD as S,bD as T,ma as U,Ka as V,pa as W,ik as _,PA as a,cO as b,hA as c,Nk as d,Fk as f,ck as g,fk as h,kA as i,ph as j,Yh as k,Xk as l,xk as m,NA as n,AA as o,wk as p,bi as q,MA as r,bA as s,jA as t,Lk as u,KO as v,cD as w,RD as x,TO as y,to as z}; \ No newline at end of file +`)},CE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(Rx(r=>{switch(r.type){case G.TEXT_MESSAGE_START:{let e=r;return[{type:bE.enum.TextMessageStart,messageId:e.messageId,role:e.role}]}case G.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:bE.enum.TextMessageContent,messageId:e.messageId,content:e.delta}]}case G.TEXT_MESSAGE_END:{let e=r;return[{type:bE.enum.TextMessageEnd,messageId:e.messageId}]}case G.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:bE.enum.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case G.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let p=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(Xx(d.function.arguments));e.tool_argument&&e.tool_argument in t?(f({...i,[e.state_key]:t[e.tool_argument]}),p=!0):e.tool_argument||(f({...i,[e.state_key]:t}),p=!0)}catch{}}return[{type:bE.enum.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...p?[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case G.TOOL_CALL_END:{let e=r;return[{type:bE.enum.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case G.TOOL_CALL_RESULT:{let e=r;return[{type:bE.enum.ActionExecutionResult,actionExecutionId:e.toolCallId,result:e.content,actionName:d[e.toolCallId]||`unknown`}]}case G.RAW:return[];case G.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:bE.enum.MetaEvent,name:e.name,value:e.value}]}case G.STATE_SNAPSHOT:return f(r.snapshot),[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case G.STATE_DELTA:{let c=r,l=Qy.applyPatch(i,c.delta,!0,!1);return l?(f(l.newDocument),[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]):[]}case G.MESSAGES_SNAPSHOT:return c=r.messages,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case G.RUN_STARTED:return[];case G.RUN_FINISHED:return c&&(i.messages=c),Object.keys(i).length===0?[]:[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:wE(c)}:{}}),active:!1}];case G.RUN_ERROR:{let e=r;return[{type:bE.enum.RunError,message:e.message,code:e.code}]}case G.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case G.STEP_FINISHED:return u=[],l=null,[{type:bE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function wE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=SE(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r={id:e.id,name:e.function.name,arguments:JSON.parse(e.function.arguments),parentMessageId:n.id};t.push(r)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:n.content,actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var TE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,EE=e=>e===`tool`?`toolCallId`:`messageId`,DE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},OE=e=>t=>{let n=cE(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:G.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:G.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:G.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!=null&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&TE(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${EE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(Rx(e=>{switch(e.type){case G.TEXT_MESSAGE_START:case G.TEXT_MESSAGE_CONTENT:case G.TEXT_MESSAGE_END:case G.TOOL_CALL_START:case G.TOOL_CALL_ARGS:case G.TOOL_CALL_END:case G.TOOL_CALL_RESULT:case G.STATE_SNAPSHOT:case G.STATE_DELTA:case G.CUSTOM:case G.STEP_STARTED:case G.STEP_FINISHED:case G.THINKING_START:case G.THINKING_END:case G.THINKING_TEXT_MESSAGE_START:case G.THINKING_TEXT_MESSAGE_CONTENT:case G.THINKING_TEXT_MESSAGE_END:case G.REASONING_START:case G.REASONING_MESSAGE_START:case G.REASONING_MESSAGE_CONTENT:case G.REASONING_MESSAGE_END:case G.REASONING_END:return[...i(e.subagentRunId??void 0),e];case G.RUN_STARTED:case G.RUN_FINISHED:case G.RUN_ERROR:case G.MESSAGES_SNAPSHOT:return[...a(),e];case G.RAW:case G.ACTIVITY_SNAPSHOT:case G.ACTIVITY_DELTA:case G.REASONING_ENCRYPTED_VALUE:case G.SUBAGENT_STARTED:return[e];case G.SUBAGENT_FINISHED:case G.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case G.TEXT_MESSAGE_CHUNK:{let t=e,a=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),o=r.get(a),c=[],l;if(o?.kind===`text`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,name:t.name,subagentRunId:t.subagentRunId},r.set(a,{kind:`text`,fields:l});let e=DE({type:G.TEXT_MESSAGE_START,messageId:t.messageId,role:t.role||`assistant`,...t.name!==void 0&&{name:t.name},...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.TEXT_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case G.TOOL_CALL_CHUNK:{let t=e,a=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),o=r.get(a),c=[],l;if(o?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===o.fields.toolCallId))l=o.fields;else{if(c.push(...i(a)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);l={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`tool`,fields:l});let e=DE({type:G.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:l.toolCallId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.TOOL_CALL_ARGS,toolCallId:l.toolCallId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}case G.REASONING_MESSAGE_CHUNK:{let t=e,a=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),o=r.get(a),c=[],l;if(o?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===o.fields.messageId))l=o.fields;else{if(c.push(...i(a)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);l={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(a,{kind:`reasoning`,fields:l});let e=DE({type:G.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!=null&&{subagentRunId:t.subagentRunId}},t);c.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e=t.subagentRunId??l.subagentRunId,r=DE({type:G.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:t.delta,...e!=null&&{subagentRunId:e}},t);c.push(r),n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:l.messageId})}if(c.length===0&&t.metadata!==void 0){let e=t.subagentRunId??l.subagentRunId;c.push({type:G.REASONING_MESSAGE_CONTENT,messageId:l.messageId,delta:``,metadata:t.metadata,...e!=null&&{subagentRunId:e}})}return c}}return e.type,[]}),Gx(()=>{a()}))};function kE(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}var AE=class{runNext(e,t){return t.run(e).pipe(OE(!1))}runNextWithState(e,t){let n=tE(e.messages||[]),r=tE(e.state||{}),i=new $b;return pE(e,i,t,[]).subscribe(e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)}),this.runNext(e,t).pipe(Ux(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:tE(n),state:tE(r)})))}},jE=class extends AE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function ME(e){let t=e.content;if(Array.isArray(t)){let n=t.filter(e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``);return{...e,content:n}}return typeof t==`string`?e:{...e,content:``}}var NE=class extends AE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(ME)};return this.runNext(i,t)}},PE=`THINKING_START`,FE=`THINKING_END`,IE=`THINKING_TEXT_MESSAGE_START`,LE=`THINKING_TEXT_MESSAGE_CONTENT`,RE=`THINKING_TEXT_MESSAGE_END`,zE=class extends AE{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(Ix(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case PE:{this.currentReasoningId=nE();let{title:t,...n}=e;return this.warnAboutTransformation(PE,G.REASONING_START),{...n,type:G.REASONING_START,messageId:this.currentReasoningId}}case IE:return this.currentMessageId=nE(),this.warnAboutTransformation(IE,G.REASONING_MESSAGE_START),{...e,type:G.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`assistant`};case LE:{let{delta:t,...n}=e;return this.warnAboutTransformation(LE,G.REASONING_MESSAGE_CONTENT),{...n,type:G.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??nE(),delta:t}}case RE:{let t=this.currentMessageId??nE();return this.warnAboutTransformation(RE,G.REASONING_MESSAGE_END),{...e,type:G.REASONING_MESSAGE_END,messageId:t}}case FE:{let t=this.currentReasoningId??nE();return this.warnAboutTransformation(FE,G.REASONING_END),{...e,type:G.REASONING_END,messageId:t}}default:return e}}};function BE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function VE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function HE(e){let t=BE(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e}function UE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>VE(e)?HE(e):e);return{...e,content:n}}var WE=class extends AE{run(e,t){let n={...e,messages:e.messages.map(UE)};return this.runNext(n,t)}},GE=`SUBAGENT_STARTED`,KE=`SUBAGENT_FINISHED`,qE=`SUBAGENT_ERROR`;function JE(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function YE(e){return e.map(e=>JE(e))}var XE=class extends AE{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>JE(e))};return this.runNext(n,t).pipe(Jx(e=>{let t=e.type;(t===GE||t===KE||t===qE)&&this.warnDroppedLifecycleEvent(t)}),Vx(e=>{let t=e.type;return t!==GE&&t!==KE&&t!==qE}),Ix(e=>{let t=JE(e);if(t.type===G.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:YE(e.messages)}}if(t.type===G.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>JE(e))}}}if(t.type===G.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:YE(e.input.messages)}}}return t}))}},ZE=`0.0.59`,QE=class{get maxVersion(){return ZE}get debug(){return this._debug}set debug(e){this._debug=sE(e),this._debugLogger=uE(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?uE(sE(!0)):void 0:e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??``,this.threadId=n??rg(),this.messages=tE(r??[]),this.state=tE(i??{}),this._debug=sE(a),this._debugLogger=uE(this._debug),eE(this.maxVersion,`0.0.39`)<=0&&this.middlewares.unshift(new NE),eE(this.maxVersion,`0.0.45`)<=0&&this.middlewares.unshift(new zE),eE(this.maxVersion,`0.0.47`)<=0&&this.middlewares.unshift(new WE),eE(this.maxVersion,`0.0.57`)<=0&&this.middlewares.unshift(new XE)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new jE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??rg();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Fx(zb(()=>this.middlewares.length===0?this.run(n):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),OE(this.debugLogger),mE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),Gx(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)));let s=tE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new gv}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??rg();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Fx(zb(()=>Bx(()=>this.connect(n)),OE(this.debugLogger),mE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.isRunning=!1,e instanceof gv?ex:this.onError(n,e,a))),Gx(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)),{defaultValue:void 0});let s=tE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}apply(e,t,n){return pE(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Jx(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=tE(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||rg(),tools:tE(e?.tools??[]),context:tE(e?.context??[]),forwardedProps:tE(e?.forwardedProps??{}),state:tE(this.state),messages:n,...e?.resume===void 0?{}:{resume:tE(e.resume)}}}async onInitialize(e,t){if(this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new hv(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let e of this.pendingInterrupts)if(kE(e))throw new hv(`Interrupt ${e.id} expired at ${e.expiresAt}`)}let n=await oE(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return Mx(oE(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Ix(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await oE(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=tE(this.messages),e.state=tE(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=tE(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=tE(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=tE(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??rg();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t)).pipe(OE(this.debugLogger),mE(this.debugLogger),CE(this.threadId,t.runId,this.agentId),e=>e.pipe(Ix(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function $E(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var eD=class extends QE{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify($E(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=tE(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return yE(gE(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=tE(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},tD=L.createContext(void 0),nD=e=>{let t=L.useContext(tD);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},rD=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(tD.Provider,{value:e,children:t})),iD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},aD=new class{#e=iD;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function oD(e){setTimeout(e,0)}var sD=typeof window>`u`||`Deno`in globalThis;function cD(){}function lD(e,t){return typeof e==`function`?e(t):e}function uD(e){return typeof e==`number`&&e>=0&&e!==1/0}function dD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fD(e,t){return typeof e==`function`?e(t):e}function pD(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==hD(o,t.options))return!1}else if(!_D(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function mD(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(gD(t.options.mutationKey)!==gD(a))return!1}else if(!_D(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function hD(e,t){return(t?.queryKeyHashFn||gD)(e)}function gD(e){return JSON.stringify(e,(e,t)=>SD(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function _D(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n500)return t;let r=xD(e)&&xD(t);if(!r&&!(SD(e)&&SD(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{aD.setTimeout(t,e)})}function TD(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:yD(e,t)}function ED(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function DD(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var OD=Symbol();function kD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===OD?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function AD(e,t){return typeof e==`function`?e(...t):!!e}function jD(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var MD=()=>sD,ND=()=>MD(),PD=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},FD=new class extends PD{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ID=oD;function LD(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ID,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var RD=LD(),zD=new class extends PD{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function BD(e){return Math.min(1e3*2**e,3e4)}function VD(e){return(e??`online`)!==`online`||zD.isOnline()}var HD=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function UD(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(cD);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new HD(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>FD.isFocused()&&(e.networkMode===`always`||zD.isOnline())&&e.canRun(),p=()=>VD(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ND()?0:3),a=e.retryDelay??BD,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nf()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var WD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),uD(this.gcTime)&&(this.#e=aD.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ND()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(aD.clearTimeout(this.#e),this.#e=void 0)}};function GD(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{jD(e,()=>t.signal,()=>n=!0)},u=kD(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?DD:ED;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?qD:KD,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:KD(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function KD(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function qD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function JD(e,t){return t?KD(e,t)!=null:!1}function YD(e,t){return!t||!e.getPreviousPageParam?!1:qD(e,t)!=null}var XD=class extends WD{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=$D(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=$D(this.options);e.data!==void 0&&(this.setState(QD(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=TD(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(cD).catch(cD):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>fD(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===OD||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>fD(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!dD(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=kD(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?GD(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=UD({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof HD&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof HD){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ZD(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...QD(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),RD.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ZD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:VD(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function QD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function $D(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var eO=class extends PD{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),nO(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rO(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rO(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof fD(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!bD(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&iO(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||fD(this.options.enabled,this.#t)!==fD(t.enabled,this.#t)||fD(this.options.staleTime,this.#t)!==fD(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||fD(this.options.enabled,this.#t)!==fD(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return bD(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(cD)),t}#h(e){return!ND()&&fD(this.options.enabled,this.#t)!==!1&&uD(e)}#g(){this.#b();let e=fD(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=dD(this.#r.dataUpdatedAt,e)+1;this.#u=aD.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=aD.setInterval(()=>{(this.options.refetchIntervalInBackground||FD.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(aD.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(aD.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&nO(e,t),o=i&&iO(e,n,t,r);(a||o)&&(l={...l,...ZD(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=TD(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=TD(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:aO(e,t),refetch:this.refetch,isEnabled:fD(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),bD(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();RD.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function tO(e,t){return fD(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||fD(t.retryOnMount,e)!==!1)}function nO(e,t){return tO(e,t)||e.state.data!==void 0&&rO(e,t,t.refetchOnMount)}function rO(e,t,n){if(fD(t.enabled,e)!==!1&&fD(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&aO(e,t)}return!1}function iO(e,t,n,r){return(e!==t||fD(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&aO(e,n)}function aO(e,t){return fD(t.enabled,e)!==!1&&e.isStaleByTime(fD(t.staleTime,e))}var oO=class extends eO{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:JD(t,n.data),hasPreviousPage:YD(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},sO=class extends WD{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||cO(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=UD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),RD.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function cO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var lO=class extends PD{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new sO({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=uO(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=uO(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){RD.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>mD(t,e))}findAll(e={}){return this.getAll().filter(t=>mD(e,t))}notify(e){RD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return RD.batch(()=>Promise.all(e.map(e=>e.continue().catch(cD))))}};function uO(e){return e.options.scope?.id}var dO=class extends PD{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??hD(r,t),a=this.get(i);return a||(a=new XD({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){RD.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>pD(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>pD(e,t)):t}notify(e){RD.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){RD.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){RD.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fO=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new dO,this.#t=e.mutationCache||new lO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=FD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=zD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fD(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=lD(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return RD.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;RD.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return RD.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=RD.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(cD).catch(cD)}invalidateQueries(e,t={}){return RD.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=RD.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(cD)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(cD)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(fD(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(fD(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cD).catch(cD)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cD).catch(cD)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return zD.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(gD(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{_D(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(gD(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{_D(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=hD(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===OD&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},pO=L.createContext(!1),mO=()=>L.useContext(pO);pO.Provider;function hO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gO=L.createContext(hO()),_O=()=>L.useContext(gO),vO=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?AD(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},yO=e=>{L.useEffect(()=>{e.clearReset()},[e])},bO=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||AD(n,[e.error,r])),xO=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},SO=(e,t)=>e?.suspense&&t.isPending,CO=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wO(e,t,n){let r=mO(),i=_O(),a=nD(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,xO(o),vO(o,i,s),yO(i);let[l]=L.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(L.useSyncExternalStore(L.useCallback(e=>{let t=d?l.subscribe(RD.batchCalls(e)):cD;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),L.useEffect(()=>{l.setOptions(o)},[o,l]),SO(o,u))throw CO(o,l,i);if(bO({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function TO(e,t){return wO(e,eO,t)}function EO(e,t){return wO(e,oO,t)}var DO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),OO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),kO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),AO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z`}))]]),jO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm84,108a83.64,83.64,0,0,1-4.47,27L167,130a19.65,19.65,0,0,0-7.8-2.78l-22.82-3.08A20.14,20.14,0,0,0,117.72,132h-4.07l-2.71-5.6a19.88,19.88,0,0,0-13.8-10.84L94.46,115l4-7h14.39a20,20,0,0,0,9.66-2.49l12.25-6.76a20.57,20.57,0,0,0,3.74-2.68l26.92-24.33A20,20,0,0,0,172,56.49,84,84,0,0,1,212,128ZM140.76,45l6.2,11.1L122.75,78l-10.93,6H96.14A20.05,20.05,0,0,0,78.78,94.06l-4.49,7.85L67.68,84.28l9.91-23.42A83.91,83.91,0,0,1,140.76,45ZM44,128a83.52,83.52,0,0,1,4.4-26.77l7.74,20.65a19.89,19.89,0,0,0,14.52,12.53l19.53,4.2,3,6.1a20.11,20.11,0,0,0,13.55,10.77l-5,11.12a20,20,0,0,0,3.58,21.71l.21.22,18.16,18.7-.89,4.59A84.09,84.09,0,0,1,44,128Zm103.65,81.66a20.11,20.11,0,0,0-5-17.3l-.21-.22-17.72-18.25,11.37-25.52,19,2.56,41.43,25.48A84.2,84.2,0,0,1,147.65,209.66Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M213.09,172.48a96,96,0,0,1-80.41,51.41l3.17-16.44a8,8,0,0,0-2-6.95l-19.74-20.33a8,8,0,0,1-1.44-8.69l13.7-30.74a8,8,0,0,1,8.38-4.67l22.82,3.08a8.11,8.11,0,0,1,3.12,1.11ZM116.71,95,129,88.24a7.46,7.46,0,0,0,1.5-1.07l26.91-24.33A8,8,0,0,0,159,53l-10.5-18.81A96.62,96.62,0,0,0,128,32,95.61,95.61,0,0,0,67.78,53.23L56,81.08A8,8,0,0,0,55.88,87l11.5,30.67a8,8,0,0,0,5.81,5l2.69.58L89.2,100a8,8,0,0,1,6.94-4h16.71A7.9,7.9,0,0,0,116.71,95Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm90,102a89.55,89.55,0,0,1-7.46,35.86l-46.69-28.71a13.94,13.94,0,0,0-5.46-2l-22.82-3.07A14.06,14.06,0,0,0,121.06,138h-9.92a2,2,0,0,1-1.8-1.13l-3.8-7.86a13.94,13.94,0,0,0-9.66-7.59l-10.71-2.3L94.4,103a2,2,0,0,1,1.74-1h16.71a13.9,13.9,0,0,0,6.76-1.75l12.25-6.75a14.73,14.73,0,0,0,2.62-1.88l26.91-24.33a13.93,13.93,0,0,0,2.83-17.21L161,44.25A90.16,90.16,0,0,1,218,128ZM144.6,39.54l9.15,16.39a2,2,0,0,1-.41,2.46L126.43,82.72a1.84,1.84,0,0,1-.37.27l-12.25,6.76a2,2,0,0,1-1,.25H96.14A14,14,0,0,0,84,97L73.18,115.91a2,2,0,0,1-.19-.35L61.5,84.89a2,2,0,0,1,0-1.48L72.68,57.06A89.9,89.9,0,0,1,144.6,39.54ZM38,128A89.52,89.52,0,0,1,49.38,84.23a13.85,13.85,0,0,0,.89,4.87l11.49,30.67a13.94,13.94,0,0,0,10.16,8.78l21.44,4.6a2,2,0,0,1,1.38,1.09l3.8,7.86a14.07,14.07,0,0,0,12.6,7.9h4.56l-8.49,19a14,14,0,0,0,2.51,15.2l.1.11,19.68,20.26a2,2,0,0,1,.46,1.7L127.7,218A90.1,90.1,0,0,1,38,128Zm102.08,89.19,1.67-8.6a14.07,14.07,0,0,0-3.47-12.16l-.1-.11L118.5,176.06a2,2,0,0,1-.33-2.14l13.7-30.73A2,2,0,0,1,134,142l22.82,3.08a2,2,0,0,1,.78.27L205,174.55A90.18,90.18,0,0,1,140.08,217.19Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm92,100a91.44,91.44,0,0,1-8.58,38.76L162.8,136.85a12.07,12.07,0,0,0-4.68-1.67l-22.82-3.07a12,12,0,0,0-12.56,7l-.4.88h-11.2a4,4,0,0,1-3.6-2.26l-3.8-7.86a11.93,11.93,0,0,0-8.28-6.5L82.07,120.5,92.67,102a4,4,0,0,1,3.47-2h16.71a12,12,0,0,0,5.8-1.5l12.24-6.76a11.79,11.79,0,0,0,2.25-1.6L160.05,65.8a12,12,0,0,0,2.43-14.75l-5.86-10.49A92.17,92.17,0,0,1,220,128ZM145.89,37.75l9.6,17.2a4,4,0,0,1-.81,4.92L127.77,84.21a4.41,4.41,0,0,1-.75.53L114.78,91.5a4,4,0,0,1-1.93.5H96.14a12,12,0,0,0-10.41,6l-11.86,20.7a4,4,0,0,1-2.75-2.47L59.63,85.6a4,4,0,0,1,.06-3L71,55.81A91.51,91.51,0,0,1,128,36,92.53,92.53,0,0,1,145.89,37.75ZM36,128A91.52,91.52,0,0,1,56,70.77l-3.71,8.75a12,12,0,0,0-.18,8.88l11.49,30.67a11.93,11.93,0,0,0,8.72,7.52l21.43,4.61a4,4,0,0,1,2.76,2.17l3.8,7.86a12.07,12.07,0,0,0,10.8,6.77h7.64L109,169.85A12,12,0,0,0,111.26,183l19.68,20.26a4,4,0,0,1,1,3.47L129.36,220,128,220A92.1,92.1,0,0,1,36,128Zm101.6,91.5,2.18-11.29a12.08,12.08,0,0,0-3-10.49l-19.68-20.26a4,4,0,0,1-.71-4.35l13.7-30.74a4,4,0,0,1,4.18-2.33l22.82,3.07a4.12,4.12,0,0,1,1.56.56l49.11,30.2A92.12,92.12,0,0,1,137.6,219.5Z`}))]]),MO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),NO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),PO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),FO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),IO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),LO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),RO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),zO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),BO=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),VO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:DO}));VO.displayName=`ArrowLeftIcon`;var HO=VO,UO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:OO}));UO.displayName=`ArrowRightIcon`;var WO=UO,GO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:kO}));GO.displayName=`DotsThreeIcon`;var KO=GO,qO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:AO}));qO.displayName=`GithubLogoIcon`;var JO=qO,YO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:jO}));YO.displayName=`GlobeHemisphereWestIcon`;var XO=YO,ZO=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:MO}));ZO.displayName=`MagnifyingGlassIcon`;var QO=ZO,$O=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:NO}));$O.displayName=`MoonIcon`;var ek=$O,tk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:PO}));tk.displayName=`PencilSimpleIcon`;var nk=tk,rk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:FO}));rk.displayName=`PlusIcon`;var ik=rk,ak=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:IO}));ak.displayName=`SignOutIcon`;var ok=ak,sk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:LO}));sk.displayName=`SparkleIcon`;var ck=sk,lk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:RO}));lk.displayName=`SunIcon`;var uk=lk,dk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:zO}));dk.displayName=`TrashIcon`;var fk=dk,pk=L.forwardRef((e,t)=>L.createElement(w,{ref:t,...e,weights:BO}));pk.displayName=`UserPlusIcon`;var mk=pk,hk=`fanout.access-token`,gk=`fanout:unauthorized`;function _k(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`?``:`${t.pathname}${t.search}`}function vk(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function yk(){localStorage.removeItem(hk)}function bk(){yk(),window.dispatchEvent(new Event(gk))}async function xk(e,t={}){let n=new Headers(t.headers);n.set(`Fanout-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&bk(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw Error(e.message??e.error??`You do not have permission to perform this action.`)}return r}async function Sk(){let e=await xk(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&bk(),window.location.assign(`/`)}var Ck=(0,L.createContext)(null);function wk(){let e=(0,L.useContext)(Ck);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var Tk=(0,L.createContext)(null);function Ek(){let e=(0,L.useContext)(Tk);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function Dk(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``?null:{id:t.id,email:typeof t.email==`string`?t.email:``,name:typeof t.name==`string`?t.name:``,role:typeof t.role==`string`?t.role:``}}async function Ok(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??r.error??`Request failed (${n.status})`);return r}function kk({children:e,wide:t=!1}){return(0,R.jsx)(we,{mih:`100dvh`,style:{background:`radial-gradient(circle at 50% -12%, var(--mantine-color-brand-light), transparent 38%), linear-gradient(180deg, var(--mantine-color-default-hover), var(--mantine-color-body) 62%)`},children:(0,R.jsx)(oe,{mih:`100dvh`,px:`md`,py:48,children:(0,R.jsx)(D,{size:t?680:480,w:`100%`,children:(0,R.jsx)(Ee,{radius:28,p:{base:24,sm:40},style:{background:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-default-border)`,boxShadow:`var(--mantine-shadow-xl)`},children:e})})})})}function Ak(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function jk(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function Mk({children:e}){let t=bi(),[n,r]=(0,L.useState)(null),[i,a]=(0,L.useState)(!1),[o,s]=(0,L.useState)(`none`),[c,l]=(0,L.useState)(null),[u,d]=(0,L.useState)(!1),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(``),[g,_]=(0,L.useState)(Ak),[v,y]=(0,L.useState)(jk),[b,x]=(0,L.useState)(``),[S,w]=(0,L.useState)(!1),[T,E]=(0,L.useState)(0),[D,k]=(0,L.useState)(()=>Date.now()),[A,j]=(0,L.useState)(!1),[M,N]=(0,L.useState)(``),[ne,ie]=(0,L.useState)(null),[P,ae]=(0,L.useState)(!1),se=(0,L.useRef)(null),ce=_k(),le=o===`user`;async function ue(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){s(`none`),l(null);return}let t=await e.json().catch(()=>null);s(vk(t)),l(Dk(t))}async function fe(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;l(Dk(await e.json().catch(()=>null)))}catch{}}(0,L.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),t({href:e.pathname+e.search+e.hash,replace:!0}))},[t]),(0,L.useEffect)(()=>{yk(),Ok(`/api/auth/status`).then(r).catch(e=>N(String(e))).finally(()=>a(!0)),ue().catch(()=>s(`none`)).finally(()=>d(!0));let e=()=>{s(`none`),l(null)};return window.addEventListener(gk,e),()=>window.removeEventListener(gk,e)},[]),(0,L.useEffect)(()=>{u&&o===`none`&&v&&(j(!0),N(``),Ok(`/api/auth/login-link`,{token:v}).then(()=>{s(`user`),fe()}).catch(e=>N(e instanceof Error?e.message:String(e))).finally(()=>{y(``),j(!1)}))},[v,u,o]),(0,L.useEffect)(()=>{le&&u&&ce&&window.location.replace(ce)},[le,ce,u]),(0,L.useEffect)(()=>{if(T<=Date.now())return;let e=setInterval(()=>{k(Date.now()),Date.now()>=T&&clearInterval(e)},1e3);return()=>clearInterval(e)},[T]);let pe=Math.max(0,Math.ceil((T-D)/1e3));(0,L.useEffect)(()=>{S&&!A&&M&&se.current?.querySelector(`input`)?.focus()},[A,S,M]);async function me(e){try{await navigator.clipboard.writeText(e),ae(!0)}catch{N(`Clipboard access failed. Select and copy the token manually.`)}}if(ne?.ingest_token)return(0,R.jsx)(kk,{wide:!0,children:(0,R.jsxs)(F,{gap:`lg`,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,R.jsx)(de,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,R.jsx)(O,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,R.jsx)(am,{block:!0,children:ne.suggested_endpoint??`${window.location.hostname}:4317`})]}),(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`Header`}),(0,R.jsxs)(am,{block:!0,children:[ne.ingest_header_name??`Authorization`,`: Bearer `,ne.ingest_token]})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),(0,R.jsxs)(te,{grow:!0,align:`stretch`,children:[(0,R.jsx)(xe,{variant:`light`,radius:`md`,leftSection:P?(0,R.jsx)(re,{size:16,weight:`bold`}):(0,R.jsx)(ge,{size:16}),onClick:()=>void me(`${ne.ingest_header_name??`Authorization`}: Bearer ${ne.ingest_token}`),children:P?`Copied`:`Copy header`}),(0,R.jsx)(xe,{radius:`md`,rightSection:(0,R.jsx)(WO,{size:16,weight:`bold`}),onClick:()=>{s(`user`),ie(null),fe()},children:`Continue to Fanout`})]}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,onClick:()=>void me(ne.ingest_token??``),children:`Copy token only`})]})});if(!u||!i||v)return(0,R.jsx)(oe,{mih:`100dvh`,children:(0,R.jsx)(C,{size:`sm`})});if(!n)return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:`lg`,children:[(0,R.jsx)(ye,{}),(0,R.jsx)(de,{order:1,children:`Fanout is unavailable`}),(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M||`Authentication status could not be loaded.`})]})});if(le&&ce)return null;if(le)return(0,R.jsx)(Ck.Provider,{value:n,children:(0,R.jsx)(Tk.Provider,{value:c??{id:``,email:f,name:m,role:``},children:e})});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=ce?`/api/auth/oidc/start?return_to=${encodeURIComponent(ce)}`:`/api/auth/oidc/start`;return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:28,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(F,{gap:10,children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,R.jsx)(de,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,R.jsx)(O,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),(0,R.jsx)(xe,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function he(){j(!0),N(``);try{await Ok(`/api/auth/start`,{email:f}),w(!0),x(``),E(Date.now()+3e4),k(Date.now())}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}}async function _e(e){j(!0),N(``);try{await Ok(`/api/auth/verify`,{email:f,code:e}),s(`user`),w(!1),x(``),E(0),fe()}catch(e){x(``),N(e instanceof Error?e.message:String(e))}finally{j(!1)}}function ve(){w(!1),x(``),N(``)}async function be(e){e.preventDefault(),j(!0),N(``);try{if(n?.setup_required){let e=await Ok(`/api/auth/setup`,{email:f,name:m,setup_token:g});e.ingest_token?ie(e):(s(`user`),fe())}else if(S){await _e(b);return}else{await he();return}}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(!1)}}let I=S&&!n?.setup_required,Se=n?.setup_required?`Create the first admin`:I?`Check your email`:n?.self_signup?`Sign in or create an account`:`Sign in`,Ce=n?.setup_required?`Use the one-time token printed by the Fanout process.`:n?.smtp_configured?I?`We sent a code to ${f}.`:n?.self_signup?`Enter your email to sign in or create a viewer account. No password needed.`:`Enter your email and we’ll send a short verification code. No password needed.`:`Email delivery is not configured. Ask the operator to run fanout login-link with your email address.`;return(0,R.jsx)(kk,{children:(0,R.jsxs)(F,{gap:28,children:[(0,R.jsx)(ye,{}),(0,R.jsxs)(F,{gap:10,children:[(0,R.jsx)(O,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:n?.setup_required?`One-time setup`:`Secure workspace`}),(0,R.jsx)(de,{order:1,fz:{base:28,sm:32},lh:1.08,children:Se}),Ce&&(0,R.jsx)(O,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:Ce})]}),(0,R.jsx)(`form`,{onSubmit:be,children:(0,R.jsxs)(F,{gap:`md`,children:[(0,R.jsx)(Xh,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:f,onChange:e=>p(e.currentTarget.value),disabled:S,variant:`filled`,radius:`md`,size:`md`,autoFocus:!S}),n?.setup_required&&(0,R.jsx)(Xh,{label:`Name`,placeholder:`Your name`,value:m,onChange:e=>h(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),n?.setup_required&&(0,R.jsx)(Xh,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:g,onChange:e=>_(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),I&&(0,R.jsxs)(F,{gap:`xs`,children:[(0,R.jsx)(O,{size:`sm`,fw:600,children:`Verification code`}),(0,R.jsx)(we,{ref:se,children:(0,R.jsx)(Fh,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:b,onChange:x,onComplete:e=>void _e(e),disabled:A,error:!!M,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,R.jsxs)(te,{justify:`space-between`,gap:`xs`,children:[(0,R.jsxs)(O,{c:`dimmed`,size:`xs`,children:[`Sent to `,f]}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,leftSection:(0,R.jsx)(HO,{size:12,weight:`bold`}),onClick:ve,disabled:A,children:`Change email`})]}),(0,R.jsxs)(te,{justify:`space-between`,gap:`xs`,children:[(0,R.jsx)(O,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,R.jsx)(xe,{variant:`subtle`,size:`compact-xs`,onClick:()=>void he(),disabled:A||pe>0,children:pe>0?`Resend in ${pe}s`:`Resend code`})]})]}),M&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,children:M}),I?(0,R.jsx)(xe,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:A||b.length<6,rightSection:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:`Verify code`}):(0,R.jsx)(xe,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:!n||!n.setup_required&&!n.smtp_configured,leftSection:n?.setup_required?(0,R.jsx)(mk,{size:17,weight:`bold`}):void 0,rightSection:n?.setup_required?void 0:(0,R.jsx)(WO,{size:17,weight:`bold`}),children:n?.setup_required?`Create admin`:`Send code`})]})})]})})}var Nk=[`dashboards`],Pk=[`agent-threads`];async function Fk(e){let t=await xk(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var Ik=(0,L.createContext)(null);function Lk(){let e=(0,L.useContext)(Ik);if(!e)throw Error(`Fanout app context is unavailable`);return e}var Rk=`Create a new dashboard for me. First ask what I want to monitor, then design it when you have enough context.`,zk={observability_overview:`Checking system health…`,service_topology:`Mapping service dependencies…`,service_performance:`Reading performance signals…`,trace_detail:`Inspecting a trace…`,search_logs:`Searching logs…`,intelligence_snapshot:`Reviewing detected anomalies…`};function Bk(e){return zk[e]??`Working on it…`}var Vk=[];for(let e=0;e<256;++e)Vk.push((e+256).toString(16).slice(1));function Hk(e,t=0){return(Vk[e[t+0]]+Vk[e[t+1]]+Vk[e[t+2]]+Vk[e[t+3]]+`-`+Vk[e[t+4]]+Vk[e[t+5]]+`-`+Vk[e[t+6]]+Vk[e[t+7]]+`-`+Vk[e[t+8]]+Vk[e[t+9]]+`-`+Vk[e[t+10]]+Vk[e[t+11]]+Vk[e[t+12]]+Vk[e[t+13]]+Vk[e[t+14]]+Vk[e[t+15]]).toLowerCase()}var Uk=new Uint8Array(16);function Wk(){return crypto.getRandomValues(Uk)}var Gk={};function Kk(e,t,n){let r;if(e)r=Jk(e.random??e.rng?.()??Wk(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=Wk();qk(Gk,e,i),r=Jk(i,Gk.msecs,Gk.seq,t,n)}return t??Hk(r)}function qk(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=Yk(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function Jk(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=Yk(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function Yk(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function Xk(){return Kk()}async function Zk(e,t){let n=new URLSearchParams({limit:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await xk(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function Qk({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,ref:l}){let u=nD(),[d,f]=(0,L.useState)(``),[p]=Na(d.trim(),250),[m,h]=(0,L.useState)(null),[g,_]=(0,L.useState)(null),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(``),[S,w]=(0,L.useState)(!1),T=(0,L.useRef)(null);(0,L.useImperativeHandle)(l,()=>({focusSearch:()=>T.current?.focus()}),[]),(0,L.useEffect)(()=>{r&&requestAnimationFrame(()=>T.current?.focus())},[r]);let D=EO({queryKey:[...Pk,p],queryFn:({pageParam:e})=>Zk(p,e),initialPageParam:``,getNextPageParam:e=>e.nextCursor||void 0,enabled:e}),k=TO({queryKey:Nk,queryFn:()=>Fk(`/api/dashboards`),refetchInterval:3e4}),A=(0,L.useMemo)(()=>D.data?.pages.flatMap(e=>e.threads)??[],[D.data]),j=(0,L.useMemo)(()=>iA(A),[A]),M=(0,L.useMemo)(()=>{let e=k.data?.dashboards??[],t=p.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[k.data,p]);function N(e){x(``),y(e.title),h(e)}async function ne(){if(m&&v.trim()){w(!0),x(``);try{let e=await xk(`/api/agent/threads/${encodeURIComponent(m.threadId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:v.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await u.invalidateQueries({queryKey:Pk}),h(null)}catch(e){x(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{w(!1)}}}async function re(){if(g){w(!0),x(``);try{let e=await xk(`/api/agent/threads/${encodeURIComponent(g.threadId)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=g.threadId;_(null),await u.invalidateQueries({queryKey:Pk}),o(t)}catch(e){x(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{w(!1)}}}return(0,R.jsxs)(F,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,R.jsx)(xe,{leftSection:(0,R.jsx)(ik,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,R.jsx)(Ku,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,R.jsxs)(F,{gap:`lg`,pb:`sm`,children:[e&&(0,R.jsxs)(F,{gap:4,children:[(0,R.jsx)($k,{children:`Chats`}),D.isLoading&&(0,R.jsx)(oe,{py:`md`,children:(0,R.jsx)(C,{size:`xs`})}),D.isError&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!D.isLoading&&!D.isError&&A.length===0&&(0,R.jsx)(O,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:p?`No matching chats`:`No chats yet`}),j.map(e=>(0,R.jsxs)(F,{gap:2,children:[j.length>1&&(0,R.jsx)(O,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,R.jsx)(eA,{thread:e,active:e.threadId===t,onSelect:()=>a(e.threadId),onRename:()=>N(e),onDelete:()=>{x(``),_(e)}},e.threadId))]},e.label)),D.hasNextPage&&(0,R.jsx)(xe,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:D.isFetchingNextPage,onClick:()=>void D.fetchNextPage(),children:`See all`})]}),(0,R.jsxs)(F,{gap:4,children:[(0,R.jsx)($k,{children:`Dashboards`}),k.isLoading&&(0,R.jsx)(oe,{py:`md`,children:(0,R.jsx)(C,{size:`xs`})}),k.isError&&(0,R.jsx)(ee,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!k.isLoading&&!k.isError&&p&&M.length===0&&(0,R.jsx)(O,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),M.map(e=>{let t=e.id===n;return(0,R.jsx)(E,{className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:()=>s(e.id),children:(0,R.jsxs)(te,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(O,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,R.jsx)($p,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})},e.id)}),e&&(0,R.jsx)(xe,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,R.jsx)(ck,{size:14,weight:`fill`}),onClick:c,children:`Create with AI`})]})]})}),(0,R.jsx)(Xh,{ref:T,value:d,onChange:e=>f(e.currentTarget.value),leftSection:(0,R.jsx)(QO,{size:15}),rightSection:(0,R.jsx)(Om,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats and dashboards`,size:`sm`}),(0,R.jsx)(kh,{opened:m!==null,onClose:()=>!S&&h(null),title:`Rename chat`,centered:!0,children:(0,R.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),ne()},children:(0,R.jsxs)(F,{children:[(0,R.jsx)(Xh,{label:`Name`,value:v,onChange:e=>y(e.currentTarget.value),maxLength:120,autoFocus:!0}),b&&(0,R.jsx)(ee,{color:`bad`,children:b}),(0,R.jsxs)(te,{justify:`flex-end`,children:[(0,R.jsx)(xe,{variant:`default`,onClick:()=>h(null),disabled:S,children:`Cancel`}),(0,R.jsx)(xe,{type:`submit`,loading:S,disabled:!v.trim(),children:`Save`})]})]})})}),(0,R.jsx)(kh,{opened:g!==null,onClose:()=>!S&&_(null),title:`Delete chat?`,centered:!0,children:(0,R.jsxs)(F,{children:[(0,R.jsxs)(O,{size:`sm`,children:[`This permanently removes `,(0,R.jsx)(O,{span:!0,fw:650,children:g?.title}),` and its saved messages.`]}),b&&(0,R.jsx)(ee,{color:`bad`,children:b}),(0,R.jsxs)(te,{justify:`flex-end`,children:[(0,R.jsx)(xe,{variant:`default`,onClick:()=>_(null),disabled:S,children:`Cancel`}),(0,R.jsx)(xe,{color:`bad`,loading:S,onClick:()=>void re(),children:`Delete`})]})]})})]})}function $k({children:e}){return(0,R.jsx)(O,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function eA({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,R.jsx)(we,{"data-active":t||void 0,className:`rail-row`,children:(0,R.jsxs)(te,{gap:2,wrap:`nowrap`,children:[(0,R.jsx)(E,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,R.jsxs)(F,{gap:0,children:[(0,R.jsx)(O,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,R.jsx)(O,{c:`dimmed`,size:`xs`,children:aA(e.updatedAt)})]})}),(0,R.jsxs)(ph,{position:`bottom-end`,withinPortal:!0,children:[(0,R.jsx)(ph.Target,{children:(0,R.jsx)(zd,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,R.jsx)(KO,{size:18,weight:`bold`})})}),(0,R.jsxs)(ph.Dropdown,{children:[(0,R.jsx)(ph.Item,{leftSection:(0,R.jsx)(nk,{size:15}),onClick:r,children:`Rename`}),(0,R.jsx)(ph.Item,{color:`bad`,leftSection:(0,R.jsx)(fk,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function tA(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function nA(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var rA=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function iA(e){let t=nA(new Date),n=new Map;for(let r of e){let e=Math.floor((t-nA(tA(r.updatedAt)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return rA.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function aA(e){let t=tA(e),n=nA(new Date);return Math.floor((n-nA(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function oA({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=Lk(),s=bi(),c=ua({select:e=>e.location.pathname}),{dashboardId:l}=vi({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=qa(!1),[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(``),_=(0,L.useRef)(null),v=ue(`(max-width: 62em)`),y=(0,L.useRef)(v);y.current=v,(0,L.useEffect)(()=>{f.close()},[c]),(0,L.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e}}),onCreateDashboard:()=>o(Rk)};return(0,R.jsxs)(Rp,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,R.jsx)(Rp.Header,{children:(0,R.jsxs)(te,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,R.jsxs)(te,{gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(nm,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,R.jsx)(ye,{size:`small`})]}),(0,R.jsxs)(te,{gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(sA,{}),(0,R.jsx)(cA,{onError:g})]})]})}),(0,R.jsx)(Rp.Navbar,{p:`sm`,children:(0,R.jsx)(Qk,{ref:_,...b})}),(0,R.jsx)(Tm,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,R.jsx)(ye,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,R.jsx)(Qk,{...b,autoFocusSearch:d&&p})}),(0,R.jsxs)(Rp.Main,{children:[h&&(0,R.jsx)(ee,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function sA(){let{setColorScheme:e}=co(),t=fo(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`;return(0,R.jsx)(Yh,{label:`Switch to ${n} theme`,children:(0,R.jsx)(zd,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onClick:()=>e(n),children:t===`dark`?(0,R.jsx)(uk,{size:17,weight:`bold`}):(0,R.jsx)(ek,{size:17,weight:`bold`})})})}function cA({onError:e}){let t=Ek(),n=(t.name.trim()||t.email.trim()||`?`).charAt(0).toUpperCase();return(0,R.jsxs)(ph,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,R.jsx)(ph.Target,{children:(0,R.jsx)(zd,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,R.jsx)(Xp,{size:26,radius:`xl`,color:`brand`,children:n})})}),(0,R.jsxs)(ph.Dropdown,{children:[(0,R.jsx)(ph.Label,{children:t.email||`Signed in`}),(0,R.jsx)(ph.Item,{component:`a`,href:`https://github.com/labstack/fanout`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(JO,{size:15,weight:`bold`}),children:`Fanout on GitHub`}),(0,R.jsx)(ph.Item,{component:`a`,href:`https://labstack.com`,target:`_blank`,rel:`noopener noreferrer`,leftSection:(0,R.jsx)(XO,{size:15}),children:`LabStack`}),(0,R.jsx)(ph.Divider,{}),(0,R.jsx)(ph.Item,{leftSection:(0,R.jsx)(ok,{size:15}),onClick:()=>void Sk().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function lA(){let{agent_available:e}=wk(),t=bi(),n=nD(),{threadId:r}=vi({strict:!1}),[i,a]=(0,L.useState)(Xk),o=(0,L.useRef)(new Set),s=r??i,[c,l]=(0,L.useState)([]),[u,d]=(0,L.useState)({}),[f,p]=(0,L.useState)(``),[m,h]=(0,L.useState)(!1),[g,_]=(0,L.useState)(!1),[v,y]=(0,L.useState)(``),[b,x]=(0,L.useState)(``),[S,C]=(0,L.useState)(``),[w,T]=(0,L.useState)(0),E=(0,L.useRef)(``),D=(0,L.useRef)(null),O=(0,L.useRef)(null),k=(0,L.useRef)(0),A=(0,L.useMemo)(()=>new eD({url:`/api/agent`,threadId:s,fetch:(e,t)=>xk(e,t)}),[s]),ee=!e||f===s;function j(){k.current=0,y(``)}(0,L.useEffect)(()=>{let t=!0;if(l([]),d({}),p(``),h(!1),_(!1),j(),C(``),!e){p(s);return}!r||o.current.has(s)?(A.setMessages([]),p(s)):xk(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}A.setMessages(e.messages??[]),l([...e.messages??[]]),p(s)}}).catch(()=>{t&&(E.current=``,C(`This chat could not be restored. Start a new chat or try again.`))});let i=A.subscribe({onEvent:({messages:e})=>l([...e]),onRunInitialized:()=>{_(!0),C(``)},onToolCallStartEvent:({event:e})=>{k.current+=1,y(Bk(e.toolCallName))},onToolCallEndEvent:()=>{k.current=Math.max(0,k.current-1),k.current===0&&y(``)},onRunFinalized:({messages:e})=>{let t=[...e];l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),j(),o.current.delete(s),n.invalidateQueries({queryKey:Pk})},onRunFailed:e=>{console.error(`Agent run failed`,e),C(`Fanout could not complete this analysis.`),_(!1),j(),o.current.delete(s),n.invalidateQueries({queryKey:Pk})}});return()=>{t=!1,i.unsubscribe(),A.abortRun()}},[A,e,n,w,s]),(0,L.useEffect)(()=>{D.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[c,g]),(0,L.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>O.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>O.current?.focus()))),e.key===`Escape`&&n===O.current&&(x(``),O.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function M(){_(!0),C(``);try{await A.runAgent()}catch(e){console.error(`Agent run failed`,e),C(`Fanout could not complete this analysis.`),_(!1),j(),o.current.delete(s)}}async function N(n){let i=n.trim();if(!e||!i||g||!ee||m)return;r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let a={id:Xk(),role:`user`,content:i};A.addMessage(a),l([...A.messages]),d(e=>({...e,[a.id]:Date.now()})),x(``),await M()}(0,L.useEffect)(()=>{let e=E.current;ee&&r&&e&&(E.current=``,N(e))},[ee,r,s]);function te(e){e.preventDefault(),N(b)}function ne(){A.abortRun(),_(!1),j(),o.current.delete(s)}function re(){!g&&A.messages.some(e=>e.role===`user`)&&M()}function ie(n){if(!e)return;let r=Xk();o.current.add(r),E.current=n??``,t({to:`/chat/$threadId`,params:{threadId:r}})}function P(){A.abortRun(),E.current=``,a(Xk()),t({to:`/chat`})}function ae(e){t({to:`/chat/$threadId`,params:{threadId:e}})}function oe(){T(e=>e+1)}return(0,R.jsx)(Ik.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:ee,running:g,activity:v,input:b,setInput:x,error:S,bottomRef:D,inputRef:O,send:N,submit:te,stop:ne,retry:re,reloadThread:oe,openChat:ie,newThread:P,selectThread:ae},children:(0,R.jsx)(oA,{children:(0,R.jsx)(ea,{})})})}function uA(){let e=(0,L.useMemo)(()=>new fO,[]);return(0,R.jsx)(rD,{client:e,children:(0,R.jsx)(Mk,{children:(0,R.jsx)(lA,{})})})}var dA=Vi({component:uA,notFoundComponent:()=>(0,R.jsx)(xi,{to:`/`,replace:!0})}),fA=`modulepreload`,pA=function(e){return`/`+e},mA={},hA=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=pA(t,n),t=s(t),t in mA)return;mA[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:fA,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},gA=Hi(`/`)({component:Ui(()=>hA(()=>import(`./routes-C2A3xwKL.js`),__vite__mapDeps([0,1])),`component`)}),_A=Hi(`/chat/`)({component:Ui(()=>hA(()=>import(`./chat.index-u0MOvyAV.js`),__vite__mapDeps([2,3,1,4])),`component`)}),vA=Hi(`/chat/$threadId`)({component:Ui(()=>hA(()=>import(`./chat._threadId-u0MOvyAV.js`),__vite__mapDeps([5,3,1,4])),`component`)}),yA=Hi(`/dashboards/`)({component:Ui(()=>hA(()=>import(`./dashboards.index-D-Z1PEHh.js`),__vite__mapDeps([6,1,7,4])),`component`)}),bA=Hi(`/dashboards/$dashboardId`)({component:Ui(()=>hA(()=>import(`./dashboards._dashboardId-DCQxYJDK.js`),__vite__mapDeps([8,1,7,4])),`component`)}),xA=gA.update({id:`/`,path:`/`,getParentRoute:()=>dA}),SA=_A.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>dA}),CA=vA.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>dA}),wA=yA.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>dA}),TA={IndexRoute:xA,ChatThreadIdRoute:CA,DashboardsDashboardIdRoute:bA.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>dA}),ChatIndexRoute:SA,DashboardsIndexRoute:wA},EA=oa({routeTree:dA._addFileChildren(TA)._addFileTypes(),defaultPreload:`intent`,scrollRestoration:!0}),DA=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],OA=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],kA=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],AA=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],jA=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],MA=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],NA={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#565b69`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#a4abb4`}},PA={dark:[`#66d0ee`,`#a97ce0`,`#5fe8ce`,`#cb55e8`,`#41b6f8`,`#d2a6ff`],light:[`#2b93b5`,`#7c4dcc`,`#1a9c86`,`#a12fbf`,`#2f7fd4`,`#9163d6`]},FA={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},IA={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:DA,brand:OA,ok:kA,warn:AA,bad:jA,info:MA},defaultRadius:`md`,fontFamily:FA.body,fontFamilyMonospace:FA.display,headings:{fontFamily:FA.body,fontWeight:`600`},cursorType:`pointer`},LA=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":NA.light.muted},dark:{}}),RA=Eo(IA);(0,q_.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(To,{theme:RA,defaultColorScheme:`auto`,cssVariablesResolver:LA,children:(0,R.jsx)(la,{router:EA})})}));export{kh as A,eo as B,gD as C,nD as D,AD as E,jd as F,fa as G,Ea as H,Ku as I,xi as K,fo as L,$p as M,zp as N,Xh as O,zd as P,io as R,PD as S,bD as T,ma as U,Ka as V,pa as W,ik as _,PA as a,cO as b,hA as c,Nk as d,Fk as f,ck as g,fk as h,kA as i,ph as j,Yh as k,Xk as l,xk as m,NA as n,AA as o,wk as p,bi as q,MA as r,bA as s,jA as t,Lk as u,KO as v,cD as w,RD as x,TO as y,to as z}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-D0PVhqdW.js b/internal/ui/dist/assets/mcp-app-frame-BOSJ7bPK.js similarity index 99% rename from internal/ui/dist/assets/mcp-app-frame-D0PVhqdW.js rename to internal/ui/dist/assets/mcp-app-frame-BOSJ7bPK.js index 37ab0934d..4f480bf8f 100644 --- a/internal/ui/dist/assets/mcp-app-frame-D0PVhqdW.js +++ b/internal/ui/dist/assets/mcp-app-frame-BOSJ7bPK.js @@ -1,4 +1,4 @@ -import{_ as e,_t as t,bt as n,d as r,f as i,gt as a,ht as o,l as s,pt as c,vt as l,x as u,xt as d,yt as f}from"./brand-CCB4_HD8.js";import{L as p,m}from"./index-BxnvJp0Y.js";function h(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function g(e,t=`|`){return e.map(e=>se(e)).join(t)}function _(e,t){return typeof t==`bigint`?t.toString():t}function v(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function y(e){return e==null}function b(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function x(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){};function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var re=v(()=>{if(Ke.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function T(e){if(w(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return w(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ie(e){return T(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ae=new Set([`string`,`number`,`symbol`]);function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function se(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var le={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ue(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&S(e,r,n.shape[r])}return S(this,`shape`,e),e},checks:[]}))}function de(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return S(this,`shape`,r),r},checks:[]}))}function fe(e,t){if(!T(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function pe(e,t){if(!T(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function me(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return S(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function he(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return S(this,`shape`,i),i},checks:[]}))}function ge(e,t,n){return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return S(this,`shape`,i),i}}))}function _e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function be(e){return typeof e==`string`?e:e?.message}function xe(e,t,n){var r;for(let i=t;ie;return t[Le]=!0,t}var ze,Be=Object.freeze({status:`aborted`}),Ve={value:void 0,enumerable:!1},He=`captureStackTrace`in Error?Error:null;function Ue(e){let t=He;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return He=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function k(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Oe(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ue(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var We=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ge=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ze=globalThis).__zod_globalConfig??(ze.__zod_globalConfig={});var Ke=globalThis.__zod_globalConfig;function qe(e){return e&&Object.assign(Ke,e),Ke}function Je(){let e=this._zod;return e.message??=JSON.stringify(e.def,_,2),e.message}function Ye(e){this._zod.message=e}var Xe={get:Je,set:Ye,enumerable:!0,configurable:!0},Ze={value:void 0,enumerable:!1},Qe={value:void 0,enumerable:!1},$e=new WeakSet([Object.prototype,Error.prototype]),et=(e,t)=>{e.name=`$ZodError`,Ze.value=e._zod,Object.defineProperty(e,"_zod",Ze),Qe.value=t,Object.defineProperty(e,"issues",Qe),Ze.value=void 0,Qe.value=void 0,Object.defineProperty(e,"message",Xe);let n=Object.getPrototypeOf(e);$e.has(n)||($e.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},tt=k(`$ZodError`,et),nt=k(`$ZodError`,et,void 0,{Parent:Error});function rt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function it(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?rt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function at(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new We;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},ct=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},lt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new We;return a.issues.length?{success:!1,error:new(e??tt)(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ut=lt(nt),dt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ft=dt(nt),pt=e=>{let t=st(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ot(n,a))};return n},mt=e=>{let t=st(e),n=(e,r,i,a)=>t(e,r,i,ot(n,a));return n},ht=e=>{let t=ct(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ot(n,a))};return n},gt=e=>{let t=ct(e),n=async(e,r,i,a)=>await t(e,r,i,ot(n,a));return n},_t=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lt(e)(t,n,i)},vt=e=>(t,n,r)=>lt(e)(t,n,r),yt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dt(e)(t,n,i)},bt=e=>async(t,n,r)=>dt(e)(t,n,r),xt=/^[cC][0-9a-z]{6,}$/,St=/^[0-9a-z]+$/,Ct=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wt=/^[0-9a-vA-V]{20}$/,Tt=/^[A-Za-z0-9]{27}$/,Et=/^[a-zA-Z0-9_-]{21}$/;function Dt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ot=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,At=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mt=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Nt(){return new RegExp(Mt,`u`)}var Pt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,It=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Lt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zt=/^[A-Za-z0-9_-]*$/,Bt=/^https?$/,Vt=/^\+[1-9]\d{6,14}$/,Ht=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Ut(e){return RegExp(`^${e}$`)}var Wt=Ut(Ht);function Gt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kt(e){return RegExp(`^${Gt(e)}$`)}function qt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Gt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Gt({precision:e.precision})}`:n;return RegExp(`^${Ht}T(?:${r})$`)}var Jt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Yt=/^-?\d+$/,Xt=/^-?\d+(?:\.\d+)?$/,Zt=/^(?:true|false)$/i,Qt=/^null$/i,$t=/^undefined$/i,en=/^[^A-Z]*$/,tn=/^[^a-z]*$/,nn=k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rn=e=>{let t=e.value;return!y(t)&&t.length!==void 0},an={number:`number`,bigint:`bigint`,object:`date`},on=k(`$ZodCheckLessThan`,(e,t)=>{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:an[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cn=k(`$ZodCheckMultipleOf`,(e,t)=>{nn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):x(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ln=k(`$ZodCheckNumberFormat`,(e,t)=>{nn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=le[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Yt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),un=k(`$ZodCheckMaxLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?we(r):i)<=t.maximum)return;let a=Te(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),dn=k(`$ZodCheckMinLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=Te(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fn=k(`$ZodCheckLengthEquals`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?we(r):i;if(a===t.length)return;let o=Te(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),pn=k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;nn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),mn=k(`$ZodCheckRegex`,(e,t)=>{pn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hn=k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=en,pn.init(e,t)}),gn=k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=tn,pn.init(e,t)}),_n=k(`$ZodCheckIncludes`,(e,t)=>{nn.init(e,t);let n=oe(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),vn=k(`$ZodCheckStartsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`^${oe(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),yn=k(`$ZodCheckEndsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`.*${oe(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),bn=k(`$ZodCheckOverwrite`,(e,t)=>{nn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),xn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` +import{_ as e,_t as t,bt as n,d as r,f as i,gt as a,ht as o,l as s,pt as c,vt as l,x as u,xt as d,yt as f}from"./brand-CCB4_HD8.js";import{L as p,m}from"./index-DSdcpqnK.js";function h(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function g(e,t=`|`){return e.map(e=>se(e)).join(t)}function _(e,t){return typeof t==`bigint`?t.toString():t}function v(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function y(e){return e==null}function b(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function x(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){};function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var re=v(()=>{if(Ke.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function T(e){if(w(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return w(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ie(e){return T(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ae=new Set([`string`,`number`,`symbol`]);function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function se(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var le={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ue(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&S(e,r,n.shape[r])}return S(this,`shape`,e),e},checks:[]}))}function de(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return E(e,C(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return S(this,`shape`,r),r},checks:[]}))}function fe(e,t){if(!T(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function pe(e,t){if(!T(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function me(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return S(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function he(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return S(this,`shape`,i),i},checks:[]}))}function ge(e,t,n){return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return S(this,`shape`,i),i}}))}function _e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function be(e){return typeof e==`string`?e:e?.message}function xe(e,t,n){var r;for(let i=t;ie;return t[Le]=!0,t}var ze,Be=Object.freeze({status:`aborted`}),Ve={value:void 0,enumerable:!1},He=`captureStackTrace`in Error?Error:null;function Ue(e){let t=He;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return He=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function k(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Oe(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ue(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var We=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ge=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ze=globalThis).__zod_globalConfig??(ze.__zod_globalConfig={});var Ke=globalThis.__zod_globalConfig;function qe(e){return e&&Object.assign(Ke,e),Ke}function Je(){let e=this._zod;return e.message??=JSON.stringify(e.def,_,2),e.message}function Ye(e){this._zod.message=e}var Xe={get:Je,set:Ye,enumerable:!0,configurable:!0},Ze={value:void 0,enumerable:!1},Qe={value:void 0,enumerable:!1},$e=new WeakSet([Object.prototype,Error.prototype]),et=(e,t)=>{e.name=`$ZodError`,Ze.value=e._zod,Object.defineProperty(e,"_zod",Ze),Qe.value=t,Object.defineProperty(e,"issues",Qe),Ze.value=void 0,Qe.value=void 0,Object.defineProperty(e,"message",Xe);let n=Object.getPrototypeOf(e);$e.has(n)||($e.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},tt=k(`$ZodError`,et),nt=k(`$ZodError`,et,void 0,{Parent:Error});function rt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function it(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?rt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function at(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new We;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},ct=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},lt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new We;return a.issues.length?{success:!1,error:new(e??tt)(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ut=lt(nt),dt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ft=dt(nt),pt=e=>{let t=st(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ot(n,a))};return n},mt=e=>{let t=st(e),n=(e,r,i,a)=>t(e,r,i,ot(n,a));return n},ht=e=>{let t=ct(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ot(n,a))};return n},gt=e=>{let t=ct(e),n=async(e,r,i,a)=>await t(e,r,i,ot(n,a));return n},_t=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lt(e)(t,n,i)},vt=e=>(t,n,r)=>lt(e)(t,n,r),yt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dt(e)(t,n,i)},bt=e=>async(t,n,r)=>dt(e)(t,n,r),xt=/^[cC][0-9a-z]{6,}$/,St=/^[0-9a-z]+$/,Ct=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wt=/^[0-9a-vA-V]{20}$/,Tt=/^[A-Za-z0-9]{27}$/,Et=/^[a-zA-Z0-9_-]{21}$/;function Dt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ot=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,At=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mt=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Nt(){return new RegExp(Mt,`u`)}var Pt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,It=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Lt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zt=/^[A-Za-z0-9_-]*$/,Bt=/^https?$/,Vt=/^\+[1-9]\d{6,14}$/,Ht=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Ut(e){return RegExp(`^${e}$`)}var Wt=Ut(Ht);function Gt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kt(e){return RegExp(`^${Gt(e)}$`)}function qt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Gt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Gt({precision:e.precision})}`:n;return RegExp(`^${Ht}T(?:${r})$`)}var Jt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Yt=/^-?\d+$/,Xt=/^-?\d+(?:\.\d+)?$/,Zt=/^(?:true|false)$/i,Qt=/^null$/i,$t=/^undefined$/i,en=/^[^A-Z]*$/,tn=/^[^a-z]*$/,nn=k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rn=e=>{let t=e.value;return!y(t)&&t.length!==void 0},an={number:`number`,bigint:`bigint`,object:`date`},on=k(`$ZodCheckLessThan`,(e,t)=>{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:an[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cn=k(`$ZodCheckMultipleOf`,(e,t)=>{nn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):x(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ln=k(`$ZodCheckNumberFormat`,(e,t)=>{nn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=le[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Yt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),un=k(`$ZodCheckMaxLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?we(r):i)<=t.maximum)return;let a=Te(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),dn=k(`$ZodCheckMinLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=Te(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fn=k(`$ZodCheckLengthEquals`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?we(r):i;if(a===t.length)return;let o=Te(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),pn=k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;nn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),mn=k(`$ZodCheckRegex`,(e,t)=>{pn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hn=k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=en,pn.init(e,t)}),gn=k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=tn,pn.init(e,t)}),_n=k(`$ZodCheckIncludes`,(e,t)=>{nn.init(e,t);let n=oe(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),vn=k(`$ZodCheckStartsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`^${oe(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),yn=k(`$ZodCheckEndsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`.*${oe(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),bn=k(`$ZodCheckOverwrite`,(e,t)=>{nn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),xn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(` `)}\n};`)(...Object.values(this.closed))}},Sn={major:4,minor:5,patch:4},A=k(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Sn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=_e(t),a;for(let o of n){if(o._zod.def.when){if(ve(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new We;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(xe(t.issues,n,e),i||=_e(t,n))});else{if(t.issues.length===n)continue;xe(t.issues,n,e),i||=_e(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(_e(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new We;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new We;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Ae(this,`~standard`,wn(this))},set"~standard"(e){ke(this,`~standard`,e)}}),Cn=e=>e.success?{value:e.data}:{issues:e.error?.issues};function wn(e){return{validate:t=>{try{return Cn(ut(e,t))}catch{return ft(e,t).then(Cn)}},vendor:`zod`,version:1}}var Tn=k(`$ZodString`,(e,t)=>{A.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Jt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),j=k(`$ZodStringFormat`,(e,t)=>{pn.init(e,t),Tn.init(e,t)}),En=k(`$ZodGUID`,(e,t)=>{t.pattern??=kt,j.init(e,t)}),Dn=k(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=At(e)}else t.pattern??=At();j.init(e,t)}),On=k(`$ZodEmail`,(e,t)=>{t.pattern??=jt,j.init(e,t)});function kn(e,t){if(!t.normalize&&t.protocol?.source===Bt.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var An=/[\t\n\r]/g;function jn(e){return e.replace(An,``)}function Mn(e,t){return t.lastIndex=0,t.test(e.hostname)}function Nn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Pn=k(`$ZodURL`,(e,t)=>{j.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=kn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Mn(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Nn(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:jn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Fn=k(`$ZodEmoji`,(e,t)=>{t.pattern??=Nt(),j.init(e,t)}),In=k(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Et:Dt(t.length),j.init(e,t)}),Ln=k(`$ZodCUID`,(e,t)=>{t.pattern??=xt,j.init(e,t)}),Rn=k(`$ZodCUID2`,(e,t)=>{t.pattern??=St,j.init(e,t)}),zn=k(`$ZodULID`,(e,t)=>{t.pattern??=Ct,j.init(e,t)}),Bn=k(`$ZodXID`,(e,t)=>{t.pattern??=wt,j.init(e,t)}),Vn=k(`$ZodKSUID`,(e,t)=>{t.pattern??=Tt,j.init(e,t)}),Hn=k(`$ZodISODateTime`,(e,t)=>{t.pattern??=qt(t),j.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),Un=k(`$ZodISODate`,(e,t)=>{t.pattern??=Wt,j.init(e,t)}),Wn=k(`$ZodISOTime`,(e,t)=>{t.pattern??=Kt(t),j.init(e,t)}),Gn=k(`$ZodISODuration`,(e,t)=>{t.pattern??=Ot,j.init(e,t)}),Kn=k(`$ZodIPv4`,(e,t)=>{t.pattern??=Pt,j.init(e,t),e._zod.bag.format=`ipv4`}),qn=/^[0-9a-fA-F:.]+$/;function Jn(e){if(!qn.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Yn=k(`$ZodIPv6`,(e,t)=>{t.pattern??=Ft,j.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Xn=k(`$ZodCIDRv4`,(e,t)=>{t.pattern??=It,j.init(e,t)});function Zn(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Jn(n)}var Qn=k(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Lt,j.init(e,t),e._zod.check=n=>{Zn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function $n(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var er=k(`$ZodBase64`,(e,t)=>{t.pattern??=Rt,j.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{$n(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function tr(e){if(!zt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return $n(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var nr=k(`$ZodBase64URL`,(e,t)=>{t.pattern??=zt,j.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{tr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),rr=k(`$ZodE164`,(e,t)=>{t.pattern??=Vt,j.init(e,t)});function ir(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var ar=k(`$ZodJWT`,(e,t)=>{j.init(e,t),e._zod.check=n=>{ir(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),or=k(`$ZodNumber`,(e,t)=>{A.init(e,t),e._zod.pattern=e._zod.bag.pattern??Xt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),sr=k(`$ZodNumberFormat`,(e,t)=>{ln.init(e,t),or.init(e,t)}),cr=k(`$ZodBoolean`,(e,t)=>{A.init(e,t),e._zod.pattern=Zt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),lr=k(`$ZodUndefined`,(e,t)=>{A.init(e,t),e._zod.pattern=$t,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),ur=k(`$ZodNull`,(e,t)=>{A.init(e,t),e._zod.pattern=Qt,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),dr=k(`$ZodAny`,(e,t)=>{A.init(e,t),e._zod.parse=e=>e}),fr=k(`$ZodUnknown`,(e,t)=>{A.init(e,t),e._zod.parse=e=>e}),pr=k(`$ZodNever`,(e,t)=>{A.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function mr(e,t,n){e.issues.length&&t.issues.push(...ye(n,e.issues)),t.value[n]=e.value}var hr=k(`$ZodArray`,(e,t)=>{A.init(e,t);let n=Ke.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;emr(t,r,e))):mr(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function gr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...ye(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}var _r=[];function vr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:_r,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ce(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function yr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>gr(e,n,i,t,u,d))):gr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var br=new WeakMap,xr=k(`$ZodObject`,(e,t)=>{if(A.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;br.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),br.set(t,n),n}})}let n=v(()=>vr(t));O(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||S(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=w,i=t.catchall,a,o=Ke.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>gr(n,t,e,c,r,i))):gr(a,t,e,c,r,i)}return i?yr(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),Sr=k(`$ZodObjectJIT`,(e,t)=>{xr.init(e,t);let n=e._zod.parse,r=v(()=>vr(t)),i=Ke.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new xn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>` for (let i = 0; i < ${e}.issues.length; i++) { diff --git a/internal/ui/dist/assets/routes-DdP3ZNeG.js b/internal/ui/dist/assets/routes-C2A3xwKL.js similarity index 84% rename from internal/ui/dist/assets/routes-DdP3ZNeG.js rename to internal/ui/dist/assets/routes-C2A3xwKL.js index 133cbeee2..46cb5d556 100644 --- a/internal/ui/dist/assets/routes-DdP3ZNeG.js +++ b/internal/ui/dist/assets/routes-C2A3xwKL.js @@ -1 +1 @@ -import{pt as e}from"./brand-CCB4_HD8.js";import{K as t,p as n}from"./index-BxnvJp0Y.js";var r=e();function i(){let{agent_available:e}=n();if(!e)return(0,r.jsx)(t,{to:`/dashboards`,replace:!0});let i=localStorage.getItem(`fanout.thread-id`);return i?(localStorage.removeItem(`fanout.thread-id`),(0,r.jsx)(t,{to:`/chat/$threadId`,params:{threadId:i},replace:!0})):(0,r.jsx)(t,{to:`/chat`,replace:!0})}export{i as component}; \ No newline at end of file +import{pt as e}from"./brand-CCB4_HD8.js";import{K as t,p as n}from"./index-DSdcpqnK.js";var r=e();function i(){let{agent_available:e}=n();if(!e)return(0,r.jsx)(t,{to:`/dashboards`,replace:!0});let i=localStorage.getItem(`fanout.thread-id`);return i?(localStorage.removeItem(`fanout.thread-id`),(0,r.jsx)(t,{to:`/chat/$threadId`,params:{threadId:i},replace:!0})):(0,r.jsx)(t,{to:`/chat`,replace:!0})}export{i as component}; \ No newline at end of file diff --git a/internal/ui/dist/index.html b/internal/ui/dist/index.html index 7251795c3..afd4875e4 100644 --- a/internal/ui/dist/index.html +++ b/internal/ui/dist/index.html @@ -21,7 +21,7 @@ document.documentElement.setAttribute("data-mantine-color-scheme", computed); } catch (e) {} - + diff --git a/ui/host/src/widgets/configure.tsx b/ui/host/src/widgets/configure.tsx index d48cf3bc0..e1773c0e9 100644 --- a/ui/host/src/widgets/configure.tsx +++ b/ui/host/src/widgets/configure.tsx @@ -11,7 +11,7 @@ const fields: Partial> = { topology: ["service"], performance: ["service"], logs: ["service", "severity", "search"], - trace: ["trace_id"], + trace: ["trace_id", "service"], }; // The server is the source of widget types, so a widget's stored type can be diff --git a/ui/host/src/widgets/trace.tsx b/ui/host/src/widgets/trace.tsx index d95012031..14776d86f 100644 --- a/ui/host/src/widgets/trace.tsx +++ b/ui/host/src/widgets/trace.tsx @@ -11,7 +11,10 @@ import type { WidgetBodyProps } from "./widget-card"; function shortID(value: string) { return value.length > 12 ? `${value.slice(0, 8)}…${value.slice(-4)}` : value; } export default function TraceWidget({ widget, filters, dark }: WidgetBodyProps) { - const trace = useObservability("trace", widgetParams(filters, widget.config, ["trace_id"])); + // service is forwarded as well as trace_id: without it a widget titled after + // one service picks the slowest or most broken trace in the whole window, + // which is usually some other service entirely. + const trace = useObservability("trace", widgetParams(filters, widget.config, ["trace_id", "service"])); if (trace.isError) return void trace.refetch()} />; const data = trace.data?.data; if (data && data.spans.length === 0) return ; diff --git a/ui/host/src/widgets/widgets.test.tsx b/ui/host/src/widgets/widgets.test.tsx index 5e3aafe9d..15b0aae52 100644 --- a/ui/host/src/widgets/widgets.test.tsx +++ b/ui/host/src/widgets/widgets.test.tsx @@ -86,6 +86,17 @@ describe("widgets", () => { await act(async () => root.unmount()); }); + it("trace scopes its query to the configured service", async () => { + const root = await mount({ id: "w5b", type: "trace", title: "Slow checkout trace", enabled: true, config: { service: "payments" } }); + await vi.waitFor(() => expect(fetchMock).toHaveBeenCalled()); + const requested = fetchMock.mock.calls.map(([input]) => String(input)).filter((url) => url.includes("/api/observability/trace")); + expect(requested.length).toBeGreaterThan(0); + // Without this the widget asks for the worst trace anywhere in the window, + // which is rarely the service the widget is named after. + expect(requested.every((url) => new URL(url, "http://localhost").searchParams.get("service") === "payments")).toBe(true); + await act(async () => root.unmount()); + }); + it("topology draws a graph and counts routes", async () => { const root = await mount({ id: "w2", type: "topology", title: "Service map", enabled: true }); await vi.waitFor(() => expect(document.body.textContent).toContain("2 services · 1 route")); From 9107929bb0ee81b8a9b83a90a78e40d3f2643b8f Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 6 Sep 2026 17:43:44 -0700 Subject: [PATCH 5/8] fix(rollup): grade a service on its own work, not on what it waits for MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit service_rollup took p50 and p95 over every span a service emitted, so a subscription held open by design set the service's latency. On the demo, fraud-detection, product-reviews, ad and recommendation each carry a CLIENT span of exactly 600s — their subscription to flagd's EventStream — and each was marked unhealthy for it while serving requests in single-digit milliseconds. Nine of twenty services were red, which is also why the demo's headline read "Unhealthy" continuously. Latency percentiles now exclude CLIENT and PRODUCER spans, which measure a dependency rather than the service's own work. Error rate still counts every span: a failing outbound call is the caller's problem too. A service that only makes outbound calls — a load generator, a cron worker — falls back to all of its spans rather than reporting no latency at all. Genuinely slow work is untouched: frontend's 103s POST /api/checkout is a SERVER span and still counts. flagd holds 600s server-side event streams and will stay unhealthy until streaming spans are classified separately; that is a narrower problem than this one and is left for its own change. Buckets already rolled up keep their old values; new buckets use the new definition. Reported in #232 (P0 item 5). Stacked on fix/trace-widget-service-scope. Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk --- internal/query/duck.go | 21 ++++++++++++-- internal/query/rollup_test.go | 54 +++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/internal/query/duck.go b/internal/query/duck.go index 0198bf80e..424fa3b88 100644 --- a/internal/query/duck.go +++ b/internal/query/duck.go @@ -1259,8 +1259,25 @@ span_agg AS ( date_trunc('minute', s.start_time) AS bucket, s.service, COUNT(*) AS spans, - quantile_cont(s.duration_ms, 0.50) AS p50_ms, - quantile_cont(s.duration_ms, 0.95) AS p95_ms, + -- Latency describes the work a service performs, not the calls it waits + -- on. A CLIENT or PRODUCER span measures a dependency: a subscription held + -- open for ten minutes makes its subscriber look broken while saying + -- nothing about how that subscriber serves anyone. Grading on those is what + -- marked half the demo's services unhealthy for holding a flagd event + -- stream open. Error rate still counts every span, because a failing + -- outbound call is the caller's problem too. + -- + -- COALESCE keeps a service that only makes outbound calls — a load + -- generator, a cron worker — measured on what it does have rather than + -- silently reported as having no latency at all. + COALESCE( + quantile_cont(s.duration_ms, 0.50) FILTER (WHERE COALESCE(s.kind, '') NOT IN ('SPAN_KIND_CLIENT', 'SPAN_KIND_PRODUCER')), + quantile_cont(s.duration_ms, 0.50) + ) AS p50_ms, + COALESCE( + quantile_cont(s.duration_ms, 0.95) FILTER (WHERE COALESCE(s.kind, '') NOT IN ('SPAN_KIND_CLIENT', 'SPAN_KIND_PRODUCER')), + quantile_cont(s.duration_ms, 0.95) + ) AS p95_ms, avg(CASE WHEN s.status IN ('STATUS_CODE_ERROR', 'ERROR') THEN 1.0 ELSE 0.0 END) AS error_rate FROM spans s JOIN affected a diff --git a/internal/query/rollup_test.go b/internal/query/rollup_test.go index 4c4b3e510..79e74c054 100644 --- a/internal/query/rollup_test.go +++ b/internal/query/rollup_test.go @@ -3,6 +3,7 @@ package query import ( "context" "database/sql" + "fmt" "testing" "time" @@ -81,6 +82,59 @@ WHERE bucket = ? AND service = 'checkout'`, bucket, 2) } +func TestServiceRollupLatencyExcludesDependencyWaits(t *testing.T) { + db := openTestDuck(t) + if err := CreateTables(db); err != nil { + t.Fatalf("CreateTables failed: %v", err) + } + if err := CreateViews(db); err != nil { + t.Fatalf("CreateViews failed: %v", err) + } + d := &Duck{DB: db, cfg: config.Config{RetentionDays: 30}} + ctx := context.Background() + bucket := time.Now().UTC().Truncate(time.Minute).Add(-2 * time.Minute) + + // A subscriber holding a ten-minute stream open while serving fast + // requests: the CLIENT spans are the wait, the SERVER spans are the work. + for i := range 3 { + insertRollupTestSpan(t, db, rollupTestSpan{ + namespace: "ns", traceID: "t-sub", spanID: fmt.Sprintf("stream-%d", i), service: "reviews", + operation: "flagd.evaluation.v1.Service/EventStream", kind: "SPAN_KIND_CLIENT", + start: bucket.Add(time.Duration(i) * time.Second), duration: 10 * time.Minute, ingested: int64(100 + i), + }) + insertRollupTestSpan(t, db, rollupTestSpan{ + namespace: "ns", traceID: "t-req", spanID: fmt.Sprintf("serve-%d", i), service: "reviews", + operation: "GET /reviews", kind: "SPAN_KIND_SERVER", + start: bucket.Add(time.Duration(i) * time.Second), duration: 40 * time.Millisecond, ingested: int64(200 + i), + }) + } + // A service that only ever calls out still needs a number. + insertRollupTestSpan(t, db, rollupTestSpan{ + namespace: "ns", traceID: "t-gen", spanID: "gen-1", service: "load-generator", + operation: "GET /", kind: "SPAN_KIND_CLIENT", + start: bucket.Add(4 * time.Second), duration: 250 * time.Millisecond, ingested: 300, + }) + + if _, err := d.rollupOnce(ctx); err != nil { + t.Fatalf("rollupOnce failed: %v", err) + } + + p95 := func(service string) float64 { + t.Helper() + var value float64 + if err := db.QueryRow(`SELECT p95_ms FROM service_rollup WHERE namespace = 'ns' AND bucket = ? AND service = ?`, bucket, service).Scan(&value); err != nil { + t.Fatalf("query p95 for %s: %v", service, err) + } + return value + } + if got := p95("reviews"); got > 100 { + t.Fatalf("reviews p95 = %.1fms, want the served requests (~40ms) rather than the stream it subscribes to", got) + } + if got := p95("load-generator"); got < 200 { + t.Fatalf("load-generator p95 = %.1fms, want its outbound calls to still count when it has nothing else", got) + } +} + func TestRollupOnceRebuildsAffectedEndpointBuckets(t *testing.T) { db := openTestDuck(t) if err := CreateTables(db); err != nil { From 3f1556d02a4fa923ad5709e2da86fdbbddbfba3d Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 6 Sep 2026 18:40:44 -0700 Subject: [PATCH 6/8] fix(rollup): a bucket of pure waiting must not decide the window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Excluding CLIENT and PRODUCER spans inside each bucket was not enough on its own. A minute in which a held-open subscription is the only span still has to report something, so it fell back to that subscription — and since a service's window P95 is the maximum across its buckets, that one minute decided the whole window anyway. Running the change against a local build showed reviews still reporting 600000ms and still marked unhealthy, which is the symptom this was supposed to remove. service_rollup now records served_spans, the count of spans describing work the service performed. Readers prefer the buckets that have some, and fall back to the rest only when a service served nothing all window — a load generator keeps its 250ms rather than reporting a flat zero, which would read as healthy for the same reason an empty window used to. Verified against a local instance: reviews now reports 48ms and healthy while holding three ten-minute subscriptions, load-generator keeps 250ms, and checkout's genuinely slow 9s served request still marks it unhealthy. Reported in #232 (P0 item 5). Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk --- internal/alert/engine.go | 7 ++- internal/alert/engine_env_test.go | 6 +-- internal/observability/latency_read_test.go | 60 +++++++++++++++++++++ internal/observability/latency_sql.go | 22 ++++++++ internal/observability/namespace_test.go | 5 +- internal/observability/overview.go | 6 +-- internal/observability/performance.go | 16 +++--- internal/query/duck.go | 3 ++ internal/query/views.go | 6 ++- 9 files changed, 112 insertions(+), 19 deletions(-) create mode 100644 internal/observability/latency_read_test.go create mode 100644 internal/observability/latency_sql.go diff --git a/internal/alert/engine.go b/internal/alert/engine.go index 0d75279b6..72694a0f4 100644 --- a/internal/alert/engine.go +++ b/internal/alert/engine.go @@ -421,7 +421,8 @@ func (e *Engine) buildEnvs(ctx context.Context) map[string]AlertEnv { WITH current AS ( SELECT service, avg(error_rate) as error_rate, - avg(p50_ms) as p50, avg(p95_ms) as p95, + COALESCE(avg(p50_ms) FILTER (WHERE served_spans > 0), avg(p50_ms)) as p50, + COALESCE(avg(p95_ms) FILTER (WHERE served_spans > 0), avg(p95_ms)) as p95, sum(spans) as throughput, sum(log_count) as log_count FROM service_rollup WHERE bucket >= (SELECT max(bucket) FROM service_rollup) - INTERVAL '5 minutes' @@ -429,7 +430,9 @@ WITH current AS ( ), previous AS ( SELECT service, - avg(error_rate) as error_rate, avg(p95_ms) as p95, sum(spans) as throughput + avg(error_rate) as error_rate, + COALESCE(avg(p95_ms) FILTER (WHERE served_spans > 0), avg(p95_ms)) as p95, + sum(spans) as throughput FROM service_rollup WHERE bucket >= (SELECT max(bucket) FROM service_rollup) - INTERVAL '10 minutes' AND bucket < (SELECT max(bucket) FROM service_rollup) - INTERVAL '5 minutes' diff --git a/internal/alert/engine_env_test.go b/internal/alert/engine_env_test.go index 70472e0ea..e6cae5279 100644 --- a/internal/alert/engine_env_test.go +++ b/internal/alert/engine_env_test.go @@ -27,15 +27,15 @@ func TestBuildEnvs_IntegerSumsSurviveHugeint(t *testing.T) { if _, err := db.Exec(` CREATE TABLE service_rollup ( namespace VARCHAR, bucket TIMESTAMP, service VARCHAR, - spans BIGINT, error_rate DOUBLE, p50_ms DOUBLE, p95_ms DOUBLE, + spans BIGINT, served_spans BIGINT, error_rate DOUBLE, p50_ms DOUBLE, p95_ms DOUBLE, log_count BIGINT, metric_count BIGINT )`); err != nil { t.Fatalf("create service_rollup: %v", err) } if _, err := db.Exec(` INSERT INTO service_rollup VALUES - ('', now(), 'svc-a', 100, 0.0, 10.0, 20.0, 5, 0), - ('', now() - INTERVAL 1 MINUTE, 'svc-a', 100, 0.0, 10.0, 20.0, 5, 0)`); err != nil { + ('', now(), 'svc-a', 100, 100, 0.0, 10.0, 20.0, 5, 0), + ('', now() - INTERVAL 1 MINUTE, 'svc-a', 100, 100, 0.0, 10.0, 20.0, 5, 0)`); err != nil { t.Fatalf("seed service_rollup: %v", err) } diff --git a/internal/observability/latency_read_test.go b/internal/observability/latency_read_test.go new file mode 100644 index 000000000..87a62390e --- /dev/null +++ b/internal/observability/latency_read_test.go @@ -0,0 +1,60 @@ +package observability + +import ( + "context" + "database/sql" + "testing" + "time" + + _ "github.com/duckdb/duckdb-go/v2" +) + +// A bucket holding nothing but calls the service was waiting on must not decide +// the window. Excluding those spans inside the bucket is not enough on its own: +// a minute in which a ten-minute subscription is the only span still has to +// report something, and that something would otherwise become the service's +// worst bucket and its health. +func TestOverviewPrefersBucketsWhereTheServiceServedSomething(t *testing.T) { + db, err := sql.Open("duckdb", "") + if err != nil { + t.Fatalf("open duckdb: %v", err) + } + t.Cleanup(func() { _ = db.Close() }) + if _, err := db.Exec(` +CREATE TABLE service_rollup ( + namespace VARCHAR, bucket TIMESTAMP, service VARCHAR, + spans BIGINT, served_spans BIGINT, error_rate DOUBLE, p50_ms DOUBLE, p95_ms DOUBLE, + log_count BIGINT, metric_count BIGINT +)`); err != nil { + t.Fatalf("create service_rollup: %v", err) + } + + now := time.Now().UTC().Truncate(time.Minute) + if _, err := db.Exec(`INSERT INTO service_rollup VALUES + ('', ?, 'reviews', 1, 0, 0, 600000, 600000, 0, 0), + ('', ?, 'reviews', 20, 20, 0, 30, 40, 0, 0), + ('', ?, 'generator', 5, 0, 0, 250, 250, 0, 0)`, + now.Add(-3*time.Minute), now.Add(-time.Minute), now.Add(-time.Minute)); err != nil { + t.Fatalf("seed service_rollup: %v", err) + } + + svc := New(SQLDB(db), newTestRepository(t).Parquet, 30) + result, err := svc.Overview(context.Background(), Scope{Start: now.Add(-time.Hour), End: now.Add(time.Minute)}, 50) + if err != nil { + t.Fatalf("Overview: %v", err) + } + got := map[string]ServiceHealth{} + for _, service := range result.Data.Services { + got[service.Service] = service + } + if p95 := got["reviews"].P95MS; p95 > 100 { + t.Fatalf("reviews p95 = %.0fms, want the minute it served (40ms), not the subscription it was holding", p95) + } + if got["reviews"].Health != HealthHealthy { + t.Fatalf("reviews health = %q, want healthy", got["reviews"].Health) + } + // A service that served nothing all window keeps the only number it has. + if p95 := got["generator"].P95MS; p95 != 250 { + t.Fatalf("generator p95 = %.0fms, want 250ms rather than a flat zero", p95) + } +} diff --git a/internal/observability/latency_sql.go b/internal/observability/latency_sql.go new file mode 100644 index 000000000..a961a8cc4 --- /dev/null +++ b/internal/observability/latency_sql.go @@ -0,0 +1,22 @@ +package observability + +// A service's latency is read from the buckets in which it actually served +// something. service_rollup stores percentiles that already exclude the calls a +// service was waiting on, but a bucket holding nothing except such calls has no +// served latency to report and falls back to them — a subscription held open +// for ten minutes would otherwise decide the service's whole window. +// +// Preferring served buckets keeps that bucket out of the answer while leaving a +// service that served nothing all window — a load generator, a cron worker — +// measured on what it does have instead of reporting a flat zero. +const ( + // windowP95SQL aggregates p95 across buckets. MAX, not an average: the + // worst bucket is the one worth knowing about. + windowP95SQL = `COALESCE(MAX(p95_ms) FILTER (WHERE served_spans > 0), MAX(p95_ms), 0)` + + // windowP50SQL weights each bucket by the spans it holds. + windowP50SQL = `COALESCE( + SUM(p50_ms * spans) FILTER (WHERE served_spans > 0) / NULLIF(SUM(spans) FILTER (WHERE served_spans > 0), 0), + SUM(p50_ms * spans) / NULLIF(SUM(spans), 0), + 0)` +) diff --git a/internal/observability/namespace_test.go b/internal/observability/namespace_test.go index 21ed75a16..7e60d36e3 100644 --- a/internal/observability/namespace_test.go +++ b/internal/observability/namespace_test.go @@ -22,6 +22,7 @@ CREATE TABLE service_rollup ( namespace VARCHAR, service VARCHAR, spans BIGINT, + served_spans BIGINT, error_rate DOUBLE, p50_ms DOUBLE, p95_ms DOUBLE, @@ -33,8 +34,8 @@ CREATE TABLE service_rollup ( stamp := time.Date(2026, 8, 23, 20, 0, 0, 0, time.UTC) if _, err := db.Exec(`INSERT INTO service_rollup VALUES - (?, 'prod', 'checkout', 2, 0, 10, 20, 1, 1), - (?, 'staging', 'catalog', 3, 0, 10, 20, 1, 1)`, stamp, stamp); err != nil { + (?, 'prod', 'checkout', 2, 2, 0, 10, 20, 1, 1), + (?, 'staging', 'catalog', 3, 3, 0, 10, 20, 1, 1)`, stamp, stamp); err != nil { t.Fatalf("insert service rollups: %v", err) } diff --git a/internal/observability/overview.go b/internal/observability/overview.go index 8f9c96e99..c17659f25 100644 --- a/internal/observability/overview.go +++ b/internal/observability/overview.go @@ -5,13 +5,13 @@ import ( "fmt" ) -const overviewQuery = ` +var overviewQuery = ` SELECT service, CAST(SUM(spans) AS BIGINT) AS spans, COALESCE(SUM(error_rate * spans) / NULLIF(SUM(spans), 0), 0) AS error_rate, - COALESCE(SUM(p50_ms * spans) / NULLIF(SUM(spans), 0), 0) AS p50_ms, - COALESCE(MAX(p95_ms), 0) AS p95_ms, + ` + windowP50SQL + ` AS p50_ms, + ` + windowP95SQL + ` AS p95_ms, CAST(SUM(log_count) AS BIGINT) AS log_count, CAST(SUM(metric_count) AS BIGINT) AS metric_count FROM service_rollup diff --git a/internal/observability/performance.go b/internal/observability/performance.go index 8c3fdeaad..5a4e40f1e 100644 --- a/internal/observability/performance.go +++ b/internal/observability/performance.go @@ -11,13 +11,13 @@ import ( "github.com/labstack/fanout/internal/query" ) -const performancePointsQueryTemplate = ` +var performancePointsQueryTemplate = ` SELECT time_bucket(INTERVAL '%s', bucket) AS point_time, CAST(SUM(spans) AS BIGINT), COALESCE(SUM(error_rate * spans) / NULLIF(SUM(spans), 0), 0), - COALESCE(SUM(p50_ms * spans) / NULLIF(SUM(spans), 0), 0), - COALESCE(MAX(p95_ms), 0), + ` + windowP50SQL + `, + ` + windowP95SQL + `, CAST(SUM(log_count) AS BIGINT), CAST(SUM(metric_count) AS BIGINT) FROM service_rollup @@ -189,8 +189,8 @@ FROM endpoint_totals t ORDER BY t.calls DESC, p95_ms DESC LIMIT ?` -const performanceHeatmapQueryTemplate = ` -SELECT time_bucket(INTERVAL '%s', bucket) AS point_time, service, COALESCE(MAX(p95_ms), 0) +var performanceHeatmapQueryTemplate = ` +SELECT time_bucket(INTERVAL '%s', bucket) AS point_time, service, ` + windowP95SQL + ` FROM service_rollup WHERE bucket >= ? AND bucket < ? AND (? = '' OR namespace = ?) AND service IN ( @@ -209,12 +209,12 @@ func performanceHeatmapSQL(window time.Duration) string { return fmt.Sprintf(performanceHeatmapQueryTemplate, timelineBucketWidth(window)) } -const performanceAggregateQuery = ` +var performanceAggregateQuery = ` SELECT CAST(COALESCE(SUM(spans), 0) AS DOUBLE), COALESCE(SUM(error_rate * spans) / NULLIF(SUM(spans), 0), 0), - COALESCE(SUM(p50_ms * spans) / NULLIF(SUM(spans), 0), 0), - COALESCE(MAX(p95_ms), 0) + ` + windowP50SQL + `, + ` + windowP95SQL + ` FROM service_rollup WHERE bucket >= ? AND bucket < ? AND (? = '' OR namespace = ?) AND (? = '' OR service = ?)` diff --git a/internal/query/duck.go b/internal/query/duck.go index 424fa3b88..12774783f 100644 --- a/internal/query/duck.go +++ b/internal/query/duck.go @@ -1259,6 +1259,7 @@ span_agg AS ( date_trunc('minute', s.start_time) AS bucket, s.service, COUNT(*) AS spans, + COUNT(*) FILTER (WHERE COALESCE(s.kind, '') NOT IN ('SPAN_KIND_CLIENT', 'SPAN_KIND_PRODUCER')) AS served_spans, -- Latency describes the work a service performs, not the calls it waits -- on. A CLIENT or PRODUCER span measures a dependency: a subscription held -- open for ten minutes makes its subscriber look broken while saying @@ -1330,6 +1331,7 @@ INSERT INTO service_rollup ( bucket, service, spans, + served_spans, p50_ms, p95_ms, error_rate, @@ -1341,6 +1343,7 @@ SELECT a.bucket, a.service, COALESCE(s.spans, 0), + COALESCE(s.served_spans, 0), COALESCE(s.p50_ms, 0), COALESCE(s.p95_ms, 0), COALESCE(s.error_rate, 0), diff --git a/internal/query/views.go b/internal/query/views.go index eee6f4ba8..17e18c657 100644 --- a/internal/query/views.go +++ b/internal/query/views.go @@ -98,6 +98,10 @@ CREATE TABLE service_rollup ( bucket TIMESTAMP, service TEXT, spans BIGINT, + -- Spans that describe work this service performed, rather than a call it was + -- waiting on. A bucket with none of them has no latency of its own to report, + -- and readers prefer the buckets that do; see the rollup's span_agg. + served_spans BIGINT DEFAULT 0, p50_ms DOUBLE, p95_ms DOUBLE, error_rate DOUBLE, @@ -270,7 +274,7 @@ func CreateTables(db *sql.DB) error { // production telemetry rows themselves live in immutable Parquet batches. func CreateCacheTables(db *sql.DB) error { if err := ensureCacheTable(db, "service_rollup", createServiceRollupTable, - "namespace", "bucket", "service", "spans", "p50_ms", "p95_ms", "error_rate", "log_count", "metric_count"); err != nil { + "namespace", "bucket", "service", "spans", "served_spans", "p50_ms", "p95_ms", "error_rate", "log_count", "metric_count"); err != nil { return err } if err := ensureCacheTable(db, "edge_rollup", createEdgeRollupTable, From 0df82e330ef037728c20bcb3ac18cb614338a0da Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 6 Sep 2026 19:52:28 -0700 Subject: [PATCH 7/8] fix(observability): card totals take latency from the halves that served MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit totalsOf took the larger P95 of the two comparison halves and weighted P50 across both. A half spent holding a subscription open has no served latency, so its fallback figure would decide the card — putting the card back in disagreement with the overview beside it, which reads the whole window and prefers the buckets that served something. That disagreement is what these totals exist to end. Latency now comes from the halves with served spans, falling back to both when a service served nothing all window. Counts and error rate still cover every span: an operation the service waited on is still an operation it performed, and a failed outbound call is still its problem. Found while re-reading the diff before merge. Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk --- internal/observability/latency_read_test.go | 31 ++++++++++++++ internal/observability/performance.go | 47 +++++++++++++++++---- internal/observability/service_test.go | 4 +- 3 files changed, 72 insertions(+), 10 deletions(-) diff --git a/internal/observability/latency_read_test.go b/internal/observability/latency_read_test.go index 87a62390e..ce6d59ba9 100644 --- a/internal/observability/latency_read_test.go +++ b/internal/observability/latency_read_test.go @@ -3,6 +3,7 @@ package observability import ( "context" "database/sql" + "math" "testing" "time" @@ -58,3 +59,33 @@ CREATE TABLE service_rollup ( t.Fatalf("generator p95 = %.0fms, want 250ms rather than a flat zero", p95) } } + +// The card's headline figures are folded from the two comparison halves. A half +// spent holding a subscription open has no latency of its own, and letting it +// decide the number would put the card back in disagreement with the overview +// beside it. +func TestTotalsTakeLatencyFromHalvesThatServedSomething(t *testing.T) { + served := performanceAggregate{Spans: 100, ServedSpans: 100, ErrorRate: 0.02, P50MS: 30, P95MS: 40} + waiting := performanceAggregate{Spans: 3, ServedSpans: 0, ErrorRate: 0, P50MS: 600000, P95MS: 600000} + + totals := totalsOf(served, waiting) + if totals.P95MS != 40 { + t.Fatalf("p95 = %.0f, want the served half's 40ms rather than the subscription's 600000ms", totals.P95MS) + } + if totals.P50MS != 30 { + t.Fatalf("p50 = %.0f, want 30ms", totals.P50MS) + } + // Counts and error rate still describe everything the service did. + if totals.Spans != 103 { + t.Fatalf("spans = %d, want every span in the window", totals.Spans) + } + if math.Abs(totals.ErrorRate-(0.02*100/103)) > 1e-9 { + t.Fatalf("error rate = %v, want it weighted across all spans", totals.ErrorRate) + } + + // With nothing served all window, the only numbers available are kept. + onlyWaiting := totalsOf(waiting, waiting) + if onlyWaiting.P95MS != 600000 { + t.Fatalf("p95 = %.0f, want the subscription figure when there is nothing else", onlyWaiting.P95MS) + } +} diff --git a/internal/observability/performance.go b/internal/observability/performance.go index 5a4e40f1e..9dda571de 100644 --- a/internal/observability/performance.go +++ b/internal/observability/performance.go @@ -212,6 +212,7 @@ func performanceHeatmapSQL(window time.Duration) string { var performanceAggregateQuery = ` SELECT CAST(COALESCE(SUM(spans), 0) AS DOUBLE), + CAST(COALESCE(SUM(served_spans), 0) AS DOUBLE), COALESCE(SUM(error_rate * spans) / NULLIF(SUM(spans), 0), 0), ` + windowP50SQL + `, ` + windowP95SQL + ` @@ -390,10 +391,11 @@ func (s *Service) endpointCacheState(ctx context.Context) (bool, time.Time, erro } type performanceAggregate struct { - Spans float64 - ErrorRate float64 - P50MS float64 - P95MS float64 + Spans float64 + ServedSpans float64 + ErrorRate float64 + P50MS float64 + P95MS float64 } func (s *Service) performanceAggregate(ctx context.Context, scope Scope, service string) (performanceAggregate, error) { @@ -404,7 +406,7 @@ func (s *Service) performanceAggregate(ctx context.Context, scope Scope, service defer rows.Close() var value performanceAggregate if rows.Next() { - if err := rows.Scan(&value.Spans, &value.ErrorRate, &value.P50MS, &value.P95MS); err != nil { + if err := rows.Scan(&value.Spans, &value.ServedSpans, &value.ErrorRate, &value.P50MS, &value.P95MS); err != nil { return performanceAggregate{}, fmt.Errorf("scan performance comparison: %w", err) } } @@ -415,13 +417,42 @@ func (s *Service) performanceAggregate(ctx context.Context, scope Scope, service // running a third aggregate query: the halves tile the window exactly, so // summing spans, weighting the averages by span count and taking the larger // P95 reproduces what performanceAggregateQuery would return over the whole -// scope. Keep these three rules in step with that query. +// scope. Keep these rules in step with that query. +// +// Latency comes only from halves in which the service served something, +// matching what the whole-window query does across buckets. Taking the larger +// P95 of both halves regardless would let a half spent holding a subscription +// open decide the figure, and the card would then disagree with the overview +// beside it — which is the disagreement these totals exist to end. Counts and +// error rate still cover every span: an operation the service waited on is +// still an operation it performed, and a failed outbound call is still its +// problem. func totalsOf(before, after performanceAggregate) PerformanceTotals { spans := before.Spans + after.Spans - totals := PerformanceTotals{Spans: int64(spans), P95MS: math.Max(before.P95MS, after.P95MS)} + totals := PerformanceTotals{Spans: int64(spans)} if spans > 0 { totals.ErrorRate = (before.ErrorRate*before.Spans + after.ErrorRate*after.Spans) / spans - totals.P50MS = (before.P50MS*before.Spans + after.P50MS*after.Spans) / spans + } + + latency := []performanceAggregate{} + for _, half := range []performanceAggregate{before, after} { + if half.ServedSpans > 0 { + latency = append(latency, half) + } + } + if len(latency) == 0 { + latency = []performanceAggregate{before, after} + } + var weight float64 + for _, half := range latency { + totals.P95MS = math.Max(totals.P95MS, half.P95MS) + totals.P50MS += half.P50MS * half.Spans + weight += half.Spans + } + if weight > 0 { + totals.P50MS /= weight + } else { + totals.P50MS = 0 } return totals } diff --git a/internal/observability/service_test.go b/internal/observability/service_test.go index 7c98660df..c2fac08dd 100644 --- a/internal/observability/service_test.go +++ b/internal/observability/service_test.go @@ -214,10 +214,10 @@ func TestPerformanceReturnsAllVisualizationDatasets(t *testing.T) { AddRow(start, "checkout", 220.0)) mock.ExpectQuery(regexp.QuoteMeta(performanceAggregateQuery)). WithArgs(start, midpoint, "prod", "prod", "checkout", "checkout"). - WillReturnRows(sqlmock.NewRows([]string{"spans", "error_rate", "p50_ms", "p95_ms"}).AddRow(50.0, 0.12, 90.0, 240.0)) + WillReturnRows(sqlmock.NewRows([]string{"spans", "served_spans", "error_rate", "p50_ms", "p95_ms"}).AddRow(50.0, 50.0, 0.12, 90.0, 240.0)) mock.ExpectQuery(regexp.QuoteMeta(performanceAggregateQuery)). WithArgs(midpoint, end, "prod", "prod", "checkout", "checkout"). - WillReturnRows(sqlmock.NewRows([]string{"spans", "error_rate", "p50_ms", "p95_ms"}).AddRow(70.0, 0.06, 70.0, 180.0)) + WillReturnRows(sqlmock.NewRows([]string{"spans", "served_spans", "error_rate", "p50_ms", "p95_ms"}).AddRow(70.0, 70.0, 0.06, 70.0, 180.0)) result, err := svc.Performance(context.Background(), Scope{Namespace: "prod", Start: start, End: end}, "checkout", 25) if err != nil { From cdb5d8b807a42d1283e8bc35acfc498bfcffd9ee Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 6 Sep 2026 19:57:15 -0700 Subject: [PATCH 8/8] fix(rollup): rebuild a cache table that a schema change emptied MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding served_spans made ensureCacheTable drop and recreate service_rollup on upgrade, but the rollup only rebuilds what its watermark says is missing. The stored watermark still pointed past every dropped bucket, so an existing installation would have come back with an empty service_rollup that never refilled, and the overview, performance, heatmap and alert queries would all have reported no data for that history — permanent silent loss on upgrade, not the "buckets keep their old percentiles" this branch claimed. Recreating a cache table now discards the progress keys named for it, and the service rollup's key moves to v3 because the meaning of its p50 and p95 changed along with its shape. The regression test walks the upgrade: roll up, drop the column an older build lacked, and require the bucket to come back. Also from review: fold the card's P50 with the same served-span weight the window query uses, weight windowP50SQL by served_spans rather than by every span in the bucket, document served_spans and the new latency semantics in the LLM-facing schema, and delete the doc comment above normalizeSeverity that described the behaviour this branch replaced. Claude-Session: https://claude.ai/code/session_017ovmTezqzvxVP8P9MGDQNk --- internal/ingest/server.go | 2 -- internal/observability/latency_sql.go | 7 +++-- internal/observability/performance.go | 10 +++++-- internal/query/duck.go | 12 ++++++-- internal/query/rollup_test.go | 42 +++++++++++++++++++++++++++ internal/query/schema.go | 10 ++++++- internal/query/views.go | 25 ++++++++++++++++ 7 files changed, 99 insertions(+), 9 deletions(-) diff --git a/internal/ingest/server.go b/internal/ingest/server.go index c1b82e23c..bf0688c7e 100644 --- a/internal/ingest/server.go +++ b/internal/ingest/server.go @@ -699,8 +699,6 @@ func anyValueString(v *common.AnyValue) string { } } -// normalizeSeverity returns uppercase severity text. If text is empty, -// derives it from the OTel severity number (1-24). // normalizeSeverity maps a record onto the six OTel severity names, so that a // search for ERROR finds every error however its emitter spelled it. // diff --git a/internal/observability/latency_sql.go b/internal/observability/latency_sql.go index a961a8cc4..369106029 100644 --- a/internal/observability/latency_sql.go +++ b/internal/observability/latency_sql.go @@ -14,9 +14,12 @@ const ( // worst bucket is the one worth knowing about. windowP95SQL = `COALESCE(MAX(p95_ms) FILTER (WHERE served_spans > 0), MAX(p95_ms), 0)` - // windowP50SQL weights each bucket by the spans it holds. + // windowP50SQL weights each bucket by the spans the figure describes. A + // bucket's p50 is computed over served spans, so weighting it by the + // bucket's total would let one served request sitting beside a thousand + // outbound calls outweigh a bucket that served hundreds. windowP50SQL = `COALESCE( - SUM(p50_ms * spans) FILTER (WHERE served_spans > 0) / NULLIF(SUM(spans) FILTER (WHERE served_spans > 0), 0), + SUM(p50_ms * served_spans) FILTER (WHERE served_spans > 0) / NULLIF(SUM(served_spans) FILTER (WHERE served_spans > 0), 0), SUM(p50_ms * spans) / NULLIF(SUM(spans), 0), 0)` ) diff --git a/internal/observability/performance.go b/internal/observability/performance.go index 9dda571de..5dc5ea10e 100644 --- a/internal/observability/performance.go +++ b/internal/observability/performance.go @@ -446,8 +446,14 @@ func totalsOf(before, after performanceAggregate) PerformanceTotals { var weight float64 for _, half := range latency { totals.P95MS = math.Max(totals.P95MS, half.P95MS) - totals.P50MS += half.P50MS * half.Spans - weight += half.Spans + // Weighted by served spans, matching windowP50SQL: the half's p50 + // describes the requests it served, not the calls it also made. + span := half.ServedSpans + if span == 0 { + span = half.Spans + } + totals.P50MS += half.P50MS * span + weight += span } if weight > 0 { totals.P50MS /= weight diff --git a/internal/query/duck.go b/internal/query/duck.go index 12774783f..c5405e4ce 100644 --- a/internal/query/duck.go +++ b/internal/query/duck.go @@ -60,8 +60,16 @@ func (d *Duck) MaintenanceHealth() (lastOK, lastAt time.Time, consecutiveFailure } const ( - serviceRollupStateKey = "service_rollup_v2" - serviceRollupRawMaxKey = "service_rollup_v2_rawmax" + // v3: service_rollup gained served_spans, and its p50/p95 stopped counting + // the calls a service waits on. ensureCacheTable drops the table when the + // new column is missing, but the watermark decides what gets rebuilt — left + // at v2 it would point past every historical bucket, so the dropped rows + // would never come back and the whole window would read as empty. A new key + // has no watermark, which is what makes the next pass a full backfill. + // Bump this whenever the table's shape or the meaning of its columns + // changes. + serviceRollupStateKey = "service_rollup_v3" + serviceRollupRawMaxKey = "service_rollup_v3_rawmax" edgeRollupStateKey = "edge_rollup_v2" edgeRollupRawMaxKey = "edge_rollup_v2_rawmax" edgeRollupSubCursorKey = "edge_rollup_v2_substart" diff --git a/internal/query/rollup_test.go b/internal/query/rollup_test.go index 79e74c054..7bb69c888 100644 --- a/internal/query/rollup_test.go +++ b/internal/query/rollup_test.go @@ -768,3 +768,45 @@ func nullIfEmpty(v string) any { } return v } + +// A cache table that is dropped for a schema change has to be rebuilt, and a +// rollup only rebuilds what its watermark says is missing. Leaving the +// watermark in place after emptying the table loses every historical bucket +// permanently, and every query over that window then reports no data. +func TestRecreatingAServiceRollupClearsItsWatermark(t *testing.T) { + db := openTestDuck(t) + if err := CreateTables(db); err != nil { + t.Fatalf("CreateTables failed: %v", err) + } + if err := CreateViews(db); err != nil { + t.Fatalf("CreateViews failed: %v", err) + } + d := &Duck{DB: db, cfg: config.Config{RetentionDays: 30}} + ctx := context.Background() + bucket := time.Now().UTC().Truncate(time.Minute).Add(-2 * time.Minute) + + insertRollupTestSpan(t, db, rollupTestSpan{ + namespace: "ns", traceID: "t-1", spanID: "s-1", service: "checkout", + operation: "POST /checkout", start: bucket.Add(5 * time.Second), + duration: 50 * time.Millisecond, ingested: 100, + }) + if _, err := d.rollupOnce(ctx); err != nil { + t.Fatalf("rollupOnce failed: %v", err) + } + requireServiceRollupSpans(t, db, "ns", bucket, "checkout", 1) + + // Stand in for the upgrade: the stored table is missing a column this + // build requires, so ensureCacheTable empties it. + if _, err := db.Exec(`ALTER TABLE service_rollup DROP COLUMN served_spans`); err != nil { + t.Fatalf("simulate an older table: %v", err) + } + if err := CreateTables(db); err != nil { + t.Fatalf("CreateTables after the schema change: %v", err) + } + requireRowCount(t, db, `SELECT count(*) FROM service_rollup`, nil, 0) + + if _, err := d.rollupOnce(ctx); err != nil { + t.Fatalf("rollupOnce after recreate failed: %v", err) + } + requireServiceRollupSpans(t, db, "ns", bucket, "checkout", 1) +} diff --git a/internal/query/schema.go b/internal/query/schema.go index 308a5576a..570de1778 100644 --- a/internal/query/schema.go +++ b/internal/query/schema.go @@ -96,9 +96,17 @@ service_rollup columns: - namespace (VARCHAR) - bucket (TIMESTAMP) - service (VARCHAR) -- spans, log_count, metric_count (BIGINT) +- spans, served_spans, log_count, metric_count (BIGINT) - p50_ms, p95_ms, error_rate (DOUBLE) +served_spans counts the spans describing work the service performed, excluding +the SPAN_KIND_CLIENT and SPAN_KIND_PRODUCER spans that measure a call it was +waiting on. p50_ms and p95_ms are computed over those served spans, falling +back to all spans in a bucket that served none — a subscription held open for +ten minutes is a bucket like that, and it must not be read as the service's own +latency. When aggregating across buckets, prefer the ones with served_spans > 0 +and weight p50_ms by served_spans; error_rate and spans cover every span. + edge_rollup columns: - namespace (VARCHAR) - bucket (TIMESTAMP) diff --git a/internal/query/views.go b/internal/query/views.go index 17e18c657..5583f68d0 100644 --- a/internal/query/views.go +++ b/internal/query/views.go @@ -4,6 +4,7 @@ import ( "database/sql" "fmt" "path/filepath" + "strings" ) const createSpansTable = ` @@ -341,8 +342,32 @@ func ensureCacheTable(db *sql.DB, table, createStmt string, requiredColumns ...s if _, err := db.Exec(createStmt); err != nil { return fmt.Errorf("recreate %s: %w", table, err) } + return forgetRollupProgress(db, table) + } + } + return nil +} + +// forgetRollupProgress discards the watermarks belonging to a cache table that +// has just been emptied. +// +// A rollup only rebuilds what its watermark says is missing. Recreating the +// table without clearing that watermark leaves it pointing past every bucket +// that was just dropped, so the history never comes back and every query over +// it reports an empty window — a silent, permanent data loss on upgrade rather +// than a rebuild. Progress keys are named for their table, which is what lets +// this find them. +func forgetRollupProgress(db *sql.DB, table string) error { + if table == "rollup_state" { + return nil + } + if _, err := db.Exec("DELETE FROM rollup_state WHERE cache_key LIKE ? || '%'", table); err != nil { + // A fresh database has no rollup_state yet; it is created alongside + // these tables and has nothing to forget. + if strings.Contains(err.Error(), "rollup_state") { return nil } + return fmt.Errorf("clear %s rollup progress: %w", table, err) } return nil }