@zaip-ai/cli 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/services/adapters.d.ts +1 -1
- package/dist/services/adapters.d.ts.map +1 -1
- package/dist/services/adapters.js +15 -5
- package/dist/services/adapters.js.map +1 -1
- package/dist/services/adapters.test.js +1 -1
- package/dist/services/agent-adapters.d.ts +9 -0
- package/dist/services/agent-adapters.d.ts.map +1 -1
- package/dist/services/agent-adapters.js +38 -3
- package/dist/services/agent-adapters.js.map +1 -1
- package/dist/services/agent-adapters.test.js +8 -1
- package/dist/services/agent-adapters.test.js.map +1 -1
- package/dist/services/codex-config-template.d.ts +2 -1
- package/dist/services/codex-config-template.d.ts.map +1 -1
- package/dist/services/codex-config-template.js +13 -2
- package/dist/services/codex-config-template.js.map +1 -1
- package/dist/services/codex-rules.d.ts +1 -1
- package/dist/services/codex-rules.d.ts.map +1 -1
- package/dist/services/codex-rules.js +31 -7
- package/dist/services/codex-rules.js.map +1 -1
- package/dist/services/codex-subagent-hook-template.d.ts +1 -1
- package/dist/services/codex-subagent-hook-template.d.ts.map +1 -1
- package/dist/services/codex-subagent-hook-template.js +4 -1
- package/dist/services/codex-subagent-hook-template.js.map +1 -1
- package/dist/services/doctor.d.ts.map +1 -1
- package/dist/services/doctor.js +3 -1
- package/dist/services/doctor.js.map +1 -1
- package/dist/services/global-codex-config.d.ts +6 -3
- package/dist/services/global-codex-config.d.ts.map +1 -1
- package/dist/services/global-codex-config.js +82 -13
- package/dist/services/global-codex-config.js.map +1 -1
- package/dist/services/global-codex-config.test.js +57 -10
- package/dist/services/global-codex-config.test.js.map +1 -1
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +15 -2
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/logger.js +1 -1
- package/dist/services/logger.js.map +1 -1
- package/dist/services/logger.test.js +3 -3
- package/dist/services/logger.test.js.map +1 -1
- package/dist/services/runtime-template.test.js +21 -5
- package/dist/services/runtime-template.test.js.map +1 -1
- package/dist/services/template-manifest.d.ts.map +1 -1
- package/dist/services/template-manifest.js +2 -0
- package/dist/services/template-manifest.js.map +1 -1
- package/package.json +1 -1
- package/templates/.agents/config/agents/catalog.yaml +310 -10
- package/templates/.agents/config/clients/codex/agents/zaip-agent-brand-strategist.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-designer.toml +5 -5
- package/templates/.agents/config/clients/codex/agents/zaip-agent-finalizer.toml +1 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-general-operations.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-governance-compliance.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-growth-strategist.toml +30 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-marketing-analyst.toml +8 -8
- package/templates/.agents/config/clients/codex/agents/zaip-agent-orchestrator.toml +5 -3
- package/templates/.agents/config/clients/codex/agents/zaip-agent-sales-specialist.toml +30 -0
- package/templates/.agents/config/project.yaml +1 -1
- package/templates/.agents/dashboard/.zaip-managed.json +659 -163
- package/templates/.agents/dashboard/DATA-DICTIONARY.md +2227 -0
- package/templates/.agents/dashboard/README.md +48 -97
- package/templates/.agents/dashboard/apps/frontend/dist/assets/CostCalculationGuidePage-Z60df2r-.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-Cv-JcoxP.js → DashboardHelpDialog-Cs6dzDmW.js} +294 -109
- package/templates/.agents/dashboard/apps/frontend/dist/assets/PricingSettingsDialog-Coc6pA-1.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-QE1k9yZB.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-_Pf5DA_A.js +3 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-BVlz3DLZ.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-CaKwQP43.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-BZ5WdaMN.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-Cf9ctPVt.js +68 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-C98LGC-Q.js → dashboard-localization-CLJ0lT9v.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/icons-vendor-DFBuc_qp.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-8A4DcNXM.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DK_enB5Z.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/react-vendor-CCQOHdVI.js +9 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/rolldown-runtime-D9-fqq9M.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/traceability-DFY7ZDlu.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/traceability-pC2_0J8x.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +9 -2
- package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/App.tsx +952 -595
- package/templates/.agents/dashboard/apps/frontend/src/AppLoadingBoundary.tsx +48 -0
- package/templates/.agents/dashboard/apps/frontend/src/AppLoadingPanels.tsx +2 -0
- package/templates/.agents/dashboard/apps/frontend/src/AppOverlays.tsx +247 -0
- package/templates/.agents/dashboard/apps/frontend/src/AppRequestGuards.tsx +95 -0
- package/templates/.agents/dashboard/apps/frontend/src/AppSetupRoutes.tsx +87 -0
- package/templates/.agents/dashboard/apps/frontend/src/CostCalculationGuidePage.tsx +641 -0
- package/templates/.agents/dashboard/apps/frontend/src/DashboardAlternateContent.tsx +159 -0
- package/templates/.agents/dashboard/apps/frontend/src/DashboardCapabilityNav.tsx +13 -13
- package/templates/.agents/dashboard/apps/frontend/src/DashboardGlobalSettings.tsx +56 -0
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.tsx +257 -313
- package/templates/.agents/dashboard/apps/frontend/src/ProjectStackEditor.tsx +149 -0
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.test.ts +35 -0
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.tsx +111 -12
- package/templates/.agents/dashboard/apps/frontend/src/app-preferences.ts +15 -0
- package/templates/.agents/dashboard/apps/frontend/src/app-session-token.ts +20 -0
- package/templates/.agents/dashboard/apps/frontend/src/cost-calculation-guide.css +267 -0
- package/templates/.agents/dashboard/apps/frontend/src/cost-calculation-guide.test.ts +69 -0
- package/templates/.agents/dashboard/apps/frontend/src/cost-period-refresh.test.ts +70 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.test.ts +111 -0
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +432 -13
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-localization.ts +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/main.tsx +1 -0
- package/templates/.agents/dashboard/apps/frontend/src/operations-detail-hydration.test.ts +55 -0
- package/templates/.agents/dashboard/apps/frontend/src/operations-detail-hydration.ts +36 -0
- package/templates/.agents/dashboard/apps/frontend/src/operations-entity-page-projection.test.ts +126 -0
- package/templates/.agents/dashboard/apps/frontend/src/operations-entity-page-projection.ts +181 -0
- package/templates/.agents/dashboard/apps/frontend/src/operations-period-contract.test.ts +138 -0
- package/templates/.agents/dashboard/apps/frontend/src/operations-period-render.test.ts +105 -0
- package/templates/.agents/dashboard/apps/frontend/src/operations-period.test.ts +6 -3
- package/templates/.agents/dashboard/apps/frontend/src/operations-period.ts +9 -5
- package/templates/.agents/dashboard/apps/frontend/src/overview-status-page.test.ts +24 -0
- package/templates/.agents/dashboard/apps/frontend/src/period-transition-overlay.css +44 -0
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-model.ts +121 -62
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-page.css +471 -2
- package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +84 -17
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-banner-semantics.test.ts +44 -0
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +196 -39
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-notice.ts +15 -0
- package/templates/.agents/dashboard/apps/frontend/src/sqlite-cost-adapters.ts +26 -0
- package/templates/.agents/dashboard/apps/frontend/src/styles.css +14 -2
- package/templates/.agents/dashboard/apps/frontend/src/traceability-workspace.css +38 -2
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.test.ts +187 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.ts +190 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-effects.ts +121 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-operations-pages.ts +398 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-trace-documents.ts +141 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-idle-cost-prefetch.ts +45 -0
- package/templates/.agents/dashboard/apps/frontend/src/work-list-pagination.test.ts +46 -0
- package/templates/.agents/dashboard/apps/frontend/src/work-list-pagination.ts +37 -0
- package/templates/.agents/dashboard/apps/frontend/vite.config.ts +55 -5
- package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/contracts.ts +47 -6
- package/templates/.agents/dashboard/modules/cost-monitor/src/duration-estimate.ts +13 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.test.ts +64 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.tsx +275 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.test.ts +100 -15
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.tsx +131 -40
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.tsx +137 -19
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostModelsAuditTable.test.ts +2 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostModelsAuditTable.tsx +13 -10
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorContent.tsx +303 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +226 -6
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +479 -402
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostSummary.tsx +5 -13
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +312 -72
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.tsx +373 -321
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/MacroCostTable.test.ts +17 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/MacroCostTable.tsx +25 -6
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-copy.ts +0 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-page-helpers.ts +17 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-responsive.css +6 -3
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-row-filters.ts +123 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-summary.ts +8 -3
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-views.ts +32 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor.css +52 -14
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-presentation.ts +121 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/index.ts +3 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/period-cost-groups.test.ts +68 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/period-cost-groups.ts +32 -5
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-compact-cost-page.ts +108 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-group-page.test.ts +12 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-group-page.ts +60 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-run-page.ts +106 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.test.ts +2 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.ts +5 -3
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-pricing-fallback.test.ts +53 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.basics.test.ts +34 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.test.ts +168 -137
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.ts +188 -29
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.test.ts +956 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +775 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-terminal-day.test.ts +95 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/index.ts +1 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/refactor-map-xr9l.json +61 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/task-cost-groups.test.ts +41 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/task-cost-groups.ts +55 -11
- package/templates/.agents/dashboard/modules/operations/package.json +2 -1
- package/templates/.agents/dashboard/modules/operations/src/contracts.ts +182 -0
- package/templates/.agents/dashboard/modules/operations/src/duration-population.test.ts +63 -1
- package/templates/.agents/dashboard/modules/operations/src/duration-population.ts +60 -5
- package/templates/.agents/dashboard/modules/operations/src/react/EntityDetailsDialog.tsx +14 -3
- package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.test.ts +44 -1
- package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +325 -18
- package/templates/.agents/dashboard/modules/operations/src/react/MacroPlanningDialog.tsx +1 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationDateFilters.test.ts +9 -5
- package/templates/.agents/dashboard/modules/operations/src/react/OperationDateFilters.tsx +2 -2
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsMainContent.tsx +168 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx +95 -6
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +365 -14
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +532 -131
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +314 -358
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageNavigation.tsx +68 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageOverview.tsx +169 -0
- package/templates/.agents/dashboard/modules/operations/src/react/PeriodSummaryTable.tsx +51 -8
- package/templates/.agents/dashboard/modules/operations/src/react/PrdDocumentDialog.test.tsx +32 -0
- package/templates/.agents/dashboard/modules/operations/src/react/PrdDocumentDialog.tsx +62 -6
- package/templates/.agents/dashboard/modules/operations/src/react/TaskBoard.test.ts +55 -0
- package/templates/.agents/dashboard/modules/operations/src/react/TaskBoard.tsx +27 -19
- package/templates/.agents/dashboard/modules/operations/src/react/TaskDetailsDialog.tsx +99 -42
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.priority.test.ts +19 -0
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.tsx +255 -34
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.test.ts +163 -8
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.tsx +101 -68
- package/templates/.agents/dashboard/modules/operations/src/react/conversation-rows.test.ts +72 -1
- package/templates/.agents/dashboard/modules/operations/src/react/conversation-rows.ts +78 -16
- package/templates/.agents/dashboard/modules/operations/src/react/execution-metrics.ts +6 -4
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +50 -1
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +143 -9
- package/templates/.agents/dashboard/modules/operations/src/react/export/export-layout.test.ts +29 -4
- package/templates/.agents/dashboard/modules/operations/src/react/macro-planning-dialog-content.css +49 -0
- package/templates/.agents/dashboard/modules/operations/src/react/macro-planning-dialog.css +93 -50
- package/templates/.agents/dashboard/modules/operations/src/react/manual-work-priority.test.ts +82 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operation-date-range.test.ts +29 -2
- package/templates/.agents/dashboard/modules/operations/src/react/operation-date-range.ts +22 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operation-duration.test.ts +77 -4
- package/templates/.agents/dashboard/modules/operations/src/react/operation-duration.ts +65 -5
- package/templates/.agents/dashboard/modules/operations/src/react/operations-coverage-toast.test.ts +54 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-global-filters.test.ts +19 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +149 -12
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview.status-cards.test.ts +27 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-page-contract.ts +136 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-period-scope.test.ts +160 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-period-scope.ts +47 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-query.ts +10 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-responsive.css +3 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-view-labels.ts +28 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operations-view-order.test.ts +24 -7
- package/templates/.agents/dashboard/modules/operations/src/react/operations.css +42 -0
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary-population.test.ts +54 -0
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary-population.ts +32 -0
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary.test.ts +165 -6
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary.ts +148 -6
- package/templates/.agents/dashboard/modules/operations/src/react/popup-localization.test.ts +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/unified-work-board.css +132 -0
- package/templates/.agents/dashboard/modules/operations/src/react/unified-work-board.css.test.ts +13 -0
- package/templates/.agents/dashboard/modules/operations/src/react/unified-work-board.header.test.ts +16 -0
- package/templates/.agents/dashboard/modules/operations/src/react/use-infinite-column.ts +11 -5
- package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.test.ts +5 -3
- package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.ts +4 -83
- package/templates/.agents/dashboard/modules/operations/src/server/build-operations-projection.test.ts +291 -15
- package/templates/.agents/dashboard/modules/operations/src/server/build-operations-projection.ts +182 -472
- package/templates/.agents/dashboard/modules/operations/src/server/canonical-compat.test.ts +40 -0
- package/templates/.agents/dashboard/modules/operations/src/server/canonical-compat.ts +19 -6
- package/templates/.agents/dashboard/modules/operations/src/server/canonical-run-projection.ts +31 -6
- package/templates/.agents/dashboard/modules/operations/src/server/daily-duration-projection.ts +220 -0
- package/templates/.agents/dashboard/modules/operations/src/server/execution-duration-projection.ts +28 -0
- package/templates/.agents/dashboard/modules/operations/src/server/execution-relationship-counts.test.ts +27 -2
- package/templates/.agents/dashboard/modules/operations/src/server/execution-relationship-counts.ts +22 -13
- package/templates/.agents/dashboard/modules/operations/src/server/filter.test.ts +3 -3
- package/templates/.agents/dashboard/modules/operations/src/server/filter.ts +7 -2
- package/templates/.agents/dashboard/modules/operations/src/server/index.ts +3 -0
- package/templates/.agents/dashboard/modules/operations/src/server/macro.ts +3 -12
- package/templates/.agents/dashboard/modules/operations/src/server/manifest-usage.ts +65 -0
- package/templates/.agents/dashboard/modules/operations/src/server/operations-projection-aggregates.ts +297 -0
- package/templates/.agents/dashboard/modules/operations/src/server/quick-daily-operations-projection.ts +324 -0
- package/templates/.agents/dashboard/modules/operations/src/server/quick-operations-projection.test.ts +505 -0
- package/templates/.agents/dashboard/modules/operations/src/server/quick-operations-projection.ts +609 -0
- package/templates/.agents/dashboard/modules/operations/src/server/runs.ts +18 -19
- package/templates/.agents/dashboard/modules/operations/src/work-board-model.ts +76 -0
- package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
- package/templates/.agents/dashboard/modules/traceability/src/server/build-task-trace.ts +3 -1
- package/templates/.agents/dashboard/packages/branding/package.json +1 -1
- package/templates/.agents/dashboard/packages/branding/src/index.ts +1 -1
- package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
- package/templates/.agents/dashboard/packages/contracts/src/index.ts +1 -0
- package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +1756 -0
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +1608 -0
- package/templates/.agents/dashboard/packages/local-runtime/package.json +8 -3
- package/templates/.agents/dashboard/packages/local-runtime/scripts/build-sqlite-dashboard.mjs +12 -0
- package/templates/.agents/dashboard/packages/local-runtime/scripts/build-sqlite-runtime.mjs +83 -0
- package/templates/.agents/dashboard/packages/local-runtime/scripts/rebuild-sqlite-read-model.mjs +28 -0
- package/templates/.agents/dashboard/packages/local-runtime/scripts/test-sqlite-read-model.mjs +262 -0
- package/templates/.agents/dashboard/packages/local-runtime/scripts/test-unix-launchers.mjs +41 -0
- package/templates/.agents/dashboard/packages/local-runtime/scripts/validate-sqlite-read-model.mjs +105 -0
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +1643 -107
- package/templates/.agents/dashboard/packages/local-runtime/src/agent-adapter-sync.ts +30 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/agent-catalog-settings.test.ts +3 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/agent-catalog-settings.ts +5 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/manifest-runs.ts +72 -33
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.test.ts +335 -4
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +392 -1
- package/templates/.agents/dashboard/packages/local-runtime/src/runtime.mjs +5 -5
- package/templates/.agents/dashboard/packages/local-runtime/src/server-board.test.ts +71 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-board.ts +179 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-cross-layer-parity.test.ts +245 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-daily-read-models-route.ts +64 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-daily-read-models.test.ts +204 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-daily-read-models.ts +194 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-pages.test.ts +163 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-pages.ts +354 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-runs-route.test.ts +74 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-runs-route.ts +113 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-overview.test.ts +68 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-period.ts +47 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-projections.ts +483 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-settings.test.ts +5 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot.test.ts +163 -84
- package/templates/.agents/dashboard/packages/local-runtime/src/server-workspace.ts +145 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +551 -266
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +1145 -308
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-metric-contract.test.ts +53 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-metric-contract.ts +708 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +2232 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.ts +6151 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/work-priority-contract.test.ts +33 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-history.mjs +41 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-processes.mjs +210 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +437 -190
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +299 -24
- package/templates/.agents/dashboard/packages/ui/package.json +1 -1
- package/templates/.agents/dashboard/packages/windows-launcher/LauncherVerificationBehaviorTests.cs +206 -0
- package/templates/.agents/dashboard/packages/windows-launcher/Program.cs +95 -8
- package/templates/.agents/dashboard/packages/windows-launcher/build-dashboard-launcher.ps1 +2 -2
- package/templates/.agents/dashboard/packages/windows-launcher/run-launcher-verification-tests.ps1 +22 -0
- package/templates/.agents/dashboard/read-model.dbml +2201 -0
- package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/playwright.config.ts +1 -1
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +214 -41
- package/templates/.agents/dashboard/work-priority.json +34 -0
- package/templates/.agents/dashboard/zaip-dashboard-linux.sh +45 -0
- package/templates/.agents/dashboard/zaip-dashboard-mac.command +3 -0
- package/templates/.agents/dashboard/zaip-dashboard-windows.exe +0 -0
- package/templates/.agents/design/.zaip-managed.json +3 -3
- package/templates/.agents/design/apps/catalog/package.json +1 -1
- package/templates/.agents/design/packages/local-runtime/package.json +1 -1
- package/templates/.agents/requirements/autonomous-assurance.md +1 -1
- package/templates/.agents/requirements/comparative-audit.md +1 -1
- package/templates/.agents/requirements/context-engine.md +1 -1
- package/templates/.agents/requirements/cost-observability.md +1 -1
- package/templates/.agents/requirements/dashboard-launch.md +24 -0
- package/templates/.agents/requirements/data-export.md +1 -1
- package/templates/.agents/requirements/design-system.md +1 -1
- package/templates/.agents/requirements/execution-engine.md +1 -1
- package/templates/.agents/requirements/kanban-dashboard.md +4 -3
- package/templates/.agents/requirements/model-orchestration.md +1 -1
- package/templates/.agents/requirements/public-distribution.md +9 -6
- package/templates/.agents/requirements/software-architecture.md +1 -1
- package/templates/.agents/requirements/strategic-improvements.md +1 -1
- package/templates/.agents/requirements/work-lifecycle.md +9 -3
- package/templates/.agents/requirements/zaip-strategic-95.md +4 -4
- package/templates/.agents/rules/autonomy-decision.md +15 -0
- package/templates/.agents/rules/core.md +1 -1
- package/templates/.agents/rules/run-lifecycle-closure.md +1 -1
- package/templates/.agents/rules/specialist-routing.md +19 -0
- package/templates/.agents/rules/workflow.md +1 -1
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +114 -64
- package/templates/.agents/runtime/checksums.sha256 +6 -4
- package/templates/.agents/runtime/manifest.json +3 -1
- package/templates/.agents/runtime/pnpm-lock.sha256 +1 -0
- package/templates/.agents/runtime/provenance.json +11 -0
- package/templates/.agents/runtime/sbom.cdx.json +1929 -39
- package/templates/.agents/skills/zaip-aios/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-brand-governance/SKILL.md +15 -0
- package/templates/.agents/skills/zaip-skill-brand-governance/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-brand-governance/references/brandbook-standards.md +30 -0
- package/templates/.agents/skills/zaip-skill-dashboard-sqlite/SKILL.md +25 -0
- package/templates/.agents/skills/zaip-skill-dashboard-sqlite/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/SKILL.md +18 -0
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/agents/openai.yaml +6 -0
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-fence.mjs +71 -0
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/ready-queue-fence.test.mjs +60 -0
- package/templates/.agents/skills/zaip-skill-executar-fila-pronta/scripts/scheduled-ready-queue-contract.test.mjs +111 -0
- package/templates/.agents/skills/zaip-skill-execution/SKILL.md +2 -2
- package/templates/.agents/skills/zaip-skill-frontend-launcher/references/launcher-contract.md +3 -1
- package/templates/.agents/skills/zaip-skill-general-operations/SKILL.md +12 -0
- package/templates/.agents/skills/zaip-skill-general-operations/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +9 -7
- package/templates/.agents/skills/zaip-skill-github-deploy/agents/openai.yaml +2 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +11 -38
- package/templates/.agents/skills/zaip-skill-governance-compliance/SKILL.md +12 -0
- package/templates/.agents/skills/zaip-skill-governance-compliance/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-growth-strategy-revops/SKILL.md +15 -0
- package/templates/.agents/skills/zaip-skill-growth-strategy-revops/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-growth-strategy-revops/references/growth-revops-framework.md +25 -0
- package/templates/.agents/skills/zaip-skill-instalar-agendamento/SKILL.md +17 -0
- package/templates/.agents/skills/zaip-skill-instalar-agendamento/agents/openai.yaml +6 -0
- package/templates/.agents/skills/zaip-skill-marketing/SKILL.md +3 -3
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +76 -27
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +128 -24
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +122 -4
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.mjs +66 -19
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.test.mjs +193 -7
- package/templates/.agents/skills/zaip-skill-sales-methodology/SKILL.md +14 -0
- package/templates/.agents/skills/zaip-skill-sales-methodology/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-sales-methodology/references/sales-process-framework.md +77 -0
- package/templates/.agents/skills/zaip-skill-setup/SKILL.md +5 -0
- package/templates/.agents/skills/zaip-skill-sqlite-read-model/SKILL.md +96 -0
- package/templates/.agents/skills/zaip-skill-sqlite-read-model/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-sqlite-read-model/scripts/ensure-node.mjs +18 -0
- package/templates/.agents/zaip-aios/INDEX.md +1 -0
- package/templates/.agents/zaip-aios/README.md +37 -8
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/.agents/zaip-aios/guides/09-agentes-e-squads.md +43 -6
- package/templates/.agents/zaip-aios/guides/10-seguranca.md +21 -7
- package/templates/.agents/zaip-aios/guides/17-como-o-custo-e-calculado.md +32 -0
- package/templates/template-manifest.json +945 -214
- package/templates/.agents/dashboard/apps/frontend/dist/assets/AgentCatalogSettingsPage-CLYIi7Vo.js +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/AgentCatalogSettingsPage-DTDNVQGX.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/PricingSettingsDialog-CzEggcRb.js +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-05YKn6Z4.js +0 -3
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-YO3yqtgV.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-8AzCnl3a.js +0 -77
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DdBYQ_8D.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/src/AgentCatalogSettingsPage.tsx +0 -617
- package/templates/.agents/dashboard/apps/frontend/src/agent-catalog-settings-page.css +0 -660
- package/templates/.agents/dashboard/apps/frontend/src/agent-catalog-settings.test.ts +0 -249
- package/templates/.agents/dashboard/dashboard.config.json +0 -4
- package/templates/.agents/dashboard/zaip-dashboard.exe +0 -0
|
@@ -0,0 +1,1608 @@
|
|
|
1
|
+
"use strict";var Ih=Object.create;var zi=Object.defineProperty;var Nh=Object.getOwnPropertyDescriptor;var Ch=Object.getOwnPropertyNames;var Rh=Object.getPrototypeOf,Lh=Object.prototype.hasOwnProperty;var k=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Mh=(e,t)=>{for(var n in t)zi(e,n,{get:t[n],enumerable:!0})},mu=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ch(t))!Lh.call(e,r)&&r!==n&&zi(e,r,{get:()=>t[r],enumerable:!(i=Nh(t,r))||i.enumerable});return e};var nt=(e,t,n)=>(n=e!=null?Ih(Rh(e)):{},mu(t||!e||!e.__esModule?zi(n,"default",{value:e,enumerable:!0}):n,e)),Uh=e=>mu(zi({},"__esModule",{value:!0}),e);var ar=k(rt=>{"use strict";var gu;Object.defineProperty(rt,"__esModule",{value:!0});rt.globalConfig=rt.$ZodEncodeError=rt.$ZodAsyncError=rt.$brand=rt.NEVER=void 0;rt.$constructor=Ph;rt.config=xh;rt.NEVER=Object.freeze({status:"aborted"});function Ph(e,t,n){function i(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);let l=a.prototype,_=Object.keys(l);for(let u=0;u<_.length;u++){let f=_[u];f in s||(s[f]=l[f].bind(s))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:e});function a(s){var c;let l=n?.Parent?new o:this;i(l,s),(c=l._zod).deferred??(c.deferred=[]);for(let _ of l._zod.deferred)_();return l}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}rt.$brand=Symbol("zod_brand");var Ns=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};rt.$ZodAsyncError=Ns;var Cs=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};rt.$ZodEncodeError=Cs;(gu=globalThis).__zod_globalConfig??(gu.__zod_globalConfig={});rt.globalConfig=globalThis.__zod_globalConfig;function xh(e){return e&&Object.assign(rt.globalConfig,e),rt.globalConfig}});var G=k(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.Class=W.BIGINT_FORMAT_RANGES=W.NUMBER_FORMAT_RANGES=W.primitiveTypes=W.propertyKeyTypes=W.getParsedType=W.allowsEval=W.captureStackTrace=void 0;W.assertEqual=Dh;W.assertNotEqual=zh;W.assertIs=Fh;W.assertNever=Zh;W.assert=qh;W.getEnumValues=Vh;W.joinValues=Wh;W.jsonStringifyReplacer=Bh;W.cached=vu;W.nullish=Hh;W.cleanRegex=Jh;W.floatSafeRemainder=Kh;W.defineLazy=Xh;W.objectClone=Gh;W.assignProp=Bn;W.mergeDefs=jn;W.cloneDef=Yh;W.getElementAtPath=Qh;W.promiseAllObject=ev;W.randomString=tv;W.esc=nv;W.slugify=rv;W.isObject=Rs;W.isPlainObject=Fi;W.shallowClone=iv;W.numKeys=ov;W.escapeRegex=sv;W.clone=Hn;W.normalizeParams=cv;W.createTransparentProxy=lv;W.stringifyPrimitive=yu;W.optionalKeys=uv;W.pick=dv;W.omit=_v;W.extend=fv;W.safeExtend=pv;W.merge=mv;W.partial=gv;W.required=hv;W.aborted=vv;W.explicitlyAborted=yv;W.prefixIssues=bv;W.unwrapMessage=Zr;W.finalizeIssue=Sv;W.getSizableOrigin=Ev;W.getLengthableOrigin=kv;W.parsedType=Ov;W.issue=wv;W.cleanEnum=Av;W.base64ToUint8Array=bu;W.uint8ArrayToBase64=Su;W.base64urlToUint8Array=Tv;W.uint8ArrayToBase64url=$v;W.hexToUint8Array=Iv;W.uint8ArrayToHex=Nv;var jh=ar();function Dh(e){return e}function zh(e){return e}function Fh(e){}function Zh(e){throw new Error("Unexpected value in exhaustive check")}function qh(e){}function Vh(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function Wh(e,t="|"){return e.map(n=>yu(n)).join(t)}function Bh(e,t){return typeof t=="bigint"?t.toString():t}function vu(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Hh(e){return e==null}function Jh(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Kh(e,t){let n=e/t,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var hu=Symbol("evaluating");function Xh(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==hu)return i===void 0&&(i=hu,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Gh(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Bn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function jn(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function Yh(e){return jn(e._zod.def)}function Qh(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function ev(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function tv(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function nv(e){return JSON.stringify(e)}function rv(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}W.captureStackTrace="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Rs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}W.allowsEval=vu(()=>{if(jh.globalConfig.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Fi(e){if(Rs(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Rs(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function iv(e){return Fi(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function ov(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var av=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}};W.getParsedType=av;W.propertyKeyTypes=new Set(["string","number","symbol"]);W.primitiveTypes=new Set(["string","number","bigint","boolean","symbol","undefined"]);function sv(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hn(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function cv(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function lv(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function yu(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function uv(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}W.NUMBER_FORMAT_RANGES={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};W.BIGINT_FORMAT_RANGES={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function dv(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=jn(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=n.shape[s])}return Bn(this,"shape",a),a},checks:[]});return Hn(e,o)}function _v(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=jn(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Bn(this,"shape",a),a},checks:[]});return Hn(e,o)}function fv(e,t){if(!Fi(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=jn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Bn(this,"shape",o),o}});return Hn(e,r)}function pv(e,t){if(!Fi(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=jn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Bn(this,"shape",i),i}});return Hn(e,n)}function mv(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=jn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Bn(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Hn(e,n)}function gv(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=jn(t._zod.def,{get shape(){let s=t._zod.def.shape,c={...s};if(n)for(let l in n){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)c[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return Bn(this,"shape",c),c},checks:[]});return Hn(t,a)}function hv(e,t,n){let i=jn(t._zod.def,{get shape(){let r=t._zod.def.shape,o={...r};if(n)for(let a in n){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(o[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(let a in r)o[a]=new e({type:"nonoptional",innerType:r[a]});return Bn(this,"shape",o),o}});return Hn(t,i)}function vv(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function yv(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function bv(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Zr(e){return typeof e=="string"?e:e?.message}function Sv(e,t,n){let i=e.message?e.message:Zr(e.inst?._zod.def?.error?.(e))??Zr(t?.error?.(e))??Zr(n.customError?.(e))??Zr(n.localeError?.(e))??"Invalid input",{inst:r,continue:o,input:a,...s}=e;return s.path??(s.path=[]),s.message=i,t?.reportInput&&(s.input=a),s}function Ev(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function kv(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ov(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function wv(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function Av(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function bu(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function Su(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Tv(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return bu(t+n)}function $v(e){return Su(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Iv(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function Nv(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ls=class{constructor(...t){}};W.Class=Ls});var Ms=k(et=>{"use strict";var Cv=et&&et.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Rv=et&&et.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Lv=et&&et.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Cv(t,e,n);return Rv(t,e),t};Object.defineProperty(et,"__esModule",{value:!0});et.$ZodRealError=et.$ZodError=void 0;et.flattenError=Uv;et.formatError=Pv;et.treeifyError=xv;et.toDotPath=Ou;et.prettifyError=jv;var Eu=ar(),Mv=Lv(G()),ku=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Mv.jsonStringifyReplacer,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})};et.$ZodError=(0,Eu.$constructor)("$ZodError",ku);et.$ZodRealError=(0,Eu.$constructor)("$ZodError",ku,{Parent:Error});function Uv(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):i.push(t(r));return{formErrors:i,fieldErrors:n}}function Pv(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>i({issues:s},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let s=[...o,...a.path];if(s.length===0)n._errors.push(t(a));else{let c=n,l=0;for(;l<s.length;){let _=s[l];l===s.length-1?(c[_]=c[_]||{_errors:[]},c[_]._errors.push(t(a))):c[_]=c[_]||{_errors:[]},c=c[_],l++}}}};return i(e),n}function xv(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var a,s;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>i({issues:l},[...o,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...o,...c.path]);else{let l=[...o,...c.path];if(l.length===0){n.errors.push(t(c));continue}let _=n,u=0;for(;u<l.length;){let f=l[u],p=u===l.length-1;typeof f=="string"?(_.properties??(_.properties={}),(a=_.properties)[f]??(a[f]={errors:[]}),_=_.properties[f]):(_.items??(_.items=[]),(s=_.items)[f]??(s[f]={errors:[]}),_=_.items[f]),p&&_.errors.push(t(c)),u++}}};return i(e),n}function Ou(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function jv(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${Ou(i.path)}`);return t.join(`
|
|
2
|
+
`)}});var Ps=k(Z=>{"use strict";var Dv=Z&&Z.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),zv=Z&&Z.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Us=Z&&Z.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Dv(t,e,n);return zv(t,e),t};Object.defineProperty(Z,"__esModule",{value:!0});Z.safeDecodeAsync=Z._safeDecodeAsync=Z.safeEncodeAsync=Z._safeEncodeAsync=Z.safeDecode=Z._safeDecode=Z.safeEncode=Z._safeEncode=Z.decodeAsync=Z._decodeAsync=Z.encodeAsync=Z._encodeAsync=Z.decode=Z._decode=Z.encode=Z._encode=Z.safeParseAsync=Z._safeParseAsync=Z.safeParse=Z._safeParse=Z.parseAsync=Z._parseAsync=Z.parse=Z._parse=void 0;var vr=Us(ar()),gt=Us(Ms()),yr=Us(G()),Fv=e=>(t,n,i,r)=>{let o=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new vr.$ZodAsyncError;if(a.issues.length){let s=new(r?.Err??e)(a.issues.map(c=>yr.finalizeIssue(c,o,vr.config())));throw yr.captureStackTrace(s,r?.callee),s}return a.value};Z._parse=Fv;Z.parse=(0,Z._parse)(gt.$ZodRealError);var Zv=e=>async(t,n,i,r)=>{let o=i?{...i,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(r?.Err??e)(a.issues.map(c=>yr.finalizeIssue(c,o,vr.config())));throw yr.captureStackTrace(s,r?.callee),s}return a.value};Z._parseAsync=Zv;Z.parseAsync=(0,Z._parseAsync)(gt.$ZodRealError);var qv=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new vr.$ZodAsyncError;return o.issues.length?{success:!1,error:new(e??gt.$ZodError)(o.issues.map(a=>yr.finalizeIssue(a,r,vr.config())))}:{success:!0,data:o.value}};Z._safeParse=qv;Z.safeParse=(0,Z._safeParse)(gt.$ZodRealError);var Vv=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>yr.finalizeIssue(a,r,vr.config())))}:{success:!0,data:o.value}};Z._safeParseAsync=Vv;Z.safeParseAsync=(0,Z._safeParseAsync)(gt.$ZodRealError);var Wv=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return(0,Z._parse)(e)(t,n,r)};Z._encode=Wv;Z.encode=(0,Z._encode)(gt.$ZodRealError);var Bv=e=>(t,n,i)=>(0,Z._parse)(e)(t,n,i);Z._decode=Bv;Z.decode=(0,Z._decode)(gt.$ZodRealError);var Hv=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return(0,Z._parseAsync)(e)(t,n,r)};Z._encodeAsync=Hv;Z.encodeAsync=(0,Z._encodeAsync)(gt.$ZodRealError);var Jv=e=>async(t,n,i)=>(0,Z._parseAsync)(e)(t,n,i);Z._decodeAsync=Jv;Z.decodeAsync=(0,Z._decodeAsync)(gt.$ZodRealError);var Kv=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return(0,Z._safeParse)(e)(t,n,r)};Z._safeEncode=Kv;Z.safeEncode=(0,Z._safeEncode)(gt.$ZodRealError);var Xv=e=>(t,n,i)=>(0,Z._safeParse)(e)(t,n,i);Z._safeDecode=Xv;Z.safeDecode=(0,Z._safeDecode)(gt.$ZodRealError);var Gv=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return(0,Z._safeParseAsync)(e)(t,n,r)};Z._safeEncodeAsync=Gv;Z.safeEncodeAsync=(0,Z._safeEncodeAsync)(gt.$ZodRealError);var Yv=e=>async(t,n,i)=>(0,Z._safeParseAsync)(e)(t,n,i);Z._safeDecodeAsync=Yv;Z.safeDecodeAsync=(0,Z._safeDecodeAsync)(gt.$ZodRealError)});var Zi=k(T=>{"use strict";var Qv=T&&T.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),ey=T&&T.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),ty=T&&T.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Qv(t,e,n);return ey(t,e),t};Object.defineProperty(T,"__esModule",{value:!0});T.sha256_base64url=T.sha256_base64=T.sha256_hex=T.sha1_base64url=T.sha1_base64=T.sha1_hex=T.md5_base64url=T.md5_base64=T.md5_hex=T.hex=T.uppercase=T.lowercase=T.undefined=T.null=T.boolean=T.number=T.integer=T.bigint=T.string=T.date=T.e164=T.httpProtocol=T.domain=T.hostname=T.base64url=T.base64=T.cidrv6=T.cidrv4=T.mac=T.ipv6=T.ipv4=T.browserEmail=T.idnEmail=T.unicodeEmail=T.rfc5322Email=T.html5Email=T.email=T.uuid7=T.uuid6=T.uuid4=T.uuid=T.guid=T.extendedDuration=T.duration=T.nanoid=T.ksuid=T.xid=T.ulid=T.cuid2=T.cuid=void 0;T.sha512_base64url=T.sha512_base64=T.sha512_hex=T.sha384_base64url=T.sha384_base64=T.sha384_hex=void 0;T.emoji=oy;T.time=sy;T.datetime=cy;var ny=ty(G());T.cuid=/^[cC][0-9a-z]{6,}$/;T.cuid2=/^[0-9a-z]+$/;T.ulid=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;T.xid=/^[0-9a-vA-V]{20}$/;T.ksuid=/^[A-Za-z0-9]{27}$/;T.nanoid=/^[a-zA-Z0-9_-]{21}$/;T.duration=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;T.extendedDuration=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;T.guid=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;var ry=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;T.uuid=ry;T.uuid4=(0,T.uuid)(4);T.uuid6=(0,T.uuid)(6);T.uuid7=(0,T.uuid)(7);T.email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;T.html5Email=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;T.rfc5322Email=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;T.unicodeEmail=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;T.idnEmail=T.unicodeEmail;T.browserEmail=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;var iy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function oy(){return new RegExp(iy,"u")}T.ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;T.ipv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var ay=e=>{let t=ny.escapeRegex(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)};T.mac=ay;T.cidrv4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;T.cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;T.base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;T.base64url=/^[A-Za-z0-9_-]*$/;T.hostname=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;T.domain=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;T.httpProtocol=/^https?$/;T.e164=/^\+[1-9]\d{6,14}$/;var wu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";T.date=new RegExp(`^${wu}$`);function Au(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sy(e){return new RegExp(`^${Au(e)}$`)}function cy(e){let t=Au({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${n.join("|")})`;return new RegExp(`^${wu}T(?:${i})$`)}var ly=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};T.string=ly;T.bigint=/^-?\d+n?$/;T.integer=/^-?\d+$/;T.number=/^-?\d+(?:\.\d+)?$/;T.boolean=/^(?:true|false)$/i;var uy=/^null$/i;T.null=uy;var dy=/^undefined$/i;T.undefined=dy;T.lowercase=/^[^A-Z]*$/;T.uppercase=/^[^a-z]*$/;T.hex=/^[0-9a-fA-F]*$/;function qr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Vr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}T.md5_hex=/^[0-9a-fA-F]{32}$/;T.md5_base64=qr(22,"==");T.md5_base64url=Vr(22);T.sha1_hex=/^[0-9a-fA-F]{40}$/;T.sha1_base64=qr(27,"=");T.sha1_base64url=Vr(27);T.sha256_hex=/^[0-9a-fA-F]{64}$/;T.sha256_base64=qr(43,"=");T.sha256_base64url=Vr(43);T.sha384_hex=/^[0-9a-fA-F]{96}$/;T.sha384_base64=qr(64,"");T.sha384_base64url=Vr(64);T.sha512_hex=/^[0-9a-fA-F]{128}$/;T.sha512_base64=qr(86,"==");T.sha512_base64url=Vr(86)});var qi=k(B=>{"use strict";var _y=B&&B.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),fy=B&&B.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),xs=B&&B.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&_y(t,e,n);return fy(t,e),t};Object.defineProperty(B,"__esModule",{value:!0});B.$ZodCheckOverwrite=B.$ZodCheckMimeType=B.$ZodCheckProperty=B.$ZodCheckEndsWith=B.$ZodCheckStartsWith=B.$ZodCheckIncludes=B.$ZodCheckUpperCase=B.$ZodCheckLowerCase=B.$ZodCheckRegex=B.$ZodCheckStringFormat=B.$ZodCheckLengthEquals=B.$ZodCheckMinLength=B.$ZodCheckMaxLength=B.$ZodCheckSizeEquals=B.$ZodCheckMinSize=B.$ZodCheckMaxSize=B.$ZodCheckBigIntFormat=B.$ZodCheckNumberFormat=B.$ZodCheckMultipleOf=B.$ZodCheckGreaterThan=B.$ZodCheckLessThan=B.$ZodCheck=void 0;var Fe=xs(ar()),js=xs(Zi()),Be=xs(G());B.$ZodCheck=Fe.$constructor("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])});var $u={number:"number",bigint:"bigint",object:"date"};B.$ZodCheckLessThan=Fe.$constructor("$ZodCheckLessThan",(e,t)=>{B.$ZodCheck.init(e,t);let n=$u[typeof t.value];e._zod.onattach.push(i=>{let r=i._zod.bag,o=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});B.$ZodCheckGreaterThan=Fe.$constructor("$ZodCheckGreaterThan",(e,t)=>{B.$ZodCheck.init(e,t);let n=$u[typeof t.value];e._zod.onattach.push(i=>{let r=i._zod.bag,o=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});B.$ZodCheckMultipleOf=Fe.$constructor("$ZodCheckMultipleOf",(e,t)=>{B.$ZodCheck.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Be.floatSafeRemainder(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}});B.$ZodCheckNumberFormat=Fe.$constructor("$ZodCheckNumberFormat",(e,t)=>{B.$ZodCheck.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=Be.NUMBER_FORMAT_RANGES[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=r,s.maximum=o,n&&(s.pattern=js.integer)}),e._zod.check=a=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<r&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}});B.$ZodCheckBigIntFormat=Fe.$constructor("$ZodCheckBigIntFormat",(e,t)=>{B.$ZodCheck.init(e,t);let[n,i]=Be.BIGINT_FORMAT_RANGES[t.format];e._zod.onattach.push(r=>{let o=r._zod.bag;o.format=t.format,o.minimum=n,o.maximum=i}),e._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});B.$ZodCheckMaxSize=Fe.$constructor("$ZodCheckMaxSize",(e,t)=>{var n;B.$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Be.nullish(r)&&r.size!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Be.getSizableOrigin(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}});B.$ZodCheckMinSize=Fe.$constructor("$ZodCheckMinSize",(e,t)=>{var n;B.$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Be.nullish(r)&&r.size!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Be.getSizableOrigin(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}});B.$ZodCheckSizeEquals=Fe.$constructor("$ZodCheckSizeEquals",(e,t)=>{var n;B.$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Be.nullish(r)&&r.size!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let a=o>t.size;i.issues.push({origin:Be.getSizableOrigin(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}});B.$ZodCheckMaxLength=Fe.$constructor("$ZodCheckMaxLength",(e,t)=>{var n;B.$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Be.nullish(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let r=i.value;if(r.length<=t.maximum)return;let a=Be.getLengthableOrigin(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}});B.$ZodCheckMinLength=Fe.$constructor("$ZodCheckMinLength",(e,t)=>{var n;B.$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Be.nullish(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let r=i.value;if(r.length>=t.minimum)return;let a=Be.getLengthableOrigin(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}});B.$ZodCheckLengthEquals=Fe.$constructor("$ZodCheckLengthEquals",(e,t)=>{var n;B.$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=i=>{let r=i.value;return!Be.nullish(r)&&r.length!==void 0}),e._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=i=>{let r=i.value,o=r.length;if(o===t.length)return;let a=Be.getLengthableOrigin(r),s=o>t.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}});B.$ZodCheckStringFormat=Fe.$constructor("$ZodCheckStringFormat",(e,t)=>{var n,i;B.$ZodCheck.init(e,t),e._zod.onattach.push(r=>{let o=r._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})});B.$ZodCheckRegex=Fe.$constructor("$ZodCheckRegex",(e,t)=>{B.$ZodCheckStringFormat.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});B.$ZodCheckLowerCase=Fe.$constructor("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=js.lowercase),B.$ZodCheckStringFormat.init(e,t)});B.$ZodCheckUpperCase=Fe.$constructor("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=js.uppercase),B.$ZodCheckStringFormat.init(e,t)});B.$ZodCheckIncludes=Fe.$constructor("$ZodCheckIncludes",(e,t)=>{B.$ZodCheck.init(e,t);let n=Be.escapeRegex(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}});B.$ZodCheckStartsWith=Fe.$constructor("$ZodCheckStartsWith",(e,t)=>{B.$ZodCheck.init(e,t);let n=new RegExp(`^${Be.escapeRegex(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}});B.$ZodCheckEndsWith=Fe.$constructor("$ZodCheckEndsWith",(e,t)=>{B.$ZodCheck.init(e,t);let n=new RegExp(`.*${Be.escapeRegex(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Tu(e,t,n){e.issues.length&&t.issues.push(...Be.prefixIssues(n,e.issues))}B.$ZodCheckProperty=Fe.$constructor("$ZodCheckProperty",(e,t)=>{B.$ZodCheck.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>Tu(r,n,t.property));Tu(i,n,t.property)}});B.$ZodCheckMimeType=Fe.$constructor("$ZodCheckMimeType",(e,t)=>{B.$ZodCheck.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}});B.$ZodCheckOverwrite=Fe.$constructor("$ZodCheckOverwrite",(e,t)=>{B.$ZodCheck.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}})});var zs=k(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.Doc=void 0;var Ds=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
3
|
+
`).filter(a=>a),r=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...n,r.join(`
|
|
4
|
+
`))}};Vi.Doc=Ds});var Fs=k(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.version=void 0;Wi.version={major:4,minor:4,patch:3}});var Vs=k(g=>{"use strict";var py=g&&g.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),my=g&&g.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Xi=g&&g.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&py(t,e,n);return my(t,e),t};Object.defineProperty(g,"__esModule",{value:!0});g.$ZodTuple=g.$ZodIntersection=g.$ZodDiscriminatedUnion=g.$ZodXor=g.$ZodUnion=g.$ZodObjectJIT=g.$ZodObject=g.$ZodArray=g.$ZodDate=g.$ZodVoid=g.$ZodNever=g.$ZodUnknown=g.$ZodAny=g.$ZodNull=g.$ZodUndefined=g.$ZodSymbol=g.$ZodBigIntFormat=g.$ZodBigInt=g.$ZodBoolean=g.$ZodNumberFormat=g.$ZodNumber=g.$ZodCustomStringFormat=g.$ZodJWT=g.$ZodE164=g.$ZodBase64URL=g.$ZodBase64=g.$ZodCIDRv6=g.$ZodCIDRv4=g.$ZodMAC=g.$ZodIPv6=g.$ZodIPv4=g.$ZodISODuration=g.$ZodISOTime=g.$ZodISODate=g.$ZodISODateTime=g.$ZodKSUID=g.$ZodXID=g.$ZodULID=g.$ZodCUID2=g.$ZodCUID=g.$ZodNanoID=g.$ZodEmoji=g.$ZodURL=g.$ZodEmail=g.$ZodUUID=g.$ZodGUID=g.$ZodStringFormat=g.$ZodString=g.clone=g.$ZodType=void 0;g.$ZodCustom=g.$ZodLazy=g.$ZodPromise=g.$ZodFunction=g.$ZodTemplateLiteral=g.$ZodReadonly=g.$ZodPreprocess=g.$ZodCodec=g.$ZodPipe=g.$ZodNaN=g.$ZodCatch=g.$ZodSuccess=g.$ZodNonOptional=g.$ZodPrefault=g.$ZodDefault=g.$ZodNullable=g.$ZodExactOptional=g.$ZodOptional=g.$ZodTransform=g.$ZodFile=g.$ZodLiteral=g.$ZodEnum=g.$ZodSet=g.$ZodMap=g.$ZodRecord=void 0;g.isValidBase64=qs;g.isValidBase64URL=qu;g.isValidJWT=Vu;var Gi=Xi(qi()),x=Xi(ar()),gy=zs(),br=Ps(),Ee=Xi(Zi()),j=Xi(G()),hy=Fs();g.$ZodType=x.$constructor("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hy.version;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let r of i)for(let o of r._zod.onattach)o(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(a,s,c)=>{let l=j.aborted(a),_;for(let u of s){if(u._zod.def.when){if(j.explicitlyAborted(a)||!u._zod.def.when(a))continue}else if(l)continue;let f=a.issues.length,p=u._zod.check(a);if(p instanceof Promise&&c?.async===!1)throw new x.$ZodAsyncError;if(_||p instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await p,a.issues.length!==f&&(l||(l=j.aborted(a,f)))});else{if(a.issues.length===f)continue;l||(l=j.aborted(a,f))}}return _?_.then(()=>a):a},o=(a,s,c)=>{if(j.aborted(a))return a.aborted=!0,a;let l=r(s,i,c);if(l instanceof Promise){if(c.async===!1)throw new x.$ZodAsyncError;return l.then(_=>e._zod.parse(_,c))}return e._zod.parse(l,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(_=>o(_,a,s)):o(l,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new x.$ZodAsyncError;return c.then(l=>r(l,i,s))}return r(c,i,s)}}j.defineLazy(e,"~standard",()=>({validate:r=>{try{let o=(0,br.safeParse)(e,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return(0,br.safeParseAsync)(e,r).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))});var vy=G();Object.defineProperty(g,"clone",{enumerable:!0,get:function(){return vy.clone}});g.$ZodString=x.$constructor("$ZodString",(e,t)=>{g.$ZodType.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ee.string(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}});g.$ZodStringFormat=x.$constructor("$ZodStringFormat",(e,t)=>{Gi.$ZodCheckStringFormat.init(e,t),g.$ZodString.init(e,t)});g.$ZodGUID=x.$constructor("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ee.guid),g.$ZodStringFormat.init(e,t)});g.$ZodUUID=x.$constructor("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ee.uuid(i))}else t.pattern??(t.pattern=Ee.uuid());g.$ZodStringFormat.init(e,t)});g.$ZodEmail=x.$constructor("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ee.email),g.$ZodStringFormat.init(e,t)});g.$ZodURL=x.$constructor("$ZodURL",(e,t)=>{g.$ZodStringFormat.init(e,t),e._zod.check=n=>{try{let i=n.value.trim();if(!t.normalize&&t.protocol?.source===Ee.httpProtocol.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}let r=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}});g.$ZodEmoji=x.$constructor("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ee.emoji()),g.$ZodStringFormat.init(e,t)});g.$ZodNanoID=x.$constructor("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ee.nanoid),g.$ZodStringFormat.init(e,t)});g.$ZodCUID=x.$constructor("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ee.cuid),g.$ZodStringFormat.init(e,t)});g.$ZodCUID2=x.$constructor("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ee.cuid2),g.$ZodStringFormat.init(e,t)});g.$ZodULID=x.$constructor("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ee.ulid),g.$ZodStringFormat.init(e,t)});g.$ZodXID=x.$constructor("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ee.xid),g.$ZodStringFormat.init(e,t)});g.$ZodKSUID=x.$constructor("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ee.ksuid),g.$ZodStringFormat.init(e,t)});g.$ZodISODateTime=x.$constructor("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ee.datetime(t)),g.$ZodStringFormat.init(e,t)});g.$ZodISODate=x.$constructor("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ee.date),g.$ZodStringFormat.init(e,t)});g.$ZodISOTime=x.$constructor("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ee.time(t)),g.$ZodStringFormat.init(e,t)});g.$ZodISODuration=x.$constructor("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ee.duration),g.$ZodStringFormat.init(e,t)});g.$ZodIPv4=x.$constructor("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ee.ipv4),g.$ZodStringFormat.init(e,t),e._zod.bag.format="ipv4"});g.$ZodIPv6=x.$constructor("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ee.ipv6),g.$ZodStringFormat.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}});g.$ZodMAC=x.$constructor("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Ee.mac(t.delimiter)),g.$ZodStringFormat.init(e,t),e._zod.bag.format="mac"});g.$ZodCIDRv4=x.$constructor("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ee.cidrv4),g.$ZodStringFormat.init(e,t)});g.$ZodCIDRv6=x.$constructor("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ee.cidrv6),g.$ZodStringFormat.init(e,t),e._zod.check=n=>{let i=n.value.split("/");try{if(i.length!==2)throw new Error;let[r,o]=i;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function qs(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}g.$ZodBase64=x.$constructor("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ee.base64),g.$ZodStringFormat.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{qs(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function qu(e){if(!Ee.base64url.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return qs(n)}g.$ZodBase64URL=x.$constructor("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ee.base64url),g.$ZodStringFormat.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{qu(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}});g.$ZodE164=x.$constructor("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ee.e164),g.$ZodStringFormat.init(e,t)});function Vu(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}g.$ZodJWT=x.$constructor("$ZodJWT",(e,t)=>{g.$ZodStringFormat.init(e,t),e._zod.check=n=>{Vu(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}});g.$ZodCustomStringFormat=x.$constructor("$ZodCustomStringFormat",(e,t)=>{g.$ZodStringFormat.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}});g.$ZodNumber=x.$constructor("$ZodNumber",(e,t)=>{g.$ZodType.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ee.number,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...o?{received:o}:{}}),n}});g.$ZodNumberFormat=x.$constructor("$ZodNumberFormat",(e,t)=>{Gi.$ZodCheckNumberFormat.init(e,t),g.$ZodNumber.init(e,t)});g.$ZodBoolean=x.$constructor("$ZodBoolean",(e,t)=>{g.$ZodType.init(e,t),e._zod.pattern=Ee.boolean,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}});g.$ZodBigInt=x.$constructor("$ZodBigInt",(e,t)=>{g.$ZodType.init(e,t),e._zod.pattern=Ee.bigint,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}});g.$ZodBigIntFormat=x.$constructor("$ZodBigIntFormat",(e,t)=>{Gi.$ZodCheckBigIntFormat.init(e,t),g.$ZodBigInt.init(e,t)});g.$ZodSymbol=x.$constructor("$ZodSymbol",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}});g.$ZodUndefined=x.$constructor("$ZodUndefined",(e,t)=>{g.$ZodType.init(e,t),e._zod.pattern=Ee.undefined,e._zod.values=new Set([void 0]),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}});g.$ZodNull=x.$constructor("$ZodNull",(e,t)=>{g.$ZodType.init(e,t),e._zod.pattern=Ee.null,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}});g.$ZodAny=x.$constructor("$ZodAny",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=n=>n});g.$ZodUnknown=x.$constructor("$ZodUnknown",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=n=>n});g.$ZodNever=x.$constructor("$ZodNever",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});g.$ZodVoid=x.$constructor("$ZodVoid",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}});g.$ZodDate=x.$constructor("$ZodDate",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:e}),n}});function Iu(e,t,n){e.issues.length&&t.issues.push(...j.prefixIssues(n,e.issues)),t.value[n]=e.value}g.$ZodArray=x.$constructor("$ZodArray",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let o=[];for(let a=0;a<r.length;a++){let s=r[a],c=t.element._zod.run({value:s,issues:[]},i);c instanceof Promise?o.push(c.then(l=>Iu(l,n,a))):Iu(c,n,a)}return o.length?Promise.all(o).then(()=>n):n}});function Ki(e,t,n,i,r,o){let a=n in i;if(e.issues.length){if(r&&o&&!a)return;t.issues.push(...j.prefixIssues(n,e.issues))}if(!a&&!r){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?a&&(t.value[n]=void 0):t.value[n]=e.value}function Wu(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let n=j.optionalKeys(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Bu(e,t,n,i,r,o){let a=[],s=r.keySet,c=r.catchall._zod,l=c.def.type,_=c.optin==="optional",u=c.optout==="optional";for(let f in t){if(f==="__proto__"||s.has(f))continue;if(l==="never"){a.push(f);continue}let p=c.run({value:t[f],issues:[]},i);p instanceof Promise?e.push(p.then(y=>Ki(y,n,f,t,_,u))):Ki(p,n,f,t,_,u)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}g.$ZodObject=x.$constructor("$ZodObject",(e,t)=>{if(g.$ZodType.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}let i=j.cached(()=>Wu(t));j.defineLazy(e._zod,"propValues",()=>{let s=t.shape,c={};for(let l in s){let _=s[l]._zod;if(_.values){c[l]??(c[l]=new Set);for(let u of _.values)c[l].add(u)}}return c});let r=j.isObject,o=t.catchall,a;e._zod.parse=(s,c)=>{a??(a=i.value);let l=s.value;if(!r(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};let _=[],u=a.shape;for(let f of a.keys){let p=u[f],y=p._zod.optin==="optional",v=p._zod.optout==="optional",h=p._zod.run({value:l[f],issues:[]},c);h instanceof Promise?_.push(h.then(O=>Ki(O,s,f,l,y,v))):Ki(h,s,f,l,y,v)}return o?Bu(_,l,s,c,i.value,e):_.length?Promise.all(_).then(()=>s):s}});g.$ZodObjectJIT=x.$constructor("$ZodObjectJIT",(e,t)=>{g.$ZodObject.init(e,t);let n=e._zod.parse,i=j.cached(()=>Wu(t)),r=f=>{let p=new gy.Doc(["shape","payload","ctx"]),y=i.value,v=D=>{let b=j.esc(D);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");let h=Object.create(null),O=0;for(let D of y.keys)h[D]=`key_${O++}`;p.write("const newResult = {};");for(let D of y.keys){let b=h[D],E=j.esc(D),A=f[D],R=A?._zod?.optin==="optional",I=A?._zod?.optout==="optional";p.write(`const ${b} = ${v(D)};`),R&&I?p.write(`
|
|
5
|
+
if (${b}.issues.length) {
|
|
6
|
+
if (${E} in input) {
|
|
7
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
8
|
+
...iss,
|
|
9
|
+
path: iss.path ? [${E}, ...iss.path] : [${E}]
|
|
10
|
+
})));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (${b}.value === undefined) {
|
|
15
|
+
if (${E} in input) {
|
|
16
|
+
newResult[${E}] = undefined;
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
newResult[${E}] = ${b}.value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`):R?p.write(`
|
|
23
|
+
if (${b}.issues.length) {
|
|
24
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
25
|
+
...iss,
|
|
26
|
+
path: iss.path ? [${E}, ...iss.path] : [${E}]
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${b}.value === undefined) {
|
|
31
|
+
if (${E} in input) {
|
|
32
|
+
newResult[${E}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${E}] = ${b}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`):p.write(`
|
|
39
|
+
const ${b}_present = ${E} in input;
|
|
40
|
+
if (${b}.issues.length) {
|
|
41
|
+
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
42
|
+
...iss,
|
|
43
|
+
path: iss.path ? [${E}, ...iss.path] : [${E}]
|
|
44
|
+
})));
|
|
45
|
+
}
|
|
46
|
+
if (!${b}_present && !${b}.issues.length) {
|
|
47
|
+
payload.issues.push({
|
|
48
|
+
code: "invalid_type",
|
|
49
|
+
expected: "nonoptional",
|
|
50
|
+
input: undefined,
|
|
51
|
+
path: [${E}]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (${b}_present) {
|
|
56
|
+
if (${b}.value === undefined) {
|
|
57
|
+
newResult[${E}] = undefined;
|
|
58
|
+
} else {
|
|
59
|
+
newResult[${E}] = ${b}.value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");let C=p.compile();return(D,b)=>C(f,D,b)},o,a=j.isObject,s=!x.globalConfig.jitless,c=j.allowsEval,l=s&&c.value,_=t.catchall,u;e._zod.parse=(f,p)=>{u??(u=i.value);let y=f.value;return a(y)?s&&l&&p?.async===!1&&p.jitless!==!0?(o||(o=r(t.shape)),f=o(f,p),_?Bu([],y,f,p,u,e):f):n(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),f)}});function Nu(e,t,n,i){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let r=e.filter(o=>!j.aborted(o));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(a=>j.finalizeIssue(a,i,x.config())))}),t)}g.$ZodUnion=x.$constructor("$ZodUnion",(e,t)=>{g.$ZodType.init(e,t),j.defineLazy(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),j.defineLazy(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),j.defineLazy(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),j.defineLazy(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>j.cleanRegex(r.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,a=[];for(let s of t.options){let c=s._zod.run({value:i.value,issues:[]},r);if(c instanceof Promise)a.push(c),o=!0;else{if(c.issues.length===0)return c;a.push(c)}}return o?Promise.all(a).then(s=>Nu(s,i,e,r)):Nu(a,i,e,r)}});function Cu(e,t,n,i){let r=e.filter(o=>o.issues.length===0);return r.length===1?(t.value=r[0].value,t):(r.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(a=>j.finalizeIssue(a,i,x.config())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}g.$ZodXor=x.$constructor("$ZodXor",(e,t)=>{g.$ZodUnion.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,a=[];for(let s of t.options){let c=s._zod.run({value:i.value,issues:[]},r);c instanceof Promise?(a.push(c),o=!0):a.push(c)}return o?Promise.all(a).then(s=>Cu(s,i,e,r)):Cu(a,i,e,r)}});g.$ZodDiscriminatedUnion=x.$constructor("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,g.$ZodUnion.init(e,t);let n=e._zod.parse;j.defineLazy(e._zod,"propValues",()=>{let r={};for(let o of t.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[s,c]of Object.entries(a)){r[s]||(r[s]=new Set);for(let l of c)r[s].add(l)}}return r});let i=j.cached(()=>{let r=t.options,o=new Map;for(let a of r){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of s){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,a)}}return o});e._zod.parse=(r,o)=>{let a=r.value;if(!j.isObject(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;let s=i.value.get(a?.[t.discriminator]);return s?s._zod.run(r,o):t.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()),input:a,path:[t.discriminator],inst:e}),r)}});g.$ZodIntersection=x.$constructor("$ZodIntersection",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>{let r=n.value,o=t.left._zod.run({value:r,issues:[]},i),a=t.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,l])=>Ru(n,c,l)):Ru(n,o,a)}});function Zs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(j.isPlainObject(e)&&j.isPlainObject(t)){let n=Object.keys(t),i=Object.keys(e).filter(o=>n.indexOf(o)!==-1),r={...e,...t};for(let o of i){let a=Zs(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r[o]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<e.length;i++){let r=e[i],o=t[i],a=Zs(r,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ru(e,t,n){let i=new Map,r;for(let s of t.issues)if(s.code==="unrecognized_keys"){r??(r=s);for(let c of s.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else e.issues.push(s);for(let s of n.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else e.issues.push(s);let o=[...i].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&r&&e.issues.push({...r,keys:o}),j.aborted(e))return e;let a=Zs(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}g.$ZodTuple=x.$constructor("$ZodTuple",(e,t)=>{g.$ZodType.init(e,t);let n=t.items;e._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],s=Lu(n,"optin"),c=Lu(n,"optout");if(!t.rest){if(o.length<s)return i.issues.push({code:"too_small",minimum:s,inclusive:!0,input:o,inst:e,origin:"array"}),i;o.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:e,origin:"array"})}let l=new Array(n.length);for(let _=0;_<n.length;_++){let u=n[_]._zod.run({value:o[_],issues:[]},r);u instanceof Promise?a.push(u.then(f=>{l[_]=f})):l[_]=u}if(t.rest){let _=n.length-1,u=o.slice(n.length);for(let f of u){_++;let p=t.rest._zod.run({value:f,issues:[]},r);p instanceof Promise?a.push(p.then(y=>Mu(y,i,_))):Mu(p,i,_)}}return a.length?Promise.all(a).then(()=>Uu(l,i,n,o,c)):Uu(l,i,n,o,c)}});function Lu(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!=="optional")return n+1;return 0}function Mu(e,t,n){e.issues.length&&t.issues.push(...j.prefixIssues(n,e.issues)),t.value[n]=e.value}function Uu(e,t,n,i,r){for(let o=0;o<n.length;o++){let a=e[o],s=o<i.length;if(a.issues.length){if(!s&&o>=r){t.value.length=o;break}t.issues.push(...j.prefixIssues(o,a.issues))}t.value[o]=a.value}for(let o=t.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&t.value[o]===void 0);o--)t.value.length=o;return t}g.$ZodRecord=x.$constructor("$ZodRecord",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;if(!j.isPlainObject(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let o=[],a=t.keyType._zod.values;if(a){n.value={};let s=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){s.add(typeof l=="number"?l.toString():l);let _=t.keyType._zod.run({value:l,issues:[]},i);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(_.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:_.issues.map(p=>j.finalizeIssue(p,i,x.config())),input:l,path:[l],inst:e});continue}let u=_.value,f=t.valueType._zod.run({value:r[l],issues:[]},i);f instanceof Promise?o.push(f.then(p=>{p.issues.length&&n.issues.push(...j.prefixIssues(l,p.issues)),n.value[u]=p.value})):(f.issues.length&&n.issues.push(...j.prefixIssues(l,f.issues)),n.value[u]=f.value)}let c;for(let l in r)s.has(l)||(c=c??[],c.push(l));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:c})}else{n.value={};for(let s of Reflect.ownKeys(r)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Ee.number.test(s)&&c.issues.length){let u=t.keyType._zod.run({value:Number(s),issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");u.issues.length===0&&(c=u)}if(c.issues.length){t.mode==="loose"?n.value[s]=r[s]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(u=>j.finalizeIssue(u,i,x.config())),input:s,path:[s],inst:e});continue}let _=t.valueType._zod.run({value:r[s],issues:[]},i);_ instanceof Promise?o.push(_.then(u=>{u.issues.length&&n.issues.push(...j.prefixIssues(s,u.issues)),n.value[c.value]=u.value})):(_.issues.length&&n.issues.push(...j.prefixIssues(s,_.issues)),n.value[c.value]=_.value)}}return o.length?Promise.all(o).then(()=>n):n}});g.$ZodMap=x.$constructor("$ZodMap",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let o=[];n.value=new Map;for(let[a,s]of r){let c=t.keyType._zod.run({value:a,issues:[]},i),l=t.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([_,u])=>{Pu(_,u,n,a,r,e,i)})):Pu(c,l,n,a,r,e,i)}return o.length?Promise.all(o).then(()=>n):n}});function Pu(e,t,n,i,r,o,a){e.issues.length&&(j.propertyKeyTypes.has(typeof i)?n.issues.push(...j.prefixIssues(i,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:e.issues.map(s=>j.finalizeIssue(s,a,x.config()))})),t.issues.length&&(j.propertyKeyTypes.has(typeof i)?n.issues.push(...j.prefixIssues(i,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:t.issues.map(s=>j.finalizeIssue(s,a,x.config()))})),n.value.set(e.value,t.value)}g.$ZodSet=x.$constructor("$ZodSet",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let o=[];n.value=new Set;for(let a of r){let s=t.valueType._zod.run({value:a,issues:[]},i);s instanceof Promise?o.push(s.then(c=>xu(c,n))):xu(s,n)}return o.length?Promise.all(o).then(()=>n):n}});function xu(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}g.$ZodEnum=x.$constructor("$ZodEnum",(e,t)=>{g.$ZodType.init(e,t);let n=j.getEnumValues(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(r=>j.propertyKeyTypes.has(typeof r)).map(r=>typeof r=="string"?j.escapeRegex(r):r.toString()).join("|")})$`),e._zod.parse=(r,o)=>{let a=r.value;return i.has(a)||r.issues.push({code:"invalid_value",values:n,input:a,inst:e}),r}});g.$ZodLiteral=x.$constructor("$ZodLiteral",(e,t)=>{if(g.$ZodType.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?j.escapeRegex(i):i?j.escapeRegex(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}});g.$ZodFile=x.$constructor("$ZodFile",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}});g.$ZodTransform=x.$constructor("$ZodTransform",(e,t)=>{g.$ZodType.init(e,t),e._zod.optin="optional",e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new x.$ZodEncodeError(e.constructor.name);let r=t.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(a=>(n.value=a,n.fallback=!0,n));if(r instanceof Promise)throw new x.$ZodAsyncError;return n.value=r,n.fallback=!0,n}});function ju(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}g.$ZodOptional=x.$constructor("$ZodOptional",(e,t)=>{g.$ZodType.init(e,t),e._zod.optin="optional",e._zod.optout="optional",j.defineLazy(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),j.defineLazy(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${j.cleanRegex(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){let r=n.value,o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(a=>ju(a,r)):ju(o,r)}return n.value===void 0?n:t.innerType._zod.run(n,i)}});g.$ZodExactOptional=x.$constructor("$ZodExactOptional",(e,t)=>{g.$ZodOptional.init(e,t),j.defineLazy(e._zod,"values",()=>t.innerType._zod.values),j.defineLazy(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)});g.$ZodNullable=x.$constructor("$ZodNullable",(e,t)=>{g.$ZodType.init(e,t),j.defineLazy(e._zod,"optin",()=>t.innerType._zod.optin),j.defineLazy(e._zod,"optout",()=>t.innerType._zod.optout),j.defineLazy(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${j.cleanRegex(n.source)}|null)$`):void 0}),j.defineLazy(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)});g.$ZodDefault=x.$constructor("$ZodDefault",(e,t)=>{g.$ZodType.init(e,t),e._zod.optin="optional",j.defineLazy(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>Du(o,t)):Du(r,t)}});function Du(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}g.$ZodPrefault=x.$constructor("$ZodPrefault",(e,t)=>{g.$ZodType.init(e,t),e._zod.optin="optional",j.defineLazy(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))});g.$ZodNonOptional=x.$constructor("$ZodNonOptional",(e,t)=>{g.$ZodType.init(e,t),j.defineLazy(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>zu(o,e)):zu(r,e)}});function zu(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}g.$ZodSuccess=x.$constructor("$ZodSuccess",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new x.$ZodEncodeError("ZodSuccess");let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}});g.$ZodCatch=x.$constructor("$ZodCatch",(e,t)=>{g.$ZodType.init(e,t),e._zod.optin="optional",j.defineLazy(e._zod,"optout",()=>t.innerType._zod.optout),j.defineLazy(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(a=>j.finalizeIssue(a,i,x.config()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(o=>j.finalizeIssue(o,i,x.config()))},input:n.value}),n.issues=[],n.fallback=!0),n)}});g.$ZodNaN=x.$constructor("$ZodNaN",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)});g.$ZodPipe=x.$constructor("$ZodPipe",(e,t)=>{g.$ZodType.init(e,t),j.defineLazy(e._zod,"values",()=>t.in._zod.values),j.defineLazy(e._zod,"optin",()=>t.in._zod.optin),j.defineLazy(e._zod,"optout",()=>t.out._zod.optout),j.defineLazy(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(a=>Bi(a,t.in,i)):Bi(o,t.in,i)}let r=t.in._zod.run(n,i);return r instanceof Promise?r.then(o=>Bi(o,t.out,i)):Bi(r,t.out,i)}});function Bi(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}g.$ZodCodec=x.$constructor("$ZodCodec",(e,t)=>{g.$ZodType.init(e,t),j.defineLazy(e._zod,"values",()=>t.in._zod.values),j.defineLazy(e._zod,"optin",()=>t.in._zod.optin),j.defineLazy(e._zod,"optout",()=>t.out._zod.optout),j.defineLazy(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=t.in._zod.run(n,i);return o instanceof Promise?o.then(a=>Hi(a,t,i)):Hi(o,t,i)}else{let o=t.out._zod.run(n,i);return o instanceof Promise?o.then(a=>Hi(a,t,i)):Hi(o,t,i)}}});function Hi(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(o=>Ji(e,o,t.out,n)):Ji(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(o=>Ji(e,o,t.in,n)):Ji(e,r,t.in,n)}}function Ji(e,t,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},i)}g.$ZodPreprocess=x.$constructor("$ZodPreprocess",(e,t)=>{g.$ZodPipe.init(e,t)});g.$ZodReadonly=x.$constructor("$ZodReadonly",(e,t)=>{g.$ZodType.init(e,t),j.defineLazy(e._zod,"propValues",()=>t.innerType._zod.propValues),j.defineLazy(e._zod,"values",()=>t.innerType._zod.values),j.defineLazy(e._zod,"optin",()=>t.innerType?._zod?.optin),j.defineLazy(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);let r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(Fu):Fu(r)}});function Fu(e){return e.value=Object.freeze(e.value),e}g.$ZodTemplateLiteral=x.$constructor("$ZodTemplateLiteral",(e,t)=>{g.$ZodType.init(e,t);let n=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let r=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=r.startsWith("^")?1:0,a=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(o,a))}else if(i===null||j.primitiveTypes.has(typeof i))n.push(j.escapeRegex(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)});g.$ZodFunction=x.$constructor("$ZodFunction",(e,t)=>(g.$ZodType.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...i){let r=e._def.input?(0,br.parse)(e._def.input,i):i,o=Reflect.apply(n,this,r);return e._def.output?(0,br.parse)(e._def.output,o):o}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let r=e._def.input?await(0,br.parseAsync)(e._def.input,i):i,o=await Reflect.apply(n,this,r);return e._def.output?await(0,br.parseAsync)(e._def.output,o):o}},e._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let i=e.constructor;return Array.isArray(n[0])?new i({type:"function",input:new g.$ZodTuple({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new i({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:n})},e));g.$ZodPromise=x.$constructor("$ZodPromise",(e,t)=>{g.$ZodType.init(e,t),e._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},i))});g.$ZodLazy=x.$constructor("$ZodLazy",(e,t)=>{g.$ZodType.init(e,t),j.defineLazy(e._zod,"innerType",()=>{let n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),j.defineLazy(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),j.defineLazy(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),j.defineLazy(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),j.defineLazy(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,i)=>e._zod.innerType._zod.run(n,i)});g.$ZodCustom=x.$constructor("$ZodCustom",(e,t)=>{Gi.$ZodCheck.init(e,t),g.$ZodType.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{let i=n.value,r=t.fn(i);if(r instanceof Promise)return r.then(o=>Zu(o,n,i,e));Zu(r,n,i,e)}});function Zu(e,t,n,i){if(!e){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),t.issues.push(j.issue(r))}}});var Ju=k((Lt,Hu)=>{"use strict";var yy=Lt&&Lt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),by=Lt&&Lt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Sy=Lt&&Lt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&yy(t,e,n);return by(t,e),t};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.default=ky;var Yi=Sy(G()),Ey=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Yi.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Yi.stringifyPrimitive(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Yi.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${n[o.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${Yi.joinValues(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function ky(){return{localeError:Ey()}}Hu.exports=Lt.default});var Xu=k((Mt,Ku)=>{"use strict";var Oy=Mt&&Mt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),wy=Mt&&Mt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Ay=Mt&&Mt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Oy(t,e,n);return wy(t,e),t};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.default=$y;var Qi=Ay(G()),Ty=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Qi.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${s}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Qi.stringifyPrimitive(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Qi.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${Qi.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function $y(){return{localeError:Ty()}}Ku.exports=Mt.default});var Qu=k((Ut,Yu)=>{"use strict";var Iy=Ut&&Ut.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Ny=Ut&&Ut.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Cy=Ut&&Ut.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Iy(t,e,n);return Ny(t,e),t};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.default=Ly;var eo=Cy(G());function Gu(e,t,n,i){let r=Math.abs(e),o=r%10,a=r%100;return a>=11&&a<=19?i:o===1?t:o>=2&&o<=4?n:i}var Ry=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=eo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${eo.stringifyPrimitive(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${eo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=Gu(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${r.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=Gu(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${r.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${eo.joinValues(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function Ly(){return{localeError:Ry()}}Yu.exports=Ut.default});var td=k((Pt,ed)=>{"use strict";var My=Pt&&Pt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Uy=Pt&&Pt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Py=Pt&&Pt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&My(t,e,n);return Uy(t,e),t};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.default=jy;var to=Py(G()),xy=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=to.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${to.stringifyPrimitive(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${to.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${to.joinValues(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function jy(){return{localeError:xy()}}ed.exports=Pt.default});var rd=k((xt,nd)=>{"use strict";var Dy=xt&&xt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),zy=xt&&xt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Fy=xt&&xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Dy(t,e,n);return zy(t,e),t};Object.defineProperty(xt,"__esModule",{value:!0});xt.default=qy;var no=Fy(G()),Zy=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=no.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${s}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${no.stringifyPrimitive(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${no.joinValues(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",a=t(r.origin);return a?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(r.origin);return a?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${no.joinValues(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function qy(){return{localeError:Zy()}}nd.exports=xt.default});var od=k((jt,id)=>{"use strict";var Vy=jt&&jt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Wy=jt&&jt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),By=jt&&jt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Vy(t,e,n);return Wy(t,e),t};Object.defineProperty(jt,"__esModule",{value:!0});jt.default=Jy;var ro=By(G()),Hy=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=ro.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${s}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${ro.stringifyPrimitive(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${ro.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${ro.joinValues(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function Jy(){return{localeError:Hy()}}id.exports=jt.default});var sd=k((Dt,ad)=>{"use strict";var Ky=Dt&&Dt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Xy=Dt&&Dt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Gy=Dt&&Dt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Ky(t,e,n);return Xy(t,e),t};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.default=Qy;var io=Gy(G()),Yy=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=io.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${s}`:`Ugyldigt input: forventede ${o}, fik ${s}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${io.stringifyPrimitive(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${io.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin),s=i[r.origin]??r.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${o} ${r.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin),s=i[r.origin]??r.origin;return a?`For lille: forventede ${s} ${a.verb} ${o} ${r.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${io.joinValues(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}};function Qy(){return{localeError:Yy()}}ad.exports=Dt.default});var ld=k((zt,cd)=>{"use strict";var eb=zt&&zt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),tb=zt&&zt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),nb=zt&&zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&eb(t,e,n);return tb(t,e),t};Object.defineProperty(zt,"__esModule",{value:!0});zt.default=ib;var oo=nb(G()),rb=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=oo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${s}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${oo.stringifyPrimitive(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${oo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${oo.joinValues(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function ib(){return{localeError:rb()}}cd.exports=zt.default});var dd=k((Ft,ud)=>{"use strict";var ob=Ft&&Ft.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),ab=Ft&&Ft.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),sb=Ft&&Ft.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&ob(t,e,n);return ab(t,e),t};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.default=lb;var ao=sb(G()),cb=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(r){return e[r]??null}let n={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=ao.parsedType(r.input),s=i[a]??a;return typeof r.expected=="string"&&/^[A-Z]/.test(r.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${r.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return r.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${ao.stringifyPrimitive(r.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${ao.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${o.prefix}"`:o.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${o.suffix}"`:o.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${o.includes}"`:o.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${ao.joinValues(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function lb(){return{localeError:cb()}}ud.exports=Ft.default});var Ws=k((Zt,_d)=>{"use strict";var ub=Zt&&Zt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),db=Zt&&Zt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),_b=Zt&&Zt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&ub(t,e,n);return db(t,e),t};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.default=pb;var so=_b(G()),fb=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=so.parsedType(r.input),s=i[a]??a;return`Invalid input: expected ${o}, received ${s}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${so.stringifyPrimitive(r.values[0])}`:`Invalid option: expected one of ${so.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${a.unit}`:`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${so.joinValues(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function pb(){return{localeError:fb()}}_d.exports=Zt.default});var pd=k((qt,fd)=>{"use strict";var mb=qt&&qt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),gb=qt&&qt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),hb=qt&&qt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&mb(t,e,n);return gb(t,e),t};Object.defineProperty(qt,"__esModule",{value:!0});qt.default=yb;var co=hb(G()),vb=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=co.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${s}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${co.stringifyPrimitive(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${co.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${co.joinValues(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function yb(){return{localeError:vb()}}fd.exports=qt.default});var gd=k((Vt,md)=>{"use strict";var bb=Vt&&Vt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Sb=Vt&&Vt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Eb=Vt&&Vt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&bb(t,e,n);return Sb(t,e),t};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.default=Ob;var lo=Eb(G()),kb=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=lo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${s}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${lo.stringifyPrimitive(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${lo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin),s=i[r.origin]??r.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${o}${r.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin),s=i[r.origin]??r.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${o}${r.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${lo.joinValues(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}};function Ob(){return{localeError:kb()}}md.exports=Vt.default});var vd=k((Wt,hd)=>{"use strict";var wb=Wt&&Wt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Ab=Wt&&Wt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Tb=Wt&&Wt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&wb(t,e,n);return Ab(t,e),t};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.default=Ib;var uo=Tb(G()),$b=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=uo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${uo.stringifyPrimitive(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${uo.joinValues(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${uo.joinValues(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Ib(){return{localeError:$b()}}hd.exports=Wt.default});var bd=k((Bt,yd)=>{"use strict";var Nb=Bt&&Bt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Cb=Bt&&Bt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Rb=Bt&&Bt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Nb(t,e,n);return Cb(t,e),t};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.default=Mb;var _o=Rb(G()),Lb=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=_o.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${s}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${_o.stringifyPrimitive(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${_o.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${_o.joinValues(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function Mb(){return{localeError:Lb()}}yd.exports=Bt.default});var Ed=k((Ht,Sd)=>{"use strict";var Ub=Ht&&Ht.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Pb=Ht&&Ht.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),xb=Ht&&Ht.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Ub(t,e,n);return Pb(t,e),t};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.default=Db;var fo=xb(G()),jb=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=fo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${s} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${fo.stringifyPrimitive(r.values[0])} attendu`:`Option invalide : une valeur parmi ${fo.joinValues(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Trop grand : ${i[r.origin]??"valeur"} doit ${a.verb} ${o}${r.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Trop petit : ${i[r.origin]??"valeur"} doit ${a.verb} ${o}${r.minimum.toString()} ${a.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${fo.joinValues(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function Db(){return{localeError:jb()}}Sd.exports=Ht.default});var Od=k((Jt,kd)=>{"use strict";var zb=Jt&&Jt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Fb=Jt&&Jt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Zb=Jt&&Jt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&zb(t,e,n);return Fb(t,e),t};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.default=Vb;var po=Zb(G()),qb=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=po.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${s}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${po.stringifyPrimitive(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${po.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",a=t(r.origin);return a?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",a=t(r.origin);return a?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${po.joinValues(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function Vb(){return{localeError:qb()}}kd.exports=Jt.default});var Ad=k((Kt,wd)=>{"use strict";var Wb=Kt&&Kt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Bb=Kt&&Kt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Hb=Kt&&Kt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Wb(t,e,n);return Bb(t,e),t};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.default=Kb;var mo=Hb(G()),Jb=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=l=>l?e[l]:void 0,i=l=>{let _=n(l);return _?_.label:l??e.unknown.label},r=l=>`\u05D4${i(l)}`,o=l=>(n(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=l=>l?t[l]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let _=l.expected,u=c[_??""]??i(_),f=mo.parsedType(l.input),p=c[f]??e[f]?.label??f;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${u}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${mo.stringifyPrimitive(l.values[0])}`;let _=l.values.map(p=>mo.stringifyPrimitive(p));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${_[0]} \u05D0\u05D5 ${_[1]}`;let u=_[_.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${_.slice(0,-1).join(", ")} \u05D0\u05D5 ${u}`}case"too_big":{let _=a(l.origin),u=r(l.origin??"value");if(l.origin==="string")return`${_?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${u} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${_?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let y=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${u} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${y}`}if(l.origin==="array"||l.origin==="set"){let y=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",v=l.inclusive?`${l.maximum} ${_?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${_?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${u} ${y} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`.trim()}let f=l.inclusive?"<=":"<",p=o(l.origin??"value");return _?.unit?`${_.longLabel} \u05DE\u05D3\u05D9: ${u} ${p} ${f}${l.maximum.toString()} ${_.unit}`:`${_?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${u} ${p} ${f}${l.maximum.toString()}`}case"too_small":{let _=a(l.origin),u=r(l.origin??"value");if(l.origin==="string")return`${_?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${u} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${_?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let y=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${u} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${y}`}if(l.origin==="array"||l.origin==="set"){let y=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let h=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${u} ${y} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`}let v=l.inclusive?`${l.minimum} ${_?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${_?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${u} ${y} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`.trim()}let f=l.inclusive?">=":">",p=o(l.origin??"value");return _?.unit?`${_.shortLabel} \u05DE\u05D3\u05D9: ${u} ${p} ${f}${l.minimum.toString()} ${_.unit}`:`${_?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${u} ${p} ${f}${l.minimum.toString()}`}case"invalid_format":{let _=l;if(_.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${_.prefix}"`;if(_.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${_.suffix}"`;if(_.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${_.includes}"`;if(_.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${_.pattern}`;let u=s[_.format],f=u?.label??_.format,y=(u?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${y}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${mo.joinValues(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Kb(){return{localeError:Jb()}}wd.exports=Kt.default});var $d=k((Xt,Td)=>{"use strict";var Xb=Xt&&Xt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Gb=Xt&&Xt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Yb=Xt&&Xt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Xb(t,e,n);return Gb(t,e),t};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.default=eS;var go=Yb(G()),Qb=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(r){return e[r]??null}let n={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=go.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${s}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${go.stringifyPrimitive(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${go.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin),s=i[r.origin]??r.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${o}${r.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin),s=i[r.origin]??r.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${o}${r.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${go.joinValues(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}};function eS(){return{localeError:Qb()}}Td.exports=Xt.default});var Nd=k((Gt,Id)=>{"use strict";var tS=Gt&&Gt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),nS=Gt&&Gt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),rS=Gt&&Gt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&tS(t,e,n);return nS(t,e),t};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.default=oS;var ho=rS(G()),iS=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=ho.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${ho.stringifyPrimitive(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${ho.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${ho.joinValues(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function oS(){return{localeError:iS()}}Id.exports=Gt.default});var Ld=k((Yt,Rd)=>{"use strict";var aS=Yt&&Yt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),sS=Yt&&Yt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),cS=Yt&&Yt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&aS(t,e,n);return sS(t,e),t};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.default=uS;var vo=cS(G());function Cd(e,t,n){return Math.abs(e)===1?t:n}function Sr(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}var lS=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(r){return e[r]??null}let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=vo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${vo.stringifyPrimitive(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${vo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=Cd(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Sr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Sr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=Cd(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Sr(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Sr(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${vo.joinValues(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Sr(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Sr(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function uS(){return{localeError:lS()}}Rd.exports=Yt.default});var Ud=k((Qt,Md)=>{"use strict";var dS=Qt&&Qt.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),_S=Qt&&Qt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fS=Qt&&Qt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&dS(t,e,n);return _S(t,e),t};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.default=mS;var yo=fS(G()),pS=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=yo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${o}, diterima ${s}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${yo.stringifyPrimitive(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${yo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${yo.joinValues(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function mS(){return{localeError:pS()}}Md.exports=Qt.default});var xd=k((en,Pd)=>{"use strict";var gS=en&&en.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),hS=en&&en.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),vS=en&&en.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&gS(t,e,n);return hS(t,e),t};Object.defineProperty(en,"__esModule",{value:!0});en.default=bS;var bo=vS(G()),yS=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(r){return e[r]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=bo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${bo.stringifyPrimitive(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${bo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${bo.joinValues(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}};function bS(){return{localeError:yS()}}Pd.exports=en.default});var Dd=k((tn,jd)=>{"use strict";var SS=tn&&tn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),ES=tn&&tn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),kS=tn&&tn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&SS(t,e,n);return ES(t,e),t};Object.defineProperty(tn,"__esModule",{value:!0});tn.default=wS;var So=kS(G()),OS=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=So.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${s}`:`Input non valido: atteso ${o}, ricevuto ${s}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${So.stringifyPrimitive(r.values[0])}`:`Opzione non valida: atteso uno tra ${So.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${So.joinValues(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function wS(){return{localeError:OS()}}jd.exports=tn.default});var Fd=k((nn,zd)=>{"use strict";var AS=nn&&nn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),TS=nn&&nn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),$S=nn&&nn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&AS(t,e,n);return TS(t,e),t};Object.defineProperty(nn,"__esModule",{value:!0});nn.default=NS;var Eo=$S(G()),IS=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Eo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Eo.stringifyPrimitive(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Eo.joinValues(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(r.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(r.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${Eo.joinValues(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function NS(){return{localeError:IS()}}zd.exports=nn.default});var qd=k((rn,Zd)=>{"use strict";var CS=rn&&rn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),RS=rn&&rn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),LS=rn&&rn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&CS(t,e,n);return RS(t,e),t};Object.defineProperty(rn,"__esModule",{value:!0});rn.default=US;var ko=LS(G()),MS=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(r){return e[r]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=ko.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${ko.stringifyPrimitive(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${ko.joinValues(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${o}${r.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${a.verb} ${o}${r.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${ko.joinValues(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function US(){return{localeError:MS()}}Zd.exports=rn.default});var Bs=k((on,Vd)=>{"use strict";var PS=on&&on.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),xS=on&&on.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),jS=on&&on.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&PS(t,e,n);return xS(t,e),t};Object.defineProperty(on,"__esModule",{value:!0});on.default=zS;var Oo=jS(G()),DS=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Oo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Oo.stringifyPrimitive(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Oo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Oo.joinValues(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function zS(){return{localeError:DS()}}Vd.exports=on.default});var Bd=k((Er,Wd)=>{"use strict";var FS=Er&&Er.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Er,"__esModule",{value:!0});Er.default=qS;var ZS=FS(Bs());function qS(){return(0,ZS.default)()}Wd.exports=Er.default});var Jd=k((an,Hd)=>{"use strict";var VS=an&&an.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),WS=an&&an.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),BS=an&&an.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&VS(t,e,n);return WS(t,e),t};Object.defineProperty(an,"__esModule",{value:!0});an.default=JS;var wo=BS(G()),HS=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=wo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${wo.stringifyPrimitive(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${wo.joinValues(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(r.origin),c=s?.unit??"\uC694\uC18C";return s?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${c} ${o}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${a}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(r.origin),c=s?.unit??"\uC694\uC18C";return s?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${c} ${o}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${wo.joinValues(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function JS(){return{localeError:HS()}}Hd.exports=an.default});var Gd=k((sn,Xd)=>{"use strict";var KS=sn&&sn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),XS=sn&&sn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),GS=sn&&sn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&KS(t,e,n);return XS(t,e),t};Object.defineProperty(sn,"__esModule",{value:!0});sn.default=QS;var Ao=GS(G()),Wr=e=>e.charAt(0).toUpperCase()+e.slice(1);function Kd(e){let t=Math.abs(e),n=t%10,i=t%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}var YS=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(r,o,a,s){let c=e[r]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[s][a?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Ao.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${Ao.stringifyPrimitive(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${Ao.joinValues(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,a=t(r.origin,Kd(Number(r.maximum)),r.inclusive??!1,"smaller");if(a?.verb)return`${Wr(o??r.origin??"reik\u0161m\u0117")} ${a.verb} ${r.maximum.toString()} ${a.unit??"element\u0173"}`;let s=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Wr(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${r.maximum.toString()} ${a?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,a=t(r.origin,Kd(Number(r.minimum)),r.inclusive??!1,"bigger");if(a?.verb)return`${Wr(o??r.origin??"reik\u0161m\u0117")} ${a.verb} ${r.minimum.toString()} ${a.unit??"element\u0173"}`;let s=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Wr(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${r.minimum.toString()} ${a?.unit}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${Ao.joinValues(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${Wr(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function QS(){return{localeError:YS()}}Xd.exports=sn.default});var Qd=k((cn,Yd)=>{"use strict";var eE=cn&&cn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),tE=cn&&cn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),nE=cn&&cn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&eE(t,e,n);return tE(t,e),t};Object.defineProperty(cn,"__esModule",{value:!0});cn.default=iE;var To=nE(G()),rE=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=To.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${To.stringifyPrimitive(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${To.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${To.joinValues(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function iE(){return{localeError:rE()}}Yd.exports=cn.default});var t_=k((ln,e_)=>{"use strict";var oE=ln&&ln.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),aE=ln&&ln.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),sE=ln&&ln.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&oE(t,e,n);return aE(t,e),t};Object.defineProperty(ln,"__esModule",{value:!0});ln.default=lE;var $o=sE(G()),cE=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=$o.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${s}`:`Input tidak sah: dijangka ${o}, diterima ${s}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${$o.stringifyPrimitive(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${$o.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Terlalu besar: dijangka ${r.origin??"nilai"} ${a.verb} ${o}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Terlalu kecil: dijangka ${r.origin} ${a.verb} ${o}${r.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${$o.joinValues(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function lE(){return{localeError:cE()}}e_.exports=ln.default});var r_=k((un,n_)=>{"use strict";var uE=un&&un.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),dE=un&&un.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),_E=un&&un.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&uE(t,e,n);return dE(t,e),t};Object.defineProperty(un,"__esModule",{value:!0});un.default=pE;var Io=_E(G()),fE=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Io.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${o}, ontving ${s}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${Io.stringifyPrimitive(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Io.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin),s=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin),s=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${Io.joinValues(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function pE(){return{localeError:fE()}}n_.exports=un.default});var o_=k((dn,i_)=>{"use strict";var mE=dn&&dn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),gE=dn&&dn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),hE=dn&&dn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&mE(t,e,n);return gE(t,e),t};Object.defineProperty(dn,"__esModule",{value:!0});dn.default=yE;var No=hE(G()),vE=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=No.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${s}`:`Ugyldig input: forventet ${o}, fikk ${s}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${No.stringifyPrimitive(r.values[0])}`:`Ugyldig valg: forventet en av ${No.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${No.joinValues(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function yE(){return{localeError:vE()}}i_.exports=dn.default});var s_=k((_n,a_)=>{"use strict";var bE=_n&&_n.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),SE=_n&&_n.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),EE=_n&&_n.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&bE(t,e,n);return SE(t,e),t};Object.defineProperty(_n,"__esModule",{value:!0});_n.default=OE;var Co=EE(G()),kE=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Co.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${s}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${Co.stringifyPrimitive(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Co.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${Co.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function OE(){return{localeError:kE()}}a_.exports=_n.default});var l_=k((fn,c_)=>{"use strict";var wE=fn&&fn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),AE=fn&&fn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),TE=fn&&fn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&wE(t,e,n);return AE(t,e),t};Object.defineProperty(fn,"__esModule",{value:!0});fn.default=IE;var Ro=TE(G()),$E=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Ro.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Ro.stringifyPrimitive(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Ro.joinValues(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Ro.joinValues(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function IE(){return{localeError:$E()}}c_.exports=fn.default});var d_=k((pn,u_)=>{"use strict";var NE=pn&&pn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),CE=pn&&pn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),RE=pn&&pn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&NE(t,e,n);return CE(t,e),t};Object.defineProperty(pn,"__esModule",{value:!0});pn.default=ME;var Lo=RE(G()),LE=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Lo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${s}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Lo.stringifyPrimitive(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Lo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${Lo.joinValues(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function ME(){return{localeError:LE()}}u_.exports=pn.default});var f_=k((mn,__)=>{"use strict";var UE=mn&&mn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),PE=mn&&mn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),xE=mn&&mn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&UE(t,e,n);return PE(t,e),t};Object.defineProperty(mn,"__esModule",{value:!0});mn.default=DE;var Mo=xE(G()),jE=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Mo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${s}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${Mo.stringifyPrimitive(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Mo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${o}${r.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Muito pequeno: esperado que ${r.origin} tivesse ${o}${r.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${n[o.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${Mo.joinValues(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function DE(){return{localeError:jE()}}__.exports=mn.default});var m_=k((gn,p_)=>{"use strict";var zE=gn&&gn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),FE=gn&&gn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),ZE=gn&&gn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&zE(t,e,n);return FE(t,e),t};Object.defineProperty(gn,"__esModule",{value:!0});gn.default=VE;var Uo=ZE(G()),qE=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(r){return e[r]??null}let n={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Uo.parsedType(r.input),s=i[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${s}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${Uo.stringifyPrimitive(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${Uo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${a.verb} ${o}${r.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Prea mic: a\u0219teptat ca ${r.origin} ${a.verb} ${o}${r.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${Uo.joinValues(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}};function VE(){return{localeError:qE()}}p_.exports=gn.default});var v_=k((hn,h_)=>{"use strict";var WE=hn&&hn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),BE=hn&&hn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),HE=hn&&hn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&WE(t,e,n);return BE(t,e),t};Object.defineProperty(hn,"__esModule",{value:!0});hn.default=KE;var Po=HE(G());function g_(e,t,n,i){let r=Math.abs(e),o=r%10,a=r%100;return a>=11&&a<=19?i:o===1?t:o>=2&&o<=4?n:i}var JE=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Po.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Po.stringifyPrimitive(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Po.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);if(a){let s=Number(r.maximum),c=g_(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);if(a){let s=Number(r.minimum),c=g_(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${Po.joinValues(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function KE(){return{localeError:JE()}}h_.exports=hn.default});var b_=k((vn,y_)=>{"use strict";var XE=vn&&vn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),GE=vn&&vn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),YE=vn&&vn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&XE(t,e,n);return GE(t,e),t};Object.defineProperty(vn,"__esModule",{value:!0});vn.default=ek;var xo=YE(G()),QE=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=xo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${s}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${xo.stringifyPrimitive(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${xo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${xo.joinValues(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function ek(){return{localeError:QE()}}y_.exports=vn.default});var E_=k((yn,S_)=>{"use strict";var tk=yn&&yn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),nk=yn&&yn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),rk=yn&&yn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&tk(t,e,n);return nk(t,e),t};Object.defineProperty(yn,"__esModule",{value:!0});yn.default=ok;var jo=rk(G()),ik=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=jo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${s}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${jo.stringifyPrimitive(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${jo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${jo.joinValues(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function ok(){return{localeError:ik()}}S_.exports=yn.default});var O_=k((bn,k_)=>{"use strict";var ak=bn&&bn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),sk=bn&&bn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),ck=bn&&bn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&ak(t,e,n);return sk(t,e),t};Object.defineProperty(bn,"__esModule",{value:!0});bn.default=uk;var Do=ck(G()),lk=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Do.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Do.stringifyPrimitive(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Do.joinValues(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Do.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function uk(){return{localeError:lk()}}k_.exports=bn.default});var A_=k((Sn,w_)=>{"use strict";var dk=Sn&&Sn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),_k=Sn&&Sn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fk=Sn&&Sn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&dk(t,e,n);return _k(t,e),t};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.default=mk;var zo=fk(G()),pk=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=zo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${zo.stringifyPrimitive(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${zo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(r.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(r.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${zo.joinValues(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function mk(){return{localeError:pk()}}w_.exports=Sn.default});var $_=k((En,T_)=>{"use strict";var gk=En&&En.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),hk=En&&En.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),vk=En&&En.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&gk(t,e,n);return hk(t,e),t};Object.defineProperty(En,"__esModule",{value:!0});En.default=bk;var Fo=vk(G()),yk=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(r){return e[r]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Fo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${s}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Fo.stringifyPrimitive(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Fo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${Fo.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function bk(){return{localeError:yk()}}T_.exports=En.default});var Hs=k((kn,I_)=>{"use strict";var Sk=kn&&kn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Ek=kn&&kn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),kk=kn&&kn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Sk(t,e,n);return Ek(t,e),t};Object.defineProperty(kn,"__esModule",{value:!0});kn.default=wk;var Zo=kk(G()),Ok=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Zo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Zo.stringifyPrimitive(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Zo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${o}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${a.verb} ${o}${r.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${Zo.joinValues(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function wk(){return{localeError:Ok()}}I_.exports=kn.default});var C_=k((kr,N_)=>{"use strict";var Ak=kr&&kr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kr,"__esModule",{value:!0});kr.default=$k;var Tk=Ak(Hs());function $k(){return(0,Tk.default)()}N_.exports=kr.default});var L_=k((On,R_)=>{"use strict";var Ik=On&&On.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Nk=On&&On.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Ck=On&&On.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Ik(t,e,n);return Nk(t,e),t};Object.defineProperty(On,"__esModule",{value:!0});On.default=Lk;var qo=Ck(G()),Rk=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=qo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${qo.stringifyPrimitive(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${qo.joinValues(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${qo.joinValues(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Lk(){return{localeError:Rk()}}R_.exports=On.default});var U_=k((wn,M_)=>{"use strict";var Mk=wn&&wn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Uk=wn&&wn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Pk=wn&&wn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Mk(t,e,n);return Uk(t,e),t};Object.defineProperty(wn,"__esModule",{value:!0});wn.default=jk;var Vo=Pk(G()),xk=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(r){return e[r]??null}let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Vo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${s}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${Vo.stringifyPrimitive(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${Vo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${Vo.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function jk(){return{localeError:xk()}}M_.exports=wn.default});var x_=k((An,P_)=>{"use strict";var Dk=An&&An.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),zk=An&&An.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Fk=An&&An.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Dk(t,e,n);return zk(t,e),t};Object.defineProperty(An,"__esModule",{value:!0});An.default=qk;var Wo=Fk(G()),Zk=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Wo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Wo.stringifyPrimitive(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Wo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${r.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${a.verb} ${o}${r.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Wo.joinValues(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function qk(){return{localeError:Zk()}}P_.exports=An.default});var D_=k((Tn,j_)=>{"use strict";var Vk=Tn&&Tn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Wk=Tn&&Tn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Bk=Tn&&Tn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Vk(t,e,n);return Wk(t,e),t};Object.defineProperty(Tn,"__esModule",{value:!0});Tn.default=Jk;var Bo=Bk(G()),Hk=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Bo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Bo.stringifyPrimitive(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Bo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Bo.joinValues(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Jk(){return{localeError:Hk()}}j_.exports=Tn.default});var F_=k(($n,z_)=>{"use strict";var Kk=$n&&$n.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),Xk=$n&&$n.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Gk=$n&&$n.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Kk(t,e,n);return Xk(t,e),t};Object.defineProperty($n,"__esModule",{value:!0});$n.default=Qk;var Ho=Gk(G()),Yk=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Ho.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Ho.stringifyPrimitive(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Ho.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${Ho.joinValues(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Qk(){return{localeError:Yk()}}z_.exports=$n.default});var q_=k((In,Z_)=>{"use strict";var eO=In&&In.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),tO=In&&In.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),nO=In&&In.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&eO(t,e,n);return tO(t,e),t};Object.defineProperty(In,"__esModule",{value:!0});In.default=iO;var Jo=nO(G()),rO=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,a=Jo.parsedType(r.input),s=i[a]??a;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${Jo.stringifyPrimitive(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${Jo.joinValues(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",a=t(r.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${a.verb} ${o}${r.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",a=t(r.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${a.verb} ${o}${r.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${Jo.joinValues(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function iO(){return{localeError:rO()}}Z_.exports=In.default});var Js=k(N=>{"use strict";var ie=N&&N.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(N,"__esModule",{value:!0});N.zhCN=N.vi=N.uz=N.ur=N.uk=N.ua=N.tr=N.th=N.ta=N.sv=N.sl=N.ru=N.ro=N.pt=N.pl=N.ps=N.ota=N.no=N.nl=N.ms=N.mk=N.lt=N.ko=N.km=N.kh=N.ka=N.ja=N.it=N.is=N.id=N.hy=N.hu=N.hr=N.he=N.frCA=N.fr=N.fi=N.fa=N.es=N.eo=N.en=N.el=N.de=N.da=N.cs=N.ca=N.bg=N.be=N.az=N.ar=void 0;N.yo=N.zhTW=void 0;var oO=Ju();Object.defineProperty(N,"ar",{enumerable:!0,get:function(){return ie(oO).default}});var aO=Xu();Object.defineProperty(N,"az",{enumerable:!0,get:function(){return ie(aO).default}});var sO=Qu();Object.defineProperty(N,"be",{enumerable:!0,get:function(){return ie(sO).default}});var cO=td();Object.defineProperty(N,"bg",{enumerable:!0,get:function(){return ie(cO).default}});var lO=rd();Object.defineProperty(N,"ca",{enumerable:!0,get:function(){return ie(lO).default}});var uO=od();Object.defineProperty(N,"cs",{enumerable:!0,get:function(){return ie(uO).default}});var dO=sd();Object.defineProperty(N,"da",{enumerable:!0,get:function(){return ie(dO).default}});var _O=ld();Object.defineProperty(N,"de",{enumerable:!0,get:function(){return ie(_O).default}});var fO=dd();Object.defineProperty(N,"el",{enumerable:!0,get:function(){return ie(fO).default}});var pO=Ws();Object.defineProperty(N,"en",{enumerable:!0,get:function(){return ie(pO).default}});var mO=pd();Object.defineProperty(N,"eo",{enumerable:!0,get:function(){return ie(mO).default}});var gO=gd();Object.defineProperty(N,"es",{enumerable:!0,get:function(){return ie(gO).default}});var hO=vd();Object.defineProperty(N,"fa",{enumerable:!0,get:function(){return ie(hO).default}});var vO=bd();Object.defineProperty(N,"fi",{enumerable:!0,get:function(){return ie(vO).default}});var yO=Ed();Object.defineProperty(N,"fr",{enumerable:!0,get:function(){return ie(yO).default}});var bO=Od();Object.defineProperty(N,"frCA",{enumerable:!0,get:function(){return ie(bO).default}});var SO=Ad();Object.defineProperty(N,"he",{enumerable:!0,get:function(){return ie(SO).default}});var EO=$d();Object.defineProperty(N,"hr",{enumerable:!0,get:function(){return ie(EO).default}});var kO=Nd();Object.defineProperty(N,"hu",{enumerable:!0,get:function(){return ie(kO).default}});var OO=Ld();Object.defineProperty(N,"hy",{enumerable:!0,get:function(){return ie(OO).default}});var wO=Ud();Object.defineProperty(N,"id",{enumerable:!0,get:function(){return ie(wO).default}});var AO=xd();Object.defineProperty(N,"is",{enumerable:!0,get:function(){return ie(AO).default}});var TO=Dd();Object.defineProperty(N,"it",{enumerable:!0,get:function(){return ie(TO).default}});var $O=Fd();Object.defineProperty(N,"ja",{enumerable:!0,get:function(){return ie($O).default}});var IO=qd();Object.defineProperty(N,"ka",{enumerable:!0,get:function(){return ie(IO).default}});var NO=Bd();Object.defineProperty(N,"kh",{enumerable:!0,get:function(){return ie(NO).default}});var CO=Bs();Object.defineProperty(N,"km",{enumerable:!0,get:function(){return ie(CO).default}});var RO=Jd();Object.defineProperty(N,"ko",{enumerable:!0,get:function(){return ie(RO).default}});var LO=Gd();Object.defineProperty(N,"lt",{enumerable:!0,get:function(){return ie(LO).default}});var MO=Qd();Object.defineProperty(N,"mk",{enumerable:!0,get:function(){return ie(MO).default}});var UO=t_();Object.defineProperty(N,"ms",{enumerable:!0,get:function(){return ie(UO).default}});var PO=r_();Object.defineProperty(N,"nl",{enumerable:!0,get:function(){return ie(PO).default}});var xO=o_();Object.defineProperty(N,"no",{enumerable:!0,get:function(){return ie(xO).default}});var jO=s_();Object.defineProperty(N,"ota",{enumerable:!0,get:function(){return ie(jO).default}});var DO=l_();Object.defineProperty(N,"ps",{enumerable:!0,get:function(){return ie(DO).default}});var zO=d_();Object.defineProperty(N,"pl",{enumerable:!0,get:function(){return ie(zO).default}});var FO=f_();Object.defineProperty(N,"pt",{enumerable:!0,get:function(){return ie(FO).default}});var ZO=m_();Object.defineProperty(N,"ro",{enumerable:!0,get:function(){return ie(ZO).default}});var qO=v_();Object.defineProperty(N,"ru",{enumerable:!0,get:function(){return ie(qO).default}});var VO=b_();Object.defineProperty(N,"sl",{enumerable:!0,get:function(){return ie(VO).default}});var WO=E_();Object.defineProperty(N,"sv",{enumerable:!0,get:function(){return ie(WO).default}});var BO=O_();Object.defineProperty(N,"ta",{enumerable:!0,get:function(){return ie(BO).default}});var HO=A_();Object.defineProperty(N,"th",{enumerable:!0,get:function(){return ie(HO).default}});var JO=$_();Object.defineProperty(N,"tr",{enumerable:!0,get:function(){return ie(JO).default}});var KO=C_();Object.defineProperty(N,"ua",{enumerable:!0,get:function(){return ie(KO).default}});var XO=Hs();Object.defineProperty(N,"uk",{enumerable:!0,get:function(){return ie(XO).default}});var GO=L_();Object.defineProperty(N,"ur",{enumerable:!0,get:function(){return ie(GO).default}});var YO=U_();Object.defineProperty(N,"uz",{enumerable:!0,get:function(){return ie(YO).default}});var QO=x_();Object.defineProperty(N,"vi",{enumerable:!0,get:function(){return ie(QO).default}});var ew=D_();Object.defineProperty(N,"zhCN",{enumerable:!0,get:function(){return ie(ew).default}});var tw=F_();Object.defineProperty(N,"zhTW",{enumerable:!0,get:function(){return ie(tw).default}});var nw=q_();Object.defineProperty(N,"yo",{enumerable:!0,get:function(){return ie(nw).default}})});var Br=k(Tt=>{"use strict";var V_;Object.defineProperty(Tt,"__esModule",{value:!0});Tt.globalRegistry=Tt.$ZodRegistry=Tt.$input=Tt.$output=void 0;Tt.registry=W_;Tt.$output=Symbol("ZodOutput");Tt.$input=Symbol("ZodInput");var Ko=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};Tt.$ZodRegistry=Ko;function W_(){return new Ko}(V_=globalThis).__zod_globalRegistry??(V_.__zod_globalRegistry=W_());Tt.globalRegistry=globalThis.__zod_globalRegistry});var K_=k(w=>{"use strict";var rw=w&&w.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),iw=w&&w.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Yo=w&&w.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&rw(t,e,n);return iw(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});w.TimePrecision=void 0;w._string=ow;w._coercedString=aw;w._email=sw;w._guid=cw;w._uuid=lw;w._uuidv4=uw;w._uuidv6=dw;w._uuidv7=_w;w._url=fw;w._emoji=pw;w._nanoid=mw;w._cuid=gw;w._cuid2=hw;w._ulid=vw;w._xid=yw;w._ksuid=bw;w._ipv4=Sw;w._ipv6=Ew;w._mac=kw;w._cidrv4=Ow;w._cidrv6=ww;w._base64=Aw;w._base64url=Tw;w._e164=$w;w._jwt=Iw;w._isoDateTime=Nw;w._isoDate=Cw;w._isoTime=Rw;w._isoDuration=Lw;w._number=Mw;w._coercedNumber=Uw;w._int=Pw;w._float32=xw;w._float64=jw;w._int32=Dw;w._uint32=zw;w._boolean=Fw;w._coercedBoolean=Zw;w._bigint=qw;w._coercedBigint=Vw;w._int64=Ww;w._uint64=Bw;w._symbol=Hw;w._undefined=Jw;w._null=Kw;w._any=Xw;w._unknown=Gw;w._never=Yw;w._void=Qw;w._date=eA;w._coercedDate=tA;w._nan=nA;w._lt=B_;w._lte=Hr;w._max=Hr;w._lte=Hr;w._max=Hr;w._gt=H_;w._gte=Jr;w._min=Jr;w._gte=Jr;w._min=Jr;w._positive=rA;w._negative=iA;w._nonpositive=oA;w._nonnegative=aA;w._multipleOf=sA;w._maxSize=cA;w._minSize=lA;w._size=uA;w._maxLength=dA;w._minLength=_A;w._length=fA;w._regex=pA;w._lowercase=mA;w._uppercase=gA;w._includes=hA;w._startsWith=vA;w._endsWith=yA;w._property=bA;w._mime=SA;w._overwrite=Or;w._normalize=EA;w._trim=kA;w._toLowerCase=OA;w._toUpperCase=wA;w._slugify=AA;w._array=TA;w._union=$A;w._xor=IA;w._discriminatedUnion=NA;w._intersection=CA;w._tuple=RA;w._record=LA;w._map=MA;w._set=UA;w._enum=PA;w._nativeEnum=xA;w._literal=jA;w._file=DA;w._transform=zA;w._optional=FA;w._nullable=ZA;w._default=qA;w._nonoptional=VA;w._success=WA;w._catch=BA;w._pipe=HA;w._readonly=JA;w._templateLiteral=KA;w._lazy=XA;w._promise=GA;w._custom=YA;w._refine=QA;w._superRefine=eT;w._check=J_;w.describe=tT;w.meta=nT;w._stringbool=rT;w._stringFormat=iT;var xe=Yo(qi()),Go=Yo(Br()),Xo=Yo(Vs()),U=Yo(G());function ow(e,t){return new e({type:"string",...U.normalizeParams(t)})}function aw(e,t){return new e({type:"string",coerce:!0,...U.normalizeParams(t)})}function sw(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...U.normalizeParams(t)})}function cw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...U.normalizeParams(t)})}function lw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...U.normalizeParams(t)})}function uw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...U.normalizeParams(t)})}function dw(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...U.normalizeParams(t)})}function _w(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...U.normalizeParams(t)})}function fw(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...U.normalizeParams(t)})}function pw(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...U.normalizeParams(t)})}function mw(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...U.normalizeParams(t)})}function gw(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...U.normalizeParams(t)})}function hw(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...U.normalizeParams(t)})}function vw(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...U.normalizeParams(t)})}function yw(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...U.normalizeParams(t)})}function bw(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...U.normalizeParams(t)})}function Sw(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...U.normalizeParams(t)})}function Ew(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...U.normalizeParams(t)})}function kw(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...U.normalizeParams(t)})}function Ow(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...U.normalizeParams(t)})}function ww(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...U.normalizeParams(t)})}function Aw(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...U.normalizeParams(t)})}function Tw(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...U.normalizeParams(t)})}function $w(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...U.normalizeParams(t)})}function Iw(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...U.normalizeParams(t)})}w.TimePrecision={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Nw(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...U.normalizeParams(t)})}function Cw(e,t){return new e({type:"string",format:"date",check:"string_format",...U.normalizeParams(t)})}function Rw(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...U.normalizeParams(t)})}function Lw(e,t){return new e({type:"string",format:"duration",check:"string_format",...U.normalizeParams(t)})}function Mw(e,t){return new e({type:"number",checks:[],...U.normalizeParams(t)})}function Uw(e,t){return new e({type:"number",coerce:!0,checks:[],...U.normalizeParams(t)})}function Pw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...U.normalizeParams(t)})}function xw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...U.normalizeParams(t)})}function jw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...U.normalizeParams(t)})}function Dw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...U.normalizeParams(t)})}function zw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...U.normalizeParams(t)})}function Fw(e,t){return new e({type:"boolean",...U.normalizeParams(t)})}function Zw(e,t){return new e({type:"boolean",coerce:!0,...U.normalizeParams(t)})}function qw(e,t){return new e({type:"bigint",...U.normalizeParams(t)})}function Vw(e,t){return new e({type:"bigint",coerce:!0,...U.normalizeParams(t)})}function Ww(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...U.normalizeParams(t)})}function Bw(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...U.normalizeParams(t)})}function Hw(e,t){return new e({type:"symbol",...U.normalizeParams(t)})}function Jw(e,t){return new e({type:"undefined",...U.normalizeParams(t)})}function Kw(e,t){return new e({type:"null",...U.normalizeParams(t)})}function Xw(e){return new e({type:"any"})}function Gw(e){return new e({type:"unknown"})}function Yw(e,t){return new e({type:"never",...U.normalizeParams(t)})}function Qw(e,t){return new e({type:"void",...U.normalizeParams(t)})}function eA(e,t){return new e({type:"date",...U.normalizeParams(t)})}function tA(e,t){return new e({type:"date",coerce:!0,...U.normalizeParams(t)})}function nA(e,t){return new e({type:"nan",...U.normalizeParams(t)})}function B_(e,t){return new xe.$ZodCheckLessThan({check:"less_than",...U.normalizeParams(t),value:e,inclusive:!1})}function Hr(e,t){return new xe.$ZodCheckLessThan({check:"less_than",...U.normalizeParams(t),value:e,inclusive:!0})}function H_(e,t){return new xe.$ZodCheckGreaterThan({check:"greater_than",...U.normalizeParams(t),value:e,inclusive:!1})}function Jr(e,t){return new xe.$ZodCheckGreaterThan({check:"greater_than",...U.normalizeParams(t),value:e,inclusive:!0})}function rA(e){return H_(0,e)}function iA(e){return B_(0,e)}function oA(e){return Hr(0,e)}function aA(e){return Jr(0,e)}function sA(e,t){return new xe.$ZodCheckMultipleOf({check:"multiple_of",...U.normalizeParams(t),value:e})}function cA(e,t){return new xe.$ZodCheckMaxSize({check:"max_size",...U.normalizeParams(t),maximum:e})}function lA(e,t){return new xe.$ZodCheckMinSize({check:"min_size",...U.normalizeParams(t),minimum:e})}function uA(e,t){return new xe.$ZodCheckSizeEquals({check:"size_equals",...U.normalizeParams(t),size:e})}function dA(e,t){return new xe.$ZodCheckMaxLength({check:"max_length",...U.normalizeParams(t),maximum:e})}function _A(e,t){return new xe.$ZodCheckMinLength({check:"min_length",...U.normalizeParams(t),minimum:e})}function fA(e,t){return new xe.$ZodCheckLengthEquals({check:"length_equals",...U.normalizeParams(t),length:e})}function pA(e,t){return new xe.$ZodCheckRegex({check:"string_format",format:"regex",...U.normalizeParams(t),pattern:e})}function mA(e){return new xe.$ZodCheckLowerCase({check:"string_format",format:"lowercase",...U.normalizeParams(e)})}function gA(e){return new xe.$ZodCheckUpperCase({check:"string_format",format:"uppercase",...U.normalizeParams(e)})}function hA(e,t){return new xe.$ZodCheckIncludes({check:"string_format",format:"includes",...U.normalizeParams(t),includes:e})}function vA(e,t){return new xe.$ZodCheckStartsWith({check:"string_format",format:"starts_with",...U.normalizeParams(t),prefix:e})}function yA(e,t){return new xe.$ZodCheckEndsWith({check:"string_format",format:"ends_with",...U.normalizeParams(t),suffix:e})}function bA(e,t,n){return new xe.$ZodCheckProperty({check:"property",property:e,schema:t,...U.normalizeParams(n)})}function SA(e,t){return new xe.$ZodCheckMimeType({check:"mime_type",mime:e,...U.normalizeParams(t)})}function Or(e){return new xe.$ZodCheckOverwrite({check:"overwrite",tx:e})}function EA(e){return Or(t=>t.normalize(e))}function kA(){return Or(e=>e.trim())}function OA(){return Or(e=>e.toLowerCase())}function wA(){return Or(e=>e.toUpperCase())}function AA(){return Or(e=>U.slugify(e))}function TA(e,t,n){return new e({type:"array",element:t,...U.normalizeParams(n)})}function $A(e,t,n){return new e({type:"union",options:t,...U.normalizeParams(n)})}function IA(e,t,n){return new e({type:"union",options:t,inclusive:!1,...U.normalizeParams(n)})}function NA(e,t,n,i){return new e({type:"union",options:n,discriminator:t,...U.normalizeParams(i)})}function CA(e,t,n){return new e({type:"intersection",left:t,right:n})}function RA(e,t,n,i){let r=n instanceof Xo.$ZodType,o=r?i:n,a=r?n:null;return new e({type:"tuple",items:t,rest:a,...U.normalizeParams(o)})}function LA(e,t,n,i){return new e({type:"record",keyType:t,valueType:n,...U.normalizeParams(i)})}function MA(e,t,n,i){return new e({type:"map",keyType:t,valueType:n,...U.normalizeParams(i)})}function UA(e,t,n){return new e({type:"set",valueType:t,...U.normalizeParams(n)})}function PA(e,t,n){let i=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:i,...U.normalizeParams(n)})}function xA(e,t,n){return new e({type:"enum",entries:t,...U.normalizeParams(n)})}function jA(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...U.normalizeParams(n)})}function DA(e,t){return new e({type:"file",...U.normalizeParams(t)})}function zA(e,t){return new e({type:"transform",transform:t})}function FA(e,t){return new e({type:"optional",innerType:t})}function ZA(e,t){return new e({type:"nullable",innerType:t})}function qA(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():U.shallowClone(n)}})}function VA(e,t,n){return new e({type:"nonoptional",innerType:t,...U.normalizeParams(n)})}function WA(e,t){return new e({type:"success",innerType:t})}function BA(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function HA(e,t,n){return new e({type:"pipe",in:t,out:n})}function JA(e,t){return new e({type:"readonly",innerType:t})}function KA(e,t,n){return new e({type:"template_literal",parts:t,...U.normalizeParams(n)})}function XA(e,t){return new e({type:"lazy",getter:t})}function GA(e,t){return new e({type:"promise",innerType:t})}function YA(e,t,n){let i=U.normalizeParams(n);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function QA(e,t,n){return new e({type:"custom",check:"custom",fn:t,...U.normalizeParams(n)})}function eT(e,t){let n=J_(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(U.issue(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(U.issue(o))}},e(i.value,i)),t);return n}function J_(e,t){let n=new xe.$ZodCheck({check:"custom",...U.normalizeParams(t)});return n._zod.check=e,n}function tT(e){let t=new xe.$ZodCheck({check:"describe"});return t._zod.onattach=[n=>{let i=Go.globalRegistry.get(n)??{};Go.globalRegistry.add(n,{...i,description:e})}],t._zod.check=()=>{},t}function nT(e){let t=new xe.$ZodCheck({check:"meta"});return t._zod.onattach=[n=>{let i=Go.globalRegistry.get(n)??{};Go.globalRegistry.add(n,{...i,...e})}],t._zod.check=()=>{},t}function rT(e,t){let n=U.normalizeParams(t),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(p=>typeof p=="string"?p.toLowerCase():p),r=r.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(i),a=new Set(r),s=e.Codec??Xo.$ZodCodec,c=e.Boolean??Xo.$ZodBoolean,l=e.String??Xo.$ZodString,_=new l({type:"string",error:n.error}),u=new c({type:"boolean",error:n.error}),f=new s({type:"pipe",in:_,out:u,transform:((p,y)=>{let v=p;return n.case!=="sensitive"&&(v=v.toLowerCase()),o.has(v)?!0:a.has(v)?!1:(y.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:y.value,inst:f,continue:!1}),{})}),reverseTransform:((p,y)=>p===!0?i[0]||"true":r[0]||"false"),error:n.error});return f}function iT(e,t,n,i={}){let r=U.normalizeParams(i),o={...U.normalizeParams(i),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:s=>n.test(s),...r};return n instanceof RegExp&&(o.pattern=n),new e(o)}});var Kr=k(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.createStandardJSONSchemaMethod=yt.createToJSONSchemaMethod=void 0;yt.initializeContext=Ks;yt.process=Qo;yt.extractDefs=Xs;yt.finalize=Gs;var oT=Br();function Ks(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??oT.globalRegistry,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Qo(e,t,n={path:[],schemaPath:[]}){var i;let r=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let _={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,_);else{let f=a.schema,p=t.processors[r.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);p(e,t,f,_)}let u=e._zod.parent;u&&(a.ref||(a.ref=u),Qo(u,t,_),t.seen.get(u).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(a.schema,c),t.io==="input"&&at(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((i=a.schema).default??(i.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Xs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let c=i.get(s);if(c&&c!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(s,a[0])}}let r=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let u=e.external.registry.get(a[0])?.id,f=e.external.uri??(y=>y);if(u)return{ref:f(u)};let p=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=p,{defId:p,ref:`${f("__shared")}#/${s}/${p}`}}if(a[1]===n)return{ref:"#"};let l=`#/${s}/`,_=a[1].schema.id??`__schema${e.counter++}`;return{defId:_,ref:l+_}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:c,defId:l}=r(a);s.def={...s.schema},l&&(s.defId=l);let _=s.schema;for(let u in _)delete _[u];_.$ref=c};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
64
|
+
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){o(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(t!==a[0]&&l){o(a);continue}}if(e.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1&&e.reused==="ref"){o(a);continue}}}function Gs(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let c=e.seen.get(s);if(c.ref===null)return;let l=c.def??c.schema,_={...l},u=c.ref;if(c.ref=null,u){i(u);let p=e.seen.get(u),y=p.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(y)):Object.assign(l,y),Object.assign(l,_),s._zod.parent===u)for(let h in l)h==="$ref"||h==="allOf"||h in _||delete l[h];if(y.$ref&&p.def)for(let h in l)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(l[h])===JSON.stringify(p.def[h])&&delete l[h]}let f=s._zod.parent;if(f&&f!==u){i(f);let p=e.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let y in l)y==="$ref"||y==="allOf"||y in p.def&&JSON.stringify(l[y])===JSON.stringify(p.def[y])&&delete l[y]}e.override({zodSchema:s,jsonSchema:l,path:c.path??[]})};for(let s of[...e.seen.entries()].reverse())i(s[0]);let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(s)}Object.assign(r,n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&r.id===o&&delete r.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?r.$defs=a:r.definitions=a);try{let s=JSON.parse(JSON.stringify(r));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:(0,yt.createStandardJSONSchemaMethod)(t,"input",e.processors),output:(0,yt.createStandardJSONSchemaMethod)(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function at(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return at(i.element,n);if(i.type==="set")return at(i.valueType,n);if(i.type==="lazy")return at(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return at(i.innerType,n);if(i.type==="intersection")return at(i.left,n)||at(i.right,n);if(i.type==="record"||i.type==="map")return at(i.keyType,n)||at(i.valueType,n);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:at(i.in,n)||at(i.out,n);if(i.type==="object"){for(let r in i.shape)if(at(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(at(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(at(r,n))return!0;return!!(i.rest&&at(i.rest,n))}return!1}var aT=(e,t={})=>n=>{let i=Ks({...n,processors:t});return Qo(e,i),Xs(i,e),Gs(i,e)};yt.createToJSONSchemaMethod=aT;var sT=(e,t,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},a=Ks({...r??{},target:o,io:t,processors:n});return Qo(e,a),Xs(a,e),Gs(a,e)};yt.createStandardJSONSchemaMethod=sT});var Xr=k($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.allProcessors=$.lazyProcessor=$.optionalProcessor=$.promiseProcessor=$.readonlyProcessor=$.pipeProcessor=$.catchProcessor=$.prefaultProcessor=$.defaultProcessor=$.nonoptionalProcessor=$.nullableProcessor=$.recordProcessor=$.tupleProcessor=$.intersectionProcessor=$.unionProcessor=$.objectProcessor=$.arrayProcessor=$.setProcessor=$.mapProcessor=$.transformProcessor=$.functionProcessor=$.customProcessor=$.successProcessor=$.fileProcessor=$.templateLiteralProcessor=$.nanProcessor=$.literalProcessor=$.enumProcessor=$.dateProcessor=$.unknownProcessor=$.anyProcessor=$.neverProcessor=$.voidProcessor=$.undefinedProcessor=$.nullProcessor=$.symbolProcessor=$.bigintProcessor=$.booleanProcessor=$.numberProcessor=$.stringProcessor=void 0;$.toJSONSchema=KT;var $e=Kr(),cT=G(),lT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},uT=(e,t,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(r.minLength=o),typeof a=="number"&&(r.maxLength=a),s&&(r.format=lT[s]??s,r.format===""&&delete r.format,s==="time"&&delete r.format),l&&(r.contentEncoding=l),c&&c.size>0){let _=[...c];_.length===1?r.pattern=_[0].source:_.length>1&&(r.allOf=[..._.map(u=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:u.source}))])}};$.stringProcessor=uT;var dT=(e,t,n,i)=>{let r=n,{minimum:o,maximum:a,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:_}=e._zod.bag;typeof s=="string"&&s.includes("int")?r.type="integer":r.type="number";let u=typeof _=="number"&&_>=(o??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(a??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";u?p?(r.minimum=_,r.exclusiveMinimum=!0):r.exclusiveMinimum=_:typeof o=="number"&&(r.minimum=o),f?p?(r.maximum=l,r.exclusiveMaximum=!0):r.exclusiveMaximum=l:typeof a=="number"&&(r.maximum=a),typeof c=="number"&&(r.multipleOf=c)};$.numberProcessor=dT;var _T=(e,t,n,i)=>{n.type="boolean"};$.booleanProcessor=_T;var fT=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")};$.bigintProcessor=fT;var pT=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")};$.symbolProcessor=pT;var mT=(e,t,n,i)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"};$.nullProcessor=mT;var gT=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")};$.undefinedProcessor=gT;var hT=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")};$.voidProcessor=hT;var vT=(e,t,n,i)=>{n.not={}};$.neverProcessor=vT;var yT=(e,t,n,i)=>{};$.anyProcessor=yT;var bT=(e,t,n,i)=>{};$.unknownProcessor=bT;var ST=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")};$.dateProcessor=ST;var ET=(e,t,n,i)=>{let r=e._zod.def,o=(0,cT.getEnumValues)(r.entries);o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),n.enum=o};$.enumProcessor=ET;var kT=(e,t,n,i)=>{let r=e._zod.def,o=[];for(let a of r.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else o.every(a=>typeof a=="number")&&(n.type="number"),o.every(a=>typeof a=="string")&&(n.type="string"),o.every(a=>typeof a=="boolean")&&(n.type="boolean"),o.every(a=>a===null)&&(n.type="null"),n.enum=o};$.literalProcessor=kT;var OT=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")};$.nanProcessor=OT;var wT=(e,t,n,i)=>{let r=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source};$.templateLiteralProcessor=wT;var AT=(e,t,n,i)=>{let r=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:c}=e._zod.bag;a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),c?c.length===1?(o.contentMediaType=c[0],Object.assign(r,o)):(Object.assign(r,o),r.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(r,o)};$.fileProcessor=AT;var TT=(e,t,n,i)=>{n.type="boolean"};$.successProcessor=TT;var $T=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};$.customProcessor=$T;var IT=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")};$.functionProcessor=IT;var NT=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};$.transformProcessor=NT;var CT=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")};$.mapProcessor=CT;var RT=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")};$.setProcessor=RT;var LT=(e,t,n,i)=>{let r=n,o=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(r.minItems=a),typeof s=="number"&&(r.maxItems=s),r.type="array",r.items=(0,$e.process)(o.element,t,{...i,path:[...i.path,"items"]})};$.arrayProcessor=LT;var MT=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="object",r.properties={};let a=o.shape;for(let l in a)r.properties[l]=(0,$e.process)(a[l],t,{...i,path:[...i.path,"properties",l]});let s=new Set(Object.keys(a)),c=new Set([...s].filter(l=>{let _=o.shape[l]._zod;return t.io==="input"?_.optin===void 0:_.optout===void 0}));c.size>0&&(r.required=Array.from(c)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=(0,$e.process)(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)};$.objectProcessor=MT;var UT=(e,t,n,i)=>{let r=e._zod.def,o=r.inclusive===!1,a=r.options.map((s,c)=>(0,$e.process)(s,t,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=a:n.anyOf=a};$.unionProcessor=UT;var PT=(e,t,n,i)=>{let r=e._zod.def,o=(0,$e.process)(r.left,t,{...i,path:[...i.path,"allOf",0]}),a=(0,$e.process)(r.right,t,{...i,path:[...i.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];n.allOf=c};$.intersectionProcessor=PT;var xT=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((f,p)=>(0,$e.process)(f,t,{...i,path:[...i.path,a,p]})),l=o.rest?(0,$e.process)(o.rest,t,{...i,path:[...i.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(r.prefixItems=c,l&&(r.items=l)):t.target==="openapi-3.0"?(r.items={anyOf:c},l&&r.items.anyOf.push(l),r.minItems=c.length,l||(r.maxItems=c.length)):(r.items=c,l&&(r.additionalItems=l));let{minimum:_,maximum:u}=e._zod.bag;typeof _=="number"&&(r.minItems=_),typeof u=="number"&&(r.maxItems=u)};$.tupleProcessor=xT;var jT=(e,t,n,i)=>{let r=n,o=e._zod.def;r.type="object";let a=o.keyType,c=a._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let _=(0,$e.process)(o.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let u of c)r.patternProperties[u.source]=_}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=(0,$e.process)(o.keyType,t,{...i,path:[...i.path,"propertyNames"]})),r.additionalProperties=(0,$e.process)(o.valueType,t,{...i,path:[...i.path,"additionalProperties"]});let l=a._zod.values;if(l){let _=[...l].filter(u=>typeof u=="string"||typeof u=="number");_.length>0&&(r.required=_)}};$.recordProcessor=jT;var DT=(e,t,n,i)=>{let r=e._zod.def,o=(0,$e.process)(r.innerType,t,i),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]};$.nullableProcessor=DT;var zT=(e,t,n,i)=>{let r=e._zod.def;(0,$e.process)(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType};$.nonoptionalProcessor=zT;var FT=(e,t,n,i)=>{let r=e._zod.def;(0,$e.process)(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))};$.defaultProcessor=FT;var ZT=(e,t,n,i)=>{let r=e._zod.def;(0,$e.process)(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))};$.prefaultProcessor=ZT;var qT=(e,t,n,i)=>{let r=e._zod.def;(0,$e.process)(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType;let a;try{a=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a};$.catchProcessor=qT;var VT=(e,t,n,i)=>{let r=e._zod.def,o=r.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?o?r.out:r.in:r.out;(0,$e.process)(a,t,i);let s=t.seen.get(e);s.ref=a};$.pipeProcessor=VT;var WT=(e,t,n,i)=>{let r=e._zod.def;(0,$e.process)(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType,n.readOnly=!0};$.readonlyProcessor=WT;var BT=(e,t,n,i)=>{let r=e._zod.def;(0,$e.process)(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType};$.promiseProcessor=BT;var HT=(e,t,n,i)=>{let r=e._zod.def;(0,$e.process)(r.innerType,t,i);let o=t.seen.get(e);o.ref=r.innerType};$.optionalProcessor=HT;var JT=(e,t,n,i)=>{let r=e._zod.innerType;(0,$e.process)(r,t,i);let o=t.seen.get(e);o.ref=r};$.lazyProcessor=JT;$.allProcessors={string:$.stringProcessor,number:$.numberProcessor,boolean:$.booleanProcessor,bigint:$.bigintProcessor,symbol:$.symbolProcessor,null:$.nullProcessor,undefined:$.undefinedProcessor,void:$.voidProcessor,never:$.neverProcessor,any:$.anyProcessor,unknown:$.unknownProcessor,date:$.dateProcessor,enum:$.enumProcessor,literal:$.literalProcessor,nan:$.nanProcessor,template_literal:$.templateLiteralProcessor,file:$.fileProcessor,success:$.successProcessor,custom:$.customProcessor,function:$.functionProcessor,transform:$.transformProcessor,map:$.mapProcessor,set:$.setProcessor,array:$.arrayProcessor,object:$.objectProcessor,union:$.unionProcessor,intersection:$.intersectionProcessor,tuple:$.tupleProcessor,record:$.recordProcessor,nullable:$.nullableProcessor,nonoptional:$.nonoptionalProcessor,default:$.defaultProcessor,prefault:$.prefaultProcessor,catch:$.catchProcessor,pipe:$.pipeProcessor,readonly:$.readonlyProcessor,promise:$.promiseProcessor,optional:$.optionalProcessor,lazy:$.lazyProcessor};function KT(e,t){if("_idmap"in e){let i=e,r=(0,$e.initializeContext)({...t,processors:$.allProcessors}),o={};for(let c of i._idmap.entries()){let[l,_]=c;(0,$e.process)(_,r)}let a={},s={registry:i,uri:t?.uri,defs:o};r.external=s;for(let c of i._idmap.entries()){let[l,_]=c;(0,$e.extractDefs)(r,_),a[l]=(0,$e.finalize)(r,_)}if(Object.keys(o).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[c]:o}}return{schemas:a}}let n=(0,$e.initializeContext)({...t,processors:$.allProcessors});return(0,$e.process)(e,n),(0,$e.extractDefs)(n,e),(0,$e.finalize)(n,e)}});var X_=k(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.JSONSchemaGenerator=void 0;var XT=Xr(),ea=Kr(),Ys=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=(0,ea.initializeContext)({processors:XT.allProcessors,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return(0,ea.process)(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),(0,ea.extractDefs)(this.ctx,t);let i=(0,ea.finalize)(this.ctx,t),{"~standard":r,...o}=i;return o}};ta.JSONSchemaGenerator=Ys});var Y_=k(G_=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0})});var dt=k(ke=>{"use strict";var Q_=ke&&ke.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),GT=ke&&ke.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Nn=ke&&ke.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Q_(t,e,n)},na=ke&&ke.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Q_(t,e,n);return GT(t,e),t};Object.defineProperty(ke,"__esModule",{value:!0});ke.JSONSchema=ke.JSONSchemaGenerator=ke.toJSONSchema=ke.locales=ke.regexes=ke.util=void 0;Nn(ar(),ke);Nn(Ps(),ke);Nn(Ms(),ke);Nn(Vs(),ke);Nn(qi(),ke);Nn(Fs(),ke);ke.util=na(G());ke.regexes=na(Zi());ke.locales=na(Js());Nn(Br(),ke);Nn(zs(),ke);Nn(K_(),ke);Nn(Kr(),ke);var YT=Xr();Object.defineProperty(ke,"toJSONSchema",{enumerable:!0,get:function(){return YT.toJSONSchema}});var QT=X_();Object.defineProperty(ke,"JSONSchemaGenerator",{enumerable:!0,get:function(){return QT.JSONSchemaGenerator}});ke.JSONSchema=na(Y_())});var ra=k(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.slugify=Y.toUpperCase=Y.toLowerCase=Y.trim=Y.normalize=Y.overwrite=Y.mime=Y.property=Y.endsWith=Y.startsWith=Y.includes=Y.uppercase=Y.lowercase=Y.regex=Y.length=Y.minLength=Y.maxLength=Y.size=Y.minSize=Y.maxSize=Y.multipleOf=Y.nonnegative=Y.nonpositive=Y.negative=Y.positive=Y.gte=Y.gt=Y.lte=Y.lt=void 0;var Ie=dt();Object.defineProperty(Y,"lt",{enumerable:!0,get:function(){return Ie._lt}});Object.defineProperty(Y,"lte",{enumerable:!0,get:function(){return Ie._lte}});Object.defineProperty(Y,"gt",{enumerable:!0,get:function(){return Ie._gt}});Object.defineProperty(Y,"gte",{enumerable:!0,get:function(){return Ie._gte}});Object.defineProperty(Y,"positive",{enumerable:!0,get:function(){return Ie._positive}});Object.defineProperty(Y,"negative",{enumerable:!0,get:function(){return Ie._negative}});Object.defineProperty(Y,"nonpositive",{enumerable:!0,get:function(){return Ie._nonpositive}});Object.defineProperty(Y,"nonnegative",{enumerable:!0,get:function(){return Ie._nonnegative}});Object.defineProperty(Y,"multipleOf",{enumerable:!0,get:function(){return Ie._multipleOf}});Object.defineProperty(Y,"maxSize",{enumerable:!0,get:function(){return Ie._maxSize}});Object.defineProperty(Y,"minSize",{enumerable:!0,get:function(){return Ie._minSize}});Object.defineProperty(Y,"size",{enumerable:!0,get:function(){return Ie._size}});Object.defineProperty(Y,"maxLength",{enumerable:!0,get:function(){return Ie._maxLength}});Object.defineProperty(Y,"minLength",{enumerable:!0,get:function(){return Ie._minLength}});Object.defineProperty(Y,"length",{enumerable:!0,get:function(){return Ie._length}});Object.defineProperty(Y,"regex",{enumerable:!0,get:function(){return Ie._regex}});Object.defineProperty(Y,"lowercase",{enumerable:!0,get:function(){return Ie._lowercase}});Object.defineProperty(Y,"uppercase",{enumerable:!0,get:function(){return Ie._uppercase}});Object.defineProperty(Y,"includes",{enumerable:!0,get:function(){return Ie._includes}});Object.defineProperty(Y,"startsWith",{enumerable:!0,get:function(){return Ie._startsWith}});Object.defineProperty(Y,"endsWith",{enumerable:!0,get:function(){return Ie._endsWith}});Object.defineProperty(Y,"property",{enumerable:!0,get:function(){return Ie._property}});Object.defineProperty(Y,"mime",{enumerable:!0,get:function(){return Ie._mime}});Object.defineProperty(Y,"overwrite",{enumerable:!0,get:function(){return Ie._overwrite}});Object.defineProperty(Y,"normalize",{enumerable:!0,get:function(){return Ie._normalize}});Object.defineProperty(Y,"trim",{enumerable:!0,get:function(){return Ie._trim}});Object.defineProperty(Y,"toLowerCase",{enumerable:!0,get:function(){return Ie._toLowerCase}});Object.defineProperty(Y,"toUpperCase",{enumerable:!0,get:function(){return Ie._toUpperCase}});Object.defineProperty(Y,"slugify",{enumerable:!0,get:function(){return Ie._slugify}})});var Gr=k(Ue=>{"use strict";var e$=Ue&&Ue.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),t$=Ue&&Ue.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),ef=Ue&&Ue.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&e$(t,e,n);return t$(t,e),t};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.ZodISODuration=Ue.ZodISOTime=Ue.ZodISODate=Ue.ZodISODateTime=void 0;Ue.datetime=n$;Ue.date=r$;Ue.time=i$;Ue.duration=o$;var bt=ef(dt()),ia=ef(Yr());Ue.ZodISODateTime=bt.$constructor("ZodISODateTime",(e,t)=>{bt.$ZodISODateTime.init(e,t),ia.ZodStringFormat.init(e,t)});function n$(e){return bt._isoDateTime(Ue.ZodISODateTime,e)}Ue.ZodISODate=bt.$constructor("ZodISODate",(e,t)=>{bt.$ZodISODate.init(e,t),ia.ZodStringFormat.init(e,t)});function r$(e){return bt._isoDate(Ue.ZodISODate,e)}Ue.ZodISOTime=bt.$constructor("ZodISOTime",(e,t)=>{bt.$ZodISOTime.init(e,t),ia.ZodStringFormat.init(e,t)});function i$(e){return bt._isoTime(Ue.ZodISOTime,e)}Ue.ZodISODuration=bt.$constructor("ZodISODuration",(e,t)=>{bt.$ZodISODuration.init(e,t),ia.ZodStringFormat.init(e,t)});function o$(e){return bt._isoDuration(Ue.ZodISODuration,e)}});var Qs=k(St=>{"use strict";var a$=St&&St.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),s$=St&&St.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),nf=St&&St.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&a$(t,e,n);return s$(t,e),t};Object.defineProperty(St,"__esModule",{value:!0});St.ZodRealError=St.ZodError=void 0;var oa=nf(dt()),c$=dt(),tf=nf(G()),rf=(e,t)=>{c$.$ZodError.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>oa.formatError(e,n)},flatten:{value:n=>oa.flattenError(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,tf.jsonStringifyReplacer,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,tf.jsonStringifyReplacer,2)}},isEmpty:{get(){return e.issues.length===0}}})};St.ZodError=oa.$constructor("ZodError",rf);St.ZodRealError=oa.$constructor("ZodError",rf,{Parent:Error})});var ec=k(Oe=>{"use strict";var l$=Oe&&Oe.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),u$=Oe&&Oe.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),d$=Oe&&Oe.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&l$(t,e,n);return u$(t,e),t};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.safeDecodeAsync=Oe.safeEncodeAsync=Oe.safeDecode=Oe.safeEncode=Oe.decodeAsync=Oe.encodeAsync=Oe.decode=Oe.encode=Oe.safeParseAsync=Oe.safeParse=Oe.parseAsync=Oe.parse=void 0;var Et=d$(dt()),kt=Qs();Oe.parse=Et._parse(kt.ZodRealError);Oe.parseAsync=Et._parseAsync(kt.ZodRealError);Oe.safeParse=Et._safeParse(kt.ZodRealError);Oe.safeParseAsync=Et._safeParseAsync(kt.ZodRealError);Oe.encode=Et._encode(kt.ZodRealError);Oe.decode=Et._decode(kt.ZodRealError);Oe.encodeAsync=Et._encodeAsync(kt.ZodRealError);Oe.decodeAsync=Et._decodeAsync(kt.ZodRealError);Oe.safeEncode=Et._safeEncode(kt.ZodRealError);Oe.safeDecode=Et._safeDecode(kt.ZodRealError);Oe.safeEncodeAsync=Et._safeEncodeAsync(kt.ZodRealError);Oe.safeDecodeAsync=Et._safeDecodeAsync(kt.ZodRealError)});var Yr=k(d=>{"use strict";var _$=d&&d.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),f$=d&&d.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Qr=d&&d.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&_$(t,e,n);return f$(t,e),t};Object.defineProperty(d,"__esModule",{value:!0});d.ZodLiteral=d.ZodEnum=d.ZodSet=d.ZodMap=d.ZodRecord=d.ZodTuple=d.ZodIntersection=d.ZodDiscriminatedUnion=d.ZodXor=d.ZodUnion=d.ZodObject=d.ZodArray=d.ZodDate=d.ZodVoid=d.ZodNever=d.ZodUnknown=d.ZodAny=d.ZodNull=d.ZodUndefined=d.ZodSymbol=d.ZodBigIntFormat=d.ZodBigInt=d.ZodBoolean=d.ZodNumberFormat=d.ZodNumber=d.ZodCustomStringFormat=d.ZodJWT=d.ZodE164=d.ZodBase64URL=d.ZodBase64=d.ZodCIDRv6=d.ZodCIDRv4=d.ZodIPv6=d.ZodMAC=d.ZodIPv4=d.ZodKSUID=d.ZodXID=d.ZodULID=d.ZodCUID2=d.ZodCUID=d.ZodNanoID=d.ZodEmoji=d.ZodURL=d.ZodUUID=d.ZodGUID=d.ZodEmail=d.ZodStringFormat=d.ZodString=d._ZodString=d.ZodType=void 0;d.stringbool=d.meta=d.describe=d.ZodCustom=d.ZodFunction=d.ZodPromise=d.ZodLazy=d.ZodTemplateLiteral=d.ZodReadonly=d.ZodPreprocess=d.ZodCodec=d.ZodPipe=d.ZodNaN=d.ZodCatch=d.ZodSuccess=d.ZodNonOptional=d.ZodPrefault=d.ZodDefault=d.ZodNullable=d.ZodExactOptional=d.ZodOptional=d.ZodTransform=d.ZodFile=void 0;d.string=sa;d.email=p$;d.guid=m$;d.uuid=g$;d.uuidv4=h$;d.uuidv6=v$;d.uuidv7=y$;d.url=b$;d.httpUrl=S$;d.emoji=E$;d.nanoid=k$;d.cuid=O$;d.cuid2=w$;d.ulid=A$;d.xid=T$;d.ksuid=$$;d.ipv4=I$;d.mac=N$;d.ipv6=C$;d.cidrv4=R$;d.cidrv6=L$;d.base64=M$;d.base64url=U$;d.e164=P$;d.jwt=x$;d.stringFormat=j$;d.hostname=D$;d.hex=z$;d.hash=F$;d.number=af;d.int=nc;d.float32=Z$;d.float64=q$;d.int32=V$;d.uint32=W$;d.boolean=sf;d.bigint=B$;d.int64=H$;d.uint64=J$;d.symbol=K$;d.undefined=X$;d.null=cf;d.any=G$;d.unknown=wr;d.never=ic;d.void=Y$;d.date=Q$;d.array=ua;d.keyof=eI;d.object=tI;d.strictObject=nI;d.looseObject=rI;d.union=oc;d.xor=iI;d.discriminatedUnion=oI;d.intersection=lf;d.tuple=uf;d.record=df;d.partialRecord=aI;d.looseRecord=sI;d.map=cI;d.set=lI;d.enum=ac;d.nativeEnum=uI;d.literal=dI;d.file=_I;d.transform=sc;d.optional=ca;d.exactOptional=_f;d.nullable=la;d.nullish=fI;d._default=ff;d.prefault=pf;d.nonoptional=mf;d.success=pI;d.catch=gf;d.nan=mI;d.pipe=rc;d.codec=gI;d.invertCodec=hI;d.readonly=hf;d.templateLiteral=vI;d.lazy=vf;d.promise=yI;d._function=da;d.function=da;d._function=da;d.function=da;d.check=bI;d.custom=SI;d.refine=yf;d.superRefine=bf;d.instanceof=EI;d.json=OI;d.preprocess=wI;var m=Qr(dt()),be=dt(),_e=Qr(Xr()),tc=Kr(),ce=Qr(ra()),aa=Qr(Gr()),Ot=Qr(ec()),of=new WeakMap;function ei(e,t,n){let i=Object.getPrototypeOf(e),r=of.get(i);if(r||(r=new Set,of.set(i,r)),!r.has(t)){r.add(t);for(let o in n){let a=n[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}d.ZodType=m.$constructor("ZodType",(e,t)=>(m.$ZodType.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:(0,tc.createStandardJSONSchemaMethod)(e,"input"),output:(0,tc.createStandardJSONSchemaMethod)(e,"output")}}),e.toJSONSchema=(0,tc.createToJSONSchemaMethod)(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,i)=>Ot.parse(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>Ot.safeParse(e,n,i),e.parseAsync=async(n,i)=>Ot.parseAsync(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>Ot.safeParseAsync(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>Ot.encode(e,n,i),e.decode=(n,i)=>Ot.decode(e,n,i),e.encodeAsync=async(n,i)=>Ot.encodeAsync(e,n,i),e.decodeAsync=async(n,i)=>Ot.decodeAsync(e,n,i),e.safeEncode=(n,i)=>Ot.safeEncode(e,n,i),e.safeDecode=(n,i)=>Ot.safeDecode(e,n,i),e.safeEncodeAsync=async(n,i)=>Ot.safeEncodeAsync(e,n,i),e.safeDecodeAsync=async(n,i)=>Ot.safeDecodeAsync(e,n,i),ei(e,"ZodType",{check(...n){let i=this.def;return this.clone(be.util.mergeDefs(i,{checks:[...i.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return m.clone(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(yf(n,i))},superRefine(n,i){return this.check(bf(n,i))},overwrite(n){return this.check(ce.overwrite(n))},optional(){return ca(this)},exactOptional(){return _f(this)},nullable(){return la(this)},nullish(){return ca(la(this))},nonoptional(n){return mf(this,n)},array(){return ua(this)},or(n){return oc([this,n])},and(n){return lf(this,n)},transform(n){return rc(this,sc(n))},default(n){return ff(this,n)},prefault(n){return pf(this,n)},catch(n){return gf(this,n)},pipe(n){return rc(this,n)},readonly(){return hf(this)},describe(n){let i=this.clone();return m.globalRegistry.add(i,{description:n}),i},meta(...n){if(n.length===0)return m.globalRegistry.get(this);let i=this.clone();return m.globalRegistry.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return m.globalRegistry.get(e)?.description},configurable:!0}),e));d._ZodString=m.$constructor("_ZodString",(e,t)=>{m.$ZodString.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(i,r,o)=>_e.stringProcessor(e,i,r,o);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ei(e,"_ZodString",{regex(...i){return this.check(ce.regex(...i))},includes(...i){return this.check(ce.includes(...i))},startsWith(...i){return this.check(ce.startsWith(...i))},endsWith(...i){return this.check(ce.endsWith(...i))},min(...i){return this.check(ce.minLength(...i))},max(...i){return this.check(ce.maxLength(...i))},length(...i){return this.check(ce.length(...i))},nonempty(...i){return this.check(ce.minLength(1,...i))},lowercase(i){return this.check(ce.lowercase(i))},uppercase(i){return this.check(ce.uppercase(i))},trim(){return this.check(ce.trim())},normalize(...i){return this.check(ce.normalize(...i))},toLowerCase(){return this.check(ce.toLowerCase())},toUpperCase(){return this.check(ce.toUpperCase())},slugify(){return this.check(ce.slugify())}})});d.ZodString=m.$constructor("ZodString",(e,t)=>{m.$ZodString.init(e,t),d._ZodString.init(e,t),e.email=n=>e.check(m._email(d.ZodEmail,n)),e.url=n=>e.check(m._url(d.ZodURL,n)),e.jwt=n=>e.check(m._jwt(d.ZodJWT,n)),e.emoji=n=>e.check(m._emoji(d.ZodEmoji,n)),e.guid=n=>e.check(m._guid(d.ZodGUID,n)),e.uuid=n=>e.check(m._uuid(d.ZodUUID,n)),e.uuidv4=n=>e.check(m._uuidv4(d.ZodUUID,n)),e.uuidv6=n=>e.check(m._uuidv6(d.ZodUUID,n)),e.uuidv7=n=>e.check(m._uuidv7(d.ZodUUID,n)),e.nanoid=n=>e.check(m._nanoid(d.ZodNanoID,n)),e.guid=n=>e.check(m._guid(d.ZodGUID,n)),e.cuid=n=>e.check(m._cuid(d.ZodCUID,n)),e.cuid2=n=>e.check(m._cuid2(d.ZodCUID2,n)),e.ulid=n=>e.check(m._ulid(d.ZodULID,n)),e.base64=n=>e.check(m._base64(d.ZodBase64,n)),e.base64url=n=>e.check(m._base64url(d.ZodBase64URL,n)),e.xid=n=>e.check(m._xid(d.ZodXID,n)),e.ksuid=n=>e.check(m._ksuid(d.ZodKSUID,n)),e.ipv4=n=>e.check(m._ipv4(d.ZodIPv4,n)),e.ipv6=n=>e.check(m._ipv6(d.ZodIPv6,n)),e.cidrv4=n=>e.check(m._cidrv4(d.ZodCIDRv4,n)),e.cidrv6=n=>e.check(m._cidrv6(d.ZodCIDRv6,n)),e.e164=n=>e.check(m._e164(d.ZodE164,n)),e.datetime=n=>e.check(aa.datetime(n)),e.date=n=>e.check(aa.date(n)),e.time=n=>e.check(aa.time(n)),e.duration=n=>e.check(aa.duration(n))});function sa(e){return m._string(d.ZodString,e)}d.ZodStringFormat=m.$constructor("ZodStringFormat",(e,t)=>{m.$ZodStringFormat.init(e,t),d._ZodString.init(e,t)});d.ZodEmail=m.$constructor("ZodEmail",(e,t)=>{m.$ZodEmail.init(e,t),d.ZodStringFormat.init(e,t)});function p$(e){return m._email(d.ZodEmail,e)}d.ZodGUID=m.$constructor("ZodGUID",(e,t)=>{m.$ZodGUID.init(e,t),d.ZodStringFormat.init(e,t)});function m$(e){return m._guid(d.ZodGUID,e)}d.ZodUUID=m.$constructor("ZodUUID",(e,t)=>{m.$ZodUUID.init(e,t),d.ZodStringFormat.init(e,t)});function g$(e){return m._uuid(d.ZodUUID,e)}function h$(e){return m._uuidv4(d.ZodUUID,e)}function v$(e){return m._uuidv6(d.ZodUUID,e)}function y$(e){return m._uuidv7(d.ZodUUID,e)}d.ZodURL=m.$constructor("ZodURL",(e,t)=>{m.$ZodURL.init(e,t),d.ZodStringFormat.init(e,t)});function b$(e){return m._url(d.ZodURL,e)}function S$(e){return m._url(d.ZodURL,{protocol:m.regexes.httpProtocol,hostname:m.regexes.domain,...be.util.normalizeParams(e)})}d.ZodEmoji=m.$constructor("ZodEmoji",(e,t)=>{m.$ZodEmoji.init(e,t),d.ZodStringFormat.init(e,t)});function E$(e){return m._emoji(d.ZodEmoji,e)}d.ZodNanoID=m.$constructor("ZodNanoID",(e,t)=>{m.$ZodNanoID.init(e,t),d.ZodStringFormat.init(e,t)});function k$(e){return m._nanoid(d.ZodNanoID,e)}d.ZodCUID=m.$constructor("ZodCUID",(e,t)=>{m.$ZodCUID.init(e,t),d.ZodStringFormat.init(e,t)});function O$(e){return m._cuid(d.ZodCUID,e)}d.ZodCUID2=m.$constructor("ZodCUID2",(e,t)=>{m.$ZodCUID2.init(e,t),d.ZodStringFormat.init(e,t)});function w$(e){return m._cuid2(d.ZodCUID2,e)}d.ZodULID=m.$constructor("ZodULID",(e,t)=>{m.$ZodULID.init(e,t),d.ZodStringFormat.init(e,t)});function A$(e){return m._ulid(d.ZodULID,e)}d.ZodXID=m.$constructor("ZodXID",(e,t)=>{m.$ZodXID.init(e,t),d.ZodStringFormat.init(e,t)});function T$(e){return m._xid(d.ZodXID,e)}d.ZodKSUID=m.$constructor("ZodKSUID",(e,t)=>{m.$ZodKSUID.init(e,t),d.ZodStringFormat.init(e,t)});function $$(e){return m._ksuid(d.ZodKSUID,e)}d.ZodIPv4=m.$constructor("ZodIPv4",(e,t)=>{m.$ZodIPv4.init(e,t),d.ZodStringFormat.init(e,t)});function I$(e){return m._ipv4(d.ZodIPv4,e)}d.ZodMAC=m.$constructor("ZodMAC",(e,t)=>{m.$ZodMAC.init(e,t),d.ZodStringFormat.init(e,t)});function N$(e){return m._mac(d.ZodMAC,e)}d.ZodIPv6=m.$constructor("ZodIPv6",(e,t)=>{m.$ZodIPv6.init(e,t),d.ZodStringFormat.init(e,t)});function C$(e){return m._ipv6(d.ZodIPv6,e)}d.ZodCIDRv4=m.$constructor("ZodCIDRv4",(e,t)=>{m.$ZodCIDRv4.init(e,t),d.ZodStringFormat.init(e,t)});function R$(e){return m._cidrv4(d.ZodCIDRv4,e)}d.ZodCIDRv6=m.$constructor("ZodCIDRv6",(e,t)=>{m.$ZodCIDRv6.init(e,t),d.ZodStringFormat.init(e,t)});function L$(e){return m._cidrv6(d.ZodCIDRv6,e)}d.ZodBase64=m.$constructor("ZodBase64",(e,t)=>{m.$ZodBase64.init(e,t),d.ZodStringFormat.init(e,t)});function M$(e){return m._base64(d.ZodBase64,e)}d.ZodBase64URL=m.$constructor("ZodBase64URL",(e,t)=>{m.$ZodBase64URL.init(e,t),d.ZodStringFormat.init(e,t)});function U$(e){return m._base64url(d.ZodBase64URL,e)}d.ZodE164=m.$constructor("ZodE164",(e,t)=>{m.$ZodE164.init(e,t),d.ZodStringFormat.init(e,t)});function P$(e){return m._e164(d.ZodE164,e)}d.ZodJWT=m.$constructor("ZodJWT",(e,t)=>{m.$ZodJWT.init(e,t),d.ZodStringFormat.init(e,t)});function x$(e){return m._jwt(d.ZodJWT,e)}d.ZodCustomStringFormat=m.$constructor("ZodCustomStringFormat",(e,t)=>{m.$ZodCustomStringFormat.init(e,t),d.ZodStringFormat.init(e,t)});function j$(e,t,n={}){return m._stringFormat(d.ZodCustomStringFormat,e,t,n)}function D$(e){return m._stringFormat(d.ZodCustomStringFormat,"hostname",m.regexes.hostname,e)}function z$(e){return m._stringFormat(d.ZodCustomStringFormat,"hex",m.regexes.hex,e)}function F$(e,t){let n=t?.enc??"hex",i=`${e}_${n}`,r=m.regexes[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return m._stringFormat(d.ZodCustomStringFormat,i,r,t)}d.ZodNumber=m.$constructor("ZodNumber",(e,t)=>{m.$ZodNumber.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(i,r,o)=>_e.numberProcessor(e,i,r,o),ei(e,"ZodNumber",{gt(i,r){return this.check(ce.gt(i,r))},gte(i,r){return this.check(ce.gte(i,r))},min(i,r){return this.check(ce.gte(i,r))},lt(i,r){return this.check(ce.lt(i,r))},lte(i,r){return this.check(ce.lte(i,r))},max(i,r){return this.check(ce.lte(i,r))},int(i){return this.check(nc(i))},safe(i){return this.check(nc(i))},positive(i){return this.check(ce.gt(0,i))},nonnegative(i){return this.check(ce.gte(0,i))},negative(i){return this.check(ce.lt(0,i))},nonpositive(i){return this.check(ce.lte(0,i))},multipleOf(i,r){return this.check(ce.multipleOf(i,r))},step(i,r){return this.check(ce.multipleOf(i,r))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function af(e){return m._number(d.ZodNumber,e)}d.ZodNumberFormat=m.$constructor("ZodNumberFormat",(e,t)=>{m.$ZodNumberFormat.init(e,t),d.ZodNumber.init(e,t)});function nc(e){return m._int(d.ZodNumberFormat,e)}function Z$(e){return m._float32(d.ZodNumberFormat,e)}function q$(e){return m._float64(d.ZodNumberFormat,e)}function V$(e){return m._int32(d.ZodNumberFormat,e)}function W$(e){return m._uint32(d.ZodNumberFormat,e)}d.ZodBoolean=m.$constructor("ZodBoolean",(e,t)=>{m.$ZodBoolean.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.booleanProcessor(e,n,i,r)});function sf(e){return m._boolean(d.ZodBoolean,e)}d.ZodBigInt=m.$constructor("ZodBigInt",(e,t)=>{m.$ZodBigInt.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(i,r,o)=>_e.bigintProcessor(e,i,r,o),e.gte=(i,r)=>e.check(ce.gte(i,r)),e.min=(i,r)=>e.check(ce.gte(i,r)),e.gt=(i,r)=>e.check(ce.gt(i,r)),e.gte=(i,r)=>e.check(ce.gte(i,r)),e.min=(i,r)=>e.check(ce.gte(i,r)),e.lt=(i,r)=>e.check(ce.lt(i,r)),e.lte=(i,r)=>e.check(ce.lte(i,r)),e.max=(i,r)=>e.check(ce.lte(i,r)),e.positive=i=>e.check(ce.gt(BigInt(0),i)),e.negative=i=>e.check(ce.lt(BigInt(0),i)),e.nonpositive=i=>e.check(ce.lte(BigInt(0),i)),e.nonnegative=i=>e.check(ce.gte(BigInt(0),i)),e.multipleOf=(i,r)=>e.check(ce.multipleOf(i,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function B$(e){return m._bigint(d.ZodBigInt,e)}d.ZodBigIntFormat=m.$constructor("ZodBigIntFormat",(e,t)=>{m.$ZodBigIntFormat.init(e,t),d.ZodBigInt.init(e,t)});function H$(e){return m._int64(d.ZodBigIntFormat,e)}function J$(e){return m._uint64(d.ZodBigIntFormat,e)}d.ZodSymbol=m.$constructor("ZodSymbol",(e,t)=>{m.$ZodSymbol.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.symbolProcessor(e,n,i,r)});function K$(e){return m._symbol(d.ZodSymbol,e)}d.ZodUndefined=m.$constructor("ZodUndefined",(e,t)=>{m.$ZodUndefined.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.undefinedProcessor(e,n,i,r)});function X$(e){return m._undefined(d.ZodUndefined,e)}d.ZodNull=m.$constructor("ZodNull",(e,t)=>{m.$ZodNull.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.nullProcessor(e,n,i,r)});function cf(e){return m._null(d.ZodNull,e)}d.ZodAny=m.$constructor("ZodAny",(e,t)=>{m.$ZodAny.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.anyProcessor(e,n,i,r)});function G$(){return m._any(d.ZodAny)}d.ZodUnknown=m.$constructor("ZodUnknown",(e,t)=>{m.$ZodUnknown.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.unknownProcessor(e,n,i,r)});function wr(){return m._unknown(d.ZodUnknown)}d.ZodNever=m.$constructor("ZodNever",(e,t)=>{m.$ZodNever.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.neverProcessor(e,n,i,r)});function ic(e){return m._never(d.ZodNever,e)}d.ZodVoid=m.$constructor("ZodVoid",(e,t)=>{m.$ZodVoid.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.voidProcessor(e,n,i,r)});function Y$(e){return m._void(d.ZodVoid,e)}d.ZodDate=m.$constructor("ZodDate",(e,t)=>{m.$ZodDate.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(i,r,o)=>_e.dateProcessor(e,i,r,o),e.min=(i,r)=>e.check(ce.gte(i,r)),e.max=(i,r)=>e.check(ce.lte(i,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Q$(e){return m._date(d.ZodDate,e)}d.ZodArray=m.$constructor("ZodArray",(e,t)=>{m.$ZodArray.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.arrayProcessor(e,n,i,r),e.element=t.element,ei(e,"ZodArray",{min(n,i){return this.check(ce.minLength(n,i))},nonempty(n){return this.check(ce.minLength(1,n))},max(n,i){return this.check(ce.maxLength(n,i))},length(n,i){return this.check(ce.length(n,i))},unwrap(){return this.element}})});function ua(e,t){return m._array(d.ZodArray,e,t)}function eI(e){let t=e._zod.def.shape;return ac(Object.keys(t))}d.ZodObject=m.$constructor("ZodObject",(e,t)=>{m.$ZodObjectJIT.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.objectProcessor(e,n,i,r),be.util.defineLazy(e,"shape",()=>t.shape),ei(e,"ZodObject",{keyof(){return ac(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:wr()})},loose(){return this.clone({...this._zod.def,catchall:wr()})},strict(){return this.clone({...this._zod.def,catchall:ic()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return be.util.extend(this,n)},safeExtend(n){return be.util.safeExtend(this,n)},merge(n){return be.util.merge(this,n)},pick(n){return be.util.pick(this,n)},omit(n){return be.util.omit(this,n)},partial(...n){return be.util.partial(d.ZodOptional,this,n[0])},required(...n){return be.util.required(d.ZodNonOptional,this,n[0])}})});function tI(e,t){let n={type:"object",shape:e??{},...be.util.normalizeParams(t)};return new d.ZodObject(n)}function nI(e,t){return new d.ZodObject({type:"object",shape:e,catchall:ic(),...be.util.normalizeParams(t)})}function rI(e,t){return new d.ZodObject({type:"object",shape:e,catchall:wr(),...be.util.normalizeParams(t)})}d.ZodUnion=m.$constructor("ZodUnion",(e,t)=>{m.$ZodUnion.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.unionProcessor(e,n,i,r),e.options=t.options});function oc(e,t){return new d.ZodUnion({type:"union",options:e,...be.util.normalizeParams(t)})}d.ZodXor=m.$constructor("ZodXor",(e,t)=>{d.ZodUnion.init(e,t),m.$ZodXor.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.unionProcessor(e,n,i,r),e.options=t.options});function iI(e,t){return new d.ZodXor({type:"union",options:e,inclusive:!1,...be.util.normalizeParams(t)})}d.ZodDiscriminatedUnion=m.$constructor("ZodDiscriminatedUnion",(e,t)=>{d.ZodUnion.init(e,t),m.$ZodDiscriminatedUnion.init(e,t)});function oI(e,t,n){return new d.ZodDiscriminatedUnion({type:"union",options:t,discriminator:e,...be.util.normalizeParams(n)})}d.ZodIntersection=m.$constructor("ZodIntersection",(e,t)=>{m.$ZodIntersection.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.intersectionProcessor(e,n,i,r)});function lf(e,t){return new d.ZodIntersection({type:"intersection",left:e,right:t})}d.ZodTuple=m.$constructor("ZodTuple",(e,t)=>{m.$ZodTuple.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.tupleProcessor(e,n,i,r),e.rest=n=>e.clone({...e._zod.def,rest:n})});function uf(e,t,n){let i=t instanceof m.$ZodType,r=i?n:t,o=i?t:null;return new d.ZodTuple({type:"tuple",items:e,rest:o,...be.util.normalizeParams(r)})}d.ZodRecord=m.$constructor("ZodRecord",(e,t)=>{m.$ZodRecord.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.recordProcessor(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType});function df(e,t,n){return!t||!t._zod?new d.ZodRecord({type:"record",keyType:sa(),valueType:e,...be.util.normalizeParams(t)}):new d.ZodRecord({type:"record",keyType:e,valueType:t,...be.util.normalizeParams(n)})}function aI(e,t,n){let i=m.clone(e);return i._zod.values=void 0,new d.ZodRecord({type:"record",keyType:i,valueType:t,...be.util.normalizeParams(n)})}function sI(e,t,n){return new d.ZodRecord({type:"record",keyType:e,valueType:t,mode:"loose",...be.util.normalizeParams(n)})}d.ZodMap=m.$constructor("ZodMap",(e,t)=>{m.$ZodMap.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.mapProcessor(e,n,i,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(m._minSize(...n)),e.nonempty=n=>e.check(m._minSize(1,n)),e.max=(...n)=>e.check(m._maxSize(...n)),e.size=(...n)=>e.check(m._size(...n))});function cI(e,t,n){return new d.ZodMap({type:"map",keyType:e,valueType:t,...be.util.normalizeParams(n)})}d.ZodSet=m.$constructor("ZodSet",(e,t)=>{m.$ZodSet.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.setProcessor(e,n,i,r),e.min=(...n)=>e.check(m._minSize(...n)),e.nonempty=n=>e.check(m._minSize(1,n)),e.max=(...n)=>e.check(m._maxSize(...n)),e.size=(...n)=>e.check(m._size(...n))});function lI(e,t){return new d.ZodSet({type:"set",valueType:e,...be.util.normalizeParams(t)})}d.ZodEnum=m.$constructor("ZodEnum",(e,t)=>{m.$ZodEnum.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(i,r,o)=>_e.enumProcessor(e,i,r,o),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(i,r)=>{let o={};for(let a of i)if(n.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new d.ZodEnum({...t,checks:[],...be.util.normalizeParams(r),entries:o})},e.exclude=(i,r)=>{let o={...t.entries};for(let a of i)if(n.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new d.ZodEnum({...t,checks:[],...be.util.normalizeParams(r),entries:o})}});function ac(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new d.ZodEnum({type:"enum",entries:n,...be.util.normalizeParams(t)})}function uI(e,t){return new d.ZodEnum({type:"enum",entries:e,...be.util.normalizeParams(t)})}d.ZodLiteral=m.$constructor("ZodLiteral",(e,t)=>{m.$ZodLiteral.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.literalProcessor(e,n,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function dI(e,t){return new d.ZodLiteral({type:"literal",values:Array.isArray(e)?e:[e],...be.util.normalizeParams(t)})}d.ZodFile=m.$constructor("ZodFile",(e,t)=>{m.$ZodFile.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.fileProcessor(e,n,i,r),e.min=(n,i)=>e.check(m._minSize(n,i)),e.max=(n,i)=>e.check(m._maxSize(n,i)),e.mime=(n,i)=>e.check(m._mime(Array.isArray(n)?n:[n],i))});function _I(e){return m._file(d.ZodFile,e)}d.ZodTransform=m.$constructor("ZodTransform",(e,t)=>{m.$ZodTransform.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.transformProcessor(e,n,i,r),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new m.$ZodEncodeError(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(be.util.issue(o,n.value,t));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(be.util.issue(a))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});function sc(e){return new d.ZodTransform({type:"transform",transform:e})}d.ZodOptional=m.$constructor("ZodOptional",(e,t)=>{m.$ZodOptional.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.optionalProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function ca(e){return new d.ZodOptional({type:"optional",innerType:e})}d.ZodExactOptional=m.$constructor("ZodExactOptional",(e,t)=>{m.$ZodExactOptional.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.optionalProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function _f(e){return new d.ZodExactOptional({type:"optional",innerType:e})}d.ZodNullable=m.$constructor("ZodNullable",(e,t)=>{m.$ZodNullable.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.nullableProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function la(e){return new d.ZodNullable({type:"nullable",innerType:e})}function fI(e){return ca(la(e))}d.ZodDefault=m.$constructor("ZodDefault",(e,t)=>{m.$ZodDefault.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.defaultProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ff(e,t){return new d.ZodDefault({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():be.util.shallowClone(t)}})}d.ZodPrefault=m.$constructor("ZodPrefault",(e,t)=>{m.$ZodPrefault.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.prefaultProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function pf(e,t){return new d.ZodPrefault({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():be.util.shallowClone(t)}})}d.ZodNonOptional=m.$constructor("ZodNonOptional",(e,t)=>{m.$ZodNonOptional.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.nonoptionalProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function mf(e,t){return new d.ZodNonOptional({type:"nonoptional",innerType:e,...be.util.normalizeParams(t)})}d.ZodSuccess=m.$constructor("ZodSuccess",(e,t)=>{m.$ZodSuccess.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.successProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function pI(e){return new d.ZodSuccess({type:"success",innerType:e})}d.ZodCatch=m.$constructor("ZodCatch",(e,t)=>{m.$ZodCatch.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.catchProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function gf(e,t){return new d.ZodCatch({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}d.ZodNaN=m.$constructor("ZodNaN",(e,t)=>{m.$ZodNaN.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.nanProcessor(e,n,i,r)});function mI(e){return m._nan(d.ZodNaN,e)}d.ZodPipe=m.$constructor("ZodPipe",(e,t)=>{m.$ZodPipe.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.pipeProcessor(e,n,i,r),e.in=t.in,e.out=t.out});function rc(e,t){return new d.ZodPipe({type:"pipe",in:e,out:t})}d.ZodCodec=m.$constructor("ZodCodec",(e,t)=>{d.ZodPipe.init(e,t),m.$ZodCodec.init(e,t)});function gI(e,t,n){return new d.ZodCodec({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function hI(e){let t=e._zod.def;return new d.ZodCodec({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}d.ZodPreprocess=m.$constructor("ZodPreprocess",(e,t)=>{d.ZodPipe.init(e,t),m.$ZodPreprocess.init(e,t)});d.ZodReadonly=m.$constructor("ZodReadonly",(e,t)=>{m.$ZodReadonly.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.readonlyProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function hf(e){return new d.ZodReadonly({type:"readonly",innerType:e})}d.ZodTemplateLiteral=m.$constructor("ZodTemplateLiteral",(e,t)=>{m.$ZodTemplateLiteral.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.templateLiteralProcessor(e,n,i,r)});function vI(e,t){return new d.ZodTemplateLiteral({type:"template_literal",parts:e,...be.util.normalizeParams(t)})}d.ZodLazy=m.$constructor("ZodLazy",(e,t)=>{m.$ZodLazy.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.lazyProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.getter()});function vf(e){return new d.ZodLazy({type:"lazy",getter:e})}d.ZodPromise=m.$constructor("ZodPromise",(e,t)=>{m.$ZodPromise.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.promiseProcessor(e,n,i,r),e.unwrap=()=>e._zod.def.innerType});function yI(e){return new d.ZodPromise({type:"promise",innerType:e})}d.ZodFunction=m.$constructor("ZodFunction",(e,t)=>{m.$ZodFunction.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.functionProcessor(e,n,i,r)});function da(e){return new d.ZodFunction({type:"function",input:Array.isArray(e?.input)?uf(e?.input):e?.input??ua(wr()),output:e?.output??wr()})}d.ZodCustom=m.$constructor("ZodCustom",(e,t)=>{m.$ZodCustom.init(e,t),d.ZodType.init(e,t),e._zod.processJSONSchema=(n,i,r)=>_e.customProcessor(e,n,i,r)});function bI(e){let t=new m.$ZodCheck({check:"custom"});return t._zod.check=e,t}function SI(e,t){return m._custom(d.ZodCustom,e??(()=>!0),t)}function yf(e,t={}){return m._refine(d.ZodCustom,e,t)}function bf(e,t){return m._superRefine(e,t)}d.describe=m.describe;d.meta=m.meta;function EI(e,t={}){let n=new d.ZodCustom({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...be.util.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}var kI=(...e)=>m._stringbool({Codec:d.ZodCodec,Boolean:d.ZodBoolean,String:d.ZodString},...e);d.stringbool=kI;function OI(e){let t=vf(()=>oc([sa(e),af(),sf(),cf(),ua(t),df(sa(),t)]));return t}function wI(e,t){return new d.ZodPreprocess({type:"pipe",in:sc(e),out:t})}});var Of=k(Ke=>{"use strict";var AI=Ke&&Ke.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),TI=Ke&&Ke.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),$I=Ke&&Ke.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&AI(t,e,n);return TI(t,e),t};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.ZodFirstPartyTypeKind=Ke.config=Ke.$brand=Ke.ZodIssueCode=void 0;Ke.setErrorMap=II;Ke.getErrorMap=NI;var Ef=$I(dt());Ke.ZodIssueCode={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var kf=dt();Object.defineProperty(Ke,"$brand",{enumerable:!0,get:function(){return kf.$brand}});Object.defineProperty(Ke,"config",{enumerable:!0,get:function(){return kf.config}});function II(e){Ef.config({customError:e})}function NI(){return Ef.config().customError}var Sf;Sf||(Ke.ZodFirstPartyTypeKind=Sf={})});var Af=k(Dn=>{"use strict";var CI=Dn&&Dn.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),RI=Dn&&Dn.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),cc=Dn&&Dn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&CI(t,e,n);return RI(t,e),t};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.fromJSONSchema=zI;var LI=Br(),MI=cc(ra()),UI=cc(Gr()),PI=cc(Yr()),q={...PI,...MI,iso:UI},xI=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function jI(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function DI(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1];if(!r||!t.defs[r])throw new Error(`Reference not found: ${e}`);return t.defs[r]}throw new Error(`Reference not found: ${e}`)}function wf(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return q.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return q.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let o=DI(r,t),a=it(o,t);return t.refs.set(r,a),t.processing.delete(r),a}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return q.null();if(r.length===0)return q.never();if(r.length===1)return q.literal(r[0]);if(r.every(a=>typeof a=="string"))return q.enum(r);let o=r.map(a=>q.literal(a));return o.length<2?o[0]:q.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return q.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(o=>{let a={...e,type:o};return wf(a,t)});return r.length===0?q.never():r.length===1?r[0]:q.union(r)}if(!n)return q.any();let i;switch(n){case"string":{let r=q.string();if(e.format){let o=e.format;o==="email"?r=r.check(q.email()):o==="uri"||o==="uri-reference"?r=r.check(q.url()):o==="uuid"||o==="guid"?r=r.check(q.uuid()):o==="date-time"?r=r.check(q.iso.datetime()):o==="date"?r=r.check(q.iso.date()):o==="time"?r=r.check(q.iso.time()):o==="duration"?r=r.check(q.iso.duration()):o==="ipv4"?r=r.check(q.ipv4()):o==="ipv6"?r=r.check(q.ipv6()):o==="mac"?r=r.check(q.mac()):o==="cidr"?r=r.check(q.cidrv4()):o==="cidr-v6"?r=r.check(q.cidrv6()):o==="base64"?r=r.check(q.base64()):o==="base64url"?r=r.check(q.base64url()):o==="e164"?r=r.check(q.e164()):o==="jwt"?r=r.check(q.jwt()):o==="emoji"?r=r.check(q.emoji()):o==="nanoid"?r=r.check(q.nanoid()):o==="cuid"?r=r.check(q.cuid()):o==="cuid2"?r=r.check(q.cuid2()):o==="ulid"?r=r.check(q.ulid()):o==="xid"?r=r.check(q.xid()):o==="ksuid"&&(r=r.check(q.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?q.number().int():q.number();typeof e.minimum=="number"&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),i=r;break}case"boolean":{i=q.boolean();break}case"null":{i=q.null();break}case"object":{let r={},o=e.properties||{},a=new Set(e.required||[]);for(let[c,l]of Object.entries(o)){let _=it(l,t);r[c]=a.has(c)?_:_.optional()}if(e.propertyNames){let c=it(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?it(e.additionalProperties,t):q.any();if(Object.keys(r).length===0){i=q.record(c,l);break}let _=q.object(r).passthrough(),u=q.looseRecord(c,l);i=q.intersection(_,u);break}if(e.patternProperties){let c=e.patternProperties,l=Object.keys(c),_=[];for(let f of l){let p=it(c[f],t),y=q.string().regex(new RegExp(f));_.push(q.looseRecord(y,p))}let u=[];if(Object.keys(r).length>0&&u.push(q.object(r).passthrough()),u.push(..._),u.length===0)i=q.object({}).passthrough();else if(u.length===1)i=u[0];else{let f=q.intersection(u[0],u[1]);for(let p=2;p<u.length;p++)f=q.intersection(f,u[p]);i=f}break}let s=q.object(r);e.additionalProperties===!1?i=s.strict():typeof e.additionalProperties=="object"?i=s.catchall(it(e.additionalProperties,t)):i=s.passthrough();break}case"array":{let r=e.prefixItems,o=e.items;if(r&&Array.isArray(r)){let a=r.map(c=>it(c,t)),s=o&&typeof o=="object"&&!Array.isArray(o)?it(o,t):void 0;s?i=q.tuple(a).rest(s):i=q.tuple(a),typeof e.minItems=="number"&&(i=i.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(q.maxLength(e.maxItems)))}else if(Array.isArray(o)){let a=o.map(c=>it(c,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?it(e.additionalItems,t):void 0;s?i=q.tuple(a).rest(s):i=q.tuple(a),typeof e.minItems=="number"&&(i=i.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(q.maxLength(e.maxItems)))}else if(o!==void 0){let a=it(o,t),s=q.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),i=s}else i=q.array(q.any());break}default:throw new Error(`Unsupported type: ${n}`)}return i}function it(e,t){if(typeof e=="boolean")return e?q.any():q.never();let n=wf(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(l=>it(l,t)),c=q.union(s);n=i?q.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(l=>it(l,t)),c=q.xor(s);n=i?q.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=i?n:q.any();else{let s=i?n:it(e.allOf[0],t),c=i?0:1;for(let l=c;l<e.allOf.length;l++)s=q.intersection(s,it(e.allOf[l],t));n=s}e.nullable===!0&&t.version==="openapi-3.0"&&(n=q.nullable(n)),e.readOnly===!0&&(n=q.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let r={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in e&&(r[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(r[s]=e[s]);for(let s of Object.keys(e))xI.has(s)||(r[s]=e[s]);return Object.keys(r).length>0&&t.registry.add(n,r),e.description&&(n=n.describe(e.description)),n}function zI(e,t){if(typeof e=="boolean")return e?q.any():q.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=jI(n,t?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??LI.globalRegistry};return it(n,o)}});var $f=k(ht=>{"use strict";var FI=ht&&ht.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),ZI=ht&&ht.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Tf=ht&&ht.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&FI(t,e,n);return ZI(t,e),t};Object.defineProperty(ht,"__esModule",{value:!0});ht.string=qI;ht.number=VI;ht.boolean=WI;ht.bigint=BI;ht.date=HI;var ti=Tf(dt()),ni=Tf(Yr());function qI(e){return ti._coercedString(ni.ZodString,e)}function VI(e){return ti._coercedNumber(ni.ZodNumber,e)}function WI(e){return ti._coercedBoolean(ni.ZodBoolean,e)}function BI(e){return ti._coercedBigint(ni.ZodBigInt,e)}function HI(e){return ti._coercedDate(ni.ZodDate,e)}});var lc=k(H=>{"use strict";var If=H&&H.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),JI=H&&H.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),_a=H&&H.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&If(t,e,n);return JI(t,e),t},ri=H&&H.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&If(t,e,n)},KI=H&&H.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(H,"__esModule",{value:!0});H.coerce=H.iso=H.ZodISODuration=H.ZodISOTime=H.ZodISODate=H.ZodISODateTime=H.locales=H.fromJSONSchema=H.toJSONSchema=H.NEVER=H.util=H.TimePrecision=H.flattenError=H.formatError=H.prettifyError=H.treeifyError=H.regexes=H.clone=H.$brand=H.$input=H.$output=H.config=H.registry=H.globalRegistry=H.core=void 0;H.core=_a(dt());ri(Yr(),H);ri(ra(),H);ri(Qs(),H);ri(ec(),H);ri(Of(),H);var XI=dt(),GI=KI(Ws());(0,XI.config)((0,GI.default)());var st=dt();Object.defineProperty(H,"globalRegistry",{enumerable:!0,get:function(){return st.globalRegistry}});Object.defineProperty(H,"registry",{enumerable:!0,get:function(){return st.registry}});Object.defineProperty(H,"config",{enumerable:!0,get:function(){return st.config}});Object.defineProperty(H,"$output",{enumerable:!0,get:function(){return st.$output}});Object.defineProperty(H,"$input",{enumerable:!0,get:function(){return st.$input}});Object.defineProperty(H,"$brand",{enumerable:!0,get:function(){return st.$brand}});Object.defineProperty(H,"clone",{enumerable:!0,get:function(){return st.clone}});Object.defineProperty(H,"regexes",{enumerable:!0,get:function(){return st.regexes}});Object.defineProperty(H,"treeifyError",{enumerable:!0,get:function(){return st.treeifyError}});Object.defineProperty(H,"prettifyError",{enumerable:!0,get:function(){return st.prettifyError}});Object.defineProperty(H,"formatError",{enumerable:!0,get:function(){return st.formatError}});Object.defineProperty(H,"flattenError",{enumerable:!0,get:function(){return st.flattenError}});Object.defineProperty(H,"TimePrecision",{enumerable:!0,get:function(){return st.TimePrecision}});Object.defineProperty(H,"util",{enumerable:!0,get:function(){return st.util}});Object.defineProperty(H,"NEVER",{enumerable:!0,get:function(){return st.NEVER}});var YI=Xr();Object.defineProperty(H,"toJSONSchema",{enumerable:!0,get:function(){return YI.toJSONSchema}});var QI=Af();Object.defineProperty(H,"fromJSONSchema",{enumerable:!0,get:function(){return QI.fromJSONSchema}});H.locales=_a(Js());var fa=Gr();Object.defineProperty(H,"ZodISODateTime",{enumerable:!0,get:function(){return fa.ZodISODateTime}});Object.defineProperty(H,"ZodISODate",{enumerable:!0,get:function(){return fa.ZodISODate}});Object.defineProperty(H,"ZodISOTime",{enumerable:!0,get:function(){return fa.ZodISOTime}});Object.defineProperty(H,"ZodISODuration",{enumerable:!0,get:function(){return fa.ZodISODuration}});H.iso=_a(Gr());H.coerce=_a($f())});var ct=k(_t=>{"use strict";var Nf=_t&&_t.__createBinding||(Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]})),eN=_t&&_t.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),tN=_t&&_t.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&Nf(t,e,n);return eN(t,e),t},nN=_t&&_t.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&Nf(t,e,n)};Object.defineProperty(_t,"__esModule",{value:!0});_t.z=void 0;var Cf=tN(lc());_t.z=Cf;nN(lc(),_t);_t.default=Cf});var Se=k(tt=>{"use strict";var dc=Symbol.for("yaml.alias"),xf=Symbol.for("yaml.document"),ma=Symbol.for("yaml.map"),jf=Symbol.for("yaml.pair"),_c=Symbol.for("yaml.scalar"),ga=Symbol.for("yaml.seq"),Fn=Symbol.for("yaml.node.type"),ON=e=>!!e&&typeof e=="object"&&e[Fn]===dc,wN=e=>!!e&&typeof e=="object"&&e[Fn]===xf,AN=e=>!!e&&typeof e=="object"&&e[Fn]===ma,TN=e=>!!e&&typeof e=="object"&&e[Fn]===jf,Df=e=>!!e&&typeof e=="object"&&e[Fn]===_c,$N=e=>!!e&&typeof e=="object"&&e[Fn]===ga;function zf(e){if(e&&typeof e=="object")switch(e[Fn]){case ma:case ga:return!0}return!1}function IN(e){if(e&&typeof e=="object")switch(e[Fn]){case dc:case ma:case _c:case ga:return!0}return!1}var NN=e=>(Df(e)||zf(e))&&!!e.anchor;tt.ALIAS=dc;tt.DOC=xf;tt.MAP=ma;tt.NODE_TYPE=Fn;tt.PAIR=jf;tt.SCALAR=_c;tt.SEQ=ga;tt.hasAnchor=NN;tt.isAlias=ON;tt.isCollection=zf;tt.isDocument=wN;tt.isMap=AN;tt.isNode=IN;tt.isPair=TN;tt.isScalar=Df;tt.isSeq=$N});var ii=k(fc=>{"use strict";var He=Se(),ft=Symbol("break visit"),Ff=Symbol("skip children"),Cn=Symbol("remove node");function ha(e,t){let n=Zf(t);He.isDocument(e)?Tr(null,e.contents,n,Object.freeze([e]))===Cn&&(e.contents=null):Tr(null,e,n,Object.freeze([]))}ha.BREAK=ft;ha.SKIP=Ff;ha.REMOVE=Cn;function Tr(e,t,n,i){let r=qf(e,t,n,i);if(He.isNode(r)||He.isPair(r))return Vf(e,i,r),Tr(e,r,n,i);if(typeof r!="symbol"){if(He.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let a=Tr(o,t.items[o],n,i);if(typeof a=="number")o=a-1;else{if(a===ft)return ft;a===Cn&&(t.items.splice(o,1),o-=1)}}}else if(He.isPair(t)){i=Object.freeze(i.concat(t));let o=Tr("key",t.key,n,i);if(o===ft)return ft;o===Cn&&(t.key=null);let a=Tr("value",t.value,n,i);if(a===ft)return ft;a===Cn&&(t.value=null)}}return r}async function va(e,t){let n=Zf(t);He.isDocument(e)?await $r(null,e.contents,n,Object.freeze([e]))===Cn&&(e.contents=null):await $r(null,e,n,Object.freeze([]))}va.BREAK=ft;va.SKIP=Ff;va.REMOVE=Cn;async function $r(e,t,n,i){let r=await qf(e,t,n,i);if(He.isNode(r)||He.isPair(r))return Vf(e,i,r),$r(e,r,n,i);if(typeof r!="symbol"){if(He.isCollection(t)){i=Object.freeze(i.concat(t));for(let o=0;o<t.items.length;++o){let a=await $r(o,t.items[o],n,i);if(typeof a=="number")o=a-1;else{if(a===ft)return ft;a===Cn&&(t.items.splice(o,1),o-=1)}}}else if(He.isPair(t)){i=Object.freeze(i.concat(t));let o=await $r("key",t.key,n,i);if(o===ft)return ft;o===Cn&&(t.key=null);let a=await $r("value",t.value,n,i);if(a===ft)return ft;a===Cn&&(t.value=null)}}return r}function Zf(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function qf(e,t,n,i){if(typeof n=="function")return n(e,t,i);if(He.isMap(t))return n.Map?.(e,t,i);if(He.isSeq(t))return n.Seq?.(e,t,i);if(He.isPair(t))return n.Pair?.(e,t,i);if(He.isScalar(t))return n.Scalar?.(e,t,i);if(He.isAlias(t))return n.Alias?.(e,t,i)}function Vf(e,t,n){let i=t[t.length-1];if(He.isCollection(i))i.items[e]=n;else if(He.isPair(i))e==="key"?i.key=n:i.value=n;else if(He.isDocument(i))i.contents=n;else{let r=He.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}fc.visit=ha;fc.visitAsync=va});var pc=k(Bf=>{"use strict";var Wf=Se(),CN=ii(),RN={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},LN=e=>e.replace(/[!,[\]{}]/g,t=>RN[t]),oi=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let i=t.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[o,a]=i;return this.tags[o]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let a=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,a),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){let a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}let[,i,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(r)}catch(a){return n(String(a)),null}return i==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(let[n,i]of Object.entries(this.tags))if(t.startsWith(i))return n+LN(t.substring(i.length));return t[0]==="!"?t:`!<${t}>`}toString(t){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(t&&i.length>0&&Wf.isNode(t.contents)){let o={};CN.visit(t.contents,(a,s)=>{Wf.isNode(s)&&s.tag&&(o[s.tag]=!0)}),r=Object.keys(o)}else r=[];for(let[o,a]of i)o==="!!"&&a==="tag:yaml.org,2002:"||(!t||r.some(s=>s.startsWith(a)))&&n.push(`%TAG ${o} ${a}`);return n.join(`
|
|
66
|
+
`)}};oi.defaultYaml={explicit:!1,version:"1.2"};oi.defaultTags={"!!":"tag:yaml.org,2002:"};Bf.Directives=oi});var ya=k(ai=>{"use strict";var Hf=Se(),MN=ii();function UN(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Jf(e){let t=new Set;return MN.visit(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function Kf(e,t){for(let n=1;;++n){let i=`${e}${n}`;if(!t.has(i))return i}}function PN(e,t){let n=[],i=new Map,r=null;return{onAnchor:o=>{n.push(o),r??(r=Jf(e));let a=Kf(t,r);return r.add(a),a},setAnchors:()=>{for(let o of n){let a=i.get(o);if(typeof a=="object"&&a.anchor&&(Hf.isScalar(a.node)||Hf.isCollection(a.node)))a.node.anchor=a.anchor;else{let s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=o,s}}},sourceObjects:i}}ai.anchorIsValid=UN;ai.anchorNames=Jf;ai.createNodeAnchors=PN;ai.findNewAnchor=Kf});var mc=k(Xf=>{"use strict";function si(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,o=i.length;r<o;++r){let a=i[r],s=si(e,i,String(r),a);s===void 0?delete i[r]:s!==a&&(i[r]=s)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let o=i.get(r),a=si(e,i,r,o);a===void 0?i.delete(r):a!==o&&i.set(r,a)}else if(i instanceof Set)for(let r of Array.from(i)){let o=si(e,i,r,r);o===void 0?i.delete(r):o!==r&&(i.delete(r),i.add(o))}else for(let[r,o]of Object.entries(i)){let a=si(e,i,r,o);a===void 0?delete i[r]:a!==o&&(i[r]=a)}return e.call(t,n,i)}Xf.applyReviver=si});var Jn=k(Yf=>{"use strict";var xN=Se();function Gf(e,t,n){if(Array.isArray(e))return e.map((i,r)=>Gf(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!xN.hasAnchor(e))return e.toJSON(t,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(e,i),n.onCreate=o=>{i.res=o,delete n.onCreate};let r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!n?.keep?Number(e):e}Yf.toJS=Gf});var ba=k(ep=>{"use strict";var jN=mc(),Qf=Se(),DN=Jn(),gc=class{constructor(t){Object.defineProperty(this,Qf.NODE_TYPE,{value:t})}clone(){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){if(!Qf.isDocument(t))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},s=DN.toJS(this,"",a);if(typeof r=="function")for(let{count:c,res:l}of a.anchors.values())r(l,c);return typeof o=="function"?jN.applyReviver(o,{"":s},"",s):s}};ep.NodeBase=gc});var ci=k(tp=>{"use strict";var zN=ya(),FN=ii(),Ir=Se(),ZN=ba(),qN=Jn(),hc=class extends ZN.NodeBase{constructor(t){super(Ir.ALIAS),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],FN.visit(t,{Node:(o,a)=>{(Ir.isAlias(a)||Ir.hasAnchor(a))&&i.push(a)}}),n&&(n.aliasResolveCache=i));let r;for(let o of i){if(o===this)break;o.anchor===this.source&&(r=o)}return r}toJSON(t,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:o}=n,a=this.resolve(r,n);if(!a){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=i.get(a);if(s||(qN.toJS(a,null,n),s=i.get(a)),s?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=Sa(r,a,i)),s.count*s.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(t,n,i){let r=`*${this.source}`;if(t){if(zN.anchorIsValid(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${r} `}return r}};function Sa(e,t,n){if(Ir.isAlias(t)){let i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(Ir.isCollection(t)){let i=0;for(let r of t.items){let o=Sa(e,r,n);o>i&&(i=o)}return i}else if(Ir.isPair(t)){let i=Sa(e,t.key,n),r=Sa(e,t.value,n);return Math.max(i,r)}return 1}tp.Alias=hc});var We=k(vc=>{"use strict";var VN=Se(),WN=ba(),BN=Jn(),HN=e=>!e||typeof e!="function"&&typeof e!="object",Kn=class extends WN.NodeBase{constructor(t){super(VN.SCALAR),this.value=t}toJSON(t,n){return n?.keep?this.value:BN.toJS(this.value,t,n)}toString(){return String(this.value)}};Kn.BLOCK_FOLDED="BLOCK_FOLDED";Kn.BLOCK_LITERAL="BLOCK_LITERAL";Kn.PLAIN="PLAIN";Kn.QUOTE_DOUBLE="QUOTE_DOUBLE";Kn.QUOTE_SINGLE="QUOTE_SINGLE";vc.Scalar=Kn;vc.isScalarValue=HN});var li=k(rp=>{"use strict";var JN=ci(),sr=Se(),np=We(),KN="tag:yaml.org,2002:";function XN(e,t,n){if(t){let i=n.filter(o=>o.tag===t),r=i.find(o=>!o.format)??i[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(i=>i.identify?.(e)&&!i.format)}function GN(e,t,n){if(sr.isDocument(e)&&(e=e.contents),sr.isNode(e))return e;if(sr.isPair(e)){let u=n.schema[sr.MAP].createNode?.(n.schema,null,n);return u.items.push(e),u}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:o,schema:a,sourceObjects:s}=n,c;if(i&&e&&typeof e=="object"){if(c=s.get(e),c)return c.anchor??(c.anchor=r(e)),new JN.Alias(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith("!!")&&(t=KN+t.slice(2));let l=XN(e,t,a.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){let u=new np.Scalar(e);return c&&(c.node=u),u}l=e instanceof Map?a[sr.MAP]:Symbol.iterator in Object(e)?a[sr.SEQ]:a[sr.MAP]}o&&(o(l),delete n.onTagObj);let _=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new np.Scalar(e);return t?_.tag=t:l.default||(_.tag=l.tag),c&&(c.node=_),_}rp.createNode=GN});var ka=k(Ea=>{"use strict";var YN=li(),Rn=Se(),QN=ba();function yc(e,t,n){let i=n;for(let r=t.length-1;r>=0;--r){let o=t[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let a=[];a[o]=i,i=a}else i=new Map([[o,i]])}return YN.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var ip=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,bc=class extends QN.NodeBase{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(i=>Rn.isNode(i)||Rn.isPair(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(ip(t))this.add(n);else{let[i,...r]=t,o=this.get(i,!0);if(Rn.isCollection(o))o.addIn(r,n);else if(o===void 0&&this.schema)this.set(i,yc(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(t){let[n,...i]=t;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(Rn.isCollection(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(t,n){let[i,...r]=t,o=this.get(i,!0);return r.length===0?!n&&Rn.isScalar(o)?o.value:o:Rn.isCollection(o)?o.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Rn.isPair(n))return!1;let i=n.value;return i==null||t&&Rn.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(t){let[n,...i]=t;if(i.length===0)return this.has(n);let r=this.get(n,!0);return Rn.isCollection(r)?r.hasIn(i):!1}setIn(t,n){let[i,...r]=t;if(r.length===0)this.set(i,n);else{let o=this.get(i,!0);if(Rn.isCollection(o))o.setIn(r,n);else if(o===void 0&&this.schema)this.set(i,yc(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};Ea.Collection=bc;Ea.collectionFromPath=yc;Ea.isEmptyPath=ip});var ui=k(Oa=>{"use strict";var eC=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Sc(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var tC=(e,t,n)=>e.endsWith(`
|
|
67
|
+
`)?Sc(n,t):n.includes(`
|
|
68
|
+
`)?`
|
|
69
|
+
`+Sc(n,t):(e.endsWith(" ")?"":" ")+n;Oa.indentComment=Sc;Oa.lineComment=tC;Oa.stringifyComment=eC});var ap=k(di=>{"use strict";var nC="flow",Ec="block",wa="quoted";function rC(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:o=20,onFold:a,onOverflow:s}={}){if(!r||r<0)return e;r<o&&(o=0);let c=Math.max(1+o,1+r-t.length);if(e.length<=c)return e;let l=[],_={},u=r-t.length;typeof i=="number"&&(i>r-Math.max(2,o)?l.push(0):u=r-i);let f,p,y=!1,v=-1,h=-1,O=-1;n===Ec&&(v=op(e,v,t.length),v!==-1&&(u=v+c));for(let D;D=e[v+=1];){if(n===wa&&D==="\\"){switch(h=v,e[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}O=v}if(D===`
|
|
70
|
+
`)n===Ec&&(v=op(e,v,t.length)),u=v+t.length+c,f=void 0;else{if(D===" "&&p&&p!==" "&&p!==`
|
|
71
|
+
`&&p!==" "){let b=e[v+1];b&&b!==" "&&b!==`
|
|
72
|
+
`&&b!==" "&&(f=v)}if(v>=u)if(f)l.push(f),u=f+c,f=void 0;else if(n===wa){for(;p===" "||p===" ";)p=D,D=e[v+=1],y=!0;let b=v>O+1?v-2:h-1;if(_[b])return e;l.push(b),_[b]=!0,u=b+c,f=void 0}else y=!0}p=D}if(y&&s&&s(),l.length===0)return e;a&&a();let C=e.slice(0,l[0]);for(let D=0;D<l.length;++D){let b=l[D],E=l[D+1]||e.length;b===0?C=`
|
|
73
|
+
${t}${e.slice(0,E)}`:(n===wa&&_[b]&&(C+=`${e[b]}\\`),C+=`
|
|
74
|
+
${t}${e.slice(b+1,E)}`)}return C}function op(e,t,n){let i=t,r=t+1,o=e[r];for(;o===" "||o===" ";)if(t<r+n)o=e[++t];else{do o=e[++t];while(o&&o!==`
|
|
75
|
+
`);i=t,r=t+1,o=e[r]}return i}di.FOLD_BLOCK=Ec;di.FOLD_FLOW=nC;di.FOLD_QUOTED=wa;di.foldFlowLines=rC});var fi=k(sp=>{"use strict";var $t=We(),Xn=ap(),Ta=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$a=e=>/^(%|---|\.\.\.)/m.test(e);function iC(e,t,n){if(!t||t<0)return!1;let i=t-n,r=e.length;if(r<=i)return!1;for(let o=0,a=0;o<r;++o)if(e[o]===`
|
|
76
|
+
`){if(o-a>i)return!0;if(a=o+1,r-a<=i)return!1}return!0}function _i(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,o=t.indent||($a(e)?" ":""),a="",s=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(s,c)+"\\ ",c+=1,s=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{a+=n.slice(s,c);let _=n.substr(c+2,4);switch(_){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:_.substr(0,2)==="00"?a+="\\x"+_.substr(2):a+=n.substr(c,6)}c+=5,s=c+1}break;case"n":if(i||n[c+2]==='"'||n.length<r)c+=1;else{for(a+=n.slice(s,c)+`
|
|
77
|
+
|
|
78
|
+
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)a+=`
|
|
79
|
+
`,c+=2;a+=o,n[c+2]===" "&&(a+="\\"),c+=1,s=c+1}break;default:c+=1}return a=s?a+n.slice(s):n,i?a:Xn.foldFlowLines(a,o,Xn.FOLD_QUOTED,Ta(t,!1))}function kc(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
80
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return _i(e,t);let n=t.indent||($a(e)?" ":""),i="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
81
|
+
${n}`)+"'";return t.implicitKey?i:Xn.foldFlowLines(i,n,Xn.FOLD_FLOW,Ta(t,!1))}function Nr(e,t){let{singleQuote:n}=t.options,i;if(n===!1)i=_i;else{let r=e.includes('"'),o=e.includes("'");r&&!o?i=kc:o&&!r?i=_i:i=n?kc:_i}return i(e,t)}var Oc;try{Oc=new RegExp(`(^|(?<!
|
|
82
|
+
))
|
|
83
|
+
+(?!
|
|
84
|
+
|$)`,"g")}catch{Oc=/\n+(?!\n|$)/g}function Aa({comment:e,type:t,value:n},i,r,o){let{blockQuote:a,commentString:s,lineWidth:c}=i.options;if(!a||/\n[\t ]+$/.test(n))return Nr(n,i);let l=i.indent||(i.forceBlockIndent||$a(n)?" ":""),_=a==="literal"?!0:a==="folded"||t===$t.Scalar.BLOCK_FOLDED?!1:t===$t.Scalar.BLOCK_LITERAL?!0:!iC(n,c,l.length);if(!n)return _?`|
|
|
85
|
+
`:`>
|
|
86
|
+
`;let u,f;for(f=n.length;f>0;--f){let E=n[f-1];if(E!==`
|
|
87
|
+
`&&E!==" "&&E!==" ")break}let p=n.substring(f),y=p.indexOf(`
|
|
88
|
+
`);y===-1?u="-":n===p||y!==p.length-1?(u="+",o&&o()):u="",p&&(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
89
|
+
`&&(p=p.slice(0,-1)),p=p.replace(Oc,`$&${l}`));let v=!1,h,O=-1;for(h=0;h<n.length;++h){let E=n[h];if(E===" ")v=!0;else if(E===`
|
|
90
|
+
`)O=h;else break}let C=n.substring(0,O<h?O+1:h);C&&(n=n.substring(C.length),C=C.replace(/\n+/g,`$&${l}`));let b=(v?l?"2":"1":"")+u;if(e&&(b+=" "+s(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!_){let E=n.replace(/\n+/g,`
|
|
91
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),A=!1,R=Ta(i,!0);a!=="folded"&&t!==$t.Scalar.BLOCK_FOLDED&&(R.onOverflow=()=>{A=!0});let I=Xn.foldFlowLines(`${C}${E}${p}`,l,Xn.FOLD_BLOCK,R);if(!A)return`>${b}
|
|
92
|
+
${l}${I}`}return n=n.replace(/\n+/g,`$&${l}`),`|${b}
|
|
93
|
+
${l}${C}${n}${p}`}function oC(e,t,n,i){let{type:r,value:o}=e,{actualString:a,implicitKey:s,indent:c,indentStep:l,inFlow:_}=t;if(s&&o.includes(`
|
|
94
|
+
`)||_&&/[[\]{},]/.test(o))return Nr(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return s||_||!o.includes(`
|
|
95
|
+
`)?Nr(o,t):Aa(e,t,n,i);if(!s&&!_&&r!==$t.Scalar.PLAIN&&o.includes(`
|
|
96
|
+
`))return Aa(e,t,n,i);if($a(o)){if(c==="")return t.forceBlockIndent=!0,Aa(e,t,n,i);if(s&&c===l)return Nr(o,t)}let u=o.replace(/\n+/g,`$&
|
|
97
|
+
${c}`);if(a){let f=v=>v.default&&v.tag!=="tag:yaml.org,2002:str"&&v.test?.test(u),{compat:p,tags:y}=t.doc.schema;if(y.some(f)||p?.some(f))return Nr(o,t)}return s?u:Xn.foldFlowLines(u,c,Xn.FOLD_FLOW,Ta(t,!1))}function aC(e,t,n,i){let{implicitKey:r,inFlow:o}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==$t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(s=$t.Scalar.QUOTE_DOUBLE);let c=_=>{switch(_){case $t.Scalar.BLOCK_FOLDED:case $t.Scalar.BLOCK_LITERAL:return r||o?Nr(a.value,t):Aa(a,t,n,i);case $t.Scalar.QUOTE_DOUBLE:return _i(a.value,t);case $t.Scalar.QUOTE_SINGLE:return kc(a.value,t);case $t.Scalar.PLAIN:return oC(a,t,n,i);default:return null}},l=c(s);if(l===null){let{defaultKeyType:_,defaultStringType:u}=t.options,f=r&&_||u;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}sp.stringifyString=aC});var pi=k(wc=>{"use strict";var sC=ya(),Gn=Se(),cC=ui(),lC=fi();function uC(e,t){let n=Object.assign({blockQuote:!0,commentString:cC.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function dC(e,t){if(t.tag){let r=e.filter(o=>o.tag===t.tag);if(r.length>0)return r.find(o=>o.format===t.format)??r[0]}let n,i;if(Gn.isScalar(t)){i=t.value;let r=e.filter(o=>o.identify?.(i));if(r.length>1){let o=r.filter(a=>a.test);o.length>0&&(r=o)}n=r.find(o=>o.format===t.format)??r.find(o=>!o.format)}else i=t,n=e.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function _C(e,t,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],o=(Gn.isScalar(e)||Gn.isCollection(e))&&e.anchor;o&&sC.anchorIsValid(o)&&(n.add(o),r.push(`&${o}`));let a=e.tag??(t.default?null:t.tag);return a&&r.push(i.directives.tagString(a)),r.join(" ")}function fC(e,t,n,i){if(Gn.isPair(e))return e.toString(t,n,i);if(Gn.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r,o=Gn.isNode(e)?e:t.doc.createNode(e,{onTagObj:c=>r=c});r??(r=dC(t.doc.schema.tags,o));let a=_C(o,r,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);let s=typeof r.stringify=="function"?r.stringify(o,t,n,i):Gn.isScalar(o)?lC.stringifyString(o,t,n,i):o.toString(t,n,i);return a?Gn.isScalar(o)||s[0]==="{"||s[0]==="["?`${a} ${s}`:`${a}
|
|
98
|
+
${t.indent}${s}`:s}wc.createStringifyContext=uC;wc.stringify=fC});var dp=k(up=>{"use strict";var Zn=Se(),cp=We(),lp=pi(),mi=ui();function pC({key:e,value:t},n,i,r){let{allNullValues:o,doc:a,indent:s,indentStep:c,options:{commentString:l,indentSeq:_,simpleKeys:u}}=n,f=Zn.isNode(e)&&e.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Zn.isCollection(e)||!Zn.isNode(e)&&typeof e=="object"){let R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let p=!u&&(!e||f&&t==null&&!n.inFlow||Zn.isCollection(e)||(Zn.isScalar(e)?e.type===cp.Scalar.BLOCK_FOLDED||e.type===cp.Scalar.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(u||!o),indent:s+c});let y=!1,v=!1,h=lp.stringify(e,n,()=>y=!0,()=>v=!0);if(!p&&!n.inFlow&&h.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||t==null)return y&&i&&i(),h===""?"?":p?`? ${h}`:h}else if(o&&!u||t==null&&p)return h=`? ${h}`,f&&!y?h+=mi.lineComment(h,n.indent,l(f)):v&&r&&r(),h;y&&(f=null),p?(f&&(h+=mi.lineComment(h,n.indent,l(f))),h=`? ${h}
|
|
99
|
+
${s}:`):(h=`${h}:`,f&&(h+=mi.lineComment(h,n.indent,l(f))));let O,C,D;Zn.isNode(t)?(O=!!t.spaceBefore,C=t.commentBefore,D=t.comment):(O=!1,C=null,D=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!f&&Zn.isScalar(t)&&(n.indentAtStart=h.length+1),v=!1,!_&&c.length>=2&&!n.inFlow&&!p&&Zn.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,E=lp.stringify(t,n,()=>b=!0,()=>v=!0),A=" ";if(f||O||C){if(A=O?`
|
|
100
|
+
`:"",C){let R=l(C);A+=`
|
|
101
|
+
${mi.indentComment(R,n.indent)}`}E===""&&!n.inFlow?A===`
|
|
102
|
+
`&&D&&(A=`
|
|
103
|
+
|
|
104
|
+
`):A+=`
|
|
105
|
+
${n.indent}`}else if(!p&&Zn.isCollection(t)){let R=E[0],I=E.indexOf(`
|
|
106
|
+
`),V=I!==-1,le=n.inFlow??t.flow??t.items.length===0;if(V||!le){let re=!1;if(V&&(R==="&"||R==="!")){let K=E.indexOf(" ");R==="&"&&K!==-1&&K<I&&E[K+1]==="!"&&(K=E.indexOf(" ",K+1)),(K===-1||I<K)&&(re=!0)}re||(A=`
|
|
107
|
+
${n.indent}`)}}else(E===""||E[0]===`
|
|
108
|
+
`)&&(A="");return h+=A+E,n.inFlow?b&&i&&i():D&&!b?h+=mi.lineComment(h,n.indent,l(D)):v&&r&&r(),h}up.stringifyPair=pC});var Tc=k(Ac=>{"use strict";var _p=require("process");function mC(e,...t){e==="debug"&&console.log(...t)}function gC(e,t){(e==="debug"||e==="warn")&&(typeof _p.emitWarning=="function"?_p.emitWarning(t):console.warn(t))}Ac.debug=mC;Ac.warn=gC});var La=k(Ra=>{"use strict";var Ca=Se(),fp=We(),Ia="<<",Na={identify:e=>e===Ia||typeof e=="symbol"&&e.description===Ia,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new fp.Scalar(Symbol(Ia)),{addToJSMap:pp}),stringify:()=>Ia},hC=(e,t)=>(Na.identify(t)||Ca.isScalar(t)&&(!t.type||t.type===fp.Scalar.PLAIN)&&Na.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Na.tag&&n.default);function pp(e,t,n){let i=mp(e,n);if(Ca.isSeq(i))for(let r of i.items)$c(e,t,r);else if(Array.isArray(i))for(let r of i)$c(e,t,r);else $c(e,t,i)}function $c(e,t,n){let i=mp(e,n);if(!Ca.isMap(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,e,Map);for(let[o,a]of r)t instanceof Map?t.has(o)||t.set(o,a):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function mp(e,t){return e&&Ca.isAlias(t)?t.resolve(e.doc,e):t}Ra.addMergeToJSMap=pp;Ra.isMergeKey=hC;Ra.merge=Na});var Nc=k(vp=>{"use strict";var vC=Tc(),gp=La(),yC=pi(),hp=Se(),Ic=Jn();function bC(e,t,{key:n,value:i}){if(hp.isNode(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(gp.isMergeKey(e,n))gp.addMergeToJSMap(e,t,i);else{let r=Ic.toJS(n,"",e);if(t instanceof Map)t.set(r,Ic.toJS(i,r,e));else if(t instanceof Set)t.add(r);else{let o=SC(n,r,e),a=Ic.toJS(i,o,e);o in t?Object.defineProperty(t,o,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[o]=a}}return t}function SC(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(hp.isNode(e)&&n?.doc){let i=yC.createStringifyContext(n.doc,{});i.anchors=new Set;for(let o of n.anchors.keys())i.anchors.add(o.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=e.toString(i);if(!n.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),vC.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}vp.addPairToJSMap=bC});var Yn=k(Cc=>{"use strict";var yp=li(),EC=dp(),kC=Nc(),Ma=Se();function OC(e,t,n){let i=yp.createNode(e,void 0,n),r=yp.createNode(t,void 0,n);return new Ua(i,r)}var Ua=class e{constructor(t,n=null){Object.defineProperty(this,Ma.NODE_TYPE,{value:Ma.PAIR}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return Ma.isNode(n)&&(n=n.clone(t)),Ma.isNode(i)&&(i=i.clone(t)),new e(n,i)}toJSON(t,n){let i=n?.mapAsMap?new Map:{};return kC.addPairToJSMap(n,i,this)}toString(t,n,i){return t?.doc?EC.stringifyPair(this,t,n,i):JSON.stringify(this)}};Cc.Pair=Ua;Cc.createPair=OC});var Rc=k(Sp=>{"use strict";var cr=Se(),bp=pi(),Pa=ui();function wC(e,t,n){return(t.inFlow??e.flow?TC:AC)(e,t,n)}function AC({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:o,onChompKeep:a,onComment:s}){let{indent:c,options:{commentString:l}}=n,_=Object.assign({},n,{indent:o,type:null}),u=!1,f=[];for(let y=0;y<t.length;++y){let v=t[y],h=null;if(cr.isNode(v))!u&&v.spaceBefore&&f.push(""),xa(n,f,v.commentBefore,u),v.comment&&(h=v.comment);else if(cr.isPair(v)){let C=cr.isNode(v.key)?v.key:null;C&&(!u&&C.spaceBefore&&f.push(""),xa(n,f,C.commentBefore,u))}u=!1;let O=bp.stringify(v,_,()=>h=null,()=>u=!0);h&&(O+=Pa.lineComment(O,o,l(h))),u&&h&&(u=!1),f.push(i+O)}let p;if(f.length===0)p=r.start+r.end;else{p=f[0];for(let y=1;y<f.length;++y){let v=f[y];p+=v?`
|
|
109
|
+
${c}${v}`:`
|
|
110
|
+
`}}return e?(p+=`
|
|
111
|
+
`+Pa.indentComment(l(e),c),s&&s()):u&&a&&a(),p}function TC({items:e},t,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:o,flowCollectionPadding:a,options:{commentString:s}}=t;i+=o;let c=Object.assign({},t,{indent:i,inFlow:!0,type:null}),l=!1,_=0,u=[];for(let y=0;y<e.length;++y){let v=e[y],h=null;if(cr.isNode(v))v.spaceBefore&&u.push(""),xa(t,u,v.commentBefore,!1),v.comment&&(h=v.comment);else if(cr.isPair(v)){let C=cr.isNode(v.key)?v.key:null;C&&(C.spaceBefore&&u.push(""),xa(t,u,C.commentBefore,!1),C.comment&&(l=!0));let D=cr.isNode(v.value)?v.value:null;D?(D.comment&&(h=D.comment),D.commentBefore&&(l=!0)):v.value==null&&C?.comment&&(h=C.comment)}h&&(l=!0);let O=bp.stringify(v,c,()=>h=null);l||(l=u.length>_||O.includes(`
|
|
112
|
+
`)),y<e.length-1?O+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=u.reduce((C,D)=>C+D.length+2,2)+(O.length+2)>t.options.lineWidth)),l&&(O+=",")),h&&(O+=Pa.lineComment(O,i,s(h))),u.push(O),_=u.length}let{start:f,end:p}=n;if(u.length===0)return f+p;if(!l){let y=u.reduce((v,h)=>v+h.length+2,2);l=t.options.lineWidth>0&&y>t.options.lineWidth}if(l){let y=f;for(let v of u)y+=v?`
|
|
113
|
+
${o}${r}${v}`:`
|
|
114
|
+
`;return`${y}
|
|
115
|
+
${r}${p}`}else return`${f}${a}${u.join(" ")}${a}${p}`}function xa({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let o=Pa.indentComment(t(i),e);n.push(o.trimStart())}}Sp.stringifyCollection=wC});var er=k(Mc=>{"use strict";var $C=Rc(),IC=Nc(),NC=ka(),Qn=Se(),ja=Yn(),CC=We();function gi(e,t){let n=Qn.isScalar(t)?t.value:t;for(let i of e)if(Qn.isPair(i)&&(i.key===t||i.key===n||Qn.isScalar(i.key)&&i.key.value===n))return i}var Lc=class extends NC.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Qn.MAP,t),this.items=[]}static from(t,n,i){let{keepUndefined:r,replacer:o}=i,a=new this(t),s=(c,l)=>{if(typeof o=="function")l=o.call(n,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||r)&&a.items.push(ja.createPair(c,l,i))};if(n instanceof Map)for(let[c,l]of n)s(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))s(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){let i;Qn.isPair(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new ja.Pair(t,t?.value):i=new ja.Pair(t.key,t.value);let r=gi(this.items,i.key),o=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);Qn.isScalar(r.value)&&CC.isScalarValue(i.value)?r.value.value=i.value:r.value=i.value}else if(o){let a=this.items.findIndex(s=>o(i,s)<0);a===-1?this.items.push(i):this.items.splice(a,0,i)}else this.items.push(i)}delete(t){let n=gi(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){let r=gi(this.items,t)?.value;return(!n&&Qn.isScalar(r)?r.value:r)??void 0}has(t){return!!gi(this.items,t)}set(t,n){this.add(new ja.Pair(t,n),!0)}toJSON(t,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let o of this.items)IC.addPairToJSMap(n,r,o);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(let r of this.items)if(!Qn.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),$C.stringifyCollection(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}};Mc.YAMLMap=Lc;Mc.findPair=gi});var Cr=k(kp=>{"use strict";var RC=Se(),Ep=er(),LC={collection:"map",default:!0,nodeClass:Ep.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){return RC.isMap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ep.YAMLMap.from(e,t,n)};kp.map=LC});var tr=k(Op=>{"use strict";var MC=li(),UC=Rc(),PC=ka(),za=Se(),xC=We(),jC=Jn(),Uc=class extends PC.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(za.SEQ,t),this.items=[]}add(t){this.items.push(t)}delete(t){let n=Da(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){let i=Da(t);if(typeof i!="number")return;let r=this.items[i];return!n&&za.isScalar(r)?r.value:r}has(t){let n=Da(t);return typeof n=="number"&&n<this.items.length}set(t,n){let i=Da(t);if(typeof i!="number")throw new Error(`Expected a valid index, not ${t}.`);let r=this.items[i];za.isScalar(r)&&xC.isScalarValue(n)?r.value=n:this.items[i]=n}toJSON(t,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let o of this.items)i.push(jC.toJS(o,String(r++),n));return i}toString(t,n,i){return t?UC.stringifyCollection(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let s of n){if(typeof r=="function"){let c=n instanceof Set?s:String(a++);s=r.call(n,c,s)}o.items.push(MC.createNode(s,void 0,i))}}return o}};function Da(e){let t=za.isScalar(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}Op.YAMLSeq=Uc});var Rr=k(Ap=>{"use strict";var DC=Se(),wp=tr(),zC={collection:"seq",default:!0,nodeClass:wp.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){return DC.isSeq(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>wp.YAMLSeq.from(e,t,n)};Ap.seq=zC});var hi=k(Tp=>{"use strict";var FC=fi(),ZC={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),FC.stringifyString(e,t,n,i)}};Tp.string=ZC});var Fa=k(Np=>{"use strict";var $p=We(),Ip={identify:e=>e==null,createNode:()=>new $p.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new $p.Scalar(null),stringify:({source:e},t)=>typeof e=="string"&&Ip.test.test(e)?e:t.options.nullStr};Np.nullTag=Ip});var Pc=k(Rp=>{"use strict";var qC=We(),Cp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new qC.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Cp.test.test(e)){let i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};Rp.boolTag=Cp});var Lr=k(Lp=>{"use strict";function VC({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let a=o.indexOf(".");a<0&&(a=o.length,o+=".");let s=t-(o.length-a-1);for(;s-- >0;)o+="0"}return o}Lp.stringifyNumber=VC});var jc=k(Za=>{"use strict";var WC=We(),xc=Lr(),BC={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:xc.stringifyNumber},HC={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():xc.stringifyNumber(e)}},JC={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new WC.Scalar(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:xc.stringifyNumber};Za.float=JC;Za.floatExp=HC;Za.floatNaN=BC});var zc=k(Va=>{"use strict";var Mp=Lr(),qa=e=>typeof e=="bigint"||Number.isInteger(e),Dc=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function Up(e,t,n){let{value:i}=e;return qa(i)&&i>=0?n+i.toString(t):Mp.stringifyNumber(e)}var KC={identify:e=>qa(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Dc(e,2,8,n),stringify:e=>Up(e,8,"0o")},XC={identify:qa,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Dc(e,0,10,n),stringify:Mp.stringifyNumber},GC={identify:e=>qa(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Dc(e,2,16,n),stringify:e=>Up(e,16,"0x")};Va.int=XC;Va.intHex=GC;Va.intOct=KC});var xp=k(Pp=>{"use strict";var YC=Cr(),QC=Fa(),eR=Rr(),tR=hi(),nR=Pc(),Fc=jc(),Zc=zc(),rR=[YC.map,eR.seq,tR.string,QC.nullTag,nR.boolTag,Zc.intOct,Zc.int,Zc.intHex,Fc.floatNaN,Fc.floatExp,Fc.float];Pp.schema=rR});var zp=k(Dp=>{"use strict";var iR=We(),oR=Cr(),aR=Rr();function jp(e){return typeof e=="bigint"||Number.isInteger(e)}var Wa=({value:e})=>JSON.stringify(e),sR=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Wa},{identify:e=>e==null,createNode:()=>new iR.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Wa},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Wa},{identify:jp,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>jp(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Wa}],cR={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},lR=[oR.map,aR.seq].concat(sR,cR);Dp.schema=lR});var Vc=k(Fp=>{"use strict";var vi=require("buffer"),qc=We(),uR=fi(),dR={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof vi.Buffer=="function")return vi.Buffer.from(e,"base64");if(typeof atob=="function"){let n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},i,r,o){if(!n)return"";let a=n,s;if(typeof vi.Buffer=="function")s=a instanceof vi.Buffer?a.toString("base64"):vi.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<a.length;++l)c+=String.fromCharCode(a[l]);s=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=qc.Scalar.BLOCK_LITERAL),t!==qc.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(s.length/c),_=new Array(l);for(let u=0,f=0;u<l;++u,f+=c)_[u]=s.substr(f,c);s=_.join(t===qc.Scalar.BLOCK_LITERAL?`
|
|
116
|
+
`:" ")}return uR.stringifyString({comment:e,type:t,value:s},i,r,o)}};Fp.binary=dR});var Ja=k(Ha=>{"use strict";var Ba=Se(),Wc=Yn(),_R=We(),fR=tr();function Zp(e,t){if(Ba.isSeq(e))for(let n=0;n<e.items.length;++n){let i=e.items[n];if(!Ba.isPair(i)){if(Ba.isMap(i)){i.items.length>1&&t("Each pair must have its own sequence indicator");let r=i.items[0]||new Wc.Pair(new _R.Scalar(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
117
|
+
${r.key.commentBefore}`:i.commentBefore),i.comment){let o=r.value??r.key;o.comment=o.comment?`${i.comment}
|
|
118
|
+
${o.comment}`:i.comment}i=r}e.items[n]=Ba.isPair(i)?i:new Wc.Pair(i)}}else t("Expected a sequence for this tag");return e}function qp(e,t,n){let{replacer:i}=n,r=new fR.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof i=="function"&&(a=i.call(t,String(o++),a));let s,c;if(Array.isArray(a))if(a.length===2)s=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let l=Object.keys(a);if(l.length===1)s=l[0],c=a[s];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else s=a;r.items.push(Wc.createPair(s,c,n))}return r}var pR={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Zp,createNode:qp};Ha.createPairs=qp;Ha.pairs=pR;Ha.resolvePairs=Zp});var Jc=k(Hc=>{"use strict";var Vp=Se(),Bc=Jn(),yi=er(),mR=tr(),Wp=Ja(),lr=class e extends mR.YAMLSeq{constructor(){super(),this.add=yi.YAMLMap.prototype.add.bind(this),this.delete=yi.YAMLMap.prototype.delete.bind(this),this.get=yi.YAMLMap.prototype.get.bind(this),this.has=yi.YAMLMap.prototype.has.bind(this),this.set=yi.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(t,n){if(!n)return super.toJSON(t);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let o,a;if(Vp.isPair(r)?(o=Bc.toJS(r.key,"",n),a=Bc.toJS(r.value,o,n)):o=Bc.toJS(r,"",n),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,a)}return i}static from(t,n,i){let r=Wp.createPairs(t,n,i),o=new this;return o.items=r.items,o}};lr.tag="tag:yaml.org,2002:omap";var gR={collection:"seq",identify:e=>e instanceof Map,nodeClass:lr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=Wp.resolvePairs(e,t),i=[];for(let{key:r}of n.items)Vp.isScalar(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new lr,n)},createNode:(e,t,n)=>lr.from(e,t,n)};Hc.YAMLOMap=lr;Hc.omap=gR});var Xp=k(Kc=>{"use strict";var Bp=We();function Hp({value:e,source:t},n){return t&&(e?Jp:Kp).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Jp={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Bp.Scalar(!0),stringify:Hp},Kp={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Bp.Scalar(!1),stringify:Hp};Kc.falseTag=Kp;Kc.trueTag=Jp});var Gp=k(Ka=>{"use strict";var hR=We(),Xc=Lr(),vR={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Xc.stringifyNumber},yR={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Xc.stringifyNumber(e)}},bR={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new hR.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){let i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:Xc.stringifyNumber};Ka.float=bR;Ka.floatExp=yR;Ka.floatNaN=vR});var Qp=k(Si=>{"use strict";var Yp=Lr(),bi=e=>typeof e=="bigint"||Number.isInteger(e);function Xa(e,t,n,{intAsBigInt:i}){let r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let a=BigInt(e);return r==="-"?BigInt(-1)*a:a}let o=parseInt(e,n);return r==="-"?-1*o:o}function Gc(e,t,n){let{value:i}=e;if(bi(i)){let r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return Yp.stringifyNumber(e)}var SR={identify:bi,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Xa(e,2,2,n),stringify:e=>Gc(e,2,"0b")},ER={identify:bi,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Xa(e,1,8,n),stringify:e=>Gc(e,8,"0")},kR={identify:bi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Xa(e,0,10,n),stringify:Yp.stringifyNumber},OR={identify:bi,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Xa(e,2,16,n),stringify:e=>Gc(e,16,"0x")};Si.int=kR;Si.intBin=SR;Si.intHex=OR;Si.intOct=ER});var Qc=k(Yc=>{"use strict";var Qa=Se(),Ga=Yn(),Ya=er(),ur=class e extends Ya.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(t){let n;Qa.isPair(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ga.Pair(t.key,null):n=new Ga.Pair(t,null),Ya.findPair(this.items,n.key)||this.items.push(n)}get(t,n){let i=Ya.findPair(this.items,t);return!n&&Qa.isPair(i)?Qa.isScalar(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=Ya.findPair(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Ga.Pair(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){let{replacer:r}=i,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof r=="function"&&(a=r.call(n,a,a)),o.items.push(Ga.createPair(a,null,i));return o}};ur.tag="tag:yaml.org,2002:set";var wR={collection:"map",identify:e=>e instanceof Set,nodeClass:ur,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ur.from(e,t,n),resolve(e,t){if(Qa.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new ur,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};Yc.YAMLSet=ur;Yc.set=wR});var tl=k(es=>{"use strict";var AR=Lr();function el(e,t){let n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=a=>t?BigInt(a):Number(a),o=i.replace(/_/g,"").split(":").reduce((a,s)=>a*r(60)+r(s),r(0));return n==="-"?r(-1)*o:o}function em(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return AR.stringifyNumber(e);let i="";t<0&&(i="-",t*=n(-1));let r=n(60),o=[t%r];return t<60?o.unshift(0):(t=(t-o[0])/r,o.unshift(t%r),t>=60&&(t=(t-o[0])/r,o.unshift(t))),i+o.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var TR={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>el(e,n),stringify:em},$R={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>el(e,!1),stringify:em},tm={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(tm.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,o,a,s]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,l=Date.UTC(n,i-1,r,o||0,a||0,s||0,c),_=t[8];if(_&&_!=="Z"){let u=el(_,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};es.floatTime=$R;es.intTime=TR;es.timestamp=tm});var im=k(rm=>{"use strict";var IR=Cr(),NR=Fa(),CR=Rr(),RR=hi(),LR=Vc(),nm=Xp(),nl=Gp(),ts=Qp(),MR=La(),UR=Jc(),PR=Ja(),xR=Qc(),rl=tl(),jR=[IR.map,CR.seq,RR.string,NR.nullTag,nm.trueTag,nm.falseTag,ts.intBin,ts.intOct,ts.int,ts.intHex,nl.floatNaN,nl.floatExp,nl.float,LR.binary,MR.merge,UR.omap,PR.pairs,xR.set,rl.intTime,rl.floatTime,rl.timestamp];rm.schema=jR});var pm=k(al=>{"use strict";var cm=Cr(),DR=Fa(),lm=Rr(),zR=hi(),FR=Pc(),il=jc(),ol=zc(),ZR=xp(),qR=zp(),um=Vc(),Ei=La(),dm=Jc(),_m=Ja(),om=im(),fm=Qc(),ns=tl(),am=new Map([["core",ZR.schema],["failsafe",[cm.map,lm.seq,zR.string]],["json",qR.schema],["yaml11",om.schema],["yaml-1.1",om.schema]]),sm={binary:um.binary,bool:FR.boolTag,float:il.float,floatExp:il.floatExp,floatNaN:il.floatNaN,floatTime:ns.floatTime,int:ol.int,intHex:ol.intHex,intOct:ol.intOct,intTime:ns.intTime,map:cm.map,merge:Ei.merge,null:DR.nullTag,omap:dm.omap,pairs:_m.pairs,seq:lm.seq,set:fm.set,timestamp:ns.timestamp},VR={"tag:yaml.org,2002:binary":um.binary,"tag:yaml.org,2002:merge":Ei.merge,"tag:yaml.org,2002:omap":dm.omap,"tag:yaml.org,2002:pairs":_m.pairs,"tag:yaml.org,2002:set":fm.set,"tag:yaml.org,2002:timestamp":ns.timestamp};function WR(e,t,n){let i=am.get(t);if(i&&!e)return n&&!i.includes(Ei.merge)?i.concat(Ei.merge):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{let o=Array.from(am.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(let o of e)r=r.concat(o);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Ei.merge)),r.reduce((o,a)=>{let s=typeof a=="string"?sm[a]:a;if(!s){let c=JSON.stringify(a),l=Object.keys(sm).map(_=>JSON.stringify(_)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(s)||o.push(s),o},[])}al.coreKnownTags=VR;al.getTags=WR});var ll=k(mm=>{"use strict";var sl=Se(),BR=Cr(),HR=Rr(),JR=hi(),rs=pm(),KR=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0,cl=class e{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:o,sortMapEntries:a,toStringDefaults:s}){this.compat=Array.isArray(t)?rs.getTags(t,"compat"):t?rs.getTags(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?rs.coreKnownTags:{},this.tags=rs.getTags(n,this.name,i),this.toStringOptions=s??null,Object.defineProperty(this,sl.MAP,{value:BR.map}),Object.defineProperty(this,sl.SCALAR,{value:JR.string}),Object.defineProperty(this,sl.SEQ,{value:HR.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?KR:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};mm.Schema=cl});var hm=k(gm=>{"use strict";var XR=Se(),ul=pi(),ki=ui();function GR(e,t){let n=[],i=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);c?(n.push(c),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");let r=ul.createStringifyContext(e,t),{commentString:o}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");let c=o(e.commentBefore);n.unshift(ki.indentComment(c,""))}let a=!1,s=null;if(e.contents){if(XR.isNode(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){let _=o(e.contents.commentBefore);n.push(ki.indentComment(_,""))}r.forceBlockIndent=!!e.comment,s=e.contents.comment}let c=s?void 0:()=>a=!0,l=ul.stringify(e.contents,r,()=>s=null,c);s&&(l+=ki.lineComment(l,"",o(s))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(ul.stringify(e.contents,r));if(e.directives?.docEnd)if(e.comment){let c=o(e.comment);c.includes(`
|
|
119
|
+
`)?(n.push("..."),n.push(ki.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||s)&&n[n.length-1]!==""&&n.push(""),n.push(ki.indentComment(o(c),"")))}return n.join(`
|
|
120
|
+
`)+`
|
|
121
|
+
`}gm.stringifyDocument=GR});var Oi=k(vm=>{"use strict";var YR=ci(),Mr=ka(),wt=Se(),QR=Yn(),eL=Jn(),tL=ll(),nL=hm(),dl=ya(),rL=mc(),iL=li(),_l=pc(),fl=class e{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,wt.NODE_TYPE,{value:wt.DOC});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=o;let{version:a}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new _l.Directives({version:a}),this.setSchema(a,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){let t=Object.create(e.prototype,{[wt.NODE_TYPE]:{value:wt.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=wt.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Ur(this.contents)&&this.contents.add(t)}addIn(t,n){Ur(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){let i=dl.anchorNames(this);t.anchor=!n||i.has(n)?dl.findNewAnchor(n||"a",i):n}return new YR.Alias(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){let h=C=>typeof C=="number"||C instanceof String||C instanceof Number,O=n.filter(h).map(String);O.length>0&&(n=n.concat(O)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:a,flow:s,keepUndefined:c,onTagObj:l,tag:_}=i??{},{onAnchor:u,setAnchors:f,sourceObjects:p}=dl.createNodeAnchors(this,a||"a"),y={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:r,schema:this.schema,sourceObjects:p},v=iL.createNode(t,_,y);return s&&wt.isCollection(v)&&(v.flow=!0),f(),v}createPair(t,n,i={}){let r=this.createNode(t,null,i),o=this.createNode(n,null,i);return new QR.Pair(r,o)}delete(t){return Ur(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Mr.isEmptyPath(t)?this.contents==null?!1:(this.contents=null,!0):Ur(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return wt.isCollection(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Mr.isEmptyPath(t)?!n&&wt.isScalar(this.contents)?this.contents.value:this.contents:wt.isCollection(this.contents)?this.contents.getIn(t,n):void 0}has(t){return wt.isCollection(this.contents)?this.contents.has(t):!1}hasIn(t){return Mr.isEmptyPath(t)?this.contents!==void 0:wt.isCollection(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Mr.collectionFromPath(this.schema,[t],n):Ur(this.contents)&&this.contents.set(t,n)}setIn(t,n){Mr.isEmptyPath(t)?this.contents=n:this.contents==null?this.contents=Mr.collectionFromPath(this.schema,Array.from(t),n):Ur(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new _l.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new _l.Directives({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new tL.Schema(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:o,reviver:a}={}){let s={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=eL.toJS(this.contents,n??"",s);if(typeof o=="function")for(let{count:l,res:_}of s.anchors.values())o(_,l);return typeof a=="function"?rL.applyReviver(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){let n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return nL.stringifyDocument(this,t)}};function Ur(e){if(wt.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}vm.Document=fl});var Ti=k(Ai=>{"use strict";var wi=class extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}},pl=class extends wi{constructor(t,n,i){super("YAMLParseError",t,n,i)}},ml=class extends wi{constructor(t,n,i){super("YAMLWarning",t,n,i)}},oL=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(s=>t.linePos(s));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let o=r-1,a=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&a.length>80){let s=Math.min(o-39,a.length-79);a="\u2026"+a.substring(s),o-=s-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(a.substring(0,o))){let s=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);s.length>80&&(s=s.substring(0,79)+`\u2026
|
|
122
|
+
`),a=s+a}if(/[^ ]/.test(a)){let s=1,c=n.linePos[1];c?.line===i&&c.col>r&&(s=Math.max(1,Math.min(c.col-r,80-o)));let l=" ".repeat(o)+"^".repeat(s);n.message+=`:
|
|
123
|
+
|
|
124
|
+
${a}
|
|
125
|
+
${l}
|
|
126
|
+
`}};Ai.YAMLError=wi;Ai.YAMLParseError=pl;Ai.YAMLWarning=ml;Ai.prettifyError=oL});var $i=k(ym=>{"use strict";function aL(e,{flow:t,indicator:n,next:i,offset:r,onError:o,parentIndent:a,startOnNewline:s}){let c=!1,l=s,_=s,u="",f="",p=!1,y=!1,v=null,h=null,O=null,C=null,D=null,b=null,E=null;for(let I of e)switch(y&&(I.type!=="space"&&I.type!=="newline"&&I.type!=="comma"&&o(I.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),v&&(l&&I.type!=="comment"&&I.type!=="newline"&&o(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),v=null),I.type){case"space":!t&&(n!=="doc-start"||i?.type!=="flow-collection")&&I.source.includes(" ")&&(v=I),_=!0;break;case"comment":{_||o(I,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let V=I.source.substring(1)||" ";u?u+=f+V:u=V,f="",l=!1;break}case"newline":l?u?u+=I.source:(!b||n!=="seq-item-ind")&&(c=!0):f+=I.source,l=!0,p=!0,(h||O)&&(C=I),_=!0;break;case"anchor":h&&o(I,"MULTIPLE_ANCHORS","A node can have at most one anchor"),I.source.endsWith(":")&&o(I.offset+I.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=I,E??(E=I.offset),l=!1,_=!1,y=!0;break;case"tag":{O&&o(I,"MULTIPLE_TAGS","A node can have at most one tag"),O=I,E??(E=I.offset),l=!1,_=!1,y=!0;break}case n:(h||O)&&o(I,"BAD_PROP_ORDER",`Anchors and tags must be after the ${I.source} indicator`),b&&o(I,"UNEXPECTED_TOKEN",`Unexpected ${I.source} in ${t??"collection"}`),b=I,l=n==="seq-item-ind"||n==="explicit-key-ind",_=!1;break;case"comma":if(t){D&&o(I,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),D=I,l=!1,_=!1;break}default:o(I,"UNEXPECTED_TOKEN",`Unexpected ${I.type} token`),l=!1,_=!1}let A=e[e.length-1],R=A?A.offset+A.source.length:r;return y&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v&&(l&&v.indent<=a||i?.type==="block-map"||i?.type==="block-seq")&&o(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:D,found:b,spaceBefore:c,comment:u,hasNewline:p,anchor:h,tag:O,newlineAfterProp:C,end:R,start:E??R}}ym.resolveProps=aL});var is=k(bm=>{"use strict";function gl(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
127
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let n of t.start)if(n.type==="newline")return!0;if(t.sep){for(let n of t.sep)if(n.type==="newline")return!0}if(gl(t.key)||gl(t.value))return!0}return!1;default:return!0}}bm.containsNewline=gl});var hl=k(Sm=>{"use strict";var sL=is();function cL(e,t,n){if(t?.type==="flow-collection"){let i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&sL.containsNewline(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Sm.flowIndentCheck=cL});var vl=k(km=>{"use strict";var Em=Se();function lL(e,t,n){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let r=typeof i=="function"?i:(o,a)=>o===a||Em.isScalar(o)&&Em.isScalar(a)&&o.value===a.value;return t.some(o=>r(o.key,n))}km.mapIncludes=lL});var Im=k($m=>{"use strict";var Om=Yn(),uL=er(),wm=$i(),dL=is(),Am=hl(),_L=vl(),Tm="All mapping items must start at the same column";function fL({composeNode:e,composeEmptyNode:t},n,i,r,o){let a=o?.nodeClass??uL.YAMLMap,s=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,l=null;for(let _ of i.items){let{start:u,key:f,sep:p,value:y}=_,v=wm.resolveProps(u,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),h=!v.found;if(h){if(f&&(f.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==i.indent&&r(c,"BAD_INDENT",Tm)),!v.anchor&&!v.tag&&!p){l=v.end,v.comment&&(s.comment?s.comment+=`
|
|
128
|
+
`+v.comment:s.comment=v.comment);continue}(v.newlineAfterProp||dL.containsNewline(f))&&r(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else v.found?.indent!==i.indent&&r(c,"BAD_INDENT",Tm);n.atKey=!0;let O=v.end,C=f?e(n,f,v,r):t(n,O,u,null,v,r);n.schema.compat&&Am.flowIndentCheck(i.indent,f,r),n.atKey=!1,_L.mapIncludes(n,s.items,C)&&r(O,"DUPLICATE_KEY","Map keys must be unique");let D=wm.resolveProps(p??[],{indicator:"map-value-ind",next:y,offset:C.range[2],onError:r,parentIndent:i.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=D.end,D.found){h&&(y?.type==="block-map"&&!D.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.start<D.found.offset-1024&&r(C.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let b=y?e(n,y,D,r):t(n,c,p,null,D,r);n.schema.compat&&Am.flowIndentCheck(i.indent,y,r),c=b.range[2];let E=new Om.Pair(C,b);n.options.keepSourceTokens&&(E.srcToken=_),s.items.push(E)}else{h&&r(C.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),D.comment&&(C.comment?C.comment+=`
|
|
129
|
+
`+D.comment:C.comment=D.comment);let b=new Om.Pair(C);n.options.keepSourceTokens&&(b.srcToken=_),s.items.push(b)}}return l&&l<c&&r(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[i.offset,c,l??c],s}$m.resolveBlockMap=fL});var Cm=k(Nm=>{"use strict";var pL=tr(),mL=$i(),gL=hl();function hL({composeNode:e,composeEmptyNode:t},n,i,r,o){let a=o?.nodeClass??pL.YAMLSeq,s=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=i.offset,l=null;for(let{start:_,value:u}of i.items){let f=mL.resolveProps(_,{indicator:"seq-item-ind",next:u,offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(s.comment=f.comment);continue}let p=u?e(n,u,f,r):t(n,f.end,_,null,f,r);n.schema.compat&&gL.flowIndentCheck(i.indent,u,r),c=p.range[2],s.items.push(p)}return s.range=[i.offset,c,l??c],s}Nm.resolveBlockSeq=hL});var Pr=k(Rm=>{"use strict";function vL(e,t,n,i){let r="";if(e){let o=!1,a="";for(let s of e){let{source:c,type:l}=s;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let _=c.substring(1)||" ";r?r+=a+_:r=_,a="";break}case"newline":r&&(a+=c),o=!0;break;default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:r,offset:t}}Rm.resolveEnd=vL});var Pm=k(Um=>{"use strict";var yL=Se(),bL=Yn(),Lm=er(),SL=tr(),EL=Pr(),Mm=$i(),kL=is(),OL=vl(),yl="Block collections are not allowed within flow collections",bl=e=>e&&(e.type==="block-map"||e.type==="block-seq");function wL({composeNode:e,composeEmptyNode:t},n,i,r,o){let a=i.start.source==="{",s=a?"flow map":"flow sequence",c=o?.nodeClass??(a?Lm.YAMLMap:SL.YAMLSeq),l=new c(n.schema);l.flow=!0;let _=n.atRoot;_&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=i.offset+i.start.source.length;for(let h=0;h<i.items.length;++h){let O=i.items[h],{start:C,key:D,sep:b,value:E}=O,A=Mm.resolveProps(C,{flow:s,indicator:"explicit-key-ind",next:D??b?.[0],offset:u,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!b&&!E){h===0&&A.comma?r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`):h<i.items.length-1&&r(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${s}`),A.comment&&(l.comment?l.comment+=`
|
|
130
|
+
`+A.comment:l.comment=A.comment),u=A.end;continue}!a&&n.options.strict&&kL.containsNewline(D)&&r(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)A.comma&&r(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`);else if(A.comma||r(A.start,"MISSING_CHAR",`Missing , between ${s} items`),A.comment){let R="";e:for(let I of C)switch(I.type){case"comma":case"space":break;case"comment":R=I.source.substring(1);break e;default:break e}if(R){let I=l.items[l.items.length-1];yL.isPair(I)&&(I=I.value??I.key),I.comment?I.comment+=`
|
|
131
|
+
`+R:I.comment=R,A.comment=A.comment.substring(R.length+1)}}if(!a&&!b&&!A.found){let R=E?e(n,E,A,r):t(n,A.end,b,null,A,r);l.items.push(R),u=R.range[2],bl(E)&&r(R.range,"BLOCK_IN_FLOW",yl)}else{n.atKey=!0;let R=A.end,I=D?e(n,D,A,r):t(n,R,C,null,A,r);bl(D)&&r(I.range,"BLOCK_IN_FLOW",yl),n.atKey=!1;let V=Mm.resolveProps(b??[],{flow:s,indicator:"map-value-ind",next:E,offset:I.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(V.found){if(!a&&!A.found&&n.options.strict){if(b)for(let K of b){if(K===V.found)break;if(K.type==="newline"){r(K,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<V.found.offset-1024&&r(V.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?r(E,"MISSING_CHAR",`Missing space after : in ${s}`):r(V.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let le=E?e(n,E,V,r):V.found?t(n,V.end,b,null,V,r):null;le?bl(E)&&r(le.range,"BLOCK_IN_FLOW",yl):V.comment&&(I.comment?I.comment+=`
|
|
132
|
+
`+V.comment:I.comment=V.comment);let re=new bL.Pair(I,le);if(n.options.keepSourceTokens&&(re.srcToken=O),a){let K=l;OL.mapIncludes(n,K.items,I)&&r(R,"DUPLICATE_KEY","Map keys must be unique"),K.items.push(re)}else{let K=new Lm.YAMLMap(n.schema);K.flow=!0,K.items.push(re);let pe=(le??I).range;K.range=[I.range[0],pe[1],pe[2]],l.items.push(K)}u=le?le.range[2]:V.end}}let f=a?"}":"]",[p,...y]=i.end,v=u;if(p?.source===f)v=p.offset+p.source.length;else{let h=s[0].toUpperCase()+s.substring(1),O=_?`${h} must end with a ${f}`:`${h} in block collection must be sufficiently indented and end with a ${f}`;r(u,_?"MISSING_CHAR":"BAD_INDENT",O),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){let h=EL.resolveEnd(y,v,n.options.strict,r);h.comment&&(l.comment?l.comment+=`
|
|
133
|
+
`+h.comment:l.comment=h.comment),l.range=[i.offset,v,h.offset]}else l.range=[i.offset,v,v];return l}Um.resolveFlowCollection=wL});var jm=k(xm=>{"use strict";var AL=Se(),TL=We(),$L=er(),IL=tr(),NL=Im(),CL=Cm(),RL=Pm();function Sl(e,t,n,i,r,o){let a=n.type==="block-map"?NL.resolveBlockMap(e,t,n,i,o):n.type==="block-seq"?CL.resolveBlockSeq(e,t,n,i,o):RL.resolveFlowCollection(e,t,n,i,o),s=a.constructor;return r==="!"||r===s.tagName?(a.tag=s.tagName,a):(r&&(a.tag=r),a)}function LL(e,t,n,i,r){let o=i.tag,a=o?t.directives.tagName(o.source,f=>r(o,"TAG_RESOLVE_FAILED",f)):null;if(n.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=i,y=f&&o?f.offset>o.offset?f:o:f??o;y&&(!p||p.offset<y.offset)&&r(y,"MISSING_CHAR","Missing newline after block sequence props")}let s=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!a||a==="!"||a===$L.YAMLMap.tagName&&s==="map"||a===IL.YAMLSeq.tagName&&s==="seq")return Sl(e,t,n,r,a);let c=t.schema.tags.find(f=>f.tag===a&&f.collection===s);if(!c){let f=t.schema.knownTags[a];if(f?.collection===s)t.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?r(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${s} collection, but expects ${f.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Sl(e,t,n,r,a)}let l=Sl(e,t,n,r,a,c),_=c.resolve?.(l,f=>r(o,"TAG_RESOLVE_FAILED",f),t.options)??l,u=AL.isNode(_)?_:new TL.Scalar(_);return u.range=l.range,u.tag=a,c?.format&&(u.format=c.format),u}xm.composeCollection=LL});var kl=k(Dm=>{"use strict";var El=We();function ML(e,t,n){let i=t.offset,r=UL(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let o=r.mode===">"?El.Scalar.BLOCK_FOLDED:El.Scalar.BLOCK_LITERAL,a=t.source?PL(t.source):[],s=a.length;for(let v=a.length-1;v>=0;--v){let h=a[v][1];if(h===""||h==="\r")s=v;else break}if(s===0){let v=r.chomp==="+"&&a.length>0?`
|
|
134
|
+
`.repeat(Math.max(1,a.length-1)):"",h=i+r.length;return t.source&&(h+=t.source.length),{value:v,type:o,comment:r.comment,range:[i,h,h]}}let c=t.indent+r.indent,l=t.offset+r.length,_=0;for(let v=0;v<s;++v){let[h,O]=a[v];if(O===""||O==="\r")r.indent===0&&h.length>c&&(c=h.length);else{h.length<c&&n(l+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=h.length),_=v,c===0&&!e.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=h.length+O.length+1}for(let v=a.length-1;v>=s;--v)a[v][0].length>c&&(s=v+1);let u="",f="",p=!1;for(let v=0;v<_;++v)u+=a[v][0].slice(c)+`
|
|
135
|
+
`;for(let v=_;v<s;++v){let[h,O]=a[v];l+=h.length+O.length+1;let C=O[O.length-1]==="\r";if(C&&(O=O.slice(0,-1)),O&&h.length<c){let b=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(l-O.length-(C?2:1),"BAD_INDENT",b),h=""}o===El.Scalar.BLOCK_LITERAL?(u+=f+h.slice(c)+O,f=`
|
|
136
|
+
`):h.length>c||O[0]===" "?(f===" "?f=`
|
|
137
|
+
`:!p&&f===`
|
|
138
|
+
`&&(f=`
|
|
139
|
+
|
|
140
|
+
`),u+=f+h.slice(c)+O,f=`
|
|
141
|
+
`,p=!0):O===""?f===`
|
|
142
|
+
`?u+=`
|
|
143
|
+
`:f=`
|
|
144
|
+
`:(u+=f+O,f=" ",p=!1)}switch(r.chomp){case"-":break;case"+":for(let v=s;v<a.length;++v)u+=`
|
|
145
|
+
`+a[v][0].slice(c);u[u.length-1]!==`
|
|
146
|
+
`&&(u+=`
|
|
147
|
+
`);break;default:u+=`
|
|
148
|
+
`}let y=i+r.length+t.source.length;return{value:u,type:o,comment:r.comment,range:[i,y,y]}}function UL({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=t[0],o=r[0],a=0,s="",c=-1;for(let f=1;f<r.length;++f){let p=r[f];if(!s&&(p==="-"||p==="+"))s=p;else{let y=Number(p);!a&&y?a=y:c===-1&&(c=e+f)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let l=!1,_="",u=r.length;for(let f=1;f<t.length;++f){let p=t[f];switch(p.type){case"space":l=!0;case"newline":u+=p.source.length;break;case"comment":n&&!l&&i(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=p.source.length,_=p.source.substring(1);break;case"error":i(p,"UNEXPECTED_TOKEN",p.message),u+=p.source.length;break;default:{let y=`Unexpected token in block scalar header: ${p.type}`;i(p,"UNEXPECTED_TOKEN",y);let v=p.source;v&&typeof v=="string"&&(u+=v.length)}}}return{mode:o,indent:a,chomp:s,comment:_,length:u}}function PL(e){let t=e.split(/\n( *)/),n=t[0],i=n.match(/^( *)/),o=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)o.push([t[a],t[a+1]]);return o}Dm.resolveBlockScalar=ML});var wl=k(Fm=>{"use strict";var Ol=We(),xL=Pr();function jL(e,t,n){let{offset:i,type:r,source:o,end:a}=e,s,c,l=(f,p,y)=>n(i+f,p,y);switch(r){case"scalar":s=Ol.Scalar.PLAIN,c=DL(o,l);break;case"single-quoted-scalar":s=Ol.Scalar.QUOTE_SINGLE,c=zL(o,l);break;case"double-quoted-scalar":s=Ol.Scalar.QUOTE_DOUBLE,c=FL(o,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let _=i+o.length,u=xL.resolveEnd(a,_,t,n);return{value:c,type:s,comment:u.comment,range:[i,_,u.offset]}}function DL(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),zm(e)}function zL(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),zm(e.slice(1,-1)).replace(/''/g,"'")}function zm(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
149
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
150
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=t.exec(e);if(!i)return e;let r=i[1],o=" ",a=t.lastIndex;for(n.lastIndex=a;i=n.exec(e);)i[1]===""?o===`
|
|
151
|
+
`?r+=o:o=`
|
|
152
|
+
`:(r+=o+i[1],o=" "),a=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=a,i=s.exec(e),r+o+(i?.[1]??"")}function FL(e,t){let n="";for(let i=1;i<e.length-1;++i){let r=e[i];if(!(r==="\r"&&e[i+1]===`
|
|
153
|
+
`))if(r===`
|
|
154
|
+
`){let{fold:o,offset:a}=ZL(e,i);n+=o,i=a}else if(r==="\\"){let o=e[++i],a=qL[o];if(a)n+=a;else if(o===`
|
|
155
|
+
`)for(o=e[i+1];o===" "||o===" ";)o=e[++i+1];else if(o==="\r"&&e[i+1]===`
|
|
156
|
+
`)for(o=e[++i+1];o===" "||o===" ";)o=e[++i+1];else if(o==="x"||o==="u"||o==="U"){let s=o==="x"?2:o==="u"?4:8;n+=VL(e,i+1,s,t),i+=s}else{let s=e.substr(i-1,2);t(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),n+=s}}else if(r===" "||r===" "){let o=i,a=e[i+1];for(;a===" "||a===" ";)a=e[++i+1];a!==`
|
|
157
|
+
`&&!(a==="\r"&&e[i+2]===`
|
|
158
|
+
`)&&(n+=i>o?e.slice(o,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function ZL(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===`
|
|
159
|
+
`||i==="\r")&&!(i==="\r"&&e[t+2]!==`
|
|
160
|
+
`);)i===`
|
|
161
|
+
`&&(n+=`
|
|
162
|
+
`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}var qL={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
163
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function VL(e,t,n,i){let r=e.substr(t,n),a=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(a)}catch{let s=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}Fm.resolveFlowScalar=jL});var Vm=k(qm=>{"use strict";var dr=Se(),Zm=We(),WL=kl(),BL=wl();function HL(e,t,n,i){let{value:r,type:o,comment:a,range:s}=t.type==="block-scalar"?WL.resolveBlockScalar(e,t,i):BL.resolveFlowScalar(t,e.options.strict,i),c=n?e.directives.tagName(n.source,u=>i(n,"TAG_RESOLVE_FAILED",u)):null,l;e.options.stringKeys&&e.atKey?l=e.schema[dr.SCALAR]:c?l=JL(e.schema,r,c,n,i):t.type==="scalar"?l=KL(e,r,t,i):l=e.schema[dr.SCALAR];let _;try{let u=l.resolve(r,f=>i(n??t,"TAG_RESOLVE_FAILED",f),e.options);_=dr.isScalar(u)?u:new Zm.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);i(n??t,"TAG_RESOLVE_FAILED",f),_=new Zm.Scalar(r)}return _.range=s,_.source=r,o&&(_.type=o),c&&(_.tag=c),l.format&&(_.format=l.format),a&&(_.comment=a),_}function JL(e,t,n,i,r){if(n==="!")return e[dr.SCALAR];let o=[];for(let s of e.tags)if(!s.collection&&s.tag===n)if(s.default&&s.test)o.push(s);else return s;for(let s of o)if(s.test?.test(t))return s;let a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[dr.SCALAR])}function KL({atKey:e,directives:t,schema:n},i,r,o){let a=n.tags.find(s=>(s.default===!0||e&&s.default==="key")&&s.test?.test(i))||n[dr.SCALAR];if(n.compat){let s=n.compat.find(c=>c.default&&c.test?.test(i))??n[dr.SCALAR];if(a.tag!==s.tag){let c=t.tagString(a.tag),l=t.tagString(s.tag),_=`Value may be parsed as either ${c} or ${l}`;o(r,"TAG_RESOLVE_FAILED",_,!0)}}return a}qm.composeScalar=HL});var Bm=k(Wm=>{"use strict";function XL(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];r?.type==="space";)e+=r.source.length,r=t[++i];break}}return e}Wm.emptyScalarPosition=XL});var Km=k(Tl=>{"use strict";var GL=ci(),YL=Se(),QL=jm(),Hm=Vm(),eM=Pr(),tM=Bm(),nM={composeNode:Jm,composeEmptyNode:Al};function Jm(e,t,n,i){let r=e.atKey,{spaceBefore:o,comment:a,anchor:s,tag:c}=n,l,_=!0;switch(t.type){case"alias":l=rM(e,t,i),(s||c)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Hm.composeScalar(e,t,c,i),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=QL.composeCollection(nM,e,t,n,i),s&&(l.anchor=s.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);i(t,"RESOURCE_EXHAUSTION",f)}break;default:{let u=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",u),_=!1}}return l??(l=Al(e,t.offset,void 0,null,n,i)),s&&l.anchor===""&&i(s,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!YL.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?l.comment=a:l.commentBefore=a),e.options.keepSourceTokens&&_&&(l.srcToken=t),l}function Al(e,t,n,i,{spaceBefore:r,comment:o,anchor:a,tag:s,end:c},l){let _={type:"scalar",offset:tM.emptyScalarPosition(t,n,i),indent:-1,source:""},u=Hm.composeScalar(e,_,s,l);return a&&(u.anchor=a.source.substring(1),u.anchor===""&&l(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(u.spaceBefore=!0),o&&(u.comment=o,u.range[2]=c),u}function rM({options:e},{offset:t,source:n,end:i},r){let o=new GL.Alias(n.substring(1));o.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=t+n.length,s=eM.resolveEnd(i,a,e.strict,r);return o.range=[t,a,s.offset],s.comment&&(o.comment=s.comment),o}Tl.composeEmptyNode=Al;Tl.composeNode=Jm});var Ym=k(Gm=>{"use strict";var iM=Oi(),Xm=Km(),oM=Pr(),aM=$i();function sM(e,t,{offset:n,start:i,value:r,end:o},a){let s=Object.assign({_directives:t},e),c=new iM.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},_=aM.resolveProps(i,{indicator:"doc-start",next:r??o?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});_.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!_.hasNewline&&a(_.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?Xm.composeNode(l,r,_,a):Xm.composeEmptyNode(l,_.end,i,null,_,a);let u=c.contents.range[2],f=oM.resolveEnd(o,u,!1,a);return f.comment&&(c.comment=f.comment),c.range=[n,u,f.offset],c}Gm.composeDoc=sM});var Il=k(tg=>{"use strict";var cM=require("process"),lM=pc(),uM=Oi(),Ii=Ti(),Qm=Se(),dM=Ym(),_M=Pr();function Ni(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function eg(e){let t="",n=!1,i=!1;for(let r=0;r<e.length;++r){let o=e[r];switch(o[0]){case"#":t+=(t===""?"":i?`
|
|
164
|
+
|
|
165
|
+
`:`
|
|
166
|
+
`)+(o.substring(1)||" "),n=!0,i=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}var $l=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,o)=>{let a=Ni(n);o?this.warnings.push(new Ii.YAMLWarning(a,i,r)):this.errors.push(new Ii.YAMLParseError(a,i,r))},this.directives=new lM.Directives({version:t.version||"1.2"}),this.options=t}decorate(t,n){let{comment:i,afterEmptyLine:r}=eg(this.prelude);if(i){let o=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
167
|
+
${i}`:i;else if(r||t.directives.docStart||!o)t.commentBefore=i;else if(Qm.isCollection(o)&&!o.flow&&o.items.length>0){let a=o.items[0];Qm.isPair(a)&&(a=a.key);let s=a.commentBefore;a.commentBefore=s?`${i}
|
|
168
|
+
${s}`:i}else{let a=o.commentBefore;o.commentBefore=a?`${i}
|
|
169
|
+
${a}`:i}}if(n){for(let o=0;o<this.errors.length;++o)t.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)t.warnings.push(this.warnings[o])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:eg(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,i=-1){for(let r of t)yield*this.next(r);yield*this.end(n,i)}*next(t){switch(cM.env.LOG_STREAM&&console.dir(t,{depth:null}),t.type){case"directive":this.directives.add(t.source,(n,i,r)=>{let o=Ni(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{let n=dM.composeDoc(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{let n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new Ii.YAMLParseError(Ni(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Ii.YAMLParseError(Ni(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=_M.resolveEnd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
170
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Ii.YAMLParseError(Ni(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){let i=Object.assign({_directives:this.directives},this.options),r=new uM.Document(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};tg.Composer=$l});var ig=k(os=>{"use strict";var fM=kl(),pM=wl(),mM=Ti(),ng=fi();function gM(e,t=!0,n){if(e){let i=(r,o,a)=>{let s=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(n)n(s,o,a);else throw new mM.YAMLParseError([s,s+1],o,a)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return pM.resolveFlowScalar(e,t,i);case"block-scalar":return fM.resolveBlockScalar({options:{strict:t}},e,i)}}return null}function hM(e,t){let{implicitKey:n=!1,indent:i,inFlow:r=!1,offset:o=-1,type:a="PLAIN"}=t,s=ng.stringifyString({type:a,value:e},{implicitKey:n,indent:i>0?" ".repeat(i):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
171
|
+
`}];switch(s[0]){case"|":case">":{let l=s.indexOf(`
|
|
172
|
+
`),_=s.substring(0,l),u=s.substring(l+1)+`
|
|
173
|
+
`,f=[{type:"block-scalar-header",offset:o,indent:i,source:_}];return rg(f,c)||f.push({type:"newline",offset:-1,indent:i,source:`
|
|
174
|
+
`}),{type:"block-scalar",offset:o,indent:i,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:o,indent:i,source:s,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:i,source:s,end:c};default:return{type:"scalar",offset:o,indent:i,source:s,end:c}}}function vM(e,t,n={}){let{afterKey:i=!1,implicitKey:r=!1,inFlow:o=!1,type:a}=n,s="indent"in e?e.indent:null;if(i&&typeof s=="number"&&(s+=2),!a)switch(e.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let l=e.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let c=ng.stringifyString({type:a,value:t},{implicitKey:r||s===null,indent:s!==null&&s>0?" ".repeat(s):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":yM(e,c);break;case'"':Nl(e,c,"double-quoted-scalar");break;case"'":Nl(e,c,"single-quoted-scalar");break;default:Nl(e,c,"scalar")}}function yM(e,t){let n=t.indexOf(`
|
|
175
|
+
`),i=t.substring(0,n),r=t.substring(n+1)+`
|
|
176
|
+
`;if(e.type==="block-scalar"){let o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,e.source=r}else{let{offset:o}=e,a="indent"in e?e.indent:-1,s=[{type:"block-scalar-header",offset:o,indent:a,source:i}];rg(s,"end"in e?e.end:void 0)||s.push({type:"newline",offset:-1,indent:a,source:`
|
|
177
|
+
`});for(let c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:a,props:s,source:r})}}function rg(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function Nl(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let i=e.props.slice(1),r=t.length;e.props[0].type==="block-scalar-header"&&(r-=e.props[0].source.length);for(let o of i)o.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:i});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
178
|
+
`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let i="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:i,source:t,end:r})}}}os.createScalarToken=hM;os.resolveAsScalar=gM;os.setScalarValue=vM});var ag=k(og=>{"use strict";var bM=e=>"type"in e?ss(e):as(e);function ss(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=ss(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=as(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=as(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=as(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function as({start:e,key:t,sep:n,value:i}){let r="";for(let o of e)r+=o.source;if(t&&(r+=ss(t)),n)for(let o of n)r+=o.source;return i&&(r+=ss(i)),r}og.stringify=bM});var ug=k(lg=>{"use strict";var Cl=Symbol("break visit"),SM=Symbol("skip children"),sg=Symbol("remove item");function _r(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),cg(Object.freeze([]),e,t)}_r.BREAK=Cl;_r.SKIP=SM;_r.REMOVE=sg;_r.itemAtPath=(e,t)=>{let n=e;for(let[i,r]of t){let o=n?.[i];if(o&&"items"in o)n=o.items[r];else return}return n};_r.parentCollection=(e,t)=>{let n=_r.itemAtPath(e,t.slice(0,-1)),i=t[t.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function cg(e,t,n){let i=n(t,e);if(typeof i=="symbol")return i;for(let r of["key","value"]){let o=t[r];if(o&&"items"in o){for(let a=0;a<o.items.length;++a){let s=cg(Object.freeze(e.concat([[r,a]])),o.items[a],n);if(typeof s=="number")a=s-1;else{if(s===Cl)return Cl;s===sg&&(o.items.splice(a,1),a-=1)}}typeof i=="function"&&r==="key"&&(i=i(t,e))}}return typeof i=="function"?i(t,e):i}lg.visit=_r});var cs=k(pt=>{"use strict";var Rl=ig(),EM=ag(),kM=ug(),Ll="\uFEFF",Ml="",Ul="",Pl="",OM=e=>!!e&&"items"in e,wM=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function AM(e){switch(e){case Ll:return"<BOM>";case Ml:return"<DOC>";case Ul:return"<FLOW_END>";case Pl:return"<SCALAR>";default:return JSON.stringify(e)}}function TM(e){switch(e){case Ll:return"byte-order-mark";case Ml:return"doc-mode";case Ul:return"flow-error-end";case Pl:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
179
|
+
`:case`\r
|
|
180
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}pt.createScalarToken=Rl.createScalarToken;pt.resolveAsScalar=Rl.resolveAsScalar;pt.setScalarValue=Rl.setScalarValue;pt.stringify=EM.stringify;pt.visit=kM.visit;pt.BOM=Ll;pt.DOCUMENT=Ml;pt.FLOW_END=Ul;pt.SCALAR=Pl;pt.isCollection=OM;pt.isScalar=wM;pt.prettyToken=AM;pt.tokenType=TM});var Dl=k(_g=>{"use strict";var Ci=cs();function It(e){switch(e){case void 0:case" ":case`
|
|
181
|
+
`:case"\r":case" ":return!0;default:return!1}}var dg=new Set("0123456789ABCDEFabcdef"),$M=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ls=new Set(",[]{}"),IM=new Set(` ,[]{}
|
|
182
|
+
\r `),xl=e=>!e||IM.has(e),jl=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
183
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
184
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){let r=this.buffer[i+t+1];if(r===`
|
|
185
|
+
`||!r&&!this.atEnd)return t+i+1}return n===`
|
|
186
|
+
`||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&It(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
187
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===Ci.BOM&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,i=t.indexOf("#");for(;i!==-1;){let o=t[i-1];if(o===" "||o===" "){n=i-1;break}else i=t.indexOf("#",i+1)}for(;;){let o=t[n-1];if(o===" "||o===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield Ci.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&It(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!It(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&It(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(xl),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&It(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Ci.FLOW_END,yield*this.parseLineStart();let o=0;for(;r[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),r[o]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(xl),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||It(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let t=this.charAt(0),n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
|
|
188
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let o=this.continueScalar(r+1);if(o===-1)break;r=i.indexOf(`
|
|
189
|
+
`,o)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){let n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>It(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case" ":n+=1;break;case`
|
|
190
|
+
`:t=o,n=0;break;case"\r":{let a=this.buffer[o+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
191
|
+
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(`
|
|
192
|
+
`,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
193
|
+
`;)i=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let o=t-1,a=this.buffer[o];a==="\r"&&(a=this.buffer[--o]);let s=o;for(;a===" ";)a=this.buffer[--o];if(a===`
|
|
194
|
+
`&&o>=this.pos&&o+1+n>s)t=o;else break}while(!0);return yield Ci.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let t=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let o=this.buffer[i+1];if(It(o)||t&&ls.has(o))break;n=i}else if(It(r)){let o=this.buffer[i+1];if(r==="\r"&&(o===`
|
|
195
|
+
`?(i+=1,r=`
|
|
196
|
+
`,o=this.buffer[i+1]):n=i),o==="#"||t&&ls.has(o))break;if(r===`
|
|
197
|
+
`){let a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(t&&ls.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Ci.SCALAR,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){let i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(xl),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(It(i)||n&&ls.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!It(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if($M.has(n))n=this.buffer[++t];else if(n==="%"&&dg.has(this.buffer[t+1])&&dg.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){let t=this.buffer[this.pos];return t===`
|
|
198
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
199
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};_g.Lexer=jl});var Fl=k(fg=>{"use strict";var zl=class{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n<i;){let o=n+i>>1;this.lineStarts[o]<t?n=o+1:i=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};let r=this.lineStarts[n-1];return{line:n,col:t-r+1}}}};fg.LineCounter=zl});var ql=k(vg=>{"use strict";var NM=require("process"),pg=cs(),CM=Dl();function nr(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function mg(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function hg(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function us(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function xr(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function ds(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function gg(e){if(e.start.type==="flow-seq-start")for(let t of e.items)t.sep&&!t.value&&!nr(t.start,"explicit-key-ind")&&!nr(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,hg(t.value)?t.value.end?ds(t.value.end,t.sep):t.value.end=t.sep:ds(t.start,t.sep),delete t.sep)}var Zl=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new CM.Lexer,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(t,n))yield*this.next(i);n||(yield*this.end())}*next(t){if(this.source=t,NM.env.LOG_TOKENS&&console.log("|",pg.prettyToken(t)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}let n=pg.tokenType(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{let i=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){let n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&gg(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&mg(r.start)===-1&&(n.indent===0||r.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{mg(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}let n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){let n=us(this.peek(2)),i=xr(n),r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];let o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
200
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
201
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){ds(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){let i=!this.onKeyLine&&this.indent===t.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(r&&n.sep&&!n.value){let a=[];for(let s=0;s<n.sep.length;++s){let c=n.sep[s];switch(c.type){case"newline":a.push(s);break;case"space":break;case"comment":c.indent>t.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(nr(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(hg(n.key)&&!nr(n.sep,"newline")){let a=xr(n.start),s=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:s,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(nr(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let a=xr(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:o,key:null,sep:[this.sourceToken]}):nr(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);r||n.value?(t.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(t);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!nr(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&t.items.push({start:o});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){let n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){let r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){ds(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||nr(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){let i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){let n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}let i=this.startBlockValue(t);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===t.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=us(i),o=xr(r);gg(t);let a=t.end.splice(1,t.end.length);a.push(this.sourceToken);let s={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
202
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
203
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=us(t),i=xr(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=us(t),i=xr(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};vg.Parser=Zl});var kg=k(Li=>{"use strict";var yg=Il(),RM=Oi(),Ri=Ti(),LM=Tc(),MM=Se(),UM=Fl(),bg=ql();function Sg(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new UM.LineCounter||null,prettyErrors:t}}function PM(e,t={}){let{lineCounter:n,prettyErrors:i}=Sg(t),r=new bg.Parser(n?.addNewLine),o=new yg.Composer(t),a=Array.from(o.compose(r.parse(e)));if(i&&n)for(let s of a)s.errors.forEach(Ri.prettifyError(e,n)),s.warnings.forEach(Ri.prettifyError(e,n));return a.length>0?a:Object.assign([],{empty:!0},o.streamInfo())}function Eg(e,t={}){let{lineCounter:n,prettyErrors:i}=Sg(t),r=new bg.Parser(n?.addNewLine),o=new yg.Composer(t),a=null;for(let s of o.compose(r.parse(e),!0,e.length))if(!a)a=s;else if(a.options.logLevel!=="silent"){a.errors.push(new Ri.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(a.errors.forEach(Ri.prettifyError(e,n)),a.warnings.forEach(Ri.prettifyError(e,n))),a}function xM(e,t,n){let i;typeof t=="function"?i=t:n===void 0&&t&&typeof t=="object"&&(n=t);let r=Eg(e,n);if(!r)return null;if(r.warnings.forEach(o=>LM.warn(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},n))}function jM(e,t,n){let i=null;if(typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){let r=Math.round(n);n=r<1?void 0:r>8?{indent:8}:{indent:r}}if(e===void 0){let{keepUndefined:r}=n??t??{};if(!r)return}return MM.isDocument(e)&&!i?e.toString(n):new RM.Document(e,i,n).toString(n)}Li.parse=xM;Li.parseAllDocuments=PM;Li.parseDocument=Eg;Li.stringify=jM});var Wl=k(Ae=>{"use strict";var DM=Il(),zM=Oi(),FM=ll(),Vl=Ti(),ZM=ci(),rr=Se(),qM=Yn(),VM=We(),WM=er(),BM=tr(),HM=cs(),JM=Dl(),KM=Fl(),XM=ql(),_s=kg(),Og=ii();Ae.Composer=DM.Composer;Ae.Document=zM.Document;Ae.Schema=FM.Schema;Ae.YAMLError=Vl.YAMLError;Ae.YAMLParseError=Vl.YAMLParseError;Ae.YAMLWarning=Vl.YAMLWarning;Ae.Alias=ZM.Alias;Ae.isAlias=rr.isAlias;Ae.isCollection=rr.isCollection;Ae.isDocument=rr.isDocument;Ae.isMap=rr.isMap;Ae.isNode=rr.isNode;Ae.isPair=rr.isPair;Ae.isScalar=rr.isScalar;Ae.isSeq=rr.isSeq;Ae.Pair=qM.Pair;Ae.Scalar=VM.Scalar;Ae.YAMLMap=WM.YAMLMap;Ae.YAMLSeq=BM.YAMLSeq;Ae.CST=HM;Ae.Lexer=JM.Lexer;Ae.LineCounter=KM.LineCounter;Ae.Parser=XM.Parser;Ae.parse=_s.parse;Ae.parseAllDocuments=_s.parseAllDocuments;Ae.parseDocument=_s.parseDocument;Ae.stringify=_s.stringify;Ae.visit=Og.visit;Ae.visitAsync=Og.visitAsync});var E0={};Mh(E0,{SqliteReadModelFileSystem:()=>ws,allocateAttributedTokenActiveMs:()=>mh,rebuildSqliteReadModel:()=>g0,sourceFingerprint:()=>gh,sqliteReadModelPath:()=>Os,sqliteViewMetadata:()=>uu,validateSqliteReadModelSchema:()=>Es});module.exports=Uh(E0);var Nt=require("node:crypto"),Le=require("node:fs/promises"),je=require("node:path"),or=require("node:sqlite");var de=nt(ct(),1),Y0=de.z.object({provider:de.z.string().min(1),models:de.z.array(de.z.string().min(1)).min(1),reasoning_efforts:de.z.array(de.z.enum(["low","medium","high","xhigh"])).min(1),velocities:de.z.array(de.z.literal("standard")).length(1),streaming:de.z.boolean(),cancellation:de.z.boolean(),checkpointing:de.z.boolean(),resume:de.z.boolean(),tool_calls:de.z.boolean(),structured_output:de.z.boolean(),max_parallel_invocations:de.z.number().int().positive()}).strict().superRefine((e,t)=>{e.resume&&!e.checkpointing&&t.addIssue({code:"custom",message:"Resume requires checkpointing"})}),rN=de.z.object({role:de.z.enum(["system","user","assistant","tool"]),content:de.z.string(),name:de.z.string().min(1).nullable().default(null)}).strict(),Q0=de.z.object({schema_version:de.z.literal(1),invocation_id:de.z.string().regex(/^INV-[A-Z0-9-]+$/),agent_id:de.z.string().min(1),model:de.z.string().min(1),reasoning_effort:de.z.enum(["low","medium","high","xhigh"]),velocity:de.z.literal("standard"),input:de.z.object({messages:de.z.array(rN).min(1),context_refs:de.z.array(de.z.string().min(1)),tools:de.z.array(de.z.string().min(1)),response_format:de.z.enum(["text","json"])}).strict(),budget:de.z.object({max_output_tokens:de.z.number().int().positive(),timeout_ms:de.z.number().int().positive().nullable(),max_tool_calls:de.z.number().int().nonnegative()}).strict(),metadata:de.z.record(de.z.string(),de.z.string()),resume_from:de.z.string().min(1).nullable()}).strict(),eP=de.z.object({invocation_id:de.z.string().regex(/^INV-[A-Z0-9-]+$/),reason:de.z.enum(["user","budget","timeout","shutdown","superseded"]),requested_at:de.z.string().datetime()}).strict();var se=nt(ct(),1),zn={schema_version:se.z.literal(1),invocation_id:se.z.string().regex(/^INV-[A-Z0-9-]+$/),sequence:se.z.number().int().nonnegative(),occurred_at:se.z.string().datetime()},iN=se.z.object({checkpoint_id:se.z.string().regex(/^CHK-[A-Z0-9-]+$/),opaque_token:se.z.string().min(1),resumable_until:se.z.string().datetime().nullable(),state_hash:se.z.string().regex(/^[a-f0-9]{64}$/)}).strict(),Rf=se.z.object({input_tokens:se.z.number().int().nonnegative(),cached_input_tokens:se.z.number().int().nonnegative(),output_tokens:se.z.number().int().nonnegative(),reasoning_tokens:se.z.number().int().nonnegative(),source:se.z.enum(["provider","estimated","unavailable"])}).strict(),oN=se.z.object({code:se.z.enum(["authentication","authorization","invalid_request","rate_limit","provider_unavailable","timeout","budget_exceeded","tool_error","protocol_error","unknown"]),message:se.z.string().min(1),retryable:se.z.boolean(),retry_after_ms:se.z.number().int().nonnegative().nullable(),provider_code:se.z.string().nullable()}).strict(),aN=se.z.discriminatedUnion("type",[se.z.object({...zn,type:se.z.literal("invocation.started")}).strict(),se.z.object({...zn,type:se.z.literal("output.delta"),delta:se.z.string().min(1)}).strict(),se.z.object({...zn,type:se.z.literal("tool.requested"),call_id:se.z.string().min(1),name:se.z.string().min(1),arguments:se.z.unknown()}).strict(),se.z.object({...zn,type:se.z.literal("tool.completed"),call_id:se.z.string().min(1),output:se.z.unknown()}).strict(),se.z.object({...zn,type:se.z.literal("checkpoint.created"),checkpoint:iN}).strict(),se.z.object({...zn,type:se.z.literal("usage.updated"),usage:Rf}).strict(),se.z.object({...zn,type:se.z.literal("invocation.completed"),output:se.z.string(),usage:Rf}).strict(),se.z.object({...zn,type:se.z.literal("invocation.failed"),error:oN}).strict(),se.z.object({...zn,type:se.z.literal("invocation.cancelled"),reason:se.z.string().min(1)}).strict()]);var Q=nt(ct(),1),lt=Q.z.array(Q.z.string().min(1)).superRefine((e,t)=>{new Set(e).size!==e.length&&t.addIssue({code:"custom",message:"Values must be unique"})}),Lf=Q.z.string().regex(/^[a-z0-9]+(?:_[a-z0-9]+)*$/),sN=Q.z.object({nome:Lf,cargo:Lf,foto_url:Q.z.url().refine(e=>{let t=new URL(e).protocol;return t==="http:"||t==="https:"},"Persona photo URL must use http or https").optional()}).strict();function cN(e){return`${e.nome}_${e.cargo}_zaip_agent`}var lN=lt.length(1).superRefine((e,t)=>{for(let[n,i]of e.entries())/^[a-z0-9_]+$/.test(i)||t.addIssue({code:"custom",path:[n],message:"Codex nicknames must be lowercase snake_case"})}),uN=Q.z.string().regex(/^zaip-agent-[a-z0-9-]+$/,'Codex agent name must use the "zaip-agent-NOME" format'),dN=Q.z.string().regex(/^[a-z0-9_]+$/,"Codex task name must use lowercase snake_case"),Mf=Q.z.enum(["orchestrator","analyst","task-executor","execution-finalizer","builder","reviewer","integrator","auditor"]),_N=Q.z.enum(["id","codex_name","codex_task_name"]),fN=Q.z.object({kind:_N,value:Q.z.string().min(1),deprecated_at:Q.z.iso.date(),remove_after:Q.z.iso.date(),replacement:Q.z.string().regex(/^agent-[a-z0-9-]+$/)}).strict().superRefine((e,t)=>{(e.kind==="id"?/^agent-[a-z0-9-]+$/.test(e.value):e.kind==="codex_name"?/^zaip-agent-[a-z0-9-]+$/.test(e.value):/^[a-z0-9_]+$/.test(e.value))||t.addIssue({code:"custom",path:["value"],message:`Alias value does not match identity kind ${e.kind}`}),e.remove_after<=e.deprecated_at&&t.addIssue({code:"custom",path:["remove_after"],message:"Alias removal date must be after its deprecation date"})}),pa=Q.z.object({allow:lt,deny:lt}).strict().superRefine((e,t)=>{let n=e.allow.filter(i=>e.deny.includes(i));n.length>0&&t.addIssue({code:"custom",message:`Permission both allowed and denied: ${n.join(", ")}`})}),pN=Q.z.object({id:Q.z.string().regex(/^agent-[a-z0-9-]+$/),version:Q.z.number().int().positive(),purpose:Q.z.string().min(1),use_when:lt.min(1),do_not_use:lt.min(1),codex_name:uN,codex_task_name:dN,persona:sN,nickname_candidates:lN,compatibility:Q.z.object({aliases:Q.z.array(fN)}).strict().optional(),role:Mf,priority:Q.z.number().int().nonnegative().default(100),inherits:Q.z.string().regex(/^agent-[a-z0-9-]+$/).nullable().default(null),capabilities:lt.min(1),execution_eligibility:Q.z.array(Q.z.enum(["interaction","delivery"])),tools:lt,skills:lt,write_scopes:lt,permissions:Q.z.object({filesystem:pa,network:pa,shell:pa,deployment:pa}).strict(),model:Q.z.object({required_capabilities:lt,preferred:lt,reasoning_effort:Q.z.enum(["low","medium","high","xhigh","ultra"]).optional()}).strict(),budget:Q.z.object({soft_cycles:Q.z.number().int().positive()}).strict(),contract:Q.z.object({inputs:lt.min(1),outputs:lt.min(1),evidence:lt.min(1)}).strict(),review:Q.z.object({can_approve:Q.z.boolean(),cannot_review_roles:Q.z.array(Mf)}).strict(),escalation:lt}).strict().superRefine((e,t)=>{let n=e.nickname_candidates[0];e.codex_task_name!==n&&t.addIssue({code:"custom",path:["codex_task_name"],message:`Codex task name must equal the primary nickname candidate: ${n}`});let i=cN(e.persona);e.nickname_candidates[0]!==i&&t.addIssue({code:"custom",path:["nickname_candidates"],message:`nickname_candidates must contain only the derived persona nickname: ${i}`})}),mN=Q.z.object({id:Q.z.string().regex(/^squad-[a-z0-9-]+$/),version:Q.z.number().int().positive(),purpose:Q.z.string().min(1),members:Q.z.array(Q.z.string().regex(/^agent-[a-z0-9-]+$/)).min(2),max_parallelism:Q.z.number().int().positive(),delegation:Q.z.array(Q.z.object({from:Q.z.string().regex(/^agent-[a-z0-9-]+$/),to:Q.z.string().regex(/^agent-[a-z0-9-]+$/),capability:Q.z.string().min(1)}).strict()),review_policy:Q.z.object({independent:Q.z.literal(!0),executor_roles:Q.z.array(Q.z.enum(["analyst","builder","task-executor"])).min(1),reviewer_roles:Q.z.array(Q.z.enum(["reviewer","auditor"])).min(1)}).strict(),escalation:Q.z.array(Q.z.string().regex(/^agent-[a-z0-9-]+$/)).min(1)}).strict(),uP=Q.z.object({schema_version:Q.z.literal(1),agents:Q.z.array(pN).min(1),squads:Q.z.array(mN).min(1)}).strict();var M=nt(ct(),1);var ee=nt(ct(),1),gN=["gpt-5.6-luna","gpt-5.6-terra","gpt-5.6-sol"],hN=["low","medium","high","xhigh"];var Uf="task-risk-v1",SP=ee.z.enum(gN),EP=ee.z.enum(hN),vN=ee.z.literal("standard"),kP=ee.z.object({model:ee.z.string().min(1).optional(),reasoning_effort:ee.z.string().min(1).optional(),velocity:ee.z.string().min(1).optional()}).strict().refine(e=>e.model!==void 0||e.reasoning_effort!==void 0||e.velocity!==void 0,"Model selection override must define at least one field"),yN=ee.z.enum(["discovery","planning","replanning","implementation","testing","integration","review","audit","finalization","rework"]),bN=ee.z.enum(["full_stack_boundary","shared_contracts_3_plus","critical_data_or_security","rollout_and_rollback","repeated_structural_repair","architectural_review_finding","prepared_plan_invalidated","material_architectural_tradeoffs"]),SN=ee.z.object({phase:yN,agent_role:ee.z.string().min(1),complexity:ee.z.enum(["simple","standard","complex"]),risk:ee.z.enum(["lite","standard","critical"]),transversality:ee.z.enum(["local","multi_module","cross_system"]),ambiguity:ee.z.enum(["low","medium","high"]),rework:ee.z.enum(["none","localized","structural"]),rework_cost:ee.z.enum(["low","medium","high"]),bounded:ee.z.boolean(),high_volume:ee.z.boolean().default(!1),xhigh_triggers:ee.z.array(bN).default([])}).strict(),uc=ee.z.object({production_impact:ee.z.boolean(),external_action:ee.z.boolean(),irreversible_change:ee.z.boolean(),security_or_critical_data:ee.z.boolean(),data_migration:ee.z.boolean(),broad_audit:ee.z.boolean(),rollback:ee.z.enum(["trivial","planned","complex"]),verification_scope:ee.z.enum(["scoped","package","cross_scope","full"])}).strict(),EN=SN.omit({agent_role:!0,risk:!0}).extend({risk_signals:uc}).strict(),OP=EN.extend({risk:ee.z.enum(["lite","standard","critical"]),risk_signals:uc,risk_policy_version:ee.z.literal(Uf),risk_reasons:ee.z.array(ee.z.enum(["CRITICAL_EXPLICIT_IMPACT","CRITICAL_COMPLEX_ROLLBACK","CRITICAL_AMBIGUOUS_CROSS_SYSTEM","CRITICAL_STRUCTURAL_REWORK","LITE_BOUNDED_LOCAL","STANDARD_GOVERNED"])).min(1)}).strict().superRefine((e,t)=>{let n=kN(e);e.risk!==n.risk&&t.addIssue({code:"custom",path:["risk"],message:`Task risk must be ${n.risk} for the persisted signals`}),JSON.stringify(e.risk_reasons)!==JSON.stringify(n.reasons)&&t.addIssue({code:"custom",path:["risk_reasons"],message:`Task risk reasons must be ${n.reasons.join(",")}`})}),wP=ee.z.object({models:ee.z.array(ee.z.string().min(1)).min(1),reasoning_efforts:ee.z.array(ee.z.string().min(1)).min(1),velocities:ee.z.array(ee.z.string().min(1)).min(1)}).strict(),Pf=ee.z.object({mode:ee.z.literal("auto"),default_model:ee.z.literal("gpt-5.6-terra"),default_effort:ee.z.literal("medium"),default_velocity:vN,allowed_models:ee.z.tuple([ee.z.literal("gpt-5.6-luna"),ee.z.literal("gpt-5.6-terra"),ee.z.literal("gpt-5.6-sol")]),allowed_efforts:ee.z.tuple([ee.z.literal("low"),ee.z.literal("medium"),ee.z.literal("high"),ee.z.literal("xhigh")]),max_auto_effort:ee.z.literal("xhigh"),automatic_sources:ee.z.tuple([ee.z.literal("spec"),ee.z.literal("prd")]),notice:ee.z.enum(["always","mismatch"])}).strict();function kN(e){let t=uc.parse(e.risk_signals);return t.production_impact||t.external_action||t.irreversible_change||t.security_or_critical_data||t.data_migration||t.broad_audit?Ar("critical","CRITICAL_EXPLICIT_IMPACT"):t.rollback==="complex"?Ar("critical","CRITICAL_COMPLEX_ROLLBACK"):e.ambiguity==="high"&&e.transversality==="cross_system"?Ar("critical","CRITICAL_AMBIGUOUS_CROSS_SYSTEM"):e.rework==="structural"&&e.rework_cost==="high"?Ar("critical","CRITICAL_STRUCTURAL_REWORK"):e.complexity==="simple"&&e.transversality==="local"&&e.ambiguity==="low"&&e.rework==="none"&&e.rework_cost==="low"&&e.bounded&&t.rollback==="trivial"&&t.verification_scope==="scoped"?Ar("lite","LITE_BOUNDED_LOCAL"):Ar("standard","STANDARD_GOVERNED")}function Ar(e,t){return{risk:e,policy_version:Uf,reasons:[t]}}var Hl=nt(Wl(),1),GM=10,Bl=class extends Error{name="YamlContractError"};function Mi(e){let t=(0,Hl.parseDocument)(e,{strict:!0,uniqueKeys:!0});if(t.errors.length>0)throw new Bl(t.errors.map(n=>n.message).join("; "));return t.toJS({maxAliasCount:GM})}var fs=M.z.string().regex(/^[a-f0-9]{64}$/i,"Expected a SHA-256 checksum"),QM=M.z.string().min(1).superRefine((e,t)=>{try{new Intl.DateTimeFormat("en",{timeZone:e}).format()}catch{t.addIssue({code:"custom",message:"Expected a valid IANA timezone"})}});function eU(e){return e.length===0||e.includes("\\")||e.includes("\0")||e.startsWith("/")||e.startsWith("./")||e.endsWith("/")||/^[A-Za-z]:/.test(e)?!1:e.split("/").every(t=>t.length>0&&t!=="."&&t!=="..")}var tU=M.z.object({sha256:fs}).strict();function wg(e){return M.z.record(M.z.string().min(1),e).superRefine((t,n)=>{for(let i of Object.keys(t))eU(i)||n.addIssue({code:"custom",path:[i],message:"Managed file path must be canonical and workspace-relative"})})}var nU=wg(tU),rU=wg(fs),iU=M.z.object({schema_version:M.z.literal(1),zaip:M.z.object({enabled:M.z.boolean()}).strict().optional(),"zaip-aios":M.z.object({enabled:M.z.boolean()}).strict().optional(),project:M.z.object({id:M.z.string().min(1),name:M.z.string().min(1),timezone:QM}).strict(),stack:M.z.object({id:M.z.string().min(1),language:M.z.string().min(1).optional(),api:M.z.string().min(1).optional(),query_builder:M.z.string().min(1).optional(),extensions:M.z.array(M.z.string().min(1)).min(1).optional(),layout:M.z.object({frontend:M.z.string().min(1),backend:M.z.string().min(1),site:M.z.string().min(1),modules:M.z.string().min(1),packages:M.z.string().min(1),e2e:M.z.string().min(1)}).strict().optional(),source_limits:M.z.object({warning_lines:M.z.number().int().positive(),error_lines:M.z.number().int().positive()}).strict().optional(),invariants:M.z.array(M.z.string().min(1)).min(1).optional(),commands:M.z.object({test:M.z.string().min(1),typecheck:M.z.string().min(1)}).strict().optional(),overrides:M.z.record(M.z.string(),M.z.unknown())}).strict(),clients:M.z.object({codex:M.z.boolean(),claude:M.z.boolean()}).strict(),tracking:M.z.object({enabled:M.z.boolean(),currency:M.z.string().regex(/^[A-Z]{3}$/,"Expected an ISO 4217 currency code"),storage_mode:M.z.enum(["tracked_sanitized","local_only"])}).strict(),model_orchestration:M.z.discriminatedUnion("mode",[M.z.object({mode:M.z.literal("manual"),default_model:M.z.literal("manual"),default_effort:M.z.literal("manual"),default_velocity:M.z.literal("manual"),notice:M.z.enum(["always","mismatch"])}).strict(),M.z.object({mode:M.z.literal("off"),default_model:M.z.string().min(1),default_effort:M.z.string().min(1),default_velocity:M.z.string().min(1),notice:M.z.enum(["always","mismatch"])}).strict(),Pf]).optional(),execution:M.z.discriminatedUnion("runtime",[M.z.object({runtime:M.z.literal("manual")}).strict(),M.z.object({runtime:M.z.literal("autonomous"),autonomous:M.z.object({provider:M.z.enum(["codex","claude"]),model:M.z.string().min(1),max_parallelism:M.z.number().int().min(1).max(8),lease_ms:M.z.number().int().min(5e3).max(36e5),max_phase_attempts:M.z.number().int().positive().nullable().optional(),max_total_invocations:M.z.number().int().positive().nullable().optional()}).strict()}).strict()]).optional(),assurance:M.z.object({version:M.z.literal(1),standard_depth:M.z.enum(["auto","base","elevated"]),require_final_commit:M.z.boolean()}).strict().optional(),context:M.z.object({canonical_roots:M.z.array(M.z.string().min(1)).min(1),projection_roots:M.z.array(M.z.string().min(1))}).strict().optional()}).strict().superRefine((e,t)=>{let n=e.zaip?.enabled,i=e["zaip-aios"]?.enabled;n!==void 0&&i!==void 0&&n!==i&&t.addIssue({code:"custom",path:["zaip","enabled"],message:"Conflicting ZAIP activation keys: zaip.enabled and legacy zaip-aios.enabled must agree"})}),Ag={framework:M.z.object({version:M.z.string().min(1),distribution_sha256:fs.nullable()}).strict(),layout:M.z.object({version:M.z.union([M.z.literal(2),M.z.literal(3)])}).strict(),resolved_profile:M.z.object({id:M.z.string().min(1).nullable(),sha256:fs.nullable()}).strict()},oU=M.z.object({lock_version:M.z.literal(1),...Ag,managed_files:nU}).strict(),aU=M.z.object({lock_version:M.z.literal(2),...Ag,managed_files:rU}).strict(),Jx=M.z.toJSONSchema(iU),Kx=M.z.toJSONSchema(M.z.union([oU,aU]));var he=require("node:fs/promises"),Ce=require("node:path");var $g=require("node:crypto");var Tg="23456789ABCDEFGHJKLMNPQRSTUVWXYZ";function ps(e=4){if(!Number.isSafeInteger(e)||e<2||e>16)throw new RangeError("collision code length must be between 2 and 16");let t=(0,$g.randomBytes)(e);return Array.from(t,n=>Tg[n%Tg.length]).join("")}var qn=class extends Error{name="WorkspacePathError"},Pi=class{root;appendQueues=new Map;constructor(t){this.root=(0,Ce.resolve)(t)}resolve(t){if(sU(t)||cU(t))throw new qn("Expected a path relative to the workspace root");let n=(0,Ce.resolve)(this.root,t),i=(0,Ce.relative)(this.root,n);if(i===".."||i.startsWith(`..${Ce.sep}`)||(0,Ce.isAbsolute)(i))throw new qn(`Path escapes workspace root: ${t}`);return n}async exists(t){try{let n=this.resolve(t);return await this.assertPhysicalContainment(n),await(0,he.stat)(n),!0}catch(n){if(Ui(n)&&n.code==="ENOENT")return!1;throw n}}async readText(t){let n=this.resolve(t);return await this.assertPhysicalContainment(n),(0,he.readFile)(n,"utf8")}async readBytes(t){let n=this.resolve(t);return await this.assertPhysicalContainment(n),(0,he.readFile)(n)}async readTextFrom(t,n){if(!Number.isSafeInteger(n)||n<0)throw new RangeError("Expected a non-negative byte offset");let i=this.resolve(t);await this.assertPhysicalContainment(i);let r=await(0,he.open)(i,"r");try{let o=await r.stat(),a=Math.min(n,o.size),s=Buffer.allocUnsafe(o.size-a);return s.byteLength>0&&await r.read(s,0,s.byteLength,a),{content:s.toString("utf8"),nextOffset:o.size}}finally{await r.close()}}async listFiles(t,n=""){let i=this.resolve(t);return await this.assertPhysicalContainment(i),await this.exists(t)?(await(0,he.readdir)(i,{recursive:!0,withFileTypes:!0})).filter(o=>o.isFile()).map(o=>(0,Ce.relative)(this.root,(0,Ce.resolve)(o.parentPath,o.name)).replace(/\\/g,"/")).filter(o=>o.endsWith(n)).sort():[]}async listDirectories(t){let n=this.resolve(t);return await this.assertPhysicalContainment(n),await this.exists(t)?(await(0,he.readdir)(n,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>(0,Ce.relative)(this.root,(0,Ce.resolve)(n,r.name)).replace(/\\/g,"/")).sort():[]}async writeTextAtomic(t,n){let i=this.resolve(t),r=`${i}.${ps(6)}.tmp`;await this.assertPhysicalContainment(i),await(0,he.mkdir)((0,Ce.dirname)(i),{recursive:!0}),await this.assertPhysicalContainment(i);try{await(0,he.writeFile)(r,n,{encoding:"utf8",flag:"wx"}),await lU(r,i)}finally{await(0,he.rm)(r,{force:!0})}}async appendText(t,n){let i=this.resolve(t),o=(this.appendQueues.get(i)??Promise.resolve()).catch(()=>{}).then(async()=>{await this.assertPhysicalContainment(i),await(0,he.mkdir)((0,Ce.dirname)(i),{recursive:!0}),await this.assertPhysicalContainment(i),await(0,he.appendFile)(i,n,{encoding:"utf8",flush:!0})});this.appendQueues.set(i,o);try{await o}finally{this.appendQueues.get(i)===o&&this.appendQueues.delete(i)}}async writeTextExclusive(t,n){let i=this.resolve(t);await this.assertPhysicalContainment(i),await(0,he.mkdir)((0,Ce.dirname)(i),{recursive:!0}),await this.assertPhysicalContainment(i),await(0,he.writeFile)(i,n,{encoding:"utf8",flag:"wx",flush:!0})}async writeTextAtomicExclusive(t,n){let i=this.resolve(t),r=`${i}.${ps(6)}.tmp`;await this.assertPhysicalContainment(i),await(0,he.mkdir)((0,Ce.dirname)(i),{recursive:!0}),await this.assertPhysicalContainment(i);try{await(0,he.writeFile)(r,n,{encoding:"utf8",flag:"wx",flush:!0}),await(0,he.link)(r,i)}finally{await(0,he.rm)(r,{force:!0})}}async removeFile(t){let n=this.resolve(t);await this.assertPhysicalContainment(n),await(0,he.rm)(n,{force:!0})}async removeFileIfContentMatches(t,n){let i=`${t}.${ps(16)}.compare-delete`;try{await this.moveFileAtomic(t,i)}catch(s){if(Ui(s)&&s.code==="ENOENT")return!1;throw s}if(await this.readText(i)===n)return await this.removeFile(i),!0;let o=this.resolve(i),a=this.resolve(t);try{await(0,he.link)(o,a),await this.removeFile(i)}catch(s){throw Ui(s)&&s.code==="EEXIST"?new qn(`Conditional delete observed a replacement; captured file retained at ${i}`):s}return!1}async collectCompareDeleteTombstones(t){let n=[];for(let i of await this.listFiles(t)){let r=/^(.*)\.[A-Z0-9]{16}\.compare-delete$/.exec(i);if(r===null)continue;let o=r[1];o!==void 0&&await this.exists(o)&&(await this.removeFile(i),n.push(i))}return n}async moveFileAtomic(t,n){let i=this.resolve(t),r=this.resolve(n);await this.assertPhysicalContainment(i),await this.assertPhysicalContainment(r),await(0,he.mkdir)((0,Ce.dirname)(r),{recursive:!0}),await this.assertPhysicalContainment(r),await(0,he.rename)(i,r)}async assertPhysicalContainment(t){let n=await(0,he.realpath)(this.root),i=t,r=null;for(;;)try{i=await(0,he.realpath)(i);break}catch(a){if(!Ui(a)||a.code!=="ENOENT")throw a;if(r=a,i===this.root)throw new qn(`Cannot resolve workspace root for: ${t}`,{cause:r});let s=(0,Ce.dirname)(i);if(s===i)throw new qn(`Cannot resolve workspace ancestor for: ${t}`,{cause:r});i=s}let o=(0,Ce.relative)(n,i);if(o===".."||o.startsWith(`..${Ce.sep}`)||(0,Ce.isAbsolute)(o))throw new qn(`Physical path escapes workspace root: ${t}`)}};function sU(e){return Ce.posix.isAbsolute(e)||Ce.win32.isAbsolute(e)||/^[A-Za-z]:/.test(e)}function cU(e){return e.split(/[\\/]+/).some(t=>t==="..")}function Ui(e){return e instanceof Error&&"code"in e}async function lU(e,t){if(process.platform!=="win32"){await(0,he.rename)(e,t);return}for(let n=0;n<5;n+=1)try{await(0,he.rm)(t,{force:!0}),await(0,he.rename)(e,t);return}catch(i){if(!uU(i)||n===4)throw i;await dU(25*(n+1))}}function uU(e){return Ui(e)&&["EPERM","EBUSY","EACCES"].includes(e.code??"")}async function dU(e){await new Promise(t=>setTimeout(t,e))}var Ig=require("node:child_process");var Ng=require("node:util"),tj=(0,Ng.promisify)(Ig.execFile);var Je=nt(ct(),1);var Cg=nt(Wl(),1);var oj=Je.z.object({id:Je.z.string().regex(/^RULE-[A-Z0-9-]+$/),load:Je.z.enum(["always","auto","file_match","manual"]),globs:Je.z.array(Je.z.string().min(1)).default([]),priority:Je.z.enum(["critical","high","medium","low"]),max_context_tokens:Je.z.number().int().positive(),requires:Je.z.array(Je.z.string().regex(/^RULE-[A-Z0-9-]+$/))}).strict().superRefine((e,t)=>{e.load==="file_match"&&e.globs.length===0&&t.addIssue({code:"custom",path:["globs"],message:"file_match Rules require at least one glob"})}),aj=Je.z.object({schema_version:Je.z.literal(2),id:Je.z.string().regex(/^REQUIREMENTS-[A-Z0-9-]+$/),area:Je.z.string().regex(/^[a-z][a-z0-9-]*$/),title:Je.z.string().min(1),status:Je.z.enum(["proposed","active","deprecated"]),version:Je.z.number().int().positive(),source_change:Je.z.string().min(1).nullable(),source_release:Je.z.string().regex(/^\d+\.\d+\.\d+$/).optional()}).strict().superRefine((e,t)=>{e.source_change===null&&e.source_release===void 0&&t.addIssue({code:"custom",path:["source_release"],message:"released Requirements require source_release when source_change is null"}),e.source_change!==null&&e.source_release!==void 0&&t.addIssue({code:"custom",path:["source_release"],message:"source_release is only valid when source_change is null"})});var oe=nt(ct(),1);var _U=["codex_host_native","provider_subprocess"],fU=["frontier","balanced","fast_scan","review"],pU=["subagents","worktrees","sandbox","approvals","skills","mcp"];var lj=oe.z.enum(_U),uj=oe.z.enum(fU),Lg=oe.z.enum(pU),mU=oe.z.array(Lg).min(1).refine(e=>new Set(e).size===e.length,{message:"native_surfaces must be unique"}),gU=oe.z.object({locator:oe.z.string().min(1),candidate_sha256:oe.z.string().regex(/^[a-f0-9]{64}$/)}).strict(),hU=oe.z.object({capability_id:oe.z.string().regex(/^CAP-[A-Z0-9-]+$/),current_state:oe.z.literal("implemented"),previous_states:oe.z.tuple([oe.z.literal("declared")]),evidence:oe.z.array(gU).length(0)}).strict(),vU=oe.z.object({tier:oe.z.literal(1),enabled:oe.z.literal(!0),optional:oe.z.literal(!1),invokes_provider_subprocess:oe.z.literal(!1),authority:oe.z.literal("host"),native_surfaces:mU,capability_bindings:oe.z.record(Lg,hU)}).strict().superRefine((e,t)=>{let n=Object.keys(e.capability_bindings).sort(),i=[...e.native_surfaces].sort();JSON.stringify(n)!==JSON.stringify(i)&&t.addIssue({code:"custom",path:["capability_bindings"],message:"every native surface requires exactly one conformance/maturity binding"})}),yU=oe.z.object({tier:oe.z.union([oe.z.literal(2),oe.z.literal(3)]),enabled:oe.z.boolean(),optional:oe.z.literal(!0),invokes_provider_subprocess:oe.z.literal(!0),authority:oe.z.literal("framework"),native_surfaces:oe.z.array(oe.z.never()).length(0),opt_in:oe.z.object({required:oe.z.literal(!0),allowed_sources:oe.z.array(oe.z.enum(["project_config","human_decision"])).min(1).refine(e=>new Set(e).size===e.length,{message:"opt-in sources must be unique"})}).strict()}).strict(),ms=oe.z.object({selection:oe.z.enum(["host_available","inherit_host"]),reasoning:oe.z.enum(["low","medium","high"]),intent:oe.z.string().min(1)}).strict(),dj=oe.z.object({schema_version:oe.z.literal(1),host_id:oe.z.literal("codex"),candidate_sha256:oe.z.null(),default_mode:oe.z.literal("codex_host_native"),modes:oe.z.object({codex_host_native:vU,provider_subprocess:yU}).strict(),model_classes:oe.z.object({frontier:ms,balanced:ms,fast_scan:ms,review:ms}).strict()}).strict(),_j=oe.z.object({enabled:oe.z.literal(!0),source:oe.z.enum(["project_config","human_decision"]),provenance:oe.z.object({reference:oe.z.string().min(1),recorded_at:oe.z.string().datetime({offset:!0})}).strict()}).strict();var Pe=nt(ct(),1);var bU=Pe.z.object({schema_version:Pe.z.literal(1),project:Pe.z.object({id:Pe.z.string().min(1),name:Pe.z.string().min(1),timezone:Pe.z.string().min(1).default("America/Sao_Paulo")}),framework:Pe.z.object({version:Pe.z.string().min(1)}),layout:Pe.z.object({version:Pe.z.literal(1),managed_namespace:Pe.z.string().min(1).default(".agents/managed"),project_namespace:Pe.z.string().min(1).default(".agents/project")}).default({version:1,managed_namespace:".agents/managed",project_namespace:".agents/project"}),profile:Pe.z.object({id:Pe.z.string().min(1).default("zaip-aios-stack")}),paths:Pe.z.object({specs:Pe.z.string().min(1).default(".agents/specs"),changes:Pe.z.string().min(1).default(".agents/changes"),tasks:Pe.z.string().min(1).default(".agents/tasks"),decisions:Pe.z.string().min(1).default(".agents/decisions"),runs:Pe.z.string().min(1).default(".agents/runs")}).default({specs:".agents/specs",changes:".agents/changes",tasks:".agents/tasks",decisions:".agents/decisions",runs:".agents/runs"}),agents:Pe.z.array(Pe.z.enum(["codex","claude"])).default(["codex","claude"])}).strict(),vj=Pe.z.toJSONSchema(bU);var Kl=class{#e;constructor(t){let n=new Map;for(let i of t){let r=n.get(i.from)??new Set;r.add(i.to),n.set(i.from,r)}this.#e=n}canTransition(t,n){return this.#e.get(t)?.has(n)??!1}assertTransition(t,n){if(!this.canTransition(t,n))throw new Error(`Invalid state transition: ${t} -> ${n}`)}nextStates(t){return[...this.#e.get(t)??[]]}};var $j=new Kl([{from:"draft",to:"planned"},{from:"draft",to:"cancelled"},{from:"planned",to:"executing"},{from:"planned",to:"cancelled"},{from:"executing",to:"verifying"},{from:"executing",to:"blocked"},{from:"executing",to:"cancelled"},{from:"verifying",to:"completed"},{from:"verifying",to:"failed"},{from:"verifying",to:"blocked"},{from:"verifying",to:"cancelled"},{from:"blocked",to:"executing"},{from:"blocked",to:"cancelled"}]);var z=nt(ct(),1);var Xl=e=>Math.round(e*1e6)/1e6;function gs(e,t,n){let i=`${e} ${t} ${n}`.toLowerCase();return i.includes("claude")||i.includes("anthropic")?"anthropic":i.includes("gpt")||i.includes("openai")||i.includes("codex")?"openai":null}function Mg(e){let t=Math.max(e.inputTokens-e.cachedInputTokens,0),n=Xl(t/1e6*e.inputRate*e.inputMultiplier),i=Xl(e.cachedInputTokens/1e6*(e.cachedInputRate??0)*e.inputMultiplier),r=Xl(e.outputTokens/1e6*e.outputRate*e.outputMultiplier);return{inputUsd:n,cachedInputUsd:i,outputUsd:r,reasoningUsd:0}}var Te=nt(ct(),1),jr=Te.z.number().finite().nonnegative().nullable(),AU=Te.z.object({task_id:Te.z.string().min(1),completed:Te.z.boolean(),completed_at:Te.z.string().min(1).nullable(),attempt:Te.z.number().int().nonnegative().nullable(),attempt_id:Te.z.string().min(1).nullable().optional(),equivalence_key:Te.z.string().min(1).nullable().optional(),model:Te.z.string().min(1).nullable(),reasoning_effort:Te.z.enum(["low","medium","high","xhigh"]).nullable(),baseline_task_id:Te.z.string().min(1).nullable(),baseline_attempt_id:Te.z.string().min(1).nullable().optional(),baseline_equivalence_id:Te.z.string().min(1).nullable(),observed_cost_usd:jr,baseline_observed_cost_usd:jr,quality_score:jr,quality_floor:jr,rework_count:Te.z.number().int().nonnegative().nullable(),billed_amount:jr.optional(),billed_currency:Te.z.string().min(1).nullable().optional(),billed_provenance:Te.z.enum(["observed","inferred","unavailable"]).nullable().optional(),billed_source_id:Te.z.string().min(1).nullable().optional(),billed_at:Te.z.string().min(1).nullable().optional(),baseline_billed_amount:jr.optional(),baseline_billed_currency:Te.z.string().min(1).nullable().optional(),baseline_billed_provenance:Te.z.enum(["observed","inferred","unavailable"]).nullable().optional(),baseline_billed_source_id:Te.z.string().min(1).nullable().optional(),baseline_billed_at:Te.z.string().min(1).nullable().optional()}).strict(),hD=Te.z.object({timezone:Te.z.string().min(1),interval:Te.z.object({start:Te.z.string().min(1),end:Te.z.string().min(1)}).strict(),equivalence_key:Te.z.string().min(1).nullable().optional(),tasks:Te.z.array(AU)}).strict();var fr=z.z.string().datetime({offset:!0}).or(z.z.string().datetime()),IU=z.z.object({id:z.z.string().min(1),provider:z.z.enum(["openai","anthropic"]),aliases:z.z.array(z.z.string().min(1)).default([]),input_per_million_usd:z.z.number().nonnegative(),cached_input_per_million_usd:z.z.number().nonnegative().nullable().default(null),output_per_million_usd:z.z.number().nonnegative(),reasoning_per_million_usd:z.z.number().nonnegative().nullable().default(null),priority_input_per_million_usd:z.z.number().nonnegative().nullable().optional(),priority_cached_input_per_million_usd:z.z.number().nonnegative().nullable().optional(),priority_output_per_million_usd:z.z.number().nonnegative().nullable().optional(),priority_reasoning_per_million_usd:z.z.number().nonnegative().nullable().optional(),reasoning_billed_separately:z.z.boolean().default(!1),long_context_threshold_tokens:z.z.number().int().positive().nullable().default(null),long_context_input_multiplier:z.z.number().positive().default(1),long_context_output_multiplier:z.z.number().positive().default(1),source_label:z.z.string().min(1),source_url:z.z.string().url(),notes:z.z.array(z.z.string()).default([])}).strict(),Pg=z.z.object({schema_version:z.z.literal(1),updated_at:fr,source:z.z.string().min(1),disclaimer:z.z.string().min(1),models:z.z.array(IU)}).strict(),xg=z.z.object({schema_version:z.z.literal(1),base:z.z.literal("USD"),quote:z.z.literal("BRL"),rate:z.z.number().positive(),as_of:fr,source_label:z.z.string().min(1),source_url:z.z.string().url()}).strict(),jg=z.z.object({input:z.z.number().int().nonnegative().nullable(),cached_input:z.z.number().int().nonnegative().nullable().default(null),output:z.z.number().int().nonnegative().nullable(),reasoning:z.z.number().int().nonnegative().nullable(),total:z.z.number().int().nonnegative().nullable().default(null),source:z.z.preprocess(e=>e==="client"?"provider_reported":e,z.z.enum(["provider_reported","estimated","unavailable"]))}).strict(),Dg=z.z.object({estimated_usd:z.z.number().nonnegative().nullable(),estimated_brl:z.z.number().nonnegative().nullable(),fx_rate:z.z.number().positive().nullable(),pricing_model:z.z.string().nullable(),pricing_source:z.z.string().nullable(),input_usd:z.z.number().nonnegative().nullable().default(null),cached_input_usd:z.z.number().nonnegative().nullable().default(null),output_usd:z.z.number().nonnegative().nullable().default(null),reasoning_usd:z.z.number().nonnegative().nullable().default(null)}).strict(),NU=z.z.object({cycle_count:z.z.number().int().nonnegative().nullable(),source:z.z.enum(["repository","local-codex","manual","unavailable"]),segment_key:z.z.string().nullable()}).strict(),OU=z.z.object({schema_version:z.z.literal(1),recorded_at:fr,run_id:z.z.string().startsWith("RUN-"),task_id:z.z.string().startsWith("TASK-"),spec_id:z.z.string().nullable(),change_id:z.z.string().nullable(),task_title:z.z.string().nullable(),task_status:z.z.string().nullable(),client:z.z.string().min(1),agent:z.z.string().min(1),provider:z.z.enum(["openai","anthropic"]).nullable(),model:z.z.string().min(1),status:z.z.enum(["running","completed","failed"]),started_at:fr,finished_at:fr.nullable(),duration_ms:z.z.number().int().nonnegative().nullable(),token_usage:jg,estimated_cost:Dg,telemetry:NU,source_segment_key:z.z.string().nullable()}).strict(),wU=z.z.object({schema_version:z.z.literal(1),recorded_at:fr,run_id:z.z.string().startsWith("RUN-"),task_id:z.z.string().startsWith("TASK-"),cycle_index:z.z.number().int().nonnegative(),provider:z.z.enum(["openai","anthropic"]).nullable(),model:z.z.string().min(1),timestamp:fr,source:z.z.enum(["local-codex","manual"]),source_segment_key:z.z.string().nullable(),token_usage:jg,estimated_cost:Dg}).strict();function Ug(e){return Math.round(e*1e6)/1e6}function hs(e){let t=e.provider??gs(e.model,"",""),n=e.model.toLowerCase(),i=E=>{let A=E.toLowerCase();if(n===A)return!0;let R=n.slice(A.length);return R.startsWith("@")||R.startsWith(":")||R.startsWith("/")||/^-\d{4}-\d{2}-\d{2}(?:$|[.:@/])/.test(R)},r=e.catalog.models.find(E=>i(E.id)||E.aliases.some(A=>i(A)));if(!r||t!==null&&r.provider!==t)return{estimated_usd:null,estimated_brl:null,fx_rate:e.fxRate?.rate??null,pricing_model:null,pricing_source:null,input_usd:null,cached_input_usd:null,output_usd:null,reasoning_usd:null};let o=e.usage.cached_input,a=e.usage.input,s=e.usage.output;if(a===null||o===null||s===null)return{estimated_usd:null,estimated_brl:null,fx_rate:e.fxRate?.rate??null,pricing_model:r.id,pricing_source:r.source_label,input_usd:null,cached_input_usd:null,output_usd:null,reasoning_usd:null};let c=e.usage.reasoning??0,l=r.long_context_threshold_tokens!==null&&(e.usage.input??0)>r.long_context_threshold_tokens,_=l?r.long_context_input_multiplier:1,u=l?r.long_context_output_multiplier:1,f=e.serviceTier==="priority"||e.serviceTier==="fast";if(f&&l)return{estimated_usd:null,estimated_brl:null,fx_rate:e.fxRate?.rate??null,pricing_model:r.id,pricing_source:r.source_label,input_usd:null,cached_input_usd:null,output_usd:null,reasoning_usd:null};let p=f?r.priority_input_per_million_usd??null:r.input_per_million_usd,y=f?r.priority_output_per_million_usd??null:r.output_per_million_usd;if(p===null||y===null)return{estimated_usd:null,estimated_brl:null,fx_rate:e.fxRate?.rate??null,pricing_model:r.id,pricing_source:r.source_label,input_usd:null,cached_input_usd:null,output_usd:null,reasoning_usd:null};let{inputUsd:v,cachedInputUsd:h,outputUsd:O,reasoningUsd:C}=Mg({inputTokens:a,cachedInputTokens:o,outputTokens:s,reasoningTokens:c,inputRate:p,cachedInputRate:f?r.priority_cached_input_per_million_usd??null:r.cached_input_per_million_usd,outputRate:y,reasoningRate:f?r.priority_reasoning_per_million_usd??null:r.reasoning_per_million_usd,inputMultiplier:_,outputMultiplier:u}),D=Ug(v+h+O+C),b=e.fxRate===null||e.fxRate===void 0?null:Ug(D*e.fxRate.rate);return{estimated_usd:D,estimated_brl:b,fx_rate:e.fxRate?.rate??null,pricing_model:r.id,pricing_source:r.source_label,input_usd:v,cached_input_usd:h,output_usd:O,reasoning_usd:C}}var te=nt(ct(),1);var qe=nt(ct(),1),zg=qe.z.string().datetime({offset:!0}).or(qe.z.string().datetime()),RU=qe.z.string().regex(/^DEC-(?:HUMAN|AI)-/),LU=qe.z.enum(["architecture","contract","database","security","dependency","network","infrastructure","cost","implementation","rollback"]),YD=qe.z.object({schema_version:qe.z.literal(2),id:RU,title:qe.z.string().min(1),scope_type:qe.z.enum(["change","execution"]),scope_id:qe.z.string().min(1),origin:qe.z.enum(["human","agent"]),category:LU,context:qe.z.string().min(1),decision:qe.z.string().min(1),reason:qe.z.string().min(1),alternatives:qe.z.array(qe.z.string().min(1)),consequences:qe.z.array(qe.z.string().min(1)),reversible:qe.z.boolean(),rollback:qe.z.string().min(1),confidence:qe.z.number().min(0).max(1).nullable(),created_at:zg,confirmed_at:zg.nullable()}).strict().superRefine((e,t)=>{let n=e.scope_type==="change"?"CHG-":"EXEC-";e.scope_id.startsWith(n)||t.addIssue({code:"custom",path:["scope_id"],message:`${e.scope_type} decision requires ${n} scope_id`});let i=e.origin==="human"?"DEC-HUMAN-":"DEC-AI-";e.id.startsWith(i)||t.addIssue({code:"custom",path:["id"],message:`${e.origin} decision requires ${i} id`}),e.origin==="human"&&e.confidence!==null&&t.addIssue({code:"custom",path:["confidence"],message:"Human decisions do not use agent confidence"}),e.origin==="agent"&&e.confidence===null&&t.addIssue({code:"custom",path:["confidence"],message:"Agent decisions require confidence"}),e.origin==="human"&&e.confirmed_at===null&&t.addIssue({code:"custom",path:["confirmed_at"],message:"Human decisions require explicit confirmation provenance"})});var S=nt(ct(),1);var vt=nt(ct(),1),MU=vt.z.string().datetime({offset:!0}).or(vt.z.string().datetime()),Fg=vt.z.object({schema_version:vt.z.literal(2),event_id:vt.z.string().min(1).max(200),run_id:vt.z.string().startsWith("RUN-"),sequence:vt.z.number().int().positive(),occurred_at:MU,type:vt.z.literal("run.attribution.recovered"),phase:vt.z.literal("execution"),execution_id:vt.z.string().startsWith("EXEC-"),task_id:vt.z.string().startsWith("TASK-"),change_id:vt.z.string().startsWith("CHG-")}).strict();function Zg(e,t){return e.entrypoint==="task"&&e.execution_id!==null&&e.task_id!==null&&e.change_id===null&&t.execution_id===e.execution_id&&t.task_id===e.task_id}function Yl(e,t){return e.coverage==="partial"&&t.coverage==="complete"&&e.call_id===t.call_id&&e.agent_invocation_id===t.agent_invocation_id&&e.source_call_key===t.source_call_key&&JSON.stringify(e.tokens)===JSON.stringify(t.tokens)}function Ql(e,t,n){return e.type==="usage.recorded"&&e.retrospective_correction===!0&&e.activity_kind==="retrospective_local_remeasurement"&&e.supersedes_event_id!==null&&n.has(e.supersedes_event_id)&&e.phase===t.phase}function vs(e,t){let n={conversation:0,planning:1,execution:2};if(n[t]<n[e])throw new Error(`Run V2 phase cannot move backward from ${e} to ${t}`)}var Ln=S.z.string().datetime({offset:!0}).or(S.z.string().datetime()),ys=S.z.enum(["conversation","planning","execution"]),tu=S.z.string().startsWith("RUN-"),xU=S.z.string().startsWith("CONV-"),qg=S.z.string().startsWith("EXEC-").nullable(),Vg=S.z.string().startsWith("TASK-").nullable(),Wg=S.z.string().startsWith("SPEC-").nullable(),Bg=S.z.string().startsWith("PRD-").nullable(),Hg=S.z.string().startsWith("CHG-").nullable(),eu=tu.nullable(),pr=S.z.string().regex(/^(?:AINV|INV)-/).max(200),Jg=S.z.string().startsWith("MCALL-").max(200),iz=S.z.enum(["intake","orchestrator","subagent"]),jU=S.z.enum(["intake","orchestrator","subagent","owner","contributor"]),Kg=S.z.enum(["intake","orchestration","execution","review","audit","finalization"]),nu=S.z.enum(["low","medium","high","xhigh"]);var Xg=S.z.enum(["orchestrator","delegated"]);var ru=S.z.object({input:S.z.number().int().nonnegative().nullable(),cached_input:S.z.number().int().nonnegative().nullable(),output:S.z.number().int().nonnegative().nullable(),reasoning:S.z.number().int().nonnegative().nullable(),total:S.z.number().int().nonnegative().nullable(),source:S.z.enum(["provider_reported","estimated","unavailable"])}).strict().superRefine((e,t)=>{e.input!==null&&e.cached_input!==null&&e.cached_input>e.input&&t.addIssue({code:"custom",path:["cached_input"],message:"cached_input cannot exceed input"}),e.total!==null&&e.input!==null&&e.output!==null&&e.total<e.input+e.output&&t.addIssue({code:"custom",path:["total"],message:"total cannot be lower than input + output"})}),Gg=S.z.object({usd:S.z.number().nonnegative().nullable(),brl:S.z.number().nonnegative().nullable(),fx_rate:S.z.number().positive().nullable().optional()}).strict(),Dr={schema_version:S.z.literal(2),event_id:S.z.string().min(1).max(200),run_id:tu,sequence:S.z.number().int().positive(),occurred_at:Ln},DU=S.z.object({intent:S.z.enum(["conversation","continue","refine","rework","new_work"]),classification_source:S.z.enum(["agent","explicit","fallback"]),confidence:S.z.number().min(0).max(1),reason_codes:S.z.array(S.z.string().regex(/^[a-z][a-z0-9-]{0,63}$/)).min(1).max(12)}).strict(),Yg=S.z.object({...Dr,type:S.z.literal("run.started"),attribution_status:S.z.enum(["attributed","legacy_unattributed"]),phase:ys,run_role:jU.optional(),run_purpose:Kg.optional(),requires_finalizer:S.z.boolean().optional(),execution_kind:S.z.enum(["interaction","delivery"]).optional(),execution_eligibility:S.z.array(S.z.enum(["interaction","delivery"])).optional(),entrypoint:S.z.enum(["conversation","task","spec","prd"]),work_type:S.z.enum(["new","rework"]),storage_mode:S.z.enum(["tracked_sanitized","local_only"]),client:S.z.string().min(1).max(100),agent:S.z.string().min(1).max(100),agent_name:S.z.string().min(1).max(100).nullable().optional(),agent_identity_warning:S.z.object({code:S.z.literal("deprecated-agent-identity"),kind:S.z.enum(["id","codex_name","codex_task_name"]),requested:S.z.string().min(1),canonical_id:S.z.string().min(1),deprecated_at:S.z.iso.date(),remove_after:S.z.iso.date()}).strict().optional(),provider:S.z.string().min(1).max(100).nullable(),model:S.z.string().min(1).max(200),reasoning_effort:nu.nullable().optional(),client_thread_id:S.z.string().min(1).max(200).nullable().optional(),client_turn_id:S.z.string().min(1).max(200).nullable().optional(),conversation_id:xU,execution_id:qg,task_id:Vg,spec_id:Wg,prd_id:Bg,change_id:Hg,parent_run_id:eu,continuation_of_run_id:eu,retry_of_run_id:eu,agent_invocation_id:pr.optional(),root_agent_invocation_id:pr.optional(),parent_agent_invocation_id:pr.nullable().optional(),invocation_kind:Xg.optional(),delegation_depth:S.z.number().int().nonnegative().optional(),intake:DU.nullable().optional()}).strict().superRefine((e,t)=>{e.phase==="execution"&&e.execution_id===null&&e.attribution_status!=="legacy_unattributed"&&t.addIssue({code:"custom",path:["execution_id"],message:"Execution phase requires execution_id"}),{conversation:e.conversation_id,task:e.task_id,spec:e.spec_id,prd:e.prd_id}[e.entrypoint]===null&&t.addIssue({code:"custom",path:[`${e.entrypoint}_id`],message:`${e.entrypoint} entrypoint requires its scope id`}),e.run_role==="orchestrator"&&e.parent_run_id!==null&&t.addIssue({code:"custom",path:["parent_run_id"],message:"orchestrator Run cannot have parent_run_id"}),e.run_role==="subagent"&&e.parent_run_id===null&&t.addIssue({code:"custom",path:["parent_run_id"],message:"subagent Sub-Run requires parent_run_id"});let i=e.agent_invocation_id!==void 0;i&&(e.root_agent_invocation_id===void 0||e.parent_agent_invocation_id===void 0||e.invocation_kind===void 0||e.delegation_depth===void 0)&&t.addIssue({code:"custom",path:["agent_invocation_id"],message:"Agent Invocation identity must be complete when present"}),i&&e.invocation_kind==="orchestrator"&&(e.parent_agent_invocation_id!==null||e.root_agent_invocation_id!==e.agent_invocation_id||e.delegation_depth!==0)&&t.addIssue({code:"custom",path:["invocation_kind"],message:"orchestrator Agent Invocation must be its root at depth zero"}),i&&e.invocation_kind==="delegated"&&(e.parent_agent_invocation_id===null||e.delegation_depth===0)&&t.addIssue({code:"custom",path:["parent_agent_invocation_id"],message:"delegated Agent Invocation requires a parent and positive depth"});for(let[r,o]of[["parent_run_id",e.parent_run_id],["continuation_of_run_id",e.continuation_of_run_id],["retry_of_run_id",e.retry_of_run_id]])o===e.run_id&&t.addIssue({code:"custom",path:[r],message:`${r} cannot reference itself`})}),Qg=S.z.object({...Dr,type:S.z.literal("usage.recorded"),phase:ys,activity_kind:S.z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/),classification_source:S.z.enum(["explicit","current_context","default","legacy_inferred"]),tokens:ru,cost:Gg,provider:S.z.string().min(1).max(100).nullable(),model:S.z.string().min(1).max(200).nullable(),source_segment_key:S.z.string().min(1).max(500).nullable(),model_call_id:Jg.nullable().optional(),runtime:S.z.object({reasoning_effort:S.z.string().min(1).max(40).nullable(),service_tier:S.z.string().min(1).max(40).nullable()}).strict().optional(),supersedes_event_id:S.z.string().min(1).max(200).nullable(),retrospective_correction:S.z.literal(!0).optional(),source_occurred_at:Ln.optional(),source_started_at:Ln.optional(),source_finished_at:Ln.optional(),duration_ms:S.z.number().int().nonnegative().nullable().optional(),duration_provenance:S.z.enum(["observed","reconciled","legacy_inferred","estimated","unavailable"]).nullable().optional(),context_stats:S.z.object({initial_pack_tokens:S.z.number().int().nonnegative().nullable(),tool_output_tokens:S.z.number().int().nonnegative().nullable(),files_opened:S.z.number().int().nonnegative().nullable(),snippets_opened:S.z.number().int().nonnegative().nullable()}).strict().optional()}).strict(),eh=S.z.object({...Dr,type:S.z.literal("model.call.observed"),call_id:Jg,agent_invocation_id:pr,coverage:S.z.enum(["complete","partial","unavailable"]),tokens:ru,cost:Gg,provider:S.z.string().min(1).max(100).nullable(),model:S.z.string().min(1).max(200).nullable(),source_call_key:S.z.string().min(1).max(500).nullable(),source_occurred_at:Ln.optional(),source_started_at:Ln.optional(),source_finished_at:Ln.optional(),runtime:S.z.object({reasoning_effort:S.z.string().min(1).max(40).nullable(),service_tier:S.z.string().min(1).max(40).nullable()}).strict().optional()}).strict(),th=S.z.object({schema_version:S.z.literal(1),run_id:tu,execution_id:qg.nullable().default(null),task_id:Vg.nullable().default(null),spec_id:Wg.nullable().default(null),prd_id:Bg.nullable().default(null),change_id:Hg.nullable().default(null),zaip_agent:S.z.string().min(1).max(100).nullable().default(null),phase:ys.nullable().default(null),purpose:Kg.nullable().default(null),agent_invocation_id:pr,root_agent_invocation_id:pr,parent_agent_invocation_id:pr.nullable(),invocation_kind:Xg,delegation_depth:S.z.number().int().nonnegative(),client:S.z.enum(["codex","codex-desktop","codex-subagent"]),thread_id:S.z.string().min(1).max(200).nullable(),turn_id:S.z.string().min(1).max(200).nullable(),agent_path:S.z.string().min(1).max(500).nullable()}).strict().superRefine((e,t)=>{e.invocation_kind==="orchestrator"&&(e.parent_agent_invocation_id!==null||e.root_agent_invocation_id!==e.agent_invocation_id||e.delegation_depth!==0)&&t.addIssue({code:"custom",path:["invocation_kind"],message:"orchestrator telemetry correlation must be its root at depth zero"}),e.invocation_kind==="delegated"&&(e.parent_agent_invocation_id===null||e.delegation_depth===0)&&t.addIssue({code:"custom",path:["parent_agent_invocation_id"],message:"delegated telemetry correlation requires a parent and positive depth"}),e.client==="codex-subagent"&&(e.thread_id!==null||e.agent_path===null&&e.turn_id===null)&&t.addIssue({code:"custom",path:["agent_path"],message:"Codex subagent telemetry requires agent_path or turn_id and no root thread_id"}),e.client!=="codex-subagent"&&e.thread_id===null&&e.turn_id===null&&t.addIssue({code:"custom",path:["thread_id"],message:"Codex root telemetry requires thread_id or turn_id"})}),nh=S.z.object({correlation:th,event_kind:S.z.enum(["response","usage","terminal","error"]),source:S.z.enum(["codex_app_server","codex_session_fallback","unavailable"]),source_event_key:S.z.string().min(1).max(500),source_method:S.z.enum(["item/completed","rawResponse/completed","thread/tokenUsage/updated","error","turn/completed"]).optional(),stream_boundary:S.z.enum(["item_completed","response_completed","usage_updated","error","turn_completed"]).optional(),source_occurred_at:Ln.nullable(),captured_at:Ln,coverage:S.z.enum(["complete","partial","unavailable"]),tokens:ru.nullable(),provider:S.z.string().min(1).max(100).nullable(),model:S.z.string().min(1).max(200).nullable(),runtime:S.z.object({reasoning_effort:S.z.string().min(1).max(40).nullable(),service_tier:S.z.string().min(1).max(40).nullable()}).strict(),status:S.z.enum(["completed","failed","cancelled"]).nullable(),will_retry:S.z.boolean().nullable().optional(),latency_ms:S.z.number().int().nonnegative().nullable(),historical_cost:S.z.object({estimated_usd:S.z.number().nonnegative().nullable(),estimated_brl:S.z.number().nonnegative().nullable(),fx_rate:S.z.number().positive().nullable(),pricing_model:S.z.string().nullable(),pricing_source:S.z.string().nullable(),input_usd:S.z.number().nonnegative().nullable(),cached_input_usd:S.z.number().nonnegative().nullable(),output_usd:S.z.number().nonnegative().nullable(),reasoning_usd:S.z.number().nonnegative().nullable()}).strict().nullable().optional(),context_stats:S.z.object({initial_pack_tokens:S.z.number().int().nonnegative().nullable(),tool_output_tokens:S.z.number().int().nonnegative().nullable(),files_opened:S.z.number().int().nonnegative().nullable(),snippets_opened:S.z.number().int().nonnegative().nullable()}).strict().nullable(),discarded_counts:S.z.object({prompt:S.z.number().int().nonnegative(),response_text:S.z.number().int().nonnegative(),reasoning:S.z.number().int().nonnegative(),secrets:S.z.number().int().nonnegative()}).strict()}).strict().superRefine((e,t)=>{e.source==="codex_session_fallback"&&e.coverage==="complete"&&t.addIssue({code:"custom",path:["coverage"],message:"Codex session fallback coverage must be partial or unavailable"}),e.source==="unavailable"&&e.coverage!=="unavailable"&&t.addIssue({code:"custom",path:["coverage"],message:"Unavailable source requires unavailable coverage"}),e.source==="unavailable"&&(e.provider!==null||e.model!==null||e.runtime.reasoning_effort!==null||e.runtime.service_tier!==null||e.latency_ms!==null)&&t.addIssue({code:"custom",path:["source"],message:"Unavailable source cannot contain effective runtime observations"}),e.coverage==="unavailable"&&e.tokens!==null&&e.tokens.source!=="unavailable"&&t.addIssue({code:"custom",path:["tokens","source"],message:"Unavailable coverage cannot contain observed tokens"}),e.event_kind==="terminal"&&e.status===null&&t.addIssue({code:"custom",path:["status"],message:"Terminal telemetry requires status"}),e.event_kind==="error"&&(e.will_retry===!0&&e.status!==null||e.will_retry!==!0&&e.status!=="failed")&&t.addIssue({code:"custom",path:["status"],message:"Retrying errors require null status; terminal errors require failed status"})}),zU=S.z.object({schema_version:S.z.literal(1),event_id:S.z.string().startsWith("CEVT-").max(200),checksum_sha256:S.z.string().regex(/^[a-f0-9]{64}$/),compaction:S.z.object({status:S.z.enum(["pending","compacted"]),compacted_at:Ln.nullable()}).strict(),event:nh}).strict(),rh=S.z.string().startsWith("INV-").max(200),ih=S.z.object({...Dr,type:S.z.literal("model.selection.recorded"),invocation_id:rh,requested:S.z.object({model:S.z.string().min(1).max(200),reasoning_effort:nu.nullable(),velocity:S.z.literal("standard")}).strict(),selection:S.z.object({source:S.z.enum(["execution-override","task-override","auto-policy","project-default"]),policy_version:S.z.number().int().positive(),reasons:S.z.array(S.z.string().regex(/^[a-z][a-z0-9-]{0,63}$/)).min(1).max(20)}).strict()}).strict(),oh=S.z.object({...Dr,type:S.z.literal("provider.invocation.finished"),invocation_id:rh,status:S.z.enum(["completed","failed","cancelled"]),effective:S.z.object({provider:S.z.string().min(1).max(100).nullable(),model:S.z.string().min(1).max(200).nullable(),reasoning_effort:nu.nullable(),service_tier:S.z.string().min(1).max(40).nullable()}).strict(),latency_ms:S.z.number().int().nonnegative().nullable()}).strict(),ah=S.z.object({...Dr,type:S.z.literal("run.finished"),phase:ys,status:S.z.enum(["completed","failed","cancelled"]),duration_ms:S.z.number().int().nonnegative().nullable().default(null),duration_provenance:S.z.enum(["observed","reconciled","legacy_inferred","estimated","unavailable"]).nullable().default(null)}).strict(),bs=S.z.discriminatedUnion("type",[Yg,Qg,eh,ih,oh,Fg,ah]);var lz=64*1024;function uh(e){let t=new Map,n=[];for(let i of e){if(i.source_segment_key===null){n.push(i);continue}let r=t.get(i.source_segment_key);if(r===void 0){t.set(i.source_segment_key,i),n.push(i);continue}if(!dh(i,r))throw new Error(`Divergent duplicate source segment: ${i.source_segment_key}`)}return n}function dh(e,t){return JSON.stringify(lh(e))===JSON.stringify(lh(t))}function lh(e){return{phase:e.phase,activity_kind:e.activity_kind,classification_source:e.classification_source,tokens:e.tokens,cost:e.cost,provider:e.provider,model:e.model,source_segment_key:e.source_segment_key,model_call_id:e.model_call_id??null}}function iu(e){let t=[],n=null;for(let i of e.split(/\r?\n/).map(r=>r.trim()).filter(Boolean)){let r=JSON.parse(i),o=Array.isArray(r)?HU(r,n):r,a=bs.parse(o);n??=a.run_id,t.push(a)}return t}function ou(e){let t=new Map;for(let v of e){let h=bs.parse(v),O=t.get(h.event_id);if(O!==void 0){if(JSON.stringify(O)!==JSON.stringify(h))throw new Error(`Divergent duplicate Run V2 event: ${h.event_id}`);continue}t.set(h.event_id,h)}let n=[...t.values()].sort((v,h)=>v.sequence-h.sequence);if(n.length===0||n[0]?.type!=="run.started")throw new Error("Run V2 stream must start with run.started");let i=n[0],r=i.phase,o=null,a=null,s=new Map,c=new Map,l=new Map,_=new Map,u=new Map;for(let[v,h]of n.entries()){if(h.run_id!==i.run_id)throw new Error("Run V2 stream mixes run ids");if(h.sequence!==v+1)throw new Error("Run V2 sequence must be contiguous");let O=s.get(h.sequence);if(O!==void 0&&O!==h.event_id)throw new Error(`Run V2 sequence is duplicated: ${h.sequence}`);if(s.set(h.sequence,h.event_id),v>0&&h.type==="run.started")throw new Error("Run V2 has multiple starts");if(o!==null&&!Ql(h,o,c))throw new Error("Run V2 contains a non-retrospective record after run.finished");if(h.type==="usage.recorded"){if(vs(r,h.phase),h.phase==="execution"&&i.execution_id===null&&i.attribution_status!=="legacy_unattributed")throw new Error("Execution phase requires execution_id");if(h.supersedes_event_id!==null&&!c.has(h.supersedes_event_id))throw new Error(`Superseded usage event must occur earlier: ${h.supersedes_event_id}`);c.set(h.event_id,h),r=h.phase}if(h.type==="run.attribution.recovered"){if(!Zg(i,h))throw new Error("Run attribution recovery does not match its immutable start header");if(a!==null)throw new Error("Run V2 has multiple attribution recoveries");vs(r,h.phase),r=h.phase,a=h}if(h.type==="model.selection.recorded"){if(JU(i,n.slice(0,v),{invocationId:h.invocation_id,requested:h.requested,selection:h.selection}),l.has(h.invocation_id))throw new Error(`Duplicate model selection for invocation: ${h.invocation_id}`);l.set(h.invocation_id,h)}if(h.type==="provider.invocation.finished"){if(!l.has(h.invocation_id))throw new Error(`Provider invocation requires earlier model selection: ${h.invocation_id}`);if(_.has(h.invocation_id))throw new Error(`Duplicate provider terminal for invocation: ${h.invocation_id}`);_.set(h.invocation_id,h)}if(h.type==="model.call.observed"){let C=u.get(h.call_id);if(C!==void 0&&JSON.stringify(C)!==JSON.stringify(h)&&!Yl(C,h))throw new Error(`Divergent duplicate Model Call: ${h.call_id}`);u.set(h.call_id,h)}if(h.type==="run.finished"){if(h.phase!==r)throw new Error("run.finished phase must match the latest phase");o=h}}let f=n.filter(v=>v.type==="usage.recorded"),p=new Set(f.map(v=>v.supersedes_event_id).filter(v=>v!==null)),y=uh(f.filter(v=>!p.has(v.event_id)));return{run:a===null?i:{...i,phase:a.phase,execution_id:a.execution_id,task_id:a.task_id,change_id:a.change_id},status:o?.status??"running",finished:o,attribution_recovery:a,records:n,usage_records:f,effective_usage_records:y,model_selection_records:[...l.values()],provider_invocation_records:[..._.values()],model_call_records:[...u.values()]}}function HU(e,t){if(e[0]!==3||t===null)throw new Error("Run delta requires transport version 3 and a preceding run.started header");if(e[1]==="f")return{schema_version:2,type:"run.finished",run_id:t,event_id:e[2],sequence:e[3],occurred_at:e[4],phase:e[5],status:e[6]};if(e[1]==="a")return{schema_version:2,type:"run.attribution.recovered",run_id:t,event_id:e[2],sequence:e[3],occurred_at:e[4],phase:e[5],execution_id:e[6],task_id:e[7],change_id:e[8]};if(e[1]==="m"&&Array.isArray(e[6])&&Array.isArray(e[7])){let _=e[6],u=e[7];return{schema_version:2,type:"model.selection.recorded",run_id:t,event_id:e[2],sequence:e[3],occurred_at:e[4],invocation_id:e[5],requested:{model:_[0],reasoning_effort:_[1],velocity:_[2]},selection:{source:u[0],policy_version:u[1],reasons:u[2]}}}if(e[1]==="p"&&Array.isArray(e[7])){let _=e[7];return{schema_version:2,type:"provider.invocation.finished",run_id:t,event_id:e[2],sequence:e[3],occurred_at:e[4],invocation_id:e[5],status:e[6],effective:{provider:_[0],model:_[1],reasoning_effort:_[2],service_tier:_[3]},latency_ms:e[8]}}if(e[1]==="c"&&Array.isArray(e[8])&&Array.isArray(e[9])){let _=e[8],u=e[9],f=e[16];return{schema_version:2,type:"model.call.observed",run_id:t,event_id:e[2],sequence:e[3],occurred_at:e[4],call_id:e[5],agent_invocation_id:e[6],coverage:e[7],tokens:{input:_[0],cached_input:_[1],output:_[2],reasoning:_[3],total:_[4],source:_[5]},cost:{usd:u[0],brl:u[1],fx_rate:u[2]??null},provider:e[10],model:e[11],source_call_key:e[12],...e[13]===null?{}:{source_occurred_at:e[13]},...e[14]===null||e[14]===void 0?{}:{source_started_at:e[14]},...e[15]===null||e[15]===void 0?{}:{source_finished_at:e[15]},...f===null||!Array.isArray(f)?{}:{runtime:{reasoning_effort:f[0],service_tier:f[1]}}}}if(e[1]!=="u"||!Array.isArray(e[8])||!Array.isArray(e[9]))throw new Error("Invalid Run transport v3 delta");let n=e[8],i=e[9],r=e[15],o=e[16],a=e[17],s=e[18],c=e[19],l=e[20];return{schema_version:2,type:"usage.recorded",run_id:t,event_id:e[2],sequence:e[3],occurred_at:e[4],phase:e[5],activity_kind:e[6],classification_source:e[7],tokens:{input:n[0],cached_input:n[1],output:n[2],reasoning:n[3],total:n[4],source:n[5]},cost:{usd:i[0],brl:i[1],fx_rate:i[2]??null},provider:e[10],model:e[11],source_segment_key:e[12],...l==null?{}:{model_call_id:l},supersedes_event_id:e[13],...e[14]===null?{}:{source_occurred_at:e[14]},...a==null?{}:{source_started_at:a},...s==null?{}:{source_finished_at:s},...c===!0?{retrospective_correction:!0}:{},...r===null||!Array.isArray(r)?{}:{context_stats:{initial_pack_tokens:r[0],tool_output_tokens:r[1],files_opened:r[2],snippets_opened:r[3]}},...o===null||!Array.isArray(o)?{}:{runtime:{reasoning_effort:o[0],service_tier:o[1]}}}}function JU(e,t,n){if(e.model!=="unknown"&&n.requested.model!==e.model)throw new Error(`Agent Run model is immutable: expected ${e.model}, received ${n.requested.model}`);if(e.reasoning_effort!==void 0&&e.reasoning_effort!==null&&n.requested.reasoning_effort!==e.reasoning_effort)throw new Error(`Agent Run reasoning effort is immutable: expected ${e.reasoning_effort}, received ${n.requested.reasoning_effort}`);let i=t.find(r=>r.type==="model.selection.recorded");if(i!==void 0){if(JSON.stringify(i.requested)!==JSON.stringify(n.requested))throw new Error(`Agent Run calls must inherit one model configuration: ${e.run_id}`);if(JSON.stringify(i.selection)!==JSON.stringify(n.selection))throw new Error(`Agent Run calls must inherit one selection decision: ${e.run_id}`)}}var Ss=te.z.string().datetime({offset:!0}),KU=te.z.preprocess(e=>e==="client"?"provider_reported":e,te.z.enum(["provider_reported","estimated","unavailable"])),Pz=te.z.object({id:te.z.string().regex(/^DEC-(?:HUMAN|AI)-/),title:te.z.string().min(1),origin:te.z.enum(["human","agent"]),category:te.z.enum(["architecture","contract","database","security","dependency","network","infrastructure","cost","implementation"]),status:te.z.enum(["active","superseded","rejected"]),task:te.z.string().startsWith("TASK-").nullable(),change:te.z.string().startsWith("CHG-").nullable(),context:te.z.string().min(1),decision:te.z.string().min(1),reason:te.z.string().min(1),alternatives:te.z.array(te.z.string()),consequences:te.z.array(te.z.string()),reversible:te.z.boolean(),rollback:te.z.string(),confidence:te.z.number().min(0).max(1).nullable(),created_at:Ss,confirmed_at:Ss.nullable()}).strict();var xz=te.z.object({id:te.z.string().startsWith("RUN-"),task:te.z.string().startsWith("TASK-"),status:te.z.enum(["running","completed","failed"]),client:te.z.string().min(1),agent:te.z.string().min(1),model:te.z.string().min(1),started_at:Ss,finished_at:Ss.nullable(),duration_ms:te.z.number().int().nonnegative().nullable(),provider:te.z.string().min(1).nullable().default(null),token_usage:te.z.object({input:te.z.number().int().nonnegative().nullable(),cached_input:te.z.number().int().nonnegative().nullable().default(null),output:te.z.number().int().nonnegative().nullable(),reasoning:te.z.number().int().nonnegative().nullable(),total:te.z.number().int().nonnegative().nullable().default(null),source:KU}),cost:te.z.object({estimated_usd:te.z.number().nonnegative().nullable(),estimated_brl:te.z.number().nonnegative().nullable(),fx_rate:te.z.number().positive().nullable(),pricing_model:te.z.string().nullable(),pricing_source:te.z.string().nullable(),input_usd:te.z.number().nonnegative().nullable().default(null),cached_input_usd:te.z.number().nonnegative().nullable().default(null),output_usd:te.z.number().nonnegative().nullable().default(null),reasoning_usd:te.z.number().nonnegative().nullable().default(null)}).default({estimated_usd:null,estimated_brl:null,fx_rate:null,pricing_model:null,pricing_source:null,input_usd:null,cached_input_usd:null,output_usd:null,reasoning_usd:null}),telemetry:te.z.object({cycle_count:te.z.number().int().nonnegative().nullable(),source:te.z.enum(["repository","local-codex","manual","unavailable"]),segment_key:te.z.string().nullable()}).default({cycle_count:null,source:"unavailable",segment_key:null}),commands:te.z.array(te.z.string()),gates:te.z.array(te.z.string()),decisions:te.z.array(te.z.string()),evidence:te.z.array(te.z.string())}).strict();var ph=".local/dashboard-sqlite/read-model.sqlite",XU=new Set([".json",".jsonl",".md",".yaml",".yml",".txt"]),mr="60",GU=["zaip_aios_activities","zaip_dim_llm_model","zaip_dim_provider","zaip_dim_zaip_agent","cost_invocation_dimension_facts"],YU=["zaip_activities_agent_run","zaip_activities_relationships","zaip_activities_task_day","zaip_activities_spec_day","zaip_activities_prd_day","zaip_activities_agent","zaip_activities_run_id","zaip_activities_run_hierarchy","zaip_activities_period","zaip_activities_period_invocation","zaip_activities_status","zaip_activities_payload","cost_dimension_facts_day_model","cost_dimension_facts_day_provider","cost_dimension_facts_invocation"],QU=["zaip_vw_read_model_metadata","zaip_vw_operations_overview","zaip_vw_cost_overview","zaip_vw_cost_models","zaip_vw_cost_providers","zaip_vw_operations_agent_invocations"],lu=2*36e5;function Vn(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0&&!["unavailable","unknown","mixed"].includes(t.toLowerCase())?t:null}function e0(){let e=new Intl.DateTimeFormat("en-CA",{timeZone:"America/Sao_Paulo",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date),t=Object.fromEntries(e.map(i=>[i.type,i.value])),n=`${t.year}-${t.month}-${t.day}`;return{from:`${t.year}-${t.month}-01`,to:n}}function t0(e){let t=["model","provider"],n=new Set(e.prepare("SELECT provider FROM zaip_dim_provider").all().map(u=>u.provider)),i=e.prepare(`SELECT activity_row_id, agent_invocation_id, task_id, duration_ms,
|
|
204
|
+
source_event_count, provider, model, total_tokens, cost_usd, cost_brl
|
|
205
|
+
FROM zaip_aios_activities WHERE payload_type IS NULL`).all(),r=e.prepare(`SELECT agent_invocation_id, provider, model, total_tokens, cost_usd, cost_brl
|
|
206
|
+
FROM invocation_usage_segments`).all(),o=new Map(i.filter(u=>typeof u.agent_invocation_id=="string").map(u=>[String(u.agent_invocation_id),u])),a=new Map(t.map(u=>[u,new Map])),s=(u,f)=>{let p=a.get(u),y=p.get(f);if(y!==void 0)return y;let v={key:f,label:f,invocation_count:0,task_count:0,total_duration:null,source_event_count:null,total_tokens:null,total_cost_usd:null,total_cost_brl:null};return p.set(f,v),v},c=(u,f,p)=>{typeof p=="number"&&(u[f]=(u[f]??0)+p)},l=new Map;for(let u of r){let f=String(u.agent_invocation_id??"");if(f.length===0)continue;let p=l.get(f);p===void 0?l.set(f,[u]):p.push(u)}for(let[u,f]of l){let p=o.get(u);if(p!==void 0)for(let y of t){let v=f.filter(O=>Vn(O[y])!==null&&Vn(O.provider)!==null&&n.has(Vn(O.provider))&&(typeof O.total_tokens=="number"||typeof O.cost_usd=="number"||typeof O.cost_brl=="number")),h=[...new Set(v.map(O=>Vn(O[y])))];if(h.length===0){let O=s(y,"unavailable");O.invocation_count+=1,typeof p.duration_ms=="number"&&(O.total_duration=(O.total_duration??0)+p.duration_ms),typeof p.source_event_count=="number"&&(O.source_event_count=(O.source_event_count??0)+p.source_event_count),c(O,"total_tokens",p.total_tokens),c(O,"total_cost_usd",p.cost_usd),c(O,"total_cost_brl",p.cost_brl)}for(let O of v){let C=s(y,Vn(O[y]));c(C,"total_tokens",O.total_tokens),c(C,"total_cost_usd",O.cost_usd),c(C,"total_cost_brl",O.cost_brl)}if(h.length===1){let O=s(y,h[0]);O.invocation_count+=1,typeof p.duration_ms=="number"&&(O.total_duration=(O.total_duration??0)+p.duration_ms),typeof p.source_event_count=="number"&&(O.source_event_count=(O.source_event_count??0)+p.source_event_count)}}}let _=new Map(t.map(u=>[u,new Map]));for(let[u,f]of l){let p=o.get(u)?.task_id;if(typeof p=="string")for(let y of t){let v=_.get(y),h=v.get(p)??new Set;for(let O of f){let C=Vn(O[y]),D=Vn(O.provider),b=typeof O.total_tokens=="number"||typeof O.cost_usd=="number"||typeof O.cost_brl=="number";C!==null&&D!==null&&n.has(D)&&b&&h.add(C)}v.set(p,h)}}for(let u of t)for(let f of _.get(u).values())for(let p of f)s(u,p).task_count+=1;for(let u of i){if(typeof u.agent_invocation_id=="string"||!(typeof u.total_tokens=="number"||typeof u.cost_usd=="number"||typeof u.cost_brl=="number"))continue;let p=Vn(u.provider);if(!(p===null||!n.has(p)))for(let y of t){let v=Vn(u[y])??"unavailable",h=s(y,v);h.invocation_count+=1,typeof u.task_id=="string"&&(h.task_count+=1),typeof u.duration_ms=="number"&&(h.total_duration=(h.total_duration??0)+u.duration_ms),typeof u.source_event_count=="number"&&(h.source_event_count=(h.source_event_count??0)+u.source_event_count),c(h,"total_tokens",u.total_tokens),c(h,"total_cost_usd",u.cost_usd),c(h,"total_cost_brl",u.cost_brl)}}return Object.fromEntries(t.map(u=>[u,[...a.get(u).values()].sort((f,p)=>(p.total_cost_brl??-1)-(f.total_cost_brl??-1)||f.key.localeCompare(p.key))]))}function n0(e){return e===".agents/config/project.yaml"||e===".agents/config/framework.lock.yaml"||e===".agents/config/agents/catalog.yaml"||e===".agents/config/clients.yaml"||e.startsWith(".agents/config/pricing/")||e.startsWith(".agents/records/runs/")&&e.endsWith(".jsonl")||/^\.agents\/records\/(tasks|specs|prds)\/.*\.md$/.test(e)||/^\.agents\/records\/executions\/.*\/execution\.md$/.test(e)?!0:/^\.agents\/records\/changes\/.*\/(change\.md|decisions\/.*\.md|artifacts\/(evidence|validations)\/.*\.md)$/.test(e)}function r0(e){let t=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(e)?.[1];if(t===void 0)return null;try{let n=Mi(t);return n!==null&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function _h(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Ze(e){return typeof e=="string"&&e.length>0?e:null}function au(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function i0(e){let t=[],n=[],i=[];for(let r of e){let o=r0(r.content);if(o===null)continue;let a=Ze(o.id),s=Ze(o.created_at);if(!(a===null||s===null||Number.isNaN(Date.parse(s)))){if(/^\.agents\/records\/executions\/.*\/execution\.md$/.test(r.path)){let c=_h(o.origin),l=Ze(c?.type),_=l==="interaction"?Ze(c?.conversation_id):l==="task"?Ze(c?.task_id):l==="spec"?Ze(c?.spec_id):l==="prd"?Ze(c?.prd_id):null;t.push({id:a,status:Ze(o.status),kind:Ze(o.kind),originType:l,originId:_,createdAt:s,finishedAt:Ze(o.finished_at),sourcePath:r.path});continue}if(/^\.agents\/records\/changes\/.*\/change\.md$/.test(r.path)){let c=_h(o.source),l=Ze(c?.type),_=l==="task"?Ze(c?.task_id):l==="spec"?Ze(c?.spec_id):l==="prd"?Ze(c?.prd_id):null;if(l===null||_===null)continue;n.push({id:a,title:Ze(o.title)??a,status:Ze(o.status)??"unclassified",risk:Ze(o.risk)??"unclassified",sourceType:l,sourceId:_,sourceSpecId:Ze(c?.spec_id),sourcePrdId:Ze(c?.prd_id),requirementIds:au(o.requirement_ids),acceptanceIds:au(o.acceptance_ids),taskIds:au(o.task_ids),result:Ze(o.result),createdAt:s,sourcePath:r.path});continue}if(/^\.agents\/records\/(changes|executions)\/.*\/decisions\/.*\.md$/.test(r.path)){let c=o.origin,l=o.scope_type,_=Ze(o.scope_id);if(c!=="human"&&c!=="agent"||l!=="change"&&l!=="execution"||_===null)continue;i.push({id:a,title:Ze(o.title)??a,origin:c,scopeType:l,scopeId:_,createdAt:s,sourcePath:r.path})}}}return{executions:t,changes:n,decisions:i}}function o0(e){let t=new Map;for(let n of e){let i=/^\.agents\/records\/(tasks|specs|prds|changes|executions|conversations)\//.exec(n.path);if(i===null)continue;let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(n.content)?.[1];if(r===void 0)continue;let o=c=>{let l=new RegExp(`^${c}:\\s*(.+?)\\s*$`,"m").exec(r)?.[1]?.trim();return l===void 0||l==="null"?null:l.replace(/^['"]|['"]$/g,"")},a=o("id");if(a===null)continue;let s=i[1]?.slice(0,-1);s!==void 0&&t.set(`${s}:${a}`,{kind:s,id:a,title:o("title"),status:o("status"),stage:o("stage"),risk:o("risk"),occurredAt:o("created_at")??o("started_at")??o("recorded_at")})}return t}function a0(e,t){let n=new Map;for(let i of(e??"").split(/^ {2}- id: /m).slice(1)){let r=i.slice(0,i.indexOf(`
|
|
207
|
+
`)).trim(),o=/\bcodex_name:\s*([^\s#]+)/.exec(i)?.[1]??null;if(o===null)continue;let a=/persona:\s*\{\s*nome:\s*([^,}\s]+),\s*cargo:\s*([^,}\s]+)\s*\}/.exec(i),s=/\brole:\s*([^\s#]+)/.exec(i)?.[1]??null,c={catalogId:r,persona:a?.[1]??null,job:a?.[2]??null,role:s},l=new Set([o,r]);for(let _ of i.matchAll(/^ {8}- kind:\s*(?:id|codex_name|codex_task_name)\s*\r?\n {10}value:\s*([^\s#]+)/gm)){let u=_[1];u!==void 0&&l.add(u)}for(let _ of[...l])_.startsWith("agent-")&&l.add(`zaip-${_}`);for(let _ of l)n.set(_,c)}return/^ {2}- id:\s*codex\s*$/m.test(t??"")&&n.set("codex",{catalogId:"client:codex",persona:"codex",job:"client_host",role:"host"}),n}function s0(e){return e.prd_id!==null&&e.execution_id===null||e.spec_id!==null&&e.execution_id===null||e.phase==="planning"||e.purpose==="planning"?"planning":e.execution_id!==null||e.task_id!==null||e.phase==="execution"||e.purpose==="implementation"?"development":"conversation"}function zr(e,t){let n=e.map(i=>i.tokens[t]).filter(i=>typeof i=="number");return n.length===0?null:n.reduce((i,r)=>i+r,0)}function ir(e){let t=[...new Set(e.filter(n=>typeof n=="string"&&n.length>0&&n!=="unavailable"))];return t.length===0?null:t.length===1?t[0]:"mixed"}function ks(e,t,n){return e==="openai"||e==="anthropic"?e:e==="unavailable"||t==="unavailable"||t===null?null:gs(t,n,"")}function c0(e){return typeof e.duration_ms=="number"&&(e.duration_provenance==="observed"||e.duration_provenance==="reconciled"||e.duration_provenance==="legacy_inferred")}function l0(e){let t=e.flatMap(r=>{let o=r.source_started_at,a=r.source_finished_at,s=typeof o=="string"?Date.parse(o):Number.NaN,c=typeof a=="string"?Date.parse(a):Number.NaN;return typeof o=="string"&&typeof a=="string"&&Number.isFinite(s)&&Number.isFinite(c)&&c>s&&c-s<=lu?[{start:o,end:a,startMs:s,endMs:c}]:[]});if(t.length===0)return null;let n=t.reduce((r,o)=>o.startMs<r.startMs?o:r),i=t.reduce((r,o)=>o.endMs>r.endMs?o:r);return i.endMs-n.startMs<=lu?{start:n.start,end:i.end,duration:i.endMs-n.startMs}:null}function u0(e,t){let n=l0(e);if(n!==null)return{source:n.duration,effective:n.duration,provenance:"reconciled",sourceStartedAt:n.start,sourceFinishedAt:n.end};if(typeof t.finished?.duration_ms=="number"&&t.finished.duration_provenance!=="estimated"&&t.finished.duration_provenance!=="unavailable")return{source:t.finished.duration_ms,effective:t.finished.duration_ms,provenance:t.finished.duration_provenance??"observed",sourceStartedAt:null,sourceFinishedAt:null};let i=e.filter(c0);if(i.length>0){let a=i.reduce((c,l)=>c+(l.duration_ms??0),0),s=ir(i.map(c=>c.duration_provenance))??"observed";return{source:a,effective:a,provenance:s,sourceStartedAt:null,sourceFinishedAt:null}}let r=Date.parse(t.run.occurred_at),o=typeof t.finished?.occurred_at=="string"?Date.parse(t.finished.occurred_at):Number.NaN;return Number.isFinite(r)&&Number.isFinite(o)&&o>r&&o-r<=lu?{source:null,effective:o-r,provenance:"reconciled",sourceStartedAt:null,sourceFinishedAt:null}:{source:null,effective:null,provenance:null,sourceStartedAt:null,sourceFinishedAt:null}}function d0(e){return e.flatMap(t=>{try{return[xg.parse(JSON.parse(t.content))]}catch{return[]}}).sort((t,n)=>n.as_of.localeCompare(t.as_of))[0]??null}function _0(e,t,n,i){let r=0,o=0,a=!1,s=!1,c=!1,l=[],_=[];for(let f of e){if(typeof f.cost.usd=="number"&&(r+=f.cost.usd,a=!0),typeof f.cost.brl=="number"&&(o+=f.cost.brl,s=!0),typeof f.cost.usd=="number"&&typeof f.cost.brl=="number"||f.tokens.total===null)continue;if(f.tokens.total===0){a=!0,s=!0;continue}let p=f.model??t.run.model;if(p===null||p==="unavailable")continue;let y=hs({provider:ks(f.provider,p,t.run.client),model:p,usage:f.tokens,catalog:n,fxRate:i,serviceTier:f.runtime?.service_tier??null});typeof f.cost.usd!="number"&&y.estimated_usd!==null&&(r+=y.estimated_usd,a=!0,c=!0),typeof f.cost.brl!="number"&&y.estimated_brl!==null&&(o+=y.estimated_brl,s=!0,c=!0),y.pricing_model!==null&&l.push(y.pricing_model),y.pricing_source!==null&&_.push(y.pricing_source)}let u=zr(e,"total");return{usd:a?Math.round(r*1e6)/1e6:null,brl:s?Math.round(o*1e6)/1e6:null,method:u===0?"zero_no_llm_usage":c?"token_pricing_estimate":a||s?"canonical_recorded":null,pricingModel:ir(l),pricingSource:ir(_),fxRate:s?i?.rate??null:null}}function f0(e,t){if(t===null)return null;let n=t.toLowerCase(),i=r=>{let o=r.toLowerCase();if(n===o)return!0;let a=n.slice(o.length);return a.startsWith("@")||a.startsWith(":")||a.startsWith("/")||/^-\d{4}-\d{2}-\d{2}(?:$|[.:@/])/.test(a)};return e.models.find(r=>i(r.id)||r.aliases.some(o=>i(o)))??null}function p0(e,t,n,i){let r=e.model??t.run.model,o=ks(e.provider,r,t.run.client),a=e.runtime?.service_tier??null,s=f0(n,r),c=r===null?null:hs({provider:o,model:r,usage:e.tokens,catalog:n,fxRate:i,serviceTier:a}),l=r===null?null:hs({provider:o,model:r,usage:e.tokens,catalog:n,fxRate:i,serviceTier:"default"}),_=s?.long_context_threshold_tokens!==null&&s?.long_context_threshold_tokens!==void 0&&(e.tokens.input??0)>s.long_context_threshold_tokens,u=a==="priority"||a==="fast",f=u&&!_,p=s?f?s.priority_input_per_million_usd??null:s.input_per_million_usd:null,y=s?f?s.priority_cached_input_per_million_usd??null:s.cached_input_per_million_usd:null,v=s?f?s.priority_output_per_million_usd??null:s.output_per_million_usd:null,h=s?f?s.priority_reasoning_per_million_usd??s.priority_output_per_million_usd??null:s.reasoning_per_million_usd??s.output_per_million_usd:null,O=c?.estimated_usd!==null&&c!==null?c:l,C=O?.estimated_usd??null,D=l?.estimated_usd??null,b=e.cost.usd,E=b??C,A=e.cost.brl??c?.estimated_brl??(E!==null&&i!==null?Math.round(E*i.rate*1e6)/1e6:null);return{provider:o,model:r,serviceTier:a,uncachedInputTokens:e.tokens.input===null?null:Math.max(e.tokens.input-(e.tokens.cached_input??0),0),visibleOutputTokens:e.tokens.output===null?null:Math.max(e.tokens.output-(e.tokens.reasoning??0),0),inputRate:p,cachedRate:y,outputRate:v,reasoningRate:h,contextInputMultiplier:s?_?s.long_context_input_multiplier:1:null,contextOutputMultiplier:s?_?s.long_context_output_multiplier:1:null,speedCostMultiplier:C!==null&&D!==null&&D>0?Math.round(C/D*1e3)/1e3:null,pricingScenario:u&&_?"standard_long_context_fallback":u?"priority":"standard",standardUsd:D,speedUpliftUsd:C!==null&&D!==null?Math.round((C-D)*1e6)/1e6:null,inputUsd:O?.input_usd??null,cachedInputUsd:O?.cached_input_usd??null,outputUsd:O?.output_usd??null,reasoningUsd:O?.reasoning_usd??null,calculatedUsd:C,recordedUsd:b,effectiveUsd:E,effectiveBrl:A,varianceUsd:b!==null&&C!==null?Math.round((b-C)*1e6)/1e6:null,pricingModel:O?.pricing_model??null,pricingSource:O?.pricing_source??null,fxRate:e.cost.fx_rate??i?.rate??null}}function At(e){let t=Object.fromEntries(new Intl.DateTimeFormat("en",{timeZone:"America/Sao_Paulo",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(e)).filter(n=>n.type!=="literal").map(n=>[n.type,n.value]));return`${t.year}-${t.month}-${t.day}`}function mh(e){let t=new Set;for(let r of e){t.add(r.startMs),t.add(r.endMs);for(let o=r.startMs;o<r.endMs;){let a=Date.parse(`${At(new Date(o).toISOString())}T03:00:00.000Z`)+864e5;if(a>=r.endMs)break;t.add(a),o=a}}let n=[...t].sort((r,o)=>r-o),i=new Map;for(let r=0;r<n.length-1;r+=1){let o=n[r],a=n[r+1],s=e.filter(_=>_.startMs<a&&_.endMs>o);if(s.length===0||a<=o)continue;let c=(a-o)/s.length,l=At(new Date(o).toISOString());for(let _ of s){let u=`${_.activityRowId}:${l}`,f=i.get(u);i.set(u,{activityRowId:_.activityRowId,day:l,value:(f?.value??0)+c})}}return[...i.values()]}function mt(e){return e==null?null:/^\d{4}-\d{2}-\d{2}$/.test(e)?e:At(e)}function m0(e,t){let n=e.includes("/artifacts/evidence/")?"evidence":e.includes("/artifacts/validations/")?"validation":null;if(n===null)return null;let i=/^---\r?\n([\s\S]*?)\r?\n---/.exec(t)?.[1]??"",r=a=>{let s=new RegExp(`^${a}:\\s*['"]?(.+?)['"]?\\s*$`,"m").exec(i)?.[1]?.trim();return s===void 0||s==="null"?null:s},o=r("observed_at")??r("executed_at")??r("created_at")??r("recorded_at");return o===null||Number.isNaN(Date.parse(o))?null:{kind:n,id:r("id")??e.slice(e.lastIndexOf("/")+1,-3),occurredAt:o,occurredDaySp:At(o)}}function Os(e){return(0,je.resolve)(process.env.ZAIP_SQLITE_DB_PATH??(0,je.resolve)(e,ph))}function Es(e){let t=new or.DatabaseSync(e,{readOnly:!0});try{let n=t.prepare("PRAGMA integrity_check").get();if(n.integrity_check!=="ok")throw new Error(`SQLite integrity check failed for ${e}: ${n.integrity_check??"unknown"}`);let i=t.prepare("SELECT name, type FROM sqlite_master WHERE type IN ('table', 'view', 'index')").all(),r=i.filter(u=>u.type==="table").map(u=>u.name).sort(),o=[...GU].sort();if(r.length!==o.length||r.some((u,f)=>u!==o[f]))throw new Error(`SQLite schema ${mr} requires exactly five persisted tables; found ${r.join(", ")||"none"}`);let a=new Set(i.map(u=>u.name)),s=QU.filter(u=>!a.has(u));if(s.length>0)throw new Error(`SQLite schema is missing required views: ${s.join(", ")}`);let c=i.filter(u=>u.type==="view").map(u=>u.name);if(c.some(u=>!u.startsWith("zaip_vw_")))throw new Error("SQLite persisted views must use the zaip_vw_ namespace");let l=YU.filter(u=>!a.has(u));if(l.length>0)throw new Error(`SQLite schema is missing required indexes: ${l.join(", ")}`);let _=t.prepare("SELECT value FROM zaip_vw_read_model_metadata WHERE key = ?").get("schema_version")?.value;if(_!==mr)throw new Error(`SQLite schema version must be ${mr}; found ${_??"missing"}`);return{schemaVersion:_,tableCount:r.length,viewCount:c.length,indexCount:i.filter(u=>u.type==="index"&&!u.name.startsWith("sqlite_")).length}}finally{t.close()}}async function g0(e){let t=Os(e),n=performance.now(),i=await gh(e),r=(b,E,A)=>{process.env.ZAIP_DASHBOARD_LAUNCH_PROGRESS==="1"&&process.stderr.write(`${JSON.stringify({event:"dashboard_sqlite_rebuild_progress",phase:b,percent:E,detail:A})}
|
|
208
|
+
`)},{fingerprint:o}=i,a=Math.round(performance.now()-n),s=su(t,o);if(s!==null)return Es(t),{files:s,path:t,cache:"generation",fingerprint_ms:a,materialize_ms:0};let c=(0,je.join)(process.env.ZAIP_SQLITE_CACHE_DIR??(0,je.join)((0,je.dirname)(t),"cache"),`v${mr}-${(0,Nt.createHash)("sha256").update(o).digest("hex")}.sqlite`),l=su(c,o);if(l!==null){let b=performance.now();return await cu(c,t),Es(t),{files:l,path:t,cache:"seed",fingerprint_ms:a,materialize_ms:Math.round(performance.now()-b)}}if(process.env.ZAIP_SQLITE_PREFER_LAST_VALID_SEED==="1"){let b=await v0((0,je.dirname)(c));if(b!==null){let E=performance.now();return await cu(b.path,t),{files:b.files,path:t,cache:"stale_seed",fingerprint_ms:a,materialize_ms:Math.round(performance.now()-E)}}}r("source_inventory",52,`Encontradas ${i.candidates.length} fontes can\xF4nicas.`),await(0,Le.mkdir)((0,je.dirname)(c),{recursive:!0});let _=`${c}.${process.pid}.${(0,Nt.randomUUID)()}.tmp`,u=new or.DatabaseSync(_),f=0;try{u.exec("PRAGMA journal_mode=DELETE; BEGIN IMMEDIATE;");try{u.exec(`
|
|
209
|
+
CREATE TEMP TABLE files (path TEXT PRIMARY KEY, content TEXT NOT NULL, mtime_ms INTEGER NOT NULL, size_bytes INTEGER NOT NULL, content_sha256 TEXT NOT NULL, artifact_kind TEXT, artifact_id TEXT, artifact_occurred_at TEXT, artifact_occurred_day_sp TEXT);
|
|
210
|
+
CREATE TEMP TABLE read_model_source_state (source_path TEXT PRIMARY KEY, source_hash TEXT NOT NULL, mtime_ms INTEGER NOT NULL, size_bytes INTEGER NOT NULL, source_kind TEXT NOT NULL, last_processed_at TEXT NOT NULL);
|
|
211
|
+
CREATE TEMP TABLE read_model_metadata (key TEXT PRIMARY KEY, value TEXT NOT NULL);
|
|
212
|
+
CREATE TEMP TABLE canonical_work_items (entity_kind TEXT NOT NULL, id TEXT NOT NULL, title TEXT, status TEXT, stage TEXT, risk TEXT, occurred_at TEXT NOT NULL, occurred_day_sp TEXT NOT NULL, PRIMARY KEY(entity_kind, id));
|
|
213
|
+
CREATE TEMP TABLE canonical_executions (id TEXT PRIMARY KEY, status TEXT, kind TEXT, origin_type TEXT, origin_id TEXT, created_at TEXT NOT NULL, occurred_day_sp TEXT NOT NULL, finished_at TEXT, source_path TEXT NOT NULL);
|
|
214
|
+
CREATE TEMP TABLE canonical_changes (id TEXT PRIMARY KEY, title TEXT NOT NULL, status TEXT NOT NULL, risk TEXT NOT NULL, source_type TEXT NOT NULL, source_id TEXT NOT NULL, source_spec_id TEXT, source_prd_id TEXT, requirement_ids_json TEXT NOT NULL, acceptance_ids_json TEXT NOT NULL, task_ids_json TEXT NOT NULL, result TEXT, created_at TEXT NOT NULL, occurred_day_sp TEXT NOT NULL, source_path TEXT NOT NULL);
|
|
215
|
+
CREATE TEMP TABLE canonical_decisions (id TEXT PRIMARY KEY, title TEXT NOT NULL, origin TEXT NOT NULL, scope_type TEXT NOT NULL, scope_id TEXT NOT NULL, created_at TEXT NOT NULL, occurred_day_sp TEXT NOT NULL, source_path TEXT NOT NULL);
|
|
216
|
+
CREATE TEMP TABLE canonical_run_index (run_id TEXT PRIMARY KEY, occurred_at TEXT NOT NULL, occurred_day_sp TEXT NOT NULL, task_id TEXT, phase TEXT, run_role TEXT NOT NULL, duration_ms REAL, source_event_count INTEGER NOT NULL, zaip_agent TEXT, provider TEXT, model TEXT, status TEXT);
|
|
217
|
+
CREATE TEMP TABLE invocation_usage_segments (
|
|
218
|
+
agent_invocation_id TEXT NOT NULL, provider TEXT, model TEXT, service_tier TEXT, reasoning_effort TEXT,
|
|
219
|
+
input_tokens REAL, cached_input_tokens REAL, uncached_input_tokens REAL,
|
|
220
|
+
output_tokens REAL, reasoning_tokens REAL, visible_output_tokens REAL, total_tokens REAL,
|
|
221
|
+
input_rate_usd_per_million REAL, cached_input_rate_usd_per_million REAL,
|
|
222
|
+
output_rate_usd_per_million REAL, reasoning_rate_usd_per_million REAL,
|
|
223
|
+
context_input_multiplier REAL, context_output_multiplier REAL, speed_cost_multiplier REAL, pricing_scenario TEXT,
|
|
224
|
+
standard_cost_usd REAL, speed_uplift_usd REAL,
|
|
225
|
+
input_cost_usd REAL, cached_input_cost_usd REAL, output_cost_usd REAL, reasoning_cost_usd REAL,
|
|
226
|
+
calculated_cost_usd REAL, recorded_cost_usd REAL, cost_variance_usd REAL,
|
|
227
|
+
cost_usd REAL, cost_brl REAL, cost_method TEXT, pricing_model TEXT, pricing_source TEXT, fx_rate REAL
|
|
228
|
+
);
|
|
229
|
+
CREATE TABLE zaip_aios_activities (
|
|
230
|
+
activity_row_id TEXT PRIMARY KEY, activity_source_kind TEXT NOT NULL, activity_key TEXT NOT NULL,
|
|
231
|
+
source_path TEXT NOT NULL, source_hash TEXT NOT NULL, source_occurred_at TEXT, recorded_at TEXT NOT NULL, version_activity_id TEXT,
|
|
232
|
+
source_last_event_id TEXT, source_last_sequence INTEGER,
|
|
233
|
+
work_item_kind TEXT, title TEXT, work_item_status TEXT, work_stage TEXT, risk TEXT,
|
|
234
|
+
run_role TEXT NOT NULL, root_run_id TEXT NOT NULL, parent_run_id TEXT,
|
|
235
|
+
agent_run_id TEXT, root_agent_run_id TEXT, parent_agent_run_id TEXT, agent_run_role TEXT, delegation_depth INTEGER,
|
|
236
|
+
agent_invocation_id TEXT, root_agent_invocation_id TEXT, parent_agent_invocation_id TEXT, invocation_kind TEXT,
|
|
237
|
+
execution_id TEXT, task_id TEXT, spec_id TEXT, prd_id TEXT, change_id TEXT, conversation_id TEXT, run_id TEXT,
|
|
238
|
+
occurred_at TEXT, occurred_day_sp TEXT, execution_kind TEXT, entrypoint TEXT, work_type TEXT, phase TEXT, purpose TEXT, status TEXT, activity_kind TEXT,
|
|
239
|
+
zaip_agent TEXT, zaip_agent_persona TEXT, zaip_agent_job TEXT, zaip_agent_role TEXT, agent_catalog_id TEXT, agent_catalog_hash TEXT,
|
|
240
|
+
client TEXT, provider TEXT, model TEXT, service_tier TEXT, reasoning_effort TEXT,
|
|
241
|
+
source_duration_ms REAL, source_started_at TEXT, source_finished_at TEXT, duration_ms REAL, duration_provenance TEXT, input_tokens REAL, cached_input_tokens REAL, output_tokens REAL, reasoning_tokens REAL, total_tokens REAL, token_source TEXT, usage_event_count INTEGER, llm_call_count INTEGER,
|
|
242
|
+
cost_usd REAL, cost_brl REAL, cost_method TEXT, pricing_model TEXT, pricing_source TEXT, fx_rate REAL, source_event_count INTEGER,
|
|
243
|
+
root_run_duration REAL, sub_run_duration REAL,
|
|
244
|
+
payload_type TEXT, payload_json TEXT
|
|
245
|
+
);`),u.exec(`
|
|
246
|
+
CREATE TABLE zaip_dim_zaip_agent (
|
|
247
|
+
zaip_agent TEXT PRIMARY KEY, catalog_id TEXT, persona TEXT, job TEXT, role TEXT, catalog_hash TEXT
|
|
248
|
+
);
|
|
249
|
+
CREATE TABLE zaip_dim_llm_model (
|
|
250
|
+
model TEXT PRIMARY KEY
|
|
251
|
+
);
|
|
252
|
+
CREATE TABLE zaip_dim_provider (
|
|
253
|
+
provider TEXT PRIMARY KEY
|
|
254
|
+
);
|
|
255
|
+
`),u.exec(`CREATE TEMP TABLE attributed_token_active_facts (
|
|
256
|
+
activity_row_id TEXT NOT NULL,
|
|
257
|
+
occurred_day_sp TEXT NOT NULL,
|
|
258
|
+
attributed_token_active_ms REAL NOT NULL,
|
|
259
|
+
PRIMARY KEY(activity_row_id, occurred_day_sp)
|
|
260
|
+
);`);let b=u.prepare("INSERT INTO files(path, content, mtime_ms, size_bytes, content_sha256, artifact_kind, artifact_id, artifact_occurred_at, artifact_occurred_day_sp) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"),E=u.prepare("INSERT INTO read_model_source_state(source_path, source_hash, mtime_ms, size_bytes, source_kind, last_processed_at) VALUES (?, ?, ?, ?, ?, ?)"),A=0,R=0,I=32;for(let P=0;P<i.candidates.length;P+=I){let ue=i.candidates.slice(P,P+I),J=await Promise.all(ue.map(ut=>(0,Le.readFile)(ut.path,"utf8")));for(let ut=0;ut<ue.length;ut+=1){let gr=ue[ut],Mn=J[ut];if(gr===void 0||Mn===void 0)continue;let{source:Un,mtimeMs:hr,size:Qe}=gr,Pn=(0,Nt.createHash)("sha256").update(Mn).digest("hex"),ji=Un.includes("/runs/")?"run":Un.includes("/artifacts/evidence/")?"evidence":Un.includes("/artifacts/validations/")?"validation":Un.startsWith(".agents/config/")?"config":"entity",Wn=m0(Un,Mn);b.run(Un,Mn,hr,Qe,Pn,Wn?.kind??null,Wn?.id??null,Wn?.occurredAt??null,Wn?.occurredDaySp??null),E.run(Un,Pn,hr,Qe,ji,new Date().toISOString()),A+=1}let Ve=52+Math.round((P+ue.length)/i.candidates.length*20);r("source_import",Ve,`Lidas ${Math.min(P+ue.length,i.candidates.length)} de ${i.candidates.length} fontes.`)}r("projection_build",74,"Organizando fatos e proje\xE7\xF5es do banco local.");let V=o0(u.prepare("SELECT path, content FROM files WHERE path LIKE '.agents/records/%'").all()),le=u.prepare("INSERT INTO canonical_work_items(entity_kind, id, title, status, stage, risk, occurred_at, occurred_day_sp) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");for(let P of V.values())P.kind!=="task"&&P.kind!=="spec"&&P.kind!=="prd"||P.occurredAt===null||Number.isNaN(Date.parse(P.occurredAt))||le.run(P.kind,P.id,P.title,P.status,P.stage,P.risk,P.occurredAt,At(P.occurredAt));let re=i0(u.prepare("SELECT path, content FROM files WHERE path LIKE '.agents/records/%'").all()),K=u.prepare("INSERT INTO canonical_executions(id, status, kind, origin_type, origin_id, created_at, occurred_day_sp, finished_at, source_path) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");for(let P of re.executions)K.run(P.id,P.status,P.kind,P.originType,P.originId,P.createdAt,At(P.createdAt),P.finishedAt,P.sourcePath);let pe=u.prepare("INSERT INTO canonical_changes(id, title, status, risk, source_type, source_id, source_spec_id, source_prd_id, requirement_ids_json, acceptance_ids_json, task_ids_json, result, created_at, occurred_day_sp, source_path) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");for(let P of re.changes)pe.run(P.id,P.title,P.status,P.risk,P.sourceType,P.sourceId,P.sourceSpecId,P.sourcePrdId,JSON.stringify(P.requirementIds),JSON.stringify(P.acceptanceIds),JSON.stringify(P.taskIds),P.result,P.createdAt,At(P.createdAt),P.sourcePath);let Me=u.prepare("INSERT INTO canonical_decisions(id, title, origin, scope_type, scope_id, created_at, occurred_day_sp, source_path) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");for(let P of re.decisions)Me.run(P.id,P.title,P.origin,P.scopeType,P.scopeId,P.createdAt,At(P.createdAt),P.sourcePath);let ye=u.prepare("SELECT content FROM files WHERE path = ?").get(".agents/config/agents/catalog.yaml")?.content,De=u.prepare("SELECT content FROM files WHERE path = ?").get(".agents/config/clients.yaml")?.content,ze=a0(ye,De),X=ye===void 0?null:(0,Nt.createHash)("sha256").update(ye).digest("hex"),we=u.prepare("SELECT content FROM files WHERE path = ?").get(".agents/config/pricing/models.json")?.content,F=Pg.parse(JSON.parse(we??'{"schema_version":1,"updated_at":"1970-01-01T00:00:00.000Z","source":"missing","disclaimer":"missing","models":[]}')),fe=d0(u.prepare("SELECT path, content FROM files WHERE path LIKE '.agents/config/pricing/fx/%.json'").all()),Xe=u.prepare("SELECT path, content, content_sha256 FROM files WHERE path LIKE '.agents/records/runs/%.jsonl' ORDER BY path").all(),Ge=new Map(Xe.map(P=>{let ue=ou(iu(P.content));return[ue.run.run_id,{row:P,fold:ue}]})),me=P=>{let ue=P,J=new Set;for(;ue.run.parent_run_id!==null&&!J.has(ue.run.run_id);){J.add(ue.run.run_id);let Ve=Ge.get(ue.run.parent_run_id)?.fold;if(Ve===void 0)break;ue=Ve}return ue.run.run_id},L=["activity_row_id","activity_source_kind","activity_key","source_path","source_hash","source_occurred_at","recorded_at","version_activity_id","source_last_event_id","source_last_sequence","work_item_kind","title","work_item_status","work_stage","risk","run_role","root_run_id","parent_run_id","agent_run_id","root_agent_run_id","parent_agent_run_id","agent_run_role","delegation_depth","agent_invocation_id","root_agent_invocation_id","parent_agent_invocation_id","invocation_kind","execution_id","task_id","spec_id","prd_id","change_id","conversation_id","run_id","occurred_at","occurred_day_sp","execution_kind","entrypoint","work_type","phase","purpose","status","activity_kind","zaip_agent","zaip_agent_persona","zaip_agent_job","zaip_agent_role","agent_catalog_id","agent_catalog_hash","client","provider","model","service_tier","reasoning_effort","source_duration_ms","source_started_at","source_finished_at","duration_ms","duration_provenance","input_tokens","cached_input_tokens","output_tokens","reasoning_tokens","total_tokens","token_source","usage_event_count","llm_call_count","cost_usd","cost_brl","cost_method","pricing_model","pricing_source","fx_rate","source_event_count","root_run_duration","sub_run_duration","payload_type","payload_json"],ne=u.prepare(`INSERT INTO zaip_aios_activities(${L.join(",")}) VALUES (${L.map(()=>"?").join(",")})`),ae=u.prepare("INSERT INTO attributed_token_active_facts(activity_row_id, occurred_day_sp, attributed_token_active_ms) VALUES (?, ?, ?)"),ve=u.prepare("INSERT INTO invocation_usage_segments VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"),Ne=u.prepare("INSERT INTO canonical_run_index(run_id, occurred_at, occurred_day_sp, task_id, phase, run_role, duration_ms, source_event_count, zaip_agent, provider, model, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"),Ye=0,ot=0,Ct=[];for(let{row:P,fold:ue}of Ge.values()){let J=ue.run,Ve=ue.effective_usage_records,ut=J.agent_invocation_id??null,gr=ut!==null,Mn=J.parent_run_id===null?"root":"subrun",Un=gr?J.parent_agent_invocation_id===null?"root":"subagent":null,hr=zr(Ve,"total"),Qe=u0(Ve,ue),Pn=_0(Ve,ue,F,fe),ji=Ve.filter(ge=>typeof ge.tokens.total=="number"||typeof ge.cost.usd=="number"||typeof ge.cost.brl=="number"),Wn=ir(ji.map(ge=>ge.model??J.model))??(J.model==="unavailable"?null:J.model),fu=ir(ji.map(ge=>ks(ge.provider,ge.model??J.model,J.client)))??ks(J.provider,Wn,J.client),Ts=J.agent_name??J.agent;if(Ne.run(J.run_id,J.occurred_at,At(J.occurred_at),J.task_id,J.phase,Mn,Qe.effective,ue.records.length,Ts,fu,Wn,ue.status),hr===null){ot+=1;continue}let Di=ze.get(Ts)??ze.get(J.agent),Fr=J.task_id===null?J.spec_id===null?J.prd_id===null?null:V.get(`prd:${J.prd_id}`):V.get(`spec:${J.spec_id}`):V.get(`task:${J.task_id}`),pu=new Set([...ue.model_call_records.map(ge=>ge.call_id),...Ve.map(ge=>ge.model_call_id).filter(ge=>typeof ge=="string")]),$s=ue.records.at(-1),Is=`ACTV-${(0,Nt.createHash)("sha256").update(`run:${J.run_id}`).digest("hex").slice(0,24)}`,$h={activity_row_id:Is,activity_source_kind:gr?"agent_run":"unassisted_turn",activity_key:`run:${J.run_id}`,source_path:P.path,source_hash:P.content_sha256,source_occurred_at:Ve.map(ge=>ge.source_occurred_at).filter(ge=>typeof ge=="string").sort()[0]??J.occurred_at,recorded_at:$s.occurred_at,version_activity_id:null,source_last_event_id:$s.event_id,source_last_sequence:$s.sequence,work_item_kind:Fr?.kind??null,title:Fr?.title??null,work_item_status:Fr?.status??null,work_stage:Fr?.stage??null,risk:Fr?.risk??null,run_role:Mn,root_run_id:me(ue),parent_run_id:J.parent_run_id,agent_run_id:ut,root_agent_run_id:J.root_agent_invocation_id??ut,parent_agent_run_id:J.parent_agent_invocation_id??null,agent_run_role:Un,delegation_depth:J.delegation_depth??null,agent_invocation_id:ut,root_agent_invocation_id:J.root_agent_invocation_id??ut,parent_agent_invocation_id:J.parent_agent_invocation_id??null,invocation_kind:J.invocation_kind??null,execution_id:J.execution_id,task_id:J.task_id,spec_id:J.spec_id,prd_id:J.prd_id,change_id:J.change_id,conversation_id:J.conversation_id,run_id:J.run_id,occurred_at:J.occurred_at,occurred_day_sp:At(J.occurred_at),execution_kind:J.execution_kind??null,entrypoint:J.entrypoint,work_type:J.work_type,phase:J.phase,purpose:J.run_purpose??null,status:ue.status,activity_kind:s0({execution_id:J.execution_id,task_id:J.task_id,spec_id:J.spec_id,prd_id:J.prd_id,phase:J.phase,purpose:J.run_purpose??null}),zaip_agent:Ts,zaip_agent_persona:Di?.persona??null,zaip_agent_job:Di?.job??null,zaip_agent_role:Di?.role??null,agent_catalog_id:Di?.catalogId??null,agent_catalog_hash:X,client:J.client,provider:fu,model:Wn,service_tier:ir(Ve.map(ge=>ge.runtime?.service_tier??null)),reasoning_effort:ir(Ve.map(ge=>ge.runtime?.reasoning_effort??null))??J.reasoning_effort??null,source_duration_ms:Qe.source,source_started_at:Qe.sourceStartedAt,source_finished_at:Qe.sourceFinishedAt,duration_ms:Qe.effective,duration_provenance:Qe.provenance,input_tokens:zr(Ve,"input"),cached_input_tokens:zr(Ve,"cached_input"),output_tokens:zr(Ve,"output"),reasoning_tokens:zr(Ve,"reasoning"),total_tokens:hr,token_source:ir(Ve.map(ge=>ge.tokens.source)),usage_event_count:Ve.length,llm_call_count:pu.size>0?pu.size:null,cost_usd:Pn.usd,cost_brl:Pn.brl,cost_method:Pn.method,pricing_model:Pn.pricingModel,pricing_source:Pn.pricingSource,fx_rate:Pn.fxRate,source_event_count:ue.records.length,root_run_duration:Mn==="root"?Qe.effective:null,sub_run_duration:Mn==="subrun"?Qe.effective:null,payload_type:null,payload_json:null};if(ne.run(...L.map(ge=>$h[ge]??null)),hr>0&&Qe.effective!==null&&Qe.effective>=0){let ge=Date.parse(Qe.sourceStartedAt??J.occurred_at),xn=Date.parse(Qe.sourceFinishedAt??"")||ge+Qe.effective;Number.isFinite(ge)&&Number.isFinite(xn)&&xn>ge?Ct.push({activityRowId:Is,startMs:ge,endMs:xn}):Qe.effective===0&&ae.run(Is,At(J.occurred_at),0)}if(ut!==null)for(let ge of Ve){let xn=ge.tokens,Re=p0(ge,ue,F,fe);ve.run(ut,ge.provider??null,ge.model??null,Re.serviceTier,ge.runtime?.reasoning_effort??null,xn.input,xn.cached_input,Re.uncachedInputTokens,xn.output,xn.reasoning,Re.visibleOutputTokens,xn.total,Re.inputRate,Re.cachedRate,Re.outputRate,Re.reasoningRate,Re.contextInputMultiplier,Re.contextOutputMultiplier,Re.speedCostMultiplier,Re.pricingScenario,Re.standardUsd,Re.speedUpliftUsd,Re.inputUsd,Re.cachedInputUsd,Re.outputUsd,Re.reasoningUsd,Re.calculatedUsd,Re.recordedUsd,Re.varianceUsd,Re.effectiveUsd,Re.effectiveBrl,Re.recordedUsd!==null?"canonical_recorded":"token_pricing_estimate",Re.pricingModel,Re.pricingSource,Re.fxRate)}gr||(Ye+=1)}for(let P of mh(Ct))ae.run(P.activityRowId,P.day,P.value);u.exec(`UPDATE zaip_aios_activities
|
|
261
|
+
SET duration_ms = (
|
|
262
|
+
SELECT SUM(f.attributed_token_active_ms)
|
|
263
|
+
FROM attributed_token_active_facts f
|
|
264
|
+
WHERE f.activity_row_id=zaip_aios_activities.activity_row_id
|
|
265
|
+
),
|
|
266
|
+
duration_provenance = CASE
|
|
267
|
+
WHEN EXISTS (SELECT 1 FROM attributed_token_active_facts f WHERE f.activity_row_id=zaip_aios_activities.activity_row_id)
|
|
268
|
+
THEN 'attributed_token_active' ELSE NULL END;`);let As=Ge.size,xi=u.prepare("SELECT COUNT(*) AS count FROM zaip_aios_activities WHERE agent_invocation_id IS NOT NULL").get().count;u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("source_file_count",String(A)),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("excluded_source_count",String(R));let vh=u.prepare("SELECT COUNT(DISTINCT occurred_day_sp) AS count FROM zaip_aios_activities WHERE occurred_day_sp IS NOT NULL").get().count,yh=u.prepare("SELECT COUNT(*) AS count FROM zaip_aios_activities").get().count,bh=u.prepare("SELECT COUNT(*) AS count FROM zaip_aios_activities WHERE activity_source_kind = 'agent_run'").get().count;u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("daily_aggregate_count",String(vh)),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("activity_count",String(yh)),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("canonical_run_count",String(As)),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("excluded_unknown_token_run_count",String(ot)),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("agent_run_count",String(bh)),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("telemetry_summary_count","0"),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("unassisted_activity_count",String(Ye)),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("unassisted_turn_count",String(Ye)),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("agent_invocation_count",String(xi)),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("schema_version",mr),u.prepare("INSERT INTO read_model_metadata(key, value) VALUES (?, ?)").run("source_fingerprint",o);let Sh=u.prepare("INSERT OR IGNORE INTO zaip_dim_llm_model(model) VALUES (?)"),Eh=u.prepare("INSERT OR IGNORE INTO zaip_dim_provider(provider) VALUES (?)");for(let P of F.models)Sh.run(P.id),Eh.run(P.provider);let kh=t0(u),Rt=(P,ue)=>u.exec(`INSERT INTO zaip_aios_activities(
|
|
269
|
+
activity_row_id, activity_source_kind, activity_key, source_path, source_hash,
|
|
270
|
+
recorded_at, run_role, root_run_id, payload_type, payload_json
|
|
271
|
+
) SELECT
|
|
272
|
+
'TECH-' || lower(hex(randomblob(16))), 'technical_payload', '${P}:' || row_key,
|
|
273
|
+
'sqlite://${P}', '', datetime('now'), 'technical', 'technical', '${P}', payload_json
|
|
274
|
+
FROM (${ue});`);Rt("metadata","SELECT key AS row_key, json_object('key', key, 'value', value) AS payload_json FROM read_model_metadata"),Rt("source_state","SELECT source_path AS row_key, json_object('source_path', source_path, 'source_hash', source_hash, 'mtime_ms', mtime_ms, 'size_bytes', size_bytes, 'source_kind', source_kind, 'last_processed_at', last_processed_at) AS payload_json FROM read_model_source_state"),Rt("file","SELECT path AS row_key, json_object('path', path, 'content', content, 'mtime_ms', mtime_ms, 'size_bytes', size_bytes, 'content_sha256', content_sha256, 'artifact_kind', artifact_kind, 'artifact_id', artifact_id, 'artifact_occurred_at', artifact_occurred_at, 'artifact_occurred_day_sp', artifact_occurred_day_sp) AS payload_json FROM files"),Rt("work_item","SELECT entity_kind || ':' || id AS row_key, json_object('entity_kind', entity_kind, 'id', id, 'title', title, 'status', status, 'stage', stage, 'risk', risk, 'occurred_at', occurred_at, 'occurred_day_sp', occurred_day_sp) AS payload_json FROM canonical_work_items"),Rt("execution","SELECT id AS row_key, json_object('id', id, 'status', status, 'kind', kind, 'origin_type', origin_type, 'origin_id', origin_id, 'created_at', created_at, 'occurred_day_sp', occurred_day_sp, 'finished_at', finished_at, 'source_path', source_path) AS payload_json FROM canonical_executions"),Rt("change","SELECT id AS row_key, json_object('id', id, 'title', title, 'status', status, 'risk', risk, 'source_type', source_type, 'source_id', source_id, 'source_spec_id', source_spec_id, 'source_prd_id', source_prd_id, 'requirement_ids_json', requirement_ids_json, 'acceptance_ids_json', acceptance_ids_json, 'task_ids_json', task_ids_json, 'result', result, 'created_at', created_at, 'occurred_day_sp', occurred_day_sp, 'source_path', source_path) AS payload_json FROM canonical_changes"),Rt("decision","SELECT id AS row_key, json_object('id', id, 'title', title, 'origin', origin, 'scope_type', scope_type, 'scope_id', scope_id, 'created_at', created_at, 'occurred_day_sp', occurred_day_sp, 'source_path', source_path) AS payload_json FROM canonical_decisions"),Rt("run_index","SELECT run_id AS row_key, json_object('run_id', run_id, 'occurred_at', occurred_at, 'occurred_day_sp', occurred_day_sp, 'task_id', task_id, 'phase', phase, 'run_role', run_role, 'duration_ms', duration_ms, 'source_event_count', source_event_count, 'zaip_agent', zaip_agent, 'provider', provider, 'model', model, 'status', status) AS payload_json FROM canonical_run_index"),Rt("usage_segment","SELECT agent_invocation_id || ':' || rowid AS row_key, json_object('agent_invocation_id', agent_invocation_id, 'provider', provider, 'model', model, 'service_tier', service_tier, 'reasoning_effort', reasoning_effort, 'input_tokens', input_tokens, 'cached_input_tokens', cached_input_tokens, 'uncached_input_tokens', uncached_input_tokens, 'output_tokens', output_tokens, 'reasoning_tokens', reasoning_tokens, 'visible_output_tokens', visible_output_tokens, 'total_tokens', total_tokens, 'input_rate_usd_per_million', input_rate_usd_per_million, 'cached_input_rate_usd_per_million', cached_input_rate_usd_per_million, 'output_rate_usd_per_million', output_rate_usd_per_million, 'reasoning_rate_usd_per_million', reasoning_rate_usd_per_million, 'context_input_multiplier', context_input_multiplier, 'context_output_multiplier', context_output_multiplier, 'speed_cost_multiplier', speed_cost_multiplier, 'pricing_scenario', pricing_scenario, 'standard_cost_usd', standard_cost_usd, 'speed_uplift_usd', speed_uplift_usd, 'input_cost_usd', input_cost_usd, 'cached_input_cost_usd', cached_input_cost_usd, 'output_cost_usd', output_cost_usd, 'reasoning_cost_usd', reasoning_cost_usd, 'calculated_cost_usd', calculated_cost_usd, 'recorded_cost_usd', recorded_cost_usd, 'cost_variance_usd', cost_variance_usd, 'cost_usd', cost_usd, 'cost_brl', cost_brl, 'cost_method', cost_method, 'pricing_model', pricing_model, 'pricing_source', pricing_source, 'fx_rate', fx_rate) AS payload_json FROM invocation_usage_segments"),Rt("duration_allocation","SELECT activity_row_id || ':' || occurred_day_sp AS row_key, json_object('activity_row_id', activity_row_id, 'occurred_day_sp', occurred_day_sp, 'attributed_token_active_ms', attributed_token_active_ms) AS payload_json FROM attributed_token_active_facts");let Oh=u.prepare("INSERT OR IGNORE INTO zaip_dim_zaip_agent(zaip_agent, catalog_id, persona, job, role, catalog_hash) VALUES (?, ?, ?, ?, ?, ?)");for(let[P,ue]of ze)Oh.run(P,ue.catalogId,ue.persona,ue.job,ue.role,X);let wh=u.prepare(`INSERT INTO zaip_aios_activities(
|
|
275
|
+
activity_row_id, activity_source_kind, activity_key, source_path, source_hash,
|
|
276
|
+
recorded_at, run_role, root_run_id, payload_type, payload_json
|
|
277
|
+
) VALUES (?, 'technical_payload', ?, ?, '', datetime('now'), 'technical', 'technical', 'cost_dimension_aggregate_v1', ?)`);for(let P of["model","provider"])for(let ue of kh[P])wh.run(`TECH-${(0,Nt.randomUUID)().toLowerCase()}`,`cost_dimension_aggregate_v1:${P}:${ue.key}`,`sqlite://cost_dimension_aggregate_v1/${P}`,JSON.stringify({schema_version:1,dimension:P,...ue}));let du=`
|
|
278
|
+
CREATE INDEX zaip_activities_agent_run ON zaip_aios_activities(activity_source_kind, agent_run_id, occurred_day_sp, occurred_at DESC);
|
|
279
|
+
CREATE INDEX zaip_activities_relationships ON zaip_aios_activities(task_id, spec_id, prd_id, execution_id, conversation_id);
|
|
280
|
+
CREATE INDEX zaip_activities_task_day ON zaip_aios_activities(payload_type, task_id, occurred_day_sp) WHERE task_id IS NOT NULL;
|
|
281
|
+
CREATE INDEX zaip_activities_spec_day ON zaip_aios_activities(payload_type, spec_id, occurred_day_sp) WHERE spec_id IS NOT NULL;
|
|
282
|
+
CREATE INDEX zaip_activities_prd_day ON zaip_aios_activities(payload_type, prd_id, occurred_day_sp) WHERE prd_id IS NOT NULL;
|
|
283
|
+
CREATE INDEX zaip_activities_agent ON zaip_aios_activities(zaip_agent, zaip_agent_persona, zaip_agent_job, provider, model);
|
|
284
|
+
CREATE UNIQUE INDEX zaip_activities_run_id ON zaip_aios_activities(run_id);
|
|
285
|
+
CREATE INDEX zaip_activities_run_hierarchy ON zaip_aios_activities(root_run_id, parent_run_id, run_role);
|
|
286
|
+
CREATE INDEX zaip_activities_period ON zaip_aios_activities(occurred_day_sp, occurred_at DESC);
|
|
287
|
+
-- Dimension residuals first restrict the visible period, then group
|
|
288
|
+
-- usage by invocation. This composite index avoids a temporary
|
|
289
|
+
-- grouping B-tree on Models/Providers filtered reads.
|
|
290
|
+
CREATE INDEX zaip_activities_period_invocation ON zaip_aios_activities(occurred_day_sp, agent_invocation_id)
|
|
291
|
+
WHERE agent_invocation_id IS NOT NULL;
|
|
292
|
+
CREATE INDEX zaip_activities_status ON zaip_aios_activities(activity_source_kind, status, phase);
|
|
293
|
+
CREATE INDEX zaip_activities_payload ON zaip_aios_activities(payload_type, activity_key);
|
|
294
|
+
CREATE VIEW files AS SELECT json_extract(payload_json, '$.path') AS path, json_extract(payload_json, '$.content') AS content, json_extract(payload_json, '$.mtime_ms') AS mtime_ms, json_extract(payload_json, '$.size_bytes') AS size_bytes, json_extract(payload_json, '$.content_sha256') AS content_sha256, json_extract(payload_json, '$.artifact_kind') AS artifact_kind, json_extract(payload_json, '$.artifact_id') AS artifact_id, json_extract(payload_json, '$.artifact_occurred_at') AS artifact_occurred_at, json_extract(payload_json, '$.artifact_occurred_day_sp') AS artifact_occurred_day_sp FROM zaip_aios_activities WHERE payload_type='file';
|
|
295
|
+
CREATE VIEW read_model_source_state AS SELECT json_extract(payload_json, '$.source_path') AS source_path, json_extract(payload_json, '$.source_hash') AS source_hash, json_extract(payload_json, '$.mtime_ms') AS mtime_ms, json_extract(payload_json, '$.size_bytes') AS size_bytes, json_extract(payload_json, '$.source_kind') AS source_kind, json_extract(payload_json, '$.last_processed_at') AS last_processed_at FROM zaip_aios_activities WHERE payload_type='source_state';
|
|
296
|
+
CREATE VIEW read_model_metadata AS SELECT json_extract(payload_json, '$.key') AS key, json_extract(payload_json, '$.value') AS value FROM zaip_aios_activities WHERE payload_type='metadata';
|
|
297
|
+
CREATE VIEW canonical_work_items AS SELECT json_extract(payload_json, '$.entity_kind') AS entity_kind, json_extract(payload_json, '$.id') AS id, json_extract(payload_json, '$.title') AS title, json_extract(payload_json, '$.status') AS status, json_extract(payload_json, '$.stage') AS stage, json_extract(payload_json, '$.risk') AS risk, json_extract(payload_json, '$.occurred_at') AS occurred_at, json_extract(payload_json, '$.occurred_day_sp') AS occurred_day_sp FROM zaip_aios_activities WHERE payload_type='work_item';
|
|
298
|
+
CREATE VIEW canonical_executions AS SELECT json_extract(payload_json, '$.id') AS id, json_extract(payload_json, '$.status') AS status, json_extract(payload_json, '$.kind') AS kind, json_extract(payload_json, '$.origin_type') AS origin_type, json_extract(payload_json, '$.origin_id') AS origin_id, json_extract(payload_json, '$.created_at') AS created_at, json_extract(payload_json, '$.occurred_day_sp') AS occurred_day_sp, json_extract(payload_json, '$.finished_at') AS finished_at, json_extract(payload_json, '$.source_path') AS source_path FROM zaip_aios_activities WHERE payload_type='execution';
|
|
299
|
+
CREATE VIEW canonical_changes AS SELECT json_extract(payload_json, '$.id') AS id, json_extract(payload_json, '$.title') AS title, json_extract(payload_json, '$.status') AS status, json_extract(payload_json, '$.risk') AS risk, json_extract(payload_json, '$.source_type') AS source_type, json_extract(payload_json, '$.source_id') AS source_id, json_extract(payload_json, '$.source_spec_id') AS source_spec_id, json_extract(payload_json, '$.source_prd_id') AS source_prd_id, json_extract(payload_json, '$.requirement_ids_json') AS requirement_ids_json, json_extract(payload_json, '$.acceptance_ids_json') AS acceptance_ids_json, json_extract(payload_json, '$.task_ids_json') AS task_ids_json, json_extract(payload_json, '$.result') AS result, json_extract(payload_json, '$.created_at') AS created_at, json_extract(payload_json, '$.occurred_day_sp') AS occurred_day_sp, json_extract(payload_json, '$.source_path') AS source_path FROM zaip_aios_activities WHERE payload_type='change';
|
|
300
|
+
CREATE VIEW canonical_decisions AS SELECT json_extract(payload_json, '$.id') AS id, json_extract(payload_json, '$.title') AS title, json_extract(payload_json, '$.origin') AS origin, json_extract(payload_json, '$.scope_type') AS scope_type, json_extract(payload_json, '$.scope_id') AS scope_id, json_extract(payload_json, '$.created_at') AS created_at, json_extract(payload_json, '$.occurred_day_sp') AS occurred_day_sp, json_extract(payload_json, '$.source_path') AS source_path FROM zaip_aios_activities WHERE payload_type='decision';
|
|
301
|
+
CREATE VIEW canonical_run_index AS SELECT json_extract(payload_json, '$.run_id') AS run_id, json_extract(payload_json, '$.occurred_at') AS occurred_at, json_extract(payload_json, '$.occurred_day_sp') AS occurred_day_sp, json_extract(payload_json, '$.task_id') AS task_id, json_extract(payload_json, '$.phase') AS phase, json_extract(payload_json, '$.run_role') AS run_role, json_extract(payload_json, '$.duration_ms') AS duration_ms, json_extract(payload_json, '$.source_event_count') AS source_event_count, json_extract(payload_json, '$.zaip_agent') AS zaip_agent, json_extract(payload_json, '$.provider') AS provider, json_extract(payload_json, '$.model') AS model, json_extract(payload_json, '$.status') AS status FROM zaip_aios_activities WHERE payload_type='run_index';
|
|
302
|
+
CREATE VIEW invocation_usage_segments AS SELECT json_extract(payload_json, '$.agent_invocation_id') AS agent_invocation_id, json_extract(payload_json, '$.provider') AS provider, json_extract(payload_json, '$.model') AS model, json_extract(payload_json, '$.service_tier') AS service_tier, json_extract(payload_json, '$.reasoning_effort') AS reasoning_effort, json_extract(payload_json, '$.input_tokens') AS input_tokens, json_extract(payload_json, '$.cached_input_tokens') AS cached_input_tokens, json_extract(payload_json, '$.uncached_input_tokens') AS uncached_input_tokens, json_extract(payload_json, '$.output_tokens') AS output_tokens, json_extract(payload_json, '$.reasoning_tokens') AS reasoning_tokens, json_extract(payload_json, '$.visible_output_tokens') AS visible_output_tokens, json_extract(payload_json, '$.total_tokens') AS total_tokens, json_extract(payload_json, '$.input_rate_usd_per_million') AS input_rate_usd_per_million, json_extract(payload_json, '$.cached_input_rate_usd_per_million') AS cached_input_rate_usd_per_million, json_extract(payload_json, '$.output_rate_usd_per_million') AS output_rate_usd_per_million, json_extract(payload_json, '$.reasoning_rate_usd_per_million') AS reasoning_rate_usd_per_million, json_extract(payload_json, '$.context_input_multiplier') AS context_input_multiplier, json_extract(payload_json, '$.context_output_multiplier') AS context_output_multiplier, json_extract(payload_json, '$.speed_cost_multiplier') AS speed_cost_multiplier, json_extract(payload_json, '$.pricing_scenario') AS pricing_scenario, json_extract(payload_json, '$.standard_cost_usd') AS standard_cost_usd, json_extract(payload_json, '$.speed_uplift_usd') AS speed_uplift_usd, json_extract(payload_json, '$.input_cost_usd') AS input_cost_usd, json_extract(payload_json, '$.cached_input_cost_usd') AS cached_input_cost_usd, json_extract(payload_json, '$.output_cost_usd') AS output_cost_usd, json_extract(payload_json, '$.reasoning_cost_usd') AS reasoning_cost_usd, json_extract(payload_json, '$.calculated_cost_usd') AS calculated_cost_usd, json_extract(payload_json, '$.recorded_cost_usd') AS recorded_cost_usd, json_extract(payload_json, '$.cost_variance_usd') AS cost_variance_usd, json_extract(payload_json, '$.cost_usd') AS cost_usd, json_extract(payload_json, '$.cost_brl') AS cost_brl, json_extract(payload_json, '$.cost_method') AS cost_method, json_extract(payload_json, '$.pricing_model') AS pricing_model, json_extract(payload_json, '$.pricing_source') AS pricing_source, json_extract(payload_json, '$.fx_rate') AS fx_rate FROM zaip_aios_activities WHERE payload_type='usage_segment';
|
|
303
|
+
CREATE VIEW attributed_token_active_facts AS SELECT json_extract(payload_json, '$.activity_row_id') AS activity_row_id, json_extract(payload_json, '$.occurred_day_sp') AS occurred_day_sp, json_extract(payload_json, '$.attributed_token_active_ms') AS attributed_token_active_ms FROM zaip_aios_activities WHERE payload_type='duration_allocation';
|
|
304
|
+
CREATE VIEW canonical_artifacts AS SELECT artifact_kind, artifact_id, artifact_occurred_at AS occurred_at, artifact_occurred_day_sp AS occurred_day_sp, path AS source_path FROM files WHERE artifact_kind IS NOT NULL AND artifact_occurred_at IS NOT NULL;
|
|
305
|
+
CREATE VIEW activities AS
|
|
306
|
+
SELECT a.*, f.attributed_token_active_ms
|
|
307
|
+
FROM zaip_aios_activities a
|
|
308
|
+
LEFT JOIN (
|
|
309
|
+
SELECT activity_row_id, SUM(attributed_token_active_ms) AS attributed_token_active_ms
|
|
310
|
+
FROM attributed_token_active_facts GROUP BY activity_row_id
|
|
311
|
+
) f USING(activity_row_id)
|
|
312
|
+
WHERE a.payload_type IS NULL;
|
|
313
|
+
CREATE VIEW attributed_token_active AS
|
|
314
|
+
SELECT f.activity_row_id, f.occurred_day_sp, f.attributed_token_active_ms,
|
|
315
|
+
a.run_id, a.execution_id, a.task_id, a.spec_id, a.prd_id, a.conversation_id,
|
|
316
|
+
a.zaip_agent, a.provider, a.model, a.phase, a.status
|
|
317
|
+
FROM attributed_token_active_facts f JOIN zaip_aios_activities a USING(activity_row_id);
|
|
318
|
+
CREATE VIEW agent_runs AS SELECT * FROM activities WHERE activity_source_kind = 'agent_run';
|
|
319
|
+
CREATE VIEW root_runs AS SELECT * FROM activities WHERE run_role = 'root';
|
|
320
|
+
CREATE VIEW sub_runs AS SELECT * FROM activities WHERE run_role = 'subrun';
|
|
321
|
+
CREATE VIEW invocations AS SELECT activity_row_id, activity_key, version_activity_id, source_occurred_at, root_agent_run_id AS root_agent_invocation_id, parent_agent_run_id AS parent_agent_invocation_id, execution_id, task_id, spec_id, prd_id, change_id, conversation_id, run_id, occurred_at, occurred_day_sp, invocation_kind, delegation_depth, zaip_agent, zaip_agent_persona, zaip_agent_job, zaip_agent_role, client, provider, model, phase, purpose, status, source_started_at, source_finished_at, attributed_token_active_ms, attributed_token_active_ms AS duration_ms, CASE WHEN attributed_token_active_ms IS NOT NULL THEN 'observed' ELSE 'unavailable' END AS duration_provenance, CASE WHEN attributed_token_active_ms IS NOT NULL THEN 'attributed_token_active' ELSE NULL END AS duration_fact_provenance, input_tokens, cached_input_tokens, output_tokens, reasoning_tokens, total_tokens, token_source, cost_usd, cost_brl, cost_method, pricing_model, pricing_source, fx_rate, service_tier, reasoning_effort, source_event_count, usage_event_count, llm_call_count, agent_run_id AS agent_invocation_id FROM agent_runs;
|
|
322
|
+
CREATE VIEW invocation_usage AS SELECT agent_invocation_id, agent_invocation_id AS usage_index, provider, model, service_tier, reasoning_effort, input_tokens, cached_input_tokens, uncached_input_tokens, output_tokens, reasoning_tokens, visible_output_tokens, total_tokens, input_rate_usd_per_million, cached_input_rate_usd_per_million, output_rate_usd_per_million, reasoning_rate_usd_per_million, context_input_multiplier, context_output_multiplier, speed_cost_multiplier, pricing_scenario, standard_cost_usd, speed_uplift_usd, input_cost_usd, cached_input_cost_usd, output_cost_usd, reasoning_cost_usd, calculated_cost_usd, recorded_cost_usd, cost_variance_usd, cost_usd, cost_brl, cost_method, pricing_model, pricing_source, fx_rate FROM invocation_usage_segments;
|
|
323
|
+
-- Flatten the small financial dimension fact once during rebuild.
|
|
324
|
+
-- Models/Providers must never execute JSON extraction for each paint.
|
|
325
|
+
CREATE TABLE cost_invocation_dimension_facts AS
|
|
326
|
+
SELECT i.agent_invocation_id, date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours') AS occurred_day_sp,
|
|
327
|
+
CASE WHEN u.model IS NULL OR trim(u.model)='' OR u.model='unavailable' THEN 'unavailable' ELSE u.model END AS model,
|
|
328
|
+
CASE WHEN u.provider IS NULL OR trim(u.provider)='' OR u.provider='unavailable' THEN 'unavailable' ELSE u.provider END AS provider,
|
|
329
|
+
u.input_tokens, u.cached_input_tokens, u.output_tokens, u.reasoning_tokens,
|
|
330
|
+
u.total_tokens, u.cost_usd, u.cost_brl, i.attributed_token_active_ms AS duration_ms, 0 AS residual
|
|
331
|
+
FROM invocations i JOIN invocation_usage u USING(agent_invocation_id)
|
|
332
|
+
WHERE u.total_tokens IS NOT NULL OR u.cost_usd IS NOT NULL OR u.cost_brl IS NOT NULL;
|
|
333
|
+
CREATE INDEX cost_dimension_facts_day_model ON cost_invocation_dimension_facts(occurred_day_sp, model);
|
|
334
|
+
CREATE INDEX cost_dimension_facts_day_provider ON cost_invocation_dimension_facts(occurred_day_sp, provider);
|
|
335
|
+
CREATE INDEX cost_dimension_facts_invocation ON cost_invocation_dimension_facts(agent_invocation_id);
|
|
336
|
+
INSERT INTO cost_invocation_dimension_facts
|
|
337
|
+
SELECT i.agent_invocation_id, date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours') AS occurred_day_sp, 'unavailable', 'unavailable',
|
|
338
|
+
i.input_tokens-COALESCE(s.input_tokens,0), i.cached_input_tokens-COALESCE(s.cached_input_tokens,0),
|
|
339
|
+
i.output_tokens-COALESCE(s.output_tokens,0), i.reasoning_tokens-COALESCE(s.reasoning_tokens,0),
|
|
340
|
+
i.total_tokens-COALESCE(s.total_tokens,0), i.cost_usd-COALESCE(s.cost_usd,0),
|
|
341
|
+
i.cost_brl-COALESCE(s.cost_brl,0), i.attributed_token_active_ms, 1
|
|
342
|
+
FROM invocations i LEFT JOIN (
|
|
343
|
+
SELECT agent_invocation_id, SUM(input_tokens) input_tokens, SUM(cached_input_tokens) cached_input_tokens,
|
|
344
|
+
SUM(output_tokens) output_tokens, SUM(reasoning_tokens) reasoning_tokens, SUM(total_tokens) total_tokens,
|
|
345
|
+
SUM(cost_usd) cost_usd, SUM(cost_brl) cost_brl
|
|
346
|
+
FROM cost_invocation_dimension_facts GROUP BY agent_invocation_id
|
|
347
|
+
) s USING(agent_invocation_id)
|
|
348
|
+
WHERE i.total_tokens<>COALESCE(s.total_tokens,0) OR i.cost_usd<>COALESCE(s.cost_usd,0) OR i.cost_brl<>COALESCE(s.cost_brl,0);
|
|
349
|
+
-- Financial activities outside Agent Invocation telemetry are still
|
|
350
|
+
-- factual Cost Monitor facts. Give them a stable synthetic key and
|
|
351
|
+
-- retain them as the explicit no-dimension population.
|
|
352
|
+
INSERT INTO cost_invocation_dimension_facts
|
|
353
|
+
SELECT 'activity:' || a.activity_row_id, a.occurred_day_sp, 'unavailable', 'unavailable',
|
|
354
|
+
a.input_tokens, a.cached_input_tokens, a.output_tokens, a.reasoning_tokens,
|
|
355
|
+
a.total_tokens, a.cost_usd, a.cost_brl, f.attributed_token_active_ms, 1
|
|
356
|
+
FROM zaip_aios_activities a
|
|
357
|
+
LEFT JOIN attributed_token_active_facts f USING(activity_row_id)
|
|
358
|
+
WHERE a.payload_type IS NULL AND a.activity_source_kind <> 'agent_run'
|
|
359
|
+
AND (a.total_tokens IS NOT NULL OR a.cost_usd IS NOT NULL OR a.cost_brl IS NOT NULL)
|
|
360
|
+
AND NOT EXISTS (SELECT 1 FROM cost_invocation_dimension_facts d WHERE d.agent_invocation_id='activity:' || a.activity_row_id);
|
|
361
|
+
CREATE VIEW work_items AS SELECT entity_kind, id, title, status, risk, occurred_at, occurred_day_sp FROM canonical_work_items UNION ALL SELECT 'task', task_id, COALESCE(MAX(title), task_id), MAX(work_item_status), MAX(risk), MIN(occurred_at), MIN(occurred_day_sp) FROM activities WHERE task_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM canonical_work_items c WHERE c.entity_kind='task' AND c.id=activities.task_id) GROUP BY task_id UNION ALL SELECT 'spec', spec_id, COALESCE(MAX(title), spec_id), MAX(work_item_status), MAX(risk), MIN(occurred_at), MIN(occurred_day_sp) FROM activities WHERE spec_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM canonical_work_items c WHERE c.entity_kind='spec' AND c.id=activities.spec_id) GROUP BY spec_id UNION ALL SELECT 'prd', prd_id, COALESCE(MAX(title), prd_id), MAX(work_item_status), MAX(risk), MIN(occurred_at), MIN(occurred_day_sp) FROM activities WHERE prd_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM canonical_work_items c WHERE c.entity_kind='prd' AND c.id=activities.prd_id) GROUP BY prd_id;
|
|
362
|
+
CREATE VIEW tasks AS SELECT id, title, status, risk, occurred_at, occurred_day_sp FROM work_items WHERE entity_kind = 'task';
|
|
363
|
+
CREATE VIEW specs AS SELECT id, title, status, risk, occurred_at, occurred_day_sp FROM work_items WHERE entity_kind = 'spec';
|
|
364
|
+
CREATE VIEW prds AS SELECT id, title, status, risk, occurred_at, occurred_day_sp FROM work_items WHERE entity_kind = 'prd';
|
|
365
|
+
CREATE VIEW executions AS
|
|
366
|
+
SELECT id, status, created_at AS occurred_at, occurred_day_sp FROM canonical_executions
|
|
367
|
+
UNION ALL
|
|
368
|
+
SELECT execution_id, MAX(status), MIN(occurred_at), MIN(occurred_day_sp)
|
|
369
|
+
FROM activities
|
|
370
|
+
WHERE execution_id IS NOT NULL
|
|
371
|
+
AND NOT EXISTS (SELECT 1 FROM canonical_executions c WHERE c.id=activities.execution_id)
|
|
372
|
+
GROUP BY execution_id;
|
|
373
|
+
CREATE VIEW conversations AS
|
|
374
|
+
SELECT origin_id AS id, MAX(status) AS status, MIN(created_at) AS occurred_at, MIN(occurred_day_sp) AS occurred_day_sp
|
|
375
|
+
FROM canonical_executions WHERE origin_type='interaction' AND origin_id IS NOT NULL GROUP BY origin_id
|
|
376
|
+
UNION ALL
|
|
377
|
+
SELECT conversation_id, MAX(status), MIN(occurred_at), MIN(occurred_day_sp)
|
|
378
|
+
FROM activities
|
|
379
|
+
WHERE conversation_id IS NOT NULL
|
|
380
|
+
AND NOT EXISTS (SELECT 1 FROM canonical_executions c WHERE c.origin_type='interaction' AND c.origin_id=activities.conversation_id)
|
|
381
|
+
GROUP BY conversation_id;
|
|
382
|
+
CREATE VIEW decisions AS SELECT id, title, origin, scope_type, scope_id, NULL AS status, NULL AS risk, created_at AS occurred_at, occurred_day_sp, source_path FROM canonical_decisions;
|
|
383
|
+
CREATE VIEW changes AS SELECT id, title, status, risk, source_type, source_id, requirement_ids_json, acceptance_ids_json, task_ids_json, result, created_at AS occurred_at, occurred_day_sp, source_path FROM canonical_changes;
|
|
384
|
+
CREATE VIEW dimensions AS SELECT 'zaip_agent' AS dimension, zaip_agent AS value FROM agent_runs WHERE zaip_agent IS NOT NULL UNION SELECT 'provider', provider FROM agent_runs WHERE provider IS NOT NULL UNION SELECT 'model', model FROM agent_runs WHERE model IS NOT NULL UNION SELECT 'status', status FROM zaip_aios_activities WHERE status IS NOT NULL;
|
|
385
|
+
CREATE VIEW daily_aggregate_cache AS
|
|
386
|
+
WITH RECURSIVE raw_intervals AS (
|
|
387
|
+
SELECT
|
|
388
|
+
(julianday(COALESCE(source_started_at, occurred_at)) - 2440587.5) * 86400000.0 AS start_ms,
|
|
389
|
+
(julianday(COALESCE(source_finished_at, occurred_at)) - 2440587.5) * 86400000.0 AS source_end_ms,
|
|
390
|
+
duration_ms
|
|
391
|
+
FROM invocations
|
|
392
|
+
WHERE total_tokens IS NOT NULL AND duration_ms IS NOT NULL AND duration_ms > 0
|
|
393
|
+
), measurable_intervals AS (
|
|
394
|
+
SELECT start_ms,
|
|
395
|
+
CASE WHEN source_end_ms > start_ms THEN source_end_ms ELSE start_ms + duration_ms END AS end_ms
|
|
396
|
+
FROM raw_intervals
|
|
397
|
+
), split_intervals(day, start_ms, end_ms, segment_end_ms) AS (
|
|
398
|
+
-- America/Sao_Paulo has used UTC-03:00 throughout the canonical
|
|
399
|
+
-- dashboard period. Split before unioning so a day cannot exceed
|
|
400
|
+
-- its local 24-hour boundary even when Runs span midnight.
|
|
401
|
+
SELECT date(start_ms / 1000.0, 'unixepoch', '-3 hours'), start_ms, end_ms,
|
|
402
|
+
MIN(end_ms, strftime('%s', date(start_ms / 1000.0, 'unixepoch', '-3 hours', '+1 day') || ' 03:00:00') * 1000.0)
|
|
403
|
+
FROM measurable_intervals
|
|
404
|
+
UNION ALL
|
|
405
|
+
SELECT date(segment_end_ms / 1000.0, 'unixepoch', '-3 hours'), segment_end_ms, end_ms,
|
|
406
|
+
MIN(end_ms, strftime('%s', date(segment_end_ms / 1000.0, 'unixepoch', '-3 hours', '+1 day') || ' 03:00:00') * 1000.0)
|
|
407
|
+
FROM split_intervals WHERE segment_end_ms < end_ms
|
|
408
|
+
), intervals AS (
|
|
409
|
+
SELECT day, start_ms, segment_end_ms AS end_ms FROM split_intervals
|
|
410
|
+
), ordered AS (
|
|
411
|
+
SELECT *, MAX(end_ms) OVER (PARTITION BY day ORDER BY start_ms, end_ms ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) AS prior_end_ms
|
|
412
|
+
FROM intervals
|
|
413
|
+
), grouped AS (
|
|
414
|
+
SELECT *, SUM(CASE WHEN prior_end_ms IS NULL OR start_ms > prior_end_ms THEN 1 ELSE 0 END)
|
|
415
|
+
OVER (PARTITION BY day ORDER BY start_ms, end_ms) AS interval_group
|
|
416
|
+
FROM ordered
|
|
417
|
+
), merged AS (
|
|
418
|
+
SELECT day, interval_group, MIN(start_ms) AS start_ms, MAX(end_ms) AS end_ms
|
|
419
|
+
FROM grouped GROUP BY day, interval_group
|
|
420
|
+
), operations_daily_duration AS (
|
|
421
|
+
SELECT occurred_day_sp AS day, SUM(attributed_token_active_ms) AS total_duration
|
|
422
|
+
FROM attributed_token_active_facts GROUP BY occurred_day_sp
|
|
423
|
+
), work_item_days AS (
|
|
424
|
+
SELECT entity_kind AS kind, id, occurred_day_sp AS day FROM canonical_work_items
|
|
425
|
+
UNION ALL SELECT 'task', task_id, MIN(occurred_day_sp) FROM activities WHERE task_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM canonical_work_items c WHERE c.entity_kind='task' AND c.id=activities.task_id) GROUP BY task_id
|
|
426
|
+
UNION ALL SELECT 'spec', spec_id, MIN(occurred_day_sp) FROM activities WHERE spec_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM canonical_work_items c WHERE c.entity_kind='spec' AND c.id=activities.spec_id) GROUP BY spec_id
|
|
427
|
+
UNION ALL SELECT 'prd', prd_id, MIN(occurred_day_sp) FROM activities WHERE prd_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM canonical_work_items c WHERE c.entity_kind='prd' AND c.id=activities.prd_id) GROUP BY prd_id
|
|
428
|
+
), work_item_daily AS (
|
|
429
|
+
SELECT day,
|
|
430
|
+
SUM(CASE WHEN kind='prd' THEN 1 ELSE 0 END) AS prd_count,
|
|
431
|
+
SUM(CASE WHEN kind='spec' THEN 1 ELSE 0 END) AS spec_count,
|
|
432
|
+
SUM(CASE WHEN kind='task' THEN 1 ELSE 0 END) AS task_count
|
|
433
|
+
FROM work_item_days GROUP BY day
|
|
434
|
+
), artifact_daily AS (
|
|
435
|
+
SELECT occurred_day_sp AS day,
|
|
436
|
+
SUM(CASE WHEN artifact_kind='validation' THEN 1 ELSE 0 END) AS validation_count,
|
|
437
|
+
SUM(CASE WHEN artifact_kind='evidence' THEN 1 ELSE 0 END) AS evidence_count
|
|
438
|
+
FROM canonical_artifacts GROUP BY occurred_day_sp
|
|
439
|
+
), activity_daily AS (
|
|
440
|
+
SELECT date(COALESCE(source_started_at, source_occurred_at, occurred_at), '-3 hours') AS day,
|
|
441
|
+
COUNT(*) AS activity_count,
|
|
442
|
+
SUM(CASE WHEN activity_source_kind='agent_run' THEN 1 ELSE 0 END) AS invocation_count,
|
|
443
|
+
SUM(llm_call_count) AS llm_call_count,
|
|
444
|
+
SUM(root_run_duration) AS total_root_run_duration,
|
|
445
|
+
SUM(sub_run_duration) AS total_sub_run_duration,
|
|
446
|
+
SUM(total_tokens) AS total_tokens,
|
|
447
|
+
SUM(cost_usd) AS total_cost_usd,
|
|
448
|
+
SUM(cost_brl) AS total_cost_brl
|
|
449
|
+
FROM activities
|
|
450
|
+
GROUP BY date(COALESCE(source_started_at, source_occurred_at, occurred_at), '-3 hours')
|
|
451
|
+
), cost_monitor_financial_daily AS (
|
|
452
|
+
-- Cost Monitor retains every canonical activity with a financial
|
|
453
|
+
-- observation. Historical telemetry can predate
|
|
454
|
+
-- agent_invocation_id, so restricting this population to
|
|
455
|
+
-- invocations would silently discard those facts.
|
|
456
|
+
SELECT date(COALESCE(source_started_at, source_occurred_at, occurred_at), '-3 hours') AS day,
|
|
457
|
+
COUNT(*) AS invocation_count,
|
|
458
|
+
SUM(total_tokens) AS total_tokens,
|
|
459
|
+
SUM(cost_usd) AS total_cost_usd,
|
|
460
|
+
SUM(cost_brl) AS total_cost_brl
|
|
461
|
+
FROM activities
|
|
462
|
+
WHERE total_tokens IS NOT NULL OR cost_usd IS NOT NULL OR cost_brl IS NOT NULL
|
|
463
|
+
GROUP BY date(COALESCE(source_started_at, source_occurred_at, occurred_at), '-3 hours')
|
|
464
|
+
), cost_monitor_raw_intervals AS (
|
|
465
|
+
-- Only complete source intervals from the Cost Monitor financial
|
|
466
|
+
-- population are factual. Run duration and token estimates never
|
|
467
|
+
-- fill this measure.
|
|
468
|
+
SELECT activity_row_id AS activity_id,
|
|
469
|
+
(julianday(source_started_at) - 2440587.5) * 86400000.0 AS start_ms,
|
|
470
|
+
(julianday(source_finished_at) - 2440587.5) * 86400000.0 AS end_ms
|
|
471
|
+
FROM activities
|
|
472
|
+
WHERE (total_tokens IS NOT NULL OR cost_usd IS NOT NULL OR cost_brl IS NOT NULL)
|
|
473
|
+
AND source_started_at IS NOT NULL
|
|
474
|
+
AND source_finished_at IS NOT NULL
|
|
475
|
+
AND julianday(source_finished_at) > julianday(source_started_at)
|
|
476
|
+
), cost_monitor_split_intervals AS (
|
|
477
|
+
-- Split at America/Sao_Paulo day boundaries before unioning. This
|
|
478
|
+
-- makes the factual daily measure bounded by one local day.
|
|
479
|
+
SELECT date(start_ms / 1000.0, 'unixepoch', '-3 hours') AS day,
|
|
480
|
+
activity_id, start_ms, end_ms,
|
|
481
|
+
MIN(end_ms, strftime('%s', date(start_ms / 1000.0, 'unixepoch', '-3 hours', '+1 day') || ' 03:00:00') * 1000.0) AS segment_end_ms
|
|
482
|
+
FROM cost_monitor_raw_intervals
|
|
483
|
+
UNION ALL
|
|
484
|
+
SELECT date(segment_end_ms / 1000.0, 'unixepoch', '-3 hours'),
|
|
485
|
+
activity_id, segment_end_ms, end_ms,
|
|
486
|
+
MIN(end_ms, strftime('%s', date(segment_end_ms / 1000.0, 'unixepoch', '-3 hours', '+1 day') || ' 03:00:00') * 1000.0)
|
|
487
|
+
FROM cost_monitor_split_intervals WHERE segment_end_ms < end_ms
|
|
488
|
+
), cost_monitor_ordered_intervals AS (
|
|
489
|
+
SELECT day, start_ms, segment_end_ms AS end_ms,
|
|
490
|
+
MAX(segment_end_ms) OVER (PARTITION BY day ORDER BY start_ms, segment_end_ms ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) AS prior_end_ms
|
|
491
|
+
FROM cost_monitor_split_intervals
|
|
492
|
+
), cost_monitor_grouped_intervals AS (
|
|
493
|
+
SELECT *, SUM(CASE WHEN prior_end_ms IS NULL OR start_ms > prior_end_ms THEN 1 ELSE 0 END)
|
|
494
|
+
OVER (PARTITION BY day ORDER BY start_ms, end_ms) AS interval_group
|
|
495
|
+
FROM cost_monitor_ordered_intervals
|
|
496
|
+
), cost_monitor_merged_intervals AS (
|
|
497
|
+
SELECT day, interval_group, MIN(start_ms) AS start_ms, MAX(end_ms) AS end_ms
|
|
498
|
+
FROM cost_monitor_grouped_intervals GROUP BY day, interval_group
|
|
499
|
+
), cost_monitor_daily_duration AS (
|
|
500
|
+
-- Tempo is the shared attributed activity fact. Financial
|
|
501
|
+
-- coverage is reported independently below; an incomplete price
|
|
502
|
+
-- record must never erase an observed temporal fact.
|
|
503
|
+
SELECT occurred_day_sp AS day, SUM(attributed_token_active_ms) AS total_duration
|
|
504
|
+
FROM attributed_token_active_facts GROUP BY occurred_day_sp
|
|
505
|
+
), cost_monitor_duration_coverage AS (
|
|
506
|
+
SELECT day, COUNT(DISTINCT activity_id) AS eligible_runs,
|
|
507
|
+
COUNT(DISTINCT activity_id) AS known_runs
|
|
508
|
+
FROM cost_monitor_split_intervals GROUP BY day
|
|
509
|
+
UNION ALL
|
|
510
|
+
SELECT date(COALESCE(source_started_at, source_occurred_at, occurred_at), '-3 hours'),
|
|
511
|
+
COUNT(DISTINCT activity_row_id), 0
|
|
512
|
+
FROM activities
|
|
513
|
+
WHERE (total_tokens IS NOT NULL OR cost_usd IS NOT NULL OR cost_brl IS NOT NULL)
|
|
514
|
+
AND NOT (
|
|
515
|
+
source_started_at IS NOT NULL
|
|
516
|
+
AND source_finished_at IS NOT NULL
|
|
517
|
+
AND julianday(source_finished_at) > julianday(source_started_at)
|
|
518
|
+
)
|
|
519
|
+
GROUP BY date(COALESCE(source_started_at, source_occurred_at, occurred_at), '-3 hours')
|
|
520
|
+
), cost_monitor_daily_coverage AS (
|
|
521
|
+
SELECT day, SUM(eligible_runs) AS eligible_runs, SUM(known_runs) AS known_runs
|
|
522
|
+
FROM cost_monitor_duration_coverage GROUP BY day
|
|
523
|
+
), run_daily AS (
|
|
524
|
+
SELECT occurred_day_sp AS day,
|
|
525
|
+
SUM(CASE WHEN run_role='root' THEN 1 ELSE 0 END) AS root_run_count,
|
|
526
|
+
SUM(CASE WHEN run_role='subrun' THEN 1 ELSE 0 END) AS sub_run_count,
|
|
527
|
+
COUNT(*) AS total_run_count,
|
|
528
|
+
SUM(source_event_count) AS source_event_count
|
|
529
|
+
FROM canonical_run_index GROUP BY occurred_day_sp
|
|
530
|
+
), days AS (
|
|
531
|
+
SELECT day FROM work_item_daily UNION SELECT day FROM artifact_daily
|
|
532
|
+
UNION SELECT day FROM activity_daily UNION SELECT day FROM cost_monitor_financial_daily
|
|
533
|
+
UNION SELECT day FROM cost_monitor_daily_duration UNION SELECT day FROM cost_monitor_daily_coverage UNION SELECT day FROM run_daily
|
|
534
|
+
UNION SELECT day FROM operations_daily_duration
|
|
535
|
+
)
|
|
536
|
+
SELECT d.day,
|
|
537
|
+
COALESCE(w.prd_count, 0) AS prd_count,
|
|
538
|
+
COALESCE(w.spec_count, 0) AS spec_count,
|
|
539
|
+
COALESCE(w.task_count, 0) AS task_count,
|
|
540
|
+
COALESCE(a.validation_count, 0) AS validation_count,
|
|
541
|
+
COALESCE(a.evidence_count, 0) AS evidence_count,
|
|
542
|
+
COALESCE(i.activity_count, 0) AS activity_count,
|
|
543
|
+
COALESCE(r.root_run_count, 0) AS root_run_count,
|
|
544
|
+
COALESCE(r.sub_run_count, 0) AS sub_run_count,
|
|
545
|
+
COALESCE(r.total_run_count, 0) AS total_run_count,
|
|
546
|
+
COALESCE(i.invocation_count, 0) AS invocation_count,
|
|
547
|
+
COALESCE(f.invocation_count, 0) AS cost_monitor_invocation_count,
|
|
548
|
+
i.llm_call_count,
|
|
549
|
+
COALESCE(r.source_event_count, 0) AS source_event_count,
|
|
550
|
+
i.total_root_run_duration,
|
|
551
|
+
i.total_sub_run_duration,
|
|
552
|
+
o.total_duration AS operations_total_duration,
|
|
553
|
+
COALESCE(dcm.total_duration, o.total_duration) AS cost_monitor_total_duration,
|
|
554
|
+
coverage.eligible_runs AS cost_monitor_duration_eligible_runs,
|
|
555
|
+
coverage.known_runs AS cost_monitor_duration_known_runs,
|
|
556
|
+
o.total_duration AS total_duration,
|
|
557
|
+
f.total_tokens,
|
|
558
|
+
f.total_cost_usd,
|
|
559
|
+
f.total_cost_brl
|
|
560
|
+
FROM days d
|
|
561
|
+
LEFT JOIN work_item_daily w USING(day)
|
|
562
|
+
LEFT JOIN artifact_daily a USING(day)
|
|
563
|
+
LEFT JOIN activity_daily i USING(day)
|
|
564
|
+
LEFT JOIN cost_monitor_financial_daily f USING(day)
|
|
565
|
+
LEFT JOIN cost_monitor_daily_duration dcm USING(day)
|
|
566
|
+
LEFT JOIN cost_monitor_daily_coverage coverage USING(day)
|
|
567
|
+
LEFT JOIN run_daily r USING(day)
|
|
568
|
+
LEFT JOIN operations_daily_duration o USING(day);
|
|
569
|
+
-- SPEC/PRD rows have the same canonical population as the big
|
|
570
|
+
-- numbers. A macro without direct invocation remains visible with
|
|
571
|
+
-- factual NULL usage/cost/time, never a fabricated zero.
|
|
572
|
+
CREATE VIEW cost_monitor_group_daily_cache AS SELECT occurred_day_sp AS day, 'execution' AS group_kind, execution_id AS group_value, COUNT(*) AS invocation_count, SUM(llm_call_count) AS llm_call_count, SUM(duration_ms) AS total_duration, SUM(input_tokens) AS total_input_tokens, SUM(cached_input_tokens) AS total_cached_input_tokens, SUM(output_tokens) AS total_output_tokens, SUM(reasoning_tokens) AS total_reasoning_tokens, SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS total_cost_usd, SUM(cost_brl) AS total_cost_brl FROM invocations WHERE execution_id IS NOT NULL GROUP BY occurred_day_sp, execution_id UNION ALL SELECT occurred_day_sp, 'zaip_agent', zaip_agent, COUNT(*), SUM(llm_call_count), SUM(duration_ms), SUM(input_tokens), SUM(cached_input_tokens), SUM(output_tokens), SUM(reasoning_tokens), SUM(total_tokens), SUM(cost_usd), SUM(cost_brl) FROM invocations WHERE zaip_agent IS NOT NULL GROUP BY occurred_day_sp, zaip_agent UNION ALL SELECT occurred_day_sp, 'provider', provider, COUNT(*), SUM(llm_call_count), SUM(duration_ms), SUM(input_tokens), SUM(cached_input_tokens), SUM(output_tokens), SUM(reasoning_tokens), SUM(total_tokens), SUM(cost_usd), SUM(cost_brl) FROM invocations WHERE provider IS NOT NULL GROUP BY occurred_day_sp, provider UNION ALL SELECT occurred_day_sp, 'model', model, COUNT(*), SUM(llm_call_count), SUM(duration_ms), SUM(input_tokens), SUM(cached_input_tokens), SUM(output_tokens), SUM(reasoning_tokens), SUM(total_tokens), SUM(cost_usd), SUM(cost_brl) FROM invocations WHERE model IS NOT NULL GROUP BY occurred_day_sp, model UNION ALL SELECT occurred_day_sp, 'task', task_id, COUNT(*), SUM(llm_call_count), SUM(duration_ms), SUM(input_tokens), SUM(cached_input_tokens), SUM(output_tokens), SUM(reasoning_tokens), SUM(total_tokens), SUM(cost_usd), SUM(cost_brl) FROM invocations WHERE task_id IS NOT NULL GROUP BY occurred_day_sp, task_id UNION ALL SELECT occurred_day_sp, 'spec', spec_id, COUNT(*), SUM(llm_call_count), SUM(duration_ms), SUM(input_tokens), SUM(cached_input_tokens), SUM(output_tokens), SUM(reasoning_tokens), SUM(total_tokens), SUM(cost_usd), SUM(cost_brl) FROM invocations WHERE spec_id IS NOT NULL GROUP BY occurred_day_sp, spec_id UNION ALL SELECT occurred_day_sp, 'prd', prd_id, COUNT(*), SUM(llm_call_count), SUM(duration_ms), SUM(input_tokens), SUM(cached_input_tokens), SUM(output_tokens), SUM(reasoning_tokens), SUM(total_tokens), SUM(cost_usd), SUM(cost_brl) FROM invocations WHERE prd_id IS NOT NULL GROUP BY occurred_day_sp, prd_id UNION ALL SELECT occurred_day_sp, 'conversation', conversation_id, COUNT(*), SUM(llm_call_count), SUM(duration_ms), SUM(input_tokens), SUM(cached_input_tokens), SUM(output_tokens), SUM(reasoning_tokens), SUM(total_tokens), SUM(cost_usd), SUM(cost_brl) FROM invocations WHERE conversation_id IS NOT NULL GROUP BY occurred_day_sp, conversation_id;
|
|
573
|
+
CREATE VIEW daily_aggregates AS SELECT * FROM daily_aggregate_cache;
|
|
574
|
+
CREATE VIEW overview AS
|
|
575
|
+
SELECT 'day' AS period_kind, day AS period_key, day AS start_day, day AS end_day, prd_count, spec_count, task_count, validation_count, evidence_count, activity_count, root_run_count, sub_run_count, total_run_count, invocation_count, cost_monitor_invocation_count, llm_call_count, source_event_count, total_root_run_duration, total_sub_run_duration, operations_total_duration, cost_monitor_total_duration, total_duration, total_tokens, total_cost_usd, total_cost_brl FROM daily_aggregates
|
|
576
|
+
UNION ALL
|
|
577
|
+
SELECT 'month', substr(day, 1, 7), MIN(day), MAX(day), SUM(prd_count), SUM(spec_count), SUM(task_count), SUM(validation_count), SUM(evidence_count), SUM(activity_count), SUM(root_run_count), SUM(sub_run_count), SUM(total_run_count), SUM(invocation_count), SUM(cost_monitor_invocation_count), SUM(llm_call_count), SUM(source_event_count), SUM(total_root_run_duration), SUM(total_sub_run_duration), SUM(operations_total_duration), SUM(cost_monitor_total_duration), SUM(total_duration), SUM(total_tokens), SUM(total_cost_usd), SUM(total_cost_brl) FROM daily_aggregates GROUP BY substr(day, 1, 7)
|
|
578
|
+
UNION ALL
|
|
579
|
+
SELECT 'year', substr(day, 1, 4), MIN(day), MAX(day), SUM(prd_count), SUM(spec_count), SUM(task_count), SUM(validation_count), SUM(evidence_count), SUM(activity_count), SUM(root_run_count), SUM(sub_run_count), SUM(total_run_count), SUM(invocation_count), SUM(cost_monitor_invocation_count), SUM(llm_call_count), SUM(source_event_count), SUM(total_root_run_duration), SUM(total_sub_run_duration), SUM(operations_total_duration), SUM(cost_monitor_total_duration), SUM(total_duration), SUM(total_tokens), SUM(total_cost_usd), SUM(total_cost_brl) FROM daily_aggregates GROUP BY substr(day, 1, 4);
|
|
580
|
+
CREATE VIEW overview_daily AS SELECT * FROM overview WHERE period_kind = 'day';
|
|
581
|
+
CREATE VIEW overview_monthly AS SELECT * FROM overview WHERE period_kind = 'month';
|
|
582
|
+
CREATE VIEW overview_annual AS SELECT * FROM overview WHERE period_kind = 'year';
|
|
583
|
+
CREATE VIEW operations_overview AS SELECT period_kind, period_key, start_day, end_day, prd_count, spec_count, task_count, validation_count, evidence_count, total_run_count, invocation_count, llm_call_count, operations_total_duration, total_tokens, total_cost_usd, total_cost_brl FROM overview;
|
|
584
|
+
-- Cost Monitor deliberately projects its measurable invocation
|
|
585
|
+
-- population rather than Operations' broader Run/activity totals.
|
|
586
|
+
CREATE VIEW cost_monitor_overview AS SELECT period_kind, period_key, cost_monitor_invocation_count AS total_run_count, cost_monitor_invocation_count AS invocation_count, llm_call_count, source_event_count, cost_monitor_total_duration, total_tokens, total_cost_usd, total_cost_brl FROM overview;
|
|
587
|
+
CREATE VIEW task_summary AS SELECT t.id, t.title, t.status, t.risk, t.occurred_at, t.occurred_day_sp, COUNT(i.run_id) AS invocation_count, SUM(i.llm_call_count) AS llm_call_count, SUM(i.duration_ms) AS total_duration, SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd, SUM(i.cost_brl) AS total_cost_brl FROM tasks t LEFT JOIN activities i ON i.task_id = t.id GROUP BY t.id, t.title, t.status, t.risk, t.occurred_at, t.occurred_day_sp;
|
|
588
|
+
CREATE VIEW spec_summary AS SELECT s.id, s.title, s.status, s.risk, s.occurred_at, s.occurred_day_sp, COUNT(i.run_id) AS invocation_count, SUM(i.llm_call_count) AS llm_call_count, SUM(i.duration_ms) AS total_duration, SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd, SUM(i.cost_brl) AS total_cost_brl FROM specs s LEFT JOIN activities i ON i.spec_id = s.id GROUP BY s.id, s.title, s.status, s.risk, s.occurred_at, s.occurred_day_sp;
|
|
589
|
+
CREATE VIEW prd_summary AS SELECT p.id, p.title, p.status, p.risk, p.occurred_at, p.occurred_day_sp, COUNT(i.run_id) AS invocation_count, SUM(i.llm_call_count) AS llm_call_count, SUM(i.duration_ms) AS total_duration, SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd, SUM(i.cost_brl) AS total_cost_brl FROM prds p LEFT JOIN activities i ON i.prd_id = p.id GROUP BY p.id, p.title, p.status, p.risk, p.occurred_at, p.occurred_day_sp;
|
|
590
|
+
CREATE VIEW cost_monitor_group_daily AS SELECT * FROM cost_monitor_group_daily_cache;
|
|
591
|
+
CREATE VIEW vw_overview AS SELECT * FROM overview;
|
|
592
|
+
CREATE VIEW vw_overview_daily AS SELECT * FROM overview WHERE period_kind = 'day';
|
|
593
|
+
CREATE VIEW vw_overview_monthly AS SELECT * FROM overview WHERE period_kind = 'month';
|
|
594
|
+
CREATE VIEW vw_overview_annual AS SELECT * FROM overview WHERE period_kind = 'year';
|
|
595
|
+
CREATE VIEW vw_task_summary AS SELECT * FROM task_summary;
|
|
596
|
+
CREATE VIEW vw_spec_summary AS SELECT * FROM spec_summary;
|
|
597
|
+
CREATE VIEW vw_prd_summary AS SELECT * FROM prd_summary;
|
|
598
|
+
CREATE VIEW vw_task_summary_daily AS SELECT occurred_day_sp AS day, COUNT(*) AS task_count, SUM(llm_call_count) AS llm_call_count FROM task_summary GROUP BY occurred_day_sp;
|
|
599
|
+
CREATE VIEW vw_spec_summary_daily AS SELECT occurred_day_sp AS day, COUNT(*) AS spec_count, SUM(llm_call_count) AS llm_call_count FROM spec_summary GROUP BY occurred_day_sp;
|
|
600
|
+
CREATE VIEW vw_prd_summary_daily AS SELECT occurred_day_sp AS day, COUNT(*) AS prd_count, SUM(llm_call_count) AS llm_call_count FROM prd_summary GROUP BY occurred_day_sp;
|
|
601
|
+
CREATE VIEW vw_task_status_daily AS SELECT occurred_day_sp AS day, status, COUNT(*) AS task_count FROM task_summary GROUP BY occurred_day_sp, status;
|
|
602
|
+
CREATE VIEW vw_task_risk_daily AS SELECT occurred_day_sp AS day, risk, COUNT(*) AS task_count FROM task_summary GROUP BY occurred_day_sp, risk;
|
|
603
|
+
CREATE VIEW vw_entities AS SELECT 'task' AS entity_kind, id, title, status, risk, occurred_at, occurred_day_sp FROM task_summary UNION ALL SELECT 'spec', id, title, status, risk, occurred_at, occurred_day_sp FROM spec_summary UNION ALL SELECT 'prd', id, title, status, risk, occurred_at, occurred_day_sp FROM prd_summary;
|
|
604
|
+
CREATE VIEW vw_cost_group_daily AS SELECT * FROM cost_monitor_group_daily_cache;
|
|
605
|
+
-- Narrow temporal Cost surfaces. Do not route the visible Cost
|
|
606
|
+
-- tables through the three-grain overview union: it expands every
|
|
607
|
+
-- daily interval pipeline twice and prevents the outer from/to filter
|
|
608
|
+
-- from remaining a simple period predicate. These views expose only
|
|
609
|
+
-- the columns consumed by Daily, Monthly and Annual.
|
|
610
|
+
CREATE VIEW vw_cost_daily AS
|
|
611
|
+
SELECT day AS period_key, day AS start_day, day AS end_day,
|
|
612
|
+
cost_monitor_invocation_count AS total_run_count,
|
|
613
|
+
cost_monitor_invocation_count AS invocation_count,
|
|
614
|
+
llm_call_count, source_event_count,
|
|
615
|
+
cost_monitor_total_duration AS total_duration,
|
|
616
|
+
total_tokens, total_cost_usd, total_cost_brl
|
|
617
|
+
FROM daily_aggregate_cache;
|
|
618
|
+
CREATE VIEW vw_cost_monthly AS
|
|
619
|
+
SELECT substr(day, 1, 7) AS period_key, MIN(day) AS start_day, MAX(day) AS end_day,
|
|
620
|
+
SUM(cost_monitor_invocation_count) AS total_run_count,
|
|
621
|
+
SUM(cost_monitor_invocation_count) AS invocation_count,
|
|
622
|
+
SUM(llm_call_count) AS llm_call_count, SUM(source_event_count) AS source_event_count,
|
|
623
|
+
SUM(cost_monitor_total_duration) AS total_duration,
|
|
624
|
+
SUM(total_tokens) AS total_tokens, SUM(total_cost_usd) AS total_cost_usd, SUM(total_cost_brl) AS total_cost_brl
|
|
625
|
+
FROM daily_aggregate_cache GROUP BY substr(day, 1, 7);
|
|
626
|
+
CREATE VIEW vw_cost_annual AS
|
|
627
|
+
SELECT substr(day, 1, 4) AS period_key, MIN(day) AS start_day, MAX(day) AS end_day,
|
|
628
|
+
SUM(cost_monitor_invocation_count) AS total_run_count,
|
|
629
|
+
SUM(cost_monitor_invocation_count) AS invocation_count,
|
|
630
|
+
SUM(llm_call_count) AS llm_call_count, SUM(source_event_count) AS source_event_count,
|
|
631
|
+
SUM(cost_monitor_total_duration) AS total_duration,
|
|
632
|
+
SUM(total_tokens) AS total_tokens, SUM(total_cost_usd) AS total_cost_usd, SUM(total_cost_brl) AS total_cost_brl
|
|
633
|
+
FROM daily_aggregate_cache GROUP BY substr(day, 1, 4);
|
|
634
|
+
CREATE VIEW vw_cost_overview AS
|
|
635
|
+
-- MATERIALIZED keeps the expensive factual daily interval pipeline
|
|
636
|
+
-- to one evaluation for this three-grain overview response.
|
|
637
|
+
WITH daily AS MATERIALIZED (
|
|
638
|
+
SELECT day, cost_monitor_invocation_count, llm_call_count,
|
|
639
|
+
source_event_count, cost_monitor_total_duration,
|
|
640
|
+
cost_monitor_duration_eligible_runs, cost_monitor_duration_known_runs,
|
|
641
|
+
total_tokens, total_cost_usd, total_cost_brl
|
|
642
|
+
FROM daily_aggregate_cache
|
|
643
|
+
)
|
|
644
|
+
SELECT 'day' AS period_kind, day AS period_key,
|
|
645
|
+
cost_monitor_invocation_count AS total_run_count,
|
|
646
|
+
cost_monitor_invocation_count AS invocation_count,
|
|
647
|
+
llm_call_count, source_event_count,
|
|
648
|
+
cost_monitor_total_duration AS cost_monitor_total_duration,
|
|
649
|
+
total_tokens, total_cost_usd, total_cost_brl, day AS start_day, day AS end_day,
|
|
650
|
+
cost_monitor_total_duration AS total_duration
|
|
651
|
+
FROM daily
|
|
652
|
+
UNION ALL
|
|
653
|
+
SELECT 'month', substr(day, 1, 7), SUM(cost_monitor_invocation_count), SUM(cost_monitor_invocation_count),
|
|
654
|
+
SUM(llm_call_count), SUM(source_event_count),
|
|
655
|
+
SUM(cost_monitor_total_duration),
|
|
656
|
+
SUM(total_tokens), SUM(total_cost_usd), SUM(total_cost_brl), MIN(day), MAX(day),
|
|
657
|
+
SUM(cost_monitor_total_duration)
|
|
658
|
+
FROM daily GROUP BY substr(day, 1, 7)
|
|
659
|
+
UNION ALL
|
|
660
|
+
SELECT 'year', substr(day, 1, 4), SUM(cost_monitor_invocation_count), SUM(cost_monitor_invocation_count),
|
|
661
|
+
SUM(llm_call_count), SUM(source_event_count),
|
|
662
|
+
SUM(cost_monitor_total_duration),
|
|
663
|
+
SUM(total_tokens), SUM(total_cost_usd), SUM(total_cost_brl), MIN(day), MAX(day),
|
|
664
|
+
SUM(cost_monitor_total_duration)
|
|
665
|
+
FROM daily GROUP BY substr(day, 1, 4);
|
|
666
|
+
CREATE VIEW vw_cost_executions AS SELECT i.execution_id, i.execution_id AS title, e.status, NULL AS risk, MIN(i.occurred_at) AS occurred_at, MIN(i.occurred_day_sp) AS occurred_day_sp, SUM(i.llm_call_count) AS llm_call_count, SUM(i.duration_ms) AS total_duration, SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd, SUM(i.cost_brl) AS total_cost_brl, COUNT(*) AS invocation_count FROM invocations i LEFT JOIN executions e ON e.id = i.execution_id WHERE i.execution_id IS NOT NULL GROUP BY i.execution_id, e.status;
|
|
667
|
+
CREATE VIEW vw_cost_agent_invocations AS
|
|
668
|
+
SELECT i.*,
|
|
669
|
+
COUNT(u.usage_index) AS pricing_segment_count,
|
|
670
|
+
CASE WHEN COUNT(DISTINCT COALESCE(u.provider, '') || '|' || COALESCE(u.model, '') || '|' || COALESCE(u.service_tier, 'default') || '|' || COALESCE(CAST(u.context_input_multiplier AS TEXT), '') || '|' || COALESCE(CAST(u.context_output_multiplier AS TEXT), '')) > 1 THEN 1 ELSE 0 END AS pricing_mixed,
|
|
671
|
+
SUM(u.uncached_input_tokens) AS uncached_input_tokens,
|
|
672
|
+
SUM(u.visible_output_tokens) AS visible_output_tokens,
|
|
673
|
+
CASE COUNT(DISTINCT u.input_rate_usd_per_million) WHEN 1 THEN MIN(u.input_rate_usd_per_million) ELSE NULL END AS input_rate_usd_per_million,
|
|
674
|
+
CASE COUNT(DISTINCT u.cached_input_rate_usd_per_million) WHEN 1 THEN MIN(u.cached_input_rate_usd_per_million) ELSE NULL END AS cached_input_rate_usd_per_million,
|
|
675
|
+
CASE COUNT(DISTINCT u.output_rate_usd_per_million) WHEN 1 THEN MIN(u.output_rate_usd_per_million) ELSE NULL END AS output_rate_usd_per_million,
|
|
676
|
+
CASE COUNT(DISTINCT u.reasoning_rate_usd_per_million) WHEN 1 THEN MIN(u.reasoning_rate_usd_per_million) ELSE NULL END AS reasoning_rate_usd_per_million,
|
|
677
|
+
CASE COUNT(DISTINCT u.context_input_multiplier) WHEN 1 THEN MIN(u.context_input_multiplier) ELSE NULL END AS context_input_multiplier,
|
|
678
|
+
CASE COUNT(DISTINCT u.context_output_multiplier) WHEN 1 THEN MIN(u.context_output_multiplier) ELSE NULL END AS context_output_multiplier,
|
|
679
|
+
CASE COUNT(DISTINCT u.speed_cost_multiplier) WHEN 1 THEN MIN(u.speed_cost_multiplier) ELSE NULL END AS speed_cost_multiplier,
|
|
680
|
+
CASE COUNT(DISTINCT u.pricing_scenario) WHEN 1 THEN MIN(u.pricing_scenario) ELSE 'mixed' END AS pricing_scenario,
|
|
681
|
+
SUM(u.standard_cost_usd) AS standard_cost_usd,
|
|
682
|
+
SUM(u.speed_uplift_usd) AS speed_uplift_usd,
|
|
683
|
+
SUM(u.input_cost_usd) AS input_cost_usd,
|
|
684
|
+
SUM(u.cached_input_cost_usd) AS cached_input_cost_usd,
|
|
685
|
+
SUM(u.output_cost_usd) AS output_cost_usd,
|
|
686
|
+
SUM(u.reasoning_cost_usd) AS reasoning_cost_usd,
|
|
687
|
+
SUM(u.calculated_cost_usd) AS calculated_cost_usd,
|
|
688
|
+
SUM(u.recorded_cost_usd) AS recorded_cost_usd,
|
|
689
|
+
CASE COUNT(DISTINCT CASE WHEN u.recorded_cost_usd IS NOT NULL THEN u.fx_rate END)
|
|
690
|
+
WHEN 1 THEN MIN(CASE WHEN u.recorded_cost_usd IS NOT NULL THEN u.fx_rate END)
|
|
691
|
+
ELSE NULL
|
|
692
|
+
END AS recorded_fx_rate,
|
|
693
|
+
SUM(CASE WHEN u.recorded_cost_usd IS NOT NULL THEN u.cost_brl END) AS recorded_brl,
|
|
694
|
+
(SELECT json_extract(fx.content, '$.rate')
|
|
695
|
+
FROM files fx
|
|
696
|
+
WHERE fx.path LIKE '.agents/config/pricing/fx/%.json'
|
|
697
|
+
ORDER BY CASE WHEN fx.path LIKE '%/current-usd-brl.json' THEN 0 ELSE 1 END,
|
|
698
|
+
json_extract(fx.content, '$.as_of') DESC
|
|
699
|
+
LIMIT 1) AS current_fx_rate,
|
|
700
|
+
SUM(u.cost_variance_usd) AS cost_variance_usd,
|
|
701
|
+
CASE COUNT(DISTINCT u.pricing_model) WHEN 1 THEN MIN(u.pricing_model) ELSE NULL END AS audit_pricing_model,
|
|
702
|
+
CASE COUNT(DISTINCT u.pricing_source) WHEN 1 THEN MIN(u.pricing_source) ELSE NULL END AS audit_pricing_source
|
|
703
|
+
FROM invocations i LEFT JOIN invocation_usage u USING(agent_invocation_id)
|
|
704
|
+
GROUP BY i.agent_invocation_id;
|
|
705
|
+
CREATE VIEW vw_cost_zaip_agents AS SELECT zaip_agent, SUM(llm_call_count) AS llm_call_count, SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl, COUNT(*) AS invocation_count FROM invocations GROUP BY zaip_agent;
|
|
706
|
+
CREATE VIEW vw_cost_models AS WITH usage AS (SELECT model, agent_invocation_id, SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl FROM invocation_usage GROUP BY model, agent_invocation_id), calls AS (SELECT i.agent_invocation_id, CASE WHEN (SELECT COUNT(DISTINCT m.model) FROM invocation_usage m WHERE m.agent_invocation_id = i.agent_invocation_id AND m.model IS NOT NULL) = 1 THEN i.llm_call_count END AS llm_call_count FROM invocations i) SELECT u.model, SUM(c.llm_call_count) AS llm_call_count, SUM(u.total_tokens) AS total_tokens, SUM(u.cost_usd) AS cost_usd, SUM(u.cost_brl) AS cost_brl, COUNT(*) AS invocation_count FROM usage u JOIN calls c USING(agent_invocation_id) GROUP BY u.model;
|
|
707
|
+
CREATE VIEW vw_cost_providers AS WITH usage AS (SELECT provider, agent_invocation_id, SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl FROM invocation_usage GROUP BY provider, agent_invocation_id), calls AS (SELECT i.agent_invocation_id, CASE WHEN (SELECT COUNT(DISTINCT p.provider) FROM invocation_usage p WHERE p.agent_invocation_id = i.agent_invocation_id AND p.provider IS NOT NULL) = 1 THEN i.llm_call_count END AS llm_call_count FROM invocations i) SELECT u.provider, SUM(c.llm_call_count) AS llm_call_count, SUM(u.total_tokens) AS total_tokens, SUM(u.cost_usd) AS cost_usd, SUM(u.cost_brl) AS cost_brl, COUNT(*) AS invocation_count FROM usage u JOIN calls c USING(agent_invocation_id) GROUP BY u.provider;
|
|
708
|
+
CREATE VIEW vw_cost_tasks AS SELECT i.task_id, COALESCE(MAX(t.title), i.task_id) AS title, MAX(t.status) AS status, MAX(t.risk) AS risk, MIN(i.occurred_at) AS occurred_at, MIN(i.occurred_day_sp) AS occurred_day_sp, SUM(i.llm_call_count) AS llm_call_count, SUM(i.duration_ms) AS total_duration, SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd, SUM(i.cost_brl) AS total_cost_brl, COUNT(*) AS invocation_count FROM invocations i LEFT JOIN tasks t ON t.id = i.task_id WHERE i.task_id IS NOT NULL GROUP BY i.task_id;
|
|
709
|
+
CREATE VIEW vw_cost_specs AS SELECT s.id AS spec_id, s.title, s.status, s.risk, COALESCE(MIN(i.occurred_at), s.occurred_at) AS occurred_at, COALESCE(MIN(i.occurred_day_sp), s.occurred_day_sp) AS occurred_day_sp, SUM(i.llm_call_count) AS llm_call_count, SUM(i.duration_ms) AS total_duration, SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd, SUM(i.cost_brl) AS total_cost_brl, COUNT(i.agent_invocation_id) AS invocation_count FROM specs s LEFT JOIN invocations i ON i.spec_id = s.id GROUP BY s.id, s.title, s.status, s.risk, s.occurred_at, s.occurred_day_sp;
|
|
710
|
+
CREATE VIEW vw_cost_prds AS SELECT p.id AS prd_id, p.title, p.status, p.risk, COALESCE(MIN(i.occurred_at), p.occurred_at) AS occurred_at, COALESCE(MIN(i.occurred_day_sp), p.occurred_day_sp) AS occurred_day_sp, SUM(i.llm_call_count) AS llm_call_count, SUM(i.duration_ms) AS total_duration, SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd, SUM(i.cost_brl) AS total_cost_brl, COUNT(i.agent_invocation_id) AS invocation_count FROM prds p LEFT JOIN invocations i ON i.prd_id = p.id GROUP BY p.id, p.title, p.status, p.risk, p.occurred_at, p.occurred_day_sp;
|
|
711
|
+
CREATE VIEW vw_cost_conversations AS SELECT i.conversation_id, i.conversation_id AS title, MAX(c.status) AS status, NULL AS risk, MIN(i.occurred_at) AS occurred_at, MIN(i.occurred_day_sp) AS occurred_day_sp, SUM(i.llm_call_count) AS llm_call_count, SUM(i.duration_ms) AS total_duration, SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd, SUM(i.cost_brl) AS total_cost_brl, COUNT(*) AS invocation_count FROM invocations i LEFT JOIN conversations c ON c.id = i.conversation_id WHERE i.conversation_id IS NOT NULL GROUP BY i.conversation_id;
|
|
712
|
+
CREATE VIEW vw_operations_work_list AS SELECT * FROM vw_entities;
|
|
713
|
+
-- Full work summary retains historical activity coverage for internal
|
|
714
|
+
-- entity summaries. It is not the Kanban population.
|
|
715
|
+
CREATE VIEW vw_operations_work_summary AS
|
|
716
|
+
WITH task_lineage AS (
|
|
717
|
+
SELECT DISTINCT
|
|
718
|
+
CAST(task.value AS TEXT) AS task_id,
|
|
719
|
+
COALESCE(c.source_spec_id, CASE WHEN c.source_type='spec' THEN c.source_id END) AS spec_id,
|
|
720
|
+
COALESCE(c.source_prd_id, CASE WHEN c.source_type='prd' THEN c.source_id END) AS prd_id
|
|
721
|
+
FROM canonical_changes c, json_each(c.task_ids_json) AS task
|
|
722
|
+
), lineage_cardinality AS (
|
|
723
|
+
-- Parent creation Runs are not observed Task Runs. They can be
|
|
724
|
+
-- displayed on a child only when exactly one canonical Task owns
|
|
725
|
+
-- that lineage, preventing a shared macro total from being copied
|
|
726
|
+
-- into sibling cards.
|
|
727
|
+
SELECT spec_id, prd_id, COUNT(*) AS task_count
|
|
728
|
+
FROM task_lineage
|
|
729
|
+
GROUP BY spec_id, prd_id
|
|
730
|
+
), entity_activity AS (
|
|
731
|
+
SELECT 'task' AS entity_kind, task_id AS entity_id, * FROM activities WHERE task_id IS NOT NULL
|
|
732
|
+
UNION ALL SELECT 'spec', spec_id, * FROM activities WHERE spec_id IS NOT NULL
|
|
733
|
+
UNION ALL SELECT 'prd', prd_id, * FROM activities WHERE prd_id IS NOT NULL
|
|
734
|
+
UNION ALL
|
|
735
|
+
SELECT 'task', l.task_id, a.*
|
|
736
|
+
FROM task_lineage l
|
|
737
|
+
JOIN lineage_cardinality cardinality
|
|
738
|
+
ON cardinality.spec_id IS l.spec_id AND cardinality.prd_id IS l.prd_id
|
|
739
|
+
JOIN activities a
|
|
740
|
+
ON a.task_id IS NULL
|
|
741
|
+
AND (
|
|
742
|
+
(l.spec_id IS NOT NULL AND a.spec_id = l.spec_id)
|
|
743
|
+
OR (
|
|
744
|
+
l.spec_id IS NULL
|
|
745
|
+
AND l.prd_id IS NOT NULL
|
|
746
|
+
AND a.spec_id IS NULL
|
|
747
|
+
AND a.prd_id = l.prd_id
|
|
748
|
+
)
|
|
749
|
+
)
|
|
750
|
+
WHERE cardinality.task_count = 1
|
|
751
|
+
AND NOT EXISTS (SELECT 1 FROM activities direct WHERE direct.task_id = l.task_id)
|
|
752
|
+
), financial AS (
|
|
753
|
+
SELECT entity_kind, entity_id,
|
|
754
|
+
COUNT(*) AS invocation_count,
|
|
755
|
+
SUM(llm_call_count) AS llm_call_count,
|
|
756
|
+
SUM(total_tokens) AS total_tokens,
|
|
757
|
+
SUM(cost_usd) AS total_cost_usd,
|
|
758
|
+
SUM(cost_brl) AS total_cost_brl
|
|
759
|
+
FROM entity_activity GROUP BY entity_kind, entity_id
|
|
760
|
+
), durations AS (
|
|
761
|
+
SELECT entity_kind, entity_id, ROUND(SUM(duration_ms)) AS total_duration
|
|
762
|
+
FROM entity_activity GROUP BY entity_kind, entity_id
|
|
763
|
+
)
|
|
764
|
+
SELECT w.entity_kind, w.id, w.title, w.status, w.risk, w.occurred_at, w.occurred_day_sp,
|
|
765
|
+
f.invocation_count, f.llm_call_count, d.total_duration,
|
|
766
|
+
f.total_tokens, f.total_cost_usd, f.total_cost_brl
|
|
767
|
+
FROM work_items w
|
|
768
|
+
LEFT JOIN financial f ON f.entity_kind=w.entity_kind AND f.entity_id=w.id
|
|
769
|
+
LEFT JOIN durations d ON d.entity_kind=w.entity_kind AND d.entity_id=w.id;
|
|
770
|
+
-- Kanban is a lifecycle surface: it lists only canonical records.
|
|
771
|
+
-- Telemetry-only identifiers remain Cost Monitor facts but cannot
|
|
772
|
+
-- create a synthetic operational card.
|
|
773
|
+
CREATE VIEW vw_operations_work_kanban AS
|
|
774
|
+
SELECT summary.*
|
|
775
|
+
FROM canonical_work_items canonical
|
|
776
|
+
JOIN vw_operations_work_summary summary
|
|
777
|
+
ON summary.entity_kind=canonical.entity_kind AND summary.id=canonical.id;
|
|
778
|
+
CREATE VIEW vw_operations_executions AS
|
|
779
|
+
WITH metrics AS (
|
|
780
|
+
SELECT i.execution_id,
|
|
781
|
+
CASE COUNT(DISTINCT t.risk) WHEN 0 THEN NULL WHEN 1 THEN MIN(t.risk) ELSE 'mixed' END AS risk,
|
|
782
|
+
MIN(i.occurred_at) AS telemetry_started_at,
|
|
783
|
+
SUM(i.llm_call_count) AS llm_call_count,
|
|
784
|
+
SUM(i.duration_ms) AS duration_ms,
|
|
785
|
+
CASE WHEN COUNT(i.duration_ms) > 0 THEN 'observed' ELSE 'unavailable' END AS duration_provenance,
|
|
786
|
+
SUM(i.total_tokens) AS total_tokens,
|
|
787
|
+
SUM(i.cost_brl) AS total_cost_brl,
|
|
788
|
+
COUNT(*) AS invocation_count
|
|
789
|
+
FROM invocations i LEFT JOIN tasks t ON t.id=i.task_id
|
|
790
|
+
WHERE i.execution_id IS NOT NULL GROUP BY i.execution_id
|
|
791
|
+
)
|
|
792
|
+
SELECT c.id AS execution_id, c.status, m.risk,
|
|
793
|
+
c.created_at AS started_at, c.finished_at,
|
|
794
|
+
c.kind AS execution_kind, c.origin_type,
|
|
795
|
+
CASE WHEN c.origin_type='task' THEN c.origin_id END AS task_id,
|
|
796
|
+
CASE WHEN c.origin_type='interaction' THEN c.origin_id END AS conversation_id,
|
|
797
|
+
m.llm_call_count, m.duration_ms, COALESCE(m.duration_provenance, 'unavailable') AS duration_provenance,
|
|
798
|
+
CASE WHEN c.status IN ('completed', 'failed', 'cancelled') AND c.finished_at IS NOT NULL THEN MAX(0, CAST((julianday(c.finished_at) - julianday(c.created_at)) * 86400000 AS INTEGER)) ELSE NULL END AS lifecycle_elapsed_ms,
|
|
799
|
+
m.total_tokens, m.total_cost_brl,
|
|
800
|
+
COALESCE(m.invocation_count, 0) AS invocation_count,
|
|
801
|
+
c.source_path
|
|
802
|
+
FROM canonical_executions c LEFT JOIN metrics m ON m.execution_id=c.id
|
|
803
|
+
UNION ALL
|
|
804
|
+
SELECT i.execution_id, MAX(i.status),
|
|
805
|
+
CASE COUNT(DISTINCT t.risk) WHEN 0 THEN NULL WHEN 1 THEN MIN(t.risk) ELSE 'mixed' END,
|
|
806
|
+
MIN(i.occurred_at), MAX(i.occurred_at), NULL, NULL, MAX(i.task_id), MAX(i.conversation_id),
|
|
807
|
+
SUM(i.llm_call_count), SUM(i.duration_ms), CASE WHEN COUNT(i.duration_ms) > 0 THEN 'observed' ELSE 'unavailable' END, NULL, SUM(i.total_tokens), SUM(i.cost_brl), COUNT(*), NULL
|
|
808
|
+
FROM invocations i LEFT JOIN tasks t ON t.id=i.task_id
|
|
809
|
+
WHERE i.execution_id IS NOT NULL
|
|
810
|
+
AND NOT EXISTS (SELECT 1 FROM canonical_executions c WHERE c.id=i.execution_id)
|
|
811
|
+
GROUP BY i.execution_id;
|
|
812
|
+
CREATE VIEW vw_operations_agent_invocations AS
|
|
813
|
+
SELECT c.*,
|
|
814
|
+
date(COALESCE(c.source_started_at, c.source_occurred_at, c.occurred_at), '-3 hours') AS source_day_sp,
|
|
815
|
+
t.risk
|
|
816
|
+
FROM vw_cost_agent_invocations c LEFT JOIN tasks t ON t.id=c.task_id;
|
|
817
|
+
CREATE VIEW vw_operations_conversations AS
|
|
818
|
+
SELECT i.conversation_id, c.status,
|
|
819
|
+
CASE COUNT(DISTINCT t.risk) WHEN 0 THEN NULL WHEN 1 THEN MIN(t.risk) ELSE 'mixed' END AS risk,
|
|
820
|
+
MIN(i.occurred_at) AS started_at, MAX(i.occurred_at) AS finished_at,
|
|
821
|
+
SUM(i.llm_call_count) AS llm_call_count, SUM(i.duration_ms) AS total_duration,
|
|
822
|
+
CASE WHEN COUNT(i.duration_ms) > 0 THEN 'observed' ELSE 'unavailable' END AS duration_provenance,
|
|
823
|
+
SUM(i.total_tokens) AS total_tokens, SUM(i.cost_brl) AS total_cost_brl,
|
|
824
|
+
GROUP_CONCAT(DISTINCT CASE WHEN i.model IS NULL OR trim(i.model) = '' OR lower(i.model) = 'unknown' THEN NULL ELSE i.model END) AS model,
|
|
825
|
+
GROUP_CONCAT(DISTINCT CASE WHEN i.reasoning_effort IS NULL OR trim(i.reasoning_effort) = '' OR lower(i.reasoning_effort) = 'unknown' THEN NULL ELSE i.reasoning_effort END) AS reasoning_effort,
|
|
826
|
+
COUNT(*) AS invocation_count
|
|
827
|
+
FROM invocations i LEFT JOIN conversations c ON c.id=i.conversation_id LEFT JOIN tasks t ON t.id=i.task_id
|
|
828
|
+
WHERE i.conversation_id IS NOT NULL GROUP BY i.conversation_id, c.status
|
|
829
|
+
UNION ALL
|
|
830
|
+
SELECT c.id, c.status, NULL, c.occurred_at, NULL, NULL, NULL, 'unavailable', NULL, NULL, NULL, NULL, 0
|
|
831
|
+
FROM conversations c
|
|
832
|
+
WHERE NOT EXISTS (SELECT 1 FROM invocations i WHERE i.conversation_id=c.id);
|
|
833
|
+
CREATE VIEW vw_operations_decisions AS SELECT * FROM decisions;
|
|
834
|
+
CREATE VIEW vw_operations_changes AS SELECT * FROM changes;
|
|
835
|
+
CREATE VIEW vw_operations_daily AS SELECT period_key AS day, * FROM operations_overview WHERE period_kind = 'day';
|
|
836
|
+
CREATE VIEW vw_operations_monthly AS SELECT * FROM operations_overview WHERE period_kind = 'month';
|
|
837
|
+
CREATE VIEW vw_operations_annual AS SELECT * FROM operations_overview WHERE period_kind = 'year';
|
|
838
|
+
CREATE VIEW vw_first_fold_overview AS SELECT * FROM vw_overview_daily;
|
|
839
|
+
CREATE VIEW vw_first_fold_task_status AS SELECT * FROM vw_task_status_daily;
|
|
840
|
+
CREATE VIEW vw_first_fold_task_risk AS SELECT * FROM vw_task_risk_daily;
|
|
841
|
+
CREATE VIEW vw_first_fold_top_tasks AS SELECT t.*, c.total_duration, c.total_tokens, c.total_cost_usd, c.total_cost_brl FROM task_summary t LEFT JOIN (SELECT task_id, SUM(llm_call_count) AS llm_call_count, SUM(duration_ms) AS total_duration, SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS total_cost_usd, SUM(cost_brl) AS total_cost_brl FROM invocations GROUP BY task_id) c ON c.task_id = t.id ORDER BY c.total_duration DESC;
|
|
842
|
+
CREATE VIEW vw_first_fold_overview_all_time AS
|
|
843
|
+
WITH totals AS (
|
|
844
|
+
SELECT MIN(day) AS start_day, MAX(day) AS end_day,
|
|
845
|
+
SUM(total_run_count) AS total_run_count,
|
|
846
|
+
SUM(invocation_count) AS agent_invocation_count,
|
|
847
|
+
SUM(llm_call_count) AS llm_call_count,
|
|
848
|
+
ROUND(SUM(total_duration)) AS total_duration_ms,
|
|
849
|
+
SUM(total_tokens) AS total_tokens,
|
|
850
|
+
SUM(total_cost_usd) AS total_cost_usd,
|
|
851
|
+
SUM(total_cost_brl) AS total_cost_brl,
|
|
852
|
+
SUM(CASE WHEN total_duration IS NOT NULL THEN 1 ELSE 0 END) AS execution_day_count
|
|
853
|
+
FROM daily_aggregates
|
|
854
|
+
), task_totals AS (
|
|
855
|
+
SELECT COUNT(*) AS task_count,
|
|
856
|
+
SUM(CASE WHEN status='completed' THEN 1 ELSE 0 END) AS completed_task_count,
|
|
857
|
+
MAX(occurred_at) AS latest_task_created_at
|
|
858
|
+
FROM task_summary
|
|
859
|
+
), spec_totals AS (
|
|
860
|
+
SELECT COUNT(*) AS spec_count,
|
|
861
|
+
SUM(CASE WHEN status IN ('completed','delivered') THEN 1 ELSE 0 END) AS completed_spec_count
|
|
862
|
+
FROM spec_summary
|
|
863
|
+
), prd_totals AS (
|
|
864
|
+
SELECT COUNT(*) AS prd_count,
|
|
865
|
+
SUM(CASE WHEN status IN ('completed','delivered') THEN 1 ELSE 0 END) AS completed_prd_count
|
|
866
|
+
FROM prd_summary
|
|
867
|
+
)
|
|
868
|
+
SELECT 'all' AS period_key, totals.start_day, totals.end_day,
|
|
869
|
+
task_totals.task_count, task_totals.completed_task_count,
|
|
870
|
+
spec_totals.spec_count, spec_totals.completed_spec_count,
|
|
871
|
+
prd_totals.prd_count, prd_totals.completed_prd_count,
|
|
872
|
+
totals.total_run_count, totals.agent_invocation_count, totals.llm_call_count,
|
|
873
|
+
totals.total_duration_ms, totals.total_tokens,
|
|
874
|
+
totals.total_cost_usd, totals.total_cost_brl, totals.execution_day_count,
|
|
875
|
+
task_totals.latest_task_created_at
|
|
876
|
+
FROM totals CROSS JOIN task_totals CROSS JOIN spec_totals CROSS JOIN prd_totals;
|
|
877
|
+
CREATE VIEW vw_first_fold_task_status_all_time AS
|
|
878
|
+
WITH counts AS (
|
|
879
|
+
SELECT COALESCE(status, 'draft') AS status, COUNT(*) AS task_count
|
|
880
|
+
FROM task_summary GROUP BY COALESCE(status, 'draft')
|
|
881
|
+
), total AS (SELECT SUM(task_count) AS task_count FROM counts)
|
|
882
|
+
SELECT counts.status, counts.task_count,
|
|
883
|
+
CASE WHEN total.task_count = 0 THEN 0.0 ELSE CAST(counts.task_count AS REAL) / total.task_count END AS task_percentage
|
|
884
|
+
FROM counts CROSS JOIN total;
|
|
885
|
+
CREATE VIEW vw_first_fold_task_risk_all_time AS
|
|
886
|
+
WITH counts AS (
|
|
887
|
+
SELECT COALESCE(risk, 'standard') AS risk, COUNT(*) AS task_count
|
|
888
|
+
FROM task_summary GROUP BY COALESCE(risk, 'standard')
|
|
889
|
+
), total AS (SELECT SUM(task_count) AS task_count FROM counts)
|
|
890
|
+
SELECT counts.risk, counts.task_count,
|
|
891
|
+
CASE WHEN total.task_count = 0 THEN 0.0 ELSE CAST(counts.task_count AS REAL) / total.task_count END AS task_percentage
|
|
892
|
+
FROM counts CROSS JOIN total;
|
|
893
|
+
CREATE VIEW vw_first_fold_task_metrics_all_time AS
|
|
894
|
+
SELECT overview.task_count,
|
|
895
|
+
CASE WHEN overview.task_count = 0 OR overview.total_duration_ms IS NULL THEN NULL ELSE overview.total_duration_ms / overview.task_count END AS average_duration_ms_per_task,
|
|
896
|
+
CASE WHEN overview.task_count = 0 OR overview.total_tokens IS NULL THEN NULL ELSE overview.total_tokens / overview.task_count END AS average_tokens_per_task,
|
|
897
|
+
CASE WHEN overview.task_count = 0 OR overview.total_cost_usd IS NULL THEN NULL ELSE overview.total_cost_usd / overview.task_count END AS average_cost_usd_per_task,
|
|
898
|
+
CASE WHEN overview.task_count = 0 OR overview.total_cost_brl IS NULL THEN NULL ELSE overview.total_cost_brl / overview.task_count END AS average_cost_brl_per_task,
|
|
899
|
+
overview.latest_task_created_at
|
|
900
|
+
FROM vw_first_fold_overview_all_time overview;
|
|
901
|
+
CREATE VIEW vw_first_fold_spec_status_all_time AS
|
|
902
|
+
WITH counts AS (
|
|
903
|
+
SELECT CASE
|
|
904
|
+
WHEN status='cancelled' THEN 'cancelled'
|
|
905
|
+
WHEN status='failed' THEN 'failed'
|
|
906
|
+
WHEN status='blocked' THEN 'blocked'
|
|
907
|
+
WHEN status IN ('delivered','completed') THEN 'completed'
|
|
908
|
+
WHEN status='ready' THEN 'ready'
|
|
909
|
+
WHEN status='draft' THEN 'planning'
|
|
910
|
+
WHEN status='verifying' THEN 'verifying'
|
|
911
|
+
WHEN status IN ('active','executing') THEN 'executing'
|
|
912
|
+
ELSE 'planning'
|
|
913
|
+
END AS stage, COUNT(*) AS entity_count
|
|
914
|
+
FROM spec_summary GROUP BY stage
|
|
915
|
+
), total AS (SELECT SUM(entity_count) AS entity_count FROM counts)
|
|
916
|
+
SELECT counts.stage, counts.entity_count,
|
|
917
|
+
CASE WHEN total.entity_count=0 THEN 0.0 ELSE CAST(counts.entity_count AS REAL)/total.entity_count END AS entity_percentage
|
|
918
|
+
FROM counts CROSS JOIN total;
|
|
919
|
+
CREATE VIEW vw_first_fold_prd_status_all_time AS
|
|
920
|
+
WITH counts AS (
|
|
921
|
+
SELECT CASE
|
|
922
|
+
WHEN status='cancelled' THEN 'cancelled'
|
|
923
|
+
WHEN status='failed' THEN 'failed'
|
|
924
|
+
WHEN status='blocked' THEN 'blocked'
|
|
925
|
+
WHEN status IN ('delivered','completed') THEN 'completed'
|
|
926
|
+
WHEN status='ready' THEN 'ready'
|
|
927
|
+
WHEN status='draft' THEN 'definition'
|
|
928
|
+
WHEN status='verifying' THEN 'verifying'
|
|
929
|
+
WHEN status IN ('active','executing') THEN 'executing'
|
|
930
|
+
ELSE 'definition'
|
|
931
|
+
END AS stage, COUNT(*) AS entity_count
|
|
932
|
+
FROM prd_summary GROUP BY stage
|
|
933
|
+
), total AS (SELECT SUM(entity_count) AS entity_count FROM counts)
|
|
934
|
+
SELECT counts.stage, counts.entity_count,
|
|
935
|
+
CASE WHEN total.entity_count=0 THEN 0.0 ELSE CAST(counts.entity_count AS REAL)/total.entity_count END AS entity_percentage
|
|
936
|
+
FROM counts CROSS JOIN total;
|
|
937
|
+
CREATE VIEW vw_first_fold_spec_classification_all_time AS
|
|
938
|
+
WITH rollup AS (
|
|
939
|
+
SELECT s.id, COUNT(DISTINCT a.task_id) AS task_count,
|
|
940
|
+
SUM(CASE WHEN a.work_type='rework' AND a.run_role='root' THEN 1 ELSE 0 END) AS rework_run_count
|
|
941
|
+
FROM spec_summary s LEFT JOIN activities a ON a.spec_id=s.id GROUP BY s.id
|
|
942
|
+
), counts AS (
|
|
943
|
+
SELECT CASE WHEN rework_run_count>0 THEN 'rework' WHEN task_count>0 THEN 'structured' ELSE 'empty' END AS classification,
|
|
944
|
+
COUNT(*) AS entity_count
|
|
945
|
+
FROM rollup GROUP BY classification
|
|
946
|
+
), total AS (SELECT SUM(entity_count) AS entity_count FROM counts)
|
|
947
|
+
SELECT counts.classification, counts.entity_count,
|
|
948
|
+
CASE WHEN total.entity_count=0 THEN 0.0 ELSE CAST(counts.entity_count AS REAL)/total.entity_count END AS entity_percentage
|
|
949
|
+
FROM counts CROSS JOIN total;
|
|
950
|
+
CREATE VIEW vw_first_fold_prd_classification_all_time AS
|
|
951
|
+
WITH rollup AS (
|
|
952
|
+
SELECT p.id, COUNT(DISTINCT a.task_id) AS task_count,
|
|
953
|
+
SUM(CASE WHEN a.work_type='rework' AND a.run_role='root' THEN 1 ELSE 0 END) AS rework_run_count
|
|
954
|
+
FROM prd_summary p LEFT JOIN activities a ON a.prd_id=p.id GROUP BY p.id
|
|
955
|
+
), counts AS (
|
|
956
|
+
SELECT CASE WHEN rework_run_count>0 THEN 'rework' WHEN task_count>0 THEN 'structured' ELSE 'empty' END AS classification,
|
|
957
|
+
COUNT(*) AS entity_count
|
|
958
|
+
FROM rollup GROUP BY classification
|
|
959
|
+
), total AS (SELECT SUM(entity_count) AS entity_count FROM counts)
|
|
960
|
+
SELECT counts.classification, counts.entity_count,
|
|
961
|
+
CASE WHEN total.entity_count=0 THEN 0.0 ELSE CAST(counts.entity_count AS REAL)/total.entity_count END AS entity_percentage
|
|
962
|
+
FROM counts CROSS JOIN total;
|
|
963
|
+
CREATE VIEW vw_first_fold_spec_metrics_all_time AS
|
|
964
|
+
WITH usage AS (
|
|
965
|
+
SELECT spec_id,
|
|
966
|
+
COUNT(*) AS total_run_count,
|
|
967
|
+
ROUND(SUM(duration_ms)) AS total_duration_ms,
|
|
968
|
+
SUM(total_tokens) AS total_tokens,
|
|
969
|
+
SUM(cost_usd) AS total_cost_usd,
|
|
970
|
+
SUM(cost_brl) AS total_cost_brl
|
|
971
|
+
FROM activities WHERE spec_id IS NOT NULL GROUP BY spec_id
|
|
972
|
+
)
|
|
973
|
+
SELECT COUNT(*) AS entity_count,
|
|
974
|
+
SUM(usage.total_run_count) AS total_run_count,
|
|
975
|
+
SUM(usage.total_duration_ms) AS total_duration_ms,
|
|
976
|
+
SUM(usage.total_tokens) AS total_tokens,
|
|
977
|
+
SUM(usage.total_cost_usd) AS total_cost_usd,
|
|
978
|
+
SUM(usage.total_cost_brl) AS total_cost_brl,
|
|
979
|
+
CASE WHEN COUNT(*)=0 THEN NULL ELSE SUM(usage.total_duration_ms)/COUNT(*) END AS average_duration_ms,
|
|
980
|
+
CASE WHEN COUNT(*)=0 THEN NULL ELSE SUM(usage.total_tokens)/COUNT(*) END AS average_tokens,
|
|
981
|
+
CASE WHEN COUNT(*)=0 THEN NULL ELSE SUM(usage.total_cost_usd)/COUNT(*) END AS average_cost_usd,
|
|
982
|
+
CASE WHEN COUNT(*)=0 THEN NULL ELSE SUM(usage.total_cost_brl)/COUNT(*) END AS average_cost_brl,
|
|
983
|
+
MAX(s.occurred_at) AS latest_created_at
|
|
984
|
+
FROM spec_summary s LEFT JOIN usage ON usage.spec_id=s.id;
|
|
985
|
+
CREATE VIEW vw_first_fold_prd_metrics_all_time AS
|
|
986
|
+
WITH usage AS (
|
|
987
|
+
SELECT prd_id,
|
|
988
|
+
COUNT(*) AS total_run_count,
|
|
989
|
+
ROUND(SUM(duration_ms)) AS total_duration_ms,
|
|
990
|
+
SUM(total_tokens) AS total_tokens,
|
|
991
|
+
SUM(cost_usd) AS total_cost_usd,
|
|
992
|
+
SUM(cost_brl) AS total_cost_brl
|
|
993
|
+
FROM activities WHERE prd_id IS NOT NULL GROUP BY prd_id
|
|
994
|
+
)
|
|
995
|
+
SELECT COUNT(*) AS entity_count,
|
|
996
|
+
SUM(usage.total_run_count) AS total_run_count,
|
|
997
|
+
SUM(usage.total_duration_ms) AS total_duration_ms,
|
|
998
|
+
SUM(usage.total_tokens) AS total_tokens,
|
|
999
|
+
SUM(usage.total_cost_usd) AS total_cost_usd,
|
|
1000
|
+
SUM(usage.total_cost_brl) AS total_cost_brl,
|
|
1001
|
+
CASE WHEN COUNT(*)=0 THEN NULL ELSE SUM(usage.total_duration_ms)/COUNT(*) END AS average_duration_ms,
|
|
1002
|
+
CASE WHEN COUNT(*)=0 THEN NULL ELSE SUM(usage.total_tokens)/COUNT(*) END AS average_tokens,
|
|
1003
|
+
CASE WHEN COUNT(*)=0 THEN NULL ELSE SUM(usage.total_cost_usd)/COUNT(*) END AS average_cost_usd,
|
|
1004
|
+
CASE WHEN COUNT(*)=0 THEN NULL ELSE SUM(usage.total_cost_brl)/COUNT(*) END AS average_cost_brl,
|
|
1005
|
+
MAX(p.occurred_at) AS latest_created_at
|
|
1006
|
+
FROM prd_summary p LEFT JOIN usage ON usage.prd_id=p.id;
|
|
1007
|
+
CREATE VIEW vw_first_fold_top_specs_all_time AS
|
|
1008
|
+
WITH usage AS (
|
|
1009
|
+
SELECT spec_id,
|
|
1010
|
+
COUNT(*) AS total_run_count,
|
|
1011
|
+
SUM(llm_call_count) AS llm_call_count,
|
|
1012
|
+
ROUND(SUM(duration_ms)) AS total_duration_ms,
|
|
1013
|
+
SUM(total_tokens) AS total_tokens,
|
|
1014
|
+
SUM(cost_usd) AS total_cost_usd,
|
|
1015
|
+
SUM(cost_brl) AS total_cost_brl
|
|
1016
|
+
FROM activities WHERE spec_id IS NOT NULL GROUP BY spec_id
|
|
1017
|
+
), ranked AS (
|
|
1018
|
+
SELECT s.id AS entity_id, s.title, s.status, usage.total_run_count, usage.llm_call_count,
|
|
1019
|
+
usage.total_duration_ms, usage.total_tokens, usage.total_cost_usd, usage.total_cost_brl,
|
|
1020
|
+
ROW_NUMBER() OVER (ORDER BY usage.total_duration_ms IS NOT NULL DESC, usage.total_duration_ms DESC, usage.total_run_count DESC, s.id) AS rank
|
|
1021
|
+
FROM spec_summary s LEFT JOIN usage ON usage.spec_id=s.id
|
|
1022
|
+
), total AS (SELECT SUM(total_duration_ms) AS total_duration_ms FROM ranked)
|
|
1023
|
+
SELECT ranked.rank, ranked.entity_id, ranked.title, ranked.status,
|
|
1024
|
+
COALESCE(ranked.total_run_count,0) AS total_run_count, ranked.llm_call_count,
|
|
1025
|
+
ranked.total_duration_ms, ranked.total_tokens, ranked.total_cost_usd, ranked.total_cost_brl,
|
|
1026
|
+
CASE WHEN total.total_duration_ms IS NULL OR total.total_duration_ms=0 OR ranked.total_duration_ms IS NULL THEN 0.0 ELSE ranked.total_duration_ms/total.total_duration_ms END AS duration_share
|
|
1027
|
+
FROM ranked CROSS JOIN total WHERE ranked.rank<=5 ORDER BY ranked.rank;
|
|
1028
|
+
CREATE VIEW vw_first_fold_top_prds_all_time AS
|
|
1029
|
+
WITH usage AS (
|
|
1030
|
+
SELECT prd_id,
|
|
1031
|
+
COUNT(*) AS total_run_count,
|
|
1032
|
+
SUM(llm_call_count) AS llm_call_count,
|
|
1033
|
+
ROUND(SUM(duration_ms)) AS total_duration_ms,
|
|
1034
|
+
SUM(total_tokens) AS total_tokens,
|
|
1035
|
+
SUM(cost_usd) AS total_cost_usd,
|
|
1036
|
+
SUM(cost_brl) AS total_cost_brl
|
|
1037
|
+
FROM activities WHERE prd_id IS NOT NULL GROUP BY prd_id
|
|
1038
|
+
), ranked AS (
|
|
1039
|
+
SELECT p.id AS entity_id, p.title, p.status, usage.total_run_count, usage.llm_call_count,
|
|
1040
|
+
usage.total_duration_ms, usage.total_tokens, usage.total_cost_usd, usage.total_cost_brl,
|
|
1041
|
+
ROW_NUMBER() OVER (ORDER BY usage.total_duration_ms IS NOT NULL DESC, usage.total_duration_ms DESC, usage.total_run_count DESC, p.id) AS rank
|
|
1042
|
+
FROM prd_summary p LEFT JOIN usage ON usage.prd_id=p.id
|
|
1043
|
+
), total AS (SELECT SUM(total_duration_ms) AS total_duration_ms FROM ranked)
|
|
1044
|
+
SELECT ranked.rank, ranked.entity_id, ranked.title, ranked.status,
|
|
1045
|
+
COALESCE(ranked.total_run_count,0) AS total_run_count, ranked.llm_call_count,
|
|
1046
|
+
ranked.total_duration_ms, ranked.total_tokens, ranked.total_cost_usd, ranked.total_cost_brl,
|
|
1047
|
+
CASE WHEN total.total_duration_ms IS NULL OR total.total_duration_ms=0 OR ranked.total_duration_ms IS NULL THEN 0.0 ELSE ranked.total_duration_ms/total.total_duration_ms END AS duration_share
|
|
1048
|
+
FROM ranked CROSS JOIN total WHERE ranked.rank<=5 ORDER BY ranked.rank;
|
|
1049
|
+
CREATE VIEW vw_first_fold_top_tasks_all_time AS
|
|
1050
|
+
WITH duration AS (
|
|
1051
|
+
SELECT a.task_id, ROUND(SUM(f.attributed_token_active_ms)) AS total_duration_ms
|
|
1052
|
+
FROM attributed_token_active_facts f JOIN zaip_aios_activities a USING(activity_row_id)
|
|
1053
|
+
WHERE a.task_id IS NOT NULL AND a.phase='execution' GROUP BY a.task_id
|
|
1054
|
+
), usage AS (
|
|
1055
|
+
SELECT task_id, COUNT(*) AS total_run_count, SUM(llm_call_count) AS llm_call_count,
|
|
1056
|
+
SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS total_cost_usd, SUM(cost_brl) AS total_cost_brl
|
|
1057
|
+
FROM activities WHERE task_id IS NOT NULL AND phase='execution' GROUP BY task_id
|
|
1058
|
+
), ranked AS (
|
|
1059
|
+
SELECT t.id AS task_id, t.title, t.status, t.risk,
|
|
1060
|
+
usage.total_run_count, usage.llm_call_count, duration.total_duration_ms,
|
|
1061
|
+
usage.total_tokens, usage.total_cost_usd, usage.total_cost_brl,
|
|
1062
|
+
ROW_NUMBER() OVER (ORDER BY duration.total_duration_ms DESC, t.id) AS rank
|
|
1063
|
+
FROM duration JOIN task_summary t ON t.id=duration.task_id
|
|
1064
|
+
LEFT JOIN usage ON usage.task_id=duration.task_id
|
|
1065
|
+
), total AS (SELECT SUM(total_duration_ms) AS total_duration_ms FROM ranked)
|
|
1066
|
+
SELECT ranked.rank, ranked.task_id, ranked.title, ranked.status, ranked.risk,
|
|
1067
|
+
ranked.total_run_count, ranked.llm_call_count, ranked.total_duration_ms,
|
|
1068
|
+
ranked.total_tokens, ranked.total_cost_usd, ranked.total_cost_brl,
|
|
1069
|
+
CASE WHEN total.total_duration_ms IS NULL OR total.total_duration_ms = 0 THEN 0.0 ELSE ranked.total_duration_ms / total.total_duration_ms END AS duration_share
|
|
1070
|
+
FROM ranked CROSS JOIN total WHERE ranked.rank <= 5 ORDER BY ranked.rank;
|
|
1071
|
+
CREATE VIEW vw_first_fold_task_summary AS SELECT * FROM vw_task_summary;
|
|
1072
|
+
CREATE VIEW vw_first_fold_spec_summary AS SELECT * FROM vw_spec_summary;
|
|
1073
|
+
CREATE VIEW vw_first_fold_prd_summary AS SELECT * FROM vw_prd_summary;
|
|
1074
|
+
CREATE VIEW cost_monitor_daily AS SELECT * FROM vw_cost_daily;
|
|
1075
|
+
CREATE VIEW cost_monitor_monthly AS SELECT * FROM vw_cost_monthly;
|
|
1076
|
+
CREATE VIEW cost_monitor_annual AS SELECT * FROM vw_cost_annual;
|
|
1077
|
+
CREATE VIEW cost_monitor_overview_view AS SELECT * FROM vw_cost_overview;
|
|
1078
|
+
CREATE VIEW cost_monitor_executions AS SELECT * FROM vw_cost_executions;
|
|
1079
|
+
CREATE VIEW cost_monitor_agent_invocations AS SELECT * FROM vw_cost_agent_invocations;
|
|
1080
|
+
CREATE VIEW cost_monitor_zaip_agents AS SELECT * FROM vw_cost_zaip_agents;
|
|
1081
|
+
CREATE VIEW cost_monitor_models AS SELECT * FROM vw_cost_models;
|
|
1082
|
+
CREATE VIEW cost_monitor_providers AS SELECT * FROM vw_cost_providers;
|
|
1083
|
+
CREATE VIEW cost_monitor_tasks AS SELECT * FROM vw_cost_tasks;
|
|
1084
|
+
CREATE VIEW cost_monitor_specs AS SELECT * FROM vw_cost_specs;
|
|
1085
|
+
CREATE VIEW cost_monitor_prds AS SELECT * FROM vw_cost_prds;
|
|
1086
|
+
CREATE VIEW cost_monitor_conversations AS SELECT * FROM vw_cost_conversations;
|
|
1087
|
+
CREATE VIEW operations_work_list AS SELECT * FROM vw_operations_work_list;
|
|
1088
|
+
CREATE VIEW operations_work_summary AS SELECT * FROM vw_operations_work_summary;
|
|
1089
|
+
CREATE VIEW operations_work_kanban AS SELECT * FROM vw_operations_work_kanban;
|
|
1090
|
+
CREATE VIEW operations_executions AS SELECT * FROM vw_operations_executions;
|
|
1091
|
+
CREATE VIEW operations_agent_invocations AS SELECT * FROM vw_operations_agent_invocations;
|
|
1092
|
+
CREATE VIEW operations_conversations AS SELECT * FROM vw_operations_conversations;
|
|
1093
|
+
CREATE VIEW operations_decisions AS SELECT * FROM vw_operations_decisions;
|
|
1094
|
+
CREATE VIEW operations_changes AS SELECT * FROM vw_operations_changes;
|
|
1095
|
+
CREATE VIEW operations_daily AS SELECT * FROM vw_operations_daily;
|
|
1096
|
+
CREATE VIEW operations_monthly AS SELECT * FROM vw_operations_monthly;
|
|
1097
|
+
CREATE VIEW operations_annual AS SELECT * FROM vw_operations_annual;
|
|
1098
|
+
CREATE VIEW first_fold_overview AS SELECT * FROM vw_first_fold_overview;
|
|
1099
|
+
CREATE VIEW first_fold_task_status AS SELECT * FROM vw_first_fold_task_status;
|
|
1100
|
+
CREATE VIEW first_fold_task_risk AS SELECT * FROM vw_first_fold_task_risk;
|
|
1101
|
+
CREATE VIEW first_fold_top_tasks AS SELECT * FROM vw_first_fold_top_tasks;
|
|
1102
|
+
CREATE VIEW first_fold_overview_all_time AS SELECT * FROM vw_first_fold_overview_all_time;
|
|
1103
|
+
CREATE VIEW first_fold_task_status_all_time AS SELECT * FROM vw_first_fold_task_status_all_time;
|
|
1104
|
+
CREATE VIEW first_fold_task_risk_all_time AS SELECT * FROM vw_first_fold_task_risk_all_time;
|
|
1105
|
+
CREATE VIEW first_fold_task_metrics_all_time AS SELECT * FROM vw_first_fold_task_metrics_all_time;
|
|
1106
|
+
CREATE VIEW first_fold_top_tasks_all_time AS SELECT * FROM vw_first_fold_top_tasks_all_time;
|
|
1107
|
+
CREATE VIEW first_fold_spec_status_all_time AS SELECT * FROM vw_first_fold_spec_status_all_time;
|
|
1108
|
+
CREATE VIEW first_fold_spec_classification_all_time AS SELECT * FROM vw_first_fold_spec_classification_all_time;
|
|
1109
|
+
CREATE VIEW first_fold_spec_metrics_all_time AS SELECT * FROM vw_first_fold_spec_metrics_all_time;
|
|
1110
|
+
CREATE VIEW first_fold_top_specs_all_time AS SELECT * FROM vw_first_fold_top_specs_all_time;
|
|
1111
|
+
CREATE VIEW first_fold_prd_status_all_time AS SELECT * FROM vw_first_fold_prd_status_all_time;
|
|
1112
|
+
CREATE VIEW first_fold_prd_classification_all_time AS SELECT * FROM vw_first_fold_prd_classification_all_time;
|
|
1113
|
+
CREATE VIEW first_fold_prd_metrics_all_time AS SELECT * FROM vw_first_fold_prd_metrics_all_time;
|
|
1114
|
+
CREATE VIEW first_fold_top_prds_all_time AS SELECT * FROM vw_first_fold_top_prds_all_time;
|
|
1115
|
+
CREATE VIEW first_fold_task AS SELECT * FROM vw_first_fold_task_summary;
|
|
1116
|
+
CREATE VIEW first_fold_spec AS SELECT * FROM vw_first_fold_spec_summary;
|
|
1117
|
+
CREATE VIEW first_fold_prd AS SELECT * FROM vw_first_fold_prd_summary;
|
|
1118
|
+
CREATE VIEW task_summary_daily AS SELECT * FROM vw_task_summary_daily;
|
|
1119
|
+
CREATE VIEW spec_summary_daily AS SELECT * FROM vw_spec_summary_daily;
|
|
1120
|
+
CREATE VIEW prd_summary_daily AS SELECT * FROM vw_prd_summary_daily;
|
|
1121
|
+
CREATE VIEW task_status_daily AS SELECT * FROM vw_task_status_daily;
|
|
1122
|
+
CREATE VIEW task_risk_daily AS SELECT * FROM vw_task_risk_daily;
|
|
1123
|
+
COMMIT;`,Ah=[...du.matchAll(/\bCREATE VIEW ([A-Za-z_][A-Za-z0-9_]*)/g)].map(P=>P[1]).filter(P=>P!==void 0).reduce((P,ue)=>{let J=ue.startsWith("vw_")?ue.slice(3):ue;return P.replace(new RegExp(`\\b${ue}\\b`,"g"),`zaip_vw_${J}`)},du),_u=new Set,Th=Ah.replace(/\bCREATE VIEW ([A-Za-z_][A-Za-z0-9_]*)[\s\S]*?;/g,(P,ue)=>_u.has(ue)?"":(_u.add(ue),P));u.exec(Th),r("projection_finalize",80,"Finalizando \xEDndices e a c\xF3pia local do dashboard."),f=A}catch(b){throw u.exec("ROLLBACK;"),b}}finally{u.close()}try{await(0,Le.rename)(_,c)}catch(b){if(su(c,o)===null)throw await(0,Le.rm)(_,{force:!0}),b;await(0,Le.rm)(_,{force:!0})}let p=performance.now();await cu(c,t);let y=new ws(e),v=y.firstFoldViewportAllTime(),h=e0(),O={from_day:h.from,to_day:h.to,source_latest_day:y.firstFoldRelevantLatestDay(),aggregate:y.firstFoldAggregate(h),pages:{task:y.summaryPage("task",h,0,1e4).rows,spec:y.summaryPage("spec",h,0,1e4).rows,prd:y.summaryPage("prd",h,0,1e4).rows},top_tasks:y.topTasks(h)};y.close();let C=JSON.stringify(v),D=JSON.stringify(O);for(let b of[c,t]){let E=new or.DatabaseSync(b);try{E.prepare(`INSERT INTO zaip_aios_activities(
|
|
1124
|
+
activity_row_id, activity_source_kind, activity_key, source_path, source_hash,
|
|
1125
|
+
recorded_at, run_role, root_run_id, payload_type, payload_json
|
|
1126
|
+
) VALUES (?, 'technical_payload', 'first_fold_viewport_cache:all_time',
|
|
1127
|
+
'sqlite://first_fold_viewport_cache/all_time', '', datetime('now'), 'technical', 'technical',
|
|
1128
|
+
'first_fold_viewport_cache', ?)`).run(`TECH-${(0,Nt.randomUUID)().toLowerCase()}`,C),E.prepare(`INSERT INTO zaip_aios_activities(
|
|
1129
|
+
activity_row_id, activity_source_kind, activity_key, source_path, source_hash,
|
|
1130
|
+
recorded_at, run_role, root_run_id, payload_type, payload_json
|
|
1131
|
+
) VALUES (?, 'technical_payload', 'first_fold_monthly_quick_cache:default',
|
|
1132
|
+
'sqlite://first_fold_monthly_quick_cache/default', '', datetime('now'), 'technical', 'technical',
|
|
1133
|
+
'first_fold_monthly_quick_cache', ?)`).run(`TECH-${(0,Nt.randomUUID)().toLowerCase()}`,D)}finally{E.close()}}return r("snapshot_ready",86,"A c\xF3pia privada do banco local est\xE1 pronta."),Es(t),await h0((0,je.dirname)(c),c),{files:f,path:t,cache:"rebuilt",fingerprint_ms:a,materialize_ms:Math.round(performance.now()-p)}}async function h0(e,t){let n=await(0,Le.readdir)(e,{withFileTypes:!0}).catch(()=>[]),i=await Promise.all(n.filter(r=>r.isFile()&&r.name.endsWith(".sqlite")&&(0,je.resolve)(e,r.name)!==t).map(async r=>({path:(0,je.resolve)(e,r.name),mtime:(await(0,Le.stat)((0,je.resolve)(e,r.name))).mtimeMs})));for(let r of i.sort((o,a)=>a.mtime-o.mtime).slice(1))await(0,Le.rm)(r.path,{force:!0}).catch(()=>{});for(let r of n){if(!r.isFile()||!r.name.includes(".sqlite.")||!r.name.includes(".tmp"))continue;let o=(0,je.resolve)(e,r.name);Date.now()-(await(0,Le.stat)(o)).mtimeMs>6e4&&await(0,Le.rm)(o,{force:!0}).catch(()=>{})}}function su(e,t){try{let n=new or.DatabaseSync(e,{readOnly:!0}),i=n.prepare("SELECT value FROM zaip_vw_read_model_metadata WHERE key = ?").get("source_fingerprint")?.value,r=n.prepare("SELECT value FROM zaip_vw_read_model_metadata WHERE key = ?").get("schema_version")?.value,o=Number(n.prepare("SELECT value FROM zaip_vw_read_model_metadata WHERE key = ?").get("source_file_count")?.value??0);return n.close(),i===t&&r===mr?o:null}catch{return null}}async function v0(e){let t=await(0,Le.readdir)(e,{withFileTypes:!0}).catch(()=>[]),n=await Promise.all(t.filter(i=>i.isFile()&&i.name.endsWith(".sqlite")).map(async i=>({path:(0,je.join)(e,i.name),mtime:(await(0,Le.stat)((0,je.join)(e,i.name))).mtimeMs})));for(let i of n.sort((r,o)=>o.mtime-r.mtime)){let r=y0(i.path);if(r!==null)return{path:i.path,files:r}}return null}function y0(e){try{let t=new or.DatabaseSync(e,{readOnly:!0}),n=t.prepare("SELECT value FROM zaip_vw_read_model_metadata WHERE key = ?").get("schema_version")?.value,i=Number(t.prepare("SELECT value FROM zaip_vw_read_model_metadata WHERE key = ?").get("source_file_count")?.value??0);return t.close(),n===mr?i:null}catch{return null}}function fh(e){let t=e.prepare("SELECT name FROM sqlite_master WHERE type = 'view' AND name LIKE 'zaip_vw_%'").all();for(let{name:n}of t){let i=n.slice(8),r=o=>`"${o.replaceAll('"','""')}"`;e.exec(`CREATE TEMP VIEW ${r(i)} AS SELECT * FROM main.${r(n)}`)}}async function cu(e,t){await(0,Le.mkdir)((0,je.dirname)(t),{recursive:!0});let n=`${t}.${process.pid}.${(0,Nt.randomUUID)()}.tmp`;await(0,Le.copyFile)(e,n);try{await(0,Le.rename)(n,t)}catch(i){throw await(0,Le.rm)(n,{force:!0}),i}}async function gh(e){let t=(await Promise.all([".agents/records",".agents/config"].map(i=>hh((0,je.resolve)(e,i))))).flat().filter(i=>XU.has(i.slice(i.lastIndexOf(".")).toLowerCase())&&n0((0,je.relative)(e,i).replaceAll("\\","/"))).sort(),n=await Promise.all(t.map(async i=>{let r=await(0,Le.stat)(i);return{path:i,source:(0,je.relative)(e,i).replaceAll("\\","/"),mtimeMs:Math.trunc(r.mtimeMs),size:r.size}}));return{fingerprint:n.map(i=>`${i.source}:${i.mtimeMs}:${i.size}`).join("|"),candidates:n}}var uu={cost_monitor_daily:{date:"period_key",id:"period_key",order:"period_key DESC"},cost_monitor_monthly:{date:"period_key",id:"period_key",order:"period_key DESC"},cost_monitor_annual:{date:"period_key",id:"period_key",order:"period_key DESC"},cost_monitor_overview_view:{date:"period_key",id:"period_key",order:"period_key DESC"},cost_monitor_executions:{date:null,id:"execution_id",order:"invocation_count DESC, execution_id DESC"},cost_monitor_agent_invocations:{date:"occurred_day_sp",id:"agent_invocation_id",order:"occurred_at DESC, agent_invocation_id DESC"},cost_monitor_zaip_agents:{date:null,id:"zaip_agent",order:"invocation_count DESC, zaip_agent"},cost_monitor_models:{date:null,id:"model",order:"invocation_count DESC, model"},cost_monitor_providers:{date:null,id:"provider",order:"invocation_count DESC, provider"},cost_monitor_tasks:{date:null,id:"task_id",order:"invocation_count DESC, task_id"},cost_monitor_specs:{date:null,id:"spec_id",order:"invocation_count DESC, spec_id"},cost_monitor_prds:{date:null,id:"prd_id",order:"invocation_count DESC, prd_id"},cost_monitor_conversations:{date:null,id:"conversation_id",order:"invocation_count DESC, conversation_id"},operations_work_list:{date:"occurred_day_sp",id:"id",order:"occurred_at DESC, id DESC"},operations_work_kanban:{date:"occurred_day_sp",id:"id",order:"occurred_at DESC, id DESC"},operations_executions:{date:null,id:"execution_id",order:"started_at DESC, execution_id DESC"},operations_agent_invocations:{date:"source_day_sp",id:"agent_invocation_id",order:"occurred_at DESC, agent_invocation_id DESC"},operations_conversations:{date:null,id:"conversation_id",order:"started_at DESC, conversation_id DESC"},operations_decisions:{date:"occurred_day_sp",id:"id",order:"occurred_at DESC, id DESC"},operations_changes:{date:"occurred_day_sp",id:"id",order:"occurred_at DESC, id DESC"},operations_daily:{date:"day",id:"day",order:"day DESC"},operations_monthly:{date:"period_key",id:"period_key",order:"period_key DESC"},operations_annual:{date:"period_key",id:"period_key",order:"period_key DESC"},first_fold_overview:{date:"start_day",id:"period_key",order:"period_key DESC"},first_fold_task_status:{date:"day",id:"status",order:"day DESC, status"},first_fold_task_risk:{date:"day",id:"risk",order:"day DESC, risk"},first_fold_top_tasks:{date:"occurred_day_sp",id:"id",order:"total_duration DESC, id DESC"},first_fold_overview_all_time:{date:null,id:"period_key",order:"period_key"},first_fold_task_status_all_time:{date:null,id:"status",order:"status"},first_fold_task_risk_all_time:{date:null,id:"risk",order:"risk"},first_fold_task_metrics_all_time:{date:null,id:null,order:"task_count DESC"},first_fold_top_tasks_all_time:{date:null,id:"task_id",order:"rank"},first_fold_spec_status_all_time:{date:null,id:"stage",order:"stage"},first_fold_spec_classification_all_time:{date:null,id:"classification",order:"classification"},first_fold_spec_metrics_all_time:{date:null,id:null,order:"entity_count DESC"},first_fold_top_specs_all_time:{date:null,id:"entity_id",order:"rank"},first_fold_prd_status_all_time:{date:null,id:"stage",order:"stage"},first_fold_prd_classification_all_time:{date:null,id:"classification",order:"classification"},first_fold_prd_metrics_all_time:{date:null,id:null,order:"entity_count DESC"},first_fold_top_prds_all_time:{date:null,id:"entity_id",order:"rank"},first_fold_task:{date:"occurred_day_sp",id:"id",order:"occurred_at DESC, id DESC"},first_fold_spec:{date:"occurred_day_sp",id:"id",order:"occurred_at DESC, id DESC"},first_fold_prd:{date:"occurred_day_sp",id:"id",order:"occurred_at DESC, id DESC"}};async function hh(e){let t=await(0,Le.readdir)(e,{withFileTypes:!0}).catch(()=>[]);return(await Promise.all(t.map(async i=>{let r=(0,je.join)(e,i.name);return i.isDirectory()?hh(r):i.isFile()?[r]:[]}))).flat()}var ws=class extends Pi{executionDurationCache=new Map;dailyAggregateRowsCache=null;firstFoldAllTimeCache=null;firstFoldTopTasksAllTimeCache=null;firstFoldViewportCache=null;firstFoldMonthlyQuickCache=void 0;firstFoldViewportTimings={};metadataValues=null;unfilteredViewPageCache=new Map;viewPageResultCache=new Map;operationsWorkListPageCache=null;dailyAggregateRows(){return this.dailyAggregateRowsCache===null&&(this.dailyAggregateRowsCache=this.database.prepare("SELECT * FROM daily_aggregate_cache ORDER BY day").all()),this.dailyAggregateRowsCache}operationsWorkListRows(){return this.operationsWorkListPageCache??=this.database.prepare("SELECT * FROM operations_work_list ORDER BY occurred_at DESC, id DESC").all(),this.operationsWorkListPageCache}unfilteredViewRows(t){let n=this.unfilteredViewPageCache.get(t);if(n!==void 0)return n;let i=uu[t].order,r=this.database.prepare(`SELECT * FROM ${t} ORDER BY ${i}`).all();return this.unfilteredViewPageCache.set(t,r),r}database;constructor(t){super(t),this.database=new or.DatabaseSync(Os(t),{readOnly:!0}),fh(this.database)}async exists(t){let n=this.database.prepare("SELECT 1 FROM files WHERE path = ? LIMIT 1").get(t),i=this.database.prepare("SELECT 1 FROM files WHERE path LIKE ? LIMIT 1").get(`${t.replace(/\/$/,"")}/%`);return n!==void 0||i!==void 0}async readText(t){let n=this.database.prepare("SELECT content FROM files WHERE path = ?").get(t);if(n?.content===void 0)throw Object.assign(new Error(`SQLite read model is missing ${t}`),{code:"ENOENT"});return n.content}async readBytes(t){return Buffer.from(await this.readText(t),"utf8")}async readTextFrom(t,n){let i=await this.readText(t),r=Buffer.from(i,"utf8");return{content:r.subarray(Math.min(n,r.byteLength)).toString("utf8"),nextOffset:r.byteLength}}async listFiles(t,n=""){let i=`${t.replace(/\/$/,"")}/%`;return this.database.prepare("SELECT path FROM files WHERE path LIKE ? ORDER BY path").all(i).map(o=>o.path).filter(o=>o.endsWith(n))}async listDirectories(t){let n=`${t.replace(/\/$/,"")}/`,i=this.database.prepare("SELECT path FROM files WHERE path LIKE ?").all(`${n}%`);return[...new Set(i.map(r=>r.path.slice(n.length).split("/")[0]).filter(Boolean).map(r=>`${t.replace(/\/$/,"")}/${r}`))].sort()}close(){this.database.close()}reopen(){this.database=new or.DatabaseSync(Os(this.root),{readOnly:!0}),fh(this.database),this.executionDurationCache.clear(),this.dailyAggregateRowsCache=null,this.firstFoldAllTimeCache=null,this.firstFoldTopTasksAllTimeCache=null,this.firstFoldViewportCache=null,this.firstFoldMonthlyQuickCache=void 0,this.firstFoldViewportTimings={},this.metadataValues=null,this.viewPageResultCache.clear()}refresh(){this.database.close(),this.reopen()}async rebuildAndRefresh(t){this.database.close();try{await t()}finally{this.reopen()}this.viewPage("cost_monitor_daily",{limit:1,offset:0})}executionDurationByDay(t,n=null){let i=t.from?.slice(0,10)??null,r=t.to?.slice(0,10)??null,o=JSON.stringify({...t,from:i,to:r,taskId:n}),a=this.executionDurationCache.get(o);if(a!==void 0)return new Map(a);let s=["(? IS NULL OR f.occurred_day_sp >= ?)","(? IS NULL OR f.occurred_day_sp <= ?)","(? IS NULL OR a.task_id = ?)"],c=[i,i,r,r,n,n],l=(t.providers??[]).filter(v=>v!=="unavailable"),_=(t.models??[]).filter(v=>v!=="unavailable");if(t.providers?.includes("unavailable")===!0||t.models?.includes("unavailable")===!0){let v=(h,O)=>{if(O===void 0||O.length===0)return;let C=O.filter(E=>E!=="unavailable"),D=C.length===0?"0":`EXISTS (SELECT 1 FROM invocation_usage u WHERE u.agent_invocation_id=a.agent_run_id AND u.${h} IN (${C.map(()=>"?").join(",")}))`;C.length>0&&c.push(...C);let b=`NOT EXISTS (SELECT 1 FROM invocation_usage u WHERE u.agent_invocation_id=a.agent_run_id AND u.${h} IS NOT NULL AND u.${h} <> 'unavailable')`;s.push(O.includes("unavailable")?`(${D} OR ${b})`:D)};v("provider",t.providers),v("model",t.models)}else if(l.length>0||_.length>0){let v=[];l.length>0&&(v.push(`u.provider IN (${l.map(()=>"?").join(",")})`),c.push(...l)),_.length>0&&(v.push(`u.model IN (${_.map(()=>"?").join(",")})`),c.push(..._)),s.push(`EXISTS (SELECT 1 FROM invocation_usage u WHERE u.agent_invocation_id=a.agent_run_id AND ${v.join(" AND ")})`)}let f=[["zaip_agent",t.agents],["phase",t.phases],["status",t.statuses]];for(let[v,h]of f)h===void 0||h.length===0||(s.push(`a.${v} IN (${h.map(()=>"?").join(",")})`),c.push(...h));let p=this.database.prepare(`SELECT f.occurred_day_sp AS day, SUM(f.attributed_token_active_ms) AS duration_ms
|
|
1134
|
+
FROM attributed_token_active_facts f JOIN zaip_aios_activities a USING(activity_row_id)
|
|
1135
|
+
WHERE ${s.join(" AND ")} GROUP BY f.occurred_day_sp`).all(...c),y=new Map(p.map(v=>[v.day,Number(v.duration_ms)]));return this.executionDurationCache.set(o,y),new Map(y)}canonicalRunCountByDay(t){let n=t.from?.slice(0,10)??null,i=t.to?.slice(0,10)??null,r=["(? IS NULL OR occurred_day_sp >= ?)","(? IS NULL OR occurred_day_sp <= ?)"],o=[n,n,i,i],a=(t.providers??[]).filter(u=>u!=="unavailable"),s=(t.models??[]).filter(u=>u!=="unavailable");if(t.providers?.includes("unavailable")===!0||t.models?.includes("unavailable")===!0){let u=(f,p)=>{if(p===void 0||p.length===0)return;let y=p.filter(O=>O!=="unavailable"),v=y.length===0?"0":`EXISTS (SELECT 1 FROM invocations i JOIN invocation_usage u USING(agent_invocation_id) WHERE i.run_id=canonical_run_index.run_id AND u.${f} IN (${y.map(()=>"?").join(",")}))`;y.length>0&&o.push(...y);let h=`NOT EXISTS (SELECT 1 FROM invocations i JOIN invocation_usage u USING(agent_invocation_id) WHERE i.run_id=canonical_run_index.run_id AND u.${f} IS NOT NULL AND u.${f} <> 'unavailable')`;r.push(p.includes("unavailable")?`(${v} OR ${h})`:v)};u("provider",t.providers),u("model",t.models)}else if(a.length>0||s.length>0){let u=[];a.length>0&&(u.push(`u.provider IN (${a.map(()=>"?").join(",")})`),o.push(...a)),s.length>0&&(u.push(`u.model IN (${s.map(()=>"?").join(",")})`),o.push(...s)),r.push(`EXISTS (SELECT 1 FROM invocations i JOIN invocation_usage u USING(agent_invocation_id) WHERE i.run_id=canonical_run_index.run_id AND ${u.join(" AND ")})`)}let l=[["zaip_agent",t.agents],["phase",t.phases],["status",t.statuses]];for(let[u,f]of l)f===void 0||f.length===0||(r.push(`${u} IN (${f.map(()=>"?").join(",")})`),o.push(...f));let _=this.database.prepare(`SELECT occurred_day_sp AS day, COUNT(*) AS count FROM canonical_run_index WHERE ${r.join(" AND ")} GROUP BY occurred_day_sp`).all(...o);return new Map(_.map(u=>[u.day,Number(u.count)]))}dailyPeriods(t){let n=t.from?.slice(0,10)??null,i=t.to?.slice(0,10)??null,r=this.executionDurationByDay(t),o=this.dailyAggregateRows().filter(c=>{let l=String(c.day);return(n===null||l>=n)&&(i===null||l<=i)}),a=new Map(o.map(c=>[String(c.day),c])),s=[...new Set([...a.keys(),...r.keys()])].sort();return Object.fromEntries(s.map(c=>{let l=a.get(c)??{},_=Number(l.total_run_count??0),u=Number(l.activity_count??0),f=Math.max(0,_-u);return[c,{prds:Number(l.prd_count??0),specs:Number(l.spec_count??0),tasks:Number(l.task_count??0),validations:Number(l.validation_count??0),evidences:Number(l.evidence_count??0),runs:Number(l.total_run_count??0),usage:{total_tokens:{known_sum:Number(l.total_tokens??0),unknown:f},cost:{known_sum:Number(l.total_cost_brl??0),unknown:f}},duration:{known_sum:r.get(c)??0,unknown:r.has(c)?0:Number(l.total_run_count??0)}}]}))}firstFoldAggregate(t){let n=t.from?.slice(0,10)??null,i=t.to?.slice(0,10)??null,r=this.dailyAggregateRows().filter(c=>{let l=String(c.day);return(n===null||l>=n)&&(i===null||l<=i)}),o=c=>{let l=r.map(_=>_[c]).filter(_=>typeof _=="number");return l.length===0?null:l.reduce((_,u)=>_+u,0)},a=this.executionDurationByDay(t),s=[...a.values()].reduce((c,l)=>c+l,0);return{days:r.length,total_run_count:o("total_run_count")??0,agent_invocation_count:o("invocation_count")??0,llm_call_count:o("llm_call_count"),duration_ms:a.size===0?null:s,total_tokens:o("total_tokens"),cost_brl:o("total_cost_brl"),execution_day_count:a.size}}firstFoldMonthlyQuick(t){if(this.firstFoldMonthlyQuickCache===void 0){let l=this.database.prepare("SELECT payload_json FROM zaip_aios_activities WHERE payload_type='first_fold_monthly_quick_cache' ORDER BY recorded_at DESC LIMIT 1").get();try{let _=typeof l?.payload_json=="string"?JSON.parse(l.payload_json):null;this.firstFoldMonthlyQuickCache=_!==null&&typeof _.from_day=="string"&&typeof _.to_day=="string"&&_.aggregate!==void 0&&_.pages!==void 0&&Array.isArray(_.top_tasks)?_:null}catch{this.firstFoldMonthlyQuickCache=null}}let n=this.firstFoldMonthlyQuickCache;if(n===null)return null;let i=t.from?.slice(0,10)??null,r=t.to?.slice(0,10)??null,o=i===n.from_day&&r===n.to_day,a=i===n.from_day&&r!==null&&r>n.to_day&&r.slice(0,7)===n.from_day.slice(0,7),s=n.source_latest_day===null||n.source_latest_day<=n.to_day;return o||a&&s?n:i!==null&&r!==null&&i.slice(0,7)>(n.source_latest_day===null?n.from_day.slice(0,7):n.source_latest_day.slice(0,7))?{from_day:i,to_day:r,source_latest_day:n.source_latest_day,aggregate:{days:0,total_run_count:0,agent_invocation_count:0,llm_call_count:null,duration_ms:null,total_tokens:null,cost_brl:null,execution_day_count:0},pages:{task:[],spec:[],prd:[]},top_tasks:[]}:null}firstFoldRelevantLatestDay(){let t=this.database.prepare(`SELECT MAX(day) AS day FROM (
|
|
1136
|
+
SELECT occurred_day_sp AS day FROM activities
|
|
1137
|
+
UNION ALL SELECT occurred_day_sp AS day FROM canonical_work_items
|
|
1138
|
+
UNION ALL SELECT occurred_day_sp AS day FROM canonical_artifacts
|
|
1139
|
+
UNION ALL SELECT occurred_day_sp AS day FROM canonical_run_index
|
|
1140
|
+
UNION ALL SELECT occurred_day_sp AS day FROM attributed_token_active_facts
|
|
1141
|
+
)`).get();return typeof t.day=="string"?t.day:null}firstFoldAllTime(){if(this.firstFoldAllTimeCache!==null)return this.firstFoldAllTimeCache;let t=this.database.prepare("SELECT * FROM zaip_vw_first_fold_overview_all_time").get(),n=this.database.prepare("SELECT status, task_count FROM zaip_vw_first_fold_task_status_all_time").all(),i=this.database.prepare("SELECT risk, task_count FROM zaip_vw_first_fold_task_risk_all_time").all(),r=this.database.prepare("SELECT * FROM zaip_vw_first_fold_task_metrics_all_time").get(),o=this.database.prepare("SELECT * FROM zaip_vw_first_fold_top_tasks_all_time ORDER BY rank").all(),a=(l,_=0)=>typeof l=="number"?l:_,s=l=>typeof l=="number"?l:null,c=l=>{let _=this.database.prepare(`SELECT stage, entity_count FROM zaip_vw_first_fold_${l}_status_all_time`).all(),u=this.database.prepare(`SELECT classification, entity_count FROM zaip_vw_first_fold_${l}_classification_all_time`).all(),f=this.database.prepare(`SELECT * FROM zaip_vw_first_fold_${l}_metrics_all_time`).get(),p=this.database.prepare(`SELECT * FROM zaip_vw_first_fold_top_${l}s_all_time ORDER BY rank`).all();return{status_counts:Object.fromEntries(_.map(y=>[y.stage,Number(y.entity_count)])),classification_counts:Object.fromEntries(u.map(y=>[y.classification,Number(y.entity_count)])),entity_count:a(f.entity_count),total_run_count:a(f.total_run_count),total_duration_ms:s(f.total_duration_ms),total_tokens:s(f.total_tokens),total_cost_usd:s(f.total_cost_usd),total_cost_brl:s(f.total_cost_brl),average_duration_ms:s(f.average_duration_ms),average_tokens:s(f.average_tokens),average_cost_usd:s(f.average_cost_usd),average_cost_brl:s(f.average_cost_brl),latest_created_at:typeof f.latest_created_at=="string"?f.latest_created_at:null,top_entities:p}};return this.firstFoldAllTimeCache={aggregate:{days:typeof t.start_day=="string"&&typeof t.end_day=="string"?this.dailyAggregateRows().length:0,start_day:typeof t.start_day=="string"?t.start_day:null,end_day:typeof t.end_day=="string"?t.end_day:null,task_count:a(t.task_count),completed_task_count:a(t.completed_task_count),spec_count:a(t.spec_count),completed_spec_count:a(t.completed_spec_count),prd_count:a(t.prd_count),completed_prd_count:a(t.completed_prd_count),total_run_count:a(t.total_run_count),agent_invocation_count:a(t.agent_invocation_count),llm_call_count:s(t.llm_call_count),duration_ms:s(t.total_duration_ms),total_tokens:s(t.total_tokens),total_cost_usd:s(t.total_cost_usd),cost_brl:s(t.total_cost_brl),execution_day_count:a(t.execution_day_count),latest_task_created_at:typeof t.latest_task_created_at=="string"?t.latest_task_created_at:null},task_status_counts:Object.fromEntries(n.map(l=>[l.status,Number(l.task_count)])),task_risk_counts:Object.fromEntries(i.map(l=>[l.risk,Number(l.task_count)])),task_metrics:{average_duration_ms_per_task:s(r.average_duration_ms_per_task),average_tokens_per_task:s(r.average_tokens_per_task),average_cost_usd_per_task:s(r.average_cost_usd_per_task),average_cost_brl_per_task:s(r.average_cost_brl_per_task),latest_task_created_at:typeof r.latest_task_created_at=="string"?r.latest_task_created_at:null},top_tasks:o,macro_metrics:{specs:c("spec"),prds:c("prd")}},this.firstFoldAllTimeCache}firstFoldTopTasksAllTime(){return this.firstFoldTopTasksAllTimeCache!==null?this.firstFoldTopTasksAllTimeCache:(this.firstFoldTopTasksAllTimeCache=this.database.prepare("SELECT * FROM zaip_vw_first_fold_top_tasks_all_time ORDER BY rank").all(),this.firstFoldTopTasksAllTimeCache)}firstFoldViewportAllTime(){if(this.firstFoldViewportCache!==null)return this.firstFoldViewportCache;let t=this.database.prepare("SELECT payload_json FROM zaip_aios_activities WHERE payload_type='first_fold_viewport_cache' ORDER BY recorded_at DESC LIMIT 1").get();if(typeof t?.payload_json=="string")return this.firstFoldViewportCache=JSON.parse(t.payload_json),this.firstFoldViewportCache;let n=process.env.ZAIP_DASHBOARD_PROFILE_FIRST_FOLD==="1",r=((s,c)=>{let l=performance.now(),_=c();return n&&(this.firstFoldViewportTimings[s]=Math.round((performance.now()-l)*10)/10),n&&console.info(JSON.stringify({event:"dashboard_first_fold_select",select:s,elapsed_ms:Math.round((performance.now()-l)*10)/10})),_})("viewport_overview",()=>this.database.prepare(`WITH totals AS (
|
|
1142
|
+
SELECT SUM(CASE WHEN activity_source_kind='agent_run' THEN 1 ELSE 0 END) AS agent_invocation_count,
|
|
1143
|
+
SUM(llm_call_count) AS llm_call_count,
|
|
1144
|
+
SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS total_cost_usd,
|
|
1145
|
+
SUM(cost_brl) AS total_cost_brl FROM activities
|
|
1146
|
+
), run_totals AS (
|
|
1147
|
+
SELECT COUNT(*) AS total_run_count FROM canonical_run_index
|
|
1148
|
+
), duration_totals AS (
|
|
1149
|
+
SELECT ROUND(SUM(attributed_token_active_ms)) AS total_duration_ms,
|
|
1150
|
+
COUNT(DISTINCT occurred_day_sp) AS execution_day_count
|
|
1151
|
+
FROM attributed_token_active_facts
|
|
1152
|
+
), bounds AS (
|
|
1153
|
+
SELECT MIN(day) AS start_day, MAX(day) AS end_day, COUNT(*) AS day_count FROM (
|
|
1154
|
+
SELECT occurred_day_sp AS day FROM activities
|
|
1155
|
+
UNION SELECT occurred_day_sp AS day FROM canonical_work_items
|
|
1156
|
+
UNION SELECT occurred_day_sp AS day FROM canonical_artifacts
|
|
1157
|
+
)
|
|
1158
|
+
), canonical_items AS MATERIALIZED (
|
|
1159
|
+
SELECT json_extract(payload_json, '$.entity_kind') AS entity_kind,
|
|
1160
|
+
json_extract(payload_json, '$.id') AS id,
|
|
1161
|
+
json_extract(payload_json, '$.status') AS status,
|
|
1162
|
+
json_extract(payload_json, '$.risk') AS risk,
|
|
1163
|
+
json_extract(payload_json, '$.occurred_at') AS occurred_at
|
|
1164
|
+
FROM zaip_aios_activities WHERE payload_type='work_item'
|
|
1165
|
+
), items AS MATERIALIZED (
|
|
1166
|
+
SELECT entity_kind, id, status, risk, occurred_at FROM canonical_items
|
|
1167
|
+
UNION ALL SELECT 'task', a.task_id, MAX(a.work_item_status), MAX(a.risk), MIN(a.occurred_at)
|
|
1168
|
+
FROM zaip_aios_activities a WHERE a.payload_type IS NULL AND a.task_id IS NOT NULL
|
|
1169
|
+
AND NOT EXISTS (SELECT 1 FROM canonical_items c WHERE c.entity_kind='task' AND c.id=a.task_id)
|
|
1170
|
+
GROUP BY task_id
|
|
1171
|
+
UNION ALL SELECT 'spec', a.spec_id, MAX(a.work_item_status), MAX(a.risk), MIN(a.occurred_at)
|
|
1172
|
+
FROM zaip_aios_activities a WHERE a.payload_type IS NULL AND a.spec_id IS NOT NULL
|
|
1173
|
+
AND NOT EXISTS (SELECT 1 FROM canonical_items c WHERE c.entity_kind='spec' AND c.id=a.spec_id)
|
|
1174
|
+
GROUP BY spec_id
|
|
1175
|
+
UNION ALL SELECT 'prd', a.prd_id, MAX(a.work_item_status), MAX(a.risk), MIN(a.occurred_at)
|
|
1176
|
+
FROM zaip_aios_activities a WHERE a.payload_type IS NULL AND a.prd_id IS NOT NULL
|
|
1177
|
+
AND NOT EXISTS (SELECT 1 FROM canonical_items c WHERE c.entity_kind='prd' AND c.id=a.prd_id)
|
|
1178
|
+
GROUP BY prd_id
|
|
1179
|
+
), item_totals AS (
|
|
1180
|
+
SELECT
|
|
1181
|
+
SUM(entity_kind='task') AS task_count,
|
|
1182
|
+
SUM(entity_kind='task' AND status='completed') AS completed_task_count,
|
|
1183
|
+
MAX(CASE WHEN entity_kind='task' THEN occurred_at END) AS latest_task_created_at,
|
|
1184
|
+
SUM(entity_kind='spec') AS spec_count,
|
|
1185
|
+
SUM(entity_kind='spec' AND status IN ('completed','delivered')) AS completed_spec_count,
|
|
1186
|
+
SUM(entity_kind='prd') AS prd_count,
|
|
1187
|
+
SUM(entity_kind='prd' AND status IN ('completed','delivered')) AS completed_prd_count
|
|
1188
|
+
FROM items
|
|
1189
|
+
), task_status AS (
|
|
1190
|
+
SELECT json_group_object(status, task_count) AS task_status_json FROM (
|
|
1191
|
+
SELECT COALESCE(status, 'draft') AS status, COUNT(*) AS task_count
|
|
1192
|
+
FROM items WHERE entity_kind='task' GROUP BY COALESCE(status, 'draft')
|
|
1193
|
+
)
|
|
1194
|
+
), task_risk AS (
|
|
1195
|
+
SELECT json_group_object(risk, task_count) AS task_risk_json FROM (
|
|
1196
|
+
SELECT COALESCE(risk, 'standard') AS risk, COUNT(*) AS task_count
|
|
1197
|
+
FROM items WHERE entity_kind='task' GROUP BY COALESCE(risk, 'standard')
|
|
1198
|
+
)
|
|
1199
|
+
) SELECT totals.*, run_totals.*, duration_totals.*, bounds.*, item_totals.*, task_status.*, task_risk.*
|
|
1200
|
+
FROM totals CROSS JOIN run_totals CROSS JOIN duration_totals CROSS JOIN bounds
|
|
1201
|
+
CROSS JOIN item_totals CROSS JOIN task_status CROSS JOIN task_risk`).get()),o=(s,c=0)=>typeof s=="number"?s:c,a=s=>typeof s=="number"?s:null;return this.firstFoldViewportCache={aggregate:{days:o(r.day_count),start_day:typeof r.start_day=="string"?r.start_day:null,end_day:typeof r.end_day=="string"?r.end_day:null,task_count:o(r.task_count),completed_task_count:o(r.completed_task_count),spec_count:o(r.spec_count),completed_spec_count:o(r.completed_spec_count),prd_count:o(r.prd_count),completed_prd_count:o(r.completed_prd_count),total_run_count:o(r.total_run_count),agent_invocation_count:o(r.agent_invocation_count),llm_call_count:a(r.llm_call_count),duration_ms:a(r.total_duration_ms),total_tokens:a(r.total_tokens),total_cost_usd:a(r.total_cost_usd),cost_brl:a(r.total_cost_brl),execution_day_count:o(r.execution_day_count),latest_task_created_at:typeof r.latest_task_created_at=="string"?r.latest_task_created_at:null},task_status_counts:typeof r.task_status_json=="string"?JSON.parse(r.task_status_json):{},task_risk_counts:typeof r.task_risk_json=="string"?JSON.parse(r.task_risk_json):{}},this.firstFoldViewportCache}firstFoldViewportProfile(){return this.firstFoldViewportTimings}topTasks(t,n=5){let i=t.from?.slice(0,10)??null,r=t.to?.slice(0,10)??null,o=this.database.prepare(`SELECT task_id, SUM(total_tokens) AS total_tokens, SUM(cost_brl) AS cost_brl, COUNT(*) AS run_count
|
|
1202
|
+
FROM activities WHERE task_id IS NOT NULL AND phase = 'execution'
|
|
1203
|
+
AND (? IS NULL OR occurred_day_sp >= ?) AND (? IS NULL OR occurred_day_sp <= ?)
|
|
1204
|
+
GROUP BY task_id`).all(i,i,r,r),a=this.database.prepare(`SELECT a.task_id, SUM(f.attributed_token_active_ms) AS duration_ms
|
|
1205
|
+
FROM attributed_token_active_facts f JOIN zaip_aios_activities a USING(activity_row_id)
|
|
1206
|
+
WHERE a.task_id IS NOT NULL AND a.phase = 'execution'
|
|
1207
|
+
AND (? IS NULL OR f.occurred_day_sp >= ?) AND (? IS NULL OR f.occurred_day_sp <= ?)
|
|
1208
|
+
GROUP BY a.task_id`).all(i,i,r,r),s=new Map(a.map(c=>[c.task_id,Number(c.duration_ms)]));return o.map(c=>({...c,duration_ms:s.get(c.task_id)??0})).filter(c=>c.duration_ms>0).sort((c,l)=>l.duration_ms-c.duration_ms||c.task_id.localeCompare(l.task_id)).slice(0,n)}canonicalTraceFiles(t){let n=[...new Set(t.filter(Boolean))];if(n.length===0)return[];let i=n.map(()=>"content LIKE ?").join(" OR ");return this.database.prepare(`SELECT path, content FROM files
|
|
1209
|
+
WHERE path LIKE '.agents/records/%' AND (${i}) ORDER BY path`).all(...n.map(r=>`%${r}%`))}taskTraceUsage(t){let n=this.database.prepare(`SELECT run_id, run_role, phase, duration_ms FROM canonical_run_index
|
|
1210
|
+
WHERE task_id = ?`).all(t),i=this.database.prepare("SELECT run_id, total_tokens, cost_brl FROM activities WHERE task_id = ?").all(t),r=n.filter(_=>_.run_role==="root"&&_.phase==="execution"&&typeof _.duration_ms=="number").length,o=this.executionDurationByDay({from:null,to:null},t),a=o.size===0?null:[...o.values()].reduce((_,u)=>_+u,0),s=i.filter(_=>typeof _.total_tokens=="number"),c=i.filter(_=>typeof _.cost_brl=="number"),l=(_,u)=>({value:_,known_runs:u,unknown_runs:Math.max(0,n.length-u),coverage_ratio:n.length===0?1:u/n.length});return{run_count:n.length,duration_ms:l(a,r),total_tokens:l(s.length===0?null:s.reduce((_,u)=>_+Number(u.total_tokens),0),s.length),cost:{...l(c.length===0?null:c.reduce((_,u)=>_+Number(u.cost_brl),0),c.length),currency:c.length===0?null:"BRL"}}}invocationTotals(t){let n=t.from?.slice(0,10)??null,i=t.to?.slice(0,10)??null;return this.database.prepare("SELECT COUNT(*) AS invocation_count, SUM(llm_call_count) AS llm_call_count, SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl FROM invocations WHERE (? IS NULL OR occurred_day_sp >= ?) AND (? IS NULL OR occurred_day_sp <= ?)").get(n,n,i,i)}invocationCostRows(t){let n=t.from?.slice(0,10)??null,i=t.to?.slice(0,10)??null,r="date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours')",o=[`(? IS NULL OR ${r} >= ?)`,`(? IS NULL OR ${r} <= ?)`],a=[n,n,i,i],s=(u,f)=>{f!==void 0&&f.length>0&&(o.push(`${u} IN (${f.map(()=>"?").join(",")})`),a.push(...f))};s("i.zaip_agent",t.agents),s("i.phase",t.phases),s("i.status",t.statuses),s("i.task_id",t.tasks),s("i.spec_id",t.specs),s("i.prd_id",t.prds),s("i.execution_id",t.executions),s("i.change_id",t.changes);let c=(t.providers??[]).filter(u=>u!=="unavailable"),l=(t.models??[]).filter(u=>u!=="unavailable");if(t.providers?.includes("unavailable")===!0||t.models?.includes("unavailable")===!0){let u=(f,p)=>{if(p===void 0||p.length===0)return;let y=p.filter(C=>C!=="unavailable"),v=p.includes("unavailable"),h=y.length===0?"0":`EXISTS (SELECT 1 FROM invocation_usage f WHERE f.agent_invocation_id = i.agent_invocation_id AND f.${f} IN (${y.map(()=>"?").join(",")}))`;y.length>0&&a.push(...y);let O=`NOT EXISTS (SELECT 1 FROM invocation_usage f WHERE f.agent_invocation_id = i.agent_invocation_id AND f.${f} IS NOT NULL AND f.${f} <> 'unavailable')`;o.push(v?`(${h} OR ${O})`:h)};u("provider",t.providers),u("model",t.models)}else if(c.length>0||l.length>0){let u=[];c.length>0&&(u.push(`f.provider IN (${c.map(()=>"?").join(",")})`),a.push(...c)),l.length>0&&(u.push(`f.model IN (${l.map(()=>"?").join(",")})`),a.push(...l)),o.push(`EXISTS (SELECT 1 FROM invocation_usage f WHERE f.agent_invocation_id = i.agent_invocation_id AND ${u.join(" AND ")})`)}return this.database.prepare(`SELECT i.*, CASE COUNT(DISTINCT s.provider) WHEN 0 THEN NULL WHEN 1 THEN MIN(s.provider) ELSE 'mixed' END AS provider, CASE COUNT(DISTINCT s.model) WHEN 0 THEN NULL WHEN 1 THEN MIN(s.model) ELSE 'mixed' END AS model,
|
|
1211
|
+
SUM(s.input_tokens) AS input_tokens, SUM(s.cached_input_tokens) AS cached_input_tokens,
|
|
1212
|
+
SUM(s.output_tokens) AS output_tokens, SUM(s.reasoning_tokens) AS reasoning_tokens,
|
|
1213
|
+
SUM(s.total_tokens) AS total_tokens, SUM(s.cost_usd) AS cost_usd, SUM(s.cost_brl) AS cost_brl
|
|
1214
|
+
FROM invocations i LEFT JOIN invocation_usage s USING(agent_invocation_id)
|
|
1215
|
+
WHERE ${o.join(" AND ")}
|
|
1216
|
+
GROUP BY i.agent_invocation_id ORDER BY i.occurred_at`).all(...a)}costMonitorFactualDurationByDay(t,n=this.costMonitorFinancialActivityRows(t)){let i=n,r=new Set,o=new Map;for(let u of i){let f=typeof u.source_started_at=="string"?u.source_started_at:typeof u.source_occurred_at=="string"?u.source_occurred_at:typeof u.occurred_at=="string"?u.occurred_at:null;if(f===null||!(typeof u.total_tokens=="number"||typeof u.cost_brl=="number"||typeof u.cost_usd=="number"))continue;let y=typeof u.activity_row_id=="string"||typeof u.activity_row_id=="number"?String(u.activity_row_id):String(u.run_id??f);r.add(y)}let a=new Map,s=new Set,c=this.database.prepare("SELECT 1 AS present FROM sqlite_master WHERE name = 'attributed_token_active_facts'").get()!==void 0?"attributed_token_active_facts":"zaip_vw_attributed_token_active_facts",l=Array.from(r);for(let u=0;u<l.length;u+=900){let f=l.slice(u,u+900),p=this.database.prepare(`SELECT activity_row_id, occurred_day_sp, attributed_token_active_ms
|
|
1217
|
+
FROM ${c}
|
|
1218
|
+
WHERE activity_row_id IN (${f.map(()=>"?").join(",")})`).all(...f);for(let y of p){let v=String(y.activity_row_id),h=String(y.occurred_day_sp),O=Number(y.attributed_token_active_ms);if(!Number.isFinite(O)||O<0)continue;let C=a.get(h)??{known_sum:0,activityIds:new Set};C.known_sum+=O,C.activityIds.add(v),a.set(h,C),s.add(v)}}for(let u of i){let f=typeof u.activity_row_id=="string"||typeof u.activity_row_id=="number"?String(u.activity_row_id):null;if(f===null||s.has(f))continue;let p=typeof u.source_started_at=="string"?u.source_started_at:typeof u.source_occurred_at=="string"?u.source_occurred_at:typeof u.occurred_at=="string"?u.occurred_at:null;if(p===null)continue;let y=At(p),v=o.get(y)??new Set;v.add(f),o.set(y,v)}let _=new Map;for(let u of new Set([...a.keys(),...o.keys()])){let f=a.get(u)??{known_sum:0,activityIds:new Set},p=o.get(u)??new Set;_.set(u,{known_sum:f.known_sum,eligible_runs:new Set([...f.activityIds,...p]).size,known_runs:f.activityIds.size})}return _}activityCostRows(t){let n=t.from?.slice(0,10)??null,i=t.to?.slice(0,10)??null,r=["(? IS NULL OR i.occurred_day_sp >= ?)","(? IS NULL OR i.occurred_day_sp <= ?)"],o=[n,n,i,i],a=(s,c)=>{c!==void 0&&c.length>0&&(r.push(`${s} IN (${c.map(()=>"?").join(",")})`),o.push(...c))};return a("i.zaip_agent",t.agents),a("i.provider",t.providers),a("i.model",t.models),a("i.phase",t.phases),a("i.status",t.statuses),a("i.task_id",t.tasks),a("i.spec_id",t.specs),a("i.prd_id",t.prds),a("i.execution_id",t.executions),a("i.change_id",t.changes),this.database.prepare(`SELECT i.*, i.activity_row_id AS agent_invocation_id,
|
|
1219
|
+
i.parent_run_id AS parent_agent_invocation_id
|
|
1220
|
+
FROM activities i WHERE ${r.join(" AND ")} ORDER BY i.occurred_at`).all(...o)}costMonitorFinancialActivityRows(t){let{from:n,to:i,providers:r=[],models:o=[]}=t,a=mt(n),s=mt(i),c="date(COALESCE(a.source_started_at, a.source_occurred_at, a.occurred_at), '-3 hours')",l=["(a.total_tokens IS NOT NULL OR a.cost_brl IS NOT NULL OR a.cost_usd IS NOT NULL)",`(? IS NULL OR ${c} >= ?)`,`(? IS NULL OR ${c} <= ?)`],_=[a,a,s,s],u=(f,p)=>{p!==void 0&&p.length>0&&(l.push(`a.${f} IN (${p.map(()=>"?").join(",")})`),_.push(...p))};if(u("zaip_agent",t.agents),u("phase",t.phases),u("status",t.statuses),u("task_id",t.tasks),u("spec_id",t.specs),u("prd_id",t.prds),u("execution_id",t.executions),u("change_id",t.changes),r.length>0||o.length>0){let f=[];r.length>0&&f.push(`COALESCE(u.provider, 'unavailable') IN (${r.map(()=>"?").join(",")})`),o.length>0&&f.push(`COALESCE(u.model, 'unavailable') IN (${o.map(()=>"?").join(",")})`);let p=[...r,...o],y=[];r.length>0&&y.push(`COALESCE(a.provider, 'unavailable') IN (${r.map(()=>"?").join(",")})`),o.length>0&&y.push(`COALESCE(a.model, 'unavailable') IN (${o.map(()=>"?").join(",")})`),l.push(`((a.agent_run_id IS NULL AND ${y.join(" AND ")}) OR (a.agent_run_id IS NOT NULL AND EXISTS (SELECT 1 FROM invocation_usage u WHERE u.agent_invocation_id = a.agent_run_id AND ${f.join(" AND ")})))`),_.push(...r,...o,...p)}return this.database.prepare(`SELECT
|
|
1221
|
+
a.activity_row_id, a.agent_run_id, a.parent_run_id,
|
|
1222
|
+
a.source_started_at, a.source_finished_at, a.source_occurred_at,
|
|
1223
|
+
a.occurred_at, a.occurred_day_sp, a.run_id,
|
|
1224
|
+
a.task_id, a.execution_id, a.spec_id, a.prd_id, a.change_id,
|
|
1225
|
+
a.zaip_agent, a.provider, a.model, a.phase, a.status,
|
|
1226
|
+
a.duration_ms, a.source_duration_ms, a.duration_provenance,
|
|
1227
|
+
a.total_tokens, a.input_tokens, a.cached_input_tokens,
|
|
1228
|
+
a.output_tokens, a.reasoning_tokens, a.cost_usd, a.cost_brl,
|
|
1229
|
+
a.source_event_count,
|
|
1230
|
+
a.activity_row_id AS agent_invocation_id,
|
|
1231
|
+
a.parent_run_id AS parent_agent_invocation_id
|
|
1232
|
+
FROM activities a WHERE ${l.join(" AND ")} ORDER BY a.occurred_at`).all(..._)}costMonitorSummaryAggregate(t){let{from:n,to:i,providers:r=[],models:o=[]}=t,a=mt(n),s=mt(i),c="date(COALESCE(a.source_started_at, a.source_occurred_at, a.occurred_at), '-3 hours')",l=["(a.total_tokens IS NOT NULL OR a.cost_brl IS NOT NULL OR a.cost_usd IS NOT NULL)",`(? IS NULL OR ${c} >= ?)`,`(? IS NULL OR ${c} <= ?)`],_=[a,a,s,s],u=(L,ne)=>{ne===void 0||ne.length===0||(l.push(`a.${L} IN (${ne.map(()=>"?").join(",")})`),_.push(...ne))};if(u("zaip_agent",t.agents),u("phase",t.phases),u("status",t.statuses),u("task_id",t.tasks),u("spec_id",t.specs),u("prd_id",t.prds),u("execution_id",t.executions),u("change_id",t.changes),r.length>0||o.length>0){let L=[],ne=[],ae=[],ve=[];r.length>0&&(L.push(`COALESCE(u.provider, 'unavailable') IN (${r.map(()=>"?").join(",")})`),ne.push(`COALESCE(a.provider, 'unavailable') IN (${r.map(()=>"?").join(",")})`),ae.push(...r),ve.push(...r)),o.length>0&&(L.push(`COALESCE(u.model, 'unavailable') IN (${o.map(()=>"?").join(",")})`),ne.push(`COALESCE(a.model, 'unavailable') IN (${o.map(()=>"?").join(",")})`),ae.push(...o),ve.push(...o)),l.push(`((a.agent_run_id IS NULL AND ${ne.join(" AND ")}) OR (a.agent_run_id IS NOT NULL AND a.agent_run_id IN (SELECT u.agent_invocation_id FROM invocation_usage u WHERE ${L.join(" AND ")})))`),_.push(...ve,...ae)}let f=`WITH selected AS (
|
|
1233
|
+
SELECT ${c} AS day,
|
|
1234
|
+
CASE WHEN a.phase='conversation' THEN 'conversation'
|
|
1235
|
+
WHEN a.phase='planning' THEN 'planning' ELSE 'execution' END AS phase_key,
|
|
1236
|
+
a.task_id, a.model, a.agent_run_id, a.activity_source_kind,
|
|
1237
|
+
a.source_event_count AS event_count,
|
|
1238
|
+
a.attributed_token_active_ms AS duration_ms,
|
|
1239
|
+
a.input_tokens, a.cached_input_tokens, a.output_tokens, a.reasoning_tokens,
|
|
1240
|
+
a.total_tokens, a.cost_usd, a.cost_brl
|
|
1241
|
+
FROM activities a WHERE ${l.join(" AND ")}
|
|
1242
|
+
)`,y=this.database.prepare(`${f}
|
|
1243
|
+
SELECT day, phase_key, COUNT(*) AS eligible_runs,
|
|
1244
|
+
json_group_array(DISTINCT task_id) AS task_ids_json,
|
|
1245
|
+
COALESCE(SUM(event_count), 0) AS events,
|
|
1246
|
+
SUM(duration_ms) AS duration_ms,
|
|
1247
|
+
SUM(input_tokens) AS input_tokens,
|
|
1248
|
+
SUM(cached_input_tokens) AS cached_input_tokens,
|
|
1249
|
+
SUM(output_tokens) AS output_tokens,
|
|
1250
|
+
SUM(reasoning_tokens) AS reasoning_tokens,
|
|
1251
|
+
SUM(total_tokens) AS total_tokens,
|
|
1252
|
+
SUM(cost_usd) AS cost_usd,
|
|
1253
|
+
SUM(cost_brl) AS cost_brl,
|
|
1254
|
+
COUNT(duration_ms) AS duration_known,
|
|
1255
|
+
COUNT(total_tokens) AS tokens_known,
|
|
1256
|
+
COUNT(cost_usd) AS usd_known,
|
|
1257
|
+
COUNT(cost_brl) AS brl_known
|
|
1258
|
+
FROM selected GROUP BY day, phase_key ORDER BY day, phase_key`).all(..._),v=["duration_ms","input_tokens","cached_input_tokens","output_tokens","reasoning_tokens","total_tokens","cost_usd","cost_brl"],h=["eligible_runs","events","duration_known","tokens_known","usd_known","brl_known"],O=(L,ne)=>{let ae={key:L};for(let Ne of h)ae[Ne]=ne.reduce((Ye,ot)=>Ye+(typeof ot[Ne]=="number"?Number(ot[Ne]):0),0);for(let Ne of v){let Ye=ne.filter(ot=>typeof ot[Ne]=="number");ae[Ne]=Ye.length===0?null:Ye.reduce((ot,Ct)=>ot+Number(Ct[Ne]),0)}let ve=new Set;for(let Ne of ne)if(typeof Ne.task_ids_json=="string")for(let Ye of JSON.parse(Ne.task_ids_json))typeof Ye=="string"&&ve.add(Ye);return ae.task_count=ve.size,ae},D=["conversation","planning","execution"].map(L=>O(L,y.filter(ne=>ne.phase_key===L)));D.push(O("total",y));let b=[...new Set(y.map(L=>String(L.day)))].map(L=>O(L,y.filter(ne=>String(ne.day)===L))),E=this.database.prepare(`WITH canonical_ids AS MATERIALIZED (
|
|
1259
|
+
SELECT entity_kind AS kind, id FROM canonical_work_items
|
|
1260
|
+
), work_item_days AS (
|
|
1261
|
+
SELECT entity_kind AS kind, id, occurred_day_sp AS day FROM canonical_work_items
|
|
1262
|
+
UNION ALL
|
|
1263
|
+
SELECT 'task', a.task_id, MIN(a.occurred_day_sp) FROM activities a
|
|
1264
|
+
LEFT JOIN canonical_ids c ON c.kind='task' AND c.id=a.task_id
|
|
1265
|
+
WHERE a.task_id IS NOT NULL AND c.id IS NULL
|
|
1266
|
+
GROUP BY a.task_id
|
|
1267
|
+
UNION ALL
|
|
1268
|
+
SELECT 'spec', a.spec_id, MIN(a.occurred_day_sp) FROM activities a
|
|
1269
|
+
LEFT JOIN canonical_ids c ON c.kind='spec' AND c.id=a.spec_id
|
|
1270
|
+
WHERE a.spec_id IS NOT NULL AND c.id IS NULL
|
|
1271
|
+
GROUP BY a.spec_id
|
|
1272
|
+
UNION ALL
|
|
1273
|
+
SELECT 'prd', a.prd_id, MIN(a.occurred_day_sp) FROM activities a
|
|
1274
|
+
LEFT JOIN canonical_ids c ON c.kind='prd' AND c.id=a.prd_id
|
|
1275
|
+
WHERE a.prd_id IS NOT NULL AND c.id IS NULL
|
|
1276
|
+
GROUP BY a.prd_id
|
|
1277
|
+
), structural AS (
|
|
1278
|
+
SELECT day,
|
|
1279
|
+
SUM(CASE WHEN kind='prd' THEN 1 ELSE 0 END) AS prd_count,
|
|
1280
|
+
SUM(CASE WHEN kind='spec' THEN 1 ELSE 0 END) AS spec_count,
|
|
1281
|
+
SUM(CASE WHEN kind='task' THEN 1 ELSE 0 END) AS task_count,
|
|
1282
|
+
0 AS validation_count, 0 AS evidence_count
|
|
1283
|
+
FROM work_item_days
|
|
1284
|
+
WHERE day IS NOT NULL
|
|
1285
|
+
AND (? IS NULL OR day >= ?)
|
|
1286
|
+
AND (? IS NULL OR day <= ?)
|
|
1287
|
+
GROUP BY day
|
|
1288
|
+
UNION ALL
|
|
1289
|
+
SELECT occurred_day_sp,
|
|
1290
|
+
0, 0, 0,
|
|
1291
|
+
SUM(CASE WHEN artifact_kind='validation' THEN 1 ELSE 0 END),
|
|
1292
|
+
SUM(CASE WHEN artifact_kind='evidence' THEN 1 ELSE 0 END)
|
|
1293
|
+
FROM canonical_artifacts
|
|
1294
|
+
WHERE occurred_day_sp IS NOT NULL
|
|
1295
|
+
AND (? IS NULL OR occurred_day_sp >= ?)
|
|
1296
|
+
AND (? IS NULL OR occurred_day_sp <= ?)
|
|
1297
|
+
GROUP BY occurred_day_sp
|
|
1298
|
+
)
|
|
1299
|
+
SELECT day,
|
|
1300
|
+
SUM(prd_count) AS prd_count,
|
|
1301
|
+
SUM(spec_count) AS spec_count,
|
|
1302
|
+
SUM(task_count) AS task_count,
|
|
1303
|
+
SUM(validation_count) AS validation_count,
|
|
1304
|
+
SUM(evidence_count) AS evidence_count
|
|
1305
|
+
FROM structural GROUP BY day ORDER BY day`).all(a,a,s,s,a,a,s,s),A=L=>typeof L=="number"?L:0,R=L=>typeof L=="number"?L:null,I=L=>{let ne=A(L?.eligible_runs);return{events:A(L?.events),duration_ms:R(L?.duration_ms),tokens:{input:R(L?.input_tokens),cached_input:R(L?.cached_input_tokens),output:R(L?.output_tokens),reasoning:R(L?.reasoning_tokens),total:R(L?.total_tokens)},cost:{usd:R(L?.cost_usd),brl:R(L?.cost_brl)},coverage:{events:A(L?.events),tokens:A(L?.tokens_known),usd:A(L?.usd_known),brl:A(L?.brl_known)},_duration_population:{eligible_runs:ne,known_runs:A(L?.duration_known)}}},V=new Map(D.map(L=>[String(L.key),L])),le=V.get("total"),re=L=>{let{_duration_population:ne,...ae}=L;return ae},K=re(I(V.get("conversation"))),pe=re(I(V.get("planning"))),Me=re(I(V.get("execution"))),ye=re(I(V.get("total"))),De=re(I()),ze=new Map(b.map(L=>[String(L.key),L])),X=new Map(E.map(L=>[String(L.day),L])),F=[...new Set([...ze.keys(),...X.keys()])].sort().map(L=>{let ne=ze.get(L),ae=X.get(L),ve=A(ne?.eligible_runs),Ne=A(ne?.duration_known);return{key:L,prd_count:A(ae?.prd_count),spec_count:A(ae?.spec_count),task_count:A(ae?.task_count),validation_count:A(ae?.validation_count),evidence_count:A(ae?.evidence_count),total_run_count:ve,total_duration:R(ne?.duration_ms),duration_known:A(ne?.duration_ms),duration_unknown:Math.max(0,ve-Ne),total_tokens:R(ne?.total_tokens),total_cost_usd:R(ne?.cost_usd),total_cost_brl:R(ne?.cost_brl),source_event_count:A(ne?.events)}}),fe=Object.fromEntries(F.map(L=>{let ne=ze.get(L.key),ae=A(ne?.eligible_runs),ve=A(ne?.tokens_known),Ne=A(ne?.brl_known);return[L.key,{prds:L.prd_count,specs:L.spec_count,tasks:L.task_count,validations:L.validation_count,evidences:L.evidence_count,runs:ae,usage:{total_tokens:{known_sum:A(ne?.total_tokens),unknown:ae-ve,complete:ve===ae,coverage_ratio:ae===0?1:ve/ae},cost:{known_sum:A(ne?.cost_brl),unknown:ae-Ne,complete:Ne===ae,coverage_ratio:ae===0?1:Ne/ae,currency:"BRL"}},events:{known_sum:A(ne?.events),unknown:0,complete:!0,coverage_ratio:1}}]})),Xe=Object.fromEntries(b.map(L=>{let ne=I(L);return[String(L.key),{known_sum:A(L.duration_ms),eligible_runs:ne._duration_population.eligible_runs,known_runs:ne._duration_population.known_runs}]})),me=this.database.prepare(`${f},
|
|
1306
|
+
segment_totals AS (
|
|
1307
|
+
SELECT agent_invocation_id, SUM(total_tokens) AS total_tokens,
|
|
1308
|
+
SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl
|
|
1309
|
+
FROM cost_invocation_dimension_facts
|
|
1310
|
+
WHERE total_tokens IS NOT NULL OR cost_usd IS NOT NULL OR cost_brl IS NOT NULL
|
|
1311
|
+
GROUP BY agent_invocation_id
|
|
1312
|
+
), components AS (
|
|
1313
|
+
-- Agent facts can contain several observed models. Attribute their
|
|
1314
|
+
-- financial components to the model segment, never to a mixed parent.
|
|
1315
|
+
SELECT CASE WHEN f.model IS NULL OR trim(f.model) = '' OR lower(f.model) IN ('unavailable', 'unknown', 'mixed')
|
|
1316
|
+
THEN 'unavailable' ELSE f.model END AS key,
|
|
1317
|
+
SUM(f.total_tokens) AS total_tokens, SUM(f.cost_usd) AS total_cost_usd,
|
|
1318
|
+
SUM(f.cost_brl) AS total_cost_brl
|
|
1319
|
+
FROM selected s JOIN cost_invocation_dimension_facts f
|
|
1320
|
+
ON f.agent_invocation_id=s.agent_run_id
|
|
1321
|
+
WHERE s.agent_run_id IS NOT NULL
|
|
1322
|
+
GROUP BY key
|
|
1323
|
+
UNION ALL
|
|
1324
|
+
-- Non-agent financial facts have no invocation segments, so their
|
|
1325
|
+
-- observed model remains the only factual dimension.
|
|
1326
|
+
SELECT CASE WHEN model IS NULL OR trim(model) = '' OR lower(model) IN ('unavailable', 'unknown', 'mixed')
|
|
1327
|
+
THEN 'unavailable' ELSE model END AS key,
|
|
1328
|
+
SUM(total_tokens), SUM(cost_usd), SUM(cost_brl)
|
|
1329
|
+
FROM selected WHERE agent_run_id IS NULL GROUP BY key
|
|
1330
|
+
UNION ALL
|
|
1331
|
+
-- Preserve any consolidated invocation remainder as Sem dimens\xE3o so
|
|
1332
|
+
-- the model chart reconciles to the same financial population.
|
|
1333
|
+
SELECT 'unavailable' AS key,
|
|
1334
|
+
SUM(s.total_tokens - COALESCE(st.total_tokens, 0)),
|
|
1335
|
+
SUM(s.cost_usd - COALESCE(st.cost_usd, 0)),
|
|
1336
|
+
SUM(s.cost_brl - COALESCE(st.cost_brl, 0))
|
|
1337
|
+
FROM selected s LEFT JOIN segment_totals st ON st.agent_invocation_id=s.agent_run_id
|
|
1338
|
+
WHERE s.agent_run_id IS NOT NULL
|
|
1339
|
+
AND (s.total_tokens <> COALESCE(st.total_tokens, 0)
|
|
1340
|
+
OR s.cost_usd <> COALESCE(st.cost_usd, 0)
|
|
1341
|
+
OR s.cost_brl <> COALESCE(st.cost_brl, 0))
|
|
1342
|
+
)
|
|
1343
|
+
SELECT key, 0 AS invocation_count, NULL AS task_count,
|
|
1344
|
+
NULL AS total_duration, 0 AS duration_unknown, 0 AS duration_known,
|
|
1345
|
+
0 AS source_event_count, SUM(total_tokens) AS total_tokens,
|
|
1346
|
+
SUM(total_cost_usd) AS total_cost_usd, SUM(total_cost_brl) AS total_cost_brl
|
|
1347
|
+
FROM components GROUP BY key ORDER BY total_cost_brl DESC, key`).all(..._).map(L=>{let ne=R(L.total_duration),ae=A(L.duration_unknown),ve=R(L.duration_known)??ne??0;return{key:String(L.key??"unavailable"),label:String(L.label??L.key??"unavailable"),latest_started_at:"",run_count:A(L.invocation_count),task_count:R(L.task_count),prd_count:0,spec_count:0,evidence_count:0,test_count:0,event_count:A(L.source_event_count),total_tokens:R(L.total_tokens),estimated_usd:R(L.total_cost_usd),estimated_brl:R(L.total_cost_brl),duration_ms:ne,duration:{known_sum:ve,unknown:ae,complete:ae===0,coverage_ratio:ae===0?1:0},coverage:{events:0,tokens:0,usd:0,brl:0}}});return{periods:{daily:fe},aggregate_usage:{conversation:K,planning:pe,execution:Me,total:ye,new_work:ye,rework:De},task_count:A(le?.task_count),model_groups:me,cost_monitor_daily_duration:Xe,daily_rows:F}}summaryPage(t,n,i,r,o=null){let a="operations_work_summary",s=n.from?.slice(0,10)??null,c=n.to?.slice(0,10)??null,l=S0(o),_=["entity_kind = ?","(? IS NULL OR occurred_day_sp >= ?)","(? IS NULL OR occurred_day_sp <= ?)"],u=[t,s,s,c,c];n.status&&(_.push("status = ?"),u.push(n.status)),n.risk&&(_.push("risk = ?"),u.push(n.risk)),n.query&&(_.push("(id LIKE ? OR title LIKE ?)"),u.push(`%${n.query}%`,`%${n.query}%`));let f=_.join(" AND "),p=[...u];l!==null&&(_.push("(occurred_at < ? OR (occurred_at = ? AND id < ?))"),u.push(l[0],l[0],l[1]));let y=_.join(" AND "),v=Number(this.database.prepare(`SELECT COUNT(*) AS count FROM ${a} WHERE ${f}`).get(...p).count),h=l===null?i:0,O=this.database.prepare(`SELECT id, title, status, risk, occurred_at, occurred_day_sp,
|
|
1348
|
+
invocation_count, llm_call_count, total_duration, total_tokens, total_cost_usd, total_cost_brl
|
|
1349
|
+
FROM ${a} WHERE ${y} ORDER BY occurred_at DESC, id DESC LIMIT ? OFFSET ?`).all(...u,r,h),C=O.at(-1);return{data_source:"sqlite_read_model",kind:t,offset:h,limit:r,total:v,has_more:O.length===r&&(l!==null||h+O.length<v),next_cursor:C===void 0||O.length<r?null:b0(String(C.occurred_at),String(C.id)),rows:O}}overviewPage(t,n,i){let r=Number(this.database.prepare("SELECT COUNT(*) AS count FROM overview WHERE period_kind = ?").get(t).count),o=this.database.prepare(`SELECT o.*, op.operations_total_duration, cm.cost_monitor_total_duration, cm.total_tokens, cm.total_cost_usd, cm.total_cost_brl
|
|
1350
|
+
FROM overview o JOIN operations_overview op USING(period_kind, period_key) JOIN cost_monitor_overview cm USING(period_kind, period_key)
|
|
1351
|
+
WHERE o.period_kind = ? ORDER BY o.period_key DESC LIMIT ? OFFSET ?`).all(t,i,n),a=this.executionDurationByDay({from:null,to:null});for(let s of o)s.operations_total_duration=[...a].filter(([c])=>t==="day"?c===s.period_key:c.startsWith(String(s.period_key))).reduce((c,[,l])=>c+l,0);return{data_source:"sqlite_read_model",kind:"overview",period:t,offset:n,limit:i,total:r,has_more:n+o.length<r,rows:o}}viewPage(t,n){let i=`${t}:${JSON.stringify(n)}`,r=this.viewPageResultCache.get(i);if(r!==void 0)return structuredClone(r);let o=this.uncachedViewPage(t,n);if(this.viewPageResultCache.size>=256){let a=this.viewPageResultCache.keys().next().value;a!==void 0&&this.viewPageResultCache.delete(a)}return this.viewPageResultCache.set(i,structuredClone(o)),o}uncachedViewPage(t,n){if(["operations_work_kanban","operations_executions","operations_agent_invocations","operations_conversations"].includes(t)&&!n.from&&!n.to&&!n.query&&!n.status&&!n.risk&&!n.provider&&!n.model&&!n.agent&&!n.phase&&!n.origin&&!n.workType&&!n.priority){let b=this.unfilteredViewRows(t),E=Math.min(200,Math.max(1,n.limit??100)),A=Math.max(0,n.offset??0),R=b.slice(A,A+E);return{data_source:"sqlite_read_model",view:t,offset:A,limit:E,total_count:b.length,has_more:A+R.length<b.length,rows:R}}if(t==="operations_work_list"&&!n.from&&!n.to&&!n.query&&!n.status&&!n.risk){let b=this.operationsWorkListRows(),E=Math.min(200,Math.max(1,n.limit??50)),A=Math.max(0,n.offset??0),R=b.slice(A,A+E);return{data_source:"sqlite_read_model",view:t,offset:A,limit:E,total_count:b.length,has_more:A+R.length<b.length,rows:R}}if(t==="cost_monitor_agent_invocations"){let b="date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours')",E=[`(? IS NULL OR ${b} >= ?)`,`(? IS NULL OR ${b} <= ?)`],A=mt(n.from),R=mt(n.to),I=[A,A,R,R],V=(De,ze)=>{ze&&(E.push(`${De} = ?`),I.push(ze))};V("i.zaip_agent",n.agent),V("i.phase",n.phase),V("i.status",n.status);let le=[];n.provider&&(n.provider==="unavailable"?E.push("((i.agent_invocation_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM invocation_usage known_provider WHERE known_provider.agent_invocation_id=i.agent_invocation_id AND known_provider.provider IS NOT NULL AND known_provider.provider <> 'unavailable')) OR (i.agent_invocation_id IS NULL AND (i.provider IS NULL OR i.provider = 'unavailable')))"):(le.push("f.provider=?"),I.push(n.provider))),n.model&&(n.model==="unavailable"?E.push("((i.agent_invocation_id IS NOT NULL AND NOT EXISTS (SELECT 1 FROM invocation_usage known_model WHERE known_model.agent_invocation_id=i.agent_invocation_id AND known_model.model IS NOT NULL AND known_model.model <> 'unavailable')) OR (i.agent_invocation_id IS NULL AND (i.model IS NULL OR i.model = 'unavailable')))"):(le.push("f.model=?"),I.push(n.model))),le.length>0&&E.push(`EXISTS (SELECT 1 FROM invocation_usage f WHERE f.agent_invocation_id=i.agent_invocation_id AND ${le.join(" AND ")})`),n.query&&(E.push("(i.agent_invocation_id LIKE ? OR i.task_id LIKE ? OR i.execution_id LIKE ?)"),I.push(`%${n.query}%`,`%${n.query}%`,`%${n.query}%`));let re=E.join(" AND "),K=Math.min(200,Math.max(1,n.limit??100)),pe=Math.max(0,n.offset??0),Me=Number(this.database.prepare(`SELECT COUNT(*) AS count FROM cost_agent_invocations i WHERE ${re}`).get(...I).count),ye=this.database.prepare(`SELECT i.* FROM cost_agent_invocations i WHERE ${re} ORDER BY i.occurred_at DESC, i.agent_invocation_id DESC LIMIT ? OFFSET ?`).all(...I,K,pe);return{data_source:"sqlite_read_model",view:t,offset:pe,limit:K,total_count:Me,has_more:pe+ye.length<Me,rows:ye}}let o={cost_monitor_daily:"day",cost_monitor_monthly:"month",cost_monitor_annual:"year",cost_monitor_zaip_agents:"agent",cost_monitor_models:"model",cost_monitor_providers:"provider"}[t];if((o==="model"||o==="provider")&&!n.from&&!n.to&&!n.query&&!n.status&&!n.risk&&!n.provider&&!n.model&&!n.agent&&!n.phase&&!n.origin&&!n.workType&&!n.priority){let b=o,E=this.database.prepare(`SELECT
|
|
1352
|
+
json_extract(payload_json, '$.key') AS key,
|
|
1353
|
+
json_extract(payload_json, '$.label') AS label,
|
|
1354
|
+
json_extract(payload_json, '$.invocation_count') AS invocation_count,
|
|
1355
|
+
json_extract(payload_json, '$.task_count') AS task_count,
|
|
1356
|
+
json_extract(payload_json, '$.total_duration') AS total_duration,
|
|
1357
|
+
json_extract(payload_json, '$.source_event_count') AS source_event_count,
|
|
1358
|
+
json_extract(payload_json, '$.total_tokens') AS total_tokens,
|
|
1359
|
+
json_extract(payload_json, '$.total_cost_usd') AS total_cost_usd,
|
|
1360
|
+
json_extract(payload_json, '$.total_cost_brl') AS total_cost_brl
|
|
1361
|
+
FROM zaip_aios_activities
|
|
1362
|
+
WHERE payload_type='cost_dimension_aggregate_v1'
|
|
1363
|
+
AND json_extract(payload_json, '$.dimension')=?
|
|
1364
|
+
ORDER BY total_cost_brl DESC, key`).all(b),A=Math.min(200,Math.max(1,n.limit??50)),R=Math.max(0,n.offset??0),I=E.slice(R,R+A);return{data_source:"sqlite_read_model",view:t,offset:R,limit:A,total_count:E.length,has_more:R+I.length<E.length,rows:I}}if(o==="agent"){let b=["i.zaip_agent IS NOT NULL"],E=[];if(n.from&&(b.push("date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours') >= ?"),E.push(n.from.slice(0,10))),n.to&&(b.push("date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours') <= ?"),E.push(n.to.slice(0,10))),n.agent&&(b.push("i.zaip_agent = ?"),E.push(n.agent)),n.phase&&(b.push("i.phase = ?"),E.push(n.phase)),n.status&&(b.push("i.status = ?"),E.push(n.status)),n.priority&&b.push("0"),n.risk&&(b.push("t.risk = ?"),E.push(n.risk)),n.origin){let F=n.origin==="prd"?"i.prd_id IS NOT NULL":n.origin==="spec"?"i.prd_id IS NULL AND i.spec_id IS NOT NULL":n.origin==="task"?"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NOT NULL":"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NULL";b.push(F)}n.workType&&b.push("0");let A=[];if(n.provider&&(n.provider==="unavailable"?b.push("NOT EXISTS (SELECT 1 FROM invocation_usage known_provider WHERE known_provider.agent_invocation_id=i.agent_invocation_id AND known_provider.provider IS NOT NULL AND known_provider.provider <> 'unavailable')"):(A.push("f.provider = ?"),E.push(n.provider))),n.model&&(n.model==="unavailable"?b.push("NOT EXISTS (SELECT 1 FROM invocation_usage known_model WHERE known_model.agent_invocation_id=i.agent_invocation_id AND known_model.model IS NOT NULL AND known_model.model <> 'unavailable')"):(A.push("f.model = ?"),E.push(n.model))),A.length>0&&b.push(`EXISTS (SELECT 1 FROM invocation_usage f WHERE f.agent_invocation_id=i.agent_invocation_id AND ${A.join(" AND ")})`),n.query){let F=`%${n.query}%`;b.push("(i.zaip_agent LIKE ? OR i.zaip_agent_persona LIKE ? OR i.zaip_agent_job LIKE ?)"),E.push(F,F,F)}let R="date(COALESCE(a.source_started_at, a.source_occurred_at, a.occurred_at), '-3 hours')",I=["a.activity_source_kind <> 'agent_run'","a.zaip_agent IS NOT NULL","(a.total_tokens IS NOT NULL OR a.cost_brl IS NOT NULL OR a.cost_usd IS NOT NULL)"],V=[];if(n.from&&(I.push(`${R} >= ?`),V.push(n.from.slice(0,10))),n.to&&(I.push(`${R} <= ?`),V.push(n.to.slice(0,10))),n.agent&&(I.push("a.zaip_agent = ?"),V.push(n.agent)),n.phase&&(I.push("a.phase = ?"),V.push(n.phase)),n.status&&(I.push("a.status = ?"),V.push(n.status)),(n.priority||n.workType)&&I.push("0"),n.risk&&(I.push("activity_task.risk = ?"),V.push(n.risk)),n.origin&&I.push(n.origin==="prd"?"a.prd_id IS NOT NULL":n.origin==="spec"?"a.prd_id IS NULL AND a.spec_id IS NOT NULL":n.origin==="task"?"a.prd_id IS NULL AND a.spec_id IS NULL AND a.task_id IS NOT NULL":"a.prd_id IS NULL AND a.spec_id IS NULL AND a.task_id IS NULL"),n.provider||n.model){let F=[],fe=[];n.provider&&(F.push("COALESCE(a.provider, 'unavailable') = ?"),fe.push("COALESCE(u.provider, 'unavailable') = ?"),V.push(n.provider)),n.model&&(F.push("COALESCE(a.model, 'unavailable') = ?"),fe.push("COALESCE(u.model, 'unavailable') = ?"),V.push(n.model)),I.push(`((a.agent_run_id IS NULL AND ${F.join(" AND ")}) OR (a.agent_run_id IS NOT NULL AND EXISTS (SELECT 1 FROM invocation_usage u WHERE u.agent_invocation_id = a.agent_run_id AND ${fe.join(" AND ")})))`),n.provider&&V.push(n.provider),n.model&&V.push(n.model)}if(n.query){let F=`%${n.query}%`;I.push("(a.zaip_agent LIKE ? OR a.zaip_agent_persona LIKE ? OR a.zaip_agent_job LIKE ?)"),V.push(F,F,F)}let le=b.join(" AND "),re=["i.zaip_agent IS NOT NULL","(i.total_tokens IS NOT NULL OR i.cost_brl IS NOT NULL OR i.cost_usd IS NOT NULL)"],K=[],pe="date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours')";if(n.from&&(re.push(`${pe} >= ?`),K.push(n.from.slice(0,10))),n.to&&(re.push(`${pe} <= ?`),K.push(n.to.slice(0,10))),n.agent&&(re.push("i.zaip_agent = ?"),K.push(n.agent)),n.phase&&(re.push("i.phase = ?"),K.push(n.phase)),n.status&&(re.push("i.status = ?"),K.push(n.status)),(n.priority||n.workType)&&re.push("0"),n.risk&&(re.push("invocation_task.risk = ?"),K.push(n.risk)),n.origin&&re.push(n.origin==="prd"?"i.prd_id IS NOT NULL":n.origin==="spec"?"i.prd_id IS NULL AND i.spec_id IS NOT NULL":n.origin==="task"?"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NOT NULL":"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NULL"),n.provider||n.model){let F=[];n.provider&&(F.push("COALESCE(u.provider, 'unavailable') = ?"),K.push(n.provider)),n.model&&(F.push("COALESCE(u.model, 'unavailable') = ?"),K.push(n.model)),re.push(`EXISTS (SELECT 1 FROM invocation_usage u WHERE u.agent_invocation_id=i.agent_invocation_id AND ${F.join(" AND ")})`)}if(n.query){let F=`%${n.query}%`;re.push("(i.zaip_agent LIKE ? OR i.zaip_agent_persona LIKE ? OR i.zaip_agent_job LIKE ?)"),K.push(F,F,F)}let Me=`WITH agent_facts AS (
|
|
1365
|
+
SELECT i.zaip_agent AS key, i.zaip_agent_persona AS persona, i.zaip_agent_job AS job, d.persona AS catalog_persona, d.job AS catalog_job,
|
|
1366
|
+
i.occurred_at, i.task_id, i.duration_ms, i.source_event_count, i.total_tokens, i.cost_usd, i.cost_brl
|
|
1367
|
+
FROM invocations i LEFT JOIN tasks invocation_task ON invocation_task.id=i.task_id LEFT JOIN zaip_dim_zaip_agent d ON d.zaip_agent = i.zaip_agent
|
|
1368
|
+
WHERE ${re.join(" AND ")}
|
|
1369
|
+
UNION ALL
|
|
1370
|
+
SELECT a.zaip_agent AS key, a.zaip_agent_persona AS persona, a.zaip_agent_job AS job, d.persona AS catalog_persona, d.job AS catalog_job,
|
|
1371
|
+
a.occurred_at, a.task_id, a.attributed_token_active_ms AS duration_ms, a.source_event_count, a.total_tokens, a.cost_usd, a.cost_brl
|
|
1372
|
+
FROM activities a LEFT JOIN tasks activity_task ON activity_task.id=a.task_id LEFT JOIN zaip_dim_zaip_agent d ON d.zaip_agent = a.zaip_agent
|
|
1373
|
+
WHERE ${I.join(" AND ")}
|
|
1374
|
+
)`,ye=Math.min(200,Math.max(1,n.limit??50)),De=Math.max(0,n.offset??0),ze=Number(this.database.prepare(`${Me} SELECT COUNT(DISTINCT key) AS count FROM agent_facts`).get(...K,...V).count),X=this.database.prepare(`${Me} SELECT COUNT(*) AS invocation_count, COUNT(DISTINCT task_id) AS task_count, SUM(duration_ms) AS total_duration, SUM(CASE WHEN duration_ms IS NULL THEN 1 ELSE 0 END) AS duration_unknown, SUM(CASE WHEN duration_ms IS NULL THEN 0 ELSE duration_ms END) AS duration_known, SUM(source_event_count) AS source_event_count, SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS total_cost_usd, SUM(cost_brl) AS total_cost_brl FROM agent_facts`).get(...K,...V),we=this.database.prepare(`${Me} SELECT key, key AS label, COALESCE(MAX(persona), MAX(catalog_persona)) AS persona, COALESCE(MAX(job), MAX(catalog_job)) AS job, MAX(occurred_at) AS latest_started_at, COUNT(*) AS invocation_count, COUNT(DISTINCT task_id) AS task_count, SUM(duration_ms) AS total_duration, SUM(CASE WHEN duration_ms IS NULL THEN 1 ELSE 0 END) AS duration_unknown, SUM(CASE WHEN duration_ms IS NULL THEN 0 ELSE duration_ms END) AS duration_known, SUM(source_event_count) AS source_event_count, SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS total_cost_usd, SUM(cost_brl) AS total_cost_brl FROM agent_facts GROUP BY key ORDER BY total_cost_brl DESC, key LIMIT ? OFFSET ?`).all(...K,...V,ye,De);return{data_source:"sqlite_read_model",view:t,offset:De,limit:ye,total_count:ze,has_more:De+we.length<ze,totals:X,rows:we}}if(o==="model"){let b=["1=1"],E=[];n.from&&(b.push("date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours') >= ?"),E.push(n.from.slice(0,10))),n.to&&(b.push("date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours') <= ?"),E.push(n.to.slice(0,10))),n.agent&&(b.push("i.zaip_agent = ?"),E.push(n.agent)),n.phase&&(b.push("i.phase = ?"),E.push(n.phase)),n.status&&(b.push("i.status = ?"),E.push(n.status)),(n.priority||n.workType)&&b.push("0"),n.risk&&(b.push("t.risk = ?"),E.push(n.risk)),n.origin&&b.push(n.origin==="prd"?"i.prd_id IS NOT NULL":n.origin==="spec"?"i.prd_id IS NULL AND i.spec_id IS NOT NULL":n.origin==="task"?"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NOT NULL":"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NULL"),n.provider&&(n.provider==="unavailable"?b.push("s.provider IS NULL AND NOT EXISTS (SELECT 1 FROM invocation_usage known_provider WHERE known_provider.agent_invocation_id=i.agent_invocation_id AND known_provider.provider IS NOT NULL AND known_provider.provider <> 'unavailable')"):(b.push("s.provider = ?"),E.push(n.provider))),n.model&&(n.model==="unavailable"?b.push("s.model_key = 'unavailable'"):(b.push("s.model_key = ?"),E.push(n.model))),n.query&&(b.push("s.model_key LIKE ?"),E.push(`%${n.query}%`));let A=b.join(" AND "),R=["a.activity_source_kind <> 'agent_run'"],I=[];n.from&&(R.push("a.occurred_day_sp >= ?"),I.push(n.from.slice(0,10))),n.to&&(R.push("a.occurred_day_sp <= ?"),I.push(n.to.slice(0,10))),n.agent&&(R.push("a.zaip_agent = ?"),I.push(n.agent)),n.phase&&(R.push("a.phase = ?"),I.push(n.phase)),n.status&&(R.push("a.status = ?"),I.push(n.status)),(n.priority||n.workType)&&R.push("0"),n.risk&&(R.push("activity_task.risk = ?"),I.push(n.risk)),n.origin&&R.push(n.origin==="prd"?"a.prd_id IS NOT NULL":n.origin==="spec"?"a.prd_id IS NULL AND a.spec_id IS NOT NULL":n.origin==="task"?"a.prd_id IS NULL AND a.spec_id IS NULL AND a.task_id IS NOT NULL":"a.prd_id IS NULL AND a.spec_id IS NULL AND a.task_id IS NULL"),n.provider&&(n.provider==="unavailable"?R.push("a.provider IS NULL OR trim(a.provider) = '' OR a.provider = 'unavailable'"):(R.push("a.provider = ?"),I.push(n.provider))),n.model&&(n.model==="unavailable"?R.push("a.model IS NULL OR trim(a.model) = '' OR a.model = 'unavailable'"):(R.push("a.model = ?"),I.push(n.model))),n.query&&(R.push("COALESCE(a.model, 'unavailable') LIKE ?"),I.push(`%${n.query}%`));let V=`WITH segment_totals AS (
|
|
1375
|
+
SELECT agent_invocation_id, SUM(input_tokens) AS input_tokens, SUM(cached_input_tokens) AS cached_input_tokens,
|
|
1376
|
+
SUM(output_tokens) AS output_tokens, SUM(reasoning_tokens) AS reasoning_tokens,
|
|
1377
|
+
SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl
|
|
1378
|
+
FROM cost_invocation_dimension_facts
|
|
1379
|
+
WHERE total_tokens IS NOT NULL OR cost_usd IS NOT NULL OR cost_brl IS NOT NULL
|
|
1380
|
+
GROUP BY agent_invocation_id
|
|
1381
|
+
), segments AS (
|
|
1382
|
+
SELECT agent_invocation_id,
|
|
1383
|
+
CASE WHEN model IS NULL OR trim(model) = '' OR model = 'unavailable' THEN 'unavailable' ELSE model END AS model_key,
|
|
1384
|
+
CASE WHEN provider IS NULL OR trim(provider) = '' OR provider = 'unavailable' THEN NULL ELSE provider END AS provider,
|
|
1385
|
+
SUM(input_tokens) AS input_tokens, SUM(cached_input_tokens) AS cached_input_tokens,
|
|
1386
|
+
SUM(output_tokens) AS output_tokens, SUM(reasoning_tokens) AS reasoning_tokens,
|
|
1387
|
+
SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl
|
|
1388
|
+
FROM cost_invocation_dimension_facts
|
|
1389
|
+
WHERE total_tokens IS NOT NULL OR cost_usd IS NOT NULL OR cost_brl IS NOT NULL
|
|
1390
|
+
GROUP BY agent_invocation_id, model_key, provider
|
|
1391
|
+
UNION ALL
|
|
1392
|
+
-- Preserve every factual residual from the consolidated invocation:
|
|
1393
|
+
-- source totals can exceed their attributed usage segments even when
|
|
1394
|
+
-- a provider/model string exists. The residual is Sem dimens\xE3o.
|
|
1395
|
+
SELECT i.agent_invocation_id, 'unavailable' AS model_key, NULL AS provider,
|
|
1396
|
+
i.input_tokens - COALESCE(st.input_tokens, 0), i.cached_input_tokens - COALESCE(st.cached_input_tokens, 0),
|
|
1397
|
+
i.output_tokens - COALESCE(st.output_tokens, 0), i.reasoning_tokens - COALESCE(st.reasoning_tokens, 0),
|
|
1398
|
+
i.total_tokens - COALESCE(st.total_tokens, 0), i.cost_usd - COALESCE(st.cost_usd, 0), i.cost_brl - COALESCE(st.cost_brl, 0)
|
|
1399
|
+
FROM invocations i LEFT JOIN segment_totals st USING(agent_invocation_id)
|
|
1400
|
+
WHERE (i.total_tokens IS NOT NULL OR i.cost_usd IS NOT NULL OR i.cost_brl IS NOT NULL)
|
|
1401
|
+
AND (i.total_tokens <> COALESCE(st.total_tokens, 0) OR i.cost_usd <> COALESCE(st.cost_usd, 0) OR i.cost_brl <> COALESCE(st.cost_brl, 0))
|
|
1402
|
+
), model_segments AS (
|
|
1403
|
+
SELECT agent_invocation_id, model_key, SUM(input_tokens) AS input_tokens, SUM(cached_input_tokens) AS cached_input_tokens,
|
|
1404
|
+
SUM(output_tokens) AS output_tokens, SUM(reasoning_tokens) AS reasoning_tokens,
|
|
1405
|
+
SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl
|
|
1406
|
+
FROM segments GROUP BY agent_invocation_id, model_key
|
|
1407
|
+
), known_models AS (
|
|
1408
|
+
SELECT agent_invocation_id, COUNT(DISTINCT model_key) AS model_count
|
|
1409
|
+
FROM model_segments WHERE model_key <> 'unavailable' GROUP BY agent_invocation_id
|
|
1410
|
+
), filtered_segments AS (
|
|
1411
|
+
SELECT s.*, i.task_id, i.duration_ms, i.source_event_count, km.model_count
|
|
1412
|
+
FROM segments s JOIN invocations i USING(agent_invocation_id)
|
|
1413
|
+
LEFT JOIN tasks t ON t.id=i.task_id LEFT JOIN known_models km USING(agent_invocation_id)
|
|
1414
|
+
WHERE ${A}`,le=`), financial_components AS (
|
|
1415
|
+
SELECT model_key AS key, SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS total_cost_usd, SUM(cost_brl) AS total_cost_brl
|
|
1416
|
+
FROM filtered_segments GROUP BY model_key
|
|
1417
|
+
UNION ALL
|
|
1418
|
+
SELECT CASE WHEN a.model IS NULL OR trim(a.model) = '' OR lower(a.model) IN ('unavailable', 'unknown', 'mixed') THEN 'unavailable' ELSE a.model END AS key,
|
|
1419
|
+
SUM(a.total_tokens) AS total_tokens, SUM(a.cost_usd) AS total_cost_usd, SUM(a.cost_brl) AS total_cost_brl
|
|
1420
|
+
FROM activities a LEFT JOIN tasks activity_task ON activity_task.id=a.task_id
|
|
1421
|
+
WHERE ${R.join(" AND ")}
|
|
1422
|
+
AND (a.total_tokens IS NOT NULL OR a.cost_usd IS NOT NULL OR a.cost_brl IS NOT NULL)
|
|
1423
|
+
GROUP BY key
|
|
1424
|
+
), financial AS (
|
|
1425
|
+
SELECT key, SUM(total_tokens) AS total_tokens, SUM(total_cost_usd) AS total_cost_usd, SUM(total_cost_brl) AS total_cost_brl
|
|
1426
|
+
FROM financial_components GROUP BY key
|
|
1427
|
+
), population_models AS (
|
|
1428
|
+
SELECT agent_invocation_id, model_key, MAX(task_id) AS task_id, MAX(duration_ms) AS duration_ms,
|
|
1429
|
+
MAX(source_event_count) AS source_event_count, MAX(model_count) AS model_count
|
|
1430
|
+
FROM filtered_segments GROUP BY agent_invocation_id, model_key
|
|
1431
|
+
), population_ranked AS (
|
|
1432
|
+
SELECT *, ROW_NUMBER() OVER (PARTITION BY agent_invocation_id ORDER BY model_key) AS model_rank
|
|
1433
|
+
FROM population_models
|
|
1434
|
+
), population AS (
|
|
1435
|
+
SELECT model_key AS key,
|
|
1436
|
+
COUNT(*) AS invocation_count,
|
|
1437
|
+
SUM(duration_ms) AS total_duration,
|
|
1438
|
+
SUM(source_event_count) AS source_event_count
|
|
1439
|
+
FROM population_ranked WHERE model_rank = 1 AND model_count = 1
|
|
1440
|
+
GROUP BY model_key
|
|
1441
|
+
), task_models AS (
|
|
1442
|
+
SELECT task_id, model_key
|
|
1443
|
+
FROM population_models WHERE task_id IS NOT NULL
|
|
1444
|
+
GROUP BY task_id, model_key
|
|
1445
|
+
), task_population AS (
|
|
1446
|
+
SELECT model_key AS key,
|
|
1447
|
+
COUNT(*) AS task_count
|
|
1448
|
+
FROM task_models
|
|
1449
|
+
GROUP BY model_key
|
|
1450
|
+
), keys AS (
|
|
1451
|
+
SELECT key FROM financial UNION SELECT key FROM population UNION SELECT key FROM task_population
|
|
1452
|
+
)`,re=Math.min(200,Math.max(1,n.limit??50)),K=Math.max(0,n.offset??0),pe=Number(this.database.prepare(`${V} ${le} SELECT COUNT(*) AS count FROM keys`).get(...E,...I).count),Me=this.database.prepare(`${V} ${le} SELECT
|
|
1453
|
+
(SELECT COUNT(*) FROM population_ranked WHERE model_rank = 1) AS invocation_count,
|
|
1454
|
+
(SELECT COUNT(DISTINCT task_id) FROM population_models) AS task_count,
|
|
1455
|
+
(SELECT SUM(duration_ms) FROM population_ranked WHERE model_rank = 1) AS total_duration,
|
|
1456
|
+
(SELECT SUM(CASE WHEN duration_ms IS NULL THEN 1 ELSE 0 END) FROM population_ranked WHERE model_rank = 1) AS duration_unknown,
|
|
1457
|
+
(SELECT SUM(CASE WHEN duration_ms IS NULL THEN 0 ELSE duration_ms END) FROM population_ranked WHERE model_rank = 1) AS duration_known,
|
|
1458
|
+
(SELECT SUM(source_event_count) FROM population_ranked WHERE model_rank = 1) AS source_event_count,
|
|
1459
|
+
SUM(input_tokens) AS total_input_tokens,
|
|
1460
|
+
SUM(cached_input_tokens) AS total_cached_input_tokens,
|
|
1461
|
+
SUM(output_tokens) AS total_output_tokens,
|
|
1462
|
+
SUM(reasoning_tokens) AS total_reasoning_tokens,
|
|
1463
|
+
SUM(total_tokens) AS total_tokens,
|
|
1464
|
+
SUM(cost_usd) AS total_cost_usd,
|
|
1465
|
+
SUM(cost_brl) AS total_cost_brl
|
|
1466
|
+
FROM filtered_segments`).get(...E,...I),ye=this.database.prepare(`${V} ${le} SELECT keys.key, keys.key AS label, COALESCE(population.invocation_count, 0) AS invocation_count, COALESCE(task_population.task_count, 0) AS task_count, population.total_duration, population.source_event_count, financial.total_tokens, financial.total_cost_usd, financial.total_cost_brl FROM keys LEFT JOIN population USING(key) LEFT JOIN task_population USING(key) LEFT JOIN financial USING(key) ORDER BY financial.total_cost_brl DESC, keys.key LIMIT ? OFFSET ?`).all(...E,...I,re,K);return{data_source:"sqlite_read_model",view:t,offset:K,limit:re,total_count:pe,has_more:K+ye.length<pe,totals:Me,rows:ye}}if(o==="provider"){let b=["1=1"],E=[];n.from&&(b.push("date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours') >= ?"),E.push(n.from.slice(0,10))),n.to&&(b.push("date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours') <= ?"),E.push(n.to.slice(0,10))),n.agent&&(b.push("i.zaip_agent = ?"),E.push(n.agent)),n.phase&&(b.push("i.phase = ?"),E.push(n.phase)),n.status&&(b.push("i.status = ?"),E.push(n.status)),(n.priority||n.workType)&&b.push("0"),n.risk&&(b.push("t.risk = ?"),E.push(n.risk)),n.origin&&b.push(n.origin==="prd"?"i.prd_id IS NOT NULL":n.origin==="spec"?"i.prd_id IS NULL AND i.spec_id IS NOT NULL":n.origin==="task"?"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NOT NULL":"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NULL"),n.provider&&(n.provider==="unavailable"?b.push("s.provider_key = 'unavailable'"):(b.push("s.provider_key = ?"),E.push(n.provider))),n.model&&(n.model==="unavailable"?b.push("s.model_key = 'unavailable'"):(b.push("s.model_key = ?"),E.push(n.model))),n.query&&(b.push("s.provider_key LIKE ?"),E.push(`%${n.query}%`));let R=`WITH segment_totals AS (
|
|
1467
|
+
SELECT agent_invocation_id, SUM(input_tokens) AS input_tokens, SUM(cached_input_tokens) AS cached_input_tokens,
|
|
1468
|
+
SUM(output_tokens) AS output_tokens, SUM(reasoning_tokens) AS reasoning_tokens,
|
|
1469
|
+
SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl
|
|
1470
|
+
FROM cost_invocation_dimension_facts
|
|
1471
|
+
WHERE total_tokens IS NOT NULL OR cost_usd IS NOT NULL OR cost_brl IS NOT NULL
|
|
1472
|
+
GROUP BY agent_invocation_id
|
|
1473
|
+
), segments AS (
|
|
1474
|
+
SELECT agent_invocation_id,
|
|
1475
|
+
CASE WHEN provider IS NULL OR trim(provider) = '' OR provider = 'unavailable' THEN 'unavailable' ELSE provider END AS provider_key,
|
|
1476
|
+
CASE WHEN model IS NULL OR trim(model) = '' OR model = 'unavailable' THEN 'unavailable' ELSE model END AS model_key,
|
|
1477
|
+
SUM(input_tokens) AS input_tokens, SUM(cached_input_tokens) AS cached_input_tokens,
|
|
1478
|
+
SUM(output_tokens) AS output_tokens, SUM(reasoning_tokens) AS reasoning_tokens,
|
|
1479
|
+
SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl
|
|
1480
|
+
FROM cost_invocation_dimension_facts
|
|
1481
|
+
WHERE total_tokens IS NOT NULL OR cost_usd IS NOT NULL OR cost_brl IS NOT NULL
|
|
1482
|
+
GROUP BY agent_invocation_id, provider_key, model_key
|
|
1483
|
+
UNION ALL
|
|
1484
|
+
-- See the equivalent Models branch: attribute only the segment part;
|
|
1485
|
+
-- retain the consolidated factual remainder as Sem dimens\xE3o.
|
|
1486
|
+
SELECT i.agent_invocation_id, 'unavailable' AS provider_key, 'unavailable' AS model_key,
|
|
1487
|
+
i.input_tokens - COALESCE(st.input_tokens, 0), i.cached_input_tokens - COALESCE(st.cached_input_tokens, 0),
|
|
1488
|
+
i.output_tokens - COALESCE(st.output_tokens, 0), i.reasoning_tokens - COALESCE(st.reasoning_tokens, 0),
|
|
1489
|
+
i.total_tokens - COALESCE(st.total_tokens, 0), i.cost_usd - COALESCE(st.cost_usd, 0), i.cost_brl - COALESCE(st.cost_brl, 0)
|
|
1490
|
+
FROM invocations i LEFT JOIN segment_totals st USING(agent_invocation_id)
|
|
1491
|
+
WHERE (i.total_tokens IS NOT NULL OR i.cost_usd IS NOT NULL OR i.cost_brl IS NOT NULL)
|
|
1492
|
+
AND (i.total_tokens <> COALESCE(st.total_tokens, 0) OR i.cost_usd <> COALESCE(st.cost_usd, 0) OR i.cost_brl <> COALESCE(st.cost_brl, 0))
|
|
1493
|
+
), provider_segments AS (
|
|
1494
|
+
SELECT agent_invocation_id, provider_key,
|
|
1495
|
+
SUM(input_tokens) AS input_tokens, SUM(cached_input_tokens) AS cached_input_tokens,
|
|
1496
|
+
SUM(output_tokens) AS output_tokens, SUM(reasoning_tokens) AS reasoning_tokens,
|
|
1497
|
+
SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS cost_usd, SUM(cost_brl) AS cost_brl
|
|
1498
|
+
FROM segments GROUP BY agent_invocation_id, provider_key
|
|
1499
|
+
), known_providers AS (
|
|
1500
|
+
SELECT agent_invocation_id, COUNT(DISTINCT provider_key) AS provider_count
|
|
1501
|
+
FROM provider_segments WHERE provider_key <> 'unavailable' GROUP BY agent_invocation_id
|
|
1502
|
+
), filtered_segments AS (
|
|
1503
|
+
SELECT s.*, i.task_id, i.duration_ms, i.source_event_count, kp.provider_count
|
|
1504
|
+
FROM segments s JOIN invocations i USING(agent_invocation_id)
|
|
1505
|
+
LEFT JOIN tasks t ON t.id=i.task_id LEFT JOIN known_providers kp USING(agent_invocation_id)
|
|
1506
|
+
WHERE ${b.join(" AND ")}`,I=`), financial AS (
|
|
1507
|
+
SELECT provider_key AS key, SUM(total_tokens) AS total_tokens, SUM(cost_usd) AS total_cost_usd, SUM(cost_brl) AS total_cost_brl FROM filtered_segments GROUP BY provider_key
|
|
1508
|
+
), population_providers AS (
|
|
1509
|
+
SELECT agent_invocation_id, provider_key, MAX(task_id) AS task_id, MAX(duration_ms) AS duration_ms, MAX(source_event_count) AS source_event_count, MAX(provider_count) AS provider_count
|
|
1510
|
+
FROM filtered_segments GROUP BY agent_invocation_id, provider_key
|
|
1511
|
+
), population_ranked AS (
|
|
1512
|
+
SELECT *, ROW_NUMBER() OVER (PARTITION BY agent_invocation_id ORDER BY provider_key) AS provider_rank FROM population_providers
|
|
1513
|
+
), population AS (
|
|
1514
|
+
SELECT provider_key AS key, COUNT(*) AS invocation_count, SUM(duration_ms) AS total_duration, SUM(source_event_count) AS source_event_count
|
|
1515
|
+
FROM population_ranked WHERE provider_rank = 1 AND provider_count = 1 GROUP BY provider_key
|
|
1516
|
+
), task_providers AS (
|
|
1517
|
+
SELECT task_id, provider_key FROM population_providers WHERE task_id IS NOT NULL GROUP BY task_id, provider_key
|
|
1518
|
+
), task_population AS (
|
|
1519
|
+
SELECT provider_key AS key, COUNT(*) AS task_count
|
|
1520
|
+
FROM task_providers GROUP BY provider_key
|
|
1521
|
+
), keys AS (SELECT key FROM financial UNION SELECT key FROM population UNION SELECT key FROM task_population)`,V=Math.min(200,Math.max(1,n.limit??50)),le=Math.max(0,n.offset??0),re=Number(this.database.prepare(`${R} ${I} SELECT COUNT(*) AS count FROM keys`).get(...E).count),K=this.database.prepare(`${R} ${I} SELECT
|
|
1522
|
+
(SELECT COUNT(*) FROM population_ranked WHERE provider_rank = 1) AS invocation_count,
|
|
1523
|
+
(SELECT COUNT(DISTINCT task_id) FROM population_providers) AS task_count,
|
|
1524
|
+
(SELECT SUM(duration_ms) FROM population_ranked WHERE provider_rank = 1) AS total_duration,
|
|
1525
|
+
(SELECT SUM(CASE WHEN duration_ms IS NULL THEN 1 ELSE 0 END) FROM population_ranked WHERE provider_rank = 1) AS duration_unknown,
|
|
1526
|
+
(SELECT SUM(CASE WHEN duration_ms IS NULL THEN 0 ELSE duration_ms END) FROM population_ranked WHERE provider_rank = 1) AS duration_known,
|
|
1527
|
+
(SELECT SUM(source_event_count) FROM population_ranked WHERE provider_rank = 1) AS source_event_count,
|
|
1528
|
+
SUM(input_tokens) AS total_input_tokens,
|
|
1529
|
+
SUM(cached_input_tokens) AS total_cached_input_tokens,
|
|
1530
|
+
SUM(output_tokens) AS total_output_tokens,
|
|
1531
|
+
SUM(reasoning_tokens) AS total_reasoning_tokens,
|
|
1532
|
+
SUM(total_tokens) AS total_tokens,
|
|
1533
|
+
SUM(cost_usd) AS total_cost_usd,
|
|
1534
|
+
SUM(cost_brl) AS total_cost_brl
|
|
1535
|
+
FROM filtered_segments`).get(...E),pe=this.database.prepare(`${R} ${I} SELECT keys.key, keys.key AS label, COALESCE(population.invocation_count,0) AS invocation_count, COALESCE(task_population.task_count,0) AS task_count, population.total_duration, population.source_event_count, financial.total_tokens, financial.total_cost_usd, financial.total_cost_brl FROM keys LEFT JOIN population USING(key) LEFT JOIN task_population USING(key) LEFT JOIN financial USING(key) ORDER BY financial.total_cost_brl DESC, keys.key LIMIT ? OFFSET ?`).all(...E,V,le);return{data_source:"sqlite_read_model",view:t,offset:le,limit:V,total_count:re,has_more:le+pe.length<re,totals:K,rows:pe}}let s=o==="day"||o==="month"||o==="year",c=!!(n.provider||n.model||n.agent||n.phase||n.status||n.origin||n.priority||n.risk||n.workType);if(o!==void 0&&s&&!c){let b=mt(n.from),E=mt(n.to),R=this.costMonitorSummaryAggregate({from:b,to:E}).daily_rows,I=new Map(R.map(X=>[String(X.key),X])),V=[...I.keys()].sort(),le=new Map,re=["prd_count","spec_count","task_count","validation_count","evidence_count","total_run_count","invocation_count","cost_monitor_invocation_count","llm_call_count","source_event_count","total_tokens","total_cost_usd","total_cost_brl"];for(let X of V){let we=o==="day"?X:o==="month"?X.slice(0,7):X.slice(0,4),F=le.get(we)??{key:we,label:we,period_key:we,start_day:X,end_day:X,total_duration:null,duration_incomplete:!1,duration_provenance:"unavailable",estimation_basis:null};F.start_day=String(F.start_day)<X?F.start_day:X,F.end_day=String(F.end_day)>X?F.end_day:X;let fe=I.get(X);for(let Ge of re){let me=fe?.[Ge];typeof me=="number"&&(F[Ge]=(typeof F[Ge]=="number"?Number(F[Ge]):0)+me)}let Xe=fe?.total_duration;typeof Xe=="number"&&(F.total_duration=(typeof F.total_duration=="number"?Number(F.total_duration):0)+Xe),typeof fe?.duration_unknown=="number"&&fe.duration_unknown>0&&(F.duration_incomplete=!0),le.set(we,F)}let K=n.query?.toLocaleLowerCase()??null,pe=[...le.values()].map(X=>{let we=typeof X.total_duration=="number"?X.total_duration:null,F=X.duration_incomplete===!0?1:0;return{key:String(X.key),label:String(X.label),prd_count:Number(X.prd_count??0),spec_count:Number(X.spec_count??0),task_count:Number(X.task_count??0),total_run_count:Number(X.total_run_count??0),validation_count:Number(X.validation_count??0),evidence_count:Number(X.evidence_count??0),total_duration:we,duration_known:we??0,duration_unknown:F,total_tokens:typeof X.total_tokens=="number"?X.total_tokens:null,total_cost_usd:typeof X.total_cost_usd=="number"?X.total_cost_usd:null,total_cost_brl:typeof X.total_cost_brl=="number"?X.total_cost_brl:null}}).filter(X=>K===null||String(X.key).toLocaleLowerCase().includes(K)).sort((X,we)=>String(we.key).localeCompare(String(X.key))),Me=pe.reduce((X,we)=>{for(let F of["prd_count","spec_count","task_count","total_run_count","validation_count","evidence_count","total_duration","duration_known","duration_unknown","total_tokens","total_cost_usd","total_cost_brl"]){let fe=we[F];typeof fe=="number"?X[F]=(X[F]??0)+fe:F in X||(X[F]=null)}return X},{}),ye=Math.min(200,Math.max(1,n.limit??50)),De=Math.max(0,n.offset??0),ze=pe.slice(De,De+ye);return{data_source:"sqlite_read_model",view:t,offset:De,limit:ye,total_count:pe.length,has_more:De+ze.length<pe.length,totals:Me,rows:ze}}if(o!==void 0&&(!s||c)){if(s&&n.workType)return{data_source:"sqlite_read_model",view:t,offset:Math.max(0,n.offset??0),limit:Math.min(200,Math.max(1,n.limit??50)),total_count:0,has_more:!1,rows:[]};let b=o==="day"?"date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours')":o==="month"?"substr(date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours'), 1, 7)":o==="year"?"substr(date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours'), 1, 4)":"i.provider_group",E=[`${b} IS NOT NULL`,"(i.total_tokens IS NOT NULL OR i.cost_usd IS NOT NULL OR i.cost_brl IS NOT NULL)"],A=[];n.from&&(E.push("date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours') >= ?"),A.push(mt(n.from))),n.to&&(E.push("date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours') <= ?"),A.push(mt(n.to)));let R=[];if(n.provider&&(n.provider==="unavailable"?E.push("NOT EXISTS (SELECT 1 FROM invocation_usage known_provider WHERE known_provider.agent_invocation_id=i.agent_invocation_id AND known_provider.provider IS NOT NULL AND known_provider.provider <> 'unavailable')"):(R.push("f.provider=?"),A.push(n.provider))),n.model&&(n.model==="unavailable"?E.push("NOT EXISTS (SELECT 1 FROM invocation_usage known_model WHERE known_model.agent_invocation_id=i.agent_invocation_id AND known_model.model IS NOT NULL AND known_model.model <> 'unavailable')"):(R.push("f.model=?"),A.push(n.model))),R.length>0&&E.push(`EXISTS (SELECT 1 FROM invocation_usage f WHERE f.agent_invocation_id=i.agent_invocation_id AND ${R.join(" AND ")})`),n.agent&&(E.push("i.zaip_agent = ?"),A.push(n.agent)),n.phase&&(E.push("i.phase = ?"),A.push(n.phase)),n.status&&(E.push("i.status = ?"),A.push(n.status)),n.priority&&E.push("0"),n.risk&&(E.push("i.task_risk = ?"),A.push(n.risk)),n.origin&&E.push(n.origin==="prd"?"i.prd_id IS NOT NULL":n.origin==="spec"?"i.prd_id IS NULL AND i.spec_id IS NOT NULL":n.origin==="task"?"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NOT NULL":"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NULL"),n.workType&&E.push("0"),n.query){let ye=`%${n.query}%`;E.push("(i.agent_invocation_id LIKE ? OR i.execution_id LIKE ? OR i.task_id LIKE ? OR i.spec_id LIKE ? OR i.prd_id LIKE ? OR i.conversation_id LIKE ? OR i.zaip_agent LIKE ? OR i.purpose LIKE ?)"),A.push(ye,ye,ye,ye,ye,ye,ye,ye)}let I=`WITH usage_rollup AS (
|
|
1536
|
+
SELECT agent_invocation_id,
|
|
1537
|
+
CASE COUNT(DISTINCT provider) WHEN 0 THEN NULL WHEN 1 THEN MIN(provider) ELSE 'mixed' END AS provider_group,
|
|
1538
|
+
CASE COUNT(DISTINCT model) WHEN 0 THEN NULL WHEN 1 THEN MIN(model) ELSE 'mixed' END AS model_group,
|
|
1539
|
+
SUM(input_tokens) AS input_tokens, SUM(cached_input_tokens) AS cached_input_tokens,
|
|
1540
|
+
SUM(output_tokens) AS output_tokens, SUM(reasoning_tokens) AS reasoning_tokens
|
|
1541
|
+
FROM invocation_usage GROUP BY agent_invocation_id
|
|
1542
|
+
), facts AS (
|
|
1543
|
+
-- Temporal Cost Monitor groups intentionally retain historical
|
|
1544
|
+
-- financial activities that have no agent invocation id. For modern
|
|
1545
|
+
-- Agent Runs, usage_rollup remains available for provider/model
|
|
1546
|
+
-- same-segment filtering; historical facts keep their own recorded
|
|
1547
|
+
-- provider/model attributes.
|
|
1548
|
+
SELECT v.*, v.agent_run_id AS agent_invocation_id, t.risk AS task_risk,
|
|
1549
|
+
u.provider_group, u.model_group, u.input_tokens, u.cached_input_tokens,
|
|
1550
|
+
u.output_tokens, u.reasoning_tokens
|
|
1551
|
+
FROM activities v
|
|
1552
|
+
LEFT JOIN tasks t ON t.id=v.task_id
|
|
1553
|
+
LEFT JOIN usage_rollup u ON u.agent_invocation_id=v.agent_run_id
|
|
1554
|
+
)`,V=E.join(" AND "),le=Number(this.database.prepare(`${I} SELECT COUNT(*) AS count FROM (SELECT ${b} FROM facts i WHERE ${V} GROUP BY ${b})`).get(...A).count),re=Math.min(200,Math.max(1,n.limit??50)),K=Math.max(0,n.offset??0),pe=o==="day"||o==="month"||o==="year"?"key DESC":"total_cost_brl DESC, key",Me=this.database.prepare(`${I} SELECT ${b} AS key, ${b} AS label, ${b} AS period_key, MIN(date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours')) AS start_day, MAX(date(COALESCE(i.source_started_at, i.source_occurred_at, i.occurred_at), '-3 hours')) AS end_day, COUNT(*) AS invocation_count, SUM(i.llm_call_count) AS llm_call_count, SUM(i.source_event_count) AS source_event_count, NULL AS total_duration, SUM(i.input_tokens) AS total_input_tokens, SUM(i.cached_input_tokens) AS total_cached_input_tokens, SUM(i.output_tokens) AS total_output_tokens, SUM(i.reasoning_tokens) AS total_reasoning_tokens, SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd, SUM(i.cost_brl) AS total_cost_brl FROM facts i WHERE ${V} GROUP BY ${b} ORDER BY ${pe} LIMIT ? OFFSET ?`).all(...A,re,K);if(s){let ye={from:n.from??null,to:n.to??null,providers:n.provider?[n.provider]:[],models:n.model?[n.model]:[],agents:n.agent?[n.agent]:[],phases:n.phase?[n.phase]:[],statuses:n.status?[n.status]:[]},De=this.costMonitorFactualDurationByDay(ye),ze=!!(n.origin||n.priority||n.risk||n.workType),X=ze?[]:this.database.prepare(`SELECT day, prd_count, spec_count, task_count, validation_count, evidence_count
|
|
1555
|
+
FROM daily_aggregate_cache WHERE (? IS NULL OR day >= ?) AND (? IS NULL OR day <= ?)`).all(mt(n.from),mt(n.from),mt(n.to),mt(n.to)),we=new Map;for(let me of X){let L=String(me.day),ne=o==="day"?L:o==="month"?L.slice(0,7):L.slice(0,4),ae=we.get(ne)??{prd_count:0,spec_count:0,task_count:0,validation_count:0,evidence_count:0};for(let ve of["prd_count","spec_count","task_count","validation_count","evidence_count"])ae[ve]=(ae[ve]??0)+Number(me[ve]??0);we.set(ne,ae)}let F=new Map(Me.map(me=>[String(me.period_key),me])),fe=new Set((n.query?[]:[...new Set([...De.keys(),...X.map(me=>String(me.day))])]).map(me=>o==="day"?me:o==="month"?me.slice(0,7):me.slice(0,4))),Ge=[...new Set([...F.keys(),...fe])].sort((me,L)=>L.localeCompare(me)).map(me=>{let L=F.get(me)??{key:me,label:me,period_key:me,start_day:me,end_day:me,invocation_count:0,llm_call_count:null,source_event_count:0,total_tokens:null,total_cost_usd:null,total_cost_brl:null},ne=ve=>o==="day"?ve===me:ve.startsWith(me),ae=[...De].filter(([ve])=>ne(ve));return{...L,...we.get(me)??(ze?{prd_count:null,spec_count:null,task_count:null,validation_count:null,evidence_count:null}:{prd_count:0,spec_count:0,task_count:0,validation_count:0,evidence_count:0}),total_run_count:Number(L.invocation_count??0),total_duration:ae.length===0||ae.some(([,ve])=>ve.eligible_runs!==ve.known_runs)?null:ae.reduce((ve,[,Ne])=>ve+Ne.known_sum,0)}});le=Ge.length,Me=Ge.slice(K,K+re);for(let me of Me){let L=String(me.period_key),ne=[...De.keys()].filter(ae=>o==="day"?ae===L:ae.startsWith(L));ne.length>0&&(me.start_day=ne.sort()[0],me.end_day=ne.sort().at(-1))}}return{data_source:"sqlite_read_model",view:t,offset:K,limit:re,total_count:le,has_more:K+Me.length<le,rows:Me}}let _={cost_monitor_executions:"execution",cost_monitor_tasks:"task",cost_monitor_specs:"spec",cost_monitor_prds:"prd",cost_monitor_conversations:"conversation"}[t];if(_!==void 0){let b=_==="spec"||_==="prd",E=!!(n.provider||n.model||n.agent||n.phase||n.origin||n.workType||n.priority);if(b&&!E){let X=_==="spec"?"specs":"prds",we=_==="spec"?"spec_id":"prd_id",F=[],fe=[],Xe=[],Ge=[];n.from&&(F.push("entity.occurred_day_sp >= ?"),fe.push(n.from.slice(0,10)),Xe.push("i.occurred_day_sp >= ?"),Ge.push(n.from.slice(0,10))),n.to&&(F.push("entity.occurred_day_sp <= ?"),fe.push(n.to.slice(0,10)),Xe.push("i.occurred_day_sp <= ?"),Ge.push(n.to.slice(0,10))),n.status&&(F.push("entity.status = ?"),fe.push(n.status)),n.risk&&(F.push("entity.risk = ?"),fe.push(n.risk)),n.query&&(F.push("(entity.id LIKE ? OR COALESCE(entity.title, '') LIKE ?)"),fe.push(`%${n.query}%`,`%${n.query}%`));let me=F.length===0?"1":F.join(" AND "),L=Xe.length===0?"":` AND ${Xe.join(" AND ")}`,ne=`WITH grouped AS (
|
|
1556
|
+
SELECT entity.id AS group_value, entity.title, entity.status, entity.risk,
|
|
1557
|
+
COALESCE(MIN(i.occurred_day_sp), entity.occurred_day_sp) AS first_day,
|
|
1558
|
+
COALESCE(MAX(i.occurred_day_sp), entity.occurred_day_sp) AS last_day,
|
|
1559
|
+
COALESCE(MAX(i.occurred_at), entity.occurred_at) AS occurred_at,
|
|
1560
|
+
COUNT(i.agent_invocation_id) AS invocation_count,
|
|
1561
|
+
SUM(i.llm_call_count) AS llm_call_count, SUM(i.duration_ms) AS total_duration,
|
|
1562
|
+
SUM(i.input_tokens) AS total_input_tokens,
|
|
1563
|
+
SUM(i.cached_input_tokens) AS total_cached_input_tokens,
|
|
1564
|
+
SUM(i.output_tokens) AS total_output_tokens,
|
|
1565
|
+
SUM(i.reasoning_tokens) AS total_reasoning_tokens,
|
|
1566
|
+
SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd,
|
|
1567
|
+
SUM(i.cost_brl) AS total_cost_brl
|
|
1568
|
+
FROM ${X} entity
|
|
1569
|
+
LEFT JOIN invocations i ON i.${we} = entity.id${L}
|
|
1570
|
+
WHERE ${me}
|
|
1571
|
+
GROUP BY entity.id, entity.title, entity.status, entity.risk, entity.occurred_at, entity.occurred_day_sp
|
|
1572
|
+
)`,ae=Math.min(200,Math.max(1,n.limit??50)),ve=Math.max(0,n.offset??0),Ne=[...Ge,...fe],Ye=Number(this.database.prepare(`${ne} SELECT COUNT(*) AS count FROM grouped`).get(...Ne).count),ot=this.database.prepare(`${ne} SELECT COUNT(*) AS entity_count, COALESCE(SUM(invocation_count), 0) AS invocation_count, ROUND(SUM(total_duration)) AS total_duration, SUM(total_tokens) AS total_tokens, SUM(total_cost_usd) AS total_cost_usd, SUM(total_cost_brl) AS total_cost_brl FROM grouped`).get(...Ne),Ct=this.database.prepare(`${ne} SELECT group_value AS id, group_value AS key, title, status, risk, first_day, last_day, occurred_at, invocation_count, llm_call_count, total_duration, total_input_tokens, total_cached_input_tokens, total_output_tokens, total_reasoning_tokens, total_tokens, total_cost_usd, total_cost_brl FROM grouped ORDER BY total_cost_brl DESC, group_value LIMIT ? OFFSET ?`).all(...Ne,ae,ve);return{data_source:"sqlite_read_model",view:t,offset:ve,limit:ae,total_count:Ye,has_more:ve+Ct.length<Ye,totals:ot,rows:Ct}}if(!!(n.provider||n.model||n.agent||n.phase||n.status||n.origin||n.workType||n.priority||n.risk)){let X={task:"i.task_id",spec:"i.spec_id",prd:"i.prd_id",execution:"i.execution_id",conversation:"i.conversation_id"}[_],we=_==="task"?"tasks":_==="spec"?"specs":_==="prd"?"prds":null,F=[`${X} IS NOT NULL`],fe=[];n.from&&(F.push("i.occurred_day_sp >= ?"),fe.push(n.from.slice(0,10))),n.to&&(F.push("i.occurred_day_sp <= ?"),fe.push(n.to.slice(0,10))),n.agent&&(F.push("i.zaip_agent = ?"),fe.push(n.agent)),n.phase&&(F.push("i.phase = ?"),fe.push(n.phase)),n.status&&(F.push("i.status = ?"),fe.push(n.status)),n.risk&&(F.push("task_entity.risk = ?"),fe.push(n.risk)),n.origin&&F.push(n.origin==="prd"?"i.prd_id IS NOT NULL":n.origin==="spec"?"i.prd_id IS NULL AND i.spec_id IS NOT NULL":n.origin==="task"?"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NOT NULL":"i.prd_id IS NULL AND i.spec_id IS NULL AND i.task_id IS NULL"),(n.workType||n.priority)&&F.push("0");let Xe=[];n.provider&&(n.provider==="unavailable"?F.push("NOT EXISTS (SELECT 1 FROM invocation_usage known_provider WHERE known_provider.agent_invocation_id=i.agent_invocation_id AND known_provider.provider IS NOT NULL AND known_provider.provider <> 'unavailable')"):(Xe.push("u.provider = ?"),fe.push(n.provider))),n.model&&(n.model==="unavailable"?F.push("NOT EXISTS (SELECT 1 FROM invocation_usage known_model WHERE known_model.agent_invocation_id=i.agent_invocation_id AND known_model.model IS NOT NULL AND known_model.model <> 'unavailable')"):(Xe.push("u.model = ?"),fe.push(n.model))),Xe.length>0&&F.push(`EXISTS (SELECT 1 FROM invocation_usage u WHERE u.agent_invocation_id=i.agent_invocation_id AND ${Xe.join(" AND ")})`),n.query&&(F.push(we===null?`${X} LIKE ?`:`(${X} LIKE ? OR COALESCE(entity.title, '') LIKE ?)`),fe.push(`%${n.query}%`,...we===null?[]:[`%${n.query}%`]));let L=`${we===null?"":`LEFT JOIN ${we} entity ON entity.id=${X}`} LEFT JOIN tasks task_entity ON task_entity.id=i.task_id`,ne=F.join(" AND "),ae=we===null?X:`COALESCE(MAX(entity.title), ${X})`,Ne=`WITH grouped AS (SELECT ${X} AS group_value, ${ae} AS title, ${we===null?"NULL":"MAX(entity.status)"} AS status, MAX(task_entity.risk) AS risk, MAX(i.occurred_at) AS occurred_at, COUNT(*) AS invocation_count, SUM(i.duration_ms) AS total_duration, SUM(i.total_tokens) AS total_tokens, SUM(i.cost_usd) AS total_cost_usd, SUM(i.cost_brl) AS total_cost_brl FROM invocations i ${L} WHERE ${ne} GROUP BY ${X})`,Ye=Math.min(200,Math.max(1,n.limit??50)),ot=Math.max(0,n.offset??0),Ct=Number(this.database.prepare(`${Ne} SELECT COUNT(*) AS count FROM grouped`).get(...fe).count),As=this.database.prepare(`${Ne} SELECT COUNT(*) AS entity_count, COALESCE(SUM(invocation_count), 0) AS invocation_count, ROUND(SUM(total_duration)) AS total_duration, SUM(total_tokens) AS total_tokens, SUM(total_cost_usd) AS total_cost_usd, SUM(total_cost_brl) AS total_cost_brl FROM grouped`).get(...fe),xi=this.database.prepare(`${Ne} SELECT group_value AS id, group_value AS key, title, status, risk, occurred_at, invocation_count, total_duration, total_tokens, total_cost_usd, total_cost_brl FROM grouped ORDER BY total_cost_brl DESC, group_value LIMIT ? OFFSET ?`).all(...fe,Ye,ot);return{data_source:"sqlite_read_model",view:t,offset:ot,limit:Ye,total_count:Ct,has_more:ot+xi.length<Ct,totals:As,rows:xi}}let I={task:{table:"tasks",title:"entity.title",status:"entity.status",risk:"entity.risk"},spec:{table:"specs",title:"entity.title",status:"entity.status",risk:"entity.risk"},prd:{table:"prds",title:"entity.title",status:"entity.status",risk:"entity.risk"},execution:{table:"executions",title:"grouped.group_value",status:"entity.status",risk:"NULL"},conversation:{table:"conversations",title:"grouped.group_value",status:"entity.status",risk:"NULL"}}[_],V=["group_kind = ?","group_value IS NOT NULL"],le=[_];n.from&&(V.push("day >= ?"),le.push(n.from.slice(0,10))),n.to&&(V.push("day <= ?"),le.push(n.to.slice(0,10))),n.query&&(V.push("group_value LIKE ?"),le.push(`%${n.query}%`));let re=_==="provider"?n.provider:_==="model"?n.model:_==="zaip_agent"?n.agent:void 0;re&&(V.push("group_value = ?"),le.push(re));let K=V.join(" AND "),pe=Number(this.database.prepare(`SELECT COUNT(DISTINCT group_value) AS count FROM cost_monitor_group_daily_cache WHERE ${K}`).get(...le).count),Me=this.database.prepare(`SELECT COUNT(DISTINCT group_value) AS entity_count,
|
|
1573
|
+
COALESCE(SUM(invocation_count), 0) AS invocation_count,
|
|
1574
|
+
ROUND(SUM(total_duration)) AS total_duration,
|
|
1575
|
+
SUM(total_tokens) AS total_tokens,
|
|
1576
|
+
SUM(total_cost_usd) AS total_cost_usd,
|
|
1577
|
+
SUM(total_cost_brl) AS total_cost_brl
|
|
1578
|
+
FROM cost_monitor_group_daily_cache
|
|
1579
|
+
WHERE ${K}`).get(...le),ye=Math.min(200,Math.max(1,n.limit??50)),De=Math.max(0,n.offset??0),ze=this.database.prepare(`WITH grouped AS (
|
|
1580
|
+
SELECT group_value, MIN(day) AS first_day, MAX(day) AS last_day,
|
|
1581
|
+
SUM(invocation_count) AS invocation_count,
|
|
1582
|
+
SUM(llm_call_count) AS llm_call_count,
|
|
1583
|
+
SUM(total_duration) AS total_duration,
|
|
1584
|
+
SUM(total_input_tokens) AS total_input_tokens,
|
|
1585
|
+
SUM(total_cached_input_tokens) AS total_cached_input_tokens,
|
|
1586
|
+
SUM(total_output_tokens) AS total_output_tokens,
|
|
1587
|
+
SUM(total_reasoning_tokens) AS total_reasoning_tokens,
|
|
1588
|
+
SUM(total_tokens) AS total_tokens,
|
|
1589
|
+
SUM(total_cost_usd) AS total_cost_usd,
|
|
1590
|
+
SUM(total_cost_brl) AS total_cost_brl
|
|
1591
|
+
FROM cost_monitor_group_daily_cache
|
|
1592
|
+
WHERE ${K}
|
|
1593
|
+
GROUP BY group_value
|
|
1594
|
+
)
|
|
1595
|
+
SELECT grouped.group_value AS id, grouped.group_value AS key,
|
|
1596
|
+
COALESCE(${I.title}, grouped.group_value) AS title,
|
|
1597
|
+
${I.status} AS status, ${I.risk} AS risk,
|
|
1598
|
+
grouped.first_day, grouped.last_day,
|
|
1599
|
+
grouped.last_day || 'T12:00:00.000Z' AS occurred_at,
|
|
1600
|
+
grouped.invocation_count, grouped.llm_call_count, grouped.total_duration,
|
|
1601
|
+
grouped.total_input_tokens, grouped.total_cached_input_tokens,
|
|
1602
|
+
grouped.total_output_tokens, grouped.total_reasoning_tokens,
|
|
1603
|
+
grouped.total_tokens, grouped.total_cost_usd, grouped.total_cost_brl
|
|
1604
|
+
FROM grouped
|
|
1605
|
+
LEFT JOIN ${I.table} entity ON entity.id = grouped.group_value
|
|
1606
|
+
ORDER BY grouped.total_cost_brl DESC, grouped.group_value
|
|
1607
|
+
LIMIT ? OFFSET ?`).all(...le,ye,De);return{data_source:"sqlite_read_model",view:t,offset:De,limit:ye,total_count:pe,has_more:De+ze.length<pe,totals:Me,rows:ze}}let u=uu[t],f=[],p=[],y=t==="cost_monitor_monthly"||t==="cost_monitor_annual"||t==="operations_monthly"||t==="operations_annual";y&&n.from?(f.push("end_day >= ?"),p.push(n.from.slice(0,10))):u.date!==null&&n.from&&(f.push(`${u.date} >= ?`),p.push(n.from.slice(0,10))),y&&n.to?(f.push("start_day <= ?"),p.push(n.to.slice(0,10))):u.date!==null&&n.to&&(f.push(`${u.date} <= ?`),p.push(n.to.slice(0,10))),n.query&&["cost_monitor_daily","cost_monitor_monthly","cost_monitor_annual","cost_monitor_overview_view","operations_monthly","operations_annual"].includes(t)&&(f.push("period_key LIKE ?"),p.push(`%${n.query}%`)),n.query&&t==="operations_daily"&&(f.push("day LIKE ?"),p.push(`%${n.query}%`)),n.status&&["operations_work_list","operations_work_kanban","operations_executions","operations_conversations","operations_decisions","operations_changes","operations_agent_invocations","first_fold_task","first_fold_spec","first_fold_prd"].includes(t)&&(f.push("status = ?"),p.push(n.status)),n.risk&&["operations_work_list","operations_work_kanban","operations_executions","operations_conversations","operations_decisions","operations_changes","operations_agent_invocations","first_fold_task","first_fold_spec","first_fold_prd"].includes(t)&&(f.push("risk = ?"),p.push(n.risk)),n.query&&["operations_work_list","operations_work_kanban","first_fold_top_tasks","first_fold_task","first_fold_spec","first_fold_prd"].includes(t)&&(f.push("(id LIKE ? OR title LIKE ?)"),p.push(`%${n.query}%`,`%${n.query}%`)),n.query&&t==="operations_executions"&&(f.push("execution_id LIKE ?"),p.push(`%${n.query}%`)),n.query&&t==="operations_conversations"&&(f.push("conversation_id LIKE ?"),p.push(`%${n.query}%`)),n.query&&(t==="operations_decisions"||t==="operations_changes")&&(f.push("id LIKE ?"),p.push(`%${n.query}%`)),t==="operations_agent_invocations"&&(n.query&&(f.push("(agent_invocation_id LIKE ? OR task_id LIKE ? OR execution_id LIKE ?)"),p.push(`%${n.query}%`,`%${n.query}%`,`%${n.query}%`)),n.agent&&(f.push("zaip_agent = ?"),p.push(n.agent)),n.phase&&(f.push("phase = ?"),p.push(n.phase)),n.provider&&(f.push("provider = ?"),p.push(n.provider)),n.model&&(f.push("model = ?"),p.push(n.model)));let v=f.length===0?"":` WHERE ${f.join(" AND ")}`,h=Number(this.database.prepare(`SELECT COUNT(*) AS count FROM ${t}${v}`).get(...p).count),O=Math.min(200,Math.max(1,n.limit??(t.includes("agent_invocations")?100:t==="first_fold_top_tasks"?5:50))),C=Math.max(0,n.offset??0),D=this.database.prepare(`SELECT * FROM ${t}${v} ORDER BY ${u.order} LIMIT ? OFFSET ?`).all(...p,O,C);if(t==="operations_daily"||t==="operations_monthly"||t==="operations_annual"){let b=t!=="operations_daily"&&(n.from||n.to),E=n.from?.slice(0,10)??null,A=n.to?.slice(0,10)??null,R=b?this.database.prepare("SELECT * FROM operations_daily WHERE (? IS NULL OR day >= ?) AND (? IS NULL OR day <= ?)").all(E,E,A,A):[],I=this.executionDurationByDay({from:n.from??null,to:n.to??null});for(let V of D){let le=String(V.day??V.period_key);if(b){let re=R.filter(pe=>String(pe.day).startsWith(le)),K=re.map(pe=>String(pe.day)).sort();V.start_day=K[0]??null,V.end_day=K.at(-1)??null;for(let pe of["prd_count","spec_count","task_count","validation_count","evidence_count","total_run_count","invocation_count","llm_call_count","total_tokens","total_cost_usd","total_cost_brl"])V[pe]=re.reduce((Me,ye)=>Me+(typeof ye[pe]=="number"?Number(ye[pe]):0),0)}V.operations_total_duration=[...I].filter(([re])=>t==="operations_daily"?re===le:re.startsWith(le)).reduce((re,[,K])=>re+K,0)}}return{data_source:"sqlite_read_model",view:t,offset:C,limit:O,total_count:h,has_more:C+D.length<h,rows:D}}metadata(){this.metadataValues===null&&(this.metadataValues=new Map(this.database.prepare("SELECT key, value FROM read_model_metadata").all().map(n=>[n.key,n.value])));let t=n=>Number(this.metadataValues?.get(n)??0);return{storage_mode:"sqlite_read_model",db_path:process.env.ZAIP_SQLITE_DB_PATH?"session-specific":ph,source_file_count:t("source_file_count"),excluded_source_count:t("excluded_source_count"),daily_aggregate_count:t("daily_aggregate_count"),activity_count:t("activity_count"),canonical_run_count:t("canonical_run_count"),agent_run_count:t("agent_run_count"),telemetry_summary_count:t("telemetry_summary_count"),unassisted_activity_count:t("unassisted_activity_count")}}};function b0(e,t){return encodeURIComponent(JSON.stringify([e,t]))}function S0(e){if(e===null)return null;try{let t=JSON.parse(decodeURIComponent(e));return Array.isArray(t)&&typeof t[0]=="string"&&typeof t[1]=="string"?[t[0],t[1]]:null}catch{return null}}0&&(module.exports={SqliteReadModelFileSystem,allocateAttributedTokenActiveMs,rebuildSqliteReadModel,sourceFingerprint,sqliteReadModelPath,sqliteViewMetadata,validateSqliteReadModelSchema});
|
|
1608
|
+
//# sourceMappingURL=sqlite-read-model.cjs.map
|