@langwatch/server 3.8.0 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1330) hide show
  1. package/README.md +3 -3
  2. package/feature-map.json +4 -2
  3. package/langevals/evaluators/langevals/langevals_langevals/select_best_compare.py +165 -5
  4. package/langevals/evaluators/langevals/tests/test_select_best_compare.py +471 -9
  5. package/langevals/ts-integration/evaluators.generated.ts +83 -63
  6. package/langwatch/.env.example +7 -0
  7. package/langwatch/biome.jsonc +23 -0
  8. package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-DKvtbwGG.js +2 -0
  9. package/langwatch/dist/client/assets/AddDatasetRecordDrawer-D1vOO9OS.js +6 -0
  10. package/langwatch/dist/client/assets/AddOrEditAnnotationScore-zxFsPi_K.js +2 -0
  11. package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-soYSKpT_.js +2 -0
  12. package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-BHJmgYGv.js +3 -0
  13. package/langwatch/dist/client/assets/AddParticipants-z6X3xaWh.js +2 -0
  14. package/langwatch/dist/client/assets/AgentHistoryDrawer-kb5K4X01.js +2 -0
  15. package/langwatch/dist/client/assets/AgentHttpEditorDrawer-Cf-aA1pn.js +5 -0
  16. package/langwatch/dist/client/assets/AgentListDrawer-z4OL5IVm.js +2 -0
  17. package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-Ky7GOYHj.js +2 -0
  18. package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-CAszeo8y.js +2 -0
  19. package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-DWrxkhIq.js +2 -0
  20. package/langwatch/dist/client/assets/AiGatewayLayout-BqznP5T2.js +2 -0
  21. package/langwatch/dist/client/assets/AnnotationsTable-C9n949u_.js +2 -0
  22. package/langwatch/dist/client/assets/AreaChart-PNFZHqkl.js +2 -0
  23. package/langwatch/dist/client/assets/AuthCard-D14g-b3Y.js +2 -0
  24. package/langwatch/dist/client/assets/AutomationDrawer-Cjo9egay.js +112 -0
  25. package/langwatch/dist/client/assets/BarChart-B23ShI5J.js +4 -0
  26. package/langwatch/dist/client/assets/BatchEvaluationSummary-CmkigWIn.js +2 -0
  27. package/langwatch/dist/client/assets/BudgetEditDrawer-nkQpQiY0.js +2 -0
  28. package/langwatch/dist/client/assets/CartesianChart-Ci1mTvgb.js +54 -0
  29. package/langwatch/dist/client/assets/CascadeArchiveDialog-BPqLe1Ai.js +2 -0
  30. package/langwatch/dist/client/assets/ChartTooltip-BMGa2HEK.js +2 -0
  31. package/langwatch/dist/client/assets/ChatWindow-BBsct-iS.js +5 -0
  32. package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-DOqtlBKU.js +9 -0
  33. package/langwatch/dist/client/assets/CodexCodingDefaultsAsk--UfSQyVR.js +2 -0
  34. package/langwatch/dist/client/assets/ColorfulBlockIcons-zwwbjL9F.js +6 -0
  35. package/langwatch/dist/client/assets/ColumnTypeIcon-CZZ6Esh0.js +2 -0
  36. package/langwatch/dist/client/assets/ComparisonLeaderboardDrawer-ChH7KNaX.js +4 -0
  37. package/langwatch/dist/client/assets/ConfirmDialog-CWzCY4sN.js +2 -0
  38. package/langwatch/dist/client/assets/ContactSalesBlock-B3w2lKdE.js +2 -0
  39. package/langwatch/dist/client/assets/Conversation-BhvQmXJ-.js +2 -0
  40. package/langwatch/dist/client/assets/CopyInput-Qeb_2bgP.js +2 -0
  41. package/langwatch/dist/client/assets/CopyableInputWithPrefix-Bp04WBtM.js +2 -0
  42. package/langwatch/dist/client/assets/CreateProjectDrawer-Dg_yrbka.js +2 -0
  43. package/langwatch/dist/client/assets/CreateTeamDrawer-CLJnKmFE.js +2 -0
  44. package/langwatch/dist/client/assets/CustomGraph-C6j6slUs.js +2 -0
  45. package/langwatch/dist/client/assets/DashboardLayout-Cn5-9Ye2.js +96 -0
  46. package/langwatch/dist/client/assets/DashboardNameDrawer-BvGn3rsq.js +2 -0
  47. package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-Wx7PJ_9S.js +2 -0
  48. package/langwatch/dist/client/assets/DatasetEditorTable-Ca3bmQrl.js +2 -0
  49. package/langwatch/dist/client/assets/DatasetPickerList-RZLjPQ2S.js +2 -0
  50. package/langwatch/dist/client/assets/DatasetPreviewTable-Ck22Wy4h.js +2 -0
  51. package/langwatch/dist/client/assets/DatasetSelector-BxeSHSDD.js +2 -0
  52. package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-ncleLyuX.js +2 -0
  53. package/langwatch/dist/client/assets/DeleteConfirmationDialog-Br5m12kp.js +2 -0
  54. package/langwatch/dist/client/assets/DocsLinks-D-I122gH.js +2 -0
  55. package/langwatch/dist/client/assets/DynamicZodForm-BUbQBluG.js +2 -0
  56. package/langwatch/dist/client/assets/EditAutomationFilterDrawer-Bci7dGy6.js +3 -0
  57. package/langwatch/dist/client/assets/EditModelProviderDrawer-CdUQa5qQ.js +4 -0
  58. package/langwatch/dist/client/assets/EditProjectDrawer-DDMa3VNp.js +2 -0
  59. package/langwatch/dist/client/assets/EmojiPickerModal-BLskXRKS.js +3 -0
  60. package/langwatch/dist/client/assets/EnterpriseLockedSurface-CGy3NpuC.js +2 -0
  61. package/langwatch/dist/client/assets/ErrorBarContext-CUuF6tzC.js +2 -0
  62. package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-Dw6JMkKa.js +107 -0
  63. package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-F1nHh-cP.js +2 -0
  64. package/langwatch/dist/client/assets/EvaluatorEditorDrawer-eotRSQPT.js +2 -0
  65. package/langwatch/dist/client/assets/EvaluatorEditorShared-BLZXXMFD.js +43 -0
  66. package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-Bx_uZmkb.js +2 -0
  67. package/langwatch/dist/client/assets/EvaluatorListDrawer--2JYBA1w.js +2 -0
  68. package/langwatch/dist/client/assets/EvaluatorMappingsSection-DCqvgq8G.js +2 -0
  69. package/langwatch/dist/client/assets/EvaluatorSelection-BTMe6CCC.js +2 -0
  70. package/langwatch/dist/client/assets/EvaluatorSelectionBox-CDxYA37_.js +2 -0
  71. package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-BDgiQ_Gu.js +2 -0
  72. package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-D4HFeq77.js +2 -0
  73. package/langwatch/dist/client/assets/ExecutionState-xp8LG59p.js +2 -0
  74. package/langwatch/dist/client/assets/FeatureFlagsDrawer-DIplgYQy.js +2 -0
  75. package/langwatch/dist/client/assets/FieldInfoTooltip-C_hEtQpK.js +2 -0
  76. package/langwatch/dist/client/assets/FieldsFilters-Ci5mVooQ.js +2 -0
  77. package/langwatch/dist/client/assets/FilterDisplay-BKjP30tt.js +2 -0
  78. package/langwatch/dist/client/assets/FilterSidebar-Cgxbpfi7.js +2 -0
  79. package/langwatch/dist/client/assets/FormatMoney-LZE9c_pf.js +2 -0
  80. package/langwatch/dist/client/assets/FoundryDrawer-DjVyu6Ww.js +2 -0
  81. package/langwatch/dist/client/assets/FullLogo-DRBt8v39.js +2 -0
  82. package/langwatch/dist/client/assets/GovernanceLayout-Baar1Fc8.js +2 -0
  83. package/langwatch/dist/client/assets/GraphsLayout-RNsRoPhs.js +2 -0
  84. package/langwatch/dist/client/assets/GroupBindingInputRow-BxvXd1EU.js +2 -0
  85. package/langwatch/dist/client/assets/GuardrailsDrawer-BtsfIXzD.js +91 -0
  86. package/langwatch/dist/client/assets/History-B3CO9rUC.js +17 -0
  87. package/langwatch/dist/client/assets/HorizontalFormControl-CpxShF8O.js +2 -0
  88. package/langwatch/dist/client/assets/HoverableBigText-BMBnTTnr.js +2 -0
  89. package/langwatch/dist/client/assets/InstallCliCard-DO5HE9Zk.js +2 -0
  90. package/langwatch/dist/client/assets/IntegratePaneShell-Bc7i3AU3.js +8 -0
  91. package/langwatch/dist/client/assets/InviteMemberDrawer-CiQbGDVl.js +2 -0
  92. package/langwatch/dist/client/assets/IsolatedErrorBoundary-QK1gsCee.js +2 -0
  93. package/langwatch/dist/client/assets/LLMModelCostDrawer-K4uPc99h.js +2 -0
  94. package/langwatch/dist/client/assets/LangyContextTarget-Dxr919ue.js +2 -0
  95. package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-CnBBcfON.js +2 -0
  96. package/langwatch/dist/client/assets/Legend-C-o-ebW-.js +6 -0
  97. package/langwatch/dist/client/assets/Line-CbuF_DU9.js +2 -0
  98. package/langwatch/dist/client/assets/LineChart-CjG7MhLF.js +2 -0
  99. package/langwatch/dist/client/assets/ListTable-Dq11zhPy.js +2 -0
  100. package/langwatch/dist/client/assets/LoadingScreen-BRa1kl7f.js +2 -0
  101. package/langwatch/dist/client/assets/Markdown-Cip8Rj5C.js +35 -0
  102. package/langwatch/dist/client/assets/MenuLink-CEEzPpsg.js +2 -0
  103. package/langwatch/dist/client/assets/MessageCard-Nbu21sIo.js +2 -0
  104. package/langwatch/dist/client/assets/MetadataTag-CQmOL4su.js +5 -0
  105. package/langwatch/dist/client/assets/ModelProviderCustomModelInput-s8Z1JIfQ.js +2 -0
  106. package/langwatch/dist/client/assets/ModelProviderScreen-BkZVsCiO.js +2 -0
  107. package/langwatch/dist/client/assets/ModelSelector-BjEx9IlF.js +2 -0
  108. package/langwatch/dist/client/assets/MyLayout-Dr6t6Ogu.js +2 -0
  109. package/langwatch/dist/client/assets/NavigationFooter-GfOzirbT.js +2 -0
  110. package/langwatch/dist/client/assets/NewWorkflowForm-uqnhwRpZ.js +2 -0
  111. package/langwatch/dist/client/assets/NoDataInfoBlock-Busjhz63.js +2 -0
  112. package/langwatch/dist/client/assets/OnboardingContainer-BGhio01s.js +2 -0
  113. package/langwatch/dist/client/assets/OnlineEvaluationDrawer-DyCVUUmz.js +2 -0
  114. package/langwatch/dist/client/assets/OpsPageShell-GqOT9Ezv.js +2 -0
  115. package/langwatch/dist/client/assets/OttlEditor-BYyg1quG.js +3 -0
  116. package/langwatch/dist/client/assets/OverflownText-q6WIx911.js +2 -0
  117. package/langwatch/dist/client/assets/ProjectAvatar-B0tbfKzY.js +43 -0
  118. package/langwatch/dist/client/assets/ProjectLangyLayout-Du3nxtBV.js +82 -0
  119. package/langwatch/dist/client/assets/PromptEditorDrawer-DeL8XgdG.js +2 -0
  120. package/langwatch/dist/client/assets/PromptListDrawer-y4bmNt4t.js +2 -0
  121. package/langwatch/dist/client/assets/PropertySectionTitle-CK55WvKi.js +37 -0
  122. package/langwatch/dist/client/assets/ProviderModelSelector-B-0vpQ2t.js +2 -0
  123. package/langwatch/dist/client/assets/ProviderScopeChips-DN3rtvAE.js +2 -0
  124. package/langwatch/dist/client/assets/PushToCopiesDialog-Ry_M3FuH.js +2 -0
  125. package/langwatch/dist/client/assets/ReferenceDot-DrNtDSrg.js +2 -0
  126. package/langwatch/dist/client/assets/RenderInputOutput-DqsCnspr.js +261 -0
  127. package/langwatch/dist/client/assets/ScatterChart-jarSkvrF.js +2 -0
  128. package/langwatch/dist/client/assets/ScenarioFormDrawer-DvJcYmkQ.js +2 -0
  129. package/langwatch/dist/client/assets/ScenarioInputMappingSection-BewVLFCZ.js +2 -0
  130. package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-BAPna8ym.js +3 -0
  131. package/langwatch/dist/client/assets/ScopeChipPicker-pQ061i-c.js +2 -0
  132. package/langwatch/dist/client/assets/SearchInput-DH_qIhwi.js +2 -0
  133. package/langwatch/dist/client/assets/SectionNavigationLayout-DwPBnqYj.js +2 -0
  134. package/langwatch/dist/client/assets/SelectDatasetDrawer-8MPCEZID.js +2 -0
  135. package/langwatch/dist/client/assets/SelectionActionBar-C2SOsiow.js +2 -0
  136. package/langwatch/dist/client/assets/SeriesFilterDrawer-d5DYEKTZ.js +2 -0
  137. package/langwatch/dist/client/assets/SettingsLayout-ZI47ZjuT.js +2 -0
  138. package/langwatch/dist/client/assets/SetupWithAgentButton-CNTb3Avj.js +4 -0
  139. package/langwatch/dist/client/assets/ShikiCommandBox-u0WEsz_9.js +5 -0
  140. package/langwatch/dist/client/assets/SpanDetails-L_YT0nxH.js +3 -0
  141. package/langwatch/dist/client/assets/SubscriptionPage-CaUbKJjG.js +2 -0
  142. package/langwatch/dist/client/assets/SuiteFormDrawer-BjUQdKq8.js +2 -0
  143. package/langwatch/dist/client/assets/Symbols-R6sphPWl.js +2 -0
  144. package/langwatch/dist/client/assets/TabButton-8Oc9UYh8.js +3 -0
  145. package/langwatch/dist/client/assets/TableCell-Ci8ylzki.js +2 -0
  146. package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-DSKFRtdD.js +2 -0
  147. package/langwatch/dist/client/assets/TeamForm-CL9ycvq0.js +2 -0
  148. package/langwatch/dist/client/assets/TeamUserRoleField-D0ZTlKiH.js +2 -0
  149. package/langwatch/dist/client/assets/TraceDetails-JolY6sXJ.js +9 -0
  150. package/langwatch/dist/client/assets/TraceDetailsDrawer-lgPzHJ3L.js +2 -0
  151. package/langwatch/dist/client/assets/TraceIdPeek-DDi0ChdF.js +2 -0
  152. package/langwatch/dist/client/assets/TracesMapping-BPXT_-h4.js +2 -0
  153. package/langwatch/dist/client/assets/UpgradeModalContent-DmGd0n65.js +2 -0
  154. package/langwatch/dist/client/assets/UploadCSVDrawer-haYFZH65.js +3 -0
  155. package/langwatch/dist/client/assets/VariablesSection-DW_-pHw8.js +2 -0
  156. package/langwatch/dist/client/assets/VersionBadge-BrsZ4NP1.js +2 -0
  157. package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-B9tl6d9Q.js +1161 -0
  158. package/langwatch/dist/client/assets/ViewAutomationDrawer-DliGiKaC.js +2 -0
  159. package/langwatch/dist/client/assets/VirtualKeySecretReveal-B9QMNIxJ.js +54 -0
  160. package/langwatch/dist/client/assets/WelcomeLayout-DZ1ue0he.js +2 -0
  161. package/langwatch/dist/client/assets/WithFeatureFlagGuard-CgkIIt3_.js +2 -0
  162. package/langwatch/dist/client/assets/WithPermissionGuard-Da_hdEdq.js +2 -0
  163. package/langwatch/dist/client/assets/WorkflowCard-C_ClnTV_.js +2 -0
  164. package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-DozYRazW.js +2 -0
  165. package/langwatch/dist/client/assets/_...path_-Da4obdgF.js +2 -0
  166. package/langwatch/dist/client/assets/_Uint8Array-BKsS4AYJ.js +2 -0
  167. package/langwatch/dist/client/assets/__...path__-hjRUlcmj.js +22 -0
  168. package/langwatch/dist/client/assets/_baseAssignValue-B0IP5NGP.js +2 -0
  169. package/langwatch/dist/client/assets/_baseClone-DWP1OuEe.js +2 -0
  170. package/langwatch/dist/client/assets/_baseEach-Bv6waMUN.js +2 -0
  171. package/langwatch/dist/client/assets/_baseFor-K5aTWdeA.js +2 -0
  172. package/langwatch/dist/client/assets/_experiment_-Cv2h4AYK.js +2 -0
  173. package/langwatch/dist/client/assets/_id_-BoubOQoS.js +2 -0
  174. package/langwatch/dist/client/assets/_id_-BuzJEIUf.js +2 -0
  175. package/langwatch/dist/client/assets/_id_-BzLlrR7z.js +2 -0
  176. package/langwatch/dist/client/assets/_id_-DAzjJ7AY.js +2 -0
  177. package/langwatch/dist/client/assets/_id_-Dc2UAWAO.js +2 -0
  178. package/langwatch/dist/client/assets/_id_-DwutdLKk.js +2 -0
  179. package/langwatch/dist/client/assets/_id_-H7-5DI5r.js +2 -0
  180. package/langwatch/dist/client/assets/_project_-DTuunSJZ.js +8 -0
  181. package/langwatch/dist/client/assets/_runId_-BGhwmwQj.js +7 -0
  182. package/langwatch/dist/client/assets/_shell-ChQAHWWX.js +2 -0
  183. package/langwatch/dist/client/assets/_slug_-D6Y2wsW5.js +2 -0
  184. package/langwatch/dist/client/assets/_slug_-DLKkXVG8.js +2 -0
  185. package/langwatch/dist/client/assets/_slug_-yLo6E4BE.js +17 -0
  186. package/langwatch/dist/client/assets/_team_-TUptH6wK.js +2 -0
  187. package/langwatch/dist/client/assets/_workflow_-B_flNNON.js +3 -0
  188. package/langwatch/dist/client/assets/_workflow_-DUyBeEF1.js +25 -0
  189. package/langwatch/dist/client/assets/accept-BtE8pbrP.js +2 -0
  190. package/langwatch/dist/client/assets/activity-BDNvBEBL.js +1 -0
  191. package/langwatch/dist/client/assets/agents-CZnWSlhu.js +2 -0
  192. package/langwatch/dist/client/assets/alerts-BDNvBEBL.js +1 -0
  193. package/langwatch/dist/client/assets/all-in7z_yGY.js +2 -0
  194. package/langwatch/dist/client/assets/analytics-C8m2qboV.js +2 -0
  195. package/langwatch/dist/client/assets/annotation-scores-hmT53w46.js +2 -0
  196. package/langwatch/dist/client/assets/annotations-DwouO48Z.js +2 -0
  197. package/langwatch/dist/client/assets/anomaly-rules-DoJdIoCt.js +2 -0
  198. package/langwatch/dist/client/assets/api-keys-CykxAxvG.js +4 -0
  199. package/langwatch/dist/client/assets/asaplangy-D3J00Q-Z.js +5 -0
  200. package/langwatch/dist/client/assets/audit-log-Dy4vcEeJ.js +2 -0
  201. package/langwatch/dist/client/assets/auth-IqMSC5k1.js +2 -0
  202. package/langwatch/dist/client/assets/authentication-BqVl7Fh-.js +2 -0
  203. package/langwatch/dist/client/assets/authorize-BGMc1Gzv.js +2 -0
  204. package/langwatch/dist/client/assets/authorize-DhHzBVUd.js +2 -0
  205. package/langwatch/dist/client/assets/automations-BDNvBEBL.js +1 -0
  206. package/langwatch/dist/client/assets/automations-BhzNESFp.js +2 -0
  207. package/langwatch/dist/client/assets/billing-plans-D_IT1cHz.js +2 -0
  208. package/langwatch/dist/client/assets/blank-Ct2wtHyX.js +2 -0
  209. package/langwatch/dist/client/assets/blobs-Dwi1OImQ.js +2 -0
  210. package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-CnAsMlS_.js +133 -0
  211. package/langwatch/dist/client/assets/budgets-Cn5gXQK_.js +3 -0
  212. package/langwatch/dist/client/assets/bug-reports-feRha8NA.js +2 -0
  213. package/langwatch/dist/client/assets/cache-rules-T0g7jfVv.js +2 -0
  214. package/langwatch/dist/client/assets/choose-D7SJAjkq.js +2 -0
  215. package/langwatch/dist/client/assets/chunk-EX3LRPZG-DkekrL-i.js +232 -0
  216. package/langwatch/dist/client/assets/chunk-FWX5IMBZ-2uc49Oqf.js +3 -0
  217. package/langwatch/dist/client/assets/chunk-PUDLZKDR-CdFvlX4m.js +157 -0
  218. package/langwatch/dist/client/assets/chunk-RYQCIY6F-BLUBc3em.js +2 -0
  219. package/langwatch/dist/client/assets/chunk-V7JOEXUC-daLm26hJ.js +207 -0
  220. package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-CDA8LHAw.js +2 -0
  221. package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-CDA8LHAw.js +2 -0
  222. package/langwatch/dist/client/assets/clsx-CjueKrWZ.js +2 -0
  223. package/langwatch/dist/client/assets/codeAgentConfig-BGKq9uCt.js +7 -0
  224. package/langwatch/dist/client/assets/codingDefaultSync-BHSxIX3Y.js +2 -0
  225. package/langwatch/dist/client/assets/configure-CrBmyV7I.js +4 -0
  226. package/langwatch/dist/client/assets/constants-CDt5HyiB.js +2 -0
  227. package/langwatch/dist/client/assets/custom-wRFdLdR4.js +12 -0
  228. package/langwatch/dist/client/assets/custom_evaluator-C4ikBFuX.js +31 -0
  229. package/langwatch/dist/client/assets/dagre-VKFMJZFB-BElJnuGp.js +5 -0
  230. package/langwatch/dist/client/assets/dagre-VMur7wh6.js +2 -0
  231. package/langwatch/dist/client/assets/data-privacy-DAIYO4AS.js +2 -0
  232. package/langwatch/dist/client/assets/data-retention-6spK_HnV.js +2 -0
  233. package/langwatch/dist/client/assets/datasets-_6-oF4ZW.js +2 -0
  234. package/langwatch/dist/client/assets/debounce-CS9Z04io.js +2 -0
  235. package/langwatch/dist/client/assets/defaultModelState-B2tL23ua.js +2 -0
  236. package/langwatch/dist/client/assets/dejaview-Cde-wWV4.js +2 -0
  237. package/langwatch/dist/client/assets/departments-Cm-0ZxEt.js +2 -0
  238. package/langwatch/dist/client/assets/devices-DmiWzGY2.js +2 -0
  239. package/langwatch/dist/client/assets/dist-C4xeXVRv.js +6 -0
  240. package/langwatch/dist/client/assets/drawerFromUrl-CKr5SifD.js +2 -0
  241. package/langwatch/dist/client/assets/edit-CLmkWTOM.js +62 -0
  242. package/langwatch/dist/client/assets/email-suppressions-cqwH0a9N.js +2 -0
  243. package/langwatch/dist/client/assets/erDiagram-Q63AITRT-Byy32QYy.js +86 -0
  244. package/langwatch/dist/client/assets/error-D8QCVS4R.js +2 -0
  245. package/langwatch/dist/client/assets/errors-mlatPkMI.js +2 -0
  246. package/langwatch/dist/client/assets/evaluations-BBoYdpZy.js +2 -0
  247. package/langwatch/dist/client/assets/evaluations-DhzXchFj.js +2 -0
  248. package/langwatch/dist/client/assets/evaluators-BtHslgaT.js +2 -0
  249. package/langwatch/dist/client/assets/evaluators-_EDCn-tQ.js +148 -0
  250. package/langwatch/dist/client/assets/experiments-CffarahA.js +1 -0
  251. package/langwatch/dist/client/assets/feature-flags-mcBTRF0E.js +2 -0
  252. package/langwatch/dist/client/assets/fetchSSE-CnJPAkno.js +3 -0
  253. package/langwatch/dist/client/assets/fieldset-kmG3NTVs.js +2 -0
  254. package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-CY9NG0NN.js +1 -0
  255. package/langwatch/dist/client/assets/forgot-password-wo5Sna-0.js +2 -0
  256. package/langwatch/dist/client/assets/formatMoney-ClmqgvaY.js +2 -0
  257. package/langwatch/dist/client/assets/formatTargetOutput-DXvqMkYJ.js +2 -0
  258. package/langwatch/dist/client/assets/foundry-CfvGgfP0.js +477 -0
  259. package/langwatch/dist/client/assets/gateway-Be0EsD57.js +2 -0
  260. package/langwatch/dist/client/assets/getEvaluator-D2EjIa3G.js +2 -0
  261. package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-D2oUP3Tn.js +2 -0
  262. package/langwatch/dist/client/assets/governance-YZL-Q4Vy.js +2 -0
  263. package/langwatch/dist/client/assets/graphlib-DsLTzvlk.js +2 -0
  264. package/langwatch/dist/client/assets/grid-MxZhegzw.js +2 -0
  265. package/langwatch/dist/client/assets/groups-BmusUt3C.js +2 -0
  266. package/langwatch/dist/client/assets/guardrails-DAx8mDop.js +2 -0
  267. package/langwatch/dist/client/assets/handled-error-DbmvFmFF.js +2 -0
  268. package/langwatch/dist/client/assets/http-C64lOZI7.js +7 -0
  269. package/langwatch/dist/client/assets/identifierUtils-C2FgAR6z.js +2 -0
  270. package/langwatch/dist/client/assets/immer-DImI3Uq2.js +14 -0
  271. package/langwatch/dist/client/assets/index-8SbDirJv.js +68 -0
  272. package/langwatch/dist/client/assets/ingestion-source-detail-PQbeRniA.js +19 -0
  273. package/langwatch/dist/client/assets/ingestion-sources-CCyiAKHP.js +12 -0
  274. package/langwatch/dist/client/assets/integrations-WSl7N8v9.js +2 -0
  275. package/langwatch/dist/client/assets/isArrayLikeObject-DQ6J5Gh8.js +2 -0
  276. package/langwatch/dist/client/assets/isSymbol-DQQCRrSw.js +2 -0
  277. package/langwatch/dist/client/assets/langyHomeSuggestions-czH603Eu.js +2 -0
  278. package/langwatch/dist/client/assets/license-BXfbZQgG.js +2 -0
  279. package/langwatch/dist/client/assets/licenseStatusUtils-CeEgqpQ1.js +2 -0
  280. package/langwatch/dist/client/assets/lu-BSZWBZXU.js +2 -0
  281. package/langwatch/dist/client/assets/map-DUpZ7PrO.js +2 -0
  282. package/langwatch/dist/client/assets/mappingValidation-C7knTdfD.js +2 -0
  283. package/langwatch/dist/client/assets/me-DbCM2fI8.js +7 -0
  284. package/langwatch/dist/client/assets/me-DgXzEkaD.js +2 -0
  285. package/langwatch/dist/client/assets/members-CNILhgB4.js +2 -0
  286. package/langwatch/dist/client/assets/mermaid.core-1LNrQSiZ.js +12 -0
  287. package/langwatch/dist/client/assets/messages-CIoUj-2S.js +2 -0
  288. package/langwatch/dist/client/assets/metrics-Ba4ghWyR.js +2 -0
  289. package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-BsK9qdX4.js +97 -0
  290. package/langwatch/dist/client/assets/model-costs-Cmo-7iNN.js +2 -0
  291. package/langwatch/dist/client/assets/model-providers-DNeQW-T1.js +2 -0
  292. package/langwatch/dist/client/assets/modelProviderHelpers-BgYFTBND.js +2 -0
  293. package/langwatch/dist/client/assets/my-queue-DAyfQ6lp.js +2 -0
  294. package/langwatch/dist/client/assets/normalizeComparison-QGQpERT7.js +2 -0
  295. package/langwatch/dist/client/assets/not-found-BFkr8OS7.js +2 -0
  296. package/langwatch/dist/client/assets/now-BWCCq_PO.js +2 -0
  297. package/langwatch/dist/client/assets/onboarding-DAAoh3gE.js +2 -0
  298. package/langwatch/dist/client/assets/online-evaluations-DbC0C3ct.js +2 -0
  299. package/langwatch/dist/client/assets/ops-BnGgY3gP.js +2 -0
  300. package/langwatch/dist/client/assets/organizations-D-hWxeYL.js +2 -0
  301. package/langwatch/dist/client/assets/pages-BthWVZpr.js +2 -0
  302. package/langwatch/dist/client/assets/persistence-NkzSPIBC.js +2 -0
  303. package/langwatch/dist/client/assets/personalProject-C9vU_vdl.js +2 -0
  304. package/langwatch/dist/client/assets/plans-B_rx4bLE.js +2 -0
  305. package/langwatch/dist/client/assets/preconditionFieldUtils-ryKgG9T1.js +2 -0
  306. package/langwatch/dist/client/assets/product-BuY5Xwg3.js +2 -0
  307. package/langwatch/dist/client/assets/project-C2NjfKL8.js +2 -0
  308. package/langwatch/dist/client/assets/projections-rLpLV9w3.js +2 -0
  309. package/langwatch/dist/client/assets/projects-BF0LrAID.js +2 -0
  310. package/langwatch/dist/client/assets/promptHandle-BT-5THDj.js +2 -0
  311. package/langwatch/dist/client/assets/prompts-BHe5aLJx.js +8 -0
  312. package/langwatch/dist/client/assets/radio-group-BPt-WSZX.js +2 -0
  313. package/langwatch/dist/client/assets/registry-olFQKglt.js +2 -0
  314. package/langwatch/dist/client/assets/reports-BLYN6Q1s.js +2 -0
  315. package/langwatch/dist/client/assets/request-DFzKYavU.js +2 -0
  316. package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-CRtGWC_J.js +85 -0
  317. package/langwatch/dist/client/assets/reset-password-DYZspdMQ.js +2 -0
  318. package/langwatch/dist/client/assets/role-bindings-FmulBsng.js +2 -0
  319. package/langwatch/dist/client/assets/roles-RLhR-aqL.js +2 -0
  320. package/langwatch/dist/client/assets/routing-policies-ljceihkc.js +5 -0
  321. package/langwatch/dist/client/assets/scenarios-BQqYDDZG.js +2 -0
  322. package/langwatch/dist/client/assets/scheduler-BFnKJjAw.js +2 -0
  323. package/langwatch/dist/client/assets/schedules-BDNvBEBL.js +1 -0
  324. package/langwatch/dist/client/assets/scim-Bmka9JwE.js +2 -0
  325. package/langwatch/dist/client/assets/seatTypeCopy-fhsCX-T3.js +2 -0
  326. package/langwatch/dist/client/assets/secrets-Cwr6m0Ec.js +2 -0
  327. package/langwatch/dist/client/assets/segment-group-BktqF-NE.js +2 -0
  328. package/langwatch/dist/client/assets/segmented-control-Dux7mG6V.js +2 -0
  329. package/langwatch/dist/client/assets/select-BvA110t-.js +2 -0
  330. package/langwatch/dist/client/assets/send-KqbwnHm5.js +2 -0
  331. package/langwatch/dist/client/assets/sequenceView-CXTCS8lF.js +5 -0
  332. package/langwatch/dist/client/assets/seriesOptions-B04NlY20.js +1015 -0
  333. package/langwatch/dist/client/assets/settings-U355L_I1.js +2 -0
  334. package/langwatch/dist/client/assets/setup-BlSoABYV.js +2 -0
  335. package/langwatch/dist/client/assets/shikiAdapter-Ctbe7cQu.js +3 -0
  336. package/langwatch/dist/client/assets/showSuiteRunError-D2fez5Ub.js +2 -0
  337. package/langwatch/dist/client/assets/signin-DyT1qLoq.js +2 -0
  338. package/langwatch/dist/client/assets/signup-D8m3PZ3b.js +2 -0
  339. package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-iaTfadDT.js +2 -0
  340. package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-DH-TUWs1.js +2 -0
  341. package/langwatch/dist/client/assets/subscription-_ypR9RT2.js +3 -0
  342. package/langwatch/dist/client/assets/subscriptions-BRPlrnsz.js +2 -0
  343. package/langwatch/dist/client/assets/suggestionUI-BvF9IL3n.js +106 -0
  344. package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-DT3qutmi.js +3 -0
  345. package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-Chcqm6v8.js +9 -0
  346. package/langwatch/dist/client/assets/switch-BZp2DIfW.js +2 -0
  347. package/langwatch/dist/client/assets/switch-C1DNHB2v.js +2 -0
  348. package/langwatch/dist/client/assets/tabs-B6CQXTUQ.js +2 -0
  349. package/langwatch/dist/client/assets/teams-B3Yc0LtS.js +2 -0
  350. package/langwatch/dist/client/assets/teams-Df3DGQGZ.js +2 -0
  351. package/langwatch/dist/client/assets/tool-catalog-CpVqJ_Dp.js +7 -0
  352. package/langwatch/dist/client/assets/toolIcons-CwYXl2Eu.js +2 -0
  353. package/langwatch/dist/client/assets/tooltip-CM-lMDNU.js +2 -0
  354. package/langwatch/dist/client/assets/topic-clustering-DEtDEXOU.js +2 -0
  355. package/langwatch/dist/client/assets/topics-BGSBPvH8.js +2 -0
  356. package/langwatch/dist/client/assets/traceStore-C-SeEWpA.js +55 -0
  357. package/langwatch/dist/client/assets/traces-hMC5nfWE.js +289 -0
  358. package/langwatch/dist/client/assets/tracesMapping-CJhNJ9Ej.js +3 -0
  359. package/langwatch/dist/client/assets/tracking-in5OR8uP.js +2 -0
  360. package/langwatch/dist/client/assets/types-DNh2n8ZE.js +2 -0
  361. package/langwatch/dist/client/assets/types-OZJZgbcd.js +2 -0
  362. package/langwatch/dist/client/assets/types-nw9Z9F-v.js +2 -0
  363. package/langwatch/dist/client/assets/undo-2-CYjzz3Fj.js +2 -0
  364. package/langwatch/dist/client/assets/usage-BMXYHJUH.js +2 -0
  365. package/langwatch/dist/client/assets/usage-Da6wBDdP.js +2 -0
  366. package/langwatch/dist/client/assets/use-generic-onboarding-flow-eie3NRF5.js +2 -0
  367. package/langwatch/dist/client/assets/useActivePlan-Dsa3BYxd.js +2 -0
  368. package/langwatch/dist/client/assets/useAllPromptsForProject-BS-h_uSZ.js +2 -0
  369. package/langwatch/dist/client/assets/useAnnotationQueues-BMo2kZ_n.js +2 -0
  370. package/langwatch/dist/client/assets/useAvailableEvaluators-DkZ2Yt1F.js +2 -0
  371. package/langwatch/dist/client/assets/useCyclingVerb-BTWaxKR2.js +2 -0
  372. package/langwatch/dist/client/assets/useDepartmentColumn-xoZ52lPP.js +2 -0
  373. package/langwatch/dist/client/assets/useEvaluationsV3Store-CjI63SqB.js +2 -0
  374. package/langwatch/dist/client/assets/useExportTraces-kA2TFkjy.js +2 -0
  375. package/langwatch/dist/client/assets/useFeatureFlag-BjAcqOFH.js +2 -0
  376. package/langwatch/dist/client/assets/usePersonalContext-BGjy_Vrg.js +2 -0
  377. package/langwatch/dist/client/assets/useProjectSpanNames-DV-N8Iqc.js +2 -0
  378. package/langwatch/dist/client/assets/useProjectsForCopy-C63wLMNr.js +2 -0
  379. package/langwatch/dist/client/assets/useRunViaApiTabs-DMsq4RV1.js +50 -0
  380. package/langwatch/dist/client/assets/useShowLangy-C1pPUZqz.js +2 -0
  381. package/langwatch/dist/client/assets/useSimulationUpdateListener-ufWGuGhO.js +2 -0
  382. package/langwatch/dist/client/assets/useTargetName-DRCsNovZ.js +2 -0
  383. package/langwatch/dist/client/assets/useTargetNameMap-2sQCSyzN.js +2 -0
  384. package/langwatch/dist/client/assets/useTraceDetailsDrawer-CWSKPTh_.js +2 -0
  385. package/langwatch/dist/client/assets/useTraceUpdateListener-DqLF7KuU.js +2 -0
  386. package/langwatch/dist/client/assets/useUrlScopeFilter-BmRsU3rU.js +2 -0
  387. package/langwatch/dist/client/assets/useVariantMetrics-CK9aOmIb.js +2 -0
  388. package/langwatch/dist/client/assets/useWorkflowStore-CWWkoMW1.js +8 -0
  389. package/langwatch/dist/client/assets/users-B9jauEWz.js +2 -0
  390. package/langwatch/dist/client/assets/users-C8IaWy9-.js +2 -0
  391. package/langwatch/dist/client/assets/users-DIbzKO8Q.js +2 -0
  392. package/langwatch/dist/client/assets/v3-C9Ud_O3k.js +2 -0
  393. package/langwatch/dist/client/assets/variables-Dox25KUK.js +396 -0
  394. package/langwatch/dist/client/assets/viewStore-BCIvcW8n.js +2 -0
  395. package/langwatch/dist/client/assets/virtual-keys-D-qkAFBv.js +2 -0
  396. package/langwatch/dist/client/assets/welcome-CnjW7kg3.js +16 -0
  397. package/langwatch/dist/client/assets/wizard-CUCaNag_.js +2 -0
  398. package/langwatch/dist/client/assets/workbench-N1DutXtL.js +2 -0
  399. package/langwatch/dist/client/assets/workflows-D2XRYWpS.js +3 -0
  400. package/langwatch/dist/client/assets/wrap-D_XqGHIU.js +2 -0
  401. package/langwatch/dist/client/index.html +4 -4
  402. package/langwatch/dist/scenario-child-process.js +7 -0
  403. package/langwatch/e2e/auth-regression/better-auth-sso-smoketest.ts +72 -0
  404. package/langwatch/ee/LICENSE.md +52 -18
  405. package/langwatch/ee/README.md +15 -6
  406. package/langwatch/ee/admin/routes/__tests__/admin.integration.test.ts +1 -1
  407. package/langwatch/ee/admin/routes/admin.ts +1 -1
  408. package/langwatch/ee/audit-log/auditLog.ts +51 -0
  409. package/langwatch/ee/billing/__tests__/planLimits.unit.test.ts +6 -6
  410. package/langwatch/ee/billing/__tests__/planProvider.unit.test.ts +21 -33
  411. package/langwatch/ee/billing/__tests__/subscription.service.unit.test.ts +1 -0
  412. package/langwatch/ee/billing/__tests__/usage-limit.service.unit.test.ts +17 -17
  413. package/langwatch/ee/billing/planLimits.ts +1 -37
  414. package/langwatch/ee/billing/planProvider.ts +0 -13
  415. package/langwatch/ee/governance/reactors/__tests__/gatewayBudgetSync.reactor.unit.test.ts +39 -0
  416. package/langwatch/ee/governance/reactors/__tests__/governanceKpisSync.reactor.unit.test.ts +33 -0
  417. package/langwatch/ee/governance/reactors/__tests__/governanceOcsfEventsSync.reactor.unit.test.ts +33 -0
  418. package/langwatch/ee/governance/reactors/__tests__/governanceReactorsPreEnqueueGate.unit.test.ts +243 -0
  419. package/langwatch/ee/governance/reactors/gatewayBudgetSync.reactor.ts +391 -185
  420. package/langwatch/ee/governance/reactors/governanceKpisSync.reactor.ts +14 -7
  421. package/langwatch/ee/governance/reactors/governanceOcsfEventsSync.reactor.ts +97 -81
  422. package/langwatch/ee/governance/services/governanceAttributeKeys.ts +17 -0
  423. package/langwatch/ee/licensing/__tests__/constants.unit.test.ts +4 -6
  424. package/langwatch/ee/licensing/__tests__/defaults.unit.test.ts +63 -86
  425. package/langwatch/ee/licensing/__tests__/fixtures/testLicenses.ts +18 -0
  426. package/langwatch/ee/licensing/__tests__/licenseGenerationService.unit.test.ts +52 -16
  427. package/langwatch/ee/licensing/__tests__/licenseHandler.integration.test.ts +199 -15
  428. package/langwatch/ee/licensing/__tests__/mintedPlan.unit.test.ts +110 -0
  429. package/langwatch/ee/licensing/__tests__/planMapping.unit.test.ts +4 -29
  430. package/langwatch/ee/licensing/__tests__/planTemplates.unit.test.ts +0 -61
  431. package/langwatch/ee/licensing/__tests__/validation.unit.test.ts +69 -0
  432. package/langwatch/ee/licensing/constants.ts +11 -59
  433. package/langwatch/ee/licensing/defaults.ts +20 -32
  434. package/langwatch/ee/licensing/licenseGenerationService.ts +6 -19
  435. package/langwatch/ee/licensing/licenseHandler.ts +109 -92
  436. package/langwatch/ee/licensing/mintedPlan.ts +57 -0
  437. package/langwatch/ee/licensing/ossBaselineFloor.ts +45 -0
  438. package/langwatch/ee/licensing/planInfo.ts +0 -13
  439. package/langwatch/ee/licensing/planMapping.ts +0 -13
  440. package/langwatch/ee/licensing/planTemplates.ts +8 -42
  441. package/langwatch/ee/licensing/types.ts +24 -29
  442. package/langwatch/ee/licensing/validation.ts +13 -1
  443. package/langwatch/ee/scim/__tests__/scim-token.service.unit.test.ts +110 -0
  444. package/langwatch/ee/scim/__tests__/scim.costCenter.integration.test.ts +171 -0
  445. package/langwatch/ee/scim/__tests__/scim.service.unit.test.ts +415 -0
  446. package/langwatch/ee/scim/routes.ts +585 -0
  447. package/langwatch/ee/scim/scim-group.service.ts +465 -0
  448. package/langwatch/ee/scim/scim-role-resolver.ts +48 -0
  449. package/langwatch/ee/scim/scim-role-resolver.unit.test.ts +93 -0
  450. package/langwatch/ee/scim/scim-token.service.ts +71 -0
  451. package/langwatch/ee/scim/scim.service.ts +554 -0
  452. package/langwatch/ee/scim/scim.types.ts +149 -0
  453. package/langwatch/ee/scim/webhooks.ts +170 -0
  454. package/langwatch/ee/sso/__tests__/fallbackName.test.ts +142 -0
  455. package/langwatch/ee/sso/__tests__/matching.test.ts +126 -0
  456. package/langwatch/ee/sso/__tests__/parseIssuerUrl.test.ts +59 -0
  457. package/langwatch/ee/sso/__tests__/sso-gate.test.ts +459 -0
  458. package/langwatch/ee/sso/__tests__/sso-license.repository.test.ts +53 -0
  459. package/langwatch/ee/sso/__tests__/ssoPathGate.test.ts +182 -0
  460. package/langwatch/ee/sso/__tests__/ssoRouteTableCanary.test.ts +186 -0
  461. package/langwatch/ee/sso/matching.ts +48 -0
  462. package/langwatch/ee/sso/providers.ts +271 -0
  463. package/langwatch/ee/sso/sso-gate.ts +294 -0
  464. package/langwatch/ee/sso/sso-license.repository.ts +47 -0
  465. package/langwatch/ee/sso/ssoPathGate.ts +127 -0
  466. package/langwatch/package.json +1 -1
  467. package/langwatch/prisma/migrations/20260802120000_organization_user_disabled_at/migration.sql +7 -0
  468. package/langwatch/prisma/schema.prisma +8 -0
  469. package/langwatch/scripts/check-feature-parity.ts +0 -4
  470. package/langwatch/src/__tests__/noBinarySourceFiles.unit.test.ts +56 -0
  471. package/langwatch/src/app/api/agents/[[...route]]/app.ts +0 -2
  472. package/langwatch/src/app/api/agents/__tests__/agents-rest-api.integration.test.ts +0 -22
  473. package/langwatch/src/app/api/dashboards/[[...route]]/app.ts +0 -2
  474. package/langwatch/src/app/api/dashboards/__tests__/dashboard-rest-api.integration.test.ts +0 -18
  475. package/langwatch/src/app/api/dataset/[[...route]]/app.ts +0 -33
  476. package/langwatch/src/app/api/dataset/__tests__/dataset-rest-api.integration.test.ts +0 -24
  477. package/langwatch/src/app/api/dataset/__tests__/dataset-upload-api.integration.test.ts +0 -25
  478. package/langwatch/src/app/api/evaluators/[[...route]]/app.v1.ts +0 -2
  479. package/langwatch/src/app/api/export/scenario-runs/[[...route]]/app.ts +250 -0
  480. package/langwatch/src/app/api/export/scenario-runs/__tests__/scenario-run-export-route.integration.test.ts +336 -0
  481. package/langwatch/src/app/api/graphs/[[...route]]/app.ts +0 -2
  482. package/langwatch/src/app/api/middleware/__tests__/error-handler.unit.test.ts +4 -4
  483. package/langwatch/src/app/api/middleware/index.ts +0 -1
  484. package/langwatch/src/app/api/monitors/[[...route]]/app.ts +0 -2
  485. package/langwatch/src/app/api/projects/[[...route]]/app.ts +28 -8
  486. package/langwatch/src/app/api/prompts/[[...route]]/app.v1.ts +0 -2
  487. package/langwatch/src/app/api/scenario-events/[[...route]]/app.ts +0 -5
  488. package/langwatch/src/app/api/scenarios/[[...route]]/app.v1.ts +0 -2
  489. package/langwatch/src/app/api/shared/errors.ts +14 -0
  490. package/langwatch/src/app/api/simulation-runs/__tests__/simulation-run-platform-url.integration.test.ts +6 -3
  491. package/langwatch/src/app/api/suites/[[...route]]/app.ts +0 -2
  492. package/langwatch/src/app/api/teams/[[...route]]/app.ts +22 -1
  493. package/langwatch/src/app/api/teams/__tests__/teams-rest-api.integration.test.ts +146 -0
  494. package/langwatch/src/app/api/traces/[[...route]]/app.v1.ts +114 -0
  495. package/langwatch/src/app/api/triggers/[[...route]]/app.ts +0 -2
  496. package/langwatch/src/components/AddMembersForm.tsx +25 -5
  497. package/langwatch/src/components/AddOrEditDatasetDrawer.tsx +1 -9
  498. package/langwatch/src/components/ComparisonLeaderboardDrawer.tsx +496 -0
  499. package/langwatch/src/components/LicenseStatus.tsx +14 -16
  500. package/langwatch/src/components/__tests__/ComparisonLeaderboardDrawer.gate.integration.test.tsx +146 -0
  501. package/langwatch/src/components/__tests__/LicenseStatus.integration.test.tsx +129 -0
  502. package/langwatch/src/components/__tests__/UpgradeModal.integration.test.tsx +358 -68
  503. package/langwatch/src/components/agents/AgentCodeEditorDrawer.tsx +7 -14
  504. package/langwatch/src/components/agents/AgentHttpEditorDrawer.tsx +7 -14
  505. package/langwatch/src/components/agents/WorkflowSelectorDrawer.tsx +1 -15
  506. package/langwatch/src/components/analytics/DashboardNameDrawer.tsx +20 -26
  507. package/langwatch/src/components/auth/AuthCard.tsx +41 -0
  508. package/langwatch/src/components/batch-evaluation-results/BatchEvaluationResults.tsx +72 -0
  509. package/langwatch/src/components/batch-evaluation-results/BatchEvaluationResultsTable.tsx +109 -2
  510. package/langwatch/src/components/batch-evaluation-results/ComparisonCharts.tsx +241 -77
  511. package/langwatch/src/components/batch-evaluation-results/ComparisonLeaderboardChart.tsx +355 -0
  512. package/langwatch/src/components/batch-evaluation-results/ComparisonTable.tsx +437 -75
  513. package/langwatch/src/components/batch-evaluation-results/LeaderboardStep.tsx +105 -0
  514. package/langwatch/src/components/batch-evaluation-results/LeaderboardTrustPanel.tsx +464 -0
  515. package/langwatch/src/components/batch-evaluation-results/LeaderboardVerdictPanel.tsx +354 -0
  516. package/langwatch/src/components/batch-evaluation-results/PairwiseLeaderboard.tsx +553 -0
  517. package/langwatch/src/components/batch-evaluation-results/ParetoScatterChart.tsx +512 -0
  518. package/langwatch/src/components/batch-evaluation-results/TradeoffSummaryLine.tsx +58 -0
  519. package/langwatch/src/components/batch-evaluation-results/WinRateChart.tsx +12 -4
  520. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.filter-overflow.integration.test.tsx +8 -1
  521. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.leaderboard-gate.integration.test.tsx +192 -0
  522. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonCharts.test.tsx +8 -1
  523. package/langwatch/src/components/batch-evaluation-results/__tests__/ComparisonTable.group-by-metadata.integration.test.tsx +352 -0
  524. package/langwatch/src/components/batch-evaluation-results/__tests__/bootstrapMeanCI.unit.test.ts +98 -0
  525. package/langwatch/src/components/batch-evaluation-results/__tests__/buildAxisLabels.unit.test.ts +134 -0
  526. package/langwatch/src/components/batch-evaluation-results/__tests__/buildPairwiseComparisons.test.ts +95 -0
  527. package/langwatch/src/components/batch-evaluation-results/__tests__/buildTrustChecks.unit.test.ts +551 -0
  528. package/langwatch/src/components/batch-evaluation-results/__tests__/computeBTLeaderboard.test.ts +428 -0
  529. package/langwatch/src/components/batch-evaluation-results/__tests__/computeBandClipping.unit.test.ts +125 -0
  530. package/langwatch/src/components/batch-evaluation-results/__tests__/computeComparability.unit.test.ts +208 -0
  531. package/langwatch/src/components/batch-evaluation-results/__tests__/computeJudgeBiasChecks.unit.test.ts +186 -0
  532. package/langwatch/src/components/batch-evaluation-results/__tests__/computeLeaderboardVerdict.test.ts +288 -0
  533. package/langwatch/src/components/batch-evaluation-results/__tests__/computeParetoDominance.unit.test.ts +599 -0
  534. package/langwatch/src/components/batch-evaluation-results/__tests__/computeSampleAdequacy.unit.test.ts +212 -0
  535. package/langwatch/src/components/batch-evaluation-results/__tests__/computeScoreBarScale.unit.test.ts +104 -0
  536. package/langwatch/src/components/batch-evaluation-results/__tests__/computeVariantMetrics.test.ts +99 -0
  537. package/langwatch/src/components/batch-evaluation-results/__tests__/detectComparisonColumns.test.ts +133 -0
  538. package/langwatch/src/components/batch-evaluation-results/__tests__/formatLeaderboardHeadline.unit.test.ts +252 -0
  539. package/langwatch/src/components/batch-evaluation-results/__tests__/formatTradeoffSummary.unit.test.ts +219 -0
  540. package/langwatch/src/components/batch-evaluation-results/__tests__/leaderboardCache.unit.test.ts +128 -0
  541. package/langwatch/src/components/batch-evaluation-results/__tests__/panelAgreement.unit.test.ts +165 -0
  542. package/langwatch/src/components/batch-evaluation-results/__tests__/paretoScatterPoints.unit.test.ts +95 -0
  543. package/langwatch/src/components/batch-evaluation-results/__tests__/scoreSeparation.unit.test.ts +314 -0
  544. package/langwatch/src/components/batch-evaluation-results/__tests__/variantMetricsSymmetry.unit.test.ts +129 -0
  545. package/langwatch/src/components/batch-evaluation-results/__tests__/verdictSafety.unit.test.ts +438 -0
  546. package/langwatch/src/components/batch-evaluation-results/__tests__/winMatrixHasPairwiseDetail.unit.test.ts +126 -0
  547. package/langwatch/src/components/batch-evaluation-results/bootstrapMeanCI.ts +78 -0
  548. package/langwatch/src/components/batch-evaluation-results/buildPairwiseComparisons.ts +30 -0
  549. package/langwatch/src/components/batch-evaluation-results/chartAxisLabels.ts +98 -0
  550. package/langwatch/src/components/batch-evaluation-results/computeBTLeaderboard.ts +814 -0
  551. package/langwatch/src/components/batch-evaluation-results/computeComparability.ts +305 -0
  552. package/langwatch/src/components/batch-evaluation-results/computeJudgeBiasChecks.ts +175 -0
  553. package/langwatch/src/components/batch-evaluation-results/computeLeaderboardVerdict.ts +277 -0
  554. package/langwatch/src/components/batch-evaluation-results/computeParetoDominance.ts +283 -0
  555. package/langwatch/src/components/batch-evaluation-results/computeSampleAdequacy.ts +91 -0
  556. package/langwatch/src/components/batch-evaluation-results/computeVariantMetrics.ts +236 -0
  557. package/langwatch/src/components/batch-evaluation-results/computeWinMatrixShape.ts +61 -0
  558. package/langwatch/src/components/batch-evaluation-results/formatLeaderboardHeadline.ts +139 -0
  559. package/langwatch/src/components/batch-evaluation-results/formatTradeoffSummary.ts +126 -0
  560. package/langwatch/src/components/batch-evaluation-results/mulberry32.ts +19 -0
  561. package/langwatch/src/components/batch-evaluation-results/scoreSeparation.ts +102 -0
  562. package/langwatch/src/components/batch-evaluation-results/types.ts +82 -9
  563. package/langwatch/src/components/batch-evaluation-results/useBTLeaderboard.ts +137 -0
  564. package/langwatch/src/components/batch-evaluation-results/usePairwiseSort.ts +78 -0
  565. package/langwatch/src/components/batch-evaluation-results/useResultsGrouping.ts +119 -0
  566. package/langwatch/src/components/batch-evaluation-results/useShowComparisonLeaderboard.ts +43 -0
  567. package/langwatch/src/components/batch-evaluation-results/useVariantMetrics.ts +106 -0
  568. package/langwatch/src/components/checks/DynamicZodForm.tsx +9 -0
  569. package/langwatch/src/components/drawerRegistry.ts +5 -0
  570. package/langwatch/src/components/evaluations/OnlineEvaluationDrawer.tsx +13 -20
  571. package/langwatch/src/components/evaluators/EvaluatorEditorShared.tsx +16 -20
  572. package/langwatch/src/components/evaluators/WorkflowSelectorForEvaluatorDrawer.tsx +1 -15
  573. package/langwatch/src/components/experiments/CreateExperimentButton.tsx +13 -17
  574. package/langwatch/src/components/license/LicenseDetailsCard.tsx +72 -23
  575. package/langwatch/src/components/license/LicenseGeneratorForm.tsx +0 -60
  576. package/langwatch/src/components/license/LicenseLoadError.tsx +23 -0
  577. package/langwatch/src/components/license/OverSeatsCallout.tsx +68 -0
  578. package/langwatch/src/components/license/ResourceLimitsDisplay.tsx +0 -74
  579. package/langwatch/src/components/license/__tests__/OverSeatsCallout.integration.test.tsx +56 -0
  580. package/langwatch/src/components/license/__tests__/ResourceLimitsDisplay.unit.test.ts +8 -135
  581. package/langwatch/src/components/license/__tests__/licenseStatusUtils.unit.test.ts +68 -13
  582. package/langwatch/src/components/license/__tests__/planFormDefaults.unit.test.ts +11 -11
  583. package/langwatch/src/components/license/__tests__/useLicenseActions.integration.test.ts +185 -0
  584. package/langwatch/src/components/license/licenseStatusUtils.ts +21 -17
  585. package/langwatch/src/components/license/planFormDefaults.ts +3 -18
  586. package/langwatch/src/components/license/useLicenseActions.ts +26 -3
  587. package/langwatch/src/components/me/PersonalRecentTracesTable.tsx +4 -0
  588. package/langwatch/src/components/ops/projections/BulkReplayWizard.tsx +23 -1
  589. package/langwatch/src/components/plans/PlansComparisonPage.tsx +18 -0
  590. package/langwatch/src/components/plans/__tests__/PlansComparisonPage.integration.test.tsx +17 -0
  591. package/langwatch/src/components/plans/__tests__/planCurrentResolver.unit.test.ts +19 -0
  592. package/langwatch/src/components/plans/planCurrentResolver.ts +13 -0
  593. package/langwatch/src/components/projects/CreateProjectDrawer.tsx +36 -40
  594. package/langwatch/src/components/prompts/PromptEditorDrawer.tsx +9 -15
  595. package/langwatch/src/components/prompts/__tests__/PromptEditorDrawer.test.tsx +0 -1
  596. package/langwatch/src/components/scenarios/ScenarioCreateModal.tsx +3 -5
  597. package/langwatch/src/components/scenarios/ScenarioFormDrawer.tsx +2 -32
  598. package/langwatch/src/components/settings/CreateTeamDrawer.tsx +31 -35
  599. package/langwatch/src/components/settings/EnterpriseCapabilitiesSection.tsx +236 -0
  600. package/langwatch/src/components/settings/InfoWithoutSelecting.tsx +25 -0
  601. package/langwatch/src/components/settings/OrganizationUserRoleField.tsx +21 -2
  602. package/langwatch/src/components/settings/__tests__/EnterpriseCapabilitiesSection.integration.test.tsx +173 -0
  603. package/langwatch/src/components/settings/__tests__/seatTypeCopy.unit.test.ts +94 -0
  604. package/langwatch/src/components/settings/__tests__/seatTypeExplanation.integration.test.tsx +126 -0
  605. package/langwatch/src/components/settings/seatTypeCopy.ts +29 -0
  606. package/langwatch/src/components/subscription/SubscriptionPage.tsx +0 -1
  607. package/langwatch/src/components/subscription/__tests__/subscription-test-setup.ts +0 -13
  608. package/langwatch/src/components/subscription/billing-plans.ts +3 -12
  609. package/langwatch/src/components/suites/RunHistoryFilters.tsx +55 -3
  610. package/langwatch/src/components/suites/RunHistoryPanel.tsx +44 -0
  611. package/langwatch/src/components/suites/ScenarioRunExportDialog.tsx +92 -0
  612. package/langwatch/src/components/suites/SuiteFormDrawer.tsx +4 -20
  613. package/langwatch/src/components/suites/__tests__/AllRunsPanel.integration.test.tsx +3 -0
  614. package/langwatch/src/components/suites/__tests__/RunHistoryEmptyState.integration.test.tsx +45 -0
  615. package/langwatch/src/components/suites/__tests__/RunHistoryLiveWindow.integration.test.tsx +135 -0
  616. package/langwatch/src/components/suites/__tests__/ScenarioRunExportUi.integration.test.tsx +227 -0
  617. package/langwatch/src/components/suites/__tests__/SuiteDetailPanel.integration.test.tsx +3 -0
  618. package/langwatch/src/components/suites/run-history-transforms.ts +1 -28
  619. package/langwatch/src/components/suites/useExportScenarioRuns.ts +333 -0
  620. package/langwatch/src/components/suites/useRunHistoryPagination.ts +14 -0
  621. package/langwatch/src/components/upgrade-modal/LimitContent.tsx +3 -154
  622. package/langwatch/src/env-create.mjs +4 -0
  623. package/langwatch/src/features/errors/logic/codes.ts +2 -1
  624. package/langwatch/src/features/errors/logic/presentation.ts +8 -3
  625. package/langwatch/src/features/langy/__tests__/presentLangyToolError.unit.test.ts +1 -1
  626. package/langwatch/src/features/langy/logic/langyToolFailure.ts +4 -7
  627. package/langwatch/src/features/traces-v2/components/TraceDrawer/conversationView/TurnSteps.tsx +1 -1
  628. package/langwatch/src/features/traces-v2/components/TraceDrawer/drawerHeader/DrawerHeader.tsx +34 -0
  629. package/langwatch/src/features/traces-v2/components/TraceDrawer/drawerHeader/__tests__/utils.unit.test.ts +74 -0
  630. package/langwatch/src/features/traces-v2/components/TraceDrawer/terminalView/TerminalView.tsx +57 -3
  631. package/langwatch/src/features/traces-v2/components/TraceDrawer/terminalView/__tests__/TerminalView.integration.test.tsx +43 -3
  632. package/langwatch/src/features/traces-v2/components/TraceTable/columns.ts +7 -0
  633. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/ContextSizeCell.tsx +48 -0
  634. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/__tests__/ContextSizeCell.integration.test.tsx +57 -0
  635. package/langwatch/src/features/traces-v2/components/TraceTable/registry/cells/trace/index.ts +2 -0
  636. package/langwatch/src/features/traces-v2/components/shared/TokenBreakdownTooltip.tsx +22 -0
  637. package/langwatch/src/features/traces-v2/lens/capabilities.ts +2 -0
  638. package/langwatch/src/features/traces-v2/types/trace.ts +2 -0
  639. package/langwatch/src/hooks/__tests__/useLicenseEnforcement.unit.test.tsx +18 -30
  640. package/langwatch/src/hooks/__tests__/useOrganizationTeamProject.personal-workspace.integration.test.tsx +30 -0
  641. package/langwatch/src/hooks/__tests__/usePostHogIdentify.unit.test.ts +3 -3
  642. package/langwatch/src/hooks/useMemberDisableAction.ts +53 -0
  643. package/langwatch/src/hooks/useOrganizationTeamProject.ts +8 -7
  644. package/langwatch/src/optimization_studio/components/Evaluate.tsx +39 -46
  645. package/langwatch/src/optimization_studio/components/workflow/NewWorkflowForm.tsx +22 -30
  646. package/langwatch/src/pages/[project]/analytics/custom/index.tsx +1 -6
  647. package/langwatch/src/pages/api/experiment/__tests__/init.unit.test.ts +2 -87
  648. package/langwatch/src/pages/api/experiment/init.ts +7 -60
  649. package/langwatch/src/pages/auth/__tests__/forgot-password.integration.test.tsx +38 -3
  650. package/langwatch/src/pages/auth/forgot-password.tsx +19 -23
  651. package/langwatch/src/pages/auth/reset-password.tsx +2 -23
  652. package/langwatch/src/pages/settings/__tests__/authentication.integration.test.tsx +7 -0
  653. package/langwatch/src/pages/settings/__tests__/team-settings.refused-save.integration.test.tsx +253 -0
  654. package/langwatch/src/pages/settings/authentication.tsx +7 -2
  655. package/langwatch/src/pages/settings/license.tsx +4 -3
  656. package/langwatch/src/pages/settings/members.tsx +126 -34
  657. package/langwatch/src/pages/settings/teams/[team].tsx +73 -20
  658. package/langwatch/src/pages/settings/usage.tsx +7 -8
  659. package/langwatch/src/prompts/prompt-playground/components/sidebar/AddPromptButton.tsx +3 -8
  660. package/langwatch/src/server/api/routers/__tests__/annotation.tenant-references.unit.test.ts +1 -1
  661. package/langwatch/src/server/api/routers/__tests__/apiKey.myBindings.unit.test.ts +1 -1
  662. package/langwatch/src/server/api/routers/__tests__/apiKey.nameById.unit.test.ts +1 -1
  663. package/langwatch/src/server/api/routers/__tests__/apiKey.restricted-permissions.unit.test.ts +4 -1
  664. package/langwatch/src/server/api/routers/__tests__/automations.router.integration.test.ts +1 -1
  665. package/langwatch/src/server/api/routers/__tests__/bugReports.gating.unit.test.ts +1 -1
  666. package/langwatch/src/server/api/routers/__tests__/enterprise-guards.integration.test.ts +0 -4
  667. package/langwatch/src/server/api/routers/__tests__/evaluators.tenant-workflow.unit.test.ts +1 -1
  668. package/langwatch/src/server/api/routers/__tests__/graphs.tenant-dashboard.unit.test.ts +1 -1
  669. package/langwatch/src/server/api/routers/__tests__/langy.turnErrors.unit.test.ts +1 -1
  670. package/langwatch/src/server/api/routers/__tests__/langyGithub.access-order.unit.test.ts +1 -1
  671. package/langwatch/src/server/api/routers/__tests__/license.integration.test.ts +1 -17
  672. package/langwatch/src/server/api/routers/__tests__/licenseEnforcement.reportLimitBlocked.unit.test.ts +1 -1
  673. package/langwatch/src/server/api/routers/__tests__/monitors.copy.integration.test.ts +1 -11
  674. package/langwatch/src/server/api/routers/__tests__/organization.acceptInvite.unit.test.ts +1 -1
  675. package/langwatch/src/server/api/routers/__tests__/organization.setMemberDisabled.integration.test.ts +306 -0
  676. package/langwatch/src/server/api/routers/__tests__/personal-workspace-invariants.integration.test.ts +794 -0
  677. package/langwatch/src/server/api/routers/__tests__/plan.getActivePlan.integration.test.ts +0 -1
  678. package/langwatch/src/server/api/routers/__tests__/project.getHasFirstMessage.unit.test.ts +1 -1
  679. package/langwatch/src/server/api/routers/__tests__/project.regenerateApiKey.unit.test.ts +2 -2
  680. package/langwatch/src/server/api/routers/__tests__/prompts.copy.integration.test.ts +0 -58
  681. package/langwatch/src/server/api/routers/__tests__/prompts.duplicate.integration.test.ts +0 -54
  682. package/langwatch/src/server/api/routers/__tests__/publicEnv.test.ts +60 -0
  683. package/langwatch/src/server/api/routers/__tests__/secrets.reserved-names.unit.test.ts +1 -1
  684. package/langwatch/src/server/api/routers/__tests__/team.update.multi-binding.unit.test.ts +1 -1
  685. package/langwatch/src/server/api/routers/__tests__/traces.4991-full-resolution.unit.test.ts +1 -1
  686. package/langwatch/src/server/api/routers/__tests__/tracesV2.transcript-read.unit.test.ts +121 -0
  687. package/langwatch/src/server/api/routers/__tests__/translate.unit.test.ts +1 -1
  688. package/langwatch/src/server/api/routers/__tests__/user.changePassword.unit.test.ts +105 -0
  689. package/langwatch/src/server/api/routers/__tests__/user.deactivation.unit.test.ts +1 -1
  690. package/langwatch/src/server/api/routers/__tests__/user.register.unit.test.ts +67 -5
  691. package/langwatch/src/server/api/routers/__tests__/workflows.generateCommitMessage.unit.test.ts +1 -1
  692. package/langwatch/src/server/api/routers/agents.ts +0 -6
  693. package/langwatch/src/server/api/routers/analytics/__tests__/dataForFilter.unit.test.ts +1 -1
  694. package/langwatch/src/server/api/routers/apiKey.ts +1 -1
  695. package/langwatch/src/server/api/routers/automations.ts +0 -4
  696. package/langwatch/src/server/api/routers/bugReports.ts +1 -1
  697. package/langwatch/src/server/api/routers/copyEvaluatorToProject.ts +2 -5
  698. package/langwatch/src/server/api/routers/dashboards.ts +0 -2
  699. package/langwatch/src/server/api/routers/dataset.ts +0 -9
  700. package/langwatch/src/server/api/routers/emailSuppression.ts +1 -1
  701. package/langwatch/src/server/api/routers/evaluators.ts +0 -4
  702. package/langwatch/src/server/api/routers/experiments.ts +0 -14
  703. package/langwatch/src/server/api/routers/export.ts +65 -24
  704. package/langwatch/src/server/api/routers/graphs.ts +0 -2
  705. package/langwatch/src/server/api/routers/group.ts +6 -0
  706. package/langwatch/src/server/api/routers/langyEgress.ts +1 -1
  707. package/langwatch/src/server/api/routers/langyGithub.ts +1 -1
  708. package/langwatch/src/server/api/routers/license.ts +44 -36
  709. package/langwatch/src/server/api/routers/licenseEnforcement.ts +0 -21
  710. package/langwatch/src/server/api/routers/modelProviders.ts +1 -1
  711. package/langwatch/src/server/api/routers/monitors.ts +0 -6
  712. package/langwatch/src/server/api/routers/onboarding/__tests__/onboarding.personal-workspace.integration.test.ts +8 -15
  713. package/langwatch/src/server/api/routers/onboarding/onboarding.router.unit.test.ts +1 -1
  714. package/langwatch/src/server/api/routers/onboarding/setProductInterest.integration.test.ts +1 -1
  715. package/langwatch/src/server/api/routers/ops.ts +2 -0
  716. package/langwatch/src/server/api/routers/organization.ts +67 -1
  717. package/langwatch/src/server/api/routers/project.ts +74 -36
  718. package/langwatch/src/server/api/routers/prompts/prompts.trpc-router.ts +0 -10
  719. package/langwatch/src/server/api/routers/publicEnv.ts +7 -3
  720. package/langwatch/src/server/api/routers/scenarios/__tests__/simulation-runner.router.unit.test.ts +1 -1
  721. package/langwatch/src/server/api/routers/scenarios/scenario-crud.router.ts +0 -4
  722. package/langwatch/src/server/api/routers/scimToken.ts +1 -1
  723. package/langwatch/src/server/api/routers/suites/suite.router.ts +0 -3
  724. package/langwatch/src/server/api/routers/team.ts +48 -39
  725. package/langwatch/src/server/api/routers/tracesV2.schemas.ts +2 -0
  726. package/langwatch/src/server/api/routers/tracesV2.ts +76 -20
  727. package/langwatch/src/server/api/routers/user.ts +16 -6
  728. package/langwatch/src/server/api/routers/workflows.ts +0 -7
  729. package/langwatch/src/server/api/trpc.ts +1 -1
  730. package/langwatch/src/server/api-key/__tests__/api-key.service.legacy-ceiling.unit.test.ts +379 -0
  731. package/langwatch/src/server/api-key/__tests__/api-key.service.safety.unit.test.ts +3 -0
  732. package/langwatch/src/server/api-key/__tests__/api-key.service.unit.test.ts +3 -0
  733. package/langwatch/src/server/api-key/api-key.service.ts +63 -22
  734. package/langwatch/src/server/api-router.ts +5 -3
  735. package/langwatch/src/server/app-layer/__tests__/tracing.unit.test.ts +142 -0
  736. package/langwatch/src/server/app-layer/clients/clickhouse/__tests__/cold-scan-detector.coverage.unit.test.ts +2 -0
  737. package/langwatch/src/server/app-layer/clients/clickhouse/windowed-read.ts +15 -0
  738. package/langwatch/src/server/app-layer/dependencies.ts +8 -0
  739. package/langwatch/src/server/app-layer/evaluations/repositories/__tests__/evaluation-run.resolver-window.unit.test.ts +103 -0
  740. package/langwatch/src/server/app-layer/evaluations/repositories/evaluation-run.clickhouse.repository.ts +35 -1
  741. package/langwatch/src/server/app-layer/groups/group.service.ts +37 -0
  742. package/langwatch/src/server/app-layer/groups/repositories/group.prisma.repository.ts +9 -0
  743. package/langwatch/src/server/app-layer/groups/repositories/group.repository.ts +8 -0
  744. package/langwatch/src/server/app-layer/langy/__tests__/langyConversationMemory.unit.test.ts +1 -1
  745. package/langwatch/src/server/app-layer/langy/__tests__/langyTurnContext.unit.test.ts +0 -0
  746. package/langwatch/src/server/app-layer/langy/langyConversationMemory.ts +1 -1
  747. package/langwatch/src/server/app-layer/logs/repositories/__tests__/canonical-log-record.clickhouse.repository.unit.test.ts +54 -0
  748. package/langwatch/src/server/app-layer/logs/repositories/canonical-log-record.clickhouse.repository.ts +29 -12
  749. package/langwatch/src/server/app-layer/ops/__tests__/integration/pending-counter-reconcile.integration.test.ts +240 -0
  750. package/langwatch/src/server/app-layer/ops/__tests__/integration/replay-full-rebuild.integration.test.ts +390 -0
  751. package/langwatch/src/server/app-layer/ops/__tests__/replay.service.unit.test.ts +105 -1
  752. package/langwatch/src/server/app-layer/ops/replay.service.ts +47 -0
  753. package/langwatch/src/server/app-layer/ops/repositories/__tests__/queue.redis.repository.reconcile-pending.unit.test.ts +752 -0
  754. package/langwatch/src/server/app-layer/ops/repositories/queue.redis.repository.ts +597 -48
  755. package/langwatch/src/server/app-layer/organizations/__tests__/organization.service.unit.test.ts +1 -0
  756. package/langwatch/src/server/app-layer/organizations/organization.service.ts +16 -0
  757. package/langwatch/src/server/app-layer/organizations/repositories/organization.prisma.repository.ts +63 -2
  758. package/langwatch/src/server/app-layer/organizations/repositories/organization.repository.ts +15 -0
  759. package/langwatch/src/server/app-layer/presets.ts +27 -13
  760. package/langwatch/src/server/app-layer/projects/__tests__/project-service-update.unit.test.ts +100 -0
  761. package/langwatch/src/server/app-layer/projects/project.service.ts +145 -6
  762. package/langwatch/src/server/app-layer/projects/repositories/project.prisma.repository.ts +2 -16
  763. package/langwatch/src/server/app-layer/projects/repositories/project.repository.ts +2 -13
  764. package/langwatch/src/server/app-layer/simulations/__tests__/scenario-run-export-sweep.integration.test.ts +370 -0
  765. package/langwatch/src/server/app-layer/simulations/repositories/simulation.clickhouse.repository.ts +302 -7
  766. package/langwatch/src/server/app-layer/simulations/repositories/simulation.repository.ts +62 -0
  767. package/langwatch/src/server/app-layer/subscription/__tests__/composite-plan-provider.unit.test.ts +2 -28
  768. package/langwatch/src/server/app-layer/subscription/__tests__/self-hosted-plan-provider.unit.test.ts +101 -0
  769. package/langwatch/src/server/app-layer/subscription/self-hosted-plan-provider.ts +34 -0
  770. package/langwatch/src/server/app-layer/teams/team.service.ts +27 -0
  771. package/langwatch/src/server/app-layer/traces/__tests__/claude-code-span-enrichment.unit.test.ts +179 -0
  772. package/langwatch/src/server/app-layer/traces/__tests__/coding-agent-span-filter.unit.test.ts +50 -0
  773. package/langwatch/src/server/app-layer/traces/__tests__/coding-agent-transcript.derivation.unit.test.ts +331 -0
  774. package/langwatch/src/server/app-layer/traces/__tests__/trace-io-extraction.service.unit.test.ts +20 -0
  775. package/langwatch/src/server/app-layer/traces/canonicalisation/__tests__/structuredIO.test.ts +22 -1
  776. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/claudeCode.unit.test.ts +217 -0
  777. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/codex.unit.test.ts +133 -0
  778. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/__tests__/vercel.unit.test.ts +79 -0
  779. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/_constants.ts +9 -0
  780. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/claudeCode.ts +429 -6
  781. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/codex.ts +158 -70
  782. package/langwatch/src/server/app-layer/traces/canonicalisation/extractors/vercel.ts +26 -8
  783. package/langwatch/src/server/app-layer/traces/claude-code-span-enrichment.ts +89 -1
  784. package/langwatch/src/server/app-layer/traces/coding-agent-span-filter.ts +23 -1
  785. package/langwatch/src/server/app-layer/traces/coding-agent-transcript.derivation.ts +330 -75
  786. package/langwatch/src/server/app-layer/traces/repositories/__tests__/span-storage.resolver-window.unit.test.ts +108 -0
  787. package/langwatch/src/server/app-layer/traces/repositories/__tests__/trace-list.clickhouse.repository.integration.test.ts +31 -2
  788. package/langwatch/src/server/app-layer/traces/repositories/span-storage.clickhouse.repository.ts +36 -1
  789. package/langwatch/src/server/app-layer/traces/repositories/trace-list.clickhouse.repository.ts +7 -0
  790. package/langwatch/src/server/app-layer/traces/trace-io-extraction.service.ts +8 -1
  791. package/langwatch/src/server/app-layer/traces/trace-list.service.ts +10 -0
  792. package/langwatch/src/server/app-layer/tracing.ts +47 -0
  793. package/langwatch/src/server/app-layer/usage/usage.service.ts +0 -80
  794. package/langwatch/src/server/better-auth/__tests__/hooks.test.ts +72 -0
  795. package/langwatch/src/server/better-auth/__tests__/index.test.ts +31 -9
  796. package/langwatch/src/server/better-auth/__tests__/resetRecoversOauthUser.test.ts +128 -0
  797. package/langwatch/src/server/better-auth/__tests__/ssoGate.hook.test.ts +321 -0
  798. package/langwatch/src/server/better-auth/hooks.ts +46 -1
  799. package/langwatch/src/server/better-auth/index.ts +123 -284
  800. package/langwatch/src/server/clickhouse/__tests__/replicatedEngineGuard.unit.test.ts +301 -0
  801. package/langwatch/src/server/clickhouse/goose.ts +8 -0
  802. package/langwatch/src/server/clickhouse/migrations/00064_replicate_gateway_budget_scope_totals.sql +291 -0
  803. package/langwatch/src/server/clickhouse/migrations/00065_replicate_trace_analytics_rollup.sql +143 -0
  804. package/langwatch/src/server/clickhouse/migrations/00066_replicate_evaluation_analytics_rollup.sql +115 -0
  805. package/langwatch/src/server/datasets/__tests__/dataset-chunking.unit.test.ts +0 -0
  806. package/langwatch/src/server/evaluations/evaluators.generated.ts +83 -63
  807. package/langwatch/src/server/event-sourcing/pipeline/__tests__/staticBuilder.validations.unit.test.ts +46 -0
  808. package/langwatch/src/server/event-sourcing/pipeline/processManagerDefinition.ts +14 -0
  809. package/langwatch/src/server/event-sourcing/pipeline/staticBuilder.ts +8 -0
  810. package/langwatch/src/server/event-sourcing/pipelines/automations/subscribers/__tests__/graphTriggerActivity.groupKey.unit.test.ts +55 -0
  811. package/langwatch/src/server/event-sourcing/pipelines/automations/subscribers/graphTriggerActivity.subscriber.ts +23 -0
  812. package/langwatch/src/server/event-sourcing/pipelines/blob-maintenance/process-manager/blobCleanup.process.ts +6 -4
  813. package/langwatch/src/server/event-sourcing/pipelines/coding-agent-processing/schemas/constants.ts +6 -4
  814. package/langwatch/src/server/event-sourcing/pipelines/evaluation-processing/pipeline.ts +9 -1
  815. package/langwatch/src/server/event-sourcing/pipelines/log-processing/__tests__/logCommandCoalescing.unit.test.ts +174 -0
  816. package/langwatch/src/server/event-sourcing/pipelines/log-processing/pipeline.ts +7 -0
  817. package/langwatch/src/server/event-sourcing/pipelines/log-processing/schemas/constants.ts +19 -0
  818. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/__tests__/metricCommandCoalescing.unit.test.ts +137 -0
  819. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/pipeline.ts +7 -0
  820. package/langwatch/src/server/event-sourcing/pipelines/metric-processing/schemas/constants.ts +19 -0
  821. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/__tests__/aiSdkStructuredOutput.integration.test.ts +199 -0
  822. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/pipeline.ts +9 -1
  823. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/spanStorageGroupKey.unit.test.ts +98 -0
  824. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/traceSummaryClaudeCodeLift.unit.test.ts +187 -1
  825. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/spanStorage.mapProjection.ts +10 -1
  826. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/spanStorageGroupKey.ts +63 -0
  827. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/traceSummary.foldProjection.ts +85 -18
  828. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/reactors/__tests__/projectMetadata.groupKey.unit.test.ts +140 -0
  829. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/reactors/projectMetadata.reactor.ts +23 -0
  830. package/langwatch/src/server/event-sourcing/projections/__tests__/projectionRouter.mapReactorCollapse.unit.test.ts +260 -0
  831. package/langwatch/src/server/event-sourcing/projections/foldProjection.types.ts +6 -3
  832. package/langwatch/src/server/event-sourcing/projections/global/__tests__/billingMeterDispatch.groupKey.unit.test.ts +139 -0
  833. package/langwatch/src/server/event-sourcing/projections/global/billingMeterDispatch.reactor.ts +27 -1
  834. package/langwatch/src/server/event-sourcing/projections/projectionRouter.ts +58 -41
  835. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/blobSweeper.integration.test.ts +149 -0
  836. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/groupQueue.decodeDrop.integration.test.ts +12 -1
  837. package/langwatch/src/server/event-sourcing/queues/groupQueue/__tests__/groupQueue.integration.test.ts +45 -0
  838. package/langwatch/src/server/event-sourcing/queues/groupQueue/blobSweeper.ts +130 -22
  839. package/langwatch/src/server/event-sourcing/queues/groupQueue/scripts.ts +46 -0
  840. package/langwatch/src/server/event-sourcing/replay/__tests__/traceAnalyticsRollupReplay.integration.test.ts +356 -0
  841. package/langwatch/src/server/event-sourcing/replay/replayService.ts +7 -0
  842. package/langwatch/src/server/event-sourcing/services/queues/__tests__/queueManager.commandGroupKey.test.ts +114 -2
  843. package/langwatch/src/server/event-sourcing/services/queues/queueManager.ts +13 -9
  844. package/langwatch/src/server/experiments-v3/execution/__tests__/buildTargetMetadata.unit.test.ts +93 -0
  845. package/langwatch/src/server/experiments-v3/execution/__tests__/orchestratorStorageDispatch.unit.test.ts +57 -0
  846. package/langwatch/src/server/experiments-v3/execution/__tests__/resultMapper.test.ts +180 -13
  847. package/langwatch/src/server/experiments-v3/execution/orchestrator.ts +40 -8
  848. package/langwatch/src/server/experiments-v3/execution/resultMapper.ts +81 -22
  849. package/langwatch/src/server/experiments-v3/execution/types.ts +8 -0
  850. package/langwatch/src/server/export/scenario-runs/__tests__/csv-serializer.unit.test.ts +732 -0
  851. package/langwatch/src/server/export/scenario-runs/__tests__/scenario-run-export.service.unit.test.ts +303 -0
  852. package/langwatch/src/server/export/scenario-runs/csv-serializer.ts +383 -0
  853. package/langwatch/src/server/export/scenario-runs/errors.ts +44 -0
  854. package/langwatch/src/server/export/scenario-runs/scenario-run-export.service.ts +200 -0
  855. package/langwatch/src/server/export/scenario-runs/types.ts +64 -0
  856. package/langwatch/src/server/featureFlag/frontendFeatureFlags.ts +4 -0
  857. package/langwatch/src/server/featureFlag/registry.ts +7 -0
  858. package/langwatch/src/server/gateway/virtualKey.service.ts +2 -2
  859. package/langwatch/src/server/license-enforcement/__tests__/constants.unit.test.ts +2 -10
  860. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.repository.integration.test.ts +17 -194
  861. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.repository.unit.test.ts +3 -301
  862. package/langwatch/src/server/license-enforcement/__tests__/license-enforcement.service.unit.test.ts +51 -137
  863. package/langwatch/src/server/license-enforcement/__tests__/license-limit-guard.unit.test.ts +46 -13
  864. package/langwatch/src/server/license-enforcement/__tests__/usage-stats.service.unit.test.ts +1 -3
  865. package/langwatch/src/server/license-enforcement/constants.ts +0 -26
  866. package/langwatch/src/server/license-enforcement/index.ts +0 -5
  867. package/langwatch/src/server/license-enforcement/license-enforcement.repository.ts +4 -227
  868. package/langwatch/src/server/license-enforcement/license-enforcement.service.ts +0 -52
  869. package/langwatch/src/server/license-enforcement/types.ts +8 -17
  870. package/langwatch/src/server/license-enforcement/usage-stats.service.ts +0 -32
  871. package/langwatch/src/server/modelProviders/__tests__/governanceSignup.providerScope.integration.test.ts +1 -1
  872. package/langwatch/src/server/rbac/__tests__/apiKeyCeilingStaleness.unit.test.ts +5 -0
  873. package/langwatch/src/server/rbac/__tests__/role-binding-resolver.ceiling.unit.test.ts +108 -3
  874. package/langwatch/src/server/rbac/role-binding-resolver.ts +147 -1
  875. package/langwatch/src/server/role/__tests__/role-service-rolebinding.unit.test.ts +2 -0
  876. package/langwatch/src/server/role/role.service.ts +15 -1
  877. package/langwatch/src/server/role-bindings/__tests__/role-binding.service.tenant.unit.test.ts +2 -0
  878. package/langwatch/src/server/role-bindings/personal-team-scope.ts +105 -0
  879. package/langwatch/src/server/role-bindings/role-binding.service.ts +10 -2
  880. package/langwatch/src/server/routes/__tests__/github-langy-install.integration.test.ts +1 -1
  881. package/langwatch/src/server/routes/auth.ts +6 -1
  882. package/langwatch/src/server/routes/github-langy.ts +1 -1
  883. package/langwatch/src/server/scenarios/__tests__/scenario-archive.integration.test.ts +11 -15
  884. package/langwatch/src/server/scenarios/scenario-run-category.ts +48 -0
  885. package/langwatch/src/server/stored-objects/__tests__/coerce-content-to-array.unit.test.ts +0 -0
  886. package/langwatch/src/server/stored-objects/__tests__/scenario-events-ingest.integration.test.ts +2 -6
  887. package/langwatch/src/server/teams/team.service.ts +14 -1
  888. package/langwatch/src/server/tracer/types.ts +3 -0
  889. package/langwatch/src/server/traces/__tests__/trace-service-claude-enrichment.unit.test.ts +85 -0
  890. package/langwatch/src/server/traces/mappers/__tests__/trace-summary.mapper.test.ts +106 -0
  891. package/langwatch/src/server/traces/mappers/trace-summary.mapper.ts +59 -0
  892. package/langwatch/src/server/traces/projection/catalog.ts +3 -0
  893. package/langwatch/src/server/traces/trace.service.ts +21 -1
  894. package/langwatch/src/server/workers/__tests__/livenessThread.unit.test.ts +133 -0
  895. package/langwatch/src/server/workers/startWorkers.ts +250 -29
  896. package/langwatch/src/utils/__tests__/api.unit.test.ts +15 -15
  897. package/langwatch/src/utils/constants.ts +1 -0
  898. package/langwatch/src/utils/lambdaFetch.ts +0 -0
  899. package/langwatch/test-setup.ts +9 -0
  900. package/mcp-server/dist/chunk-FMQIE5DL.js +2328 -0
  901. package/mcp-server/dist/create-mcp-server.js +1 -1
  902. package/mcp-server/dist/discover-evaluator-schema-HYPFWGNN.js +2191 -0
  903. package/mcp-server/dist/http-server-UBX7YFXE.js +24466 -0
  904. package/mcp-server/dist/index.js +49 -33
  905. package/package.json +1 -1
  906. package/packages/server/dist/cli.cjs +1 -1
  907. package/langwatch/dist/client/assets/AddAnnotationQueueDrawer-BeOD83jA.js +0 -2
  908. package/langwatch/dist/client/assets/AddDatasetRecordDrawer-jHTYLVuB.js +0 -6
  909. package/langwatch/dist/client/assets/AddOrEditAnnotationScore-DW5VXwj8.js +0 -2
  910. package/langwatch/dist/client/assets/AddOrEditAnnotationScoreDrawer-6ycw-4n0.js +0 -2
  911. package/langwatch/dist/client/assets/AddOrEditDatasetDrawer-DKQT3n1Q.js +0 -3
  912. package/langwatch/dist/client/assets/AddParticipants-7HKlJHjI.js +0 -2
  913. package/langwatch/dist/client/assets/AgentHistoryDrawer-B1kjJyfj.js +0 -2
  914. package/langwatch/dist/client/assets/AgentHttpEditorDrawer-Dkex2eS8.js +0 -5
  915. package/langwatch/dist/client/assets/AgentListDrawer-B-ab-fJ_.js +0 -2
  916. package/langwatch/dist/client/assets/AgentTypeSelectorDrawer-CBUwY7Q0.js +0 -2
  917. package/langwatch/dist/client/assets/AgentWorkflowEditorDrawer-DZr-iX29.js +0 -2
  918. package/langwatch/dist/client/assets/AgentWorkflowTargetEditorDrawer-C1AYXbvP.js +0 -2
  919. package/langwatch/dist/client/assets/AiGatewayLayout-BFUOyL-l.js +0 -2
  920. package/langwatch/dist/client/assets/AnnotationsTable-CnwGxhJg.js +0 -2
  921. package/langwatch/dist/client/assets/AreaChart-BZjKjRMD.js +0 -2
  922. package/langwatch/dist/client/assets/AutomationDrawer-BTtX7UXo.js +0 -112
  923. package/langwatch/dist/client/assets/BatchEvaluationSummary-CFBL50E9.js +0 -2
  924. package/langwatch/dist/client/assets/BudgetEditDrawer-DhNs7V2e.js +0 -2
  925. package/langwatch/dist/client/assets/CartesianChart-CgGSWzzH.js +0 -54
  926. package/langwatch/dist/client/assets/CascadeArchiveDialog-BOcl2osO.js +0 -2
  927. package/langwatch/dist/client/assets/ChartTooltip-BKs8as3o.js +0 -4
  928. package/langwatch/dist/client/assets/ChatWindow-B-UHoZDM.js +0 -5
  929. package/langwatch/dist/client/assets/CodeEvaluatorEditorDrawer-jdmrD4H5.js +0 -9
  930. package/langwatch/dist/client/assets/CodexCodingDefaultsAsk-CKLyE8Ty.js +0 -2
  931. package/langwatch/dist/client/assets/ColorfulBlockIcons-Ctm_Gy50.js +0 -6
  932. package/langwatch/dist/client/assets/ColumnTypeIcon-Bh1MI0_N.js +0 -2
  933. package/langwatch/dist/client/assets/ConfirmDialog-CbyD4lof.js +0 -2
  934. package/langwatch/dist/client/assets/ContactSalesBlock-3LFiXNMY.js +0 -2
  935. package/langwatch/dist/client/assets/Conversation-C27uRW0p.js +0 -2
  936. package/langwatch/dist/client/assets/CopyInput-BJ8UDgiW.js +0 -2
  937. package/langwatch/dist/client/assets/CopyableInputWithPrefix-DhfQEE7R.js +0 -2
  938. package/langwatch/dist/client/assets/CreateProjectDrawer-f6ESIihF.js +0 -2
  939. package/langwatch/dist/client/assets/CreateTeamDrawer-CsScDzr3.js +0 -2
  940. package/langwatch/dist/client/assets/CustomGraph-DOp8hQmM.js +0 -2
  941. package/langwatch/dist/client/assets/DashboardLayout-BhHe0vIT.js +0 -96
  942. package/langwatch/dist/client/assets/DashboardNameDrawer-WriiQpWZ.js +0 -2
  943. package/langwatch/dist/client/assets/DataPrivacyRuleDrawer-BWcEQSs7.js +0 -2
  944. package/langwatch/dist/client/assets/DatasetEditorTable-BLbB_Sn-.js +0 -2
  945. package/langwatch/dist/client/assets/DatasetPickerList-CDIBTAQW.js +0 -2
  946. package/langwatch/dist/client/assets/DatasetPreviewTable-UuBrd6hv.js +0 -2
  947. package/langwatch/dist/client/assets/DatasetSelector-DJI4ZOko.js +0 -2
  948. package/langwatch/dist/client/assets/DefaultModelOverrideDrawer-DfGbPivl.js +0 -2
  949. package/langwatch/dist/client/assets/DeleteConfirmationDialog-w7WZ7lHP.js +0 -2
  950. package/langwatch/dist/client/assets/DocsLinks-vsvIA7dY.js +0 -2
  951. package/langwatch/dist/client/assets/DynamicZodForm-lW0sHL84.js +0 -2
  952. package/langwatch/dist/client/assets/EditAutomationFilterDrawer-UZGlf7Jf.js +0 -3
  953. package/langwatch/dist/client/assets/EditModelProviderDrawer-FxE8Cjfj.js +0 -4
  954. package/langwatch/dist/client/assets/EditProjectDrawer-DvGgMwQg.js +0 -2
  955. package/langwatch/dist/client/assets/EmojiPickerModal-DOTbYgFl.js +0 -3
  956. package/langwatch/dist/client/assets/EnterpriseLockedSurface-CM8Sj7hf.js +0 -2
  957. package/langwatch/dist/client/assets/ErrorBarContext-Bpz3-JDH.js +0 -2
  958. package/langwatch/dist/client/assets/EvaluatorApiUsageDialog-Bnv6z6m_.js +0 -107
  959. package/langwatch/dist/client/assets/EvaluatorCategorySelectorDrawer-DPt4B9Ey.js +0 -2
  960. package/langwatch/dist/client/assets/EvaluatorEditorDrawer-C1OQ89no.js +0 -2
  961. package/langwatch/dist/client/assets/EvaluatorEditorShared-Dlnmyfw9.js +0 -43
  962. package/langwatch/dist/client/assets/EvaluatorHistoryDrawer-BFqreRNY.js +0 -2
  963. package/langwatch/dist/client/assets/EvaluatorListDrawer-B5GkvEER.js +0 -2
  964. package/langwatch/dist/client/assets/EvaluatorMappingsSection-uZ95zEz_.js +0 -2
  965. package/langwatch/dist/client/assets/EvaluatorSelection-CLClnlPT.js +0 -2
  966. package/langwatch/dist/client/assets/EvaluatorSelectionBox-VWh5DBap.js +0 -2
  967. package/langwatch/dist/client/assets/EvaluatorTypeSelectorContent-BTrBItgE.js +0 -2
  968. package/langwatch/dist/client/assets/EvaluatorTypeSelectorDrawer-0T-zwQQZ.js +0 -2
  969. package/langwatch/dist/client/assets/ExecutionState-BPNxLkdI.js +0 -2
  970. package/langwatch/dist/client/assets/FeatureFlagsDrawer-CpSauosT.js +0 -2
  971. package/langwatch/dist/client/assets/FieldInfoTooltip-BlO6fteF.js +0 -2
  972. package/langwatch/dist/client/assets/FieldsFilters-B46wbf2n.js +0 -2
  973. package/langwatch/dist/client/assets/FilterDisplay-BzhnJIar.js +0 -2
  974. package/langwatch/dist/client/assets/FilterSidebar-CbZF27X2.js +0 -2
  975. package/langwatch/dist/client/assets/FormatMoney-vCZvmGG1.js +0 -2
  976. package/langwatch/dist/client/assets/FoundryDrawer-DskBXiS5.js +0 -2
  977. package/langwatch/dist/client/assets/FullLogo-Db9M_uOO.js +0 -2
  978. package/langwatch/dist/client/assets/GovernanceLayout-DiDbO74a.js +0 -2
  979. package/langwatch/dist/client/assets/GraphsLayout-BCvqg3RK.js +0 -2
  980. package/langwatch/dist/client/assets/GroupBindingInputRow-DQP7aETW.js +0 -2
  981. package/langwatch/dist/client/assets/GuardrailsDrawer-CHV6LBxp.js +0 -91
  982. package/langwatch/dist/client/assets/History-hXXVv0A2.js +0 -17
  983. package/langwatch/dist/client/assets/HorizontalFormControl-lYiaIlzD.js +0 -2
  984. package/langwatch/dist/client/assets/HoverableBigText-CIhevUVt.js +0 -2
  985. package/langwatch/dist/client/assets/InstallCliCard-CJKSPLJ_.js +0 -2
  986. package/langwatch/dist/client/assets/IntegratePaneShell-BpcA5j4P.js +0 -8
  987. package/langwatch/dist/client/assets/InviteMemberDrawer-DiuPqGoS.js +0 -2
  988. package/langwatch/dist/client/assets/IsolatedErrorBoundary-CZ4MnYEN.js +0 -2
  989. package/langwatch/dist/client/assets/LLMModelCostDrawer-D1G0lU1N.js +0 -2
  990. package/langwatch/dist/client/assets/LangyContextTarget-CIlp_Zew.js +0 -2
  991. package/langwatch/dist/client/assets/LegacyTracesDeprecationBanner-Cd0jbm0t.js +0 -2
  992. package/langwatch/dist/client/assets/Legend-DY68SncN.js +0 -6
  993. package/langwatch/dist/client/assets/Line-B2wakHWw.js +0 -2
  994. package/langwatch/dist/client/assets/LineChart-Bb84FSVR.js +0 -2
  995. package/langwatch/dist/client/assets/ListTable-8idtTXBY.js +0 -2
  996. package/langwatch/dist/client/assets/LoadingScreen-DQ62wqSN.js +0 -2
  997. package/langwatch/dist/client/assets/Markdown-C9extmbX.js +0 -35
  998. package/langwatch/dist/client/assets/MenuLink-CVzOs3K8.js +0 -2
  999. package/langwatch/dist/client/assets/MessageCard--GCYkR2M.js +0 -2
  1000. package/langwatch/dist/client/assets/MetadataTag-CSCPlbDN.js +0 -5
  1001. package/langwatch/dist/client/assets/ModelProviderCustomModelInput-DUwvNeux.js +0 -2
  1002. package/langwatch/dist/client/assets/ModelProviderScreen-BVBKstQm.js +0 -2
  1003. package/langwatch/dist/client/assets/ModelSelector-4R-dc-Ny.js +0 -2
  1004. package/langwatch/dist/client/assets/MyLayout-DCMYTSgX.js +0 -2
  1005. package/langwatch/dist/client/assets/NavigationFooter-1VNOUoV6.js +0 -2
  1006. package/langwatch/dist/client/assets/NewWorkflowForm-CsYSc1Vr.js +0 -2
  1007. package/langwatch/dist/client/assets/NoDataInfoBlock-C8x5bzL0.js +0 -2
  1008. package/langwatch/dist/client/assets/OnboardingContainer-e4kVlnyx.js +0 -2
  1009. package/langwatch/dist/client/assets/OnlineEvaluationDrawer-D2jYsSON.js +0 -2
  1010. package/langwatch/dist/client/assets/OpsPageShell-Ch1rtwuD.js +0 -2
  1011. package/langwatch/dist/client/assets/OttlEditor-baChQv3o.js +0 -3
  1012. package/langwatch/dist/client/assets/OverflownText-CY4Y__oL.js +0 -2
  1013. package/langwatch/dist/client/assets/ProjectAvatar-DtI9dT1f.js +0 -43
  1014. package/langwatch/dist/client/assets/ProjectLangyLayout-Cl7GB9zi.js +0 -82
  1015. package/langwatch/dist/client/assets/PromptEditorDrawer-BLIu4fKV.js +0 -2
  1016. package/langwatch/dist/client/assets/PromptListDrawer-BHC9jUMJ.js +0 -2
  1017. package/langwatch/dist/client/assets/PropertySectionTitle-Da2IdhM3.js +0 -37
  1018. package/langwatch/dist/client/assets/ProviderModelSelector-Cg5Lbc1U.js +0 -2
  1019. package/langwatch/dist/client/assets/ProviderScopeChips-D7HJW6Ht.js +0 -2
  1020. package/langwatch/dist/client/assets/PushToCopiesDialog-B_hvn6aW.js +0 -2
  1021. package/langwatch/dist/client/assets/ReferenceDot-DbjBc6Dh.js +0 -2
  1022. package/langwatch/dist/client/assets/RenderInputOutput-BntIB-Ae.js +0 -261
  1023. package/langwatch/dist/client/assets/ScenarioFormDrawer-BORe6ffA.js +0 -2
  1024. package/langwatch/dist/client/assets/ScenarioInputMappingSection-DVpK_-Qh.js +0 -2
  1025. package/langwatch/dist/client/assets/ScenarioRunDetailDrawer-MJhw77cs.js +0 -3
  1026. package/langwatch/dist/client/assets/ScopeChipPicker-B3xHf0Ii.js +0 -2
  1027. package/langwatch/dist/client/assets/SearchInput-C7YbWRUQ.js +0 -2
  1028. package/langwatch/dist/client/assets/SectionNavigationLayout-CIP_2Nxf.js +0 -2
  1029. package/langwatch/dist/client/assets/SelectDatasetDrawer-D_nCx9JT.js +0 -2
  1030. package/langwatch/dist/client/assets/SelectionActionBar-fxhOYCmO.js +0 -2
  1031. package/langwatch/dist/client/assets/SeriesFilterDrawer-zoWjjTxC.js +0 -2
  1032. package/langwatch/dist/client/assets/SettingsLayout-sixsNIX_.js +0 -2
  1033. package/langwatch/dist/client/assets/SetupWithAgentButton-Bhxb1yOj.js +0 -4
  1034. package/langwatch/dist/client/assets/ShikiCommandBox-CN1W-H2m.js +0 -5
  1035. package/langwatch/dist/client/assets/SpanDetails-DavcMtlr.js +0 -3
  1036. package/langwatch/dist/client/assets/SubscriptionPage-gPKGn08f.js +0 -2
  1037. package/langwatch/dist/client/assets/SuiteFormDrawer-C_5urLUY.js +0 -2
  1038. package/langwatch/dist/client/assets/TabButton-Cp8UA45p.js +0 -3
  1039. package/langwatch/dist/client/assets/TableCell-Cbtwk2YR.js +0 -2
  1040. package/langwatch/dist/client/assets/TargetTypeSelectorDrawer-B0xHR5hC.js +0 -2
  1041. package/langwatch/dist/client/assets/TeamForm-DvN0gccP.js +0 -2
  1042. package/langwatch/dist/client/assets/TeamUserRoleField-DD6lt16j.js +0 -2
  1043. package/langwatch/dist/client/assets/TraceDetails-DZtIKcmo.js +0 -9
  1044. package/langwatch/dist/client/assets/TraceDetailsDrawer-DKgyPTw5.js +0 -2
  1045. package/langwatch/dist/client/assets/TraceIdPeek-7T88rBev.js +0 -2
  1046. package/langwatch/dist/client/assets/TracesMapping-CYIUxk62.js +0 -2
  1047. package/langwatch/dist/client/assets/UpgradeModalContent-eXy8pG4-.js +0 -2
  1048. package/langwatch/dist/client/assets/UploadCSVDrawer-BTttuVHZ.js +0 -3
  1049. package/langwatch/dist/client/assets/VariablesSection-hjZ5pmeK.js +0 -2
  1050. package/langwatch/dist/client/assets/VersionBadge-BPxGh4w7.js +0 -2
  1051. package/langwatch/dist/client/assets/ViaClaudeDesktopScreen-B9EYtw_g.js +0 -1161
  1052. package/langwatch/dist/client/assets/ViewAutomationDrawer-H_lJU8lG.js +0 -2
  1053. package/langwatch/dist/client/assets/VirtualKeySecretReveal-5GeVsP9d.js +0 -54
  1054. package/langwatch/dist/client/assets/WelcomeLayout-CDTLOa4d.js +0 -2
  1055. package/langwatch/dist/client/assets/WithFeatureFlagGuard-OePuXWRG.js +0 -2
  1056. package/langwatch/dist/client/assets/WithPermissionGuard-Cr6Aljmy.js +0 -2
  1057. package/langwatch/dist/client/assets/WorkflowCard-SFB2TN6O.js +0 -2
  1058. package/langwatch/dist/client/assets/WorkflowSelectorForEvaluatorDrawer-C9JwDruB.js +0 -2
  1059. package/langwatch/dist/client/assets/_...path_-Cgdgmf5W.js +0 -2
  1060. package/langwatch/dist/client/assets/_Uint8Array-DZ50H-2q.js +0 -2
  1061. package/langwatch/dist/client/assets/__...path__-CwRP2Csi.js +0 -22
  1062. package/langwatch/dist/client/assets/_baseAssignValue-BqKt0w0a.js +0 -2
  1063. package/langwatch/dist/client/assets/_baseClone-DCKy3Vq2.js +0 -2
  1064. package/langwatch/dist/client/assets/_baseEach-BGeacxUS.js +0 -2
  1065. package/langwatch/dist/client/assets/_baseFor-BQgMStOx.js +0 -2
  1066. package/langwatch/dist/client/assets/_experiment_-UwR3aJGK.js +0 -2
  1067. package/langwatch/dist/client/assets/_id_-7nn1sxUS.js +0 -2
  1068. package/langwatch/dist/client/assets/_id_-BGN_cxTM.js +0 -2
  1069. package/langwatch/dist/client/assets/_id_-C39KWPCF.js +0 -2
  1070. package/langwatch/dist/client/assets/_id_-CLpZ89Xl.js +0 -2
  1071. package/langwatch/dist/client/assets/_id_-CYndCW2V.js +0 -2
  1072. package/langwatch/dist/client/assets/_id_-CfWpUbg4.js +0 -2
  1073. package/langwatch/dist/client/assets/_id_-npXkLrUc.js +0 -2
  1074. package/langwatch/dist/client/assets/_project_-B7G8spwK.js +0 -8
  1075. package/langwatch/dist/client/assets/_runId_-BSik_ZD4.js +0 -7
  1076. package/langwatch/dist/client/assets/_shell-BGaZUKLi.js +0 -2
  1077. package/langwatch/dist/client/assets/_slug_-BN6BJfW8.js +0 -17
  1078. package/langwatch/dist/client/assets/_slug_-C7DGk6aN.js +0 -2
  1079. package/langwatch/dist/client/assets/_slug_-DOlOZ10W.js +0 -2
  1080. package/langwatch/dist/client/assets/_team_-B9rXOt0D.js +0 -2
  1081. package/langwatch/dist/client/assets/_workflow_-BJIdrL-L.js +0 -25
  1082. package/langwatch/dist/client/assets/_workflow_-BKcndaRn.js +0 -3
  1083. package/langwatch/dist/client/assets/accept-CSdmIcux.js +0 -2
  1084. package/langwatch/dist/client/assets/activity-QICCt22J.js +0 -1
  1085. package/langwatch/dist/client/assets/agents--fK5G7M5.js +0 -2
  1086. package/langwatch/dist/client/assets/alerts-QICCt22J.js +0 -1
  1087. package/langwatch/dist/client/assets/all-yOqzcthm.js +0 -2
  1088. package/langwatch/dist/client/assets/analytics-CjMLTwIY.js +0 -2
  1089. package/langwatch/dist/client/assets/annotation-scores-sPTr7fKF.js +0 -2
  1090. package/langwatch/dist/client/assets/annotations-Ye3ttmrc.js +0 -2
  1091. package/langwatch/dist/client/assets/anomaly-rules-DwSc-85q.js +0 -2
  1092. package/langwatch/dist/client/assets/api-keys-CKyHUAXs.js +0 -4
  1093. package/langwatch/dist/client/assets/asaplangy-6A4CIIRR.js +0 -5
  1094. package/langwatch/dist/client/assets/audit-log-DQ9_D13G.js +0 -2
  1095. package/langwatch/dist/client/assets/auth-CHp-bSLm.js +0 -2
  1096. package/langwatch/dist/client/assets/authentication-CktawfTg.js +0 -2
  1097. package/langwatch/dist/client/assets/authorize-BSFPddoX.js +0 -2
  1098. package/langwatch/dist/client/assets/authorize-YWRIgnuS.js +0 -2
  1099. package/langwatch/dist/client/assets/automations-CI-QD_zf.js +0 -2
  1100. package/langwatch/dist/client/assets/automations-QICCt22J.js +0 -1
  1101. package/langwatch/dist/client/assets/billing-plans-DUVLJ_Sk.js +0 -2
  1102. package/langwatch/dist/client/assets/blank-CqHTkVM2.js +0 -2
  1103. package/langwatch/dist/client/assets/blobs-B_lHV3eu.js +0 -2
  1104. package/langwatch/dist/client/assets/blockDiagram-677ZJIJ3-CQSMftlX.js +0 -133
  1105. package/langwatch/dist/client/assets/budgets-D0yk2zkk.js +0 -3
  1106. package/langwatch/dist/client/assets/bug-reports-D48JQaYJ.js +0 -2
  1107. package/langwatch/dist/client/assets/cache-rules-BLbEe56I.js +0 -2
  1108. package/langwatch/dist/client/assets/choose-CR8H5_AF.js +0 -2
  1109. package/langwatch/dist/client/assets/chunk-EX3LRPZG-CULySKMF.js +0 -232
  1110. package/langwatch/dist/client/assets/chunk-FWX5IMBZ-vsHlz4qh.js +0 -3
  1111. package/langwatch/dist/client/assets/chunk-PUDLZKDR-ByJfzd90.js +0 -157
  1112. package/langwatch/dist/client/assets/chunk-RYQCIY6F-DW5yDiZP.js +0 -2
  1113. package/langwatch/dist/client/assets/chunk-V7JOEXUC-rGVlZXkP.js +0 -207
  1114. package/langwatch/dist/client/assets/classDiagram-OUVF2IWQ-DjpCOWYp.js +0 -2
  1115. package/langwatch/dist/client/assets/classDiagram-v2-EOCWNBFH-DjpCOWYp.js +0 -2
  1116. package/langwatch/dist/client/assets/codeAgentConfig-DlJOMg8p.js +0 -7
  1117. package/langwatch/dist/client/assets/codingDefaultSync-C3S2VHmn.js +0 -2
  1118. package/langwatch/dist/client/assets/configure-BPQgl6jf.js +0 -4
  1119. package/langwatch/dist/client/assets/constants-Bb5Vi_Bd.js +0 -2
  1120. package/langwatch/dist/client/assets/custom-D79e_fnJ.js +0 -12
  1121. package/langwatch/dist/client/assets/custom_evaluator-DgcItmbH.js +0 -31
  1122. package/langwatch/dist/client/assets/dagre-BqI7WPId.js +0 -2
  1123. package/langwatch/dist/client/assets/dagre-VKFMJZFB-BJj7ndf9.js +0 -5
  1124. package/langwatch/dist/client/assets/data-privacy-BuolZ3DI.js +0 -2
  1125. package/langwatch/dist/client/assets/data-retention-yWQxxUQF.js +0 -2
  1126. package/langwatch/dist/client/assets/datasets-u_OgZHiv.js +0 -2
  1127. package/langwatch/dist/client/assets/debounce-BJsF8wQY.js +0 -2
  1128. package/langwatch/dist/client/assets/defaultModelState-DY_b79Yj.js +0 -2
  1129. package/langwatch/dist/client/assets/dejaview-DSjI4vi2.js +0 -2
  1130. package/langwatch/dist/client/assets/departments-C3oaBPyA.js +0 -2
  1131. package/langwatch/dist/client/assets/devices-O_ZVZdxA.js +0 -2
  1132. package/langwatch/dist/client/assets/dist-Dd3SzC15.js +0 -6
  1133. package/langwatch/dist/client/assets/drawerFromUrl-DaNSDEzf.js +0 -2
  1134. package/langwatch/dist/client/assets/edit-CswmqyLU.js +0 -62
  1135. package/langwatch/dist/client/assets/email-suppressions-B8AuxWio.js +0 -2
  1136. package/langwatch/dist/client/assets/erDiagram-Q63AITRT-DIiR5G9i.js +0 -86
  1137. package/langwatch/dist/client/assets/error-nKFTkytv.js +0 -2
  1138. package/langwatch/dist/client/assets/errors-e711UMq7.js +0 -2
  1139. package/langwatch/dist/client/assets/evaluations-Cg9PywKJ.js +0 -2
  1140. package/langwatch/dist/client/assets/evaluations-xuA_g6-G.js +0 -2
  1141. package/langwatch/dist/client/assets/evaluators-6oHFfk5m.js +0 -146
  1142. package/langwatch/dist/client/assets/evaluators-CBPI9nP9.js +0 -2
  1143. package/langwatch/dist/client/assets/experiments-DHsdWtPG.js +0 -1
  1144. package/langwatch/dist/client/assets/feature-flags-e-cVnxOK.js +0 -2
  1145. package/langwatch/dist/client/assets/fetchSSE-5rVPow_l.js +0 -3
  1146. package/langwatch/dist/client/assets/fieldset-BNLAUiqD.js +0 -2
  1147. package/langwatch/dist/client/assets/flowDiagram-23GEKE2U-DlrfK-aL.js +0 -1
  1148. package/langwatch/dist/client/assets/forgot-password-B_FXHTn9.js +0 -2
  1149. package/langwatch/dist/client/assets/formatMoney-DRwvOSzZ.js +0 -2
  1150. package/langwatch/dist/client/assets/formatTargetOutput-CkKef3lk.js +0 -2
  1151. package/langwatch/dist/client/assets/foundry-U39hnXil.js +0 -477
  1152. package/langwatch/dist/client/assets/gateway-DZnsUBnP.js +0 -2
  1153. package/langwatch/dist/client/assets/getEvaluator-irVFciCL.js +0 -2
  1154. package/langwatch/dist/client/assets/getRadiusAndStrokeWidthFromDot-BFtcAGI_.js +0 -2
  1155. package/langwatch/dist/client/assets/governance-BBQIXSQ_.js +0 -2
  1156. package/langwatch/dist/client/assets/graphlib-Bg9XziCe.js +0 -2
  1157. package/langwatch/dist/client/assets/grid-DVy6ELOp.js +0 -2
  1158. package/langwatch/dist/client/assets/groups-DYnJ4U2W.js +0 -2
  1159. package/langwatch/dist/client/assets/guardrails-DdKPd-Zs.js +0 -2
  1160. package/langwatch/dist/client/assets/handled-error-CI7XXA3n.js +0 -2
  1161. package/langwatch/dist/client/assets/http-DSF_1QKT.js +0 -7
  1162. package/langwatch/dist/client/assets/identifierUtils-B50FmQLB.js +0 -2
  1163. package/langwatch/dist/client/assets/immer-CFru3D02.js +0 -14
  1164. package/langwatch/dist/client/assets/index-CPtTUYLD.js +0 -68
  1165. package/langwatch/dist/client/assets/ingestion-source-detail-BLfzu5Yv.js +0 -19
  1166. package/langwatch/dist/client/assets/ingestion-sources-BcwE_tRu.js +0 -12
  1167. package/langwatch/dist/client/assets/integrations-D220c59Q.js +0 -2
  1168. package/langwatch/dist/client/assets/isArrayLikeObject-DUy1V36n.js +0 -2
  1169. package/langwatch/dist/client/assets/isSymbol-COuSxi_J.js +0 -2
  1170. package/langwatch/dist/client/assets/langyHomeSuggestions-6NtCcdnH.js +0 -2
  1171. package/langwatch/dist/client/assets/license-Be6bs3wD.js +0 -2
  1172. package/langwatch/dist/client/assets/licenseStatusUtils-YSS0xL-G.js +0 -2
  1173. package/langwatch/dist/client/assets/lu-DlSq9Be4.js +0 -2
  1174. package/langwatch/dist/client/assets/map-7tkBBrDN.js +0 -2
  1175. package/langwatch/dist/client/assets/mappingValidation-C-AT88B0.js +0 -2
  1176. package/langwatch/dist/client/assets/me-BHRwGQAJ.js +0 -7
  1177. package/langwatch/dist/client/assets/me-DyaTjlbw.js +0 -2
  1178. package/langwatch/dist/client/assets/members-Dn5oJBlv.js +0 -2
  1179. package/langwatch/dist/client/assets/mermaid.core-krP_t-L5.js +0 -12
  1180. package/langwatch/dist/client/assets/messages-CN1bd906.js +0 -2
  1181. package/langwatch/dist/client/assets/metrics-Do8QhcIC.js +0 -2
  1182. package/langwatch/dist/client/assets/mindmap-definition-LN4V7U3C-DBef2D4I.js +0 -97
  1183. package/langwatch/dist/client/assets/model-costs-D6eiVgIz.js +0 -2
  1184. package/langwatch/dist/client/assets/model-providers-CiSkvGtd.js +0 -2
  1185. package/langwatch/dist/client/assets/modelProviderHelpers-P2Cogc-H.js +0 -2
  1186. package/langwatch/dist/client/assets/my-queue-D1aRcnMh.js +0 -2
  1187. package/langwatch/dist/client/assets/normalizeComparison-BY-r_dYf.js +0 -2
  1188. package/langwatch/dist/client/assets/not-found-BiyummjJ.js +0 -2
  1189. package/langwatch/dist/client/assets/now-flOUcolU.js +0 -2
  1190. package/langwatch/dist/client/assets/onboarding-D3dMDvS6.js +0 -2
  1191. package/langwatch/dist/client/assets/online-evaluations-Dk2ygUi2.js +0 -2
  1192. package/langwatch/dist/client/assets/ops-Djcw5_lX.js +0 -2
  1193. package/langwatch/dist/client/assets/organizations-F6Q6gYJ3.js +0 -2
  1194. package/langwatch/dist/client/assets/pages-BXwixFEM.js +0 -2
  1195. package/langwatch/dist/client/assets/persistence-DZOtzFnQ.js +0 -2
  1196. package/langwatch/dist/client/assets/personalProject-DMRX2-SI.js +0 -2
  1197. package/langwatch/dist/client/assets/plans-C_VYB2VX.js +0 -2
  1198. package/langwatch/dist/client/assets/preconditionFieldUtils-B7QfymK4.js +0 -2
  1199. package/langwatch/dist/client/assets/product-D0RNZ3Ls.js +0 -2
  1200. package/langwatch/dist/client/assets/project-ZTQzA2gY.js +0 -2
  1201. package/langwatch/dist/client/assets/projections-DocSauqq.js +0 -2
  1202. package/langwatch/dist/client/assets/projects-ClyGKBO9.js +0 -2
  1203. package/langwatch/dist/client/assets/promptHandle-Cen_6YRW.js +0 -2
  1204. package/langwatch/dist/client/assets/prompts-CLb2R5Fd.js +0 -8
  1205. package/langwatch/dist/client/assets/radio-group-CWz2nJi3.js +0 -2
  1206. package/langwatch/dist/client/assets/registry-B64xvGV5.js +0 -2
  1207. package/langwatch/dist/client/assets/reports-C-XbHSdJ.js +0 -2
  1208. package/langwatch/dist/client/assets/request-C3Wgq2B3.js +0 -2
  1209. package/langwatch/dist/client/assets/requirementDiagram-TGXJPOKE-9g84jNsR.js +0 -85
  1210. package/langwatch/dist/client/assets/reset-password-ohopJtIH.js +0 -2
  1211. package/langwatch/dist/client/assets/role-bindings-BQ31P1EO.js +0 -2
  1212. package/langwatch/dist/client/assets/roles-CQDx2TP6.js +0 -2
  1213. package/langwatch/dist/client/assets/routing-policies-uvNo9gfx.js +0 -5
  1214. package/langwatch/dist/client/assets/scenarios-CpA_eExG.js +0 -2
  1215. package/langwatch/dist/client/assets/scheduler-CgzNzJjP.js +0 -2
  1216. package/langwatch/dist/client/assets/schedules-QICCt22J.js +0 -1
  1217. package/langwatch/dist/client/assets/scim-BivWilDe.js +0 -2
  1218. package/langwatch/dist/client/assets/secrets-Dp2ang1r.js +0 -2
  1219. package/langwatch/dist/client/assets/segment-group-DQ4SkpwM.js +0 -2
  1220. package/langwatch/dist/client/assets/segmented-control-BNxU6DEN.js +0 -2
  1221. package/langwatch/dist/client/assets/select-D17PWjH9.js +0 -2
  1222. package/langwatch/dist/client/assets/send-Dd5105kW.js +0 -2
  1223. package/langwatch/dist/client/assets/sequenceView-FFm7w152.js +0 -5
  1224. package/langwatch/dist/client/assets/seriesOptions-CDRg_FIS.js +0 -1015
  1225. package/langwatch/dist/client/assets/settings-aFAaBCpo.js +0 -2
  1226. package/langwatch/dist/client/assets/setup-BqCpBMpq.js +0 -2
  1227. package/langwatch/dist/client/assets/shikiAdapter-CbWAxLvq.js +0 -3
  1228. package/langwatch/dist/client/assets/showSuiteRunError-B2iiQdeh.js +0 -2
  1229. package/langwatch/dist/client/assets/signin-C6AzSXTw.js +0 -2
  1230. package/langwatch/dist/client/assets/signup-Co9SguQP.js +0 -2
  1231. package/langwatch/dist/client/assets/stateDiagram-2N3HPSRC-CDfCuyr-.js +0 -2
  1232. package/langwatch/dist/client/assets/stateDiagram-v2-6OUMAXLB-mNUL4OCz.js +0 -2
  1233. package/langwatch/dist/client/assets/subscription-BYrIJoC0.js +0 -3
  1234. package/langwatch/dist/client/assets/subscriptions-CrupW2oH.js +0 -2
  1235. package/langwatch/dist/client/assets/suggestionUI-0NFK2m-V.js +0 -106
  1236. package/langwatch/dist/client/assets/swimlanes-5IMT3BWC-aY42sUsR.js +0 -3
  1237. package/langwatch/dist/client/assets/swimlanesDiagram-G3AALYLV-BQgl3Mwz.js +0 -9
  1238. package/langwatch/dist/client/assets/switch-DGatWO8v.js +0 -2
  1239. package/langwatch/dist/client/assets/switch-mtnuJtgJ.js +0 -2
  1240. package/langwatch/dist/client/assets/tabs-U8n5D55_.js +0 -2
  1241. package/langwatch/dist/client/assets/teams-CMzKSSEB.js +0 -2
  1242. package/langwatch/dist/client/assets/teams-DBNLpvFi.js +0 -2
  1243. package/langwatch/dist/client/assets/tool-catalog-DgWWHys3.js +0 -7
  1244. package/langwatch/dist/client/assets/toolIcons-DmISNQ_S.js +0 -2
  1245. package/langwatch/dist/client/assets/tooltip-gjZ4s2dt.js +0 -2
  1246. package/langwatch/dist/client/assets/topic-clustering-wc06nKYO.js +0 -2
  1247. package/langwatch/dist/client/assets/topics-DbjuJKH7.js +0 -2
  1248. package/langwatch/dist/client/assets/traceStore-By6b3pBZ.js +0 -55
  1249. package/langwatch/dist/client/assets/traces-DjQaBgiE.js +0 -289
  1250. package/langwatch/dist/client/assets/tracesMapping-DpjIOyAg.js +0 -3
  1251. package/langwatch/dist/client/assets/tracking-D4oUOPlm.js +0 -2
  1252. package/langwatch/dist/client/assets/types-CCALFpCT.js +0 -2
  1253. package/langwatch/dist/client/assets/types-DfJmP3wn.js +0 -2
  1254. package/langwatch/dist/client/assets/types-X7bcC-zw.js +0 -2
  1255. package/langwatch/dist/client/assets/usage-B3fH-bNu.js +0 -2
  1256. package/langwatch/dist/client/assets/usage-YeRzOlEs.js +0 -2
  1257. package/langwatch/dist/client/assets/use-generic-onboarding-flow-DZY28ya2.js +0 -2
  1258. package/langwatch/dist/client/assets/useActivePlan-fRQ_etI2.js +0 -2
  1259. package/langwatch/dist/client/assets/useAllPromptsForProject-DCZJ0_-p.js +0 -2
  1260. package/langwatch/dist/client/assets/useAnnotationQueues-ByLqaEs6.js +0 -2
  1261. package/langwatch/dist/client/assets/useAvailableEvaluators-BKFN_L8t.js +0 -2
  1262. package/langwatch/dist/client/assets/useCompoundLicenseCheck-BqNF-zzC.js +0 -2
  1263. package/langwatch/dist/client/assets/useCyclingVerb-DSHVFfHS.js +0 -2
  1264. package/langwatch/dist/client/assets/useDepartmentColumn-D1DF_PiG.js +0 -2
  1265. package/langwatch/dist/client/assets/useEvaluationsV3Store-Bc6Q5CKo.js +0 -2
  1266. package/langwatch/dist/client/assets/useExportTraces-BqLmfd8N.js +0 -2
  1267. package/langwatch/dist/client/assets/useFeatureFlag-Do1Ecu3l.js +0 -2
  1268. package/langwatch/dist/client/assets/useInviteActions-DwPlKWmS.js +0 -2
  1269. package/langwatch/dist/client/assets/useLicenseEnforcement-DOI0dcqD.js +0 -2
  1270. package/langwatch/dist/client/assets/usePersonalContext-CggG6KVI.js +0 -2
  1271. package/langwatch/dist/client/assets/useProjectSpanNames-jFO9A6Re.js +0 -2
  1272. package/langwatch/dist/client/assets/useProjectsForCopy-B8F_BY79.js +0 -2
  1273. package/langwatch/dist/client/assets/useRunViaApiTabs-Cr0_nbbp.js +0 -50
  1274. package/langwatch/dist/client/assets/useShowLangy-kmjRxLHs.js +0 -2
  1275. package/langwatch/dist/client/assets/useSimulationUpdateListener-BQB61L8b.js +0 -2
  1276. package/langwatch/dist/client/assets/useTargetName-nPyk8kf-.js +0 -2
  1277. package/langwatch/dist/client/assets/useTargetNameMap-C2bPHyhD.js +0 -2
  1278. package/langwatch/dist/client/assets/useTraceDetailsDrawer-CL82mHNA.js +0 -2
  1279. package/langwatch/dist/client/assets/useTraceUpdateListener-r6BQdcuk.js +0 -2
  1280. package/langwatch/dist/client/assets/useUrlScopeFilter-DFlXMn0U.js +0 -2
  1281. package/langwatch/dist/client/assets/useWorkflowStore-DGHQA8ai.js +0 -8
  1282. package/langwatch/dist/client/assets/users-D5W8Qjjj.js +0 -2
  1283. package/langwatch/dist/client/assets/users-DFyHT5UO.js +0 -2
  1284. package/langwatch/dist/client/assets/users-rKylpyh9.js +0 -2
  1285. package/langwatch/dist/client/assets/v3-NB4P-Pc3.js +0 -2
  1286. package/langwatch/dist/client/assets/variables-DF2_abiB.js +0 -396
  1287. package/langwatch/dist/client/assets/viewStore-DtvCfAUF.js +0 -2
  1288. package/langwatch/dist/client/assets/virtual-keys-DW1kPrjW.js +0 -2
  1289. package/langwatch/dist/client/assets/welcome-DJsfSWej.js +0 -16
  1290. package/langwatch/dist/client/assets/wizard-D2X_QMNx.js +0 -2
  1291. package/langwatch/dist/client/assets/workbench-fZ1KK4fN.js +0 -2
  1292. package/langwatch/dist/client/assets/workflows-CY65pvqY.js +0 -3
  1293. package/langwatch/dist/client/assets/wrap-DlWOPhPw.js +0 -2
  1294. package/langwatch/src/app/api/middleware/__tests__/resource-limit-enforcement.integration.test.ts +0 -278
  1295. package/langwatch/src/app/api/middleware/__tests__/resource-limit.unit.test.ts +0 -299
  1296. package/langwatch/src/app/api/middleware/resource-limit.ts +0 -147
  1297. package/langwatch/src/app/api/scenario-events/[[...route]]/scenario-set-limit.ts +0 -54
  1298. package/langwatch/src/app/api/scenario-events/__tests__/scenario-set-limit.unit.test.ts +0 -195
  1299. package/langwatch/src/app/api/scenario-events/scenario-set-limit.stress.test.ts +0 -216
  1300. package/langwatch/src/components/__tests__/UpgradeModal.unit.test.tsx +0 -103
  1301. package/langwatch/src/hooks/useCompoundLicenseCheck.ts +0 -41
  1302. package/langwatch/src/pages/api/experiment/init.stress.test.ts +0 -130
  1303. package/langwatch/src/server/api/routers/__tests__/project.create.planLimit.integration.test.ts +0 -370
  1304. package/langwatch/src/server/api/routers/__tests__/team.createTeamWithMembers.planLimit.integration.test.ts +0 -251
  1305. package/langwatch/src/server/app-layer/usage/__tests__/usage-service-checkScenarioSetLimit.unit.test.ts +0 -322
  1306. package/langwatch/src/server/app-layer/usage/errors.ts +0 -24
  1307. package/langwatch/src/server/auditLog.ts +0 -49
  1308. package/langwatch/src/server/better-auth/__tests__/fallbackName.test.ts +0 -141
  1309. package/langwatch/src/server/better-auth/__tests__/parseIssuerUrl.test.ts +0 -58
  1310. package/langwatch/src/server/better-auth/__tests__/sso.test.ts +0 -125
  1311. package/langwatch/src/server/better-auth/sso.ts +0 -47
  1312. package/langwatch/src/server/event-sourcing/pipelines/trace-processing/projections/__tests__/traceSummary.coalesce.unit.test.ts +0 -33
  1313. package/langwatch/src/server/license-enforcement/__tests__/limit-breakdown.unit.test.ts +0 -101
  1314. package/langwatch/src/server/license-enforcement/__tests__/personal-workspaces-excluded.integration.test.ts +0 -391
  1315. package/langwatch/src/server/license-enforcement/enforcement.middleware.ts +0 -103
  1316. package/langwatch/src/server/license-enforcement/limit-breakdown.ts +0 -96
  1317. package/langwatch/src/server/routes/scim.ts +0 -583
  1318. package/langwatch/src/server/routes/webhooks.ts +0 -168
  1319. package/langwatch/src/server/scim/__tests__/scim-token.service.unit.test.ts +0 -109
  1320. package/langwatch/src/server/scim/__tests__/scim.costCenter.integration.test.ts +0 -170
  1321. package/langwatch/src/server/scim/__tests__/scim.service.unit.test.ts +0 -414
  1322. package/langwatch/src/server/scim/scim-group.service.ts +0 -464
  1323. package/langwatch/src/server/scim/scim-role-resolver.ts +0 -47
  1324. package/langwatch/src/server/scim/scim-role-resolver.unit.test.ts +0 -92
  1325. package/langwatch/src/server/scim/scim-token.service.ts +0 -70
  1326. package/langwatch/src/server/scim/scim.service.ts +0 -553
  1327. package/langwatch/src/server/scim/scim.types.ts +0 -148
  1328. package/mcp-server/dist/chunk-DSB77X63.js +0 -2328
  1329. package/mcp-server/dist/discover-evaluator-schema-OFEADIJY.js +0 -2175
  1330. package/mcp-server/dist/http-server-YVM4PRTC.js +0 -24466
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{t as n}from"./clsx-CjueKrWZ.js";import{$n as r,Ht as i,Q as a,Vn as o,Wn as s,Zn as c,at as l,cr as u,lr as d,lt as f,q as p,sr as m,x as h}from"./CartesianChart-Ci1mTvgb.js";var g=e(t());function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_.apply(null,arguments)}var v=e=>{var t=e.cx,i=e.cy,a=e.r,o=e.className,c=n(`recharts-dot`,o);return r(t)&&r(i)&&r(a)?g.createElement(`circle`,_({},u(e),s(e),{className:c,cx:t,cy:i,r:a})):null},y=[`points`];function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?b(Object(n),!0).forEach(function(t){S(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function S(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e){var t=w(e,`string`);return typeof t==`symbol`?t:t+``}function w(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T.apply(null,arguments)}function E(e,t){if(e==null)return{};var n,r,i=D(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function D(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function O(e){var t=e.option,r=e.dotProps,i=e.className;if((0,g.isValidElement)(t))return(0,g.cloneElement)(t,r);if(typeof t==`function`)return t(r);var a=n(i,typeof t==`boolean`?``:t.className),o=r??{};o.points;var s=E(o,y);return g.createElement(v,T({},s,{className:a}))}function k(e,t){return e==null?!1:t?!0:e.length===1}function A(e){var t=e.points,n=e.dot,r=e.className,o=e.dotClassName,s=e.dataKey,c=e.baseProps,u=e.needClip,d=e.clipPathId,f=e.zIndex,h=f===void 0?i.scatter:f;if(!k(t,n))return null;var _=p(n),v=m(n),y=t.map((e,r)=>{var i=x(x(x({r:3},c),v),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:s,value:e.value,payload:e.payload,points:t});return g.createElement(O,{key:`dot-${r}`,option:n,dotProps:i,className:o})}),b={};return u&&d!=null&&(b.clipPath=`url(#clipPath-${_?``:`dots-`}${d})`),g.createElement(l,{zIndex:h},g.createElement(a,T({className:r},b),y))}function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?j(Object(n),!0).forEach(function(t){N(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function N(e,t,n){return(t=P(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){var t=F(e,`string`);return typeof t==`symbol`?t:t+``}function F(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var I=e=>{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,o=e.dataKey,c=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var l=M(M(M({},{index:n,dataKey:o,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),d(i)),s(i)),u=(0,g.isValidElement)(i)?(0,g.cloneElement)(i,l):typeof i==`function`?i(l):g.createElement(v,l);return g.createElement(a,{className:`recharts-active-dot`,clipPath:c},u)};function L(e){var t=e.points,n=e.mainColor,r=e.activeDot,a=e.itemDataKey,s=e.clipPath,u=e.zIndex,d=u===void 0?i.activeDot:u,p=o(f),m=h();if(t==null||m==null)return null;var _=t.find(e=>m.includes(e.payload));return c(_)?null:g.createElement(l,{zIndex:d},g.createElement(I,{point:_,childIndex:Number(p),mainColor:n,dataKey:a,activeDot:r,clipPath:s}))}function R(e){var t=d(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}export{v as i,L as n,A as r,R as t};
2
+ //# sourceMappingURL=getRadiusAndStrokeWidthFromDot-D2oUP3Tn.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{dn as n,i as r,n as i}from"./portal-Sdfvrza9.js";import{t as a}from"./jsx-runtime-CFwixLRt.js";import{t as o}from"./heading-C0sACr0w.js";import{n as s,t as c}from"./v-stack-hkuSkmCA.js";import{Nn as l,Sn as u,jn as d,vn as f}from"./ProjectAvatar-B0tbfKzY.js";import{t as p}from"./badge-Cpc3eA-C.js";import{l as m,n as h}from"./toaster-BsYkODqs.js";import{a as g,i as _,n as v,r as y,t as b}from"./alert-CPsXih3K.js";import{t as x}from"./errors-mlatPkMI.js";import{t as S}from"./spacer-C38e7o6r.js";import{n as C}from"./api-l6Cnm0vQ.js";import{t as ee}from"./GovernanceLayout-Baar1Fc8.js";import{t as w}from"./circle-dashed-DWC9qFep.js";import{t as T}from"./circle-Dx3G8v5Q.js";import{Mr as E,Vt as D,t as O}from"./index-8SbDirJv.js";import{t as k}from"./WithFeatureFlagGuard-CgkIIt3_.js";import{t as A}from"./WithPermissionGuard-Da_hdEdq.js";import{d as j,rt as M,u as N,xn as P,y as F}from"./CartesianChart-Ci1mTvgb.js";import{t as I}from"./Legend-C-o-ebW-.js";import{n as L,t as R}from"./AreaChart-PNFZHqkl.js";import{t as te}from"./InstallCliCard-DO5HE9Zk.js";var z=e(t()),B=e(u()),V=a();function H({organizationId:e}){let{data:t}=C.governance.quarantineFillStats.useQuery({organizationId:e},{enabled:!!e,refetchInterval:6e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:!1});return t?.exceeded?(0,V.jsxs)(_,{status:`warning`,variant:`surface`,children:[(0,V.jsx)(y,{}),(0,V.jsxs)(b,{children:[(0,V.jsxs)(g,{children:[Math.round(t.rate),` spans/min landing in quarantine — likely misconfigured ingest`]}),(0,V.jsx)(v,{children:(0,V.jsxs)(c,{align:`start`,gap:2,children:[(0,V.jsx)(s,{fontSize:`sm`,children:`Unrecognized traffic is being routed to the org-wide quarantine project (admin-only). End users do not see this data. Configure the credential on the source listed below to send traces to the right scope.`}),t.perSource.length>0&&(0,V.jsxs)(n,{children:[(0,V.jsxs)(s,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,children:[`Top contributors (last `,t.windowSeconds,`s)`]}),(0,V.jsx)(c,{align:`start`,gap:.5,marginTop:1,children:t.perSource.slice(0,5).map(e=>(0,V.jsxs)(i,{gap:2,fontSize:`xs`,children:[(0,V.jsx)(s,{fontFamily:`mono`,children:e.ingestionSourceId??`unknown source`}),(0,V.jsxs)(s,{color:`fg.muted`,children:[e.spanCount,` spans`]})]},e.ingestionSourceId??`unknown`))})]}),(0,V.jsx)(O,{href:`/settings/governance/ingestion-sources`,fontSize:`sm`,color:`orange.600`,children:`Review ingestion sources →`})]})})]})]}):null}function U({teams:e}){let t=e.reduce((e,t)=>e+t.spendUsd,0);return t===0||e.length===0?null:(0,V.jsxs)(c,{align:`stretch`,gap:3,children:[(0,V.jsxs)(i,{children:[(0,V.jsx)(o,{size:`sm`,children:`Team share of spend`}),(0,V.jsx)(S,{}),(0,V.jsxs)(s,{fontSize:`xs`,color:`fg.muted`,children:[(0,B.default)(t).format(`$0,0.00`),` total · last 30 days`]})]}),(0,V.jsx)(n,{display:`flex`,height:`32px`,borderRadius:`md`,overflow:`hidden`,borderWidth:`1px`,borderColor:`border.subtle`,children:e.map(e=>{let r=e.spendUsd/t*100,i=f(e.teamName);return(0,V.jsx)(n,{width:`${r}%`,backgroundColor:i,opacity:.9,title:`${e.teamName} — ${(0,B.default)(e.spendUsd).format(`$0,0.00`)} (${r.toFixed(1)}%)`,_hover:{opacity:1}},e.teamId??e.teamName)})}),(0,V.jsx)(i,{wrap:`wrap`,gap:3,fontSize:`xs`,children:e.map(e=>{let r=e.spendUsd/t*100;return(0,V.jsxs)(i,{gap:1.5,children:[(0,V.jsx)(n,{width:`10px`,height:`10px`,borderRadius:`sm`,backgroundColor:f(e.teamName)}),(0,V.jsx)(s,{color:`fg`,fontWeight:`medium`,children:e.teamName}),(0,V.jsxs)(s,{color:`fg.muted`,children:[r.toFixed(1),`%`]})]},e.teamId??e.teamName)})})]})}var W={team:`team`,user:`user`,model:`model`};function G({buckets:e,groupBy:t,emptyHint:r}){let{rows:a,seriesKeys:l}=(0,z.useMemo)(()=>{if(!e||e.length===0)return{rows:[],seriesKeys:[]};let t=new Map;for(let n of e)for(let e of n.points)t.has(e.key)||t.set(e.key,e.label);let n=[...t.entries()].map(([e,t])=>({key:e,label:t}));return{rows:e.map(e=>{let t={day:e.bucketIso};for(let e of n)t[e.key]=0;for(let n of e.points)t[n.key]=n.spendUsd;return t}),seriesKeys:n}},[e]);return(0,V.jsxs)(c,{align:`stretch`,gap:2,children:[(0,V.jsxs)(i,{children:[(0,V.jsxs)(o,{size:`sm`,children:[`Spend over time, by `,W[t]]}),(0,V.jsx)(S,{}),(0,V.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:`stacked daily spend · last 30 days`})]}),(0,V.jsx)(n,{borderWidth:`1px`,borderColor:`border.subtle`,borderRadius:`lg`,padding:3,height:`280px`,children:a.length===0?(0,V.jsxs)(c,{align:`center`,justify:`center`,height:`100%`,color:`fg.muted`,gap:1,children:[(0,V.jsx)(s,{fontSize:`sm`,children:`No spend in this window yet.`}),r&&(0,V.jsx)(s,{fontSize:`xs`,children:r})]}):(0,V.jsx)(P,{width:`100%`,height:`100%`,children:(0,V.jsxs)(R,{data:a,margin:{top:8,right:8,bottom:0,left:0},children:[(0,V.jsx)(`defs`,{children:l.map(e=>{let t=f(e.label);return(0,V.jsxs)(`linearGradient`,{id:`spend-fill-${e.key}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,V.jsx)(`stop`,{offset:`0%`,stopColor:t,stopOpacity:.45}),(0,V.jsx)(`stop`,{offset:`100%`,stopColor:t,stopOpacity:.05})]},e.key)})}),(0,V.jsx)(F,{strokeDasharray:`3 3`,stroke:`#e2e8f0`,vertical:!1}),(0,V.jsx)(j,{dataKey:`day`,tick:{fontSize:11,fill:`#64748b`},tickFormatter:K,minTickGap:24}),(0,V.jsx)(N,{tick:{fontSize:11,fill:`#64748b`},tickFormatter:e=>`$${(0,B.default)(e).format(`0,0.[00]`)}`,width:60}),(0,V.jsx)(M,{formatter:(e,t)=>{let n=l.find(e=>e.key===String(t))?.label??String(t);return[`$${Number(e).toFixed(4)}`,n]},labelFormatter:e=>K(e),contentStyle:{fontSize:12}}),(0,V.jsx)(I,{wrapperStyle:{fontSize:11},iconType:`circle`,formatter:e=>l.find(t=>t.key===e)?.label??e}),l.map(e=>{let t=f(e.label);return(0,V.jsx)(L,{type:`monotone`,dataKey:e.key,stackId:`spend`,stroke:t,strokeWidth:1.5,fill:`url(#spend-fill-${e.key})`,isAnimationActive:!1},e.key)})]})})})]})}function K(e){let t=String(e),n=t.slice(0,10).split(`-`);return n.length===3?`${n[1]}/${n[2]}`:t}var q=e=>e===0?`$0.00`:(0,B.default)(e).format(`$0,0.00`),J=e=>{if(!e)return`-`;let t=typeof e==`string`?new Date(e):e;if(Number.isNaN(t.getTime()))return`-`;let n=Date.now()-t.getTime();if(n<0)return`just now`;let r=Math.floor(n/1e3);if(r<60)return`${r}s ago`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`};function ne(){let{organization:e}=D({redirectToOnboarding:!1}),t=e?.id??``,r=C.ingestionSources.list.useQuery({organizationId:t},{enabled:!!t,refetchOnWindowFocus:!1}),a=C.routingPolicy.list.useQuery({organizationId:t},{enabled:!!t,refetchOnWindowFocus:!1}),u=C.anomalyRules.list.useQuery({organizationId:t},{enabled:!!t,refetchOnWindowFocus:!1}),d=C.aiTools.adminList.useQuery({organizationId:t},{enabled:!!t,refetchOnWindowFocus:!1}),f=C.activityMonitor.summary.useQuery({organizationId:t,windowDays:30},{enabled:!!t,refetchOnWindowFocus:!1}),m=C.activityMonitor.spendByUser.useQuery({organizationId:t,windowDays:30,limit:50},{enabled:!!t,refetchOnWindowFocus:!1}),h=C.activityMonitor.spendByTeam.useQuery({organizationId:t,windowDays:30,limit:50},{enabled:!!t,refetchOnWindowFocus:!1}),g=C.activityMonitor.spendByDepartment.useQuery({organizationId:t,windowDays:30},{enabled:!!t,refetchOnWindowFocus:!1}),_=C.activityMonitor.ingestionSourcesHealth.useQuery({organizationId:t},{enabled:!!t,refetchOnWindowFocus:!1}),v=C.activityMonitor.recentAnomalies.useQuery({organizationId:t},{enabled:!!t,refetchOnWindowFocus:!1}),[y,b]=(0,z.useState)(`team`),x=C.activityMonitor.spendOverTime.useQuery({organizationId:t,windowDays:30,groupBy:y},{enabled:!!t,refetchOnWindowFocus:!1}),w=r.data??[],T=a.data??[],E=f.data,k=m.data??[],A=h.data??[],j=g.data??[],M=_.data??[],N=v.data??[],P=u.data??[],F=d.data??[],I=w.length>0,L=T.length>0,R=P.length>0,W=F.length>0,K=!!E&&(E.spentThisWindowUsd>0||E.activeUsersThisWindow>0||E.openAnomalyCount>0);return(0,V.jsx)(ee,{pageTitle:`AI Governance · LangWatch`,children:(0,V.jsxs)(c,{align:`stretch`,gap:6,width:`full`,maxW:`container.xl`,children:[(0,V.jsxs)(i,{alignItems:`end`,children:[(0,V.jsxs)(c,{align:`start`,gap:1,children:[(0,V.jsxs)(i,{gap:2,children:[(0,V.jsx)(o,{size:`md`,children:`AI Governance`}),(0,V.jsx)(p,{colorPalette:`purple`,variant:`subtle`,children:`Preview`})]}),(0,V.jsx)(s,{color:`fg.muted`,fontSize:`sm`,children:`Spend, users, anomalies, and ingestion-source health for the organization. Window: last 30 days.`})]}),(0,V.jsx)(S,{})]}),t&&(0,V.jsx)(H,{organizationId:t}),!K&&(0,V.jsxs)(n,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,padding:5,children:[(0,V.jsxs)(c,{align:`start`,gap:1,marginBottom:4,children:[(0,V.jsx)(o,{as:`h3`,size:`sm`,children:`Setup checklist`}),(0,V.jsxs)(s,{fontSize:`sm`,color:`fg.muted`,children:[`Complete each step to start collecting governance data. Live metrics replace this checklist once your first ingestion source is reporting events. (AI Gateway traffic shows in`,` `,(0,V.jsx)(O,{href:`/gateway/usage`,children:`Gateway → Usage`}),`; this dashboard rolls up signals from ingestion sources beyond the gateway.)`]})]}),(0,V.jsxs)(c,{align:`stretch`,gap:2,children:[(0,V.jsx)(Y,{done:W,title:`Add tools to the catalog`,description:`Publish the coding assistants, model providers, and internal tools your team installs from their /me portal.`,href:`/settings/governance/tool-catalog`,ctaLabel:W?`${F.length} tile${F.length===1?``:`s`} in the catalog`:`Add tools to the catalog`}),(0,V.jsx)(Y,{done:L,title:`Define a routing policy`,description:`Tell virtual keys which providers + models to route through.`,href:`/settings/routing-policies`,ctaLabel:L?`${T.length} ${T.length===1?`policy`:`policies`} configured`:`Add a routing policy`}),(0,V.jsx)(Y,{done:I,title:`Connect an ingestion source`,description:`Map an external AI platform into the activity monitor via OTel push, webhook, or S3 audit drop.`,href:`/settings/governance/ingestion-sources`,ctaLabel:I?`${w.length} source${w.length===1?``:`s`} configured`:`Add an ingestion source`}),(0,V.jsx)(Y,{done:R,title:`Define anomaly rules`,description:`Set thresholds that page on-call when activity drifts.`,href:`/settings/governance/anomaly-rules`,ctaLabel:R?`${P.length} rule${P.length===1?``:`s`} configured`:`Anomaly rules`})]}),(0,V.jsx)(n,{marginTop:5,children:(0,V.jsx)(te,{heading:`Install the CLI to onboard your team`,subline:"Members install the CLI on their devices to start using AI tools through LangWatch. Run `langwatch login` after install to authenticate."})})]}),K&&E&&(0,V.jsxs)(l,{columns:{base:1,md:3},gap:4,children:[(0,V.jsx)(X,{title:`Spend (30 d)`,value:q(E.spentThisWindowUsd),subline:E.spentThisWindowUsd===0?`no traffic this window`:!E.hasPriorBaseline||E.spentThisWindowUsd<10?`insufficient baseline`:`${E.windowOverPreviousPct>=0?`↑`:`↓`} ${Q(E.windowOverPreviousPct)} vs previous`,tone:E.hasPriorBaseline&&E.spentThisWindowUsd>=10&&E.windowOverPreviousPct>25?`amber`:`default`}),(0,V.jsx)(X,{title:`Active users (30 d)`,value:(0,B.default)(E.activeUsersThisWindow).format(`0,0`),subline:E.activeUsersThisWindow===0?`nobody used AI this window`:`${E.newUsersThisWindow} new this window`}),(0,V.jsx)(X,{title:`Open anomalies`,value:(0,B.default)(E.openAnomalyCount).format(`0,0`),subline:E.openAnomalyCount===0?`nothing to alert on`:`${E.anomalyBreakdown.critical} critical · ${E.anomalyBreakdown.warning} warning`,tone:E.openAnomalyCount>0?`amber`:`default`})]}),K&&(0,V.jsx)(Z,{title:`Spend over time`,subline:`Daily UTC buckets, last 30 days. Toggle the breakdown to see which dimension is driving the trend.`,actions:(0,V.jsx)(ie,{value:y,onChange:b}),children:(0,V.jsx)(G,{buckets:x.data?.buckets,groupBy:y,emptyHint:`Connect an ingestion source to start collecting governance data.`})}),A.length>0&&(0,V.jsx)(Z,{title:`Spend share across teams`,children:(0,V.jsx)(U,{teams:A})}),(0,V.jsx)(Z,{title:`Top teams by spend`,subline:`Top 5 teams ranked by spend (last 30 days). Sources without a team land under 'Org-wide'.`,actions:A.length>0?(0,V.jsx)(O,{href:`/settings/governance/teams`,color:`blue.600`,fontSize:`sm`,children:`View all teams →`}):null,children:A.length===0?(0,V.jsx)(s,{color:`fg.muted`,fontSize:`sm`,children:`No team activity this window.`}):(0,V.jsxs)(c,{align:`stretch`,gap:0,children:[(0,V.jsx)(de,{}),A.slice(0,5).map(e=>(0,V.jsx)(me,{team:e},e.teamId??`org-wide`))]})}),(0,V.jsx)(Z,{title:`Top users by spend`,subline:`Top 5 LangWatch members ranked by spend (last 30 days).`,actions:k.length>0?(0,V.jsx)(O,{href:`/settings/governance/users`,color:`blue.600`,fontSize:`sm`,children:`View all users →`}):null,children:k.length===0?(0,V.jsx)(s,{color:`fg.muted`,fontSize:`sm`,children:`No active users this window.`}):(0,V.jsxs)(c,{align:`stretch`,gap:0,children:[(0,V.jsx)(ue,{}),k.slice(0,5).map(e=>(0,V.jsx)(he,{user:e},e.actor))]})}),(0,V.jsx)(Z,{title:`Spend by department`,subline:`Spend grouped by department across every project in the org, including personal AI use (last 30 days).`,actions:(0,V.jsx)(O,{href:`/settings/governance/departments`,color:`blue.600`,fontSize:`sm`,children:`Manage departments →`}),children:j.length===0?(0,V.jsx)(s,{color:`fg.muted`,fontSize:`sm`,children:`No spend to attribute this window. Assign people, teams, and projects to departments to compare spend across the org.`}):(0,V.jsxs)(c,{align:`stretch`,gap:0,children:[(0,V.jsx)(fe,{}),j.map(e=>(0,V.jsx)(pe,{department:e},e.departmentId??`unassigned`))]})}),(0,V.jsx)(Z,{title:`Recent anomalies`,subline:`Cross-source rules that fired and haven't been acknowledged.`,"aria-live":`polite`,children:N.length===0?(0,V.jsx)(s,{color:`fg.muted`,fontSize:`sm`,children:K?`All quiet - no active alerts.`:`Available when the detection backend ships.`}):(0,V.jsx)(c,{align:`stretch`,gap:2,children:N.map(e=>(0,V.jsx)(le,{alert:e},e.id))})}),(0,V.jsx)(Z,{title:`Ingestion sources`,subline:`External AI platforms reporting activity to LangWatch.`,children:M.length===0?(0,V.jsxs)(c,{align:`start`,gap:2,children:[(0,V.jsx)(s,{color:`fg.muted`,fontSize:`sm`,children:`No ingestion sources configured.`}),(0,V.jsx)(O,{href:`/settings/governance/ingestion-sources`,color:`blue.600`,children:`+ Add a source`})]}):(0,V.jsx)(i,{gap:3,wrap:`wrap`,children:M.map(e=>(0,V.jsx)(se,{source:e},e.id))})}),(0,V.jsx)(re,{organizationId:t})]})})}function re({organizationId:e}){let t=C.sessionPolicy.get.useQuery({organizationId:e},{enabled:!!e,refetchOnWindowFocus:!1}),n=C.useUtils(),a=C.sessionPolicy.setMaxDuration.useMutation({onSuccess:()=>{n.sessionPolicy.get.invalidate({organizationId:e}),h.create({title:`Session policy saved`,type:`success`})},onError:e=>x({error:e,fallbackTitle:`Couldn't save the session policy`})}),o=t.data?.maxSessionDurationDays??0,[l,u]=(0,z.useState)(`0`);(0,z.useEffect)(()=>{t.data&&u(String(o))},[o,t.data]);let d=Number(l),f=!Number.isInteger(d)||d<0||d>365,p=!f&&d!==o;return(0,V.jsx)(Z,{title:`CLI session policy`,subline:"Maximum lifetime of a CLI/device session before re-login is required. Applies to every member's `langwatch login` session.",children:(0,V.jsxs)(c,{align:`stretch`,gap:3,children:[(0,V.jsxs)(i,{gap:3,align:`end`,children:[(0,V.jsxs)(c,{align:`start`,gap:1,children:[(0,V.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:`Days (0 = unbounded)`}),(0,V.jsx)(E,{type:`number`,min:0,max:365,step:1,value:l,onChange:e=>u(e.target.value),width:`120px`,size:`sm`,borderColor:f?`red.300`:void 0})]}),(0,V.jsx)(r,{size:`sm`,onClick:()=>{f||!e||a.mutate({organizationId:e,maxSessionDurationDays:d})},loading:a.isPending,disabled:!p||f,children:`Save`}),(0,V.jsx)(r,{size:`sm`,variant:`ghost`,onClick:()=>u(String(o)),disabled:!p||a.isPending,children:`Reset`})]}),(0,V.jsxs)(s,{fontSize:`xs`,color:`fg.muted`,children:[`Suggested presets: `,(0,V.jsx)(`code`,{children:`7`}),` (high-security) · `,(0,V.jsx)(`code`,{children:`30`}),` `,`(standard) · `,(0,V.jsx)(`code`,{children:`0`}),` (open-source / small teams). Values higher than the natural refresh-token life (~30d) cap at the refresh-token expiry.`]}),f&&(0,V.jsx)(s,{fontSize:`xs`,color:`red.600`,children:`Enter an integer between 0 and 365.`})]})})}function Y({done:e,title:t,description:r,href:a,ctaLabel:o,upcoming:l}){return(0,V.jsxs)(i,{borderWidth:`1px`,borderColor:e?`green.200`:`border.muted`,borderRadius:`sm`,padding:3,gap:3,alignItems:`start`,opacity:l?.7:1,children:[(0,V.jsx)(n,{color:e?`green.500`:`fg.muted`,paddingTop:`2px`,children:e?(0,V.jsx)(m,{size:18}):(0,V.jsx)(T,{size:18})}),(0,V.jsxs)(c,{align:`start`,gap:0,flex:1,minWidth:0,children:[(0,V.jsxs)(i,{gap:2,children:[(0,V.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:t}),l&&(0,V.jsx)(p,{size:`sm`,variant:`surface`,colorPalette:`gray`,children:`Coming soon`})]}),(0,V.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:r})]}),(0,V.jsx)(O,{href:a,color:`blue.600`,children:o})]})}function X({title:e,value:t,subline:r,tone:i=`default`}){return(0,V.jsxs)(n,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,padding:4,children:[(0,V.jsx)(s,{fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,textTransform:`uppercase`,letterSpacing:`wider`,children:e}),(0,V.jsx)(o,{as:`span`,size:`md`,color:i===`amber`?`orange.500`:`fg`,marginTop:1,children:t}),(0,V.jsx)(s,{fontSize:`sm`,color:`fg.muted`,marginTop:1,children:r})]})}function ie({value:e,onChange:t}){let n=[`team`,`user`,`model`];return(0,V.jsx)(i,{gap:0,borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,overflow:`hidden`,children:n.map((i,a)=>{let o=i===e;return(0,V.jsxs)(r,{size:`xs`,variant:o?`solid`:`ghost`,colorPalette:o?`orange`:`gray`,onClick:()=>t(i),borderRadius:0,borderRightWidth:a<n.length-1?`1px`:0,borderColor:`border.muted`,textTransform:`capitalize`,children:[`By `,i]},i)})})}function Z({title:e,subline:t,actions:r,children:a,...l}){return(0,V.jsxs)(n,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,padding:5,...l,children:[(0,V.jsxs)(i,{align:`start`,justify:`space-between`,marginBottom:3,gap:4,children:[(0,V.jsxs)(c,{align:`start`,gap:1,flex:1,children:[(0,V.jsx)(o,{as:`h3`,size:`sm`,children:e}),t&&(0,V.jsx)(s,{fontSize:`sm`,color:`fg.muted`,children:t})]}),r&&(0,V.jsx)(n,{flexShrink:0,children:r})]}),a]})}var ae={active:m,awaiting_first_event:w,disabled:d},oe={active:`green.600`,awaiting_first_event:`orange.500`,disabled:`fg.muted`};function se({source:e}){let t=ae[e.status??`awaiting_first_event`]??w;return(0,V.jsx)(O,{href:`/settings/governance/ingestion-sources`,_hover:{textDecoration:`none`},children:(0,V.jsxs)(i,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`full`,paddingX:3,paddingY:2,gap:2,_hover:{borderColor:`orange.300`},children:[(0,V.jsx)(n,{color:oe[e.status??`awaiting_first_event`]??`fg.muted`,children:(0,V.jsx)(t,{size:14})}),(0,V.jsxs)(c,{align:`start`,gap:0,children:[(0,V.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:e.name}),(0,V.jsxs)(s,{fontSize:`xs`,color:`fg.muted`,children:[e.sourceType,` · `,J(e.lastEventIso??null),e.eventsLast24h>0&&` · ${(0,B.default)(e.eventsLast24h).format(`0,0`)} events / 24h`]})]})]})})}var ce={critical:`red.600`,warning:`orange.500`,info:`blue.600`};function le({alert:e}){return(0,V.jsxs)(i,{borderWidth:`1px`,borderColor:`border.muted`,borderRadius:`md`,padding:3,gap:3,alignItems:`start`,children:[(0,V.jsx)(n,{color:ce[e.severity],paddingTop:`2px`,children:(0,V.jsx)(w,{size:16})}),(0,V.jsxs)(c,{align:`start`,gap:0,flex:1,children:[(0,V.jsxs)(i,{gap:2,children:[(0,V.jsx)(p,{colorPalette:e.severity===`critical`?`red`:e.severity===`warning`?`orange`:`blue`,children:e.severity}),(0,V.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:e.rule})]}),(0,V.jsxs)(s,{fontSize:`xs`,color:`fg.muted`,children:[e.sourceLabel,` · detected `,J(e.detectedAtIso)]})]}),(0,V.jsx)(p,{size:`sm`,variant:`surface`,children:e.currentState})]})}function ue(){return(0,V.jsxs)(i,{paddingY:2,paddingX:3,borderBottomWidth:`1px`,borderColor:`border.muted`,fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,textTransform:`uppercase`,letterSpacing:`wider`,children:[(0,V.jsx)(n,{flex:3,children:`User`}),(0,V.jsx)(n,{flex:2,children:`Spend`}),(0,V.jsx)(n,{flex:2,children:`Requests`}),(0,V.jsx)(n,{flex:2,children:`Last active`}),(0,V.jsx)(n,{flex:2,children:`Trend`}),(0,V.jsx)(n,{flex:2,children:`Most-used`})]})}function de(){return(0,V.jsxs)(i,{paddingY:2,paddingX:3,borderBottomWidth:`1px`,borderColor:`border.muted`,fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,textTransform:`uppercase`,letterSpacing:`wider`,children:[(0,V.jsx)(n,{flex:3,children:`Team`}),(0,V.jsx)(n,{flex:2,children:`Spend`}),(0,V.jsx)(n,{flex:2,children:`Requests`}),(0,V.jsx)(n,{flex:2,children:`Last active`}),(0,V.jsx)(n,{flex:2,children:`Trend`}),(0,V.jsx)(n,{flex:2,children:`Sources`})]})}function fe(){return(0,V.jsxs)(i,{paddingY:2,paddingX:3,borderBottomWidth:`1px`,borderColor:`border.muted`,fontSize:`xs`,fontWeight:`semibold`,color:`fg.muted`,textTransform:`uppercase`,letterSpacing:`wider`,children:[(0,V.jsx)(n,{flex:3,children:`Department`}),(0,V.jsx)(n,{flex:2,children:`Spend`}),(0,V.jsx)(n,{flex:2,children:`Requests`})]})}function pe({department:e}){let t=e.departmentId===null;return(0,V.jsxs)(i,{paddingY:2,paddingX:3,borderBottomWidth:`1px`,borderColor:`border.muted`,fontSize:`sm`,children:[(0,V.jsx)(n,{flex:3,children:(0,V.jsxs)(i,{gap:2,children:[(0,V.jsx)(n,{width:`10px`,height:`10px`,borderRadius:`full`,backgroundColor:t?`#94a3b8`:f(e.departmentName),flexShrink:0}),(0,V.jsx)(s,{fontWeight:`medium`,color:t?`fg.muted`:`fg`,children:e.departmentName})]})}),(0,V.jsx)(n,{flex:2,children:q(e.spendUsd)}),(0,V.jsx)(n,{flex:2,children:(0,B.default)(e.requestCount).format(`0,0`)})]})}function Q(e){let t=Math.abs(e);return t>=1e3?`>1000%`:t<1?`0%`:`${Math.round(t)}%`}function $({pct:e,hasBaseline:t}){return t?(0,V.jsxs)(n,{flex:2,color:e>25?`orange.500`:e<-25?`blue.500`:`fg.muted`,children:[e>0?`↑`:e<0?`↓`:`·`,` `,Q(e)]}):(0,V.jsx)(n,{flex:2,color:`fg.muted`,children:`-`})}function me({team:e}){let t=!e.teamId,r=t?`#94a3b8`:f(e.teamName),a=(0,V.jsxs)(i,{paddingY:2,paddingX:3,borderBottomWidth:`1px`,borderColor:`border.muted`,fontSize:`sm`,_hover:t?void 0:{backgroundColor:`bg.subtle`},cursor:t?`default`:`pointer`,children:[(0,V.jsx)(n,{flex:3,children:(0,V.jsxs)(i,{gap:2,children:[(0,V.jsx)(n,{width:`10px`,height:`10px`,borderRadius:`full`,backgroundColor:r,flexShrink:0}),(0,V.jsxs)(c,{align:`start`,gap:0,children:[(0,V.jsx)(s,{fontWeight:`medium`,color:t?`fg.muted`:`fg`,children:e.teamName}),t&&(0,V.jsx)(s,{fontSize:`xs`,color:`fg.subtle`,children:`synthetic - sources without a team`})]})]})}),(0,V.jsx)(n,{flex:2,children:q(e.spendUsd)}),(0,V.jsx)(n,{flex:2,children:(0,B.default)(e.requestCount).format(`0,0`)}),(0,V.jsx)(n,{flex:2,color:`fg.muted`,children:J(e.lastActivityIso)}),(0,V.jsx)($,{pct:e.deltaPctVsPriorWindow,hasBaseline:e.hasPriorBaseline}),(0,V.jsxs)(n,{flex:2,color:`fg.muted`,children:[e.sourceCount,` `,e.sourceCount===1?`source`:`sources`]})]});return t?a:(0,V.jsx)(O,{href:`/settings/governance/teams/${e.teamId}`,display:`block`,width:`full`,_hover:{textDecoration:`none`},children:a})}function he({user:e}){let t=f(e.actor);return(0,V.jsx)(O,{href:`/settings/governance/users/${encodeURIComponent(e.actor)}`,display:`block`,width:`full`,_hover:{textDecoration:`none`},children:(0,V.jsxs)(i,{paddingY:2,paddingX:3,borderBottomWidth:`1px`,borderColor:`border.muted`,fontSize:`sm`,_hover:{backgroundColor:`bg.subtle`},cursor:`pointer`,children:[(0,V.jsx)(n,{flex:3,children:(0,V.jsxs)(i,{gap:2,children:[(0,V.jsx)(n,{width:`10px`,height:`10px`,borderRadius:`full`,backgroundColor:t,flexShrink:0}),(0,V.jsx)(s,{fontWeight:`medium`,children:e.actor})]})}),(0,V.jsx)(n,{flex:2,children:q(e.spendUsd)}),(0,V.jsx)(n,{flex:2,children:(0,B.default)(e.requests).format(`0,0`)}),(0,V.jsx)(n,{flex:2,color:`fg.muted`,children:J(e.lastActivityIso)}),(0,V.jsx)($,{pct:e.trendVsPreviousPct,hasBaseline:e.hasPriorBaseline}),(0,V.jsx)(n,{flex:2,color:`fg.muted`,children:e.mostUsedTarget})]})})}var ge=k(`release_ui_ai_governance_enabled`,{bypassOnboardingRedirect:!0})(A(`organization:manage`,{bypassOnboardingRedirect:!0})(ne));export{ge as default};
2
+ //# sourceMappingURL=governance-YZL-Q4Vy.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./fetchSSE-CnJPAkno.js";import{d as t,r as n,t as r}from"./_baseEach-Bv6waMUN.js";import{D as i,O as a,S as o,b as s,c,f as l,g as u,n as d,p as f,r as p,u as m,x as h,y as g}from"./_Uint8Array-BKsS4AYJ.js";import{a as ee,i as te,o as _,r as v}from"./_baseFor-K5aTWdeA.js";import{a as y,n as b,t as x}from"./isArrayLikeObject-DQ6J5Gh8.js";import{t as S}from"./_arrayEach-D_HpLtqV.js";function C(){}function w(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function ne(e){return e!==e}function re(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function ie(e,t,n){return t===t?re(e,t,n):w(e,ne,n)}function ae(e,t){return!!(e!=null&&e.length)&&ie(e,t,0)>-1}var T=e?e.isConcatSpreadable:void 0;function oe(e){return a(e)||s(e)||!!(T&&e&&e[T])}function E(e,t,n,r,i){var a=-1,o=e.length;for(n||=oe,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?E(s,t-1,n,r,i):m(i,s):r||(i[i.length]=s)}return i}function D(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function O(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function k(e){return typeof e==`function`?e:_}function A(e,t){return(a(e)?S:r)(e,k(t))}function j(e,t){var n=[];return r(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function M(e,t){return(a(e)?c:j)(e,n(t,3))}function N(e,n){return t(n,function(t){return e[t]})}function P(e){return e==null?[]:N(e,l(e))}var F=`[object Map]`,I=`[object Set]`,L=Object.prototype.hasOwnProperty;function R(e){if(e==null)return!0;if(o(e)&&(a(e)||typeof e==`string`||typeof e.splice==`function`||g(e)||u(e)||s(e)))return!e.length;var t=d(e);if(t==F||t==I)return!e.size;if(h(e))return!f(e).length;for(var n in e)if(L.call(e,n))return!1;return!0}function z(e){return e===void 0}function B(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function V(e,t,i){var o=a(e)?D:B,s=arguments.length<3;return o(e,n(t,4),i,s,r)}var H=p&&1/v(new p([,-0]))[1]==1/0?function(e){return new p(e)}:C,U=200;function W(e,t,n){var r=-1,i=ae,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=O;else if(a>=U){var l=t?null:H(e);if(l)return v(l);o=!1,i=te,c=new ee}else c=t?[]:s;outer:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue outer;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}var G=b(function(e){return W(E(e,1,x,!0))}),K=`\0`,q=`\0`,J=``,Y=class{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,`directed`)?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,`compound`)?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=y(void 0),this._defaultEdgeLabelFn=y(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[q]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return i(e)||(e=y(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return l(this._nodes)}sources(){var e=this;return M(this.nodes(),function(t){return R(e._in[t])})}sinks(){var e=this;return M(this.nodes(),function(t){return R(e._out[t])})}setNodes(e,t){var n=arguments,r=this;return A(e,function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=q,this._children[e]={},this._children[q][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],A(this.children(e),e=>{this.setParent(e)}),delete this._children[e]),A(l(this._in[e]),t),delete this._in[e],delete this._preds[e],A(l(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(z(t))t=q;else{t+=``;for(var n=t;!z(n);n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==q)return t}}children(e){if(z(e)&&(e=q),this._isCompound){var t=this._children[e];if(t)return l(t)}else if(e===q)return this.nodes();else if(this.hasNode(e))return[]}predecessors(e){var t=this._preds[e];if(t)return l(t)}successors(e){var t=this._sucs[e];if(t)return l(t)}neighbors(e){var t=this.predecessors(e);if(t)return G(t,this.successors(e))}isLeaf(e){return(this.isDirected()?this.successors(e):this.neighbors(e)).length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;A(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),A(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};function i(e){var a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&A(t.nodes(),function(e){t.setParent(e,i(e))}),t}setDefaultEdgeLabel(e){return i(e)||(e=y(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return P(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return V(e,function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i}),this}setEdge(){var e,t,n,r,i=!1,a=arguments[0];typeof a==`object`&&a&&`v`in a?(e=a.v,t=a.w,n=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=``+e,t=``+t,z(n)||(n=``+n);var o=Q(this._isDirected,e,t,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(!z(n)&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);var s=se(this._isDirected,e,t,n);return e=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,X(this._preds[t],e),X(this._sucs[e],t),this._in[t][o]=s,this._out[e][o]=s,this._edgeCount++,this}edge(e,t,n){var r=arguments.length===1?$(this._isDirected,arguments[0]):Q(this._isDirected,e,t,n);return this._edgeLabels[r]}hasEdge(e,t,n){var r=arguments.length===1?$(this._isDirected,arguments[0]):Q(this._isDirected,e,t,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,r)}removeEdge(e,t,n){var r=arguments.length===1?$(this._isDirected,arguments[0]):Q(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],Z(this._preds[t],e),Z(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this}inEdges(e,t){var n=this._in[e];if(n){var r=P(n);return t?M(r,function(e){return e.v===t}):r}}outEdges(e,t){var n=this._out[e];if(n){var r=P(n);return t?M(r,function(e){return e.w===t}):r}}nodeEdges(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}};Y.prototype._nodeCount=0,Y.prototype._edgeCount=0;function X(e,t){e[t]?e[t]++:e[t]=1}function Z(e,t){--e[t]||delete e[t]}function Q(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}return i+J+a+J+(z(r)?K:r)}function se(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function $(e,t){return Q(e,t.v,t.w,t.name)}export{M as a,E as c,P as i,w as l,V as n,A as o,z as r,k as s,Y as t};
2
+ //# sourceMappingURL=graphlib-DsLTzvlk.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{C as n,D as r,E as i,Et as a,H as o,K as s,O as c,S as l,Tt as u,W as d,_ as f,b as p,cn as m,fn as h,j as g,k as _,lt as v,mt as ee,o as y,pt as te,un as b,w as x,wt as S,x as ne}from"./portal-Sdfvrza9.js";import{t as re}from"./jsx-runtime-CFwixLRt.js";import{c as ie,n as C,o as ae,t as oe}from"./visually-hidden-0SZJZ5dQ.js";import{n as w}from"./icon-D6xQEiPb.js";import{l as se,s as ce}from"./field-BadoNaN5.js";import{a as le}from"./split-presence-props-CBmNxzZm.js";import{a as T,i as ue}from"./field-uFetMRUQ.js";import{Hr as E,Vr as D}from"./index-8SbDirJv.js";function O(e){let{pointerNode:t,keyboardNode:n=t,onPress:r,onPressStart:i,onPressEnd:c,isValidKey:l=e=>e.key===`Enter`}=e;if(!t)return u;let f=te(t),p=u,m=u,h=u,g=e=>({point:d(e),event:e});function _(e){i?.(g(e))}function y(e){c?.(g(e))}p=a(o(t,`pointerdown`,e=>{m(),m=a(o(f,`pointerup`,e=>{v(t,s(e))?r?.(g(e)):c?.(g(e))},{passive:!r,once:!0}),o(f,`pointercancel`,y,{passive:!c,once:!0})),ee(n)&&e.pointerType===`mouse`&&e.preventDefault(),_(e)},{passive:!i}),o(n,`focus`,b));function b(){h=a(o(n,`keydown`,e=>{l(e)&&(m(),m=o(n,`keyup`,e=>{if(!l(e))return;let t=g(new f.PointerEvent(`pointerup`));r?.(t),c?.(t)}),_(new f.PointerEvent(`pointerdown`)))}),o(n,`blur`,()=>{y(new f.PointerEvent(`pointercancel`))}))}return()=>{p(),m(),h()}}var k=e=>e.ids?.root??`checkbox:${e.id}`,A=e=>e.ids?.label??`checkbox:${e.id}:label`,de=e=>e.ids?.control??`checkbox:${e.id}:control`,j=e=>e.ids?.hiddenInput??`checkbox:${e.id}:input`,fe=e=>e.getById(k(e)),M=e=>e.getById(j(e));function pe(e,t){let{send:n,context:r,prop:i,computed:a,scope:o}=e,c=!!i(`disabled`),l=!!i(`readOnly`),u=!!i(`required`),d=!!i(`invalid`),f=!c&&r.get(`focused`),p=!c&&r.get(`focusVisible`),m=a(`checked`),h=a(`indeterminate`),g=r.get(`checked`),_={"data-active":S(r.get(`active`)),"data-focus":S(f),"data-focus-visible":S(p),"data-readonly":S(l),"data-hover":S(r.get(`hovered`)),"data-disabled":S(c),"data-state":h?`indeterminate`:m?`checked`:`unchecked`,"data-invalid":S(d),"data-required":S(u)};return{checked:m,disabled:c,indeterminate:h,focused:f,checkedState:g,setChecked(e){n({type:`CHECKED.SET`,checked:e,isTrusted:!1})},toggleChecked(){n({type:`CHECKED.TOGGLE`,checked:m,isTrusted:!1})},getRootProps(){return t.label({...E.root.attrs,..._,dir:i(`dir`),id:k(o),htmlFor:j(o),onPointerMove(){c||n({type:`CONTEXT.SET`,context:{hovered:!0}})},onPointerLeave(){c||n({type:`CONTEXT.SET`,context:{hovered:!1}})},onClick(e){s(e)===M(o)&&e.stopPropagation()}})},getLabelProps(){return t.element({...E.label.attrs,..._,dir:i(`dir`),id:A(o)})},getControlProps(){return t.element({...E.control.attrs,..._,dir:i(`dir`),id:de(o),"aria-hidden":!0})},getIndicatorProps(){return t.element({...E.indicator.attrs,..._,dir:i(`dir`),hidden:!h&&!m})},getHiddenInputProps(){return t.input({id:j(o),type:`checkbox`,required:i(`required`),defaultChecked:m,disabled:c,"aria-labelledby":A(o),"aria-invalid":d,name:i(`name`),form:i(`form`),value:i(`value`),style:oe,onFocus(){n({type:`CONTEXT.SET`,context:{focused:!0,focusVisible:ce()}})},onBlur(){n({type:`CONTEXT.SET`,context:{focused:!1,focusVisible:!1}})},onClick(e){if(l){e.preventDefault();return}let t=e.currentTarget.checked;n({type:`CHECKED.SET`,checked:t,isTrusted:!0})}})}}}var{not:N}=c(),me=_({props({props:e}){return{value:`on`,...e,defaultChecked:e.defaultChecked??!1}},initialState(){return`ready`},context({prop:e,bindable:t}){return{checked:t(()=>({defaultValue:e(`defaultChecked`),value:e(`checked`),onChange(t){e(`onCheckedChange`)?.({checked:t})}})),fieldsetDisabled:t(()=>({defaultValue:!1})),focusVisible:t(()=>({defaultValue:!1})),active:t(()=>({defaultValue:!1})),focused:t(()=>({defaultValue:!1})),hovered:t(()=>({defaultValue:!1}))}},watch({track:e,context:t,prop:n,action:r}){e([()=>n(`disabled`)],()=>{r([`removeFocusIfNeeded`])}),e([()=>t.get(`checked`)],()=>{r([`syncInputElement`])})},effects:[`trackFormControlState`,`trackPressEvent`,`trackFocusVisible`],on:{"CHECKED.TOGGLE":[{guard:N(`isTrusted`),actions:[`toggleChecked`,`dispatchChangeEvent`]},{actions:[`toggleChecked`]}],"CHECKED.SET":[{guard:N(`isTrusted`),actions:[`setChecked`,`dispatchChangeEvent`]},{actions:[`setChecked`]}],"CONTEXT.SET":{actions:[`setContext`]}},computed:{indeterminate:({context:e})=>P(e.get(`checked`)),checked:({context:e})=>he(e.get(`checked`)),disabled:({context:e,prop:t})=>!!t(`disabled`)||e.get(`fieldsetDisabled`)},states:{ready:{}},implementations:{guards:{isTrusted:({event:e})=>!!e.isTrusted},effects:{trackPressEvent({context:e,computed:t,scope:n}){if(!t(`disabled`))return O({pointerNode:fe(n),keyboardNode:M(n),isValidKey:e=>e.key===` `,onPress:()=>e.set(`active`,!1),onPressStart:()=>e.set(`active`,!0),onPressEnd:()=>e.set(`active`,!1)})},trackFocusVisible({computed:e,scope:t}){if(!e(`disabled`))return se({root:t.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return ie(M(t),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){e.set(`checked`,e.initial(`checked`))}})}},actions:{setContext({context:e,event:t}){for(let n in t.context)e.set(n,t.context[n])},syncInputElement({context:e,computed:t,scope:n}){let r=M(n);r&&(ae(r,t(`checked`)),r.indeterminate=P(e.get(`checked`)))},removeFocusIfNeeded({context:e,prop:t}){t(`disabled`)&&e.get(`focused`)&&(e.set(`focused`,!1),e.set(`focusVisible`,!1))},setChecked({context:e,event:t}){e.set(`checked`,t.checked)},toggleChecked({context:e,computed:t}){let n=P(t(`checked`))?!0:!t(`checked`);e.set(`checked`,n)},dispatchChangeEvent({computed:e,scope:t}){queueMicrotask(()=>{C(M(t),{checked:e(`checked`)})})}}}});function P(e){return e===`indeterminate`}function he(e){return P(e)?!1:!!e}var[F,I]=i({name:`CheckboxContext`,hookName:`useCheckboxContext`,providerName:`<CheckboxProvider />`}),ge=e=>e.children(I()),L=e(t(),1),R=re(),z=(0,L.forwardRef)((e,t)=>{let n=g(I().getControlProps(),e);return(0,R.jsx)(x.div,{...n,ref:t})});z.displayName=`CheckboxControl`;function _e(e){let{value:t,onChange:n,defaultValue:r}=e,[i,a]=(0,L.useState)(r),o=t!==void 0;return[o?t:i,(0,L.useCallback)(e=>(o||a(e),n?.(e)),[o,n])]}function ve(e={}){let t=ue(),{defaultValue:n,value:r,onValueChange:i,disabled:a=t?.disabled,readOnly:o,name:s,invalid:c=t?.invalid,maxSelectedValues:l}=e,u=!(a||o),d=le(i,{sync:!0}),[f,p]=_e({value:r,defaultValue:n||[],onChange:d}),m=e=>f.some(t=>String(t)===String(e)),h=e=>{m(e)?v(e):_(e)},g=l!=null&&f.length>=l,_=e=>{u&&(m(e)||g||p(f.concat(e)))},v=e=>{u&&p(f.filter(t=>String(t)!==String(e)))};return{isChecked:m,value:f,name:s,disabled:!!a,readOnly:!!o,invalid:!!c,setValue:p,addValue:_,toggleValue:h,getItemProps:e=>{let t=e.value==null?void 0:m(e.value);return{checked:t,onCheckedChange(){e.value!=null&&h(e.value)},name:s,disabled:a||g&&!t,readOnly:o,invalid:c}}}}var[B,ye]=i({name:`CheckboxGroupContext`,hookName:`useCheckboxGroupContext`,providerName:`<CheckboxGroupProvider />`,strict:!1}),be=w(),V=(0,L.forwardRef)((e,t)=>{let[n,r]=be(e,[`defaultValue`,`value`,`onValueChange`,`disabled`,`invalid`,`readOnly`,`name`,`maxSelectedValues`]);return(0,R.jsx)(B,{value:ve(n),children:(0,R.jsx)(x.div,{ref:t,role:`group`,...r,...D.build().group.attrs})})});V.displayName=`CheckboxGroup`;var xe=w(),H=(0,L.forwardRef)((e,t)=>{let[n,r]=xe(e,[`value`]);return(0,R.jsx)(B,{value:n.value,children:(0,R.jsx)(x.div,{ref:t,role:`group`,...r,...D.build().group.attrs})})});H.displayName=`CheckboxGroupProvider`;var U=(0,L.forwardRef)((e,t)=>{let n=g(I().getHiddenInputProps(),e),r=T();return(0,R.jsx)(x.input,{"aria-describedby":r?.ariaDescribedby,...n,ref:t})});U.displayName=`CheckboxHiddenInput`;var W=(0,L.forwardRef)((e,t)=>{let{indeterminate:n,...r}=e,i=I(),a=g(i.getIndicatorProps(),r),o=n?i.indeterminate:i.checked;return(0,R.jsx)(x.div,{...a,hidden:!o,ref:t})});W.displayName=`CheckboxIndicator`;var G=(0,L.forwardRef)((e,t)=>{let n=g(I().getLabelProps(),e);return(0,R.jsx)(x.span,{...n,ref:t})});G.displayName=`CheckboxLabel`;var Se=(e={})=>{let t=ye(),r=T(),i=(0,L.useMemo)(()=>g(t?.getItemProps({value:e.value})??{},e),[e,t]),a=(0,L.useId)(),{getRootNode:o}=n(),{dir:s}=l();return pe(ne(me,{id:a,ids:{label:r?.ids.label,hiddenInput:r?.ids.control},dir:s,disabled:r?.disabled,readOnly:r?.readOnly,invalid:r?.invalid,required:r?.required,getRootNode:o,...i}),p)},Ce=w(),K=(0,L.forwardRef)((e,t)=>{let[n,r]=Ce(e,[`checked`,`defaultChecked`,`disabled`,`form`,`id`,`ids`,`invalid`,`name`,`onCheckedChange`,`readOnly`,`required`,`value`]),i=Se(n),a=g(i.getRootProps(),r);return(0,R.jsx)(F,{value:i,children:(0,R.jsx)(x.label,{...a,ref:t})})});K.displayName=`CheckboxRoot`;var we=w(),q=(0,L.forwardRef)((e,t)=>{let[{value:n},r]=we(e,[`value`]),i=g(n.getRootProps(),r);return(0,R.jsx)(F,{value:n,children:(0,R.jsx)(x.label,{...i,ref:t})})});q.displayName=`CheckboxRootProvider`;var J=r({Context:()=>ge,Control:()=>z,Group:()=>V,GroupProvider:()=>H,HiddenInput:()=>U,Indicator:()=>W,Label:()=>G,Root:()=>K,RootProvider:()=>q}),Y=(0,L.forwardRef)(function(e,t){let n=m({key:`checkmark`,recipe:e.recipe}),[r,i]=n.splitVariantProps(e),{checked:a,indeterminate:o,disabled:s,unstyled:c,children:l,...u}=i,d=c?b:n(r);return(0,R.jsx)(h.svg,{ref:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3px`,strokeLinecap:`round`,strokeLinejoin:`round`,"data-state":o?`indeterminate`:a?`checked`:`unchecked`,"data-disabled":y(s),css:[d,e.css],...u,children:o?(0,R.jsx)(`path`,{d:`M5 12h14`}):a?(0,R.jsx)(`polyline`,{points:`20 6 9 17 4 12`}):null})});Y.displayName=`Checkmark`;var{withProvider:X,withContext:Z,useStyles:Te,PropsProvider:Ee}=f({key:`checkbox`});X(J.RootProvider,`root`,{forwardAsChild:!0});var De=X(J.Root,`root`,{forwardAsChild:!0}),Oe=Z(J.Label,`label`,{forwardAsChild:!0}),Q=(0,L.forwardRef)(function(e,t){let{checked:n,indeterminate:r,...i}=e,a=I(),o=Te();return n&&a.checked?(0,R.jsx)(h.svg,{ref:t,asChild:!0,...i,css:[o.indicator,e.css],children:n}):r&&a.indeterminate?(0,R.jsx)(h.svg,{ref:t,asChild:!0,...i,css:[o.indicator,e.css],children:r}):(0,R.jsx)(Y,{ref:t,checked:a.checked,indeterminate:a.indeterminate,disabled:a.disabled,unstyled:!0,...i,css:[o.indicator,e.css]})}),ke=Z(J.Control,`control`,{forwardAsChild:!0,defaultProps:{children:(0,R.jsx)(Q,{})}}),Ae=h(J.Group,{base:{display:`flex`,flexDirection:`column`,gap:`1.5`}},{forwardAsChild:!0});J.Context;var je=J.HiddenInput,$=(0,L.forwardRef)(function(e,t){let{templateAreas:n,column:r,row:i,autoFlow:a,autoRows:o,templateRows:s,autoColumns:c,templateColumns:l,inline:u,...d}=e;return(0,R.jsx)(h.div,{...d,ref:t,css:[{display:u?`inline-grid`:`grid`,gridTemplateAreas:n,gridAutoColumns:c,gridColumn:r,gridRow:i,gridAutoFlow:a,gridAutoRows:o,gridTemplateRows:s,gridTemplateColumns:l},e.css]})});$.displayName=`Grid`;export{Q as a,O as c,je as i,ke as n,Oe as o,Ae as r,De as s,$ as t};
2
+ //# sourceMappingURL=grid-MxZhegzw.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{t as s}from"./heading-C0sACr0w.js";import{n as c,t as l}from"./v-stack-hkuSkmCA.js";import{An as u,n as d}from"./ProjectAvatar-B0tbfKzY.js";import{p as f,t as p}from"./select-BvA110t-.js";import{t as m}from"./badge-Cpc3eA-C.js";import{n as h}from"./toaster-BsYkODqs.js";import{$ as g,G as _,I as v,J as y,Q as b,X as x,Y as S,Z as C,tt as w}from"./Markdown-Cip8Rj5C.js";import{a as T,i as E,n as D,r as O,t as k}from"./alert-CPsXih3K.js";import{r as A,t as j}from"./card-By_Mbslh.js";import{t as M}from"./errors-mlatPkMI.js";import{t as N}from"./spacer-C38e7o6r.js";import{n as P}from"./api-l6Cnm0vQ.js";import{t as F}from"./pen-C3Gj-8O8.js";import{Mr as I,Qn as L,St as R,Vn as z,Vt as B,Yn as V}from"./index-8SbDirJv.js";import{t as H}from"./useActivePlan-Dsa3BYxd.js";import{t as U}from"./WithPermissionGuard-Da_hdEdq.js";import{t as W}from"./input-group-D7qfFB6C.js";import{t as G}from"./SettingsLayout-ZI47ZjuT.js";import{t as K}from"./ContactSalesBlock-B3w2lKdE.js";import{i as q,n as ee,r as J,t as Y}from"./GroupBindingInputRow-BxvXd1EU.js";var X=e(t()),Z=o();function Q({organizationId:e,open:t,onClose:n}){let o=P.useContext(),[s,u]=(0,X.useState)(``),[h,g]=(0,X.useState)([]),[_,v]=(0,X.useState)([]),[y,b]=(0,X.useState)(``),[x,S]=(0,X.useState)(``),C=P.organization.getOrganizationWithMembersAndTheirTeams.useQuery({organizationId:e},{enabled:t}),w=P.group.create.useMutation();function T(){u(``),g([]),v([]),b(``),S(``)}async function E(){if(s.trim())try{await w.mutateAsync({organizationId:e,name:s.trim(),bindings:h.map(e=>({role:e.role,customRoleId:e.customRoleId,scopeType:e.scopeType,scopeId:e.scopeId})),memberIds:_}),o.group.listAll.invalidate(),T(),n()}catch(e){M({error:e,fallbackTitle:`Couldn't create the group`})}}let D=(C.data?.members??[]).filter(e=>!_.includes(e.userId)).map(e=>({label:`${e.user.name??e.user.email} (${e.user.email})`,value:e.userId})).sort((e,t)=>e.label.localeCompare(t.label)),O=x?D.filter(e=>e.label.toLowerCase().includes(x.toLowerCase())):D,k=f({items:O});return(0,Z.jsx)(R.Root,{open:t,onOpenChange:e=>{e.open||(T(),n())},size:`lg`,children:(0,Z.jsxs)(R.Content,{bg:`bg`,maxHeight:`90vh`,overflowY:`auto`,children:[(0,Z.jsx)(R.Header,{children:(0,Z.jsx)(R.Title,{children:`Create group`})}),(0,Z.jsx)(R.CloseTrigger,{}),(0,Z.jsx)(R.Body,{pb:6,children:(0,Z.jsxs)(l,{gap:5,align:`stretch`,children:[(0,Z.jsx)(I,{autoFocus:!0,placeholder:`Group name`,value:s,onChange:e=>u(e.target.value)}),(0,Z.jsxs)(r,{children:[(0,Z.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,mb:3,children:`Access`}),h.length>0&&(0,Z.jsx)(l,{gap:2,align:`stretch`,mb:2,children:h.map((e,t)=>(0,Z.jsxs)(a,{px:3,py:2,bg:`bg.muted`,borderRadius:`md`,fontSize:`sm`,children:[(0,Z.jsx)(m,{colorPalette:J(e.role),size:`sm`,children:e.customRoleName??e.role}),(0,Z.jsx)(c,{color:`fg.muted`,children:`on`}),(0,Z.jsxs)(m,{colorPalette:`purple`,size:`sm`,children:[q(e.scopeType),` `,e.scopeName??e.scopeId]}),(0,Z.jsx)(N,{}),(0,Z.jsx)(i,{size:`xs`,variant:`ghost`,color:`fg.muted`,"aria-label":`Remove ${e.customRoleName??e.role} binding on ${e.scopeName??e.scopeId}`,onClick:()=>g(e=>e.filter((e,n)=>n!==t)),children:(0,Z.jsx)(z,{size:14})})]},t))}),(0,Z.jsx)(Y,{organizationId:e,onAdd:e=>g(t=>[...t,e])})]}),(0,Z.jsxs)(r,{children:[(0,Z.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,mb:3,children:`Members`}),_.length>0&&(0,Z.jsx)(l,{gap:1,align:`stretch`,mb:2,children:_.map(e=>{let t=C.data?.members.find(t=>t.userId===e);return(0,Z.jsxs)(a,{py:1,fontSize:`sm`,children:[(0,Z.jsx)(d,{name:t?.user.name??t?.user.email??`?`,image:t?.user.image,size:`xs`}),(0,Z.jsx)(c,{flex:1,children:t?.user.name??t?.user.email??e}),(0,Z.jsx)(i,{size:`xs`,variant:`ghost`,color:`fg.muted`,"aria-label":`Remove ${t?.user.name??t?.user.email??e} from group`,onClick:()=>v(t=>t.filter(t=>t!==e)),children:(0,Z.jsx)(z,{size:14})})]},e)})}),(0,Z.jsx)(a,{gap:2,mt:2,children:(0,Z.jsxs)(p.Root,{collection:k,value:y?[y]:[],onValueChange:e=>{let t=e.value[0];t&&(v(e=>[...e,t]),b(``))},size:`sm`,flex:1,children:[(0,Z.jsx)(p.Trigger,{children:(0,Z.jsx)(p.ValueText,{placeholder:`Add member...`})}),(0,Z.jsxs)(p.Content,{children:[(0,Z.jsx)(r,{position:`sticky`,top:0,zIndex:1,bg:`bg`,pb:1,children:(0,Z.jsx)(W,{startElement:(0,Z.jsx)(V,{size:14}),startOffset:`2px`,width:`full`,children:(0,Z.jsx)(I,{size:`sm`,placeholder:`Search members...`,value:x,onChange:e=>S(e.target.value),onKeyDown:e=>e.stopPropagation()})})}),O.map(e=>(0,Z.jsx)(p.Item,{item:e,children:e.label},e.value))]})]})})]})]})}),(0,Z.jsxs)(R.Footer,{children:[(0,Z.jsx)(i,{variant:`outline`,onClick:()=>{T(),n()},children:`Cancel`}),(0,Z.jsx)(i,{colorPalette:`blue`,disabled:!s.trim(),loading:w.isPending,onClick:()=>void E(),children:`Create group`})]})]})})}function te({group:e,organizationId:t,canManage:o,open:s,onClose:u}){let g=P.useContext(),[_,v]=(0,X.useState)(e.name),[y,b]=(0,X.useState)(e.name),[x,S]=(0,X.useState)(new Set),[C,w]=(0,X.useState)([]),[T,E]=(0,X.useState)(new Set),[D,O]=(0,X.useState)([]),[k,A]=(0,X.useState)(``),[j,F]=(0,X.useState)(``),[L,B]=(0,X.useState)(!1),H=(0,X.useRef)(null),U=()=>{v(e.name),b(e.name),S(new Set),w([]),E(new Set),O([]),A(``),F(``)};(0,X.useEffect)(()=>{s&&U()},[s,e.id]);let G=_.trim()!==y&&_.trim()!==``,K=G||x.size>0||C.length>0||T.size>0||D.length>0,Q=P.group.getById.useQuery({organizationId:t,groupId:e.id},{enabled:s}),te=P.organization.getOrganizationWithMembersAndTheirTeams.useQuery({organizationId:t},{enabled:s&&o}),ne=P.group.applyEdits.useMutation(),re=async()=>{let n=H.current?.flush()??null,r=n?[...C,n]:C;B(!0);try{await ne.mutateAsync({organizationId:t,groupId:e.id,rename:G?{name:_.trim()}:null,bindingIdsToDelete:[...x],bindingsToCreate:r.map(e=>({role:e.role,customRoleId:e.customRoleId,scopeType:e.scopeType,scopeId:e.scopeId})),memberUserIdsToAdd:D.map(e=>e.userId),memberUserIdsToRemove:[...T]}),g.group.getById.invalidate(),g.group.listAll.invalidate(),h.create({title:`Group updated`,type:`success`}),u()}catch(e){M({error:e,fallbackTitle:`Couldn't update this group`})}finally{B(!1)}},ie=e=>S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),ae=e=>E(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),oe=({userId:e,label:t,image:n})=>{O(r=>[...r,{userId:e,label:t,image:n}]),A(``),F(``)},$=Q.data,se=new Set([...$?.members.map(e=>e.userId)??[],...D.map(e=>e.userId)]);return(0,Z.jsx)(R.Root,{open:s,onOpenChange:e=>{e.open||(U(),u())},size:`lg`,children:(0,Z.jsxs)(R.Content,{bg:`bg`,maxHeight:`90vh`,overflowY:`auto`,children:[(0,Z.jsx)(R.Header,{children:(0,Z.jsx)(R.Title,{children:e.name})}),(0,Z.jsx)(R.CloseTrigger,{}),(0,Z.jsx)(R.Body,{pb:6,children:Q.isLoading?(0,Z.jsx)(n,{}):$?(0,Z.jsxs)(l,{gap:5,align:`stretch`,children:[o&&!$.scimSource&&(0,Z.jsx)(I,{value:_,onChange:e=>v(e.target.value),placeholder:`Group name`,size:`md`}),(0,Z.jsxs)(a,{children:[(0,Z.jsx)(ee,{scimSource:$.scimSource}),(0,Z.jsxs)(c,{fontSize:`sm`,color:`fg.muted`,children:[Math.max(0,$.members.length-T.size+D.length),` `,`members`]})]}),(0,Z.jsxs)(r,{children:[(0,Z.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,mb:3,children:`Access granted`}),$.bindings.length===0&&C.length===0?(0,Z.jsx)(c,{fontSize:`sm`,color:`fg.muted`,fontStyle:`italic`,children:`No access configured yet.`}):(0,Z.jsxs)(l,{gap:2,align:`stretch`,children:[$.bindings.map(e=>{let t=x.has(e.id);return(0,Z.jsxs)(a,{px:3,py:2,bg:`bg.muted`,borderRadius:`md`,fontSize:`sm`,opacity:t?.4:1,transition:`opacity 0.15s`,children:[(0,Z.jsx)(m,{colorPalette:J(e.role),size:`sm`,textDecoration:t?`line-through`:void 0,children:e.customRoleName??e.role}),(0,Z.jsx)(c,{color:`fg.muted`,children:`on`}),(0,Z.jsxs)(m,{colorPalette:`purple`,size:`sm`,textDecoration:t?`line-through`:void 0,children:[q(e.scopeType),` `,e.scopeName??e.scopeId]}),(0,Z.jsx)(N,{}),o&&(0,Z.jsx)(i,{size:`xs`,variant:`ghost`,color:t?`blue.500`:`fg.muted`,"aria-label":t?`Undo removal`:`Remove binding`,onClick:()=>ie(e.id),children:(0,Z.jsx)(z,{size:14})})]},e.id)}),C.map((e,t)=>(0,Z.jsxs)(a,{px:3,py:2,bg:`bg.muted`,borderRadius:`md`,fontSize:`sm`,opacity:.7,children:[(0,Z.jsx)(m,{colorPalette:J(e.role),size:`sm`,children:e.customRoleName??e.role}),(0,Z.jsx)(c,{color:`fg.muted`,children:`on`}),(0,Z.jsxs)(m,{colorPalette:`purple`,size:`sm`,children:[q(e.scopeType),` `,e.scopeName??e.scopeId]}),(0,Z.jsx)(N,{}),(0,Z.jsx)(i,{size:`xs`,variant:`ghost`,color:`fg.muted`,"aria-label":`Undo add`,onClick:()=>w(e=>e.filter((e,n)=>n!==t)),children:(0,Z.jsx)(z,{size:14})})]},t))]}),o&&(0,Z.jsx)(Y,{ref:H,organizationId:t,onAdd:e=>w(t=>[...t,e])})]}),(0,Z.jsxs)(r,{children:[(0,Z.jsx)(c,{fontSize:`sm`,fontWeight:`semibold`,mb:3,children:`Members`}),$.scimSource&&(0,Z.jsxs)(r,{px:3,py:2,bg:`bg.muted`,borderRadius:`md`,mb:3,fontSize:`sm`,color:`fg.muted`,children:[`Membership managed by `,$.scimSource.toUpperCase(),` via SCIM.`]}),$.members.length===0&&D.length===0?(0,Z.jsx)(c,{fontSize:`sm`,color:`fg.muted`,fontStyle:`italic`,children:`No members yet.`}):(0,Z.jsxs)(Z.Fragment,{children:[$.members.map(e=>{let t=T.has(e.userId);return(0,Z.jsxs)(a,{py:1,fontSize:`sm`,opacity:t?.4:1,transition:`opacity 0.15s`,children:[(0,Z.jsx)(d,{name:e.name??e.email??`?`,image:e.image,size:`xs`}),(0,Z.jsx)(c,{flex:1,textDecoration:t?`line-through`:void 0,children:e.name??e.email}),o&&!$.scimSource&&(0,Z.jsx)(i,{size:`xs`,variant:`ghost`,color:t?`blue.500`:`fg.muted`,"aria-label":t?`Undo removal of ${e.name??e.email}`:`Mark ${e.name??e.email} for removal`,onClick:()=>ae(e.userId),children:(0,Z.jsx)(z,{size:14})})]},e.userId)}),D.map(e=>(0,Z.jsxs)(a,{py:1,fontSize:`sm`,opacity:.7,children:[(0,Z.jsx)(d,{name:e.label,image:e.image,size:`xs`}),(0,Z.jsx)(c,{flex:1,color:`green.600`,children:e.label}),(0,Z.jsx)(i,{size:`xs`,variant:`ghost`,color:`fg.muted`,"aria-label":`Undo adding ${e.label}`,onClick:()=>O(t=>t.filter(t=>t.userId!==e.userId)),children:(0,Z.jsx)(z,{size:14})})]},e.userId))]}),o&&!$.scimSource&&(()=>{let e=(te.data?.members??[]).filter(e=>!se.has(e.userId)).map(e=>({label:`${e.user.name??e.user.email} (${e.user.email})`,value:e.userId,image:e.user.image??null})).sort((e,t)=>e.label.localeCompare(t.label)),t=j?e.filter(e=>e.label.toLowerCase().includes(j.toLowerCase())):e,n=f({items:t});return(0,Z.jsxs)(a,{gap:2,mt:2,children:[(0,Z.jsxs)(p.Root,{collection:n,value:k?[k]:[],onValueChange:e=>A(e.value[0]??``),size:`sm`,flex:1,children:[(0,Z.jsx)(p.Trigger,{children:(0,Z.jsx)(p.ValueText,{placeholder:`Add member...`})}),(0,Z.jsxs)(p.Content,{children:[(0,Z.jsx)(r,{position:`sticky`,top:0,zIndex:1,bg:`bg`,pb:1,children:(0,Z.jsx)(W,{startElement:(0,Z.jsx)(V,{size:14}),startOffset:`2px`,width:`full`,children:(0,Z.jsx)(I,{size:`sm`,placeholder:`Search members...`,value:j,onChange:e=>F(e.target.value),onKeyDown:e=>e.stopPropagation()})})}),t.map(e=>(0,Z.jsx)(p.Item,{item:e,children:e.label},e.value))]})]}),(0,Z.jsx)(i,{size:`sm`,colorPalette:k?`blue`:void 0,disabled:!k,onClick:()=>{let t=e.find(e=>e.value===k);t&&oe({userId:t.value,label:t.label,image:t.image})},children:`Add`})]})})()]})]}):null}),o&&(0,Z.jsxs)(R.Footer,{children:[(0,Z.jsx)(i,{variant:`outline`,onClick:()=>{U(),u()},children:`Cancel`}),(0,Z.jsx)(i,{colorPalette:`blue`,disabled:!K,loading:L,onClick:()=>void re(),children:`Save`})]})]})})}function ne(){let{organization:e,hasPermission:t}=B(),{isEnterprise:o}=H(),[d,f]=(0,X.useState)(null),[p,N]=(0,X.useState)(!1),[I,z]=(0,X.useState)(null),V=P.useContext(),U=P.group.delete.useMutation({onSuccess:()=>{h.create({title:`Group deleted`,type:`success`}),V.group.listAll.invalidate(),z(null)},onError:e=>M({error:e,fallbackTitle:`Couldn't delete the group`})}),W=P.group.listAll.useQuery({organizationId:e?.id??``},{enabled:!!e&&o}),Y=t(`organization:manage`);return e?o?(0,Z.jsxs)(G,{children:[(0,Z.jsxs)(l,{gap:6,width:`full`,align:`start`,children:[(0,Z.jsx)(a,{justify:`space-between`,width:`full`,children:(0,Z.jsxs)(l,{align:`start`,gap:1,children:[(0,Z.jsx)(s,{as:`h2`,children:`Groups`}),(0,Z.jsx)(c,{color:`fg.muted`,fontSize:`sm`,children:`Assign access to many people at once. SCIM-synced groups are managed by your identity provider.`})]})}),(0,Z.jsx)(w,{}),W.isLoading&&(0,Z.jsx)(n,{}),!W.isLoading&&(0,Z.jsx)(A,{width:`full`,overflow:`hidden`,children:(0,Z.jsx)(j,{paddingY:0,paddingX:0,overflowX:`auto`,children:(0,Z.jsxs)(b,{variant:`line`,size:`md`,width:`full`,children:[(0,Z.jsx)(C,{children:(0,Z.jsxs)(g,{children:[(0,Z.jsx)(x,{children:`Group`}),(0,Z.jsx)(x,{width:`120px`,children:`Source`}),(0,Z.jsx)(x,{textAlign:`right`,children:`Access`}),(0,Z.jsx)(x,{width:`80px`,textAlign:`right`,children:`Members`}),Y&&(0,Z.jsx)(x,{width:`48px`})]})}),(0,Z.jsxs)(y,{children:[(W.data??[]).map(e=>(0,Z.jsxs)(g,{cursor:`pointer`,onClick:()=>f(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),f(e))},tabIndex:0,role:`button`,_hover:{bg:`bg.muted`},children:[(0,Z.jsx)(S,{fontWeight:`medium`,children:e.name}),(0,Z.jsx)(S,{children:(0,Z.jsx)(ee,{scimSource:e.scimSource})}),(0,Z.jsx)(S,{children:(0,Z.jsxs)(l,{gap:1,align:`end`,children:[e.bindings.map((e,t)=>(0,Z.jsxs)(a,{gap:1,fontSize:`xs`,children:[(0,Z.jsx)(m,{colorPalette:J(e.role),size:`sm`,children:e.customRoleName??e.role}),(0,Z.jsx)(c,{color:`fg.muted`,children:`on`}),(0,Z.jsxs)(m,{colorPalette:`purple`,size:`sm`,children:[q(e.scopeType),` `,e.scopeName??e.scopeId]})]},t)),e.bindings.length===0&&(0,Z.jsx)(c,{fontSize:`xs`,color:`fg.subtle`,textAlign:`right`,children:`No access configured`})]})}),(0,Z.jsx)(S,{textAlign:`right`,children:(0,Z.jsx)(c,{fontSize:`sm`,color:`fg.muted`,children:e.memberCount})}),Y&&(0,Z.jsx)(S,{children:(0,Z.jsxs)(v.Root,{children:[(0,Z.jsx)(v.Trigger,{asChild:!0,children:(0,Z.jsx)(i,{variant:`ghost`,size:`xs`,"aria-label":`Actions for ${e.name}`,onClick:e=>e.stopPropagation(),children:(0,Z.jsx)(u,{size:16})})}),(0,Z.jsxs)(v.Content,{children:[(0,Z.jsx)(v.Item,{value:`edit`,onClick:t=>{t.stopPropagation(),f(e)},children:(0,Z.jsxs)(r,{display:`flex`,alignItems:`center`,gap:2,children:[(0,Z.jsx)(F,{size:14}),`Edit`]})}),(0,Z.jsx)(v.Item,{value:`delete`,color:`red.500`,onClick:t=>{t.stopPropagation(),z(e)},children:(0,Z.jsxs)(r,{display:`flex`,alignItems:`center`,gap:2,children:[(0,Z.jsx)(_,{size:14}),`Delete`]})})]})]})})]},e.id)),Y&&(0,Z.jsx)(g,{cursor:`pointer`,onClick:()=>N(!0),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N(!0))},tabIndex:0,role:`button`,_hover:{bg:`bg.muted`},color:`fg.muted`,children:(0,Z.jsx)(S,{colSpan:5,children:(0,Z.jsxs)(a,{gap:2,children:[(0,Z.jsx)(L,{size:14}),(0,Z.jsx)(c,{fontSize:`sm`,children:`Add manual group`})]})})})]})]})})})]}),d&&(0,Z.jsx)(te,{group:d,organizationId:e.id,canManage:Y,open:!!d,onClose:()=>f(null)}),(0,Z.jsx)(Q,{organizationId:e.id,open:p,onClose:()=>N(!1)}),(0,Z.jsx)(R.Root,{open:!!I,onOpenChange:e=>{e.open||z(null)},children:(0,Z.jsxs)(R.Content,{bg:`bg`,maxWidth:`440px`,children:[(0,Z.jsx)(R.Header,{children:(0,Z.jsx)(R.Title,{children:`Delete group`})}),(0,Z.jsx)(R.CloseTrigger,{}),(0,Z.jsx)(R.Body,{children:(0,Z.jsx)(c,{fontSize:`sm`,children:I?.scimSource?`This SCIM group will be re-created by your IdP on next sync. Delete anyway?`:`Delete "${I?.name}" and all its access rules?`})}),(0,Z.jsxs)(R.Footer,{children:[(0,Z.jsx)(i,{variant:`outline`,onClick:()=>z(null),children:`Cancel`}),(0,Z.jsx)(i,{colorPalette:`red`,loading:U.isPending,onClick:()=>I&&U.mutate({organizationId:e.id,groupId:I.id}),children:`Delete`})]})]})})]}):(0,Z.jsx)(G,{children:(0,Z.jsxs)(l,{gap:6,align:`start`,width:`full`,children:[(0,Z.jsxs)(E,{status:`info`,children:[(0,Z.jsx)(O,{}),(0,Z.jsxs)(k,{children:[(0,Z.jsx)(T,{children:`Enterprise Feature`}),(0,Z.jsx)(D,{children:`Groups are available on Enterprise plans. Contact sales to upgrade.`})]})]}),(0,Z.jsx)(r,{width:`full`,children:(0,Z.jsx)(K,{})})]})}):(0,Z.jsx)(G,{})}var re=U(`organization:manage`,{layoutComponent:G})(ne);export{re as default};
2
+ //# sourceMappingURL=groups-BmusUt3C.js.map
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{n as s,t as c}from"./v-stack-hkuSkmCA.js";import{t as l}from"./badge-Cpc3eA-C.js";import{$ as u,J as d,Q as f,X as p,Y as m,Z as h,r as g}from"./Markdown-Cip8Rj5C.js";import{a as _,n as v,r as y}from"./field-BadoNaN5.js";import{L as b}from"./DashboardLayout-Cn5-9Ye2.js";import{r as x,t as S}from"./card-By_Mbslh.js";import{n as C}from"./personalProject-C9vU_vdl.js";import{a as w,i as T,n as E,r as D,t as O}from"./empty-state-T8EYr5NF.js";import{t as k}from"./errors-mlatPkMI.js";import{r as A,t as j}from"./native-select-DL2k8x0o.js";import{t as M}from"./spacer-C38e7o6r.js";import{tt as N}from"./immer-DImI3Uq2.js";import{n as P}from"./api-l6Cnm0vQ.js";import{t as F}from"./AiGatewayLayout-BqznP5T2.js";import{t as I}from"./archive-CIpRF4hE.js";import{Mr as L,Qn as R,Vt as z,nr as B,qn as V}from"./index-8SbDirJv.js";import{t as H}from"./WithPermissionGuard-Da_hdEdq.js";var U=e(t()),W=o(),G={PRE:`Pre (request)`,POST:`Post (response)`,STREAM_CHUNK:`Stream chunk`},K={PRE:`Runs on the inbound request body before any provider call. Block returns 403 guardrail_blocked.`,POST:`Runs on the assistant response before the client sees it. Block returns 403 + zero-cost debit.`,STREAM_CHUNK:`Runs per visible SSE delta. Always fail-open per contract (50ms budget).`},q={FAIL_CLOSED:`Fail closed (block on evaluator error)`,FAIL_OPEN:`Fail open (allow on evaluator error)`};function J(){let{organization:e,project:t,hasPermission:o}=z(),_=t?.id??``,v=o(`gatewayGuardrails:manage`),y=P.gatewayGuardrails.list.useQuery({projectId:_},{enabled:!!_,refetchOnWindowFocus:!1}),C=P.monitors.getAllForProject.useQuery({projectId:_},{enabled:!!_,refetchOnWindowFocus:!1}),A=P.useContext(),j=(0,U.useMemo)(()=>(C.data??[]).filter(e=>e.enabled&&e.executionMode===`AS_GUARDRAIL`&&typeof e.evaluatorId==`string`&&e.evaluatorId.length>0).map(e=>({id:e.evaluatorId,name:e.name,slug:e.slug})),[C.data]),N=(0,U.useMemo)(()=>{let e=new Map;for(let t of j)e.set(t.id,t);return e},[j]),L=P.gatewayGuardrails.archive.useMutation({onSuccess:async()=>{_&&await A.gatewayGuardrails.list.invalidate({projectId:_})}}),[H,K]=(0,U.useState)(!1),[q,J]=(0,U.useState)(null),[X,Z]=(0,U.useState)(null),Q=async()=>{if(!(!X||!_))try{await L.mutateAsync({projectId:_,id:X.id}),Z(null)}catch(e){k({error:e,fallbackTitle:`Couldn't archive the guardrail`})}},$=(y.data??[]).filter(e=>!e.archivedAt);return e?_?(0,W.jsxs)(F,{pageTitle:`Guardrails · AI Gateway · LangWatch`,children:[(0,W.jsxs)(b.Header,{children:[(0,W.jsx)(b.Heading,{children:`Guardrails`}),(0,W.jsx)(M,{}),v&&(0,W.jsxs)(i,{colorPalette:`orange`,size:`sm`,onClick:()=>K(!0),disabled:j.length===0,children:[(0,W.jsx)(R,{size:14}),` New guardrail`]})]}),(0,W.jsx)(r,{paddingX:6,paddingY:4,width:`full`,children:(0,W.jsxs)(c,{align:`stretch`,gap:4,children:[(0,W.jsx)(s,{fontSize:`sm`,color:`fg.muted`,children:`Project-scoped LangWatch evaluators that run on every gateway request bound to this project. Pick a direction (pre / post / stream_chunk) and a failure mode (default fail closed). The VK opt-in lives in the virtual-key drawer.`}),y.isLoading?(0,W.jsx)(n,{}):$.length===0?(0,W.jsx)(x,{children:(0,W.jsx)(S,{children:(0,W.jsx)(T,{children:(0,W.jsxs)(O,{children:[(0,W.jsx)(D,{children:(0,W.jsx)(V,{size:36})}),(0,W.jsx)(w,{children:`No guardrails yet`}),(0,W.jsx)(E,{children:j.length===0?(0,W.jsxs)(W.Fragment,{children:[`No project evaluators are marked as guardrails. Open Evaluations, edit an evaluator, and switch`,` `,(0,W.jsx)(`strong`,{children:`executionMode`}),` to`,` `,(0,W.jsx)(`code`,{children:`AS_GUARDRAIL`}),` before binding it here.`]}):(0,W.jsxs)(W.Fragment,{children:[`Click `,(0,W.jsx)(`strong`,{children:`New guardrail`}),` to bind one of your project evaluators as a pre / post / stream_chunk hook.`]})})]})})})}):(0,W.jsxs)(f,{size:`sm`,variant:`line`,children:[(0,W.jsx)(h,{children:(0,W.jsxs)(u,{children:[(0,W.jsx)(p,{children:`Name`}),(0,W.jsx)(p,{children:`Direction`}),(0,W.jsx)(p,{children:`Evaluator`}),(0,W.jsx)(p,{children:`Failure mode`}),(0,W.jsx)(p,{})]})}),(0,W.jsx)(d,{children:$.map(e=>{let t=N.get(e.evaluatorId);return(0,W.jsxs)(u,{children:[(0,W.jsx)(m,{children:(0,W.jsxs)(c,{align:`start`,gap:0,children:[(0,W.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:e.name}),e.description&&(0,W.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:e.description})]})}),(0,W.jsx)(m,{children:(0,W.jsx)(l,{variant:`subtle`,children:G[e.direction]})}),(0,W.jsx)(m,{children:t?(0,W.jsxs)(c,{align:`start`,gap:0,children:[(0,W.jsx)(s,{fontSize:`sm`,children:t.name}),(0,W.jsx)(s,{fontSize:`2xs`,color:`fg.muted`,fontFamily:`mono`,children:t.slug})]}):(0,W.jsx)(s,{fontSize:`xs`,color:`fg.muted`,fontFamily:`mono`,children:e.evaluatorId})}),(0,W.jsx)(m,{children:(0,W.jsx)(l,{variant:`surface`,colorPalette:e.failureMode===`FAIL_CLOSED`?`red`:`yellow`,children:e.failureMode===`FAIL_CLOSED`?`fail closed`:`fail open`})}),(0,W.jsx)(m,{children:(0,W.jsxs)(a,{justify:`end`,gap:1,children:[v&&(0,W.jsxs)(i,{size:`xs`,variant:`ghost`,onClick:()=>J(e),children:[(0,W.jsx)(B,{size:12}),` Edit`]}),v&&(0,W.jsx)(i,{size:`xs`,variant:`ghost`,colorPalette:`red`,onClick:()=>Z(e),children:(0,W.jsx)(I,{size:12})})]})})]},e.id)})})]})]})}),(0,W.jsx)(Y,{open:H||q!==null,mode:q?`edit`:`create`,existing:q,projectId:_,guardrailEvaluators:j,onClose:()=>{K(!1),J(null)}}),(0,W.jsx)(g,{open:X!==null,onOpenChange:e=>{e||Z(null)},title:`Archive guardrail "${X?.name??``}"?`,message:`The guardrail stops being evaluated on the gateway within ~60s. VKs that referenced it via guardrailAttachments will simply skip it on next bundle refresh.`,confirmLabel:`Archive`,tone:`danger`,loading:L.isPending,onConfirm:Q})]}):(0,W.jsxs)(F,{pageTitle:`Guardrails · AI Gateway · LangWatch`,children:[(0,W.jsx)(b.Header,{children:(0,W.jsx)(b.Heading,{children:`Guardrails`})}),(0,W.jsx)(r,{paddingX:6,paddingY:4,width:`full`,children:(0,W.jsx)(T,{children:(0,W.jsxs)(O,{children:[(0,W.jsx)(D,{children:(0,W.jsx)(V,{size:36})}),(0,W.jsx)(w,{children:`Pick a project first`}),(0,W.jsx)(E,{children:`Guardrails are scoped per project. Use the project switcher in the top-left to pick a project before creating one.`})]})})})]}):(0,W.jsx)(F,{children:(0,W.jsx)(n,{})})}function Y({open:e,mode:t,existing:n,projectId:r,guardrailEvaluators:o,onClose:s}){let l=P.useContext(),[u,d]=(0,U.useState)(``),[f,p]=(0,U.useState)(``),[m,h]=(0,U.useState)(``),[g,b]=(0,U.useState)(`PRE`),[x,S]=(0,U.useState)(`FAIL_CLOSED`);(0,U.useEffect)(()=>{e&&(t===`edit`&&n?(d(n.name),p(n.description??``),h(n.evaluatorId),b(n.direction),S(n.failureMode)):t===`create`&&(d(``),p(``),h(o[0]?.id??``),b(`PRE`),S(`FAIL_CLOSED`)))},[e,t,n?.id]);let w=P.gatewayGuardrails.create.useMutation({onSuccess:async()=>{await l.gatewayGuardrails.list.invalidate({projectId:r}),s()},onError:e=>k({error:e,fallbackTitle:`Couldn't create the guardrail`})}),T=P.gatewayGuardrails.update.useMutation({onSuccess:async()=>{await l.gatewayGuardrails.list.invalidate({projectId:r}),s()},onError:e=>k({error:e,fallbackTitle:`Couldn't save the guardrail`})}),E=w.isPending||T.isPending,D=!u.trim()||!m||E;return(0,W.jsx)(C.Root,{open:e,onOpenChange:({open:e})=>{e||s()},placement:`end`,size:`md`,children:(0,W.jsxs)(C.Content,{bg:`bg`,children:[(0,W.jsxs)(C.Header,{children:[(0,W.jsx)(C.Title,{children:t===`create`?`New guardrail`:`Edit guardrail`}),(0,W.jsx)(C.CloseTrigger,{})]}),(0,W.jsx)(C.Body,{children:(0,W.jsxs)(c,{align:`stretch`,gap:5,children:[(0,W.jsxs)(_,{required:!0,children:[(0,W.jsx)(y,{children:`Name`}),(0,W.jsx)(L,{value:u,onChange:e=>d(e.target.value),placeholder:`e.g. block PII on requests`,autoFocus:!0})]}),(0,W.jsxs)(_,{children:[(0,W.jsx)(y,{children:`Description`}),(0,W.jsx)(N,{value:f,onChange:e=>p(e.target.value),rows:2,placeholder:`Why this guardrail exists`})]}),(0,W.jsxs)(_,{required:!0,children:[(0,W.jsx)(y,{children:`Evaluator`}),(0,W.jsx)(A,{size:`sm`,children:(0,W.jsxs)(j,{value:m,onChange:e=>h(e.target.value),children:[(0,W.jsx)(`option`,{value:``,children:`Pick an evaluator…`}),o.map(e=>(0,W.jsxs)(`option`,{value:e.id,children:[e.name,` (`,e.slug,`)`]},e.id))]})}),(0,W.jsx)(v,{children:`Only evaluators with executionMode AS_GUARDRAIL are listed. Flip an evaluator in Evaluations to expose it here.`})]}),(0,W.jsxs)(_,{required:!0,children:[(0,W.jsx)(y,{children:`Direction`}),(0,W.jsx)(A,{size:`sm`,children:(0,W.jsx)(j,{value:g,onChange:e=>b(e.target.value),children:[`PRE`,`POST`,`STREAM_CHUNK`].map(e=>(0,W.jsx)(`option`,{value:e,children:G[e]},e))})}),(0,W.jsx)(v,{children:K[g]})]}),(0,W.jsxs)(_,{required:!0,children:[(0,W.jsx)(y,{children:`Failure mode`}),(0,W.jsx)(A,{size:`sm`,children:(0,W.jsxs)(j,{value:x,onChange:e=>S(e.target.value),children:[(0,W.jsx)(`option`,{value:`FAIL_CLOSED`,children:q.FAIL_CLOSED}),(0,W.jsx)(`option`,{value:`FAIL_OPEN`,children:q.FAIL_OPEN})]})}),(0,W.jsx)(v,{children:`stream_chunk is always fail-open per contract regardless of this setting.`})]})]})}),(0,W.jsx)(C.Footer,{children:(0,W.jsxs)(a,{width:`full`,children:[(0,W.jsx)(M,{}),(0,W.jsx)(i,{variant:`ghost`,onClick:s,disabled:E,children:`Cancel`}),(0,W.jsx)(i,{colorPalette:`orange`,onClick:()=>{t===`create`?w.mutate({projectId:r,name:u,description:f||null,evaluatorId:m,direction:g,failureMode:x}):n&&T.mutate({projectId:r,id:n.id,name:u,description:f||null,evaluatorId:m,direction:g,failureMode:x})},loading:E,disabled:D,children:t===`create`?`Create`:`Save changes`})]})})]})})}var X=H(`gatewayGuardrails:view`,{layoutComponent:F})(J);export{X as default};
2
+ //# sourceMappingURL=guardrails-DAx8mDop.js.map
@@ -0,0 +1,2 @@
1
+ import{Yt as e}from"./index-8SbDirJv.js";var t=()=>void 0,n=class n extends Error{constructor(t,n,r={}){super(n),this.code=t,this.isHandled=!0;let i=e.getActiveSpan()?.spanContext();this.traceId=r.traceId??i?.traceId,this.spanId=r.spanId??i?.spanId,this.meta=r.meta??{},this.httpStatus=r.httpStatus??500,this.fault=r.fault??`customer`,this.tips=r.tips??[],this.docsUrl=r.docsUrl,this.reasons=r.reasons??[]}serialize(){let e=t(this.traceId);return{code:this.code,kind:this.code,meta:this.meta,traceId:this.traceId,spanId:this.spanId,...e?{traceUrl:e}:{},httpStatus:this.httpStatus,fault:this.fault,...this.tips.length>0?{tips:this.tips}:{},...this.docsUrl?{docsUrl:this.docsUrl}:{},reasons:this.reasons.map(a)}}static is(e){return e instanceof this}static isHandled(e){return e instanceof n||r(e)}static isUnhandled(e){return e instanceof Error&&!n.isHandled(e)}static toUserMessage(e,t){return n.isHandled(e)?e.message:(t?.(e),`An unknown error occurred`)}};function r(e){return e instanceof Error&&e.isHandled===!0}function i(e,t={}){let r=e.code??e.type;return new class extends n{constructor(){super(r,e.message,{meta:e.meta,httpStatus:t.httpStatus,fault:e.fault,tips:e.tips,docsUrl:e.docs_url,traceId:e.trace_id,spanId:e.span_id,reasons:(e.reasons??[]).map(e=>i(e))}),this.name=r}}}function a(e){if(n.isHandled(e)){let t=e.message&&e.message!==e.code&&!e.meta.message?{...e.meta,message:e.message}:e.meta;return{code:e.code,kind:e.code,fault:e.fault,...e.traceId?{traceId:e.traceId}:{},...e.spanId?{spanId:e.spanId}:{},...Object.keys(t).length>0&&{meta:t},...e.tips.length>0&&{tips:e.tips},...e.docsUrl?{docsUrl:e.docsUrl}:{},...e.reasons.length>0&&{reasons:e.reasons.map(a)}}}return{code:`unknown`,kind:`unknown`}}export{i as n,n as t};
2
+ //# sourceMappingURL=handled-error-DbmvFmFF.js.map
@@ -0,0 +1,7 @@
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./react-BUD3sqOU.js";import{a as n,dn as r,i,n as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{n as s,t as c}from"./v-stack-hkuSkmCA.js";import{Jn as l,Kn as u,Tn as d,Yn as f,qn as p}from"./ProjectAvatar-B0tbfKzY.js";import{t as m}from"./badge-Cpc3eA-C.js";import{t as h}from"./tooltip-CM-lMDNU.js";import{o as g,s as _,u as v}from"./toaster-BsYkODqs.js";import{tt as y}from"./Markdown-Cip8Rj5C.js";import{a as b,r as x}from"./field-BadoNaN5.js";import{a as S,i as C,n as w,r as T,t as E}from"./alert-CPsXih3K.js";import{d as D}from"./fetchSSE-CnJPAkno.js";import{n as O,r as k,t as A}from"./native-select-DL2k8x0o.js";import{t as j}from"./spacer-C38e7o6r.js";import{i as M,o as N,r as P,t as F}from"./tabs-B6CQXTUQ.js";import{$ as ee,et as te,tt as I}from"./immer-DImI3Uq2.js";import{n as L}from"./api-l6Cnm0vQ.js";import{c as R,l as z,u as ne}from"./variables-Dox25KUK.js";import{$n as re,Mr as B,Qn as ie,Vn as ae,Vt as oe}from"./index-8SbDirJv.js";var V=o(),H=[{value:`none`,label:`No Authentication`},{value:`bearer`,label:`Bearer Token`},{value:`api_key`,label:`API Key`},{value:`basic`,label:`Basic Auth`}];function U({value:e,onChange:t,disabled:n=!1}){let r=e?.type??`none`,i=e=>{switch(e){case`none`:t({type:`none`});break;case`bearer`:t({type:`bearer`,token:``});break;case`api_key`:t({type:`api_key`,header:`X-API-Key`,value:``});break;case`basic`:t({type:`basic`,username:``,password:``});break}};return(0,V.jsxs)(c,{align:`stretch`,gap:4,width:`full`,children:[(0,V.jsxs)(b,{children:[(0,V.jsx)(x,{children:`Auth Type`}),(0,V.jsxs)(k,{disabled:n,children:[(0,V.jsx)(A,{value:r,onChange:e=>i(e.target.value),children:H.map(e=>(0,V.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,V.jsx)(O,{})]})]}),e?.type===`bearer`&&(0,V.jsxs)(b,{children:[(0,V.jsx)(x,{children:`Token`}),(0,V.jsx)(B,{type:`password`,value:e.token,onChange:n=>t({...e,token:n.target.value}),placeholder:`Enter bearer token`,disabled:n})]}),e?.type===`api_key`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(b,{children:[(0,V.jsx)(x,{children:`Header Name`}),(0,V.jsx)(B,{value:e.header,onChange:n=>t({...e,header:n.target.value}),placeholder:`X-API-Key`,disabled:n})]}),(0,V.jsxs)(b,{children:[(0,V.jsx)(x,{children:`API Key Value`}),(0,V.jsx)(B,{type:`password`,value:e.value,onChange:n=>t({...e,value:n.target.value}),placeholder:`Enter API key`,disabled:n})]})]}),e?.type===`basic`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(b,{children:[(0,V.jsx)(x,{children:`Username`}),(0,V.jsx)(B,{value:e.username,onChange:n=>t({...e,username:n.target.value}),placeholder:`Username`,disabled:n})]}),(0,V.jsxs)(b,{children:[(0,V.jsx)(x,{children:`Password`}),(0,V.jsx)(B,{type:`password`,value:e.password,onChange:n=>t({...e,password:n.target.value}),placeholder:`Password`,disabled:n})]})]})]})}var W=[{name:`input`,description:`The user's input message to the agent`},{name:`threadId`,description:`Unique identifier for the conversation thread`},{name:`messages`,description:`Array of chat messages in OpenAI format`}];function G({value:e,onChange:t,disabled:n=!1}){return(0,V.jsxs)(c,{align:`stretch`,gap:3,width:`full`,children:[(0,V.jsx)(I,{value:e,onChange:e=>t(e.target.value),placeholder:`{
2
+ "thread_id": "{{threadId}}",
3
+ "messages": {{messages}}
4
+ }`,fontFamily:`mono`,fontSize:`13px`,minHeight:`180px`,disabled:n,resize:`vertical`,"data-testid":`body-template-editor`}),(0,V.jsxs)(r,{padding:3,bg:`bg.subtle`,borderRadius:`md`,borderWidth:`1px`,borderColor:`border`,children:[(0,V.jsx)(s,{fontSize:`xs`,fontWeight:`medium`,color:`fg.muted`,marginBottom:2,children:`Available Variables`}),(0,V.jsx)(c,{align:`stretch`,gap:1,children:W.map(e=>(0,V.jsxs)(s,{fontSize:`xs`,children:[(0,V.jsx)(f,{fontSize:`xs`,colorPalette:`blue`,children:`{{${e.name}}}`}),` `,`— `,e.description]},e.name))})]})]})}function K({value:e,onChange:t,disabled:n=!1}){let r=()=>{t([...e,{key:``,value:``}])},o=n=>{t(e.filter((e,t)=>t!==n))},l=(n,r,i)=>{let a=[...e],o=a[n];o&&(a[n]={...o,[r]:i},t(a))};return(0,V.jsxs)(c,{align:`stretch`,gap:3,width:`full`,children:[(0,V.jsxs)(a,{width:`full`,children:[(0,V.jsx)(s,{fontSize:`xs`,fontWeight:`bold`,textTransform:`uppercase`,color:`fg.muted`,children:`Custom Headers`}),(0,V.jsx)(j,{}),!n&&(0,V.jsxs)(i,{size:`xs`,variant:`outline`,onClick:r,"data-testid":`add-header-button`,children:[(0,V.jsx)(ie,{size:14}),`Add Header`]})]}),e.length===0?(0,V.jsx)(s,{fontSize:`13px`,color:`fg.subtle`,textAlign:`center`,paddingY:4,children:`No custom headers defined`}):(0,V.jsx)(c,{align:`stretch`,gap:2,children:e.map((e,t)=>(0,V.jsxs)(a,{gap:2,children:[(0,V.jsx)(B,{value:e.key,onChange:e=>l(t,`key`,e.target.value),placeholder:`Header name`,size:`sm`,flex:1,disabled:n,"data-testid":`header-key-${t}`}),(0,V.jsx)(B,{value:e.value,onChange:e=>l(t,`value`,e.target.value),placeholder:`Header value`,size:`sm`,flex:2,disabled:n,"data-testid":`header-value-${t}`}),!n&&(0,V.jsx)(h,{content:`Remove header`,positioning:{placement:`top`},children:(0,V.jsx)(i,{size:`xs`,variant:`ghost`,colorPalette:`gray`,onClick:()=>o(t),color:`fg.subtle`,"data-testid":`remove-header-${t}`,children:(0,V.jsx)(ae,{size:14})})})]},t))})]})}var q=e(t());function J({value:e,onChange:t,disabled:n=!1}){return(0,V.jsxs)(k,{size:`sm`,width:`100px`,disabled:n,children:[(0,V.jsx)(A,{value:e,onChange:e=>t(e.target.value),fontWeight:`medium`,color:`blue.600`,children:D.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))}),(0,V.jsx)(O,{})]})}function se({message:e,index:t,onChange:n,onRemove:i,disabled:o,canRemove:s}){return(0,V.jsxs)(r,{width:`full`,children:[(0,V.jsxs)(a,{width:`full`,paddingBottom:2,children:[(0,V.jsx)(z,{role:e.role}),(0,V.jsx)(j,{}),s&&(0,V.jsx)(R,{onRemove:i,disabled:o})]}),(0,V.jsx)(I,{value:e.content,onChange:t=>n({...e,content:t.target.value}),placeholder:e.role===`user`?`Enter user message...`:`Enter assistant response...`,fontSize:`sm`,minHeight:`80px`,resize:`vertical`,disabled:o})]})}function ce({messages:e,onChange:t,disabled:n=!1}){let i=(0,q.useCallback)((n,r)=>{let i=[...e];i[n]=r,t(i)},[e,t]),o=(0,q.useCallback)(n=>{t(e.filter((e,t)=>t!==n))},[e,t]),l=(0,q.useCallback)(n=>{t([...e,{role:n,content:``}])},[e,t]);return(0,V.jsxs)(c,{align:`stretch`,gap:3,width:`full`,children:[(0,V.jsxs)(a,{width:`full`,children:[(0,V.jsx)(s,{fontSize:`xs`,color:`fg.muted`,marginBottom:2,children:(0,V.jsx)(f,{fontSize:`xs`,children:`{{messages}}`})}),(0,V.jsx)(j,{}),(0,V.jsx)(ne,{onAdd:l})]}),(0,V.jsx)(r,{padding:4,bg:`bg.subtle`,borderRadius:`md`,borderWidth:`1px`,borderColor:`border`,children:e.map((t,r)=>(0,V.jsx)(se,{message:t,index:r,onChange:e=>i(r,e),onRemove:()=>o(r),disabled:n,canRemove:e.length>1},r))})]})}function le(e){return JSON.stringify(e.map(e=>({role:e.role,content:e.content})))}var ue=`test-thread-123`,de=[{role:`user`,content:`Hello`}];function fe(e,t){let n=e;for(let[e,r]of Object.entries(t))n=n.replace(RegExp(`\\{\\{${e}\\}\\}`,`g`),r);return n}function pe(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}function me(e){return e>=200&&e<300?`green`:e>=300&&e<400?`blue`:e>=400&&e<500?`orange`:`red`}function Y({text:e,label:t=`Copy`}){let[n,r]=(0,q.useState)(!1);return(0,V.jsx)(h,{content:n?`Copied!`:t,children:(0,V.jsx)(i,{variant:`ghost`,size:`xs`,onClick:async()=>{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},padding:1,minWidth:`auto`,children:n?(0,V.jsx)(_,{size:14}):(0,V.jsx)(g,{size:14})})})}function X({title:e,defaultOpen:t=!1,children:n,badge:i}){let[o,c]=(0,q.useState)(t);return(0,V.jsxs)(p,{open:o,onOpenChange:({open:e})=>c(e),children:[(0,V.jsx)(l,{asChild:!0,children:(0,V.jsxs)(a,{gap:2,width:`full`,mb:2,children:[o?(0,V.jsx)(te,{size:14}):(0,V.jsx)(ee,{size:14}),(0,V.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,children:e}),i]})}),(0,V.jsx)(u,{children:(0,V.jsx)(r,{paddingLeft:6,paddingY:2,children:n})})]})}function he({url:e,method:t,headers:n,body:i}){return(0,V.jsx)(X,{title:`Request Preview`,defaultOpen:!0,children:(0,V.jsxs)(c,{align:`stretch`,gap:2,fontSize:`sm`,children:[(0,V.jsxs)(a,{children:[(0,V.jsx)(m,{colorPalette:`blue`,children:t??`POST`}),(0,V.jsx)(s,{fontFamily:`mono`,fontSize:`xs`,wordBreak:`break-all`,children:e??`No URL configured`})]}),n&&n.length>0&&(0,V.jsxs)(r,{children:[(0,V.jsx)(s,{fontWeight:`medium`,fontSize:`xs`,color:`fg.muted`,children:`Headers:`}),(0,V.jsx)(r,{as:`pre`,fontSize:`xs`,fontFamily:`mono`,bg:`bg.subtle`,padding:2,borderRadius:`md`,overflow:`auto`,children:n.map(e=>`${e.key}: ${e.value}`).join(`
5
+ `)})]}),(0,V.jsxs)(r,{children:[(0,V.jsxs)(a,{justify:`space-between`,children:[(0,V.jsx)(s,{fontWeight:`medium`,fontSize:`xs`,color:`fg.muted`,children:`Body (rendered):`}),(0,V.jsx)(Y,{text:i,label:`Copy body`})]}),(0,V.jsx)(r,{as:`pre`,fontSize:`xs`,fontFamily:`mono`,bg:`bg.subtle`,padding:2,borderRadius:`md`,overflow:`auto`,maxHeight:`150px`,whiteSpace:`pre-wrap`,children:i})]})]})})}function Z({result:e}){let t=typeof e.response==`string`?e.response:JSON.stringify(e.response,null,2);return(0,V.jsxs)(c,{align:`stretch`,gap:3,children:[(e.status!==void 0||e.duration!==void 0||t)&&(0,V.jsxs)(a,{justify:`space-between`,padding:3,bg:e.success?`green.50`:`red.50`,borderRadius:`md`,borderWidth:`1px`,borderColor:e.success?`green.200`:`red.200`,children:[(0,V.jsxs)(a,{gap:3,children:[e.status!==void 0&&(0,V.jsxs)(m,{colorPalette:me(e.status),size:`lg`,children:[e.status,` `,e.statusText??``]}),e.duration!==void 0&&(0,V.jsxs)(a,{gap:1,color:`fg.muted`,fontSize:`sm`,children:[(0,V.jsx)(d,{size:14}),(0,V.jsx)(s,{children:pe(e.duration)})]})]}),t&&(0,V.jsx)(Y,{text:t,label:`Copy response`})]}),e.error&&(0,V.jsxs)(C,{status:`error`,children:[(0,V.jsx)(T,{children:(0,V.jsx)(v,{size:16})}),(0,V.jsxs)(E,{children:[(0,V.jsx)(S,{children:`Error`}),(0,V.jsx)(w,{fontFamily:`mono`,fontSize:`sm`,children:e.error})]})]}),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&(0,V.jsx)(X,{title:`Response Headers`,children:(0,V.jsx)(r,{as:`pre`,fontSize:`xs`,fontFamily:`mono`,bg:`bg.subtle`,padding:2,borderRadius:`md`,overflow:`auto`,children:Object.entries(e.responseHeaders).map(([e,t])=>`${e}: ${t}`).join(`
6
+ `)})}),e.response!==void 0&&(0,V.jsx)(X,{title:`Response Body`,defaultOpen:!0,children:(0,V.jsx)(r,{as:`pre`,fontSize:`xs`,fontFamily:`mono`,bg:`bg.subtle`,padding:3,borderRadius:`md`,overflow:`auto`,maxHeight:`300px`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,children:t})}),e.extractedOutput!==void 0&&(0,V.jsxs)(r,{padding:3,bg:`blue.50`,borderRadius:`md`,borderWidth:`1px`,borderColor:`blue.200`,children:[(0,V.jsxs)(a,{justify:`space-between`,marginBottom:2,children:[(0,V.jsx)(s,{fontSize:`sm`,fontWeight:`medium`,color:`blue.700`,children:`Extracted Output (JSONPath)`}),(0,V.jsx)(Y,{text:e.extractedOutput,label:`Copy extracted output`})]}),(0,V.jsx)(r,{as:`pre`,fontSize:`sm`,fontFamily:`mono`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,children:e.extractedOutput})]}),e.success&&e.response!==void 0&&e.extractedOutput===void 0&&(0,V.jsxs)(C,{status:`warning`,children:[(0,V.jsx)(T,{}),(0,V.jsxs)(E,{children:[(0,V.jsx)(S,{children:`JSONPath extraction returned no results`}),(0,V.jsx)(w,{children:`Check that your output path matches the response structure.`})]})]})]})}function Q({onTest:e,disabled:t=!1,url:o,method:l,headers:u,outputPath:d,bodyTemplate:p}){let[m,h]=(0,q.useState)(ue),[g,_]=(0,q.useState)(de),[D,O]=(0,q.useState)(!1),[k,A]=(0,q.useState)(null),j=(0,q.useMemo)(()=>le(g),[g]),M=(0,q.useMemo)(()=>p?fe(p,{threadId:m,messages:j}):`{}`,[p,m,j]),N=(0,q.useMemo)(()=>{try{return JSON.parse(M),{valid:!0,error:null}}catch(e){return{valid:!1,error:e instanceof Error?e.message:`Invalid JSON`}}},[M]),P=(0,q.useMemo)(()=>{if(!u)return{valid:!0,errors:[]};let e=[];for(let t of u){let n=t.key.trim();t.key!==n&&e.push(`Header "${t.key}" has leading/trailing whitespace`),n||e.push(`Empty header name`)}return{valid:e.length===0,errors:e}},[u]),F=(0,q.useCallback)(async()=>{O(!0),A(null);try{A(await e(M))}catch(e){A({success:!1,error:e instanceof Error?e.message:`Unknown error`})}finally{O(!1)}},[M,e]);return(0,V.jsxs)(c,{align:`stretch`,gap:4,width:`full`,children:[(0,V.jsxs)(c,{align:`stretch`,gap:4,children:[(0,V.jsx)(b,{children:(0,V.jsxs)(a,{width:`full`,children:[(0,V.jsx)(x,{fontSize:`xs`,children:(0,V.jsx)(f,{fontSize:`xs`,children:`{{threadId}}`})}),(0,V.jsx)(B,{value:m,onChange:e=>h(e.target.value),placeholder:`test-thread-123`,size:`sm`,fontFamily:`mono`,fontSize:`sm`})]})}),(0,V.jsx)(ce,{messages:g,onChange:_,disabled:t})]}),(0,V.jsx)(y,{}),(0,V.jsx)(he,{url:o,method:l,headers:u,body:M}),(0,V.jsx)(y,{}),!N.valid&&(0,V.jsxs)(C,{status:`error`,children:[(0,V.jsx)(T,{children:(0,V.jsx)(v,{size:16})}),(0,V.jsxs)(E,{children:[(0,V.jsx)(S,{children:`Invalid JSON in body template`}),(0,V.jsx)(w,{fontFamily:`mono`,fontSize:`sm`,children:N.error})]})]}),!P.valid&&(0,V.jsxs)(C,{status:`warning`,children:[(0,V.jsx)(T,{}),(0,V.jsxs)(E,{children:[(0,V.jsx)(S,{children:`Header Issues`}),(0,V.jsx)(w,{children:(0,V.jsx)(c,{align:`start`,gap:1,children:P.errors.map((e,t)=>(0,V.jsx)(s,{fontSize:`sm`,children:e},t))})})]})]}),d&&(0,V.jsx)(r,{fontSize:`sm`,color:`fg.muted`,children:(0,V.jsxs)(s,{children:[`Output will be extracted using JSONPath:`,` `,(0,V.jsx)(f,{fontSize:`sm`,children:d})]})}),(0,V.jsx)(a,{justify:`flex-end`,children:(0,V.jsxs)(i,{colorPalette:`blue`,onClick:F,disabled:t||D||!o||!N.valid,size:`sm`,children:[D?(0,V.jsx)(n,{size:`sm`}):(0,V.jsx)(re,{size:16}),`Send Request`]})}),k&&(0,V.jsx)(Z,{result:k})]})}function $({value:e,onChange:t,disabled:n=!1}){return(0,V.jsxs)(c,{align:`stretch`,gap:1,width:`full`,children:[(0,V.jsx)(B,{value:e,onChange:e=>t(e.target.value),placeholder:`$.choices[0].message.content`,fontFamily:`mono`,fontSize:`13px`,disabled:n}),(0,V.jsx)(s,{fontSize:`xs`,color:`fg.muted`,children:`Path to extract the agent response from the API response.`}),(0,V.jsx)(s,{fontSize:`xs`,color:`yellow.500`,children:`Note: HTTP Agents must return text.`})]})}function ge({url:e,onUrlChange:t,method:n,onMethodChange:i,bodyTemplate:o,onBodyTemplateChange:l,outputPath:u,onOutputPathChange:d,auth:f,onAuthChange:p,headers:m,onHeadersChange:h,onTest:g,paddingX:_=4}){let[v,y]=(0,q.useState)(`body`);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(r,{paddingX:_,children:(0,V.jsxs)(c,{align:`stretch`,gap:2,width:`full`,children:[(0,V.jsx)(s,{fontWeight:`medium`,fontSize:`sm`,children:`Endpoint`}),(0,V.jsxs)(a,{gap:2,children:[(0,V.jsx)(J,{value:n,onChange:i}),(0,V.jsx)(B,{flex:1,value:e,onChange:e=>t(e.target.value),placeholder:`https://api.example.com/endpoint`,fontFamily:`mono`,fontSize:`13px`,size:`sm`})]})]})}),(0,V.jsxs)(M,{value:v,onValueChange:e=>y(e.value),width:`full`,colorPalette:`blue`,children:[(0,V.jsxs)(P,{paddingX:_,borderBottomWidth:`1px`,borderColor:`border`,children:[(0,V.jsx)(N,{value:`body`,children:`Body`}),(0,V.jsx)(N,{value:`auth`,children:`Auth`}),(0,V.jsx)(N,{value:`headers`,children:`Headers`}),(0,V.jsx)(N,{value:`test`,children:`Test`})]}),(0,V.jsx)(F,{value:`body`,paddingX:_,paddingY:3,children:(0,V.jsxs)(c,{gap:4,align:`stretch`,children:[(0,V.jsxs)(b,{children:[(0,V.jsx)(x,{fontSize:`sm`,children:`Request Body Template`}),(0,V.jsx)(G,{value:o,onChange:l})]}),(0,V.jsxs)(b,{children:[(0,V.jsx)(x,{fontSize:`sm`,children:`Output Path (JSONPath)`}),(0,V.jsx)($,{value:u,onChange:d})]})]})}),(0,V.jsx)(F,{value:`auth`,paddingX:_,paddingY:3,children:(0,V.jsx)(U,{value:f,onChange:p})}),(0,V.jsx)(F,{value:`headers`,paddingX:_,paddingY:3,children:(0,V.jsx)(K,{value:m,onChange:h})}),(0,V.jsx)(F,{value:`test`,paddingX:_,paddingY:3,children:(0,V.jsx)(Q,{onTest:g,url:e,method:n,headers:m,outputPath:u,bodyTemplate:o})})]})]})}function _e({url:e,method:t,headers:n,auth:r,outputPath:i}){let{project:a}=oe(),o=L.httpProxy.execute.useMutation();return{handleTest:(0,q.useCallback)(async s=>{if(!a?.id)return{success:!1,error:`No project selected`};try{let c=await o.mutateAsync({projectId:a.id,url:e,method:t,headers:n.map(e=>({key:e.key,value:e.value})),auth:r?{type:r.type,token:r.type===`bearer`?r.token:void 0,headerName:r.type===`api_key`?r.header:void 0,apiKeyValue:r.type===`api_key`?r.value:void 0,username:r.type===`basic`?r.username:void 0,password:r.type===`basic`?r.password:void 0}:void 0,body:s,outputPath:i});return{success:c.success,response:c.response,extractedOutput:c.extractedOutput,error:c.error,status:c.status,duration:c.duration,responseHeaders:c.responseHeaders}}catch(e){return{success:!1,error:e instanceof Error?e.message:`Test request failed`}}},[a?.id,e,t,n,r,i,o]),isPending:o.isPending}}export{J as a,U as c,Q as i,ge as n,K as o,$ as r,G as s,_e as t};
7
+ //# sourceMappingURL=http-C64lOZI7.js.map
@@ -0,0 +1,2 @@
1
+ import{dn as e,i as t,n}from"./portal-Sdfvrza9.js";import{t as r}from"./jsx-runtime-CFwixLRt.js";import{n as i}from"./v-stack-hkuSkmCA.js";import{s as a}from"./shikiAdapter-Ctbe7cQu.js";import{I as o}from"./Markdown-Cip8Rj5C.js";import{et as s}from"./immer-DImI3Uq2.js";import{t as c}from"./braces-DdQzhQOf.js";import{t as l}from"./hash-Ci9P85W2.js";import{t as u}from"./image-C5YGAaF3.js";import{t as d}from"./type-DJLCeacc.js";import{Gn as f,ir as p}from"./index-8SbDirJv.js";var m=r(),h=({type:e,size:t=16})=>{let n={size:t,strokeWidth:2.5,color:`var(--chakra-colors-gray-500)`};switch(e){case`str`:case`string`:return(0,m.jsx)(d,{...n});case`float`:case`int`:case`number`:return(0,m.jsx)(l,{...n});case`bool`:case`boolean`:return(0,m.jsx)(f,{...n});case`list`:case`list[str]`:case`list[float]`:case`list[int]`:case`list[bool]`:return(0,m.jsx)(p,{...n});case`dict`:case`json`:case`json_schema`:return(0,m.jsx)(c,{...n});case`chat_messages`:return(0,m.jsx)(a,{...n});case`image`:return(0,m.jsx)(u,{...n});default:return(0,m.jsx)(d,{...n})}},g={str:`Text`,string:`Text`,float:`Number`,int:`Number`,number:`Number`,bool:`Boolean`,boolean:`Boolean`,image:`Image`,list:`List`,"list[str]":`List`,"list[float]":`List`,"list[int]":`List`,"list[bool]":`List`,dict:`Object`,json:`Object`,json_schema:`JSON Schema`,chat_messages:`Messages`},_=e=>g[e]??e,v=({type:t,size:n=`sm`})=>{let r=_(t);return(0,m.jsx)(e,{as:`span`,fontSize:n===`xs`?`10px`:`11px`,fontWeight:`medium`,color:`fg.muted`,bg:`bg.muted`,borderRadius:`4px`,padding:n===`xs`?`2px 4px`:`2px 6px`,fontFamily:`mono`,whiteSpace:`nowrap`,children:r})},y=({value:e,options:r,onChange:a,readOnly:c=!1,testId:l})=>c?(0,m.jsxs)(n,{gap:1,flexShrink:0,paddingX:1,"data-testid":l,children:[(0,m.jsx)(h,{type:e,size:14}),(0,m.jsx)(i,{fontSize:`13px`,color:`fg.muted`,children:_(e)})]}):(0,m.jsxs)(o.Root,{children:[(0,m.jsx)(o.Trigger,{asChild:!0,children:(0,m.jsxs)(t,{size:`xs`,variant:`outline`,colorPalette:`gray`,flexShrink:0,gap:1,paddingX:2,fontWeight:`normal`,"data-testid":l,children:[(0,m.jsx)(h,{type:e,size:14}),(0,m.jsx)(i,{fontSize:`13px`,children:_(e)}),(0,m.jsx)(s,{size:12,color:`var(--chakra-colors-fg-muted)`})]})}),(0,m.jsx)(o.Content,{portalled:!1,children:r.map(e=>(0,m.jsx)(o.Item,{value:e.value,onClick:()=>a(e.value),"data-testid":`field-type-option-${e.value}`,children:(0,m.jsxs)(n,{gap:2,children:[(0,m.jsx)(h,{type:e.value,size:14}),(0,m.jsx)(i,{children:e.label})]})},e.value))})]}),b=e=>e.replace(/ /g,`_`).replace(/[^a-zA-Z0-9_]/g,``).toLowerCase(),x=(e,t)=>{if(!t.includes(e))return e;let n=1;for(;t.includes(`${e}_${n}`);)n++;return`${e}_${n}`};export{v as a,g as i,b as n,h as o,y as r,_ as s,x as t};
2
+ //# sourceMappingURL=identifierUtils-C2FgAR6z.js.map
@@ -0,0 +1,14 @@
1
+ import{o as e,t}from"./rolldown-runtime-DAXXjFlN.js";import{t as n}from"./react-BUD3sqOU.js";import{dn as r,jn as i,sn as a}from"./portal-Sdfvrza9.js";import{t as o}from"./jsx-runtime-CFwixLRt.js";import{d as s}from"./toaster-BsYkODqs.js";import{t as c}from"./field-uFetMRUQ.js";import{f as l,p as u}from"./trpcError-CFsR-0nB.js";import{Q as d}from"./index-8SbDirJv.js";import{n as f,t as p}from"./OpenAI-DFYm1n1s.js";var{withContext:m,PropsProvider:ee}=a({key:`textarea`}),te=m(c.Textarea),ne=s(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),re=s(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ie=s(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),ae=s(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),oe=s(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),se=s(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),h=e(n()),g=o(),ce=140,le=1500,ue=4e3;function de(e){let t=e.trim();if(!t||t.includes(`+`))return null;switch(t.toLowerCase()){case`esc`:return`Escape`;case`enter`:case`return`:return`Enter`;case`space`:return` `;case`tab`:return`Tab`;case`↑`:return`ArrowUp`;case`↓`:return`ArrowDown`;case`←`:return`ArrowLeft`;case`→`:return`ArrowRight`;default:return t.length===1?t:null}}function fe(e){return typeof e==`string`?e:typeof e==`number`?String(e):Array.isArray(e)?e.map(fe).join(``):``}function pe({children:e,demo:t=!1,demoEveryMs:n=ue,demoFirstDelayMs:i=le}){let[a,o]=(0,h.useState)(!1),[s,c]=(0,h.useState)(!1),l=(0,h.useRef)(null),u=(0,h.useMemo)(()=>de(fe(e)),[e]),d=()=>{o(!0),l.current!=null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{o(!1),l.current=null},ce)};return(0,h.useEffect)(()=>{if(!u)return;let e=u.length===1?u.toLowerCase():u,t=t=>{t.ctrlKey||t.metaKey||t.altKey||(t.key.length===1?t.key.toLowerCase():t.key)===e&&(c(!0),d())};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[u]),(0,h.useEffect)(()=>{if(!t||s)return;let e=null,r=window.setTimeout(()=>{d(),e=window.setInterval(d,n)},i);return()=>{window.clearTimeout(r),e!=null&&window.clearInterval(e)}},[t,s,n,i]),(0,h.useEffect)(()=>()=>{l.current!=null&&window.clearTimeout(l.current)},[]),(0,g.jsx)(r,{as:`kbd`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,paddingX:1,height:`15px`,minWidth:`15px`,borderRadius:`sm`,border:`1px solid`,borderColor:a?`blue.solid`:`border`,bg:a?`blue.subtle`:`bg.surface`,fontSize:`2xs`,fontFamily:`mono`,color:a?`blue.fg`:`fg.muted`,transform:a?`translateY(1px) scale(0.94)`:`translateY(0) scale(1)`,boxShadow:a?`none`:`0 1px 0 var(--chakra-colors-border-muted)`,transition:`transform 0.08s ease, background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.08s ease`,children:e})}var me=`application/x-langy-context`;function he(e){let t=e?.getData(me);if(!t)return null;try{let e=JSON.parse(t);if(typeof e==`object`&&e&&typeof e.id==`string`&&typeof e.label==`string`)return e}catch{}return null}var ge=2600,_e=30,ve=15e3,_=null;function ye(){_&&clearTimeout(_),_=setTimeout(()=>{_=null,v.getState().clearReveal()},ge)}function be(e,t){return e.kind===t.kind&&e.label===t.label&&e.ref===t.ref}var v=u()(e=>({targets:{},picked:[],activeChipIds:new Set,revealedIds:new Set,pendingReveal:null,nearIds:new Set,hoveredId:null,spotlightId:null,absorbFlash:null,armSource:null,setSpotlight:t=>e(e=>e.spotlightId===t?e:{spotlightId:t}),flashAbsorb:t=>e(e=>({absorbFlash:{id:t,nonce:(e.absorbFlash?.nonce??0)+1}})),clearAbsorbFlash:t=>e(e=>e.absorbFlash?.nonce===t?{absorbFlash:null}:e),arm:t=>e(e=>e.armSource===t?e:{armSource:t}),disarm:t=>e(e=>e.armSource===null||t&&e.armSource!==t?e:{armSource:null,nearIds:new Set,hoveredId:null}),toggleArm:()=>e(e=>e.armSource===null?{armSource:`key`}:{armSource:null,nearIds:new Set,hoveredId:null}),register:t=>e(e=>{let n=e.targets[t.id];if(n&&be(n,t))return e;let r={...e.targets,[t.id]:t},i=e.pendingReveal;if(i&&Date.now()-i.requestedAt>ve)return{targets:r,pendingReveal:null};if(i&&i.kind===t.kind&&e.revealedIds.size<_e){ye();let n=new Set(e.revealedIds);return n.add(t.id),{targets:r,revealedIds:n}}return{targets:r}}),unregister:t=>e(e=>{if(!(t in e.targets))return e;let n={...e.targets};return delete n[t],{targets:n}}),pick:t=>e(e=>e.picked.some(e=>e.id===t.id)?e:{picked:[...e.picked,t]}),unpick:t=>e(e=>e.picked.some(e=>e.id===t)?{picked:e.picked.filter(e=>e.id!==t)}:e),clearPicked:()=>e(e=>e.picked.length===0?e:{picked:[]}),requestReveal:({kind:t})=>e(e=>{let n=Object.values(e.targets).filter(e=>e.kind===t).slice(0,_e).map(e=>e.id);return n.length>0?(ye(),{revealedIds:new Set(n),pendingReveal:null}):{pendingReveal:{kind:t,requestedAt:Date.now()}}}),holdReveal:()=>{_&&ye()},clearReveal:()=>e(e=>e.revealedIds.size===0&&e.pendingReveal===null?e:{revealedIds:new Set,pendingReveal:null}),setActiveChipIds:t=>e(e=>t.length===e.activeChipIds.size&&t.every(t=>e.activeChipIds.has(t))?e:{activeChipIds:new Set(t)}),setProximity:({nearIds:t,hoveredId:n})=>e(e=>t.length===e.nearIds.size&&t.every(t=>e.nearIds.has(t))&&n===e.hoveredId?e:{nearIds:new Set(t),hoveredId:n}),reset:()=>{_&&=(clearTimeout(_),null),e({targets:{},picked:[],activeChipIds:new Set,revealedIds:new Set,pendingReveal:null,nearIds:new Set,hoveredId:null,spotlightId:null,armSource:null})}}));d.subscribe((e,t)=>{if(e.activeConversationScope!==t.activeConversationScope){v.getState().reset();return}e.conversationEpoch!==t.conversationEpoch&&v.getState().clearPicked()});function xe(e){v.getState().pick(e),v.getState().flashAbsorb(e.id),d.getState().chooseChip(e.id),d.getState().dismissContextHint()}function Se(e){v.getState().unpick(e),d.getState().dismissChip(e)}var Ce=11e3,we=Object.freeze({});function Te(e){let t=e?.id,n=e?.kind,r=e?.label,i=e?.ref,a=(e?.enabled??!0)&&!!t&&!!n&&!!r,o=v(e=>e.register),s=v(e=>e.unregister),c=v(e=>a&&t?e.activeChipIds.has(t):!1),l=v(e=>a&&t?e.revealedIds.has(t):!1),u=v(e=>e.armSource!==null),d=v(e=>a&&t?e.hoveredId===t:!1);(0,h.useEffect)(()=>{if(!(!a||!t||!n||!r))return o({id:t,kind:n,label:r,ref:i}),()=>s(t)},[a,t,n,r,i,o,s]);let f=(0,h.useCallback)(()=>{!t||!n||!r||(v.getState().activeChipIds.has(t)?Se(t):xe({id:t,kind:n,label:r,ref:i}))},[t,n,r,i]),p=(0,h.useCallback)(e=>{!t||!n||!r||(e.dataTransfer.setData(me,JSON.stringify({id:t,kind:n,label:r,ref:i})),e.dataTransfer.setData(`text/plain`,r),e.dataTransfer.effectAllowed=`copy`)},[t,n,r,i]),m=(0,h.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),f()},[f]),ee=u||l;return{targetProps:(0,h.useMemo)(()=>!a||!t?we:ee?{className:`langy-target`,style:Ee(t),"data-langy-target":t,"data-langy-target-state":De({isAdded:c,isHovered:d,isNear:!0}),draggable:!0,onDragStart:p,onClickCapture:m}:{"data-langy-target":t},[a,t,ee,c,d,p,m]),isActive:a,isAdded:c,toggle:f}}function Ee(e){return{"--langy-target-delay":`-${Oe(e)}ms`}}function De({isAdded:e,isHovered:t,isNear:n}){if(e)return`added`;if(t)return`hover`;if(n)return`near`}function Oe(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)%Ce}function ke(e){let t=[],n=new Set;for(let r of e)!r||n.has(r.id)||(n.add(r.id),t.push(r));return t}function y(e){return e.length<=10?e:`${e.slice(0,6)}…${e.slice(-2)}`}function Ae(e,t){let n=t?.trim();return{id:`trace:${e}`,kind:`trace`,label:n?`Trace · ${n}`:`Trace · ${y(e)}`,ref:e}}function je({datasetId:e,name:t}){return{id:`dataset:${e}`,kind:`dataset`,label:t?`dataset: ${t}`:`dataset ${y(e)}`,ref:e}}function b({kind:e,noun:t,id:n,name:r,ref:i}){let a=r?.trim();return{id:`${e}:${n}`,kind:e,label:a?`${t}: ${a}`:`${t} ${y(n)}`,ref:i??n}}function Me({workflowId:e,name:t}){return b({kind:`workflow`,noun:`workflow`,id:e,name:t})}function Ne({agentId:e,name:t}){return b({kind:`agent`,noun:`agent`,id:e,name:t})}function Pe({automationId:e,name:t}){return b({kind:`automation`,noun:`automation`,id:e,name:t})}function Fe({annotationId:e,name:t,noun:n=`annotation`}){return b({kind:`annotation`,noun:n,id:e,name:t})}function Ie({evaluationId:e,name:t,noun:n=`evaluation`}){return b({kind:`evaluation`,noun:n,id:e,name:t})}function Le({scenarioId:e,name:t,noun:n=`simulation`}){return b({kind:`scenario`,noun:n,id:e,name:t})}function Re({slug:e,name:t}){return b({kind:`experiment`,noun:`experiment`,id:e,name:t})}function ze({dashboardId:e,name:t}){return b({kind:`dashboard`,noun:`dashboard`,id:e,name:t})}function Be({promptId:e,handle:t}){return{id:`prompt:${e}`,kind:`prompt`,label:t?`prompt: ${t}`:`prompt ${y(e)}`,ref:t??e}}var x=l(`langwatch:use-sse-subscription`);function Ve(e,t,n={}){let{enabled:r=!0,onData:i,onError:a,onStarted:o,onStopped:s,onConnected:c,onDisconnected:l}=n,[u,d]=(0,h.useState)(r?`connecting`:`disconnected`),f=(0,h.useRef)(void 0),p=(0,h.useRef)(void 0),m=(0,h.useRef)(!1);return x.debug({enabled:r,input:t},`SSE subscription hook initialized`),e.useSubscription(t,{enabled:r,onStarted:()=>{m.current=!0,d(`connected`),x.info({input:t},`SSE subscription started`),o?.(),c?.()},onData:e=>{m.current||(m.current=!0,d(`connected`),x.info({input:t},`SSE subscription connected via first event`),c?.()),f.current=e,x.debug({input:t,data:typeof e},`SSE data received`),i?.(e)},onError:e=>{m.current=!1,p.current=e,d(`error`),x.error({input:t,error:e.message},`SSE subscription error`),a?.(e)},onStopped:()=>{m.current=!1,d(`disconnected`),x.info({input:t},`SSE subscription stopped`),s?.(),l?.()}}),(0,h.useEffect)(()=>{r?(d(e=>e===`disconnected`?`connecting`:e),x.debug({input:t},`SSE subscription enabled`)):(m.current=!1,d(`disconnected`),x.debug({input:t},`SSE subscription disabled`))},[r]),{connectionState:u,retryCount:0,lastData:f.current,lastError:p.current,isConnected:u===`connected`,isConnecting:u===`connecting`,hasError:u===`error`,isDisconnected:u===`disconnected`}}var He=e(i(),1);function Ue(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function S(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function We(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Ge=(e,t)=>Math.abs(e-t)<1.01,Ke=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},C,qe=()=>{if(C!==void 0)return C;if(typeof navigator>`u`)return C=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return C=!0;let e=navigator.maxTouchPoints;return C=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Je=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Ye=e=>e,Xe=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Ze=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Je(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Je(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},w={passive:!0},Qe=typeof window>`u`?!0:`onscrollend`in window,$e=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Qe,o=0,s=a?null:Ke(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,w),a&&r.addEventListener(`scrollend`,u,w),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},et=(e,t)=>$e(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),tt=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},nt=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},rt=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ye,rangeExtractor:Xe,onChange:()=>{},measureElement:tt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=S(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!qe()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,w),e.addEventListener(`touchend`,n,w),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(qe()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=S(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=S(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=Ue(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),ee=l+m;u[i]={index:i,start:l,size:m,end:ee,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=S(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=ot(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=S(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=S(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return We(t[it(0,t.length-1,r?e=>n[e*2]:e=>We(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(qe()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Ge(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},it=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function at(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function ot(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=at(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=it(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var st=typeof document<`u`?h.useLayoutEffect:h.useEffect;function ct({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=h.useReducer(e=>e+1,0)[1],a=h.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}let r=!!e.options.horizontal,i=t.mode===`transform`,o=r?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let n of c){let a=n.start-s,c=e.elementsCache.get(n.key);c&&t.lastPositions.get(c)!==a&&(t.lastPositions.set(c,a),i?c.style.transform=r?`translate3d(${a}px, 0, 0)`:`translate3d(0, ${a}px, 0)`:c.style[o]=`${a}px`)}},s={...r,onChange:(t,n)=>{var s;let c=a.current,l=!0;if(c.enabled){o(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,He.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[c]=h.useState(()=>{let e=new rt(s);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return c.setOptions(s),st(()=>c._didMount(),[]),st(()=>c._willUpdate()),st(()=>{o(c)}),c}function lt(e){return ct({observeElementRect:Ze,observeElementOffset:et,scrollToFn:nt,...e})}var ut=1500;function dt(){let[e,t]=(0,h.useState)(!1),n=(0,h.useRef)(null),r=(0,h.useRef)(!0),i=(0,h.useCallback)(()=>{n.current!==null&&(clearTimeout(n.current),n.current=null)},[]);return(0,h.useEffect)(()=>(r.current=!0,()=>{r.current=!1,i()}),[i]),{copied:e,copy:(0,h.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{r.current&&(t(!0),i(),n.current=setTimeout(()=>{t(!1),n.current=null},ut))}).catch(()=>{})},[i])}}var ft=h.forwardRef(function({children:e,...t},n){return(0,g.jsx)(r,{as:`span`,display:`inline-flex`,ref:n,...t,children:e})}),pt=t((e=>{e.__esModule=void 0,e.__esModule=!0;var t=typeof Object.setPrototypeOf==`function`,n=typeof Object.getPrototypeOf==`function`,r=typeof Object.defineProperty==`function`,i=typeof Object.create==`function`,a=typeof Object.prototype.hasOwnProperty==`function`;e.setPrototypeOf=function(e,n){t?Object.setPrototypeOf(e,n):e.__proto__=n},e.getPrototypeOf=function(e){return n?Object.getPrototypeOf(e):e.__proto__||e.prototype};var o=!1;e.defineProperty=function e(t,n,i){if(r&&!o)try{Object.defineProperty(t,n,i)}catch{o=!0,e(t,n,i)}else t[n]=i.value};var s=function(e,t){return a?e.hasOwnProperty(e,t):e[t]===void 0};e.hasOwnProperty=s,e.objectCreate=function(e,t){if(i)return Object.create(e,t);var n=function(){};n.prototype=e;var r=new n;if(t===void 0)return r;if(typeof t==`object`)for(var a in t)s(t,a)&&(r[a]=t[a].value);return r}})),mt=t((e=>{e.__esModule=void 0,e.__esModule=!0;var t=pt(),n=t.setPrototypeOf,r=t.getPrototypeOf,i=t.defineProperty,a=t.objectCreate,o=Error().toString()===`[object Error]`,s=``;function c(e){var t=this.constructor,a=t.name||(function(){var e=t.toString().match(/^function\s*([^\s(]+)/);return e===null?s||`Error`:e[1]})(),l=a===`Error`,u=l?s:a,d=Error.apply(this,arguments);if(n(d,r(this)),!(d instanceof t)||!(d instanceof c)){var d=this;Error.apply(this,arguments),i(d,`message`,{configurable:!0,enumerable:!1,value:e,writable:!0})}if(i(d,`name`,{configurable:!0,enumerable:!1,value:u,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(d,l?c:t),d.stack===void 0){var f=Error(e);f.name=d.name,d.stack=f.stack}return o&&i(d,`toString`,{configurable:!0,enumerable:!1,value:function(){return(this.name||`Error`)+(this.message===void 0?``:`: `+this.message)},writable:!0}),d}s=c.name||`ExtendableError`,c.prototype=a(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),e.ExtendableError=c,e.default=e.ExtendableError})),ht=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SyntaxError=e.LiqeError=void 0;var t=mt(),n=class extends t.ExtendableError{};e.LiqeError=n,e.SyntaxError=class extends n{constructor(e,t,n,r){super(e),this.message=e,this.offset=t,this.line=n,this.column=r}}})),gt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertWildcardToRegex=void 0;var t=/(\*+)|(\?)/g;e.convertWildcardToRegex=e=>new RegExp(e.replaceAll(t,(e,t)=>t?`(.+?)`:`(.)`))})),_t=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.escapeRegexString=void 0;var t=/[$()*+.?[\\\]^{|}]/g,n=/-/g;e.escapeRegexString=e=>e.replaceAll(t,`\\$&`).replaceAll(n,`\\x2d`)})),vt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.parseRegex=void 0;var t=/(\/?)(.+)\1([a-z]*)/,n=/^(?!.*?(.).*?\1)[AJUXgimsux]+$/;e.parseRegex=e=>{let r=t.exec(e);if(!r)throw Error(`Invalid RegExp.`);return r[3]&&!n.test(r[3])?new RegExp(e):new RegExp(r[2],r[3])}})),yt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createStringTest=void 0;var t=gt(),n=_t(),r=vt(),i=(e,t)=>{let n;return e[t]?n=e[t]:(n=(0,r.parseRegex)(t),e[t]=n),e=>e.match(n)?.[0]??!1};e.createStringTest=(e,r)=>{if(r.type!==`Tag`)throw Error(`Expected a tag expression.`);let{expression:a}=r;if(a.type===`RangeExpression`)throw Error(`Unexpected range expression.`);if(a.type===`RegexExpression`)return i(e,a.value);if(a.type!==`LiteralExpression`)throw Error(`Expected a literal expression.`);let o=String(a.value);return(o.includes(`*`)||o.includes(`?`))&&a.quoted===!1?i(e,String((0,t.convertWildcardToRegex)(o))+`ui`):i(e,`/(`+(0,n.escapeRegexString)(o)+`)/`+(a.quoted?`u`:`ui`))}})),bt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.testComparisonRange=void 0,e.testComparisonRange=(e,t,n)=>{switch(n){case`:<`:return t<e;case`:<=`:return t<=e;case`:=`:return t===e;case`:>`:return t>e;case`:>=`:return t>=e;default:throw Error(`Unimplemented comparison operator: ${n}`)}}})),xt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.testRange=void 0,e.testRange=(e,t)=>typeof e==`number`?!(e<t.min||e===t.min&&!t.minInclusive||e>t.max||e===t.max&&!t.maxInclusive):!1})),St=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.internalFilter=void 0;var t=yt(),n=bt(),r=xt(),i=e=>{if(e.type!==`Tag`)throw Error(`Expected a tag expression.`);let{expression:i}=e;if(i.type===`RangeExpression`)return e=>(0,r.testRange)(e,i.range);if(i.type===`EmptyExpression`)return()=>!1;let a=i.value;if(e.operator&&e.operator.operator!==`:`){let t=e.operator;if(typeof a!=`number`)throw TypeError(`Expected a number.`);return e=>typeof e==`number`?(0,n.testComparisonRange)(a,e,t.operator):!1}else if(typeof a==`boolean`)return e=>e===a;else if(a===null)return e=>e===null;else{let n=(0,t.createStringTest)({},e);return e=>n(String(e))}},a=(e,t,n,r,i)=>{if(Array.isArray(t)){let o=!1,s=0;for(let c of t)if(a(e,c,n,[...r,String(s++)],i)){if(n)return!0;o=!0}return o}else if(typeof t==`object`&&t){let o=!1;for(let s in t)if(a(e,t[s],n,[...r,s],i)){if(n)return!0;o=!0}return o}if(e.type!==`Tag`)throw Error(`Expected a tag expression.`);if(!e.test)throw Error(`Expected test to be defined.`);let o=e.test(t);return o?(i.push({...typeof o==`string`&&{keyword:o},path:r.join(`.`)}),!0):!!o},o=(e,t,n,r,o)=>{if(t.type!==`Tag`)throw Error(`Expected a tag expression.`);if(t.test||=i(t),t.field.type===`ImplicitField`){let i=!1;for(let s in e)if(a({...t,field:{location:{end:-1,start:-1},name:s,quoted:!0,quotes:`double`,type:`Field`}},e[s],n,[...r,s],o)){if(n)return!0;i=!0}return i}if(t.field.name in e)return a(t,e[t.field.name],n,r,o);if(t.getValue&&t.field.path)return a(t,t.getValue(e),n,t.field.path,o);if(t.field.path){let r=e;for(let e of t.field.path)if(typeof r!=`object`||!r)return!1;else if(e in r)r=r[e];else return!1;return a(t,r,n,t.field.path,o)}else return!1};e.internalFilter=(t,n,r=!0,i=[],a=[])=>{if(t.type===`Tag`)return n.filter(e=>o(e,t,r,t.field.type===`ImplicitField`?i:[...i,t.field.name],a));if(t.type===`UnaryOperator`){let a=new Set((0,e.internalFilter)(t.operand,n,r,i,[]));return n.filter(e=>!a.has(e))}if(t.type===`ParenthesizedExpression`)return(0,e.internalFilter)(t.expression,n,r,i,a);if(!t.left)throw Error(`Expected left to be defined.`);let s=(0,e.internalFilter)(t.left,n,r,i,a);if(!t.right)throw Error(`Expected right to be defined.`);if(t.type!==`LogicalExpression`)throw Error(`Expected a tag expression.`);if(t.operator.operator===`OR`){let o=(0,e.internalFilter)(t.right,n,r,i,a);return Array.from(new Set([...s,...o]))}else if(t.operator.operator===`AND`)return(0,e.internalFilter)(t.right,s,r,i,a);throw Error(`Unexpected state.`)}})),Ct=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.filter=void 0;var t=St();e.filter=(e,n)=>(0,t.internalFilter)(e,n)})),wt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.highlight=void 0;var t=_t(),n=St();e.highlight=(e,r)=>{let i=[];(0,n.internalFilter)(e,[r],!1,[],i);let a=[];for(let e of i){let t=a.find(t=>t.path===e.path);t||(t={keywords:[],path:e.path},a.push(t)),e.keyword&&t.keywords.push(e.keyword)}return a.map(e=>e.keywords.length>0?{path:e.path,query:RegExp(`(`+e.keywords.map(e=>(0,t.escapeRegexString)(e.trim())).join(`|`)+`)`)}:{path:e.path})}})),Tt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isSafeUnquotedExpression=void 0,e.isSafeUnquotedExpression=e=>/^[#$*@A-Z_a-z][#$*.@A-Z_a-z-]*$/.test(e)})),Et=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){return e[0]}e.default={Lexer:void 0,ParserRules:[{name:`main`,postprocess:e=>e[1],symbols:[`_`,`logical_expression`,`_`]},{name:`_$ebnf$1`,symbols:[]},{name:`_$ebnf$1`,postprocess:e=>e[0].concat([e[1]]),symbols:[`_$ebnf$1`,`whitespace_character`]},{name:`_`,postprocess:e=>e[0].length,symbols:[`_$ebnf$1`]},{name:`__$ebnf$1`,symbols:[`whitespace_character`]},{name:`__$ebnf$1`,postprocess:e=>e[0].concat([e[1]]),symbols:[`__$ebnf$1`,`whitespace_character`]},{name:`__`,postprocess:e=>e[0].length,symbols:[`__$ebnf$1`]},{name:`whitespace_character`,postprocess:t,symbols:[/[\t\n\v\f ]/]},{name:`decimal$ebnf$1`,postprocess:t,symbols:[{literal:`-`}]},{name:`decimal$ebnf$1`,postprocess:()=>null,symbols:[]},{name:`decimal$ebnf$2`,symbols:[/\d/]},{name:`decimal$ebnf$2`,postprocess:e=>e[0].concat([e[1]]),symbols:[`decimal$ebnf$2`,/\d/]},{name:`decimal$ebnf$3$subexpression$1$ebnf$1`,symbols:[/\d/]},{name:`decimal$ebnf$3$subexpression$1$ebnf$1`,postprocess:e=>e[0].concat([e[1]]),symbols:[`decimal$ebnf$3$subexpression$1$ebnf$1`,/\d/]},{name:`decimal$ebnf$3$subexpression$1`,symbols:[{literal:`.`},`decimal$ebnf$3$subexpression$1$ebnf$1`]},{name:`decimal$ebnf$3`,postprocess:t,symbols:[`decimal$ebnf$3$subexpression$1`]},{name:`decimal$ebnf$3`,postprocess:()=>null,symbols:[]},{name:`decimal`,postprocess:e=>Number.parseFloat((e[0]||``)+e[1].join(``)+(e[2]?`.`+e[2][1].join(``):``)),symbols:[`decimal$ebnf$1`,`decimal$ebnf$2`,`decimal$ebnf$3`]},{name:`dqstring$ebnf$1`,symbols:[]},{name:`dqstring$ebnf$1`,postprocess:e=>e[0].concat([e[1]]),symbols:[`dqstring$ebnf$1`,`dstrchar`]},{name:`dqstring`,postprocess:e=>e[1].join(``),symbols:[{literal:`"`},`dqstring$ebnf$1`,{literal:`"`}]},{name:`sqstring$ebnf$1`,symbols:[]},{name:`sqstring$ebnf$1`,postprocess:e=>e[0].concat([e[1]]),symbols:[`sqstring$ebnf$1`,`sstrchar`]},{name:`sqstring`,postprocess:e=>e[1].join(``),symbols:[{literal:`'`},`sqstring$ebnf$1`,{literal:`'`}]},{name:`dstrchar`,postprocess:t,symbols:[/[^\n"\\]/]},{name:`dstrchar`,postprocess:e=>JSON.parse(`"`+e.join(``)+`"`),symbols:[{literal:`\\`},`strescape`]},{name:`sstrchar`,postprocess:t,symbols:[/[^\n'\\]/]},{name:`sstrchar`,postprocess:e=>JSON.parse(`"`+e.join(``)+`"`),symbols:[{literal:`\\`},`strescape`]},{name:`sstrchar$string$1`,postprocess:e=>e.join(``),symbols:[{literal:`\\`},{literal:`'`}]},{name:`sstrchar`,postprocess:()=>`'`,symbols:[`sstrchar$string$1`]},{name:`strescape`,postprocess:t,symbols:[/["/\\bfnrt]/]},{name:`strescape`,postprocess:e=>e.join(``),symbols:[{literal:`u`},/[\dA-Fa-f]/,/[\dA-Fa-f]/,/[\dA-Fa-f]/,/[\dA-Fa-f]/]},{name:`logical_expression`,postprocess:t,symbols:[`two_op_logical_expression`]},{name:`two_op_logical_expression`,postprocess:e=>({left:e[0],location:{end:e[2].location.end,start:e[0].location.start},operator:e[1],right:e[2],type:`LogicalExpression`}),symbols:[`pre_two_op_logical_expression`,`boolean_operator`,`post_one_op_logical_expression`]},{name:`two_op_logical_expression`,postprocess:e=>({left:e[0],location:{end:e[2].location.end,start:e[0].location.start},operator:{operator:`AND`,type:`ImplicitBooleanOperator`},right:e[2],type:`LogicalExpression`}),symbols:[`pre_two_op_implicit_logical_expression`,`__`,`post_one_op_implicit_logical_expression`]},{name:`two_op_logical_expression`,postprocess:e=>e[0],symbols:[`one_op_logical_expression`]},{name:`pre_two_op_implicit_logical_expression`,postprocess:e=>e[0],symbols:[`two_op_logical_expression`]},{name:`pre_two_op_implicit_logical_expression`,postprocess:e=>({expression:e[2],location:{end:e[4].location.start+1,start:e[0].location.start},type:`ParenthesizedExpression`}),symbols:[`parentheses_open`,`_`,`two_op_logical_expression`,`_`,`parentheses_close`]},{name:`post_one_op_implicit_logical_expression`,postprocess:e=>e[0],symbols:[`one_op_logical_expression`]},{name:`post_one_op_implicit_logical_expression`,postprocess:e=>({expression:e[2],location:{end:e[4].location.start+1,start:e[0].location.start},type:`ParenthesizedExpression`}),symbols:[`parentheses_open`,`_`,`one_op_logical_expression`,`_`,`parentheses_close`]},{name:`pre_two_op_logical_expression`,postprocess:e=>e[0],symbols:[`two_op_logical_expression`,`__`]},{name:`pre_two_op_logical_expression`,postprocess:e=>({expression:e[2],location:{end:e[4].location.start+1,start:e[0].location.start},type:`ParenthesizedExpression`}),symbols:[`parentheses_open`,`_`,`two_op_logical_expression`,`_`,`parentheses_close`]},{name:`one_op_logical_expression`,postprocess:e=>({expression:{location:{end:e[0].location.start+1,start:e[0].location.start+1},type:`EmptyExpression`},location:{end:e[2].location.start+1,start:e[0].location.start},type:`ParenthesizedExpression`}),symbols:[`parentheses_open`,`_`,`parentheses_close`]},{name:`one_op_logical_expression`,postprocess:e=>({expression:e[2],location:{end:e[4].location.start+1,start:e[0].location.start},type:`ParenthesizedExpression`}),symbols:[`parentheses_open`,`_`,`two_op_logical_expression`,`_`,`parentheses_close`]},{name:`one_op_logical_expression$string$1`,postprocess:e=>e.join(``),symbols:[{literal:`N`},{literal:`O`},{literal:`T`}]},{name:`one_op_logical_expression`,postprocess:(e,t)=>({location:{end:e[1].location.end,start:t},operand:e[1],operator:`NOT`,type:`UnaryOperator`}),symbols:[`one_op_logical_expression$string$1`,`post_boolean_primary`]},{name:`one_op_logical_expression`,postprocess:(e,t)=>({location:{end:e[1].location.end,start:t},operand:e[1],operator:`-`,type:`UnaryOperator`}),symbols:[{literal:`-`},`boolean_primary`]},{name:`one_op_logical_expression`,postprocess:e=>e[0],symbols:[`boolean_primary`]},{name:`post_one_op_logical_expression`,postprocess:e=>e[1],symbols:[`__`,`one_op_logical_expression`]},{name:`post_one_op_logical_expression`,postprocess:e=>({expression:e[2],location:{end:e[4].location+1,start:e[0].location},type:`ParenthesizedExpression`}),symbols:[`parentheses_open`,`_`,`one_op_logical_expression`,`_`,`parentheses_close`]},{name:`parentheses_open`,postprocess:(e,t)=>({location:{start:t}}),symbols:[{literal:`(`}]},{name:`parentheses_close`,postprocess:(e,t)=>({location:{start:t}}),symbols:[{literal:`)`}]},{name:`boolean_operator$string$1`,postprocess:e=>e.join(``),symbols:[{literal:`O`},{literal:`R`}]},{name:`boolean_operator`,postprocess:(e,t)=>({location:{end:t+2,start:t},operator:`OR`,type:`BooleanOperator`}),symbols:[`boolean_operator$string$1`]},{name:`boolean_operator$string$2`,postprocess:e=>e.join(``),symbols:[{literal:`A`},{literal:`N`},{literal:`D`}]},{name:`boolean_operator`,postprocess:(e,t)=>({location:{end:t+3,start:t},operator:`AND`,type:`BooleanOperator`}),symbols:[`boolean_operator$string$2`]},{name:`boolean_primary`,postprocess:t,symbols:[`tag_expression`]},{name:`post_boolean_primary`,postprocess:e=>({expression:e[3],location:{end:e[5].location.start+1,start:e[1].location.start},type:`ParenthesizedExpression`}),symbols:[`__`,`parentheses_open`,`_`,`two_op_logical_expression`,`_`,`parentheses_close`]},{name:`post_boolean_primary`,postprocess:e=>e[1],symbols:[`__`,`boolean_primary`]},{name:`tag_expression`,postprocess:(e,t)=>{let n={location:e[0].location,name:e[0].name,path:e[0].name.split(`.`).filter(Boolean),quoted:e[0].quoted,quotes:e[0].quotes,type:`Field`};return e[0].quotes||delete n.quotes,{field:n,location:{end:e[2].expression.location.end,start:t},operator:e[1],...e[2]}},symbols:[`field`,`comparison_operator`,`expression`]},{name:`tag_expression`,postprocess:(e,t)=>{let n={location:e[0].location,name:e[0].name,path:e[0].name.split(`.`).filter(Boolean),quoted:e[0].quoted,quotes:e[0].quotes,type:`Field`};return e[0].quotes||delete n.quotes,{expression:{location:{end:e[1].location.end,start:e[1].location.end},type:`EmptyExpression`},field:n,location:{end:e[1].location.end,start:t},operator:e[1],type:`Tag`}},symbols:[`field`,`comparison_operator`]},{name:`tag_expression`,postprocess:(e,t)=>({field:{type:`ImplicitField`},location:{end:e[0].expression.location.end,start:t},...e[0]}),symbols:[`expression`]},{name:`field$ebnf$1`,symbols:[]},{name:`field$ebnf$1`,postprocess:e=>e[0].concat([e[1]]),symbols:[`field$ebnf$1`,/[\w$.-]/]},{name:`field`,postprocess:(e,t)=>({location:{end:t+(e[0]+e[1].join(``)).length,start:t},name:e[0]+e[1].join(``),quoted:!1,type:`LiteralExpression`}),symbols:[/[$A-Z_a-z]/,`field$ebnf$1`]},{name:`field`,postprocess:(e,t)=>({location:{end:t+e[0].length+2,start:t},name:e[0],quoted:!0,quotes:`single`,type:`LiteralExpression`}),symbols:[`sqstring`]},{name:`field`,postprocess:(e,t)=>({location:{end:t+e[0].length+2,start:t},name:e[0],quoted:!0,quotes:`double`,type:`LiteralExpression`}),symbols:[`dqstring`]},{name:`expression`,postprocess:(e,t)=>({expression:{location:{end:t+e.join(``).length,start:t},quoted:!1,type:`LiteralExpression`,value:Number(e.join(``))},type:`Tag`}),symbols:[`decimal`]},{name:`expression`,postprocess:(e,t)=>({expression:{location:{end:t+e.join(``).length,start:t},type:`RegexExpression`,value:e.join(``)},type:`Tag`}),symbols:[`regex`]},{name:`expression`,postprocess:e=>e[0],symbols:[`range`]},{name:`expression`,postprocess:(e,t,n)=>{let r=e.join(``);if(e[0]===`AND`||e[0]===`OR`||e[0]===`NOT`)return n;let i;return i=r===`true`?!0:r===`false`?!1:r===`null`?null:r,{expression:{location:{end:t+r.length,start:t},quoted:!1,type:`LiteralExpression`,value:i},type:`Tag`}},symbols:[`unquoted_value`]},{name:`expression`,postprocess:(e,t)=>({expression:{location:{end:t+e.join(``).length+2,start:t},quoted:!0,quotes:`single`,type:`LiteralExpression`,value:e.join(``)},type:`Tag`}),symbols:[`sqstring`]},{name:`expression`,postprocess:(e,t)=>({expression:{location:{end:t+e.join(``).length+2,start:t},quoted:!0,quotes:`double`,type:`LiteralExpression`,value:e.join(``)},type:`Tag`}),symbols:[`dqstring`]},{name:`range$string$1`,postprocess:e=>e.join(``),symbols:[{literal:` `},{literal:`T`},{literal:`O`},{literal:` `}]},{name:`range`,postprocess:(e,t)=>({expression:{location:{end:e[4].location.start+1,start:e[0].location.start},range:{max:e[3],maxInclusive:e[4].inclusive,min:e[1],minInclusive:e[0].inclusive},type:`RangeExpression`},location:{start:t},type:`Tag`}),symbols:[`range_open`,`decimal`,`range$string$1`,`decimal`,`range_close`]},{name:`range_open`,postprocess:(e,t)=>({inclusive:!0,location:{start:t}}),symbols:[{literal:`[`}]},{name:`range_open`,postprocess:(e,t)=>({inclusive:!1,location:{start:t}}),symbols:[{literal:`{`}]},{name:`range_close`,postprocess:(e,t)=>({inclusive:!0,location:{start:t}}),symbols:[{literal:`]`}]},{name:`range_close`,postprocess:(e,t)=>({inclusive:!1,location:{start:t}}),symbols:[{literal:`}`}]},{name:`comparison_operator$subexpression$1`,symbols:[{literal:`:`}]},{name:`comparison_operator$subexpression$1$string$1`,postprocess:e=>e.join(``),symbols:[{literal:`:`},{literal:`=`}]},{name:`comparison_operator$subexpression$1`,symbols:[`comparison_operator$subexpression$1$string$1`]},{name:`comparison_operator$subexpression$1$string$2`,postprocess:e=>e.join(``),symbols:[{literal:`:`},{literal:`>`}]},{name:`comparison_operator$subexpression$1`,symbols:[`comparison_operator$subexpression$1$string$2`]},{name:`comparison_operator$subexpression$1$string$3`,postprocess:e=>e.join(``),symbols:[{literal:`:`},{literal:`<`}]},{name:`comparison_operator$subexpression$1`,symbols:[`comparison_operator$subexpression$1$string$3`]},{name:`comparison_operator$subexpression$1$string$4`,postprocess:e=>e.join(``),symbols:[{literal:`:`},{literal:`>`},{literal:`=`}]},{name:`comparison_operator$subexpression$1`,symbols:[`comparison_operator$subexpression$1$string$4`]},{name:`comparison_operator$subexpression$1$string$5`,postprocess:e=>e.join(``),symbols:[{literal:`:`},{literal:`<`},{literal:`=`}]},{name:`comparison_operator$subexpression$1`,symbols:[`comparison_operator$subexpression$1$string$5`]},{name:`comparison_operator`,postprocess:(e,t)=>({location:{end:t+e[0][0].length,start:t},operator:e[0][0],type:`ComparisonOperator`}),symbols:[`comparison_operator$subexpression$1`]},{name:`regex`,postprocess:e=>e.join(``),symbols:[`regex_body`,`regex_flags`]},{name:`regex_body$ebnf$1`,symbols:[]},{name:`regex_body$ebnf$1`,postprocess:e=>e[0].concat([e[1]]),symbols:[`regex_body$ebnf$1`,`regex_body_char`]},{name:`regex_body`,postprocess:e=>`/`+e[1].join(``)+`/`,symbols:[{literal:`/`},`regex_body$ebnf$1`,{literal:`/`}]},{name:`regex_body_char`,postprocess:t,symbols:[/[^\\]/]},{name:`regex_body_char`,postprocess:e=>`\\`+e[1],symbols:[{literal:`\\`},/[^\\]/]},{name:`regex_body_char`,postprocess:e=>`\\`+e[1],symbols:[{literal:`\\`},{literal:`\\`}]},{name:`regex_flags`,symbols:[]},{name:`regex_flags$ebnf$1`,symbols:[/[dgimsuy]/]},{name:`regex_flags$ebnf$1`,postprocess:e=>e[0].concat([e[1]]),symbols:[`regex_flags$ebnf$1`,/[dgimsuy]/]},{name:`regex_flags`,postprocess:e=>e[0].join(``),symbols:[`regex_flags$ebnf$1`]},{name:`unquoted_value$ebnf$1`,symbols:[]},{name:`unquoted_value$ebnf$1`,postprocess:e=>e[0].concat([e[1]]),symbols:[`unquoted_value$ebnf$1`,/[\w#$*.?@\u0080-\uFFFF\-]/]},{name:`unquoted_value`,postprocess:e=>e[0]+e[1].join(``),symbols:[/[#$*?@A-Z_a-z\u0080-\uFFFF]/,`unquoted_value$ebnf$1`]},{name:`unquoted_value$ebnf$2`,symbols:[/\d/]},{name:`unquoted_value$ebnf$2`,postprocess:e=>e[0].concat([e[1]]),symbols:[`unquoted_value$ebnf$2`,/\d/]},{name:`unquoted_value$ebnf$3`,symbols:[]},{name:`unquoted_value$ebnf$3`,postprocess:e=>e[0].concat([e[1]]),symbols:[`unquoted_value$ebnf$3`,/[\w#$*.?@\u0080-\uFFFF\-]/]},{name:`unquoted_value`,postprocess:e=>e[0].join(``)+e[1]+e[2].join(``),symbols:[`unquoted_value$ebnf$2`,/[#$*?@A-Z_a-z\u0080-\uFFFF\-]/,`unquoted_value$ebnf$3`]}],ParserStart:`main`}})),Dt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isSafePath=void 0;var t=/^(\.(?:[_a-zA-Z]\w*|0|[1-9]\d*))+$/u;e.isSafePath=e=>t.test(e)})),Ot=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createGetValueFunctionBody=void 0;var t=Dt();e.createGetValueFunctionBody=e=>{if(!(0,t.isSafePath)(e))throw Error(`Unsafe path.`);return(`return subject`+e).replaceAll(/(\.(\d+))/g,`.[$2]`).replaceAll(`.`,`?.`)}})),kt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hydrateAst=void 0;var t=Ot(),n=Dt();e.hydrateAst=r=>{let i={...r};return r.type===`Tag`&&r.field.type===`Field`&&`field`in r&&(0,n.isSafePath)(r.field.name)&&(i.getValue=Function(`subject`,(0,t.createGetValueFunctionBody)(r.field.name))),`left`in r&&(i.left=(0,e.hydrateAst)(r.left)),`right`in r&&(i.right=(0,e.hydrateAst)(r.right)),`operand`in r&&(i.operand=(0,e.hydrateAst)(r.operand)),i}})),At=t(((e,t)=>{(function(e,n){typeof t==`object`&&t.exports?t.exports=n():e.nearley=n()})(e,function(){function e(t,n,r){return this.id=++e.highestId,this.name=t,this.symbols=n,this.postprocess=r,this}e.highestId=0,e.prototype.toString=function(e){var t=e===void 0?this.symbols.map(s).join(` `):this.symbols.slice(0,e).map(s).join(` `)+` ● `+this.symbols.slice(e).map(s).join(` `);return this.name+` → `+t};function t(e,t,n,r){this.rule=e,this.dot=t,this.reference=n,this.data=[],this.wantedBy=r,this.isComplete=this.dot===e.symbols.length}t.prototype.toString=function(){return`{`+this.rule.toString(this.dot)+`}, from: `+(this.reference||0)},t.prototype.nextState=function(e){var n=new t(this.rule,this.dot+1,this.reference,this.wantedBy);return n.left=this,n.right=e,n.isComplete&&(n.data=n.build(),n.right=void 0),n},t.prototype.build=function(){var e=[],t=this;do e.push(t.right.data),t=t.left;while(t.left);return e.reverse(),e},t.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,a.fail))};function n(e,t){this.grammar=e,this.index=t,this.states=[],this.wants={},this.scannable=[],this.completed={}}n.prototype.process=function(e){for(var t=this.states,n=this.wants,r=this.completed,i=0;i<t.length;i++){var o=t[i];if(o.isComplete){if(o.finish(),o.data!==a.fail){for(var s=o.wantedBy,c=s.length;c--;){var l=s[c];this.complete(l,o)}if(o.reference===this.index){var u=o.rule.name;(this.completed[u]=this.completed[u]||[]).push(o)}}}else{var u=o.rule.symbols[o.dot];if(typeof u!=`string`){this.scannable.push(o);continue}if(n[u]){if(n[u].push(o),r.hasOwnProperty(u))for(var d=r[u],c=0;c<d.length;c++){var f=d[c];this.complete(o,f)}}else n[u]=[o],this.predict(u)}}},n.prototype.predict=function(e){for(var n=this.grammar.byName[e]||[],r=0;r<n.length;r++){var i=n[r],a=this.wants[e],o=new t(i,0,this.index,a);this.states.push(o)}},n.prototype.complete=function(e,t){var n=e.nextState(t);this.states.push(n)};function r(e,t){this.rules=e,this.start=t||this.rules[0].name;var n=this.byName={};this.rules.forEach(function(e){n.hasOwnProperty(e.name)||(n[e.name]=[]),n[e.name].push(e)})}r.fromCompiled=function(t,n){var i=t.Lexer;t.ParserStart&&(n=t.ParserStart,t=t.ParserRules);var t=t.map(function(t){return new e(t.name,t.symbols,t.postprocess)}),a=new r(t,n);return a.lexer=i,a};function i(){this.reset(``)}i.prototype.reset=function(e,t){this.buffer=e,this.index=0,this.line=t?t.line:1,this.lastLineBreak=t?-t.col:0},i.prototype.next=function(){if(this.index<this.buffer.length){var e=this.buffer[this.index++];return e===`
2
+ `&&(this.line+=1,this.lastLineBreak=this.index),{value:e}}},i.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},i.prototype.formatError=function(e,t){var n=this.buffer;if(typeof n==`string`){var r=n.split(`
3
+ `).slice(Math.max(0,this.line-5),this.line),i=n.indexOf(`
4
+ `,this.index);i===-1&&(i=n.length);var a=this.index-this.lastLineBreak,o=String(this.line).length;return t+=` at line `+this.line+` col `+a+`:
5
+
6
+ `,t+=r.map(function(e,t){return s(this.line-r.length+t+1,o)+` `+e},this).join(`
7
+ `),t+=`
8
+ `+s(``,o+a)+`^
9
+ `,t}else return t+` at index `+(this.index-1);function s(e,t){var n=String(e);return Array(t-n.length+1).join(` `)+n}};function a(e,t,a){if(e instanceof r)var o=e,a=t;else var o=r.fromCompiled(e,t);for(var s in this.grammar=o,this.options={keepHistory:!1,lexer:o.lexer||new i},a||{})this.options[s]=a[s];this.lexer=this.options.lexer,this.lexerState=void 0;var c=new n(o,0);this.table=[c],c.wants[o.start]=[],c.predict(o.start),c.process(),this.current=0}a.fail={},a.prototype.feed=function(e){var t=this.lexer;t.reset(e,this.lexerState);for(var r;;){try{if(r=t.next(),!r)break}catch(e){var a=new n(this.grammar,this.current+1);this.table.push(a);var o=Error(this.reportLexerError(e));throw o.offset=this.current,o.token=e.token,o}var s=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var c=this.current+1,a=new n(this.grammar,c);this.table.push(a);for(var l=r.text===void 0?r.value:r.text,u=t.constructor===i?r.value:r,d=s.scannable,f=d.length;f--;){var p=d[f],m=p.rule.symbols[p.dot];if(m.test?m.test(u):m.type?m.type===r.type:m.literal===l){var ee=p.nextState({data:u,token:r,isToken:!0,reference:c-1});a.states.push(ee)}}if(a.process(),a.states.length===0){var o=Error(this.reportError(r));throw o.offset=this.current,o.token=r,o}this.options.keepHistory&&(s.lexerState=t.save()),this.current++}return s&&(this.lexerState=t.save()),this.results=this.finish(),this},a.prototype.reportLexerError=function(e){var t,n,r=e.token;return r?(t=`input `+JSON.stringify(r.text[0])+` (lexer error)`,n=this.lexer.formatError(r,`Syntax error`)):(t=`input (lexer error)`,n=e.message),this.reportErrorCommon(n,t)},a.prototype.reportError=function(e){var t=(e.type?e.type+` token: `:``)+JSON.stringify(e.value===void 0?e:e.value),n=this.lexer.formatError(e,`Syntax error`);return this.reportErrorCommon(n,t)},a.prototype.reportErrorCommon=function(e,t){var n=[];n.push(e);var r=this.table.length-2,i=this.table[r],a=i.states.filter(function(e){var t=e.rule.symbols[e.dot];return t&&typeof t!=`string`});return a.length===0?(n.push(`Unexpected `+t+`. I did not expect any more input. Here is the state of my parse table:
10
+ `),this.displayStateStack(i.states,n)):(n.push(`Unexpected `+t+`. Instead, I was expecting to see one of the following:
11
+ `),a.map(function(e){return this.buildFirstStateStack(e,[])||[e]},this).forEach(function(e){var t=e[0],r=t.rule.symbols[t.dot],i=this.getSymbolDisplay(r);n.push(`A `+i+` based on:`),this.displayStateStack(e,n)},this)),n.push(``),n.join(`
12
+ `)},a.prototype.displayStateStack=function(e,t){for(var n,r=0,i=0;i<e.length;i++){var a=e[i],o=a.rule.toString(a.dot);o===n?r++:(r>0&&t.push(` ^ `+r+` more lines identical to this`),r=0,t.push(` `+o)),n=o}},a.prototype.getSymbolDisplay=function(e){return o(e)},a.prototype.buildFirstStateStack=function(e,t){if(t.indexOf(e)!==-1)return null;if(e.wantedBy.length===0)return[e];var n=e.wantedBy[0],r=[e].concat(t),i=this.buildFirstStateStack(n,r);return i===null?null:[e].concat(i)},a.prototype.save=function(){var e=this.table[this.current];return e.lexerState=this.lexerState,e},a.prototype.restore=function(e){var t=e.index;this.current=t,this.table[t]=e,this.table.splice(t+1),this.lexerState=e.lexerState,this.results=this.finish()},a.prototype.rewind=function(e){if(!this.options.keepHistory)throw Error("set option `keepHistory` to enable rewinding");this.restore(this.table[e])},a.prototype.finish=function(){var e=[],t=this.grammar.start;return this.table[this.table.length-1].states.forEach(function(n){n.rule.name===t&&n.dot===n.rule.symbols.length&&n.reference===0&&n.data!==a.fail&&e.push(n)}),e.map(function(e){return e.data})};function o(e){var t=typeof e;if(t===`string`)return e;if(t===`object`){if(e.literal)return JSON.stringify(e.literal);if(e instanceof RegExp)return`character matching `+e;if(e.type)return e.type+` token`;if(e.test)return`token matching `+String(e.test);throw Error(`Unknown symbol type: `+e)}}function s(e){var t=typeof e;if(t===`string`)return e;if(t===`object`){if(e.literal)return JSON.stringify(e.literal);if(e instanceof RegExp)return e.toString();if(e.type)return`%`+e.type;if(e.test)return`<`+String(e.test)+`>`;throw Error(`Unknown symbol type: `+e)}}return{Parser:a,Grammar:r,Rule:e}})})),jt=t((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.parse=void 0;var n=ht(),r=t(Et()),i=kt(),a=t(At()),o=a.default.Grammar.fromCompiled(r.default),s=/Syntax error at line (?<line>\d+) col (?<column>\d+)/;e.parse=e=>{if(e.trim()===``)return{location:{end:0,start:0},type:`EmptyExpression`};let t=new a.default.Parser(o),r;try{r=t.feed(e).results}catch(e){if(typeof e?.message==`string`&&typeof e?.offset==`number`){let t=e.message.match(s);throw t?new n.SyntaxError(`Syntax error at line ${t.groups.line} column ${t.groups.column}`,e.offset,Number(t.groups.line),Number(t.groups.column)):e}throw e}if(r.length===0)throw Error(`Found no parsings.`);if(r.length>1){let e=JSON.stringify(r[0]);for(let t of r)if(JSON.stringify(t)!==e)throw new n.LiqeError(`Ambiguous results.`)}return(0,i.hydrateAst)(r[0])}})),Mt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=(e,t)=>t===`double`?`"${e}"`:t===`single`?`'${e}'`:e,n=e=>{if(e.type===`LiteralExpression`)return e.quoted&&typeof e.value==`string`?t(e.value,e.quotes):String(e.value);if(e.type===`RegexExpression`)return String(e.value);if(e.type===`RangeExpression`){let{max:t,maxInclusive:n,min:r,minInclusive:i}=e.range;return`${i?`[`:`{`}${r} TO ${t}${n?`]`:`}`}`}if(e.type===`EmptyExpression`)return``;throw Error(`Unexpected AST type.`)},r=e=>{if(e.type!==`Tag`)throw Error(`Expected a tag expression.`);let{expression:r,field:i,operator:a}=e;if(i.type===`ImplicitField`)return n(r);let o=i.quoted?t(i.name,i.quotes):i.name,s=` `.repeat(r.location.start-a.location.end);return o+a.operator+s+n(r)};e.serialize=t=>{if(t.type===`ParenthesizedExpression`){if(!(`location`in t.expression))throw Error(`Expected location in expression.`);if(!t.location.end)throw Error(`Expected location end.`);let n=` `.repeat(t.expression.location.start-(t.location.start+1)),r=` `.repeat(t.location.end-t.expression.location.end-1);return`(${n}${(0,e.serialize)(t.expression)}${r})`}if(t.type===`Tag`)return r(t);if(t.type===`LogicalExpression`){let n=``;return t.operator.type===`BooleanOperator`?(n+=` `.repeat(t.operator.location.start-t.left.location.end),n+=t.operator.operator,n+=` `.repeat(t.right.location.start-t.operator.location.end)):n=` `.repeat(t.right.location.start-t.left.location.end),`${(0,e.serialize)(t.left)}${n}${(0,e.serialize)(t.right)}`}if(t.type===`UnaryOperator`)return(t.operator===`NOT`?`NOT `:t.operator)+(0,e.serialize)(t.operand);if(t.type===`EmptyExpression`)return``;throw Error(`Unexpected AST type.`)}})),Nt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.test=void 0;var t=Ct();e.test=(e,n)=>(0,t.filter)(e,[n]).length===1})),Pt=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.test=e.serialize=e.parse=e.isSafeUnquotedExpression=e.highlight=e.filter=e.SyntaxError=e.LiqeError=void 0;var t=ht();Object.defineProperty(e,"LiqeError",{enumerable:!0,get:function(){return t.LiqeError}}),Object.defineProperty(e,"SyntaxError",{enumerable:!0,get:function(){return t.SyntaxError}});var n=Ct();Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return n.filter}});var r=wt();Object.defineProperty(e,"highlight",{enumerable:!0,get:function(){return r.highlight}});var i=Tt();Object.defineProperty(e,"isSafeUnquotedExpression",{enumerable:!0,get:function(){return i.isSafeUnquotedExpression}});var a=jt();Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return a.parse}});var o=Mt();Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return o.serialize}});var s=Nt();Object.defineProperty(e,"test",{enumerable:!0,get:function(){return s.test}})}))();function Ft(e){let t=[],n=``,r=``;for(let i=0;i<e.length;i++){let a=e[i];r?(n+=a,a===r&&e[i-1]!==`\\`&&(t.push({text:n,quoted:!0}),n=``,r=``)):a===`"`||a===`'`?(n&&t.push({text:n,quoted:!1}),n=a,r=a):n+=a}return n&&t.push({text:n,quoted:r!==``}),t}function It(e){return Ft(e).map(e=>e.quoted?e.text:e.text.replace(/([\]\)])(?=(?:AND|OR|NOT)\b)/gi,`$1 `).replace(/\b(?:AND|OR|NOT)\b\s+/gi,e=>e.replace(/\s+/g,` `)).replace(/\(\s+/g,`(`).replace(/\s+\)/g,`)`).replace(/[ \t]{2,}/g,` `)).join(``).trim()}function T(e){return It((0,Pt.serialize)(e))}var E={type:`EmptyExpression`,location:{start:0,end:0}},Lt=class extends Error{constructor(e,t){super(e),this.position=t,this.name=`ParseError`}},Rt=new Set([` `,` `,`
13
+ `,`(`]);function zt(e){let t=e.replace(/\u00A0/g,` `),n=``,r=!1,i=``;for(let e=0;e<t.length;e++){let a=t[e];if(r){n+=a,a===i&&(r=!1);continue}if(a===`"`||a===`'`){n+=a,r=!0,i=a;continue}if(a===`@`){let n=e===0?void 0:t[e-1];if(n===void 0||Rt.has(n))continue}n+=a}return n}var Bt=8,D=new Map;function Vt(e){let t=D.get(e);if(t)return D.delete(e),D.set(e,t),t}function Ht(e,t){if(D.size>=Bt){let e=D.keys().next().value;e!==void 0&&D.delete(e)}D.set(e,t)}function O(e){let t=zt(e).trim();if(t.length===0)return E;let n=Vt(t);if(n){if(n.ok)return n.ast;throw n.error}try{let e=(0,Pt.parse)(t);return Ht(t,{ok:!0,ast:e}),e}catch(e){let n=e instanceof Pt.SyntaxError?new Lt(e.message,e.offset):new Lt(`Invalid query syntax — check for unmatched quotes or parentheses.`);throw Ht(t,{ok:!1,error:n}),n}}function k(e){return e.type===`EmptyExpression`}function A(e,t,n=!1){if(e.type===`Tag`){t(e,n);return}if(e.type===`UnaryOperator`){let r=e.operator===`NOT`||e.operator===`-`;A(e.operand,t,n!==r);return}if(e.type===`LogicalExpression`){A(e.left,t,n),A(e.right,t,n);return}e.type===`ParenthesizedExpression`&&A(e.expression,t,n)}function j(e,t){if(e.type===`Tag`)return t(e)?e:E;if(e.type===`UnaryOperator`)return t(e.operand)?k(j(e.operand,t))?E:e:E;if(e.type===`LogicalExpression`){let n=j(e.left,t),r=j(e.right,t);return k(n)&&k(r)?E:k(n)?r:k(r)?n:{...e,left:n,right:r}}if(e.type===`ParenthesizedExpression`){let n=j(e.expression,t);return k(n)?E:n.type===`LogicalExpression`?{...e,expression:n}:n}return e}function Ut({currentQuery:e,fieldName:t,value:n,currentState:r,combinator:i=`AND`}){let a=Qt({currentQuery:e,fieldName:t,value:n});return r===`neutral`?M(a,`${t}:${N(n)}`,i):r===`include`?M(a,`NOT ${t}:${N(n)}`):a}function Wt({currentQuery:e,fieldName:t,value:n}){let r=`${t}:${N(n)}`;if(!e.trim())return M(e,r);let i;try{i=O(e)}catch{return e}let a=Gt(i,t);if(!a)return M(e,r);let o=e.trimStart(),s=e.length-o.length,c=`(${`${t}:${N(a.value)}`} OR ${r})`;return e.slice(0,s+a.start)+c+e.slice(s+a.end)}function Gt(e,t){let n=[];if(A(e,(e,r)=>{r||e.type===`Tag`&&e.field.type!==`ImplicitField`&&e.field.name===t&&e.expression.type===`LiteralExpression`&&n.push({value:String(e.expression.value),start:e.location.start,end:e.location.end})}),n.length!==1)return null;let r=n[0];return Kt(e,r.start,r.end)?null:r}function Kt(e,t,n){let r=!1,i=(e,a)=>{if(!r){if(e.type===`Tag`){a&&e.location.start===t&&e.location.end===n&&(r=!0);return}if(e.type===`LogicalExpression`){let t=e.operator.operator===`OR`;i(e.left,a||t),i(e.right,a||t);return}if(e.type===`UnaryOperator`){i(e.operand,a);return}e.type===`ParenthesizedExpression`&&i(e.expression,a)}};return i(e,!1),r}function qt({currentQuery:e,groupStart:t,groupEnd:n,fieldName:r,value:i}){if(!e.trim())return e;let a=e.trimStart(),o=e.length-a.length,s=o+n;if(s<=o+t)return e;let c=`${r}:${N(i)}`;return e.slice(0,s)+` OR ${c}`+e.slice(s)}function Jt({currentQuery:e,start:t,end:n,newValue:r}){if(!e.trim())return e;try{let i=O(e),a=null;if(A(i,e=>{e.type===`Tag`&&(e.location.start!==t||e.location.end!==n||e.field.type!==`ImplicitField`&&e.expression.type===`LiteralExpression`&&(a=e.field.name))}),a===null)return e;let o=e.trimStart(),s=e.length-o.length,c=`${a}:${N(r)}`;return e.slice(0,s+t)+c+e.slice(s+n)}catch{return e}}function Yt({currentQuery:e,start:t,end:n}){if(!e.trim())return e;let r=e.trimStart(),i=e.length-r.length,a=i+t,o=i+n,s=e.slice(a,o).toUpperCase(),c;if(s===`AND`)c=`OR`;else if(s===`OR`)c=`AND`;else return e;return e.slice(0,a)+c+e.slice(o)}function Xt({currentQuery:e,fieldName:t,from:n,to:r}){return M(Zt({currentQuery:e,fieldName:t}),`${t}:[${n} TO ${r}]`)}function Zt({currentQuery:e,fieldName:t}){if(!e.trim())return``;try{let n=j(O(e),e=>e.type!==`Tag`||e.field.type===`ImplicitField`?!0:e.field.name!==t);return k(n)?``:T(n)}catch{return e}}function Qt({currentQuery:e,fieldName:t,value:n}){if(!e.trim())return``;try{let r=j(O(e),e=>e.type!==`Tag`||e.field.type===`ImplicitField`||e.field.name!==t||e.expression.type!==`LiteralExpression`?!0:String(e.expression.value)!==n);return k(r)?``:T(r)}catch{return e}}function $t({currentQuery:e,value:t}){if(!e.trim())return``;try{let n=!1,r=j(O(e),e=>n||e.type!==`Tag`||e.field.type!==`ImplicitField`||e.expression.type!==`LiteralExpression`||String(e.expression.value)!==t?!0:(n=!0,!1));return k(r)?``:T(r)}catch{return e}}function en({currentQuery:e,start:t,end:n}){if(!e.trim())return``;try{let r=j(O(e),e=>e.type===`Tag`?!(e.location.start===t&&e.location.end===n):!0);return k(r)?``:T(r)}catch{return e}}function M(e,t,n=`AND`){let r=e.trim();return r?n===`OR`?`(${r}) OR (${t})`:`${r} AND ${t}`:t}function N(e){return e===``||!/^[A-Za-z0-9_.-]+$/.test(e)?`"${e.replace(/[\\"]/g,`\\$&`)}"`:e}var tn=`evaluator`,nn=`evaluatorVerdict`,rn=`evaluatorScore`,an=`evaluatorLabel`,on=new Set([nn,an]);function sn(e){return e.field.type===`ImplicitField`?null:e.field.name}function cn(e,t){let n=null,r=e=>{if(!n){if(e.type===`ParenthesizedExpression`){if(ln(e.expression,t)){n=e;return}r(e.expression);return}if(e.type===`LogicalExpression`){r(e.left),r(e.right);return}e.type===`UnaryOperator`&&r(e.operand)}};return r(e),n}function ln(e,t){return e.type===`Tag`?sn(e)===`evaluator`&&e.expression.type===`LiteralExpression`&&String(e.expression.value)===t:e.type===`LogicalExpression`&&e.operator.operator===`AND`?ln(e.left,t)||ln(e.right,t):!1}function un(e,t){A(e,(e,n)=>{if(e.type!==`Tag`)return;let r=sn(e);if(r){if(on.has(r)){if(e.expression.type!==`LiteralExpression`)return;t.categorical.push({field:r,value:String(e.expression.value),negated:n});return}if(r===`evaluatorScore`&&!n){if(e.expression.type===`RangeExpression`){t.score={from:e.expression.range.min,to:e.expression.range.max};return}if(e.expression.type===`LiteralExpression`){let n=e.operator.operator,r=e.expression.value,i=typeof r==`number`?r:parseFloat(String(r));if(!Number.isFinite(i))return;n===`:>`||n===`:>=`?t.score={from:i}:(n===`:<`||n===`:<=`)&&(t.score={to:i})}}}})}function dn(e,t){let n={present:!1,categorical:[],score:null};A(e,(e,r)=>{e.type!==`Tag`||r||sn(e)===`evaluator`&&e.expression.type===`LiteralExpression`&&String(e.expression.value)===t&&(n.present=!0)});let r=cn(e,t);return r&&un(r,n),n}function fn(e,t){if(!e.trim())return{present:!1,categorical:[],score:null};try{return dn(O(e),t)}catch{return{present:!1,categorical:[],score:null}}}function pn(e){let t=`${e.field}:${N(e.value)}`;return e.negated?`NOT ${t}`:t}function mn(e,t){let n=[`${tn}:${N(e)}`];for(let e of t.categorical)n.push(pn(e));if(t.score){let{from:e,to:r}=t.score;e!==void 0&&r!==void 0?n.push(`${rn}:[${e} TO ${r}]`):e===void 0?r!==void 0&&n.push(`${rn}:<=${r}`):n.push(`${rn}:>=${e}`)}return n.length===1?n[0]:`(${n.join(` AND `)})`}function hn(e,t){let n=cn(e,t),r=new Set;return n&&A(n,e=>{e.type===`Tag`&&r.add(e)}),j(e,e=>e.type===`Tag`?!(r.has(e)||sn(e)===`evaluator`&&e.expression.type===`LiteralExpression`&&String(e.expression.value)===t):!0)}function gn(e,t,n){let r;try{r=e.trim()?O(e):O(``)}catch{return e}let i=fn(e,t);n(i);let a=hn(r,t),o=k(a)?``:T(a),s=mn(t,i);return o?`${o} AND ${s}`:s}function _n({currentQuery:e,evaluatorId:t,field:n,value:r}){return gn(e,t,e=>{let t=e.categorical.findIndex(e=>e.field===n&&e.value===r);t<0?e.categorical.push({field:n,value:r,negated:!1}):e.categorical[t].negated?e.categorical.splice(t,1):e.categorical[t].negated=!0})}function vn({currentQuery:e,evaluatorId:t,from:n,to:r}){return gn(e,t,e=>{let t=Number(n),i=Number(r);e.score=Number.isFinite(t)&&Number.isFinite(i)?{from:t,to:i}:null})}function yn({currentQuery:e,evaluatorId:t}){return e.trim()?gn(e,t,e=>{e.score=null}):``}function P(e){if(e.type===`Tag`){if(e.expression.type===`EmptyExpression`){let t=e.field.type===`ImplicitField`?``:e.field.name;return t?`Missing value after \`${t}:\``:"Missing value after `:`"}return null}return e.type===`UnaryOperator`?P(e.operand):e.type===`LogicalExpression`?P(e.left)??P(e.right):e.type===`ParenthesizedExpression`?P(e.expression):null}function bn(e,t){let n=[],r=[];return A(e,(e,i)=>{if(e.type!==`Tag`||e.field.type===`ImplicitField`||e.field.name!==t||e.expression.type!==`LiteralExpression`)return;let a=String(e.expression.value);i?r.push(a):n.push(a)}),{include:n,exclude:r}}function xn(e,t,n){let{include:r,exclude:i}=bn(e,t);return r.includes(n)?`include`:i.includes(n)?`exclude`:`neutral`}function Sn(e){let t=new Map;return A(e,(e,n)=>{if(e.type!==`Tag`||e.field.type===`ImplicitField`||e.expression.type!==`LiteralExpression`)return;let r=`${e.field.name}|${String(e.expression.value)}`;t.set(r,n?`exclude`:`include`)}),t}function Cn(e,t){let n=null;return A(e,(e,r)=>{if(r||e.type!==`Tag`||e.field.type===`ImplicitField`||e.field.name!==t)return;if(e.expression.type===`RangeExpression`){n={from:e.expression.range.min,to:e.expression.range.max};return}if(e.expression.type!==`LiteralExpression`)return;let i=e.operator.operator;if(i===`:`)return;let a=e.expression.value,o=typeof a==`number`?a:parseFloat(String(a));Number.isFinite(o)&&(i===`:>`||i===`:>=`?n={from:o}:(i===`:<`||i===`:<=`)&&(n={to:o}))}),n}function wn(e,t){return`${e}|${t}`}function Tn(e){let t=[],n=new Map,r=new Map,i=e=>{if(e.type===`LogicalExpression`){if(e.operator.operator===`OR`){let i=F(e);if(i.length>1){let a=`or-${e.location.start}-${e.location.end}`,o=new Set(i.map(e=>e.field));t.push({id:a,fields:o,members:i,start:e.location.start,end:e.location.end});for(let e of i)n.set(wn(e.field,e.value),a);for(let e of o){let t=r.get(e);t?t.includes(a)||t.push(a):r.set(e,[a])}return}}i(e.left),i(e.right);return}if(e.type===`UnaryOperator`){i(e.operand);return}e.type===`ParenthesizedExpression`&&i(e.expression)};return i(e),{groups:t,memberToGroupId:n,fieldToGroupIds:r}}function F(e,t=!1){if(e.type===`LogicalExpression`)return e.operator.operator===`OR`?[...F(e.left,t),...F(e.right,t)]:[];if(e.type===`ParenthesizedExpression`)return F(e.expression,t);if(e.type===`UnaryOperator`){let n=e.operator===`NOT`||e.operator===`-`;return F(e.operand,t!==n)}return e.type===`Tag`?e.field.type===`ImplicitField`||e.expression.type!==`LiteralExpression`?[]:[{field:e.field.name,value:String(e.expression.value),negated:t,start:e.location.start,end:e.location.end}]:[]}var I={type:`EmptyExpression`,location:{start:0,end:0}},En=720*60*60*1e3;function Dn(){let e=Date.now();return{from:e-En,to:e,label:`Last 30 days`,presetId:`30d`}}var On=Dn();function kn(e){let t=e.trim();if(!t)return{ast:I,queryText:``,parseError:null};try{let n=O(t),r=P(n);return r?{ast:I,queryText:e,parseError:r}:{ast:n,queryText:k(n)?``:T(n),parseError:null}}catch(t){return{ast:I,queryText:e,parseError:t instanceof Lt?t.message:`Invalid query syntax — check for unmatched quotes or parentheses.`}}}function L(e,t){return{...kn(t(e.queryText)),page:1,pageCursors:{1:null},lastAiTranslation:null}}var An=u((e,t)=>({ast:I,queryText:``,parseError:null,aiError:null,timeRange:On,page:1,pageSize:50,pageCursors:{1:null},debouncedQueryText:``,debouncedTimeRange:On,lastAiTranslation:null,setAiError:t=>e({aiError:t}),dismissParseError:()=>e({parseError:null}),recordAiTranslation:t=>e({lastAiTranslation:t}),applyQueryText:t=>e(e=>{let n=kn(t);return n.parseError?t===e.queryText&&n.parseError===e.parseError?e:{queryText:t,parseError:n.parseError,aiError:null,lastAiTranslation:null}:n.queryText===e.queryText&&e.parseError===null&&e.aiError===null?e:{...n,aiError:null,page:1,pageCursors:{1:null},lastAiTranslation:null}}),setQuery:(t,n)=>e({ast:n,queryText:t,parseError:null,page:1,pageCursors:{1:null},lastAiTranslation:null}),setFilterFromLens:t=>e(()=>{let e=kn(t);return e.parseError?{ast:I,queryText:``,parseError:null,page:1,pageCursors:{1:null},lastAiTranslation:null}:{...e,page:1,pageCursors:{1:null},lastAiTranslation:null}}),toggleFacet:(t,n,r)=>e(e=>{let i=xn(e.ast,t,n);return i===`neutral`&&r?.orGroupLocation?L(e,e=>qt({currentQuery:e,groupStart:r.orGroupLocation.start,groupEnd:r.orGroupLocation.end,fieldName:t,value:n})):i===`neutral`&&r?.combinator!==`OR`?L(e,e=>Wt({currentQuery:e,fieldName:t,value:n})):L(e,e=>Ut({currentQuery:e,fieldName:t,value:n,currentState:i,combinator:r?.combinator??`AND`}))}),excludeFacet:(t,n)=>e(e=>xn(e.ast,t,n)===`exclude`?L(e,e=>Qt({currentQuery:e,fieldName:t,value:n})):L(e,e=>Ut({currentQuery:e,fieldName:t,value:n,currentState:`include`}))),toggleEvaluatorSubFilter:({evaluatorId:t,field:n,value:r})=>e(e=>L(e,e=>_n({currentQuery:e,evaluatorId:t,field:n,value:r}))),setEvaluatorScoreRange:({evaluatorId:t,from:n,to:r})=>e(e=>L(e,e=>vn({currentQuery:e,evaluatorId:t,from:n,to:r}))),removeEvaluatorScoreRange:({evaluatorId:t})=>e(e=>L(e,e=>yn({currentQuery:e,evaluatorId:t}))),swapOperator:(t,n)=>e(e=>L(e,e=>Yt({currentQuery:e,start:t,end:n}))),setFacetValueAt:(t,n,r)=>e(e=>L(e,e=>Jt({currentQuery:e,start:t,end:n,newValue:r}))),removeFacet:(t,n)=>e(e=>L(e,e=>Qt({currentQuery:e,fieldName:t,value:n}))),removeField:t=>e(e=>L(e,e=>Zt({currentQuery:e,fieldName:t}))),removeFreeText:t=>e(e=>L(e,e=>$t({currentQuery:e,value:t}))),setRange:(t,n,r)=>e(e=>L(e,e=>Xt({currentQuery:e,fieldName:t,from:n,to:r}))),removeRange:t=>e(e=>L(e,e=>Zt({currentQuery:e,fieldName:t}))),setTimeRange:t=>e({timeRange:t,page:1,pageCursors:{1:null}}),rollTimeRange:t=>e({timeRange:t}),setPage:t=>e({page:t}),setPageCursor:(t,n)=>e(e=>({pageCursors:{...e.pageCursors,[t]:n}})),resetPagination:()=>e({page:1,pageCursors:{1:null}}),setPageSize:t=>e({pageSize:t,page:1,pageCursors:{1:null}}),clearAll:()=>e({ast:I,queryText:``,parseError:null,aiError:null,page:1,pageCursors:{1:null},lastAiTranslation:null}),commitDebounced:()=>{let n=t();e({debouncedQueryText:n.parseError?n.debouncedQueryText:n.queryText,debouncedTimeRange:n.timeRange})}}));function jn(){try{return An.getState().queryText}catch{return``}}function Mn(){return(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 32 32`,children:[(0,g.jsx)(`g`,{fill:`#181818`,clipPath:`url(#clip0_3993_1955)`,children:(0,g.jsx)(`path`,{d:`M18.436 5l8.76 21.973H32L23.24 5h-4.804zM8.273 18.278l2.997-7.722 2.998 7.722H8.273zM8.759 5L0 26.973h4.897l1.792-4.615h9.163l1.791 4.614h4.898L13.78 5H8.76z`})}),(0,g.jsx)(`defs`,{children:(0,g.jsx)(`clipPath`,{id:`clip0_3993_1955`,children:(0,g.jsx)(`path`,{fill:`#fff`,d:`M0 0H32V22H0z`,transform:`translate(0 5)`})})})]})}function Nn(){return(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,xmlSpace:`preserve`,id:`Layer_1`,x:`0`,y:`0`,version:`1.1`,viewBox:`0 0 304 182`,children:[(0,g.jsx)(`path`,{fill:`#252F3E`,d:`M86.4 66.4c0 3.7.4 6.7 1.1 8.9.8 2.2 1.8 4.6 3.2 7.2.5.8.7 1.6.7 2.3 0 1-.6 2-1.9 3L83.2 92c-.9.6-1.8.9-2.6.9-1 0-2-.5-3-1.4-1.4-1.5-2.6-3.1-3.6-4.7-1-1.7-2-3.6-3.1-5.9Q59.2 94.7 41.5 94.7c-8.4 0-15.1-2.4-20-7.2s-7.4-11.2-7.4-19.2c0-8.5 3-15.4 9.1-20.6s14.2-7.8 24.5-7.8c3.4 0 6.9.3 10.6.8s7.5 1.3 11.5 2.2v-7.3c0-7.6-1.6-12.9-4.7-16-3.2-3.1-8.6-4.6-16.3-4.6-3.5 0-7.1.4-10.8 1.3s-7.3 2-10.8 3.4c-1.6.7-2.8 1.1-3.5 1.3s-1.2.3-1.6.3c-1.4 0-2.1-1-2.1-3.1v-4.9c0-1.6.2-2.8.7-3.5s1.4-1.4 2.8-2.1Q28.75 5 36.1 3.2C41 1.9 46.2 1.3 51.7 1.3c11.9 0 20.6 2.7 26.2 8.1 5.5 5.4 8.3 13.6 8.3 24.6v32.4zM45.8 81.6c3.3 0 6.7-.6 10.3-1.8s6.8-3.4 9.5-6.4c1.6-1.9 2.8-4 3.4-6.4s1-5.3 1-8.7v-4.2c-2.9-.7-6-1.3-9.2-1.7s-6.3-.6-9.4-.6c-6.7 0-11.6 1.3-14.9 4s-4.9 6.5-4.9 11.5c0 4.7 1.2 8.2 3.7 10.6 2.4 2.5 5.9 3.7 10.5 3.7m80.3 10.8c-1.8 0-3-.3-3.8-1-.8-.6-1.5-2-2.1-3.9L96.7 10.2c-.6-2-.9-3.3-.9-4 0-1.6.8-2.5 2.4-2.5h9.8c1.9 0 3.2.3 3.9 1 .8.6 1.4 2 2 3.9l16.8 66.2 15.6-66.2c.5-2 1.1-3.3 1.9-3.9s2.2-1 4-1h8c1.9 0 3.2.3 4 1 .8.6 1.5 2 1.9 3.9l15.8 67 17.3-67c.6-2 1.3-3.3 2-3.9.8-.6 2.1-1 3.9-1h9.3c1.6 0 2.5.8 2.5 2.5 0 .5-.1 1-.2 1.6s-.3 1.4-.7 2.5l-24.1 77.3q-.9 3-2.1 3.9c-.8.6-2.1 1-3.8 1h-8.6c-1.9 0-3.2-.3-4-1s-1.5-2-1.9-4L156 23l-15.4 64.4c-.5 2-1.1 3.3-1.9 4s-2.2 1-4 1zm128.5 2.7c-5.2 0-10.4-.6-15.4-1.8s-8.9-2.5-11.5-4c-1.6-.9-2.7-1.9-3.1-2.8s-.6-1.9-.6-2.8v-5.1c0-2.1.8-3.1 2.3-3.1q.9 0 1.8.3c.6.2 1.5.6 2.5 1 3.4 1.5 7.1 2.7 11 3.5 4 .8 7.9 1.2 11.9 1.2 6.3 0 11.2-1.1 14.6-3.3s5.2-5.4 5.2-9.5c0-2.8-.9-5.1-2.7-7s-5.2-3.6-10.1-5.2L246 52c-7.3-2.3-12.7-5.7-16-10.2-3.3-4.4-5-9.3-5-14.5q0-6.3 2.7-11.1c1.8-3.2 4.2-6 7.2-8.2 3-2.3 6.4-4 10.4-5.2s8.2-1.7 12.6-1.7c2.2 0 4.5.1 6.7.4 2.3.3 4.4.7 6.5 1.1 2 .5 3.9 1 5.7 1.6q2.7.9 4.2 1.8c1.4.8 2.4 1.6 3 2.5q.9 1.2.9 3.3v4.7c0 2.1-.8 3.2-2.3 3.2-.8 0-2.1-.4-3.8-1.2q-8.55-3.9-19.2-3.9c-5.7 0-10.2.9-13.3 2.8s-4.7 4.8-4.7 8.9c0 2.8 1 5.2 3 7.1s5.7 3.8 11 5.5l14.2 4.5c7.2 2.3 12.4 5.5 15.5 9.6s4.6 8.8 4.6 14c0 4.3-.9 8.2-2.6 11.6-1.8 3.4-4.2 6.4-7.3 8.8-3.1 2.5-6.8 4.3-11.1 5.6-4.5 1.4-9.2 2.1-14.3 2.1`}),(0,g.jsxs)(`g`,{fill:`#F90`,fillRule:`evenodd`,clipRule:`evenodd`,children:[(0,g.jsx)(`path`,{d:`M273.5 143.7c-32.9 24.3-80.7 37.2-121.8 37.2-57.6 0-109.5-21.3-148.7-56.7-3.1-2.8-.3-6.6 3.4-4.4 42.4 24.6 94.7 39.5 148.8 39.5 36.5 0 76.6-7.6 113.5-23.2 5.5-2.5 10.2 3.6 4.8 7.6`}),(0,g.jsx)(`path`,{d:`M287.2 128.1c-4.2-5.4-27.8-2.6-38.5-1.3-3.2.4-3.7-2.4-.8-4.5 18.8-13.2 49.7-9.4 53.3-5 3.6 4.5-1 35.4-18.6 50.2-2.7 2.3-5.3 1.1-4.1-1.9 4-9.9 12.9-32.2 8.7-37.5`,className:`st1`})]})]})}function Pn(){return(0,g.jsxs)(`svg`,{fill:`currentColor`,style:{flex:`none`,lineHeight:`1`},viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,g.jsx)(`title`,{children:`Cerebras`}),(0,g.jsx)(`path`,{"clip-rule":`evenodd`,d:`M14.121 2.701a9.299 9.299 0 000 18.598V22.7c-5.91 0-10.7-4.791-10.7-10.701S8.21 1.299 14.12 1.299V2.7zm4.752 3.677A7.353 7.353 0 109.42 17.643l-.901 1.074a8.754 8.754 0 01-1.08-12.334 8.755 8.755 0 0112.335-1.08l-.901 1.075zm-2.255.844a5.407 5.407 0 00-5.048 9.563l-.656 1.24a6.81 6.81 0 016.358-12.043l-.654 1.24zM14.12 8.539a3.46 3.46 0 100 6.922v1.402a4.863 4.863 0 010-9.726v1.402z`,fill:`#F15A29`,"fill-rule":`evenodd`}),(0,g.jsx)(`path`,{d:`M15.407 10.836a2.24 2.24 0 00-.51-.409 1.084 1.084 0 00-.544-.152c-.255 0-.483.047-.684.14a1.58 1.58 0 00-.84.912c-.074.203-.11.416-.11.631 0 .218.036.43.11.631a1.594 1.594 0 00.84.913c.2.093.43.14.684.14.216 0 .417-.046.602-.135.188-.09.35-.225.475-.392l.928 1.006c-.14.14-.3.261-.482.363a3.367 3.367 0 01-1.083.38c-.17.026-.317.04-.44.04a3.315 3.315 0 01-1.182-.21 2.825 2.825 0 01-.961-.597 2.816 2.816 0 01-.644-.929 2.987 2.987 0 01-.238-1.21c0-.444.08-.847.238-1.21.15-.35.368-.666.643-.929.278-.261.605-.464.962-.596a3.315 3.315 0 011.182-.21c.355 0 .712.068 1.072.204.361.138.685.36.944.649l-.962.97z`})]})}function Fn(){return(0,g.jsxs)(`svg`,{viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":!0,children:[(0,g.jsx)(`title`,{children:`Codex`}),(0,g.jsxs)(r,{as:`g`,_dark:{display:`none`},children:[(0,g.jsx)(`path`,{d:`M19.503 0H4.496A4.496 4.496 0 000 4.496v15.007A4.496 4.496 0 004.496 24h15.007A4.496 4.496 0 0024 19.503V4.496A4.496 4.496 0 0019.503 0z`,fill:`#fff`}),(0,g.jsx)(`path`,{d:`M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z`,fill:`url(#codex-brand-gradient)`})]}),(0,g.jsx)(r,{as:`g`,display:`none`,_dark:{display:`inline`},children:(0,g.jsx)(`path`,{fill:`#fff`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z`})}),(0,g.jsx)(`defs`,{children:(0,g.jsxs)(`linearGradient`,{gradientUnits:`userSpaceOnUse`,id:`codex-brand-gradient`,x1:`12`,x2:`12`,y1:`3`,y2:`21`,children:[(0,g.jsx)(`stop`,{stopColor:`#B1A7FF`}),(0,g.jsx)(`stop`,{offset:`.5`,stopColor:`#7A9DFF`}),(0,g.jsx)(`stop`,{offset:`1`,stopColor:`#3941FF`})]})})]})}function In(){return(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,g.jsx)(`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`}),(0,g.jsx)(`polyline`,{points:`3.27 6.96 12 12.01 20.73 6.96`}),(0,g.jsx)(`line`,{x1:`12`,y1:`22.08`,x2:`12`,y2:`12`})]})}function Ln(){return(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 512 512`,children:[(0,g.jsx)(`g`,{clipPath:`url(#clip0_5770_2470)`,children:(0,g.jsx)(`path`,{fill:`#4D6BFE`,d:`M506.624 95.616c-5.419-2.645-7.765 2.41-10.923 4.992-1.088.832-2.005 1.92-2.922 2.902-7.936 8.469-17.195 14.016-29.291 13.354-17.685-.981-32.789 4.566-46.144 18.091-2.837-16.683-12.267-26.624-26.603-33.024-7.509-3.328-15.104-6.635-20.373-13.867-3.669-5.141-4.672-10.88-6.507-16.512-1.173-3.413-2.346-6.89-6.25-7.467-4.267-.66-5.931 2.902-7.595 5.889-6.677 12.202-9.259 25.642-9.003 39.253.576 30.634 13.504 55.04 39.211 72.384 2.923 1.984 3.669 3.989 2.752 6.89-1.749 5.974-3.84 11.776-5.675 17.771-1.173 3.819-2.922 4.629-7.018 2.987a117.9 117.9 0 0 1-37.035-25.174c-18.283-17.664-34.795-37.162-55.403-52.437a243 243 0 0 0-14.698-10.048c-21.014-20.416 2.773-37.184 8.277-39.168 5.76-2.09 1.984-9.216-16.619-9.13-18.602.085-35.626 6.293-57.322 14.591a65 65 0 0 1-9.92 2.923 204.7 204.7 0 0 0-61.504-2.176c-40.214 4.48-72.32 23.509-95.936 55.957-28.374 38.998-35.051 83.328-26.88 129.536 8.597 48.726 33.472 89.067 71.68 120.598 39.637 32.704 85.269 48.725 137.344 45.653 31.616-1.813 66.837-6.059 106.538-39.68 10.027 4.992 20.523 6.976 37.974 8.469 13.44 1.259 26.368-.64 36.373-2.73 15.68-3.328 14.592-17.856 8.939-20.502-45.974-21.418-35.883-12.693-45.078-19.754 23.382-27.648 58.582-56.363 72.363-149.398 1.067-7.402.149-12.053 0-18.026-.085-3.627.747-5.056 4.907-5.462a89 89 0 0 0 32.96-10.133c29.781-16.277 41.813-42.987 44.65-75.029.427-4.907-.085-9.941-5.269-12.523M247.061 384c-44.565-35.029-66.176-46.571-75.093-46.08-8.363.512-6.848 10.048-5.013 16.277 1.92 6.144 4.416 10.368 7.914 15.766 2.432 3.562 4.096 8.874-2.41 12.864-14.358 8.874-39.296-2.987-40.47-3.563-29.034-17.109-53.333-39.68-70.421-70.549-16.512-29.718-26.112-61.59-27.69-95.616-.427-8.235 1.983-11.136 10.175-12.63a100.2 100.2 0 0 1 32.619-.832c45.483 6.656 84.181 26.987 116.651 59.179 18.517 18.347 32.533 40.256 46.976 61.675 15.36 22.741 31.872 44.416 52.906 62.165 7.424 6.229 13.334 10.965 19.008 14.443-17.109 1.92-45.653 2.346-65.152-13.099m21.334-137.387a6.527 6.527 0 0 1 8.853-6.122 6.45 6.45 0 0 1 4.267 6.144 6.55 6.55 0 0 1-1.935 4.66 6.51 6.51 0 0 1-4.679 1.889 6.45 6.45 0 0 1-4.622-1.923 6.5 6.5 0 0 1-1.4-2.136 6.5 6.5 0 0 1-.484-2.512m66.346 34.048c-4.266 1.728-8.512 3.222-12.586 3.414a26.56 26.56 0 0 1-17.024-5.419c-5.846-4.907-10.027-7.637-11.776-16.171a36.9 36.9 0 0 1 .341-12.544c1.493-6.976-.171-11.456-5.099-15.509-3.989-3.328-9.088-4.245-14.677-4.245a11.9 11.9 0 0 1-5.419-1.664c-2.346-1.152-4.266-4.054-2.432-7.638.598-1.152 3.414-3.968 4.096-4.48 7.595-4.309 16.363-2.901 24.448.342 7.51 3.072 13.184 8.704 21.355 16.682 8.341 9.622 9.856 12.288 14.613 19.499 3.755 5.653 7.168 11.456 9.494 18.091 1.429 4.16-.406 7.552-5.334 9.642`})}),(0,g.jsx)(`defs`,{children:(0,g.jsx)(`clipPath`,{id:`clip0_5770_2470`,children:(0,g.jsx)(`path`,{fill:`#fff`,d:`M0 0h512v512H0z`})})})]})}function Rn(){return(0,g.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,children:(0,g.jsx)(`path`,{fill:`currentColor`,d:`M8 3.5h3v17H8v-17zm5 0h3v17h-3v-17z`})})}function zn(){let e=(0,h.useId)();return(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,children:[(0,g.jsx)(`path`,{fill:`url(#${e})`,d:`M16 8.016A8.52 8.52 0 0 0 8.016 16h-.032A8.52 8.52 0 0 0 0 8.016v-.032A8.52 8.52 0 0 0 7.984 0h.032A8.52 8.52 0 0 0 16 7.984z`}),(0,g.jsx)(`defs`,{children:(0,g.jsxs)(`radialGradient`,{id:e,cx:`0`,cy:`0`,r:`1`,gradientTransform:`matrix(16.1326 5.4553 -43.70045 129.2322 1.588 6.503)`,gradientUnits:`userSpaceOnUse`,children:[(0,g.jsx)(`stop`,{offset:`0.067`,stopColor:`#9168C0`}),(0,g.jsx)(`stop`,{offset:`0.343`,stopColor:`#5684D1`}),(0,g.jsx)(`stop`,{offset:`0.672`,stopColor:`#1BA1E3`})]})})]})}function Bn(){return(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,preserveAspectRatio:`xMidYMid`,viewBox:`0 -25 256 256`,children:[(0,g.jsx)(`path`,{fill:`#EA4335`,d:`m170.252 56.819 22.253-22.253 1.483-9.37C153.437-11.677 88.976-7.496 52.42 33.92 42.267 45.423 34.734 59.764 30.717 74.573l7.97-1.123 44.505-7.34 3.436-3.513c19.797-21.742 53.27-24.667 76.128-6.168z`}),(0,g.jsx)(`path`,{fill:`#4285F4`,d:`M224.205 73.918a100.25 100.25 0 0 0-30.217-48.722l-31.232 31.232a55.52 55.52 0 0 1 20.379 44.037v5.544c15.35 0 27.797 12.445 27.797 27.796 0 15.352-12.446 27.485-27.797 27.485h-55.671l-5.466 5.934v33.34l5.466 5.231h55.67c39.93.311 72.553-31.494 72.864-71.424a72.3 72.3 0 0 0-31.793-60.453`}),(0,g.jsx)(`path`,{fill:`#34A853`,d:`M71.87 205.796h55.593V161.29H71.87a27.3 27.3 0 0 1-11.399-2.498l-7.887 2.42-22.409 22.253-1.952 7.574c12.567 9.489 27.9 14.825 43.647 14.757`}),(0,g.jsx)(`path`,{fill:`#FBBC05`,d:`M71.87 61.426C31.94 61.663-.237 94.227.001 134.158a72.3 72.3 0 0 0 28.222 56.88l32.248-32.246c-13.99-6.322-20.208-22.786-13.887-36.776s22.786-20.208 36.775-13.888a27.8 27.8 0 0 1 13.887 13.888l32.248-32.248A72.22 72.22 0 0 0 71.87 61.427`})]})}function Vn(){return(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,className:`fill-foreground`,viewBox:`0 0 24 24`,children:[(0,g.jsx)(`path`,{fill:`#F55036`,d:`M24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12z`}),(0,g.jsx)(`path`,{fill:`#fff`,d:`M12.002 6a4.118 4.118 0 00-4.118 4.108 4.118 4.118 0 004.118 4.109h1.354v-1.541h-1.354a2.574 2.574 0 01-2.574-2.568 2.574 2.574 0 012.574-2.568c1.42 0 2.58 1.152 2.58 2.568v3.784a2.58 2.58 0 01-2.555 2.567 2.558 2.558 0 01-1.791-.752l-1.092 1.09a4.095 4.095 0 002.855 1.202l.028.001h.029a4.118 4.118 0 004.061-4.09l.002-3.903A4.119 4.119 0 0012.002 6z`})]})}function Hn(){return(0,g.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 32 32`,"aria-label":`Voyage AI`,children:(0,g.jsxs)(`g`,{fill:`#1A1A1A`,children:[(0,g.jsx)(`path`,{d:`M16 4l-7.2 17.5h3.6l1.45-3.7h4.3l1.45 3.7H23.2L16 4zm-1.05 10.85L16 11.7l1.05 3.15h-2.1z`}),(0,g.jsx)(`path`,{d:`M5.5 24h21v3h-21z`})]})})}function Un(){return(0,g.jsxs)(`svg`,{fill:`currentColor`,"fill-rule":`evenodd`,style:{flex:`none`,lineHeight:`1`},viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,g.jsx)(`title`,{children:`Grok`}),(0,g.jsx)(`path`,{d:`M6.469 8.776L16.512 23h-4.464L2.005 8.776H6.47zm-.004 7.9l2.233 3.164L6.467 23H2l4.465-6.324zM22 2.582V23h-3.659V7.764L22 2.582zM22 1l-9.952 14.095-2.233-3.163L17.533 1H22z`})]})}var Wn={openai:(0,g.jsx)(p,{}),openai_codex:(0,g.jsx)(Fn,{}),azure:(0,g.jsx)(f,{}),anthropic:(0,g.jsx)(Mn,{}),elevenlabs:(0,g.jsx)(Rn,{}),groq:(0,g.jsx)(Vn,{}),vertex_ai:(0,g.jsx)(Bn,{}),gemini:(0,g.jsx)(zn,{}),google_agent_platform:(0,g.jsx)(Bn,{}),bedrock:(0,g.jsx)(Nn,{}),deepseek:(0,g.jsx)(Ln,{}),custom:(0,g.jsx)(In,{}),xai:(0,g.jsx)(Un,{}),cerebras:(0,g.jsx)(Pn,{}),voyage:(0,g.jsx)(Hn,{}),azure_safety:(0,g.jsx)(f,{})},Gn=new Set([`openai`,`anthropic`,`voyage`,`custom`]);function Kn({provider:e,size:t}){let n=Wn[e];return n?(0,g.jsx)(r,{width:t,height:t,flexShrink:0,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,css:{"& > svg":{width:`100%`,height:`100%`}},_dark:Gn.has(e)?{filter:`invert(1) brightness(0.92)`}:void 0,"aria-hidden":`true`,children:n}):null}var qn=Symbol.for(`immer-nothing`),Jn=Symbol.for(`immer-draftable`),R=Symbol.for(`immer-state`);function z(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var B=Object,V=B.getPrototypeOf,H=`constructor`,U=`prototype`,Yn=`configurable`,Xn=`enumerable`,Zn=`writable`,W=`value`,G=e=>!!e&&!!e[R];function K(e){return e?er(e)||or(e)||!!e[Jn]||!!e[H]?.[Jn]||sr(e)||cr(e):!1}var Qn=B[U][H].toString(),$n=new WeakMap;function er(e){if(!e||!lr(e))return!1;let t=V(e);if(t===null||t===B[U])return!0;let n=B.hasOwnProperty.call(t,H)&&t[H];if(n===Object)return!0;if(!J(n))return!1;let r=$n.get(n);return r===void 0&&(r=Function.toString.call(n),$n.set(n,r)),r===Qn}function tr(e,t,n=!0){q(e)===0?(n?Reflect.ownKeys(e):B.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function q(e){let t=e[R];return t?t.type_:or(e)?1:sr(e)?2:cr(e)?3:0}var nr=(e,t,n=q(e))=>n===2?e.has(t):B[U].hasOwnProperty.call(e,t),rr=(e,t,n=q(e))=>n===2?e.get(t):e[t],ir=(e,t,n,r=q(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function ar(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var or=Array.isArray,sr=e=>e instanceof Map,cr=e=>e instanceof Set,lr=e=>typeof e==`object`,J=e=>typeof e==`function`,ur=e=>typeof e==`boolean`;function dr(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Y=e=>e.copy_||e.base_,fr=e=>e.modified_?e.copy_:e.base_;function pr(e,t){if(sr(e))return new Map(e);if(cr(e))return new Set(e);if(or(e))return Array[U].slice.call(e);let n=er(e);if(t===!0||t===`class_only`&&!n){let t=B.getOwnPropertyDescriptors(e);delete t[R];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[Zn]===!1&&(a[Zn]=!0,a[Yn]=!0),(a.get||a.set)&&(t[i]={[Yn]:!0,[Zn]:!0,[Xn]:a[Xn],[W]:e[i]})}return B.create(V(e),t)}else{let t=V(e);if(t!==null&&n)return{...e};let r=B.create(t);return B.assign(r,e)}}function mr(e,t=!1){return _r(e)||G(e)||!K(e)?e:(q(e)>1&&B.defineProperties(e,{set:gr,add:gr,clear:gr,delete:gr}),B.freeze(e),t&&tr(e,(e,t)=>{mr(t,!0)},!1),e)}function hr(){z(2)}var gr={[W]:hr};function _r(e){return e===null||!lr(e)?!0:B.isFrozen(e)}var vr=`MapSet`,yr=`Patches`,br=`ArrayMethods`,xr={};function X(e){let t=xr[e];return t||z(0,e),t}var Sr=e=>!!xr[e],Z,Cr=()=>Z,wr=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Sr(vr)?X(vr):void 0,arrayMethodsPlugin_:Sr(br)?X(br):void 0});function Tr(e,t){t&&(e.patchPlugin_=X(yr),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Er(e){Dr(e),e.drafts_.forEach(kr),e.drafts_=null}function Dr(e){e===Z&&(Z=e.parent_)}var Or=e=>Z=wr(Z,e);function kr(e){let t=e[R];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ar(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[R].modified_&&(Er(t),z(4)),K(e)&&(e=jr(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[R].base_,e,t)}else e=jr(t,n);return Mr(t,e,!0),Er(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===qn?void 0:e}function jr(e,t){if(_r(t))return t;let n=t[R];if(!n)return Br(t,e.handledSet_,e);if(!Pr(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);Rr(n,e)}return n.copy_}function Mr(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&mr(t,n)}function Nr(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Pr=(e,t)=>e.scope_===t,Fr=[];function Ir(e,t,n,r){let i=Y(e),a=e.type_;if(r!==void 0&&rr(i,r,a)===t){ir(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;tr(i,(e,n)=>{if(G(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??Fr;for(let e of o)ir(i,e,n,a)}function Lr(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!Pr(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=fr(i);Ir(e,i.draft_??i,a,n),Rr(i,r)})}function Rr(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Nr(e)}}function zr(e,t,n){let{scope_:r}=e;if(G(n)){let i=n[R];Pr(i,r)&&i.callbacks_.push(function(){$(e),Ir(e,n,fr(i),t)})}else K(n)&&e.callbacks_.push(function(){let i=Y(e);e.type_===3?i.has(n)&&Br(n,r.handledSet_,r):rr(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Br(rr(e.copy_,t,e.type_),r.handledSet_,r)})}function Br(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||G(e)||t.has(e)||!K(e)||_r(e)?e:(t.add(e),tr(e,(r,i)=>{if(G(i)){let t=i[R];Pr(t,n)&&(ir(e,r,fr(t),e.type_),Nr(t))}else K(i)&&Br(i,t,n)}),e)}function Vr(e,t){let n=or(e),r={type_:+!!n,scope_:t?t.scope_:Cr(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=Hr;n&&(i=[r],a=Q);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var Hr={get(e,t){if(t===R)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=Y(e);if(!nr(i,t,e.type_))return Wr(e,i,t);let a=i[t];if(e.finalized_||!K(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&dr(t))return a;if(a===Ur(e.base_,t)){$(e);let n=e.type_===1?+t:t,r=Jr(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in Y(e)},ownKeys(e){return Reflect.ownKeys(Y(e))},set(e,t,n){let r=Gr(Y(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=Ur(Y(e),t),i=r?.[R];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(ar(n,r)&&(n!==void 0||nr(e.base_,t,e.type_)))return!0;$(e),Kr(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),zr(e,t,n),!0)},deleteProperty(e,t){return $(e),Ur(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Kr(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Y(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Zn]:!0,[Yn]:e.type_!==1||t!==`length`,[Xn]:r[Xn],[W]:n[t]}},defineProperty(){z(11)},getPrototypeOf(e){return V(e.base_)},setPrototypeOf(){z(12)}},Q={};for(let e in Hr){let t=Hr[e];Q[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}Q.deleteProperty=function(e,t){return Q.set.call(this,e,t,void 0)},Q.set=function(e,t,n){return Hr.set.call(this,e[0],t,n,e[0])};function Ur(e,t){let n=e[R];return(n?Y(n):e)[t]}function Wr(e,t,n){let r=Gr(t,n);return r?W in r?r[W]:r.get?.call(e.draft_):void 0}function Gr(e,t){if(!(t in e))return;let n=V(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=V(n)}}function Kr(e){e.modified_||(e.modified_=!0,e.parent_&&Kr(e.parent_))}function $(e){e.copy_||=(e.assigned_=new Map,pr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var qr=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(J(e)&&!J(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}J(t)||z(6),n!==void 0&&!J(n)&&z(7);let r;if(K(e)){let i=Or(this),a=Jr(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?Er(i):Dr(i)}return Tr(i,n),Ar(r,i)}else if(!e||!lr(e)){if(r=t(e),r===void 0&&(r=e),r===qn&&(r=void 0),this.autoFreeze_&&mr(r,!0),n){let t=[],i=[];X(yr).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}else z(1,e)},this.produceWithPatches=(e,t)=>{if(J(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},ur(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ur(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ur(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){K(e)||z(8),G(e)&&(e=Yr(e));let t=Or(this),n=Jr(t,e,void 0);return n[R].isManual_=!0,Dr(t),n}finishDraft(e,t){let n=e&&e[R];(!n||!n.isManual_)&&z(9);let{scope_:r}=n;return Tr(r,t),Ar(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=X(yr).applyPatches_;return G(e)?r(e,t):this.produce(e,e=>r(e,t))}};function Jr(e,t,n,r){let[i,a]=sr(t)?X(vr).proxyMap_(t,n):cr(t)?X(vr).proxySet_(t,n):Vr(t,n);return(n?.scope_??Cr()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Lr(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function Yr(e){return G(e)||z(10,e),Xr(e)}function Xr(e){if(!K(e)||_r(e))return e;let t=e[R],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=pr(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=pr(e,!0);return tr(n,(e,t)=>{ir(n,e,Xr(t))},r),t&&(t.finalized_=!1),n}var Zr=new qr().produce,Qr=e=>e;export{re as $,Fe as A,Ae as B,O as C,lt as D,dt as E,Re as F,he as G,Te as H,ke as I,pe as J,Se as K,Be as L,ze as M,je as N,Ve as O,Ie as P,ie as Q,Le as R,A as S,ft as T,me as U,Me as V,xe as W,oe as X,se as Y,ae as Z,nn as _,Zr as a,en as b,On as c,Tn as d,ne as et,Sn as f,an as g,Cn as h,K as i,Pe as j,Ne as k,jn as l,bn as m,Yr as n,Kn as o,xn as p,v as q,G as r,Wn as s,Qr as t,te as tt,An as u,dn as v,zt as w,Yt as x,N as y,y as z};
14
+ //# sourceMappingURL=immer-DImI3Uq2.js.map