From 4c862ef4b7d127f01cfb18b813bf9887519b16a6 Mon Sep 17 00:00:00 2001 From: baiyanyun Date: Thu, 11 Jun 2026 18:31:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=B8=E6=94=B6=E6=95=B0=E5=AD=97=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E5=85=A5=E5=8F=A3=E8=B7=AF=E7=94=B1=E5=B9=B2=E9=A2=84?= =?UTF-8?q?=E5=9B=9E=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../embedded/sgrobot-digital/src/lib/api.ts | 17 + .../src/lib/qimingclawAdapter.ts | 289 +++++++++++++++ .../src/pages/digital/CommandDeck.tsx | 85 ++++- .../embedded/sgrobot-digital/src/types/api.ts | 49 +++ .../sgrobot-digital/assets/index-BUX1PxSf.js | 184 ---------- .../sgrobot-digital/assets/index-CEkePwhY.js | 184 ++++++++++ .../public/sgrobot-digital/index.html | 2 +- .../scripts/check-digital-employee.js | 13 + .../main/ipc/digitalEmployeeHandlers.test.ts | 23 ++ .../src/main/ipc/digitalEmployeeHandlers.ts | 11 + .../digitalEmployee/stateService.test.ts | 85 +++++ .../services/digitalEmployee/stateService.ts | 338 ++++++++++++++++++ .../digitalEmployee/syncService.test.ts | 25 ++ .../services/digitalEmployee/syncService.ts | 23 +- .../src/preload/webviewPerfBridge.ts | 6 + ...ital-employee-frontend-integration-plan.md | 8 +- 16 files changed, 1151 insertions(+), 191 deletions(-) delete mode 100644 qimingclaw/crates/agent-electron-client/public/sgrobot-digital/assets/index-BUX1PxSf.js create mode 100644 qimingclaw/crates/agent-electron-client/public/sgrobot-digital/assets/index-CEkePwhY.js diff --git a/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/lib/api.ts b/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/lib/api.ts index fa0755a4..fdd9dd69 100644 --- a/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/lib/api.ts +++ b/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/lib/api.ts @@ -30,6 +30,9 @@ import type { CreatePlanRequest, RouteDecisionTimelineResponse, RouteDecisionPolicyPullResult, + RouteInterventionDecisionRequest, + RouteInterventionDecisionResponse, + RouteInterventionTimelineResponse, IngressRouteRequest, IngressRouteResponse, GovernanceCommandRequest, @@ -496,6 +499,20 @@ export function getRouteDecisionTimeline(): Promise('/api/route-decisions'); } +export function getRouteInterventions(): Promise { + return apiFetch('/api/route-decisions/interventions'); +} + +export function decideRouteIntervention( + routeDecisionId: string, + input: RouteInterventionDecisionRequest, +): Promise { + return apiFetch(`/api/route-decisions/${encodeURIComponent(routeDecisionId)}/intervention`, { + method: 'POST', + body: JSON.stringify(input), + }); +} + export function routeIngress( body: IngressRouteRequest, ): Promise { diff --git a/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/lib/qimingclawAdapter.ts b/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/lib/qimingclawAdapter.ts index 419fb014..ce0d3b38 100644 --- a/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/lib/qimingclawAdapter.ts +++ b/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/lib/qimingclawAdapter.ts @@ -42,6 +42,10 @@ import type { RouteDecisionPolicyPullResult, RouteDecisionRecord, RouteDecisionTimelineResponse, + RouteInterventionDecisionRequest, + RouteInterventionDecisionResponse, + RouteInterventionRecord, + RouteInterventionTimelineResponse, SkillSpec, UserNotification, } from '@/types/api'; @@ -78,7 +82,9 @@ declare global { dispatchPlanReadySteps?: (planId: string) => Promise; getScheduleRuns?: (scheduleId: string, limit?: number) => Promise; listRouteDecisions?: (options?: { limit?: number }) => Promise; + listRouteInterventions?: (options?: { limit?: number }) => Promise; recordRouteDecision?: (input: QimingclawRouteDecisionInput) => Promise; + recordRouteInterventionResolution?: (input: QimingclawRouteInterventionResolutionInput) => Promise; recordGovernanceCommand?: (command: QimingclawGovernanceCommandRecord) => Promise; recordDailyReport?: (input: QimingclawDailyReportRecordInput) => Promise; accessArtifact?: (artifactId: string, action: 'preview' | 'download' | 'open_location', options?: { actor?: string | null; source?: string | null }) => Promise; @@ -377,6 +383,7 @@ interface QimingclawRouteDecisionInput { } interface QimingclawRouteDecisionPolicyInput { + routeDecisionId?: string | null; routeKind?: string | null; intentKind?: string | null; reasonCodes?: string[] | null; @@ -408,6 +415,30 @@ interface QimingclawRouteDecisionPolicyResult { error?: string | null; } +interface QimingclawRouteInterventionResolutionInput { + routeDecisionId: string; + approvalId?: string | null; + decision: string; + createdCommandId?: string | null; + commandAccepted?: boolean | null; + commandError?: string | null; + blockedReason?: string | null; + policyResult?: string | null; + policySource?: string | null; + matchedIntent?: string | null; + routeKind?: string | null; + intentKind?: string | null; + reasonCodes?: string[] | null; + candidateSkills?: string[] | null; + contextRefs?: Record | null; + entrypoint?: string | null; + actor?: string | null; + correlationId?: string | null; + message?: string | null; + payload?: Record | null; + occurredAt?: string | null; +} + interface QimingclawRiskPolicyInput { actionKind?: string | null; actionLabel?: string | null; @@ -903,6 +934,17 @@ export async function handleQimingclawDigitalApi( if (method === 'GET' && pathname === '/api/route-decisions') { return await readRouteDecisions(Number(url.searchParams.get('limit')) || 80) as T; } + if (method === 'GET' && pathname === '/api/route-decisions/interventions') { + return await readRouteInterventions(Number(url.searchParams.get('limit')) || 80) as T; + } + const routeInterventionMatch = pathname.match(/^\/api\/route-decisions\/([^/]+)\/intervention$/); + if (method === 'POST' && routeInterventionMatch) { + return await handleRouteInterventionDecision( + decodeURIComponent(routeInterventionMatch[1] || ''), + parseJsonBody(options.body), + await readQimingclawSnapshot(), + ) as T; + } if (method === 'POST' && pathname === '/api/ingress/route') { return await handleIngressRoute(parseJsonBody(options.body), await readQimingclawSnapshot()) as T; } @@ -1251,6 +1293,9 @@ async function pullBridgeApprovalUpdates(): Promise<{ ok: boolean; applied?: num } try { const result = await bridge.pullApprovalUpdates(); + if (result?.ok !== false) { + await resolveApprovedRouteInterventions(await readQimingclawSnapshot()); + } return { ok: result?.ok !== false, applied: Number(result?.applied ?? 0), @@ -1263,6 +1308,24 @@ async function pullBridgeApprovalUpdates(): Promise<{ ok: boolean; applied?: num } } +async function resolveApprovedRouteInterventions(snapshot: QimingclawSnapshot | null): Promise { + const timeline = await readRouteInterventions(120); + const approved = timeline.interventions.filter((item) => ( + item.intervention_status === 'approved' + && item.approval_id + && !item.resolved_at + )).slice(0, 5); + for (const intervention of approved) { + await handleRouteInterventionDecision(intervention.route_decision_id, { + approval_id: intervention.approval_id, + decision: 'approved', + actor: 'management-api', + }, snapshot).catch((error) => { + console.warn('[qimingclawAdapter] auto route intervention resolution failed:', error); + }); + } +} + async function evaluateBridgeRiskPolicy(input: QimingclawRiskPolicyInput): Promise { const bridge = window.QimingClawBridge?.digital; if (!bridge?.evaluateRiskPolicy) { @@ -3228,12 +3291,19 @@ function buildRouteDecisionSummary(snapshot: QimingclawSnapshot | null): Digital const rows = routeDecisionRows(snapshot); const latest = rows[0] ?? null; const policy = routeDecisionPolicy(snapshot?.uiState ?? readState()); + const resolutionEvents = runtimeEvents(snapshot).filter((event) => event.kind === 'route_decision_intervention_resolved'); + const resolvedRouteIds = new Set(resolutionEvents.map((event) => stringValue(asRecord(event.payload)?.route_decision_id)).filter(Boolean)); + const latestResolution = resolutionEvents.sort((left, right) => right.occurredAt.localeCompare(left.occurredAt))[0] ?? null; + const latestResolutionPayload = asRecord(latestResolution?.payload) ?? null; return { total: rows.length, mapped_count: rows.filter((row) => stringValue(row.created_command_id)).length, attention_count: rows.filter((row) => ['warn', 'error'].includes(stringValue(row.attention_level))).length, blocked_count: rows.filter((row) => stringValue(row.policy_result) === 'blocked').length, approval_required_count: rows.filter((row) => stringValue(row.policy_result) === 'approval_required').length, + pending_intervention_count: rows.filter((row) => stringValue(row.policy_result) !== 'accepted' && !resolvedRouteIds.has(stringValue(row.route_decision_id))).length, + restored_count: resolutionEvents.filter((event) => asRecord(event.payload)?.command_accepted === true).length, + latest_intervention_status: stringValue(latestResolutionPayload?.status ?? latestResolutionPayload?.decision) || null, policy_source: policy.source ?? null, policy_last_pulled_at: policy.last_pulled_at ?? null, policy_last_pull_error: policy.last_pull_error ?? null, @@ -5846,6 +5916,224 @@ async function readRouteDecisions(limit = 80): Promise { + const bridge = window.QimingClawBridge?.digital; + if (!bridge?.listRouteInterventions) { + return { has_route_intervention_state: false, interventions: [] }; + } + try { + const interventions = await bridge.listRouteInterventions({ limit }); + return { has_route_intervention_state: true, interventions: interventions ?? [] }; + } catch (error) { + console.warn('[qimingclawAdapter] list route interventions failed:', error); + return { has_route_intervention_state: false, interventions: [] }; + } +} + +async function handleRouteInterventionDecision( + routeDecisionId: string, + body: RouteInterventionDecisionRequest, + snapshot: QimingclawSnapshot | null, +): Promise { + const decisionText = stringValue(body.decision) || 'reject'; + const approvalId = stringValue(body.approval_id) || routeInterventionApprovalId(routeDecisionId, snapshot); + const existing = await readRouteInterventions(160); + const existingRecord = existing.interventions.find((item) => item.route_decision_id === routeDecisionId) ?? null; + const detail = routeDecisionDetail(routeDecisionId, snapshot); + const routeDecision = detail?.decision ?? routeInterventionToRouteDecision(existingRecord, routeDecisionId); + if (!routeDecision) { + const intervention = await recordRouteInterventionResolution({ + routeDecisionId, + approvalId, + decision: decisionText, + commandAccepted: false, + commandError: 'route_intervention_missing_context', + actor: body.actor ?? 'digital_employee_operator', + occurredAt: new Date().toISOString(), + }); + return { accepted: false, route_decision_id: routeDecisionId, intervention, error: 'invalid_context', message: '入口路由上下文缺失,无法恢复执行。' }; + } + + await recordLocalRouteApprovalDecision(approvalId, decisionText, body.actor ?? 'digital_employee_operator', snapshot); + + let command: GovernanceCommandResponse | null = null; + let commandError: string | null = null; + if (isApprovedInterventionDecision(decisionText)) { + const routeCommand = buildGovernanceCommandForRouteDecision(routeDecision, detail?.body ?? routeDecisionToIngressBody(routeDecision), snapshot); + if (routeCommand.command) { + command = await handleGovernanceCommand(routeCommand.command, snapshot); + if (!command.accepted) commandError = command.error || 'route_intervention_command_rejected'; + } else { + commandError = routeCommand.reasonCode || 'route_intervention_missing_context'; + } + } + + const intervention = await recordRouteInterventionResolution({ + routeDecisionId, + approvalId, + decision: decisionText, + createdCommandId: command?.command_id ?? null, + commandAccepted: command?.accepted === true, + commandError, + blockedReason: routeDecision.blocked_reason ?? null, + policyResult: routeDecision.policy_result ?? null, + policySource: routeDecision.policy_source ?? null, + matchedIntent: routeDecision.matched_intent ?? null, + routeKind: routeDecision.route_kind, + intentKind: routeDecision.intent_kind, + reasonCodes: routeDecision.reason_codes, + candidateSkills: routeDecision.candidate_skills, + contextRefs: routeDecision.context_refs, + entrypoint: routeDecision.entrypoint ?? null, + actor: body.actor ?? 'digital_employee_operator', + correlationId: routeDecision.correlation_id, + payload: { comment: body.comment ?? null }, + occurredAt: new Date().toISOString(), + }); + return { + accepted: intervention.intervention_status !== 'failed', + route_decision_id: routeDecisionId, + intervention, + command, + error: commandError || undefined, + message: intervention.resolution_duplicate + ? '入口路由干预已处理。' + : isApprovedInterventionDecision(decisionText) + ? command?.command_id ? '入口路由干预已通过并恢复执行。' : '入口路由干预已通过。' + : '入口路由干预已拒绝。', + }; +} + +async function recordRouteInterventionResolution(input: QimingclawRouteInterventionResolutionInput): Promise { + const bridge = window.QimingClawBridge?.digital; + if (!bridge?.recordRouteInterventionResolution) { + return { + route_decision_id: input.routeDecisionId, + approval_id: input.approvalId ?? null, + route_kind: input.routeKind ?? 'ChatOnly', + intent_kind: input.intentKind ?? 'chat', + policy_result: input.policyResult ?? null, + intervention_status: input.commandError ? 'failed' : isApprovedInterventionDecision(input.decision) ? 'approved' : 'rejected', + decision: input.decision, + created_command_id: input.createdCommandId ?? null, + blocked_reason: input.blockedReason ?? null, + matched_intent: input.matchedIntent ?? null, + policy_source: input.policySource ?? null, + reason_codes: input.reasonCodes ?? [], + candidate_skills: input.candidateSkills ?? [], + context_refs: input.contextRefs ?? {}, + entrypoint: input.entrypoint ?? null, + actor: input.actor ?? null, + correlation_id: input.correlationId ?? null, + approval_status: null, + recorded_at: input.occurredAt ?? new Date().toISOString(), + resolved_at: input.occurredAt ?? new Date().toISOString(), + resolution_duplicate: false, + }; + } + return bridge.recordRouteInterventionResolution(input); +} + +function routeDecisionDetail(routeDecisionId: string, snapshot: QimingclawSnapshot | null): { decision: RouteDecisionRecord; body: IngressRouteRequest } | null { + const event = runtimeEvents(snapshot).find((item) => { + if (item.kind !== 'route_decision') return false; + const payload = asRecord(item.payload) ?? {}; + const decision = routeDecisionFromRuntimePayload(payload, item); + return decision.id === routeDecisionId; + }); + if (!event) return null; + const payload = asRecord(event.payload) ?? {}; + const decision = routeDecisionFromRuntimePayload(payload, event); + const envelope = asRecord(payload.envelope) ?? {}; + return { + decision, + body: { + entrypoint: decision.entrypoint as IngressRouteRequest['entrypoint'] ?? 'chat', + actor: decision.actor ?? undefined, + text: stringValue(envelope.text) || undefined, + payload: asRecord(envelope.payload) ?? {}, + attachments: arrayValue(envelope.attachments).filter((item): item is string => typeof item === 'string'), + timestamp: decision.recorded_at, + correlation_id: decision.correlation_id, + idempotency_key: `route-intervention:${decision.id}`, + context_refs: decision.context_refs, + }, + }; +} + +function routeInterventionToRouteDecision(record: RouteInterventionRecord | null, routeDecisionId: string): RouteDecisionRecord | null { + if (!record) return null; + return { + id: routeDecisionId, + route_kind: record.route_kind, + intent_kind: record.intent_kind, + reason_codes: record.reason_codes ?? [], + candidate_skills: record.candidate_skills ?? [], + context_refs: record.context_refs ?? {}, + created_command_id: record.created_command_id, + correlation_id: record.correlation_id || routeDecisionId, + creates_plan: record.route_kind === 'PlanControl' || record.route_kind === 'PlanExecution', + creates_task_run: record.route_kind === 'DirectRun' || record.route_kind === 'PlanExecution', + approval_mode: record.approval_id ? 'manual' : null, + policy_result: record.policy_result, + policy_source: record.policy_source, + blocked_reason: record.blocked_reason, + approval_id: record.approval_id, + matched_intent: record.matched_intent, + recorded_at: record.recorded_at, + entrypoint: record.entrypoint, + actor: record.actor, + }; +} + +function routeDecisionToIngressBody(decision: RouteDecisionRecord): IngressRouteRequest { + return { + entrypoint: decision.entrypoint as IngressRouteRequest['entrypoint'] ?? 'chat', + actor: decision.actor ?? undefined, + payload: {}, + attachments: [], + timestamp: decision.recorded_at, + correlation_id: decision.correlation_id, + idempotency_key: `route-intervention:${decision.id}`, + context_refs: decision.context_refs, + }; +} + +function routeInterventionApprovalId(routeDecisionId: string, snapshot: QimingclawSnapshot | null): string | null { + const detail = routeDecisionDetail(routeDecisionId, snapshot); + if (detail?.decision.approval_id) return detail.decision.approval_id; + const row = routeDecisionRows(snapshot).find((item) => stringValue(item.route_decision_id) === routeDecisionId); + return stringValue(row?.approval_id) || null; +} + +async function recordLocalRouteApprovalDecision( + approvalId: string | null, + decision: string, + actor: string, + snapshot: QimingclawSnapshot | null, +): Promise { + if (!approvalId) return; + const date = todayInputDate(); + const state = snapshot?.uiState ?? await readBridgeUiState() ?? readState(); + state.decisionResultsByDate = state.decisionResultsByDate ?? {}; + state.decisionResultsByDate[date] = { + ...(state.decisionResultsByDate[date] ?? {}), + [approvalId]: decision, + }; + await saveState(state, 'decide_approval', date, { decision_id: approvalId, decision, actor }); + await window.QimingClawBridge?.digital?.submitApprovalDecision?.({ + approval_id: approvalId, + decision, + date, + actor, + source: 'sgrobot-route-intervention', + }).catch(() => null); +} + +function isApprovedInterventionDecision(decision: string): boolean { + return ['approve', 'approved', 'accept', 'accepted'].includes(decision.toLowerCase()); +} + async function handleIngressRoute( body: IngressRouteRequest, snapshot: QimingclawSnapshot | null, @@ -5881,6 +6169,7 @@ async function handleIngressRoute( actor: body.actor ?? null, }; const routePolicy = await evaluateBridgeRouteDecisionPolicy({ + routeDecisionId: decision.id, routeKind: decision.route_kind, intentKind: decision.intent_kind, reasonCodes: decision.reason_codes, diff --git a/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/pages/digital/CommandDeck.tsx b/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/pages/digital/CommandDeck.tsx index 9c711331..afbb50b1 100644 --- a/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/pages/digital/CommandDeck.tsx +++ b/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/pages/digital/CommandDeck.tsx @@ -8,6 +8,7 @@ import { dispatchPlanReadySteps, getDigitalEmployeeWorkday, getPlanStepGraph, + getRouteInterventions, getSchedulerJobs, governanceCommand, postDigitalEmployeeWorkdayAction, @@ -16,6 +17,7 @@ import { pullRiskApprovalPolicy, pullRouteDecisionPolicy, recordApprovalAction, + decideRouteIntervention, restartManagedService, } from '@/lib/api'; import { isTauri } from '@/lib/tauri'; @@ -33,6 +35,7 @@ import type { GovernanceCommandKind, PlanStepBusinessRow, PlanStepDependencyDetail, + RouteInterventionRecord, } from '@/types/api'; import type { DigitalNavigationTarget } from './navigation'; @@ -990,6 +993,8 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit const [blockedPlanSteps, setBlockedPlanSteps] = useState([]); const [planStepGraphRows, setPlanStepGraphRows] = useState([]); const [blockedPlanStepError, setBlockedPlanStepError] = useState(null); + const [routeInterventions, setRouteInterventions] = useState([]); + const [routeInterventionError, setRouteInterventionError] = useState(null); const [blockedInputTarget, setBlockedInputTarget] = useState(null); const [blockedInputDraft, setBlockedInputDraft] = useState(''); const [profileForm, setProfileForm] = useState({ @@ -1076,7 +1081,19 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit setBlockedPlanStepError(error instanceof Error ? error.message : '阻塞步骤加载失败'); }); - await Promise.allSettled([projectionPromise, jobsPromise, syncStatusPromise, planStepGraphPromise]); + const routeInterventionPromise = getRouteInterventions() + .then((response) => { + if (!mountedRef.current) return; + setRouteInterventions(response.interventions.slice(0, 6)); + setRouteInterventionError(null); + }) + .catch((error: unknown) => { + if (!mountedRef.current) return; + setRouteInterventions([]); + setRouteInterventionError(error instanceof Error ? error.message : '路由干预加载失败'); + }); + + await Promise.allSettled([projectionPromise, jobsPromise, syncStatusPromise, planStepGraphPromise, routeInterventionPromise]); if (mountedRef.current) { setProjectionLoading(false); } @@ -1458,6 +1475,30 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit } }, [fetchProjection]); + const resolveRouteIntervention = useCallback(async (intervention: RouteInterventionRecord, decision: 'approved' | 'rejected') => { + const actionKey = `route-intervention:${intervention.route_decision_id}:${decision}`; + setActionBusy(actionKey); + setActionError(null); + setActionNotice(null); + try { + const result = await decideRouteIntervention(intervention.route_decision_id, { + approval_id: intervention.approval_id, + decision, + actor: 'digital_employee_operator', + }); + if (!mountedRef.current) return; + await fetchProjection(); + if (!mountedRef.current) return; + setActionNotice(result.message || (decision === 'approved' ? '入口路由干预已通过。' : '入口路由干预已拒绝。')); + } catch (error) { + if (mountedRef.current) { + setActionError(error instanceof Error ? error.message : '处理入口路由干预失败'); + } + } finally { + if (mountedRef.current) setActionBusy(null); + } + }, [fetchProjection]); + const copySyncFailureDiagnostic = useCallback(async (failure: ManagementSyncFailure) => { const diagnostic = buildSyncFailureDiagnostic(failure, managementSyncStatus); try { @@ -2177,6 +2218,45 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit {actionError || actionNotice || planDataError || workdayProjection?.demo_reason} )} + {(routeInterventions.length > 0 || routeInterventionError) && ( +
+ {routeInterventionError &&

{routeInterventionError}

} + {routeInterventions.slice(0, 4).map((intervention) => { + const status = intervention.intervention_status; + const pending = !intervention.resolved_at && ['pending', 'blocked', 'approved'].includes(status); + const approveKey = `route-intervention:${intervention.route_decision_id}:approved`; + const rejectKey = `route-intervention:${intervention.route_decision_id}:rejected`; + return ( +
+ {intervention.entrypoint || 'route'} + {intervention.route_kind} / {intervention.intent_kind} + {status} + {intervention.blocked_reason || intervention.matched_intent || intervention.approval_id || intervention.route_decision_id} + {pending && ( +
+ + +
+ )} +
+ ); + })} +
+ )} {managedServiceIssues.length > 0 && (
{managedServiceIssues.map((service) => { @@ -2360,9 +2440,12 @@ export default function CommandDeck({ onNavigate }: { onNavigate: (target: Digit 0 ? 'is-warning' : ''}>需关注{routeSummary.attention_count} {(routeSummary.blocked_count ?? 0) > 0 && 阻断{routeSummary.blocked_count}} {(routeSummary.approval_required_count ?? 0) > 0 && 待审{routeSummary.approval_required_count}} + {(routeSummary.pending_intervention_count ?? 0) > 0 && 待干预{routeSummary.pending_intervention_count}} + {(routeSummary.restored_count ?? 0) > 0 && 已恢复{routeSummary.restored_count}} {latestRoute ? `${latestRoute.route_kind} / ${latestRoute.intent_kind} · ${latestRoute.status_label}` : '暂无路由决策'} {routeSummary.policy_source ? ` · 策略${routeSummary.policy_source === 'remote' ? '远端' : '本地'}` : ''} + {routeSummary.latest_intervention_status ? ` · 干预${routeSummary.latest_intervention_status}` : ''} {routeSummary.policy_last_pull_error ? ` · 拉取失败` : ''}
diff --git a/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/types/api.ts b/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/types/api.ts index fadcc608..fb4b1f92 100644 --- a/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/types/api.ts +++ b/qimingclaw/crates/agent-electron-client/embedded/sgrobot-digital/src/types/api.ts @@ -409,6 +409,52 @@ export interface RouteDecisionTimelineResponse { decisions: RouteDecisionRecord[]; } +export interface RouteInterventionRecord { + route_decision_id: string; + approval_id: string | null; + route_kind: string; + intent_kind: string; + policy_result: string | null; + intervention_status: 'pending' | 'blocked' | 'approved' | 'rejected' | 'executed' | 'failed' | 'resolved' | string; + decision: string | null; + created_command_id: string | null; + blocked_reason: string | null; + matched_intent: string | null; + policy_source: string | null; + reason_codes: string[]; + candidate_skills: string[]; + context_refs: Record; + entrypoint: string | null; + actor: string | null; + correlation_id: string | null; + approval_status: string | null; + recorded_at: string; + resolved_at: string | null; + resolution_event_id?: string | null; + resolution_duplicate?: boolean; +} + +export interface RouteInterventionTimelineResponse { + has_route_intervention_state: boolean; + interventions: RouteInterventionRecord[]; +} + +export interface RouteInterventionDecisionRequest { + approval_id?: string | null; + decision: 'approve' | 'approved' | 'reject' | 'rejected' | string; + actor?: string | null; + comment?: string | null; +} + +export interface RouteInterventionDecisionResponse { + accepted: boolean; + route_decision_id: string; + intervention: RouteInterventionRecord; + command?: unknown; + message?: string; + error?: GovernanceCommandErrorCode | string; +} + export interface RouteDecisionPolicy { enabled: boolean; auto_create_governance_commands: boolean; @@ -989,6 +1035,9 @@ export interface DigitalEmployeeRouteSummary { attention_count: number; blocked_count?: number; approval_required_count?: number; + pending_intervention_count?: number; + restored_count?: number; + latest_intervention_status?: string | null; policy_source?: string | null; policy_last_pulled_at?: string | null; policy_last_pull_error?: string | null; diff --git a/qimingclaw/crates/agent-electron-client/public/sgrobot-digital/assets/index-BUX1PxSf.js b/qimingclaw/crates/agent-electron-client/public/sgrobot-digital/assets/index-BUX1PxSf.js deleted file mode 100644 index ef1cd3f0..00000000 --- a/qimingclaw/crates/agent-electron-client/public/sgrobot-digital/assets/index-BUX1PxSf.js +++ /dev/null @@ -1,184 +0,0 @@ -(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))r(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const p of d.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&r(p)}).observe(document,{childList:!0,subtree:!0});function i(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function r(c){if(c.ep)return;c.ep=!0;const d=i(c);fetch(c.href,d)}})();function u0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var tf={exports:{}},dr={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Gh;function d0(){if(Gh)return dr;Gh=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(r,c,d){var p=null;if(d!==void 0&&(p=""+d),c.key!==void 0&&(p=""+c.key),"key"in c){d={};for(var y in c)y!=="key"&&(d[y]=c[y])}else d=c;return c=d.ref,{$$typeof:n,type:r,key:p,ref:c!==void 0?c:null,props:d}}return dr.Fragment=a,dr.jsx=i,dr.jsxs=i,dr}var Yh;function f0(){return Yh||(Yh=1,tf.exports=d0()),tf.exports}var o=f0(),nf={exports:{}},Ce={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ih;function m0(){if(Ih)return Ce;Ih=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),p=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),w=Symbol.iterator;function $(A){return A===null||typeof A!="object"?null:(A=w&&A[w]||A["@@iterator"],typeof A=="function"?A:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,N={};function T(A,H,W){this.props=A,this.context=H,this.refs=N,this.updater=W||j}T.prototype.isReactComponent={},T.prototype.setState=function(A,H){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,H,"setState")},T.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function I(){}I.prototype=T.prototype;function K(A,H,W){this.props=A,this.context=H,this.refs=N,this.updater=W||j}var re=K.prototype=new I;re.constructor=K,D(re,T.prototype),re.isPureReactComponent=!0;var ne=Array.isArray;function le(){}var J={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function ie(A,H,W){var ae=W.ref;return{$$typeof:n,type:A,key:H,ref:ae!==void 0?ae:null,props:W}}function M(A,H){return ie(A.type,H,A.props)}function ce(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function Te(A){var H={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(W){return H[W]})}var P=/\/+/g;function _e(A,H){return typeof A=="object"&&A!==null&&A.key!=null?Te(""+A.key):H.toString(36)}function Se(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(le,le):(A.status="pending",A.then(function(H){A.status==="pending"&&(A.status="fulfilled",A.value=H)},function(H){A.status==="pending"&&(A.status="rejected",A.reason=H)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function L(A,H,W,ae,he){var we=typeof A;(we==="undefined"||we==="boolean")&&(A=null);var Z=!1;if(A===null)Z=!0;else switch(we){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(A.$$typeof){case n:case a:Z=!0;break;case S:return Z=A._init,L(Z(A._payload),H,W,ae,he)}}if(Z)return he=he(A),Z=ae===""?"."+_e(A,0):ae,ne(he)?(W="",Z!=null&&(W=Z.replace(P,"$&/")+"/"),L(he,H,W,"",function(Ue){return Ue})):he!=null&&(ce(he)&&(he=M(he,W+(he.key==null||A&&A.key===he.key?"":(""+he.key).replace(P,"$&/")+"/")+Z)),H.push(he)),1;Z=0;var de=ae===""?".":ae+":";if(ne(A))for(var Be=0;Be>>1,X=L[me];if(0>>1;mec(W,te))aec(he,W)?(L[me]=he,L[ae]=te,me=ae):(L[me]=W,L[H]=te,me=H);else if(aec(he,te))L[me]=he,L[ae]=te,me=ae;else break e}}return V}function c(L,V){var te=L.sortIndex-V.sortIndex;return te!==0?te:L.id-V.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var p=Date,y=p.now();n.unstable_now=function(){return p.now()-y}}var _=[],h=[],S=1,x=null,w=3,$=!1,j=!1,D=!1,N=!1,T=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function re(L){for(var V=i(h);V!==null;){if(V.callback===null)r(h);else if(V.startTime<=L)r(h),V.sortIndex=V.expirationTime,a(_,V);else break;V=i(h)}}function ne(L){if(D=!1,re(L),!j)if(i(_)!==null)j=!0,le||(le=!0,Te());else{var V=i(h);V!==null&&Se(ne,V.startTime-L)}}var le=!1,J=-1,F=5,ie=-1;function M(){return N?!0:!(n.unstable_now()-ieL&&M());){var me=x.callback;if(typeof me=="function"){x.callback=null,w=x.priorityLevel;var X=me(x.expirationTime<=L);if(L=n.unstable_now(),typeof X=="function"){x.callback=X,re(L),V=!0;break t}x===i(_)&&r(_),re(L)}else r(_);x=i(_)}if(x!==null)V=!0;else{var A=i(h);A!==null&&Se(ne,A.startTime-L),V=!1}}break e}finally{x=null,w=te,$=!1}V=void 0}}finally{V?Te():le=!1}}}var Te;if(typeof K=="function")Te=function(){K(ce)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,_e=P.port2;P.port1.onmessage=ce,Te=function(){_e.postMessage(null)}}else Te=function(){T(ce,0)};function Se(L,V){J=T(function(){L(n.unstable_now())},V)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(L){L.callback=null},n.unstable_forceFrameRate=function(L){0>L||125me?(L.sortIndex=te,a(h,L),i(_)===null&&L===i(h)&&(D?(I(J),J=-1):D=!0,Se(ne,te-me))):(L.sortIndex=X,a(_,L),j||$||(j=!0,le||(le=!0,Te()))),L},n.unstable_shouldYield=M,n.unstable_wrapCallback=function(L){var V=w;return function(){var te=w;w=V;try{return L.apply(this,arguments)}finally{w=te}}}})(sf)),sf}var Vh;function h0(){return Vh||(Vh=1,lf.exports=_0()),lf.exports}var rf={exports:{}},Yt={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Xh;function g0(){if(Xh)return Yt;Xh=1;var n=Yf();function a(_){var h="https://react.dev/errors/"+_;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),rf.exports=g0(),rf.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Jh;function v0(){if(Jh)return fr;Jh=1;var n=h0(),a=Yf(),i=y0();function r(e){var t="https://react.dev/errors/"+e;if(1X||(e.current=me[X],me[X]=null,X--)}function W(e,t){X++,me[X]=e.current,e.current=t}var ae=A(null),he=A(null),we=A(null),Z=A(null);function de(e,t){switch(W(we,t),W(he,e),W(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dh(t),e=fh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(ae),W(ae,e)}function Be(){H(ae),H(he),H(we)}function Ue(e){e.memoizedState!==null&&W(Z,e);var t=ae.current,l=fh(t,e.type);t!==l&&(W(he,e),W(ae,l))}function Lt(e){he.current===e&&(H(ae),H(he)),Z.current===e&&(H(Z),rr._currentValue=te)}var Bt,He;function Le(e){if(Bt===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Bt=t&&t[1]||"",He=-1)":-1u||C[s]!==O[u]){var G=` -`+C[s].replace(" at new "," at ");return e.displayName&&G.includes("")&&(G=G.replace("",e.displayName)),G}while(1<=s&&0<=u);break}}}finally{kt=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Le(l):""}function si(e,t){switch(e.tag){case 26:case 27:case 5:return Le(e.type);case 16:return Le("Lazy");case 13:return e.child!==t&&t!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return ia(e.type,!1);case 11:return ia(e.type.render,!1);case 1:return ia(e.type,!0);case 31:return Le("Activity");default:return""}}function ps(e){try{var t="",l=null;do t+=si(e,l),l=e,e=e.return;while(e);return t}catch(s){return` -Error generating stack: `+s.message+` -`+s.stack}}var bl=Object.prototype.hasOwnProperty,ri=n.unstable_scheduleCallback,za=n.unstable_cancelCallback,Sl=n.unstable_shouldYield,ci=n.unstable_requestPaint,Tt=n.unstable_now,bn=n.unstable_getCurrentPriorityLevel,sa=n.unstable_ImmediatePriority,ra=n.unstable_UserBlockingPriority,xl=n.unstable_NormalPriority,Zo=n.unstable_LowPriority,oi=n.unstable_IdlePriority,Jo=n.log,Fo=n.unstable_setDisableYieldValue,wt=null,Ut=null;function se(e){if(typeof Jo=="function"&&Fo(e),Ut&&typeof Ut.setStrictMode=="function")try{Ut.setStrictMode(wt,e)}catch{}}var jt=Math.clz32?Math.clz32:ui,et=Math.log,on=Math.LN2;function ui(e){return e>>>=0,e===0?32:31-(et(e)/on|0)|0}var tn=256,At=262144,ca=4194304;function It(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Vn(e,t,l){var s=e.pendingLanes;if(s===0)return 0;var u=0,f=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var b=s&134217727;return b!==0?(s=b&~f,s!==0?u=It(s):(g&=b,g!==0?u=It(g):l||(l=b&~e,l!==0&&(u=It(l))))):(b=s&~f,b!==0?u=It(b):g!==0?u=It(g):l||(l=s&~e,l!==0&&(u=It(l)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,l=t&-t,f>=l||f===32&&(l&4194048)!==0)?t:u}function oa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Kt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qr(){var e=ca;return ca<<=1,(ca&62914560)===0&&(ca=4194304),e}function di(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Sn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Po(e,t,l,s,u,f){var g=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var b=e.entanglements,C=e.expirationTimes,O=e.hiddenUpdates;for(l=g&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Yr=/[\n"\\]/g;function Ft(e){return e.replace(Yr,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function vs(e,t,l,s,u,f,g,b){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Jt(t)):e.value!==""+Jt(t)&&(e.value=""+Jt(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Ss(e,g,Jt(t)):l!=null?Ss(e,g,Jt(l)):s!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+Jt(b):e.removeAttribute("name")}function bs(e,t,l,s,u,f,g,b){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||l!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){wl(e);return}l=l!=null?""+Jt(l):"",t=t!=null?""+Jt(t):l,b||t===e.value||(e.value=t),e.defaultValue=t}s=s??u,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=b?e.checked:!!s,e.defaultChecked=!!s,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),wl(e)}function Ss(e,t,l){t==="number"&&qa(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function fa(e,t,l,s){if(e=e.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),js=!1;if(qn)try{var El={};Object.defineProperty(El,"passive",{get:function(){js=!0}}),window.addEventListener("test",El,El),window.removeEventListener("test",El,El)}catch{js=!1}var Jn=null,vi=null,bi=null;function Si(){if(bi)return bi;var e,t=vi,l=t.length,s,u="value"in Jn?Jn.value:Jn.textContent,f=u.length;for(e=0;e=Es),ym=" ",vm=!1;function bm(e,t){switch(e){case"keyup":return Rv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wi=!1;function Mv(e,t){switch(e){case"compositionend":return Sm(t);case"keypress":return t.which!==32?null:(vm=!0,ym);case"textInput":return e=t.data,e===ym&&vm?null:e;default:return null}}function zv(e,t){if(wi)return e==="compositionend"||!ru&&bm(e,t)?(e=Si(),bi=vi=Jn=null,wi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:l,offset:t-e};e=s}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Nm(l)}}function Dm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qa(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=qa(e.document)}return t}function uu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Yv=qn&&"documentMode"in document&&11>=document.documentMode,ji=null,du=null,Rs=null,fu=!1;function $m(e,t,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;fu||ji==null||ji!==qa(s)||(s=ji,"selectionStart"in s&&uu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Rs&&Ds(Rs,s)||(Rs=s,s=Kc(du,"onSelect"),0>=g,u-=g,Pn=1<<32-jt(t)+u|l<Ne?(Me=fe,fe=null):Me=fe.sibling;var Ye=q(R,fe,z[Ne],Y);if(Ye===null){fe===null&&(fe=Me);break}e&&fe&&Ye.alternate===null&&t(R,fe),E=f(Ye,E,Ne),Ge===null?ve=Ye:Ge.sibling=Ye,Ge=Ye,fe=Me}if(Ne===z.length)return l(R,fe),Oe&&ha(R,Ne),ve;if(fe===null){for(;NeNe?(Me=fe,fe=null):Me=fe.sibling;var dl=q(R,fe,Ye.value,Y);if(dl===null){fe===null&&(fe=Me);break}e&&fe&&dl.alternate===null&&t(R,fe),E=f(dl,E,Ne),Ge===null?ve=dl:Ge.sibling=dl,Ge=dl,fe=Me}if(Ye.done)return l(R,fe),Oe&&ha(R,Ne),ve;if(fe===null){for(;!Ye.done;Ne++,Ye=z.next())Ye=Q(R,Ye.value,Y),Ye!==null&&(E=f(Ye,E,Ne),Ge===null?ve=Ye:Ge.sibling=Ye,Ge=Ye);return Oe&&ha(R,Ne),ve}for(fe=s(fe);!Ye.done;Ne++,Ye=z.next())Ye=B(fe,R,Ne,Ye.value,Y),Ye!==null&&(e&&Ye.alternate!==null&&fe.delete(Ye.key===null?Ne:Ye.key),E=f(Ye,E,Ne),Ge===null?ve=Ye:Ge.sibling=Ye,Ge=Ye);return e&&fe.forEach(function(o0){return t(R,o0)}),Oe&&ha(R,Ne),ve}function Fe(R,E,z,Y){if(typeof z=="object"&&z!==null&&z.type===D&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case $:e:{for(var ve=z.key;E!==null;){if(E.key===ve){if(ve=z.type,ve===D){if(E.tag===7){l(R,E.sibling),Y=u(E,z.props.children),Y.return=R,R=Y;break e}}else if(E.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&Ul(ve)===E.type){l(R,E.sibling),Y=u(E,z.props),Ls(Y,z),Y.return=R,R=Y;break e}l(R,E);break}else t(R,E);E=E.sibling}z.type===D?(Y=zl(z.props.children,R.mode,Y,z.key),Y.return=R,R=Y):(Y=cc(z.type,z.key,z.props,null,R.mode,Y),Ls(Y,z),Y.return=R,R=Y)}return g(R);case j:e:{for(ve=z.key;E!==null;){if(E.key===ve)if(E.tag===4&&E.stateNode.containerInfo===z.containerInfo&&E.stateNode.implementation===z.implementation){l(R,E.sibling),Y=u(E,z.children||[]),Y.return=R,R=Y;break e}else{l(R,E);break}else t(R,E);E=E.sibling}Y=vu(z,R.mode,Y),Y.return=R,R=Y}return g(R);case F:return z=Ul(z),Fe(R,E,z,Y)}if(Se(z))return ue(R,E,z,Y);if(Te(z)){if(ve=Te(z),typeof ve!="function")throw Error(r(150));return z=ve.call(z),xe(R,E,z,Y)}if(typeof z.then=="function")return Fe(R,E,_c(z),Y);if(z.$$typeof===K)return Fe(R,E,dc(R,z),Y);hc(R,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,E!==null&&E.tag===6?(l(R,E.sibling),Y=u(E,z),Y.return=R,R=Y):(l(R,E),Y=yu(z,R.mode,Y),Y.return=R,R=Y),g(R)):l(R,E)}return function(R,E,z,Y){try{qs=0;var ve=Fe(R,E,z,Y);return Oi=null,ve}catch(fe){if(fe===zi||fe===mc)throw fe;var Ge=fn(29,fe,null,R.mode);return Ge.lanes=Y,Ge.return=R,Ge}finally{}}}var Gl=np(!0),ap=np(!1),Xa=!1;function Du(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ru(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ja(e,t,l){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ke&2)!==0){var u=s.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),s.pending=t,t=rc(e),Um(e,null,l),t}return sc(e,s,t,l),rc(e)}function Bs(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,l|=s,t.lanes=l,Lr(e,l)}}function $u(e,t){var l=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,l===s)){var u=null,f=null;if(l=l.firstBaseUpdate,l!==null){do{var g={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};f===null?u=f=g:f=f.next=g,l=l.next}while(l!==null);f===null?u=f=t:f=f.next=t}else u=f=t;l={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:s.shared,callbacks:s.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Mu=!1;function Us(){if(Mu){var e=Mi;if(e!==null)throw e}}function Hs(e,t,l,s){Mu=!1;var u=e.updateQueue;Xa=!1;var f=u.firstBaseUpdate,g=u.lastBaseUpdate,b=u.shared.pending;if(b!==null){u.shared.pending=null;var C=b,O=C.next;C.next=null,g===null?f=O:g.next=O,g=C;var G=e.alternate;G!==null&&(G=G.updateQueue,b=G.lastBaseUpdate,b!==g&&(b===null?G.firstBaseUpdate=O:b.next=O,G.lastBaseUpdate=C))}if(f!==null){var Q=u.baseState;g=0,G=O=C=null,b=f;do{var q=b.lane&-536870913,B=q!==b.lane;if(B?($e&q)===q:(s&q)===q){q!==0&&q===$i&&(Mu=!0),G!==null&&(G=G.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ue=e,xe=b;q=t;var Fe=l;switch(xe.tag){case 1:if(ue=xe.payload,typeof ue=="function"){Q=ue.call(Fe,Q,q);break e}Q=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=xe.payload,q=typeof ue=="function"?ue.call(Fe,Q,q):ue,q==null)break e;Q=x({},Q,q);break e;case 2:Xa=!0}}q=b.callback,q!==null&&(e.flags|=64,B&&(e.flags|=8192),B=u.callbacks,B===null?u.callbacks=[q]:B.push(q))}else B={lane:q,tag:b.tag,payload:b.payload,callback:b.callback,next:null},G===null?(O=G=B,C=Q):G=G.next=B,g|=q;if(b=b.next,b===null){if(b=u.shared.pending,b===null)break;B=b,b=B.next,B.next=null,u.lastBaseUpdate=B,u.shared.pending=null}}while(!0);G===null&&(C=Q),u.baseState=C,u.firstBaseUpdate=O,u.lastBaseUpdate=G,f===null&&(u.shared.lanes=0),tl|=g,e.lanes=g,e.memoizedState=Q}}function lp(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function ip(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;ef?f:8;var g=L.T,b={};L.T=b,Wu(e,!1,t,l);try{var C=u(),O=L.S;if(O!==null&&O(b,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var G=Pv(C,s);Is(e,t,G,gn(e))}else Is(e,t,s,gn(e))}catch(Q){Is(e,t,{then:function(){},status:"rejected",reason:Q},gn())}finally{V.p=f,g!==null&&b.types!==null&&(g.types=b.types),L.T=g}}function lb(){}function Fu(e,t,l,s){if(e.tag!==5)throw Error(r(476));var u=qp(e).queue;Op(e,u,t,te,l===null?lb:function(){return Lp(e),l(s)})}function qp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:te},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ba,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Lp(e){var t=qp(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},gn())}function Pu(){return Rt(rr)}function Bp(){return _t().memoizedState}function Up(){return _t().memoizedState}function ib(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=gn();e=Za(l);var s=Ja(t,e,l);s!==null&&(rn(s,t,l),Bs(s,t,l)),t={cache:Au()},e.payload=t;return}t=t.return}}function sb(e,t,l){var s=gn();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Cc(e)?Gp(t,l):(l=hu(e,t,l,s),l!==null&&(rn(l,e,s),Yp(l,t,s)))}function Hp(e,t,l){var s=gn();Is(e,t,l,s)}function Is(e,t,l,s){var u={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Cc(e))Gp(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var g=t.lastRenderedState,b=f(g,l);if(u.hasEagerState=!0,u.eagerState=b,dn(b,g))return sc(e,t,u,0),Pe===null&&ic(),!1}catch{}finally{}if(l=hu(e,t,u,s),l!==null)return rn(l,e,s),Yp(l,t,s),!0}return!1}function Wu(e,t,l,s){if(s={lane:2,revertLane:Dd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Cc(e)){if(t)throw Error(r(479))}else t=hu(e,l,s,2),t!==null&&rn(t,e,2)}function Cc(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function Gp(e,t){Li=vc=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Yp(e,t,l){if((l&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,l|=s,t.lanes=l,Lr(e,l)}}var Ks={readContext:Rt,use:xc,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};Ks.useEffectEvent=ot;var Ip={readContext:Rt,use:xc,useCallback:function(e,t){return Wt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:Ap,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,wc(4194308,4,Dp.bind(null,t,e),l)},useLayoutEffect:function(e,t){return wc(4194308,4,e,t)},useInsertionEffect:function(e,t){wc(4,2,e,t)},useMemo:function(e,t){var l=Wt();t=t===void 0?null:t;var s=e();if(Yl){se(!0);try{e()}finally{se(!1)}}return l.memoizedState=[s,t],s},useReducer:function(e,t,l){var s=Wt();if(l!==void 0){var u=l(t);if(Yl){se(!0);try{l(t)}finally{se(!1)}}}else u=t;return s.memoizedState=s.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},s.queue=e,e=e.dispatch=sb.bind(null,Ee,e),[s.memoizedState,e]},useRef:function(e){var t=Wt();return e={current:e},t.memoizedState=e},useState:function(e){e=Qu(e);var t=e.queue,l=Hp.bind(null,Ee,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Zu,useDeferredValue:function(e,t){var l=Wt();return Ju(l,e,t)},useTransition:function(){var e=Qu(!1);return e=Op.bind(null,Ee,e.queue,!0,!1),Wt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var s=Ee,u=Wt();if(Oe){if(l===void 0)throw Error(r(407));l=l()}else{if(l=t(),Pe===null)throw Error(r(349));($e&127)!==0||dp(s,t,l)}u.memoizedState=l;var f={value:l,getSnapshot:t};return u.queue=f,Ap(mp.bind(null,s,f,e),[e]),s.flags|=2048,Ui(9,{destroy:void 0},fp.bind(null,s,f,l,t),null),l},useId:function(){var e=Wt(),t=Pe.identifierPrefix;if(Oe){var l=Wn,s=Pn;l=(s&~(1<<32-jt(s)-1)).toString(32)+l,t="_"+t+"R_"+l,l=bc++,0<\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof s.is=="string"?g.createElement("select",{is:s.is}):g.createElement("select"),s.multiple?f.multiple=!0:s.size&&(f.size=s.size);break;default:f=typeof s.is=="string"?g.createElement(u,{is:s.is}):g.createElement(u)}}f[ft]=t,f[Qt]=s;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)f.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=f;e:switch(Mt(f,u,s),u){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&xa(t)}}return at(t),md(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&xa(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(r(166));if(e=we.current,Di(t)){if(e=t.stateNode,l=t.memoizedProps,s=null,u=Dt,u!==null)switch(u.tag){case 27:case 5:s=u.memoizedProps}e[ft]=t,e=!!(e.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||oh(e.nodeValue,l)),e||Qa(t,!0)}else e=Qc(e).createTextNode(s),e[ft]=t,t.stateNode=e}return at(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(s=Di(t),l!==null){if(e===null){if(!s)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[ft]=t}else Ol(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),e=!1}else l=ku(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(pn(t),t):(pn(t),null);if((t.flags&128)!==0)throw Error(r(558))}return at(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Di(t),s!==null&&s.dehydrated!==null){if(e===null){if(!u)throw Error(r(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[ft]=t}else Ol(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),u=!1}else u=ku(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(pn(t),t):(pn(t),null)}return pn(t),(t.flags&128)!==0?(t.lanes=l,t):(l=s!==null,e=e!==null&&e.memoizedState!==null,l&&(s=t.child,u=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(u=s.alternate.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==u&&(s.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Dc(t,t.updateQueue),at(t),null);case 4:return Be(),e===null&&zd(t.stateNode.containerInfo),at(t),null;case 10:return ya(t.type),at(t),null;case 19:if(H(pt),s=t.memoizedState,s===null)return at(t),null;if(u=(t.flags&128)!==0,f=s.rendering,f===null)if(u)Vs(s,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=yc(e),f!==null){for(t.flags|=128,Vs(s,!1),e=f.updateQueue,t.updateQueue=e,Dc(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)Hm(l,e),l=l.sibling;return W(pt,pt.current&1|2),Oe&&ha(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Tt()>Oc&&(t.flags|=128,u=!0,Vs(s,!1),t.lanes=4194304)}else{if(!u)if(e=yc(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Dc(t,e),Vs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!Oe)return at(t),null}else 2*Tt()-s.renderingStartTime>Oc&&l!==536870912&&(t.flags|=128,u=!0,Vs(s,!1),t.lanes=4194304);s.isBackwards?(f.sibling=t.child,t.child=f):(e=s.last,e!==null?e.sibling=f:t.child=f,s.last=f)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Tt(),e.sibling=null,l=pt.current,W(pt,u?l&1|2:l&1),Oe&&ha(t,s.treeForkCount),e):(at(t),null);case 22:case 23:return pn(t),Ou(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(l&536870912)!==0&&(t.flags&128)===0&&(at(t),t.subtreeFlags&6&&(t.flags|=8192)):at(t),l=t.updateQueue,l!==null&&Dc(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==l&&(t.flags|=2048),e!==null&&H(Bl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ya(yt),at(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function db(e,t){switch(Su(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(yt),Be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Lt(t),null;case 31:if(t.memoizedState!==null){if(pn(t),t.alternate===null)throw Error(r(340));Ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(pn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(pt),null;case 4:return Be(),null;case 10:return ya(t.type),null;case 22:case 23:return pn(t),Ou(),e!==null&&H(Bl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(yt),null;case 25:return null;default:return null}}function p_(e,t){switch(Su(t),t.tag){case 3:ya(yt),Be();break;case 26:case 27:case 5:Lt(t);break;case 4:Be();break;case 31:t.memoizedState!==null&&pn(t);break;case 13:pn(t);break;case 19:H(pt);break;case 10:ya(t.type);break;case 22:case 23:pn(t),Ou(),e!==null&&H(Bl);break;case 24:ya(yt)}}function Xs(e,t){try{var l=t.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var u=s.next;l=u;do{if((l.tag&e)===e){s=void 0;var f=l.create,g=l.inst;s=f(),g.destroy=s}l=l.next}while(l!==u)}}catch(b){Ve(t,t.return,b)}}function Wa(e,t,l){try{var s=t.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var f=u.next;s=f;do{if((s.tag&e)===e){var g=s.inst,b=g.destroy;if(b!==void 0){g.destroy=void 0,u=t;var C=l,O=b;try{O()}catch(G){Ve(u,C,G)}}}s=s.next}while(s!==f)}}catch(G){Ve(t,t.return,G)}}function __(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{ip(t,l)}catch(s){Ve(e,e.return,s)}}}function h_(e,t,l){l.props=Il(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(s){Ve(e,t,s)}}function Zs(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof l=="function"?e.refCleanup=l(s):l.current=s}}catch(u){Ve(e,t,u)}}function ea(e,t){var l=e.ref,s=e.refCleanup;if(l!==null)if(typeof s=="function")try{s()}catch(u){Ve(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(u){Ve(e,t,u)}else l.current=null}function g_(e){var t=e.type,l=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&s.focus();break e;case"img":l.src?s.src=l.src:l.srcSet&&(s.srcset=l.srcSet)}}catch(u){Ve(e,e.return,u)}}function pd(e,t,l){try{var s=e.stateNode;$b(s,e.type,l,t),s[Qt]=t}catch(u){Ve(e,e.return,u)}}function y_(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&sl(e.type)||e.tag===4}function _d(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||y_(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&sl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function hd(e,t,l){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=kn));else if(s!==4&&(s===27&&sl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(hd(e,t,l),e=e.sibling;e!==null;)hd(e,t,l),e=e.sibling}function Rc(e,t,l){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(s!==4&&(s===27&&sl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Rc(e,t,l),e=e.sibling;e!==null;)Rc(e,t,l),e=e.sibling}function v_(e){var t=e.stateNode,l=e.memoizedProps;try{for(var s=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Mt(t,s,l),t[ft]=e,t[Qt]=l}catch(f){Ve(e,e.return,f)}}var ka=!1,St=!1,gd=!1,b_=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function fb(e,t){if(e=e.containerInfo,Ld=Wc,e=Rm(e),uu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var s=l.getSelection&&l.getSelection();if(s&&s.rangeCount!==0){l=s.anchorNode;var u=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{l.nodeType,f.nodeType}catch{l=null;break e}var g=0,b=-1,C=-1,O=0,G=0,Q=e,q=null;t:for(;;){for(var B;Q!==l||u!==0&&Q.nodeType!==3||(b=g+u),Q!==f||s!==0&&Q.nodeType!==3||(C=g+s),Q.nodeType===3&&(g+=Q.nodeValue.length),(B=Q.firstChild)!==null;)q=Q,Q=B;for(;;){if(Q===e)break t;if(q===l&&++O===u&&(b=g),q===f&&++G===s&&(C=g),(B=Q.nextSibling)!==null)break;Q=q,q=Q.parentNode}Q=B}l=b===-1||C===-1?null:{start:b,end:C}}else l=null}l=l||{start:0,end:0}}else l=null;for(Bd={focusedElem:e,selectionRange:l},Wc=!1,Nt=t;Nt!==null;)if(t=Nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Nt=e;else for(;Nt!==null;){switch(t=Nt,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),Mt(f,s,l),f[ft]=e,it(f),s=f;break e;case"link":var g=Ch("link","href",u).get(s+(l.href||""));if(g){for(var b=0;bFe&&(g=Fe,Fe=xe,xe=g);var R=Tm(b,xe),E=Tm(b,Fe);if(R&&E&&(B.rangeCount!==1||B.anchorNode!==R.node||B.anchorOffset!==R.offset||B.focusNode!==E.node||B.focusOffset!==E.offset)){var z=Q.createRange();z.setStart(R.node,R.offset),B.removeAllRanges(),xe>Fe?(B.addRange(z),B.extend(E.node,E.offset)):(z.setEnd(E.node,E.offset),B.addRange(z))}}}}for(Q=[],B=b;B=B.parentNode;)B.nodeType===1&&Q.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;bl?32:l,L.T=null,l=wd,wd=null;var f=al,g=Ea;if(Ct=0,Ki=al=null,Ea=0,(Ke&6)!==0)throw Error(r(331));var b=Ke;if(Ke|=4,D_(f.current),E_(f,f.current,g,l),Ke=b,tr(0,!1),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(wt,f)}catch{}return!0}finally{V.p=u,L.T=s,Z_(e,t)}}function F_(e,t,l){t=jn(l,t),t=ad(e.stateNode,t,2),e=Ja(e,t,2),e!==null&&(Sn(e,2),ta(e))}function Ve(e,t,l){if(e.tag===3)F_(e,e,l);else for(;t!==null;){if(t.tag===3){F_(t,e,l);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(nl===null||!nl.has(s))){e=jn(l,e),l=Pp(2),s=Ja(t,l,2),s!==null&&(Wp(l,s,t,e),Sn(s,2),ta(s));break}}t=t.return}}function Ed(e,t,l){var s=e.pingCache;if(s===null){s=e.pingCache=new _b;var u=new Set;s.set(t,u)}else u=s.get(t),u===void 0&&(u=new Set,s.set(t,u));u.has(l)||(bd=!0,u.add(l),e=bb.bind(null,e,t,l),t.then(e,e))}function bb(e,t,l){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Pe===e&&($e&l)===l&&(ut===4||ut===3&&($e&62914560)===$e&&300>Tt()-zc?(Ke&2)===0&&Qi(e,0):Sd|=l,Ii===$e&&(Ii=0)),ta(e)}function P_(e,t){t===0&&(t=qr()),e=Ml(e,t),e!==null&&(Sn(e,t),ta(e))}function Sb(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),P_(e,l)}function xb(e,t){var l=0;switch(e.tag){case 31:case 13:var s=e.stateNode,u=e.memoizedState;u!==null&&(l=u.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(r(314))}s!==null&&s.delete(t),P_(e,l)}function kb(e,t){return ri(e,t)}var Gc=null,Xi=null,Nd=!1,Yc=!1,Td=!1,il=0;function ta(e){e!==Xi&&e.next===null&&(Xi===null?Gc=Xi=e:Xi=Xi.next=e),Yc=!0,Nd||(Nd=!0,jb())}function tr(e,t){if(!Td&&Yc){Td=!0;do for(var l=!1,s=Gc;s!==null;){if(e!==0){var u=s.pendingLanes;if(u===0)var f=0;else{var g=s.suspendedLanes,b=s.pingedLanes;f=(1<<31-jt(42|e)+1)-1,f&=u&~(g&~b),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(l=!0,nh(s,f))}else f=$e,f=Vn(s,s===Pe?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||oa(s,f)||(l=!0,nh(s,f));s=s.next}while(l);Td=!1}}function wb(){W_()}function W_(){Yc=Nd=!1;var e=0;il!==0&&zb()&&(e=il);for(var t=Tt(),l=null,s=Gc;s!==null;){var u=s.next,f=eh(s,t);f===0?(s.next=null,l===null?Gc=u:l.next=u,u===null&&(Xi=l)):(l=s,(e!==0||(f&3)!==0)&&(Yc=!0)),s=u}Ct!==0&&Ct!==5||tr(e),il!==0&&(il=0)}function eh(e,t){for(var l=e.suspendedLanes,s=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0b)break;var G=C.transferSize,Q=C.initiatorType;G&&uh(Q)&&(C=C.responseEnd,g+=G*(C"u"?null:document;function xh(e,t,l){var s=Zi;if(s&&typeof t=="string"&&t){var u=Ft(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof l=="string"&&(u+='[crossorigin="'+l+'"]'),Sh.has(u)||(Sh.add(u),e={rel:e,crossOrigin:l,href:t},s.querySelector(u)===null&&(t=s.createElement("link"),Mt(t,"link",e),it(t),s.head.appendChild(t)))}}function Ib(e){Na.D(e),xh("dns-prefetch",e,null)}function Kb(e,t){Na.C(e,t),xh("preconnect",e,t)}function Qb(e,t,l){Na.L(e,t,l);var s=Zi;if(s&&e&&t){var u='link[rel="preload"][as="'+Ft(t)+'"]';t==="image"&&l&&l.imageSrcSet?(u+='[imagesrcset="'+Ft(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(u+='[imagesizes="'+Ft(l.imageSizes)+'"]')):u+='[href="'+Ft(e)+'"]';var f=u;switch(t){case"style":f=Ji(e);break;case"script":f=Fi(e)}Dn.has(f)||(e=x({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Dn.set(f,e),s.querySelector(u)!==null||t==="style"&&s.querySelector(ir(f))||t==="script"&&s.querySelector(sr(f))||(t=s.createElement("link"),Mt(t,"link",e),it(t),s.head.appendChild(t)))}}function Vb(e,t){Na.m(e,t);var l=Zi;if(l&&e){var s=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Ft(s)+'"][href="'+Ft(e)+'"]',f=u;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Fi(e)}if(!Dn.has(f)&&(e=x({rel:"modulepreload",href:e},t),Dn.set(f,e),l.querySelector(u)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(sr(f)))return}s=l.createElement("link"),Mt(s,"link",e),it(s),l.head.appendChild(s)}}}function Xb(e,t,l){Na.S(e,t,l);var s=Zi;if(s&&e){var u=da(s).hoistableStyles,f=Ji(e);t=t||"default";var g=u.get(f);if(!g){var b={loading:0,preload:null};if(g=s.querySelector(ir(f)))b.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Dn.get(f))&&Qd(e,l);var C=g=s.createElement("link");it(C),Mt(C,"link",e),C._p=new Promise(function(O,G){C.onload=O,C.onerror=G}),C.addEventListener("load",function(){b.loading|=1}),C.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Xc(g,t,s)}g={type:"stylesheet",instance:g,count:1,state:b},u.set(f,g)}}}function Zb(e,t){Na.X(e,t);var l=Zi;if(l&&e){var s=da(l).hoistableScripts,u=Fi(e),f=s.get(u);f||(f=l.querySelector(sr(u)),f||(e=x({src:e,async:!0},t),(t=Dn.get(u))&&Vd(e,t),f=l.createElement("script"),it(f),Mt(f,"link",e),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function Jb(e,t){Na.M(e,t);var l=Zi;if(l&&e){var s=da(l).hoistableScripts,u=Fi(e),f=s.get(u);f||(f=l.querySelector(sr(u)),f||(e=x({src:e,async:!0,type:"module"},t),(t=Dn.get(u))&&Vd(e,t),f=l.createElement("script"),it(f),Mt(f,"link",e),l.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function kh(e,t,l,s){var u=(u=we.current)?Vc(u):null;if(!u)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Ji(l.href),l=da(u).hoistableStyles,s=l.get(t),s||(s={type:"style",instance:null,count:0,state:null},l.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Ji(l.href);var f=da(u).hoistableStyles,g=f.get(e);if(g||(u=u.ownerDocument||u,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,g),(f=u.querySelector(ir(e)))&&!f._p&&(g.instance=f,g.state.loading=5),Dn.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Dn.set(e,l),f||Fb(u,e,l,g.state))),t&&s===null)throw Error(r(528,""));return g}if(t&&s!==null)throw Error(r(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Fi(l),l=da(u).hoistableScripts,s=l.get(t),s||(s={type:"script",instance:null,count:0,state:null},l.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Ji(e){return'href="'+Ft(e)+'"'}function ir(e){return'link[rel="stylesheet"]['+e+"]"}function wh(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function Fb(e,t,l,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Mt(t,"link",l),it(t),e.head.appendChild(t))}function Fi(e){return'[src="'+Ft(e)+'"]'}function sr(e){return"script[async]"+e}function jh(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Ft(l.href)+'"]');if(s)return t.instance=s,it(s),s;var u=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),it(s),Mt(s,"style",u),Xc(s,l.precedence,e),t.instance=s;case"stylesheet":u=Ji(l.href);var f=e.querySelector(ir(u));if(f)return t.state.loading|=4,t.instance=f,it(f),f;s=wh(l),(u=Dn.get(u))&&Qd(s,u),f=(e.ownerDocument||e).createElement("link"),it(f);var g=f;return g._p=new Promise(function(b,C){g.onload=b,g.onerror=C}),Mt(f,"link",s),t.state.loading|=4,Xc(f,l.precedence,e),t.instance=f;case"script":return f=Fi(l.src),(u=e.querySelector(sr(f)))?(t.instance=u,it(u),u):(s=l,(u=Dn.get(f))&&(s=x({},l),Vd(s,u)),e=e.ownerDocument||e,u=e.createElement("script"),it(u),Mt(u,"link",s),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Xc(s,l.precedence,e));return t.instance}function Xc(e,t,l){for(var s=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=s.length?s[s.length-1]:null,f=u,g=0;g title"):null)}function Pb(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Eh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Wb(e,t,l,s){if(l.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var u=Ji(s.href),f=t.querySelector(ir(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Jc.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=f,it(f);return}f=t.ownerDocument||t,s=wh(s),(u=Dn.get(u))&&Qd(s,u),f=f.createElement("link"),it(f);var g=f;g._p=new Promise(function(b,C){g.onload=b,g.onerror=C}),Mt(f,"link",s),l.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Jc.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Xd=0;function e0(e,t){return e.stylesheets&&e.count===0&&Pc(e,e.stylesheets),0Xd?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(u)}}:null}function Jc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Pc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fc=null;function Pc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fc=new Map,t.forEach(t0,e),Fc=null,Jc.call(e))}function t0(e,t){if(!(t.state.loading&4)){var l=Fc.get(e);if(l)var s=l.get(null);else{l=new Map,Fc.set(e,l);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),af.exports=v0(),af.exports}var S0=b0();/** - * react-router v7.17.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */var Ph="popstate";function Wh(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function x0(n={}){function a(c,d){let{pathname:p="/",search:y="",hash:_=""}=ti(c.location.hash.substring(1));return!p.startsWith("/")&&!p.startsWith(".")&&(p="/"+p),wf("",{pathname:p,search:y,hash:_},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function i(c,d){let p=c.document.querySelector("base"),y="";if(p&&p.getAttribute("href")){let _=c.location.href,h=_.indexOf("#");y=h===-1?_:_.slice(0,h)}return y+"#"+(typeof d=="string"?d:jr(d))}function r(c,d){Mn(c.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(d)})`)}return w0(a,i,r,n)}function rt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function Mn(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function k0(){return Math.random().toString(36).substring(2,10)}function eg(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function wf(n,a,i=null,r,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?ti(a):a,state:i,key:a&&a.key||r||k0(),mask:c}}function jr({pathname:n="/",search:a="",hash:i=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(n+=i.charAt(0)==="#"?i:"#"+i),n}function ti(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let r=n.indexOf("?");r>=0&&(a.search=n.substring(r),n=n.substring(0,r)),n&&(a.pathname=n)}return a}function w0(n,a,i,r={}){let{window:c=document.defaultView,v5Compat:d=!1}=r,p=c.history,y="POP",_=null,h=S();h==null&&(h=0,p.replaceState({...p.state,idx:h},""));function S(){return(p.state||{idx:null}).idx}function x(){y="POP";let N=S(),T=N==null?null:N-h;h=N,_&&_({action:y,location:D.location,delta:T})}function w(N,T){y="PUSH";let I=Wh(N)?N:wf(D.location,N,T);i&&i(I,N),h=S()+1;let K=eg(I,h),re=D.createHref(I.mask||I);try{p.pushState(K,"",re)}catch(ne){if(ne instanceof DOMException&&ne.name==="DataCloneError")throw ne;c.location.assign(re)}d&&_&&_({action:y,location:D.location,delta:1})}function $(N,T){y="REPLACE";let I=Wh(N)?N:wf(D.location,N,T);i&&i(I,N),h=S();let K=eg(I,h),re=D.createHref(I.mask||I);p.replaceState(K,"",re),d&&_&&_({action:y,location:D.location,delta:0})}function j(N){return j0(c,N)}let D={get action(){return y},get location(){return n(c,p)},listen(N){if(_)throw new Error("A history only accepts one active listener");return c.addEventListener(Ph,x),_=N,()=>{c.removeEventListener(Ph,x),_=null}},createHref(N){return a(c,N)},createURL:j,encodeLocation(N){let T=j(N);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:w,replace:$,go(N){return p.go(N)}};return D}function j0(n,a,i=!1){let r="http://localhost";n&&(r=n.location.origin!=="null"?n.location.origin:n.location.href),rt(r,"No window.location.(origin|href) available to create URL");let c=typeof a=="string"?a:jr(a);return c=c.replace(/ $/,"%20"),!i&&c.startsWith("//")&&(c=r+c),new URL(c,r)}function ey(n,a,i="/"){return C0(n,a,i,!1)}function C0(n,a,i,r,c){let d=typeof a=="string"?ti(a):a,p=Da(d.pathname||"/",i);if(p==null)return null;let y=A0(n),_=null,h=B0(p);for(let S=0;_==null&&S{let S={relativePath:h===void 0?p.path||"":h,caseSensitive:p.caseSensitive===!0,childrenIndex:y,route:p};if(S.relativePath.startsWith("/")){if(!S.relativePath.startsWith(r)&&_)return;rt(S.relativePath.startsWith(r),`Absolute route path "${S.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),S.relativePath=S.relativePath.slice(r.length)}let x=Gn([r,S.relativePath]),w=i.concat(S);p.children&&p.children.length>0&&(rt(p.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),ty(p.children,a,w,x,_)),!(p.path==null&&!p.index)&&a.push({path:x,score:z0(x,p.index),routesMeta:w})};return n.forEach((p,y)=>{var _;if(p.path===""||!((_=p.path)!=null&&_.includes("?")))d(p,y);else for(let h of ny(p.path))d(p,y,!0,h)}),a}function ny(n){let a=n.split("/");if(a.length===0)return[];let[i,...r]=a,c=i.endsWith("?"),d=i.replace(/\?$/,"");if(r.length===0)return c?[d,""]:[d];let p=ny(r.join("/")),y=[];return y.push(...p.map(_=>_===""?d:[d,_].join("/"))),c&&y.push(...p),y.map(_=>n.startsWith("/")&&_===""?"/":_)}function E0(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:O0(a.routesMeta.map(r=>r.childrenIndex),i.routesMeta.map(r=>r.childrenIndex)))}var N0=/^:[\w-]+$/,T0=3,D0=2,R0=1,$0=10,M0=-2,tg=n=>n==="*";function z0(n,a){let i=n.split("/"),r=i.length;return i.some(tg)&&(r+=M0),a&&(r+=D0),i.filter(c=>!tg(c)).reduce((c,d)=>c+(N0.test(d)?T0:d===""?R0:$0),r)}function O0(n,a){return n.length===a.length&&n.slice(0,-1).every((r,c)=>r===a[c])?n[n.length-1]-a[a.length-1]:0}function q0(n,a,i=!1){let{routesMeta:r}=n,c={},d="/",p=[];for(let y=0;y{if(S==="*"){let j=y[w]||"";p=d.slice(0,d.length-j.length).replace(/(.)\/+$/,"$1")}const $=y[w];return x&&!$?h[S]=void 0:h[S]=($||"").replace(/%2F/g,"/"),h},{}),pathname:d,pathnameBase:p,pattern:n}}function L0(n,a=!1,i=!0){Mn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let r=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(p,y,_,h,S)=>{if(r.push({paramName:y,isOptional:_!=null}),_){let x=S.charAt(h+p.length);return x&&x!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(r.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),r]}function B0(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Mn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function Da(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,r=n.charAt(i);return r&&r!=="/"?null:n.slice(i)||"/"}var U0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function H0(n,a="/"){let{pathname:i,search:r="",hash:c=""}=typeof n=="string"?ti(n):n,d;return i?(i=ay(i),i.startsWith("/")?d=ng(i.substring(1),"/"):d=ng(i,a)):d=a,{pathname:d,search:I0(r),hash:K0(c)}}function ng(n,a){let i=So(a).split("/");return n.split("/").forEach(c=>{c===".."?i.length>1&&i.pop():c!=="."&&i.push(c)}),i.length>1?i.join("/"):"/"}function cf(n,a,i,r){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function G0(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function If(n){let a=G0(n);return a.map((i,r)=>r===a.length-1?i.pathname:i.pathnameBase)}function Mo(n,a,i,r=!1){let c;typeof n=="string"?c=ti(n):(c={...n},rt(!c.pathname||!c.pathname.includes("?"),cf("?","pathname","search",c)),rt(!c.pathname||!c.pathname.includes("#"),cf("#","pathname","hash",c)),rt(!c.search||!c.search.includes("#"),cf("#","search","hash",c)));let d=n===""||c.pathname==="",p=d?"/":c.pathname,y;if(p==null)y=i;else{let x=a.length-1;if(!r&&p.startsWith("..")){let w=p.split("/");for(;w[0]==="..";)w.shift(),x-=1;c.pathname=w.join("/")}y=x>=0?a[x]:"/"}let _=H0(c,y),h=p&&p!=="/"&&p.endsWith("/"),S=(d||p===".")&&i.endsWith("/");return!_.pathname.endsWith("/")&&(h||S)&&(_.pathname+="/"),_}var ay=n=>n.replace(/\/\/+/g,"/"),Gn=n=>ay(n.join("/")),So=n=>n.replace(/\/+$/,""),Y0=n=>So(n).replace(/^\/*/,"/"),I0=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,K0=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,Q0=class{constructor(n,a,i,r=!1){this.status=n,this.statusText=a||"",this.internal=r,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function V0(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function X0(n){let a=n.map(i=>i.route.path).filter(Boolean);return Gn(a)||"/"}var ly=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function iy(n,a){let i=n;if(typeof i!="string"||!U0.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let r=i,c=!1;if(ly)try{let d=new URL(window.location.href),p=i.startsWith("//")?new URL(d.protocol+i):new URL(i),y=Da(p.pathname,a);p.origin===d.origin&&y!=null?i=y+p.search+p.hash:c=!0}catch{Mn(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:c,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var sy=["POST","PUT","PATCH","DELETE"];new Set(sy);var Z0=["GET",...sy];new Set(Z0);var rs=k.createContext(null);rs.displayName="DataRouter";var zo=k.createContext(null);zo.displayName="DataRouterState";var ry=k.createContext(!1);function J0(){return k.useContext(ry)}var cy=k.createContext({isTransitioning:!1});cy.displayName="ViewTransition";var F0=k.createContext(new Map);F0.displayName="Fetchers";var P0=k.createContext(null);P0.displayName="Await";var vn=k.createContext(null);vn.displayName="Navigation";var Nr=k.createContext(null);Nr.displayName="Location";var la=k.createContext({outlet:null,matches:[],isDataRoute:!1});la.displayName="Route";var Kf=k.createContext(null);Kf.displayName="RouteError";var oy="REACT_ROUTER_ERROR",W0="REDIRECT",eS="ROUTE_ERROR_RESPONSE";function tS(n){if(n.startsWith(`${oy}:${W0}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function nS(n){if(n.startsWith(`${oy}:${eS}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Q0(a.status,a.statusText,a.data)}catch{}}function aS(n,{relative:a}={}){rt(cs(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:r}=k.useContext(vn),{hash:c,pathname:d,search:p}=Tr(n,{relative:a}),y=d;return i!=="/"&&(y=d==="/"?i:Gn([i,d])),r.createHref({pathname:y,search:p,hash:c})}function cs(){return k.useContext(Nr)!=null}function Kn(){return rt(cs(),"useLocation() may be used only in the context of a component."),k.useContext(Nr).location}var uy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function dy(n){k.useContext(vn).static||k.useLayoutEffect(n)}function Qf(){let{isDataRoute:n}=k.useContext(la);return n?hS():lS()}function lS(){rt(cs(),"useNavigate() may be used only in the context of a component.");let n=k.useContext(rs),{basename:a,navigator:i}=k.useContext(vn),{matches:r}=k.useContext(la),{pathname:c}=Kn(),d=JSON.stringify(If(r)),p=k.useRef(!1);return dy(()=>{p.current=!0}),k.useCallback((_,h={})=>{if(Mn(p.current,uy),!p.current)return;if(typeof _=="number"){i.go(_);return}let S=Mo(_,JSON.parse(d),c,h.relative==="path");n==null&&a!=="/"&&(S.pathname=S.pathname==="/"?a:Gn([a,S.pathname])),(h.replace?i.replace:i.push)(S,h.state,h)},[a,i,d,c,n])}k.createContext(null);function Tr(n,{relative:a}={}){let{matches:i}=k.useContext(la),{pathname:r}=Kn(),c=JSON.stringify(If(i));return k.useMemo(()=>Mo(n,JSON.parse(c),r,a==="path"),[n,c,r,a])}function iS(n,a){return fy(n,a)}function fy(n,a,i){var N;rt(cs(),"useRoutes() may be used only in the context of a component.");let{navigator:r}=k.useContext(vn),{matches:c}=k.useContext(la),d=c[c.length-1],p=d?d.params:{},y=d?d.pathname:"/",_=d?d.pathnameBase:"/",h=d&&d.route;{let T=h&&h.path||"";py(y,!h||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${y}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .`)}let S=Kn(),x;if(a){let T=typeof a=="string"?ti(a):a;rt(_==="/"||((N=T.pathname)==null?void 0:N.startsWith(_)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${_}" but pathname "${T.pathname}" was given in the \`location\` prop.`),x=T}else x=S;let w=x.pathname||"/",$=w;if(_!=="/"){let T=_.replace(/^\//,"").split("/");$="/"+w.replace(/^\//,"").split("/").slice(T.length).join("/")}let j=i&&i.state.matches.length?i.state.matches.map(T=>Object.assign(T,{route:i.manifest[T.route.id]||T.route})):ey(n,{pathname:$});Mn(h||j!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Mn(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let D=uS(j&&j.map(T=>Object.assign({},T,{params:Object.assign({},p,T.params),pathname:Gn([_,r.encodeLocation?r.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?_:Gn([_,r.encodeLocation?r.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,i);return a&&D?k.createElement(Nr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...x},navigationType:"POP"}},D):D}function sS(){let n=_S(),a=V0(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,r="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:r},d={padding:"2px 4px",backgroundColor:r},p=null;return console.error("Error handled by React Router default ErrorBoundary:",n),p=k.createElement(k.Fragment,null,k.createElement("p",null,"💿 Hey developer 👋"),k.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",k.createElement("code",{style:d},"ErrorBoundary")," or"," ",k.createElement("code",{style:d},"errorElement")," prop on your route.")),k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},a),i?k.createElement("pre",{style:c},i):null,p)}var rS=k.createElement(sS,null),my=class extends k.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const i=nS(n.digest);i&&(n=i)}let a=n!==void 0?k.createElement(la.Provider,{value:this.props.routeContext},k.createElement(Kf.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?k.createElement(cS,{error:n},a):a}};my.contextType=ry;var of=new WeakMap;function cS({children:n,error:a}){let{basename:i}=k.useContext(vn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let r=tS(a.digest);if(r){let c=of.get(a);if(c)throw c;let d=iy(r.location,i);if(ly&&!of.get(a))if(d.isExternal||r.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:r.replace}));throw of.set(a,p),p}return k.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return n}function oS({routeContext:n,match:a,children:i}){let r=k.useContext(rs);return r&&r.static&&r.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=a.route.id),k.createElement(la.Provider,{value:n},i)}function uS(n,a=[],i){let r=i==null?void 0:i.state;if(n==null){if(!r)return null;if(r.errors)n=r.matches;else if(a.length===0&&!r.initialized&&r.matches.length>0)n=r.matches;else return null}let c=n,d=r==null?void 0:r.errors;if(d!=null){let S=c.findIndex(x=>x.route.id&&(d==null?void 0:d[x.route.id])!==void 0);rt(S>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,S+1))}let p=!1,y=-1;if(i&&r){p=r.renderFallback;for(let S=0;S=0?c=c.slice(0,y+1):c=[c[0]];break}}}}let _=i==null?void 0:i.onError,h=r&&_?(S,x)=>{var w,$;_(S,{location:r.location,params:(($=(w=r.matches)==null?void 0:w[0])==null?void 0:$.params)??{},pattern:X0(r.matches),errorInfo:x})}:void 0;return c.reduceRight((S,x,w)=>{let $,j=!1,D=null,N=null;r&&($=d&&x.route.id?d[x.route.id]:void 0,D=x.route.errorElement||rS,p&&(y<0&&w===0?(py("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,N=null):y===w&&(j=!0,N=x.route.hydrateFallbackElement||null)));let T=a.concat(c.slice(0,w+1)),I=()=>{let K;return $?K=D:j?K=N:x.route.Component?K=k.createElement(x.route.Component,null):x.route.element?K=x.route.element:K=S,k.createElement(oS,{match:x,routeContext:{outlet:S,matches:T,isDataRoute:r!=null},children:K})};return r&&(x.route.ErrorBoundary||x.route.errorElement||w===0)?k.createElement(my,{location:r.location,revalidation:r.revalidation,component:D,error:$,children:I(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:h}):I()},null)}function Vf(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dS(n){let a=k.useContext(rs);return rt(a,Vf(n)),a}function fS(n){let a=k.useContext(zo);return rt(a,Vf(n)),a}function mS(n){let a=k.useContext(la);return rt(a,Vf(n)),a}function Xf(n){let a=mS(n),i=a.matches[a.matches.length-1];return rt(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function pS(){return Xf("useRouteId")}function _S(){var r;let n=k.useContext(Kf),a=fS("useRouteError"),i=Xf("useRouteError");return n!==void 0?n:(r=a.errors)==null?void 0:r[i]}function hS(){let{router:n}=dS("useNavigate"),a=Xf("useNavigate"),i=k.useRef(!1);return dy(()=>{i.current=!0}),k.useCallback(async(c,d={})=>{Mn(i.current,uy),i.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...d}))},[n,a])}var ag={};function py(n,a,i){!a&&!ag[n]&&(ag[n]=!0,Mn(!1,i))}k.memo(gS);function gS({routes:n,manifest:a,future:i,state:r,isStatic:c,onError:d}){return fy(n,void 0,{manifest:a,state:r,isStatic:c,onError:d})}function yS({to:n,replace:a,state:i,relative:r}){rt(cs()," may be used only in the context of a component.");let{static:c}=k.useContext(vn);Mn(!c," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:d}=k.useContext(la),{pathname:p}=Kn(),y=Qf(),_=Mo(n,If(d),p,r==="path"),h=JSON.stringify(_);return k.useEffect(()=>{y(JSON.parse(h),{replace:a,state:i,relative:r})},[y,h,r,a,i]),null}function jf(n){rt(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function vS({basename:n="/",children:a=null,location:i,navigationType:r="POP",navigator:c,static:d=!1,useTransitions:p}){rt(!cs(),"You cannot render a inside another . You should never have more than one in your app.");let y=n.replace(/^\/*/,"/"),_=k.useMemo(()=>({basename:y,navigator:c,static:d,useTransitions:p,future:{}}),[y,c,d,p]);typeof i=="string"&&(i=ti(i));let{pathname:h="/",search:S="",hash:x="",state:w=null,key:$="default",mask:j}=i,D=k.useMemo(()=>{let N=Da(h,y);return N==null?null:{location:{pathname:N,search:S,hash:x,state:w,key:$,mask:j},navigationType:r}},[y,h,S,x,w,$,r,j]);return Mn(D!=null,` is not able to match the URL "${h}${S}${x}" because it does not start with the basename, so the won't render anything.`),D==null?null:k.createElement(vn.Provider,{value:_},k.createElement(Nr.Provider,{children:a,value:D}))}function bS({children:n,location:a}){return iS(Cf(n),a)}function Cf(n,a=[]){let i=[];return k.Children.forEach(n,(r,c)=>{if(!k.isValidElement(r))return;let d=[...a,c];if(r.type===k.Fragment){i.push.apply(i,Cf(r.props.children,d));return}rt(r.type===jf,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),rt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let p={id:r.props.id||d.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(p.children=Cf(r.props.children,d)),i.push(p)}),i}var fo="get",mo="application/x-www-form-urlencoded";function Oo(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function SS(n){return Oo(n)&&n.tagName.toLowerCase()==="button"}function xS(n){return Oo(n)&&n.tagName.toLowerCase()==="form"}function kS(n){return Oo(n)&&n.tagName.toLowerCase()==="input"}function wS(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function jS(n,a){return n.button===0&&(!a||a==="_self")&&!wS(n)}var so=null;function CS(){if(so===null)try{new FormData(document.createElement("form"),0),so=!1}catch{so=!0}return so}var AS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function uf(n){return n!=null&&!AS.has(n)?(Mn(!1,`"${n}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${mo}"`),null):n}function ES(n,a){let i,r,c,d,p;if(xS(n)){let y=n.getAttribute("action");r=y?Da(y,a):null,i=n.getAttribute("method")||fo,c=uf(n.getAttribute("enctype"))||mo,d=new FormData(n)}else if(SS(n)||kS(n)&&(n.type==="submit"||n.type==="image")){let y=n.form;if(y==null)throw new Error('Cannot submit a