@aindy/ui-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ export function taggedRequest(domain: any, apiFn: any): (...args: any[]) => any;
2
+ export function unwrapEnvelope(response: any): any;
3
+ export function getStoredToken(): string;
4
+ export function setStoredToken(token: any): void;
5
+ export function clearStoredToken(): void;
6
+ export function buildApiUrl(path: any): any;
7
+ export function adminRequest(path: any, opts?: {}): Promise<any>;
8
+ export function authRequestExternal(url: any, opts?: {}): Promise<any>;
9
+ export class ApiError extends Error {
10
+ constructor(status: any, message: any, body: any);
11
+ status: any;
12
+ body: any;
13
+ }
14
+ export const API_BASE: any;
15
+ export function authRequest(path: any, opts?: {}): Promise<any>;
16
+ export function request(path: any, opts?: {}): Promise<any>;
17
+ export function requestAbsolute(url: any, opts?: {}): Promise<any>;
@@ -0,0 +1,165 @@
1
+ export const ROUTES: Readonly<{
2
+ AUTH: Readonly<{
3
+ LOGIN: "/auth/login";
4
+ REGISTER: "/auth/register";
5
+ }>;
6
+ TASKS: Readonly<{
7
+ LIST: "/tasks/list";
8
+ CREATE: "/tasks/create";
9
+ COMPLETE: "/tasks/complete";
10
+ START: "/tasks/start";
11
+ }>;
12
+ ARM: Readonly<{
13
+ ANALYZE: "/arm/analyze";
14
+ GENERATE: "/arm/generate";
15
+ LOGS: "/arm/logs";
16
+ CONFIG: "/arm/config";
17
+ METRICS: "/arm/metrics";
18
+ CONFIG_SUGGESTIONS: "/arm/config/suggest";
19
+ }>;
20
+ AGENT: Readonly<{
21
+ CREATE_RUN: "/agent/run";
22
+ RUNS: "/agent/runs";
23
+ RUN: (runId: any) => string;
24
+ APPROVE: (runId: any) => string;
25
+ REJECT: (runId: any) => string;
26
+ STEPS: (runId: any) => string;
27
+ EVENTS: (runId: any) => string;
28
+ TOOLS: "/agent/tools";
29
+ TRUST: "/agent/trust";
30
+ SUGGESTIONS: "/agent/suggestions";
31
+ }>;
32
+ ANALYTICS: Readonly<{
33
+ LINKEDIN_MANUAL: "/analytics/linkedin/manual";
34
+ MASTERPLAN_SUMMARY: (masterplanId: any) => string;
35
+ CALCULATE_TWR: "/calculate_twr";
36
+ CALCULATE_ENGAGEMENT: "/calculate_engagement";
37
+ CALCULATE_AI_EFFICIENCY: "/calculate_ai_efficiency";
38
+ CALCULATE_IMPACT_SCORE: "/calculate_impact_score";
39
+ CALCULATE_INCOME_EFFICIENCY: "/income_efficiency";
40
+ CALCULATE_REVENUE_SCALING: "/revenue_scaling";
41
+ CALCULATE_EXECUTION_SPEED: "/execution_speed";
42
+ CALCULATE_ATTENTION_VALUE: "/attention_value";
43
+ CALCULATE_ENGAGEMENT_RATE: "/engagement_rate";
44
+ CALCULATE_BUSINESS_GROWTH: "/business_growth";
45
+ CALCULATE_MONETIZATION_EFFICIENCY: "/monetization_efficiency";
46
+ CALCULATE_AI_PRODUCTIVITY_BOOST: "/ai_productivity_boost";
47
+ CALCULATE_DECISION_EFFICIENCY: "/decision_efficiency";
48
+ CALCULATE_LOST_POTENTIAL: "/lost_potential";
49
+ SCORES_ME: "/scores/me";
50
+ SCORES_RECALCULATE: "/scores/me/recalculate";
51
+ SCORES_HISTORY: "/scores/me/history";
52
+ SCORES_FEEDBACK: "/scores/feedback";
53
+ }>;
54
+ FREELANCE: Readonly<{
55
+ ORDERS: "/freelance/orders";
56
+ FEEDBACK: "/freelance/feedback";
57
+ METRICS_LATEST: "/freelance/metrics/latest";
58
+ }>;
59
+ IDENTITY: Readonly<{
60
+ BOOT: "/identity/boot";
61
+ PROFILE: "/identity/";
62
+ EVOLUTION: "/identity/evolution";
63
+ CONTEXT: "/identity/context";
64
+ }>;
65
+ MASTERPLAN: Readonly<{
66
+ GENESIS_SESSION: "/genesis/session";
67
+ GENESIS_MESSAGE: "/genesis/message";
68
+ GENESIS_SESSION_BY_ID: (sessionId: any) => string;
69
+ GENESIS_SYNTHESIZE: "/genesis/synthesize";
70
+ GENESIS_DRAFT: (sessionId: any) => string;
71
+ GENESIS_LOCK: "/genesis/lock";
72
+ GENESIS_AUDIT: "/genesis/audit";
73
+ PLANS: "/masterplans/";
74
+ PLAN: (planId: any) => string;
75
+ PLAN_ACTIVATE: (planId: any) => string;
76
+ PLAN_ANCHOR: (planId: any) => string;
77
+ PLAN_PROJECTION: (planId: any) => string;
78
+ }>;
79
+ MEMORY: Readonly<{
80
+ AGENTS: "/memory/agents";
81
+ AGENT_RECALL: (namespace: any) => string;
82
+ FEDERATED_RECALL: "/memory/federated/recall";
83
+ NODES: "/memory/nodes";
84
+ RECALL_V3: "/memory/recall/v3";
85
+ SUGGEST: "/memory/suggest";
86
+ NODE_FEEDBACK: (nodeId: any) => string;
87
+ NODE_PERFORMANCE: (nodeId: any) => string;
88
+ NODE_TRAVERSE: (nodeId: any) => string;
89
+ NODE_HISTORY: (nodeId: any) => string;
90
+ NODE_SHARE: (nodeId: any) => string;
91
+ METRICS_DASHBOARD: "/memory/metrics/dashboard";
92
+ }>;
93
+ SEARCH: Readonly<{
94
+ RESEARCH_QUERY: "/research/query";
95
+ HISTORY: "/search/history";
96
+ HISTORY_ITEM: (historyId: any) => string;
97
+ LEAD_GEN: "/leadgen/";
98
+ ANALYZE_SEO: "/analyze_seo/";
99
+ GENERATE_META: "/generate_meta/";
100
+ SUGGEST_IMPROVEMENTS: "/suggest_improvements/";
101
+ }>;
102
+ SOCIAL: Readonly<{
103
+ PROFILE_BY_USERNAME: (username: any) => string;
104
+ PROFILE: "/social/profile";
105
+ FEED: "/social/feed";
106
+ POST: "/social/post";
107
+ ANALYTICS: "/social/analytics";
108
+ INTERACT: (postId: any) => string;
109
+ }>;
110
+ RIPPLETRACE: Readonly<{
111
+ DROP_POINTS: "/rippletrace/drop_points";
112
+ PINGS: "/rippletrace/pings";
113
+ RECENT: "/rippletrace/recent";
114
+ TRACE: (dropPointId: any) => string;
115
+ TRACE_GRAPH: (traceId: any) => string;
116
+ CAUSAL_GRAPH: "/rippletrace/causal/graph";
117
+ CAUSAL_CHAIN: (dropPointId: any) => string;
118
+ NARRATIVE_SUMMARY: "/rippletrace/narrative/summary";
119
+ DROP_POINT_NARRATIVE: (dropPointId: any) => string;
120
+ PREDICTIONS_SUMMARY: "/rippletrace/predictions/summary";
121
+ DROP_POINT_PREDICTION: (dropPointId: any) => string;
122
+ SYSTEM_RECOMMENDATIONS: "/rippletrace/recommendations/system";
123
+ RECOMMENDATIONS_SUMMARY: "/rippletrace/recommendations/summary";
124
+ DROP_POINT_RECOMMENDATION: (dropPointId: any) => string;
125
+ LEARNING_STATS: "/rippletrace/learning/stats";
126
+ EVALUATE_LEARNING_OUTCOME: (dropPointId: any) => string;
127
+ ADJUST_LEARNING_THRESHOLDS: "/rippletrace/learning/adjust";
128
+ PLAYBOOKS: "/rippletrace/playbooks";
129
+ PLAYBOOK: (playbookId: any) => string;
130
+ MATCH_PLAYBOOKS: (dropPointId: any) => string;
131
+ STRATEGIES: "/rippletrace/strategies";
132
+ BUILD_STRATEGIES: "/rippletrace/strategies/build";
133
+ STRATEGY: (strategyId: any) => string;
134
+ MATCH_STRATEGIES: (dropPointId: any) => string;
135
+ EVENT_DOWNSTREAM: (eventId: any) => string;
136
+ EVENT_UPSTREAM: (eventId: any) => string;
137
+ }>;
138
+ OPERATOR: Readonly<{
139
+ FLOW_RUNS: "/flows/runs";
140
+ FLOW_RUN: (runId: any) => string;
141
+ FLOW_RUN_HISTORY: (runId: any) => string;
142
+ FLOW_RUN_RESUME: (runId: any) => string;
143
+ FLOW_REGISTRY: "/flows/registry";
144
+ FLOW_STRATEGIES: "/flows/strategies";
145
+ AUTOMATION_LOGS: "/automation/logs";
146
+ AUTOMATION_LOG: (logId: any) => string;
147
+ AUTOMATION_REPLAY: (logId: any) => string;
148
+ SCHEDULER_STATUS: "/automation/scheduler/status";
149
+ OBSERVABILITY_REQUESTS: "/observability/requests";
150
+ OBSERVABILITY_DASHBOARD: "/observability/dashboard";
151
+ CLIENT_ERROR: "/client/error";
152
+ CLIENT_VITALS: "/client/vitals";
153
+ }>;
154
+ PLATFORM: Readonly<{
155
+ DASHBOARD_OVERVIEW: "/dashboard/overview";
156
+ HEALTH_DETAILS: "/health/details";
157
+ INFLUENCE_GRAPH: "/influence_graph";
158
+ CAUSAL_GRAPH: "/causal_graph";
159
+ NARRATIVE: (dropPointId: any) => string;
160
+ HEALTH: "/health";
161
+ HEALTH_DEEP: "/health/deep";
162
+ HEALTH_DOMAINS: "/health/domains";
163
+ VERSION: "/api/version";
164
+ }>;
165
+ }>;
@@ -0,0 +1,3 @@
1
+ export function loginUser(credentials: any): Promise<any>;
2
+ export function registerUser(credentials: any): Promise<any>;
3
+ export function bootIdentity(token?: string): Promise<any>;
@@ -0,0 +1,3 @@
1
+ export { ROUTES } from './_routes.js';
2
+ export { ApiError, adminRequest, authRequest, authRequestExternal, buildApiUrl, clearStoredToken, getStoredToken, request, requestAbsolute, setStoredToken, taggedRequest, unwrapEnvelope, API_BASE } from './_core.js';
3
+ export { bootIdentity, loginUser, registerUser } from './auth.js';
@@ -0,0 +1,2 @@
1
+ export function useAdminApiGuard(isAdmin: any): boolean;
2
+ export function AdminAccessRequired(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function AppShell(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export function DomainError({ error, domain, onRetry }: {
2
+ error: any;
3
+ domain: any;
4
+ onRetry: any;
5
+ }): import("react/jsx-runtime").JSX.Element | null;
6
+ export default DomainError;
@@ -0,0 +1,4 @@
1
+ export function EmptyState({ message, hint }: {
2
+ message: any;
3
+ hint: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export function LoadingPanel({ lines, label }: {
2
+ lines?: number | undefined;
3
+ label: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export default function ProtectedRoute({ requireAdmin }: {
2
+ requireAdmin?: boolean | undefined;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export function Toast({ toast, onDismiss }: {
2
+ toast: any;
3
+ onDismiss: any;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,8 @@
1
+ interface Props {
2
+ status: "major_mismatch" | "minor_mismatch" | "patch_mismatch" | "client_ahead";
3
+ apiVersion: string;
4
+ clientVersion: string;
5
+ onDismiss?: () => void;
6
+ }
7
+ export declare function VersionMismatchBanner({ status, apiVersion, clientVersion, onDismiss }: Props): import("react/jsx-runtime").JSX.Element | null;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ export const Button: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
+ export const buttonVariants: (props?: ({
3
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
4
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ import * as React from "react";
@@ -0,0 +1,7 @@
1
+ export const Card: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
+ export const CardHeader: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
+ export const CardFooter: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
4
+ export const CardTitle: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
+ export const CardDescription: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
6
+ export const CardContent: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
7
+ import * as React from "react";
@@ -0,0 +1,6 @@
1
+ export const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
2
+ export const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
3
+ export const TooltipContent: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
4
+ export const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
5
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
6
+ import * as React from "react";
@@ -0,0 +1,4 @@
1
+ export function AuthProvider({ children }: {
2
+ children: any;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ export function useAuth(): never;
@@ -0,0 +1,5 @@
1
+ export function SystemProvider({ children, skipBoot }: {
2
+ children: any;
3
+ skipBoot?: boolean | undefined;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export function useSystem(): never;
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),$=require("react"),Te=require("react-router-dom"),Lr=require("react-dom");function mn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=mn($),pn=mn(Lr);function Mr(e){return Array.isArray(e)?e:e==null?[]:[]}function yt(e,t){return Array.isArray(e)?e.map(t):(console.warn("safeMap prevented crash. Value:",e),[])}const xt="http://localhost:8000".replace(/\/$/,""),Ot="token",kt="aindy_token",gn=globalThis.__AINDY_APP_VERSION_OVERRIDE__||"1.0.0",Dr=new Set(["agents","allowed_auto_grant_tools","allowed_capabilities","analyses","drop_points","end","error_rate_series","events","feedback","fields","findings","flows","generations","granted_tools","history","items","jobs","logs","memories","nodes","plans","pings","recent","recent_authors","recent_changes","recent_errors","recent_ripples","results","runs","steps","strategies","suggestions","tags","timeline","tools"]);class X extends Error{constructor(t,n,r){super(n),this.name="ApiError",this.status=t,this.body=r}}function zr(e,t){return function(...n){return t(...n).catch(r=>{throw r instanceof X&&(r.domain=e),r})}}function jr(e){if(e&&typeof e=="object"&&"data"in e&&"error"in e){if(e.error)throw new X(200,e.error,e);return e.data??e}return e}function ze(e){if(Array.isArray(e))return yt(e,n=>ze(n));if(!e||typeof e!="object")return e;const t={};for(const[n,r]of Object.entries(e)){if(Dr.has(n)){t[n]=Array.isArray(r)?yt(r,o=>ze(o)):[];continue}t[n]=ze(r)}return t}function be(){return localStorage.getItem(Ot)||localStorage.getItem(kt)||""}function wt(e){localStorage.setItem(Ot,e),localStorage.setItem(kt,e)}function Se(){localStorage.removeItem(Ot),localStorage.removeItem(kt)}function hn(e){return/^https?:\/\//i.test(e)?e:xt?`${xt}${e}`:e}function bn(){typeof window>"u"||typeof window.dispatchEvent!="function"||window.dispatchEvent(new CustomEvent("aindy:session-expired"))}function yn(e){typeof window>"u"||typeof window.dispatchEvent!="function"||window.dispatchEvent(new CustomEvent("aindy:version-warning",{detail:{message:e}}))}async function Pe(e,t={}){const n=hn(e),r=be(),o=new AbortController,{_isRetry:s=!1,...i}=t,l=typeof window<"u"?setTimeout(()=>o.abort(),3e4):null;i.signal&&(i.signal.aborted?o.abort():i.signal.addEventListener("abort",()=>o.abort(),{once:!0}));try{const c=await fetch(n,{...i,signal:o.signal,headers:{"Content-Type":"application/json","X-Client-Version":gn,...r?{Authorization:`Bearer ${r}`}:{},...i.headers||{}}}),a=c.headers?.get?.("X-Version-Warning");if(a&&typeof window<"u"&&(console.warn("[API Version Warning]",a),yn(a)),c.status===503){const d=parseInt(c.headers.get("Retry-After")||"0",10);if(d>0&&d<=60&&!s)return await new Promise(m=>setTimeout(m,d*1e3)),Pe(e,{...i,_isRetry:!0})}if(!c.ok){const d=await c.text(),m=new X(c.status,`API Error (${c.status}): ${d}`,d);throw c.status===401&&bn(),m}const u=await c.text();try{return ze(JSON.parse(u))}catch{return u}}catch(c){throw c?.name==="AbortError"?new X(408,"Request timed out after 30 seconds.",null):c instanceof TypeError&&!c.status?new X(0,"Network error. Check your connection.",null):c}finally{l&&clearTimeout(l)}}function xn(e,t={}){return Pe(e,{...t})}function Fr(e,t={}){const n=be();let r=!1;if(n)try{const[,o=""]=n.split("."),s=o.replace(/-/g,"+").replace(/_/g,"/"),i=s.padEnd(Math.ceil(s.length/4)*4,"=");r=JSON.parse(atob(i))?.is_admin===!0}catch{r=!1}return r?xn(e,t):Promise.reject(new X(403,"Admin privileges required for this operation.",null))}async function Nt(e,t={}){const n=be(),r=new AbortController,{_isRetry:o=!1,...s}=t,i=typeof window<"u"?setTimeout(()=>r.abort(),3e4):null;s.signal&&(s.signal.aborted?r.abort():s.signal.addEventListener("abort",()=>r.abort(),{once:!0}));try{const l=await fetch(e,{...s,signal:r.signal,headers:{"Content-Type":"application/json","X-Client-Version":gn,...n?{Authorization:`Bearer ${n}`}:{},...s.headers||{}}}),c=l.headers?.get?.("X-Version-Warning");if(c&&typeof window<"u"&&(console.warn("[API Version Warning]",c),yn(c)),l.status===503){const u=parseInt(l.headers.get("Retry-After")||"0",10);if(u>0&&u<=60&&!o)return await new Promise(d=>setTimeout(d,u*1e3)),Nt(e,{...s,_isRetry:!0})}if(!l.ok){const u=await l.text(),d=new X(l.status,`API Error (${l.status}): ${u}`,u);throw l.status===401&&bn(),d}const a=await l.text();try{return ze(JSON.parse(a))}catch{return a}}catch(l){throw l?.name==="AbortError"?new X(408,"Request timed out after 30 seconds.",null):l instanceof TypeError&&!l.status?new X(0,"Network error. Check your connection.",null):l}finally{i&&clearTimeout(i)}}function Ur(e,t={}){return Nt(e,{...t})}const g="",Gr=Object.freeze({LOGIN:`${g}/auth/login`,REGISTER:`${g}/auth/register`}),Vr=Object.freeze({LIST:`${g}/tasks/list`,CREATE:`${g}/tasks/create`,COMPLETE:`${g}/tasks/complete`,START:`${g}/tasks/start`}),Wr=Object.freeze({ANALYZE:`${g}/arm/analyze`,GENERATE:`${g}/arm/generate`,LOGS:`${g}/arm/logs`,CONFIG:`${g}/arm/config`,METRICS:`${g}/arm/metrics`,CONFIG_SUGGESTIONS:`${g}/arm/config/suggest`}),Hr=Object.freeze({CREATE_RUN:`${g}/agent/run`,RUNS:`${g}/agent/runs`,RUN:e=>`${g}/agent/runs/${e}`,APPROVE:e=>`${g}/agent/runs/${e}/approve`,REJECT:e=>`${g}/agent/runs/${e}/reject`,STEPS:e=>`${g}/agent/runs/${e}/steps`,EVENTS:e=>`${g}/agent/runs/${e}/events`,TOOLS:`${g}/agent/tools`,TRUST:`${g}/agent/trust`,SUGGESTIONS:`${g}/agent/suggestions`}),Br=Object.freeze({LINKEDIN_MANUAL:`${g}/analytics/linkedin/manual`,MASTERPLAN_SUMMARY:e=>`${g}/analytics/masterplan/${e}/summary`,CALCULATE_TWR:`${g}/calculate_twr`,CALCULATE_ENGAGEMENT:`${g}/calculate_engagement`,CALCULATE_AI_EFFICIENCY:`${g}/calculate_ai_efficiency`,CALCULATE_IMPACT_SCORE:`${g}/calculate_impact_score`,CALCULATE_INCOME_EFFICIENCY:`${g}/income_efficiency`,CALCULATE_REVENUE_SCALING:`${g}/revenue_scaling`,CALCULATE_EXECUTION_SPEED:`${g}/execution_speed`,CALCULATE_ATTENTION_VALUE:`${g}/attention_value`,CALCULATE_ENGAGEMENT_RATE:`${g}/engagement_rate`,CALCULATE_BUSINESS_GROWTH:`${g}/business_growth`,CALCULATE_MONETIZATION_EFFICIENCY:`${g}/monetization_efficiency`,CALCULATE_AI_PRODUCTIVITY_BOOST:`${g}/ai_productivity_boost`,CALCULATE_DECISION_EFFICIENCY:`${g}/decision_efficiency`,CALCULATE_LOST_POTENTIAL:`${g}/lost_potential`,SCORES_ME:`${g}/scores/me`,SCORES_RECALCULATE:`${g}/scores/me/recalculate`,SCORES_HISTORY:`${g}/scores/me/history`,SCORES_FEEDBACK:`${g}/scores/feedback`}),Yr=Object.freeze({ORDERS:`${g}/freelance/orders`,FEEDBACK:`${g}/freelance/feedback`,METRICS_LATEST:`${g}/freelance/metrics/latest`}),qr=Object.freeze({BOOT:`${g}/identity/boot`,PROFILE:`${g}/identity/`,EVOLUTION:`${g}/identity/evolution`,CONTEXT:`${g}/identity/context`}),Kr=Object.freeze({GENESIS_SESSION:`${g}/genesis/session`,GENESIS_MESSAGE:`${g}/genesis/message`,GENESIS_SESSION_BY_ID:e=>`${g}/genesis/session/${e}`,GENESIS_SYNTHESIZE:`${g}/genesis/synthesize`,GENESIS_DRAFT:e=>`${g}/genesis/draft/${e}`,GENESIS_LOCK:`${g}/genesis/lock`,GENESIS_AUDIT:`${g}/genesis/audit`,PLANS:`${g}/masterplans/`,PLAN:e=>`${g}/masterplans/${e}`,PLAN_ACTIVATE:e=>`${g}/masterplans/${e}/activate`,PLAN_ANCHOR:e=>`${g}/masterplans/${e}/anchor`,PLAN_PROJECTION:e=>`${g}/masterplans/${e}/projection`}),Xr=Object.freeze({AGENTS:`${g}/memory/agents`,AGENT_RECALL:e=>`${g}/memory/agents/${e}/recall`,FEDERATED_RECALL:`${g}/memory/federated/recall`,NODES:`${g}/memory/nodes`,RECALL_V3:`${g}/memory/recall/v3`,SUGGEST:`${g}/memory/suggest`,NODE_FEEDBACK:e=>`${g}/memory/nodes/${e}/feedback`,NODE_PERFORMANCE:e=>`${g}/memory/nodes/${e}/performance`,NODE_TRAVERSE:e=>`${g}/memory/nodes/${e}/traverse`,NODE_HISTORY:e=>`${g}/memory/nodes/${e}/history`,NODE_SHARE:e=>`${g}/memory/nodes/${e}/share`,METRICS_DASHBOARD:`${g}/memory/metrics/dashboard`}),Jr=Object.freeze({RESEARCH_QUERY:`${g}/research/query`,HISTORY:`${g}/search/history`,HISTORY_ITEM:e=>`${g}/search/history/${e}`,LEAD_GEN:`${g}/leadgen/`,ANALYZE_SEO:`${g}/analyze_seo/`,GENERATE_META:`${g}/generate_meta/`,SUGGEST_IMPROVEMENTS:`${g}/suggest_improvements/`}),Zr=Object.freeze({PROFILE_BY_USERNAME:e=>`${g}/social/profile/${e}`,PROFILE:`${g}/social/profile`,FEED:`${g}/social/feed`,POST:`${g}/social/post`,ANALYTICS:`${g}/social/analytics`,INTERACT:e=>`${g}/social/posts/${e}/interact`}),Qr=Object.freeze({DROP_POINTS:`${g}/rippletrace/drop_points`,PINGS:`${g}/rippletrace/pings`,RECENT:`${g}/rippletrace/recent`,TRACE:e=>`${g}/rippletrace/ripples/${e}`,TRACE_GRAPH:e=>`${g}/rippletrace/${encodeURIComponent(e)}`,CAUSAL_GRAPH:`${g}/rippletrace/causal/graph`,CAUSAL_CHAIN:e=>`${g}/rippletrace/causal/chain/${encodeURIComponent(e)}`,NARRATIVE_SUMMARY:`${g}/rippletrace/narrative/summary`,DROP_POINT_NARRATIVE:e=>`${g}/rippletrace/narrative/${encodeURIComponent(e)}`,PREDICTIONS_SUMMARY:`${g}/rippletrace/predictions/summary`,DROP_POINT_PREDICTION:e=>`${g}/rippletrace/predictions/${encodeURIComponent(e)}`,SYSTEM_RECOMMENDATIONS:`${g}/rippletrace/recommendations/system`,RECOMMENDATIONS_SUMMARY:`${g}/rippletrace/recommendations/summary`,DROP_POINT_RECOMMENDATION:e=>`${g}/rippletrace/recommendations/${encodeURIComponent(e)}`,LEARNING_STATS:`${g}/rippletrace/learning/stats`,EVALUATE_LEARNING_OUTCOME:e=>`${g}/rippletrace/learning/evaluate/${encodeURIComponent(e)}`,ADJUST_LEARNING_THRESHOLDS:`${g}/rippletrace/learning/adjust`,PLAYBOOKS:`${g}/rippletrace/playbooks`,PLAYBOOK:e=>`${g}/rippletrace/playbooks/${encodeURIComponent(e)}`,MATCH_PLAYBOOKS:e=>`${g}/rippletrace/playbooks/match/${encodeURIComponent(e)}`,STRATEGIES:`${g}/rippletrace/strategies`,BUILD_STRATEGIES:`${g}/rippletrace/strategies/build`,STRATEGY:e=>`${g}/rippletrace/strategies/${encodeURIComponent(e)}`,MATCH_STRATEGIES:e=>`${g}/rippletrace/strategies/match/${encodeURIComponent(e)}`,EVENT_DOWNSTREAM:e=>`${g}/rippletrace/event/${encodeURIComponent(e)}/downstream`,EVENT_UPSTREAM:e=>`${g}/rippletrace/event/${encodeURIComponent(e)}/upstream`}),eo=Object.freeze({FLOW_RUNS:`${g}/flows/runs`,FLOW_RUN:e=>`${g}/flows/runs/${e}`,FLOW_RUN_HISTORY:e=>`${g}/flows/runs/${e}/history`,FLOW_RUN_RESUME:e=>`${g}/flows/runs/${e}/resume`,FLOW_REGISTRY:`${g}/flows/registry`,FLOW_STRATEGIES:`${g}/flows/strategies`,AUTOMATION_LOGS:`${g}/automation/logs`,AUTOMATION_LOG:e=>`${g}/automation/logs/${e}`,AUTOMATION_REPLAY:e=>`${g}/automation/logs/${e}/replay`,SCHEDULER_STATUS:`${g}/automation/scheduler/status`,OBSERVABILITY_REQUESTS:`${g}/observability/requests`,OBSERVABILITY_DASHBOARD:`${g}/observability/dashboard`,CLIENT_ERROR:`${g}/client/error`,CLIENT_VITALS:`${g}/client/vitals`}),to=Object.freeze({DASHBOARD_OVERVIEW:`${g}/dashboard/overview`,HEALTH_DETAILS:`${g}/health/details`,INFLUENCE_GRAPH:`${g}/influence_graph`,CAUSAL_GRAPH:`${g}/causal_graph`,NARRATIVE:e=>`${g}/narrative/${e}`,HEALTH:`${g}/health`,HEALTH_DEEP:`${g}/health/deep`,HEALTH_DOMAINS:`${g}/health/domains`,VERSION:`${g}/api/version`}),rt=Object.freeze({AUTH:Gr,TASKS:Vr,ARM:Wr,AGENT:Hr,ANALYTICS:Br,FREELANCE:Yr,IDENTITY:qr,MASTERPLAN:Kr,MEMORY:Xr,SEARCH:Jr,SOCIAL:Zr,RIPPLETRACE:Qr,OPERATOR:eo,PLATFORM:to});function wn(e){return Pe(rt.AUTH.LOGIN,{method:"POST",body:JSON.stringify(e)})}function vn(e){return Pe(rt.AUTH.REGISTER,{method:"POST",body:JSON.stringify(e)})}function En(e=be()){return Pe(rt.IDENTITY.BOOT,{method:"GET",headers:e?{Authorization:`Bearer ${e}`}:{}})}const An=$.createContext(null);function Cn(e){if(!e)return null;try{const[,t=""]=e.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return JSON.parse(window.atob(r))}catch{return null}}function mt(e){const t=Cn(e);return!t||typeof t.exp!="number"?!1:Date.now()/1e3>t.exp-30}function no({children:e}){const[t,n]=$.useState(()=>{const a=be();return a&&mt(a)?(Se(),null):a||null}),r=$.useMemo(()=>{const a=Cn(t);return a?{...a,is_admin:a?.is_admin===!0}:null},[t]),o=r?.is_admin===!0;$.useEffect(()=>{const a=be();if(a&&mt(a)){Se(),n(null);return}n(a||null)},[]),$.useEffect(()=>{if(!t)return;const a=setInterval(()=>{mt(t)&&(Se(),n(null))},6e4);return()=>clearInterval(a)},[t]),$.useEffect(()=>{const a=()=>{Se(),n(null)};return window.addEventListener("aindy:session-expired",a),()=>window.removeEventListener("aindy:session-expired",a)},[]);const s=async(a,u)=>{const m=(await wn({email:a,password:u}))?.access_token;if(!m)throw new Error("Authentication did not return an access token.");return wt(m),n(m),m},i=async(a,u,d=null)=>{const p=(await vn({email:a,password:u,username:d}))?.access_token;if(!p)throw new Error("Authentication did not return an access token.");return wt(p),n(p),p},l=()=>{Se(),n(null)},c=$.useMemo(()=>({token:t,user:r,isAdmin:o,isAuthenticated:!!t,login:s,register:i,logout:l,setToken:n}),[t,r,o]);return h.jsx(An.Provider,{value:c,children:e})}function ot(){const e=$.useContext(An);if(!e)throw new Error("useAuth must be used within AuthProvider.");return e}const Rn=$.createContext(null),Re={user_id:null,memory:[],runs:[],metrics:null,flows:[],runtime:{boot_mode:"unknown",boot_profile:"unknown",boot_profile_source:"unknown",app_plugins_loaded:!1,app_plugin_count:0,ui_mode:"app-profile",default_route:"/dashboard",platform_home:"/platform/agent"},system_state:{memory_count:0,active_runs:0,score:null,active_flows:0}};function ro({children:e,skipBoot:t=!1}){const{token:n,logout:r}=ot(),[o,s]=$.useState(Re),[i,l]=$.useState(!1),[c,a]=$.useState(!1),[u,d]=$.useState(""),m=$.useRef(null),p=()=>{s(Re),a(!1),d(""),m.current=null},b=async(w=n)=>{if(!w)return p(),Re;l(!0),d("");try{const x=await En(w);return s({...Re,...x,memory:x?.memory||[],runs:x?.runs||[],flows:x?.flows||[],metrics:x?.metrics||null,runtime:{...Re.runtime,...x?.runtime||{}},system_state:{...Re.system_state,...x?.system_state||{}}}),a(!0),m.current=w,x}catch(x){const E=x instanceof Error?x.message:"Failed to boot identity context.";throw d(E),a(!1),x instanceof X&&x.status===401&&r(),x}finally{l(!1)}};$.useEffect(()=>{if(t){if(!n){p();return}a(!0),d(""),m.current=n;return}if(!n){p();return}m.current===n&&c||b(n).catch(()=>{})},[n,c,t]);const y=$.useMemo(()=>({system:o,setSystem:s,clearSystem:p,bootSystem:b,booting:i,booted:c,bootError:u}),[o,i,c,u]);return h.jsx(Rn.Provider,{value:y,children:e})}function Sn(){const e=$.useContext(Rn);if(!e)throw new Error("useSystem must be used within SystemProvider.");return e}const oo="/platform",so=e=>`${oo}${e}`,io=[{title:"PLATFORM",adminOnly:!0,runtimeOnlySafe:!0,links:[{to:"/agent",label:"Agent Console",external:!0},{to:"/flows",label:"Flow Engine",external:!0},{to:"/observability",label:"Observability",external:!0},{to:"/health",label:"Health",external:!0},{to:"/approvals",label:"Approvals",external:!0},{to:"/registry",label:"Registry",external:!0},{to:"/executions",label:"Executions",external:!0,runtimeOnlySafe:!1},{to:"/trace",label:"Ripple Trace",external:!0,runtimeOnlySafe:!1}]},{title:"WORKSPACE",runtimeOnlySafe:!1,links:[{to:"/dashboard",label:"Dashboard"},{to:"/tasks",label:"Tasks"},{to:"/masterplan",label:"MasterPlan"}]},{title:"ANALYTICS",runtimeOnlySafe:!1,links:[{to:"/analytics",label:"Analytics"},{to:"/kpi",label:"KPI Snapshot"}]},{title:"GROWTH",runtimeOnlySafe:!1,links:[{to:"/search/research",label:"Research"},{to:"/search/leadgen",label:"Lead Gen"},{to:"/social",label:"Social Feed"},{to:"/freelance",label:"Freelance"}]},{title:"AI TOOLS",runtimeOnlySafe:!1,links:[{to:"/arm/analyze",label:"ARM Analyze"},{to:"/arm/config",label:"ARM Config"},{to:"/arm/config/suggest",label:"ARM Suggest"},{to:"/arm/config/generate",label:"ARM Generate"},{to:"/arm/config/logs",label:"ARM Logs"},{to:"/arm/config/metrics",label:"ARM Metrics"}]},{title:"RUNTIME",runtimeOnlySafe:!0,links:[{to:"/identity",label:"Identity"},{to:"/memory",label:"Memory"}]}];function ao({to:e,label:t,onNavigate:n,external:r=!1}){const o=["block rounded-2xl border px-3 py-2 text-sm transition-colors","border-zinc-800/60 bg-zinc-950/40 text-zinc-400 hover:border-zinc-700 hover:bg-zinc-900/70 hover:text-zinc-100"];if(r){const s=typeof window<"u"&&window.location.pathname.startsWith("/platform");return h.jsx("a",{href:so(e),onClick:n,target:"_self",className:["block rounded-2xl border px-3 py-2 text-sm transition-colors",s?"border-[#00ffaa]/30 bg-[#00ffaa]/10 text-[#00ffaa]":"border-zinc-800/60 bg-zinc-950/40 text-zinc-400 hover:border-zinc-700 hover:bg-zinc-900/70 hover:text-zinc-100"].join(" "),children:t})}return h.jsx(Te.NavLink,{to:e,onClick:n,className:({isActive:s})=>[...o,s?"border-[#00ffaa]/30 bg-[#00ffaa]/10 text-[#00ffaa]":""].join(" "),children:t})}function lo(){const{isAdmin:e,logout:t,user:n}=ot(),{system:r}=Sn(),[o,s]=$.useState(!1),i=r?.runtime?.boot_mode==="runtime-only",l=$.useMemo(()=>io.filter(c=>!c.adminOnly||e).filter(c=>!i||c.runtimeOnlySafe!==!1).map(c=>({...c,title:c.title==="RUNTIME"&&!i?"IDENTITY":c.title,links:c.links.filter(a=>!i||a.runtimeOnlySafe!==!1)})),[e,i]);return h.jsxs("div",{className:"min-h-screen bg-[#09090b] text-[#fafafa] selection:bg-[#00ffaa]/30 lg:flex",children:[h.jsx("aside",{className:["fixed inset-y-0 left-0 z-40 w-80 border-r border-zinc-800/60 bg-zinc-950/95 backdrop-blur transition-transform lg:static lg:translate-x-0",o?"translate-x-0":"-translate-x-full"].join(" "),children:h.jsxs("div",{className:"flex h-full flex-col",children:[h.jsx("div",{className:"border-b border-zinc-800/60 px-5 py-5",children:h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.3em] text-[#00ffaa]",children:"Control Surface"}),h.jsx("h1",{className:"mt-3 text-2xl font-black tracking-tight text-white",children:"A.I.N.D.Y."}),h.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:i?"Runtime-only mode. Platform, memory, and identity surfaces are active.":"Route the workspace, analytics, growth, and platform surfaces."}),i?h.jsx("p",{className:"mt-3 inline-flex rounded-full border border-[#00ffaa]/30 bg-[#00ffaa]/10 px-3 py-1 text-[10px] font-bold uppercase tracking-[0.2em] text-[#00ffaa]",children:"Runtime-Only"}):null]}),h.jsx("button",{type:"button",className:"rounded-xl border border-zinc-800 px-3 py-2 text-xs uppercase tracking-[0.18em] text-zinc-400 lg:hidden",onClick:()=>s(!1),children:"Close"})]})}),h.jsx("nav",{className:"flex-1 space-y-6 overflow-y-auto px-4 py-5 custom-scrollbar",children:l.map(c=>h.jsxs("div",{children:[h.jsx("p",{className:"mb-3 px-2 text-[10px] font-bold uppercase tracking-[0.3em] text-zinc-600",children:c.title}),h.jsx("div",{className:"space-y-2",children:c.links.map(a=>h.jsx(ao,{to:a.to,label:a.label,external:a.external,onNavigate:()=>s(!1)},a.to))})]},c.title))})]})}),o?h.jsx("button",{type:"button",className:"fixed inset-0 z-30 bg-black/60 lg:hidden",onClick:()=>s(!1)}):null,h.jsxs("div",{className:"flex min-h-screen flex-1 flex-col lg:ml-0",children:[h.jsx("header",{className:"sticky top-0 z-20 border-b border-zinc-800/60 bg-[#09090b]/95 backdrop-blur",children:h.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-4 sm:px-6 lg:px-8",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("button",{type:"button",className:"rounded-2xl border border-zinc-800 bg-zinc-950/70 px-3 py-2 text-[10px] font-bold uppercase tracking-[0.18em] text-zinc-300 lg:hidden",onClick:()=>s(!0),children:"Menu"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.3em] text-zinc-600",children:"Navigation Shell"}),h.jsx("p",{className:"text-sm text-zinc-300",children:i?"Intentional platform surface":"Unified workspace routing"})]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"hidden rounded-2xl border border-zinc-800 bg-zinc-950/70 px-4 py-2 text-right sm:block",children:[h.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-zinc-600",children:"Active Identity"}),h.jsx("p",{className:"text-sm text-zinc-200",children:n?.email||"Unknown user"})]}),h.jsx("button",{type:"button",onClick:t,className:"rounded-2xl bg-[#00ffaa] px-4 py-2 text-[10px] font-black uppercase tracking-[0.18em] text-black transition-colors hover:bg-[#00ffaa]/80",children:"Logout"})]})]})}),h.jsx("main",{className:"flex-1 overflow-y-auto px-4 py-6 sm:px-6 lg:px-8",children:h.jsx("div",{className:"min-h-full rounded-[28px] border border-zinc-800/60 bg-zinc-950/40 p-4 shadow-2xl shadow-black/20 sm:p-6 lg:p-8",children:h.jsx(Te.Outlet,{})})})]})]})}function co({requireAdmin:e=!1}){const t=Te.useLocation(),{isAdmin:n,isAuthenticated:r}=ot();return r?e&&!n?h.jsx(Te.Navigate,{to:"/dashboard",replace:!0}):h.jsx(Te.Outlet,{}):h.jsx(Te.Navigate,{to:"/login",replace:!0,state:{from:t}})}const uo={major_mismatch:{bg:"#b91c1c",label:"Incompatible version",message:(e,t)=>`This page (v${t}) is incompatible with the current API (v${e}). Please reload.`,dismissable:!1},minor_mismatch:{bg:"#b45309",label:"API updated",message:(e,t)=>`API updated to v${e} (you have v${t}). Some features may not work correctly.`,dismissable:!0},patch_mismatch:{bg:"#1d4ed8",label:"Minor update available",message:(e,t)=>`API v${e} is available (you have v${t}). Reload when convenient.`,dismissable:!0},client_ahead:{bg:"#4b5563",label:"Client ahead of API",message:(e,t)=>`Client v${t} is ahead of API v${e}. This may indicate a partial rollback.`,dismissable:!0}};function fo({status:e,apiVersion:t,clientVersion:n,onDismiss:r}){const o=uo[e];return o?h.jsxs("div",{role:"alert","aria-live":"polite",style:{position:"fixed",top:0,left:0,right:0,zIndex:9999,background:o.bg,color:"white",padding:"12px 16px",textAlign:"center",fontSize:"14px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px"},children:[h.jsxs("strong",{children:[o.label,":"]}),h.jsx("span",{children:o.message(t,n)}),h.jsx("button",{onClick:()=>window.location.reload(),style:{textDecoration:"underline",cursor:"pointer",background:"none",border:"none",color:"white"},children:"Reload"}),o.dismissable&&r?h.jsx("button",{onClick:r,"aria-label":"Dismiss version warning",style:{marginLeft:8,cursor:"pointer",background:"none",border:"none",color:"white",fontSize:"18px",lineHeight:1},children:"×"}):null]}):null}const Vt={error:"border-red-500/30 bg-red-950/80 text-red-200",success:"border-emerald-500/30 bg-emerald-950/80 text-emerald-200",info:"border-zinc-600/30 bg-zinc-900/90 text-zinc-200"};function mo({toast:e,onDismiss:t}){return e?h.jsxs("div",{role:"alert","aria-live":"assertive",className:`fixed bottom-6 right-6 z-50 max-w-sm rounded-xl border px-4 py-3 text-sm shadow-xl backdrop-blur-sm ${Vt[e.type]||Vt.error}`,children:[h.jsx("span",{children:e.message}),h.jsx("button",{onClick:t,className:"ml-3 text-xs underline opacity-60 hover:opacity-100","aria-label":"Dismiss",children:"Dismiss"})]}):null}function po({lines:e=3,label:t}){const n=["w-full","w-3/4","w-1/2"];return h.jsxs("div",{className:"rounded-2xl border border-zinc-800/50 bg-zinc-950/50 p-6",children:[h.jsx("div",{className:"space-y-3",children:Array.from({length:e},(r,o)=>h.jsx("div",{"data-testid":"loading-panel-line",className:`h-3 rounded bg-zinc-800 animate-pulse ${n[o%n.length]}`},o))}),t?h.jsx("p",{className:"mt-4 text-center text-xs text-zinc-500",children:t}):null]})}function go({error:e,domain:t,onRetry:n}){if(!e)return null;const r=e?.status??"unknown",o=t||e?.domain||"server";let s=`${o} returned an unexpected error (${r}).`;return r===408?s=`${o} timed out. Check your connection and try again.`:r===429?s=`${o} is rate-limited. Wait a moment and try again.`:r===500?s=`${o} encountered an error. Our team has been notified.`:r===503&&(s=`${o} is temporarily unavailable. Try again in a moment.`),h.jsxs("div",{className:"rounded-2xl border border-zinc-800/30 bg-zinc-950/30 p-6 text-center",children:[h.jsx("p",{className:"text-sm text-zinc-400",children:s}),n?h.jsx("button",{type:"button",className:"mt-3 text-xs text-zinc-500 underline",onClick:n,children:"Try again"}):null]})}function ho(e){const[t,n]=$.useState(!1);return $.useEffect(()=>{e||n(!0)},[e]),t}function bo(){return h.jsx("div",{role:"alert",className:"flex min-h-[200px] items-center justify-center rounded-2xl border border-red-500/20 bg-zinc-950/80 p-8 text-center",children:h.jsxs("div",{children:[h.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-[0.3em] text-red-400",children:"Admin Access Required"}),h.jsx("p",{className:"mt-2 text-sm text-zinc-400",children:"This panel is only available to administrator accounts."})]})})}function yo({message:e,hint:t}){return h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-zinc-800/30 bg-zinc-950/30 p-8 text-center",children:[h.jsx("p",{className:"text-sm text-zinc-400",children:e}),t?h.jsx("p",{className:"mt-1 text-xs text-zinc-600",children:t}):null]})}function Wt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pt(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Wt(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Wt(e[o],null)}}}}function we(...e){return f.useCallback(Pt(...e),e)}var xo=Symbol.for("react.lazy"),Je=f[" use ".trim().toString()];function wo(e){return typeof e=="object"&&e!==null&&"then"in e}function Tn(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===xo&&"_payload"in e&&wo(e._payload)}function vo(e){const t=Ao(e),n=f.forwardRef((r,o)=>{let{children:s,...i}=r;Tn(s)&&typeof Je=="function"&&(s=Je(s._payload));const l=f.Children.toArray(s),c=l.find(Ro);if(c){const a=c.props.children,u=l.map(d=>d===c?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:d);return h.jsx(t,{...i,ref:o,children:f.isValidElement(a)?f.cloneElement(a,void 0,u):null})}return h.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Eo=vo("Slot");function Ao(e){const t=f.forwardRef((n,r)=>{let{children:o,...s}=n;if(Tn(o)&&typeof Je=="function"&&(o=Je(o._payload)),f.isValidElement(o)){const i=To(o),l=So(s,o.props);return o.type!==f.Fragment&&(l.ref=r?Pt(r,i):i),f.cloneElement(o,l)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Co=Symbol("radix.slottable");function Ro(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Co}function So(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function To(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function On(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=On(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function kn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=On(e))&&(r&&(r+=" "),r+=t);return r}const Ht=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Bt=kn,Oo=(e,t)=>n=>{var r;if(t?.variants==null)return Bt(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(a=>{const u=n?.[a],d=s?.[a];if(u===null)return null;const m=Ht(u)||Ht(d);return o[a][m]}),l=n&&Object.entries(n).reduce((a,u)=>{let[d,m]=u;return m===void 0||(a[d]=m),a},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((a,u)=>{let{class:d,className:m,...p}=u;return Object.entries(p).every(b=>{let[y,w]=b;return Array.isArray(w)?w.includes({...s,...l}[y]):{...s,...l}[y]===w})?[...a,d,m]:a},[]);return Bt(e,i,c,n?.class,n?.className)},ko=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},No=(e,t)=>({classGroupId:e,validator:t}),Nn=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ze="-",Yt=[],Po="arbitrary..",_o=e=>{const t=Io(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return $o(i);const l=i.split(Ze),c=l[0]===""&&l.length>1?1:0;return Pn(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],a=n[i];return c?a?ko(a,c):c:a||Yt}return n[i]||Yt}}},Pn=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const a=Pn(e,t+1,s);if(a)return a}const i=n.validators;if(i===null)return;const l=t===0?e.join(Ze):e.slice(t).join(Ze),c=i.length;for(let a=0;a<c;a++){const u=i[a];if(u.validator(l))return u.classGroupId}},$o=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Po+r:void 0})(),Io=e=>{const{theme:t,classGroups:n}=e;return Lo(n,t)},Lo=(e,t)=>{const n=Nn();for(const r in e){const o=e[r];_t(o,n,r,t)}return n},_t=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Mo(i,t,n,r)}},Mo=(e,t,n,r)=>{if(typeof e=="string"){Do(e,t,n);return}if(typeof e=="function"){zo(e,t,n,r);return}jo(e,t,n,r)},Do=(e,t,n)=>{const r=e===""?t:_n(t,e);r.classGroupId=n},zo=(e,t,n,r)=>{if(Fo(e)){_t(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(No(n,e))},jo=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[l,c]=o[i];_t(c,_n(t,l),n,r)}},_n=(e,t)=>{let n=e;const r=t.split(Ze),o=r.length;for(let s=0;s<o;s++){const i=r[s];let l=n.nextPart.get(i);l||(l=Nn(),n.nextPart.set(i,l)),n=l}return n},Fo=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Uo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},vt="!",qt=":",Go=[],Kt=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Vo=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,l=0,c=0,a;const u=o.length;for(let y=0;y<u;y++){const w=o[y];if(i===0&&l===0){if(w===qt){s.push(o.slice(c,y)),c=y+1;continue}if(w==="/"){a=y;continue}}w==="["?i++:w==="]"?i--:w==="("?l++:w===")"&&l--}const d=s.length===0?o:o.slice(c);let m=d,p=!1;d.endsWith(vt)?(m=d.slice(0,-1),p=!0):d.startsWith(vt)&&(m=d.slice(1),p=!0);const b=a&&a>c?a-c:void 0;return Kt(s,p,m,b)};if(t){const o=t+qt,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):Kt(Go,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Wo=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],l=i[0]==="[",c=t.has(i);l||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},Ho=e=>({cache:Uo(e.cacheSize),parseClassName:Vo(e),sortModifiers:Wo(e),postfixLookupClassGroupIds:Bo(e),..._o(e)}),Bo=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Yo=/\s+/,qo=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,l=[],c=e.trim().split(Yo);let a="";for(let u=c.length-1;u>=0;u-=1){const d=c[u],{isExternal:m,modifiers:p,hasImportantModifier:b,baseClassName:y,maybePostfixModifierPosition:w}=n(d);if(m){a=d+(a.length>0?" "+a:a);continue}let x=!!w,E;if(x){const T=y.substring(0,w);E=r(T);const v=E&&i[E]?r(y):void 0;v&&v!==E&&(E=v,x=!1)}else E=r(y);if(!E){if(!x){a=d+(a.length>0?" "+a:a);continue}if(E=r(y),!E){a=d+(a.length>0?" "+a:a);continue}x=!1}const O=p.length===0?"":p.length===1?p[0]:s(p).join(":"),S=b?O+vt:O,k=S+E;if(l.indexOf(k)>-1)continue;l.push(k);const N=o(E,x);for(let T=0;T<N.length;++T){const v=N[T];l.push(S+v)}a=d+(a.length>0?" "+a:a)}return a},Ko=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=$n(n))&&(o&&(o+=" "),o+=r);return o},$n=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=$n(e[r]))&&(n&&(n+=" "),n+=t);return n},Xo=(e,...t)=>{let n,r,o,s;const i=c=>{const a=t.reduce((u,d)=>d(u),e());return n=Ho(a),r=n.cache.get,o=n.cache.set,s=l,l(c)},l=c=>{const a=r(c);if(a)return a;const u=qo(c,n);return o(c,u),u};return s=i,(...c)=>s(Ko(...c))},Jo=[],W=e=>{const t=n=>n[e]||Jo;return t.isThemeGetter=!0,t},In=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ln=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Zo=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Qo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,es=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ts=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ns=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rs=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,de=e=>Zo.test(e),P=e=>!!e&&!Number.isNaN(Number(e)),ee=e=>!!e&&Number.isInteger(Number(e)),pt=e=>e.endsWith("%")&&P(e.slice(0,-1)),oe=e=>Qo.test(e),Mn=()=>!0,os=e=>es.test(e)&&!ts.test(e),$t=()=>!1,ss=e=>ns.test(e),is=e=>rs.test(e),as=e=>!A(e)&&!C(e),ls=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),cs=e=>pe(e,jn,$t),A=e=>In.test(e),ge=e=>pe(e,Fn,os),Xt=e=>pe(e,bs,P),us=e=>pe(e,Gn,Mn),ds=e=>pe(e,Un,$t),Jt=e=>pe(e,Dn,$t),fs=e=>pe(e,zn,is),Be=e=>pe(e,Vn,ss),C=e=>Ln.test(e),De=e=>ve(e,Fn),ms=e=>ve(e,Un),Zt=e=>ve(e,Dn),ps=e=>ve(e,jn),gs=e=>ve(e,zn),Ye=e=>ve(e,Vn,!0),hs=e=>ve(e,Gn,!0),pe=(e,t,n)=>{const r=In.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ve=(e,t,n=!1)=>{const r=Ln.exec(e);return r?r[1]?t(r[1]):n:!1},Dn=e=>e==="position"||e==="percentage",zn=e=>e==="image"||e==="url",jn=e=>e==="length"||e==="size"||e==="bg-size",Fn=e=>e==="length",bs=e=>e==="number",Un=e=>e==="family-name",Gn=e=>e==="number"||e==="weight",Vn=e=>e==="shadow",ys=()=>{const e=W("color"),t=W("font"),n=W("text"),r=W("font-weight"),o=W("tracking"),s=W("leading"),i=W("breakpoint"),l=W("container"),c=W("spacing"),a=W("radius"),u=W("shadow"),d=W("inset-shadow"),m=W("text-shadow"),p=W("drop-shadow"),b=W("blur"),y=W("perspective"),w=W("aspect"),x=W("ease"),E=W("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...S(),C,A],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],v=()=>[C,A,c],I=()=>[de,"full","auto",...v()],D=()=>[ee,"none","subgrid",C,A],H=()=>["auto",{span:["full",ee,C,A]},ee,C,A],F=()=>[ee,"auto",C,A],j=()=>["auto","min","max","fr",C,A],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...v()],M=()=>[de,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...v()],_=()=>[de,"screen","full","dvw","lvw","svw","min","max","fit",...v()],G=()=>[de,"screen","full","lh","dvh","lvh","svh","min","max","fit",...v()],R=()=>[e,C,A],Ie=()=>[...S(),Zt,Jt,{position:[C,A]}],Ge=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ve=()=>["auto","cover","contain",ps,cs,{size:[C,A]}],Le=()=>[pt,De,ge],B=()=>["","none","full",a,C,A],Y=()=>["",P,De,ge],Q=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>[P,pt,Zt,Jt],We=()=>["","none",b,C,A],Ae=()=>["none",P,C,A],Ce=()=>["none",P,C,A],ue=()=>[P,C,A],He=()=>[de,"full",...v()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[oe],breakpoint:[oe],color:[Mn],container:[oe],"drop-shadow":[oe],ease:["in","out","in-out"],font:[as],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[oe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[oe],shadow:[oe],spacing:["px",P],text:[oe],"text-shadow":[oe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",de,A,C,w]}],container:["container"],"container-type":[{"@container":["","normal","size",C,A]}],"container-named":[ls],columns:[{columns:[P,A,C,l]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[ee,"auto",C,A]}],basis:[{basis:[de,"full","auto",l,...v()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[P,de,"auto","initial","none",A]}],grow:[{grow:["",P,C,A]}],shrink:[{shrink:["",P,C,A]}],order:[{order:[ee,"first","last","none",C,A]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:v()}],"gap-x":[{"gap-x":v()}],"gap-y":[{"gap-y":v()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:v()}],px:[{px:v()}],py:[{py:v()}],ps:[{ps:v()}],pe:[{pe:v()}],pbs:[{pbs:v()}],pbe:[{pbe:v()}],pt:[{pt:v()}],pr:[{pr:v()}],pb:[{pb:v()}],pl:[{pl:v()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":v()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":v()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",..._()]}],"min-inline-size":[{"min-inline":["auto",..._()]}],"max-inline-size":[{"max-inline":["none",..._()]}],"block-size":[{block:["auto",...G()]}],"min-block-size":[{"min-block":["auto",...G()]}],"max-block-size":[{"max-block":["none",...G()]}],w:[{w:[l,"screen",...M()]}],"min-w":[{"min-w":[l,"screen","none",...M()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",n,De,ge]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,hs,us]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",pt,A]}],"font-family":[{font:[ms,ds,t]}],"font-features":[{"font-features":[A]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,C,A]}],"line-clamp":[{"line-clamp":[P,"none",C,Xt]}],leading:[{leading:[s,...v()]}],"list-image":[{"list-image":["none",C,A]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",C,A]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[P,"from-font","auto",C,ge]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[P,"auto",C,A]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"tab-size":[{tab:[ee,C,A]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",C,A]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",C,A]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ie()}],"bg-repeat":[{bg:Ge()}],"bg-size":[{bg:Ve()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ee,C,A],radial:["",C,A],conic:[ee,C,A]},gs,fs]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:Le()}],"gradient-via-pos":[{via:Le()}],"gradient-to-pos":[{to:Le()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-bs":[{"border-bs":Y()}],"border-w-be":[{"border-be":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[P,C,A]}],"outline-w":[{outline:["",P,De,ge]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",u,Ye,Be]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",d,Ye,Be]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[P,ge]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",m,Ye,Be]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[P,C,A]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[P]}],"mask-image-linear-from-pos":[{"mask-linear-from":V()}],"mask-image-linear-to-pos":[{"mask-linear-to":V()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":V()}],"mask-image-t-to-pos":[{"mask-t-to":V()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":V()}],"mask-image-r-to-pos":[{"mask-r-to":V()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":V()}],"mask-image-b-to-pos":[{"mask-b-to":V()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":V()}],"mask-image-l-to-pos":[{"mask-l-to":V()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":V()}],"mask-image-x-to-pos":[{"mask-x-to":V()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":V()}],"mask-image-y-to-pos":[{"mask-y-to":V()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[C,A]}],"mask-image-radial-from-pos":[{"mask-radial-from":V()}],"mask-image-radial-to-pos":[{"mask-radial-to":V()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[P]}],"mask-image-conic-from-pos":[{"mask-conic-from":V()}],"mask-image-conic-to-pos":[{"mask-conic-to":V()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ie()}],"mask-repeat":[{mask:Ge()}],"mask-size":[{mask:Ve()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",C,A]}],filter:[{filter:["","none",C,A]}],blur:[{blur:We()}],brightness:[{brightness:[P,C,A]}],contrast:[{contrast:[P,C,A]}],"drop-shadow":[{"drop-shadow":["","none",p,Ye,Be]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",P,C,A]}],"hue-rotate":[{"hue-rotate":[P,C,A]}],invert:[{invert:["",P,C,A]}],saturate:[{saturate:[P,C,A]}],sepia:[{sepia:["",P,C,A]}],"backdrop-filter":[{"backdrop-filter":["","none",C,A]}],"backdrop-blur":[{"backdrop-blur":We()}],"backdrop-brightness":[{"backdrop-brightness":[P,C,A]}],"backdrop-contrast":[{"backdrop-contrast":[P,C,A]}],"backdrop-grayscale":[{"backdrop-grayscale":["",P,C,A]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[P,C,A]}],"backdrop-invert":[{"backdrop-invert":["",P,C,A]}],"backdrop-opacity":[{"backdrop-opacity":[P,C,A]}],"backdrop-saturate":[{"backdrop-saturate":[P,C,A]}],"backdrop-sepia":[{"backdrop-sepia":["",P,C,A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":v()}],"border-spacing-x":[{"border-spacing-x":v()}],"border-spacing-y":[{"border-spacing-y":v()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",C,A]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[P,"initial",C,A]}],ease:[{ease:["linear","initial",x,C,A]}],delay:[{delay:[P,C,A]}],animate:[{animate:["none",E,C,A]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,C,A]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Ae()}],"rotate-x":[{"rotate-x":Ae()}],"rotate-y":[{"rotate-y":Ae()}],"rotate-z":[{"rotate-z":Ae()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[C,A,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:He()}],"translate-x":[{"translate-x":He()}],"translate-y":[{"translate-y":He()}],"translate-z":[{"translate-z":He()}],"translate-none":["translate-none"],zoom:[{zoom:[ee,C,A]}],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",C,A]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":R()}],"scrollbar-track-color":[{"scrollbar-track":R()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mbs":[{"scroll-mbs":v()}],"scroll-mbe":[{"scroll-mbe":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pbs":[{"scroll-pbs":v()}],"scroll-pbe":[{"scroll-pbe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",C,A]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[P,De,ge,Xt]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},xs=Xo(ys);function le(...e){return xs(kn(e))}const Wn=Oo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Hn=f.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?Eo:"button";return h.jsx(i,{className:le(Wn({variant:t,size:n,className:e})),ref:s,...o})});Hn.displayName="Button";const Bn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:le("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Bn.displayName="Card";const Yn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:le("flex flex-col space-y-1.5 p-6",e),...t}));Yn.displayName="CardHeader";const qn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:le("text-2xl font-semibold leading-none tracking-tight",e),...t}));qn.displayName="CardTitle";const Kn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:le("text-sm text-muted-foreground",e),...t}));Kn.displayName="CardDescription";const Xn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:le("p-6 pt-0",e),...t}));Xn.displayName="CardContent";const Jn=f.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:le("flex items-center p-6 pt-0",e),...t}));Jn.displayName="CardFooter";function se(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Zn(e,t=[]){let n=[];function r(s,i){const l=f.createContext(i),c=n.length;n=[...n,i];const a=d=>{const{scope:m,children:p,...b}=d,y=m?.[e]?.[c]||l,w=f.useMemo(()=>b,Object.values(b));return h.jsx(y.Provider,{value:w,children:p})};a.displayName=s+"Provider";function u(d,m){const p=m?.[e]?.[c]||l,b=f.useContext(p);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[a,u]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(l){const c=l?.[e]||s;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[r,ws(o,...t)]}function ws(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((l,{useScope:c,scopeName:a})=>{const d=c(s)[`__scope${a}`];return{...l,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function vs(e){const t=Es(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,l=f.Children.toArray(s),c=l.find(Cs);if(c){const a=c.props.children,u=l.map(d=>d===c?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:d);return h.jsx(t,{...i,ref:o,children:f.isValidElement(a)?f.cloneElement(a,void 0,u):null})}return h.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Es(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=Ss(o),l=Rs(s,o.props);return o.type!==f.Fragment&&(l.ref=r?Pt(r,i):i),f.cloneElement(o,l)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var As=Symbol("radix.slottable");function Cs(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===As}function Rs(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Ss(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ts=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=Ts.reduce((e,t)=>{const n=vs(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:i,...l}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Os(e,t){e&&pn.flushSync(()=>e.dispatchEvent(t))}function st(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function ks(e,t=globalThis?.document){const n=st(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ns="DismissableLayer",Et="dismissableLayer.update",Ps="dismissableLayer.pointerDownOutside",_s="dismissableLayer.focusOutside",Qt,Qn=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),er=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...c}=e,a=f.useContext(Qn),[u,d]=f.useState(null),m=u?.ownerDocument??globalThis?.document,[,p]=f.useState({}),b=we(t,T=>d(T)),y=Array.from(a.layers),[w]=[...a.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(w),E=u?y.indexOf(u):-1,O=a.layersWithOutsidePointerEventsDisabled.size>0,S=E>=x,k=Ls(T=>{const v=T.target,I=[...a.branches].some(D=>D.contains(v));!S||I||(o?.(T),i?.(T),T.defaultPrevented||l?.())},m),N=Ms(T=>{const v=T.target;[...a.branches].some(D=>D.contains(v))||(s?.(T),i?.(T),T.defaultPrevented||l?.())},m);return ks(T=>{E===a.layers.size-1&&(r?.(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},m),f.useEffect(()=>{if(u)return n&&(a.layersWithOutsidePointerEventsDisabled.size===0&&(Qt=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),a.layersWithOutsidePointerEventsDisabled.add(u)),a.layers.add(u),en(),()=>{n&&a.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Qt)}},[u,m,n,a]),f.useEffect(()=>()=>{u&&(a.layers.delete(u),a.layersWithOutsidePointerEventsDisabled.delete(u),en())},[u,a]),f.useEffect(()=>{const T=()=>p({});return document.addEventListener(Et,T),()=>document.removeEventListener(Et,T)},[]),h.jsx(Ee.div,{...c,ref:b,style:{pointerEvents:O?S?"auto":"none":void 0,...e.style},onFocusCapture:se(e.onFocusCapture,N.onFocusCapture),onBlurCapture:se(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:se(e.onPointerDownCapture,k.onPointerDownCapture)})});er.displayName=Ns;var $s="DismissableLayerBranch",Is=f.forwardRef((e,t)=>{const n=f.useContext(Qn),r=f.useRef(null),o=we(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),h.jsx(Ee.div,{...e,ref:o})});Is.displayName=$s;function Ls(e,t=globalThis?.document){const n=st(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let c=function(){tr(Ps,n,a,{discrete:!0})};const a={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ms(e,t=globalThis?.document){const n=st(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&tr(_s,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function en(){const e=new CustomEvent(Et);document.dispatchEvent(e)}function tr(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Os(o,s):o.dispatchEvent(s)}var ye=globalThis?.document?f.useLayoutEffect:()=>{},Ds=f[" useId ".trim().toString()]||(()=>{}),zs=0;function js(e){const[t,n]=f.useState(Ds());return ye(()=>{n(r=>r??String(zs++))},[e]),t?`radix-${t}`:""}const Fs=["top","right","bottom","left"],fe=Math.min,q=Math.max,Qe=Math.round,qe=Math.floor,ne=e=>({x:e,y:e}),Us={left:"right",right:"left",bottom:"top",top:"bottom"};function At(e,t,n){return q(e,fe(t,n))}function ie(e,t){return typeof e=="function"?e(t):e}function ae(e){return e.split("-")[0]}function _e(e){return e.split("-")[1]}function It(e){return e==="x"?"y":"x"}function Lt(e){return e==="y"?"height":"width"}function te(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Mt(e){return It(te(e))}function Gs(e,t,n){n===void 0&&(n=!1);const r=_e(e),o=Mt(e),s=Lt(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=et(i)),[i,et(i)]}function Vs(e){const t=et(e);return[Ct(e),t,Ct(t)]}function Ct(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const tn=["left","right"],nn=["right","left"],Ws=["top","bottom"],Hs=["bottom","top"];function Bs(e,t,n){switch(e){case"top":case"bottom":return n?t?nn:tn:t?tn:nn;case"left":case"right":return t?Ws:Hs;default:return[]}}function Ys(e,t,n,r){const o=_e(e);let s=Bs(ae(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ct)))),s}function et(e){const t=ae(e);return Us[t]+e.slice(t.length)}function qs(e){return{top:0,right:0,bottom:0,left:0,...e}}function nr(e){return typeof e!="number"?qs(e):{top:e,right:e,bottom:e,left:e}}function tt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function rn(e,t,n){let{reference:r,floating:o}=e;const s=te(t),i=Mt(t),l=Lt(i),c=ae(t),a=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,m=r[l]/2-o[l]/2;let p;switch(c){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(_e(t)){case"start":p[i]-=m*(n&&a?-1:1);break;case"end":p[i]+=m*(n&&a?-1:1);break}return p}async function Ks(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=ie(t,e),b=nr(p),w=l[m?d==="floating"?"reference":"floating":d],x=tt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:a,rootBoundary:u,strategy:c})),E=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),S=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},k=tt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:O,strategy:c}):E);return{top:(x.top-k.top+b.top)/S.y,bottom:(k.bottom-x.bottom+b.bottom)/S.y,left:(x.left-k.left+b.left)/S.x,right:(k.right-x.right+b.right)/S.x}}const Xs=50,Js=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:Ks},c=await(i.isRTL==null?void 0:i.isRTL(t));let a=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=rn(a,r,c),m=r,p=0;const b={};for(let y=0;y<s.length;y++){const w=s[y];if(!w)continue;const{name:x,fn:E}=w,{x:O,y:S,data:k,reset:N}=await E({x:u,y:d,initialPlacement:r,placement:m,strategy:o,middlewareData:b,rects:a,platform:l,elements:{reference:e,floating:t}});u=O??u,d=S??d,b[x]={...b[x],...k},N&&p<Xs&&(p++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(a=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:u,y:d}=rn(a,m,c)),y=-1)}return{x:u,y:d,placement:m,strategy:o,middlewareData:b}},Zs=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:a,padding:u=0}=ie(e,t)||{};if(a==null)return{};const d=nr(u),m={x:n,y:r},p=Mt(o),b=Lt(p),y=await i.getDimensions(a),w=p==="y",x=w?"top":"left",E=w?"bottom":"right",O=w?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[p]-m[p]-s.floating[b],k=m[p]-s.reference[p],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a));let T=N?N[O]:0;(!T||!await(i.isElement==null?void 0:i.isElement(N)))&&(T=l.floating[O]||s.floating[b]);const v=S/2-k/2,I=T/2-y[b]/2-1,D=fe(d[x],I),H=fe(d[E],I),F=D,j=T-y[b]-H,z=T/2-y[b]/2+v,U=At(F,z,j),L=!c.arrow&&_e(o)!=null&&z!==U&&s.reference[b]/2-(z<F?D:H)-y[b]/2<0,M=L?z<F?z-F:z-j:0;return{[p]:m[p]+M,data:{[p]:U,centerOffset:z-U-M,...L&&{alignmentOffset:M}},reset:L}}}),Qs=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:a}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...w}=ie(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=ae(o),E=te(l),O=ae(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(a.floating)),k=m||(O||!y?[et(l)]:Vs(l)),N=b!=="none";!m&&N&&k.push(...Ys(l,y,b,S));const T=[l,...k],v=await c.detectOverflow(t,w),I=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&I.push(v[x]),d){const z=Gs(o,i,S);I.push(v[z[0]],v[z[1]])}if(D=[...D,{placement:o,overflows:I}],!I.every(z=>z<=0)){var H,F;const z=(((H=s.flip)==null?void 0:H.index)||0)+1,U=T[z];if(U&&(!(d==="alignment"?E!==te(U):!1)||D.every(_=>te(_.placement)===E?_.overflows[0]>0:!0)))return{data:{index:z,overflows:D},reset:{placement:U}};let L=(F=D.filter(M=>M.overflows[0]<=0).sort((M,_)=>M.overflows[1]-_.overflows[1])[0])==null?void 0:F.placement;if(!L)switch(p){case"bestFit":{var j;const M=(j=D.filter(_=>{if(N){const G=te(_.placement);return G===E||G==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(G=>G>0).reduce((G,R)=>G+R,0)]).sort((_,G)=>_[1]-G[1])[0])==null?void 0:j[0];M&&(L=M);break}case"initialPlacement":L=l;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function on(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sn(e){return Fs.some(t=>e[t]>=0)}const ei=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=ie(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),l=on(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:sn(l)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),l=on(i,n.floating);return{data:{escapedOffsets:l,escaped:sn(l)}}}default:return{}}}}},rr=new Set(["left","top"]);async function ti(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ae(n),l=_e(n),c=te(n)==="y",a=rr.has(i)?-1:1,u=s&&c?-1:1,d=ie(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof b=="number"&&(p=l==="end"?b*-1:b),c?{x:p*u,y:m*a}:{x:m*a,y:p*u}}const ni=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,c=await ti(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},ri=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:E,y:O}=x;return{x:E,y:O}}},...a}=ie(e,t),u={x:n,y:r},d=await s.detectOverflow(t,a),m=te(ae(o)),p=It(m);let b=u[p],y=u[m];if(i){const x=p==="y"?"top":"left",E=p==="y"?"bottom":"right",O=b+d[x],S=b-d[E];b=At(O,b,S)}if(l){const x=m==="y"?"top":"left",E=m==="y"?"bottom":"right",O=y+d[x],S=y-d[E];y=At(O,y,S)}const w=c.fn({...t,[p]:b,[m]:y});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[p]:i,[m]:l}}}}}},oi=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:a=!0}=ie(e,t),u={x:n,y:r},d=te(o),m=It(d);let p=u[m],b=u[d];const y=ie(l,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const O=m==="y"?"height":"width",S=s.reference[m]-s.floating[O]+w.mainAxis,k=s.reference[m]+s.reference[O]-w.mainAxis;p<S?p=S:p>k&&(p=k)}if(a){var x,E;const O=m==="y"?"width":"height",S=rr.has(ae(o)),k=s.reference[d]-s.floating[O]+(S&&((x=i.offset)==null?void 0:x[d])||0)+(S?0:w.crossAxis),N=s.reference[d]+s.reference[O]+(S?0:((E=i.offset)==null?void 0:E[d])||0)-(S?w.crossAxis:0);b<k?b=k:b>N&&(b=N)}return{[m]:p,[d]:b}}}},si=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...a}=ie(e,t),u=await i.detectOverflow(t,a),d=ae(o),m=_e(o),p=te(o)==="y",{width:b,height:y}=s.floating;let w,x;d==="top"||d==="bottom"?(w=d,x=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(x=d,w=m==="end"?"top":"bottom");const E=y-u.top-u.bottom,O=b-u.left-u.right,S=fe(y-u[w],E),k=fe(b-u[x],O),N=!t.middlewareData.shift;let T=S,v=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(v=O),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=E),N&&!m){const D=q(u.left,0),H=q(u.right,0),F=q(u.top,0),j=q(u.bottom,0);p?v=b-2*(D!==0||H!==0?D+H:q(u.left,u.right)):T=y-2*(F!==0||j!==0?F+j:q(u.top,u.bottom))}await c({...t,availableWidth:v,availableHeight:T});const I=await i.getDimensions(l.floating);return b!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function it(){return typeof window<"u"}function $e(e){return or(e)?(e.nodeName||"").toLowerCase():"#document"}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function re(e){var t;return(t=(or(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function or(e){return it()?e instanceof Node||e instanceof K(e).Node:!1}function J(e){return it()?e instanceof Element||e instanceof K(e).Element:!1}function ce(e){return it()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function an(e){return!it()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}function Ue(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function ii(e){return/^(table|td|th)$/.test($e(e))}function at(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ai=/transform|translate|scale|rotate|perspective|filter/,li=/paint|layout|strict|content/,he=e=>!!e&&e!=="none";let gt;function Dt(e){const t=J(e)?Z(e):e;return he(t.transform)||he(t.translate)||he(t.scale)||he(t.rotate)||he(t.perspective)||!zt()&&(he(t.backdropFilter)||he(t.filter))||ai.test(t.willChange||"")||li.test(t.contain||"")}function ci(e){let t=me(e);for(;ce(t)&&!ke(t);){if(Dt(t))return t;if(at(t))return null;t=me(t)}return null}function zt(){return gt==null&&(gt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gt}function ke(e){return/^(html|body|#document)$/.test($e(e))}function Z(e){return K(e).getComputedStyle(e)}function lt(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function me(e){if($e(e)==="html")return e;const t=e.assignedSlot||e.parentNode||an(e)&&e.host||re(e);return an(t)?t.host:t}function sr(e){const t=me(e);return ke(t)?e.ownerDocument?e.ownerDocument.body:e.body:ce(t)&&Ue(t)?t:sr(t)}function je(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=sr(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=K(o);if(s){const l=Rt(i);return t.concat(i,i.visualViewport||[],Ue(o)?o:[],l&&n?je(l):[])}else return t.concat(o,je(o,[],n))}function Rt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ir(e){const t=Z(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ce(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=Qe(n)!==s||Qe(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function jt(e){return J(e)?e:e.contextElement}function Oe(e){const t=jt(e);if(!ce(t))return ne(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=ir(t);let i=(s?Qe(n.width):n.width)/r,l=(s?Qe(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const ui=ne(0);function ar(e){const t=K(e);return!zt()||!t.visualViewport?ui:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function di(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==K(e)?!1:t}function xe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=jt(e);let i=ne(1);t&&(r?J(r)&&(i=Oe(r)):i=Oe(e));const l=di(s,n,r)?ar(s):ne(0);let c=(o.left+l.x)/i.x,a=(o.top+l.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const m=K(s),p=r&&J(r)?K(r):r;let b=m,y=Rt(b);for(;y&&r&&p!==b;){const w=Oe(y),x=y.getBoundingClientRect(),E=Z(y),O=x.left+(y.clientLeft+parseFloat(E.paddingLeft))*w.x,S=x.top+(y.clientTop+parseFloat(E.paddingTop))*w.y;c*=w.x,a*=w.y,u*=w.x,d*=w.y,c+=O,a+=S,b=K(y),y=Rt(b)}}return tt({width:u,height:d,x:c,y:a})}function ct(e,t){const n=lt(e).scrollLeft;return t?t.left+n:xe(re(e)).left+n}function lr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ct(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function fi(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=re(r),l=t?at(t.floating):!1;if(r===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},a=ne(1);const u=ne(0),d=ce(r);if((d||!d&&!s)&&(($e(r)!=="body"||Ue(i))&&(c=lt(r)),d)){const p=xe(r);a=Oe(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const m=i&&!d&&!s?lr(i,c):ne(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+u.x+m.x,y:n.y*a.y-c.scrollTop*a.y+u.y+m.y}}function mi(e){return Array.from(e.getClientRects())}function pi(e){const t=re(e),n=lt(e),r=e.ownerDocument.body,o=q(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=q(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+ct(e);const l=-n.scrollTop;return Z(r).direction==="rtl"&&(i+=q(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:l}}const ln=25;function gi(e,t){const n=K(e),r=re(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(o){s=o.width,i=o.height;const u=zt();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const a=ct(r);if(a<=0){const u=r.ownerDocument,d=u.body,m=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(r.clientWidth-d.clientWidth-p);b<=ln&&(s-=b)}else a<=ln&&(s+=a);return{width:s,height:i,x:l,y:c}}function hi(e,t){const n=xe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=ce(e)?Oe(e):ne(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=o*s.x,a=r*s.y;return{width:i,height:l,x:c,y:a}}function cn(e,t,n){let r;if(t==="viewport")r=gi(e,n);else if(t==="document")r=pi(re(e));else if(J(t))r=hi(t,n);else{const o=ar(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return tt(r)}function cr(e,t){const n=me(e);return n===t||!J(n)||ke(n)?!1:Z(n).position==="fixed"||cr(n,t)}function bi(e,t){const n=t.get(e);if(n)return n;let r=je(e,[],!1).filter(l=>J(l)&&$e(l)!=="body"),o=null;const s=Z(e).position==="fixed";let i=s?me(e):e;for(;J(i)&&!ke(i);){const l=Z(i),c=Dt(i);!c&&l.position==="fixed"&&(o=null),(s?!c&&!o:!c&&l.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ue(i)&&!c&&cr(e,i))?r=r.filter(u=>u!==i):o=l,i=me(i)}return t.set(e,r),r}function yi(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?at(t)?[]:bi(t,this._c):[].concat(n),r],l=cn(t,i[0],o);let c=l.top,a=l.right,u=l.bottom,d=l.left;for(let m=1;m<i.length;m++){const p=cn(t,i[m],o);c=q(p.top,c),a=fe(p.right,a),u=fe(p.bottom,u),d=q(p.left,d)}return{width:a-d,height:u-c,x:d,y:c}}function xi(e){const{width:t,height:n}=ir(e);return{width:t,height:n}}function wi(e,t,n){const r=ce(t),o=re(t),s=n==="fixed",i=xe(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=ne(0);function a(){c.x=ct(o)}if(r||!r&&!s)if(($e(t)!=="body"||Ue(o))&&(l=lt(t)),r){const p=xe(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&a();s&&!r&&o&&a();const u=o&&!r&&!s?lr(o,l):ne(0),d=i.left+l.scrollLeft-c.x-u.x,m=i.top+l.scrollTop-c.y-u.y;return{x:d,y:m,width:i.width,height:i.height}}function ht(e){return Z(e).position==="static"}function un(e,t){if(!ce(e)||Z(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return re(e)===n&&(n=n.ownerDocument.body),n}function ur(e,t){const n=K(e);if(at(e))return n;if(!ce(e)){let o=me(e);for(;o&&!ke(o);){if(J(o)&&!ht(o))return o;o=me(o)}return n}let r=un(e,t);for(;r&&ii(r)&&ht(r);)r=un(r,t);return r&&ke(r)&&ht(r)&&!Dt(r)?n:r||ci(e)||n}const vi=async function(e){const t=this.getOffsetParent||ur,n=this.getDimensions,r=await n(e.floating);return{reference:wi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ei(e){return Z(e).direction==="rtl"}const Ai={convertOffsetParentRelativeRectToViewportRelativeRect:fi,getDocumentElement:re,getClippingRect:yi,getOffsetParent:ur,getElementRects:vi,getClientRects:mi,getDimensions:xi,getScale:Oe,isElement:J,isRTL:Ei};function dr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ci(e,t){let n=null,r;const o=re(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const a=e.getBoundingClientRect(),{left:u,top:d,width:m,height:p}=a;if(l||t(),!m||!p)return;const b=qe(d),y=qe(o.clientWidth-(u+m)),w=qe(o.clientHeight-(d+p)),x=qe(u),O={rootMargin:-b+"px "+-y+"px "+-w+"px "+-x+"px",threshold:q(0,fe(1,c))||1};let S=!0;function k(N){const T=N[0].intersectionRatio;if(T!==c){if(!S)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!dr(a,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(k,{...O,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,O)}n.observe(e)}return i(!0),s}function Ri(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,a=jt(e),u=o||s?[...a?je(a):[],...t?je(t):[]]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const d=a&&l?Ci(a,n):null;let m=-1,p=null;i&&(p=new ResizeObserver(x=>{let[E]=x;E&&E.target===a&&p&&t&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var O;(O=p)==null||O.observe(t)})),n()}),a&&!c&&p.observe(a),t&&p.observe(t));let b,y=c?xe(e):null;c&&w();function w(){const x=xe(e);y&&!dr(y,x)&&n(),y=x,b=requestAnimationFrame(w)}return n(),()=>{var x;u.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),d?.(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(b)}}const Si=ni,Ti=ri,Oi=Qs,ki=si,Ni=ei,dn=Zs,Pi=oi,_i=(e,t,n)=>{const r=new Map,o={platform:Ai,...n},s={...o.platform,_c:r};return Js(e,t,{...o,platform:s})};var $i=typeof document<"u",Ii=function(){},Xe=$i?$.useLayoutEffect:Ii;function nt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!nt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!nt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function fr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fn(e,t){const n=fr(e);return Math.round(t*n)/n}function bt(e){const t=f.useRef(e);return Xe(()=>{t.current=e}),t}function Li(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:a}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=f.useState(r);nt(m,r)||p(r);const[b,y]=f.useState(null),[w,x]=f.useState(null),E=f.useCallback(_=>{_!==N.current&&(N.current=_,y(_))},[]),O=f.useCallback(_=>{_!==T.current&&(T.current=_,x(_))},[]),S=s||b,k=i||w,N=f.useRef(null),T=f.useRef(null),v=f.useRef(u),I=c!=null,D=bt(c),H=bt(o),F=bt(a),j=f.useCallback(()=>{if(!N.current||!T.current)return;const _={placement:t,strategy:n,middleware:m};H.current&&(_.platform=H.current),_i(N.current,T.current,_).then(G=>{const R={...G,isPositioned:F.current!==!1};z.current&&!nt(v.current,R)&&(v.current=R,pn.flushSync(()=>{d(R)}))})},[m,t,n,H,F]);Xe(()=>{a===!1&&v.current.isPositioned&&(v.current.isPositioned=!1,d(_=>({..._,isPositioned:!1})))},[a]);const z=f.useRef(!1);Xe(()=>(z.current=!0,()=>{z.current=!1}),[]),Xe(()=>{if(S&&(N.current=S),k&&(T.current=k),S&&k){if(D.current)return D.current(S,k,j);j()}},[S,k,j,D,I]);const U=f.useMemo(()=>({reference:N,floating:T,setReference:E,setFloating:O}),[E,O]),L=f.useMemo(()=>({reference:S,floating:k}),[S,k]),M=f.useMemo(()=>{const _={position:n,left:0,top:0};if(!L.floating)return _;const G=fn(L.floating,u.x),R=fn(L.floating,u.y);return l?{..._,transform:"translate("+G+"px, "+R+"px)",...fr(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:R}},[n,l,L.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:j,refs:U,elements:L,floatingStyles:M}),[u,j,U,L,M])}const Mi=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?dn({element:r.current,padding:o}).fn(n):{}:r?dn({element:r,padding:o}).fn(n):{}}}},Di=(e,t)=>{const n=Si(e);return{name:n.name,fn:n.fn,options:[e,t]}},zi=(e,t)=>{const n=Ti(e);return{name:n.name,fn:n.fn,options:[e,t]}},ji=(e,t)=>({fn:Pi(e).fn,options:[e,t]}),Fi=(e,t)=>{const n=Oi(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ui=(e,t)=>{const n=ki(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gi=(e,t)=>{const n=Ni(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vi=(e,t)=>{const n=Mi(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Wi="Arrow",mr=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return h.jsx(Ee.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});mr.displayName=Wi;var Hi=mr;function Bi(e){const[t,n]=f.useState(void 0);return ye(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,l;if("borderBoxSize"in s){const c=s.borderBoxSize,a=Array.isArray(c)?c[0]:c;i=a.inlineSize,l=a.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Ft="Popper",[pr,gr]=Zn(Ft),[Yi,hr]=pr(Ft),br=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return h.jsx(Yi,{scope:t,anchor:r,onAnchorChange:o,children:n})};br.displayName=Ft;var yr="PopperAnchor",xr=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=hr(yr,n),i=f.useRef(null),l=we(t,i),c=f.useRef(null);return f.useEffect(()=>{const a=c.current;c.current=r?.current||i.current,a!==c.current&&s.onAnchorChange(c.current)}),r?null:h.jsx(Ee.div,{...o,ref:l})});xr.displayName=yr;var Ut="PopperContent",[qi,Ki]=pr(Ut),wr=f.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:a=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:b,...y}=e,w=hr(Ut,n),[x,E]=f.useState(null),O=we(t,Q=>E(Q)),[S,k]=f.useState(null),N=Bi(S),T=N?.width??0,v=N?.height??0,I=r+(s!=="center"?"-"+s:""),D=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},H=Array.isArray(a)?a:[a],F=H.length>0,j={padding:D,boundary:H.filter(Ji),altBoundary:F},{refs:z,floatingStyles:U,placement:L,isPositioned:M,middlewareData:_}=Li({strategy:"fixed",placement:I,whileElementsMounted:(...Q)=>Ri(...Q,{animationFrame:p==="always"}),elements:{reference:w.anchor},middleware:[Di({mainAxis:o+v,alignmentAxis:i}),c&&zi({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?ji():void 0,...j}),c&&Fi({...j}),Ui({...j,apply:({elements:Q,rects:Me,availableWidth:V,availableHeight:We})=>{const{width:Ae,height:Ce}=Me.reference,ue=Q.floating.style;ue.setProperty("--radix-popper-available-width",`${V}px`),ue.setProperty("--radix-popper-available-height",`${We}px`),ue.setProperty("--radix-popper-anchor-width",`${Ae}px`),ue.setProperty("--radix-popper-anchor-height",`${Ce}px`)}}),S&&Vi({element:S,padding:l}),Zi({arrowWidth:T,arrowHeight:v}),m&&Gi({strategy:"referenceHidden",...j})]}),[G,R]=Ar(L),Ie=st(b);ye(()=>{M&&Ie?.()},[M,Ie]);const Ge=_.arrow?.x,Ve=_.arrow?.y,Le=_.arrow?.centerOffset!==0,[B,Y]=f.useState();return ye(()=>{x&&Y(window.getComputedStyle(x).zIndex)},[x]),h.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:M?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(qi,{scope:n,placedSide:G,onArrowChange:k,arrowX:Ge,arrowY:Ve,shouldHideArrow:Le,children:h.jsx(Ee.div,{"data-side":G,"data-align":R,...y,ref:O,style:{...y.style,animation:M?void 0:"none"}})})})});wr.displayName=Ut;var vr="PopperArrow",Xi={top:"bottom",right:"left",bottom:"top",left:"right"},Er=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Ki(vr,r),i=Xi[s.placedSide];return h.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:h.jsx(Hi,{...o,ref:n,style:{...o.style,display:"block"}})})});Er.displayName=vr;function Ji(e){return e!==null}var Zi=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[a,u]=Ar(n),d={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,p=(o.arrow?.y??0)+c/2;let b="",y="";return a==="bottom"?(b=i?d:`${m}px`,y=`${-c}px`):a==="top"?(b=i?d:`${m}px`,y=`${r.floating.height+c}px`):a==="right"?(b=`${-c}px`,y=i?d:`${p}px`):a==="left"&&(b=`${r.floating.width+c}px`,y=i?d:`${p}px`),{data:{x:b,y}}}});function Ar(e){const[t,n="center"]=e.split("-");return[t,n]}var Qi=br,ea=xr,ta=wr,na=Er;function ra(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Cr=e=>{const{present:t,children:n}=e,r=oa(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=we(r.ref,sa(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};Cr.displayName="Presence";function oa(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),i=e?"mounted":"unmounted",[l,c]=ra(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const a=Ke(r.current);s.current=l==="mounted"?a:"none"},[l]),ye(()=>{const a=r.current,u=o.current;if(u!==e){const m=s.current,p=Ke(a);e?c("MOUNT"):p==="none"||a?.display==="none"?c("UNMOUNT"):c(u&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),ye(()=>{if(t){let a;const u=t.ownerDocument.defaultView??window,d=p=>{const y=Ke(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(c("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",a=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=p=>{p.target===t&&(s.current=Ke(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(a),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(a=>{r.current=a?getComputedStyle(a):null,n(a)},[])}}function Ke(e){return e?.animationName||"none"}function sa(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ia=Symbol("radix.slottable");function aa(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ia,t}var la=f[" useInsertionEffect ".trim().toString()]||ye;function ca({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=ua({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:o;{const u=f.useRef(e!==void 0);f.useEffect(()=>{const d=u.current;d!==l&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,r])}const a=f.useCallback(u=>{if(l){const d=da(u)?u(e):u;d!==e&&i.current?.(d)}else s(u)},[l,e,s,i]);return[c,a]}function ua({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return la(()=>{s.current=t},[t]),f.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function da(e){return typeof e=="function"}var fa=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ma="VisuallyHidden",Rr=f.forwardRef((e,t)=>h.jsx(Ee.span,{...e,ref:t,style:{...fa,...e.style}}));Rr.displayName=ma;var pa=Rr,[ut]=Zn("Tooltip",[gr]),dt=gr(),Sr="TooltipProvider",ga=700,St="tooltip.open",[ha,Gt]=ut(Sr),Tr=e=>{const{__scopeTooltip:t,delayDuration:n=ga,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=f.useRef(!0),l=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{const a=c.current;return()=>window.clearTimeout(a)},[]),h.jsx(ha,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:f.useCallback(a=>{l.current=a},[]),disableHoverableContent:o,children:s})};Tr.displayName=Sr;var Fe="Tooltip",[ba,ft]=ut(Fe),Or=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:l}=e,c=Gt(Fe,e.__scopeTooltip),a=dt(t),[u,d]=f.useState(null),m=js(),p=f.useRef(0),b=i??c.disableHoverableContent,y=l??c.delayDuration,w=f.useRef(!1),[x,E]=ca({prop:r,defaultProp:o??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(St))):c.onClose(),s?.(T)},caller:Fe}),O=f.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),S=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,w.current=!1,E(!0)},[E]),k=f.useCallback(()=>{window.clearTimeout(p.current),p.current=0,E(!1)},[E]),N=f.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{w.current=!0,E(!0),p.current=0},y)},[y,E]);return f.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(Qi,{...a,children:h.jsx(ba,{scope:t,contentId:m,open:x,stateAttribute:O,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?N():S()},[c.isOpenDelayedRef,N,S]),onTriggerLeave:f.useCallback(()=>{b?k():(window.clearTimeout(p.current),p.current=0)},[k,b]),onOpen:S,onClose:k,disableHoverableContent:b,children:n})})};Or.displayName=Fe;var Tt="TooltipTrigger",kr=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ft(Tt,n),s=Gt(Tt,n),i=dt(n),l=f.useRef(null),c=we(t,l,o.onTriggerChange),a=f.useRef(!1),u=f.useRef(!1),d=f.useCallback(()=>a.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(ea,{asChild:!0,...i,children:h.jsx(Ee.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:se(e.onPointerMove,m=>{m.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:se(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:se(e.onPointerDown,()=>{o.open&&o.onClose(),a.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:se(e.onFocus,()=>{a.current||o.onOpen()}),onBlur:se(e.onBlur,o.onClose),onClick:se(e.onClick,o.onClose)})})});kr.displayName=Tt;var ya="TooltipPortal",[Ua,xa]=ut(ya,{forceMount:void 0}),Ne="TooltipContent",Nr=f.forwardRef((e,t)=>{const n=xa(Ne,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=ft(Ne,e.__scopeTooltip);return h.jsx(Cr,{present:r||i.open,children:i.disableHoverableContent?h.jsx(Pr,{side:o,...s,ref:t}):h.jsx(wa,{side:o,...s,ref:t})})}),wa=f.forwardRef((e,t)=>{const n=ft(Ne,e.__scopeTooltip),r=Gt(Ne,e.__scopeTooltip),o=f.useRef(null),s=we(t,o),[i,l]=f.useState(null),{trigger:c,onClose:a}=n,u=o.current,{onPointerInTransitChange:d}=r,m=f.useCallback(()=>{l(null),d(!1)},[d]),p=f.useCallback((b,y)=>{const w=b.currentTarget,x={x:b.clientX,y:b.clientY},E=Ra(x,w.getBoundingClientRect()),O=Sa(x,E),S=Ta(y.getBoundingClientRect()),k=ka([...O,...S]);l(k),d(!0)},[d]);return f.useEffect(()=>()=>m(),[m]),f.useEffect(()=>{if(c&&u){const b=w=>p(w,u),y=w=>p(w,c);return c.addEventListener("pointerleave",b),u.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",y)}}},[c,u,p,m]),f.useEffect(()=>{if(i){const b=y=>{const w=y.target,x={x:y.clientX,y:y.clientY},E=c?.contains(w)||u?.contains(w),O=!Oa(x,i);E?m():O&&(m(),a())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,u,i,a,m]),h.jsx(Pr,{...e,ref:s})}),[va,Ea]=ut(Fe,{isInside:!1}),Aa=aa("TooltipContent"),Pr=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...l}=e,c=ft(Ne,n),a=dt(n),{onClose:u}=c;return f.useEffect(()=>(document.addEventListener(St,u),()=>document.removeEventListener(St,u)),[u]),f.useEffect(()=>{if(c.trigger){const d=m=>{m.target?.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),h.jsx(er,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(ta,{"data-state":c.stateAttribute,...a,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Aa,{children:r}),h.jsx(va,{scope:n,isInside:!0,children:h.jsx(pa,{id:c.contentId,role:"tooltip",children:o||r})})]})})});Nr.displayName=Ne;var _r="TooltipArrow",Ca=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=dt(n);return Ea(_r,n).isInside?null:h.jsx(na,{...o,...r,ref:t})});Ca.displayName=_r;function Ra(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Sa(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ta(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Oa(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const l=t[s],c=t[i],a=l.x,u=l.y,d=c.x,m=c.y;u>r!=m>r&&n<(d-a)*(r-u)/(m-u)+a&&(o=!o)}return o}function ka(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Na(t)}function Na(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Pa=Tr,_a=Or,$a=kr,$r=Nr;const Ia=Pa,La=_a,Ma=$a,Ir=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx($r,{ref:r,sideOffset:t,className:le("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...n}));Ir.displayName=$r.displayName;const Da="agent-approval-count-changed";function za(e,t){if(e.length>0){const n=e[e.length-1];if(n&&typeof n=="object"&&!Array.isArray(n))return[...e.slice(0,-1),{...n,signal:t}]}return[...e,{signal:t}]}function ja(e,t={}){const{domain:n="server",onSuccess:r,onError:o}=t,[s,i]=$.useState(!1),[l,c]=$.useState(null),[a,u]=$.useState(null),d=$.useRef(!0),m=$.useRef(null);$.useEffect(()=>(d.current=!0,()=>{d.current=!1,m.current&&m.current.abort()}),[]);const p=$.useCallback(()=>{d.current&&(c(null),u(null))},[]),b=$.useCallback(async(...y)=>{m.current&&m.current.abort();const w=new AbortController;m.current=w,d.current&&(i(!0),c(null));try{const x=await e(...za(y,w.signal));return!d.current||w.signal.aborted?null:(u(x),r?.(x),x)}catch(x){if(!d.current||w.signal.aborted)return null;if(x instanceof X){if(x.domain=n,x.status===401)return null;x.status===408&&(x.message=`${n} timed out. Check your connection and try again.`)}return c(x),o?.(x),null}finally{m.current===w&&(m.current=null),d.current&&!w.signal.aborted&&i(!1)}},[e,n,o,r]);return{loading:s,error:l,data:a,execute:b,reset:p}}function Fa(){const[e,t]=$.useState(null),n=$.useCallback((o,s="error")=>{t({message:String(o),type:s}),setTimeout(()=>t(null),4e3)},[]),r=$.useCallback(()=>t(null),[]);return{toast:e,showToast:n,clearToast:r}}exports.API_BASE=xt;exports.APPROVAL_EVENT=Da;exports.AdminAccessRequired=bo;exports.ApiError=X;exports.AppShell=lo;exports.AuthProvider=no;exports.Button=Hn;exports.Card=Bn;exports.CardContent=Xn;exports.CardDescription=Kn;exports.CardFooter=Jn;exports.CardHeader=Yn;exports.CardTitle=qn;exports.DomainError=go;exports.EmptyState=yo;exports.LoadingPanel=po;exports.ProtectedRoute=co;exports.ROUTES=rt;exports.SystemProvider=ro;exports.Toast=mo;exports.Tooltip=La;exports.TooltipContent=Ir;exports.TooltipProvider=Ia;exports.TooltipTrigger=Ma;exports.VersionMismatchBanner=fo;exports.adminRequest=Fr;exports.authRequest=xn;exports.authRequestExternal=Ur;exports.bootIdentity=En;exports.buildApiUrl=hn;exports.buttonVariants=Wn;exports.clearStoredToken=Se;exports.cn=le;exports.getStoredToken=be;exports.loginUser=wn;exports.registerUser=vn;exports.request=Pe;exports.requestAbsolute=Nt;exports.safeArray=Mr;exports.safeMap=yt;exports.setStoredToken=wt;exports.taggedRequest=zr;exports.unwrapEnvelope=jr;exports.useAdminApiGuard=ho;exports.useApiCall=ja;exports.useAuth=ot;exports.useSystem=Sn;exports.useToast=Fa;
2
+ //# sourceMappingURL=index.cjs.map