@esri/solutions-components 5.1.0-next.71 → 5.1.0-next.73

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 (2301) hide show
  1. package/dist/cdn/2B4SGB3I.js +2 -0
  2. package/dist/cdn/{JGBE6W5D.js → 2MOSXHFG.js} +1 -1
  3. package/dist/cdn/2SCW7VSF.js +2 -0
  4. package/dist/cdn/35XXJCZT.js +2 -0
  5. package/dist/cdn/3FL3PNLU.js +2 -0
  6. package/dist/cdn/3FZDFAPN.js +2 -0
  7. package/dist/cdn/47IJA2SQ.js +2 -0
  8. package/dist/cdn/{T2AB3WXG.js → 4TYKXT5H.js} +42 -42
  9. package/dist/cdn/{OE6KC4HH.js → 5CARFDI3.js} +1 -1
  10. package/dist/cdn/{22E4IM57.js → 5HZOUKRN.js} +3 -216
  11. package/dist/cdn/{RVWM44LJ.js → 5OKASTA4.js} +1 -1
  12. package/dist/cdn/7FF5YSNR.js +2 -0
  13. package/dist/cdn/{Q7E2INX4.js → 7VFHFVJM.js} +1 -1
  14. package/dist/cdn/7YLCROT7.js +2 -0
  15. package/dist/cdn/ARWREGJS.js +2 -0
  16. package/dist/cdn/ATPI4B7J.js +2 -0
  17. package/dist/cdn/{ODTVWDBH.js → AYCGL3SF.js} +1 -1
  18. package/dist/cdn/BFRX6PST.js +2 -0
  19. package/dist/cdn/BGH2AS23.js +2 -0
  20. package/dist/cdn/{5ACPQLAA.js → BM666UZR.js} +1 -1
  21. package/dist/cdn/BOROZS32.js +2 -0
  22. package/dist/cdn/BZT6R6HU.js +2 -0
  23. package/dist/cdn/CEP54NLT.js +2 -0
  24. package/dist/cdn/CFBQUUDC.js +7 -0
  25. package/dist/cdn/CHHIDAIO.js +2 -0
  26. package/dist/cdn/CMZNMR3O.js +2 -0
  27. package/dist/cdn/D3XBFWCF.js +2 -0
  28. package/dist/cdn/D5FEDX3A.js +2 -0
  29. package/dist/cdn/{FUMGEW3L.js → DHM4CMZF.js} +1 -1
  30. package/dist/cdn/{VAJZ3T2O.js → DQ5KCIUN.js} +1 -1
  31. package/dist/cdn/DXXYVHWW.js +2 -0
  32. package/dist/cdn/EACG35UF.js +2 -0
  33. package/dist/cdn/{4JCVPEL7.js → EBWKBVOW.js} +1 -1
  34. package/dist/cdn/EEHNMGTM.js +2 -0
  35. package/dist/cdn/EMXGXBXU.js +2 -0
  36. package/dist/cdn/F7G3JSDV.js +2 -0
  37. package/dist/cdn/FBXNPZPC.js +2 -0
  38. package/dist/cdn/FKVDFVJD.js +2 -0
  39. package/dist/cdn/FPV4WS5B.js +2 -0
  40. package/dist/cdn/FUJV2OPO.js +2 -0
  41. package/dist/cdn/HBALPM34.js +2 -0
  42. package/dist/cdn/{K5CBVZDG.js → HBQN25RR.js} +3 -3
  43. package/dist/cdn/{QUHTVGG6.js → HHR7TKXF.js} +1 -1
  44. package/dist/cdn/HIWKSSJD.js +2 -0
  45. package/dist/cdn/HNNENA73.js +2 -0
  46. package/dist/cdn/IXPYSOIL.js +2 -0
  47. package/dist/cdn/J2NEDI2T.js +2 -0
  48. package/dist/cdn/{Q23LVZJQ.js → JOI3ZKK5.js} +1 -70
  49. package/dist/cdn/K7RFTZ56.js +2 -0
  50. package/dist/cdn/KJNYVH65.js +2 -0
  51. package/dist/cdn/{AKBA4TMK.js → KQBIVJ7H.js} +2 -2
  52. package/dist/cdn/KWFCHK6U.js +2 -0
  53. package/dist/cdn/LOSZZK4D.js +2 -0
  54. package/dist/cdn/LWM6GMKX.js +2 -0
  55. package/dist/cdn/{TGDVJ7YY.js → MS34ZMXL.js} +1 -1
  56. package/dist/cdn/MXFEGFHP.js +2 -0
  57. package/dist/cdn/MYIJ4DQY.js +21 -0
  58. package/dist/cdn/NJJYHW6D.js +2 -0
  59. package/dist/cdn/NLILOBN5.js +2 -0
  60. package/dist/cdn/NO7Q6ULD.js +2 -0
  61. package/dist/cdn/NTBODSSX.js +2 -0
  62. package/dist/cdn/{GXY54IYP.js → OAFE6H7U.js} +1 -1
  63. package/dist/cdn/OZZ2CCGL.js +2 -0
  64. package/dist/cdn/PP7IZNAR.js +2 -0
  65. package/dist/cdn/{K3TUROKL.js → RBYBNP2B.js} +1 -19
  66. package/dist/cdn/RNA5LDZ5.js +2 -0
  67. package/dist/cdn/ROO45KNC.js +2 -0
  68. package/dist/cdn/S37HZZ6Y.js +2 -0
  69. package/dist/cdn/SF5GTQEL.js +2 -0
  70. package/dist/cdn/SHFWVVGY.js +2 -0
  71. package/dist/cdn/SICXVIQQ.js +2 -0
  72. package/dist/cdn/T3KDTF34.js +2 -0
  73. package/dist/cdn/T4B64LSQ.js +2 -0
  74. package/dist/cdn/TRADVQJJ.js +2 -0
  75. package/dist/cdn/UPXLJJKV.js +2 -0
  76. package/dist/cdn/VDADP5AY.js +2 -0
  77. package/dist/cdn/{O7MVRXAG.js → VWU4KCEV.js} +1 -1
  78. package/dist/cdn/W3QL6FH2.js +2 -0
  79. package/dist/cdn/WFAI6ZZB.js +2 -0
  80. package/dist/cdn/WJSVRU72.js +2 -0
  81. package/dist/cdn/WXGTKA7P.js +2 -0
  82. package/dist/cdn/{OFGPQKW6.js → XAC6OXJQ.js} +1 -1
  83. package/dist/cdn/XD5JASLO.js +2 -0
  84. package/dist/cdn/XDADY4F7.js +2 -0
  85. package/dist/cdn/XFQNCJ4I.js +2 -0
  86. package/dist/cdn/{QFJRYOJK.js → XU2HEOFI.js} +4 -63
  87. package/dist/cdn/XVVH74AJ.js +2 -0
  88. package/dist/cdn/YEUQVA7X.js +2 -0
  89. package/dist/cdn/YQ7JYIBN.js +352 -0
  90. package/dist/cdn/YVNP437O.js +2 -0
  91. package/dist/cdn/{LP3LM7ET.js → ZIGRP4UM.js} +1 -1
  92. package/dist/cdn/ZIVKAX4G.js +2 -0
  93. package/dist/cdn/ZXA4Y7R7.js +2 -0
  94. package/dist/cdn/assets/arcgis-pdf-creator/labelFormats.json +1 -191
  95. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ar.json +1 -29
  96. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bg.json +1 -29
  97. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bs.json +1 -29
  98. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ca.json +1 -29
  99. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.cs.json +1 -29
  100. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.da.json +1 -29
  101. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.de.json +1 -29
  102. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.el.json +1 -29
  103. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.en.json +1 -61
  104. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.es.json +1 -29
  105. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.et.json +1 -29
  106. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fi.json +1 -29
  107. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fr.json +1 -29
  108. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.he.json +1 -29
  109. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hr.json +1 -29
  110. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hu.json +1 -29
  111. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.id.json +1 -29
  112. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.it.json +1 -29
  113. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ja.json +1 -29
  114. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.json +1 -61
  115. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ko.json +1 -29
  116. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lt.json +1 -29
  117. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lv.json +1 -29
  118. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.nl.json +1 -29
  119. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.no.json +1 -29
  120. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pl.json +1 -29
  121. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-BR.json +1 -29
  122. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-PT.json +1 -29
  123. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ro.json +1 -29
  124. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ru.json +1 -29
  125. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sk.json +1 -29
  126. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sl.json +1 -29
  127. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sr.json +1 -29
  128. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sv.json +1 -29
  129. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.th.json +1 -29
  130. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.tr.json +1 -29
  131. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.uk.json +1 -29
  132. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.vi.json +1 -29
  133. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-CN.json +1 -29
  134. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-HK.json +1 -29
  135. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-TW.json +1 -29
  136. package/dist/cdn/assets/buffer-tools/t9n/messages.ar.json +1 -6
  137. package/dist/cdn/assets/buffer-tools/t9n/messages.bg.json +1 -6
  138. package/dist/cdn/assets/buffer-tools/t9n/messages.bs.json +1 -6
  139. package/dist/cdn/assets/buffer-tools/t9n/messages.ca.json +1 -6
  140. package/dist/cdn/assets/buffer-tools/t9n/messages.cs.json +1 -6
  141. package/dist/cdn/assets/buffer-tools/t9n/messages.da.json +1 -6
  142. package/dist/cdn/assets/buffer-tools/t9n/messages.de.json +1 -6
  143. package/dist/cdn/assets/buffer-tools/t9n/messages.el.json +1 -6
  144. package/dist/cdn/assets/buffer-tools/t9n/messages.en.json +1 -6
  145. package/dist/cdn/assets/buffer-tools/t9n/messages.es.json +1 -6
  146. package/dist/cdn/assets/buffer-tools/t9n/messages.et.json +1 -6
  147. package/dist/cdn/assets/buffer-tools/t9n/messages.fi.json +1 -6
  148. package/dist/cdn/assets/buffer-tools/t9n/messages.fr.json +1 -6
  149. package/dist/cdn/assets/buffer-tools/t9n/messages.he.json +1 -6
  150. package/dist/cdn/assets/buffer-tools/t9n/messages.hr.json +1 -6
  151. package/dist/cdn/assets/buffer-tools/t9n/messages.hu.json +1 -6
  152. package/dist/cdn/assets/buffer-tools/t9n/messages.id.json +1 -6
  153. package/dist/cdn/assets/buffer-tools/t9n/messages.it.json +1 -6
  154. package/dist/cdn/assets/buffer-tools/t9n/messages.ja.json +1 -6
  155. package/dist/cdn/assets/buffer-tools/t9n/messages.json +1 -6
  156. package/dist/cdn/assets/buffer-tools/t9n/messages.ko.json +1 -6
  157. package/dist/cdn/assets/buffer-tools/t9n/messages.lt.json +1 -6
  158. package/dist/cdn/assets/buffer-tools/t9n/messages.lv.json +1 -6
  159. package/dist/cdn/assets/buffer-tools/t9n/messages.nb.json +1 -6
  160. package/dist/cdn/assets/buffer-tools/t9n/messages.nl.json +1 -6
  161. package/dist/cdn/assets/buffer-tools/t9n/messages.no.json +1 -6
  162. package/dist/cdn/assets/buffer-tools/t9n/messages.pl.json +1 -6
  163. package/dist/cdn/assets/buffer-tools/t9n/messages.pt-BR.json +1 -6
  164. package/dist/cdn/assets/buffer-tools/t9n/messages.pt-PT.json +1 -6
  165. package/dist/cdn/assets/buffer-tools/t9n/messages.ro.json +1 -6
  166. package/dist/cdn/assets/buffer-tools/t9n/messages.ru.json +1 -6
  167. package/dist/cdn/assets/buffer-tools/t9n/messages.sk.json +1 -6
  168. package/dist/cdn/assets/buffer-tools/t9n/messages.sl.json +1 -6
  169. package/dist/cdn/assets/buffer-tools/t9n/messages.sr.json +1 -6
  170. package/dist/cdn/assets/buffer-tools/t9n/messages.sv.json +1 -6
  171. package/dist/cdn/assets/buffer-tools/t9n/messages.th.json +1 -6
  172. package/dist/cdn/assets/buffer-tools/t9n/messages.tr.json +1 -6
  173. package/dist/cdn/assets/buffer-tools/t9n/messages.uk.json +1 -6
  174. package/dist/cdn/assets/buffer-tools/t9n/messages.vi.json +1 -6
  175. package/dist/cdn/assets/buffer-tools/t9n/messages.zh-CN.json +1 -6
  176. package/dist/cdn/assets/buffer-tools/t9n/messages.zh-HK.json +1 -6
  177. package/dist/cdn/assets/buffer-tools/t9n/messages.zh-TW.json +1 -6
  178. package/dist/cdn/assets/card-manager/t9n/messages.ar.json +1 -7
  179. package/dist/cdn/assets/card-manager/t9n/messages.bg.json +1 -7
  180. package/dist/cdn/assets/card-manager/t9n/messages.bs.json +1 -7
  181. package/dist/cdn/assets/card-manager/t9n/messages.ca.json +1 -7
  182. package/dist/cdn/assets/card-manager/t9n/messages.cs.json +1 -7
  183. package/dist/cdn/assets/card-manager/t9n/messages.da.json +1 -7
  184. package/dist/cdn/assets/card-manager/t9n/messages.de.json +1 -7
  185. package/dist/cdn/assets/card-manager/t9n/messages.el.json +1 -7
  186. package/dist/cdn/assets/card-manager/t9n/messages.en.json +1 -7
  187. package/dist/cdn/assets/card-manager/t9n/messages.es.json +1 -7
  188. package/dist/cdn/assets/card-manager/t9n/messages.et.json +1 -7
  189. package/dist/cdn/assets/card-manager/t9n/messages.fi.json +1 -7
  190. package/dist/cdn/assets/card-manager/t9n/messages.fr.json +1 -7
  191. package/dist/cdn/assets/card-manager/t9n/messages.he.json +1 -7
  192. package/dist/cdn/assets/card-manager/t9n/messages.hr.json +1 -7
  193. package/dist/cdn/assets/card-manager/t9n/messages.hu.json +1 -7
  194. package/dist/cdn/assets/card-manager/t9n/messages.id.json +1 -7
  195. package/dist/cdn/assets/card-manager/t9n/messages.it.json +1 -7
  196. package/dist/cdn/assets/card-manager/t9n/messages.ja.json +1 -7
  197. package/dist/cdn/assets/card-manager/t9n/messages.json +1 -7
  198. package/dist/cdn/assets/card-manager/t9n/messages.ko.json +1 -7
  199. package/dist/cdn/assets/card-manager/t9n/messages.lt.json +1 -7
  200. package/dist/cdn/assets/card-manager/t9n/messages.lv.json +1 -7
  201. package/dist/cdn/assets/card-manager/t9n/messages.nb.json +1 -7
  202. package/dist/cdn/assets/card-manager/t9n/messages.nl.json +1 -7
  203. package/dist/cdn/assets/card-manager/t9n/messages.no.json +1 -7
  204. package/dist/cdn/assets/card-manager/t9n/messages.pl.json +1 -7
  205. package/dist/cdn/assets/card-manager/t9n/messages.pt-BR.json +1 -7
  206. package/dist/cdn/assets/card-manager/t9n/messages.pt-PT.json +1 -7
  207. package/dist/cdn/assets/card-manager/t9n/messages.ro.json +1 -7
  208. package/dist/cdn/assets/card-manager/t9n/messages.ru.json +1 -7
  209. package/dist/cdn/assets/card-manager/t9n/messages.sk.json +1 -7
  210. package/dist/cdn/assets/card-manager/t9n/messages.sl.json +1 -7
  211. package/dist/cdn/assets/card-manager/t9n/messages.sr.json +1 -7
  212. package/dist/cdn/assets/card-manager/t9n/messages.sv.json +1 -7
  213. package/dist/cdn/assets/card-manager/t9n/messages.th.json +1 -7
  214. package/dist/cdn/assets/card-manager/t9n/messages.tr.json +1 -7
  215. package/dist/cdn/assets/card-manager/t9n/messages.uk.json +1 -7
  216. package/dist/cdn/assets/card-manager/t9n/messages.vi.json +1 -7
  217. package/dist/cdn/assets/card-manager/t9n/messages.zh-CN.json +1 -7
  218. package/dist/cdn/assets/card-manager/t9n/messages.zh-HK.json +1 -7
  219. package/dist/cdn/assets/card-manager/t9n/messages.zh-TW.json +1 -7
  220. package/dist/cdn/assets/consent-manager/t9n/messages.ar.json +1 -5
  221. package/dist/cdn/assets/consent-manager/t9n/messages.bg.json +1 -5
  222. package/dist/cdn/assets/consent-manager/t9n/messages.bs.json +1 -5
  223. package/dist/cdn/assets/consent-manager/t9n/messages.ca.json +1 -5
  224. package/dist/cdn/assets/consent-manager/t9n/messages.cs.json +1 -5
  225. package/dist/cdn/assets/consent-manager/t9n/messages.da.json +1 -5
  226. package/dist/cdn/assets/consent-manager/t9n/messages.de.json +1 -5
  227. package/dist/cdn/assets/consent-manager/t9n/messages.el.json +1 -5
  228. package/dist/cdn/assets/consent-manager/t9n/messages.en.json +1 -5
  229. package/dist/cdn/assets/consent-manager/t9n/messages.es.json +1 -5
  230. package/dist/cdn/assets/consent-manager/t9n/messages.et.json +1 -5
  231. package/dist/cdn/assets/consent-manager/t9n/messages.fi.json +1 -5
  232. package/dist/cdn/assets/consent-manager/t9n/messages.fr.json +1 -5
  233. package/dist/cdn/assets/consent-manager/t9n/messages.he.json +1 -5
  234. package/dist/cdn/assets/consent-manager/t9n/messages.hr.json +1 -5
  235. package/dist/cdn/assets/consent-manager/t9n/messages.hu.json +1 -5
  236. package/dist/cdn/assets/consent-manager/t9n/messages.id.json +1 -5
  237. package/dist/cdn/assets/consent-manager/t9n/messages.it.json +1 -5
  238. package/dist/cdn/assets/consent-manager/t9n/messages.ja.json +1 -5
  239. package/dist/cdn/assets/consent-manager/t9n/messages.json +1 -5
  240. package/dist/cdn/assets/consent-manager/t9n/messages.ko.json +1 -5
  241. package/dist/cdn/assets/consent-manager/t9n/messages.lt.json +1 -5
  242. package/dist/cdn/assets/consent-manager/t9n/messages.lv.json +1 -5
  243. package/dist/cdn/assets/consent-manager/t9n/messages.nb.json +1 -5
  244. package/dist/cdn/assets/consent-manager/t9n/messages.nl.json +1 -5
  245. package/dist/cdn/assets/consent-manager/t9n/messages.no.json +1 -5
  246. package/dist/cdn/assets/consent-manager/t9n/messages.pl.json +1 -5
  247. package/dist/cdn/assets/consent-manager/t9n/messages.pt-BR.json +1 -5
  248. package/dist/cdn/assets/consent-manager/t9n/messages.pt-PT.json +1 -5
  249. package/dist/cdn/assets/consent-manager/t9n/messages.ro.json +1 -5
  250. package/dist/cdn/assets/consent-manager/t9n/messages.ru.json +1 -5
  251. package/dist/cdn/assets/consent-manager/t9n/messages.sk.json +1 -5
  252. package/dist/cdn/assets/consent-manager/t9n/messages.sl.json +1 -5
  253. package/dist/cdn/assets/consent-manager/t9n/messages.sr.json +1 -5
  254. package/dist/cdn/assets/consent-manager/t9n/messages.sv.json +1 -5
  255. package/dist/cdn/assets/consent-manager/t9n/messages.th.json +1 -5
  256. package/dist/cdn/assets/consent-manager/t9n/messages.tr.json +1 -5
  257. package/dist/cdn/assets/consent-manager/t9n/messages.uk.json +1 -5
  258. package/dist/cdn/assets/consent-manager/t9n/messages.vi.json +1 -5
  259. package/dist/cdn/assets/consent-manager/t9n/messages.zh-CN.json +1 -5
  260. package/dist/cdn/assets/consent-manager/t9n/messages.zh-HK.json +1 -5
  261. package/dist/cdn/assets/consent-manager/t9n/messages.zh-TW.json +1 -5
  262. package/dist/cdn/assets/create-feature/t9n/messages.ar.json +1 -24
  263. package/dist/cdn/assets/create-feature/t9n/messages.bg.json +1 -24
  264. package/dist/cdn/assets/create-feature/t9n/messages.bs.json +1 -24
  265. package/dist/cdn/assets/create-feature/t9n/messages.ca.json +1 -24
  266. package/dist/cdn/assets/create-feature/t9n/messages.cs.json +1 -24
  267. package/dist/cdn/assets/create-feature/t9n/messages.da.json +1 -24
  268. package/dist/cdn/assets/create-feature/t9n/messages.de.json +1 -24
  269. package/dist/cdn/assets/create-feature/t9n/messages.el.json +1 -24
  270. package/dist/cdn/assets/create-feature/t9n/messages.en.json +1 -24
  271. package/dist/cdn/assets/create-feature/t9n/messages.es.json +1 -24
  272. package/dist/cdn/assets/create-feature/t9n/messages.et.json +1 -24
  273. package/dist/cdn/assets/create-feature/t9n/messages.fi.json +1 -24
  274. package/dist/cdn/assets/create-feature/t9n/messages.fr.json +1 -24
  275. package/dist/cdn/assets/create-feature/t9n/messages.he.json +1 -24
  276. package/dist/cdn/assets/create-feature/t9n/messages.hr.json +1 -24
  277. package/dist/cdn/assets/create-feature/t9n/messages.hu.json +1 -24
  278. package/dist/cdn/assets/create-feature/t9n/messages.id.json +1 -24
  279. package/dist/cdn/assets/create-feature/t9n/messages.it.json +1 -24
  280. package/dist/cdn/assets/create-feature/t9n/messages.ja.json +1 -24
  281. package/dist/cdn/assets/create-feature/t9n/messages.json +1 -24
  282. package/dist/cdn/assets/create-feature/t9n/messages.ko.json +1 -24
  283. package/dist/cdn/assets/create-feature/t9n/messages.lt.json +1 -24
  284. package/dist/cdn/assets/create-feature/t9n/messages.lv.json +1 -24
  285. package/dist/cdn/assets/create-feature/t9n/messages.nb.json +1 -5
  286. package/dist/cdn/assets/create-feature/t9n/messages.nl.json +1 -24
  287. package/dist/cdn/assets/create-feature/t9n/messages.no.json +1 -24
  288. package/dist/cdn/assets/create-feature/t9n/messages.pl.json +1 -24
  289. package/dist/cdn/assets/create-feature/t9n/messages.pt-BR.json +1 -24
  290. package/dist/cdn/assets/create-feature/t9n/messages.pt-PT.json +1 -24
  291. package/dist/cdn/assets/create-feature/t9n/messages.ro.json +1 -24
  292. package/dist/cdn/assets/create-feature/t9n/messages.ru.json +1 -24
  293. package/dist/cdn/assets/create-feature/t9n/messages.sk.json +1 -24
  294. package/dist/cdn/assets/create-feature/t9n/messages.sl.json +1 -24
  295. package/dist/cdn/assets/create-feature/t9n/messages.sr.json +1 -24
  296. package/dist/cdn/assets/create-feature/t9n/messages.sv.json +1 -24
  297. package/dist/cdn/assets/create-feature/t9n/messages.th.json +1 -24
  298. package/dist/cdn/assets/create-feature/t9n/messages.tr.json +1 -24
  299. package/dist/cdn/assets/create-feature/t9n/messages.uk.json +1 -24
  300. package/dist/cdn/assets/create-feature/t9n/messages.vi.json +1 -24
  301. package/dist/cdn/assets/create-feature/t9n/messages.zh-CN.json +1 -24
  302. package/dist/cdn/assets/create-feature/t9n/messages.zh-HK.json +1 -24
  303. package/dist/cdn/assets/create-feature/t9n/messages.zh-TW.json +1 -24
  304. package/dist/cdn/assets/create-related-feature/t9n/messages.ar.json +1 -3
  305. package/dist/cdn/assets/create-related-feature/t9n/messages.bg.json +1 -3
  306. package/dist/cdn/assets/create-related-feature/t9n/messages.bs.json +1 -3
  307. package/dist/cdn/assets/create-related-feature/t9n/messages.ca.json +1 -3
  308. package/dist/cdn/assets/create-related-feature/t9n/messages.cs.json +1 -3
  309. package/dist/cdn/assets/create-related-feature/t9n/messages.da.json +1 -3
  310. package/dist/cdn/assets/create-related-feature/t9n/messages.de.json +1 -3
  311. package/dist/cdn/assets/create-related-feature/t9n/messages.el.json +1 -3
  312. package/dist/cdn/assets/create-related-feature/t9n/messages.en.json +1 -3
  313. package/dist/cdn/assets/create-related-feature/t9n/messages.es.json +1 -3
  314. package/dist/cdn/assets/create-related-feature/t9n/messages.et.json +1 -3
  315. package/dist/cdn/assets/create-related-feature/t9n/messages.fi.json +1 -3
  316. package/dist/cdn/assets/create-related-feature/t9n/messages.fr.json +1 -3
  317. package/dist/cdn/assets/create-related-feature/t9n/messages.he.json +1 -3
  318. package/dist/cdn/assets/create-related-feature/t9n/messages.hr.json +1 -3
  319. package/dist/cdn/assets/create-related-feature/t9n/messages.hu.json +1 -3
  320. package/dist/cdn/assets/create-related-feature/t9n/messages.id.json +1 -3
  321. package/dist/cdn/assets/create-related-feature/t9n/messages.it.json +1 -3
  322. package/dist/cdn/assets/create-related-feature/t9n/messages.ja.json +1 -3
  323. package/dist/cdn/assets/create-related-feature/t9n/messages.json +1 -3
  324. package/dist/cdn/assets/create-related-feature/t9n/messages.ko.json +1 -3
  325. package/dist/cdn/assets/create-related-feature/t9n/messages.lt.json +1 -3
  326. package/dist/cdn/assets/create-related-feature/t9n/messages.lv.json +1 -3
  327. package/dist/cdn/assets/create-related-feature/t9n/messages.nb.json +1 -3
  328. package/dist/cdn/assets/create-related-feature/t9n/messages.nl.json +1 -3
  329. package/dist/cdn/assets/create-related-feature/t9n/messages.no.json +1 -3
  330. package/dist/cdn/assets/create-related-feature/t9n/messages.pl.json +1 -3
  331. package/dist/cdn/assets/create-related-feature/t9n/messages.pt-BR.json +1 -3
  332. package/dist/cdn/assets/create-related-feature/t9n/messages.pt-PT.json +1 -3
  333. package/dist/cdn/assets/create-related-feature/t9n/messages.ro.json +1 -3
  334. package/dist/cdn/assets/create-related-feature/t9n/messages.ru.json +1 -3
  335. package/dist/cdn/assets/create-related-feature/t9n/messages.sk.json +1 -3
  336. package/dist/cdn/assets/create-related-feature/t9n/messages.sl.json +1 -3
  337. package/dist/cdn/assets/create-related-feature/t9n/messages.sr.json +1 -3
  338. package/dist/cdn/assets/create-related-feature/t9n/messages.sv.json +1 -3
  339. package/dist/cdn/assets/create-related-feature/t9n/messages.th.json +1 -3
  340. package/dist/cdn/assets/create-related-feature/t9n/messages.tr.json +1 -3
  341. package/dist/cdn/assets/create-related-feature/t9n/messages.uk.json +1 -3
  342. package/dist/cdn/assets/create-related-feature/t9n/messages.vi.json +1 -3
  343. package/dist/cdn/assets/create-related-feature/t9n/messages.zh-CN.json +1 -3
  344. package/dist/cdn/assets/create-related-feature/t9n/messages.zh-HK.json +1 -3
  345. package/dist/cdn/assets/create-related-feature/t9n/messages.zh-TW.json +1 -3
  346. package/dist/cdn/assets/crowdsource-manager/t9n/messages.ar.json +1 -16
  347. package/dist/cdn/assets/crowdsource-manager/t9n/messages.bg.json +1 -16
  348. package/dist/cdn/assets/crowdsource-manager/t9n/messages.bs.json +1 -16
  349. package/dist/cdn/assets/crowdsource-manager/t9n/messages.ca.json +1 -16
  350. package/dist/cdn/assets/crowdsource-manager/t9n/messages.cs.json +1 -16
  351. package/dist/cdn/assets/crowdsource-manager/t9n/messages.da.json +1 -16
  352. package/dist/cdn/assets/crowdsource-manager/t9n/messages.de.json +1 -16
  353. package/dist/cdn/assets/crowdsource-manager/t9n/messages.el.json +1 -16
  354. package/dist/cdn/assets/crowdsource-manager/t9n/messages.en.json +1 -16
  355. package/dist/cdn/assets/crowdsource-manager/t9n/messages.es.json +1 -16
  356. package/dist/cdn/assets/crowdsource-manager/t9n/messages.et.json +1 -16
  357. package/dist/cdn/assets/crowdsource-manager/t9n/messages.fi.json +1 -16
  358. package/dist/cdn/assets/crowdsource-manager/t9n/messages.fr.json +1 -16
  359. package/dist/cdn/assets/crowdsource-manager/t9n/messages.he.json +1 -16
  360. package/dist/cdn/assets/crowdsource-manager/t9n/messages.hr.json +1 -16
  361. package/dist/cdn/assets/crowdsource-manager/t9n/messages.hu.json +1 -16
  362. package/dist/cdn/assets/crowdsource-manager/t9n/messages.id.json +1 -16
  363. package/dist/cdn/assets/crowdsource-manager/t9n/messages.it.json +1 -16
  364. package/dist/cdn/assets/crowdsource-manager/t9n/messages.ja.json +1 -16
  365. package/dist/cdn/assets/crowdsource-manager/t9n/messages.json +1 -16
  366. package/dist/cdn/assets/crowdsource-manager/t9n/messages.ko.json +1 -16
  367. package/dist/cdn/assets/crowdsource-manager/t9n/messages.lt.json +1 -16
  368. package/dist/cdn/assets/crowdsource-manager/t9n/messages.lv.json +1 -16
  369. package/dist/cdn/assets/crowdsource-manager/t9n/messages.nb.json +1 -15
  370. package/dist/cdn/assets/crowdsource-manager/t9n/messages.nl.json +1 -16
  371. package/dist/cdn/assets/crowdsource-manager/t9n/messages.no.json +1 -16
  372. package/dist/cdn/assets/crowdsource-manager/t9n/messages.pl.json +1 -16
  373. package/dist/cdn/assets/crowdsource-manager/t9n/messages.pt-BR.json +1 -16
  374. package/dist/cdn/assets/crowdsource-manager/t9n/messages.pt-PT.json +1 -16
  375. package/dist/cdn/assets/crowdsource-manager/t9n/messages.ro.json +1 -16
  376. package/dist/cdn/assets/crowdsource-manager/t9n/messages.ru.json +1 -16
  377. package/dist/cdn/assets/crowdsource-manager/t9n/messages.sk.json +1 -16
  378. package/dist/cdn/assets/crowdsource-manager/t9n/messages.sl.json +1 -16
  379. package/dist/cdn/assets/crowdsource-manager/t9n/messages.sr.json +1 -16
  380. package/dist/cdn/assets/crowdsource-manager/t9n/messages.sv.json +1 -16
  381. package/dist/cdn/assets/crowdsource-manager/t9n/messages.th.json +1 -16
  382. package/dist/cdn/assets/crowdsource-manager/t9n/messages.tr.json +1 -16
  383. package/dist/cdn/assets/crowdsource-manager/t9n/messages.uk.json +1 -16
  384. package/dist/cdn/assets/crowdsource-manager/t9n/messages.vi.json +1 -16
  385. package/dist/cdn/assets/crowdsource-manager/t9n/messages.zh-CN.json +1 -16
  386. package/dist/cdn/assets/crowdsource-manager/t9n/messages.zh-HK.json +1 -16
  387. package/dist/cdn/assets/crowdsource-manager/t9n/messages.zh-TW.json +1 -16
  388. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ar.json +1 -32
  389. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.bg.json +1 -32
  390. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.bs.json +1 -32
  391. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ca.json +1 -32
  392. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.cs.json +1 -32
  393. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.da.json +1 -32
  394. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.de.json +1 -32
  395. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.el.json +1 -32
  396. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.en.json +1 -32
  397. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.es.json +1 -32
  398. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.et.json +1 -32
  399. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.fi.json +1 -32
  400. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.fr.json +1 -32
  401. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.he.json +1 -32
  402. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.hr.json +1 -32
  403. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.hu.json +1 -32
  404. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.id.json +1 -32
  405. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.it.json +1 -32
  406. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ja.json +1 -32
  407. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.json +1 -32
  408. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ko.json +1 -32
  409. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.lt.json +1 -32
  410. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.lv.json +1 -32
  411. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.nb.json +1 -32
  412. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.nl.json +1 -32
  413. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.no.json +1 -32
  414. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.pl.json +1 -32
  415. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.pt-BR.json +1 -32
  416. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.pt-PT.json +1 -32
  417. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ro.json +1 -32
  418. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.ru.json +1 -32
  419. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.sk.json +1 -32
  420. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.sl.json +1 -32
  421. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.sr.json +1 -32
  422. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.sv.json +1 -32
  423. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.th.json +1 -32
  424. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.tr.json +1 -32
  425. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.uk.json +1 -32
  426. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.vi.json +1 -32
  427. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.zh-CN.json +1 -32
  428. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.zh-HK.json +1 -32
  429. package/dist/cdn/assets/crowdsource-reporter/t9n/messages.zh-TW.json +1 -32
  430. package/dist/cdn/assets/delete-button/t9n/messages.ar.json +1 -8
  431. package/dist/cdn/assets/delete-button/t9n/messages.bg.json +1 -8
  432. package/dist/cdn/assets/delete-button/t9n/messages.bs.json +1 -8
  433. package/dist/cdn/assets/delete-button/t9n/messages.ca.json +1 -8
  434. package/dist/cdn/assets/delete-button/t9n/messages.cs.json +1 -8
  435. package/dist/cdn/assets/delete-button/t9n/messages.da.json +1 -8
  436. package/dist/cdn/assets/delete-button/t9n/messages.de.json +1 -8
  437. package/dist/cdn/assets/delete-button/t9n/messages.el.json +1 -8
  438. package/dist/cdn/assets/delete-button/t9n/messages.en.json +1 -8
  439. package/dist/cdn/assets/delete-button/t9n/messages.es.json +1 -8
  440. package/dist/cdn/assets/delete-button/t9n/messages.et.json +1 -8
  441. package/dist/cdn/assets/delete-button/t9n/messages.fi.json +1 -8
  442. package/dist/cdn/assets/delete-button/t9n/messages.fr.json +1 -8
  443. package/dist/cdn/assets/delete-button/t9n/messages.he.json +1 -8
  444. package/dist/cdn/assets/delete-button/t9n/messages.hr.json +1 -8
  445. package/dist/cdn/assets/delete-button/t9n/messages.hu.json +1 -8
  446. package/dist/cdn/assets/delete-button/t9n/messages.id.json +1 -8
  447. package/dist/cdn/assets/delete-button/t9n/messages.it.json +1 -8
  448. package/dist/cdn/assets/delete-button/t9n/messages.ja.json +1 -8
  449. package/dist/cdn/assets/delete-button/t9n/messages.json +1 -8
  450. package/dist/cdn/assets/delete-button/t9n/messages.ko.json +1 -8
  451. package/dist/cdn/assets/delete-button/t9n/messages.lt.json +1 -8
  452. package/dist/cdn/assets/delete-button/t9n/messages.lv.json +1 -8
  453. package/dist/cdn/assets/delete-button/t9n/messages.nb.json +1 -8
  454. package/dist/cdn/assets/delete-button/t9n/messages.nl.json +1 -8
  455. package/dist/cdn/assets/delete-button/t9n/messages.no.json +1 -8
  456. package/dist/cdn/assets/delete-button/t9n/messages.pl.json +1 -8
  457. package/dist/cdn/assets/delete-button/t9n/messages.pt-BR.json +1 -8
  458. package/dist/cdn/assets/delete-button/t9n/messages.pt-PT.json +1 -8
  459. package/dist/cdn/assets/delete-button/t9n/messages.ro.json +1 -8
  460. package/dist/cdn/assets/delete-button/t9n/messages.ru.json +1 -8
  461. package/dist/cdn/assets/delete-button/t9n/messages.sk.json +1 -8
  462. package/dist/cdn/assets/delete-button/t9n/messages.sl.json +1 -8
  463. package/dist/cdn/assets/delete-button/t9n/messages.sr.json +1 -8
  464. package/dist/cdn/assets/delete-button/t9n/messages.sv.json +1 -8
  465. package/dist/cdn/assets/delete-button/t9n/messages.th.json +1 -8
  466. package/dist/cdn/assets/delete-button/t9n/messages.tr.json +1 -8
  467. package/dist/cdn/assets/delete-button/t9n/messages.uk.json +1 -8
  468. package/dist/cdn/assets/delete-button/t9n/messages.vi.json +1 -8
  469. package/dist/cdn/assets/delete-button/t9n/messages.zh-CN.json +1 -8
  470. package/dist/cdn/assets/delete-button/t9n/messages.zh-HK.json +1 -8
  471. package/dist/cdn/assets/delete-button/t9n/messages.zh-TW.json +1 -8
  472. package/dist/cdn/assets/delete-dialog/t9n/messages.ar.json +1 -8
  473. package/dist/cdn/assets/delete-dialog/t9n/messages.bg.json +1 -8
  474. package/dist/cdn/assets/delete-dialog/t9n/messages.bs.json +1 -8
  475. package/dist/cdn/assets/delete-dialog/t9n/messages.ca.json +1 -8
  476. package/dist/cdn/assets/delete-dialog/t9n/messages.cs.json +1 -8
  477. package/dist/cdn/assets/delete-dialog/t9n/messages.da.json +1 -8
  478. package/dist/cdn/assets/delete-dialog/t9n/messages.de.json +1 -8
  479. package/dist/cdn/assets/delete-dialog/t9n/messages.el.json +1 -8
  480. package/dist/cdn/assets/delete-dialog/t9n/messages.en.json +1 -8
  481. package/dist/cdn/assets/delete-dialog/t9n/messages.es.json +1 -8
  482. package/dist/cdn/assets/delete-dialog/t9n/messages.et.json +1 -8
  483. package/dist/cdn/assets/delete-dialog/t9n/messages.fi.json +1 -8
  484. package/dist/cdn/assets/delete-dialog/t9n/messages.fr.json +1 -8
  485. package/dist/cdn/assets/delete-dialog/t9n/messages.he.json +1 -8
  486. package/dist/cdn/assets/delete-dialog/t9n/messages.hr.json +1 -8
  487. package/dist/cdn/assets/delete-dialog/t9n/messages.hu.json +1 -8
  488. package/dist/cdn/assets/delete-dialog/t9n/messages.id.json +1 -8
  489. package/dist/cdn/assets/delete-dialog/t9n/messages.it.json +1 -8
  490. package/dist/cdn/assets/delete-dialog/t9n/messages.ja.json +1 -8
  491. package/dist/cdn/assets/delete-dialog/t9n/messages.json +1 -8
  492. package/dist/cdn/assets/delete-dialog/t9n/messages.ko.json +1 -8
  493. package/dist/cdn/assets/delete-dialog/t9n/messages.lt.json +1 -8
  494. package/dist/cdn/assets/delete-dialog/t9n/messages.lv.json +1 -8
  495. package/dist/cdn/assets/delete-dialog/t9n/messages.nb.json +1 -8
  496. package/dist/cdn/assets/delete-dialog/t9n/messages.nl.json +1 -8
  497. package/dist/cdn/assets/delete-dialog/t9n/messages.no.json +1 -8
  498. package/dist/cdn/assets/delete-dialog/t9n/messages.pl.json +1 -8
  499. package/dist/cdn/assets/delete-dialog/t9n/messages.pt-BR.json +1 -8
  500. package/dist/cdn/assets/delete-dialog/t9n/messages.pt-PT.json +1 -8
  501. package/dist/cdn/assets/delete-dialog/t9n/messages.ro.json +1 -8
  502. package/dist/cdn/assets/delete-dialog/t9n/messages.ru.json +1 -8
  503. package/dist/cdn/assets/delete-dialog/t9n/messages.sk.json +1 -8
  504. package/dist/cdn/assets/delete-dialog/t9n/messages.sl.json +1 -8
  505. package/dist/cdn/assets/delete-dialog/t9n/messages.sr.json +1 -8
  506. package/dist/cdn/assets/delete-dialog/t9n/messages.sv.json +1 -8
  507. package/dist/cdn/assets/delete-dialog/t9n/messages.th.json +1 -8
  508. package/dist/cdn/assets/delete-dialog/t9n/messages.tr.json +1 -8
  509. package/dist/cdn/assets/delete-dialog/t9n/messages.uk.json +1 -8
  510. package/dist/cdn/assets/delete-dialog/t9n/messages.vi.json +1 -8
  511. package/dist/cdn/assets/delete-dialog/t9n/messages.zh-CN.json +1 -8
  512. package/dist/cdn/assets/delete-dialog/t9n/messages.zh-HK.json +1 -8
  513. package/dist/cdn/assets/delete-dialog/t9n/messages.zh-TW.json +1 -8
  514. package/dist/cdn/assets/edit-card/t9n/messages.ar.json +1 -3
  515. package/dist/cdn/assets/edit-card/t9n/messages.bg.json +1 -3
  516. package/dist/cdn/assets/edit-card/t9n/messages.bs.json +1 -3
  517. package/dist/cdn/assets/edit-card/t9n/messages.ca.json +1 -3
  518. package/dist/cdn/assets/edit-card/t9n/messages.cs.json +1 -3
  519. package/dist/cdn/assets/edit-card/t9n/messages.da.json +1 -3
  520. package/dist/cdn/assets/edit-card/t9n/messages.de.json +1 -3
  521. package/dist/cdn/assets/edit-card/t9n/messages.el.json +1 -3
  522. package/dist/cdn/assets/edit-card/t9n/messages.en.json +1 -3
  523. package/dist/cdn/assets/edit-card/t9n/messages.es.json +1 -3
  524. package/dist/cdn/assets/edit-card/t9n/messages.et.json +1 -3
  525. package/dist/cdn/assets/edit-card/t9n/messages.fi.json +1 -3
  526. package/dist/cdn/assets/edit-card/t9n/messages.fr.json +1 -3
  527. package/dist/cdn/assets/edit-card/t9n/messages.he.json +1 -3
  528. package/dist/cdn/assets/edit-card/t9n/messages.hr.json +1 -3
  529. package/dist/cdn/assets/edit-card/t9n/messages.hu.json +1 -3
  530. package/dist/cdn/assets/edit-card/t9n/messages.id.json +1 -3
  531. package/dist/cdn/assets/edit-card/t9n/messages.it.json +1 -3
  532. package/dist/cdn/assets/edit-card/t9n/messages.ja.json +1 -3
  533. package/dist/cdn/assets/edit-card/t9n/messages.json +1 -3
  534. package/dist/cdn/assets/edit-card/t9n/messages.ko.json +1 -3
  535. package/dist/cdn/assets/edit-card/t9n/messages.lt.json +1 -3
  536. package/dist/cdn/assets/edit-card/t9n/messages.lv.json +1 -3
  537. package/dist/cdn/assets/edit-card/t9n/messages.nb.json +1 -3
  538. package/dist/cdn/assets/edit-card/t9n/messages.nl.json +1 -3
  539. package/dist/cdn/assets/edit-card/t9n/messages.no.json +1 -3
  540. package/dist/cdn/assets/edit-card/t9n/messages.pl.json +1 -3
  541. package/dist/cdn/assets/edit-card/t9n/messages.pt-BR.json +1 -3
  542. package/dist/cdn/assets/edit-card/t9n/messages.pt-PT.json +1 -3
  543. package/dist/cdn/assets/edit-card/t9n/messages.ro.json +1 -3
  544. package/dist/cdn/assets/edit-card/t9n/messages.ru.json +1 -3
  545. package/dist/cdn/assets/edit-card/t9n/messages.sk.json +1 -3
  546. package/dist/cdn/assets/edit-card/t9n/messages.sl.json +1 -3
  547. package/dist/cdn/assets/edit-card/t9n/messages.sr.json +1 -3
  548. package/dist/cdn/assets/edit-card/t9n/messages.sv.json +1 -3
  549. package/dist/cdn/assets/edit-card/t9n/messages.th.json +1 -3
  550. package/dist/cdn/assets/edit-card/t9n/messages.tr.json +1 -3
  551. package/dist/cdn/assets/edit-card/t9n/messages.uk.json +1 -3
  552. package/dist/cdn/assets/edit-card/t9n/messages.vi.json +1 -3
  553. package/dist/cdn/assets/edit-card/t9n/messages.zh-CN.json +1 -3
  554. package/dist/cdn/assets/edit-card/t9n/messages.zh-HK.json +1 -3
  555. package/dist/cdn/assets/edit-card/t9n/messages.zh-TW.json +1 -3
  556. package/dist/cdn/assets/feature-list/t9n/messages.ar.json +1 -9
  557. package/dist/cdn/assets/feature-list/t9n/messages.bg.json +1 -9
  558. package/dist/cdn/assets/feature-list/t9n/messages.bs.json +1 -9
  559. package/dist/cdn/assets/feature-list/t9n/messages.ca.json +1 -9
  560. package/dist/cdn/assets/feature-list/t9n/messages.cs.json +1 -9
  561. package/dist/cdn/assets/feature-list/t9n/messages.da.json +1 -9
  562. package/dist/cdn/assets/feature-list/t9n/messages.de.json +1 -9
  563. package/dist/cdn/assets/feature-list/t9n/messages.el.json +1 -9
  564. package/dist/cdn/assets/feature-list/t9n/messages.en.json +1 -9
  565. package/dist/cdn/assets/feature-list/t9n/messages.es.json +1 -9
  566. package/dist/cdn/assets/feature-list/t9n/messages.et.json +1 -9
  567. package/dist/cdn/assets/feature-list/t9n/messages.fi.json +1 -9
  568. package/dist/cdn/assets/feature-list/t9n/messages.fr.json +1 -9
  569. package/dist/cdn/assets/feature-list/t9n/messages.he.json +1 -9
  570. package/dist/cdn/assets/feature-list/t9n/messages.hr.json +1 -9
  571. package/dist/cdn/assets/feature-list/t9n/messages.hu.json +1 -9
  572. package/dist/cdn/assets/feature-list/t9n/messages.id.json +1 -9
  573. package/dist/cdn/assets/feature-list/t9n/messages.it.json +1 -9
  574. package/dist/cdn/assets/feature-list/t9n/messages.ja.json +1 -9
  575. package/dist/cdn/assets/feature-list/t9n/messages.json +1 -9
  576. package/dist/cdn/assets/feature-list/t9n/messages.ko.json +1 -9
  577. package/dist/cdn/assets/feature-list/t9n/messages.lt.json +1 -9
  578. package/dist/cdn/assets/feature-list/t9n/messages.lv.json +1 -9
  579. package/dist/cdn/assets/feature-list/t9n/messages.nb.json +1 -8
  580. package/dist/cdn/assets/feature-list/t9n/messages.nl.json +1 -9
  581. package/dist/cdn/assets/feature-list/t9n/messages.no.json +1 -9
  582. package/dist/cdn/assets/feature-list/t9n/messages.pl.json +1 -9
  583. package/dist/cdn/assets/feature-list/t9n/messages.pt-BR.json +1 -9
  584. package/dist/cdn/assets/feature-list/t9n/messages.pt-PT.json +1 -9
  585. package/dist/cdn/assets/feature-list/t9n/messages.ro.json +1 -9
  586. package/dist/cdn/assets/feature-list/t9n/messages.ru.json +1 -9
  587. package/dist/cdn/assets/feature-list/t9n/messages.sk.json +1 -9
  588. package/dist/cdn/assets/feature-list/t9n/messages.sl.json +1 -9
  589. package/dist/cdn/assets/feature-list/t9n/messages.sr.json +1 -9
  590. package/dist/cdn/assets/feature-list/t9n/messages.sv.json +1 -9
  591. package/dist/cdn/assets/feature-list/t9n/messages.th.json +1 -9
  592. package/dist/cdn/assets/feature-list/t9n/messages.tr.json +1 -9
  593. package/dist/cdn/assets/feature-list/t9n/messages.uk.json +1 -9
  594. package/dist/cdn/assets/feature-list/t9n/messages.vi.json +1 -9
  595. package/dist/cdn/assets/feature-list/t9n/messages.zh-CN.json +1 -9
  596. package/dist/cdn/assets/feature-list/t9n/messages.zh-HK.json +1 -9
  597. package/dist/cdn/assets/feature-list/t9n/messages.zh-TW.json +1 -9
  598. package/dist/cdn/assets/field-selection/t9n/messages.ar.json +1 -18
  599. package/dist/cdn/assets/field-selection/t9n/messages.bg.json +1 -18
  600. package/dist/cdn/assets/field-selection/t9n/messages.bs.json +1 -18
  601. package/dist/cdn/assets/field-selection/t9n/messages.ca.json +1 -18
  602. package/dist/cdn/assets/field-selection/t9n/messages.cs.json +1 -18
  603. package/dist/cdn/assets/field-selection/t9n/messages.da.json +1 -18
  604. package/dist/cdn/assets/field-selection/t9n/messages.de.json +1 -18
  605. package/dist/cdn/assets/field-selection/t9n/messages.el.json +1 -18
  606. package/dist/cdn/assets/field-selection/t9n/messages.en.json +1 -18
  607. package/dist/cdn/assets/field-selection/t9n/messages.es.json +1 -18
  608. package/dist/cdn/assets/field-selection/t9n/messages.et.json +1 -18
  609. package/dist/cdn/assets/field-selection/t9n/messages.fi.json +1 -18
  610. package/dist/cdn/assets/field-selection/t9n/messages.fr.json +1 -18
  611. package/dist/cdn/assets/field-selection/t9n/messages.he.json +1 -18
  612. package/dist/cdn/assets/field-selection/t9n/messages.hr.json +1 -18
  613. package/dist/cdn/assets/field-selection/t9n/messages.hu.json +1 -18
  614. package/dist/cdn/assets/field-selection/t9n/messages.id.json +1 -18
  615. package/dist/cdn/assets/field-selection/t9n/messages.it.json +1 -18
  616. package/dist/cdn/assets/field-selection/t9n/messages.ja.json +1 -18
  617. package/dist/cdn/assets/field-selection/t9n/messages.json +1 -18
  618. package/dist/cdn/assets/field-selection/t9n/messages.ko.json +1 -18
  619. package/dist/cdn/assets/field-selection/t9n/messages.lt.json +1 -18
  620. package/dist/cdn/assets/field-selection/t9n/messages.lv.json +1 -18
  621. package/dist/cdn/assets/field-selection/t9n/messages.nl.json +1 -18
  622. package/dist/cdn/assets/field-selection/t9n/messages.no.json +1 -18
  623. package/dist/cdn/assets/field-selection/t9n/messages.pl.json +1 -18
  624. package/dist/cdn/assets/field-selection/t9n/messages.pt-BR.json +1 -18
  625. package/dist/cdn/assets/field-selection/t9n/messages.pt-PT.json +1 -18
  626. package/dist/cdn/assets/field-selection/t9n/messages.ro.json +1 -18
  627. package/dist/cdn/assets/field-selection/t9n/messages.ru.json +1 -18
  628. package/dist/cdn/assets/field-selection/t9n/messages.sk.json +1 -18
  629. package/dist/cdn/assets/field-selection/t9n/messages.sl.json +1 -18
  630. package/dist/cdn/assets/field-selection/t9n/messages.sr.json +1 -18
  631. package/dist/cdn/assets/field-selection/t9n/messages.sv.json +1 -18
  632. package/dist/cdn/assets/field-selection/t9n/messages.th.json +1 -18
  633. package/dist/cdn/assets/field-selection/t9n/messages.tr.json +1 -18
  634. package/dist/cdn/assets/field-selection/t9n/messages.uk.json +1 -18
  635. package/dist/cdn/assets/field-selection/t9n/messages.vi.json +1 -18
  636. package/dist/cdn/assets/field-selection/t9n/messages.zh-CN.json +1 -18
  637. package/dist/cdn/assets/field-selection/t9n/messages.zh-HK.json +1 -18
  638. package/dist/cdn/assets/field-selection/t9n/messages.zh-TW.json +1 -18
  639. package/dist/cdn/assets/info-card/t9n/messages.ar.json +1 -10
  640. package/dist/cdn/assets/info-card/t9n/messages.bg.json +1 -10
  641. package/dist/cdn/assets/info-card/t9n/messages.bs.json +1 -10
  642. package/dist/cdn/assets/info-card/t9n/messages.ca.json +1 -10
  643. package/dist/cdn/assets/info-card/t9n/messages.cs.json +1 -10
  644. package/dist/cdn/assets/info-card/t9n/messages.da.json +1 -10
  645. package/dist/cdn/assets/info-card/t9n/messages.de.json +1 -10
  646. package/dist/cdn/assets/info-card/t9n/messages.el.json +1 -10
  647. package/dist/cdn/assets/info-card/t9n/messages.en.json +1 -10
  648. package/dist/cdn/assets/info-card/t9n/messages.es.json +1 -10
  649. package/dist/cdn/assets/info-card/t9n/messages.et.json +1 -10
  650. package/dist/cdn/assets/info-card/t9n/messages.fi.json +1 -10
  651. package/dist/cdn/assets/info-card/t9n/messages.fr.json +1 -10
  652. package/dist/cdn/assets/info-card/t9n/messages.he.json +1 -10
  653. package/dist/cdn/assets/info-card/t9n/messages.hr.json +1 -10
  654. package/dist/cdn/assets/info-card/t9n/messages.hu.json +1 -10
  655. package/dist/cdn/assets/info-card/t9n/messages.id.json +1 -10
  656. package/dist/cdn/assets/info-card/t9n/messages.it.json +1 -10
  657. package/dist/cdn/assets/info-card/t9n/messages.ja.json +1 -10
  658. package/dist/cdn/assets/info-card/t9n/messages.json +1 -10
  659. package/dist/cdn/assets/info-card/t9n/messages.ko.json +1 -10
  660. package/dist/cdn/assets/info-card/t9n/messages.lt.json +1 -10
  661. package/dist/cdn/assets/info-card/t9n/messages.lv.json +1 -10
  662. package/dist/cdn/assets/info-card/t9n/messages.nb.json +1 -10
  663. package/dist/cdn/assets/info-card/t9n/messages.nl.json +1 -10
  664. package/dist/cdn/assets/info-card/t9n/messages.no.json +1 -10
  665. package/dist/cdn/assets/info-card/t9n/messages.pl.json +1 -10
  666. package/dist/cdn/assets/info-card/t9n/messages.pt-BR.json +1 -10
  667. package/dist/cdn/assets/info-card/t9n/messages.pt-PT.json +1 -10
  668. package/dist/cdn/assets/info-card/t9n/messages.ro.json +1 -10
  669. package/dist/cdn/assets/info-card/t9n/messages.ru.json +1 -10
  670. package/dist/cdn/assets/info-card/t9n/messages.sk.json +1 -10
  671. package/dist/cdn/assets/info-card/t9n/messages.sl.json +1 -10
  672. package/dist/cdn/assets/info-card/t9n/messages.sr.json +1 -10
  673. package/dist/cdn/assets/info-card/t9n/messages.sv.json +1 -10
  674. package/dist/cdn/assets/info-card/t9n/messages.th.json +1 -10
  675. package/dist/cdn/assets/info-card/t9n/messages.tr.json +1 -10
  676. package/dist/cdn/assets/info-card/t9n/messages.uk.json +1 -10
  677. package/dist/cdn/assets/info-card/t9n/messages.vi.json +1 -10
  678. package/dist/cdn/assets/info-card/t9n/messages.zh-CN.json +1 -10
  679. package/dist/cdn/assets/info-card/t9n/messages.zh-HK.json +1 -10
  680. package/dist/cdn/assets/info-card/t9n/messages.zh-TW.json +1 -10
  681. package/dist/cdn/assets/layer-list/t9n/messages.ar.json +1 -5
  682. package/dist/cdn/assets/layer-list/t9n/messages.bg.json +1 -5
  683. package/dist/cdn/assets/layer-list/t9n/messages.bs.json +1 -5
  684. package/dist/cdn/assets/layer-list/t9n/messages.ca.json +1 -5
  685. package/dist/cdn/assets/layer-list/t9n/messages.cs.json +1 -5
  686. package/dist/cdn/assets/layer-list/t9n/messages.da.json +1 -5
  687. package/dist/cdn/assets/layer-list/t9n/messages.de.json +1 -5
  688. package/dist/cdn/assets/layer-list/t9n/messages.el.json +1 -5
  689. package/dist/cdn/assets/layer-list/t9n/messages.en.json +1 -5
  690. package/dist/cdn/assets/layer-list/t9n/messages.es.json +1 -5
  691. package/dist/cdn/assets/layer-list/t9n/messages.et.json +1 -5
  692. package/dist/cdn/assets/layer-list/t9n/messages.fi.json +1 -5
  693. package/dist/cdn/assets/layer-list/t9n/messages.fr.json +1 -5
  694. package/dist/cdn/assets/layer-list/t9n/messages.he.json +1 -5
  695. package/dist/cdn/assets/layer-list/t9n/messages.hr.json +1 -5
  696. package/dist/cdn/assets/layer-list/t9n/messages.hu.json +1 -5
  697. package/dist/cdn/assets/layer-list/t9n/messages.id.json +1 -5
  698. package/dist/cdn/assets/layer-list/t9n/messages.it.json +1 -5
  699. package/dist/cdn/assets/layer-list/t9n/messages.ja.json +1 -5
  700. package/dist/cdn/assets/layer-list/t9n/messages.json +1 -5
  701. package/dist/cdn/assets/layer-list/t9n/messages.ko.json +1 -5
  702. package/dist/cdn/assets/layer-list/t9n/messages.lt.json +1 -5
  703. package/dist/cdn/assets/layer-list/t9n/messages.lv.json +1 -5
  704. package/dist/cdn/assets/layer-list/t9n/messages.nb.json +1 -4
  705. package/dist/cdn/assets/layer-list/t9n/messages.nl.json +1 -5
  706. package/dist/cdn/assets/layer-list/t9n/messages.no.json +1 -5
  707. package/dist/cdn/assets/layer-list/t9n/messages.pl.json +1 -5
  708. package/dist/cdn/assets/layer-list/t9n/messages.pt-BR.json +1 -5
  709. package/dist/cdn/assets/layer-list/t9n/messages.pt-PT.json +1 -5
  710. package/dist/cdn/assets/layer-list/t9n/messages.ro.json +1 -5
  711. package/dist/cdn/assets/layer-list/t9n/messages.ru.json +1 -5
  712. package/dist/cdn/assets/layer-list/t9n/messages.sk.json +1 -5
  713. package/dist/cdn/assets/layer-list/t9n/messages.sl.json +1 -5
  714. package/dist/cdn/assets/layer-list/t9n/messages.sr.json +1 -5
  715. package/dist/cdn/assets/layer-list/t9n/messages.sv.json +1 -5
  716. package/dist/cdn/assets/layer-list/t9n/messages.th.json +1 -5
  717. package/dist/cdn/assets/layer-list/t9n/messages.tr.json +1 -5
  718. package/dist/cdn/assets/layer-list/t9n/messages.uk.json +1 -5
  719. package/dist/cdn/assets/layer-list/t9n/messages.vi.json +1 -5
  720. package/dist/cdn/assets/layer-list/t9n/messages.zh-CN.json +1 -5
  721. package/dist/cdn/assets/layer-list/t9n/messages.zh-HK.json +1 -5
  722. package/dist/cdn/assets/layer-list/t9n/messages.zh-TW.json +1 -5
  723. package/dist/cdn/assets/layer-table/t9n/messages.ar.json +1 -27
  724. package/dist/cdn/assets/layer-table/t9n/messages.bg.json +1 -27
  725. package/dist/cdn/assets/layer-table/t9n/messages.bs.json +1 -27
  726. package/dist/cdn/assets/layer-table/t9n/messages.ca.json +1 -27
  727. package/dist/cdn/assets/layer-table/t9n/messages.cs.json +1 -27
  728. package/dist/cdn/assets/layer-table/t9n/messages.da.json +1 -27
  729. package/dist/cdn/assets/layer-table/t9n/messages.de.json +1 -27
  730. package/dist/cdn/assets/layer-table/t9n/messages.el.json +1 -27
  731. package/dist/cdn/assets/layer-table/t9n/messages.en.json +1 -27
  732. package/dist/cdn/assets/layer-table/t9n/messages.es.json +1 -27
  733. package/dist/cdn/assets/layer-table/t9n/messages.et.json +1 -27
  734. package/dist/cdn/assets/layer-table/t9n/messages.fi.json +1 -27
  735. package/dist/cdn/assets/layer-table/t9n/messages.fr.json +1 -27
  736. package/dist/cdn/assets/layer-table/t9n/messages.he.json +1 -27
  737. package/dist/cdn/assets/layer-table/t9n/messages.hr.json +1 -27
  738. package/dist/cdn/assets/layer-table/t9n/messages.hu.json +1 -27
  739. package/dist/cdn/assets/layer-table/t9n/messages.id.json +1 -27
  740. package/dist/cdn/assets/layer-table/t9n/messages.it.json +1 -27
  741. package/dist/cdn/assets/layer-table/t9n/messages.ja.json +1 -27
  742. package/dist/cdn/assets/layer-table/t9n/messages.json +1 -27
  743. package/dist/cdn/assets/layer-table/t9n/messages.ko.json +1 -27
  744. package/dist/cdn/assets/layer-table/t9n/messages.lt.json +1 -27
  745. package/dist/cdn/assets/layer-table/t9n/messages.lv.json +1 -27
  746. package/dist/cdn/assets/layer-table/t9n/messages.nb.json +1 -25
  747. package/dist/cdn/assets/layer-table/t9n/messages.nl.json +1 -27
  748. package/dist/cdn/assets/layer-table/t9n/messages.no.json +1 -27
  749. package/dist/cdn/assets/layer-table/t9n/messages.pl.json +1 -27
  750. package/dist/cdn/assets/layer-table/t9n/messages.pt-BR.json +1 -27
  751. package/dist/cdn/assets/layer-table/t9n/messages.pt-PT.json +1 -27
  752. package/dist/cdn/assets/layer-table/t9n/messages.ro.json +1 -27
  753. package/dist/cdn/assets/layer-table/t9n/messages.ru.json +1 -27
  754. package/dist/cdn/assets/layer-table/t9n/messages.sk.json +1 -27
  755. package/dist/cdn/assets/layer-table/t9n/messages.sl.json +1 -27
  756. package/dist/cdn/assets/layer-table/t9n/messages.sr.json +1 -27
  757. package/dist/cdn/assets/layer-table/t9n/messages.sv.json +1 -27
  758. package/dist/cdn/assets/layer-table/t9n/messages.th.json +1 -27
  759. package/dist/cdn/assets/layer-table/t9n/messages.tr.json +1 -27
  760. package/dist/cdn/assets/layer-table/t9n/messages.uk.json +1 -27
  761. package/dist/cdn/assets/layer-table/t9n/messages.vi.json +1 -27
  762. package/dist/cdn/assets/layer-table/t9n/messages.zh-CN.json +1 -27
  763. package/dist/cdn/assets/layer-table/t9n/messages.zh-HK.json +1 -27
  764. package/dist/cdn/assets/layer-table/t9n/messages.zh-TW.json +1 -27
  765. package/dist/cdn/assets/map-card/t9n/messages.ar.json +1 -11
  766. package/dist/cdn/assets/map-card/t9n/messages.bg.json +1 -11
  767. package/dist/cdn/assets/map-card/t9n/messages.bs.json +1 -11
  768. package/dist/cdn/assets/map-card/t9n/messages.ca.json +1 -11
  769. package/dist/cdn/assets/map-card/t9n/messages.cs.json +1 -11
  770. package/dist/cdn/assets/map-card/t9n/messages.da.json +1 -11
  771. package/dist/cdn/assets/map-card/t9n/messages.de.json +1 -11
  772. package/dist/cdn/assets/map-card/t9n/messages.el.json +1 -11
  773. package/dist/cdn/assets/map-card/t9n/messages.en.json +1 -11
  774. package/dist/cdn/assets/map-card/t9n/messages.es.json +1 -11
  775. package/dist/cdn/assets/map-card/t9n/messages.et.json +1 -11
  776. package/dist/cdn/assets/map-card/t9n/messages.fi.json +1 -11
  777. package/dist/cdn/assets/map-card/t9n/messages.fr.json +1 -11
  778. package/dist/cdn/assets/map-card/t9n/messages.he.json +1 -11
  779. package/dist/cdn/assets/map-card/t9n/messages.hr.json +1 -11
  780. package/dist/cdn/assets/map-card/t9n/messages.hu.json +1 -11
  781. package/dist/cdn/assets/map-card/t9n/messages.id.json +1 -11
  782. package/dist/cdn/assets/map-card/t9n/messages.it.json +1 -11
  783. package/dist/cdn/assets/map-card/t9n/messages.ja.json +1 -11
  784. package/dist/cdn/assets/map-card/t9n/messages.json +1 -11
  785. package/dist/cdn/assets/map-card/t9n/messages.ko.json +1 -11
  786. package/dist/cdn/assets/map-card/t9n/messages.lt.json +1 -11
  787. package/dist/cdn/assets/map-card/t9n/messages.lv.json +1 -11
  788. package/dist/cdn/assets/map-card/t9n/messages.nb.json +1 -10
  789. package/dist/cdn/assets/map-card/t9n/messages.nl.json +1 -11
  790. package/dist/cdn/assets/map-card/t9n/messages.no.json +1 -11
  791. package/dist/cdn/assets/map-card/t9n/messages.pl.json +1 -11
  792. package/dist/cdn/assets/map-card/t9n/messages.pt-BR.json +1 -11
  793. package/dist/cdn/assets/map-card/t9n/messages.pt-PT.json +1 -11
  794. package/dist/cdn/assets/map-card/t9n/messages.ro.json +1 -11
  795. package/dist/cdn/assets/map-card/t9n/messages.ru.json +1 -11
  796. package/dist/cdn/assets/map-card/t9n/messages.sk.json +1 -11
  797. package/dist/cdn/assets/map-card/t9n/messages.sl.json +1 -11
  798. package/dist/cdn/assets/map-card/t9n/messages.sr.json +1 -11
  799. package/dist/cdn/assets/map-card/t9n/messages.sv.json +1 -11
  800. package/dist/cdn/assets/map-card/t9n/messages.th.json +1 -11
  801. package/dist/cdn/assets/map-card/t9n/messages.tr.json +1 -11
  802. package/dist/cdn/assets/map-card/t9n/messages.uk.json +1 -11
  803. package/dist/cdn/assets/map-card/t9n/messages.vi.json +1 -11
  804. package/dist/cdn/assets/map-card/t9n/messages.zh-CN.json +1 -11
  805. package/dist/cdn/assets/map-card/t9n/messages.zh-HK.json +1 -11
  806. package/dist/cdn/assets/map-card/t9n/messages.zh-TW.json +1 -11
  807. package/dist/cdn/assets/map-draw-tools/t9n/messages.ar.json +1 -5
  808. package/dist/cdn/assets/map-draw-tools/t9n/messages.bg.json +1 -5
  809. package/dist/cdn/assets/map-draw-tools/t9n/messages.bs.json +1 -5
  810. package/dist/cdn/assets/map-draw-tools/t9n/messages.ca.json +1 -5
  811. package/dist/cdn/assets/map-draw-tools/t9n/messages.cs.json +1 -5
  812. package/dist/cdn/assets/map-draw-tools/t9n/messages.da.json +1 -5
  813. package/dist/cdn/assets/map-draw-tools/t9n/messages.de.json +1 -5
  814. package/dist/cdn/assets/map-draw-tools/t9n/messages.el.json +1 -5
  815. package/dist/cdn/assets/map-draw-tools/t9n/messages.en.json +1 -5
  816. package/dist/cdn/assets/map-draw-tools/t9n/messages.es.json +1 -5
  817. package/dist/cdn/assets/map-draw-tools/t9n/messages.et.json +1 -5
  818. package/dist/cdn/assets/map-draw-tools/t9n/messages.fi.json +1 -5
  819. package/dist/cdn/assets/map-draw-tools/t9n/messages.fr.json +1 -5
  820. package/dist/cdn/assets/map-draw-tools/t9n/messages.he.json +1 -5
  821. package/dist/cdn/assets/map-draw-tools/t9n/messages.hr.json +1 -5
  822. package/dist/cdn/assets/map-draw-tools/t9n/messages.hu.json +1 -5
  823. package/dist/cdn/assets/map-draw-tools/t9n/messages.id.json +1 -5
  824. package/dist/cdn/assets/map-draw-tools/t9n/messages.it.json +1 -5
  825. package/dist/cdn/assets/map-draw-tools/t9n/messages.ja.json +1 -5
  826. package/dist/cdn/assets/map-draw-tools/t9n/messages.json +1 -5
  827. package/dist/cdn/assets/map-draw-tools/t9n/messages.ko.json +1 -5
  828. package/dist/cdn/assets/map-draw-tools/t9n/messages.lt.json +1 -5
  829. package/dist/cdn/assets/map-draw-tools/t9n/messages.lv.json +1 -5
  830. package/dist/cdn/assets/map-draw-tools/t9n/messages.nb.json +1 -5
  831. package/dist/cdn/assets/map-draw-tools/t9n/messages.nl.json +1 -5
  832. package/dist/cdn/assets/map-draw-tools/t9n/messages.no.json +1 -5
  833. package/dist/cdn/assets/map-draw-tools/t9n/messages.pl.json +1 -5
  834. package/dist/cdn/assets/map-draw-tools/t9n/messages.pt-BR.json +1 -5
  835. package/dist/cdn/assets/map-draw-tools/t9n/messages.pt-PT.json +1 -5
  836. package/dist/cdn/assets/map-draw-tools/t9n/messages.ro.json +1 -5
  837. package/dist/cdn/assets/map-draw-tools/t9n/messages.ru.json +1 -5
  838. package/dist/cdn/assets/map-draw-tools/t9n/messages.sk.json +1 -5
  839. package/dist/cdn/assets/map-draw-tools/t9n/messages.sl.json +1 -5
  840. package/dist/cdn/assets/map-draw-tools/t9n/messages.sr.json +1 -5
  841. package/dist/cdn/assets/map-draw-tools/t9n/messages.sv.json +1 -5
  842. package/dist/cdn/assets/map-draw-tools/t9n/messages.th.json +1 -5
  843. package/dist/cdn/assets/map-draw-tools/t9n/messages.tr.json +1 -5
  844. package/dist/cdn/assets/map-draw-tools/t9n/messages.uk.json +1 -5
  845. package/dist/cdn/assets/map-draw-tools/t9n/messages.vi.json +1 -5
  846. package/dist/cdn/assets/map-draw-tools/t9n/messages.zh-CN.json +1 -5
  847. package/dist/cdn/assets/map-draw-tools/t9n/messages.zh-HK.json +1 -5
  848. package/dist/cdn/assets/map-draw-tools/t9n/messages.zh-TW.json +1 -5
  849. package/dist/cdn/assets/map-layer-picker/t9n/messages.ar.json +1 -5
  850. package/dist/cdn/assets/map-layer-picker/t9n/messages.bg.json +1 -5
  851. package/dist/cdn/assets/map-layer-picker/t9n/messages.bs.json +1 -5
  852. package/dist/cdn/assets/map-layer-picker/t9n/messages.ca.json +1 -5
  853. package/dist/cdn/assets/map-layer-picker/t9n/messages.cs.json +1 -5
  854. package/dist/cdn/assets/map-layer-picker/t9n/messages.da.json +1 -5
  855. package/dist/cdn/assets/map-layer-picker/t9n/messages.de.json +1 -5
  856. package/dist/cdn/assets/map-layer-picker/t9n/messages.el.json +1 -5
  857. package/dist/cdn/assets/map-layer-picker/t9n/messages.en.json +1 -5
  858. package/dist/cdn/assets/map-layer-picker/t9n/messages.es.json +1 -5
  859. package/dist/cdn/assets/map-layer-picker/t9n/messages.et.json +1 -5
  860. package/dist/cdn/assets/map-layer-picker/t9n/messages.fi.json +1 -5
  861. package/dist/cdn/assets/map-layer-picker/t9n/messages.fr.json +1 -5
  862. package/dist/cdn/assets/map-layer-picker/t9n/messages.he.json +1 -5
  863. package/dist/cdn/assets/map-layer-picker/t9n/messages.hr.json +1 -5
  864. package/dist/cdn/assets/map-layer-picker/t9n/messages.hu.json +1 -5
  865. package/dist/cdn/assets/map-layer-picker/t9n/messages.id.json +1 -5
  866. package/dist/cdn/assets/map-layer-picker/t9n/messages.it.json +1 -5
  867. package/dist/cdn/assets/map-layer-picker/t9n/messages.ja.json +1 -5
  868. package/dist/cdn/assets/map-layer-picker/t9n/messages.json +1 -5
  869. package/dist/cdn/assets/map-layer-picker/t9n/messages.ko.json +1 -5
  870. package/dist/cdn/assets/map-layer-picker/t9n/messages.lt.json +1 -5
  871. package/dist/cdn/assets/map-layer-picker/t9n/messages.lv.json +1 -5
  872. package/dist/cdn/assets/map-layer-picker/t9n/messages.nb.json +1 -5
  873. package/dist/cdn/assets/map-layer-picker/t9n/messages.nl.json +1 -5
  874. package/dist/cdn/assets/map-layer-picker/t9n/messages.no.json +1 -5
  875. package/dist/cdn/assets/map-layer-picker/t9n/messages.pl.json +1 -5
  876. package/dist/cdn/assets/map-layer-picker/t9n/messages.pt-BR.json +1 -5
  877. package/dist/cdn/assets/map-layer-picker/t9n/messages.pt-PT.json +1 -5
  878. package/dist/cdn/assets/map-layer-picker/t9n/messages.ro.json +1 -5
  879. package/dist/cdn/assets/map-layer-picker/t9n/messages.ru.json +1 -5
  880. package/dist/cdn/assets/map-layer-picker/t9n/messages.sk.json +1 -5
  881. package/dist/cdn/assets/map-layer-picker/t9n/messages.sl.json +1 -5
  882. package/dist/cdn/assets/map-layer-picker/t9n/messages.sr.json +1 -5
  883. package/dist/cdn/assets/map-layer-picker/t9n/messages.sv.json +1 -5
  884. package/dist/cdn/assets/map-layer-picker/t9n/messages.th.json +1 -5
  885. package/dist/cdn/assets/map-layer-picker/t9n/messages.tr.json +1 -5
  886. package/dist/cdn/assets/map-layer-picker/t9n/messages.uk.json +1 -5
  887. package/dist/cdn/assets/map-layer-picker/t9n/messages.vi.json +1 -5
  888. package/dist/cdn/assets/map-layer-picker/t9n/messages.zh-CN.json +1 -5
  889. package/dist/cdn/assets/map-layer-picker/t9n/messages.zh-HK.json +1 -5
  890. package/dist/cdn/assets/map-layer-picker/t9n/messages.zh-TW.json +1 -5
  891. package/dist/cdn/assets/map-picker/t9n/messages.ar.json +1 -3
  892. package/dist/cdn/assets/map-picker/t9n/messages.bg.json +1 -3
  893. package/dist/cdn/assets/map-picker/t9n/messages.bs.json +1 -3
  894. package/dist/cdn/assets/map-picker/t9n/messages.ca.json +1 -3
  895. package/dist/cdn/assets/map-picker/t9n/messages.cs.json +1 -3
  896. package/dist/cdn/assets/map-picker/t9n/messages.da.json +1 -3
  897. package/dist/cdn/assets/map-picker/t9n/messages.de.json +1 -3
  898. package/dist/cdn/assets/map-picker/t9n/messages.el.json +1 -3
  899. package/dist/cdn/assets/map-picker/t9n/messages.en.json +1 -3
  900. package/dist/cdn/assets/map-picker/t9n/messages.es.json +1 -3
  901. package/dist/cdn/assets/map-picker/t9n/messages.et.json +1 -3
  902. package/dist/cdn/assets/map-picker/t9n/messages.fi.json +1 -3
  903. package/dist/cdn/assets/map-picker/t9n/messages.fr.json +1 -3
  904. package/dist/cdn/assets/map-picker/t9n/messages.he.json +1 -3
  905. package/dist/cdn/assets/map-picker/t9n/messages.hr.json +1 -3
  906. package/dist/cdn/assets/map-picker/t9n/messages.hu.json +1 -3
  907. package/dist/cdn/assets/map-picker/t9n/messages.id.json +1 -3
  908. package/dist/cdn/assets/map-picker/t9n/messages.it.json +1 -3
  909. package/dist/cdn/assets/map-picker/t9n/messages.ja.json +1 -3
  910. package/dist/cdn/assets/map-picker/t9n/messages.json +1 -3
  911. package/dist/cdn/assets/map-picker/t9n/messages.ko.json +1 -3
  912. package/dist/cdn/assets/map-picker/t9n/messages.lt.json +1 -3
  913. package/dist/cdn/assets/map-picker/t9n/messages.lv.json +1 -3
  914. package/dist/cdn/assets/map-picker/t9n/messages.nb.json +1 -3
  915. package/dist/cdn/assets/map-picker/t9n/messages.nl.json +1 -3
  916. package/dist/cdn/assets/map-picker/t9n/messages.no.json +1 -3
  917. package/dist/cdn/assets/map-picker/t9n/messages.pl.json +1 -3
  918. package/dist/cdn/assets/map-picker/t9n/messages.pt-BR.json +1 -3
  919. package/dist/cdn/assets/map-picker/t9n/messages.pt-PT.json +1 -3
  920. package/dist/cdn/assets/map-picker/t9n/messages.ro.json +1 -3
  921. package/dist/cdn/assets/map-picker/t9n/messages.ru.json +1 -3
  922. package/dist/cdn/assets/map-picker/t9n/messages.sk.json +1 -3
  923. package/dist/cdn/assets/map-picker/t9n/messages.sl.json +1 -3
  924. package/dist/cdn/assets/map-picker/t9n/messages.sr.json +1 -3
  925. package/dist/cdn/assets/map-picker/t9n/messages.sv.json +1 -3
  926. package/dist/cdn/assets/map-picker/t9n/messages.th.json +1 -3
  927. package/dist/cdn/assets/map-picker/t9n/messages.tr.json +1 -3
  928. package/dist/cdn/assets/map-picker/t9n/messages.uk.json +1 -3
  929. package/dist/cdn/assets/map-picker/t9n/messages.vi.json +1 -3
  930. package/dist/cdn/assets/map-picker/t9n/messages.zh-CN.json +1 -3
  931. package/dist/cdn/assets/map-picker/t9n/messages.zh-HK.json +1 -3
  932. package/dist/cdn/assets/map-picker/t9n/messages.zh-TW.json +1 -3
  933. package/dist/cdn/assets/map-search/t9n/messages.ar.json +1 -3
  934. package/dist/cdn/assets/map-search/t9n/messages.bg.json +1 -3
  935. package/dist/cdn/assets/map-search/t9n/messages.bs.json +1 -3
  936. package/dist/cdn/assets/map-search/t9n/messages.ca.json +1 -3
  937. package/dist/cdn/assets/map-search/t9n/messages.cs.json +1 -3
  938. package/dist/cdn/assets/map-search/t9n/messages.da.json +1 -3
  939. package/dist/cdn/assets/map-search/t9n/messages.de.json +1 -3
  940. package/dist/cdn/assets/map-search/t9n/messages.el.json +1 -3
  941. package/dist/cdn/assets/map-search/t9n/messages.en.json +1 -3
  942. package/dist/cdn/assets/map-search/t9n/messages.es.json +1 -3
  943. package/dist/cdn/assets/map-search/t9n/messages.et.json +1 -3
  944. package/dist/cdn/assets/map-search/t9n/messages.fi.json +1 -3
  945. package/dist/cdn/assets/map-search/t9n/messages.fr.json +1 -3
  946. package/dist/cdn/assets/map-search/t9n/messages.he.json +1 -3
  947. package/dist/cdn/assets/map-search/t9n/messages.hr.json +1 -3
  948. package/dist/cdn/assets/map-search/t9n/messages.hu.json +1 -3
  949. package/dist/cdn/assets/map-search/t9n/messages.id.json +1 -3
  950. package/dist/cdn/assets/map-search/t9n/messages.it.json +1 -3
  951. package/dist/cdn/assets/map-search/t9n/messages.ja.json +1 -3
  952. package/dist/cdn/assets/map-search/t9n/messages.json +1 -3
  953. package/dist/cdn/assets/map-search/t9n/messages.ko.json +1 -3
  954. package/dist/cdn/assets/map-search/t9n/messages.lt.json +1 -3
  955. package/dist/cdn/assets/map-search/t9n/messages.lv.json +1 -3
  956. package/dist/cdn/assets/map-search/t9n/messages.nl.json +1 -3
  957. package/dist/cdn/assets/map-search/t9n/messages.no.json +1 -3
  958. package/dist/cdn/assets/map-search/t9n/messages.pl.json +1 -3
  959. package/dist/cdn/assets/map-search/t9n/messages.pt-BR.json +1 -3
  960. package/dist/cdn/assets/map-search/t9n/messages.pt-PT.json +1 -3
  961. package/dist/cdn/assets/map-search/t9n/messages.ro.json +1 -3
  962. package/dist/cdn/assets/map-search/t9n/messages.ru.json +1 -3
  963. package/dist/cdn/assets/map-search/t9n/messages.sk.json +1 -3
  964. package/dist/cdn/assets/map-search/t9n/messages.sl.json +1 -3
  965. package/dist/cdn/assets/map-search/t9n/messages.sr.json +1 -3
  966. package/dist/cdn/assets/map-search/t9n/messages.sv.json +1 -3
  967. package/dist/cdn/assets/map-search/t9n/messages.th.json +1 -3
  968. package/dist/cdn/assets/map-search/t9n/messages.tr.json +1 -3
  969. package/dist/cdn/assets/map-search/t9n/messages.uk.json +1 -3
  970. package/dist/cdn/assets/map-search/t9n/messages.vi.json +1 -3
  971. package/dist/cdn/assets/map-search/t9n/messages.zh-CN.json +1 -3
  972. package/dist/cdn/assets/map-search/t9n/messages.zh-HK.json +1 -3
  973. package/dist/cdn/assets/map-search/t9n/messages.zh-TW.json +1 -3
  974. package/dist/cdn/assets/map-select-tools/t9n/messages.ar.json +1 -16
  975. package/dist/cdn/assets/map-select-tools/t9n/messages.bg.json +1 -16
  976. package/dist/cdn/assets/map-select-tools/t9n/messages.bs.json +1 -16
  977. package/dist/cdn/assets/map-select-tools/t9n/messages.ca.json +1 -16
  978. package/dist/cdn/assets/map-select-tools/t9n/messages.cs.json +1 -16
  979. package/dist/cdn/assets/map-select-tools/t9n/messages.da.json +1 -16
  980. package/dist/cdn/assets/map-select-tools/t9n/messages.de.json +1 -16
  981. package/dist/cdn/assets/map-select-tools/t9n/messages.el.json +1 -16
  982. package/dist/cdn/assets/map-select-tools/t9n/messages.en.json +1 -16
  983. package/dist/cdn/assets/map-select-tools/t9n/messages.es.json +1 -16
  984. package/dist/cdn/assets/map-select-tools/t9n/messages.et.json +1 -16
  985. package/dist/cdn/assets/map-select-tools/t9n/messages.fi.json +1 -16
  986. package/dist/cdn/assets/map-select-tools/t9n/messages.fr.json +1 -16
  987. package/dist/cdn/assets/map-select-tools/t9n/messages.he.json +1 -16
  988. package/dist/cdn/assets/map-select-tools/t9n/messages.hr.json +1 -16
  989. package/dist/cdn/assets/map-select-tools/t9n/messages.hu.json +1 -16
  990. package/dist/cdn/assets/map-select-tools/t9n/messages.id.json +1 -16
  991. package/dist/cdn/assets/map-select-tools/t9n/messages.it.json +1 -16
  992. package/dist/cdn/assets/map-select-tools/t9n/messages.ja.json +1 -16
  993. package/dist/cdn/assets/map-select-tools/t9n/messages.json +1 -16
  994. package/dist/cdn/assets/map-select-tools/t9n/messages.ko.json +1 -16
  995. package/dist/cdn/assets/map-select-tools/t9n/messages.lt.json +1 -16
  996. package/dist/cdn/assets/map-select-tools/t9n/messages.lv.json +1 -16
  997. package/dist/cdn/assets/map-select-tools/t9n/messages.nb.json +1 -16
  998. package/dist/cdn/assets/map-select-tools/t9n/messages.nl.json +1 -16
  999. package/dist/cdn/assets/map-select-tools/t9n/messages.no.json +1 -16
  1000. package/dist/cdn/assets/map-select-tools/t9n/messages.pl.json +1 -16
  1001. package/dist/cdn/assets/map-select-tools/t9n/messages.pt-BR.json +1 -16
  1002. package/dist/cdn/assets/map-select-tools/t9n/messages.pt-PT.json +1 -16
  1003. package/dist/cdn/assets/map-select-tools/t9n/messages.ro.json +1 -16
  1004. package/dist/cdn/assets/map-select-tools/t9n/messages.ru.json +1 -16
  1005. package/dist/cdn/assets/map-select-tools/t9n/messages.sk.json +1 -16
  1006. package/dist/cdn/assets/map-select-tools/t9n/messages.sl.json +1 -16
  1007. package/dist/cdn/assets/map-select-tools/t9n/messages.sr.json +1 -16
  1008. package/dist/cdn/assets/map-select-tools/t9n/messages.sv.json +1 -16
  1009. package/dist/cdn/assets/map-select-tools/t9n/messages.th.json +1 -16
  1010. package/dist/cdn/assets/map-select-tools/t9n/messages.tr.json +1 -16
  1011. package/dist/cdn/assets/map-select-tools/t9n/messages.uk.json +1 -16
  1012. package/dist/cdn/assets/map-select-tools/t9n/messages.vi.json +1 -16
  1013. package/dist/cdn/assets/map-select-tools/t9n/messages.zh-CN.json +1 -16
  1014. package/dist/cdn/assets/map-select-tools/t9n/messages.zh-HK.json +1 -16
  1015. package/dist/cdn/assets/map-select-tools/t9n/messages.zh-TW.json +1 -16
  1016. package/dist/cdn/assets/map-tools/t9n/messages.ar.json +1 -16
  1017. package/dist/cdn/assets/map-tools/t9n/messages.bg.json +1 -16
  1018. package/dist/cdn/assets/map-tools/t9n/messages.bs.json +1 -16
  1019. package/dist/cdn/assets/map-tools/t9n/messages.ca.json +1 -16
  1020. package/dist/cdn/assets/map-tools/t9n/messages.cs.json +1 -16
  1021. package/dist/cdn/assets/map-tools/t9n/messages.da.json +1 -16
  1022. package/dist/cdn/assets/map-tools/t9n/messages.de.json +1 -16
  1023. package/dist/cdn/assets/map-tools/t9n/messages.el.json +1 -16
  1024. package/dist/cdn/assets/map-tools/t9n/messages.en.json +1 -16
  1025. package/dist/cdn/assets/map-tools/t9n/messages.es.json +1 -16
  1026. package/dist/cdn/assets/map-tools/t9n/messages.et.json +1 -16
  1027. package/dist/cdn/assets/map-tools/t9n/messages.fi.json +1 -16
  1028. package/dist/cdn/assets/map-tools/t9n/messages.fr.json +1 -16
  1029. package/dist/cdn/assets/map-tools/t9n/messages.he.json +1 -16
  1030. package/dist/cdn/assets/map-tools/t9n/messages.hr.json +1 -16
  1031. package/dist/cdn/assets/map-tools/t9n/messages.hu.json +1 -16
  1032. package/dist/cdn/assets/map-tools/t9n/messages.id.json +1 -16
  1033. package/dist/cdn/assets/map-tools/t9n/messages.it.json +1 -16
  1034. package/dist/cdn/assets/map-tools/t9n/messages.ja.json +1 -16
  1035. package/dist/cdn/assets/map-tools/t9n/messages.json +1 -16
  1036. package/dist/cdn/assets/map-tools/t9n/messages.ko.json +1 -16
  1037. package/dist/cdn/assets/map-tools/t9n/messages.lt.json +1 -16
  1038. package/dist/cdn/assets/map-tools/t9n/messages.lv.json +1 -16
  1039. package/dist/cdn/assets/map-tools/t9n/messages.nb.json +1 -10
  1040. package/dist/cdn/assets/map-tools/t9n/messages.nl.json +1 -16
  1041. package/dist/cdn/assets/map-tools/t9n/messages.no.json +1 -16
  1042. package/dist/cdn/assets/map-tools/t9n/messages.pl.json +1 -16
  1043. package/dist/cdn/assets/map-tools/t9n/messages.pt-BR.json +1 -16
  1044. package/dist/cdn/assets/map-tools/t9n/messages.pt-PT.json +1 -16
  1045. package/dist/cdn/assets/map-tools/t9n/messages.ro.json +1 -16
  1046. package/dist/cdn/assets/map-tools/t9n/messages.ru.json +1 -16
  1047. package/dist/cdn/assets/map-tools/t9n/messages.sk.json +1 -16
  1048. package/dist/cdn/assets/map-tools/t9n/messages.sl.json +1 -16
  1049. package/dist/cdn/assets/map-tools/t9n/messages.sr.json +1 -16
  1050. package/dist/cdn/assets/map-tools/t9n/messages.sv.json +1 -16
  1051. package/dist/cdn/assets/map-tools/t9n/messages.th.json +1 -16
  1052. package/dist/cdn/assets/map-tools/t9n/messages.tr.json +1 -16
  1053. package/dist/cdn/assets/map-tools/t9n/messages.uk.json +1 -16
  1054. package/dist/cdn/assets/map-tools/t9n/messages.vi.json +1 -16
  1055. package/dist/cdn/assets/map-tools/t9n/messages.zh-CN.json +1 -16
  1056. package/dist/cdn/assets/map-tools/t9n/messages.zh-HK.json +1 -16
  1057. package/dist/cdn/assets/map-tools/t9n/messages.zh-TW.json +1 -16
  1058. package/dist/cdn/assets/pdf-download/data/labelFormats.json +1 -191
  1059. package/dist/cdn/assets/pdf-download/t9n/messages.ar.json +1 -3
  1060. package/dist/cdn/assets/pdf-download/t9n/messages.bg.json +1 -3
  1061. package/dist/cdn/assets/pdf-download/t9n/messages.bs.json +1 -3
  1062. package/dist/cdn/assets/pdf-download/t9n/messages.ca.json +1 -3
  1063. package/dist/cdn/assets/pdf-download/t9n/messages.cs.json +1 -3
  1064. package/dist/cdn/assets/pdf-download/t9n/messages.da.json +1 -3
  1065. package/dist/cdn/assets/pdf-download/t9n/messages.de.json +1 -3
  1066. package/dist/cdn/assets/pdf-download/t9n/messages.el.json +1 -3
  1067. package/dist/cdn/assets/pdf-download/t9n/messages.en.json +1 -3
  1068. package/dist/cdn/assets/pdf-download/t9n/messages.es.json +1 -3
  1069. package/dist/cdn/assets/pdf-download/t9n/messages.et.json +1 -3
  1070. package/dist/cdn/assets/pdf-download/t9n/messages.fi.json +1 -3
  1071. package/dist/cdn/assets/pdf-download/t9n/messages.fr.json +1 -3
  1072. package/dist/cdn/assets/pdf-download/t9n/messages.he.json +1 -3
  1073. package/dist/cdn/assets/pdf-download/t9n/messages.hr.json +1 -3
  1074. package/dist/cdn/assets/pdf-download/t9n/messages.hu.json +1 -3
  1075. package/dist/cdn/assets/pdf-download/t9n/messages.id.json +1 -3
  1076. package/dist/cdn/assets/pdf-download/t9n/messages.it.json +1 -3
  1077. package/dist/cdn/assets/pdf-download/t9n/messages.ja.json +1 -3
  1078. package/dist/cdn/assets/pdf-download/t9n/messages.json +1 -3
  1079. package/dist/cdn/assets/pdf-download/t9n/messages.ko.json +1 -3
  1080. package/dist/cdn/assets/pdf-download/t9n/messages.lt.json +1 -3
  1081. package/dist/cdn/assets/pdf-download/t9n/messages.lv.json +1 -3
  1082. package/dist/cdn/assets/pdf-download/t9n/messages.nb.json +1 -3
  1083. package/dist/cdn/assets/pdf-download/t9n/messages.nl.json +1 -3
  1084. package/dist/cdn/assets/pdf-download/t9n/messages.no.json +1 -3
  1085. package/dist/cdn/assets/pdf-download/t9n/messages.pl.json +1 -3
  1086. package/dist/cdn/assets/pdf-download/t9n/messages.pt-BR.json +1 -3
  1087. package/dist/cdn/assets/pdf-download/t9n/messages.pt-PT.json +1 -3
  1088. package/dist/cdn/assets/pdf-download/t9n/messages.ro.json +1 -3
  1089. package/dist/cdn/assets/pdf-download/t9n/messages.ru.json +1 -3
  1090. package/dist/cdn/assets/pdf-download/t9n/messages.sk.json +1 -3
  1091. package/dist/cdn/assets/pdf-download/t9n/messages.sl.json +1 -3
  1092. package/dist/cdn/assets/pdf-download/t9n/messages.sr.json +1 -3
  1093. package/dist/cdn/assets/pdf-download/t9n/messages.sv.json +1 -3
  1094. package/dist/cdn/assets/pdf-download/t9n/messages.th.json +1 -3
  1095. package/dist/cdn/assets/pdf-download/t9n/messages.tr.json +1 -3
  1096. package/dist/cdn/assets/pdf-download/t9n/messages.uk.json +1 -3
  1097. package/dist/cdn/assets/pdf-download/t9n/messages.vi.json +1 -3
  1098. package/dist/cdn/assets/pdf-download/t9n/messages.zh-CN.json +1 -3
  1099. package/dist/cdn/assets/pdf-download/t9n/messages.zh-HK.json +1 -3
  1100. package/dist/cdn/assets/pdf-download/t9n/messages.zh-TW.json +1 -3
  1101. package/dist/cdn/assets/public-notification/t9n/messages.ar.json +1 -54
  1102. package/dist/cdn/assets/public-notification/t9n/messages.bg.json +1 -54
  1103. package/dist/cdn/assets/public-notification/t9n/messages.bs.json +1 -54
  1104. package/dist/cdn/assets/public-notification/t9n/messages.ca.json +1 -54
  1105. package/dist/cdn/assets/public-notification/t9n/messages.cs.json +1 -54
  1106. package/dist/cdn/assets/public-notification/t9n/messages.da.json +1 -54
  1107. package/dist/cdn/assets/public-notification/t9n/messages.de.json +1 -54
  1108. package/dist/cdn/assets/public-notification/t9n/messages.el.json +1 -54
  1109. package/dist/cdn/assets/public-notification/t9n/messages.en.json +1 -54
  1110. package/dist/cdn/assets/public-notification/t9n/messages.es.json +1 -54
  1111. package/dist/cdn/assets/public-notification/t9n/messages.et.json +1 -54
  1112. package/dist/cdn/assets/public-notification/t9n/messages.fi.json +1 -54
  1113. package/dist/cdn/assets/public-notification/t9n/messages.fr.json +1 -54
  1114. package/dist/cdn/assets/public-notification/t9n/messages.he.json +1 -54
  1115. package/dist/cdn/assets/public-notification/t9n/messages.hr.json +1 -54
  1116. package/dist/cdn/assets/public-notification/t9n/messages.hu.json +1 -54
  1117. package/dist/cdn/assets/public-notification/t9n/messages.id.json +1 -54
  1118. package/dist/cdn/assets/public-notification/t9n/messages.it.json +1 -54
  1119. package/dist/cdn/assets/public-notification/t9n/messages.ja.json +1 -54
  1120. package/dist/cdn/assets/public-notification/t9n/messages.json +1 -54
  1121. package/dist/cdn/assets/public-notification/t9n/messages.ko.json +1 -54
  1122. package/dist/cdn/assets/public-notification/t9n/messages.lt.json +1 -54
  1123. package/dist/cdn/assets/public-notification/t9n/messages.lv.json +1 -54
  1124. package/dist/cdn/assets/public-notification/t9n/messages.nb.json +1 -44
  1125. package/dist/cdn/assets/public-notification/t9n/messages.nl.json +1 -54
  1126. package/dist/cdn/assets/public-notification/t9n/messages.no.json +1 -54
  1127. package/dist/cdn/assets/public-notification/t9n/messages.pl.json +1 -54
  1128. package/dist/cdn/assets/public-notification/t9n/messages.pt-BR.json +1 -54
  1129. package/dist/cdn/assets/public-notification/t9n/messages.pt-PT.json +1 -54
  1130. package/dist/cdn/assets/public-notification/t9n/messages.ro.json +1 -54
  1131. package/dist/cdn/assets/public-notification/t9n/messages.ru.json +1 -54
  1132. package/dist/cdn/assets/public-notification/t9n/messages.sk.json +1 -54
  1133. package/dist/cdn/assets/public-notification/t9n/messages.sl.json +1 -54
  1134. package/dist/cdn/assets/public-notification/t9n/messages.sr.json +1 -54
  1135. package/dist/cdn/assets/public-notification/t9n/messages.sv.json +1 -54
  1136. package/dist/cdn/assets/public-notification/t9n/messages.th.json +1 -54
  1137. package/dist/cdn/assets/public-notification/t9n/messages.tr.json +1 -54
  1138. package/dist/cdn/assets/public-notification/t9n/messages.uk.json +1 -54
  1139. package/dist/cdn/assets/public-notification/t9n/messages.vi.json +1 -54
  1140. package/dist/cdn/assets/public-notification/t9n/messages.zh-CN.json +1 -54
  1141. package/dist/cdn/assets/public-notification/t9n/messages.zh-HK.json +1 -54
  1142. package/dist/cdn/assets/public-notification/t9n/messages.zh-TW.json +1 -54
  1143. package/dist/cdn/assets/refine-selection/t9n/messages.ar.json +1 -13
  1144. package/dist/cdn/assets/refine-selection/t9n/messages.bg.json +1 -13
  1145. package/dist/cdn/assets/refine-selection/t9n/messages.bs.json +1 -13
  1146. package/dist/cdn/assets/refine-selection/t9n/messages.ca.json +1 -13
  1147. package/dist/cdn/assets/refine-selection/t9n/messages.cs.json +1 -13
  1148. package/dist/cdn/assets/refine-selection/t9n/messages.da.json +1 -13
  1149. package/dist/cdn/assets/refine-selection/t9n/messages.de.json +1 -13
  1150. package/dist/cdn/assets/refine-selection/t9n/messages.el.json +1 -13
  1151. package/dist/cdn/assets/refine-selection/t9n/messages.en.json +1 -13
  1152. package/dist/cdn/assets/refine-selection/t9n/messages.es.json +1 -13
  1153. package/dist/cdn/assets/refine-selection/t9n/messages.et.json +1 -13
  1154. package/dist/cdn/assets/refine-selection/t9n/messages.fi.json +1 -13
  1155. package/dist/cdn/assets/refine-selection/t9n/messages.fr.json +1 -13
  1156. package/dist/cdn/assets/refine-selection/t9n/messages.he.json +1 -13
  1157. package/dist/cdn/assets/refine-selection/t9n/messages.hr.json +1 -13
  1158. package/dist/cdn/assets/refine-selection/t9n/messages.hu.json +1 -13
  1159. package/dist/cdn/assets/refine-selection/t9n/messages.id.json +1 -13
  1160. package/dist/cdn/assets/refine-selection/t9n/messages.it.json +1 -13
  1161. package/dist/cdn/assets/refine-selection/t9n/messages.ja.json +1 -13
  1162. package/dist/cdn/assets/refine-selection/t9n/messages.json +1 -13
  1163. package/dist/cdn/assets/refine-selection/t9n/messages.ko.json +1 -13
  1164. package/dist/cdn/assets/refine-selection/t9n/messages.lt.json +1 -13
  1165. package/dist/cdn/assets/refine-selection/t9n/messages.lv.json +1 -13
  1166. package/dist/cdn/assets/refine-selection/t9n/messages.nb.json +1 -9
  1167. package/dist/cdn/assets/refine-selection/t9n/messages.nl.json +1 -13
  1168. package/dist/cdn/assets/refine-selection/t9n/messages.no.json +1 -13
  1169. package/dist/cdn/assets/refine-selection/t9n/messages.pl.json +1 -13
  1170. package/dist/cdn/assets/refine-selection/t9n/messages.pt-BR.json +1 -13
  1171. package/dist/cdn/assets/refine-selection/t9n/messages.pt-PT.json +1 -13
  1172. package/dist/cdn/assets/refine-selection/t9n/messages.ro.json +1 -13
  1173. package/dist/cdn/assets/refine-selection/t9n/messages.ru.json +1 -13
  1174. package/dist/cdn/assets/refine-selection/t9n/messages.sk.json +1 -13
  1175. package/dist/cdn/assets/refine-selection/t9n/messages.sl.json +1 -13
  1176. package/dist/cdn/assets/refine-selection/t9n/messages.sr.json +1 -13
  1177. package/dist/cdn/assets/refine-selection/t9n/messages.sv.json +1 -13
  1178. package/dist/cdn/assets/refine-selection/t9n/messages.th.json +1 -13
  1179. package/dist/cdn/assets/refine-selection/t9n/messages.tr.json +1 -13
  1180. package/dist/cdn/assets/refine-selection/t9n/messages.uk.json +1 -13
  1181. package/dist/cdn/assets/refine-selection/t9n/messages.vi.json +1 -13
  1182. package/dist/cdn/assets/refine-selection/t9n/messages.zh-CN.json +1 -13
  1183. package/dist/cdn/assets/refine-selection/t9n/messages.zh-HK.json +1 -13
  1184. package/dist/cdn/assets/refine-selection/t9n/messages.zh-TW.json +1 -13
  1185. package/dist/cdn/assets/solution-builder-assistant/images/solutions-builder-draft-thumbnail.png +0 -0
  1186. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.en.json +1 -25
  1187. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.json +1 -25
  1188. package/dist/cdn/assets/solution-configure-titles/t9n/messages.ar.json +1 -14
  1189. package/dist/cdn/assets/solution-configure-titles/t9n/messages.bg.json +1 -14
  1190. package/dist/cdn/assets/solution-configure-titles/t9n/messages.bs.json +1 -14
  1191. package/dist/cdn/assets/solution-configure-titles/t9n/messages.ca.json +1 -14
  1192. package/dist/cdn/assets/solution-configure-titles/t9n/messages.cs.json +1 -14
  1193. package/dist/cdn/assets/solution-configure-titles/t9n/messages.da.json +1 -14
  1194. package/dist/cdn/assets/solution-configure-titles/t9n/messages.de.json +1 -14
  1195. package/dist/cdn/assets/solution-configure-titles/t9n/messages.el.json +1 -14
  1196. package/dist/cdn/assets/solution-configure-titles/t9n/messages.en.json +1 -14
  1197. package/dist/cdn/assets/solution-configure-titles/t9n/messages.es.json +1 -14
  1198. package/dist/cdn/assets/solution-configure-titles/t9n/messages.et.json +1 -14
  1199. package/dist/cdn/assets/solution-configure-titles/t9n/messages.fi.json +1 -14
  1200. package/dist/cdn/assets/solution-configure-titles/t9n/messages.fr.json +1 -14
  1201. package/dist/cdn/assets/solution-configure-titles/t9n/messages.he.json +1 -14
  1202. package/dist/cdn/assets/solution-configure-titles/t9n/messages.hr.json +1 -14
  1203. package/dist/cdn/assets/solution-configure-titles/t9n/messages.hu.json +1 -14
  1204. package/dist/cdn/assets/solution-configure-titles/t9n/messages.id.json +1 -14
  1205. package/dist/cdn/assets/solution-configure-titles/t9n/messages.it.json +1 -14
  1206. package/dist/cdn/assets/solution-configure-titles/t9n/messages.ja.json +1 -14
  1207. package/dist/cdn/assets/solution-configure-titles/t9n/messages.json +1 -14
  1208. package/dist/cdn/assets/solution-configure-titles/t9n/messages.ko.json +1 -14
  1209. package/dist/cdn/assets/solution-configure-titles/t9n/messages.lt.json +1 -14
  1210. package/dist/cdn/assets/solution-configure-titles/t9n/messages.lv.json +1 -14
  1211. package/dist/cdn/assets/solution-configure-titles/t9n/messages.nl.json +1 -14
  1212. package/dist/cdn/assets/solution-configure-titles/t9n/messages.no.json +1 -14
  1213. package/dist/cdn/assets/solution-configure-titles/t9n/messages.pl.json +1 -14
  1214. package/dist/cdn/assets/solution-configure-titles/t9n/messages.pt-BR.json +1 -14
  1215. package/dist/cdn/assets/solution-configure-titles/t9n/messages.pt-PT.json +1 -14
  1216. package/dist/cdn/assets/solution-configure-titles/t9n/messages.ro.json +1 -14
  1217. package/dist/cdn/assets/solution-configure-titles/t9n/messages.ru.json +1 -14
  1218. package/dist/cdn/assets/solution-configure-titles/t9n/messages.sk.json +1 -14
  1219. package/dist/cdn/assets/solution-configure-titles/t9n/messages.sl.json +1 -14
  1220. package/dist/cdn/assets/solution-configure-titles/t9n/messages.sr.json +1 -14
  1221. package/dist/cdn/assets/solution-configure-titles/t9n/messages.sv.json +1 -14
  1222. package/dist/cdn/assets/solution-configure-titles/t9n/messages.th.json +1 -14
  1223. package/dist/cdn/assets/solution-configure-titles/t9n/messages.tr.json +1 -14
  1224. package/dist/cdn/assets/solution-configure-titles/t9n/messages.uk.json +1 -14
  1225. package/dist/cdn/assets/solution-configure-titles/t9n/messages.vi.json +1 -14
  1226. package/dist/cdn/assets/solution-configure-titles/t9n/messages.zh-CN.json +1 -14
  1227. package/dist/cdn/assets/solution-configure-titles/t9n/messages.zh-HK.json +1 -14
  1228. package/dist/cdn/assets/solution-configure-titles/t9n/messages.zh-TW.json +1 -14
  1229. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ar.json +1 -12
  1230. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.bg.json +1 -12
  1231. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.bs.json +1 -12
  1232. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ca.json +1 -12
  1233. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.cs.json +1 -12
  1234. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.da.json +1 -12
  1235. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.de.json +1 -12
  1236. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.el.json +1 -12
  1237. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.en.json +1 -12
  1238. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.es.json +1 -12
  1239. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.et.json +1 -12
  1240. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.fi.json +1 -12
  1241. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.fr.json +1 -12
  1242. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.he.json +1 -12
  1243. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.hr.json +1 -12
  1244. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.hu.json +1 -12
  1245. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.id.json +1 -12
  1246. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.it.json +1 -12
  1247. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ja.json +1 -12
  1248. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.json +1 -12
  1249. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ko.json +1 -12
  1250. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.lt.json +1 -12
  1251. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.lv.json +1 -12
  1252. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.nl.json +1 -12
  1253. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.no.json +1 -12
  1254. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.pl.json +1 -12
  1255. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.pt-BR.json +1 -12
  1256. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.pt-PT.json +1 -12
  1257. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ro.json +1 -12
  1258. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.ru.json +1 -12
  1259. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.sk.json +1 -12
  1260. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.sl.json +1 -12
  1261. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.sr.json +1 -12
  1262. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.sv.json +1 -12
  1263. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.th.json +1 -12
  1264. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.tr.json +1 -12
  1265. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.uk.json +1 -12
  1266. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.vi.json +1 -12
  1267. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.zh-CN.json +1 -12
  1268. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.zh-HK.json +1 -12
  1269. package/dist/cdn/assets/solution-delete-dialog/t9n/messages.zh-TW.json +1 -12
  1270. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ar.json +1 -21
  1271. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.bg.json +1 -21
  1272. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.bs.json +1 -21
  1273. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ca.json +1 -21
  1274. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.cs.json +1 -21
  1275. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.da.json +1 -21
  1276. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.de.json +1 -21
  1277. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.el.json +1 -21
  1278. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.en.json +1 -21
  1279. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.es.json +1 -21
  1280. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.et.json +1 -21
  1281. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.fi.json +1 -21
  1282. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.fr.json +1 -21
  1283. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.he.json +1 -21
  1284. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.hr.json +1 -21
  1285. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.hu.json +1 -21
  1286. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.id.json +1 -21
  1287. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.it.json +1 -21
  1288. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ja.json +1 -21
  1289. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.json +1 -21
  1290. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ko.json +1 -21
  1291. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.lt.json +1 -21
  1292. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.lv.json +1 -21
  1293. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.nl.json +1 -21
  1294. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.no.json +1 -21
  1295. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.pl.json +1 -21
  1296. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.pt-BR.json +1 -21
  1297. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.pt-PT.json +1 -21
  1298. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ro.json +1 -21
  1299. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.ru.json +1 -21
  1300. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.sk.json +1 -21
  1301. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.sl.json +1 -21
  1302. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.sr.json +1 -21
  1303. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.sv.json +1 -21
  1304. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.th.json +1 -21
  1305. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.tr.json +1 -21
  1306. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.uk.json +1 -21
  1307. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.vi.json +1 -21
  1308. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.zh-CN.json +1 -21
  1309. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.zh-HK.json +1 -21
  1310. package/dist/cdn/assets/solution-deploy-dialog/t9n/messages.zh-TW.json +1 -21
  1311. package/dist/cdn/assets/solution-deployed-card/t9n/messages.ar.json +1 -14
  1312. package/dist/cdn/assets/solution-deployed-card/t9n/messages.bg.json +1 -14
  1313. package/dist/cdn/assets/solution-deployed-card/t9n/messages.bs.json +1 -14
  1314. package/dist/cdn/assets/solution-deployed-card/t9n/messages.ca.json +1 -14
  1315. package/dist/cdn/assets/solution-deployed-card/t9n/messages.cs.json +1 -14
  1316. package/dist/cdn/assets/solution-deployed-card/t9n/messages.da.json +1 -14
  1317. package/dist/cdn/assets/solution-deployed-card/t9n/messages.de.json +1 -14
  1318. package/dist/cdn/assets/solution-deployed-card/t9n/messages.el.json +1 -14
  1319. package/dist/cdn/assets/solution-deployed-card/t9n/messages.en.json +1 -14
  1320. package/dist/cdn/assets/solution-deployed-card/t9n/messages.es.json +1 -14
  1321. package/dist/cdn/assets/solution-deployed-card/t9n/messages.et.json +1 -14
  1322. package/dist/cdn/assets/solution-deployed-card/t9n/messages.fi.json +1 -14
  1323. package/dist/cdn/assets/solution-deployed-card/t9n/messages.fr.json +1 -14
  1324. package/dist/cdn/assets/solution-deployed-card/t9n/messages.he.json +1 -14
  1325. package/dist/cdn/assets/solution-deployed-card/t9n/messages.hr.json +1 -14
  1326. package/dist/cdn/assets/solution-deployed-card/t9n/messages.hu.json +1 -14
  1327. package/dist/cdn/assets/solution-deployed-card/t9n/messages.id.json +1 -14
  1328. package/dist/cdn/assets/solution-deployed-card/t9n/messages.it.json +1 -14
  1329. package/dist/cdn/assets/solution-deployed-card/t9n/messages.ja.json +1 -14
  1330. package/dist/cdn/assets/solution-deployed-card/t9n/messages.json +1 -14
  1331. package/dist/cdn/assets/solution-deployed-card/t9n/messages.ko.json +1 -14
  1332. package/dist/cdn/assets/solution-deployed-card/t9n/messages.lt.json +1 -14
  1333. package/dist/cdn/assets/solution-deployed-card/t9n/messages.lv.json +1 -14
  1334. package/dist/cdn/assets/solution-deployed-card/t9n/messages.nl.json +1 -14
  1335. package/dist/cdn/assets/solution-deployed-card/t9n/messages.no.json +1 -14
  1336. package/dist/cdn/assets/solution-deployed-card/t9n/messages.pl.json +1 -14
  1337. package/dist/cdn/assets/solution-deployed-card/t9n/messages.pt-BR.json +1 -14
  1338. package/dist/cdn/assets/solution-deployed-card/t9n/messages.pt-PT.json +1 -14
  1339. package/dist/cdn/assets/solution-deployed-card/t9n/messages.ro.json +1 -14
  1340. package/dist/cdn/assets/solution-deployed-card/t9n/messages.ru.json +1 -14
  1341. package/dist/cdn/assets/solution-deployed-card/t9n/messages.sk.json +1 -14
  1342. package/dist/cdn/assets/solution-deployed-card/t9n/messages.sl.json +1 -14
  1343. package/dist/cdn/assets/solution-deployed-card/t9n/messages.sr.json +1 -14
  1344. package/dist/cdn/assets/solution-deployed-card/t9n/messages.sv.json +1 -14
  1345. package/dist/cdn/assets/solution-deployed-card/t9n/messages.th.json +1 -14
  1346. package/dist/cdn/assets/solution-deployed-card/t9n/messages.tr.json +1 -14
  1347. package/dist/cdn/assets/solution-deployed-card/t9n/messages.uk.json +1 -14
  1348. package/dist/cdn/assets/solution-deployed-card/t9n/messages.vi.json +1 -14
  1349. package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-CN.json +1 -14
  1350. package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-HK.json +1 -14
  1351. package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-TW.json +1 -14
  1352. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ar.json +1 -21
  1353. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.bg.json +1 -21
  1354. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.bs.json +1 -21
  1355. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ca.json +1 -21
  1356. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.cs.json +1 -21
  1357. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.da.json +1 -21
  1358. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.de.json +1 -21
  1359. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.el.json +1 -21
  1360. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.en.json +1 -23
  1361. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.es.json +1 -21
  1362. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.et.json +1 -21
  1363. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.fi.json +1 -21
  1364. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.fr.json +1 -21
  1365. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.he.json +1 -21
  1366. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.hr.json +1 -21
  1367. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.hu.json +1 -21
  1368. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.id.json +1 -21
  1369. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.it.json +1 -21
  1370. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ja.json +1 -21
  1371. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.json +1 -23
  1372. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ko.json +1 -21
  1373. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.lt.json +1 -21
  1374. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.lv.json +1 -21
  1375. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.nl.json +1 -21
  1376. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.no.json +1 -21
  1377. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.pl.json +1 -21
  1378. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.pt-BR.json +1 -21
  1379. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.pt-PT.json +1 -21
  1380. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ro.json +1 -21
  1381. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ru.json +1 -21
  1382. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sk.json +1 -21
  1383. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sl.json +1 -21
  1384. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sr.json +1 -21
  1385. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sv.json +1 -21
  1386. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.th.json +1 -21
  1387. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.tr.json +1 -21
  1388. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.uk.json +1 -21
  1389. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.vi.json +1 -21
  1390. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.zh-CN.json +1 -21
  1391. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.zh-HK.json +1 -21
  1392. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.zh-TW.json +1 -21
  1393. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ar.json +1 -19
  1394. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.bg.json +1 -19
  1395. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.bs.json +1 -19
  1396. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ca.json +1 -19
  1397. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.cs.json +1 -19
  1398. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.da.json +1 -19
  1399. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.de.json +1 -19
  1400. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.el.json +1 -19
  1401. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.en.json +1 -19
  1402. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.es.json +1 -19
  1403. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.et.json +1 -19
  1404. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.fi.json +1 -19
  1405. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.fr.json +1 -19
  1406. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.he.json +1 -19
  1407. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.hr.json +1 -19
  1408. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.hu.json +1 -19
  1409. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.id.json +1 -19
  1410. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.it.json +1 -19
  1411. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ja.json +1 -19
  1412. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.json +1 -19
  1413. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ko.json +1 -19
  1414. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.lt.json +1 -19
  1415. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.lv.json +1 -19
  1416. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.nl.json +1 -19
  1417. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.no.json +1 -19
  1418. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.pl.json +1 -19
  1419. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.pt-BR.json +1 -19
  1420. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.pt-PT.json +1 -19
  1421. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ro.json +1 -19
  1422. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.ru.json +1 -19
  1423. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.sk.json +1 -19
  1424. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.sl.json +1 -19
  1425. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.sr.json +1 -19
  1426. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.sv.json +1 -19
  1427. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.th.json +1 -19
  1428. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.tr.json +1 -19
  1429. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.uk.json +1 -19
  1430. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.vi.json +1 -19
  1431. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.zh-CN.json +1 -19
  1432. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.zh-HK.json +1 -19
  1433. package/dist/cdn/assets/solution-deploying-dialog/t9n/messages.zh-TW.json +1 -19
  1434. package/dist/cdn/assets/solution-details-card/t9n/messages.ar.json +1 -7
  1435. package/dist/cdn/assets/solution-details-card/t9n/messages.bg.json +1 -7
  1436. package/dist/cdn/assets/solution-details-card/t9n/messages.bs.json +1 -7
  1437. package/dist/cdn/assets/solution-details-card/t9n/messages.ca.json +1 -7
  1438. package/dist/cdn/assets/solution-details-card/t9n/messages.cs.json +1 -7
  1439. package/dist/cdn/assets/solution-details-card/t9n/messages.da.json +1 -7
  1440. package/dist/cdn/assets/solution-details-card/t9n/messages.de.json +1 -7
  1441. package/dist/cdn/assets/solution-details-card/t9n/messages.el.json +1 -7
  1442. package/dist/cdn/assets/solution-details-card/t9n/messages.en.json +1 -7
  1443. package/dist/cdn/assets/solution-details-card/t9n/messages.es.json +1 -7
  1444. package/dist/cdn/assets/solution-details-card/t9n/messages.et.json +1 -7
  1445. package/dist/cdn/assets/solution-details-card/t9n/messages.fi.json +1 -7
  1446. package/dist/cdn/assets/solution-details-card/t9n/messages.fr.json +1 -7
  1447. package/dist/cdn/assets/solution-details-card/t9n/messages.he.json +1 -7
  1448. package/dist/cdn/assets/solution-details-card/t9n/messages.hr.json +1 -7
  1449. package/dist/cdn/assets/solution-details-card/t9n/messages.hu.json +1 -7
  1450. package/dist/cdn/assets/solution-details-card/t9n/messages.id.json +1 -7
  1451. package/dist/cdn/assets/solution-details-card/t9n/messages.it.json +1 -7
  1452. package/dist/cdn/assets/solution-details-card/t9n/messages.ja.json +1 -7
  1453. package/dist/cdn/assets/solution-details-card/t9n/messages.json +1 -7
  1454. package/dist/cdn/assets/solution-details-card/t9n/messages.ko.json +1 -7
  1455. package/dist/cdn/assets/solution-details-card/t9n/messages.lt.json +1 -7
  1456. package/dist/cdn/assets/solution-details-card/t9n/messages.lv.json +1 -7
  1457. package/dist/cdn/assets/solution-details-card/t9n/messages.nl.json +1 -7
  1458. package/dist/cdn/assets/solution-details-card/t9n/messages.no.json +1 -7
  1459. package/dist/cdn/assets/solution-details-card/t9n/messages.pl.json +1 -7
  1460. package/dist/cdn/assets/solution-details-card/t9n/messages.pt-BR.json +1 -7
  1461. package/dist/cdn/assets/solution-details-card/t9n/messages.pt-PT.json +1 -7
  1462. package/dist/cdn/assets/solution-details-card/t9n/messages.ro.json +1 -7
  1463. package/dist/cdn/assets/solution-details-card/t9n/messages.ru.json +1 -7
  1464. package/dist/cdn/assets/solution-details-card/t9n/messages.sk.json +1 -7
  1465. package/dist/cdn/assets/solution-details-card/t9n/messages.sl.json +1 -7
  1466. package/dist/cdn/assets/solution-details-card/t9n/messages.sr.json +1 -7
  1467. package/dist/cdn/assets/solution-details-card/t9n/messages.sv.json +1 -7
  1468. package/dist/cdn/assets/solution-details-card/t9n/messages.th.json +1 -7
  1469. package/dist/cdn/assets/solution-details-card/t9n/messages.tr.json +1 -7
  1470. package/dist/cdn/assets/solution-details-card/t9n/messages.uk.json +1 -7
  1471. package/dist/cdn/assets/solution-details-card/t9n/messages.vi.json +1 -7
  1472. package/dist/cdn/assets/solution-details-card/t9n/messages.zh-CN.json +1 -7
  1473. package/dist/cdn/assets/solution-details-card/t9n/messages.zh-HK.json +1 -7
  1474. package/dist/cdn/assets/solution-details-card/t9n/messages.zh-TW.json +1 -7
  1475. package/dist/cdn/assets/solution-details-panel/t9n/messages.ar.json +1 -65
  1476. package/dist/cdn/assets/solution-details-panel/t9n/messages.bg.json +1 -65
  1477. package/dist/cdn/assets/solution-details-panel/t9n/messages.bs.json +1 -65
  1478. package/dist/cdn/assets/solution-details-panel/t9n/messages.ca.json +1 -65
  1479. package/dist/cdn/assets/solution-details-panel/t9n/messages.cs.json +1 -65
  1480. package/dist/cdn/assets/solution-details-panel/t9n/messages.da.json +1 -65
  1481. package/dist/cdn/assets/solution-details-panel/t9n/messages.de.json +1 -65
  1482. package/dist/cdn/assets/solution-details-panel/t9n/messages.el.json +1 -65
  1483. package/dist/cdn/assets/solution-details-panel/t9n/messages.en.json +1 -65
  1484. package/dist/cdn/assets/solution-details-panel/t9n/messages.es.json +1 -65
  1485. package/dist/cdn/assets/solution-details-panel/t9n/messages.et.json +1 -65
  1486. package/dist/cdn/assets/solution-details-panel/t9n/messages.fi.json +1 -65
  1487. package/dist/cdn/assets/solution-details-panel/t9n/messages.fr.json +1 -65
  1488. package/dist/cdn/assets/solution-details-panel/t9n/messages.he.json +1 -65
  1489. package/dist/cdn/assets/solution-details-panel/t9n/messages.hr.json +1 -65
  1490. package/dist/cdn/assets/solution-details-panel/t9n/messages.hu.json +1 -65
  1491. package/dist/cdn/assets/solution-details-panel/t9n/messages.id.json +1 -65
  1492. package/dist/cdn/assets/solution-details-panel/t9n/messages.it.json +1 -65
  1493. package/dist/cdn/assets/solution-details-panel/t9n/messages.ja.json +1 -65
  1494. package/dist/cdn/assets/solution-details-panel/t9n/messages.json +1 -65
  1495. package/dist/cdn/assets/solution-details-panel/t9n/messages.ko.json +1 -65
  1496. package/dist/cdn/assets/solution-details-panel/t9n/messages.lt.json +1 -65
  1497. package/dist/cdn/assets/solution-details-panel/t9n/messages.lv.json +1 -65
  1498. package/dist/cdn/assets/solution-details-panel/t9n/messages.nl.json +1 -65
  1499. package/dist/cdn/assets/solution-details-panel/t9n/messages.no.json +1 -65
  1500. package/dist/cdn/assets/solution-details-panel/t9n/messages.pl.json +1 -65
  1501. package/dist/cdn/assets/solution-details-panel/t9n/messages.pt-BR.json +1 -65
  1502. package/dist/cdn/assets/solution-details-panel/t9n/messages.pt-PT.json +1 -65
  1503. package/dist/cdn/assets/solution-details-panel/t9n/messages.ro.json +1 -65
  1504. package/dist/cdn/assets/solution-details-panel/t9n/messages.ru.json +1 -65
  1505. package/dist/cdn/assets/solution-details-panel/t9n/messages.sk.json +1 -65
  1506. package/dist/cdn/assets/solution-details-panel/t9n/messages.sl.json +1 -65
  1507. package/dist/cdn/assets/solution-details-panel/t9n/messages.sr.json +1 -65
  1508. package/dist/cdn/assets/solution-details-panel/t9n/messages.sv.json +1 -65
  1509. package/dist/cdn/assets/solution-details-panel/t9n/messages.th.json +1 -65
  1510. package/dist/cdn/assets/solution-details-panel/t9n/messages.tr.json +1 -65
  1511. package/dist/cdn/assets/solution-details-panel/t9n/messages.uk.json +1 -65
  1512. package/dist/cdn/assets/solution-details-panel/t9n/messages.vi.json +1 -65
  1513. package/dist/cdn/assets/solution-details-panel/t9n/messages.zh-CN.json +1 -65
  1514. package/dist/cdn/assets/solution-details-panel/t9n/messages.zh-HK.json +1 -65
  1515. package/dist/cdn/assets/solution-details-panel/t9n/messages.zh-TW.json +1 -65
  1516. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ar.json +1 -4
  1517. package/dist/cdn/assets/solution-item-accordion/t9n/messages.bg.json +1 -4
  1518. package/dist/cdn/assets/solution-item-accordion/t9n/messages.bs.json +1 -4
  1519. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ca.json +1 -4
  1520. package/dist/cdn/assets/solution-item-accordion/t9n/messages.cs.json +1 -4
  1521. package/dist/cdn/assets/solution-item-accordion/t9n/messages.da.json +1 -4
  1522. package/dist/cdn/assets/solution-item-accordion/t9n/messages.de.json +1 -4
  1523. package/dist/cdn/assets/solution-item-accordion/t9n/messages.el.json +1 -4
  1524. package/dist/cdn/assets/solution-item-accordion/t9n/messages.en.json +1 -4
  1525. package/dist/cdn/assets/solution-item-accordion/t9n/messages.es.json +1 -4
  1526. package/dist/cdn/assets/solution-item-accordion/t9n/messages.et.json +1 -4
  1527. package/dist/cdn/assets/solution-item-accordion/t9n/messages.fi.json +1 -4
  1528. package/dist/cdn/assets/solution-item-accordion/t9n/messages.fr.json +1 -4
  1529. package/dist/cdn/assets/solution-item-accordion/t9n/messages.he.json +1 -4
  1530. package/dist/cdn/assets/solution-item-accordion/t9n/messages.hr.json +1 -4
  1531. package/dist/cdn/assets/solution-item-accordion/t9n/messages.hu.json +1 -4
  1532. package/dist/cdn/assets/solution-item-accordion/t9n/messages.id.json +1 -4
  1533. package/dist/cdn/assets/solution-item-accordion/t9n/messages.it.json +1 -4
  1534. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ja.json +1 -4
  1535. package/dist/cdn/assets/solution-item-accordion/t9n/messages.json +1 -4
  1536. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ko.json +1 -4
  1537. package/dist/cdn/assets/solution-item-accordion/t9n/messages.lt.json +1 -4
  1538. package/dist/cdn/assets/solution-item-accordion/t9n/messages.lv.json +1 -4
  1539. package/dist/cdn/assets/solution-item-accordion/t9n/messages.nb.json +1 -3
  1540. package/dist/cdn/assets/solution-item-accordion/t9n/messages.nl.json +1 -4
  1541. package/dist/cdn/assets/solution-item-accordion/t9n/messages.no.json +1 -4
  1542. package/dist/cdn/assets/solution-item-accordion/t9n/messages.pl.json +1 -4
  1543. package/dist/cdn/assets/solution-item-accordion/t9n/messages.pt-BR.json +1 -4
  1544. package/dist/cdn/assets/solution-item-accordion/t9n/messages.pt-PT.json +1 -4
  1545. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ro.json +1 -4
  1546. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ru.json +1 -4
  1547. package/dist/cdn/assets/solution-item-accordion/t9n/messages.sk.json +1 -4
  1548. package/dist/cdn/assets/solution-item-accordion/t9n/messages.sl.json +1 -4
  1549. package/dist/cdn/assets/solution-item-accordion/t9n/messages.sr.json +1 -4
  1550. package/dist/cdn/assets/solution-item-accordion/t9n/messages.sv.json +1 -4
  1551. package/dist/cdn/assets/solution-item-accordion/t9n/messages.th.json +1 -4
  1552. package/dist/cdn/assets/solution-item-accordion/t9n/messages.tr.json +1 -4
  1553. package/dist/cdn/assets/solution-item-accordion/t9n/messages.uk.json +1 -4
  1554. package/dist/cdn/assets/solution-item-accordion/t9n/messages.vi.json +1 -4
  1555. package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-CN.json +1 -4
  1556. package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-HK.json +1 -4
  1557. package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-TW.json +1 -4
  1558. package/dist/cdn/assets/solution-item-diagram/t9n/messages.ar.json +1 -9
  1559. package/dist/cdn/assets/solution-item-diagram/t9n/messages.bg.json +1 -9
  1560. package/dist/cdn/assets/solution-item-diagram/t9n/messages.bs.json +1 -9
  1561. package/dist/cdn/assets/solution-item-diagram/t9n/messages.ca.json +1 -9
  1562. package/dist/cdn/assets/solution-item-diagram/t9n/messages.cs.json +1 -9
  1563. package/dist/cdn/assets/solution-item-diagram/t9n/messages.da.json +1 -9
  1564. package/dist/cdn/assets/solution-item-diagram/t9n/messages.de.json +1 -9
  1565. package/dist/cdn/assets/solution-item-diagram/t9n/messages.el.json +1 -9
  1566. package/dist/cdn/assets/solution-item-diagram/t9n/messages.en.json +1 -9
  1567. package/dist/cdn/assets/solution-item-diagram/t9n/messages.es.json +1 -9
  1568. package/dist/cdn/assets/solution-item-diagram/t9n/messages.et.json +1 -9
  1569. package/dist/cdn/assets/solution-item-diagram/t9n/messages.fi.json +1 -9
  1570. package/dist/cdn/assets/solution-item-diagram/t9n/messages.fr.json +1 -9
  1571. package/dist/cdn/assets/solution-item-diagram/t9n/messages.he.json +1 -9
  1572. package/dist/cdn/assets/solution-item-diagram/t9n/messages.hr.json +1 -9
  1573. package/dist/cdn/assets/solution-item-diagram/t9n/messages.hu.json +1 -9
  1574. package/dist/cdn/assets/solution-item-diagram/t9n/messages.id.json +1 -9
  1575. package/dist/cdn/assets/solution-item-diagram/t9n/messages.it.json +1 -9
  1576. package/dist/cdn/assets/solution-item-diagram/t9n/messages.ja.json +1 -9
  1577. package/dist/cdn/assets/solution-item-diagram/t9n/messages.json +1 -9
  1578. package/dist/cdn/assets/solution-item-diagram/t9n/messages.ko.json +1 -9
  1579. package/dist/cdn/assets/solution-item-diagram/t9n/messages.lt.json +1 -9
  1580. package/dist/cdn/assets/solution-item-diagram/t9n/messages.lv.json +1 -9
  1581. package/dist/cdn/assets/solution-item-diagram/t9n/messages.nl.json +1 -9
  1582. package/dist/cdn/assets/solution-item-diagram/t9n/messages.no.json +1 -9
  1583. package/dist/cdn/assets/solution-item-diagram/t9n/messages.pl.json +1 -9
  1584. package/dist/cdn/assets/solution-item-diagram/t9n/messages.pt-BR.json +1 -9
  1585. package/dist/cdn/assets/solution-item-diagram/t9n/messages.pt-PT.json +1 -9
  1586. package/dist/cdn/assets/solution-item-diagram/t9n/messages.ro.json +1 -9
  1587. package/dist/cdn/assets/solution-item-diagram/t9n/messages.ru.json +1 -9
  1588. package/dist/cdn/assets/solution-item-diagram/t9n/messages.sk.json +1 -9
  1589. package/dist/cdn/assets/solution-item-diagram/t9n/messages.sl.json +1 -9
  1590. package/dist/cdn/assets/solution-item-diagram/t9n/messages.sr.json +1 -9
  1591. package/dist/cdn/assets/solution-item-diagram/t9n/messages.sv.json +1 -9
  1592. package/dist/cdn/assets/solution-item-diagram/t9n/messages.th.json +1 -9
  1593. package/dist/cdn/assets/solution-item-diagram/t9n/messages.tr.json +1 -9
  1594. package/dist/cdn/assets/solution-item-diagram/t9n/messages.uk.json +1 -9
  1595. package/dist/cdn/assets/solution-item-diagram/t9n/messages.vi.json +1 -9
  1596. package/dist/cdn/assets/solution-item-diagram/t9n/messages.zh-CN.json +1 -9
  1597. package/dist/cdn/assets/solution-item-diagram/t9n/messages.zh-HK.json +1 -9
  1598. package/dist/cdn/assets/solution-item-diagram/t9n/messages.zh-TW.json +1 -9
  1599. package/dist/cdn/assets/solution-resource-card/t9n/messages.ar.json +1 -5
  1600. package/dist/cdn/assets/solution-resource-card/t9n/messages.bg.json +1 -5
  1601. package/dist/cdn/assets/solution-resource-card/t9n/messages.bs.json +1 -5
  1602. package/dist/cdn/assets/solution-resource-card/t9n/messages.ca.json +1 -5
  1603. package/dist/cdn/assets/solution-resource-card/t9n/messages.cs.json +1 -5
  1604. package/dist/cdn/assets/solution-resource-card/t9n/messages.da.json +1 -5
  1605. package/dist/cdn/assets/solution-resource-card/t9n/messages.de.json +1 -5
  1606. package/dist/cdn/assets/solution-resource-card/t9n/messages.el.json +1 -5
  1607. package/dist/cdn/assets/solution-resource-card/t9n/messages.en.json +1 -5
  1608. package/dist/cdn/assets/solution-resource-card/t9n/messages.es.json +1 -5
  1609. package/dist/cdn/assets/solution-resource-card/t9n/messages.et.json +1 -5
  1610. package/dist/cdn/assets/solution-resource-card/t9n/messages.fi.json +1 -5
  1611. package/dist/cdn/assets/solution-resource-card/t9n/messages.fr.json +1 -5
  1612. package/dist/cdn/assets/solution-resource-card/t9n/messages.he.json +1 -5
  1613. package/dist/cdn/assets/solution-resource-card/t9n/messages.hr.json +1 -5
  1614. package/dist/cdn/assets/solution-resource-card/t9n/messages.hu.json +1 -5
  1615. package/dist/cdn/assets/solution-resource-card/t9n/messages.id.json +1 -5
  1616. package/dist/cdn/assets/solution-resource-card/t9n/messages.it.json +1 -5
  1617. package/dist/cdn/assets/solution-resource-card/t9n/messages.ja.json +1 -5
  1618. package/dist/cdn/assets/solution-resource-card/t9n/messages.json +1 -5
  1619. package/dist/cdn/assets/solution-resource-card/t9n/messages.ko.json +1 -5
  1620. package/dist/cdn/assets/solution-resource-card/t9n/messages.lt.json +1 -5
  1621. package/dist/cdn/assets/solution-resource-card/t9n/messages.lv.json +1 -5
  1622. package/dist/cdn/assets/solution-resource-card/t9n/messages.nl.json +1 -5
  1623. package/dist/cdn/assets/solution-resource-card/t9n/messages.no.json +1 -5
  1624. package/dist/cdn/assets/solution-resource-card/t9n/messages.pl.json +1 -5
  1625. package/dist/cdn/assets/solution-resource-card/t9n/messages.pt-BR.json +1 -5
  1626. package/dist/cdn/assets/solution-resource-card/t9n/messages.pt-PT.json +1 -5
  1627. package/dist/cdn/assets/solution-resource-card/t9n/messages.ro.json +1 -5
  1628. package/dist/cdn/assets/solution-resource-card/t9n/messages.ru.json +1 -5
  1629. package/dist/cdn/assets/solution-resource-card/t9n/messages.sk.json +1 -5
  1630. package/dist/cdn/assets/solution-resource-card/t9n/messages.sl.json +1 -5
  1631. package/dist/cdn/assets/solution-resource-card/t9n/messages.sr.json +1 -5
  1632. package/dist/cdn/assets/solution-resource-card/t9n/messages.sv.json +1 -5
  1633. package/dist/cdn/assets/solution-resource-card/t9n/messages.th.json +1 -5
  1634. package/dist/cdn/assets/solution-resource-card/t9n/messages.tr.json +1 -5
  1635. package/dist/cdn/assets/solution-resource-card/t9n/messages.uk.json +1 -5
  1636. package/dist/cdn/assets/solution-resource-card/t9n/messages.vi.json +1 -5
  1637. package/dist/cdn/assets/solution-resource-card/t9n/messages.zh-CN.json +1 -5
  1638. package/dist/cdn/assets/solution-resource-card/t9n/messages.zh-HK.json +1 -5
  1639. package/dist/cdn/assets/solution-resource-card/t9n/messages.zh-TW.json +1 -5
  1640. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ar.json +1 -4
  1641. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.bg.json +1 -4
  1642. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.bs.json +1 -4
  1643. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ca.json +1 -4
  1644. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.cs.json +1 -4
  1645. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.da.json +1 -4
  1646. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.de.json +1 -4
  1647. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.el.json +1 -4
  1648. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.en.json +1 -4
  1649. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.es.json +1 -4
  1650. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.et.json +1 -4
  1651. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.fi.json +1 -4
  1652. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.fr.json +1 -4
  1653. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.he.json +1 -4
  1654. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.hr.json +1 -4
  1655. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.hu.json +1 -4
  1656. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.id.json +1 -4
  1657. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.it.json +1 -4
  1658. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ja.json +1 -4
  1659. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.json +1 -4
  1660. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ko.json +1 -4
  1661. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.lt.json +1 -4
  1662. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.lv.json +1 -4
  1663. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.nl.json +1 -4
  1664. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.no.json +1 -4
  1665. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.pl.json +1 -4
  1666. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.pt-BR.json +1 -4
  1667. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.pt-PT.json +1 -4
  1668. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ro.json +1 -4
  1669. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.ru.json +1 -4
  1670. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.sk.json +1 -4
  1671. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.sl.json +1 -4
  1672. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.sr.json +1 -4
  1673. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.sv.json +1 -4
  1674. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.th.json +1 -4
  1675. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.tr.json +1 -4
  1676. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.uk.json +1 -4
  1677. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.vi.json +1 -4
  1678. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.zh-CN.json +1 -4
  1679. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.zh-HK.json +1 -4
  1680. package/dist/cdn/assets/solution-snapshot-gallery/t9n/messages.zh-TW.json +1 -4
  1681. package/dist/cdn/assets/solution-social-share/t9n/messages.ar.json +1 -31
  1682. package/dist/cdn/assets/solution-social-share/t9n/messages.bg.json +1 -31
  1683. package/dist/cdn/assets/solution-social-share/t9n/messages.bs.json +1 -31
  1684. package/dist/cdn/assets/solution-social-share/t9n/messages.ca.json +1 -31
  1685. package/dist/cdn/assets/solution-social-share/t9n/messages.cs.json +1 -31
  1686. package/dist/cdn/assets/solution-social-share/t9n/messages.da.json +1 -31
  1687. package/dist/cdn/assets/solution-social-share/t9n/messages.de.json +1 -31
  1688. package/dist/cdn/assets/solution-social-share/t9n/messages.el.json +1 -31
  1689. package/dist/cdn/assets/solution-social-share/t9n/messages.en.json +1 -31
  1690. package/dist/cdn/assets/solution-social-share/t9n/messages.es.json +1 -31
  1691. package/dist/cdn/assets/solution-social-share/t9n/messages.et.json +1 -31
  1692. package/dist/cdn/assets/solution-social-share/t9n/messages.fi.json +1 -31
  1693. package/dist/cdn/assets/solution-social-share/t9n/messages.fr.json +1 -31
  1694. package/dist/cdn/assets/solution-social-share/t9n/messages.he.json +1 -31
  1695. package/dist/cdn/assets/solution-social-share/t9n/messages.hr.json +1 -31
  1696. package/dist/cdn/assets/solution-social-share/t9n/messages.hu.json +1 -31
  1697. package/dist/cdn/assets/solution-social-share/t9n/messages.id.json +1 -31
  1698. package/dist/cdn/assets/solution-social-share/t9n/messages.it.json +1 -31
  1699. package/dist/cdn/assets/solution-social-share/t9n/messages.ja.json +1 -31
  1700. package/dist/cdn/assets/solution-social-share/t9n/messages.json +1 -31
  1701. package/dist/cdn/assets/solution-social-share/t9n/messages.ko.json +1 -31
  1702. package/dist/cdn/assets/solution-social-share/t9n/messages.lt.json +1 -31
  1703. package/dist/cdn/assets/solution-social-share/t9n/messages.lv.json +1 -31
  1704. package/dist/cdn/assets/solution-social-share/t9n/messages.nl.json +1 -31
  1705. package/dist/cdn/assets/solution-social-share/t9n/messages.no.json +1 -31
  1706. package/dist/cdn/assets/solution-social-share/t9n/messages.pl.json +1 -31
  1707. package/dist/cdn/assets/solution-social-share/t9n/messages.pt-BR.json +1 -31
  1708. package/dist/cdn/assets/solution-social-share/t9n/messages.pt-PT.json +1 -31
  1709. package/dist/cdn/assets/solution-social-share/t9n/messages.ro.json +1 -31
  1710. package/dist/cdn/assets/solution-social-share/t9n/messages.ru.json +1 -31
  1711. package/dist/cdn/assets/solution-social-share/t9n/messages.sk.json +1 -31
  1712. package/dist/cdn/assets/solution-social-share/t9n/messages.sl.json +1 -31
  1713. package/dist/cdn/assets/solution-social-share/t9n/messages.sr.json +1 -31
  1714. package/dist/cdn/assets/solution-social-share/t9n/messages.sv.json +1 -31
  1715. package/dist/cdn/assets/solution-social-share/t9n/messages.th.json +1 -31
  1716. package/dist/cdn/assets/solution-social-share/t9n/messages.tr.json +1 -31
  1717. package/dist/cdn/assets/solution-social-share/t9n/messages.uk.json +1 -31
  1718. package/dist/cdn/assets/solution-social-share/t9n/messages.vi.json +1 -31
  1719. package/dist/cdn/assets/solution-social-share/t9n/messages.zh-CN.json +1 -31
  1720. package/dist/cdn/assets/solution-social-share/t9n/messages.zh-HK.json +1 -31
  1721. package/dist/cdn/assets/solution-social-share/t9n/messages.zh-TW.json +1 -31
  1722. package/dist/cdn/assets/solutions-all-panel/t9n/messages.ar.json +1 -10
  1723. package/dist/cdn/assets/solutions-all-panel/t9n/messages.bg.json +1 -10
  1724. package/dist/cdn/assets/solutions-all-panel/t9n/messages.bs.json +1 -10
  1725. package/dist/cdn/assets/solutions-all-panel/t9n/messages.ca.json +1 -10
  1726. package/dist/cdn/assets/solutions-all-panel/t9n/messages.cs.json +1 -10
  1727. package/dist/cdn/assets/solutions-all-panel/t9n/messages.da.json +1 -10
  1728. package/dist/cdn/assets/solutions-all-panel/t9n/messages.de.json +1 -10
  1729. package/dist/cdn/assets/solutions-all-panel/t9n/messages.el.json +1 -10
  1730. package/dist/cdn/assets/solutions-all-panel/t9n/messages.en.json +1 -10
  1731. package/dist/cdn/assets/solutions-all-panel/t9n/messages.es.json +1 -10
  1732. package/dist/cdn/assets/solutions-all-panel/t9n/messages.et.json +1 -10
  1733. package/dist/cdn/assets/solutions-all-panel/t9n/messages.fi.json +1 -10
  1734. package/dist/cdn/assets/solutions-all-panel/t9n/messages.fr.json +1 -10
  1735. package/dist/cdn/assets/solutions-all-panel/t9n/messages.he.json +1 -10
  1736. package/dist/cdn/assets/solutions-all-panel/t9n/messages.hr.json +1 -10
  1737. package/dist/cdn/assets/solutions-all-panel/t9n/messages.hu.json +1 -10
  1738. package/dist/cdn/assets/solutions-all-panel/t9n/messages.id.json +1 -10
  1739. package/dist/cdn/assets/solutions-all-panel/t9n/messages.it.json +1 -10
  1740. package/dist/cdn/assets/solutions-all-panel/t9n/messages.ja.json +1 -10
  1741. package/dist/cdn/assets/solutions-all-panel/t9n/messages.json +1 -10
  1742. package/dist/cdn/assets/solutions-all-panel/t9n/messages.ko.json +1 -10
  1743. package/dist/cdn/assets/solutions-all-panel/t9n/messages.lt.json +1 -10
  1744. package/dist/cdn/assets/solutions-all-panel/t9n/messages.lv.json +1 -10
  1745. package/dist/cdn/assets/solutions-all-panel/t9n/messages.nl.json +1 -10
  1746. package/dist/cdn/assets/solutions-all-panel/t9n/messages.no.json +1 -10
  1747. package/dist/cdn/assets/solutions-all-panel/t9n/messages.pl.json +1 -10
  1748. package/dist/cdn/assets/solutions-all-panel/t9n/messages.pt-BR.json +1 -10
  1749. package/dist/cdn/assets/solutions-all-panel/t9n/messages.pt-PT.json +1 -10
  1750. package/dist/cdn/assets/solutions-all-panel/t9n/messages.ro.json +1 -10
  1751. package/dist/cdn/assets/solutions-all-panel/t9n/messages.ru.json +1 -10
  1752. package/dist/cdn/assets/solutions-all-panel/t9n/messages.sk.json +1 -10
  1753. package/dist/cdn/assets/solutions-all-panel/t9n/messages.sl.json +1 -10
  1754. package/dist/cdn/assets/solutions-all-panel/t9n/messages.sr.json +1 -10
  1755. package/dist/cdn/assets/solutions-all-panel/t9n/messages.sv.json +1 -10
  1756. package/dist/cdn/assets/solutions-all-panel/t9n/messages.th.json +1 -10
  1757. package/dist/cdn/assets/solutions-all-panel/t9n/messages.tr.json +1 -10
  1758. package/dist/cdn/assets/solutions-all-panel/t9n/messages.uk.json +1 -10
  1759. package/dist/cdn/assets/solutions-all-panel/t9n/messages.vi.json +1 -10
  1760. package/dist/cdn/assets/solutions-all-panel/t9n/messages.zh-CN.json +1 -10
  1761. package/dist/cdn/assets/solutions-all-panel/t9n/messages.zh-HK.json +1 -10
  1762. package/dist/cdn/assets/solutions-all-panel/t9n/messages.zh-TW.json +1 -10
  1763. package/dist/cdn/assets/solutions-all-shell/t9n/messages.ar.json +1 -10
  1764. package/dist/cdn/assets/solutions-all-shell/t9n/messages.bg.json +1 -10
  1765. package/dist/cdn/assets/solutions-all-shell/t9n/messages.bs.json +1 -10
  1766. package/dist/cdn/assets/solutions-all-shell/t9n/messages.ca.json +1 -10
  1767. package/dist/cdn/assets/solutions-all-shell/t9n/messages.cs.json +1 -10
  1768. package/dist/cdn/assets/solutions-all-shell/t9n/messages.da.json +1 -10
  1769. package/dist/cdn/assets/solutions-all-shell/t9n/messages.de.json +1 -10
  1770. package/dist/cdn/assets/solutions-all-shell/t9n/messages.el.json +1 -10
  1771. package/dist/cdn/assets/solutions-all-shell/t9n/messages.en.json +1 -10
  1772. package/dist/cdn/assets/solutions-all-shell/t9n/messages.es.json +1 -10
  1773. package/dist/cdn/assets/solutions-all-shell/t9n/messages.et.json +1 -10
  1774. package/dist/cdn/assets/solutions-all-shell/t9n/messages.fi.json +1 -10
  1775. package/dist/cdn/assets/solutions-all-shell/t9n/messages.fr.json +1 -10
  1776. package/dist/cdn/assets/solutions-all-shell/t9n/messages.he.json +1 -10
  1777. package/dist/cdn/assets/solutions-all-shell/t9n/messages.hr.json +1 -10
  1778. package/dist/cdn/assets/solutions-all-shell/t9n/messages.hu.json +1 -10
  1779. package/dist/cdn/assets/solutions-all-shell/t9n/messages.id.json +1 -10
  1780. package/dist/cdn/assets/solutions-all-shell/t9n/messages.it.json +1 -10
  1781. package/dist/cdn/assets/solutions-all-shell/t9n/messages.ja.json +1 -10
  1782. package/dist/cdn/assets/solutions-all-shell/t9n/messages.json +1 -10
  1783. package/dist/cdn/assets/solutions-all-shell/t9n/messages.ko.json +1 -10
  1784. package/dist/cdn/assets/solutions-all-shell/t9n/messages.lt.json +1 -10
  1785. package/dist/cdn/assets/solutions-all-shell/t9n/messages.lv.json +1 -10
  1786. package/dist/cdn/assets/solutions-all-shell/t9n/messages.nl.json +1 -10
  1787. package/dist/cdn/assets/solutions-all-shell/t9n/messages.no.json +1 -10
  1788. package/dist/cdn/assets/solutions-all-shell/t9n/messages.pl.json +1 -10
  1789. package/dist/cdn/assets/solutions-all-shell/t9n/messages.pt-BR.json +1 -10
  1790. package/dist/cdn/assets/solutions-all-shell/t9n/messages.pt-PT.json +1 -10
  1791. package/dist/cdn/assets/solutions-all-shell/t9n/messages.ro.json +1 -10
  1792. package/dist/cdn/assets/solutions-all-shell/t9n/messages.ru.json +1 -10
  1793. package/dist/cdn/assets/solutions-all-shell/t9n/messages.sk.json +1 -10
  1794. package/dist/cdn/assets/solutions-all-shell/t9n/messages.sl.json +1 -10
  1795. package/dist/cdn/assets/solutions-all-shell/t9n/messages.sr.json +1 -10
  1796. package/dist/cdn/assets/solutions-all-shell/t9n/messages.sv.json +1 -10
  1797. package/dist/cdn/assets/solutions-all-shell/t9n/messages.th.json +1 -10
  1798. package/dist/cdn/assets/solutions-all-shell/t9n/messages.tr.json +1 -10
  1799. package/dist/cdn/assets/solutions-all-shell/t9n/messages.uk.json +1 -10
  1800. package/dist/cdn/assets/solutions-all-shell/t9n/messages.vi.json +1 -10
  1801. package/dist/cdn/assets/solutions-all-shell/t9n/messages.zh-CN.json +1 -10
  1802. package/dist/cdn/assets/solutions-all-shell/t9n/messages.zh-HK.json +1 -10
  1803. package/dist/cdn/assets/solutions-all-shell/t9n/messages.zh-TW.json +1 -10
  1804. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ar.json +1 -17
  1805. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.bg.json +1 -17
  1806. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.bs.json +1 -17
  1807. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ca.json +1 -17
  1808. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.cs.json +1 -17
  1809. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.da.json +1 -17
  1810. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.de.json +1 -17
  1811. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.el.json +1 -17
  1812. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.en.json +1 -18
  1813. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.es.json +1 -17
  1814. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.et.json +1 -17
  1815. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.fi.json +1 -17
  1816. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.fr.json +1 -17
  1817. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.he.json +1 -17
  1818. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.hr.json +1 -17
  1819. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.hu.json +1 -17
  1820. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.id.json +1 -17
  1821. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.it.json +1 -17
  1822. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ja.json +1 -17
  1823. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.json +1 -18
  1824. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ko.json +1 -17
  1825. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.lt.json +1 -17
  1826. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.lv.json +1 -17
  1827. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.nl.json +1 -17
  1828. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.no.json +1 -17
  1829. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.pl.json +1 -17
  1830. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.pt-BR.json +1 -17
  1831. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.pt-PT.json +1 -17
  1832. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ro.json +1 -17
  1833. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ru.json +1 -17
  1834. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sk.json +1 -17
  1835. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sl.json +1 -17
  1836. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sr.json +1 -17
  1837. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sv.json +1 -17
  1838. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.th.json +1 -17
  1839. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.tr.json +1 -17
  1840. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.uk.json +1 -17
  1841. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.vi.json +1 -17
  1842. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.zh-CN.json +1 -17
  1843. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.zh-HK.json +1 -17
  1844. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.zh-TW.json +1 -17
  1845. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ar.json +1 -12
  1846. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.bg.json +1 -12
  1847. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.bs.json +1 -12
  1848. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ca.json +1 -12
  1849. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.cs.json +1 -12
  1850. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.da.json +1 -12
  1851. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.de.json +1 -12
  1852. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.el.json +1 -12
  1853. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.en.json +1 -12
  1854. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.es.json +1 -12
  1855. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.et.json +1 -12
  1856. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.fi.json +1 -12
  1857. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.fr.json +1 -12
  1858. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.he.json +1 -12
  1859. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.hr.json +1 -12
  1860. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.hu.json +1 -12
  1861. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.id.json +1 -12
  1862. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.it.json +1 -12
  1863. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ja.json +1 -12
  1864. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.json +1 -12
  1865. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ko.json +1 -12
  1866. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.lt.json +1 -12
  1867. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.lv.json +1 -12
  1868. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.nl.json +1 -12
  1869. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.no.json +1 -12
  1870. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.pl.json +1 -12
  1871. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.pt-BR.json +1 -12
  1872. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.pt-PT.json +1 -12
  1873. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ro.json +1 -12
  1874. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.ru.json +1 -12
  1875. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.sk.json +1 -12
  1876. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.sl.json +1 -12
  1877. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.sr.json +1 -12
  1878. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.sv.json +1 -12
  1879. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.th.json +1 -12
  1880. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.tr.json +1 -12
  1881. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.uk.json +1 -12
  1882. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.vi.json +1 -12
  1883. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.zh-CN.json +1 -12
  1884. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.zh-HK.json +1 -12
  1885. package/dist/cdn/assets/solutions-deploy-app-nav/t9n/messages.zh-TW.json +1 -12
  1886. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ar.json +1 -8
  1887. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.bg.json +1 -8
  1888. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.bs.json +1 -8
  1889. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ca.json +1 -8
  1890. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.cs.json +1 -8
  1891. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.da.json +1 -8
  1892. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.de.json +1 -8
  1893. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.el.json +1 -8
  1894. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.en.json +1 -8
  1895. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.es.json +1 -8
  1896. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.et.json +1 -8
  1897. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.fi.json +1 -8
  1898. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.fr.json +1 -8
  1899. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.he.json +1 -8
  1900. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.hr.json +1 -8
  1901. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.hu.json +1 -8
  1902. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.id.json +1 -8
  1903. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.it.json +1 -8
  1904. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ja.json +1 -8
  1905. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.json +1 -8
  1906. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ko.json +1 -8
  1907. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.lt.json +1 -8
  1908. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.lv.json +1 -8
  1909. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.nl.json +1 -8
  1910. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.no.json +1 -8
  1911. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.pl.json +1 -8
  1912. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.pt-BR.json +1 -8
  1913. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.pt-PT.json +1 -8
  1914. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ro.json +1 -8
  1915. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.ru.json +1 -8
  1916. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.sk.json +1 -8
  1917. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.sl.json +1 -8
  1918. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.sr.json +1 -8
  1919. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.sv.json +1 -8
  1920. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.th.json +1 -8
  1921. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.tr.json +1 -8
  1922. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.uk.json +1 -8
  1923. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.vi.json +1 -8
  1924. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.zh-CN.json +1 -8
  1925. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.zh-HK.json +1 -8
  1926. package/dist/cdn/assets/solutions-deployed-panel/t9n/messages.zh-TW.json +1 -8
  1927. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ar.json +1 -9
  1928. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.bg.json +1 -9
  1929. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.bs.json +1 -9
  1930. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ca.json +1 -9
  1931. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.cs.json +1 -9
  1932. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.da.json +1 -9
  1933. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.de.json +1 -9
  1934. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.el.json +1 -9
  1935. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.en.json +1 -9
  1936. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.es.json +1 -9
  1937. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.et.json +1 -9
  1938. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.fi.json +1 -9
  1939. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.fr.json +1 -9
  1940. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.he.json +1 -9
  1941. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.hr.json +1 -9
  1942. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.hu.json +1 -9
  1943. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.id.json +1 -9
  1944. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.it.json +1 -9
  1945. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ja.json +1 -9
  1946. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.json +1 -9
  1947. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ko.json +1 -9
  1948. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.lt.json +1 -9
  1949. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.lv.json +1 -9
  1950. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.nl.json +1 -9
  1951. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.no.json +1 -9
  1952. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.pl.json +1 -9
  1953. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.pt-BR.json +1 -9
  1954. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.pt-PT.json +1 -9
  1955. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ro.json +1 -9
  1956. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.ru.json +1 -9
  1957. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.sk.json +1 -9
  1958. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.sl.json +1 -9
  1959. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.sr.json +1 -9
  1960. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.sv.json +1 -9
  1961. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.th.json +1 -9
  1962. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.tr.json +1 -9
  1963. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.uk.json +1 -9
  1964. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.vi.json +1 -9
  1965. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.zh-CN.json +1 -9
  1966. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.zh-HK.json +1 -9
  1967. package/dist/cdn/assets/solutions-deployed-shell/t9n/messages.zh-TW.json +1 -9
  1968. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ar.json +1 -52
  1969. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.bg.json +1 -52
  1970. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.bs.json +1 -52
  1971. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ca.json +1 -52
  1972. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.cs.json +1 -52
  1973. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.da.json +1 -52
  1974. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.de.json +1 -52
  1975. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.el.json +1 -52
  1976. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.en.json +1 -52
  1977. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.es.json +1 -52
  1978. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.et.json +1 -52
  1979. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.fi.json +1 -52
  1980. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.fr.json +1 -52
  1981. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.he.json +1 -52
  1982. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.hr.json +1 -52
  1983. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.hu.json +1 -52
  1984. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.id.json +1 -52
  1985. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.it.json +1 -52
  1986. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ja.json +1 -52
  1987. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.json +1 -52
  1988. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ko.json +1 -52
  1989. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.lt.json +1 -52
  1990. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.lv.json +1 -52
  1991. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.nl.json +1 -52
  1992. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.no.json +1 -52
  1993. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.pl.json +1 -52
  1994. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.pt-BR.json +1 -52
  1995. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.pt-PT.json +1 -52
  1996. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ro.json +1 -52
  1997. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.ru.json +1 -52
  1998. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.sk.json +1 -52
  1999. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.sl.json +1 -52
  2000. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.sr.json +1 -52
  2001. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.sv.json +1 -52
  2002. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.th.json +1 -52
  2003. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.tr.json +1 -52
  2004. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.uk.json +1 -52
  2005. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.vi.json +1 -52
  2006. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.zh-CN.json +1 -52
  2007. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.zh-HK.json +1 -52
  2008. package/dist/cdn/assets/solutions-filter-panel/t9n/messages.zh-TW.json +1 -52
  2009. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ar.json +1 -66
  2010. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.bg.json +1 -66
  2011. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.bs.json +1 -66
  2012. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ca.json +1 -66
  2013. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.cs.json +1 -66
  2014. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.da.json +1 -66
  2015. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.de.json +1 -66
  2016. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.el.json +1 -66
  2017. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.en.json +1 -66
  2018. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.es.json +1 -66
  2019. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.et.json +1 -66
  2020. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.fi.json +1 -66
  2021. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.fr.json +1 -66
  2022. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.he.json +1 -66
  2023. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.hr.json +1 -66
  2024. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.hu.json +1 -66
  2025. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.id.json +1 -66
  2026. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.it.json +1 -66
  2027. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ja.json +1 -66
  2028. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.json +1 -66
  2029. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ko.json +1 -66
  2030. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.lt.json +1 -66
  2031. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.lv.json +1 -66
  2032. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.nl.json +1 -66
  2033. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.no.json +1 -66
  2034. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.pl.json +1 -66
  2035. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.pt-BR.json +1 -66
  2036. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.pt-PT.json +1 -66
  2037. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ro.json +1 -66
  2038. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.ru.json +1 -66
  2039. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.sk.json +1 -66
  2040. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.sl.json +1 -66
  2041. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.sr.json +1 -66
  2042. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.sv.json +1 -66
  2043. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.th.json +1 -66
  2044. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.tr.json +1 -66
  2045. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.uk.json +1 -66
  2046. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.vi.json +1 -66
  2047. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.zh-CN.json +1 -66
  2048. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.zh-HK.json +1 -66
  2049. package/dist/cdn/assets/solutions-resources-shell/t9n/messages.zh-TW.json +1 -66
  2050. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ar.json +1 -17
  2051. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.bg.json +1 -17
  2052. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.bs.json +1 -17
  2053. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ca.json +1 -17
  2054. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.cs.json +1 -17
  2055. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.da.json +1 -17
  2056. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.de.json +1 -17
  2057. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.el.json +1 -17
  2058. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.en.json +1 -17
  2059. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.es.json +1 -17
  2060. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.et.json +1 -17
  2061. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.fi.json +1 -17
  2062. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.fr.json +1 -17
  2063. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.he.json +1 -17
  2064. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.hr.json +1 -17
  2065. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.hu.json +1 -17
  2066. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.id.json +1 -17
  2067. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.it.json +1 -17
  2068. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ja.json +1 -17
  2069. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.json +1 -17
  2070. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ko.json +1 -17
  2071. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.lt.json +1 -17
  2072. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.lv.json +1 -17
  2073. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.nl.json +1 -17
  2074. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.no.json +1 -17
  2075. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.pl.json +1 -17
  2076. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.pt-BR.json +1 -17
  2077. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.pt-PT.json +1 -17
  2078. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ro.json +1 -17
  2079. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.ru.json +1 -17
  2080. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.sk.json +1 -17
  2081. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.sl.json +1 -17
  2082. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.sr.json +1 -17
  2083. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.sv.json +1 -17
  2084. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.th.json +1 -17
  2085. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.tr.json +1 -17
  2086. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.uk.json +1 -17
  2087. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.vi.json +1 -17
  2088. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.zh-CN.json +1 -17
  2089. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.zh-HK.json +1 -17
  2090. package/dist/cdn/assets/solutions-searchsort-toolbar/t9n/messages.zh-TW.json +1 -17
  2091. package/dist/cdn/index.js +1 -3
  2092. package/dist/cdn/main.css +1 -5
  2093. package/dist/chunks/Auth.js +93 -184
  2094. package/dist/chunks/cardFetchingUtils.js +197 -291
  2095. package/dist/chunks/cardsHelpers.js +69 -101
  2096. package/dist/chunks/create_design_prompt.js +10 -2
  2097. package/dist/chunks/deployAppContexts.js +7 -8
  2098. package/dist/chunks/description.js +32 -2
  2099. package/dist/chunks/downloadUtils.js +513 -820
  2100. package/dist/chunks/get.js +253 -459
  2101. package/dist/chunks/getItemIcon.js +33 -131
  2102. package/dist/chunks/getRelatedInfos.js +37 -52
  2103. package/dist/chunks/helpers.js +372 -836
  2104. package/dist/chunks/mapViewUtils.js +88 -135
  2105. package/dist/chunks/matching_solution_prompt.js +9 -2
  2106. package/dist/chunks/pciUtils.js +184 -372
  2107. package/dist/chunks/popupUtils.js +25 -42
  2108. package/dist/chunks/prompts.js +10 -2
  2109. package/dist/chunks/publicNotificationContext.js +3 -3
  2110. package/dist/chunks/queryUtils.js +55 -105
  2111. package/dist/chunks/review_use_case_prompt.js +7 -2
  2112. package/dist/chunks/runtime.js +11 -12
  2113. package/dist/chunks/solution-deploy-dialog.js +168 -394
  2114. package/dist/chunks/solutions-deploy-app-nav.js +159 -499
  2115. package/dist/chunks/solutions_assistant_description.js +25 -2
  2116. package/dist/chunks/solutions_assistant_prompts.js +26 -2
  2117. package/dist/chunks/solutions_explorer_description.js +28 -2
  2118. package/dist/chunks/system_prompt.js +164 -2
  2119. package/dist/chunks/update_existing_design_prompt.js +2 -2
  2120. package/dist/chunks/useT9n.js +4 -4
  2121. package/dist/chunks/user_prompt.js +2 -2
  2122. package/dist/chunks/valid_tempates.js +36 -2
  2123. package/dist/chunks/workflow_1_step_1.js +54 -2
  2124. package/dist/chunks/workflow_1_step_4.js +53 -2
  2125. package/dist/components/arcgis-solutions-assistant/customElement.d.ts +6 -0
  2126. package/dist/components/arcgis-solutions-assistant/customElement.js +32324 -47580
  2127. package/dist/components/arcgis-solutions-assistant/index.js +3 -1
  2128. package/dist/components/buffer-tools/customElement.d.ts +1 -1
  2129. package/dist/components/buffer-tools/customElement.js +43 -134
  2130. package/dist/components/card-manager/customElement.d.ts +2 -2
  2131. package/dist/components/card-manager/customElement.js +42 -141
  2132. package/dist/components/consent-manager/customElement.d.ts +1 -1
  2133. package/dist/components/consent-manager/customElement.js +2545 -3453
  2134. package/dist/components/create-feature/customElement.d.ts +1 -1
  2135. package/dist/components/create-feature/customElement.js +283 -821
  2136. package/dist/components/create-related-feature/customElement.d.ts +3 -3
  2137. package/dist/components/create-related-feature/customElement.js +76 -197
  2138. package/dist/components/crowdsource-manager/customElement.js +145 -622
  2139. package/dist/components/crowdsource-reporter/customElement.d.ts +1 -1
  2140. package/dist/components/crowdsource-reporter/customElement.js +340 -873
  2141. package/dist/components/deduct-calculator/customElement.js +23 -56
  2142. package/dist/components/delete-button/customElement.d.ts +1 -1
  2143. package/dist/components/delete-button/customElement.js +17 -52
  2144. package/dist/components/delete-dialog/customElement.d.ts +1 -1
  2145. package/dist/components/delete-dialog/customElement.js +20 -49
  2146. package/dist/components/edit-card/customElement.d.ts +2 -2
  2147. package/dist/components/edit-card/customElement.js +52 -205
  2148. package/dist/components/feature-details/customElement.d.ts +2 -2
  2149. package/dist/components/feature-details/customElement.js +106 -264
  2150. package/dist/components/feature-list/customElement.d.ts +1 -1
  2151. package/dist/components/feature-list/customElement.js +166 -405
  2152. package/dist/components/field-selection/customElement.d.ts +3 -3
  2153. package/dist/components/field-selection/customElement.js +131 -291
  2154. package/dist/components/info-card/customElement.d.ts +2 -2
  2155. package/dist/components/info-card/customElement.js +82 -309
  2156. package/dist/components/layer-list/customElement.d.ts +1 -1
  2157. package/dist/components/layer-list/customElement.js +71 -155
  2158. package/dist/components/layer-list-widget/customElement.d.ts +2 -2
  2159. package/dist/components/layer-list-widget/customElement.js +20 -51
  2160. package/dist/components/layer-table/customElement.d.ts +1 -1
  2161. package/dist/components/layer-table/customElement.js +579 -1516
  2162. package/dist/components/map-basemap-gallery/customElement.d.ts +2 -2
  2163. package/dist/components/map-basemap-gallery/customElement.js +31 -68
  2164. package/dist/components/map-card/customElement.d.ts +3 -3
  2165. package/dist/components/map-card/customElement.js +130 -418
  2166. package/dist/components/map-draw-tools/customElement.d.ts +5 -5
  2167. package/dist/components/map-draw-tools/customElement.js +90 -240
  2168. package/dist/components/map-floor-filter/customElement.d.ts +2 -2
  2169. package/dist/components/map-floor-filter/customElement.js +34 -92
  2170. package/dist/components/map-fullscreen/customElement.d.ts +2 -2
  2171. package/dist/components/map-fullscreen/customElement.js +22 -54
  2172. package/dist/components/map-layer-picker/customElement.d.ts +1 -1
  2173. package/dist/components/map-layer-picker/customElement.js +113 -329
  2174. package/dist/components/map-legend/customElement.d.ts +2 -2
  2175. package/dist/components/map-legend/customElement.js +22 -53
  2176. package/dist/components/map-picker/customElement.js +64 -233
  2177. package/dist/components/map-search/customElement.d.ts +2 -2
  2178. package/dist/components/map-search/customElement.js +41 -103
  2179. package/dist/components/map-select-tools/customElement.d.ts +9 -9
  2180. package/dist/components/map-select-tools/customElement.js +220 -583
  2181. package/dist/components/map-tools/customElement.d.ts +2 -2
  2182. package/dist/components/map-tools/customElement.js +134 -428
  2183. package/dist/components/pci-calculator/customElement.js +21 -88
  2184. package/dist/components/pdf-download/customElement.js +37 -66
  2185. package/dist/components/public-notification/customElement.d.ts +10 -10
  2186. package/dist/components/public-notification/customElement.js +329 -920
  2187. package/dist/components/refine-selection/customElement.d.ts +8 -8
  2188. package/dist/components/refine-selection/customElement.js +164 -422
  2189. package/dist/components/selection-tool/customElement.d.ts +1 -1
  2190. package/dist/components/selection-tool/customElement.js +36 -82
  2191. package/dist/components/solution-builder-assistant/customElement.d.ts +58 -2
  2192. package/dist/components/solution-builder-assistant/customElement.js +422 -317
  2193. package/dist/components/solution-builder-assistant/index.js +10 -3
  2194. package/dist/components/solution-configure-titles/customElement.js +76 -285
  2195. package/dist/components/solution-delete-dialog/customElement.js +80 -221
  2196. package/dist/components/solution-deploy-dialog/customElement.js +2 -2
  2197. package/dist/components/solution-deployed-card/customElement.js +2 -2
  2198. package/dist/components/solution-deployed-card-panel/customElement.js +129 -581
  2199. package/dist/components/solution-deploying-dialog/customElement.js +44 -139
  2200. package/dist/components/solution-details-card/customElement.js +34 -194
  2201. package/dist/components/solution-details-panel/customElement.js +275 -1116
  2202. package/dist/components/solution-item-accordion/customElement.js +81 -243
  2203. package/dist/components/solution-item-diagram/customElement.js +341 -661
  2204. package/dist/components/solution-item-icon/customElement.js +13 -45
  2205. package/dist/components/solution-resource-card/customElement.js +30 -90
  2206. package/dist/components/solution-snapshot-gallery/customElement.js +34 -205
  2207. package/dist/components/solution-social-share/customElement.js +86 -437
  2208. package/dist/components/solution-user-avatar/customElement.js +32 -99
  2209. package/dist/components/solutions-all-panel/customElement.js +132 -413
  2210. package/dist/components/solutions-all-shell/customElement.js +104 -353
  2211. package/dist/components/solutions-deploy-app/customElement.js +418 -640
  2212. package/dist/components/solutions-deployed-panel/customElement.js +126 -358
  2213. package/dist/components/solutions-deployed-shell/customElement.js +60 -254
  2214. package/dist/components/solutions-filter-panel/customElement.js +99 -204
  2215. package/dist/components/solutions-resources-section/customElement.js +11 -70
  2216. package/dist/components/solutions-resources-shell/customElement.js +86 -226
  2217. package/dist/components/solutions-searchsort-toolbar/customElement.js +120 -270
  2218. package/dist/docs/api.json +1 -1
  2219. package/dist/docs/docs.json +1 -1
  2220. package/dist/docs/vscode.html-custom-data.json +1 -1
  2221. package/dist/docs/web-types.json +1 -1
  2222. package/dist/index.js +34 -34
  2223. package/dist/loader.js +5 -5
  2224. package/dist/solutions-components_commit.txt +9 -7
  2225. package/dist/types/lumina.d.ts +1 -1
  2226. package/dist/types/preact.d.ts +1 -1
  2227. package/dist/types/react.d.ts +1 -1
  2228. package/dist/types/stencil.d.ts +1 -1
  2229. package/dist/utils/interfaces.d.ts +1 -0
  2230. package/package.json +3 -3
  2231. package/dist/cdn/26SK3V2J.js +0 -20
  2232. package/dist/cdn/2MVWPP44.js +0 -251
  2233. package/dist/cdn/2NNN2IEA.js +0 -2
  2234. package/dist/cdn/2RUCAMFJ.js +0 -105
  2235. package/dist/cdn/3ERM5FMJ.js +0 -2
  2236. package/dist/cdn/5BAHCARD.js +0 -20
  2237. package/dist/cdn/5XV3PTD5.js +0 -2
  2238. package/dist/cdn/6352AMOF.js +0 -176
  2239. package/dist/cdn/6LRKAQDE.js +0 -265
  2240. package/dist/cdn/6NAVSQLJ.js +0 -2
  2241. package/dist/cdn/735MVCBG.js +0 -2
  2242. package/dist/cdn/7VJAXXKR.js +0 -189
  2243. package/dist/cdn/ABBHSW5C.js +0 -62
  2244. package/dist/cdn/BREQGNX5.js +0 -102
  2245. package/dist/cdn/COEZWF3C.js +0 -42
  2246. package/dist/cdn/D24XESKY.js +0 -83
  2247. package/dist/cdn/DKZ7PFBZ.js +0 -814
  2248. package/dist/cdn/EA6TZFQZ.js +0 -54
  2249. package/dist/cdn/ECXMNXRO.js +0 -20
  2250. package/dist/cdn/F3RXZ2VK.js +0 -54
  2251. package/dist/cdn/F5TMP43R.js +0 -102
  2252. package/dist/cdn/FUNEAGFO.js +0 -2
  2253. package/dist/cdn/FWJXWTEF.js +0 -71
  2254. package/dist/cdn/G76KOIAO.js +0 -153
  2255. package/dist/cdn/GO4LT4BS.js +0 -2
  2256. package/dist/cdn/GZ6CSUYX.js +0 -2
  2257. package/dist/cdn/HOSAVZFC.js +0 -166
  2258. package/dist/cdn/IIBS4P5T.js +0 -67
  2259. package/dist/cdn/J5E3KDIO.js +0 -112
  2260. package/dist/cdn/JM5YOLPQ.js +0 -25
  2261. package/dist/cdn/JMF6CTJM.js +0 -36
  2262. package/dist/cdn/JUWKPO3A.js +0 -82
  2263. package/dist/cdn/JYXTD2IF.js +0 -145
  2264. package/dist/cdn/K5HZDGCJ.js +0 -55
  2265. package/dist/cdn/KIK5DF3Z.js +0 -358
  2266. package/dist/cdn/KSR3KM4D.js +0 -157
  2267. package/dist/cdn/KTZEZ6BA.js +0 -2
  2268. package/dist/cdn/KVSIAKOP.js +0 -85
  2269. package/dist/cdn/M3Z2IJY4.js +0 -58
  2270. package/dist/cdn/MQBTIDVG.js +0 -223
  2271. package/dist/cdn/ODKTZQUK.js +0 -173
  2272. package/dist/cdn/OGSZHJQG.js +0 -33
  2273. package/dist/cdn/PWBUHV2O.js +0 -42
  2274. package/dist/cdn/Q4G5M4UY.js +0 -537
  2275. package/dist/cdn/QKODO4SZ.js +0 -82
  2276. package/dist/cdn/QOVENITM.js +0 -93
  2277. package/dist/cdn/RTRP4ZYA.js +0 -76
  2278. package/dist/cdn/SQUMRUIU.js +0 -197
  2279. package/dist/cdn/SYJEM3XK.js +0 -26
  2280. package/dist/cdn/T5ZCMNGU.js +0 -20
  2281. package/dist/cdn/TCL3URL6.js +0 -20
  2282. package/dist/cdn/UWPUCZY5.js +0 -188
  2283. package/dist/cdn/V7VT2ATC.js +0 -25
  2284. package/dist/cdn/VAACRGWI.js +0 -24
  2285. package/dist/cdn/VBAKQRMI.js +0 -36
  2286. package/dist/cdn/VH6TZYDS.js +0 -45
  2287. package/dist/cdn/VOCRWRW3.js +0 -20
  2288. package/dist/cdn/VP2AZJ72.js +0 -119
  2289. package/dist/cdn/VUQ64ZJA.js +0 -22
  2290. package/dist/cdn/W5AFMZM3.js +0 -2
  2291. package/dist/cdn/WGYGBJMR.js +0 -49
  2292. package/dist/cdn/WHZLDRCK.js +0 -107
  2293. package/dist/cdn/WMMIC4KW.js +0 -2
  2294. package/dist/cdn/Y3HNWJHE.js +0 -79
  2295. package/dist/cdn/Y7W2W2BG.js +0 -23
  2296. package/dist/cdn/YFKHICKJ.js +0 -29
  2297. package/dist/cdn/YIG4EZRM.js +0 -2
  2298. package/dist/cdn/Z45JWFEP.js +0 -2
  2299. package/dist/cdn/ZDK2NGTZ.js +0 -60
  2300. package/dist/cdn/ZIDTNDJC.js +0 -2
  2301. package/dist/cdn/ZTUFNYXK.js +0 -71
@@ -1,814 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import a from"./UWPUCZY5.js";import{b as _w}from"./5XV3PTD5.js";import{b as gw}from"./PAJG7ACM.js";import"./K5CBVZDG.js";import{a as Sa,c as kr,d as bw,e as ww,k as $w}from"./WMMIC4KW.js";import{a as mw}from"./GZ6CSUYX.js";import"./7NDNEWIB.js";import"./46MUUBPE.js";import"./TEHBW75B.js";import"./KU62OLRE.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./B3R52L7H.js";import"./BDXIKPLU.js";import"./G2ME4BAQ.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./73AX72WY.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as pw}from"./JGBE6W5D.js";import{E as dw,F as fw,G as hw,K as jh,h as aw,i as Zs,k as sw,l as Rh,q as ow,v as cw,w as lw,x as uw}from"./7MSBIQLE.js";import"./QPIMTXPL.js";export default $arcgis.t(([FR,xk,O_,,,,{J:vw,q:yw}])=>{var Vs=class extends uw{constructor(t){if(super(t),this.it=Rh,t.type!==cw.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Rh||t==null)return this._t=void 0,this.it=t;if(t===sw)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};Vs.directiveName="unsafeHTML",Vs.resultType=1;var Sw=lw(Vs);var BR=aw`/**
3
- * @license
4
- * Copyright 2026 Esri
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the 'License');
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an 'AS IS' BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
-
19
- :host {
20
- display: block;
21
- height: 100%;
22
- }
23
-
24
- .margin-lg {
25
- margin: var(--calcite-spacing-lg);
26
- }
27
-
28
- .display-flex-row {
29
- display: flex;
30
- flex-direction: row;
31
- }
32
-
33
- .assistant-split-container {
34
- display: flex;
35
- width: 100%;
36
- height: calc(100vh - 78px);
37
- overflow: hidden;
38
- border-radius: 10px;
39
- }
40
-
41
- .assistant-panel {
42
- display: flex;
43
- flex-direction: column;
44
- height: 100%;
45
- border: 1px solid var(--calcite-color-surface-3);
46
- background-color: var(--calcite-color-surface-2);
47
- overflow: hidden;
48
- }
49
-
50
- .chat-panel {
51
- min-width: 320px;
52
- max-width: 80%;
53
- }
54
-
55
- .builder-panel {
56
- min-width: 320px;
57
- max-width: 100%;
58
- border-left: 1px solid var(--calcite-color-surface-3);
59
- }
60
-
61
- .panel-actions {
62
- display: flex;
63
- gap: 8px;
64
- padding: 6px;
65
- align-items: center;
66
- }
67
-
68
- .builder-header,
69
- .builder-footer {
70
- padding: 10px;
71
- background: var(--calcite-color-surface-1);
72
- border-bottom: 1px solid var(--calcite-color-surface-3);
73
- }
74
-
75
- .builder-content {
76
- flex: 1;
77
- overflow: auto;
78
- padding: 12px;
79
- }
80
-
81
- .builder-content pre {
82
- white-space: pre-wrap;
83
- word-wrap: break-word;
84
- max-height: 100%;
85
- overflow: auto;
86
- }
87
-
88
- .builder-actions {
89
- display: flex;
90
- gap: 6px;
91
- align-items: center;
92
- }
93
-
94
- .padding-left-10 {
95
- padding-left: 10px;
96
- }
97
-
98
- .chat-container {
99
- display: flex;
100
- flex-direction: column;
101
- gap: 0px;
102
- max-width: 600px;
103
- height: 75%;
104
- background-color: var(--calcite-color-surface-4);
105
- padding: 1px;
106
- }
107
-
108
- .chat-container_expanded {
109
- display: flex;
110
- flex-direction: column;
111
- gap: 0px;
112
- max-width: 100%;
113
- height: 95%;
114
- background-color: var(--calcite-color-surface-1);
115
- border-radius: 10px;
116
- padding: 10px;
117
- }
118
-
119
- .chat-panel {
120
- --calcite-color-focus: var(--calcite-color-brand);
121
- --calcite-panel-border-color: var(--calcite-color-border-2);
122
- --calcite-internal-panel-header-vertical-padding: 0px;
123
- --calcite-panel-header-content-space: 0px;
124
- border: var(--calcite-border-width-sm) solid var(--calcite-color-border-2);
125
- height: 100%;
126
- }
127
-
128
- .header-content {
129
- display: flex;
130
- align-items: center;
131
- gap: var(--calcite-spacing-sm);
132
- height: 65px;
133
- box-sizing: border-box;
134
- padding-inline-start: var(--calcite-spacing-md);
135
- }
136
-
137
- .header-title {
138
- font-size: var(--calcite-font-size-md);
139
- font-weight: var(--calcite-font-weight-medium);
140
- }
141
-
142
- .beta-chip {
143
- --calcite-chip-corner-radius: var(--calcite-corner-radius-half);
144
- }
145
-
146
- /* Reset focus color for content area elements */
147
- .chat-panel calcite-card,
148
- .chat-panel calcite-text-area,
149
- .chat-panel calcite-button,
150
- .chat-panel .chat-messages,
151
- .chat-panel .chat-input {
152
- --calcite-color-focus: var(--calcite-color-brand);
153
- }
154
-
155
- .assistant-followup-chip:focus {
156
- outline: 2px solid var(--calcite-color-brand);
157
- }
158
-
159
- .chat-panel-heading {
160
- font-size: var(--calcite-font-size-0);
161
- font-weight: var(--calcite-font-weight-medium);
162
- color: var(--calcite-color-surface-1, var(--calcite-color-text-1));
163
- }
164
-
165
- .chat-messages {
166
- display: flex;
167
- flex-direction: column;
168
- gap: 20px;
169
- padding: 4px;
170
- height: 100%;
171
- overflow-y: auto;
172
- }
173
-
174
- .user-message {
175
- align-self: flex-end;
176
- background: var(--calcite-color-brand);
177
- border-radius: 8px;
178
- max-width: 90%;
179
- --calcite-card-corner-radius: 8px;
180
- --calcite-card-background-color: var(--calcite-color-brand);
181
- --calcite-card-border-color: var(--calcite-color-brand);
182
- color: var(--calcite-color-text-inverse);
183
- text-align: left;
184
- }
185
-
186
- .system-message {
187
- align-self: flex-start;
188
- background: var(--calcite-color-surface-3);
189
- border-radius: 8px;
190
- max-width: 90%;
191
- --calcite-card-corner-radius: 8px;
192
- --calcite-card-background-color: var(--calcite-color-surface-4);
193
- --calcite-card-border-color: var(--calcite-color-surface-4);
194
- color: var(--calcite-color-inverse);
195
- text-align: left;
196
- }
197
-
198
- .loader-message {
199
- align-self: flex-start;
200
- background: var(--calcite-color-surface-4);
201
- border-radius: 8px;
202
- --calcite-card-corner-radius: 8px;
203
- --calcite-card-background-color: var(--calcite-color-surface-4);
204
- --calcite-card-border-color: var(--calcite-color-surface-4);
205
- }
206
-
207
- .message-content {
208
- padding: 0px;
209
- font-size: 14px;
210
- }
211
-
212
- .response-message.message-content>p:first-of-type {
213
- margin-top: 0;
214
- }
215
-
216
- .message-content img {
217
- max-width: 100%;
218
- height: auto;
219
- display: block;
220
- object-fit: contain;
221
- }
222
-
223
- .message-content-pad {
224
- padding-bottom: 10px;
225
- font-size: 14px;
226
- }
227
-
228
- .message-content-summary {
229
- padding-bottom: 14px;
230
- }
231
-
232
- .message-content-alignment {
233
- display: flex;
234
- align-items: center;
235
- /* Vertically centers icon and text */
236
- gap: var(--calcite-spacing-md);
237
- /* Uses Calcite spacing token */
238
- font-size: var(--calcite-font-size--1);
239
- /* Matches Calcite text size */
240
- color: var(--calcite-color-text-1);
241
- /* Calcite text color */
242
- }
243
-
244
- .padding-top-10 {
245
- padding-top: 10px;
246
- }
247
-
248
- .padding-right-8 {
249
- padding-right: 8px;
250
- }
251
-
252
- .padding-left-right-5 {
253
- padding-right: 5px;
254
- padding-left: 5px;
255
- }
256
-
257
- .chip-content {
258
- padding-top: 5px;
259
- padding-bottom: 5px;
260
- padding-right: 5px;
261
- padding-left: 0px;
262
- }
263
-
264
- .chat-input {
265
- display: flex;
266
- flex-direction: row;
267
- flex-grow: 1;
268
- }
269
-
270
- .table-cell {
271
- --calcite-table-cell-background: var(--calcite-color-surface-4);
272
- }
273
-
274
- .cursor-pointer {
275
- cursor: pointer;
276
- }
277
-
278
- .notice-border-color {
279
- --temp-initial-brand: var(--calcite-color-brand);
280
- }
281
-
282
- .notice-border-color calcite-notice {
283
- --calcite-color-brand: #ddd;
284
- --calcite-icon-color: var(--temp-initial-brand);
285
- }
286
-
287
- .notice-border-color calcite-notice * {
288
- --calcite-color-brand: var(--temp-initial-brand);
289
- }
290
-
291
- .solution-card {
292
- padding: 5px 0px 5px 0px;
293
- text-decoration: none;
294
- display: block;
295
- width: 100%;
296
- cursor: pointer;
297
- }
298
-
299
- .solution-card calcite-card {
300
- display: flex;
301
- flex-direction: column;
302
- max-width: 520px;
303
- overflow: hidden;
304
- /* Hide overflow content */
305
- --calcite-card-corner-radius: var(--calcite-corner-radius-round) !important;
306
- --calcite-card-shadow: var(--calcite-shadow-sm);
307
- --calcite-card-background-color: var(--calcite-card-background-color)
308
- }
309
-
310
- .solution-card div[slot="thumbnail"] {
311
- max-height: 100%;
312
- width: 100%;
313
- position: relative;
314
-
315
- &:after {
316
- content: "";
317
- position: absolute;
318
- top: 0;
319
- left: 0;
320
- width: 100%;
321
- height: 100%;
322
- transition: all 0.15s ease-in-out;
323
- }
324
- }
325
-
326
- .solution-card div[slot="thumbnail"] img {
327
- max-height: 100%;
328
- width: 100%;
329
- object-fit: cover;
330
- }
331
-
332
- .solution-card span[slot="description"] {
333
- padding-top: 10px;
334
- }
335
-
336
- .solution-card calcite-chip {
337
- position: absolute;
338
- top: 50%;
339
- left: 50%;
340
- transform: translate(-50%, -50%);
341
- visibility: hidden;
342
- pointer-events: none;
343
- opacity: 0;
344
- transition: all 0.15s ease-in-out;
345
- z-index: 9999;
346
- }
347
-
348
- .solution-card:hover calcite-chip {
349
- visibility: visible;
350
- opacity: 1;
351
- }
352
-
353
- .solution-card:hover div[slot="thumbnail"]:after {
354
- background-color: rgba(0, 0, 0, 0.5);
355
- }
356
-
357
- .solution-card:hover h3 {
358
- text-decoration: underline;
359
- }
360
-
361
- .solution-card:focus {
362
- outline: 2px solid var(--calcite-color-brand);
363
- }
364
-
365
- .references-container {
366
- padding-top: 10px;
367
- display: block;
368
- }
369
-
370
- .references-container.collapsed {
371
- display: none;
372
- }
373
-
374
- .width-100 {
375
- width: 100%;
376
- }
377
-
378
- .disclaimer-div {
379
- display: flex;
380
- align-items: center;
381
- gap: var(--calcite-spacing-sm);
382
- /* Uses Calcite spacing token */
383
- font-size: var(--calcite-font-size--0);
384
- /* Matches Calcite text size */
385
- color: var(--calcite-color-text-1);
386
- /* Calcite text color */
387
- }
388
-
389
- .display-none {
390
- display: none;
391
- }
392
-
393
- .chat-messages calcite-fab {
394
- position: absolute;
395
- bottom: 16px;
396
- /* adjust as needed */
397
- left: 50%;
398
- transform: translateX(-50%);
399
- z-index: 999;
400
- /* ensures it stays on top of other elements */
401
- }
402
-
403
- .icon-color-background {
404
- --calcite-button-icon-color: var(--calcite-color-surface-1);
405
- }
406
-
407
- #closeAssistantButton {
408
- --calcite-action-text-color: var(--calcite-color-text-1);
409
- }
410
-
411
- .icon-color-background:focus {
412
- --calcite-color-focus: var(--calcite-color-surface-1);
413
- }
414
-
415
- /* Hide snippet on very small screens */
416
- @media (max-width: 430px) {
417
- .solution-card .solution-snippet {
418
- display: none;
419
- }
420
- }
421
-
422
- .height-32-flex-auto {
423
- height: 32px;
424
- /* or 24px */
425
- flex: 0 0 auto;
426
- /* prevents stretching */
427
- }
428
-
429
- .margin-top-0.message-content>p:first-of-type {
430
- margin-top: 0;
431
- }
432
-
433
- /* Style for anchor elements that may appear in assistant responses to emulate calcite-link */
434
- /* Excludes .solution-card anchors which maintain their original card styling */
435
- a:not(.solution-card) {
436
- color: var(--calcite-link-text-color, var(--calcite-color-text-link));
437
- cursor: pointer;
438
- text-decoration: none;
439
- line-height: inherit;
440
- background-image: linear-gradient(currentColor, currentColor), linear-gradient(var(--calcite-color-brand-underline), var(--calcite-color-brand-underline));
441
- background-position-x: 0%, 100%;
442
- background-position-y: min(1.5em, 100%);
443
- background-repeat: no-repeat, no-repeat;
444
- background-size: 0% 1px, 100% 1px;
445
- transition-property: background-size, color;
446
- transition-duration: var(--calcite-animation-timing, 150ms);
447
- transition-timing-function: ease-in-out;
448
- outline-color: transparent;
449
- position: relative;
450
- }
451
-
452
- a:not(.solution-card):hover {
453
- background-size: 100% 1px, 100% 1px;
454
- }
455
-
456
- a:not(.solution-card):focus {
457
- outline: 2px solid var(--calcite-color-brand);
458
- outline-offset: 2px;
459
- outline-color: var(--calcite-color-brand);
460
- }
461
-
462
- a:not(.solution-card):active {
463
- color: var(--calcite-color-brand-press);
464
- }`,wt="__start__",xt="__end__",ni="__input__",cf="__error__",Mh="__pregel_ns_writes",si="__pregel_send",A_="__pregel_call",Ki="__pregel_read",Rr="__pregel_checkpointer",gu="__pregel_resuming",zl="__pregel_task_id",C_="__pregel_stream",ZR="__pregel_resume_value",Fl="__pregel_resume_map",oi="__pregel_scratchpad",Bl="__pregel_previous",VR="__pregel_durability",Am="checkpoint_id",jr="checkpoint_ns",qR="__pregel_node_finished",Ar="checkpoint_map",GR="__pregel_abort_signals",It="__interrupt__",hi="__resume__",N_="__no_writes__",lf="__return__",Dh="__previous__",sn="langsmith:hidden",kw="__self__",es="__pregel_tasks",Mr="__pregel_push",Cm="__pregel_pull",or="00000000-0000-0000-0000-000000000000",HR=[sn,ni,It,hi,cf,N_,si,Ki,Rr,VR,C_,gu,zl,A_,ZR,oi,Bl,Ar,jr,Am],xw=Symbol.for("langgraph.command"),JR=class{[xw];constructor(e){this[xw]=e}};function Nm(e){let t=e;return t!=null&&typeof t.node=="string"&&t.args!==void 0}var To=class{lg_name="Send";node;args;constructor(e,t){this.node=e,this.args=Oo(t)}toJSON(){return{lg_name:this.lg_name,node:this.node,args:this.args}}};function ln(e){return e instanceof To}var WR="__overwrite__";function Pm(e){return typeof e=="object"&&e!==null&&"__overwrite__"in e?[!0,e[WR]]:[!1,void 0]}function KR(e){return Pm(e)[0]}function Ik(e){return!e||typeof e!="object"||!("__interrupt__"in e)?!1:Array.isArray(e[It])}var lr=class extends JR{lg_name="Command";lc_direct_tool_output=!0;graph;update;resume;goto=[];static PARENT="__parent__";constructor(e){super(e),this.resume=e.resume,this.graph=e.graph,this.update=e.update,e.goto&&(this.goto=Array.isArray(e.goto)?Oo(e.goto):[Oo(e.goto)])}_updateAsTuples(){return this.update&&typeof this.update=="object"&&!Array.isArray(this.update)?Object.entries(this.update):Array.isArray(this.update)&&this.update.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string")?this.update:[["__root__",this.update]]}toJSON(){let e;return typeof this.goto=="string"?e=this.goto:ln(this.goto)?e=this.goto.toJSON():e=this.goto?.map(t=>typeof t=="string"?t:t.toJSON()),{lg_name:this.lg_name,update:this.update,resume:this.resume,goto:e}}};function zt(e){return typeof e!="object"||e==null?!1:"lg_name"in e&&e.lg_name==="Command"}function Oo(e,t=new Map){if(e!=null&&typeof e=="object"){if(t.has(e))return t.get(e);let n;if(Array.isArray(e))n=[],t.set(e,n),e.forEach((r,i)=>{n[i]=Oo(r,t)});else if(zt(e)&&!(e instanceof lr))n=new lr(e),t.set(e,n);else if(Nm(e)&&!(e instanceof To))n=new To(e.node,e.args),t.set(e,n);else if(zt(e)||ln(e))n=e,t.set(e,n);else if("lc_serializable"in e&&e.lc_serializable)n=e,t.set(e,n);else{n={},t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=Oo(i,t)}return n}return e}var Ti=class extends Error{lc_error_code;constructor(e,t){let n=e??"";t?.lc_error_code&&(n=`${n}
465
-
466
- Troubleshooting URL: https://docs.langchain.com/oss/javascript/langgraph/${t.lc_error_code}/
467
- `),super(n),this.lc_error_code=t?.lc_error_code}},Ek=class extends Ti{get is_bubble_up(){return!0}},XR=class extends Ti{constructor(e,t){super(e,t),this.name="GraphRecursionError"}static get unminifiable_name(){return"GraphRecursionError"}},Zl=class extends Ti{constructor(e,t){super(e,t),this.name="GraphValueError"}static get unminifiable_name(){return"GraphValueError"}},Ka=class extends Ek{interrupts;constructor(e,t){super(JSON.stringify(e,null,2),t),this.name="GraphInterrupt",this.interrupts=e??[]}static get unminifiable_name(){return"GraphInterrupt"}},pi=class extends Ka{constructor(e,t){super([{value:e}],t),this.name="NodeInterrupt"}static get unminifiable_name(){return"NodeInterrupt"}},Tk=class extends Ek{command;constructor(e){super(),this.name="ParentCommand",this.command=e}static get unminifiable_name(){return"ParentCommand"}};function YR(e){return e!==void 0&&e.name===Tk.unminifiable_name}function Vl(e){return e!==void 0&&e.is_bubble_up===!0}function za(e){return e!==void 0&&[Ka.unminifiable_name,pi.unminifiable_name].includes(e.name)}var Iw=class extends Ti{constructor(e,t){super(e,t),this.name="EmptyInputError"}static get unminifiable_name(){return"EmptyInputError"}},Tt=class extends Ti{constructor(e,t){super(e,t),this.name="EmptyChannelError"}static get unminifiable_name(){return"EmptyChannelError"}},Qe=class extends Ti{constructor(e,t){super(e,t),this.name="InvalidUpdateError"}static get unminifiable_name(){return"InvalidUpdateError"}},QR=class extends Ti{constructor(e,t){super(e,t),this.name="UnreachableNodeError"}static get unminifiable_name(){return"UnreachableNodeError"}},Uh=class extends Ti{constructor(e,t){super(e,t),this.name="StateGraphInputError",this.message="Invalid StateGraph input. Make sure to pass a valid StateDefinition, Annotation.Root, or Zod schema."}static get unminifiable_name(){return"StateGraphInputError"}},e4=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Rm(e){return typeof e=="string"&&e4.test(e)}function Ok(e){if(!Rm(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}var Ot=[];for(rl=0;rl<256;++rl)Ot.push((rl+256).toString(16).slice(1));var rl;function Ms(e,t=0){return(Ot[e[t+0]]+Ot[e[t+1]]+Ot[e[t+2]]+Ot[e[t+3]]+"-"+Ot[e[t+4]]+Ot[e[t+5]]+"-"+Ot[e[t+6]]+Ot[e[t+7]]+"-"+Ot[e[t+8]]+Ot[e[t+9]]+"-"+Ot[e[t+10]]+Ot[e[t+11]]+Ot[e[t+12]]+Ot[e[t+13]]+Ot[e[t+14]]+Ot[e[t+15]]).toLowerCase()}var il,t4=new Uint8Array(16);function P_(){if(!il&&(il=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!il))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return il(t4)}var Lh,al,zh=0,Fh=0;function n4(e,t,n){var r=0,i=t||new Array(16);e=e||{};var a=e.node,s=e.clockseq;if(e._v6||(a||(a=Lh),s==null&&(s=al)),a==null||s==null){var o=e.random||(e.rng||P_)();a==null&&(a=[o[0],o[1],o[2],o[3],o[4],o[5]],!Lh&&!e._v6&&(a[0]|=1,Lh=a)),s==null&&(s=(o[6]<<8|o[7])&16383,al===void 0&&!e._v6&&(al=s))}var c=e.msecs!==void 0?e.msecs:Date.now(),l=e.nsecs!==void 0?e.nsecs:Fh+1,u=c-zh+(l-Fh)/1e4;if(u<0&&e.clockseq===void 0&&(s=s+1&16383),(u<0||c>zh)&&e.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");zh=c,Fh=l,al=s,c+=122192928e5;var d=((c&268435455)*1e4+l)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=d&255;var f=c/4294967296*1e4&268435455;i[r++]=f>>>8&255,i[r++]=f&255,i[r++]=f>>>24&15|16,i[r++]=f>>>16&255,i[r++]=s>>>8|128,i[r++]=s&255;for(var h=0;h<6;++h)i[r+h]=a[h];return t||Ms(i)}function r4(e){var t=typeof e=="string"?Ok(e):e,n=i4(t);return typeof e=="string"?Ms(n):n}function i4(e,t=!1){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function a4(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}var s4="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o4="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function c4(e,t,n){function r(i,a,s,o){var c;if(typeof i=="string"&&(i=a4(i)),typeof a=="string"&&(a=Ok(a)),((c=a)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var l=new Uint8Array(16+i.length);if(l.set(a),l.set(i,a.length),l=n(l),l[6]=l[6]&15|t,l[8]=l[8]&63|128,s){o=o||0;for(var u=0;u<16;++u)s[o+u]=l[u];return s}return Ms(l)}try{r.name=e}catch{}return r.DNS=s4,r.URL=o4,r}var l4=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ew={randomUUID:l4};function zi(e,t,n){if(Ew.randomUUID&&!e)return Ew.randomUUID();e=e||{};var r=e.random||(e.rng||P_)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ms(r)}function u4(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function Bh(e,t){return e<<t|e>>>32-t}function d4(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i<r.length;++i)e.push(r.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,s=Math.ceil(a/16),o=new Array(s),c=0;c<s;++c){for(var l=new Uint32Array(16),u=0;u<16;++u)l[u]=e[c*64+u*4]<<24|e[c*64+u*4+1]<<16|e[c*64+u*4+2]<<8|e[c*64+u*4+3];o[c]=l}o[s-1][14]=(e.length-1)*8/Math.pow(2,32),o[s-1][14]=Math.floor(o[s-1][14]),o[s-1][15]=(e.length-1)*8&4294967295;for(var d=0;d<s;++d){for(var f=new Uint32Array(80),h=0;h<16;++h)f[h]=o[d][h];for(var p=16;p<80;++p)f[p]=Bh(f[p-3]^f[p-8]^f[p-14]^f[p-16],1);for(var m=n[0],v=n[1],g=n[2],y=n[3],$=n[4],S=0;S<80;++S){var x=Math.floor(S/20),C=Bh(m,5)+u4(x,v,g,y)+$+t[x]+f[S]>>>0;$=y,y=g,g=Bh(v,30)>>>0,v=m,m=C}n[0]=n[0]+m>>>0,n[1]=n[1]+v>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+$>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var Ak=c4("v5",80,d4);function Tw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ow(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tw(Object(n),!0).forEach(function(r){f4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function f4(e,t,n){return(t=h4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h4(e){var t=p4(e,"string");return typeof t=="symbol"?t:t+""}function p4(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function m4(e={},t,n=0){var r=n4(Ow(Ow({},e),{},{_v6:!0}),new Uint8Array(16));return r=r4(r),Ms(r)}var Aw=null,Cw=null,Rn=0;function Ck(e,t,n){e=e||{};var r=0,i=new Uint8Array(16),a=e.random||(e.rng||P_)(),s=e.msecs!==void 0?e.msecs:Date.now(),o=e.seq!==void 0?e.seq:null,c=Cw,l=Aw;return s>Rn&&e.msecs===void 0&&(Rn=s,o!==null&&(c=null,l=null)),o!==null&&(o>2147483647&&(o=2147483647),c=o>>>19&4095,l=o&524287),(c===null||l===null)&&(c=a[6]&127,c=c<<8|a[7],l=a[8]&63,l=l<<8|a[9],l=l<<5|a[10]>>>3),s+1e4>Rn&&o===null?++l>524287&&(l=0,++c>4095&&(c=0,Rn++)):Rn=s,Cw=c,Aw=l,i[r++]=Rn/1099511627776&255,i[r++]=Rn/4294967296&255,i[r++]=Rn/16777216&255,i[r++]=Rn/65536&255,i[r++]=Rn/256&255,i[r++]=Rn&255,i[r++]=c>>>4&15|112,i[r++]=c&255,i[r++]=l>>>13&63|128,i[r++]=l>>>5&255,i[r++]=l<<3&255|a[10]&7,i[r++]=a[11],i[r++]=a[12],i[r++]=a[13],i[r++]=a[14],i[r++]=a[15],t||Ms(i)}function Nk(e){return m4({clockseq:e})}function Fa(e,t){let n=t.replace(/-/g,"").match(/.{2}/g).map(r=>parseInt(r,16));return Ak(e,new Uint8Array(n))}var g4="__error__",ql="__scheduled__",_4="__interrupt__",y4="__resume__",Nw="[...]",v4="[Circular]",_u=[],Ba=[];function b4(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function w4(e,t,n,r){typeof r>"u"&&(r=b4()),jm(e,"",0,[],void 0,0,r);var i;try{Ba.length===0?i=JSON.stringify(e,t,n):i=JSON.stringify(e,$4(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;_u.length!==0;){var a=_u.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return i}function Zh(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);i.get!==void 0?i.configurable?(Object.defineProperty(r,n,{value:e}),_u.push([r,n,t,i])):Ba.push([t,n,e]):(r[n]=e,_u.push([r,n,t]))}function jm(e,t,n,r,i,a,s){a+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<r.length;o++)if(r[o]===e){Zh(v4,e,t,i);return}if(typeof s.depthLimit<"u"&&a>s.depthLimit){Zh(Nw,e,t,i);return}if(typeof s.edgesLimit<"u"&&n+1>s.edgesLimit){Zh(Nw,e,t,i);return}if(r.push(e),Array.isArray(e))for(o=0;o<e.length;o++)jm(e[o],o,o,r,e,a,s);else{var c=Object.keys(e);for(o=0;o<c.length;o++){var l=c[o];jm(e[l],l,o,r,e,a,s)}}r.pop()}}function $4(e){return e=typeof e<"u"?e:function(t,n){return n},function(t,n){if(Ba.length>0)for(var r=0;r<Ba.length;r++){var i=Ba[r];if(i[1]===t&&i[0]===n){n=i[2],Ba.splice(r,1);break}}return e.call(this,t,n)}}var Vh,Pw;function S4(){return Pw||(Pw=1,Vh=function(e,t){if(typeof e!="string")throw new TypeError("Expected a string");return t=typeof t>"u"?"_":t,e.replace(/([a-z\d])([A-Z])/g,"$1"+t+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+t+"$2").toLowerCase()}),Vh}var k4=S4(),x4=Sa(k4),sl={exports:{}},Rw;function I4(){if(Rw)return sl.exports;Rw=1;let e=/[\p{Lu}]/u,t=/[\p{Ll}]/u,n=/^[\p{Lu}](?![\p{Lu}])/gu,r=/([\p{Alpha}\p{N}_]|$)/u,i=/[_.\- ]+/,a=new RegExp("^"+i.source),s=new RegExp(i.source+r.source,"gu"),o=new RegExp("\\d+"+r.source,"gu"),c=(f,h,p)=>{let m=!1,v=!1,g=!1;for(let y=0;y<f.length;y++){let $=f[y];m&&e.test($)?(f=f.slice(0,y)+"-"+f.slice(y),m=!1,g=v,v=!0,y++):v&&g&&t.test($)?(f=f.slice(0,y-1)+"-"+f.slice(y-1),g=v,v=!1,m=!0):(m=h($)===$&&p($)!==$,g=v,v=p($)===$&&h($)!==$)}return f},l=(f,h)=>(n.lastIndex=0,f.replace(n,p=>h(p))),u=(f,h)=>(s.lastIndex=0,o.lastIndex=0,f.replace(s,(p,m)=>h(m)).replace(o,p=>h(p))),d=(f,h)=>{if(!(typeof f=="string"||Array.isArray(f)))throw new TypeError("Expected the input to be `string | string[]`");if(h={pascalCase:!1,preserveConsecutiveUppercase:!1,...h},Array.isArray(f)?f=f.map(g=>g.trim()).filter(g=>g.length).join("-"):f=f.trim(),f.length===0)return"";let p=h.locale===!1?g=>g.toLowerCase():g=>g.toLocaleLowerCase(h.locale),m=h.locale===!1?g=>g.toUpperCase():g=>g.toLocaleUpperCase(h.locale);return f.length===1?h.pascalCase?m(f):p(f):(f!==p(f)&&(f=c(f,p,m)),f=f.replace(a,""),h.preserveConsecutiveUppercase?f=l(f,p):f=p(f),h.pascalCase&&(f=m(f.charAt(0))+f.slice(1)),u(f,m))};return sl.exports=d,sl.exports.default=d,sl.exports}var E4=I4(),T4=Sa(E4);function O4(e,t){return t?.[e]||x4(e)}function A4(e,t){return t?.[e]||T4(e)}function Pk(e,t,n){let r={};for(let i in e)Object.hasOwn(e,i)&&(r[t(i,n)]=e[i]);return r}var Rk="__lc_escaped__";function C4(e){return"lc"in e||Object.keys(e).length===1&&"__lc_escaped__"in e}function N4(e){return{[Rk]:e}}function jk(e){return Object.keys(e).length===1&&"__lc_escaped__"in e}function P4(e){return e!==null&&typeof e=="object"&&"lc_serializable"in e&&typeof e.toJSON=="function"}function R4(e){let t;return e!==null&&typeof e=="object"?"lc_id"in e&&Array.isArray(e.lc_id)?t=e.lc_id:t=[e.constructor?.name??"Object"]:t=[typeof e],{lc:1,type:"not_implemented",id:t}}function Mm(e,t=new WeakSet){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){if(t.has(e))return R4(e);if(P4(e))return e;t.add(e);let n=e;if(C4(n))return t.delete(e),N4(n);let r={};for(let[i,a]of Object.entries(n))r[i]=Mm(a,t);return t.delete(e),r}return Array.isArray(e)?e.map(n=>Mm(n,t)):e}function Dm(e){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){let t=e;if(jk(t))return t[Rk];let n={};for(let[r,i]of Object.entries(t))n[r]=Dm(i);return n}return Array.isArray(e)?e.map(t=>Dm(t)):e}var jw=Object.defineProperty,Q=(e,t)=>{let n={};for(var r in e)jw(n,r,{get:e[r],enumerable:!0});return jw(n,Symbol.toStringTag,{value:"Module"}),n},j4=Q({Serializable:()=>An,get_lc_unique_name:()=>uf});function Mw(e){return Array.isArray(e)?[...e]:{...e}}function M4(e,t){let n=Mw(e);for(let[r,i]of Object.entries(t)){let[a,...s]=r.split(".").reverse(),o=n;for(let c of s.reverse()){if(o[c]===void 0)break;o[c]=Mw(o[c]),o=o[c]}o[a]!==void 0&&(o[a]={lc:1,type:"secret",id:[i]})}return n}function uf(e){let t=Object.getPrototypeOf(e);return typeof e.lc_name=="function"&&(typeof t.lc_name!="function"||e.lc_name()!==t.lc_name())?e.lc_name():e.name}var An=class Mk{lc_serializable=!1;lc_kwargs;static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,uf(this.constructor)]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}constructor(t,...n){this.lc_serializable_keys!==void 0?this.lc_kwargs=Object.fromEntries(Object.entries(t||{}).filter(([r])=>this.lc_serializable_keys?.includes(r))):this.lc_kwargs=t??{}}toJSON(){if(!this.lc_serializable)return this.toJSONNotImplemented();if(this.lc_kwargs instanceof Mk||typeof this.lc_kwargs!="object"||Array.isArray(this.lc_kwargs))return this.toJSONNotImplemented();let t={},n={},r=Object.keys(this.lc_kwargs).reduce((o,c)=>(o[c]=c in this?this[c]:this.lc_kwargs[c],o),{});for(let o=Object.getPrototypeOf(this);o;o=Object.getPrototypeOf(o))Object.assign(t,Reflect.get(o,"lc_aliases",this)),Object.assign(n,Reflect.get(o,"lc_secrets",this)),Object.assign(r,Reflect.get(o,"lc_attributes",this));Object.keys(n).forEach(o=>{let c=this,l=r,[u,...d]=o.split(".").reverse();for(let f of d.reverse()){if(!(f in c)||c[f]===void 0)return;(!(f in l)||l[f]===void 0)&&(typeof c[f]=="object"&&c[f]!=null?l[f]={}:Array.isArray(c[f])&&(l[f]=[])),c=c[f],l=l[f]}u in c&&c[u]!==void 0&&(l[u]=l[u]||c[u])});let i={},a=new WeakSet;a.add(this);for(let[o,c]of Object.entries(r))i[o]=Mm(c,a);let s=Pk(Object.keys(n).length?M4(i,n):i,O4,t);return{lc:1,type:"constructor",id:this.lc_id,kwargs:s}}toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:this.lc_id}}},D4=Q({getEnv:()=>R_,getEnvironmentVariable:()=>wn,getRuntimeEnvironment:()=>Fk,isBrowser:()=>Dk,isDeno:()=>df,isJsDom:()=>Lk,isNode:()=>zk,isWebWorker:()=>Uk}),Dk=()=>typeof window<"u"&&typeof window.document<"u",Uk=()=>typeof globalThis=="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",Lk=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),df=()=>typeof Deno<"u",zk=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!df(),R_=()=>{let e;return Dk()?e="browser":zk()?e="node":Uk()?e="webworker":Lk()?e="jsdom":df()?e="deno":e="other",e},qh;function Fk(){return qh===void 0&&(qh={library:"langchain-js",runtime:R_()}),qh}function wn(e){try{return typeof process<"u"?process.env?.[e]:df()?Deno?.env.get(e):void 0}catch{return}}var U4=[],L4=Q({}),z4=Q({}),Y="0123456789abcdef".split(""),F4=[-2147483648,8388608,32768,128],jn=[24,16,8,0],ol=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],St=[];function Kn(e,t){t?(St[0]=St[16]=St[1]=St[2]=St[3]=St[4]=St[5]=St[6]=St[7]=St[8]=St[9]=St[10]=St[11]=St[12]=St[13]=St[14]=St[15]=0,this.blocks=St):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}Kn.prototype.update=function(e){if(!this.finalized){var t,n=typeof e;if(n!=="string"){if(n==="object"){if(e===null)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR)}else throw new Error(ERROR);t=!0}for(var r,i=0,a,s=e.length,o=this.blocks;i<s;){if(this.hashed&&(this.hashed=!1,o[0]=this.block,this.block=o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),t)for(a=this.start;i<s&&a<64;++i)o[a>>>2]|=e[i]<<jn[a++&3];else for(a=this.start;i<s&&a<64;++i)r=e.charCodeAt(i),r<128?o[a>>>2]|=r<<jn[a++&3]:r<2048?(o[a>>>2]|=(192|r>>>6)<<jn[a++&3],o[a>>>2]|=(128|r&63)<<jn[a++&3]):r<55296||r>=57344?(o[a>>>2]|=(224|r>>>12)<<jn[a++&3],o[a>>>2]|=(128|r>>>6&63)<<jn[a++&3],o[a>>>2]|=(128|r&63)<<jn[a++&3]):(r=65536+((r&1023)<<10|e.charCodeAt(++i)&1023),o[a>>>2]|=(240|r>>>18)<<jn[a++&3],o[a>>>2]|=(128|r>>>12&63)<<jn[a++&3],o[a>>>2]|=(128|r>>>6&63)<<jn[a++&3],o[a>>>2]|=(128|r&63)<<jn[a++&3]);this.lastByteIndex=a,this.bytes+=a-this.start,a>=64?(this.block=o[16],this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}};Kn.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=F4[t&3],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}};Kn.prototype.hash=function(){var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,a=this.h5,s=this.h6,o=this.h7,c=this.blocks,l,u,d,f,h,p,m,v,g,y,$;for(l=16;l<64;++l)h=c[l-15],u=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,h=c[l-2],d=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,c[l]=c[l-16]+u+c[l-7]+d<<0;for($=t&n,l=0;l<64;l+=4)this.first?(this.is224?(v=300032,h=c[0]-1413257819,o=h-150054599<<0,r=h+24177077<<0):(v=704751109,h=c[0]-210244248,o=h-1521486534<<0,r=h+143694565<<0),this.first=!1):(u=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),d=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),v=e&t,f=v^e&n^$,m=i&a^~i&s,h=o+d+m+ol[l]+c[l],p=u+f,o=r+h<<0,r=h+p<<0),u=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),d=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),g=r&e,f=g^r&t^v,m=s&o^~s&i,h=a+d+m+ol[l+1]+c[l+1],p=u+f,s=n+h<<0,n=h+p<<0,u=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),d=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),y=n&r,f=y^n&e^g,m=a&s^~a&o,h=i+d+m+ol[l+2]+c[l+2],p=u+f,a=t+h<<0,t=h+p<<0,u=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),d=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),$=t&n,f=$^t&r^y,m=a&s^~a&o,h=i+d+m+ol[l+3]+c[l+3],p=u+f,i=e+h<<0,e=h+p<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0,this.h4=this.h4+i<<0,this.h5=this.h5+a<<0,this.h6=this.h6+s<<0,this.h7=this.h7+o<<0};Kn.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,a=this.h5,s=this.h6,o=this.h7,c=Y[e>>>28&15]+Y[e>>>24&15]+Y[e>>>20&15]+Y[e>>>16&15]+Y[e>>>12&15]+Y[e>>>8&15]+Y[e>>>4&15]+Y[e&15]+Y[t>>>28&15]+Y[t>>>24&15]+Y[t>>>20&15]+Y[t>>>16&15]+Y[t>>>12&15]+Y[t>>>8&15]+Y[t>>>4&15]+Y[t&15]+Y[n>>>28&15]+Y[n>>>24&15]+Y[n>>>20&15]+Y[n>>>16&15]+Y[n>>>12&15]+Y[n>>>8&15]+Y[n>>>4&15]+Y[n&15]+Y[r>>>28&15]+Y[r>>>24&15]+Y[r>>>20&15]+Y[r>>>16&15]+Y[r>>>12&15]+Y[r>>>8&15]+Y[r>>>4&15]+Y[r&15]+Y[i>>>28&15]+Y[i>>>24&15]+Y[i>>>20&15]+Y[i>>>16&15]+Y[i>>>12&15]+Y[i>>>8&15]+Y[i>>>4&15]+Y[i&15]+Y[a>>>28&15]+Y[a>>>24&15]+Y[a>>>20&15]+Y[a>>>16&15]+Y[a>>>12&15]+Y[a>>>8&15]+Y[a>>>4&15]+Y[a&15]+Y[s>>>28&15]+Y[s>>>24&15]+Y[s>>>20&15]+Y[s>>>16&15]+Y[s>>>12&15]+Y[s>>>8&15]+Y[s>>>4&15]+Y[s&15];return this.is224||(c+=Y[o>>>28&15]+Y[o>>>24&15]+Y[o>>>20&15]+Y[o>>>16&15]+Y[o>>>12&15]+Y[o>>>8&15]+Y[o>>>4&15]+Y[o&15]),c};Kn.prototype.toString=Kn.prototype.hex;Kn.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,a=this.h5,s=this.h6,o=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,e&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255];return this.is224||c.push(o>>>24&255,o>>>16&255,o>>>8&255,o&255),c};Kn.prototype.array=Kn.prototype.digest;Kn.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e};var j_=(...e)=>new Kn(!1,!0).update(e.join("")).hex(),B4=Q({sha256:()=>j_});function Bk(e){let t=Symbol.for(e);return{brand(n,r){let i=r?Symbol.for(`${e}.${r}`):t;class a extends n{[i]=!0;constructor(...o){super(...o)}static isInstance(o){return typeof o=="object"&&o!==null&&i in o&&o[i]===!0}}return Object.defineProperty(a,"name",{value:n.name}),a},sub(n){return Bk(`${e}.${n}`)},isInstance(n){return typeof n=="object"&&n!==null&&t in n&&n[t]===!0}}}var Z4=Bk("langchain"),V4=Q({ContextOverflowError:()=>Zk,LangChainError:()=>M_,ModelAbortError:()=>Um,addLangChainErrorFields:()=>fc,ns:()=>ff});function fc(e,t){return e.lc_error_code=t,e.message=`${e.message}
468
-
469
- Troubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${t}/
470
- `,e}var ff=Z4.sub("error"),M_=class extends ff.brand(Error){name="LangChainError";constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Um=class extends ff.brand(M_,"model-abort"){name="ModelAbortError";partialOutput;constructor(e,t){super(e),this.partialOutput=t}},Zk=class Vk extends ff.brand(M_,"context-overflow"){name="ContextOverflowError";cause;constructor(t){super(t??"Input exceeded the model's context window.")}static fromError(t){let n=new Vk(t.message);return n.cause=t,n}};function gr(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"&&"source_type"in e&&(e.source_type==="url"||e.source_type==="base64"||e.source_type==="text"||e.source_type==="id")}function D_(e){return gr(e)&&e.source_type==="url"&&"url"in e&&typeof e.url=="string"}function U_(e){return gr(e)&&e.source_type==="base64"&&"data"in e&&typeof e.data=="string"}function q4(e){return gr(e)&&e.source_type==="text"&&"text"in e&&typeof e.text=="string"}function qk(e){return gr(e)&&e.source_type==="id"&&"id"in e&&typeof e.id=="string"}function Gk(e){if(gr(e)){if(e.source_type==="url")return{type:"image_url",image_url:{url:e.url}};if(e.source_type==="base64"){if(!e.mime_type)throw new Error("mime_type key is required for base64 data.");return{type:"image_url",image_url:{url:`data:${e.mime_type};base64,${e.data}`}}}}throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.")}function Lm(e){let t=e.split(";")[0].split("/");if(t.length!==2)throw new Error(`Invalid mime type: "${e}" - does not match type/subtype format.`);let n=t[0].trim(),r=t[1].trim();if(n===""||r==="")throw new Error(`Invalid mime type: "${e}" - type or subtype is empty.`);let i={};for(let a of e.split(";").slice(1)){let s=a.split("=");if(s.length!==2)throw new Error(`Invalid parameter syntax in mime type: "${e}".`);let o=s[0].trim(),c=s[1].trim();if(o==="")throw new Error(`Invalid parameter syntax in mime type: "${e}".`);i[o]=c}return{type:n,subtype:r,parameters:i}}function Ao({dataUrl:e,asTypedArray:t=!1}){let n=e.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/),r;if(n){r=n[1].toLowerCase();let i=t?Uint8Array.from(atob(n[2]),a=>a.charCodeAt(0)):n[2];return{mime_type:r,data:i}}}function L_(e,t){if(e.type==="text"){if(!t.fromStandardTextBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardTextBlock\` method.`);return t.fromStandardTextBlock(e)}if(e.type==="image"){if(!t.fromStandardImageBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardImageBlock\` method.`);return t.fromStandardImageBlock(e)}if(e.type==="audio"){if(!t.fromStandardAudioBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardAudioBlock\` method.`);return t.fromStandardAudioBlock(e)}if(e.type==="file"){if(!t.fromStandardFileBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardFileBlock\` method.`);return t.fromStandardFileBlock(e)}throw new Error(`Unable to convert content block type '${e.type}' to provider-specific format: not recognized.`)}function K(e,t){return ue(e)&&e.type===t}function ue(e){return typeof e=="object"&&e!==null}function on(e){return Array.isArray(e)}function U(e){return typeof e=="string"}function Bn(e){return typeof e=="number"}function z_(e){return e instanceof Uint8Array}function Dw(e){try{return JSON.parse(e)}catch{return}}var ci=e=>e();function G4(e){if(e.type==="char_location"&&U(e.document_title)&&Bn(e.start_char_index)&&Bn(e.end_char_index)&&U(e.cited_text)){let{document_title:t,start_char_index:n,end_char_index:r,cited_text:i,...a}=e;return{...a,type:"citation",source:"char",title:t??void 0,startIndex:n,endIndex:r,citedText:i}}if(e.type==="page_location"&&U(e.document_title)&&Bn(e.start_page_number)&&Bn(e.end_page_number)&&U(e.cited_text)){let{document_title:t,start_page_number:n,end_page_number:r,cited_text:i,...a}=e;return{...a,type:"citation",source:"page",title:t??void 0,startIndex:n,endIndex:r,citedText:i}}if(e.type==="content_block_location"&&U(e.document_title)&&Bn(e.start_block_index)&&Bn(e.end_block_index)&&U(e.cited_text)){let{document_title:t,start_block_index:n,end_block_index:r,cited_text:i,...a}=e;return{...a,type:"citation",source:"block",title:t??void 0,startIndex:n,endIndex:r,citedText:i}}if(e.type==="web_search_result_location"&&U(e.url)&&U(e.title)&&U(e.encrypted_index)&&U(e.cited_text)){let{url:t,title:n,encrypted_index:r,cited_text:i,...a}=e;return{...a,type:"citation",source:"url",url:t,title:n,startIndex:Number(r),endIndex:Number(r),citedText:i}}if(e.type==="search_result_location"&&U(e.source)&&U(e.title)&&Bn(e.start_block_index)&&Bn(e.end_block_index)&&U(e.cited_text)){let{source:t,title:n,start_block_index:r,end_block_index:i,cited_text:a,...s}=e;return{...s,type:"citation",source:"search",url:t,title:n??void 0,startIndex:r,endIndex:i,citedText:a}}}function Hk(e){if(K(e,"document")&&ue(e.source)&&"type"in e.source){if(e.source.type==="base64"&&U(e.source.media_type)&&U(e.source.data))return{type:"file",mimeType:e.source.media_type,data:e.source.data};if(e.source.type==="url"&&U(e.source.url))return{type:"file",url:e.source.url};if(e.source.type==="file"&&U(e.source.file_id))return{type:"file",fileId:e.source.file_id};if(e.source.type==="text"&&U(e.source.data))return{type:"file",mimeType:String(e.source.media_type??"text/plain"),data:e.source.data}}else if(K(e,"image")&&ue(e.source)&&"type"in e.source){if(e.source.type==="base64"&&U(e.source.media_type)&&U(e.source.data))return{type:"image",mimeType:e.source.media_type,data:e.source.data};if(e.source.type==="url"&&U(e.source.url))return{type:"image",url:e.source.url};if(e.source.type==="file"&&U(e.source.file_id))return{type:"image",fileId:e.source.file_id}}}function H4(e){function*t(){for(let n of e){let r=Hk(n);r?yield r:yield n}}return Array.from(t())}function Uw(e){function*t(){let n=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(let r of n){if(K(r,"text")&&U(r.text)){let{text:i,citations:a,...s}=r;if(on(a)&&a.length){let o=a.reduce((c,l)=>{let u=G4(l);return u?[...c,u]:c},[]);yield{...s,type:"text",text:i,annotations:o};continue}else{yield{...s,type:"text",text:i};continue}}else if(K(r,"thinking")&&U(r.thinking)){let{thinking:i,signature:a,...s}=r;yield{...s,type:"reasoning",reasoning:i,signature:a};continue}else if(K(r,"redacted_thinking")){yield{type:"non_standard",value:r};continue}else if(K(r,"tool_use")&&U(r.name)&&U(r.id)){yield{type:"tool_call",id:r.id,name:r.name,args:r.input};continue}else if(K(r,"input_json_delta")){if(W4(e)&&e.tool_call_chunks?.length){let i=e.tool_call_chunks[0];yield{type:"tool_call_chunk",id:i.id,name:i.name,args:i.args,index:i.index};continue}}else if(K(r,"server_tool_use")&&U(r.name)&&U(r.id)){let{name:i,id:a}=r;if(i==="web_search"){yield{id:a,type:"server_tool_call",name:"web_search",args:{query:ci(()=>{if(typeof r.input=="string")return r.input;if(ue(r.input)&&U(r.input.query))return r.input.query;if(U(r.partial_json)){let s=Dw(r.partial_json);if(s?.query)return s.query}return""})}};continue}else if(r.name==="code_execution"){yield{id:a,type:"server_tool_call",name:"code_execution",args:{code:ci(()=>{if(typeof r.input=="string")return r.input;if(ue(r.input)&&U(r.input.code))return r.input.code;if(U(r.partial_json)){let s=Dw(r.partial_json);if(s?.code)return s.code}return""})}};continue}}else if(K(r,"web_search_tool_result")&&U(r.tool_use_id)&&on(r.content)){let{content:i,tool_use_id:a}=r;yield{type:"server_tool_call_result",name:"web_search",toolCallId:a,status:"success",output:{urls:i.reduce((s,o)=>K(o,"web_search_result")?[...s,o.url]:s,[])}};continue}else if(K(r,"code_execution_tool_result")&&U(r.tool_use_id)&&ue(r.content)){yield{type:"server_tool_call_result",name:"code_execution",toolCallId:r.tool_use_id,status:"success",output:r.content};continue}else if(K(r,"mcp_tool_use")){yield{id:r.id,type:"server_tool_call",name:"mcp_tool_use",args:r.input};continue}else if(K(r,"mcp_tool_result")&&U(r.tool_use_id)&&ue(r.content)){yield{type:"server_tool_call_result",name:"mcp_tool_use",toolCallId:r.tool_use_id,status:"success",output:r.content};continue}else if(K(r,"container_upload")){yield{type:"server_tool_call",name:"container_upload",args:r.input};continue}else if(K(r,"search_result")){yield{id:r.id,type:"non_standard",value:r};continue}else if(K(r,"tool_result")){yield{id:r.id,type:"non_standard",value:r};continue}else{let i=Hk(r);if(i){yield i;continue}}yield{type:"non_standard",value:r}}}return Array.from(t())}var J4={translateContent:Uw,translateContentChunk:Uw};function W4(e){return typeof e?._getType=="function"&&typeof e.concat=="function"&&e._getType()==="ai"}function K4(e){return D_(e)?{type:e.type,mimeType:e.mime_type,url:e.url,metadata:e.metadata}:U_(e)?{type:e.type,mimeType:e.mime_type??"application/octet-stream",data:e.data,metadata:e.metadata}:qk(e)?{type:e.type,mimeType:e.mime_type,fileId:e.id,metadata:e.metadata}:e}function X4(e){return e.map(K4)}function Y4(e){return!!(K(e,"image_url")&&ue(e.image_url)||K(e,"input_audio")&&ue(e.input_audio)||K(e,"file")&&ue(e.file))}function Q4(e){if(K(e,"image_url")&&ue(e.image_url)&&U(e.image_url.url)){let t=Ao({dataUrl:e.image_url.url});return t?{type:"image",mimeType:t.mime_type,data:t.data}:{type:"image",url:e.image_url.url}}else{if(K(e,"input_audio")&&ue(e.input_audio)&&U(e.input_audio.data)&&U(e.input_audio.format))return{type:"audio",data:e.input_audio.data,mimeType:`audio/${e.input_audio.format}`};if(K(e,"file")&&ue(e.file)&&U(e.file.data)){let t=Ao({dataUrl:e.file.data});if(t)return{type:"file",data:t.data,mimeType:t.mime_type};if(U(e.file.file_id))return{type:"file",fileId:e.file.file_id}}}return e}function ej(e){let t=[];typeof e.content=="string"?e.content.length>0&&t.push({type:"text",text:e.content}):t.push(...F_(e.content));for(let n of e.tool_calls??[])t.push({type:"tool_call",id:n.id,name:n.name,args:n.args});return t}function tj(e){let t=[];typeof e.content=="string"?e.content.length>0&&t.push({type:"text",text:e.content}):t.push(...F_(e.content));for(let n of e.tool_calls??[])t.push({type:"tool_call",id:n.id,name:n.name,args:n.args});return t}function F_(e){let t=[];for(let n of e)Y4(n)?t.push(Q4(n)):t.push(n);return t}function nj(e){if(e.type==="url_citation"){let{url:t,title:n,start_index:r,end_index:i}=e;return{type:"citation",url:t,title:n,startIndex:r,endIndex:i}}if(e.type==="file_citation"){let{file_id:t,filename:n,index:r}=e;return{type:"citation",title:n,startIndex:r,endIndex:r,fileId:t}}return e}function Jk(e){function*t(){ue(e.additional_kwargs?.reasoning)&&on(e.additional_kwargs.reasoning.summary)&&(yield{type:"reasoning",reasoning:e.additional_kwargs.reasoning.summary.reduce((r,i)=>ue(i)&&U(i.text)?`${r}${i.text}`:r,"")});let n=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(let r of n)if(K(r,"text")){let{text:i,annotations:a,phase:s,extras:o,...c}=r,l=ue(o)?{...o}:{};U(s)&&(l.phase=s);let u=Object.keys(l).length>0?{extras:l}:{};Array.isArray(a)?yield{...c,...u,type:"text",text:String(i),annotations:a.map(nj)}:yield{...c,...u,type:"text",text:String(i)}}for(let r of e.tool_calls??[])yield{type:"tool_call",id:r.id,name:r.name,args:r.args};if(ue(e.additional_kwargs)&&on(e.additional_kwargs.tool_outputs))for(let r of e.additional_kwargs.tool_outputs){if(K(r,"web_search_call")){let i={};if(ue(r.action)&&U(r.action.query)&&(i.query=r.action.query),yield{id:r.id,type:"server_tool_call",name:"web_search",args:i},r.status==="completed"||r.status==="failed"){let a={};ue(r.action)&&(a.action=r.action),yield{type:"server_tool_call_result",toolCallId:U(r.id)?r.id:"",status:r.status==="completed"?"success":"error",output:a}}continue}else if(K(r,"file_search_call")){yield{id:r.id,type:"server_tool_call",name:"file_search",args:{queries:on(r.queries)?r.queries:[]}},(r.status==="completed"||r.status==="failed")&&(yield{type:"server_tool_call_result",toolCallId:U(r.id)?r.id:"",status:r.status==="completed"?"success":"error",output:on(r.results)?{results:r.results}:{}});continue}else if(K(r,"computer_call")){yield{type:"non_standard",value:r};continue}else if(K(r,"code_interpreter_call")){if(U(r.code)&&(yield{id:r.id,type:"server_tool_call",name:"code_interpreter",args:{code:r.code}}),on(r.outputs)){let i=ci(()=>{if(r.status!=="in_progress"){if(r.status==="completed")return 0;if(r.status==="incomplete")return 127;if(r.status!=="interpreting"&&r.status==="failed")return 1}});for(let a of r.outputs)if(K(a,"logs")){yield{type:"server_tool_call_result",toolCallId:r.id??"",status:"success",output:{type:"code_interpreter_output",returnCode:i??0,stderr:[0,void 0].includes(i)?void 0:String(a.logs),stdout:[0,void 0].includes(i)?String(a.logs):void 0}};continue}}continue}else if(K(r,"mcp_call")){yield{id:r.id,type:"server_tool_call",name:"mcp_call",args:r.input};continue}else if(K(r,"mcp_list_tools")){yield{id:r.id,type:"server_tool_call",name:"mcp_list_tools",args:r.input};continue}else if(K(r,"mcp_approval_request")){yield{type:"non_standard",value:r};continue}else if(K(r,"tool_search_call")){let i={};ue(r.arguments)&&Object.assign(i,r.arguments);let a={};U(r.execution)&&(a.execution=r.execution),U(r.status)&&(a.status=r.status),U(r.call_id)&&(a.call_id=r.call_id),yield{id:U(r.id)?r.id:"",type:"server_tool_call",name:"tool_search",args:i,...Object.keys(a).length>0?{extras:a}:{}};continue}else if(K(r,"tool_search_output")){let i={name:"tool_search"};U(r.execution)&&(i.execution=r.execution),yield{type:"server_tool_call_result",toolCallId:U(r.id)?r.id:"",status:r.status==="completed"?"success":r.status==="failed"?"error":"success",output:{tools:on(r.tools)?r.tools:[]},extras:i};continue}else if(K(r,"image_generation_call")){U(r.result)&&(yield{type:"image",mimeType:"image/png",data:r.result,id:U(r.id)?r.id:void 0,metadata:{status:U(r.status)?r.status:void 0}}),yield{type:"non_standard",value:r};continue}ue(r)&&(yield{type:"non_standard",value:r})}}return Array.from(t())}function rj(e){function*t(){yield*Jk(e);for(let n of e.tool_call_chunks??[])yield{type:"tool_call_chunk",id:n.id,name:n.name,args:n.args}}return Array.from(t())}var ij={translateContent:e=>typeof e.content=="string"?ej(e):Jk(e),translateContentChunk:e=>typeof e.content=="string"?tj(e):rj(e)};function Wk(e){return typeof e=="object"&&e!==null&&"type"in e&&"content"in e&&(typeof e.content=="string"||Array.isArray(e.content))}function aj(e,t="pretty"){return t==="pretty"?sj(e):JSON.stringify(e)}function sj(e){let t=[],n=` ${e.type.charAt(0).toUpperCase()+e.type.slice(1)} Message `,r=Math.floor((80-n.length)/2),i="=".repeat(r),a=n.length%2===0?i:`${i}=`;if(t.push(`${i}${n}${a}`),e.type==="ai"){let s=e;if(s.tool_calls&&s.tool_calls.length>0){t.push("Tool Calls:");for(let o of s.tool_calls){t.push(` ${o.name} (${o.id})`),t.push(` Call ID: ${o.id}`),t.push(" Args:");for(let[c,l]of Object.entries(o.args))t.push(` ${c}: ${typeof l=="object"?JSON.stringify(l):l}`)}}}if(e.type==="tool"){let s=e;s.name&&t.push(`Name: ${s.name}`)}return typeof e.content=="string"&&e.content.trim()&&(t.length>1&&t.push(""),t.push(e.content)),t.join(`
471
- `)}var Gh=Symbol.for("langchain.message");function Lw(e){return Array.isArray(e)?e:typeof e=="string"?e===""?[]:[{type:"text",text:e}]:e==null?[]:[e]}function Fr(e,t){if(typeof e=="string")return e===""?t:typeof t=="string"?e+t:Array.isArray(t)&&t.length===0?e:Array.isArray(t)&&t.some(n=>gr(n))?[{type:"text",source_type:"text",text:e},...t]:[{type:"text",text:e},...t];if(Array.isArray(t)){let n=Lw(e);return ts(n,t)??[...n,...t]}else return t===""?e:Array.isArray(e)&&e.some(n=>gr(n))?[...e,{type:"file",source_type:"text",text:t}]:[...Lw(e),{type:"text",text:t}]}function Kk(e,t){return e==="error"||t==="error"?"error":"success"}function oj(e,t){function n(r,i){if(typeof r!="object"||r===null||r===void 0)return r;if(i>=t)return Array.isArray(r)?"[Array]":"[Object]";if(Array.isArray(r))return r.map(s=>n(s,i+1));let a={};for(let s of Object.keys(r))a[s]=n(r[s],i+1);return a}return JSON.stringify(n(e,0),null,2)}var Xt=class extends An{lc_namespace=["langchain_core","messages"];lc_serializable=!0;get lc_aliases(){return{additional_kwargs:"additional_kwargs",response_metadata:"response_metadata"}}[Gh]=!0;id;name;content;additional_kwargs;response_metadata;_getType(){return this.type}getType(){return this._getType()}constructor(e){let t=typeof e=="string"||Array.isArray(e)?{content:e}:e;t.additional_kwargs||(t.additional_kwargs={}),t.response_metadata||(t.response_metadata={}),super(t),this.name=t.name,t.content===void 0&&t.contentBlocks!==void 0?(this.content=t.contentBlocks,this.response_metadata={output_version:"v1",...t.response_metadata}):t.content!==void 0?(this.content=t.content??[],this.response_metadata=t.response_metadata):(this.content=[],this.response_metadata=t.response_metadata),this.additional_kwargs=t.additional_kwargs,this.id=t.id}get text(){return typeof this.content=="string"?this.content:Array.isArray(this.content)?this.content.map(e=>typeof e=="string"?e:e.type==="text"?e.text:"").join(""):""}get contentBlocks(){let e=typeof this.content=="string"?[{type:"text",text:this.content}]:this.content;return[X4,F_,H4].reduce((t,n)=>n(t),e)}toDict(){return{type:this.getType(),data:this.toJSON().kwargs}}static lc_name(){return"BaseMessage"}get _printableFields(){return{id:this.id,content:this.content,name:this.name,additional_kwargs:this.additional_kwargs,response_metadata:this.response_metadata}}static isInstance(e){return typeof e=="object"&&e!==null&&Gh in e&&e[Gh]===!0&&Wk(e)}_updateId(e){this.id=e,this.lc_kwargs.id=e}get[Symbol.toStringTag](){return this.constructor.lc_name()}[Symbol.for("nodejs.util.inspect.custom")](e){if(e===null)return this;let t=oj(this._printableFields,Math.max(4,e));return`${this.constructor.lc_name()} ${t}`}toFormattedString(e="pretty"){return aj(this,e)}};function cj(e){return Array.isArray(e)&&e.every(t=>typeof t.index=="number")}var Xk=["index","created","timestamp"];function Ft(e,t,n){let r=n?.ignoreKeys??Xk;if(e==null&&t==null)return;if(e==null||t==null)return e??t;let i={...e};for(let[a,s]of Object.entries(t))if(i[a]==null)i[a]=s;else{if(s==null)continue;if(typeof i[a]!=typeof s||Array.isArray(i[a])!==Array.isArray(s))throw new Error(`field[${a}] already exists in the message chunk, but with a different type.`);if(typeof i[a]=="string"){if(a==="type")continue;if(["id","name","output_version","model_provider"].includes(a))s&&(i[a]=s);else{if(r.includes(a))continue;i[a]+=s}}else if(typeof i[a]=="number"){if(r.includes(a))continue;i[a]=i[a]+s}else if(typeof i[a]=="object"&&!Array.isArray(i[a]))i[a]=Ft(i[a],s,n);else if(Array.isArray(i[a]))i[a]=ts(i[a],s,n);else{if(i[a]===s)continue;console.warn(`field[${a}] already exists in this message chunk and value has unsupported type.`)}}return i}function lj(e){return typeof e=="number"||typeof e=="string"}function zw(e){return typeof e!="object"||e===null||!("index"in e)?!1:lj(e.index)}function Fw(e){if(typeof e!="object"||e===null||!("id"in e))return!1;let t=e.id;return t!=null&&t!==""}function uj(e,t){let n=zw(t),r=Fw(t);return!n&&!r?-1:e.findIndex(i=>{let a=zw(i),s=Fw(i);return n&&a?i.index!==t.index?!1:s&&r?i.id===t.id:!0:!n&&!a&&r&&s?i.id===t.id:!1})}function ts(e,t,n){if(!(e==null&&t==null)){if(e==null||t==null)return e||t;{let r=[...e];for(let i of t){let a=uj(r,i);if(a!==-1)r[a]=Ft(r[a],i,n);else{if(typeof i=="object"&&i!==null&&"text"in i&&i.text==="")continue;r.push(i)}}return r}}}function Yk(e,t,n){if(!(e==null&&t==null)){if(e==null||t==null)return e??t;if(typeof e!=typeof t)throw new Error(`Cannot merge objects of different types.
472
- Left ${typeof e}
473
- Right ${typeof t}`);if(typeof e=="string"&&typeof t=="string")return e+t;if(Array.isArray(e)&&Array.isArray(t))return ts(e,t,n);if(typeof e=="object"&&typeof t=="object")return Ft(e,t,n);if(e===t)return e;throw new Error(`Can not merge objects of different types.
474
- Left ${e}
475
- Right ${t}`)}}var Oi=class Qk extends Xt{static isInstance(t){if(!super.isInstance(t))return!1;let n=Object.getPrototypeOf(t);for(;n!==null;){if(n===Qk.prototype)return!0;n=Object.getPrototypeOf(n)}return!1}};function ex(e){return typeof e.role=="string"}function Rt(e){return typeof e?._getType=="function"}function Co(e){return Oi.isInstance(e)}var dj=Q({ToolMessage:()=>Cn,ToolMessageChunk:()=>hc,defaultToolCallParser:()=>Z_,isDirectToolOutput:()=>B_,isToolMessage:()=>V_,isToolMessageChunk:()=>tx});function B_(e){return e!=null&&typeof e=="object"&&"lc_direct_tool_output"in e&&e.lc_direct_tool_output===!0}var Cn=class extends Xt{static lc_name(){return"ToolMessage"}get lc_aliases(){return{tool_call_id:"tool_call_id"}}lc_direct_tool_output=!0;type="tool";status;tool_call_id;metadata;artifact;constructor(e,t,n){let r=typeof e=="string"||Array.isArray(e)?{content:e,name:n,tool_call_id:t}:e;super(r),this.tool_call_id=r.tool_call_id,this.artifact=r.artifact,this.status=r.status,this.metadata=r.metadata}static isInstance(e){return super.isInstance(e)&&e.type==="tool"}get _printableFields(){return{...super._printableFields,tool_call_id:this.tool_call_id,artifact:this.artifact}}},hc=class extends Oi{type="tool";tool_call_id;status;artifact;constructor(e){super(e),this.tool_call_id=e.tool_call_id,this.artifact=e.artifact,this.status=e.status}static lc_name(){return"ToolMessageChunk"}concat(e){let t=this.constructor;return new t({content:Fr(this.content,e.content),additional_kwargs:Ft(this.additional_kwargs,e.additional_kwargs),response_metadata:Ft(this.response_metadata,e.response_metadata),artifact:Yk(this.artifact,e.artifact),tool_call_id:this.tool_call_id,id:this.id??e.id,status:Kk(this.status,e.status)})}get _printableFields(){return{...super._printableFields,tool_call_id:this.tool_call_id,artifact:this.artifact}}};function Z_(e){let t=[],n=[];for(let r of e)if(r.function){let i=r.function.name;try{let a=JSON.parse(r.function.arguments);t.push({name:i||"",args:a||{},id:r.id})}catch{n.push({name:i,args:r.function.arguments,id:r.id,error:"Malformed args."})}}else continue;return[t,n]}function V_(e){return typeof e=="object"&&e!==null&&"getType"in e&&typeof e.getType=="function"&&e.getType()==="tool"}function tx(e){return e._getType()==="tool"}function vo(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="tool_call")}function fj(e){return!!(e&&typeof e=="object"&&"toolCall"in e&&e.toolCall!=null&&typeof e.toolCall=="object"&&"id"in e.toolCall&&typeof e.toolCall.id=="string")}var yu=class extends Error{output;constructor(e,t){super(e),this.output=t}};function vu(e,t=ns){e=e.trim();let n=e.indexOf("```");if(n===-1)return t(e);let r=e.substring(n+3);r.startsWith(`json
476
- `)?r=r.substring(5):r.startsWith("json")?r=r.substring(4):r.startsWith(`
477
- `)&&(r=r.substring(1));let i=r.indexOf("```"),a=r;return i!==-1&&(a=r.substring(0,i)),t(a.trim())}function hj(e){try{return JSON.parse(e)}catch{}let t=e.trim();if(t.length===0)throw new Error("Unexpected end of JSON input");let n=0;function r(){for(;n<t.length&&/\s/.test(t[n]);)n+=1}function i(){if(t[n]!=='"')throw new Error(`Expected '"' at position ${n}, got '${t[n]}'`);n+=1;let u="",d=!1;for(;n<t.length;){let f=t[n];if(d){if(f==="n")u+=`
478
- `;else if(f==="t")u+=" ";else if(f==="r")u+="\r";else if(f==="\\")u+="\\";else if(f==='"')u+='"';else if(f==="b")u+="\b";else if(f==="f")u+="\f";else if(f==="/")u+="/";else if(f==="u"){let h=t.substring(n+1,n+5);if(/^[0-9A-Fa-f]{0,4}$/.test(h))h.length===4?u+=String.fromCharCode(Number.parseInt(h,16)):u+=`u${h}`,n+=h.length;else throw new Error(`Invalid unicode escape sequence '\\u${h}' at position ${n}`)}else throw new Error(`Invalid escape sequence '\\${f}' at position ${n}`);d=!1}else if(f==="\\")d=!0;else{if(f==='"')return n+=1,u;u+=f}n+=1}return d&&(u+="\\"),u}function a(){let u=n,d="";if(t[n]==="-"&&(d+="-",n+=1),n<t.length&&t[n]==="0"&&(d+="0",n+=1,t[n]>="0"&&t[n]<="9"))throw new Error(`Invalid number at position ${u}`);if(n<t.length&&t[n]>="1"&&t[n]<="9")for(;n<t.length&&t[n]>="0"&&t[n]<="9";)d+=t[n],n+=1;if(n<t.length&&t[n]===".")for(d+=".",n+=1;n<t.length&&t[n]>="0"&&t[n]<="9";)d+=t[n],n+=1;if(n<t.length&&(t[n]==="e"||t[n]==="E"))for(d+=t[n],n+=1,n<t.length&&(t[n]==="+"||t[n]==="-")&&(d+=t[n],n+=1);n<t.length&&t[n]>="0"&&t[n]<="9";)d+=t[n],n+=1;if(d==="-")return-0;let f=Number.parseFloat(d);if(Number.isNaN(f))throw n=u,new Error(`Invalid number '${d}' at position ${u}`);return f}function s(){if(r(),n>=t.length)throw new Error(`Unexpected end of input at position ${n}`);let u=t[n];if(u==="{")return c();if(u==="[")return o();if(u==='"')return i();if("null".startsWith(t.substring(n,n+4)))return n+=Math.min(4,t.length-n),null;if("true".startsWith(t.substring(n,n+4)))return n+=Math.min(4,t.length-n),!0;if("false".startsWith(t.substring(n,n+5)))return n+=Math.min(5,t.length-n),!1;if(u==="-"||u>="0"&&u<="9")return a();throw new Error(`Unexpected character '${u}' at position ${n}`)}function o(){if(t[n]!=="[")throw new Error(`Expected '[' at position ${n}, got '${t[n]}'`);let u=[];if(n+=1,r(),n>=t.length)return u;if(t[n]==="]")return n+=1,u;for(;n<t.length;){if(r(),n>=t.length||(u.push(s()),r(),n>=t.length))return u;if(t[n]==="]")return n+=1,u;if(t[n]===","){n+=1;continue}throw new Error(`Expected ',' or ']' at position ${n}, got '${t[n]}'`)}return u}function c(){if(t[n]!=="{")throw new Error(`Expected '{' at position ${n}, got '${t[n]}'`);let u={};if(n+=1,r(),n>=t.length)return u;if(t[n]==="}")return n+=1,u;for(;n<t.length;){if(r(),n>=t.length)return u;let d=i();if(r(),n>=t.length)return u;if(t[n]!==":")throw new Error(`Expected ':' at position ${n}, got '${t[n]}'`);if(n+=1,r(),n>=t.length||(u[d]=s(),r(),n>=t.length))return u;if(t[n]==="}")return n+=1,u;if(t[n]===","){n+=1;continue}throw new Error(`Expected ',' or '}' at position ${n}, got '${t[n]}'`)}return u}let l=s();if(r(),n<t.length)throw new Error(`Unexpected character '${t[n]}' at position ${n}`);return l}function ns(e){try{return typeof e>"u"?null:hj(e)}catch{return null}}function q_(e){switch(e){case"csv":return"text/csv";case"doc":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"docx":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"html":return"text/html";case"md":return"text/markdown";case"pdf":return"application/pdf";case"txt":return"text/plain";case"xls":return"application/vnd.ms-excel";case"xlsx":return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";case"gif":return"image/gif";case"jpeg":return"image/jpeg";case"jpg":return"image/jpeg";case"png":return"image/png";case"webp":return"image/webp";case"flv":return"video/flv";case"mkv":return"video/mkv";case"mov":return"video/mov";case"mp4":return"video/mp4";case"mpeg":return"video/mpeg";case"mpg":return"video/mpg";case"three_gp":return"video/three_gp";case"webm":return"video/webm";case"wmv":return"video/wmv";default:return"application/octet-stream"}}function pj(e){if(ue(e.document)&&ue(e.document.source)){let t=q_(ue(e.document)&&U(e.document.format)?e.document.format:"");if(ue(e.document.source)){if(ue(e.document.source.s3Location)&&U(e.document.source.s3Location.uri))return{type:"file",mimeType:t,fileId:e.document.source.s3Location.uri};if(z_(e.document.source.bytes))return{type:"file",mimeType:t,data:e.document.source.bytes};if(U(e.document.source.text))return{type:"file",mimeType:t,data:Buffer.from(e.document.source.text).toString("base64")};if(on(e.document.source.content))return{type:"file",mimeType:t,data:e.document.source.content.reduce((n,r)=>ue(r)&&U(r.text)?n+r.text:n,"")}}}return{type:"non_standard",value:e}}function mj(e){if(K(e,"image")&&ue(e.image)){let t=q_(ue(e.image)&&U(e.image.format)?e.image.format:"");if(ue(e.image.source)){if(ue(e.image.source.s3Location)&&U(e.image.source.s3Location.uri))return{type:"image",mimeType:t,fileId:e.image.source.s3Location.uri};if(z_(e.image.source.bytes))return{type:"image",mimeType:t,data:e.image.source.bytes}}}return{type:"non_standard",value:e}}function gj(e){if(K(e,"video")&&ue(e.video)){let t=q_(ue(e.video)&&U(e.video.format)?e.video.format:"");if(ue(e.video.source)){if(ue(e.video.source.s3Location)&&U(e.video.source.s3Location.uri))return{type:"video",mimeType:t,fileId:e.video.source.s3Location.uri};if(z_(e.video.source.bytes))return{type:"video",mimeType:t,data:e.video.source.bytes}}}return{type:"non_standard",value:e}}function Bw(e){function*t(){let n=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(let r of n){if(K(r,"cache_point")){yield{type:"non_standard",value:r};continue}else if(K(r,"citations_content")&&ue(r.citationsContent)){yield{type:"text",text:on(r.citationsContent.content)?r.citationsContent.content.reduce((i,a)=>ue(a)&&U(a.text)?i+a.text:i,""):"",annotations:on(r.citationsContent.citations)?r.citationsContent.citations.reduce((i,a)=>{if(ue(a)){let s=on(a.sourceContent)?a.sourceContent.reduce((c,l)=>ue(l)&&U(l.text)?c+l.text:c,""):"",o=ci(()=>{if(ue(a.location)){let c=a.location.documentChar||a.location.documentPage||a.location.documentChunk;if(ue(c))return{source:Bn(c.documentIndex)?c.documentIndex.toString():void 0,startIndex:Bn(c.start)?c.start:void 0,endIndex:Bn(c.end)?c.end:void 0}}return{}});i.push({type:"citation",citedText:s,...o})}return i},[]):[]};continue}else if(K(r,"document")&&ue(r.document)){yield pj(r);continue}else if(K(r,"guard_content")){yield{type:"non_standard",value:r};continue}else if(K(r,"image")&&ue(r.image)){yield mj(r);continue}else if(K(r,"reasoning_content")&&U(r.reasoningText)){yield{type:"reasoning",reasoning:r.reasoningText};continue}else if(K(r,"text")&&U(r.text)){yield{type:"text",text:r.text};continue}else if(K(r,"tool_result")){yield{type:"non_standard",value:r};continue}else{if(K(r,"tool_call"))continue;if(K(r,"video")&&ue(r.video)){yield gj(r);continue}}yield{type:"non_standard",value:r}}}return Array.from(t())}var _j={translateContent:Bw,translateContentChunk:Bw};function Zw(e){let t=[],n=e.additional_kwargs?.reasoning_content;if(U(n)&&n.length>0&&t.push({type:"reasoning",reasoning:n}),typeof e.content=="string")e.content.length>0&&t.push({type:"text",text:e.content});else for(let r of e.content)typeof r=="object"&&"type"in r&&r.type==="text"&&"text"in r&&U(r.text)&&t.push({type:"text",text:r.text});for(let r of e.tool_calls??[])t.push({type:"tool_call",id:r.id,name:r.name,args:r.args});return t}var yj={translateContent:Zw,translateContentChunk:Zw};function Vw(e){function*t(){let n=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(let r of n){if(K(r,"text")&&U(r.text)){yield{type:"text",text:r.text};continue}else if(K(r,"thinking")&&U(r.thinking)){yield{type:"reasoning",reasoning:r.thinking,...r.signature?{signature:r.signature}:{}};continue}else if(K(r,"inlineData")&&ue(r.inlineData)&&U(r.inlineData.mimeType)&&U(r.inlineData.data)){yield{type:"file",mimeType:r.inlineData.mimeType,data:r.inlineData.data};continue}else if(K(r,"functionCall")&&ue(r.functionCall)&&U(r.functionCall.name)&&ue(r.functionCall.args)){yield{type:"tool_call",id:e.id,name:r.functionCall.name,args:r.functionCall.args};continue}else if(K(r,"functionResponse")){yield{type:"non_standard",value:r};continue}else if(K(r,"fileData")&&ue(r.fileData)&&U(r.fileData.mimeType)&&U(r.fileData.fileUri)){yield{type:"file",mimeType:r.fileData.mimeType,fileId:r.fileData.fileUri};continue}else if(K(r,"executableCode")){yield{type:"non_standard",value:r};continue}else if(K(r,"codeExecutionResult")){yield{type:"non_standard",value:r};continue}yield{type:"non_standard",value:r}}}return Array.from(t())}var vj={translateContent:Vw,translateContentChunk:Vw};function qw(e){function*t(){let n=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(let r of n){if(K(r,"reasoning")&&U(r.reasoning)){let i=ci(()=>{let a=n.indexOf(r);if(on(e.additional_kwargs?.signatures)&&a>=0)return e.additional_kwargs.signatures.at(a)});U(i)?yield{type:"reasoning",reasoning:r.reasoning,signature:i}:yield{type:"reasoning",reasoning:r.reasoning};continue}else if(K(r,"thinking")&&U(r.thinking)){yield{type:"reasoning",reasoning:r.thinking,...r.signature?{signature:r.signature}:{}};continue}else if(K(r,"text")&&U(r.text)){yield{type:"text",text:r.text};continue}else if(K(r,"image_url")){if(U(r.image_url))if(r.image_url.startsWith("data:")){let i=r.image_url.match(/^data:([^;]+);base64,(.+)$/);i?yield{type:"image",data:i[2],mimeType:i[1]}:yield{type:"image",url:r.image_url}}else yield{type:"image",url:r.image_url};continue}else if(K(r,"media")&&U(r.mimeType)&&U(r.data)){yield{type:"file",mimeType:r.mimeType,data:r.data};continue}yield{type:"non_standard",value:r}}}return Array.from(t())}var bj={translateContent:qw,translateContentChunk:qw};function Gw(e){let t=[],n=e.additional_kwargs?.reasoning;if(U(n)&&n.length>0&&t.push({type:"reasoning",reasoning:n}),typeof e.content=="string"){let r=e.content,i=r.match(/<think>([\s\S]*?)<\/think>/);if(i){let a=i[1].trim();a.length>0&&t.push({type:"reasoning",reasoning:a}),r=r.replace(/<think>[\s\S]*?<\/think>/,"").trim()}r.length>0&&t.push({type:"text",text:r})}else for(let r of e.content)if(typeof r=="object"&&"type"in r&&r.type==="text"&&"text"in r&&U(r.text)){let i=r.text,a=i.match(/<think>([\s\S]*?)<\/think>/);if(a){let s=a[1].trim();s.length>0&&t.push({type:"reasoning",reasoning:s}),i=i.replace(/<think>[\s\S]*?<\/think>/,"").trim()}i.length>0&&t.push({type:"text",text:i})}for(let r of e.tool_calls??[])t.push({type:"tool_call",id:r.id,name:r.name,args:r.args});return t}var wj={translateContent:Gw,translateContentChunk:Gw};function Hw(e){let t=[],n=e.additional_kwargs?.reasoning_content;if(U(n)&&n.length>0&&t.push({type:"reasoning",reasoning:n}),typeof e.content=="string")e.content.length>0&&t.push({type:"text",text:e.content});else for(let r of e.content)typeof r=="object"&&"type"in r&&r.type==="text"&&"text"in r&&U(r.text)&&t.push({type:"text",text:r.text});for(let r of e.tool_calls??[])t.push({type:"tool_call",id:r.id,name:r.name,args:r.args});return t}var $j={translateContent:Hw,translateContentChunk:Hw};function Jw(e){let t=[];if(ue(e.additional_kwargs?.reasoning)){let r=e.additional_kwargs.reasoning;if(on(r.summary)){let i=r.summary.reduce((a,s)=>ue(s)&&U(s.text)?`${a}${s.text}`:a,"");i.length>0&&t.push({type:"reasoning",reasoning:i})}}let n=e.additional_kwargs?.reasoning_content;if(U(n)&&n.length>0&&t.push({type:"reasoning",reasoning:n}),typeof e.content=="string")e.content.length>0&&t.push({type:"text",text:e.content});else for(let r of e.content)typeof r=="object"&&"type"in r&&r.type==="text"&&"text"in r&&U(r.text)&&t.push({type:"text",text:r.text});for(let r of e.tool_calls??[])t.push({type:"tool_call",id:r.id,name:r.name,args:r.args});return t}var Sj={translateContent:Jw,translateContentChunk:Jw};function Ww(e){function*t(){let n=ci(()=>{if(typeof e.content=="string")return e.additional_kwargs.originalTextContentBlock?[{...e.additional_kwargs.originalTextContentBlock,type:"text"}]:[{type:"text",text:e.content}];{let r=e.additional_kwargs?.originalTextContentBlock;if(r?.thoughtSignature&&!e.content.some(i=>"thoughtSignature"in i)){let i=[...e.content];for(let a=i.length-1;a>=0;a--){let s=i[a];if(s.type==="text"&&!s.thought)return s.thoughtSignature=r.thoughtSignature,i}}return e.content}});for(let r of n){let i=ci(()=>K(r,"text")&&U(r.text)?{type:"text",text:r.text}:K(r,"inlineData")&&ue(r.inlineData)&&U(r.inlineData.mimeType)&&U(r.inlineData.data)?{type:"file",mimeType:r.inlineData.mimeType,data:r.inlineData.data}:K(r,"functionCall")&&ue(r.functionCall)&&U(r.functionCall.name)&&ue(r.functionCall.args)?{type:"tool_call",id:e.id,name:r.functionCall.name,args:r.functionCall.args}:K(r,"functionResponse")?{type:"non_standard",value:r}:K(r,"fileData")&&ue(r.fileData)&&U(r.fileData.mimeType)&&U(r.fileData.fileUri)?{type:"file",mimeType:r.fileData.mimeType,fileId:r.fileData.fileUri}:K(r,"executableCode")?{type:"non_standard",value:r}:K(r,"codeExecutionResult")?{type:"non_standard",value:r}:{type:"non_standard",value:r}),a=ci(()=>"thought"in r&&r.thought?{type:"reasoning",reasoning:i.type==="text"?i.text:"",reasoningContentBlock:i}:i),s={thought:r.thought,thoughtSignature:r.thoughtSignature,partMetadata:r.partMetadata,...a};for(let o in s)s[o]===void 0&&delete s[o];yield s}}return Array.from(t())}var kj={translateContent:Ww,translateContentChunk:Ww};globalThis.lc_block_translators_registry??=new Map([["anthropic",J4],["bedrock-converse",_j],["deepseek",yj],["google",kj],["google-genai",vj],["google-vertexai",bj],["groq",wj],["ollama",$j],["openai",ij],["xai",Sj]]);function nx(e){return globalThis.lc_block_translators_registry.get(e)}function rx(e,t){return Ft(e,t)??{}}function ix(e,t){let n={};return(e?.audio!==void 0||t?.audio!==void 0)&&(n.audio=(e?.audio??0)+(t?.audio??0)),(e?.image!==void 0||t?.image!==void 0)&&(n.image=(e?.image??0)+(t?.image??0)),(e?.video!==void 0||t?.video!==void 0)&&(n.video=(e?.video??0)+(t?.video??0)),(e?.document!==void 0||t?.document!==void 0)&&(n.document=(e?.document??0)+(t?.document??0)),(e?.text!==void 0||t?.text!==void 0)&&(n.text=(e?.text??0)+(t?.text??0)),n}function xj(e,t){let n={...ix(e,t)};return(e?.cache_read!==void 0||t?.cache_read!==void 0)&&(n.cache_read=(e?.cache_read??0)+(t?.cache_read??0)),(e?.cache_creation!==void 0||t?.cache_creation!==void 0)&&(n.cache_creation=(e?.cache_creation??0)+(t?.cache_creation??0)),n}function Ij(e,t){let n={...ix(e,t)};return(e?.reasoning!==void 0||t?.reasoning!==void 0)&&(n.reasoning=(e?.reasoning??0)+(t?.reasoning??0)),n}function G_(e,t){return{input_tokens:(e?.input_tokens??0)+(t?.input_tokens??0),output_tokens:(e?.output_tokens??0)+(t?.output_tokens??0),total_tokens:(e?.total_tokens??0)+(t?.total_tokens??0),input_token_details:xj(e?.input_token_details,t?.input_token_details),output_token_details:Ij(e?.output_token_details,t?.output_token_details)}}var Ke=class extends Xt{type="ai";tool_calls=[];invalid_tool_calls=[];usage_metadata;get lc_aliases(){return{...super.lc_aliases,tool_calls:"tool_calls",invalid_tool_calls:"invalid_tool_calls",usage_metadata:"usage_metadata"}}constructor(e){let t;if(typeof e=="string"||Array.isArray(e))t={content:e,tool_calls:[],invalid_tool_calls:[],additional_kwargs:{}};else{t=e;let n=t.additional_kwargs?.tool_calls,r=t.tool_calls;n!=null&&n.length>0&&(r===void 0||r.length===0)&&console.warn(["New LangChain packages are available that more efficiently handle",`tool calling.
479
-
480
- Please upgrade your packages to versions that set`,"message tool calls. e.g., `pnpm install @langchain/anthropic`,","pnpm install @langchain/openai`, etc."].join(" "));try{if(n!=null&&r===void 0){let[i,a]=Z_(n);t.tool_calls=i??[],t.invalid_tool_calls=a??[]}else t.tool_calls=t.tool_calls??[],t.invalid_tool_calls=t.invalid_tool_calls??[]}catch{t.tool_calls=[],t.invalid_tool_calls=[]}if(t.response_metadata!==void 0&&"output_version"in t.response_metadata&&t.response_metadata.output_version==="v1"&&(t.contentBlocks=t.content,t.content=void 0),t.contentBlocks!==void 0){t.tool_calls&&t.contentBlocks.push(...t.tool_calls.map(a=>({type:"tool_call",id:a.id,name:a.name,args:a.args})));let i=t.contentBlocks.filter(a=>a.type==="tool_call").filter(a=>!t.tool_calls?.some(s=>s.id===a.id&&s.name===a.name));i.length>0&&(t.tool_calls=i.map(a=>({type:"tool_call",id:a.id,name:a.name,args:a.args})))}}super(t),typeof t!="string"&&(this.tool_calls=t.tool_calls??this.tool_calls,this.invalid_tool_calls=t.invalid_tool_calls??this.invalid_tool_calls),this.usage_metadata=t.usage_metadata}static lc_name(){return"AIMessage"}get contentBlocks(){if(this.response_metadata&&"output_version"in this.response_metadata&&this.response_metadata.output_version==="v1")return this.content;if(this.response_metadata&&"model_provider"in this.response_metadata&&typeof this.response_metadata.model_provider=="string"){let t=nx(this.response_metadata.model_provider);if(t)return t.translateContent(this)}let e=super.contentBlocks;if(this.tool_calls){let t=this.tool_calls.filter(n=>!e.some(r=>r.id===n.id&&r.name===n.name));e.push(...t.map(n=>({type:"tool_call",id:n.id,name:n.name,args:n.args})))}return e}get _printableFields(){return{...super._printableFields,tool_calls:this.tool_calls,invalid_tool_calls:this.invalid_tool_calls,usage_metadata:this.usage_metadata}}static isInstance(e){return super.isInstance(e)&&e.type==="ai"}};function hf(e){return e._getType()==="ai"}function zm(e){return e._getType()==="ai"}var un=class extends Oi{type="ai";tool_calls=[];invalid_tool_calls=[];tool_call_chunks=[];usage_metadata;constructor(e){let t;if(typeof e=="string"||Array.isArray(e))t={content:e,tool_calls:[],invalid_tool_calls:[],tool_call_chunks:[]};else if(e.tool_call_chunks===void 0||e.tool_call_chunks.length===0)t={...e,tool_calls:e.tool_calls??[],invalid_tool_calls:[],tool_call_chunks:[],usage_metadata:e.usage_metadata!==void 0?e.usage_metadata:void 0};else{let n=ox(e.tool_call_chunks??[]);t={...e,tool_call_chunks:n.tool_call_chunks,tool_calls:n.tool_calls,invalid_tool_calls:n.invalid_tool_calls,usage_metadata:e.usage_metadata!==void 0?e.usage_metadata:void 0}}super(t),this.tool_call_chunks=t.tool_call_chunks??this.tool_call_chunks,this.tool_calls=t.tool_calls??this.tool_calls,this.invalid_tool_calls=t.invalid_tool_calls??this.invalid_tool_calls,this.usage_metadata=t.usage_metadata}get lc_aliases(){return{...super.lc_aliases,tool_calls:"tool_calls",invalid_tool_calls:"invalid_tool_calls",tool_call_chunks:"tool_call_chunks",usage_metadata:"usage_metadata"}}static lc_name(){return"AIMessageChunk"}get contentBlocks(){if(this.response_metadata&&"output_version"in this.response_metadata&&this.response_metadata.output_version==="v1")return this.content;if(this.response_metadata&&"model_provider"in this.response_metadata&&typeof this.response_metadata.model_provider=="string"){let t=nx(this.response_metadata.model_provider);if(t)return t.translateContent(this)}let e=super.contentBlocks;if(this.tool_calls&&typeof this.content!="string"){let t=this.content.filter(n=>n.type==="tool_call").map(n=>n.id);for(let n of this.tool_calls)n.id&&!t.includes(n.id)&&e.push({...n,type:"tool_call",id:n.id,name:n.name,args:n.args})}return e}get _printableFields(){return{...super._printableFields,tool_calls:this.tool_calls,tool_call_chunks:this.tool_call_chunks,invalid_tool_calls:this.invalid_tool_calls,usage_metadata:this.usage_metadata}}concat(e){let t={content:Fr(this.content,e.content),additional_kwargs:Ft(this.additional_kwargs,e.additional_kwargs),response_metadata:rx(this.response_metadata,e.response_metadata),tool_call_chunks:[],tool_calls:[],id:this.id??e.id};if(this.tool_call_chunks!==void 0||e.tool_call_chunks!==void 0){let r=ts(this.tool_call_chunks,e.tool_call_chunks);r!==void 0&&r.length>0&&(t.tool_call_chunks=r)}if(this.tool_calls!==void 0||e.tool_calls!==void 0){let r=ts(this.tool_calls,e.tool_calls);r!==void 0&&r.length>0&&(t.tool_calls=r)}(this.usage_metadata!==void 0||e.usage_metadata!==void 0)&&(t.usage_metadata=G_(this.usage_metadata,e.usage_metadata));let n=this.constructor;return new n(t)}static isInstance(e){return super.isInstance(e)&&e.type==="ai"}},Hr=class ax extends Xt{static lc_name(){return"ChatMessage"}type="generic";role;static _chatMessageClass(){return ax}constructor(t,n){(typeof t=="string"||Array.isArray(t))&&(t={content:t,role:n}),super(t),this.role=t.role}static isInstance(t){return super.isInstance(t)&&t.type==="generic"}get _printableFields(){return{...super._printableFields,role:this.role}}},pc=class extends Oi{static lc_name(){return"ChatMessageChunk"}type="generic";role;constructor(e,t){(typeof e=="string"||Array.isArray(e))&&(e={content:e,role:t}),super(e),this.role=e.role}concat(e){let t=this.constructor;return new t({content:Fr(this.content,e.content),additional_kwargs:Ft(this.additional_kwargs,e.additional_kwargs),response_metadata:Ft(this.response_metadata,e.response_metadata),role:this.role,id:this.id??e.id})}static isInstance(e){return super.isInstance(e)&&e.type==="generic"}get _printableFields(){return{...super._printableFields,role:this.role}}};function Ej(e){return e._getType()==="generic"}function Tj(e){return e._getType()==="generic"}var pf=class extends Xt{static lc_name(){return"FunctionMessage"}type="function";name;constructor(e){super(e),this.name=e.name}},mc=class extends Oi{static lc_name(){return"FunctionMessageChunk"}type="function";concat(e){let t=this.constructor;return new t({content:Fr(this.content,e.content),additional_kwargs:Ft(this.additional_kwargs,e.additional_kwargs),response_metadata:Ft(this.response_metadata,e.response_metadata),name:this.name??"",id:this.id??e.id})}};function Oj(e){return e._getType()==="function"}function Aj(e){return e._getType()==="function"}var Vt=class extends Xt{static lc_name(){return"HumanMessage"}type="human";constructor(e){super(e)}static isInstance(e){return super.isInstance(e)&&e.type==="human"}},gc=class extends Oi{static lc_name(){return"HumanMessageChunk"}type="human";constructor(e){super(e)}concat(e){let t=this.constructor;return new t({content:Fr(this.content,e.content),additional_kwargs:Ft(this.additional_kwargs,e.additional_kwargs),response_metadata:Ft(this.response_metadata,e.response_metadata),id:this.id??e.id})}static isInstance(e){return super.isInstance(e)&&e.type==="human"}};function Cj(e){return e.getType()==="human"}function Nj(e){return e.getType()==="human"}var Xi=class extends Xt{type="remove";id;constructor(e){super({...e,content:[]}),this.id=e.id}get _printableFields(){return{...super._printableFields,id:this.id}}static isInstance(e){return super.isInstance(e)&&e.type==="remove"}},_r=class Gl extends Xt{static lc_name(){return"SystemMessage"}type="system";constructor(t){super(t)}concat(t){if(typeof t=="string")return new Gl({content:Fr(this.content,t),additional_kwargs:this.additional_kwargs,response_metadata:this.response_metadata,id:this.id,name:this.name});if(Gl.isInstance(t))return new Gl({content:Fr(this.content,t.content),additional_kwargs:{...this.additional_kwargs,...t.additional_kwargs},response_metadata:{...this.response_metadata,...t.response_metadata},id:this.id??t.id,name:this.name??t.name});throw new Error("Unexpected chunk type for system message")}static isInstance(t){return super.isInstance(t)&&t.type==="system"}},mi=class extends Oi{static lc_name(){return"SystemMessageChunk"}type="system";constructor(e){super(e)}concat(e){let t=this.constructor;return new t({content:Fr(this.content,e.content),additional_kwargs:Ft(this.additional_kwargs,e.additional_kwargs),response_metadata:Ft(this.response_metadata,e.response_metadata),id:this.id??e.id})}static isInstance(e){return super.isInstance(e)&&e.type==="system"}};function Pj(e){return e._getType()==="system"}function Rj(e){return e._getType()==="system"}var sx=e=>e();function jj(e){return vo(e)?e:typeof e.id=="string"&&e.type==="function"&&typeof e.function=="object"&&e.function!==null&&"arguments"in e.function&&typeof e.function.arguments=="string"&&"name"in e.function&&typeof e.function.name=="string"?{id:e.id,args:JSON.parse(e.function.arguments),name:e.function.name,type:"tool_call"}:e}function Mj(e){return typeof e=="object"&&e!=null&&e.lc===1&&Array.isArray(e.id)&&e.kwargs!=null&&typeof e.kwargs=="object"}function Hh(e){let t,n;if(Mj(e)){let r=e.id.at(-1);r==="HumanMessage"||r==="HumanMessageChunk"?t="user":r==="AIMessage"||r==="AIMessageChunk"?t="assistant":r==="SystemMessage"||r==="SystemMessageChunk"?t="system":r==="FunctionMessage"||r==="FunctionMessageChunk"?t="function":r==="ToolMessage"||r==="ToolMessageChunk"?t="tool":t="unknown",n=e.kwargs}else{let{type:r,...i}=e;t=r,n=i}if(t==="human"||t==="user")return new Vt(n);if(t==="ai"||t==="assistant"){let{tool_calls:r,...i}=n;if(!Array.isArray(r))return new Ke(n);let a=r.map(jj);return new Ke({...i,tool_calls:a})}else{if(t==="system")return new _r(n);if(t==="developer")return new _r({...n,additional_kwargs:{...n.additional_kwargs,__openai_role__:"developer"}});if(t==="tool"&&"tool_call_id"in n)return new Cn({...n,content:n.content,tool_call_id:n.tool_call_id,name:n.name});if(t==="remove"&&"id"in n&&typeof n.id=="string")return new Xi({...n,id:n.id});throw fc(new Error(`Unable to coerce message from array: only human, AI, system, developer, or tool message coercion is currently supported.
481
-
482
- Received: ${JSON.stringify(e,null,2)}`),"MESSAGE_COERCION_FAILURE")}}function pr(e){if(typeof e=="string")return new Vt(e);if(Rt(e))return e;if(Array.isArray(e)){let[t,n]=e;return Hh({type:t,content:n})}else if(ex(e)){let{role:t,...n}=e;return Hh({...n,type:t})}else return Hh(e)}function Dj(e){if(typeof e=="string")return e;switch(e.type){case"text":return e.text??"";case"text-plain":return e.text??"[text-plain file]";case"image":case"image_url":return"[image]";case"audio":case"input_audio":return"[audio]";case"video":return"[video]";case"file":return"[file]";case"reasoning":case"tool_call":case"tool_call_chunk":case"invalid_tool_call":case"server_tool_call":case"server_tool_call_chunk":case"server_tool_call_result":case"non_standard":return"";default:return e.type?`[${e.type}]`:""}}function H_(e,t="Human",n="AI"){let r=[];for(let i of e){let a;if(i.type==="human")a=t;else if(i.type==="ai")a=n;else if(i.type==="system")a="System";else if(i.type==="tool")a="Tool";else if(i.type==="generic")a=i.role;else throw new Error(`Got unsupported message type: ${i.type}`);let s=i.name?`${i.name}, `:"",o=typeof i.content=="string"?i.content:Array.isArray(i.content)?i.content.map(Dj).filter(Boolean).join(""):"",c=`${a}: ${s}${o}`;if(i.type==="ai"){let l=i;l.tool_calls&&l.tool_calls.length>0?c+=JSON.stringify(l.tool_calls):l.additional_kwargs&&"function_call"in l.additional_kwargs&&(c+=JSON.stringify(l.additional_kwargs.function_call))}r.push(c)}return r.join(`
483
- `)}function Uj(e){if(e.data!==void 0)return e;{let t=e;return{type:t.type,data:{content:t.text,role:t.role,name:void 0,tool_call_id:void 0}}}}function J_(e){let t=Uj(e);switch(t.type){case"human":return new Vt(t.data);case"ai":return new Ke(t.data);case"system":return new _r(t.data);case"function":if(t.data.name===void 0)throw new Error("Name must be defined for function messages");return new pf(t.data);case"tool":if(t.data.tool_call_id===void 0)throw new Error("Tool call ID must be defined for tool messages");return new Cn(t.data);case"generic":if(t.data.role===void 0)throw new Error("Role must be defined for chat messages");return new Hr(t.data);default:throw new Error(`Got unexpected type: ${t.type}`)}}function Lj(e){return e.map(J_)}function zj(e){return e.map(t=>t.toDict())}function bu(e){let t=e._getType();if(t==="human")return new gc({...e});if(t==="ai"){let n={...e};return"tool_calls"in n&&(n={...n,tool_call_chunks:n.tool_calls?.map(r=>({...r,type:"tool_call_chunk",index:void 0,args:JSON.stringify(r.args)}))}),new un({...n})}else{if(t==="system")return new mi({...e});if(t==="function")return new mc({...e});if(Hr.isInstance(e))return new pc({...e});throw new Error("Unknown message type.")}}function ox(e){let t=e.reduce((i,a)=>{let s=i.findIndex(([o])=>"id"in a&&a.id&&"index"in a&&a.index!==void 0?a.id===o.id&&a.index===o.index:"id"in a&&a.id?a.id===o.id:"index"in a&&a.index!==void 0?a.index===o.index:!1);return s!==-1?i[s].push(a):i.push([a]),i},[]),n=[],r=[];for(let i of t){let a=null,s=i[0]?.name??"",o=i.map(u=>u.args||"").join("").trim(),c=o.length?o:"{}",l=i[0]?.id;try{if(a=ns(c),!l||a===null||typeof a!="object"||Array.isArray(a))throw new Error("Malformed tool call chunk args.");n.push({name:s,args:a,id:l,type:"tool_call"})}catch{r.push({name:s,args:c,id:l,error:"Malformed args.",type:"invalid_tool_call"})}}return{tool_call_chunks:e,tool_calls:n,invalid_tool_calls:r}}var Fj=Q({BaseCache:()=>lx,InMemoryCache:()=>ux,defaultHashKeyEncoder:()=>cx,deserializeStoredGeneration:()=>Bj,serializeGeneration:()=>Zj}),cx=(...e)=>j_(e.join("_"));function Bj(e){return e.message!==void 0?{text:e.text,message:J_(e.message)}:{text:e.text}}function Zj(e){let t={text:e.text};return e.message!==void 0&&(t.message=e.message.toDict()),t}var lx=class{keyEncoder=cx;makeDefaultKeyEncoder(t){this.keyEncoder=t}},Vj=new Map,ux=class dx extends lx{cache;constructor(t){super(),this.cache=t??new Map}lookup(t,n){return Promise.resolve(this.cache.get(this.keyEncoder(t,n))??null)}async update(t,n,r){this.cache.set(this.keyEncoder(t,n),r)}static global(){return new dx(Vj)}},qj=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function bo(e){return typeof e=="string"&&qj.test(e)}function Kw(e){if(!bo(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var At=[];for(let e=0;e<256;++e)At.push((e+256).toString(16).slice(1));function W_(e,t=0){return(At[e[t+0]]+At[e[t+1]]+At[e[t+2]]+At[e[t+3]]+"-"+At[e[t+4]]+At[e[t+5]]+"-"+At[e[t+6]]+At[e[t+7]]+"-"+At[e[t+8]]+At[e[t+9]]+"-"+At[e[t+10]]+At[e[t+11]]+At[e[t+12]]+At[e[t+13]]+At[e[t+14]]+At[e[t+15]]).toLowerCase()}var Jh,Gj=new Uint8Array(16);function fx(){if(!Jh){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Jh=crypto.getRandomValues.bind(crypto)}return Jh(Gj)}function Hj(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}var Jj="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Wj="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Kj(e,t,n,r,i,a){let s=typeof n=="string"?Hj(n):n,o=typeof r=="string"?Kw(r):r;if(typeof r=="string"&&(r=Kw(r)),r?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+s.length);if(c.set(o),c.set(s,o.length),c=t(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,i){a=a||0;for(let l=0;l<16;++l)i[a+l]=c[l];return i}return W_(c)}var Xj=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Xw={randomUUID:Xj};function Yj(e,t,n){if(Xw.randomUUID&&!e)return Xw.randomUUID();e=e||{};let r=e.random??e.rng?.()??fx();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,W_(r)}function Qj(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function Wh(e,t){return e<<t|e>>>32-t}function eM(e){let t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(e.length+1);r.set(e),r[e.length]=128,e=r;let i=e.length/4+2,a=Math.ceil(i/16),s=new Array(a);for(let o=0;o<a;++o){let c=new Uint32Array(16);for(let l=0;l<16;++l)c[l]=e[o*64+l*4]<<24|e[o*64+l*4+1]<<16|e[o*64+l*4+2]<<8|e[o*64+l*4+3];s[o]=c}s[a-1][14]=(e.length-1)*8/Math.pow(2,32),s[a-1][14]=Math.floor(s[a-1][14]),s[a-1][15]=(e.length-1)*8&4294967295;for(let o=0;o<a;++o){let c=new Uint32Array(80);for(let p=0;p<16;++p)c[p]=s[o][p];for(let p=16;p<80;++p)c[p]=Wh(c[p-3]^c[p-8]^c[p-14]^c[p-16],1);let l=n[0],u=n[1],d=n[2],f=n[3],h=n[4];for(let p=0;p<80;++p){let m=Math.floor(p/20),v=Wh(l,5)+Qj(m,u,d,f)+h+t[m]+c[p]>>>0;h=f,f=d,d=Wh(u,30)>>>0,u=l,l=v}n[0]=n[0]+l>>>0,n[1]=n[1]+u>>>0,n[2]=n[2]+d>>>0,n[3]=n[3]+f>>>0,n[4]=n[4]+h>>>0}return Uint8Array.of(n[0]>>24,n[0]>>16,n[0]>>8,n[0],n[1]>>24,n[1]>>16,n[1]>>8,n[1],n[2]>>24,n[2]>>16,n[2]>>8,n[2],n[3]>>24,n[3]>>16,n[3]>>8,n[3],n[4]>>24,n[4]>>16,n[4]>>8,n[4])}function wu(e,t,n,r){return Kj(80,eM,e,t,n,r)}wu.DNS=Jj;wu.URL=Wj;var Kh={};function ei(e,t,n){let r;{let i=Date.now(),a=fx();tM(Kh,i,a),r=nM(a,Kh.msecs,Kh.seq,t,n)}return W_(r)}function tM(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function nM(e,t,n,r,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}var rM=Q({BaseCallbackHandler:()=>ga,callbackHandlerPrefersStreaming:()=>K_,isBaseCallbackHandler:()=>hx}),iM=class{};function K_(e){return"lc_prefer_streaming"in e&&e.lc_prefer_streaming}var ga=class extends iM{lc_serializable=!1;get lc_namespace(){return["langchain_core","callbacks",this.name]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,uf(this.constructor)]}lc_kwargs;ignoreLLM=!1;ignoreChain=!1;ignoreAgent=!1;ignoreRetriever=!1;ignoreCustomEvent=!1;raiseError=!1;awaitHandlers=wn("LANGCHAIN_CALLBACKS_BACKGROUND")==="false";constructor(e){super(),this.lc_kwargs=e||{},e&&(this.ignoreLLM=e.ignoreLLM??this.ignoreLLM,this.ignoreChain=e.ignoreChain??this.ignoreChain,this.ignoreAgent=e.ignoreAgent??this.ignoreAgent,this.ignoreRetriever=e.ignoreRetriever??this.ignoreRetriever,this.ignoreCustomEvent=e.ignoreCustomEvent??this.ignoreCustomEvent,this.raiseError=e.raiseError??this.raiseError,this.awaitHandlers=this.raiseError||(e._awaitHandler??this.awaitHandlers))}copy(){return new this.constructor(this)}toJSON(){return An.prototype.toJSON.call(this)}toJSONNotImplemented(){return An.prototype.toJSONNotImplemented.call(this)}static fromMethods(e){class t extends ga{name=ei();constructor(){super(),Object.assign(this,e)}}return new t}},hx=e=>{let t=e;return t!==void 0&&typeof t.copy=="function"&&typeof t.name=="string"&&typeof t.awaitHandlers=="boolean"},aM="gen_ai.operation.name",sM="gen_ai.system",Yw="gen_ai.request.model",oM="gen_ai.response.model",Qw="gen_ai.usage.input_tokens",e0="gen_ai.usage.output_tokens",t0="gen_ai.usage.total_tokens",cM="gen_ai.request.max_tokens",lM="gen_ai.request.temperature",uM="gen_ai.request.top_p",dM="gen_ai.request.frequency_penalty",fM="gen_ai.request.presence_penalty",hM="gen_ai.response.finish_reasons",pM="gen_ai.prompt",mM="gen_ai.completion",gM="gen_ai.request.extra_query",_M="gen_ai.request.extra_body",yM="gen_ai.serialized.name",vM="gen_ai.serialized.signature",bM="gen_ai.serialized.doc",wM="gen_ai.response.id",$M="gen_ai.response.service_tier",SM="gen_ai.response.system_fingerprint",kM="gen_ai.usage.input_token_details",xM="gen_ai.usage.output_token_details",IM="langsmith.trace.session_id",EM="langsmith.trace.session_name",TM="langsmith.span.kind",OM="langsmith.trace.name",AM="langsmith.metadata",n0="langsmith.span.tags",CM="langsmith.request.streaming",NM="langsmith.request.headers",PM=(...e)=>fetch(...e),px=Symbol.for("ls:fetch_implementation"),RM=()=>globalThis[px]===void 0,jM=e=>async(...t)=>{if(e||Pt("DEBUG")==="true"){let[r,i]=t;console.log(`\u2192 ${i?.method||"GET"} ${r}`)}let n=await(globalThis[px]??PM)(...t);return(e||Pt("DEBUG")==="true")&&console.log(`\u2190 ${n.status} ${n.statusText} ${n.url}`),n},mx=()=>Pt("PROJECT")??yr("LANGCHAIN_SESSION")??"default",r0={};function Hl(e){r0[e]||(console.warn(e),r0[e]=!0)}var j=e=>BigInt(e),gx=j("0x9E3779B1"),_x=j("0x85EBCA77"),MM=j("0xC2B2AE3D"),gi=j("0x9E3779B185EBCA87"),ia=j("0xC2B2AE3D27D4EB4F"),yx=j("0x165667B19E3779F9"),X_=j("0x85EBCA77C2B2AE63"),DM=j("0x27D4EB2F165667C5"),UM=j("0x165667919E3779F9"),LM=j("0x9FB21C651E98DF25");function zM(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=parseInt(e.substring(n,n+2),16);return t}var ir=zM("b8fe6c3923a44bbe7c01812cf721ad1cded46de9839097db7240a4a4b7b3671fcb79e64eccc0e578825ad07dccff7221b8084674f743248ee03590e6813a264c3c2852bb91c300cb88d0658b1b532ea371644897a20df94e3819ef46a9deacd8a8fa763fe39c343ff9dcbbc7c70b4f1d8a51e04bcdb45931c89f7ec9d9787364eac5ac8334d3ebc3c581a0fffa1363eb170ddd51b7f0da49d316552629d4689e2b16be587d47a1fc8ff8b8d17ad031ce45cb3a8f95160428afd7fbcabb4b407e"),Xa=(j(1)<<j(128))-j(1),Ie=(j(1)<<j(64))-j(1),$u=(j(1)<<j(32))-j(1),Cr=64,vx=Cr/8,FM=8,cl=4;function et(e,t=0){return new Uint8Array(e.buffer,e.byteOffset+t,e.length-t)}function tt(e,t=0){return new DataView(e.buffer,e.byteOffset+t).getBigUint64(0,!0)}function Za(e,t=0){return new DataView(e.buffer,e.byteOffset+t).getUint32(0,!0)}function Xh(e,t=0){return e[t]}var BM=e=>(e&j(255))<<j(56)|(e&j(65280))<<j(40)|(e&j(16711680))<<j(24)|(e&j(4278190080))<<j(8)|(e&j(0xff00000000))>>j(8)|(e&j(0xff0000000000))>>j(24)|(e&j(0xff000000000000))>>j(40)|(e&j(0xff00000000000000))>>j(56),ZM=e=>(e=(e&j(65535))<<j(16)|(e&j(4294901760))>>j(16),e=(e&j(16711935))<<j(8)|(e&j(4278255360))>>j(8),e),VM=(e,t)=>(e&$u)*(t&$u)&Ie,rs=e=>{if(!e)throw new Error("Assert failed")};function qM(e,t){return(e<<t|e>>j(32)-t)&$u}function bx(e,t,n){for(let r=0;r<vx;r++){let i=tt(t,r*8),a=i^tt(n,r*8);e[r^1]+=i,e[r]+=VM(a,a>>j(32))}return e}function i0(e,t,n,r){for(let i=0;i<r;i++)bx(e,et(t,i*Cr),et(n,i*8));return e}function GM(e,t){for(let n=0;n<vx;n++){let r=tt(t,n*8),i=e[n];i=Fm(i,j(47)),i^=r,i*=gx,e[n]=i&Ie}return e}function ll(e,t){return wx(e[0]^tt(t,0),e[1]^tt(t,FM))}function a0(e,t,n){let r=n;return r+=ll(e.slice(0),et(t,0*cl)),r+=ll(e.slice(2),et(t,4*cl)),r+=ll(e.slice(4),et(t,8*cl)),r+=ll(e.slice(6),et(t,12*cl)),ur(r&Ie)}function HM(e,t,n,r,i){let a=Math.floor((n.byteLength-Cr)/8),s=Cr*a,o=Math.floor((t.byteLength-1)/s);for(let c=0;c<o;c++)e=i0(e,et(t,c*s),n,a),e=i(e,et(n,n.byteLength-Cr));{let c=Math.floor((t.byteLength-1-s*o)/Cr);e=i0(e,et(t,o*s),n,c),e=r(e,et(t,t.byteLength-Cr),et(n,n.byteLength-Cr-7))}return e}function JM(e,t,n){let r=new BigUint64Array([MM,gi,ia,yx,X_,_x,DM,gx]);rs(e.length>128),r=HM(r,e,t,bx,GM),rs(r.length*8==64);{let i=a0(r,et(t,11),j(e.byteLength)*gi&Ie);return a0(r,et(t,t.byteLength-Cr-11),~(j(e.byteLength)*ia)&Ie)<<j(64)|i}}function wx(e,t){let n=e*t&Xa;return n&Ie^n>>j(64)}function s0(e,t,n){return wx((tt(e,0)^tt(t,0)+n)&Ie,(tt(e,8)^tt(t,8)-n)&Ie)}function Jl(e,t,n,r,i){let a=e&Ie,s=e>>j(64)&Ie;return a+=s0(t,r,i),a^=tt(n,0)+tt(n,8),a&=Ie,s+=s0(n,et(r,16),i),s^=tt(t,0)+tt(t,8),s&=Ie,s<<j(64)|a}function ur(e){return e^=e>>j(37),e*=UM,e&=Ie,e^=e>>j(32),e}function Su(e){return e^=e>>j(33),e*=ia,e&=Ie,e^=e>>j(29),e*=yx,e&=Ie,e^=e>>j(32),e}function WM(e,t,n){let r=e.byteLength;rs(r>0&&r<=3);let i=j(Xh(e,r-1))|j(r<<8)|j(Xh(e,0)<<16)|j(Xh(e,r>>1)<<24),a=(j(Za(t,0))^j(Za(t,4)))+n,s=(i^a)&Ie,o=(j(Za(t,8))^j(Za(t,12)))-n,c=(qM(ZM(i),j(13))^o)&Ie;return(Su(c)&Ie)<<j(64)|Su(s)}function Fm(e,t){return e^e>>t}function KM(e,t,n){let r=e.byteLength;rs(r>=4&&r<=8);{let i=Za(e,0),a=Za(e,r-4),s=j(i)|j(a)<<j(32),o=(tt(t,16)^tt(t,24))+n&Ie,l=(s^o)*(gi+(j(r)<<j(2)))&Xa;return l+=(l&Ie)<<j(65),l&=Xa,l^=l>>j(67),Fm(Fm(l&Ie,j(35))*LM&Ie,j(28))|ur(l>>j(64))<<j(64)}}function XM(e,t,n){let r=e.byteLength;rs(r>=9&&r<=16);{let i=(tt(t,32)^tt(t,40))+n&Ie,a=(tt(t,48)^tt(t,56))-n&Ie,s=tt(e),o=tt(e,r-8),c=(s^o^i)*gi,l=(c&Ie)+(j(r-1)<<j(54));c=c&(Xa^Ie)|l,o^=a,c+=o+(o&$u)*(_x-j(1))<<j(64),c&=Xa,c^=BM(c>>j(64));let u=(c&Ie)*ia;return u+=(c>>j(64))*ia<<j(64),u&=Xa,ur(u&Ie)|ur(u>>j(64))<<j(64)}}function YM(e,t){let n=e.byteLength;return rs(n<=16),n>8?XM(e,ir,t):n>=4?KM(e,ir,t):n>0?WM(e,ir,t):Su(t^tt(ir,64)^tt(ir,72))|Su(t^tt(ir,80)^tt(ir,88))<<j(64)}function Bm(e){return~e+j(1)&Ie}function QM(e,t,n){let r=j(e.byteLength)*gi&Ie,i=j(e.byteLength-1)/j(32);for(;i>=0;){let o=Number(i);r=Jl(r,et(e,16*o),et(e,e.byteLength-16*(o+1)),et(t,32*o),n),i--}let a=r+(r>>j(64))&Ie;a=ur(a);let s=(r&Ie)*gi+(r>>j(64))*X_+(j(e.byteLength)-n&Ie)*ia;return s&=Ie,s=Bm(ur(s)),a|s<<j(64)}function eD(e,t,n){let r=j(e.byteLength)*gi&Ie;for(let s=32;s<160;s+=32)r=Jl(r,et(e,s-32),et(e,s-16),et(t,s-32),n);r=ur(r&Ie)|ur(r>>j(64))<<j(64);for(let s=160;s<=e.byteLength;s+=32)r=Jl(r,et(e,s-32),et(e,s-16),et(t,3+s-160),n);r=Jl(r,et(e,e.byteLength-16),et(e,e.byteLength-32),et(t,103),Bm(n));let i=r+(r>>j(64))&Ie;i=ur(i);let a=(r&Ie)*gi+(r>>j(64))*X_+(j(e.byteLength)-n&Ie)*ia;return a&=Ie,a=Bm(ur(a)),i|a<<j(64)}function tD(e,t=j(0)){let n=e.byteLength;return n<=16?YM(e,t):n<=128?QM(e,ir,t):n<=240?eD(e,ir,t):JM(e,ir)}function nD(e){let t=new Uint8Array(16),n=new DataView(t.buffer),r=e&Ie,i=e>>j(64);return n.setBigUint64(0,i,!1),n.setBigUint64(8,r,!1),t}var $x=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function we(e,t){if(!$x.test(e)){let n=t!==void 0?`Invalid UUID for ${t}: ${e}`:`Invalid UUID: ${e}`;throw new Error(n)}return e}function rD(e){let t=typeof e=="string"?Date.parse(e):e;return Ck({msecs:t,seq:0})}function iD(e){if(!$x.test(e))return null;let t=e[14];return parseInt(t,16)}function aD(e){let t=e.replace(/-/g,""),n=new Uint8Array(16);for(let r=0;r<16;r++)n[r]=parseInt(t.slice(r*2,r*2+2),16);return n}function sD(e){let t=Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}var oD=new TextEncoder;function cD(e){let t=oD.encode(e),n=tD(t);return nD(n)}function ul(e,t){let n=`${e}:${t}`,r=cD(n),i=new Uint8Array(16);if(iD(e)===7){let s=aD(e);i.set(s.slice(0,6),0)}else{let s=Date.now();i[0]=s/1099511627776&255,i[1]=s/4294967296&255,i[2]=s/16777216&255,i[3]=s/65536&255,i[4]=s/256&255,i[5]=s&255}return i[6]=112|r[0]&15,i[7]=r[1],i[8]=128|r[2]&63,i.set(r.slice(3,10),9),sD(i)}var Zm={join:(...e)=>e.join("/"),dirname:e=>e.split("/").slice(0,-1).join("/")};async function lD(e){}async function uD(e,t){}async function dD(e){return[]}async function fD(e){return{size:0}}function hD(e,t){return t===null?!1:Date.now()-e.createdAt>t*1e3}var Vm=class{constructor(t={}){Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ttlSeconds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"refreshIntervalSeconds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"refreshTimer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_metrics",{enumerable:!0,configurable:!0,writable:!0,value:{hits:0,misses:0,refreshes:0,refreshErrors:0}}),this.configure(t)}get metrics(){return{...this._metrics}}get totalRequests(){return this._metrics.hits+this._metrics.misses}get hitRate(){let t=this.totalRequests;return t>0?this._metrics.hits/t:0}resetMetrics(){this._metrics={hits:0,misses:0,refreshes:0,refreshErrors:0}}get(t,n){if(this.maxSize===0)return;let r=this.cache.get(t);if(!r){this._metrics.misses+=1;return}return this.cache.delete(t),this.cache.set(t,{...r,refreshFunc:n}),this._metrics.hits+=1,r.value}set(t,n,r){if(this.maxSize===0)return;if(this.refreshTimer===void 0&&this.startRefreshLoop(),!this.cache.has(t)&&this.cache.size>=this.maxSize){let a=this.cache.keys().next().value;a!==void 0&&this.cache.delete(a)}let i={value:n,createdAt:Date.now(),refreshFunc:r};this.cache.delete(t),this.cache.set(t,i)}invalidate(t){this.cache.delete(t)}clear(){this.cache.clear()}get size(){return this.cache.size}stop(){this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=void 0)}dump(t){let n={};for(let[i,a]of this.cache.entries())n[i]=a.value;Zm.dirname(t);let r=`${t}.tmp`;try{JSON.stringify({entries:n},null,2)}catch(i){throw i}}load(t){return 0}startRefreshLoop(){this.stop(),this.ttlSeconds!==null&&(this.refreshTimer=setInterval(()=>{this.refreshStaleEntries().catch(t=>{console.warn("Unexpected error in cache refresh loop:",t)})},this.refreshIntervalSeconds*1e3),this.refreshTimer.unref&&this.refreshTimer.unref())}getStaleEntries(){let t=[];for(let[n,r]of this.cache.entries())hD(r,this.ttlSeconds)&&t.push([n,r]);return t}async refreshStaleEntries(){let t=this.getStaleEntries();if(t.length!==0){for(let[n,r]of t)if(r.refreshFunc!==void 0)try{let i=await r.refreshFunc();this.set(n,i,r.refreshFunc),this._metrics.refreshes+=1}catch(i){this._metrics.refreshErrors+=1,console.warn(`Failed to refresh cache entry ${n}:`,i)}}}configure(t){this.stop(),this.refreshIntervalSeconds=t.refreshIntervalSeconds??60,this.maxSize=t.maxSize??100,this.ttlSeconds=t.ttlSeconds??300}},o0=new Vm,Sx="0.5.16",tr,pD=()=>typeof window<"u"&&typeof window.document<"u",mD=()=>typeof globalThis=="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",gD=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),kx=()=>typeof Deno<"u",_D=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!kx(),xx=()=>tr||(typeof Bun<"u"?tr="bun":pD()?tr="browser":_D()?tr="node":mD()?tr="webworker":gD()?tr="jsdom":kx()?tr="deno":tr="other",tr),Yh;function Ix(){if(Yh===void 0){let e=xx(),t=vD();Yh={library:"langsmith",runtime:e,sdk:"langsmith-js",sdk_version:Sx,...t}}return Yh}function Ex(){let e=yD(),t={},n=["LANGCHAIN_API_KEY","LANGCHAIN_ENDPOINT","LANGCHAIN_TRACING_V2","LANGCHAIN_PROJECT","LANGCHAIN_SESSION","LANGSMITH_API_KEY","LANGSMITH_ENDPOINT","LANGSMITH_TRACING_V2","LANGSMITH_PROJECT","LANGSMITH_SESSION"];for(let[r,i]of Object.entries(e))typeof i=="string"&&!n.includes(r)&&!r.toLowerCase().includes("key")&&!r.toLowerCase().includes("secret")&&!r.toLowerCase().includes("token")&&(r==="LANGCHAIN_REVISION_ID"?t.revision_id=i:t[r]=i);return t}function yD(){let e={};try{if(typeof process<"u"&&process.env)for(let[t,n]of Object.entries(process.env))(t.startsWith("LANGCHAIN_")||t.startsWith("LANGSMITH_"))&&n!=null&&((t.toLowerCase().includes("key")||t.toLowerCase().includes("secret")||t.toLowerCase().includes("token"))&&typeof n=="string"?e[t]=n.slice(0,2)+"*".repeat(n.length-4)+n.slice(-2):e[t]=n)}catch{}return e}function yr(e){try{return typeof process<"u"?process.env?.[e]:void 0}catch{return}}function Pt(e){return yr(`LANGSMITH_${e}`)||yr(`LANGCHAIN_${e}`)}var Qh;function vD(){if(Qh!==void 0)return Qh;let e=["VERCEL_GIT_COMMIT_SHA","NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA","COMMIT_REF","RENDER_GIT_COMMIT","CI_COMMIT_SHA","CIRCLE_SHA1","CF_PAGES_COMMIT_SHA","REACT_APP_GIT_SHA","SOURCE_VERSION","GITHUB_SHA","TRAVIS_COMMIT","GIT_COMMIT","BUILD_VCS_NUMBER","bamboo_planRepository_revision","Build.SourceVersion","BITBUCKET_COMMIT","DRONE_COMMIT_SHA","SEMAPHORE_GIT_SHA","BUILDKITE_COMMIT"],t={};for(let n of e){let r=yr(n);r!==void 0&&(t[n]=r)}return Qh=t,t}function Tx(){return yr("OTEL_ENABLED")==="true"||Pt("OTEL_ENABLED")==="true"}var qm=class{constructor(){Object.defineProperty(this,"hasWarned",{enumerable:!0,configurable:!0,writable:!0,value:!1})}startActiveSpan(t,...n){!this.hasWarned&&Tx()&&(console.warn('You have enabled OTEL export via the `OTEL_ENABLED` or `LANGSMITH_OTEL_ENABLED` environment variable, but have not initialized the required OTEL instances. Please add:\n```\nimport { initializeOTEL } from "langsmith/experimental/otel/setup";\ninitializeOTEL();\n```\nat the beginning of your code.'),this.hasWarned=!0);let r;if(n.length===1&&typeof n[0]=="function"?r=n[0]:n.length===2&&typeof n[1]=="function"?r=n[1]:n.length===3&&typeof n[2]=="function"&&(r=n[2]),typeof r=="function")return r()}},Gm=class{constructor(){Object.defineProperty(this,"mockTracer",{enumerable:!0,configurable:!0,writable:!0,value:new qm})}getTracer(t,n){return this.mockTracer}getActiveSpan(){}setSpan(t,n){return t}getSpan(t){}setSpanContext(t,n){return t}getTracerProvider(){}setGlobalTracerProvider(t){return!1}},Hm=class{active(){return{}}with(t,n){return n()}},ep=Symbol.for("ls:otel_trace"),tp=Symbol.for("ls:otel_context"),c0=Symbol.for("ls:otel_get_default_otlp_tracer_provider"),bD=new Gm,wD=new Hm,Jm=class{getTraceInstance(){return globalThis[ep]??bD}getContextInstance(){return globalThis[tp]??wD}initializeGlobalInstances(t){globalThis[ep]===void 0&&(globalThis[ep]=t.trace),globalThis[tp]===void 0&&(globalThis[tp]=t.context)}setDefaultOTLPTracerComponents(t){globalThis[c0]=t}getDefaultOTLPTracerComponents(){return globalThis[c0]??void 0}},Y_=new Jm;function Ox(){return Y_.getTraceInstance()}function $D(){return Y_.getContextInstance()}function SD(){return Y_.getDefaultOTLPTracerComponents()}var kD={llm:"chat",tool:"execute_tool",retriever:"embeddings",embedding:"embeddings",prompt:"chat"};function xD(e){return kD[e]||e}var Wm=class{constructor(){Object.defineProperty(this,"spans",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}exportBatch(t,n){for(let r of t)try{if(!r.run)continue;if(r.operation==="post"){let i=this.createSpanForRun(r,r.run,n.get(r.id));i&&!r.run.end_time&&this.spans.set(r.id,i)}else this.updateSpanForRun(r,r.run)}catch(i){console.error(`Error processing operation ${r.id}:`,i)}}createSpanForRun(t,n,r){let i=r&&Ox().getSpan(r);if(i)try{return this.finishSpanSetup(i,n,t)}catch(a){console.error(`Failed to create span for run ${t.id}:`,a);return}}finishSpanSetup(t,n,r){return this.setSpanAttributes(t,n,r),n.error?(t.setStatus({code:2}),t.recordException(new Error(n.error))):t.setStatus({code:1}),n.end_time&&t.end(new Date(n.end_time)),t}updateSpanForRun(t,n){try{let r=this.spans.get(t.id);if(!r){console.debug(`No span found for run ${t.id} during update`);return}this.setSpanAttributes(r,n,t),n.error?(r.setStatus({code:2}),r.recordException(new Error(n.error))):r.setStatus({code:1});let i=n.end_time;i&&(r.end(new Date(i)),this.spans.delete(t.id))}catch(r){console.error(`Failed to update span for run ${t.id}:`,r)}}extractModelName(t){if(t.extra?.metadata){let n=t.extra.metadata;if(n.ls_model_name)return n.ls_model_name;if(n.invocation_params){let r=n.invocation_params;if(r.model)return r.model;if(r.model_name)return r.model_name}}}setSpanAttributes(t,n,r){if("run_type"in n&&n.run_type){t.setAttribute(TM,n.run_type);let o=xD(n.run_type||"chain");t.setAttribute(aM,o)}"name"in n&&n.name&&t.setAttribute(OM,n.name),"session_id"in n&&n.session_id&&t.setAttribute(IM,n.session_id),"session_name"in n&&n.session_name&&t.setAttribute(EM,n.session_name),this.setGenAiSystem(t,n);let i=this.extractModelName(n);i&&t.setAttribute(Yw,i),"prompt_tokens"in n&&typeof n.prompt_tokens=="number"&&t.setAttribute(Qw,n.prompt_tokens),"completion_tokens"in n&&typeof n.completion_tokens=="number"&&t.setAttribute(e0,n.completion_tokens),"total_tokens"in n&&typeof n.total_tokens=="number"&&t.setAttribute(t0,n.total_tokens),this.setInvocationParameters(t,n);let a=n.extra?.metadata||{};for(let[o,c]of Object.entries(a))c!=null&&t.setAttribute(`${AM}.${o}`,String(c));let s=n.tags;if(s&&Array.isArray(s)?t.setAttribute(n0,s.join(", ")):s&&t.setAttribute(n0,String(s)),"serialized"in n&&typeof n.serialized=="object"){let o=n.serialized;o.name&&t.setAttribute(yM,String(o.name)),o.signature&&t.setAttribute(vM,String(o.signature)),o.doc&&t.setAttribute(bM,String(o.doc))}this.setIOAttributes(t,r)}setGenAiSystem(t,n){let r="langchain",i=this.extractModelName(n);if(i){let a=i.toLowerCase();a.includes("anthropic")||a.startsWith("claude")?r="anthropic":a.includes("bedrock")?r="aws.bedrock":a.includes("azure")&&a.includes("openai")?r="az.ai.openai":a.includes("azure")&&a.includes("inference")?r="az.ai.inference":a.includes("cohere")?r="cohere":a.includes("deepseek")?r="deepseek":a.includes("gemini")?r="gemini":a.includes("groq")?r="groq":a.includes("watson")||a.includes("ibm")?r="ibm.watsonx.ai":a.includes("mistral")?r="mistral_ai":a.includes("gpt")||a.includes("openai")?r="openai":a.includes("perplexity")||a.includes("sonar")?r="perplexity":a.includes("vertex")?r="vertex_ai":(a.includes("xai")||a.includes("grok"))&&(r="xai")}t.setAttribute(sM,r)}setInvocationParameters(t,n){if(!n.extra?.metadata?.invocation_params)return;let r=n.extra.metadata.invocation_params;r.max_tokens!==void 0&&t.setAttribute(cM,r.max_tokens),r.temperature!==void 0&&t.setAttribute(lM,r.temperature),r.top_p!==void 0&&t.setAttribute(uM,r.top_p),r.frequency_penalty!==void 0&&t.setAttribute(dM,r.frequency_penalty),r.presence_penalty!==void 0&&t.setAttribute(fM,r.presence_penalty)}setIOAttributes(t,n){if(n.run.inputs)try{let r=n.run.inputs;typeof r=="object"&&r!==null&&(r.model&&Array.isArray(r.messages)&&t.setAttribute(Yw,r.model),r.stream!==void 0&&t.setAttribute(CM,r.stream),r.extra_headers&&t.setAttribute(NM,JSON.stringify(r.extra_headers)),r.extra_query&&t.setAttribute(gM,JSON.stringify(r.extra_query)),r.extra_body&&t.setAttribute(_M,JSON.stringify(r.extra_body))),t.setAttribute(pM,JSON.stringify(r))}catch(r){console.debug(`Failed to process inputs for run ${n.id}`,r)}if(n.run.outputs)try{let r=n.run.outputs,i=this.getUnifiedRunTokens(r);if(i&&(t.setAttribute(Qw,i[0]),t.setAttribute(e0,i[1]),t.setAttribute(t0,i[0]+i[1])),r&&typeof r=="object"){if(r.model&&t.setAttribute(oM,String(r.model)),r.id&&t.setAttribute(wM,r.id),r.choices&&Array.isArray(r.choices)){let a=r.choices.map(s=>s.finish_reason).filter(s=>s).map(String);a.length>0&&t.setAttribute(hM,a.join(", "))}if(r.service_tier&&t.setAttribute($M,r.service_tier),r.system_fingerprint&&t.setAttribute(SM,r.system_fingerprint),r.usage_metadata&&typeof r.usage_metadata=="object"){let a=r.usage_metadata;a.input_token_details&&t.setAttribute(kM,JSON.stringify(a.input_token_details)),a.output_token_details&&t.setAttribute(xM,JSON.stringify(a.output_token_details))}}t.setAttribute(mM,JSON.stringify(r))}catch(r){console.debug(`Failed to process outputs for run ${n.id}`,r)}}getUnifiedRunTokens(t){if(!t)return null;let n=this.extractUnifiedRunTokens(t.usage_metadata);if(n)return n;let r=Object.keys(t);for(let s of r){let o=t[s];if(!(!o||typeof o!="object")&&(n=this.extractUnifiedRunTokens(o.usage_metadata),n||o.lc===1&&o.kwargs&&typeof o.kwargs=="object"&&(n=this.extractUnifiedRunTokens(o.kwargs.usage_metadata),n)))return n}let i=t.generations||[];if(!Array.isArray(i))return null;let a=Array.isArray(i[0])?i.flat():i;for(let s of a)if(typeof s=="object"&&s.message&&typeof s.message=="object"&&s.message.kwargs&&typeof s.message.kwargs=="object"&&(n=this.extractUnifiedRunTokens(s.message.kwargs.usage_metadata),n))return n;return null}extractUnifiedRunTokens(t){return!t||typeof t!="object"||typeof t.input_tokens!="number"||typeof t.output_tokens!="number"?null:[t.input_tokens,t.output_tokens]}},ID=Object.prototype.toString,ED=e=>ID.call(e)==="[object Error]",TD=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function OD(e){if(!(e&&ED(e)&&e.name==="TypeError"&&typeof e.message=="string"))return!1;let{message:n,stack:r}=e;return n==="Load failed"?r===void 0||"__sentry_captured__"in e:n.startsWith("error sending request for url")?!0:TD.has(n)}function AD(e){if(typeof e=="number"){if(e<0)throw new TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw new TypeError("Expected `retries` to be a number or Infinity.")}function dl(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!="number"||Number.isNaN(t))throw new TypeError(`Expected \`${e}\` to be a number${r?" or Infinity":""}.`);if(!r&&!Number.isFinite(t))throw new TypeError(`Expected \`${e}\` to be a finite number.`);if(t<n)throw new TypeError(`Expected \`${e}\` to be \u2265 ${n}.`)}}var CD=class extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}};function ND(e,t){let n=Math.max(1,e+1),r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*t.factor**(n-1));return i=Math.min(i,t.maxTimeout),i}function l0(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function PD({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:new TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof CD)throw a.originalError;let s=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,o=i.maxRetryTime??Number.POSITIVE_INFINITY,c=Object.freeze({error:a,attemptNumber:t,retriesLeft:s,retriesConsumed:n});if(await i.onFailedAttempt(c),l0(r,o)<=0)throw a;let l=await i.shouldConsumeRetry(c),u=l0(r,o);if(u<=0||s<=0)throw a;if(a instanceof TypeError&&!OD(a)){if(l)throw a;return i.signal?.throwIfAborted(),!1}if(!await i.shouldRetry(c))throw a;if(!l)return i.signal?.throwIfAborted(),!1;let d=ND(n,i),f=Math.min(d,u);return f>0&&await new Promise((h,p)=>{let m=()=>{clearTimeout(v),i.signal?.removeEventListener("abort",m),p(i.signal.reason)},v=setTimeout(()=>{i.signal?.removeEventListener("abort",m),h()},f);i.unref&&v.unref?.(),i.signal?.addEventListener("abort",m,{once:!0})}),i.signal?.throwIfAborted(),!0}async function RD(e,t={}){if(t={...t},AD(t.retries),Object.hasOwn(t,"forever"))throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=Number.POSITIVE_INFINITY,t.maxRetryTime??=Number.POSITIVE_INFINITY,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,dl("factor",t.factor,{min:0,allowInfinity:!1}),dl("minTimeout",t.minTimeout,{min:0,allowInfinity:!1}),dl("maxTimeout",t.maxTimeout,{min:0,allowInfinity:!0}),dl("maxRetryTime",t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let a=await e(n);return t.signal?.throwIfAborted(),a}catch(a){await PD({error:a,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw new Error("Retry attempts exhausted without throwing an error.")}var fl={},np={exports:{}},u0;function jD(){return u0||(u0=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function a(c,l,u,d,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,d||c,f),p=n?n+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],h]:c._events[p].push(h):(c._events[p]=h,c._eventsCount++),c}function s(c,l){--c._eventsCount===0?c._events=new r:delete c._events[l]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],u,d;if(this._eventsCount===0)return l;for(d in u=this._events)t.call(u,d)&&l.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},o.prototype.listeners=function(l){var u=n?n+l:l,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,h=d.length,p=new Array(h);f<h;f++)p[f]=d[f].fn;return p},o.prototype.listenerCount=function(l){var u=n?n+l:l,d=this._events[u];return d?d.fn?1:d.length:0},o.prototype.emit=function(l,u,d,f,h,p){var m=n?n+l:l;if(!this._events[m])return!1;var v=this._events[m],g=arguments.length,y,$;if(v.fn){switch(v.once&&this.removeListener(l,v.fn,void 0,!0),g){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,u),!0;case 3:return v.fn.call(v.context,u,d),!0;case 4:return v.fn.call(v.context,u,d,f),!0;case 5:return v.fn.call(v.context,u,d,f,h),!0;case 6:return v.fn.call(v.context,u,d,f,h,p),!0}for($=1,y=new Array(g-1);$<g;$++)y[$-1]=arguments[$];v.fn.apply(v.context,y)}else{var S=v.length,x;for($=0;$<S;$++)switch(v[$].once&&this.removeListener(l,v[$].fn,void 0,!0),g){case 1:v[$].fn.call(v[$].context);break;case 2:v[$].fn.call(v[$].context,u);break;case 3:v[$].fn.call(v[$].context,u,d);break;case 4:v[$].fn.call(v[$].context,u,d,f);break;default:if(!y)for(x=1,y=new Array(g-1);x<g;x++)y[x-1]=arguments[x];v[$].fn.apply(v[$].context,y)}}return!0},o.prototype.on=function(l,u,d){return a(this,l,u,d,!1)},o.prototype.once=function(l,u,d){return a(this,l,u,d,!0)},o.prototype.removeListener=function(l,u,d,f){var h=n?n+l:l;if(!this._events[h])return this;if(!u)return s(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!f||p.once)&&(!d||p.context===d)&&s(this,h);else{for(var m=0,v=[],g=p.length;m<g;m++)(p[m].fn!==u||f&&!p[m].once||d&&p[m].context!==d)&&v.push(p[m]);v.length?this._events[h]=v.length===1?v[0]:v:s(this,h)}return this},o.prototype.removeAllListeners=function(l){var u;return l?(u=n?n+l:l,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o})(np)),np.exports}var qs={exports:{}},rp,d0;function MD(){return d0||(d0=1,rp=(e,t)=>(t=t||(()=>{}),e.then(n=>new Promise(r=>{r(t())}).then(()=>n),n=>new Promise(r=>{r(t())}).then(()=>{throw n})))),rp}var f0;function DD(){if(f0)return qs.exports;f0=1;let e=MD();class t extends Error{constructor(i){super(i),this.name="TimeoutError"}}let n=(r,i,a)=>new Promise((s,o)=>{if(typeof i!="number"||i<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(i===1/0){s(r);return}let c=setTimeout(()=>{if(typeof a=="function"){try{s(a())}catch(d){o(d)}return}let l=typeof a=="string"?a:`Promise timed out after ${i} milliseconds`,u=a instanceof Error?a:new t(l);typeof r.cancel=="function"&&r.cancel(),o(u)},i);e(r.then(s,o),()=>{clearTimeout(c)})});return qs.exports=n,qs.exports.default=n,qs.exports.TimeoutError=t,qs.exports}var hl={},pl={},h0;function UD(){if(h0)return pl;h0=1,Object.defineProperty(pl,"__esModule",{value:!0});function e(t,n,r){let i=0,a=t.length;for(;a>0;){let s=a/2|0,o=i+s;r(t[o],n)<=0?(i=++o,a-=s+1):a=s}return i}return pl.default=e,pl}var p0;function LD(){if(p0)return hl;p0=1,Object.defineProperty(hl,"__esModule",{value:!0});let e=UD();class t{constructor(){this._queue=[]}enqueue(r,i){i=Object.assign({priority:0},i);let a={priority:i.priority,run:r};if(this.size&&this._queue[this.size-1].priority>=i.priority){this._queue.push(a);return}let s=e.default(this._queue,a,(o,c)=>c.priority-o.priority);this._queue.splice(s,0,a)}dequeue(){let r=this._queue.shift();return r?.run}filter(r){return this._queue.filter(i=>i.priority===r.priority).map(i=>i.run)}get size(){return this._queue.length}}return hl.default=t,hl}var m0;function zD(){if(m0)return fl;m0=1,Object.defineProperty(fl,"__esModule",{value:!0});let e=jD(),t=DD(),n=LD(),r=()=>{},i=new t.TimeoutError;class a extends e{constructor(o){var c,l,u,d;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=r,this._resolveIdle=r,o=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:n.default},o),!(typeof o.intervalCap=="number"&&o.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(l=(c=o.intervalCap)===null||c===void 0?void 0:c.toString())!==null&&l!==void 0?l:""}\` (${typeof o.intervalCap})`);if(o.interval===void 0||!(Number.isFinite(o.interval)&&o.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(d=(u=o.interval)===null||u===void 0?void 0:u.toString())!==null&&d!==void 0?d:""}\` (${typeof o.interval})`);this._carryoverConcurrencyCount=o.carryoverConcurrencyCount,this._isIntervalIgnored=o.intervalCap===1/0||o.interval===0,this._intervalCap=o.intervalCap,this._interval=o.interval,this._queue=new o.queueClass,this._queueClass=o.queueClass,this.concurrency=o.concurrency,this._timeout=o.timeout,this._throwOnTimeout=o.throwOnTimeout===!0,this._isPaused=o.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=r,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=r,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let o=Date.now();if(this._intervalId===void 0){let c=this._intervalEnd-o;if(c<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},c)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let o=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let c=this._queue.dequeue();return c?(this.emit("active"),c(),o&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(o){if(!(typeof o=="number"&&o>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${o}\` (${typeof o})`);this._concurrency=o,this._processQueue()}async add(o,c={}){return new Promise((l,u)=>{let d=async()=>{this._pendingCount++,this._intervalCount++;try{let f=this._timeout===void 0&&c.timeout===void 0?o():t.default(Promise.resolve(o()),c.timeout===void 0?this._timeout:c.timeout,()=>{(c.throwOnTimeout===void 0?this._throwOnTimeout:c.throwOnTimeout)&&u(i)});l(await f)}catch(f){u(f)}this._next()};this._queue.enqueue(d,c),this._tryToStartAnother(),this.emit("add")})}async addAll(o,c){return Promise.all(o.map(async l=>this.add(l,c)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(o=>{let c=this._resolveEmpty;this._resolveEmpty=()=>{c(),o()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(o=>{let c=this._resolveIdle;this._resolveIdle=()=>{c(),o()}})}get size(){return this._queue.size}sizeBy(o){return this._queue.filter(o).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(o){this._timeout=o}}return fl.default=a,fl}var FD=zD(),Lr=Sa(FD),BD="default"in Lr?Lr.default:Lr,ZD=[408,425,429,500,502,503,504],g0=class{constructor(t){Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxQueueSizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queueSizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.maxConcurrency=t.maxConcurrency??1/0,this.maxRetries=t.maxRetries??6,this.maxQueueSizeBytes=t.maxQueueSizeBytes,this.queue=new BD({concurrency:this.maxConcurrency}),this.onFailedResponseHook=t?.onFailedResponseHook}call(t,...n){return this.callWithOptions({},t,...n)}callWithOptions(t,n,...r){let i=t.sizeBytes??0;if(this.maxQueueSizeBytes!==void 0&&i>0&&this.queueSizeBytes+i>this.maxQueueSizeBytes)return Promise.reject(new Error(`Queue size limit (${this.maxQueueSizeBytes} bytes) exceeded. Current queue size: ${this.queueSizeBytes} bytes, attempted addition: ${i} bytes.`));i>0&&(this.queueSizeBytes+=i);let a=this.onFailedResponseHook,s=this.queue.add(()=>RD(()=>n(...r).catch(o=>{throw o instanceof Error?o:new Error(o)}),{async onFailedAttempt({error:o}){if(typeof o!="object"||o==null)throw o;let c="message"in o&&typeof o.message=="string"?o.message:void 0;if(c?.startsWith("Cancel")||c?.startsWith("TimeoutError")||c?.startsWith("AbortError")||"name"in o&&o.name==="TimeoutError"||"code"in o&&o.code==="ECONNABORTED")throw o;let l="response"in o?o.response:void 0;if(a&&await a(l))return;let u=l?.status??("status"in o?o.status:void 0);if(u!=null&&(typeof u=="number"||typeof u=="string")&&!ZD.includes(+u))throw o},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0});return i>0&&(s=s.finally(()=>{this.queueSizeBytes-=i})),t.signal?Promise.race([s,new Promise((o,c)=>{t.signal?.addEventListener("abort",()=>{c(new Error("AbortError"))})})]):s}};function _0(e){return typeof e?._getType=="function"}function y0(e){let t={type:e._getType(),data:{content:e.content}};return e?.additional_kwargs&&Object.keys(e.additional_kwargs).length>0&&(t.data.additional_kwargs={...e.additional_kwargs}),t}var ml={exports:{}},ip,v0;function mf(){if(v0)return ip;v0=1;let e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,i=t-6;return ip={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ip}var ap,b0;function gf(){return b0||(b0=1,ap=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),ap}var w0;function _c(){return w0||(w0=1,(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=mf(),a=gf();t=e.exports={};let s=t.re=[],o=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={},d=0,f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,r]],p=v=>{for(let[g,y]of h)v=v.split(`${g}*`).join(`${g}{0,${y}}`).split(`${g}+`).join(`${g}{1,${y}}`);return v},m=(v,g,y)=>{let $=p(g),S=d++;a(v,S,g),u[v]=S,c[S]=g,l[S]=$,s[S]=new RegExp(g,y?"g":void 0),o[S]=new RegExp($,y?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),m("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${f}+`),m("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),m("FULL",`^${c[u.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),m("LOOSE",`^${c[u.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),m("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),m("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",c[u.COERCE],!0),m("COERCERTLFULL",c[u.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ml,ml.exports)),ml.exports}var sp,$0;function Q_(){if($0)return sp;$0=1;let e=Object.freeze({loose:!0}),t=Object.freeze({});return sp=r=>r?typeof r!="object"?e:r:t,sp}var op,S0;function Ax(){if(S0)return op;S0=1;let e=/^[0-9]+$/,t=(r,i)=>{if(typeof r=="number"&&typeof i=="number")return r===i?0:r<i?-1:1;let a=e.test(r),s=e.test(i);return a&&s&&(r=+r,i=+i),r===i?0:a&&!s?-1:s&&!a?1:r<i?-1:1};return op={compareIdentifiers:t,rcompareIdentifiers:(r,i)=>t(i,r)},op}var cp,k0;function en(){if(k0)return cp;k0=1;let e=gf(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=mf(),{safeRe:r,t:i}=_c(),a=Q_(),{compareIdentifiers:s}=Ax();class o{constructor(l,u){if(u=a(u),l instanceof o){if(l.loose===!!u.loose&&l.includePrerelease===!!u.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;let d=l.trim().match(u.loose?r[i.LOOSE]:r[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(f=>{if(/^[0-9]+$/.test(f)){let h=+f;if(h>=0&&h<n)return h}return f}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof o)){if(typeof l=="string"&&l===this.version)return 0;l=new o(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof o||(l=new o(l,this.options)),this.major<l.major?-1:this.major>l.major?1:this.minor<l.minor?-1:this.minor>l.minor?1:this.patch<l.patch?-1:this.patch>l.patch?1:0}comparePre(l){if(l instanceof o||(l=new o(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let u=0;do{let d=this.prerelease[u],f=l.prerelease[u];if(e("prerelease compare",u,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++u)}compareBuild(l){l instanceof o||(l=new o(l,this.options));let u=0;do{let d=this.build[u],f=l.build[u];if(e("build compare",u,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++u)}inc(l,u,d){if(l.startsWith("pre")){if(!u&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(u){let f=`-${u}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!f||f[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,d),this.inc("pre",u,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,d),this.inc("pre",u,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let f=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[f];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(u===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(f)}}if(u){let h=[u,f];d===!1&&(h=[u]),s(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return cp=o,cp}var lp,x0;function Ds(){if(x0)return lp;x0=1;let e=en();return lp=(n,r,i=!1)=>{if(n instanceof e)return n;try{return new e(n,r)}catch(a){if(!i)return null;throw a}},lp}var up,I0;function VD(){if(I0)return up;I0=1;let e=Ds();return up=(n,r)=>{let i=e(n,r);return i?i.version:null},up}var dp,E0;function qD(){if(E0)return dp;E0=1;let e=Ds();return dp=(n,r)=>{let i=e(n.trim().replace(/^[=v]+/,""),r);return i?i.version:null},dp}var fp,T0;function GD(){if(T0)return fp;T0=1;let e=en();return fp=(n,r,i,a,s)=>{typeof i=="string"&&(s=a,a=i,i=void 0);try{return new e(n instanceof e?n.version:n,i).inc(r,a,s).version}catch{return null}},fp}var hp,O0;function HD(){if(O0)return hp;O0=1;let e=Ds();return hp=(n,r)=>{let i=e(n,null,!0),a=e(r,null,!0),s=i.compare(a);if(s===0)return null;let o=s>0,c=o?i:a,l=o?a:i,u=!!c.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}let f=u?"pre":"";return i.major!==a.major?f+"major":i.minor!==a.minor?f+"minor":i.patch!==a.patch?f+"patch":"prerelease"},hp}var pp,A0;function JD(){if(A0)return pp;A0=1;let e=en();return pp=(n,r)=>new e(n,r).major,pp}var mp,C0;function WD(){if(C0)return mp;C0=1;let e=en();return mp=(n,r)=>new e(n,r).minor,mp}var gp,N0;function KD(){if(N0)return gp;N0=1;let e=en();return gp=(n,r)=>new e(n,r).patch,gp}var _p,P0;function XD(){if(P0)return _p;P0=1;let e=Ds();return _p=(n,r)=>{let i=e(n,r);return i&&i.prerelease.length?i.prerelease:null},_p}var yp,R0;function Xn(){if(R0)return yp;R0=1;let e=en();return yp=(n,r,i)=>new e(n,i).compare(new e(r,i)),yp}var vp,j0;function YD(){if(j0)return vp;j0=1;let e=Xn();return vp=(n,r,i)=>e(r,n,i),vp}var bp,M0;function QD(){if(M0)return bp;M0=1;let e=Xn();return bp=(n,r)=>e(n,r,!0),bp}var wp,D0;function ey(){if(D0)return wp;D0=1;let e=en();return wp=(n,r,i)=>{let a=new e(n,i),s=new e(r,i);return a.compare(s)||a.compareBuild(s)},wp}var $p,U0;function eU(){if(U0)return $p;U0=1;let e=ey();return $p=(n,r)=>n.sort((i,a)=>e(i,a,r)),$p}var Sp,L0;function tU(){if(L0)return Sp;L0=1;let e=ey();return Sp=(n,r)=>n.sort((i,a)=>e(a,i,r)),Sp}var kp,z0;function _f(){if(z0)return kp;z0=1;let e=Xn();return kp=(n,r,i)=>e(n,r,i)>0,kp}var xp,F0;function ty(){if(F0)return xp;F0=1;let e=Xn();return xp=(n,r,i)=>e(n,r,i)<0,xp}var Ip,B0;function Cx(){if(B0)return Ip;B0=1;let e=Xn();return Ip=(n,r,i)=>e(n,r,i)===0,Ip}var Ep,Z0;function Nx(){if(Z0)return Ep;Z0=1;let e=Xn();return Ep=(n,r,i)=>e(n,r,i)!==0,Ep}var Tp,V0;function ny(){if(V0)return Tp;V0=1;let e=Xn();return Tp=(n,r,i)=>e(n,r,i)>=0,Tp}var Op,q0;function ry(){if(q0)return Op;q0=1;let e=Xn();return Op=(n,r,i)=>e(n,r,i)<=0,Op}var Ap,G0;function Px(){if(G0)return Ap;G0=1;let e=Cx(),t=Nx(),n=_f(),r=ny(),i=ty(),a=ry();return Ap=(o,c,l,u)=>{switch(c){case"===":return typeof o=="object"&&(o=o.version),typeof l=="object"&&(l=l.version),o===l;case"!==":return typeof o=="object"&&(o=o.version),typeof l=="object"&&(l=l.version),o!==l;case"":case"=":case"==":return e(o,l,u);case"!=":return t(o,l,u);case">":return n(o,l,u);case">=":return r(o,l,u);case"<":return i(o,l,u);case"<=":return a(o,l,u);default:throw new TypeError(`Invalid operator: ${c}`)}},Ap}var Cp,H0;function nU(){if(H0)return Cp;H0=1;let e=en(),t=Ds(),{safeRe:n,t:r}=_c();return Cp=(a,s)=>{if(a instanceof e)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;s=s||{};let o=null;if(!s.rtl)o=a.match(s.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);else{let h=s.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL],p;for(;(p=h.exec(a))&&(!o||o.index+o[0].length!==a.length);)(!o||p.index+p[0].length!==o.index+o[0].length)&&(o=p),h.lastIndex=p.index+p[1].length+p[2].length;h.lastIndex=-1}if(o===null)return null;let c=o[2],l=o[3]||"0",u=o[4]||"0",d=s.includePrerelease&&o[5]?`-${o[5]}`:"",f=s.includePrerelease&&o[6]?`+${o[6]}`:"";return t(`${c}.${l}.${u}${d}${f}`,s)},Cp}var Np,J0;function rU(){if(J0)return Np;J0=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){let r=this.map.get(n);if(r!==void 0)return this.map.delete(n),this.map.set(n,r),r}delete(n){return this.map.delete(n)}set(n,r){if(!this.delete(n)&&r!==void 0){if(this.map.size>=this.max){let a=this.map.keys().next().value;this.delete(a)}this.map.set(n,r)}return this}}return Np=e,Np}var Pp,W0;function Yn(){if(W0)return Pp;W0=1;let e=/\s+/g;class t{constructor(z,B){if(B=i(B),z instanceof t)return z.loose===!!B.loose&&z.includePrerelease===!!B.includePrerelease?z:new t(z.raw,B);if(z instanceof a)return this.raw=z.value,this.set=[[z]],this.formatted=void 0,this;if(this.options=B,this.loose=!!B.loose,this.includePrerelease=!!B.includePrerelease,this.raw=z.trim().replace(e," "),this.set=this.raw.split("||").map(ee=>this.parseRange(ee.trim())).filter(ee=>ee.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let ee=this.set[0];if(this.set=this.set.filter(se=>!m(se[0])),this.set.length===0)this.set=[ee];else if(this.set.length>1){for(let se of this.set)if(se.length===1&&v(se[0])){this.set=[se];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let z=0;z<this.set.length;z++){z>0&&(this.formatted+="||");let B=this.set[z];for(let ee=0;ee<B.length;ee++)ee>0&&(this.formatted+=" "),this.formatted+=B[ee].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(z){let ee=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+z,se=r.get(ee);if(se)return se;let te=this.options.loose,le=te?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];z=z.replace(le,he(this.options.includePrerelease)),s("hyphen replace",z),z=z.replace(c[l.COMPARATORTRIM],u),s("comparator trim",z),z=z.replace(c[l.TILDETRIM],d),s("tilde trim",z),z=z.replace(c[l.CARETTRIM],f),s("caret trim",z);let Ee=z.split(" ").map(Le=>y(Le,this.options)).join(" ").split(/\s+/).map(Le=>M(Le,this.options));te&&(Ee=Ee.filter(Le=>(s("loose invalid filter",Le,this.options),!!Le.match(c[l.COMPARATORLOOSE])))),s("range list",Ee);let be=new Map,Be=Ee.map(Le=>new a(Le,this.options));for(let Le of Be){if(m(Le))return[Le];be.set(Le.value,Le)}be.size>1&&be.has("")&&be.delete("");let ut=[...be.values()];return r.set(ee,ut),ut}intersects(z,B){if(!(z instanceof t))throw new TypeError("a Range is required");return this.set.some(ee=>g(ee,B)&&z.set.some(se=>g(se,B)&&ee.every(te=>se.every(le=>te.intersects(le,B)))))}test(z){if(!z)return!1;if(typeof z=="string")try{z=new o(z,this.options)}catch{return!1}for(let B=0;B<this.set.length;B++)if(Me(this.set[B],z,this.options))return!0;return!1}}Pp=t;let n=rU(),r=new n,i=Q_(),a=yf(),s=gf(),o=en(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=_c(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=mf(),m=V=>V.value==="<0.0.0-0",v=V=>V.value==="",g=(V,z)=>{let B=!0,ee=V.slice(),se=ee.pop();for(;B&&ee.length;)B=ee.every(te=>se.intersects(te,z)),se=ee.pop();return B},y=(V,z)=>(V=V.replace(c[l.BUILD],""),s("comp",V,z),V=C(V,z),s("caret",V),V=S(V,z),s("tildes",V),V=b(V,z),s("xrange",V),V=O(V,z),s("stars",V),V),$=V=>!V||V.toLowerCase()==="x"||V==="*",S=(V,z)=>V.trim().split(/\s+/).map(B=>x(B,z)).join(" "),x=(V,z)=>{let B=z.loose?c[l.TILDELOOSE]:c[l.TILDE];return V.replace(B,(ee,se,te,le,Ee)=>{s("tilde",V,ee,se,te,le,Ee);let be;return $(se)?be="":$(te)?be=`>=${se}.0.0 <${+se+1}.0.0-0`:$(le)?be=`>=${se}.${te}.0 <${se}.${+te+1}.0-0`:Ee?(s("replaceTilde pr",Ee),be=`>=${se}.${te}.${le}-${Ee} <${se}.${+te+1}.0-0`):be=`>=${se}.${te}.${le} <${se}.${+te+1}.0-0`,s("tilde return",be),be})},C=(V,z)=>V.trim().split(/\s+/).map(B=>T(B,z)).join(" "),T=(V,z)=>{s("caret",V,z);let B=z.loose?c[l.CARETLOOSE]:c[l.CARET],ee=z.includePrerelease?"-0":"";return V.replace(B,(se,te,le,Ee,be)=>{s("caret",V,se,te,le,Ee,be);let Be;return $(te)?Be="":$(le)?Be=`>=${te}.0.0${ee} <${+te+1}.0.0-0`:$(Ee)?te==="0"?Be=`>=${te}.${le}.0${ee} <${te}.${+le+1}.0-0`:Be=`>=${te}.${le}.0${ee} <${+te+1}.0.0-0`:be?(s("replaceCaret pr",be),te==="0"?le==="0"?Be=`>=${te}.${le}.${Ee}-${be} <${te}.${le}.${+Ee+1}-0`:Be=`>=${te}.${le}.${Ee}-${be} <${te}.${+le+1}.0-0`:Be=`>=${te}.${le}.${Ee}-${be} <${+te+1}.0.0-0`):(s("no pr"),te==="0"?le==="0"?Be=`>=${te}.${le}.${Ee}${ee} <${te}.${le}.${+Ee+1}-0`:Be=`>=${te}.${le}.${Ee}${ee} <${te}.${+le+1}.0-0`:Be=`>=${te}.${le}.${Ee} <${+te+1}.0.0-0`),s("caret return",Be),Be})},b=(V,z)=>(s("replaceXRanges",V,z),V.split(/\s+/).map(B=>D(B,z)).join(" ")),D=(V,z)=>{V=V.trim();let B=z.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return V.replace(B,(ee,se,te,le,Ee,be)=>{s("xRange",V,ee,se,te,le,Ee,be);let Be=$(te),ut=Be||$(le),Le=ut||$(Ee),w=Le;return se==="="&&w&&(se=""),be=z.includePrerelease?"-0":"",Be?se===">"||se==="<"?ee="<0.0.0-0":ee="*":se&&w?(ut&&(le=0),Ee=0,se===">"?(se=">=",ut?(te=+te+1,le=0,Ee=0):(le=+le+1,Ee=0)):se==="<="&&(se="<",ut?te=+te+1:le=+le+1),se==="<"&&(be="-0"),ee=`${se+te}.${le}.${Ee}${be}`):ut?ee=`>=${te}.0.0${be} <${+te+1}.0.0-0`:Le&&(ee=`>=${te}.${le}.0${be} <${te}.${+le+1}.0-0`),s("xRange return",ee),ee})},O=(V,z)=>(s("replaceStars",V,z),V.trim().replace(c[l.STAR],"")),M=(V,z)=>(s("replaceGTE0",V,z),V.trim().replace(c[z.includePrerelease?l.GTE0PRE:l.GTE0],"")),he=V=>(z,B,ee,se,te,le,Ee,be,Be,ut,Le,w)=>($(ee)?B="":$(se)?B=`>=${ee}.0.0${V?"-0":""}`:$(te)?B=`>=${ee}.${se}.0${V?"-0":""}`:le?B=`>=${B}`:B=`>=${B}${V?"-0":""}`,$(Be)?be="":$(ut)?be=`<${+Be+1}.0.0-0`:$(Le)?be=`<${Be}.${+ut+1}.0-0`:w?be=`<=${Be}.${ut}.${Le}-${w}`:V?be=`<${Be}.${ut}.${+Le+1}-0`:be=`<=${be}`,`${B} ${be}`.trim()),Me=(V,z,B)=>{for(let ee=0;ee<V.length;ee++)if(!V[ee].test(z))return!1;if(z.prerelease.length&&!B.includePrerelease){for(let ee=0;ee<V.length;ee++)if(s(V[ee].semver),V[ee].semver!==a.ANY&&V[ee].semver.prerelease.length>0){let se=V[ee].semver;if(se.major===z.major&&se.minor===z.minor&&se.patch===z.patch)return!0}return!1}return!0};return Pp}var Rp,K0;function yf(){if(K0)return Rp;K0=1;let e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,d){if(d=n(d),u instanceof t){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){let d=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],f=u.match(d);if(!f)throw new TypeError(`Invalid comparator: ${u}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new o(f[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new o(u,this.options)}catch{return!1}return a(u,this.operator,this.semver,this.options)}intersects(u,d){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new c(this.value,d).test(u.semver):(d=n(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||a(this.semver,"<",u.semver,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||a(this.semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Rp=t;let n=Q_(),{safeRe:r,t:i}=_c(),a=Px(),s=gf(),o=en(),c=Yn();return Rp}var jp,X0;function vf(){if(X0)return jp;X0=1;let e=Yn();return jp=(n,r,i)=>{try{r=new e(r,i)}catch{return!1}return r.test(n)},jp}var Mp,Y0;function iU(){if(Y0)return Mp;Y0=1;let e=Yn();return Mp=(n,r)=>new e(n,r).set.map(i=>i.map(a=>a.value).join(" ").trim().split(" ")),Mp}var Dp,Q0;function aU(){if(Q0)return Dp;Q0=1;let e=en(),t=Yn();return Dp=(r,i,a)=>{let s=null,o=null,c=null;try{c=new t(i,a)}catch{return null}return r.forEach(l=>{c.test(l)&&(!s||o.compare(l)===-1)&&(s=l,o=new e(s,a))}),s},Dp}var Up,e$;function sU(){if(e$)return Up;e$=1;let e=en(),t=Yn();return Up=(r,i,a)=>{let s=null,o=null,c=null;try{c=new t(i,a)}catch{return null}return r.forEach(l=>{c.test(l)&&(!s||o.compare(l)===1)&&(s=l,o=new e(s,a))}),s},Up}var Lp,t$;function oU(){if(t$)return Lp;t$=1;let e=en(),t=Yn(),n=_f();return Lp=(i,a)=>{i=new t(i,a);let s=new e("0.0.0");if(i.test(s)||(s=new e("0.0.0-0"),i.test(s)))return s;s=null;for(let o=0;o<i.set.length;++o){let c=i.set[o],l=null;c.forEach(u=>{let d=new e(u.semver.version);switch(u.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!l||n(d,l))&&(l=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${u.operator}`)}}),l&&(!s||n(s,l))&&(s=l)}return s&&i.test(s)?s:null},Lp}var zp,n$;function cU(){if(n$)return zp;n$=1;let e=Yn();return zp=(n,r)=>{try{return new e(n,r).range||"*"}catch{return null}},zp}var Fp,r$;function iy(){if(r$)return Fp;r$=1;let e=en(),t=yf(),{ANY:n}=t,r=Yn(),i=vf(),a=_f(),s=ty(),o=ry(),c=ny();return Fp=(u,d,f,h)=>{u=new e(u,h),d=new r(d,h);let p,m,v,g,y;switch(f){case">":p=a,m=o,v=s,g=">",y=">=";break;case"<":p=s,m=c,v=a,g="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(u,d,h))return!1;for(let $=0;$<d.set.length;++$){let S=d.set[$],x=null,C=null;if(S.forEach(T=>{T.semver===n&&(T=new t(">=0.0.0")),x=x||T,C=C||T,p(T.semver,x.semver,h)?x=T:v(T.semver,C.semver,h)&&(C=T)}),x.operator===g||x.operator===y||(!C.operator||C.operator===g)&&m(u,C.semver))return!1;if(C.operator===y&&v(u,C.semver))return!1}return!0},Fp}var Bp,i$;function lU(){if(i$)return Bp;i$=1;let e=iy();return Bp=(n,r,i)=>e(n,r,">",i),Bp}var Zp,a$;function uU(){if(a$)return Zp;a$=1;let e=iy();return Zp=(n,r,i)=>e(n,r,"<",i),Zp}var Vp,s$;function dU(){if(s$)return Vp;s$=1;let e=Yn();return Vp=(n,r,i)=>(n=new e(n,i),r=new e(r,i),n.intersects(r,i)),Vp}var qp,o$;function fU(){if(o$)return qp;o$=1;let e=vf(),t=Xn();return qp=(n,r,i)=>{let a=[],s=null,o=null,c=n.sort((f,h)=>t(f,h,i));for(let f of c)e(f,r,i)?(o=f,s||(s=f)):(o&&a.push([s,o]),o=null,s=null);s&&a.push([s,null]);let l=[];for(let[f,h]of a)f===h?l.push(f):!h&&f===c[0]?l.push("*"):h?f===c[0]?l.push(`<=${h}`):l.push(`${f} - ${h}`):l.push(`>=${f}`);let u=l.join(" || "),d=typeof r.raw=="string"?r.raw:String(r);return u.length<d.length?u:r},qp}var Gp,c$;function hU(){if(c$)return Gp;c$=1;let e=Yn(),t=yf(),{ANY:n}=t,r=vf(),i=Xn(),a=(d,f,h={})=>{if(d===f)return!0;d=new e(d,h),f=new e(f,h);let p=!1;e:for(let m of d.set){for(let v of f.set){let g=c(m,v,h);if(p=p||g!==null,g)continue e}if(p)return!1}return!0},s=[new t(">=0.0.0-0")],o=[new t(">=0.0.0")],c=(d,f,h)=>{if(d===f)return!0;if(d.length===1&&d[0].semver===n){if(f.length===1&&f[0].semver===n)return!0;h.includePrerelease?d=s:d=o}if(f.length===1&&f[0].semver===n){if(h.includePrerelease)return!0;f=o}let p=new Set,m,v;for(let b of d)b.operator===">"||b.operator===">="?m=l(m,b,h):b.operator==="<"||b.operator==="<="?v=u(v,b,h):p.add(b.semver);if(p.size>1)return null;let g;if(m&&v){if(g=i(m.semver,v.semver,h),g>0)return null;if(g===0&&(m.operator!==">="||v.operator!=="<="))return null}for(let b of p){if(m&&!r(b,String(m),h)||v&&!r(b,String(v),h))return null;for(let D of f)if(!r(b,String(D),h))return!1;return!0}let y,$,S,x,C=v&&!h.includePrerelease&&v.semver.prerelease.length?v.semver:!1,T=m&&!h.includePrerelease&&m.semver.prerelease.length?m.semver:!1;C&&C.prerelease.length===1&&v.operator==="<"&&C.prerelease[0]===0&&(C=!1);for(let b of f){if(x=x||b.operator===">"||b.operator===">=",S=S||b.operator==="<"||b.operator==="<=",m){if(T&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===T.major&&b.semver.minor===T.minor&&b.semver.patch===T.patch&&(T=!1),b.operator===">"||b.operator===">="){if(y=l(m,b,h),y===b&&y!==m)return!1}else if(m.operator===">="&&!r(m.semver,String(b),h))return!1}if(v){if(C&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===C.major&&b.semver.minor===C.minor&&b.semver.patch===C.patch&&(C=!1),b.operator==="<"||b.operator==="<="){if($=u(v,b,h),$===b&&$!==v)return!1}else if(v.operator==="<="&&!r(v.semver,String(b),h))return!1}if(!b.operator&&(v||m)&&g!==0)return!1}return!(m&&S&&!v&&g!==0||v&&x&&!m&&g!==0||T||C)},l=(d,f,h)=>{if(!d)return f;let p=i(d.semver,f.semver,h);return p>0?d:p<0||f.operator===">"&&d.operator===">="?f:d},u=(d,f,h)=>{if(!d)return f;let p=i(d.semver,f.semver,h);return p<0?d:p>0||f.operator==="<"&&d.operator==="<="?f:d};return Gp=a,Gp}var Hp,l$;function pU(){if(l$)return Hp;l$=1;let e=_c(),t=mf(),n=en(),r=Ax(),i=Ds(),a=VD(),s=qD(),o=GD(),c=HD(),l=JD(),u=WD(),d=KD(),f=XD(),h=Xn(),p=YD(),m=QD(),v=ey(),g=eU(),y=tU(),$=_f(),S=ty(),x=Cx(),C=Nx(),T=ny(),b=ry(),D=Px(),O=nU(),M=yf(),he=Yn(),Me=vf(),V=iU(),z=aU(),B=sU(),ee=oU(),se=cU(),te=iy(),le=lU(),Ee=uU(),be=dU(),Be=fU(),ut=hU();return Hp={parse:i,valid:a,clean:s,inc:o,diff:c,major:l,minor:u,patch:d,prerelease:f,compare:h,rcompare:p,compareLoose:m,compareBuild:v,sort:g,rsort:y,gt:$,lt:S,eq:x,neq:C,gte:T,lte:b,cmp:D,coerce:O,Comparator:M,Range:he,satisfies:Me,toComparators:V,maxSatisfying:z,minSatisfying:B,minVersion:ee,validRange:se,outside:te,gtr:le,ltr:Ee,intersects:be,simplifyRange:Be,subset:ut,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers},Hp}pU();function Jp(e){return`Invalid prompt identifier format: "${e}". Expected one of:
484
- - "prompt-name" (for private prompts)
485
- - "owner/prompt-name" (for prompts with explicit owner)
486
- - "prompt-name:commit-hash" (with commit reference)
487
- - "owner/prompt-name:commit-hash" (with owner and commit)`}var Km=class extends Error{constructor(t){super(t),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="LangSmithConflictError",this.status=409}},Xm=class extends Error{constructor(t){super(t),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="LangSmithNotFoundError",this.status=404}};function u$(e){return e!=null&&typeof e=="object"&&"name"in e&&e?.name==="LangSmithNotFoundError"}async function ie(e,t,n){let r;if(e.ok){n&&(r=await e.text());return}if(e.status===403)try{(await e.json())?.error==="org_scoped_key_requires_workspace"&&(r="This API key is org-scoped and requires workspace specification. Please provide 'workspaceId' parameter, or set LANGSMITH_WORKSPACE_ID environment variable.")}catch{let o=new Error(`${e.status} ${e.statusText}`);throw o.status=e?.status,o}if(r===void 0)try{r=await e.text()}catch{r=""}let i=`Failed to ${t}. Received status [${e.status}]: ${e.statusText}. Message: ${r}`;if(e.status===404)throw new Xm(i);if(e.status===409)throw new Km(i);let a=new Error(i);throw a.status=e.status,a}var Rx="ERR_CONFLICTING_ENDPOINTS",Ym=class extends Error{constructor(){super("You cannot provide both LANGSMITH_ENDPOINT / LANGCHAIN_ENDPOINT and LANGSMITH_RUNS_ENDPOINTS."),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:Rx}),this.name="ConflictingEndpointsError"}};function mU(e){return typeof e=="object"&&e!==null&&e.code===Rx}function xr(e){if(!e||e.split("/").length>2||e.startsWith("/")||e.endsWith("/")||e.split(":").length>2)throw new Error(Jp(e));let[t,n]=e.split(":"),r=n||"latest";if(t.includes("/")){let[i,a]=t.split("/",2);if(!i||!a)throw new Error(Jp(e));return[i,a,r]}else{if(!t)throw new Error(Jp(e));return["-",t,r]}}var d$="[...]",gU={result:"[Circular]"},ku=[],Va=[],_U=new TextEncoder;function yU(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function gl(e){return _U.encode(e)}function jx(e){if(e&&typeof e=="object"&&e!==null){if(e instanceof Map)return Object.fromEntries(e);if(e instanceof Set)return Array.from(e);if(e instanceof Date)return e.toISOString();if(e instanceof RegExp)return e.toString();if(e instanceof Error)return{name:e.name,message:e.message}}else if(typeof e=="bigint")return e.toString();return e}function vU(e){return function(t,n){return jx(n)}}function mn(e,t,n,r,i){try{let a=JSON.stringify(e,vU(n),r);return gl(a)}catch(a){if(!a.message?.includes("Converting circular structure to JSON"))return console.warn(`[WARNING]: LangSmith received unserializable value.${t?`
488
- Context: ${t}`:""}`),gl("[Unserializable]");Pt("SUPPRESS_CIRCULAR_JSON_WARNINGS")!=="true"&&console.warn(`[WARNING]: LangSmith received circular JSON. This will decrease tracer performance. ${t?`
489
- Context: ${t}`:""}`),typeof i>"u"&&(i=yU()),Qm(e,"",0,[],void 0,0,i);let s;try{Va.length===0?s=JSON.stringify(e,n,r):s=JSON.stringify(e,bU(n),r)}catch{return gl("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;ku.length!==0;){let o=ku.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return gl(s)}}function Wp(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);i.get!==void 0?i.configurable?(Object.defineProperty(r,n,{value:e}),ku.push([r,n,t,i])):Va.push([t,n,e]):(r[n]=e,ku.push([r,n,t]))}function Qm(e,t,n,r,i,a,s){a+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<r.length;o++)if(r[o]===e){Wp(gU,e,t,i);return}if(typeof s.depthLimit<"u"&&a>s.depthLimit){Wp(d$,e,t,i);return}if(typeof s.edgesLimit<"u"&&n+1>s.edgesLimit){Wp(d$,e,t,i);return}if(r.push(e),Array.isArray(e))for(o=0;o<e.length;o++)Qm(e[o],o,o,r,e,a,s);else{e=jx(e);var c=Object.keys(e);for(o=0;o<c.length;o++){var l=c[o];Qm(e[l],l,o,r,e,a,s)}}r.pop()}}function bU(e){return e=typeof e<"u"?e:function(t,n){return n},function(t,n){if(Va.length>0)for(var r=0;r<Va.length;r++){var i=Va[r];if(i[1]===t&&i[0]===n){n=i[2],Va.splice(r,1);break}}return e.call(this,t,n)}}function f$(e){return typeof e=="string"&&e.length>0&&!e.includes("Z")&&!e.includes("+")&&!e.includes("-",10)?e+"Z":e}function Gs(e){return{...e,start_time:f$(e.start_time),end_time:f$(e.end_time)}}function h$(e,t,n){if(n)return e;let r=Ix(),i=t??Ex(),a=e.extra??{},s=a.metadata;return e.extra={...a,runtime:{...r,...a?.runtime},metadata:{...i,...i.revision_id||"revision_id"in e&&e.revision_id?{revision_id:("revision_id"in e?e.revision_id:void 0)??i.revision_id}:{},...s}},e}var wU=e=>{let t=e?.toString()??Pt("TRACING_SAMPLING_RATE");if(t===void 0)return;let n=parseFloat(t);if(n<0||n>1)throw new Error(`LANGSMITH_TRACING_SAMPLING_RATE must be between 0 and 1 if set. Got: ${n}`);return n},$U=e=>{let n=e.replace("http://","").replace("https://","").split("/")[0].split(":")[0];return n==="localhost"||n==="127.0.0.1"||n==="::1"};async function SU(e){let t=[];for await(let n of e)t.push(n);return t}function _l(e){if(e!==void 0)return e.trim().replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1")}var kU=async e=>{if(e?.status===429){let t=parseInt(e.headers.get("retry-after")??"10",10)*1e3;if(t>0)return await new Promise(n=>setTimeout(n,t)),!0}return!1};function p$(e){return typeof e=="number"?Number(e.toFixed(4)):e}var xU=24*1024*1024,Mx=1024*1024*1024,IU=1e4,EU=100,m$="https://api.smith.langchain.com",eg=class{constructor(t){Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"sizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"maxSizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSizeBytes=t??Mx}peek(){return this.items[0]}push(t){let n,r=new Promise(a=>{n=a}),i=mn(t.item,`Serializing run with id: ${t.item.id}`).length;return this.sizeBytes+i>this.maxSizeBytes&&this.items.length>0?(console.warn(`AutoBatchQueue size limit (${this.maxSizeBytes} bytes) exceeded. Dropping run with id: ${t.item.id}. Current queue size: ${this.sizeBytes} bytes, attempted addition: ${i} bytes.`),n(),r):(this.items.push({action:t.action,payload:t.item,otelContext:t.otelContext,apiKey:t.apiKey,apiUrl:t.apiUrl,itemPromiseResolve:n,itemPromise:r,size:i}),this.sizeBytes+=i,r)}pop({upToSizeBytes:t,upToSize:n}){if(t<1)throw new Error("Number of bytes to pop off may not be less than 1.");let r=[],i=0;for(;i+(this.peek()?.size??0)<t&&this.items.length>0&&r.length<n;){let a=this.items.shift();a&&(r.push(a),i+=a.size,this.sizeBytes-=a.size)}if(r.length===0&&this.items.length>0){let a=this.items.shift();r.push(a),i+=a.size,this.sizeBytes-=a.size}return[r.map(a=>({action:a.action,item:a.payload,otelContext:a.otelContext,apiKey:a.apiKey,apiUrl:a.apiUrl,size:a.size})),()=>r.forEach(a=>a.itemPromiseResolve())]}},is=class e{get _fetch(){return this.fetchImplementation||jM(this.debug)}constructor(t={}){Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"webUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"workspaceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"caller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchIngestCaller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeout_ms",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tenantId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hideInputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideOutputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"omitTracedRuntimeInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracingSampleRate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"filteredPostUuids",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"autoBatchTracing",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"autoBatchQueue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"autoBatchTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"autoBatchAggregationDelayMs",{enumerable:!0,configurable:!0,writable:!0,value:250}),Object.defineProperty(this,"batchSizeBytesLimit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchSizeLimit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetchOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"blockOnRootRunFinalization",{enumerable:!0,configurable:!0,writable:!0,value:yr("LANGSMITH_TRACING_BACKGROUND")==="false"}),Object.defineProperty(this,"traceBatchConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:5}),Object.defineProperty(this,"_serverInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_getServerInfoPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"manualFlushMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"langSmithToOTELTranslator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetchImplementation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cachedLSEnvVarsForMetadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_promptCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"multipartStreamingDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_multipartDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_runCompressionDisabled",{enumerable:!0,configurable:!0,writable:!0,value:Pt("DISABLE_RUN_COMPRESSION")==="true"}),Object.defineProperty(this,"failedTracesDir",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"failedTracesMaxBytes",{enumerable:!0,configurable:!0,writable:!0,value:100*1024*1024}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:yr("LANGSMITH_DEBUG")==="true"});let n=e.getDefaultClientConfig();if(this.tracingSampleRate=wU(t.tracingSamplingRate),this.apiUrl=_l(t.apiUrl??n.apiUrl)??"",this.apiUrl.endsWith("/")&&(this.apiUrl=this.apiUrl.slice(0,-1)),this.apiKey=_l(t.apiKey??n.apiKey),this.webUrl=_l(t.webUrl??n.webUrl),this.webUrl?.endsWith("/")&&(this.webUrl=this.webUrl.slice(0,-1)),this.workspaceId=_l(t.workspaceId??Pt("WORKSPACE_ID")),this.timeout_ms=t.timeout_ms??9e4,this.caller=new g0({...t.callerOptions??{},maxRetries:4,debug:t.debug??this.debug}),this.traceBatchConcurrency=t.traceBatchConcurrency??this.traceBatchConcurrency,this.traceBatchConcurrency<1)throw new Error("Trace batch concurrency must be positive.");this.debug=t.debug??this.debug,this.fetchImplementation=t.fetchImplementation,this.failedTracesDir=Pt("FAILED_TRACES_DIR")||void 0;let r=Pt("FAILED_TRACES_MAX_MB");if(r){let a=parseInt(r,10);Number.isFinite(a)&&a>0&&(this.failedTracesMaxBytes=a*1024*1024)}let i=t.maxIngestMemoryBytes??Mx;this.batchIngestCaller=new g0({maxRetries:4,maxConcurrency:this.traceBatchConcurrency,maxQueueSizeBytes:i,...t.callerOptions??{},onFailedResponseHook:kU,debug:t.debug??this.debug}),this.hideInputs=t.hideInputs??t.anonymizer??n.hideInputs,this.hideOutputs=t.hideOutputs??t.anonymizer??n.hideOutputs,this.omitTracedRuntimeInfo=t.omitTracedRuntimeInfo??!1,this.autoBatchTracing=t.autoBatchTracing??this.autoBatchTracing,this.autoBatchQueue=new eg(i),this.blockOnRootRunFinalization=t.blockOnRootRunFinalization??this.blockOnRootRunFinalization,this.batchSizeBytesLimit=t.batchSizeBytesLimit,this.batchSizeLimit=t.batchSizeLimit,this.fetchOptions=t.fetchOptions||{},this.manualFlushMode=t.manualFlushMode??this.manualFlushMode,Tx()&&(this.langSmithToOTELTranslator=new Wm),this.cachedLSEnvVarsForMetadata=Ex(),t.cache!==void 0&&t.disablePromptCache&&Hl("Both 'cache' and 'disablePromptCache' were provided. The 'cache' parameter is deprecated and will be removed in a future version. Using 'cache' parameter value."),t.cache!==void 0?(Hl("The 'cache' parameter is deprecated and will be removed in a future version. Use 'configureGlobalPromptCache()' to configure the global cache, or 'disablePromptCache: true' to disable caching for this client."),t.cache===!1?this._promptCache=void 0:t.cache===!0?this._promptCache=o0:this._promptCache=t.cache):t.disablePromptCache||(this._promptCache=o0)}static getDefaultClientConfig(){let t=Pt("API_KEY"),n=Pt("ENDPOINT")??m$,r=Pt("HIDE_INPUTS")==="true",i=Pt("HIDE_OUTPUTS")==="true";return{apiUrl:n,apiKey:t,webUrl:void 0,hideInputs:r,hideOutputs:i}}getHostUrl(){return this.webUrl?this.webUrl:$U(this.apiUrl)?(this.webUrl="http://localhost:3000",this.webUrl):this.apiUrl.endsWith("/api/v1")?(this.webUrl=this.apiUrl.replace("/api/v1",""),this.webUrl):this.apiUrl.includes("/api")&&!this.apiUrl.split(".",1)[0].endsWith("api")?(this.webUrl=this.apiUrl.replace("/api",""),this.webUrl):this.apiUrl.split(".",1)[0].includes("dev")?(this.webUrl="https://dev.smith.langchain.com",this.webUrl):this.apiUrl.split(".",1)[0].includes("eu")?(this.webUrl="https://eu.smith.langchain.com",this.webUrl):this.apiUrl.split(".",1)[0].includes("aws")?(this.webUrl="https://aws.smith.langchain.com",this.webUrl):this.apiUrl.split(".",1)[0].includes("beta")?(this.webUrl="https://beta.smith.langchain.com",this.webUrl):(this.webUrl="https://smith.langchain.com",this.webUrl)}get headers(){let t={"User-Agent":`langsmith-js/${Sx}`};return this.apiKey&&(t["x-api-key"]=`${this.apiKey}`),this.workspaceId&&(t["x-tenant-id"]=this.workspaceId),t}_getPlatformEndpointPath(t){return this.apiUrl.slice(-3)!=="/v1"&&this.apiUrl.slice(-4)!=="/v1/"?`/v1/platform/${t}`:`/platform/${t}`}async processInputs(t){return this.hideInputs===!1?t:this.hideInputs===!0?{}:typeof this.hideInputs=="function"?this.hideInputs(t):t}async processOutputs(t){return this.hideOutputs===!1?t:this.hideOutputs===!0?{}:typeof this.hideOutputs=="function"?this.hideOutputs(t):t}async prepareRunCreateOrUpdateInputs(t){let n={...t};return n.inputs!==void 0&&(n.inputs=await this.processInputs(n.inputs)),n.outputs!==void 0&&(n.outputs=await this.processOutputs(n.outputs)),n}async _getResponse(t,n){let r=n?.toString()??"",i=`${this.apiUrl}${t}?${r}`;return await this.caller.call(async()=>{let s=await this._fetch(i,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(s,`fetch ${t}`),s})}async _get(t,n){return(await this._getResponse(t,n)).json()}async*_getPaginated(t,n=new URLSearchParams,r){let i=Number(n.get("offset"))||0,a=Number(n.get("limit"))||100;for(;;){n.set("offset",String(i)),n.set("limit",String(a));let s=`${this.apiUrl}${t}?${n}`,o=await this.caller.call(async()=>{let l=await this._fetch(s,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(l,`fetch ${t}`),l}),c=r?r(await o.json()):await o.json();if(c.length===0||(yield c,c.length<a))break;i+=c.length}}async*_getCursorPaginatedList(t,n=null,r="POST",i="runs"){let a=n?{...n}:{};for(;;){let s=JSON.stringify(a),c=await(await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}${t}`,{method:r,headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await ie(u,`fetch ${t}`),u})).json();if(!c||!c[i])break;yield c[i];let l=c.cursors;if(!l||!l.next)break;a.cursor=l.next}}_shouldSample(){return this.tracingSampleRate===void 0?!0:Math.random()<this.tracingSampleRate}_filterForSampling(t,n=!1){if(this.tracingSampleRate===void 0)return t;if(n){let r=[];for(let i of t)this.filteredPostUuids.has(i.trace_id)?i.id===i.trace_id&&this.filteredPostUuids.delete(i.trace_id):r.push(i);return r}else{let r=[];for(let i of t){let a=i.trace_id??i.id;this.filteredPostUuids.has(a)||(i.id===a?this._shouldSample()?r.push(i):this.filteredPostUuids.add(a):r.push(i))}return r}}async _getBatchSizeLimitBytes(){let t=await this._ensureServerInfo();return this.batchSizeBytesLimit??t?.batch_ingest_config?.size_limit_bytes??xU}async _getBatchSizeLimit(){let t=await this._ensureServerInfo();return this.batchSizeLimit??t?.batch_ingest_config?.size_limit??EU}async _getDatasetExamplesMultiPartSupport(){return(await this._ensureServerInfo()).instance_flags?.dataset_examples_multipart_enabled??!1}drainAutoBatchQueue({batchSizeLimitBytes:t,batchSizeLimit:n}){let r=[];for(;this.autoBatchQueue.items.length>0;){let[i,a]=this.autoBatchQueue.pop({upToSizeBytes:t,upToSize:n});if(!i.length){a();break}let s=i.reduce((l,u)=>{let d=u.apiUrl??this.apiUrl,f=u.apiKey??this.apiKey,p=u.apiKey===this.apiKey&&u.apiUrl===this.apiUrl?"default":`${d}|${f}`;return l[p]||(l[p]=[]),l[p].push(u),l},{}),o=[];for(let[l,u]of Object.entries(s)){let d=this._processBatch(u,{apiUrl:l==="default"?void 0:l.split("|")[0],apiKey:l==="default"?void 0:l.split("|")[1]});o.push(d)}let c=Promise.all(o).finally(a);r.push(c)}return Promise.all(r)}static async _writeTraceToFallbackDir(t,n,r,i,a){try{let s=typeof n=="string"?Buffer.from(n,"utf8"):Buffer.from(n),o=JSON.stringify({version:1,endpoint:i,headers:r,body_base64:s.toString("base64")}),c=`trace_${Date.now()}_${zi().slice(0,8)}.json`,l=Zm.join(t,c);if(e._fallbackDirsCreated.has(t)||(await lD(t),e._fallbackDirsCreated.add(t)),a!==void 0&&a>0)try{let d=(await dD(t)).filter(h=>h.startsWith("trace_")&&h.endsWith(".json")),f=0;for(let h of d){let{size:p}=await fD(Zm.join(t,h));f+=p}if(f>=a){console.warn(`Could not write trace to fallback dir ${t} as it's already over size limit (${f} bytes >= ${a} bytes). Increase LANGSMITH_FAILED_TRACES_MAX_MB if possible.`);return}}catch{}await uD(l,o),console.warn(`LangSmith trace upload failed; data saved to ${l} for later replay.`)}catch(s){console.error(`LangSmith tracing error: could not write trace to fallback dir ${t}:`,s)}}async _processBatch(t,n){if(!t.length)return;let r=t.reduce((i,a)=>i+(a.size??0),0);try{if(this.langSmithToOTELTranslator!==void 0)this._sendBatchToOTELTranslator(t);else{let i={runCreates:t.filter(o=>o.action==="create").map(o=>o.item),runUpdates:t.filter(o=>o.action==="update").map(o=>o.item)},a=await this._ensureServerInfo();if(!this._multipartDisabled&&(a?.batch_ingest_config?.use_multipart_endpoint??!0)){let o=!this._runCompressionDisabled&&a?.instance_flags?.gzip_body_enabled;try{await this.multipartIngestRuns(i,{...n,useGzip:o,sizeBytes:r})}catch(c){if(u$(c))this._multipartDisabled=!0,await this.batchIngestRuns(i,{...n,sizeBytes:r});else throw c}}else await this.batchIngestRuns(i,{...n,sizeBytes:r})}}catch(i){console.error("Error exporting batch:",i)}}_sendBatchToOTELTranslator(t){if(this.langSmithToOTELTranslator!==void 0){let n=new Map,r=[];for(let i of t)i.item.id&&i.otelContext&&(n.set(i.item.id,i.otelContext),i.action==="create"?r.push({operation:"post",id:i.item.id,trace_id:i.item.trace_id??i.item.id,run:i.item}):r.push({operation:"patch",id:i.item.id,trace_id:i.item.trace_id??i.item.id,run:i.item}));this.langSmithToOTELTranslator.exportBatch(r,n)}}async processRunOperation(t){clearTimeout(this.autoBatchTimeout),this.autoBatchTimeout=void 0,t.item=h$(t.item,this.cachedLSEnvVarsForMetadata,this.omitTracedRuntimeInfo);let n=this.autoBatchQueue.push(t);if(this.manualFlushMode)return n;let r=await this._getBatchSizeLimitBytes(),i=await this._getBatchSizeLimit();return(this.autoBatchQueue.sizeBytes>r||this.autoBatchQueue.items.length>i)&&this.drainAutoBatchQueue({batchSizeLimitBytes:r,batchSizeLimit:i}),this.autoBatchQueue.items.length>0&&(this.autoBatchTimeout=setTimeout(()=>{this.autoBatchTimeout=void 0,this.drainAutoBatchQueue({batchSizeLimitBytes:r,batchSizeLimit:i})},this.autoBatchAggregationDelayMs)),n}async _getServerInfo(){let n=await(await this.caller.call(async()=>{let r=await this._fetch(`${this.apiUrl}/info`,{method:"GET",headers:{Accept:"application/json"},signal:AbortSignal.timeout(IU),...this.fetchOptions});return await ie(r,"get server info"),r})).json();return this.debug&&console.log(`
490
- === LangSmith Server Configuration ===
491
- `+JSON.stringify(n,null,2)+`
492
- `),n}async _ensureServerInfo(){return this._getServerInfoPromise===void 0&&(this._getServerInfoPromise=(async()=>{if(this._serverInfo===void 0)try{this._serverInfo=await this._getServerInfo()}catch(t){console.warn(`[LANGSMITH]: Failed to fetch info on supported operations. Falling back to batch operations and default limits. Info: ${t.status??"Unspecified status code"} ${t.message}`)}return this._serverInfo??{}})()),this._getServerInfoPromise.then(t=>(this._serverInfo===void 0&&(this._getServerInfoPromise=void 0),t))}async _getSettings(){return this.settings||(this.settings=this._get("/settings")),await this.settings}async flush(){let t=await this._getBatchSizeLimitBytes(),n=await this._getBatchSizeLimit();await this.drainAutoBatchQueue({batchSizeLimitBytes:t,batchSizeLimit:n})}_cloneCurrentOTELContext(){let t=Ox(),n=$D();if(this.langSmithToOTELTranslator!==void 0){let r=t.getActiveSpan();if(r)return t.setSpan(n.active(),r)}}async createRun(t,n){if(!this._filterForSampling([t]).length)return;let r={...this.headers,"Content-Type":"application/json"},i=t.project_name;delete t.project_name;let a=await this.prepareRunCreateOrUpdateInputs({session_name:i,...t,start_time:t.start_time??Date.now()});if(this.autoBatchTracing&&a.trace_id!==void 0&&a.dotted_order!==void 0){let c=this._cloneCurrentOTELContext();this.processRunOperation({action:"create",item:a,otelContext:c,apiKey:n?.apiKey,apiUrl:n?.apiUrl}).catch(console.error);return}let s=h$(a,this.cachedLSEnvVarsForMetadata,this.omitTracedRuntimeInfo);n?.apiKey!==void 0&&(r["x-api-key"]=n.apiKey),n?.workspaceId!==void 0&&(r["x-tenant-id"]=n.workspaceId);let o=mn(s,`Creating run with id: ${s.id}`);await this.caller.call(async()=>{let c=await this._fetch(`${n?.apiUrl??this.apiUrl}/runs`,{method:"POST",headers:r,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:o});return await ie(c,"create run",!0),c})}async batchIngestRuns({runCreates:t,runUpdates:n},r){if(t===void 0&&n===void 0)return;let i=await Promise.all(t?.map(c=>this.prepareRunCreateOrUpdateInputs(c))??[]),a=await Promise.all(n?.map(c=>this.prepareRunCreateOrUpdateInputs(c))??[]);if(i.length>0&&a.length>0){let c=i.reduce((u,d)=>(d.id&&(u[d.id]=d),u),{}),l=[];for(let u of a)u.id!==void 0&&c[u.id]?c[u.id]={...c[u.id],...u}:l.push(u);i=Object.values(c),a=l}let s={post:i,patch:a};if(!s.post.length&&!s.patch.length)return;let o={post:[],patch:[]};for(let c of["post","patch"]){let l=c,u=s[l].reverse(),d=u.pop();for(;d!==void 0;)o[l].push(d),d=u.pop()}if(o.post.length>0||o.patch.length>0){let c=o.post.map(l=>l.id).concat(o.patch.map(l=>l.id)).join(",");await this._postBatchIngestRuns(mn(o,`Ingesting runs with ids: ${c}`),r)}}async _postBatchIngestRuns(t,n){let r={...this.headers,"Content-Type":"application/json",Accept:"application/json"};n?.apiKey!==void 0&&(r["x-api-key"]=n.apiKey),await this.batchIngestCaller.callWithOptions({sizeBytes:n?.sizeBytes},async()=>{let i=await this._fetch(`${n?.apiUrl??this.apiUrl}/runs/batch`,{method:"POST",headers:r,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:t});return await ie(i,"batch create run",!0),i})}async multipartIngestRuns({runCreates:t,runUpdates:n},r){if(t===void 0&&n===void 0)return;let i={},a=[];for(let d of t??[]){let f=await this.prepareRunCreateOrUpdateInputs(d);f.id!==void 0&&f.attachments!==void 0&&(i[f.id]=f.attachments),delete f.attachments,a.push(f)}let s=[];for(let d of n??[])s.push(await this.prepareRunCreateOrUpdateInputs(d));if(a.find(d=>d.trace_id===void 0||d.dotted_order===void 0)!==void 0)throw new Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when creating a run');if(s.find(d=>d.trace_id===void 0||d.dotted_order===void 0)!==void 0)throw new Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when updating a run');if(a.length>0&&s.length>0){let d=a.reduce((h,p)=>(p.id&&(h[p.id]=p),h),{}),f=[];for(let h of s)h.id!==void 0&&d[h.id]?d[h.id]={...d[h.id],...h}:f.push(h);a=Object.values(d),s=f}if(a.length===0&&s.length===0)return;let l=[],u=[];for(let[d,f]of[["post",a],["patch",s]])for(let h of f){let{inputs:p,outputs:m,events:v,extra:g,error:y,serialized:$,attachments:S,...x}=h,C={inputs:p,outputs:m,events:v,extra:g,error:y,serialized:$},T=mn(x,`Serializing for multipart ingestion of run with id: ${x.id}`);u.push({name:`${d}.${x.id}`,payload:new Blob([T],{type:`application/json; length=${T.length}`})});for(let[b,D]of Object.entries(C)){if(D===void 0)continue;let O=mn(D,`Serializing ${b} for multipart ingestion of run with id: ${x.id}`);u.push({name:`${d}.${x.id}.${b}`,payload:new Blob([O],{type:`application/json; length=${O.length}`})})}if(x.id!==void 0){let b=i[x.id];if(b){delete i[x.id];for(let[D,O]of Object.entries(b)){let M,he;if(Array.isArray(O)?[M,he]=O:(M=O.mimeType,he=O.data),D.includes(".")){console.warn(`Skipping attachment '${D}' for run ${x.id}: Invalid attachment name. Attachment names must not contain periods ('.'). Please rename the attachment and try again.`);continue}u.push({name:`attachment.${x.id}.${D}`,payload:new Blob([he],{type:`${M}; length=${he.byteLength}`})})}}}l.push(`trace=${x.trace_id},id=${x.id}`)}await this._sendMultipartRequest(u,l.join("; "),r)}async _createNodeFetchBody(t,n){let r=[];for(let s of t)r.push(new Blob([`--${n}\r
493
- `])),r.push(new Blob([`Content-Disposition: form-data; name="${s.name}"\r
494
- `,`Content-Type: ${s.payload.type}\r
495
- \r
496
- `])),r.push(s.payload),r.push(new Blob([`\r
497
- `]));return r.push(new Blob([`--${n}--\r
498
- `])),await new Blob(r).arrayBuffer()}async _createMultipartStream(t,n){let r=new TextEncoder;return new ReadableStream({async start(a){let s=async o=>{typeof o=="string"?a.enqueue(r.encode(o)):a.enqueue(o)};for(let o of t){await s(`--${n}\r
499
- `),await s(`Content-Disposition: form-data; name="${o.name}"\r
500
- `),await s(`Content-Type: ${o.payload.type}\r
501
- \r
502
- `);let l=o.payload.stream().getReader();try{let u;for(;!(u=await l.read()).done;)a.enqueue(u.value)}finally{l.releaseLock()}await s(`\r
503
- `)}await s(`--${n}--\r
504
- `),a.close()}})}async _sendMultipartRequest(t,n,r){let i="----LangSmithFormBoundary"+Math.random().toString(36).slice(2),a=()=>this._createNodeFetchBody(t,i),s=()=>this._createMultipartStream(t,i),o=async c=>this.batchIngestCaller.callWithOptions({sizeBytes:r?.sizeBytes},async()=>{let l=await c(),u={...this.headers,"Content-Type":`multipart/form-data; boundary=${i}`};r?.apiKey!==void 0&&(u["x-api-key"]=r.apiKey);let d=l;r?.useGzip&&typeof l=="object"&&"pipeThrough"in l&&(d=l.pipeThrough(new CompressionStream("gzip")),u["Content-Encoding"]="gzip");let f=await this._fetch(`${r?.apiUrl??this.apiUrl}/runs/multipart`,{method:"POST",headers:u,body:d,duplex:"half",signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(f,"Failed to send multipart request",!0),f});try{let c,l=!1;RM()&&!this.multipartStreamingDisabled&&xx()!=="bun"?(l=!0,c=await o(s)):c=await o(a),(!this.multipartStreamingDisabled||l)&&c.status===422&&(r?.apiUrl??this.apiUrl)!==m$&&(console.warn(`Streaming multipart upload to ${r?.apiUrl??this.apiUrl}/runs/multipart failed. This usually means the host does not support chunked uploads. Retrying with a buffered upload for operation "${n}".`),this.multipartStreamingDisabled=!0,c=await o(a))}catch(c){if(u$(c))throw c;if(console.warn(`${c.message.trim()}
505
-
506
- Context: ${n}`),this.failedTracesDir){let l=await this._createNodeFetchBody(t,i).catch(()=>null);l&&await e._writeTraceToFallbackDir(this.failedTracesDir,l,{"Content-Type":`multipart/form-data; boundary=${i}`},"runs/multipart",this.failedTracesMaxBytes)}}}async updateRun(t,n,r){we(t),n.inputs&&(n.inputs=await this.processInputs(n.inputs)),n.outputs&&(n.outputs=await this.processOutputs(n.outputs));let i={...n,id:t};if(!this._filterForSampling([i],!0).length)return;if(this.autoBatchTracing&&i.trace_id!==void 0&&i.dotted_order!==void 0){let o=this._cloneCurrentOTELContext();if(n.end_time!==void 0&&i.parent_run_id===void 0&&this.blockOnRootRunFinalization&&!this.manualFlushMode){await this.processRunOperation({action:"update",item:i,otelContext:o,apiKey:r?.apiKey,apiUrl:r?.apiUrl}).catch(console.error);return}else this.processRunOperation({action:"update",item:i,otelContext:o,apiKey:r?.apiKey,apiUrl:r?.apiUrl}).catch(console.error);return}let a={...this.headers,"Content-Type":"application/json"};r?.apiKey!==void 0&&(a["x-api-key"]=r.apiKey),r?.workspaceId!==void 0&&(a["x-tenant-id"]=r.workspaceId);let s=mn(n,`Serializing payload to update run with id: ${t}`);await this.caller.call(async()=>{let o=await this._fetch(`${r?.apiUrl??this.apiUrl}/runs/${t}`,{method:"PATCH",headers:a,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await ie(o,"update run",!0),o})}async readRun(t,{loadChildRuns:n}={loadChildRuns:!1}){we(t);let r=Gs(await this._get(`/runs/${t}`));return n&&(r=await this._loadChildRuns(r)),r}async getRunUrl({runId:t,run:n,projectOpts:r}){if(n!==void 0){let i;n.session_id?i=n.session_id:r?.projectName?i=(await this.readProject({projectName:r?.projectName})).id:r?.projectId?i=r?.projectId:i=(await this.readProject({projectName:Pt("PROJECT")||"default"})).id;let a=await this._getTenantId();return`${this.getHostUrl()}/o/${a}/projects/p/${i}/r/${n.id}?poll=true`}else if(t!==void 0){let i=await this.readRun(t);if(!i.app_path)throw new Error(`Run ${t} has no app_path`);return`${this.getHostUrl()}${i.app_path}`}else throw new Error("Must provide either runId or run")}async _loadChildRuns(t){let n=await SU(this.listRuns({isRoot:!1,projectId:t.session_id,traceId:t.trace_id})),r={},i={};n.sort((a,s)=>(a?.dotted_order??"").localeCompare(s?.dotted_order??""));for(let a of n){if(a.parent_run_id===null||a.parent_run_id===void 0)throw new Error(`Child run ${a.id} has no parent`);a.dotted_order?.startsWith(t.dotted_order??"")&&a.id!==t.id&&(a.parent_run_id in r||(r[a.parent_run_id]=[]),r[a.parent_run_id].push(a),i[a.id]=a)}t.child_runs=r[t.id]||[];for(let a in r)a!==t.id&&(i[a].child_runs=r[a]);return t}async*listRuns(t){let{projectId:n,projectName:r,parentRunId:i,traceId:a,referenceExampleId:s,startTime:o,executionOrder:c,isRoot:l,runType:u,error:d,id:f,query:h,filter:p,traceFilter:m,treeFilter:v,limit:g,select:y,order:$}=t,S=[];if(n&&(S=Array.isArray(n)?n:[n]),r){let b=Array.isArray(r)?r:[r],D=await Promise.all(b.map(O=>this.readProject({projectName:O}).then(M=>M.id)));S.push(...D)}let x=["app_path","completion_cost","completion_tokens","dotted_order","end_time","error","events","extra","feedback_stats","first_token_time","id","inputs","name","outputs","parent_run_id","parent_run_ids","prompt_cost","prompt_tokens","reference_example_id","run_type","session_id","start_time","status","tags","total_cost","total_tokens","trace_id"],C={session:S.length?S:null,run_type:u,reference_example:s,query:h,filter:p,trace_filter:m,tree_filter:v,execution_order:c,parent_run:i,start_time:o?o.toISOString():null,error:d,id:f,limit:g,trace:a,select:y||x,is_root:l,order:$};C.select.includes("child_run_ids")&&Hl("Deprecated: 'child_run_ids' in the listRuns select parameter is deprecated and will be removed in a future version.");let T=0;for await(let b of this._getCursorPaginatedList("/runs/query",C)){let D=b.map(Gs);if(g){if(T>=g)break;if(D.length+T>g){yield*D.slice(0,g-T);break}T+=D.length,yield*D}else yield*D}}async*listGroupRuns(t){let{projectId:n,projectName:r,groupBy:i,filter:a,startTime:s,endTime:o,limit:c,offset:l}=t,d={session_id:n||(await this.readProject({projectName:r})).id,group_by:i,filter:a,start_time:s?s.toISOString():null,end_time:o?o.toISOString():null,limit:Number(c)||100},f=Number(l)||0,h="/runs/group",p=`${this.apiUrl}${h}`;for(;;){let m={...d,offset:f},v=Object.fromEntries(Object.entries(m).filter(([C,T])=>T!==void 0)),g=JSON.stringify(v),$=await(await this.caller.call(async()=>{let C=await this._fetch(p,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:g});return await ie(C,`Failed to fetch ${h}`),C})).json(),{groups:S,total:x}=$;if(S.length===0)break;for(let C of S)yield C;if(f+=S.length,f>=x)break}}async*readThread(t){let{threadId:n,projectId:r,projectName:i,isRoot:a=!0,limit:s,filter:o,order:c="asc"}=t;if(!r&&!i)throw new Error("threadId requires projectId or projectName");let l=`eq(thread_id, ${JSON.stringify(n)})`,u=o?`and(${l}, ${o})`:l;yield*this.listRuns({projectId:r??void 0,projectName:i??void 0,isRoot:a,limit:s,filter:u,order:c})}async listThreads(t){let{projectId:n,projectName:r,limit:i,offset:a=0,filter:s,startTime:o,isRoot:c=!0}=t;if(!n&&!r)throw new Error("Either projectId or projectName must be provided");if(n&&r)throw new Error("Provide exactly one of projectId or projectName");let l=n??(await this.readProject({projectName:r})).id,u=o??new Date(Date.now()-1440*60*1e3),f={session:[l],is_root:c,limit:100,order:"desc",select:["id","name","status","start_time","end_time","thread_id","trace_id","run_type","error","tags","session_id","parent_run_id","total_tokens","total_cost","dotted_order","reference_example_id","feedback_stats","app_path","completion_cost","completion_tokens","prompt_cost","prompt_tokens","first_token_time"],start_time:u.toISOString()};s!=null&&(f.filter=s);let h=new Map;for await(let g of this._getCursorPaginatedList("/runs/query",f))for(let y of g){let $=Gs(y),S=$.thread_id;if(S){let x=h.get(S)??[];x.push($),h.set(S,x)}}let p=[];for(let[g,y]of h.entries()){y.sort((T,b)=>{let D=T,O=b,M=D.start_time??"",he=O.start_time??"";if(M!==he)return M.localeCompare(he);let Me=D.dotted_order??"",V=O.dotted_order??"";return Me.localeCompare(V)});let S=[...y.map(T=>T.start_time).filter(Boolean)].sort(),x=S.length?S[0]:"",C=S.length?S[S.length-1]:"";p.push({thread_id:g,runs:y,count:y.length,filter:"",total_tokens:0,total_cost:null,min_start_time:x,max_start_time:C,latency_p50:0,latency_p99:0,feedback_stats:null,first_inputs:"",last_outputs:"",last_error:null})}p.sort((g,y)=>{let $=g.max_start_time??"";return(y.max_start_time??"").localeCompare($)});let m=a>0?p.slice(a):p;return i!==void 0?m.slice(0,i):m}async getRunStats({id:t,trace:n,parentRun:r,runType:i,projectNames:a,projectIds:s,referenceExampleIds:o,startTime:c,endTime:l,error:u,query:d,filter:f,traceFilter:h,treeFilter:p,isRoot:m,dataSourceType:v}){let g=s||[];a&&(g=[...s||[],...await Promise.all(a.map(T=>this.readProject({projectName:T}).then(b=>b.id)))]);let $=Object.fromEntries(Object.entries({id:t,trace:n,parent_run:r,run_type:i,session:g,reference_example:o,start_time:c,end_time:l,error:u,query:d,filter:f,trace_filter:h,tree_filter:p,is_root:m,data_source_type:v}).filter(([T,b])=>b!==void 0)),S=JSON.stringify($);return await(await this.caller.call(async()=>{let T=await this._fetch(`${this.apiUrl}/runs/stats`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:S});return await ie(T,"get run stats"),T})).json()}async shareRun(t,{shareId:n}={}){let r={run_id:t,share_token:n||zi()};we(t);let i=JSON.stringify(r),s=await(await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/runs/${t}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:i});return await ie(o,"share run"),o})).json();if(s===null||!("share_token"in s))throw new Error("Invalid response from server");return`${this.getHostUrl()}/public/${s.share_token}/r`}async unshareRun(t){we(t),await this.caller.call(async()=>{let n=await this._fetch(`${this.apiUrl}/runs/${t}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(n,"unshare run",!0),n})}async readRunSharedLink(t){we(t);let r=await(await this.caller.call(async()=>{let i=await this._fetch(`${this.apiUrl}/runs/${t}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(i,"read run shared link"),i})).json();if(!(r===null||!("share_token"in r)))return`${this.getHostUrl()}/public/${r.share_token}/r`}async listSharedRuns(t,{runIds:n}={}){let r=new URLSearchParams({share_token:t});if(n!==void 0)for(let s of n)r.append("id",s);return we(t),(await(await this.caller.call(async()=>{let s=await this._fetch(`${this.apiUrl}/public/${t}/runs${r}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(s,"list shared runs"),s})).json()).map(Gs)}async readDatasetSharedSchema(t,n){if(!t&&!n)throw new Error("Either datasetId or datasetName must be given");t||(t=(await this.readDataset({datasetName:n})).id),we(t);let i=await(await this.caller.call(async()=>{let a=await this._fetch(`${this.apiUrl}/datasets/${t}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(a,"read dataset shared schema"),a})).json();return i.url=`${this.getHostUrl()}/public/${i.share_token}/d`,i}async shareDataset(t,n){if(!t&&!n)throw new Error("Either datasetId or datasetName must be given");t||(t=(await this.readDataset({datasetName:n})).id);let r={dataset_id:t};we(t);let i=JSON.stringify(r),s=await(await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/datasets/${t}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:i});return await ie(o,"share dataset"),o})).json();return s.url=`${this.getHostUrl()}/public/${s.share_token}/d`,s}async unshareDataset(t){we(t),await this.caller.call(async()=>{let n=await this._fetch(`${this.apiUrl}/datasets/${t}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(n,"unshare dataset",!0),n})}async readSharedDataset(t){return we(t),await(await this.caller.call(async()=>{let i=await this._fetch(`${this.apiUrl}/public/${t}/datasets`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(i,"read shared dataset"),i})).json()}async listSharedExamples(t,n){let r={};n?.exampleIds&&(r.id=n.exampleIds);let i=new URLSearchParams;Object.entries(r).forEach(([o,c])=>{Array.isArray(c)?c.forEach(l=>i.append(o,l)):i.append(o,c)});let a=await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/public/${t}/examples?${i.toString()}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(o,"list shared examples"),o}),s=await a.json();if(!a.ok)throw"detail"in s?new Error(`Failed to list shared examples.
507
- Status: ${a.status}
508
- Message: ${Array.isArray(s.detail)?s.detail.join(`
509
- `):"Unspecified error"}`):new Error(`Failed to list shared examples: ${a.status} ${a.statusText}`);return s.map(o=>({...o,_hostUrl:this.getHostUrl()}))}async createProject({projectName:t,description:n=null,metadata:r=null,upsert:i=!1,projectExtra:a=null,referenceDatasetId:s=null}){let o=i?"?upsert=true":"",c=`${this.apiUrl}/sessions${o}`,l=a||{};r&&(l.metadata=r);let u={name:t,extra:l,description:n};s!==null&&(u.reference_dataset_id=s);let d=JSON.stringify(u);return await(await this.caller.call(async()=>{let p=await this._fetch(c,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:d});return await ie(p,"create project"),p})).json()}async updateProject(t,{name:n=null,description:r=null,metadata:i=null,projectExtra:a=null,endTime:s=null}){let o=`${this.apiUrl}/sessions/${t}`,c=a;i&&(c={...c||{},metadata:i});let l=JSON.stringify({name:n,extra:c,description:r,end_time:s?new Date(s).toISOString():null});return await(await this.caller.call(async()=>{let f=await this._fetch(o,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:l});return await ie(f,"update project"),f})).json()}async hasProject({projectId:t,projectName:n}){let r="/sessions",i=new URLSearchParams;if(t!==void 0&&n!==void 0)throw new Error("Must provide either projectName or projectId, not both");if(t!==void 0)we(t),r+=`/${t}`;else if(n!==void 0)i.append("name",n);else throw new Error("Must provide projectName or projectId");let a=await this.caller.call(async()=>{let s=await this._fetch(`${this.apiUrl}${r}?${i}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(s,"has project"),s});try{let s=await a.json();return a.ok?Array.isArray(s)?s.length>0:!0:!1}catch{return!1}}async readProject({projectId:t,projectName:n,includeStats:r}){let i="/sessions",a=new URLSearchParams;if(t!==void 0&&n!==void 0)throw new Error("Must provide either projectName or projectId, not both");if(t!==void 0)we(t),i+=`/${t}`;else if(n!==void 0)a.append("name",n);else throw new Error("Must provide projectName or projectId");r!==void 0&&a.append("include_stats",r.toString());let s=await this._get(i,a),o;if(Array.isArray(s)){if(s.length===0)throw new Error(`Project[id=${t}, name=${n}] not found`);o=s[0]}else o=s;return o}async getProjectUrl({projectId:t,projectName:n}){if(t===void 0&&n===void 0)throw new Error("Must provide either projectName or projectId");let r=await this.readProject({projectId:t,projectName:n}),i=await this._getTenantId();return`${this.getHostUrl()}/o/${i}/projects/p/${r.id}`}async getDatasetUrl({datasetId:t,datasetName:n}){if(t===void 0&&n===void 0)throw new Error("Must provide either datasetName or datasetId");let r=await this.readDataset({datasetId:t,datasetName:n}),i=await this._getTenantId();return`${this.getHostUrl()}/o/${i}/datasets/${r.id}`}async _getTenantId(){if(this._tenantId!==null)return this._tenantId;let t=new URLSearchParams({limit:"1"});for await(let n of this._getPaginated("/sessions",t))return this._tenantId=n[0].tenant_id,n[0].tenant_id;throw new Error("No projects found to resolve tenant.")}async*listProjects({projectIds:t,name:n,nameContains:r,referenceDatasetId:i,referenceDatasetName:a,includeStats:s,datasetVersion:o,referenceFree:c,metadata:l}={}){let u=new URLSearchParams;if(t!==void 0)for(let d of t)u.append("id",d);if(n!==void 0&&u.append("name",n),r!==void 0&&u.append("name_contains",r),i!==void 0)u.append("reference_dataset",i);else if(a!==void 0){let d=await this.readDataset({datasetName:a});u.append("reference_dataset",d.id)}s!==void 0&&u.append("include_stats",s.toString()),o!==void 0&&u.append("dataset_version",o),c!==void 0&&u.append("reference_free",c.toString()),l!==void 0&&u.append("metadata",JSON.stringify(l));for await(let d of this._getPaginated("/sessions",u))yield*d}async deleteProject({projectId:t,projectName:n}){let r;if(t===void 0&&n===void 0)throw new Error("Must provide projectName or projectId");if(t!==void 0&&n!==void 0)throw new Error("Must provide either projectName or projectId, not both");t===void 0?r=(await this.readProject({projectName:n})).id:r=t,we(r),await this.caller.call(async()=>{let i=await this._fetch(`${this.apiUrl}/sessions/${r}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(i,`delete session ${r} (${n})`,!0),i})}async uploadCsv({csvFile:t,fileName:n,inputKeys:r,outputKeys:i,description:a,dataType:s,name:o}){let c=`${this.apiUrl}/datasets/upload`,l=new FormData,u=new Blob([t],{type:"text/csv"});return l.append("file",u,n),r.forEach(h=>{l.append("input_keys",h)}),i.forEach(h=>{l.append("output_keys",h)}),a&&l.append("description",a),s&&l.append("data_type",s),o&&l.append("name",o),await(await this.caller.call(async()=>{let h=await this._fetch(c,{method:"POST",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:l});return await ie(h,"upload CSV"),h})).json()}async createDataset(t,{description:n,dataType:r,inputsSchema:i,outputsSchema:a,metadata:s}={}){let o={name:t,description:n,extra:{source:"sdk",...s?{metadata:s}:{}}};r&&(o.data_type=r),i&&(o.inputs_schema_definition=i),a&&(o.outputs_schema_definition=a);let c=JSON.stringify(o);return await(await this.caller.call(async()=>{let d=await this._fetch(`${this.apiUrl}/datasets`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:c});return await ie(d,"create dataset"),d})).json()}async readDataset({datasetId:t,datasetName:n}){let r="/datasets",i=new URLSearchParams({limit:"1"});if(t&&n)throw new Error("Must provide either datasetName or datasetId, not both");if(t)we(t),r+=`/${t}`;else if(n)i.append("name",n);else throw new Error("Must provide datasetName or datasetId");let a=await this._get(r,i),s;if(Array.isArray(a)){if(a.length===0)throw new Error(`Dataset[id=${t}, name=${n}] not found`);s=a[0]}else s=a;return s}async hasDataset({datasetId:t,datasetName:n}){try{return await this.readDataset({datasetId:t,datasetName:n}),!0}catch(r){if(r instanceof Error&&r.message.toLocaleLowerCase().includes("not found"))return!1;throw r}}async diffDatasetVersions({datasetId:t,datasetName:n,fromVersion:r,toVersion:i}){let a=t;if(a===void 0&&n===void 0)throw new Error("Must provide either datasetName or datasetId");if(a!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");a===void 0&&(a=(await this.readDataset({datasetName:n})).id);let s=new URLSearchParams({from_version:typeof r=="string"?r:r.toISOString(),to_version:typeof i=="string"?i:i.toISOString()});return await this._get(`/datasets/${a}/versions/diff`,s)}async readDatasetOpenaiFinetuning({datasetId:t,datasetName:n}){let r="/datasets";if(t===void 0)if(n!==void 0)t=(await this.readDataset({datasetName:n})).id;else throw new Error("Must provide either datasetName or datasetId");return(await(await this._getResponse(`${r}/${t}/openai_ft`)).text()).trim().split(`
510
- `).map(o=>JSON.parse(o))}async*listDatasets({limit:t=100,offset:n=0,datasetIds:r,datasetName:i,datasetNameContains:a,metadata:s}={}){let o="/datasets",c=new URLSearchParams({limit:t.toString(),offset:n.toString()});if(r!==void 0)for(let l of r)c.append("id",l);i!==void 0&&c.append("name",i),a!==void 0&&c.append("name_contains",a),s!==void 0&&c.append("metadata",JSON.stringify(s));for await(let l of this._getPaginated(o,c))yield*l}async updateDataset(t){let{datasetId:n,datasetName:r,...i}=t;if(!n&&!r)throw new Error("Must provide either datasetName or datasetId");let a=n??(await this.readDataset({datasetName:r})).id;we(a);let s=JSON.stringify(i);return await(await this.caller.call(async()=>{let c=await this._fetch(`${this.apiUrl}/datasets/${a}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await ie(c,"update dataset"),c})).json()}async updateDatasetTag(t){let{datasetId:n,datasetName:r,asOf:i,tag:a}=t;if(!n&&!r)throw new Error("Must provide either datasetName or datasetId");let s=n??(await this.readDataset({datasetName:r})).id;we(s);let o=JSON.stringify({as_of:typeof i=="string"?i:i.toISOString(),tag:a});await this.caller.call(async()=>{let c=await this._fetch(`${this.apiUrl}/datasets/${s}/tags`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:o});return await ie(c,"update dataset tags",!0),c})}async deleteDataset({datasetId:t,datasetName:n}){let r="/datasets",i=t;if(t!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");if(n!==void 0&&(i=(await this.readDataset({datasetName:n})).id),i!==void 0)we(i),r+=`/${i}`;else throw new Error("Must provide datasetName or datasetId");await this.caller.call(async()=>{let a=await this._fetch(this.apiUrl+r,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(a,`delete ${r}`,!0),a})}async indexDataset({datasetId:t,datasetName:n,tag:r}){let i=t;if(!i&&!n)throw new Error("Must provide either datasetName or datasetId");if(i&&n)throw new Error("Must provide either datasetName or datasetId, not both");i||(i=(await this.readDataset({datasetName:n})).id),we(i);let s=JSON.stringify({tag:r});await(await this.caller.call(async()=>{let c=await this._fetch(`${this.apiUrl}/datasets/${i}/index`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await ie(c,"index dataset"),c})).json()}async similarExamples(t,n,r,{filter:i}={}){let a={limit:r,inputs:t};i!==void 0&&(a.filter=i),we(n);let s=JSON.stringify(a);return(await(await this.caller.call(async()=>{let l=await this._fetch(`${this.apiUrl}/datasets/${n}/search`,{headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,method:"POST",body:s});return await ie(l,"fetch similar examples"),l})).json()).examples}async createExample(t,n,r){if(g$(t)&&(n!==void 0||r!==void 0))throw new Error("Cannot provide outputs or options when using ExampleCreate object");let i=n?r?.datasetId:t.dataset_id,a=n?r?.datasetName:t.dataset_name;if(i===void 0&&a===void 0)throw new Error("Must provide either datasetName or datasetId");if(i!==void 0&&a!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");i===void 0&&(i=(await this.readDataset({datasetName:a})).id);let s=(n?r?.createdAt:t.created_at)||new Date,o;g$(t)?o=t:o={inputs:t,outputs:n,created_at:s?.toISOString(),id:r?.exampleId,metadata:r?.metadata,split:r?.split,source_run_id:r?.sourceRunId,use_source_run_io:r?.useSourceRunIO,use_source_run_attachments:r?.useSourceRunAttachments,attachments:r?.attachments};let c=await this._uploadExamplesMultipart(i,[o]);return await this.readExample(c.example_ids?.[0]??zi())}async createExamples(t){if(Array.isArray(t)){if(t.length===0)return[];let y=t,$=y[0].dataset_id,S=y[0].dataset_name;if($===void 0&&S===void 0)throw new Error("Must provide either datasetName or datasetId");if($!==void 0&&S!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");$===void 0&&($=(await this.readDataset({datasetName:S})).id);let x=await this._uploadExamplesMultipart($,y);return await Promise.all(x.example_ids.map(T=>this.readExample(T)))}let{inputs:n,outputs:r,metadata:i,splits:a,sourceRunIds:s,useSourceRunIOs:o,useSourceRunAttachments:c,attachments:l,exampleIds:u,datasetId:d,datasetName:f}=t;if(n===void 0)throw new Error("Must provide inputs when using legacy parameters");let h=d,p=f;if(h===void 0&&p===void 0)throw new Error("Must provide either datasetName or datasetId");if(h!==void 0&&p!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");h===void 0&&(h=(await this.readDataset({datasetName:p})).id);let m=n.map((y,$)=>({dataset_id:h,inputs:y,outputs:r?.[$],metadata:i?.[$],split:a?.[$],id:u?.[$],attachments:l?.[$],source_run_id:s?.[$],use_source_run_io:o?.[$],use_source_run_attachments:c?.[$]})),v=await this._uploadExamplesMultipart(h,m);return await Promise.all(v.example_ids.map(y=>this.readExample(y)))}async createLLMExample(t,n,r){return this.createExample({input:t},{output:n},r)}async createChatExample(t,n,r){let i=t.map(s=>_0(s)?y0(s):s),a=_0(n)?y0(n):n;return this.createExample({input:i},{output:a},r)}async readExample(t){we(t);let n=`/examples/${t}`,r=await this._get(n),{attachment_urls:i,...a}=r,s=a;return i&&(s.attachments=Object.entries(i).reduce((o,[c,l])=>(o[c.slice(11)]={presigned_url:l.presigned_url,mime_type:l.mime_type},o),{})),s}async*listExamples({datasetId:t,datasetName:n,exampleIds:r,asOf:i,splits:a,inlineS3Urls:s,metadata:o,limit:c,offset:l,filter:u,includeAttachments:d}={}){let f;if(t!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");if(t!==void 0)f=t;else if(n!==void 0)f=(await this.readDataset({datasetName:n})).id;else throw new Error("Must provide a datasetName or datasetId");let h=new URLSearchParams({dataset:f}),p=i?typeof i=="string"?i:i?.toISOString():void 0;p&&h.append("as_of",p);let m=s??!0;if(h.append("inline_s3_urls",m.toString()),r!==void 0)for(let g of r)h.append("id",g);if(a!==void 0)for(let g of a)h.append("splits",g);if(o!==void 0){let g=JSON.stringify(o);h.append("metadata",g)}c!==void 0&&h.append("limit",c.toString()),l!==void 0&&h.append("offset",l.toString()),u!==void 0&&h.append("filter",u),d===!0&&["attachment_urls","outputs","metadata"].forEach(g=>h.append("select",g));let v=0;for await(let g of this._getPaginated("/examples",h)){for(let y of g){let{attachment_urls:$,...S}=y,x=S;$&&(x.attachments=Object.entries($).reduce((C,[T,b])=>(C[T.slice(11)]={presigned_url:b.presigned_url,mime_type:b.mime_type||void 0},C),{})),yield x,v++}if(c!==void 0&&v>=c)break}}async deleteExample(t){we(t);let n=`/examples/${t}`;await this.caller.call(async()=>{let r=await this._fetch(this.apiUrl+n,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(r,`delete ${n}`,!0),r})}async deleteExamples(t,n){if(t.forEach(r=>we(r)),n?.hardDelete){let r=this._getPlatformEndpointPath("datasets/examples/delete");await this.caller.call(async()=>{let i=await this._fetch(`${this.apiUrl}${r}`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},body:JSON.stringify({example_ids:t,hard_delete:!0}),signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(i,"hard delete examples",!0),i})}else{let r=new URLSearchParams;t.forEach(i=>r.append("example_ids",i)),await this.caller.call(async()=>{let i=await this._fetch(`${this.apiUrl}/examples?${r.toString()}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(i,"delete examples",!0),i})}}async updateExample(t,n){let r;n?r=t:r=t.id,we(r);let i;n?i={id:r,...n}:i=t;let a;return i.dataset_id!==void 0?a=i.dataset_id:a=(await this.readExample(r)).dataset_id,this._updateExamplesMultipart(a,[i])}async updateExamples(t){let n;return t[0].dataset_id===void 0?n=(await this.readExample(t[0].id)).dataset_id:n=t[0].dataset_id,this._updateExamplesMultipart(n,t)}async readDatasetVersion({datasetId:t,datasetName:n,asOf:r,tag:i}){let a;if(t?a=t:a=(await this.readDataset({datasetName:n})).id,we(a),r&&i||!r&&!i)throw new Error("Exactly one of asOf and tag must be specified.");let s=new URLSearchParams;return r!==void 0&&s.append("as_of",typeof r=="string"?r:r.toISOString()),i!==void 0&&s.append("tag",i),await(await this.caller.call(async()=>{let c=await this._fetch(`${this.apiUrl}/datasets/${a}/version?${s.toString()}`,{method:"GET",headers:{...this.headers},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(c,"read dataset version"),c})).json()}async listDatasetSplits({datasetId:t,datasetName:n,asOf:r}){let i;if(t===void 0&&n===void 0)throw new Error("Must provide dataset name or ID");if(t!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");t===void 0?i=(await this.readDataset({datasetName:n})).id:i=t,we(i);let a=new URLSearchParams,s=r?typeof r=="string"?r:r?.toISOString():void 0;return s&&a.append("as_of",s),await this._get(`/datasets/${i}/splits`,a)}async updateDatasetSplits({datasetId:t,datasetName:n,splitName:r,exampleIds:i,remove:a=!1}){let s;if(t===void 0&&n===void 0)throw new Error("Must provide dataset name or ID");if(t!==void 0&&n!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");t===void 0?s=(await this.readDataset({datasetName:n})).id:s=t,we(s);let o={split_name:r,examples:i.map(l=>(we(l),l)),remove:a},c=JSON.stringify(o);await this.caller.call(async()=>{let l=await this._fetch(`${this.apiUrl}/datasets/${s}/splits`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:c});return await ie(l,"update dataset splits",!0),l})}async createFeedback(t,n,{score:r,value:i,correction:a,comment:s,sourceInfo:o,feedbackSourceType:c="api",sourceRunId:l,feedbackId:u,feedbackConfig:d,projectId:f,comparativeExperimentId:h,sessionId:p,startTime:m}){if(!t&&!f)throw new Error("One of runId or projectId must be provided");if(t&&f)throw new Error("Only one of runId or projectId can be provided");let v={type:c??"api",metadata:o??{}};l!==void 0&&v?.metadata!==void 0&&!v.metadata.__run&&(v.metadata.__run={run_id:l}),v?.metadata!==void 0&&v.metadata.__run?.run_id!==void 0&&we(v.metadata.__run.run_id);let g={id:u??Ck(),run_id:t,key:n,score:p$(r),value:i,correction:a,comment:s,feedback_source:v,comparative_experiment_id:h,feedbackConfig:d,session_id:p??f,start_time:m},y=JSON.stringify(g),$=`${this.apiUrl}/feedback`;return await this.caller.call(async()=>{let S=await this._fetch($,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:y});return await ie(S,"create feedback",!0),S}),g}async updateFeedback(t,{score:n,value:r,correction:i,comment:a}){let s={};n!=null&&(s.score=p$(n)),r!=null&&(s.value=r),i!=null&&(s.correction=i),a!=null&&(s.comment=a),we(t);let o=JSON.stringify(s);await this.caller.call(async()=>{let c=await this._fetch(`${this.apiUrl}/feedback/${t}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:o});return await ie(c,"update feedback",!0),c})}async readFeedback(t){we(t);let n=`/feedback/${t}`;return await this._get(n)}async deleteFeedback(t){we(t);let n=`/feedback/${t}`;await this.caller.call(async()=>{let r=await this._fetch(this.apiUrl+n,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(r,`delete ${n}`,!0),r})}async*listFeedback({runIds:t,feedbackKeys:n,feedbackSourceTypes:r}={}){let i=new URLSearchParams;if(t)for(let a of t)we(a),i.append("run",a);if(n)for(let a of n)i.append("key",a);if(r)for(let a of r)i.append("source",a);for await(let a of this._getPaginated("/feedback",i))yield*a}async createPresignedFeedbackToken(t,n,{expiration:r,feedbackConfig:i}={}){let a={run_id:t,feedback_key:n,feedback_config:i};r?typeof r=="string"?a.expires_at=r:(r?.hours||r?.minutes||r?.days)&&(a.expires_in=r):a.expires_in={hours:3};let s=JSON.stringify(a);return await(await this.caller.call(async()=>{let c=await this._fetch(`${this.apiUrl}/feedback/tokens`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await ie(c,"create presigned feedback token"),c})).json()}async createComparativeExperiment({name:t,experimentIds:n,referenceDatasetId:r,createdAt:i,description:a,metadata:s,id:o}){if(n.length===0)throw new Error("At least one experiment is required");if(r||(r=(await this.readProject({projectId:n[0]})).reference_dataset_id),!r==null)throw new Error("A reference dataset is required");let c={id:o,name:t,experiment_ids:n,reference_dataset_id:r,description:a,created_at:(i??new Date)?.toISOString(),extra:{}};s&&(c.extra.metadata=s);let l=JSON.stringify(c);return(await this.caller.call(async()=>{let d=await this._fetch(`${this.apiUrl}/datasets/comparative`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:l});return await ie(d,"create comparative experiment"),d})).json()}async*listPresignedFeedbackTokens(t){we(t);let n=new URLSearchParams({run_id:t});for await(let r of this._getPaginated("/feedback/tokens",n))yield*r}_selectEvalResults(t){let n;return"results"in t?n=t.results:Array.isArray(t)?n=t:n=[t],n}async _logEvaluationFeedback(t,n,r){let i=this._selectEvalResults(t),a=[];for(let s of i){let o=r||{};s.evaluatorInfo&&(o={...s.evaluatorInfo,...o});let c=null;s.targetRunId?c=s.targetRunId:n&&(c=n.id),a.push(await this.createFeedback(c,s.key,{score:s.score,value:s.value,comment:s.comment,correction:s.correction,sourceInfo:o,sourceRunId:s.sourceRunId,feedbackConfig:s.feedbackConfig,feedbackSourceType:"model",sessionId:n?.session_id,startTime:n?.start_time}))}return[i,a]}async logEvaluationFeedback(t,n,r){let[i]=await this._logEvaluationFeedback(t,n,r);return i}async createFeedbackConfig(t){let{feedbackKey:n,feedbackConfig:r,isLowerScoreBetter:i=!1}=t,a={feedback_key:n,feedback_config:r,is_lower_score_better:i};return(await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/feedback-configs`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:JSON.stringify(a)});return await ie(o,"create feedback config"),o})).json()}async*listFeedbackConfigs(t={}){let{feedbackKeys:n,nameContains:r,limit:i}=t,a=new URLSearchParams;n&&n.forEach(o=>{a.append("key",o)}),r&&a.append("name_contains",r),a.append("limit",(i!==void 0?Math.min(i,100):100).toString());let s=0;for await(let o of this._getPaginated("/feedback-configs",a))if(yield*o,s+=o.length,i!==void 0&&s>=i)break}async updateFeedbackConfig(t,n={}){let{feedbackConfig:r,isLowerScoreBetter:i}=n,a={feedback_key:t};return r!==void 0&&(a.feedback_config=r),i!==void 0&&(a.is_lower_score_better=i),(await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/feedback-configs`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:JSON.stringify(a)});return await ie(o,"update feedback config"),o})).json()}async deleteFeedbackConfig(t){let n=new URLSearchParams({feedback_key:t});await this.caller.call(async()=>{let r=await this._fetch(`${this.apiUrl}/feedback-configs?${n}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(r,"delete feedback config",!0),r})}async*listAnnotationQueues(t={}){let{queueIds:n,name:r,nameContains:i,limit:a}=t,s=new URLSearchParams;n&&n.forEach((c,l)=>{we(c,`queueIds[${l}]`),s.append("ids",c)}),r&&s.append("name",r),i&&s.append("name_contains",i),s.append("limit",(a!==void 0?Math.min(a,100):100).toString());let o=0;for await(let c of this._getPaginated("/annotation-queues",s))if(yield*c,o++,a!==void 0&&o>=a)break}async createAnnotationQueue(t){let{name:n,description:r,queueId:i,rubricInstructions:a,rubricItems:s}=t,o={name:n,description:r,id:i||zi(),rubric_instructions:a,rubric_items:s},c=JSON.stringify(Object.fromEntries(Object.entries(o).filter(([u,d])=>d!==void 0)));return(await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}/annotation-queues`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:c});return await ie(u,"create annotation queue"),u})).json()}async readAnnotationQueue(t){return(await this.caller.call(async()=>{let r=await this._fetch(`${this.apiUrl}/annotation-queues/${we(t,"queueId")}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(r,"read annotation queue"),r})).json()}async updateAnnotationQueue(t,n){let{name:r,description:i,rubricInstructions:a,rubricItems:s}=n,o={};r!==void 0&&(o.name=r),i!==void 0&&(o.description=i),a!==void 0&&(o.rubric_instructions=a),s!==void 0&&(o.rubric_items=s);let c=JSON.stringify(o);await this.caller.call(async()=>{let l=await this._fetch(`${this.apiUrl}/annotation-queues/${we(t,"queueId")}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:c});return await ie(l,"update annotation queue",!0),l})}async deleteAnnotationQueue(t){await this.caller.call(async()=>{let n=await this._fetch(`${this.apiUrl}/annotation-queues/${we(t,"queueId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(n,"delete annotation queue",!0),n})}async addRunsToAnnotationQueue(t,n){let r=JSON.stringify(n.map((i,a)=>we(i,`runIds[${a}]`).toString()));await this.caller.call(async()=>{let i=await this._fetch(`${this.apiUrl}/annotation-queues/${we(t,"queueId")}/runs`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:r});return await ie(i,"add runs to annotation queue",!0),i})}async getRunFromAnnotationQueue(t,n){let r=`/annotation-queues/${we(t,"queueId")}/run`,a=await(await this.caller.call(async()=>{let s=await this._fetch(`${this.apiUrl}${r}/${n}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(s,"get run from annotation queue"),s})).json();return Gs(a)}async deleteRunFromAnnotationQueue(t,n){await this.caller.call(async()=>{let r=await this._fetch(`${this.apiUrl}/annotation-queues/${we(t,"queueId")}/runs/${we(n,"queueRunId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(r,"delete run from annotation queue",!0),r})}async getSizeFromAnnotationQueue(t){return(await this.caller.call(async()=>{let r=await this._fetch(`${this.apiUrl}/annotation-queues/${we(t,"queueId")}/size`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(r,"get size from annotation queue"),r})).json()}async _currentTenantIsOwner(t){let n=await this._getSettings();return t=="-"||n.tenant_handle===t}async _ownerConflictError(t,n){let r=await this._getSettings();return new Error(`Cannot ${t} for another tenant.
511
-
512
- Current tenant: ${r.tenant_handle}
513
-
514
- Requested tenant: ${n}`)}async _getLatestCommitHash(t){let r=await(await this.caller.call(async()=>{let i=await this._fetch(`${this.apiUrl}/commits/${t}/?limit=1&offset=0`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(i,"get latest commit hash"),i})).json();if(r.commits.length!==0)return r.commits[0].commit_hash}async _likeOrUnlikePrompt(t,n){let[r,i,a]=xr(t),s=JSON.stringify({like:n});return(await this.caller.call(async()=>{let c=await this._fetch(`${this.apiUrl}/likes/${r}/${i}`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await ie(c,`${n?"like":"unlike"} prompt`),c})).json()}async _getPromptUrl(t){let[n,r,i]=xr(t);if(await this._currentTenantIsOwner(n)){let a=await this._getSettings();return i!=="latest"?`${this.getHostUrl()}/prompts/${r}/${i.substring(0,8)}?organizationId=${a.id}`:`${this.getHostUrl()}/prompts/${r}?organizationId=${a.id}`}else return i!=="latest"?`${this.getHostUrl()}/hub/${n}/${r}/${i.substring(0,8)}`:`${this.getHostUrl()}/hub/${n}/${r}`}async promptExists(t){return!!await this.getPrompt(t)}async likePrompt(t){return this._likeOrUnlikePrompt(t,!0)}async unlikePrompt(t){return this._likeOrUnlikePrompt(t,!1)}async*listCommits(t){let[n,r,i]=xr(t);for await(let a of this._getPaginated(`/commits/${n}/${r}/`,new URLSearchParams,s=>s.commits))yield*a}async*listPrompts(t){let n=new URLSearchParams;n.append("sort_field",t?.sortField??"updated_at"),n.append("sort_direction","desc"),n.append("is_archived",(!!t?.isArchived).toString()),t?.isPublic!==void 0&&n.append("is_public",t.isPublic.toString()),t?.query&&n.append("query",t.query);for await(let r of this._getPaginated("/repos",n,i=>i.repos))yield*r}async getPrompt(t){let[n,r,i]=xr(t),s=await(await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/repos/${n}/${r}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return o?.status===404?null:(await ie(o,"get prompt"),o)}))?.json();return s?.repo?s.repo:null}async createPrompt(t,n){let r=await this._getSettings();if(n?.isPublic&&!r.tenant_handle)throw new Error(`Cannot create a public prompt without first
515
-
516
- creating a LangChain Hub handle.
517
- You can add a handle by creating a public prompt at:
518
-
519
- https://smith.langchain.com/prompts`);let[i,a,s]=xr(t);if(!await this._currentTenantIsOwner(i))throw await this._ownerConflictError("create a prompt",i);let o={repo_handle:a,...n?.description&&{description:n.description},...n?.readme&&{readme:n.readme},...n?.tags&&{tags:n.tags},is_public:!!n?.isPublic},c=JSON.stringify(o),l=await this.caller.call(async()=>{let d=await this._fetch(`${this.apiUrl}/repos/`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:c});return await ie(d,"create prompt"),d}),{repo:u}=await l.json();return u}async createCommit(t,n,r){if(!await this.promptExists(t))throw new Error("Prompt does not exist, you must create it first.");let[i,a,s]=xr(t),o=r?.parentCommitHash==="latest"||!r?.parentCommitHash?await this._getLatestCommitHash(`${i}/${a}`):r?.parentCommitHash,c={manifest:JSON.parse(JSON.stringify(n)),parent_commit:o},l=JSON.stringify(c),d=await(await this.caller.call(async()=>{let f=await this._fetch(`${this.apiUrl}/commits/${i}/${a}`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:l});return await ie(f,"create commit"),f})).json();return this._getPromptUrl(`${i}/${a}${d.commit_hash?`:${d.commit_hash}`:""}`)}async updateExamplesMultipart(t,n=[]){return this._updateExamplesMultipart(t,n)}async _updateExamplesMultipart(t,n=[]){if(!await this._getDatasetExamplesMultiPartSupport())throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");let r=new FormData;for(let s of n){let o=s.id,c={...s.metadata&&{metadata:s.metadata},...s.split&&{split:s.split}},l=mn(c,`Serializing body for example with id: ${o}`),u=new Blob([l],{type:"application/json"});if(r.append(o,u),s.inputs){let d=mn(s.inputs,`Serializing inputs for example with id: ${o}`),f=new Blob([d],{type:"application/json"});r.append(`${o}.inputs`,f)}if(s.outputs){let d=mn(s.outputs,`Serializing outputs whle updating example with id: ${o}`),f=new Blob([d],{type:"application/json"});r.append(`${o}.outputs`,f)}if(s.attachments)for(let[d,f]of Object.entries(s.attachments)){let h,p;Array.isArray(f)?[h,p]=f:(h=f.mimeType,p=f.data);let m=new Blob([p],{type:`${h}; length=${p.byteLength}`});r.append(`${o}.attachment.${d}`,m)}if(s.attachments_operations){let d=mn(s.attachments_operations,`Serializing attachments while updating example with id: ${o}`),f=new Blob([d],{type:"application/json"});r.append(`${o}.attachments_operations`,f)}}let i=t??n[0]?.dataset_id;return(await this.caller.call(async()=>{let s=await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${i}/examples`)}`,{method:"PATCH",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:r});return await ie(s,"update examples"),s})).json()}async uploadExamplesMultipart(t,n=[]){return this._uploadExamplesMultipart(t,n)}async _uploadExamplesMultipart(t,n=[]){if(!await this._getDatasetExamplesMultiPartSupport())throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");let r=new FormData;for(let a of n){let s=(a.id??zi()).toString(),o={created_at:a.created_at,...a.metadata&&{metadata:a.metadata},...a.split&&{split:a.split},...a.source_run_id&&{source_run_id:a.source_run_id},...a.use_source_run_io&&{use_source_run_io:a.use_source_run_io},...a.use_source_run_attachments&&{use_source_run_attachments:a.use_source_run_attachments}},c=mn(o,`Serializing body for uploaded example with id: ${s}`),l=new Blob([c],{type:"application/json"});if(r.append(s,l),a.inputs){let u=mn(a.inputs,`Serializing inputs for uploaded example with id: ${s}`),d=new Blob([u],{type:"application/json"});r.append(`${s}.inputs`,d)}if(a.outputs){let u=mn(a.outputs,`Serializing outputs for uploaded example with id: ${s}`),d=new Blob([u],{type:"application/json"});r.append(`${s}.outputs`,d)}if(a.attachments)for(let[u,d]of Object.entries(a.attachments)){let f,h;Array.isArray(d)?[f,h]=d:(f=d.mimeType,h=d.data);let p=new Blob([h],{type:`${f}; length=${h.byteLength}`});r.append(`${s}.attachment.${u}`,p)}}return(await this.caller.call(async()=>{let a=await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${t}/examples`)}`,{method:"POST",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:r});return await ie(a,"upload examples"),a})).json()}async updatePrompt(t,n){if(!await this.promptExists(t))throw new Error("Prompt does not exist, you must create it first.");let[r,i]=xr(t);if(!await this._currentTenantIsOwner(r))throw await this._ownerConflictError("update a prompt",r);let a={};if(n?.description!==void 0&&(a.description=n.description),n?.readme!==void 0&&(a.readme=n.readme),n?.tags!==void 0&&(a.tags=n.tags),n?.isPublic!==void 0&&(a.is_public=n.isPublic),n?.isArchived!==void 0&&(a.is_archived=n.isArchived),Object.keys(a).length===0)throw new Error("No valid update options provided");let s=JSON.stringify(a);return(await this.caller.call(async()=>{let c=await this._fetch(`${this.apiUrl}/repos/${r}/${i}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await ie(c,"update prompt"),c})).json()}async deletePrompt(t){if(!await this.promptExists(t))throw new Error("Prompt does not exist, you must create it first.");let[n,r,i]=xr(t);if(!await this._currentTenantIsOwner(n))throw await this._ownerConflictError("delete a prompt",n);return(await this.caller.call(async()=>{let s=await this._fetch(`${this.apiUrl}/repos/${n}/${r}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(s,"delete prompt"),s})).json()}_getPromptCacheKey(t,n){return`${t}${n?":with_model":""}`}async _fetchPromptFromApi(t,n){let[r,i,a]=xr(t),o=await(await this.caller.call(async()=>{let c=await this._fetch(`${this.apiUrl}/commits/${r}/${i}/${a}${n?.includeModel?"?include_model=true":""}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await ie(c,"pull prompt commit"),c})).json();return{owner:r,repo:i,commit_hash:o.commit_hash,manifest:o.manifest,examples:o.examples}}async pullPromptCommit(t,n){let r=this._fetchPromptFromApi.bind(this,t,n);if(!n?.skipCache&&this._promptCache){let i=this._getPromptCacheKey(t,n?.includeModel),a=this._promptCache.get(i,r);if(a)return a;let s=await r();return this._promptCache.set(i,s,r),s}return this._fetchPromptFromApi(t,n)}async _pullPrompt(t,n){let r=await this.pullPromptCommit(t,{includeModel:n?.includeModel,skipCache:n?.skipCache});return JSON.stringify(r.manifest)}async pushPrompt(t,n){return await this.promptExists(t)?n&&Object.keys(n).some(i=>i!=="object")&&await this.updatePrompt(t,{description:n?.description,readme:n?.readme,tags:n?.tags,isPublic:n?.isPublic}):await this.createPrompt(t,{description:n?.description,readme:n?.readme,tags:n?.tags,isPublic:n?.isPublic}),n?.object?await this.createCommit(t,n?.object,{parentCommitHash:n?.parentCommitHash}):await this._getPromptUrl(t)}async clonePublicDataset(t,n={}){let{sourceApiUrl:r=this.apiUrl,datasetName:i}=n,[a,s]=this.parseTokenOrUrl(t,r),o=new e({apiUrl:a,apiKey:"placeholder"}),c=await o.readSharedDataset(s),l=i||c.name;try{if(await this.hasDataset({datasetId:l})){console.log(`Dataset ${l} already exists in your tenant. Skipping.`);return}}catch{}let u=await o.listSharedExamples(s),d=await this.createDataset(l,{description:c.description,dataType:c.data_type||"kv",inputsSchema:c.inputs_schema_definition??void 0,outputsSchema:c.outputs_schema_definition??void 0});try{await this.createExamples({inputs:u.map(f=>f.inputs),outputs:u.flatMap(f=>f.outputs?[f.outputs]:[]),datasetId:d.id})}catch(f){throw console.error(`An error occurred while creating dataset ${l}. You should delete it manually.`),f}}parseTokenOrUrl(t,n,r=2,i="dataset"){try{return we(t),[n,t]}catch{}try{let s=new URL(t).pathname.split("/").filter(o=>o!=="");if(s.length>=r){let o=s[s.length-r];return[n,o]}else throw new Error(`Invalid public ${i} URL: ${t}`)}catch{throw new Error(`Invalid public ${i} URL or token: ${t}`)}}cleanup(){this._promptCache&&this._promptCache.stop()}async awaitPendingTraceBatches(){if(this.manualFlushMode)return console.warn("[WARNING]: When tracing in manual flush mode, you must call `await client.flush()` manually to submit trace batches."),Promise.resolve();await new Promise(t=>setTimeout(t,1)),await Promise.all([...this.autoBatchQueue.items.map(({itemPromise:t})=>t),this.batchIngestCaller.queue.onIdle()]),this.langSmithToOTELTranslator!==void 0&&await SD()?.DEFAULT_LANGSMITH_SPAN_PROCESSOR?.forceFlush()}};Object.defineProperty(is,"_fallbackDirsCreated",{enumerable:!0,configurable:!0,writable:!0,value:new Set});function g$(e){return"dataset_id"in e||"dataset_name"in e}var TU=e=>!!["TRACING_V2","TRACING"].find(n=>Pt(n)==="true"),li=Symbol.for("lc:context_variables"),Kp=Symbol.for("langsmith:replica_trace_roots");function _$(e,t){if(li in e)return e[li][t]}function OU(e,t,n){let r=li in e?e[li]:{};r[t]=n,e[li]=r}var AU="6ba7b810-9dad-11d1-80b4-00c04fd430c8";function y$(e){let n=Object.keys(e).sort().map(r=>`${r}:${e[r]??""}`).join("|");return Ak(n,AU)}function CU(e){return e.replace(/[-:.]/g,"")}function Dx(e,t=1){let n=t.toFixed(0).slice(0,3).padStart(3,"0");return`${new Date(e).toISOString().slice(0,-1)}${n}Z`}function Ux(e,t,n=1){let r=Dx(e,n);return{dottedOrder:CU(r)+t,microsecondPrecisionDatestring:r}}var NU=new Set(["projectName","updates","reroot"]);function PU(e){let t={};for(let n of Object.keys(e))NU.has(n)&&(t[n]=e[n]);return t}var xu=class e{constructor(t,n,r,i){Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"project_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"replicas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.metadata=t,this.tags=n,this.project_name=r,this.replicas=i}static fromHeader(t){let n=t.split(","),r={},i=[],a,s;for(let o of n){let[c,l]=o.split("="),u=decodeURIComponent(l);c==="langsmith-metadata"?r=JSON.parse(u):c==="langsmith-tags"?i=u.split(","):c==="langsmith-project"?a=u:c==="langsmith-replicas"&&(s=JSON.parse(u).map(f=>Array.isArray(f)?f:PU(f)))}return new e(r,i,a,s)}toHeader(){let t=[];return this.metadata&&Object.keys(this.metadata).length>0&&t.push(`langsmith-metadata=${encodeURIComponent(JSON.stringify(this.metadata))}`),this.tags&&this.tags.length>0&&t.push(`langsmith-tags=${encodeURIComponent(this.tags.join(","))}`),this.project_name&&t.push(`langsmith-project=${encodeURIComponent(this.project_name)}`),t.join(",")}},as=class e{constructor(t){if(Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"run_type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"project_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parent_run",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parent_run_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"child_runs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"start_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"end_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extra",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"serialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reference_example_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"trace_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dotted_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracingEnabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"execution_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"child_execution_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"attachments",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"replicas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"distributedParentId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_serialized_start_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_awaitInputsOnPost",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),RU(t)){Object.assign(this,{...t});return}let n=e.getDefaultConfig(),{metadata:r,...i}=t,a=i.client??e.getSharedClient(),s={...r,...i?.extra?.metadata};if(i.extra={...i.extra,metadata:s},"id"in i&&i.id==null&&delete i.id,Object.assign(this,{...n,...i,client:a}),this.execution_order??=1,this.child_execution_order??=1,this.dotted_order||(this._serialized_start_time=Dx(this.start_time,this.execution_order)),this.id||(this.id=rD(this._serialized_start_time??this.start_time)),this.trace_id||(this.parent_run?this.trace_id=this.parent_run.trace_id??this.id:this.trace_id=this.id),this.replicas=UU(this.replicas),!this.dotted_order){let{dottedOrder:o}=Ux(this.start_time,this.id,this.execution_order);this.parent_run?this.dotted_order=this.parent_run.dotted_order+"."+o:this.dotted_order=o}}set metadata(t){this.extra={...this.extra,metadata:{...this.extra?.metadata,...t}}}get metadata(){return this.extra?.metadata}static getDefaultConfig(){let t=Date.now();return{run_type:"chain",project_name:mx(),child_runs:[],api_url:yr("LANGCHAIN_ENDPOINT")??"http://localhost:1984",api_key:yr("LANGCHAIN_API_KEY"),caller_options:{},start_time:t,serialized:{},inputs:{},extra:{}}}static getSharedClient(){return e.sharedClient||(e.sharedClient=new is),e.sharedClient}createChild(t){let n=this.child_execution_order+1,r=this.replicas?.map(f=>{let{reroot:h,...p}=f;return p}),i=t.replicas??r,a=new e({...t,parent_run:this,project_name:this.project_name,replicas:i,client:this.client,tracingEnabled:this.tracingEnabled,execution_order:n,child_execution_order:n}),s=this.extra?.metadata??{},o=a.extra?.metadata??{};Object.keys(s).length>0&&(a.extra={...a.extra,metadata:{...s,...o}}),li in this&&(a[li]=this[li]);let c=Symbol.for("lc:child_config"),l=t.extra?.[c]??this.extra[c];if(MU(l)){let f={...l},h=jU(f.callbacks)?f.callbacks.copy?.():void 0;h&&(Object.assign(h,{_parentRunId:a.id}),h.handlers?.find(Lx)?.updateFromRunTree?.(a),f.callbacks=h),a.extra[c]=f}let u=new Set,d=this;for(;d!=null&&!u.has(d.id);)u.add(d.id),d.child_execution_order=Math.max(d.child_execution_order,n),d=d.parent_run;return this.child_runs.push(a),a}async end(t,n,r=Date.now(),i){this.outputs=this.outputs??t,this.error=this.error??n,this.end_time=this.end_time??r,i&&Object.keys(i).length>0&&(this.extra=this.extra?{...this.extra,metadata:{...this.extra.metadata,...i}}:{metadata:i})}_convertToCreate(t,n,r=!0){let i=t.extra??{};if(i?.runtime?.library===void 0&&(i.runtime||(i.runtime={}),n))for(let[o,c]of Object.entries(n))i.runtime[o]||(i.runtime[o]=c);let a=t.parent_run?.id??t.parent_run_id,s;return r?s=[]:s=t.child_runs.map(o=>this._convertToCreate(o,n,r)),{id:t.id,name:t.name,start_time:t._serialized_start_time??t.start_time,end_time:t.end_time,run_type:t.run_type,reference_example_id:t.reference_example_id,extra:i,serialized:t.serialized,error:t.error,inputs:t.inputs,outputs:t.outputs,session_name:t.project_name,child_runs:s,parent_run_id:a,trace_id:t.trace_id,dotted_order:t.dotted_order,tags:t.tags,attachments:t.attachments,events:t.events}}_sliceParentId(t,n){if(n.dotted_order){let r=n.dotted_order.split("."),i=null;for(let a=0;a<r.length;a++)if(r[a].slice(-36)===t){i=a;break}if(i!==null){let a=r.slice(i+1);n.dotted_order=a.join("."),a.length>0?n.trace_id=a[0].slice(-36):n.trace_id=n.id}}n.parent_run_id===t&&(n.parent_run_id=void 0)}_setReplicaTraceRoot(t,n){let r=_$(this,Kp)??{};r[t]=n,OU(this,Kp,r);for(let i of this.child_runs)i._setReplicaTraceRoot(t,n)}_remapForProject(t){let{projectName:n,runtimeEnv:r,excludeChildRuns:i=!0,reroot:a=!1,distributedParentId:s,apiUrl:o,apiKey:c,workspaceId:l}=t,u=this._convertToCreate(this,r,i);if(n===this.project_name)return{...u,session_name:n};if(a){if(s)this._sliceParentId(s,u);else if(u.parent_run_id=void 0,u.dotted_order){let y=u.dotted_order.split(".");y.length>0&&(u.dotted_order=y[y.length-1],u.trace_id=u.id)}let g=y$({projectName:n,apiUrl:o,apiKey:c,workspaceId:l});this._setReplicaTraceRoot(g,u.id)}let d;if(!a){let g=_$(this,Kp)??{},y=y$({projectName:n,apiUrl:o,apiKey:c,workspaceId:l});if(d=g[y],d&&(u.trace_id=d,u.dotted_order)){let $=u.dotted_order.split("."),S=null;for(let x=0;x<$.length;x++)if($[x].slice(-36)===d){S=x;break}if(S!==null){let x=$.slice(S);u.dotted_order=x.join(".")}}}let f=u.id,h=ul(f,n),p;u.trace_id?p=ul(u.trace_id,n):p=h;let m;u.parent_run_id&&(m=ul(u.parent_run_id,n));let v;return u.dotted_order&&(v=u.dotted_order.split(".").map($=>{let S=$.slice(-36),x=ul(S,n);return $.slice(0,-36)+x}).join(".")),{...u,id:h,trace_id:p,parent_run_id:m,dotted_order:v,session_name:n}}async postRun(t=!0){this._awaitInputsOnPost&&(this.inputs=await this.inputs);try{let n=Ix();if(this.replicas&&this.replicas.length>0)for(let{projectName:r,apiKey:i,apiUrl:a,workspaceId:s,reroot:o}of this.replicas){let c=this._remapForProject({projectName:r??this.project_name,runtimeEnv:n,excludeChildRuns:!0,reroot:o,distributedParentId:this.distributedParentId,apiUrl:a,apiKey:i,workspaceId:s});await this.client.createRun(c,{apiKey:i,apiUrl:a,workspaceId:s})}else{let r=this._convertToCreate(this,n,t);await this.client.createRun(r)}if(!t){Hl("Posting with excludeChildRuns=false is deprecated and will be removed in a future version.");for(let r of this.child_runs)await r.postRun(!1)}this.child_runs=[]}catch(n){console.error(`Error in postRun for run ${this.id}:`,n)}}async patchRun(t){if(this.replicas&&this.replicas.length>0)for(let{projectName:n,apiKey:r,apiUrl:i,workspaceId:a,updates:s,reroot:o}of this.replicas){let c=this._remapForProject({projectName:n??this.project_name,runtimeEnv:void 0,excludeChildRuns:!0,reroot:o,distributedParentId:this.distributedParentId,apiUrl:i,apiKey:r,workspaceId:a}),l={id:c.id,name:c.name,run_type:c.run_type,start_time:c.start_time,outputs:c.outputs,error:c.error,parent_run_id:c.parent_run_id,session_name:c.session_name,reference_example_id:c.reference_example_id,end_time:c.end_time,dotted_order:c.dotted_order,trace_id:c.trace_id,events:c.events,tags:c.tags,extra:c.extra,attachments:this.attachments,...s};t?.excludeInputs||(l.inputs=c.inputs),await this.client.updateRun(c.id,l,{apiKey:r,apiUrl:i,workspaceId:a})}else try{let n={name:this.name,run_type:this.run_type,start_time:this._serialized_start_time??this.start_time,end_time:this.end_time,error:this.error,outputs:this.outputs,parent_run_id:this.parent_run?.id??this.parent_run_id,reference_example_id:this.reference_example_id,extra:this.extra,events:this.events,dotted_order:this.dotted_order,trace_id:this.trace_id,tags:this.tags,attachments:this.attachments,session_name:this.project_name};t?.excludeInputs||(n.inputs=this.inputs),await this.client.updateRun(this.id,n)}catch(n){console.error(`Error in patchRun for run ${this.id}`,n)}this.child_runs=[]}toJSON(){return this._convertToCreate(this,void 0,!1)}addEvent(t){this.events||(this.events=[]),typeof t=="string"?this.events.push({name:"event",time:new Date().toISOString(),message:t}):this.events.push({...t,time:t.time??new Date().toISOString()})}static fromRunnableConfig(t,n){let r=t?.callbacks,i,a,s,o=TU();if(r){let l=r?.getParentRunId?.()??"",u=r?.handlers?.find(d=>d?.name=="langchain_tracer");i=u?.getRun?.(l),a=u?.projectName,s=u?.client,o=o||!!u}return i?new e({name:i.name,id:i.id,trace_id:i.trace_id,dotted_order:i.dotted_order,client:s,tracingEnabled:o,project_name:a,tags:[...new Set((i?.tags??[]).concat(t?.tags??[]))],extra:{metadata:{...i?.extra?.metadata,...t?.metadata}}}).createChild(n):new e({...n,client:s,tracingEnabled:o,project_name:a})}static fromDottedOrder(t){return this.fromHeaders({"langsmith-trace":t})}static fromHeaders(t,n){let r="get"in t&&typeof t.get=="function"?{"langsmith-trace":t.get("langsmith-trace"),baggage:t.get("baggage")}:t,i=r["langsmith-trace"];if(!i||typeof i!="string")return;let a=i.trim(),s=a.split(".").map(u=>{let[d,f]=u.split("Z");return{strTime:d,time:Date.parse(d+"Z"),uuid:f}}),o=s[0].uuid,c={...n,name:n?.name??"parent",run_type:n?.run_type??"chain",start_time:n?.start_time??Date.now(),id:s.at(-1)?.uuid,trace_id:o,dotted_order:a};if(r.baggage&&typeof r.baggage=="string"){let u=xu.fromHeader(r.baggage);c.metadata=u.metadata,c.tags=u.tags,c.project_name=u.project_name,c.replicas=u.replicas}let l=new e(c);return l.distributedParentId=l.id,l}toHeaders(t){let n={"langsmith-trace":this.dotted_order,baggage:new xu(this.extra?.metadata,this.tags,this.project_name,this.replicas).toHeader()};if(t)for(let[r,i]of Object.entries(n))t.set(r,i);return n}};Object.defineProperty(as,"sharedClient",{enumerable:!0,configurable:!0,writable:!0,value:null});function RU(e){return e!=null&&typeof e.createChild=="function"&&typeof e.postRun=="function"}function Lx(e){return typeof e=="object"&&e!=null&&typeof e.name=="string"&&e.name==="langchain_tracer"}function v$(e){return Array.isArray(e)&&e.some(t=>Lx(t))}function jU(e){return typeof e=="object"&&e!=null&&Array.isArray(e.handlers)}function MU(e){let t=e?.callbacks;return e!=null&&typeof t=="object"&&(v$(t?.handlers)||v$(t))}function DU(){let e=yr("LANGSMITH_RUNS_ENDPOINTS");if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t)){let n=[];for(let r of t){if(typeof r!="object"||r===null){console.warn(`Invalid item type in LANGSMITH_RUNS_ENDPOINTS: expected object, got ${typeof r}`);continue}if(typeof r.api_url!="string"){console.warn(`Invalid api_url type in LANGSMITH_RUNS_ENDPOINTS: expected string, got ${typeof r.api_url}`);continue}if(typeof r.api_key!="string"){console.warn(`Invalid api_key type in LANGSMITH_RUNS_ENDPOINTS: expected string, got ${typeof r.api_key}`);continue}n.push({apiUrl:r.api_url.replace(/\/$/,""),apiKey:r.api_key})}return n}else if(typeof t=="object"&&t!==null){LU(t);let n=[];for(let[r,i]of Object.entries(t)){let a=r.replace(/\/$/,"");if(typeof i=="string")n.push({apiUrl:a,apiKey:i});else{console.warn(`Invalid value type in LANGSMITH_RUNS_ENDPOINTS for URL ${r}: expected string, got ${typeof i}`);continue}}return n}else return console.warn(`Invalid LANGSMITH_RUNS_ENDPOINTS \u2013 must be valid JSON array of objects with api_url and api_key properties, or object mapping url->apiKey, got ${typeof t}`),[]}catch(t){if(mU(t))throw t;return console.warn("Invalid LANGSMITH_RUNS_ENDPOINTS \u2013 must be valid JSON array of objects with api_url and api_key properties, or object mapping url->apiKey"),[]}}function UU(e){return e?e.map(t=>Array.isArray(t)?{projectName:t[0],updates:t[1]}:t):DU()}function LU(e){if(Object.keys(e).length>0&&Pt("ENDPOINT"))throw new Ym}var zU=Q({BaseTracer:()=>Jr,isBaseTracer:()=>Pa}),FU=e=>{if(e)return e.events=e.events??[],e.child_runs=e.child_runs??[],e};function tg(e,t){if(e)return new as({...e,start_time:e._serialized_start_time??e.start_time,parent_run:tg(t),child_runs:e.child_runs.map(n=>tg(n)).filter(n=>n!==void 0),extra:{...e.extra,runtime:Fk()},tracingEnabled:!1})}function Xp(e,t){return e&&!Array.isArray(e)&&typeof e=="object"?e:{[t]:e}}function Pa(e){return typeof e._addRunToRunMap=="function"}var Jr=class extends ga{runMap=new Map;runTreeMap=new Map;usesRunTreeMap=!1;constructor(e){super(...arguments)}copy(){return this}getRunById(e){if(e!==void 0)return this.usesRunTreeMap?FU(this.runTreeMap.get(e)):this.runMap.get(e)}stringifyError(e){return e instanceof Error?e.message+(e?.stack?`
520
-
521
- ${e.stack}`:""):typeof e=="string"?e:`${e}`}_addChildRun(e,t){e.child_runs.push(t)}_addRunToRunMap(e){let{dottedOrder:t,microsecondPrecisionDatestring:n}=Ux(new Date(e.start_time).getTime(),e.id,e.execution_order),r={...e},i=this.getRunById(r.parent_run_id);if(r.parent_run_id!==void 0?i?(this._addChildRun(i,r),i.child_execution_order=Math.max(i.child_execution_order,r.child_execution_order),r.trace_id=i.trace_id,i.dotted_order!==void 0&&(r.dotted_order=[i.dotted_order,t].join("."),r._serialized_start_time=n)):r.parent_run_id=void 0:(r.trace_id=r.id,r.dotted_order=t,r._serialized_start_time=n),this.usesRunTreeMap){let a=tg(r,i);a!==void 0&&this.runTreeMap.set(r.id,a)}else this.runMap.set(r.id,r);return r}async _endTrace(e){let t=e.parent_run_id!==void 0&&this.getRunById(e.parent_run_id);t?t.child_execution_order=Math.max(t.child_execution_order,e.child_execution_order):await this.persistRun(e),await this.onRunUpdate?.(e),this.usesRunTreeMap?this.runTreeMap.delete(e.id):this.runMap.delete(e.id)}_getExecutionOrder(e){let t=e!==void 0&&this.getRunById(e);return t?t.child_execution_order+1:1}_createRunForLLMStart(e,t,n,r,i,a,s,o){let c=this._getExecutionOrder(r),l=Date.now(),u=s?{...i,metadata:s}:i,d={id:n,name:o??e.id[e.id.length-1],parent_run_id:r,start_time:l,serialized:e,events:[{name:"start",time:new Date(l).toISOString()}],inputs:{prompts:t},execution_order:c,child_runs:[],child_execution_order:c,run_type:"llm",extra:u??{},tags:a||[]};return this._addRunToRunMap(d)}async handleLLMStart(e,t,n,r,i,a,s,o){let c=this.getRunById(n)??this._createRunForLLMStart(e,t,n,r,i,a,s,o);return await this.onRunCreate?.(c),await this.onLLMStart?.(c),c}_createRunForChatModelStart(e,t,n,r,i,a,s,o){let c=this._getExecutionOrder(r),l=Date.now(),u=s?{...i,metadata:s}:i,d={id:n,name:o??e.id[e.id.length-1],parent_run_id:r,start_time:l,serialized:e,events:[{name:"start",time:new Date(l).toISOString()}],inputs:{messages:t},execution_order:c,child_runs:[],child_execution_order:c,run_type:"llm",extra:u??{},tags:a||[]};return this._addRunToRunMap(d)}async handleChatModelStart(e,t,n,r,i,a,s,o){let c=this.getRunById(n)??this._createRunForChatModelStart(e,t,n,r,i,a,s,o);return await this.onRunCreate?.(c),await this.onLLMStart?.(c),c}async handleLLMEnd(e,t,n,r,i){let a=this.getRunById(t);if(!a||a?.run_type!=="llm")throw new Error("No LLM run to end.");return a.end_time=Date.now(),a.outputs=e,a.events.push({name:"end",time:new Date(a.end_time).toISOString()}),a.extra={...a.extra,...i},await this.onLLMEnd?.(a),await this._endTrace(a),a}async handleLLMError(e,t,n,r,i){let a=this.getRunById(t);if(!a||a?.run_type!=="llm")throw new Error("No LLM run to end.");return a.end_time=Date.now(),a.error=this.stringifyError(e),a.events.push({name:"error",time:new Date(a.end_time).toISOString()}),a.extra={...a.extra,...i},await this.onLLMError?.(a),await this._endTrace(a),a}_createRunForChainStart(e,t,n,r,i,a,s,o,c){let l=this._getExecutionOrder(r),u=Date.now(),d={id:n,name:o??e.id[e.id.length-1],parent_run_id:r,start_time:u,serialized:e,events:[{name:"start",time:new Date(u).toISOString()}],inputs:t,execution_order:l,child_execution_order:l,run_type:s??"chain",child_runs:[],extra:a?{...c,metadata:a}:{...c},tags:i||[]};return this._addRunToRunMap(d)}async handleChainStart(e,t,n,r,i,a,s,o){let c=this.getRunById(n)??this._createRunForChainStart(e,t,n,r,i,a,s,o);return await this.onRunCreate?.(c),await this.onChainStart?.(c),c}async handleChainEnd(e,t,n,r,i){let a=this.getRunById(t);if(!a)throw new Error("No chain run to end.");return a.end_time=Date.now(),a.outputs=Xp(e,"output"),a.events.push({name:"end",time:new Date(a.end_time).toISOString()}),i?.inputs!==void 0&&(a.inputs=Xp(i.inputs,"input")),await this.onChainEnd?.(a),await this._endTrace(a),a}async handleChainError(e,t,n,r,i){let a=this.getRunById(t);if(!a)throw new Error("No chain run to end.");return a.end_time=Date.now(),a.error=this.stringifyError(e),a.events.push({name:"error",time:new Date(a.end_time).toISOString()}),i?.inputs!==void 0&&(a.inputs=Xp(i.inputs,"input")),await this.onChainError?.(a),await this._endTrace(a),a}_createRunForToolStart(e,t,n,r,i,a,s){let o=this._getExecutionOrder(r),c=Date.now(),l={id:n,name:s??e.id[e.id.length-1],parent_run_id:r,start_time:c,serialized:e,events:[{name:"start",time:new Date(c).toISOString()}],inputs:{input:t},execution_order:o,child_execution_order:o,run_type:"tool",child_runs:[],extra:a?{metadata:a}:{},tags:i||[]};return this._addRunToRunMap(l)}async handleToolStart(e,t,n,r,i,a,s){let o=this.getRunById(n)??this._createRunForToolStart(e,t,n,r,i,a,s);return await this.onRunCreate?.(o),await this.onToolStart?.(o),o}async handleToolEnd(e,t){let n=this.getRunById(t);if(!n||n?.run_type!=="tool")throw new Error("No tool run to end");return n.end_time=Date.now(),n.outputs={output:e},n.events.push({name:"end",time:new Date(n.end_time).toISOString()}),await this.onToolEnd?.(n),await this._endTrace(n),n}async handleToolError(e,t){let n=this.getRunById(t);if(!n||n?.run_type!=="tool")throw new Error("No tool run to end");return n.end_time=Date.now(),n.error=this.stringifyError(e),n.events.push({name:"error",time:new Date(n.end_time).toISOString()}),await this.onToolError?.(n),await this._endTrace(n),n}async handleAgentAction(e,t){let n=this.getRunById(t);if(!n||n?.run_type!=="chain")return;let r=n;r.actions=r.actions||[],r.actions.push(e),r.events.push({name:"agent_action",time:new Date().toISOString(),kwargs:{action:e}}),await this.onAgentAction?.(n)}async handleAgentEnd(e,t){let n=this.getRunById(t);!n||n?.run_type!=="chain"||(n.events.push({name:"agent_end",time:new Date().toISOString(),kwargs:{action:e}}),await this.onAgentEnd?.(n))}_createRunForRetrieverStart(e,t,n,r,i,a,s){let o=this._getExecutionOrder(r),c=Date.now(),l={id:n,name:s??e.id[e.id.length-1],parent_run_id:r,start_time:c,serialized:e,events:[{name:"start",time:new Date(c).toISOString()}],inputs:{query:t},execution_order:o,child_execution_order:o,run_type:"retriever",child_runs:[],extra:a?{metadata:a}:{},tags:i||[]};return this._addRunToRunMap(l)}async handleRetrieverStart(e,t,n,r,i,a,s){let o=this.getRunById(n)??this._createRunForRetrieverStart(e,t,n,r,i,a,s);return await this.onRunCreate?.(o),await this.onRetrieverStart?.(o),o}async handleRetrieverEnd(e,t){let n=this.getRunById(t);if(!n||n?.run_type!=="retriever")throw new Error("No retriever run to end");return n.end_time=Date.now(),n.outputs={documents:e},n.events.push({name:"end",time:new Date(n.end_time).toISOString()}),await this.onRetrieverEnd?.(n),await this._endTrace(n),n}async handleRetrieverError(e,t){let n=this.getRunById(t);if(!n||n?.run_type!=="retriever")throw new Error("No retriever run to end");return n.end_time=Date.now(),n.error=this.stringifyError(e),n.events.push({name:"error",time:new Date(n.end_time).toISOString()}),await this.onRetrieverError?.(n),await this._endTrace(n),n}async handleText(e,t){let n=this.getRunById(t);!n||n?.run_type!=="chain"||(n.events.push({name:"text",time:new Date().toISOString(),kwargs:{text:e}}),await this.onText?.(n))}async handleLLMNewToken(e,t,n,r,i,a){let s=this.getRunById(n);if(!s||s?.run_type!=="llm")throw new Error('Invalid "runId" provided to "handleLLMNewToken" callback.');return s.events.push({name:"new_token",time:new Date().toISOString(),kwargs:{token:e,idx:t,chunk:a?.chunk}}),await this.onLLMNewToken?.(s,e,{chunk:a?.chunk}),s}},Wl={exports:{}};Wl.exports;var b$;function BU(){return b$||(b$=1,(function(e){let n=(a=0)=>s=>`\x1B[${38+a};5;${s}m`,r=(a=0)=>(s,o,c)=>`\x1B[${38+a};2;${s};${o};${c}m`;function i(){let a=new Map,s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};s.color.gray=s.color.blackBright,s.bgColor.bgGray=s.bgColor.bgBlackBright,s.color.grey=s.color.blackBright,s.bgColor.bgGrey=s.bgColor.bgBlackBright;for(let[o,c]of Object.entries(s)){for(let[l,u]of Object.entries(c))s[l]={open:`\x1B[${u[0]}m`,close:`\x1B[${u[1]}m`},c[l]=s[l],a.set(u[0],u[1]);Object.defineProperty(s,o,{value:c,enumerable:!1})}return Object.defineProperty(s,"codes",{value:a,enumerable:!1}),s.color.close="\x1B[39m",s.bgColor.close="\x1B[49m",s.color.ansi256=n(),s.color.ansi16m=r(),s.bgColor.ansi256=n(10),s.bgColor.ansi16m=r(10),Object.defineProperties(s,{rgbToAnsi256:{value:(o,c,l)=>o===c&&c===l?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(c/255*5)+Math.round(l/255*5),enumerable:!1},hexToRgb:{value:o=>{let c=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(o.toString(16));if(!c)return[0,0,0];let{colorString:l}=c.groups;l.length===3&&(l=l.split("").map(d=>d+d).join(""));let u=Number.parseInt(l,16);return[u>>16&255,u>>8&255,u&255]},enumerable:!1},hexToAnsi256:{value:o=>s.rgbToAnsi256(...s.hexToRgb(o)),enumerable:!1}}),s}Object.defineProperty(e,"exports",{enumerable:!0,get:i})})(Wl)),Wl.exports}var ZU=BU(),zx=Sa(ZU),VU=Q({ConsoleCallbackHandler:()=>ng});function qt(e,t){return`${e.open}${t}${e.close}`}function In(e,t){try{return JSON.stringify(e,null,2)}catch{return t}}function w$(e){return typeof e=="string"?e.trim():e==null?e:In(e,e.toString())}function Kr(e){if(!e.end_time)return"";let t=e.end_time-e.start_time;return t<1e3?`${t}ms`:`${(t/1e3).toFixed(2)}s`}var{color:rn}=zx,ng=class extends Jr{name="console_callback_handler";persistRun(e){return Promise.resolve()}getParents(e){let t=[],n=e;for(;n.parent_run_id;){let r=this.runMap.get(n.parent_run_id);if(r)t.push(r),n=r;else break}return t}getBreadcrumbs(e){let t=[...this.getParents(e).reverse(),e].map((n,r,i)=>{let a=`${n.execution_order}:${n.run_type}:${n.name}`;return r===i.length-1?qt(zx.bold,a):a}).join(" > ");return qt(rn.grey,t)}onChainStart(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.green,"[chain/start]")} [${t}] Entering Chain run with input: ${In(e.inputs,"[inputs]")}`)}onChainEnd(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.cyan,"[chain/end]")} [${t}] [${Kr(e)}] Exiting Chain run with output: ${In(e.outputs,"[outputs]")}`)}onChainError(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.red,"[chain/error]")} [${t}] [${Kr(e)}] Chain run errored with error: ${In(e.error,"[error]")}`)}onLLMStart(e){let t=this.getBreadcrumbs(e),n="prompts"in e.inputs?{prompts:e.inputs.prompts.map(r=>r.trim())}:e.inputs;console.log(`${qt(rn.green,"[llm/start]")} [${t}] Entering LLM run with input: ${In(n,"[inputs]")}`)}onLLMEnd(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.cyan,"[llm/end]")} [${t}] [${Kr(e)}] Exiting LLM run with output: ${In(e.outputs,"[response]")}`)}onLLMError(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.red,"[llm/error]")} [${t}] [${Kr(e)}] LLM run errored with error: ${In(e.error,"[error]")}`)}onToolStart(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.green,"[tool/start]")} [${t}] Entering Tool run with input: "${w$(e.inputs.input)}"`)}onToolEnd(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.cyan,"[tool/end]")} [${t}] [${Kr(e)}] Exiting Tool run with output: "${w$(e.outputs?.output)}"`)}onToolError(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.red,"[tool/error]")} [${t}] [${Kr(e)}] Tool run errored with error: ${In(e.error,"[error]")}`)}onRetrieverStart(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.green,"[retriever/start]")} [${t}] Entering Retriever run with input: ${In(e.inputs,"[inputs]")}`)}onRetrieverEnd(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.cyan,"[retriever/end]")} [${t}] [${Kr(e)}] Exiting Retriever run with output: ${In(e.outputs,"[outputs]")}`)}onRetrieverError(e){let t=this.getBreadcrumbs(e);console.log(`${qt(rn.red,"[retriever/error]")} [${t}] [${Kr(e)}] Retriever run errored with error: ${In(e.error,"[error]")}`)}onAgentAction(e){let t=e,n=this.getBreadcrumbs(e);console.log(`${qt(rn.blue,"[agent/action]")} [${n}] Agent selected action: ${In(t.actions[t.actions.length-1],"[action]")}`)}},Yp,Fx=()=>(Yp===void 0&&(Yp=new is(wn("LANGCHAIN_CALLBACKS_BACKGROUND")==="false"?{blockOnRootRunFinalization:!0}:{})),Yp),qU=class{getStore(){}run(t,n){return n()}},Qp=Symbol.for("ls:tracing_async_local_storage"),GU=new qU,HU=class{getInstance(){return globalThis[Qp]??GU}initializeGlobalInstance(t){globalThis[Qp]===void 0&&(globalThis[Qp]=t)}},JU=new HU;function WU(e=!1){let t=JU.getInstance().getStore();if(!e&&t===void 0)throw new Error(`Could not get the current run tree.
522
-
523
- Please make sure you are calling this method within a traceable function and that tracing is enabled.`);return t}function ay(e){return typeof e=="function"&&"langsmith:traceable"in e}var KU=Q({LangChainTracer:()=>rg});function XU(e){let t;for(let n of e)for(let r of n)Ke.isInstance(r.message)&&r.message.usage_metadata!==void 0&&(t=G_(t,r.message.usage_metadata));return t}var rg=class Bx extends Jr{name="langchain_tracer";projectName;exampleId;client;replicas;usesRunTreeMap=!0;constructor(t={}){super(t);let{exampleId:n,projectName:r,client:i,replicas:a}=t;this.projectName=r??mx(),this.replicas=a,this.exampleId=n,this.client=i??Fx();let s=Bx.getTraceableRunTree();s&&this.updateFromRunTree(s)}async persistRun(t){}async onRunCreate(t){t.extra?.lc_defers_inputs||await this.getRunTreeWithTracingConfig(t.id)?.postRun()}async onRunUpdate(t){let n=this.getRunTreeWithTracingConfig(t.id);t.extra?.lc_defers_inputs?await n?.postRun():await n?.patchRun()}onLLMEnd(t){let n=t.outputs;if(n?.generations){let r=XU(n.generations);if(r!==void 0){t.extra=t.extra??{};let i=t.extra.metadata??{};i.usage_metadata=r,t.extra.metadata=i}}}getRun(t){return this.runTreeMap.get(t)}updateFromRunTree(t){this.runTreeMap.set(t.id,t);let n=t,r=new Set;for(;n.parent_run&&!(r.has(n.id)||(r.add(n.id),!n.parent_run));)n=n.parent_run;r.clear();let i=[n];for(;i.length>0;){let a=i.shift();!a||r.has(a.id)||(r.add(a.id),this.runTreeMap.set(a.id,a),a.child_runs&&i.push(...a.child_runs))}this.client=t.client??this.client,this.replicas=t.replicas??this.replicas,this.projectName=t.project_name??this.projectName,this.exampleId=t.reference_example_id??this.exampleId}getRunTreeWithTracingConfig(t){let n=this.runTreeMap.get(t);if(n)return new as({...n,client:this.client,project_name:this.projectName,replicas:this.replicas,reference_example_id:this.exampleId,tracingEnabled:!0})}static getTraceableRunTree(){try{return WU(!0)}catch{return}}},Zx=Symbol.for("ls:tracing_async_local_storage"),wo=Symbol.for("lc:context_variables"),YU=e=>{globalThis[Zx]=e},No=()=>globalThis[Zx],Yi;function QU(){return new("default"in Lr?Lr.default:Lr)({autoStart:!0,concurrency:1})}function eL(){return typeof Yi>"u"&&(Yi=QU()),Yi}async function ht(e,t){if(t===!0){let n=No();n!==void 0?await n.run(void 0,async()=>e()):await e()}else Yi=eL(),Yi.add(async()=>{let n=No();n!==void 0?await n.run(void 0,async()=>e()):await e()})}async function tL(){let e=Fx();await Promise.allSettled([typeof Yi<"u"?Yi.onIdle():Promise.resolve(),e.awaitPendingTraceBatches()])}var nL=Q({awaitAllCallbacks:()=>tL,consumeCallback:()=>ht}),rL=e=>!!["LANGSMITH_TRACING_V2","LANGCHAIN_TRACING_V2","LANGSMITH_TRACING","LANGCHAIN_TRACING"].find(t=>wn(t)==="true");function Vx(e){let t=No();if(t!==void 0)return t.getStore()?.[wo]?.[e]}var iL=Symbol("lc:configure_hooks"),aL=()=>Vx(iL)||[],sL=Q({BaseCallbackManager:()=>qx,BaseRunManager:()=>vc,CallbackManager:()=>Yt,CallbackManagerForChainRun:()=>Hx,CallbackManagerForLLMRun:()=>ig,CallbackManagerForRetrieverRun:()=>Gx,CallbackManagerForToolRun:()=>Jx,ensureHandler:()=>Po,parseCallbackConfigArg:()=>yc});function yc(e){return e?Array.isArray(e)||"name"in e?{callbacks:e}:e:{}}var qx=class{setHandler(e){return this.setHandlers([e])}},vc=class{constructor(e,t,n,r,i,a,s,o){this.runId=e,this.handlers=t,this.inheritableHandlers=n,this.tags=r,this.inheritableTags=i,this.metadata=a,this.inheritableMetadata=s,this._parentRunId=o}get parentRunId(){return this._parentRunId}async handleText(e){await Promise.all(this.handlers.map(t=>ht(async()=>{try{await t.handleText?.(e,this.runId,this._parentRunId,this.tags)}catch(n){if((t.raiseError?console.error:console.warn)(`Error in handler ${t.constructor.name}, handleText: ${n}`),t.raiseError)throw n}},t.awaitHandlers)))}async handleCustomEvent(e,t,n,r,i){await Promise.all(this.handlers.map(a=>ht(async()=>{try{await a.handleCustomEvent?.(e,t,this.runId,this.tags,this.metadata)}catch(s){if((a.raiseError?console.error:console.warn)(`Error in handler ${a.constructor.name}, handleCustomEvent: ${s}`),a.raiseError)throw s}},a.awaitHandlers)))}},Gx=class extends vc{getChild(e){let t=new Yt(this.runId);return t.setHandlers(this.inheritableHandlers),t.addTags(this.inheritableTags),t.addMetadata(this.inheritableMetadata),e&&t.addTags([e],!1),t}async handleRetrieverEnd(e){await Promise.all(this.handlers.map(t=>ht(async()=>{if(!t.ignoreRetriever)try{await t.handleRetrieverEnd?.(e,this.runId,this._parentRunId,this.tags)}catch(n){if((t.raiseError?console.error:console.warn)(`Error in handler ${t.constructor.name}, handleRetriever`),t.raiseError)throw n}},t.awaitHandlers)))}async handleRetrieverError(e){await Promise.all(this.handlers.map(t=>ht(async()=>{if(!t.ignoreRetriever)try{await t.handleRetrieverError?.(e,this.runId,this._parentRunId,this.tags)}catch(n){if((t.raiseError?console.error:console.warn)(`Error in handler ${t.constructor.name}, handleRetrieverError: ${n}`),t.raiseError)throw e}},t.awaitHandlers)))}},ig=class extends vc{async handleLLMNewToken(e,t,n,r,i,a){await Promise.all(this.handlers.map(s=>ht(async()=>{if(!s.ignoreLLM)try{await s.handleLLMNewToken?.(e,t??{prompt:0,completion:0},this.runId,this._parentRunId,this.tags,a)}catch(o){if((s.raiseError?console.error:console.warn)(`Error in handler ${s.constructor.name}, handleLLMNewToken: ${o}`),s.raiseError)throw o}},s.awaitHandlers)))}async handleLLMError(e,t,n,r,i){await Promise.all(this.handlers.map(a=>ht(async()=>{if(!a.ignoreLLM)try{await a.handleLLMError?.(e,this.runId,this._parentRunId,this.tags,i)}catch(s){if((a.raiseError?console.error:console.warn)(`Error in handler ${a.constructor.name}, handleLLMError: ${s}`),a.raiseError)throw s}},a.awaitHandlers)))}async handleLLMEnd(e,t,n,r,i){await Promise.all(this.handlers.map(a=>ht(async()=>{if(!a.ignoreLLM)try{await a.handleLLMEnd?.(e,this.runId,this._parentRunId,this.tags,i)}catch(s){if((a.raiseError?console.error:console.warn)(`Error in handler ${a.constructor.name}, handleLLMEnd: ${s}`),a.raiseError)throw s}},a.awaitHandlers)))}},Hx=class extends vc{getChild(e){let t=new Yt(this.runId);return t.setHandlers(this.inheritableHandlers),t.addTags(this.inheritableTags),t.addMetadata(this.inheritableMetadata),e&&t.addTags([e],!1),t}async handleChainError(e,t,n,r,i){await Promise.all(this.handlers.map(a=>ht(async()=>{if(!a.ignoreChain)try{await a.handleChainError?.(e,this.runId,this._parentRunId,this.tags,i)}catch(s){if((a.raiseError?console.error:console.warn)(`Error in handler ${a.constructor.name}, handleChainError: ${s}`),a.raiseError)throw s}},a.awaitHandlers)))}async handleChainEnd(e,t,n,r,i){await Promise.all(this.handlers.map(a=>ht(async()=>{if(!a.ignoreChain)try{await a.handleChainEnd?.(e,this.runId,this._parentRunId,this.tags,i)}catch(s){if((a.raiseError?console.error:console.warn)(`Error in handler ${a.constructor.name}, handleChainEnd: ${s}`),a.raiseError)throw s}},a.awaitHandlers)))}async handleAgentAction(e){await Promise.all(this.handlers.map(t=>ht(async()=>{if(!t.ignoreAgent)try{await t.handleAgentAction?.(e,this.runId,this._parentRunId,this.tags)}catch(n){if((t.raiseError?console.error:console.warn)(`Error in handler ${t.constructor.name}, handleAgentAction: ${n}`),t.raiseError)throw n}},t.awaitHandlers)))}async handleAgentEnd(e){await Promise.all(this.handlers.map(t=>ht(async()=>{if(!t.ignoreAgent)try{await t.handleAgentEnd?.(e,this.runId,this._parentRunId,this.tags)}catch(n){if((t.raiseError?console.error:console.warn)(`Error in handler ${t.constructor.name}, handleAgentEnd: ${n}`),t.raiseError)throw n}},t.awaitHandlers)))}},Jx=class extends vc{getChild(e){let t=new Yt(this.runId);return t.setHandlers(this.inheritableHandlers),t.addTags(this.inheritableTags),t.addMetadata(this.inheritableMetadata),e&&t.addTags([e],!1),t}async handleToolError(e){await Promise.all(this.handlers.map(t=>ht(async()=>{if(!t.ignoreAgent)try{await t.handleToolError?.(e,this.runId,this._parentRunId,this.tags)}catch(n){if((t.raiseError?console.error:console.warn)(`Error in handler ${t.constructor.name}, handleToolError: ${n}`),t.raiseError)throw n}},t.awaitHandlers)))}async handleToolEvent(e){await Promise.all(this.handlers.map(t=>ht(async()=>{if(!t.ignoreAgent)try{await t.handleToolEvent?.(e,this.runId,this._parentRunId,this.tags)}catch(n){if(t.raiseError)throw n}},t.awaitHandlers)))}async handleToolEnd(e){await Promise.all(this.handlers.map(t=>ht(async()=>{if(!t.ignoreAgent)try{await t.handleToolEnd?.(e,this.runId,this._parentRunId,this.tags)}catch(n){if((t.raiseError?console.error:console.warn)(`Error in handler ${t.constructor.name}, handleToolEnd: ${n}`),t.raiseError)throw n}},t.awaitHandlers)))}},Yt=class Qs extends qx{handlers=[];inheritableHandlers=[];tags=[];inheritableTags=[];metadata={};inheritableMetadata={};name="callback_manager";_parentRunId;constructor(t,n){super(),this.handlers=n?.handlers??this.handlers,this.inheritableHandlers=n?.inheritableHandlers??this.inheritableHandlers,this.tags=n?.tags??this.tags,this.inheritableTags=n?.inheritableTags??this.inheritableTags,this.metadata=n?.metadata??this.metadata,this.inheritableMetadata=n?.inheritableMetadata??this.inheritableMetadata,this._parentRunId=t}getParentRunId(){return this._parentRunId}async handleLLMStart(t,n,r=void 0,i=void 0,a=void 0,s=void 0,o=void 0,c=void 0){return Promise.all(n.map(async(l,u)=>{let d=u===0&&r?r:ei();return await Promise.all(this.handlers.map(f=>{if(!f.ignoreLLM)return Pa(f)&&f._createRunForLLMStart(t,[l],d,this._parentRunId,a,this.tags,this.metadata,c),ht(async()=>{try{await f.handleLLMStart?.(t,[l],d,this._parentRunId,a,this.tags,this.metadata,c)}catch(h){if((f.raiseError?console.error:console.warn)(`Error in handler ${f.constructor.name}, handleLLMStart: ${h}`),f.raiseError)throw h}},f.awaitHandlers)})),new ig(d,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}))}async handleChatModelStart(t,n,r=void 0,i=void 0,a=void 0,s=void 0,o=void 0,c=void 0){return Promise.all(n.map(async(l,u)=>{let d=u===0&&r?r:ei();return await Promise.all(this.handlers.map(f=>{if(!f.ignoreLLM)return Pa(f)&&f._createRunForChatModelStart(t,[l],d,this._parentRunId,a,this.tags,this.metadata,c),ht(async()=>{try{if(f.handleChatModelStart)await f.handleChatModelStart?.(t,[l],d,this._parentRunId,a,this.tags,this.metadata,c);else if(f.handleLLMStart){let h=H_(l);await f.handleLLMStart?.(t,[h],d,this._parentRunId,a,this.tags,this.metadata,c)}}catch(h){if((f.raiseError?console.error:console.warn)(`Error in handler ${f.constructor.name}, handleLLMStart: ${h}`),f.raiseError)throw h}},f.awaitHandlers)})),new ig(d,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}))}async handleChainStart(t,n,r=ei(),i=void 0,a=void 0,s=void 0,o=void 0,c=void 0,l=void 0){return await Promise.all(this.handlers.map(u=>{if(!u.ignoreChain)return Pa(u)&&u._createRunForChainStart(t,n,r,this._parentRunId,this.tags,this.metadata,i,o,l),ht(async()=>{try{await u.handleChainStart?.(t,n,r,this._parentRunId,this.tags,this.metadata,i,o,l)}catch(d){if((u.raiseError?console.error:console.warn)(`Error in handler ${u.constructor.name}, handleChainStart: ${d}`),u.raiseError)throw d}},u.awaitHandlers)})),new Hx(r,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleToolStart(t,n,r=ei(),i=void 0,a=void 0,s=void 0,o=void 0,c=void 0){return await Promise.all(this.handlers.map(l=>{if(!l.ignoreAgent)return Pa(l)&&l._createRunForToolStart(t,n,r,this._parentRunId,this.tags,this.metadata,o),ht(async()=>{try{await l.handleToolStart?.(t,n,r,this._parentRunId,this.tags,this.metadata,o,c)}catch(u){if((l.raiseError?console.error:console.warn)(`Error in handler ${l.constructor.name}, handleToolStart: ${u}`),l.raiseError)throw u}},l.awaitHandlers)})),new Jx(r,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleRetrieverStart(t,n,r=ei(),i=void 0,a=void 0,s=void 0,o=void 0){return await Promise.all(this.handlers.map(c=>{if(!c.ignoreRetriever)return Pa(c)&&c._createRunForRetrieverStart(t,n,r,this._parentRunId,this.tags,this.metadata,o),ht(async()=>{try{await c.handleRetrieverStart?.(t,n,r,this._parentRunId,this.tags,this.metadata,o)}catch(l){if((c.raiseError?console.error:console.warn)(`Error in handler ${c.constructor.name}, handleRetrieverStart: ${l}`),c.raiseError)throw l}},c.awaitHandlers)})),new Gx(r,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleCustomEvent(t,n,r,i,a){await Promise.all(this.handlers.map(s=>ht(async()=>{if(!s.ignoreCustomEvent)try{await s.handleCustomEvent?.(t,n,r,this.tags,this.metadata)}catch(o){if((s.raiseError?console.error:console.warn)(`Error in handler ${s.constructor.name}, handleCustomEvent: ${o}`),s.raiseError)throw o}},s.awaitHandlers)))}addHandler(t,n=!0){this.handlers.push(t),n&&this.inheritableHandlers.push(t)}removeHandler(t){this.handlers=this.handlers.filter(n=>n!==t),this.inheritableHandlers=this.inheritableHandlers.filter(n=>n!==t)}setHandlers(t,n=!0){this.handlers=[],this.inheritableHandlers=[];for(let r of t)this.addHandler(r,n)}addTags(t,n=!0){this.removeTags(t),this.tags.push(...t),n&&this.inheritableTags.push(...t)}removeTags(t){this.tags=this.tags.filter(n=>!t.includes(n)),this.inheritableTags=this.inheritableTags.filter(n=>!t.includes(n))}addMetadata(t,n=!0){this.metadata={...this.metadata,...t},n&&(this.inheritableMetadata={...this.inheritableMetadata,...t})}removeMetadata(t){for(let n of Object.keys(t))delete this.metadata[n],delete this.inheritableMetadata[n]}copy(t=[],n=!0){let r=new Qs(this._parentRunId);for(let i of this.handlers){let a=this.inheritableHandlers.includes(i);r.addHandler(i,a)}for(let i of this.tags){let a=this.inheritableTags.includes(i);r.addTags([i],a)}for(let i of Object.keys(this.metadata)){let a=Object.keys(this.inheritableMetadata).includes(i);r.addMetadata({[i]:this.metadata[i]},a)}for(let i of t)r.handlers.filter(a=>a.name==="console_callback_handler").some(a=>a.name===i.name)||r.addHandler(i,n);return r}static fromHandlers(t){class n extends ga{name=ei();constructor(){super(),Object.assign(this,t)}}let r=new this;return r.addHandler(new n),r}static configure(t,n,r,i,a,s,o){return this._configureSync(t,n,r,i,a,s,o)}static _configureSync(t,n,r,i,a,s,o){let c;(t||n)&&(Array.isArray(t)||!t?(c=new Qs,c.setHandlers(t?.map(Po)??[],!0)):c=t,c=c.copy(Array.isArray(n)?n.map(Po):n?.handlers,!1));let l=wn("LANGCHAIN_VERBOSE")==="true"||o?.verbose,u=rg.getTraceableRunTree(),d=u?.tracingEnabled??rL();if(u?.tracingEnabled===!1&&c){let h=c.handlers.filter(p=>p.name==="langchain_tracer");for(let p of h)c.removeHandler(p)}let f=d||(wn("LANGCHAIN_TRACING")??!1);if(l||f){if(c||(c=new Qs),l&&!c.handlers.some(h=>h.name===ng.prototype.name)){let h=new ng;c.addHandler(h,!0)}if(f&&!c.handlers.some(h=>h.name==="langchain_tracer")&&d){let h=new rg;c.addHandler(h,!0)}d&&u&&c._parentRunId===void 0&&(c._parentRunId=u.id,c.handlers.find(h=>h.name==="langchain_tracer")?.updateFromRunTree(u))}for(let{contextVar:h,inheritable:p=!0,handlerClass:m,envVar:v}of aL()){let g=v&&wn(v)==="true"&&m,y,$=h!==void 0?Vx(h):void 0;$&&hx($)?y=$:g&&(y=new m({})),y!==void 0&&(c||(c=new Qs),c.handlers.some(S=>S.name===y.name)||c.addHandler(y,p))}return(r||i)&&c&&(c.addTags(r??[]),c.addTags(i??[],!1)),(a||s)&&c&&(c.addMetadata(a??{}),c.addMetadata(s??{},!1)),c}};function Po(e){return"name"in e?e:ga.fromMethods(e)}var Wx=class{getStore(){}run(e,t){return t()}enterWith(e){}},oL=new Wx,$$=Symbol.for("lc:child_config"),cL=class{getInstance(){return No()??oL}getRunnableConfig(){return this.getInstance().getStore()?.extra?.[$$]}runWithConfig(e,t,n){let r=Yt._configureSync(e?.callbacks,void 0,e?.tags,void 0,e?.metadata),i=this.getInstance(),a=i.getStore(),s=r?.getParentRunId(),o=r?.handlers?.find(l=>l?.name==="langchain_tracer"),c;return o&&s?c=o.getRunTreeWithTracingConfig(s):n||(c=new as({name:"<runnable_lambda>",tracingEnabled:!1})),c&&(c.extra={...c.extra,[$$]:e}),a!==void 0&&a[wo]!==void 0&&(c===void 0&&(c={}),c[wo]=a[wo]),i.run(c,t)}initializeGlobalInstance(e){No()===void 0&&YU(e)}},Mt=new cL,lL=Q({AsyncLocalStorageProviderSingleton:()=>Mt,MockAsyncLocalStorage:()=>Wx,_CONTEXT_VARIABLES_KEY:()=>wo});async function Qt(e){return Yt._configureSync(e?.callbacks,void 0,e?.tags,void 0,e?.metadata)}function Tn(...e){let t={};for(let n of e.filter(r=>!!r))for(let r of Object.keys(n))if(r==="metadata")t[r]={...t[r],...n[r]};else if(r==="tags"){let i=t[r]??[];t[r]=[...new Set(i.concat(n[r]??[]))]}else if(r==="configurable")t[r]={...t[r],...n[r]};else if(r==="timeout")t.timeout===void 0?t.timeout=n.timeout:n.timeout!==void 0&&(t.timeout=Math.min(t.timeout,n.timeout));else if(r==="signal")t.signal===void 0?t.signal=n.signal:n.signal!==void 0&&("any"in AbortSignal?t.signal=AbortSignal.any([t.signal,n.signal]):t.signal=n.signal);else if(r==="callbacks"){let i=t.callbacks,a=n.callbacks;if(Array.isArray(a))if(!i)t.callbacks=a;else if(Array.isArray(i))t.callbacks=i.concat(a);else{let s=i.copy();for(let o of a)s.addHandler(Po(o),!0);t.callbacks=s}else if(a)if(!i)t.callbacks=a;else if(Array.isArray(i)){let s=a.copy();for(let o of i)s.addHandler(Po(o),!0);t.callbacks=s}else t.callbacks=new Yt(a._parentRunId,{handlers:i.handlers.concat(a.handlers),inheritableHandlers:i.inheritableHandlers.concat(a.inheritableHandlers),tags:Array.from(new Set(i.tags.concat(a.tags))),inheritableTags:Array.from(new Set(i.inheritableTags.concat(a.inheritableTags))),metadata:{...i.metadata,...a.metadata}})}else{let i=r;t[i]=n[i]??t[i]}return t}var uL=new Set(["string","number","boolean"]);function De(e){let t=Mt.getRunnableConfig(),n={tags:[],metadata:{},recursionLimit:25,runId:void 0};if(t){let{runId:r,runName:i,...a}=t;n=Object.entries(a).reduce((s,[o,c])=>(c!==void 0&&(s[o]=c),s),n)}if(e&&(n=Object.entries(e).reduce((r,[i,a])=>(a!==void 0&&(r[i]=a),r),n)),n?.configurable)for(let r of Object.keys(n.configurable))uL.has(typeof n.configurable[r])&&!n.metadata?.[r]&&(n.metadata||(n.metadata={}),n.metadata[r]=n.configurable[r]);if(n.timeout!==void 0){if(n.timeout<=0)throw new Error("Timeout must be a positive number");let r=n.timeout,i=AbortSignal.timeout(r);n.metadata||(n.metadata={}),n.metadata.timeoutMs===void 0&&(n.metadata.timeoutMs=r),n.signal!==void 0?"any"in AbortSignal&&(n.signal=AbortSignal.any([n.signal,i])):n.signal=i,delete n.timeout}return n}function Ve(e={},{callbacks:t,maxConcurrency:n,recursionLimit:r,runName:i,configurable:a,runId:s}={}){let o=De(e);return t!==void 0&&(delete o.runName,o.callbacks=t),r!==void 0&&(o.recursionLimit=r),n!==void 0&&(o.maxConcurrency=n),i!==void 0&&(o.runName=i),a!==void 0&&(o.configurable={...o.configurable,...a}),s!==void 0&&delete o.runId,o}function Br(e){if(e)return{configurable:e.configurable,recursionLimit:e.recursionLimit,callbacks:e.callbacks,tags:e.tags,metadata:e.metadata,maxConcurrency:e.maxConcurrency,timeout:e.timeout,signal:e.signal,store:e.store}}async function vr(e,t){if(t===void 0)return e;let n;return Promise.race([e.catch(r=>{if(!t?.aborted)throw r}),new Promise((r,i)=>{n=()=>{i(Ro(t))},t.addEventListener("abort",n,{once:!0}),t.aborted&&i(Ro(t))})]).finally(()=>t.removeEventListener("abort",n))}function Ro(e){return e?.reason instanceof Error?e.reason:typeof e?.reason=="string"?new Error(e.reason):new Error("Aborted")}var dL=Q({AsyncGeneratorWithSetup:()=>_a,IterableReadableStream:()=>dn,atee:()=>sy,concat:()=>_i,pipeGeneratorWithSetup:()=>Kx}),dn=class ag extends ReadableStream{reader;ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{let t=await this.reader.read();return t.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:t.value}}catch(t){throw this.reader.releaseLock(),t}}async return(){if(this.ensureReader(),this.locked){let t=this.reader.cancel();this.reader.releaseLock(),await t}return{done:!0,value:void 0}}async throw(t){if(this.ensureReader(),this.locked){let n=this.reader.cancel();this.reader.releaseLock(),await n}throw t}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}static fromReadableStream(t){let n=t.getReader();return new ag({start(r){return i();function i(){return n.read().then(({done:a,value:s})=>{if(a){r.close();return}return r.enqueue(s),i()})}},cancel(){n.releaseLock()}})}static fromAsyncGenerator(t){return new ag({async pull(n){let{value:r,done:i}=await t.next();i&&n.close(),n.enqueue(r)},async cancel(n){await t.return(n)}})}};function sy(e,t=2){let n=Array.from({length:t},()=>[]);return n.map(async function*(i){for(;;)if(i.length===0){let a=await e.next();for(let s of n)s.push(a)}else{if(i[0].done)return;yield i.shift().value}})}function _i(e,t){if(Array.isArray(e)&&Array.isArray(t))return e.concat(t);if(typeof e=="string"&&typeof t=="string")return e+t;if(typeof e=="number"&&typeof t=="number")return e+t;if("concat"in e&&typeof e.concat=="function")return e.concat(t);if(typeof e=="object"&&typeof t=="object"){let n={...e};for(let[r,i]of Object.entries(t))r in n&&!Array.isArray(n[r])?n[r]=_i(n[r],i):n[r]=i;return n}else throw new Error(`Cannot concat ${typeof e} and ${typeof t}`)}var _a=class{generator;setup;config;signal;firstResult;firstResultUsed=!1;constructor(e){this.generator=e.generator,this.config=e.config,this.signal=e.signal??this.config?.signal,this.setup=new Promise((t,n)=>{Mt.runWithConfig(Br(e.config),async()=>{this.firstResult=this.signal?vr(e.generator.next(),this.signal):e.generator.next(),e.startSetup?this.firstResult.then(e.startSetup).then(t,n):this.firstResult.then(r=>t(void 0),n)},!0)})}async next(...e){return this.signal?.throwIfAborted(),this.firstResultUsed?Mt.runWithConfig(Br(this.config),this.signal?async()=>vr(this.generator.next(...e),this.signal):async()=>this.generator.next(...e),!0):(this.firstResultUsed=!0,this.firstResult)}async return(e){return this.generator.return(e)}async throw(e){return this.generator.throw(e)}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}};async function Kx(e,t,n,r,...i){let a=new _a({generator:t,startSetup:n,signal:r}),s=await a.setup;return{output:e(a,s,...i),setup:s}}var fL=Object.prototype.hasOwnProperty;function sg(e,t){return fL.call(e,t)}function og(e){if(Array.isArray(e)){let n=new Array(e.length);for(let r=0;r<n.length;r++)n[r]=""+r;return n}if(Object.keys)return Object.keys(e);let t=[];for(let n in e)sg(e,n)&&t.push(n);return t}function Gn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function cg(e){let t=0,n=e.length,r;for(;t<n;){if(r=e.charCodeAt(t),r>=48&&r<=57){t++;continue}return!1}return!0}function ka(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function hL(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function lg(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(lg(e[n]))return!0}else if(typeof e=="object"){let n=og(e),r=n.length;for(var t=0;t<r;t++)if(lg(e[n[t]]))return!0}}return!1}function S$(e,t){let n=[e];for(let r in t){let i=typeof t[r]=="object"?JSON.stringify(t[r],null,2):t[r];typeof i<"u"&&n.push(`${r}: ${i}`)}return n.join(`
524
- `)}var pL=class extends Error{constructor(e,t,n,r,i){super(S$(e,{name:t,index:n,operation:r,tree:i})),this.name=t,this.index=n,this.operation=r,this.tree=i,Object.setPrototypeOf(this,new.target.prototype),this.message=S$(e,{name:t,index:n,operation:r,tree:i})}},mL=Q({JsonPatchError:()=>ct,_areEquals:()=>jo,applyOperation:()=>Qi,applyPatch:()=>ss,applyReducer:()=>yL,deepClone:()=>gL,getValueByPointer:()=>Iu,validate:()=>Xx,validator:()=>Eu}),ct=pL,gL=Gn,qa={add:function(e,t,n){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){let r=Iu(n,this.path);r&&(r=Gn(r));let i=Qi(n,{op:"remove",path:this.from}).removed;return Qi(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){let r=Iu(n,this.from);return Qi(n,{op:"add",path:this.path,value:Gn(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:jo(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},_L={add:function(e,t,n){return cg(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:qa.move,copy:qa.copy,test:qa.test,_get:qa._get};function Iu(e,t){if(t=="")return e;var n={op:"_get",path:t};return Qi(e,n),n.value}function Qi(e,t,n=!1,r=!0,i=!0,a=0){if(n&&(typeof n=="function"?n(t,0,e,t.path):Eu(t,0)),t.path===""){let s={newDocument:e};if(t.op==="add")return s.newDocument=t.value,s;if(t.op==="replace")return s.newDocument=t.value,s.removed=e,s;if(t.op==="move"||t.op==="copy")return s.newDocument=Iu(e,t.from),t.op==="move"&&(s.removed=e),s;if(t.op==="test"){if(s.test=jo(e,t.value),s.test===!1)throw new ct("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return s.newDocument=e,s}else{if(t.op==="remove")return s.removed=e,s.newDocument=null,s;if(t.op==="_get")return t.value=e,s;if(n)throw new ct("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return s}}else{r||(e=Gn(e));let s=(t.path||"").split("/"),o=e,c=1,l=s.length,u,d,f;for(typeof n=="function"?f=n:f=Eu;;){if(d=s[c],d&&d.indexOf("~")!=-1&&(d=hL(d)),i&&(d=="__proto__"||d=="prototype"&&c>0&&s[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&u===void 0&&(o[d]===void 0?u=s.slice(0,c).join("/"):c==l-1&&(u=t.path),u!==void 0&&f(t,0,e,u)),c++,Array.isArray(o)){if(d==="-")d=o.length;else{if(n&&!cg(d))throw new ct("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);cg(d)&&(d=~~d)}if(c>=l){if(n&&t.op==="add"&&d>o.length)throw new ct("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);let h=_L[t.op].call(t,o,d,e);if(h.test===!1)throw new ct("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return h}}else if(c>=l){let h=qa[t.op].call(t,o,d,e);if(h.test===!1)throw new ct("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return h}if(o=o[d],n&&c<l&&(!o||typeof o!="object"))throw new ct("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function ss(e,t,n,r=!0,i=!0){if(n&&!Array.isArray(t))throw new ct("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=Gn(e));let a=new Array(t.length);for(let s=0,o=t.length;s<o;s++)a[s]=Qi(e,t[s],n,!0,i,s),e=a[s].newDocument;return a.newDocument=e,a}function yL(e,t,n){let r=Qi(e,t);if(r.test===!1)throw new ct("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return r.newDocument}function Eu(e,t,n,r){if(typeof e!="object"||e===null||Array.isArray(e))throw new ct("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(qa[e.op]){if(typeof e.path!="string")throw new ct("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new ct('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new ct("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new ct("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&lg(e.value))throw new ct("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var i=e.path.split("/").length,a=r.split("/").length;if(i!==a+1&&i!==a)throw new ct("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new ct("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var s=Xx([{op:"_get",path:e.from,value:void 0}],n);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new ct("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new ct("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function Xx(e,t,n){try{if(!Array.isArray(e))throw new ct("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)ss(Gn(t),Gn(e),n||!0);else{n=n||Eu;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(i){if(i instanceof ct)return i;throw i}}function jo(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),r=Array.isArray(t),i,a,s;if(n&&r){if(a=e.length,a!=t.length)return!1;for(i=a;i--!==0;)if(!jo(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var o=Object.keys(e);if(a=o.length,a!==Object.keys(t).length)return!1;for(i=a;i--!==0;)if(!t.hasOwnProperty(o[i]))return!1;for(i=a;i--!==0;)if(s=o[i],!jo(e[s],t[s]))return!1;return!0}return e!==e&&t!==t}function Yx(e,t,n,r,i){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=og(t),s=og(e),o=!1,c=s.length-1;c>=0;c--){var l=s[c],u=e[l];if(sg(t,l)&&!(t[l]===void 0&&u!==void 0&&Array.isArray(t)===!1)){var d=t[l];typeof u=="object"&&u!=null&&typeof d=="object"&&d!=null&&Array.isArray(u)===Array.isArray(d)?Yx(u,d,n,r+"/"+ka(l),i):u!==d&&(i&&n.push({op:"test",path:r+"/"+ka(l),value:Gn(u)}),n.push({op:"replace",path:r+"/"+ka(l),value:Gn(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+ka(l),value:Gn(u)}),n.push({op:"remove",path:r+"/"+ka(l)}),o=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!o&&a.length==s.length))for(var c=0;c<a.length;c++){var l=a[c];!sg(e,l)&&t[l]!==void 0&&n.push({op:"add",path:r+"/"+ka(l),value:Gn(t[l])})}}}function bf(e,t,n=!1){var r=[];return Yx(e,t,r,"",n),r}({...mL});var vL=Q({LogStreamCallbackHandler:()=>dg,RunLog:()=>oy,RunLogPatch:()=>Nr,isLogStreamHandler:()=>Qx}),Nr=class{ops;constructor(e){this.ops=e.ops??[]}concat(e){let t=this.ops.concat(e.ops),n=ss({},t);return new oy({ops:t,state:n[n.length-1].newDocument})}},oy=class ug extends Nr{state;constructor(t){super(t),this.state=t.state}concat(t){let n=this.ops.concat(t.ops),r=ss(this.state,t.ops);return new ug({ops:n,state:r[r.length-1].newDocument})}static fromRunLogPatch(t){let n=ss({},t.ops);return new ug({ops:t.ops,state:n[n.length-1].newDocument})}},Qx=e=>e.name==="log_stream_tracer";async function k$(e,t){if(t==="original")throw new Error("Do not assign inputs with original schema drop the key for now. When inputs are added to streamLog they should be added with standardized schema for streaming events.");let{inputs:n}=e;if(["retriever","llm","prompt"].includes(e.run_type))return n;if(!(Object.keys(n).length===1&&n?.input===""))return n.input}async function x$(e,t){let{outputs:n}=e;return t==="original"||["retriever","llm","prompt"].includes(e.run_type)?n:n!==void 0&&Object.keys(n).length===1&&n?.output!==void 0?n.output:n}function bL(e){return e!==void 0&&e.message!==void 0}var dg=class extends Jr{autoClose=!0;includeNames;includeTypes;includeTags;excludeNames;excludeTypes;excludeTags;_schemaFormat="original";rootId;keyMapByRunId={};counterMapByRunName={};transformStream;writer;receiveStream;name="log_stream_tracer";lc_prefer_streaming=!0;constructor(e){super({_awaitHandler:!0,...e}),this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this._schemaFormat=e?._schemaFormat??this._schemaFormat,this.transformStream=new TransformStream,this.writer=this.transformStream.writable.getWriter(),this.receiveStream=dn.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){if(e.id===this.rootId)return!1;let t=e.tags??[],n=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(n=n||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(n=n||this.includeTypes.includes(e.run_type)),this.includeTags!==void 0&&(n=n||t.find(r=>this.includeTags?.includes(r))!==void 0),this.excludeNames!==void 0&&(n=n&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(n=n&&!this.excludeTypes.includes(e.run_type)),this.excludeTags!==void 0&&(n=n&&t.every(r=>!this.excludeTags?.includes(r))),n}async*tapOutputIterable(e,t){for await(let n of t){if(e!==this.rootId){let r=this.keyMapByRunId[e];r&&await this.writer.write(new Nr({ops:[{op:"add",path:`/logs/${r}/streamed_output/-`,value:n}]}))}yield n}}async onRunCreate(e){if(this.rootId===void 0&&(this.rootId=e.id,await this.writer.write(new Nr({ops:[{op:"replace",path:"",value:{id:e.id,name:e.name,type:e.run_type,streamed_output:[],final_output:void 0,logs:{}}}]}))),!this._includeRun(e))return;this.counterMapByRunName[e.name]===void 0&&(this.counterMapByRunName[e.name]=0),this.counterMapByRunName[e.name]+=1;let t=this.counterMapByRunName[e.name];this.keyMapByRunId[e.id]=t===1?e.name:`${e.name}:${t}`;let n={id:e.id,name:e.name,type:e.run_type,tags:e.tags??[],metadata:e.extra?.metadata??{},start_time:new Date(e.start_time).toISOString(),streamed_output:[],streamed_output_str:[],final_output:void 0,end_time:void 0};this._schemaFormat==="streaming_events"&&(n.inputs=await k$(e,this._schemaFormat)),await this.writer.write(new Nr({ops:[{op:"add",path:`/logs/${this.keyMapByRunId[e.id]}`,value:n}]}))}async onRunUpdate(e){try{let t=this.keyMapByRunId[e.id];if(t===void 0)return;let n=[];this._schemaFormat==="streaming_events"&&n.push({op:"replace",path:`/logs/${t}/inputs`,value:await k$(e,this._schemaFormat)}),n.push({op:"add",path:`/logs/${t}/final_output`,value:await x$(e,this._schemaFormat)}),e.end_time!==void 0&&n.push({op:"add",path:`/logs/${t}/end_time`,value:new Date(e.end_time).toISOString()});let r=new Nr({ops:n});await this.writer.write(r)}finally{if(e.id===this.rootId){let t=new Nr({ops:[{op:"replace",path:"/final_output",value:await x$(e,this._schemaFormat)}]});await this.writer.write(t),this.autoClose&&await this.writer.close()}}}async onLLMNewToken(e,t,n){let r=this.keyMapByRunId[e.id];if(r===void 0)return;let i=e.inputs.messages!==void 0,a;i?bL(n?.chunk)?a=n?.chunk:a=new un({id:`run-${e.id}`,content:t}):a=t;let s=new Nr({ops:[{op:"add",path:`/logs/${r}/streamed_output_str/-`,value:t},{op:"add",path:`/logs/${r}/streamed_output/-`,value:a}]});await this.writer.write(s)}},wL=Q({ChatGenerationChunk:()=>Zr,GenerationChunk:()=>os,RUN_KEY:()=>Mo}),Mo="__run",os=class eI{text;generationInfo;constructor(t){this.text=t.text,this.generationInfo=t.generationInfo}concat(t){return new eI({text:this.text+t.text,generationInfo:{...this.generationInfo,...t.generationInfo}})}},Zr=class tI extends os{message;constructor(t){super(t),this.message=t.message}concat(t){return new tI({text:this.text+t.text,generationInfo:{...this.generationInfo,...t.generationInfo},message:this.message.concat(t.message)})}},$L=Object.prototype.toString,SL=e=>$L.call(e)==="[object Error]",kL=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function xL(e){if(!(e&&SL(e)&&e.name==="TypeError"&&typeof e.message=="string"))return!1;let{message:t,stack:n}=e;return t==="Load failed"?n===void 0||"__sentry_captured__"in e:t.startsWith("error sending request for url")?!0:kL.has(t)}function IL(e){if(typeof e=="number"){if(e<0)throw new TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(e))throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(e!==void 0)throw new TypeError("Expected `retries` to be a number or Infinity.")}function yl(e,t,{min:n=0,allowInfinity:r=!1}={}){if(t!==void 0){if(typeof t!="number"||Number.isNaN(t))throw new TypeError(`Expected \`${e}\` to be a number${r?" or Infinity":""}.`);if(!r&&!Number.isFinite(t))throw new TypeError(`Expected \`${e}\` to be a finite number.`);if(t<n)throw new TypeError(`Expected \`${e}\` to be \u2265 ${n}.`)}}var EL=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}};function TL(e,t){let n=Math.max(1,e+1),r=t.randomize?Math.random()+1:1,i=Math.round(r*t.minTimeout*t.factor**(n-1));return i=Math.min(i,t.maxTimeout),i}function I$(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function OL({error:e,attemptNumber:t,retriesConsumed:n,startTime:r,options:i}){let a=e instanceof Error?e:new TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(a instanceof EL)throw a.originalError;let s=Number.isFinite(i.retries)?Math.max(0,i.retries-n):i.retries,o=i.maxRetryTime??Number.POSITIVE_INFINITY,c=Object.freeze({error:a,attemptNumber:t,retriesLeft:s,retriesConsumed:n});if(await i.onFailedAttempt(c),I$(r,o)<=0)throw a;let l=await i.shouldConsumeRetry(c),u=I$(r,o);if(u<=0||s<=0)throw a;if(a instanceof TypeError&&!xL(a)){if(l)throw a;return i.signal?.throwIfAborted(),!1}if(!await i.shouldRetry(c))throw a;if(!l)return i.signal?.throwIfAborted(),!1;let d=TL(n,i),f=Math.min(d,u);return f>0&&await new Promise((h,p)=>{let m=()=>{clearTimeout(v),i.signal?.removeEventListener("abort",m),p(i.signal.reason)},v=setTimeout(()=>{i.signal?.removeEventListener("abort",m),h()},f);i.unref&&v.unref?.(),i.signal?.addEventListener("abort",m,{once:!0})}),i.signal?.throwIfAborted(),!0}async function fg(e,t={}){if(t={...t},IL(t.retries),Object.hasOwn(t,"forever"))throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");t.retries??=10,t.factor??=2,t.minTimeout??=1e3,t.maxTimeout??=Number.POSITIVE_INFINITY,t.maxRetryTime??=Number.POSITIVE_INFINITY,t.randomize??=!1,t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.shouldConsumeRetry??=()=>!0,yl("factor",t.factor,{min:0,allowInfinity:!1}),yl("minTimeout",t.minTimeout,{min:0,allowInfinity:!1}),yl("maxTimeout",t.maxTimeout,{min:0,allowInfinity:!0}),yl("maxRetryTime",t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let n=0,r=0,i=performance.now();for(;!Number.isFinite(t.retries)||r<=t.retries;){n++;try{t.signal?.throwIfAborted();let a=await e(n);return t.signal?.throwIfAborted(),a}catch(a){await OL({error:a,attemptNumber:n,retriesConsumed:r,startTime:i,options:t})&&r++}}throw new Error("Retry attempts exhausted without throwing an error.")}var AL=Q({AsyncCaller:()=>bc}),CL=[400,401,402,403,404,405,406,407,409],NL=e=>{if(typeof e!="object"||e===null)return;if("message"in e&&typeof e.message=="string"&&(e.message.startsWith("Cancel")||e.message.startsWith("AbortError"))||"name"in e&&typeof e.name=="string"&&e.name==="AbortError"||"code"in e&&typeof e.code=="string"&&e.code==="ECONNABORTED")throw e;let t="response"in e&&typeof e.response=="object"&&e.response!==null&&"status"in e.response&&typeof e.response.status=="number"?e.response.status:void 0,n="status"in e&&typeof e.status=="number"?e.status:void 0,r=t??n;if(r&&CL.includes(+r))throw e;if(("error"in e&&typeof e.error=="object"&&e.error!==null&&"code"in e.error&&typeof e.error.code=="string"?e.error.code:void 0)==="insufficient_quota"){let i=new Error("message"in e&&typeof e.message=="string"?e.message:"Insufficient quota");throw i.name="InsufficientQuotaError",i}},bc=class{maxConcurrency;maxRetries;onFailedAttempt;queue;constructor(e){this.maxConcurrency=e.maxConcurrency??1/0,this.maxRetries=e.maxRetries??6,this.onFailedAttempt=e.onFailedAttempt??NL,this.queue=new("default"in Lr?Lr.default:Lr)({concurrency:this.maxConcurrency})}async call(e,...t){return this.queue.add(()=>fg(()=>e(...t).catch(n=>{throw n instanceof Error?n:new Error(n)}),{onFailedAttempt:({error:n})=>this.onFailedAttempt?.(n),retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(e,t,...n){if(e.signal){let r;return Promise.race([this.call(t,...n),new Promise((i,a)=>{r=()=>{a(Ro(e.signal))},e.signal?.addEventListener("abort",r,{once:!0})})]).finally(()=>{e.signal&&r&&e.signal.removeEventListener("abort",r)})}return this.call(t,...n)}fetch(...e){return this.call(()=>fetch(...e).then(t=>t.ok?t:Promise.reject(t)))}},PL=Q({isSerializableSchema:()=>aa,isStandardJsonSchema:()=>cy,isStandardSchema:()=>nI});function nI(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&"~standard"in e&&typeof e["~standard"]=="object"&&e["~standard"]!==null&&"validate"in e["~standard"]}function cy(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&"~standard"in e&&typeof e["~standard"]=="object"&&e["~standard"]!==null&&"jsonSchema"in e["~standard"]}function aa(e){return nI(e)&&cy(e)}var rI=Object.freeze({status:"aborted"});function k(e,t,n){function r(o,c){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),o._zod.traits.has(e))return;o._zod.traits.add(e),t(o,c);let l=s.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){let f=u[d];f in o||(o[f]=l[f].bind(o))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function s(o){var c;let l=n?.Parent?new a:this;r(l,o),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:o=>n?.Parent&&o instanceof n.Parent?!0:o?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var iI=Symbol("zod_brand"),zr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},cs=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Tu={};function Bt(e){return e&&Object.assign(Tu,e),Tu}function RL(e){return e}function jL(e){return e}function ML(e){}function DL(e){throw new Error("Unexpected value in exhaustive check")}function UL(e){}function ly(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function L(e,t="|"){return e.map(n=>fe(n)).join(t)}function Ou(e,t){return typeof t=="bigint"?t.toString():t}function wc(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ya(e){return e==null}function wf(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function aI(e,t){let n=(e.toString().split(".")[1]||"").length,r=t.toString(),i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){let c=r.match(/\d?e-(\d?)/);c?.[1]&&(i=Number.parseInt(c[1]))}let a=n>i?n:i,s=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return s%o/10**a}var E$=Symbol("evaluating");function Oe(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==E$)return r===void 0&&(r=E$,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function LL(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ai(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function wr(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function zL(e){return wr(e._zod.def)}function FL(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function BL(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let i={};for(let a=0;a<t.length;a++)i[t[a]]=r[a];return i})}function ZL(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function hg(e){return JSON.stringify(e)}function sI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var uy="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ls(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var oI=wc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function sa(e){if(ls(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(ls(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function $f(e){return sa(e)?{...e}:Array.isArray(e)?[...e]:e}function VL(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var qL=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Au=new Set(["string","number","symbol"]),cI=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Vr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function N(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function GL(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,a){return t??(t=e()),Reflect.set(t,r,i,a)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function fe(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function lI(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var uI={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},dI={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function fI(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a=wr(e._zod.def,{get shape(){let s={};for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(s[o]=n.shape[o])}return Ai(this,"shape",s),s},checks:[]});return mt(e,a)}function hI(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=wr(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete s[o]}return Ai(this,"shape",s),s},checks:[]});return mt(e,a)}function dy(e,t){if(!sa(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let a=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(a,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=wr(e._zod.def,{get shape(){let a={...e._zod.def.shape,...t};return Ai(this,"shape",a),a}});return mt(e,i)}function pI(e,t){if(!sa(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=wr(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return Ai(this,"shape",r),r}});return mt(e,n)}function mI(e,t){let n=wr(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Ai(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return mt(e,n)}function fy(e,t,n){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=wr(t._zod.def,{get shape(){let o=t._zod.def.shape,c={...o};if(n)for(let l in n){if(!(l in o))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:o[l]}):o[l])}else for(let l in o)c[l]=e?new e({type:"optional",innerType:o[l]}):o[l];return Ai(this,"shape",c),c},checks:[]});return mt(t,s)}function gI(e,t,n){let r=wr(t._zod.def,{get shape(){let i=t._zod.def.shape,a={...i};if(n)for(let s in n){if(!(s in a))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(a[s]=new e({type:"nonoptional",innerType:i[s]}))}else for(let s in i)a[s]=new e({type:"nonoptional",innerType:i[s]});return Ai(this,"shape",a),a}});return mt(t,r)}function Vi(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Hn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function eo(e){return typeof e=="string"?e:e?.message}function Nn(e,t,n){let r={...e,path:e.path??[]};if(!e.message){let i=eo(e.inst?._zod.def?.error?.(e))??eo(t?.error?.(e))??eo(n.customError?.(e))??eo(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Sf(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function kf(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function me(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function us(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function HL(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function _I(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function yI(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function JL(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return _I(t+n)}function WL(e){return yI(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function KL(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function XL(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var pg=class{constructor(...t){}},vI=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:dI,Class:pg,NUMBER_FORMAT_RANGES:uI,aborted:Vi,allowsEval:oI,assert:UL,assertEqual:RL,assertIs:ML,assertNever:DL,assertNotEqual:jL,assignProp:Ai,base64ToUint8Array:_I,base64urlToUint8Array:JL,cached:wc,captureStackTrace:uy,cleanEnum:HL,cleanRegex:wf,clone:mt,cloneDef:zL,createTransparentProxy:GL,defineLazy:Oe,esc:hg,escapeRegex:Vr,extend:dy,finalizeIssue:Nn,floatSafeRemainder:aI,getElementAtPath:FL,getEnumValues:ly,getLengthableOrigin:kf,getParsedType:qL,getSizableOrigin:Sf,hexToUint8Array:KL,isObject:ls,isPlainObject:sa,issue:us,joinValues:L,jsonStringifyReplacer:Ou,merge:mI,mergeDefs:wr,normalizeParams:N,nullish:ya,numKeys:VL,objectClone:LL,omit:hI,optionalKeys:lI,parsedType:me,partial:fy,pick:fI,prefixIssues:Hn,primitiveTypes:cI,promiseAllObject:BL,propertyKeyTypes:Au,randomString:ZL,required:gI,safeExtend:pI,shallowClone:$f,slugify:sI,stringifyPrimitive:fe,uint8ArrayToBase64:yI,uint8ArrayToBase64url:WL,uint8ArrayToHex:XL,unwrapMessage:eo},Symbol.toStringTag,{value:"Module"})),bI=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ou,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},hy=k("$ZodError",bI),Sn=k("$ZodError",bI,{Parent:Error});function py(e,t=n=>n.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function my(e,t=n=>n.message){let n={_errors:[]},r=i=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>r({issues:s}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let s=n,o=0;for(;o<a.path.length;){let c=a.path[o];o===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(a))):s[c]=s[c]||{_errors:[]},s=s[c],o++}}};return r(e),n}function wI(e,t=n=>n.message){let n={errors:[]},r=(i,a=[])=>{var s,o;for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>r({issues:l},c.path));else if(c.code==="invalid_key")r({issues:c.issues},c.path);else if(c.code==="invalid_element")r({issues:c.issues},c.path);else{let l=[...a,...c.path];if(l.length===0){n.errors.push(t(c));continue}let u=n,d=0;for(;d<l.length;){let f=l[d],h=d===l.length-1;typeof f=="string"?(u.properties??(u.properties={}),(s=u.properties)[f]??(s[f]={errors:[]}),u=u.properties[f]):(u.items??(u.items=[]),(o=u.items)[f]??(o[f]={errors:[]}),u=u.items[f]),h&&u.errors.push(t(c)),d++}}};return r(e),n}function $I(e){let t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function gy(e){let t=[],n=[...e.issues].sort((r,i)=>(r.path??[]).length-(i.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${$I(r.path)}`);return t.join(`
525
- `)}var $c=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new zr;if(s.issues.length){let o=new(i?.Err??e)(s.issues.map(c=>Nn(c,a,Bt())));throw uy(o,i?.callee),o}return s.value},oa=$c(Sn),Sc=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let o=new(i?.Err??e)(s.issues.map(c=>Nn(c,a,Bt())));throw uy(o,i?.callee),o}return s.value},Do=Sc(Sn),kc=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new zr;return a.issues.length?{success:!1,error:new(e??hy)(a.issues.map(s=>Nn(s,i,Bt())))}:{success:!0,data:a.value}},SI=kc(Sn),xc=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(s=>Nn(s,i,Bt())))}:{success:!0,data:a.value}},kI=xc(Sn),_y=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return $c(e)(t,n,i)},YL=_y(Sn),yy=e=>(t,n,r)=>$c(e)(t,n,r),QL=yy(Sn),vy=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Sc(e)(t,n,i)},ez=vy(Sn),by=e=>async(t,n,r)=>Sc(e)(t,n,r),tz=by(Sn),wy=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return kc(e)(t,n,i)},nz=wy(Sn),$y=e=>(t,n,r)=>kc(e)(t,n,r),rz=$y(Sn),Sy=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return xc(e)(t,n,i)},iz=Sy(Sn),ky=e=>async(t,n,r)=>xc(e)(t,n,r),az=ky(Sn),xI=/^[cC][^\s-]{8,}$/,II=/^[0-9a-z]+$/,EI=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,TI=/^[0-9a-vA-V]{20}$/,OI=/^[A-Za-z0-9]{27}$/,AI=/^[a-zA-Z0-9_-]{21}$/,CI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sz=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,NI=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ds=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,oz=ds(4),cz=ds(6),lz=ds(7),PI=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uz=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,dz=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,RI=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,fz=RI,hz=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,pz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function jI(){return new RegExp(pz,"u")}var MI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,DI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,UI=e=>{let t=Vr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},LI=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,zI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,FI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xy=/^[A-Za-z0-9_-]*$/,BI=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ZI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,VI=/^\+[1-9]\d{6,14}$/,qI="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",GI=new RegExp(`^${qI}$`);function HI(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function JI(e){return new RegExp(`^${HI(e)}$`)}function WI(e){let t=HI({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return new RegExp(`^${qI}T(?:${r})$`)}var KI=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},XI=/^-?\d+n?$/,YI=/^-?\d+$/,Iy=/^-?\d+(?:\.\d+)?$/,QI=/^(?:true|false)$/i,eE=/^null$/i,tE=/^undefined$/i,nE=/^[^A-Z]*$/,rE=/^[^a-z]*$/,iE=/^[0-9a-fA-F]*$/;function Ic(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Ec(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var mz=/^[0-9a-fA-F]{32}$/,gz=Ic(22,"=="),_z=Ec(22),yz=/^[0-9a-fA-F]{40}$/,vz=Ic(27,"="),bz=Ec(27),wz=/^[0-9a-fA-F]{64}$/,$z=Ic(43,"="),Sz=Ec(43),kz=/^[0-9a-fA-F]{96}$/,xz=Ic(64,""),Iz=Ec(64),Ez=/^[0-9a-fA-F]{128}$/,Tz=Ic(86,"=="),Oz=Ec(86),Ey=Object.freeze(Object.defineProperty({__proto__:null,base64:FI,base64url:xy,bigint:XI,boolean:QI,browserEmail:hz,cidrv4:LI,cidrv6:zI,cuid:xI,cuid2:II,date:GI,datetime:WI,domain:ZI,duration:CI,e164:VI,email:PI,emoji:jI,extendedDuration:sz,guid:NI,hex:iE,hostname:BI,html5Email:uz,idnEmail:fz,integer:YI,ipv4:MI,ipv6:DI,ksuid:OI,lowercase:nE,mac:UI,md5_base64:gz,md5_base64url:_z,md5_hex:mz,nanoid:AI,null:eE,number:Iy,rfc5322Email:dz,sha1_base64:vz,sha1_base64url:bz,sha1_hex:yz,sha256_base64:$z,sha256_base64url:Sz,sha256_hex:wz,sha384_base64:xz,sha384_base64url:Iz,sha384_hex:kz,sha512_base64:Tz,sha512_base64url:Oz,sha512_hex:Ez,string:KI,time:JI,ulid:EI,undefined:tE,unicodeEmail:RI,uppercase:rE,uuid:ds,uuid4:oz,uuid6:cz,uuid7:lz,xid:TI},Symbol.toStringTag,{value:"Module"})),ot=k("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),aE={number:"number",bigint:"bigint",object:"date"},Ty=k("$ZodCheckLessThan",(e,t)=>{ot.init(e,t);let n=aE[typeof t.value];e._zod.onattach.push(r=>{let i=r._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Oy=k("$ZodCheckGreaterThan",(e,t)=>{ot.init(e,t);let n=aE[typeof t.value];e._zod.onattach.push(r=>{let i=r._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sE=k("$ZodCheckMultipleOf",(e,t)=>{ot.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):aI(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),oE=k("$ZodCheckNumberFormat",(e,t)=>{ot.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,a]=uI[t.format];e._zod.onattach.push(s=>{let o=s._zod.bag;o.format=t.format,o.minimum=i,o.maximum=a,n&&(o.pattern=YI)}),e._zod.check=s=>{let o=s.value;if(n){if(!Number.isInteger(o)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?s.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}o<i&&s.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>a&&s.issues.push({origin:"number",input:o,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),cE=k("$ZodCheckBigIntFormat",(e,t)=>{ot.init(e,t);let[n,r]=dI[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=n,a.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),lE=k("$ZodCheckMaxSize",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{let i=r.value;return!ya(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let i=r.value;i.size<=t.maximum||r.issues.push({origin:Sf(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),uE=k("$ZodCheckMinSize",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{let i=r.value;return!ya(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let i=r.value;i.size>=t.minimum||r.issues.push({origin:Sf(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),dE=k("$ZodCheckSizeEquals",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{let i=r.value;return!ya(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{let i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=r=>{let i=r.value,a=i.size;if(a===t.size)return;let s=a>t.size;r.issues.push({origin:Sf(i),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),fE=k("$ZodCheckMaxLength",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{let i=r.value;return!ya(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let i=r.value;if(i.length<=t.maximum)return;let s=kf(i);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),hE=k("$ZodCheckMinLength",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{let i=r.value;return!ya(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let i=r.value;if(i.length>=t.minimum)return;let s=kf(i);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),pE=k("$ZodCheckLengthEquals",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{let i=r.value;return!ya(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{let i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{let i=r.value,a=i.length;if(a===t.length)return;let s=kf(i),o=a>t.length;r.issues.push({origin:s,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Tc=k("$ZodCheckStringFormat",(e,t)=>{var n,r;ot.init(e,t),e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),mE=k("$ZodCheckRegex",(e,t)=>{Tc.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),gE=k("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=nE),Tc.init(e,t)}),_E=k("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rE),Tc.init(e,t)}),yE=k("$ZodCheckIncludes",(e,t)=>{ot.init(e,t);let n=Vr(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{let a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),vE=k("$ZodCheckStartsWith",(e,t)=>{ot.init(e,t);let n=new RegExp(`^${Vr(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),bE=k("$ZodCheckEndsWith",(e,t)=>{ot.init(e,t);let n=new RegExp(`.*${Vr(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function T$(e,t,n){e.issues.length&&t.issues.push(...Hn(n,e.issues))}var wE=k("$ZodCheckProperty",(e,t)=>{ot.init(e,t),e._zod.check=n=>{let r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(i=>T$(i,n,t.property));T$(r,n,t.property)}}),$E=k("$ZodCheckMimeType",(e,t)=>{ot.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),SE=k("$ZodCheckOverwrite",(e,t)=>{ot.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}}),Cu=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
526
- `).filter(s=>s),i=Math.min(...r.map(s=>s.length-s.trimStart().length)),a=r.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(let s of a)this.content.push(s)}compile(){let t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
527
- `))}},kE={major:4,minor:3,patch:6},ke=k("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=kE;let r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(let i of r)for(let a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(s,o,c)=>{let l=Vi(s),u;for(let d of o){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(l)continue;let f=s.issues.length,h=d._zod.check(s);if(h instanceof Promise&&c?.async===!1)throw new zr;if(u||h instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await h,s.issues.length!==f&&(l||(l=Vi(s,f)))});else{if(s.issues.length===f)continue;l||(l=Vi(s,f))}}return u?u.then(()=>s):s},a=(s,o,c)=>{if(Vi(s))return s.aborted=!0,s;let l=i(o,r,c);if(l instanceof Promise){if(c.async===!1)throw new zr;return l.then(u=>e._zod.parse(u,c))}return e._zod.parse(l,c)};e._zod.run=(s,o)=>{if(o.skipChecks)return e._zod.parse(s,o);if(o.direction==="backward"){let l=e._zod.parse({value:s.value,issues:[]},{...o,skipChecks:!0});return l instanceof Promise?l.then(u=>a(u,s,o)):a(l,s,o)}let c=e._zod.parse(s,o);if(c instanceof Promise){if(o.async===!1)throw new zr;return c.then(l=>i(l,r,o))}return i(c,r,o)}}Oe(e,"~standard",()=>({validate:i=>{try{let a=SI(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return kI(e,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Oc=k("$ZodString",(e,t)=>{ke.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??KI(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Xe=k("$ZodStringFormat",(e,t)=>{Tc.init(e,t),Oc.init(e,t)}),xE=k("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=NI),Xe.init(e,t)}),IE=k("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ds(r))}else t.pattern??(t.pattern=ds());Xe.init(e,t)}),EE=k("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=PI),Xe.init(e,t)}),TE=k("$ZodURL",(e,t)=>{Xe.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),OE=k("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=jI()),Xe.init(e,t)}),AE=k("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=AI),Xe.init(e,t)}),CE=k("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=xI),Xe.init(e,t)}),NE=k("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=II),Xe.init(e,t)}),PE=k("$ZodULID",(e,t)=>{t.pattern??(t.pattern=EI),Xe.init(e,t)}),RE=k("$ZodXID",(e,t)=>{t.pattern??(t.pattern=TI),Xe.init(e,t)}),jE=k("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=OI),Xe.init(e,t)}),ME=k("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=WI(t)),Xe.init(e,t)}),DE=k("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=GI),Xe.init(e,t)}),UE=k("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=JI(t)),Xe.init(e,t)}),LE=k("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=CI),Xe.init(e,t)}),zE=k("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=MI),Xe.init(e,t),e._zod.bag.format="ipv4"}),FE=k("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=DI),Xe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),BE=k("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=UI(t.delimiter)),Xe.init(e,t),e._zod.bag.format="mac"}),ZE=k("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=LI),Xe.init(e,t)}),VE=k("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=zI),Xe.init(e,t),e._zod.check=n=>{let r=n.value.split("/");try{if(r.length!==2)throw new Error;let[i,a]=r;if(!a)throw new Error;let s=Number(a);if(`${s}`!==a)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Ay(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var qE=k("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=FI),Xe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Ay(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function GE(e){if(!xy.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ay(n)}var HE=k("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=xy),Xe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{GE(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),JE=k("$ZodE164",(e,t)=>{t.pattern??(t.pattern=VI),Xe.init(e,t)});function WE(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}var KE=k("$ZodJWT",(e,t)=>{Xe.init(e,t),e._zod.check=n=>{WE(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),XE=k("$ZodCustomStringFormat",(e,t)=>{Xe.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Cy=k("$ZodNumber",(e,t)=>{ke.init(e,t),e._zod.pattern=e._zod.bag.pattern??Iy,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),YE=k("$ZodNumberFormat",(e,t)=>{oE.init(e,t),Cy.init(e,t)}),Ny=k("$ZodBoolean",(e,t)=>{ke.init(e,t),e._zod.pattern=QI,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Py=k("$ZodBigInt",(e,t)=>{ke.init(e,t),e._zod.pattern=XI,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),QE=k("$ZodBigIntFormat",(e,t)=>{cE.init(e,t),Py.init(e,t)}),eT=k("$ZodSymbol",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;return typeof i=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),n}}),tT=k("$ZodUndefined",(e,t)=>{ke.init(e,t),e._zod.pattern=tE,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,r)=>{let i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),nT=k("$ZodNull",(e,t)=>{ke.init(e,t),e._zod.pattern=eE,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{let i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),rT=k("$ZodAny",(e,t)=>{ke.init(e,t),e._zod.parse=n=>n}),Ry=k("$ZodUnknown",(e,t)=>{ke.init(e,t),e._zod.parse=n=>n}),jy=k("$ZodNever",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),iT=k("$ZodVoid",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;return typeof i>"u"||n.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),n}}),aT=k("$ZodDate",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),n}});function O$(e,t,n){e.issues.length&&t.issues.push(...Hn(n,e.issues)),t.value[n]=e.value}var sT=k("$ZodArray",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let s=0;s<i.length;s++){let o=i[s],c=t.element._zod.run({value:o,issues:[]},r);c instanceof Promise?a.push(c.then(l=>O$(l,n,s))):O$(c,n,s)}return a.length?Promise.all(a).then(()=>n):n}});function Nu(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Hn(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function oT(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);let n=lI(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function cT(e,t,n,r,i,a){let s=[],o=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout==="optional";for(let d in t){if(o.has(d))continue;if(l==="never"){s.push(d);continue}let f=c.run({value:t[d],issues:[]},r);f instanceof Promise?e.push(f.then(h=>Nu(h,n,d,t,u))):Nu(f,n,d,t,u)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var lT=k("$ZodObject",(e,t)=>{if(ke.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let o=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...o};return Object.defineProperty(t,"shape",{value:c}),c}})}let r=wc(()=>oT(t));Oe(e._zod,"propValues",()=>{let o=t.shape,c={};for(let l in o){let u=o[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let d of u.values)c[l].add(d)}}return c});let i=ls,a=t.catchall,s;e._zod.parse=(o,c)=>{s??(s=r.value);let l=o.value;if(!i(l))return o.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),o;o.value={};let u=[],d=s.shape;for(let f of s.keys){let h=d[f],p=h._zod.optout==="optional",m=h._zod.run({value:l[f],issues:[]},c);m instanceof Promise?u.push(m.then(v=>Nu(v,o,f,l,p))):Nu(m,o,f,l,p)}return a?cT(u,l,o,c,r.value,e):u.length?Promise.all(u).then(()=>o):o}}),uT=k("$ZodObjectJIT",(e,t)=>{lT.init(e,t);let n=e._zod.parse,r=wc(()=>oT(t)),i=f=>{let h=new Cu(["shape","payload","ctx"]),p=r.value,m=$=>{let S=hg($);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};h.write("const input = payload.value;");let v=Object.create(null),g=0;for(let $ of p.keys)v[$]=`key_${g++}`;h.write("const newResult = {};");for(let $ of p.keys){let S=v[$],x=hg($),T=f[$]?._zod?.optout==="optional";h.write(`const ${S} = ${m($)};`),T?h.write(`
528
- if (${S}.issues.length) {
529
- if (${x} in input) {
530
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
531
- ...iss,
532
- path: iss.path ? [${x}, ...iss.path] : [${x}]
533
- })));
534
- }
535
- }
536
-
537
- if (${S}.value === undefined) {
538
- if (${x} in input) {
539
- newResult[${x}] = undefined;
540
- }
541
- } else {
542
- newResult[${x}] = ${S}.value;
543
- }
544
-
545
- `):h.write(`
546
- if (${S}.issues.length) {
547
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
548
- ...iss,
549
- path: iss.path ? [${x}, ...iss.path] : [${x}]
550
- })));
551
- }
552
-
553
- if (${S}.value === undefined) {
554
- if (${x} in input) {
555
- newResult[${x}] = undefined;
556
- }
557
- } else {
558
- newResult[${x}] = ${S}.value;
559
- }
560
-
561
- `)}h.write("payload.value = newResult;"),h.write("return payload;");let y=h.compile();return($,S)=>y(f,$,S)},a,s=ls,o=!Tu.jitless,l=o&&oI.value,u=t.catchall,d;e._zod.parse=(f,h)=>{d??(d=r.value);let p=f.value;return s(p)?o&&l&&h?.async===!1&&h.jitless!==!0?(a||(a=i(t.shape)),f=a(f,h),u?cT([],p,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f)}});function A$(e,t,n,r){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let i=e.filter(a=>!Vi(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(s=>Nn(s,r,Bt())))}),t)}var xf=k("$ZodUnion",(e,t)=>{ke.init(e,t),Oe(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Oe(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Oe(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Oe(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>wf(a.source)).join("|")})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let s=!1,o=[];for(let c of t.options){let l=c._zod.run({value:i.value,issues:[]},a);if(l instanceof Promise)o.push(l),s=!0;else{if(l.issues.length===0)return l;o.push(l)}}return s?Promise.all(o).then(c=>A$(c,i,e,a)):A$(o,i,e,a)}});function C$(e,t,n,r){let i=e.filter(a=>a.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(s=>Nn(s,r,Bt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}var dT=k("$ZodXor",(e,t)=>{xf.init(e,t),t.inclusive=!1;let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let s=!1,o=[];for(let c of t.options){let l=c._zod.run({value:i.value,issues:[]},a);l instanceof Promise?(o.push(l),s=!0):o.push(l)}return s?Promise.all(o).then(c=>C$(c,i,e,a)):C$(o,i,e,a)}}),fT=k("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xf.init(e,t);let n=e._zod.parse;Oe(e._zod,"propValues",()=>{let i={};for(let a of t.options){let s=a._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[o,c]of Object.entries(s)){i[o]||(i[o]=new Set);for(let l of c)i[o].add(l)}}return i});let r=wc(()=>{let i=t.options,a=new Map;for(let s of i){let o=s._zod.propValues?.[t.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of o){if(a.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);a.set(c,s)}}return a});e._zod.parse=(i,a)=>{let s=i.value;if(!ls(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let o=r.value.get(s?.[t.discriminator]);return o?o._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),i)}}),hT=k("$ZodIntersection",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{let i=n.value,a=t.left._zod.run({value:i,issues:[]},r),s=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([c,l])=>N$(n,c,l)):N$(n,a,s)}});function mg(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(sa(e)&&sa(t)){let n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(let a of r){let s=mg(e[a],t[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};i[a]=s.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],s=mg(i,a);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function N$(e,t,n){let r=new Map,i;for(let o of t.issues)if(o.code==="unrecognized_keys"){i??(i=o);for(let c of o.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(o);for(let o of n.issues)if(o.code==="unrecognized_keys")for(let c of o.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(o);let a=[...r].filter(([,o])=>o.l&&o.r).map(([o])=>o);if(a.length&&i&&e.issues.push({...i,keys:a}),Vi(e))return e;let s=mg(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var My=k("$ZodTuple",(e,t)=>{ke.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let s=[],o=[...n].reverse().findIndex(u=>u._zod.optin!=="optional"),c=o===-1?0:n.length-o;if(!t.rest){let u=a.length>n.length,d=a.length<c-1;if(u||d)return r.issues.push({...u?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:a,inst:e,origin:"array"}),r}let l=-1;for(let u of n){if(l++,l>=a.length&&l>=c)continue;let d=u._zod.run({value:a[l],issues:[]},i);d instanceof Promise?s.push(d.then(f=>vl(f,r,l))):vl(d,r,l)}if(t.rest){let u=a.slice(n.length);for(let d of u){l++;let f=t.rest._zod.run({value:d,issues:[]},i);f instanceof Promise?s.push(f.then(h=>vl(h,r,l))):vl(f,r,l)}}return s.length?Promise.all(s).then(()=>r):r}});function vl(e,t,n){e.issues.length&&t.issues.push(...Hn(n,e.issues)),t.value[n]=e.value}var pT=k("$ZodRecord",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!sa(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let a=[],s=t.keyType._zod.values;if(s){n.value={};let o=new Set;for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){o.add(typeof l=="number"?l.toString():l);let u=t.valueType._zod.run({value:i[l],issues:[]},r);u instanceof Promise?a.push(u.then(d=>{d.issues.length&&n.issues.push(...Hn(l,d.issues)),n.value[l]=d.value})):(u.issues.length&&n.issues.push(...Hn(l,u.issues)),n.value[l]=u.value)}let c;for(let l in i)o.has(l)||(c=c??[],c.push(l));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o==="__proto__")continue;let c=t.keyType._zod.run({value:o,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof o=="string"&&Iy.test(o)&&c.issues.length){let d=t.keyType._zod.run({value:Number(o),issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){t.mode==="loose"?n.value[o]=i[o]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>Nn(d,r,Bt())),input:o,path:[o],inst:e});continue}let u=t.valueType._zod.run({value:i[o],issues:[]},r);u instanceof Promise?a.push(u.then(d=>{d.issues.length&&n.issues.push(...Hn(o,d.issues)),n.value[c.value]=d.value})):(u.issues.length&&n.issues.push(...Hn(o,u.issues)),n.value[c.value]=u.value)}}return a.length?Promise.all(a).then(()=>n):n}}),mT=k("$ZodMap",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let a=[];n.value=new Map;for(let[s,o]of i){let c=t.keyType._zod.run({value:s,issues:[]},r),l=t.valueType._zod.run({value:o,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([u,d])=>{P$(u,d,n,s,i,e,r)})):P$(c,l,n,s,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function P$(e,t,n,r,i,a,s){e.issues.length&&(Au.has(typeof r)?n.issues.push(...Hn(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:a,issues:e.issues.map(o=>Nn(o,s,Bt()))})),t.issues.length&&(Au.has(typeof r)?n.issues.push(...Hn(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:a,key:r,issues:t.issues.map(o=>Nn(o,s,Bt()))})),n.value.set(e.value,t.value)}var gT=k("$ZodSet",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let a=[];n.value=new Set;for(let s of i){let o=t.valueType._zod.run({value:s,issues:[]},r);o instanceof Promise?a.push(o.then(c=>R$(c,n))):R$(o,n)}return a.length?Promise.all(a).then(()=>n):n}});function R$(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var _T=k("$ZodEnum",(e,t)=>{ke.init(e,t);let n=ly(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>Au.has(typeof i)).map(i=>typeof i=="string"?Vr(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{let s=i.value;return r.has(s)||i.issues.push({code:"invalid_value",values:n,input:s,inst:e}),i}}),yT=k("$ZodLiteral",(e,t)=>{if(ke.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Vr(r):r?Vr(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),vT=k("$ZodFile",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;return i instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:i,inst:e}),n}}),bT=k("$ZodTransform",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new cs(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(n.value=s,n));if(i instanceof Promise)throw new zr;return n.value=i,n}});function j$(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Ac=k("$ZodOptional",(e,t)=>{ke.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Oe(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${wf(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>j$(a,n.value)):j$(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),wT=k("$ZodExactOptional",(e,t)=>{Ac.init(e,t),Oe(e._zod,"values",()=>t.innerType._zod.values),Oe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),$T=k("$ZodNullable",(e,t)=>{ke.init(e,t),Oe(e._zod,"optin",()=>t.innerType._zod.optin),Oe(e._zod,"optout",()=>t.innerType._zod.optout),Oe(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${wf(n.source)}|null)$`):void 0}),Oe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),ST=k("$ZodDefault",(e,t)=>{ke.init(e,t),e._zod.optin="optional",Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>M$(a,t)):M$(i,t)}});function M$(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var kT=k("$ZodPrefault",(e,t)=>{ke.init(e,t),e._zod.optin="optional",Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),xT=k("$ZodNonOptional",(e,t)=>{ke.init(e,t),Oe(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>D$(a,e)):D$(i,e)}});function D$(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var IT=k("$ZodSuccess",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new cs("ZodSuccess");let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>(n.value=a.issues.length===0,n)):(n.value=i.issues.length===0,n)}}),ET=k("$ZodCatch",(e,t)=>{ke.init(e,t),Oe(e._zod,"optin",()=>t.innerType._zod.optin),Oe(e._zod,"optout",()=>t.innerType._zod.optout),Oe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(s=>Nn(s,r,Bt()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Nn(a,r,Bt()))},input:n.value}),n.issues=[]),n)}}),TT=k("$ZodNaN",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),OT=k("$ZodPipe",(e,t)=>{ke.init(e,t),Oe(e._zod,"values",()=>t.in._zod.values),Oe(e._zod,"optin",()=>t.in._zod.optin),Oe(e._zod,"optout",()=>t.out._zod.optout),Oe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){let a=t.out._zod.run(n,r);return a instanceof Promise?a.then(s=>bl(s,t.in,r)):bl(a,t.in,r)}let i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>bl(a,t.out,r)):bl(i,t.out,r)}});function bl(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Dy=k("$ZodCodec",(e,t)=>{ke.init(e,t),Oe(e._zod,"values",()=>t.in._zod.values),Oe(e._zod,"optin",()=>t.in._zod.optin),Oe(e._zod,"optout",()=>t.out._zod.optout),Oe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){let a=t.in._zod.run(n,r);return a instanceof Promise?a.then(s=>wl(s,t,r)):wl(a,t,r)}else{let a=t.out._zod.run(n,r);return a instanceof Promise?a.then(s=>wl(s,t,r)):wl(a,t,r)}}});function wl(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let i=t.transform(e.value,e);return i instanceof Promise?i.then(a=>$l(e,a,t.out,n)):$l(e,i,t.out,n)}else{let i=t.reverseTransform(e.value,e);return i instanceof Promise?i.then(a=>$l(e,a,t.in,n)):$l(e,i,t.in,n)}}function $l(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var AT=k("$ZodReadonly",(e,t)=>{ke.init(e,t),Oe(e._zod,"propValues",()=>t.innerType._zod.propValues),Oe(e._zod,"values",()=>t.innerType._zod.values),Oe(e._zod,"optin",()=>t.innerType?._zod?.optin),Oe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(U$):U$(i)}});function U$(e){return e.value=Object.freeze(e.value),e}var CT=k("$ZodTemplateLiteral",(e,t)=>{ke.init(e,t);let n=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let i=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${r._zod.traits}`);let a=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;n.push(i.slice(a,s))}else if(r===null||cI.has(typeof r))n.push(Vr(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,i)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),NT=k("$ZodFunction",(e,t)=>(ke.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...r){let i=e._def.input?oa(e._def.input,r):r,a=Reflect.apply(n,this,i);return e._def.output?oa(e._def.output,a):a}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...r){let i=e._def.input?await Do(e._def.input,r):r,a=await Reflect.apply(n,this,i);return e._def.output?await Do(e._def.output,a):a}},e._zod.parse=(n,r)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let r=e.constructor;return Array.isArray(n[0])?new r({type:"function",input:new My({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new r({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let r=e.constructor;return new r({type:"function",input:e._def.input,output:n})},e)),PT=k("$ZodPromise",(e,t)=>{ke.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(i=>t.innerType._zod.run({value:i,issues:[]},r))}),RT=k("$ZodLazy",(e,t)=>{ke.init(e,t),Oe(e._zod,"innerType",()=>t.getter()),Oe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Oe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Oe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Oe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),jT=k("$ZodCustom",(e,t)=>{ot.init(e,t),ke.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(a=>L$(a,n,r,e));L$(i,n,r,e)}});function L$(e,t,n,r){if(!e){let i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(us(i))}}var Az=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(i){return e[i]??null}let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${o}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${a}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${o}`}case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${fe(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${i.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:a.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${a.suffix}"`:a.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${a.includes}"`:a.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${a.pattern}`:`${n[a.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${L(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Cz(){return{localeError:Az()}}var Nz=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(i){return e[i]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${i.expected}, daxil olan ${o}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${a}, daxil olan ${o}`}case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${fe(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${a}${i.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${a}${i.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${a.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:a.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${a.suffix}" il\u0259 bitm\u0259lidir`:a.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${a.includes}" daxil olmal\u0131d\u0131r`:a.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${a.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[a.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${L(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Pz(){return{localeError:Nz()}}function z$(e,t,n,r){let i=Math.abs(e),a=i%10,s=i%100;return s>=11&&s<=19?r:a===1?t:a>=2&&a<=4?n:r}var Rz=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(i){return e[i]??null}let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},r={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${o}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${a}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${o}`}case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${fe(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);if(s){let o=Number(i.maximum),c=z$(o,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${a}${i.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);if(s){let o=Number(i.minimum),c=z$(o,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${a}${i.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${L(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function jz(){return{localeError:Rz()}}var Mz=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(i){return e[i]??null}let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${o}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${o}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${fe(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${i.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;if(a.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${a.prefix}"`;if(a.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${a.suffix}"`;if(a.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${a.includes}"`;if(a.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${a.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return a.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),a.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${L(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function Dz(){return{localeError:Mz()}}var Uz=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(i){return e[i]??null}let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${o}`:`Tipus inv\xE0lid: s'esperava ${a}, s'ha rebut ${o}`}case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${fe(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${L(i.values," o ")}`;case"too_big":{let a=i.inclusive?"com a m\xE0xim":"menys de",s=t(i.origin);return s?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${a} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${a} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${a.prefix}"`:a.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${a.suffix}"`:a.format==="includes"?`Format inv\xE0lid: ha d'incloure "${a.includes}"`:a.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${a.pattern}`:`Format inv\xE0lid per a ${n[a.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${L(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}};function Lz(){return{localeError:Uz()}}var zz=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(i){return e[i]??null}let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${i.expected}, obdr\u017Eeno ${o}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${a}, obdr\u017Eeno ${o}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${fe(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${a}${i.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${a}${i.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${a.prefix}"`:a.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${a.suffix}"`:a.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${a.includes}"`:a.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${a.pattern}`:`Neplatn\xFD form\xE1t ${n[a.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${L(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}};function Fz(){return{localeError:zz()}}var Bz=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(i){return e[i]??null}let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${o}`:`Ugyldigt input: forventede ${a}, fik ${o}`}case"invalid_value":return i.values.length===1?`Ugyldig v\xE6rdi: forventede ${fe(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin),o=r[i.origin]??i.origin;return s?`For stor: forventede ${o??"value"} ${s.verb} ${a} ${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${o??"value"} havde ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin),o=r[i.origin]??i.origin;return s?`For lille: forventede ${o} ${s.verb} ${a} ${i.minimum.toString()} ${s.unit}`:`For lille: forventede ${o} havde ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: skal starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: skal ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: skal indeholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${n[a.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${L(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${i.origin}`;default:return"Ugyldigt input"}}};function Zz(){return{localeError:Bz()}}var Vz=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(i){return e[i]??null}let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},r={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${o}`:`Ung\xFCltige Eingabe: erwartet ${a}, erhalten ${o}`}case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${fe(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ist`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ist`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ung\xFCltiger String: muss mit "${a.prefix}" beginnen`:a.format==="ends_with"?`Ung\xFCltiger String: muss mit "${a.suffix}" enden`:a.format==="includes"?`Ung\xFCltiger String: muss "${a.includes}" enthalten`:a.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${a.pattern} entsprechen`:`Ung\xFCltig: ${n[a.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${L(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}};function qz(){return{localeError:Vz()}}var Gz=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return`Invalid input: expected ${a}, received ${o}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${fe(i.values[0])}`:`Invalid option: expected one of ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Too big: expected ${i.origin??"value"} to have ${a}${i.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Too small: expected ${i.origin} to have ${a}${i.minimum.toString()} ${s.unit}`:`Too small: expected ${i.origin} to be ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${n[a.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${L(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function MT(){return{localeError:Gz()}}var Hz=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(i){return e[i]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${i.expected}, ricevi\u011Dis ${o}`:`Nevalida enigo: atendi\u011Dis ${a}, ricevi\u011Dis ${o}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${fe(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${a}${i.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${a}${i.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${a.prefix}"`:a.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${a.suffix}"`:a.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${a.includes}"`:a.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${a.pattern}`:`Nevalida ${n[a.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${L(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function Jz(){return{localeError:Hz()}}var Wz=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(i){return e[i]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${i.expected}, recibido ${o}`:`Entrada inv\xE1lida: se esperaba ${a}, recibido ${o}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${fe(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin),o=r[i.origin]??i.origin;return s?`Demasiado grande: se esperaba que ${o??"valor"} tuviera ${a}${i.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o??"valor"} fuera ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin),o=r[i.origin]??i.origin;return s?`Demasiado peque\xF1o: se esperaba que ${o} tuviera ${a}${i.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${o} fuera ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${a.prefix}"`:a.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${a.suffix}"`:a.format==="includes"?`Cadena inv\xE1lida: debe incluir "${a.includes}"`:a.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${a.pattern}`:`Inv\xE1lido ${n[a.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${L(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${r[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${r[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}};function Kz(){return{localeError:Wz()}}var Xz=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(i){return e[i]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},r={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${o} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${a} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${o} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${fe(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${L(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:a.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:a.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${a.includes}" \u0628\u0627\u0634\u062F`:a.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${a.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[a.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${L(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Yz(){return{localeError:Xz()}}var Qz=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(i){return e[i]??null}let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${o}`:`Virheellinen tyyppi: odotettiin ${a}, oli ${o}`}case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${fe(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${a}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${a}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${a.prefix}"`:a.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${a.suffix}"`:a.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${a.includes}"`:a.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${a.pattern}`:`Virheellinen ${n[a.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${L(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function e6(){return{localeError:Qz()}}var t6=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(i){return e[i]??null}let n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},r={nan:"NaN",number:"nombre",array:"tableau"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instanceof ${i.expected} attendu, ${o} re\xE7u`:`Entr\xE9e invalide : ${a} attendu, ${o} re\xE7u`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${fe(i.values[0])} attendu`:`Option invalide : une valeur parmi ${L(i.values,"|")} attendue`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Trop grand : ${i.origin??"valeur"} doit ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i.origin??"valeur"} doit \xEAtre ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Trop petit : ${i.origin} doit ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${i.origin} doit \xEAtre ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${a.pattern}`:`${n[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${L(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function n6(){return{localeError:t6()}}var r6=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(i){return e[i]??null}let n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : attendu instanceof ${i.expected}, re\xE7u ${o}`:`Entr\xE9e invalide : attendu ${a}, re\xE7u ${o}`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${fe(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"\u2264":"<",s=t(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${a}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"\u2265":">",s=t(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${a}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${a.pattern}`:`${n[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${L(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function i6(){return{localeError:r6()}}var a6=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=l=>l?e[l]:void 0,r=l=>{let u=n(l);return u?u.label:l??e.unknown.label},i=l=>`\u05D4${r(l)}`,a=l=>(n(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=l=>l?t[l]??null:null,o={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case"invalid_type":{let u=l.expected,d=c[u??""]??r(u),f=me(l.input),h=c[f]??e[f]?.label??f;return/^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(l.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${fe(l.values[0])}`;let u=l.values.map(h=>fe(h));if(l.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let u=s(l.origin),d=i(l.origin??"value");if(l.origin==="string")return`${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let p=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(l.origin==="array"||l.origin==="set"){let p=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",m=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let f=l.inclusive?"<=":"<",h=a(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${h} ${f}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${h} ${f}${l.maximum.toString()}`}case"too_small":{let u=s(l.origin),d=i(l.origin??"value");if(l.origin==="string")return`${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let p=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(l.origin==="array"||l.origin==="set"){let p=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let v=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${v}`}let m=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let f=l.inclusive?">=":">",h=a(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${h} ${f}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${h} ${f}${l.minimum.toString()}`}case"invalid_format":{let u=l;if(u.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let d=o[u.format],f=d?.label??u.format,p=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${p}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${L(l.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(l.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function s6(){return{localeError:a6()}}var o6=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(i){return e[i]??null}let n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},r={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${i.expected}, a kapott \xE9rt\xE9k ${o}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${a}, a kapott \xE9rt\xE9k ${o}`}case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${fe(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${a}${i.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${a}${i.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\xC9rv\xE9nytelen string: "${a.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:a.format==="ends_with"?`\xC9rv\xE9nytelen string: "${a.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:a.format==="includes"?`\xC9rv\xE9nytelen string: "${a.includes}" \xE9rt\xE9ket kell tartalmaznia`:a.format==="regex"?`\xC9rv\xE9nytelen string: ${a.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[a.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${L(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function c6(){return{localeError:o6()}}function F$(e,t,n){return Math.abs(e)===1?t:n}function xa(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}var l6=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(i){return e[i]??null}let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},r={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${i.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${o}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${a}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${o}`}case"invalid_value":return i.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${fe(i.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);if(s){let o=Number(i.maximum),c=F$(o,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${xa(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${i.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${xa(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);if(s){let o=Number(i.minimum),c=F$(o,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${xa(i.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${i.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${xa(i.origin)} \u056C\u056B\u0576\u056B ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${a.prefix}"-\u0578\u057E`:a.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${a.suffix}"-\u0578\u057E`:a.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${a.includes}"`:a.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${a.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[a.format]??i.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${i.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${i.keys.length>1?"\u0576\u0565\u0580":""}. ${L(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${xa(i.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${xa(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function u6(){return{localeError:l6()}}var d6=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(i){return e[i]??null}let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${o}`:`Input tidak valid: diharapkan ${a}, diterima ${o}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${fe(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${a}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${a}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak valid: harus dimulai dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak valid: harus berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak valid: harus menyertakan "${a.includes}"`:a.format==="regex"?`String tidak valid: harus sesuai pola ${a.pattern}`:`${n[a.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${L(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function f6(){return{localeError:d6()}}var h6=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(i){return e[i]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},r={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${o} \xFEar sem \xE1 a\xF0 vera instanceof ${i.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${o} \xFEar sem \xE1 a\xF0 vera ${a}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${fe(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${a}${i.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${a}${i.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${a.prefix}"`:a.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${a.suffix}"`:a.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${a.includes}"`:a.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${a.pattern}`:`Rangt ${n[a.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${L(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}};function p6(){return{localeError:h6()}}var m6=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(i){return e[i]??null}let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${o}`:`Input non valido: atteso ${a}, ricevuto ${o}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${fe(i.values[0])}`:`Opzione non valida: atteso uno tra ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${a}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${a}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Stringa non valida: deve iniziare con "${a.prefix}"`:a.format==="ends_with"?`Stringa non valida: deve terminare con "${a.suffix}"`:a.format==="includes"?`Stringa non valida: deve includere "${a.includes}"`:a.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${a.pattern}`:`Invalid ${n[a.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${L(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function g6(){return{localeError:m6()}}var _6=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(i){return e[i]??null}let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},r={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${o}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${a}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${o}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${fe(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${L(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let a=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(i.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${s.unit??"\u8981\u7D20"}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let a=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(i.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${s.unit}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${a.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[a.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${L(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function y6(){return{localeError:_6()}}var v6=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(i){return e[i]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},r={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${o}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${a}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${o}`}case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${fe(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${L(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.prefix}"-\u10D8\u10D7`:a.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.suffix}"-\u10D8\u10D7`:a.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${a.includes}"-\u10E1`:a.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${a.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${L(i.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${i.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${i.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function b6(){return{localeError:v6()}}var w6=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(i){return e[i]??null}let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},r={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${o}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${a} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${o}`}case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${fe(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${i.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${a} ${i.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${a.prefix}"`:a.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${a.suffix}"`:a.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${a.includes}"`:a.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${a.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${L(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function DT(){return{localeError:w6()}}function $6(){return DT()}var S6=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(i){return e[i]??null}let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${o}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${a}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${o}\uC785\uB2C8\uB2E4`}case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${fe(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${L(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let a=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=a==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",o=t(i.origin),c=o?.unit??"\uC694\uC18C";return o?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${c} ${a}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${a}${s}`}case"too_small":{let a=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=a==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",o=t(i.origin),c=o?.unit??"\uC694\uC18C";return o?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${c} ${a}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${a}${s}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:a.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${a.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[a.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${L(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function k6(){return{localeError:S6()}}var Hs=e=>e.charAt(0).toUpperCase()+e.slice(1);function B$(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?"many":n===1?"one":"few"}var x6=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(i,a,s,o){let c=e[i]??null;return c===null?c:{unit:c.unit[a],verb:c.verb[o][s?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},r={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${o}, o tik\u0117tasi - instanceof ${i.expected}`:`Gautas tipas ${o}, o tik\u0117tasi - ${a}`}case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${fe(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${L(i.values,"|")} pasirinkim\u0173`;case"too_big":{let a=r[i.origin]??i.origin,s=t(i.origin,B$(Number(i.maximum)),i.inclusive??!1,"smaller");if(s?.verb)return`${Hs(a??i.origin??"reik\u0161m\u0117")} ${s.verb} ${i.maximum.toString()} ${s.unit??"element\u0173"}`;let o=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Hs(a??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${o} ${i.maximum.toString()} ${s?.unit}`}case"too_small":{let a=r[i.origin]??i.origin,s=t(i.origin,B$(Number(i.minimum)),i.inclusive??!1,"bigger");if(s?.verb)return`${Hs(a??i.origin??"reik\u0161m\u0117")} ${s.verb} ${i.minimum.toString()} ${s.unit??"element\u0173"}`;let o=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Hs(a??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${o} ${i.minimum.toString()} ${s?.unit}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${a.prefix}"`:a.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${a.suffix}"`:a.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${a.includes}"`:a.format==="regex"?`Eilut\u0117 privalo atitikti ${a.pattern}`:`Neteisingas ${n[a.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${L(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let a=r[i.origin]??i.origin;return`${Hs(a??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function I6(){return{localeError:x6()}}var E6=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(i){return e[i]??null}let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},r={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${o}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${a}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${o}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${fe(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${a}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${a}${i.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${a.pattern}`:`Invalid ${n[a.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${L(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function T6(){return{localeError:E6()}}var O6=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(i){return e[i]??null}let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${o}`:`Input tidak sah: dijangka ${a}, diterima ${o}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${fe(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak sah: mesti bermula dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak sah: mesti mengandungi "${a.includes}"`:a.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${a.pattern}`:`${n[a.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${L(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function A6(){return{localeError:O6()}}var C6=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(i){return e[i]??null}let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},r={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${o}`:`Ongeldige invoer: verwacht ${a}, ontving ${o}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${fe(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin),o=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return s?`Te ${o}: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${o}: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} is`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin),o=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return s?`Te ${o}: verwacht dat ${i.origin} ${a}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${o}: verwacht dat ${i.origin} ${a}${i.minimum.toString()} is`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ongeldige tekst: moet met "${a.prefix}" beginnen`:a.format==="ends_with"?`Ongeldige tekst: moet op "${a.suffix}" eindigen`:a.format==="includes"?`Ongeldige tekst: moet "${a.includes}" bevatten`:a.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${a.pattern}`:`Ongeldig: ${n[a.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${L(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function N6(){return{localeError:C6()}}var P6=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(i){return e[i]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${o}`:`Ugyldig input: forventet ${a}, fikk ${o}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${fe(i.values[0])}`:`Ugyldig valg: forventet en av ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${a}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`For lite(n): forventet ${i.origin} til \xE5 ha ${a}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${n[a.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${L(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function R6(){return{localeError:P6()}}var j6=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(i){return e[i]??null}let n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`F\xE2sit giren: umulan instanceof ${i.expected}, al\u0131nan ${o}`:`F\xE2sit giren: umulan ${a}, al\u0131nan ${o}`}case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${fe(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${a}${i.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${a}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${a}${i.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${a}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let a=i;return a.format==="starts_with"?`F\xE2sit metin: "${a.prefix}" ile ba\u015Flamal\u0131.`:a.format==="ends_with"?`F\xE2sit metin: "${a.suffix}" ile bitmeli.`:a.format==="includes"?`F\xE2sit metin: "${a.includes}" ihtiv\xE2 etmeli.`:a.format==="regex"?`F\xE2sit metin: ${a.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[a.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${L(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function M6(){return{localeError:j6()}}var D6=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(i){return e[i]??null}let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},r={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${o} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${a} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${o} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${fe(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${L(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:a.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:a.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${a.includes}" \u0648\u0644\u0631\u064A`:a.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${a.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[a.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${L(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function U6(){return{localeError:D6()}}var L6=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(i){return e[i]??null}let n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},r={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${i.expected}, otrzymano ${o}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${a}, otrzymano ${o}`}case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${fe(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${i.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${i.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${a.prefix}"`:a.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${a.suffix}"`:a.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${a.includes}"`:a.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${a.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[a.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${L(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function z6(){return{localeError:L6()}}var F6=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(i){return e[i]??null}let n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",number:"n\xFAmero",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Tipo inv\xE1lido: esperado instanceof ${i.expected}, recebido ${o}`:`Tipo inv\xE1lido: esperado ${a}, recebido ${o}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${fe(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${a}${i.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Muito pequeno: esperado que ${i.origin} tivesse ${a}${i.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`${n[a.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${L(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}};function B6(){return{localeError:F6()}}function Z$(e,t,n,r){let i=Math.abs(e),a=i%10,s=i%100;return s>=11&&s<=19?r:a===1?t:a>=2&&a<=4?n:r}var Z6=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(i){return e[i]??null}let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${o}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${o}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${fe(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);if(s){let o=Number(i.maximum),c=Z$(o,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${i.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);if(s){let o=Number(i.minimum),c=Z$(o,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${i.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${L(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function V6(){return{localeError:Z6()}}var q6=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(i){return e[i]??null}let n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},r={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${i.expected}, prejeto ${o}`:`Neveljaven vnos: pri\u010Dakovano ${a}, prejeto ${o}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${fe(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${a}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${a}${i.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${a.prefix}"`:a.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${a.suffix}"`:a.format==="includes"?`Neveljaven niz: mora vsebovati "${a.includes}"`:a.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${a.pattern}`:`Neveljaven ${n[a.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${L(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function G6(){return{localeError:q6()}}var H6=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(i){return e[i]??null}let n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},r={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${i.expected}, fick ${o}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${a}, fick ${o}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${fe(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${a.prefix}"`:a.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${a.suffix}"`:a.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${a.includes}"`:a.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${a.pattern}"`:`Ogiltig(t) ${n[a.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${L(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function J6(){return{localeError:H6()}}var W6=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(i){return e[i]??null}let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}`}case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${fe(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${L(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${i.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${a}${i.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${a}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${a.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${L(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function K6(){return{localeError:W6()}}var X6=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(i){return e[i]??null}let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},r={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${o}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${a} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${o}`}case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${fe(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(i.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(i.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${a.prefix}"`:a.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${a.suffix}"`:a.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${a.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:a.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${a.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[a.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${L(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Y6(){return{localeError:X6()}}var Q6=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(i){return e[i]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${i.expected}, al\u0131nan ${o}`:`Ge\xE7ersiz de\u011Fer: beklenen ${a}, al\u0131nan ${o}`}case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${fe(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${a}${i.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${a}${i.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ge\xE7ersiz metin: "${a.prefix}" ile ba\u015Flamal\u0131`:a.format==="ends_with"?`Ge\xE7ersiz metin: "${a.suffix}" ile bitmeli`:a.format==="includes"?`Ge\xE7ersiz metin: "${a.includes}" i\xE7ermeli`:a.format==="regex"?`Ge\xE7ersiz metin: ${a.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[a.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${L(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function eF(){return{localeError:Q6()}}var tF=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(i){return e[i]??null}let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},r={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${o}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${a}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${o}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${fe(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${L(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function UT(){return{localeError:tF()}}function nF(){return UT()}var rF=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(i){return e[i]??null}let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},r={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${o} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${a} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${o} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${fe(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${L(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${a}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${a}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${a}${i.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${a}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${a.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${L(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function iF(){return{localeError:rF()}}var aF=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function t(i){return e[i]??null}let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${o}`:`Noto\u2018g\u2018ri kirish: kutilgan ${a}, qabul qilingan ${o}`}case"invalid_value":return i.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${fe(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Juda katta: kutilgan ${i.origin??"qiymat"} ${a}${i.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Juda kichik: kutilgan ${i.origin} ${a}${i.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${a.prefix}" bilan boshlanishi kerak`:a.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${a.suffix}" bilan tugashi kerak`:a.format==="includes"?`Noto\u2018g\u2018ri satr: "${a.includes}" ni o\u2018z ichiga olishi kerak`:a.format==="regex"?`Noto\u2018g\u2018ri satr: ${a.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[a.format]??i.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${i.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${i.keys.length>1?"lar":""}: ${L(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${i.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function sF(){return{localeError:aF()}}var oF=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(i){return e[i]??null}let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},r={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${o}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${a}, nh\u1EADn \u0111\u01B0\u1EE3c ${o}`}case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${fe(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${a}${i.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s.verb} ${a}${i.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${a.prefix}"`:a.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${a.suffix}"`:a.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${a.includes}"`:a.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${a.pattern}`:`${n[a.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${L(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function cF(){return{localeError:oF()}}var lF=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(i){return e[i]??null}let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},r={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${o}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${a}\uFF0C\u5B9E\u9645\u63A5\u6536 ${o}`}case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${fe(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${a}${i.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${a}${i.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.prefix}" \u5F00\u5934`:a.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.suffix}" \u7ED3\u5C3E`:a.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${a.pattern}`:`\u65E0\u6548${n[a.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${L(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function uF(){return{localeError:lF()}}var dF=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(i){return e[i]??null}let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},r={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${i.expected}\uFF0C\u4F46\u6536\u5230 ${o}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${a}\uFF0C\u4F46\u6536\u5230 ${o}`}case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${fe(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${a}${i.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${a}${i.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.prefix}" \u958B\u982D`:a.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.suffix}" \u7D50\u5C3E`:a.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${a.pattern}`:`\u7121\u6548\u7684 ${n[a.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${L(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function fF(){return{localeError:dF()}}var hF=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(i){return e[i]??null}let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},r={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let a=r[i.expected]??i.expected,s=me(i.input),o=r[s]??s;return/^[A-Z]/.test(i.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${o}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${a}, \xE0m\u1ECD\u0300 a r\xED ${o}`}case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${fe(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${L(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",s=t(i.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${s.verb} ${a}${i.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${i.maximum}`}case"too_small":{let a=i.inclusive?">=":">",s=t(i.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${s.verb} ${a}${i.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${i.minimum}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${a.prefix}"`:a.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${a.suffix}"`:a.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${a.includes}"`:a.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${a.pattern}`:`A\u1E63\xEC\u1E63e: ${n[a.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${L(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function pF(){return{localeError:hF()}}var LT=Object.freeze(Object.defineProperty({__proto__:null,ar:Cz,az:Pz,be:jz,bg:Dz,ca:Lz,cs:Fz,da:Zz,de:qz,en:MT,eo:Jz,es:Kz,fa:Yz,fi:e6,fr:n6,frCA:i6,he:s6,hu:c6,hy:u6,id:f6,is:p6,it:g6,ja:y6,ka:b6,kh:$6,km:DT,ko:k6,lt:I6,mk:T6,ms:A6,nl:N6,no:R6,ota:M6,pl:z6,ps:U6,pt:B6,ru:V6,sl:G6,sv:J6,ta:K6,th:Y6,tr:eF,ua:nF,uk:UT,ur:iF,uz:sF,vi:cF,yo:pF,zhCN:uF,zhTW:fF},Symbol.toStringTag,{value:"Module"})),V$,zT=Symbol("ZodOutput"),FT=Symbol("ZodInput"),Pu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let r={...this.get(n)??{}};delete r.id;let i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Uy(){return new Pu}(V$=globalThis).__zod_globalRegistry??(V$.__zod_globalRegistry=Uy());var nt=globalThis.__zod_globalRegistry;function BT(e,t){return new e({type:"string",...N(t)})}function ZT(e,t){return new e({type:"string",coerce:!0,...N(t)})}function Ly(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...N(t)})}function Ru(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...N(t)})}function zy(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...N(t)})}function Fy(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...N(t)})}function By(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...N(t)})}function Zy(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...N(t)})}function If(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...N(t)})}function Vy(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...N(t)})}function qy(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...N(t)})}function Gy(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...N(t)})}function Hy(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...N(t)})}function Jy(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...N(t)})}function Wy(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...N(t)})}function Ky(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...N(t)})}function Xy(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...N(t)})}function Yy(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...N(t)})}function VT(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...N(t)})}function Qy(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...N(t)})}function ev(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...N(t)})}function tv(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...N(t)})}function nv(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...N(t)})}function rv(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...N(t)})}function iv(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...N(t)})}var qT={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function GT(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...N(t)})}function HT(e,t){return new e({type:"string",format:"date",check:"string_format",...N(t)})}function JT(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...N(t)})}function WT(e,t){return new e({type:"string",format:"duration",check:"string_format",...N(t)})}function KT(e,t){return new e({type:"number",checks:[],...N(t)})}function XT(e,t){return new e({type:"number",coerce:!0,checks:[],...N(t)})}function YT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...N(t)})}function QT(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...N(t)})}function eO(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...N(t)})}function tO(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...N(t)})}function nO(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...N(t)})}function rO(e,t){return new e({type:"boolean",...N(t)})}function iO(e,t){return new e({type:"boolean",coerce:!0,...N(t)})}function aO(e,t){return new e({type:"bigint",...N(t)})}function sO(e,t){return new e({type:"bigint",coerce:!0,...N(t)})}function oO(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...N(t)})}function cO(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...N(t)})}function lO(e,t){return new e({type:"symbol",...N(t)})}function uO(e,t){return new e({type:"undefined",...N(t)})}function dO(e,t){return new e({type:"null",...N(t)})}function fO(e){return new e({type:"any"})}function av(e){return new e({type:"unknown"})}function sv(e,t){return new e({type:"never",...N(t)})}function hO(e,t){return new e({type:"void",...N(t)})}function pO(e,t){return new e({type:"date",...N(t)})}function mO(e,t){return new e({type:"date",coerce:!0,...N(t)})}function gO(e,t){return new e({type:"nan",...N(t)})}function yi(e,t){return new Ty({check:"less_than",...N(t),value:e,inclusive:!1})}function On(e,t){return new Ty({check:"less_than",...N(t),value:e,inclusive:!0})}function vi(e,t){return new Oy({check:"greater_than",...N(t),value:e,inclusive:!1})}function cn(e,t){return new Oy({check:"greater_than",...N(t),value:e,inclusive:!0})}function ov(e){return vi(0,e)}function cv(e){return yi(0,e)}function lv(e){return On(0,e)}function uv(e){return cn(0,e)}function fs(e,t){return new sE({check:"multiple_of",...N(t),value:e})}function Us(e,t){return new lE({check:"max_size",...N(t),maximum:e})}function bi(e,t){return new uE({check:"min_size",...N(t),minimum:e})}function Cc(e,t){return new dE({check:"size_equals",...N(t),size:e})}function Nc(e,t){return new fE({check:"max_length",...N(t),maximum:e})}function ca(e,t){return new hE({check:"min_length",...N(t),minimum:e})}function Pc(e,t){return new pE({check:"length_equals",...N(t),length:e})}function Ef(e,t){return new mE({check:"string_format",format:"regex",...N(t),pattern:e})}function Tf(e){return new gE({check:"string_format",format:"lowercase",...N(e)})}function Of(e){return new _E({check:"string_format",format:"uppercase",...N(e)})}function Af(e,t){return new yE({check:"string_format",format:"includes",...N(t),includes:e})}function Cf(e,t){return new vE({check:"string_format",format:"starts_with",...N(t),prefix:e})}function Nf(e,t){return new bE({check:"string_format",format:"ends_with",...N(t),suffix:e})}function dv(e,t,n){return new wE({check:"property",property:e,schema:t,...N(n)})}function Pf(e,t){return new $E({check:"mime_type",mime:e,...N(t)})}function Wr(e){return new SE({check:"overwrite",tx:e})}function Rf(e){return Wr(t=>t.normalize(e))}function jf(){return Wr(e=>e.trim())}function Mf(){return Wr(e=>e.toLowerCase())}function Df(){return Wr(e=>e.toUpperCase())}function Uf(){return Wr(e=>sI(e))}function _O(e,t,n){return new e({type:"array",element:t,...N(n)})}function mF(e,t,n){return new e({type:"union",options:t,...N(n)})}function gF(e,t,n){return new e({type:"union",options:t,inclusive:!1,...N(n)})}function _F(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...N(r)})}function yF(e,t,n){return new e({type:"intersection",left:t,right:n})}function vF(e,t,n,r){let i=n instanceof ke,a=i?r:n,s=i?n:null;return new e({type:"tuple",items:t,rest:s,...N(a)})}function bF(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...N(r)})}function wF(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...N(r)})}function $F(e,t,n){return new e({type:"set",valueType:t,...N(n)})}function SF(e,t,n){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new e({type:"enum",entries:r,...N(n)})}function kF(e,t,n){return new e({type:"enum",entries:t,...N(n)})}function xF(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...N(n)})}function yO(e,t){return new e({type:"file",...N(t)})}function IF(e,t){return new e({type:"transform",transform:t})}function EF(e,t){return new e({type:"optional",innerType:t})}function TF(e,t){return new e({type:"nullable",innerType:t})}function OF(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():$f(n)}})}function AF(e,t,n){return new e({type:"nonoptional",innerType:t,...N(n)})}function CF(e,t){return new e({type:"success",innerType:t})}function NF(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function PF(e,t,n){return new e({type:"pipe",in:t,out:n})}function RF(e,t){return new e({type:"readonly",innerType:t})}function jF(e,t,n){return new e({type:"template_literal",parts:t,...N(n)})}function MF(e,t){return new e({type:"lazy",getter:t})}function DF(e,t){return new e({type:"promise",innerType:t})}function vO(e,t,n){let r=N(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function bO(e,t,n){return new e({type:"custom",check:"custom",fn:t,...N(n)})}function wO(e){let t=$O(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(us(r,n.value,t._zod.def));else{let i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(us(i))}},e(n.value,n)));return t}function $O(e,t){let n=new ot({check:"custom",...N(t)});return n._zod.check=e,n}function SO(e){let t=new ot({check:"describe"});return t._zod.onattach=[n=>{let r=nt.get(n)??{};nt.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function kO(e){let t=new ot({check:"meta"});return t._zod.onattach=[n=>{let r=nt.get(n)??{};nt.add(n,{...r,...e})}],t._zod.check=()=>{},t}function xO(e,t){let n=N(t),r=n.truthy??["true","1","yes","on","y","enabled"],i=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(h=>typeof h=="string"?h.toLowerCase():h),i=i.map(h=>typeof h=="string"?h.toLowerCase():h));let a=new Set(r),s=new Set(i),o=e.Codec??Dy,c=e.Boolean??Ny,l=e.String??Oc,u=new l({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),f=new o({type:"pipe",in:u,out:d,transform:((h,p)=>{let m=h;return n.case!=="sensitive"&&(m=m.toLowerCase()),a.has(m)?!0:s.has(m)?!1:(p.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...s],input:p.value,inst:f,continue:!1}),{})}),reverseTransform:((h,p)=>h===!0?r[0]||"true":i[0]||"false"),error:n.error});return f}function Rc(e,t,n,r={}){let i=N(r),a={...N(r),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:o=>n.test(o),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}function hs(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??nt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function We(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);let o=e._zod.toJSONSchema?.();if(o)s.schema=o;else{let u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{let f=s.schema,h=t.processors[i.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);h(e,t,f,u)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),We(d,t,u),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),t.io==="input"&&Ht(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function ps(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let s of e.seen.entries()){let o=e.metadataRegistry.get(s[0])?.id;if(o){let c=r.get(o);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${o}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(o,s[0])}}let i=s=>{let o=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,f=e.external.uri??(p=>p);if(d)return{ref:f(d)};let h=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=h,{defId:h,ref:`${f("__shared")}#/${o}/${h}`}}if(s[1]===n)return{ref:"#"};let l=`#/${o}/`,u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+u}},a=s=>{if(s[1].schema.$ref)return;let o=s[1],{ref:c,defId:l}=i(s);o.def={...o.schema},l&&(o.defId=l);let u=o.schema;for(let d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let o=s[1];if(o.cycle)throw new Error(`Cycle detected: #/${o.cycle?.join("/")}/<root>
562
-
563
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let o=s[1];if(t===s[0]){a(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){a(s);continue}}if(e.metadataRegistry.get(s[0])?.id){a(s);continue}if(o.cycle){a(s);continue}if(o.count>1&&e.reused==="ref"){a(s);continue}}}function ms(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=s=>{let o=e.seen.get(s);if(o.ref===null)return;let c=o.def??o.schema,l={...c},u=o.ref;if(o.ref=null,u){r(u);let f=e.seen.get(u),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,l),s._zod.parent===u)for(let m in c)m==="$ref"||m==="allOf"||m in l||delete c[m];if(h.$ref&&f.def)for(let m in c)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(c[m])===JSON.stringify(f.def[m])&&delete c[m]}let d=s._zod.parent;if(d&&d!==u){r(d);let f=e.seen.get(d);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(let h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}e.override({zodSchema:s,jsonSchema:c,path:o.path??[]})};for(let s of[...e.seen.entries()].reverse())r(s[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(s)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let s of e.seen.entries()){let o=s[1];o.def&&o.defId&&(a[o.defId]=o.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Uo(t,"input",e.processors),output:Uo(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Ht(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ht(r.element,n);if(r.type==="set")return Ht(r.valueType,n);if(r.type==="lazy")return Ht(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Ht(r.innerType,n);if(r.type==="intersection")return Ht(r.left,n)||Ht(r.right,n);if(r.type==="record"||r.type==="map")return Ht(r.keyType,n)||Ht(r.valueType,n);if(r.type==="pipe")return Ht(r.in,n)||Ht(r.out,n);if(r.type==="object"){for(let i in r.shape)if(Ht(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(let i of r.options)if(Ht(i,n))return!0;return!1}if(r.type==="tuple"){for(let i of r.items)if(Ht(i,n))return!0;return!!(r.rest&&Ht(r.rest,n))}return!1}var IO=(e,t={})=>n=>{let r=hs({...n,processors:t});return We(e,r),ps(r,e),ms(r,e)},Uo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},s=hs({...i??{},target:a,io:t,processors:n});return We(e,s),ps(s,e),ms(s,e)},UF={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},EO=(e,t,n,r)=>{let i=n;i.type="string";let{minimum:a,maximum:s,format:o,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof s=="number"&&(i.maxLength=s),o&&(i.format=UF[o]??o,i.format===""&&delete i.format,o==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},TO=(e,t,n,r)=>{let i=n,{minimum:a,maximum:s,format:o,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof o=="string"&&o.includes("int")?i.type="integer":i.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a=="number"&&(i.minimum=a,typeof u=="number"&&t.target!=="draft-04"&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof s=="number"&&(i.maximum=s,typeof l=="number"&&t.target!=="draft-04"&&(l<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},OO=(e,t,n,r)=>{n.type="boolean"},AO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},CO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},NO=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},PO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},RO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},jO=(e,t,n,r)=>{n.not={}},MO=(e,t,n,r)=>{},DO=(e,t,n,r)=>{},UO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},LO=(e,t,n,r)=>{let i=e._zod.def,a=ly(i.entries);a.every(s=>typeof s=="number")&&(n.type="number"),a.every(s=>typeof s=="string")&&(n.type="string"),n.enum=a},zO=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let s of i.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(s))}else a.push(s);if(a.length!==0)if(a.length===1){let s=a[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else a.every(s=>typeof s=="number")&&(n.type="number"),a.every(s=>typeof s=="string")&&(n.type="string"),a.every(s=>typeof s=="boolean")&&(n.type="boolean"),a.every(s=>s===null)&&(n.type="null"),n.enum=a},FO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},BO=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=a.source},ZO=(e,t,n,r)=>{let i=n,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:o,mime:c}=e._zod.bag;s!==void 0&&(a.minLength=s),o!==void 0&&(a.maxLength=o),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,a)},VO=(e,t,n,r)=>{n.type="boolean"},qO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},GO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},HO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},JO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},WO=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},KO=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:s,maximum:o}=e._zod.bag;typeof s=="number"&&(i.minItems=s),typeof o=="number"&&(i.maxItems=o),i.type="array",i.items=We(a.element,t,{...r,path:[...r.path,"items"]})},XO=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type="object",i.properties={};let s=a.shape;for(let l in s)i.properties[l]=We(s[l],t,{...r,path:[...r.path,"properties",l]});let o=new Set(Object.keys(s)),c=new Set([...o].filter(l=>{let u=a.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=We(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},fv=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,s=i.options.map((o,c)=>We(o,t,{...r,path:[...r.path,a?"oneOf":"anyOf",c]}));a?n.oneOf=s:n.anyOf=s},YO=(e,t,n,r)=>{let i=e._zod.def,a=We(i.left,t,{...r,path:[...r.path,"allOf",0]}),s=We(i.right,t,{...r,path:[...r.path,"allOf",1]}),o=l=>"allOf"in l&&Object.keys(l).length===1,c=[...o(a)?a.allOf:[a],...o(s)?s.allOf:[s]];n.allOf=c},QO=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",o=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=a.items.map((f,h)=>We(f,t,{...r,path:[...r.path,s,h]})),l=a.rest?We(a.rest,t,{...r,path:[...r.path,o,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):t.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u=="number"&&(i.minItems=u),typeof d=="number"&&(i.maxItems=d)},e1=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type="object";let s=a.keyType,c=s._zod.bag?.patterns;if(a.mode==="loose"&&c&&c.size>0){let u=We(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=We(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=We(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let l=s._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u)}},t1=(e,t,n,r)=>{let i=e._zod.def,a=We(i.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},n1=(e,t,n,r)=>{let i=e._zod.def;We(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},r1=(e,t,n,r)=>{let i=e._zod.def;We(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},i1=(e,t,n,r)=>{let i=e._zod.def;We(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},a1=(e,t,n,r)=>{let i=e._zod.def;We(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},s1=(e,t,n,r)=>{let i=e._zod.def,a=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;We(a,t,r);let s=t.seen.get(e);s.ref=a},o1=(e,t,n,r)=>{let i=e._zod.def;We(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},c1=(e,t,n,r)=>{let i=e._zod.def;We(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},hv=(e,t,n,r)=>{let i=e._zod.def;We(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},l1=(e,t,n,r)=>{let i=e._zod.innerType;We(i,t,r);let a=t.seen.get(e);a.ref=i},gg={string:EO,number:TO,boolean:OO,bigint:AO,symbol:CO,null:NO,undefined:PO,void:RO,never:jO,any:MO,unknown:DO,date:UO,enum:LO,literal:zO,nan:FO,template_literal:BO,file:ZO,success:VO,custom:qO,function:GO,transform:HO,map:JO,set:WO,array:KO,object:XO,union:fv,intersection:YO,tuple:QO,record:e1,nullable:t1,nonoptional:n1,default:r1,prefault:i1,catch:a1,pipe:s1,readonly:o1,promise:c1,optional:hv,lazy:l1};function Lo(e,t){if("_idmap"in e){let r=e,i=hs({...t,processors:gg}),a={};for(let c of r._idmap.entries()){let[l,u]=c;We(u,i)}let s={},o={registry:r,uri:t?.uri,defs:a};i.external=o;for(let c of r._idmap.entries()){let[l,u]=c;ps(i,u),s[l]=ms(i,u)}if(Object.keys(a).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:a}}return{schemas:s}}let n=hs({...t,processors:gg});return We(e,n),ps(n,e),ms(n,e)}var _g=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=hs({processors:gg,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return We(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),ps(this.ctx,t);let r=ms(this.ctx,t),{"~standard":i,...a}=r;return a}},LF=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),zF=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:rT,$ZodArray:sT,$ZodAsyncError:zr,$ZodBase64:qE,$ZodBase64URL:HE,$ZodBigInt:Py,$ZodBigIntFormat:QE,$ZodBoolean:Ny,$ZodCIDRv4:ZE,$ZodCIDRv6:VE,$ZodCUID:CE,$ZodCUID2:NE,$ZodCatch:ET,$ZodCheck:ot,$ZodCheckBigIntFormat:cE,$ZodCheckEndsWith:bE,$ZodCheckGreaterThan:Oy,$ZodCheckIncludes:yE,$ZodCheckLengthEquals:pE,$ZodCheckLessThan:Ty,$ZodCheckLowerCase:gE,$ZodCheckMaxLength:fE,$ZodCheckMaxSize:lE,$ZodCheckMimeType:$E,$ZodCheckMinLength:hE,$ZodCheckMinSize:uE,$ZodCheckMultipleOf:sE,$ZodCheckNumberFormat:oE,$ZodCheckOverwrite:SE,$ZodCheckProperty:wE,$ZodCheckRegex:mE,$ZodCheckSizeEquals:dE,$ZodCheckStartsWith:vE,$ZodCheckStringFormat:Tc,$ZodCheckUpperCase:_E,$ZodCodec:Dy,$ZodCustom:jT,$ZodCustomStringFormat:XE,$ZodDate:aT,$ZodDefault:ST,$ZodDiscriminatedUnion:fT,$ZodE164:JE,$ZodEmail:EE,$ZodEmoji:OE,$ZodEncodeError:cs,$ZodEnum:_T,$ZodError:hy,$ZodExactOptional:wT,$ZodFile:vT,$ZodFunction:NT,$ZodGUID:xE,$ZodIPv4:zE,$ZodIPv6:FE,$ZodISODate:DE,$ZodISODateTime:ME,$ZodISODuration:LE,$ZodISOTime:UE,$ZodIntersection:hT,$ZodJWT:KE,$ZodKSUID:jE,$ZodLazy:RT,$ZodLiteral:yT,$ZodMAC:BE,$ZodMap:mT,$ZodNaN:TT,$ZodNanoID:AE,$ZodNever:jy,$ZodNonOptional:xT,$ZodNull:nT,$ZodNullable:$T,$ZodNumber:Cy,$ZodNumberFormat:YE,$ZodObject:lT,$ZodObjectJIT:uT,$ZodOptional:Ac,$ZodPipe:OT,$ZodPrefault:kT,$ZodPromise:PT,$ZodReadonly:AT,$ZodRealError:Sn,$ZodRecord:pT,$ZodRegistry:Pu,$ZodSet:gT,$ZodString:Oc,$ZodStringFormat:Xe,$ZodSuccess:IT,$ZodSymbol:eT,$ZodTemplateLiteral:CT,$ZodTransform:bT,$ZodTuple:My,$ZodType:ke,$ZodULID:PE,$ZodURL:TE,$ZodUUID:IE,$ZodUndefined:tT,$ZodUnion:xf,$ZodUnknown:Ry,$ZodVoid:iT,$ZodXID:RE,$ZodXor:dT,$brand:iI,$constructor:k,$input:FT,$output:zT,Doc:Cu,JSONSchema:LF,JSONSchemaGenerator:_g,NEVER:rI,TimePrecision:qT,_any:fO,_array:_O,_base64:tv,_base64url:nv,_bigint:aO,_boolean:rO,_catch:NF,_check:$O,_cidrv4:Qy,_cidrv6:ev,_coercedBigint:sO,_coercedBoolean:iO,_coercedDate:mO,_coercedNumber:XT,_coercedString:ZT,_cuid:Gy,_cuid2:Hy,_custom:vO,_date:pO,_decode:yy,_decodeAsync:by,_default:OF,_discriminatedUnion:_F,_e164:rv,_email:Ly,_emoji:Vy,_encode:_y,_encodeAsync:vy,_endsWith:Nf,_enum:SF,_file:yO,_float32:QT,_float64:eO,_gt:vi,_gte:cn,_guid:Ru,_includes:Af,_int:YT,_int32:tO,_int64:oO,_intersection:yF,_ipv4:Xy,_ipv6:Yy,_isoDate:HT,_isoDateTime:GT,_isoDuration:WT,_isoTime:JT,_jwt:iv,_ksuid:Ky,_lazy:MF,_length:Pc,_literal:xF,_lowercase:Tf,_lt:yi,_lte:On,_mac:VT,_map:wF,_max:On,_maxLength:Nc,_maxSize:Us,_mime:Pf,_min:cn,_minLength:ca,_minSize:bi,_multipleOf:fs,_nan:gO,_nanoid:qy,_nativeEnum:kF,_negative:cv,_never:sv,_nonnegative:uv,_nonoptional:AF,_nonpositive:lv,_normalize:Rf,_null:dO,_nullable:TF,_number:KT,_optional:EF,_overwrite:Wr,_parse:$c,_parseAsync:Sc,_pipe:PF,_positive:ov,_promise:DF,_property:dv,_readonly:RF,_record:bF,_refine:bO,_regex:Ef,_safeDecode:$y,_safeDecodeAsync:ky,_safeEncode:wy,_safeEncodeAsync:Sy,_safeParse:kc,_safeParseAsync:xc,_set:$F,_size:Cc,_slugify:Uf,_startsWith:Cf,_string:BT,_stringFormat:Rc,_stringbool:xO,_success:CF,_superRefine:wO,_symbol:lO,_templateLiteral:jF,_toLowerCase:Mf,_toUpperCase:Df,_transform:IF,_trim:jf,_tuple:vF,_uint32:nO,_uint64:cO,_ulid:Jy,_undefined:uO,_union:mF,_unknown:av,_uppercase:Of,_url:If,_uuid:zy,_uuidv4:Fy,_uuidv6:By,_uuidv7:Zy,_void:hO,_xid:Wy,_xor:gF,clone:mt,config:Bt,createStandardJSONSchemaMethod:Uo,createToJSONSchemaMethod:IO,decode:QL,decodeAsync:tz,describe:SO,encode:YL,encodeAsync:ez,extractDefs:ps,finalize:ms,flattenError:py,formatError:my,globalConfig:Tu,globalRegistry:nt,initializeContext:hs,isValidBase64:Ay,isValidBase64URL:GE,isValidJWT:WE,locales:LT,meta:kO,parse:oa,parseAsync:Do,prettifyError:gy,process:We,regexes:Ey,registry:Uy,safeDecode:rz,safeDecodeAsync:az,safeEncode:nz,safeEncodeAsync:iz,safeParse:SI,safeParseAsync:kI,toDotPath:$I,toJSONSchema:Lo,treeifyError:wI,util:vI,version:kE},Symbol.toStringTag,{value:"Module"}));function it(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_zod"in t))return!1;let n=t._zod;return typeof n=="object"&&n!==null&&"def"in n}function _t(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_def"in t)||"_zod"in t)return!1;let n=t._def;return typeof n=="object"&&n!=null&&"typeName"in n}function FF(e){return it(e)&&console.warn("[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior."),_t(e)}function bn(e){return!e||typeof e!="object"||Array.isArray(e)?!1:!!(it(e)||_t(e))}function u1(e){return typeof e=="object"&&e!==null&&"_def"in e&&typeof e._def=="object"&&e._def!==null&&"typeName"in e._def&&e._def.typeName==="ZodLiteral"}function d1(e){return it(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="literal":!1}function BF(e){return!!(u1(e)||d1(e))}async function f1(e,t){if(it(e))try{return{success:!0,data:await Do(e,t)}}catch(n){return{success:!1,error:n}}if(_t(e))return await e.safeParseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}async function Lf(e,t){if(it(e))return await Do(e,t);if(_t(e))return await e.parseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function ZF(e,t){if(it(e))try{return{success:!0,data:oa(e,t)}}catch(n){return{success:!1,error:n}}if(_t(e))return e.safeParse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function Kl(e,t){if(it(e))return oa(e,t);if(_t(e))return e.parse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function gs(e){if(it(e))return nt.get(e)?.description;if(_t(e)||"description"in e&&typeof e.description=="string")return e.description}function VF(e){if(!bn(e))return!1;if(_t(e)){let t=e._def;if(t.typeName==="ZodObject"){let n=e;return!n.shape||Object.keys(n.shape).length===0}if(t.typeName==="ZodRecord")return!0}if(it(e)){let t=e._zod.def;if(t.type==="object"){let n=e;return!n.shape||Object.keys(n.shape).length===0}if(t.type==="record")return!0}return typeof e=="object"&&e!==null&&!("shape"in e)}function pv(e){return bn(e)?_t(e)?e._def.typeName==="ZodString":it(e)?e._zod.def.type==="string":!1:!1}function zf(e){return typeof e=="object"&&e!==null&&"_def"in e&&typeof e._def=="object"&&e._def!==null&&"typeName"in e._def&&e._def.typeName==="ZodObject"}function mr(e){return it(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="object":!1}function Ff(e){return it(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="array":!1}function h1(e){return it(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="optional":!1}function p1(e){return it(e)?typeof e=="object"&&e!==null&&"_zod"in e&&typeof e._zod=="object"&&e._zod!==null&&"def"in e._zod&&typeof e._zod.def=="object"&&e._zod.def!==null&&"type"in e._zod.def&&e._zod.def.type==="nullable":!1}function En(e){return!!(zf(e)||mr(e))}function zo(e){if(_t(e))return e.shape;if(it(e))return e._zod.def.shape;throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function m1(e,t){if(_t(e))return e.extend(t);if(it(e))return dy(e,t);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function mv(e){if(_t(e))return e.partial();if(it(e))return fy(Ac,e,void 0);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function ju(e,t=!1){if(zf(e))return e.strict();if(mr(e)){let n=e._zod.def.shape;if(t)for(let[a,s]of Object.entries(e._zod.def.shape)){if(mr(s))n[a]=ju(s,t);else if(Ff(s)){let c=s._zod.def.element;mr(c)&&(c=ju(c,t)),n[a]=mt(s,{...s._zod.def,element:c})}else n[a]=s;let o=nt.get(s);o&&nt.add(n[a],o)}let r=mt(e,{...e._zod.def,shape:n,catchall:sv(jy)}),i=nt.get(e);return i&&nt.add(r,i),r}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function yg(e,t=!1){if(zf(e))return e.passthrough();if(mr(e)){let n=e._zod.def.shape;if(t)for(let[a,s]of Object.entries(e._zod.def.shape)){if(mr(s))n[a]=yg(s,t);else if(Ff(s)){let c=s._zod.def.element;mr(c)&&(c=yg(c,t)),n[a]=mt(s,{...s._zod.def,element:c})}else n[a]=s;let o=nt.get(s);o&&nt.add(n[a],o)}let r=mt(e,{...e._zod.def,shape:n,catchall:av(Ry)}),i=nt.get(e);return i&&nt.add(r,i),r}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function g1(e){if(_t(e))try{let t=e.parse(void 0);return()=>t}catch{return}if(it(e))try{let t=oa(e,void 0);return()=>t}catch{return}}function qF(e){return _t(e)&&"typeName"in e._def&&e._def.typeName==="ZodEffects"}function GF(e){return it(e)&&e._zod.def.type==="pipe"}function ji(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(_t(e))return qF(e)?ji(e._def.schema,t,n):e;if(it(e)){let i=e;if(GF(e)&&(i=ji(e._zod.def.in,t,n)),t){if(mr(i)){let s={};for(let[o,c]of Object.entries(i._zod.def.shape))s[o]=ji(c,t,n);i=mt(i,{...i._zod.def,shape:s})}else if(Ff(i)){let s=ji(i._zod.def.element,t,n);i=mt(i,{...i._zod.def,element:s})}else if(h1(i)){let s=ji(i._zod.def.innerType,t,n);i=mt(i,{...i._zod.def,innerType:s})}else if(p1(i)){let s=ji(i._zod.def.innerType,t,n);i=mt(i,{...i._zod.def,innerType:s})}}let a=nt.get(e);return a&&nt.add(i,a),n.set(e,i),i}throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function _1(e,t=!1){return ji(e,t,new WeakMap)}function HF(e,t){if(_t(e)){let n=zo(e),r={};for(let[i,a]of Object.entries(n))t(i,a)?r[i]=a.optional():r[i]=a;return e.extend(r)}if(it(e)){let n=zo(e),r={...e._zod.def.shape};for(let[s,o]of Object.entries(n))t(s,o)&&(r[s]=new Ac({type:"optional",innerType:o}));let i=mt(e,{...e._zod.def,shape:r}),a=nt.get(e);return a&&nt.add(i,a),i}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function y1(e){return e instanceof Error&&(e.constructor.name==="ZodError"||e.constructor.name==="$ZodError")}var JF=Symbol("Let zodToJsonSchema decide on which parser to use"),WF={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},KF=e=>({...WF,...e}),XF=e=>{let t=KF(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},v1=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function fn(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?v1(t,e.currentPath):t.join("/")}}function b1(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function qe(e,t,n,r,i){e[t]=n,b1(e,t,r,i)}var ze;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{let a={};for(let s of i)a[s]=s;return a},e.getValidEnumValues=i=>{let a=e.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(let o of a)s[o]=i[o];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},e.find=(i,a)=>{for(let s of i)if(a(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(ze||(ze={}));var q$;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(q$||(q$={}));var re=ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ti=e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return Number.isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}},Z=ze.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),la=class w1 extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,c=0;for(;c<s.path.length;){let l=s.path[c];c===s.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(n(s))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return i(this),r}static assert(t){if(!(t instanceof w1))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ze.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),r=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];n[a]=n[a]||[],n[a].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};la.create=e=>new la(e);var vg=(e,t)=>{let n;switch(e.code){case Z.invalid_type:e.received===re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ze.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${ze.joinValues(e.keys,", ")}`;break;case Z.invalid_union:n="Invalid input";break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ze.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${ze.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n="Invalid function arguments";break;case Z.invalid_return_type:n="Invalid function return type";break;case Z.invalid_date:n="Invalid date";break;case Z.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ze.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Z.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Z.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Z.custom:n="Invalid input";break;case Z.invalid_intersection_types:n="Intersection results could not be merged";break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n="Number must be finite";break;default:n=t.defaultError,ze.assertNever(e)}return{message:n}},YF=vg;function QF(){return YF}var e5=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="",c=r.filter(l=>!!l).slice().reverse();for(let l of c)o=l(s,{data:t,defaultError:o}).message;return{...i,path:a,message:o}};function J(e,t){let n=QF(),r=e5({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===vg?void 0:vg].filter(i=>!!i)});e.common.issues.push(r)}var $n=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let i of n){if(i.status==="aborted")return $e;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let i of n){let a=await i.key,s=await i.value;r.push({key:a,value:s})}return e.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return $e;a.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[a.value]=s.value)}return{status:t.value,value:r}}},$e=Object.freeze({status:"aborted"}),to=e=>({status:"dirty",value:e}),Pn=e=>({status:"valid",value:e}),G$=e=>e.status==="aborted",H$=e=>e.status==="dirty",_s=e=>e.status==="valid",Mu=e=>typeof Promise<"u"&&e instanceof Promise,ae;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ae||(ae={}));var br=class{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},J$=(e,t)=>{if(_s(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new la(e.common.issues);return this._error=n,this._error}}};function Ce(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,o)=>{let{message:c}=e;return s.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:c??n??o.defaultError}},description:i}}var Ue=class{get description(){return this._def.description}_getType(t){return ti(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ti(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new $n,ctx:{common:t.parent.common,data:t.data,parsedType:ti(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Mu(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ti(t)},i=this._parseSync({data:t,path:r.path,parent:r});return J$(r,i)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ti(t)};if(!this["~standard"].async)try{let r=this._parseSync({data:t,path:[],parent:n});return _s(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>_s(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ti(t)},i=this._parse({data:t,path:r.path,parent:r}),a=await(Mu(i)?i:Promise.resolve(i));return J$(r,a)}refine(t,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{let s=t(i),o=()=>a.addIssue({code:Z.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new $i({schema:this,typeName:A.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ui.create(this,this._def)}nullable(){return vs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ys.create(this)}promise(){return Fu.create(this,this._def)}or(t){return Uu.create([this,t],this._def)}and(t){return Lu.create(this,t,this._def)}transform(t){return new $i({...Ce(this._def),schema:this,typeName:A.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Ig({...Ce(this._def),innerType:this,defaultValue:n,typeName:A.ZodDefault})}brand(){return new Tg({typeName:A.ZodBranded,type:this,...Ce(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Eg({...Ce(this._def),innerType:this,catchValue:n,typeName:A.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Og.create(this,t)}readonly(){return Ag.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},t5=/^c[^\s-]{8,}$/i,n5=/^[0-9a-z]+$/,r5=/^[0-9A-HJKMNP-TV-Z]{26}$/i,i5=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,a5=/^[a-z0-9_-]{21}$/i,s5=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,o5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,c5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,l5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",em,u5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,d5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,f5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,h5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,p5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,m5=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$1="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",g5=new RegExp(`^${$1}$`);function S1(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function _5(e){return new RegExp(`^${S1(e)}$`)}function y5(e){let t=`${$1}T${S1(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function v5(e,t){return!!((t==="v4"||!t)&&u5.test(e)||(t==="v6"||!t)&&f5.test(e))}function b5(e,t){if(!s5.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function w5(e,t){return!!((t==="v4"||!t)&&d5.test(e)||(t==="v6"||!t)&&h5.test(e))}var bg=class no extends Ue{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){let a=this._getOrReturnCtx(t);return J(a,{code:Z.invalid_type,expected:re.string,received:a.parsedType}),$e}let r=new $n,i;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),J(i,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),J(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let s=t.data.length>a.value,o=t.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(t,i),s?J(i,{code:Z.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&J(i,{code:Z.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")c5.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"email",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")em||(em=new RegExp(l5,"u")),em.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"emoji",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")i5.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"uuid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")a5.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"nanoid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")t5.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"cuid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")n5.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"cuid2",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")r5.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"ulid",code:Z.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),J(i,{validation:"url",code:Z.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"regex",code:Z.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),J(i,{code:Z.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),J(i,{code:Z.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),J(i,{code:Z.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?y5(a).test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{code:Z.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?g5.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{code:Z.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?_5(a).test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{code:Z.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?o5.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"duration",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?v5(t.data,a.version)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"ip",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?b5(t.data,a.alg)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"jwt",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?w5(t.data,a.version)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"cidr",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?p5.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"base64",code:Z.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?m5.test(t.data)||(i=this._getOrReturnCtx(t,i),J(i,{validation:"base64url",code:Z.invalid_string,message:a.message}),r.dirty()):ze.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Z.invalid_string,...ae.errToObj(r)})}_addCheck(t){return new no({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ae.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ae.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ae.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ae.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ae.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ae.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ae.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ae.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ae.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ae.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ae.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ae.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ae.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ae.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ae.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ae.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ae.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...ae.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ae.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ae.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ae.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ae.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ae.errToObj(n)})}nonempty(t){return this.min(1,ae.errToObj(t))}trim(){return new no({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new no({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new no({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};bg.create=e=>new bg({checks:[],typeName:A.ZodString,coerce:e?.coerce??!1,...Ce(e)});function $5(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}var W$=class wg extends Ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==re.number){let a=this._getOrReturnCtx(t);return J(a,{code:Z.invalid_type,expected:re.number,received:a.parsedType}),$e}let r,i=new $n;for(let a of this._def.checks)a.kind==="int"?ze.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),J(r,{code:Z.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),J(r,{code:Z.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),J(r,{code:Z.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?$5(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),J(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),J(r,{code:Z.not_finite,message:a.message}),i.dirty()):ze.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ae.toString(n))}setLimit(t,n,r,i){return new wg({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ae.toString(i)}]})}_addCheck(t){return new wg({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ae.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ae.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ae.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ae.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ae.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ze.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};W$.create=e=>new W$({checks:[],typeName:A.ZodNumber,coerce:e?.coerce||!1,...Ce(e)});var K$=class $g extends Ue{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==re.bigint)return this._getInvalidInput(t);let r,i=new $n;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),J(r,{code:Z.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),J(r,{code:Z.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),J(r,{code:Z.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):ze.assertNever(a);return{status:i.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return J(n,{code:Z.invalid_type,expected:re.bigint,received:n.parsedType}),$e}gte(t,n){return this.setLimit("min",t,!0,ae.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ae.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ae.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ae.toString(n))}setLimit(t,n,r,i){return new $g({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ae.toString(i)}]})}_addCheck(t){return new $g({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ae.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ae.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ae.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ae.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};K$.create=e=>new K$({checks:[],typeName:A.ZodBigInt,coerce:e?.coerce??!1,...Ce(e)});var X$=class extends Ue{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){let r=this._getOrReturnCtx(t);return J(r,{code:Z.invalid_type,expected:re.boolean,received:r.parsedType}),$e}return Pn(t.data)}};X$.create=e=>new X$({typeName:A.ZodBoolean,coerce:e?.coerce||!1,...Ce(e)});var Y$=class k1 extends Ue{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){let a=this._getOrReturnCtx(t);return J(a,{code:Z.invalid_type,expected:re.date,received:a.parsedType}),$e}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return J(a,{code:Z.invalid_date}),$e}let r=new $n,i;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),J(i,{code:Z.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),J(i,{code:Z.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):ze.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new k1({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ae.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ae.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};Y$.create=e=>new Y$({checks:[],coerce:e?.coerce||!1,typeName:A.ZodDate,...Ce(e)});var Q$=class extends Ue{_parse(t){if(this._getType(t)!==re.symbol){let r=this._getOrReturnCtx(t);return J(r,{code:Z.invalid_type,expected:re.symbol,received:r.parsedType}),$e}return Pn(t.data)}};Q$.create=e=>new Q$({typeName:A.ZodSymbol,...Ce(e)});var eS=class extends Ue{_parse(t){if(this._getType(t)!==re.undefined){let r=this._getOrReturnCtx(t);return J(r,{code:Z.invalid_type,expected:re.undefined,received:r.parsedType}),$e}return Pn(t.data)}};eS.create=e=>new eS({typeName:A.ZodUndefined,...Ce(e)});var tS=class extends Ue{_parse(t){if(this._getType(t)!==re.null){let r=this._getOrReturnCtx(t);return J(r,{code:Z.invalid_type,expected:re.null,received:r.parsedType}),$e}return Pn(t.data)}};tS.create=e=>new tS({typeName:A.ZodNull,...Ce(e)});var Du=class extends Ue{constructor(){super(...arguments),this._any=!0}_parse(t){return Pn(t.data)}};Du.create=e=>new Du({typeName:A.ZodAny,...Ce(e)});var nS=class extends Ue{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Pn(t.data)}};nS.create=e=>new nS({typeName:A.ZodUnknown,...Ce(e)});var wi=class extends Ue{_parse(t){let n=this._getOrReturnCtx(t);return J(n,{code:Z.invalid_type,expected:re.never,received:n.parsedType}),$e}};wi.create=e=>new wi({typeName:A.ZodNever,...Ce(e)});var rS=class extends Ue{_parse(t){if(this._getType(t)!==re.undefined){let r=this._getOrReturnCtx(t);return J(r,{code:Z.invalid_type,expected:re.void,received:r.parsedType}),$e}return Pn(t.data)}};rS.create=e=>new rS({typeName:A.ZodVoid,...Ce(e)});var ys=class Xl extends Ue{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==re.array)return J(n,{code:Z.invalid_type,expected:re.array,received:n.parsedType}),$e;if(i.exactLength!==null){let s=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(s||o)&&(J(n,{code:s?Z.too_big:Z.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(J(n,{code:Z.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(J(n,{code:Z.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>i.type._parseAsync(new br(n,s,n.path,o)))).then(s=>$n.mergeArray(r,s));let a=[...n.data].map((s,o)=>i.type._parseSync(new br(n,s,n.path,o)));return $n.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new Xl({...this._def,minLength:{value:t,message:ae.toString(n)}})}max(t,n){return new Xl({...this._def,maxLength:{value:t,message:ae.toString(n)}})}length(t,n){return new Xl({...this._def,exactLength:{value:t,message:ae.toString(n)}})}nonempty(t){return this.min(1,t)}};ys.create=(e,t)=>new ys({type:e,minLength:null,maxLength:null,exactLength:null,typeName:A.ZodArray,...Ce(t)});function Ra(e){if(e instanceof qr){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=ui.create(Ra(r))}return new qr({...e._def,shape:()=>t})}else return e instanceof ys?new ys({...e._def,type:Ra(e.element)}):e instanceof ui?ui.create(Ra(e.unwrap())):e instanceof vs?vs.create(Ra(e.unwrap())):e instanceof Fo?Fo.create(e.items.map(t=>Ra(t))):e}var qr=class zn extends Ue{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=ze.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==re.object){let l=this._getOrReturnCtx(t);return J(l,{code:Z.invalid_type,expected:re.object,received:l.parsedType}),$e}let{status:r,ctx:i}=this._processInputParams(t),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof wi&&this._def.unknownKeys==="strip"))for(let l in i.data)s.includes(l)||o.push(l);let c=[];for(let l of s){let u=a[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new br(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof wi){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of o)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")o.length>0&&(J(i,{code:Z.unrecognized_keys,keys:o}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of o){let d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new br(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,f=await u.value;l.push({key:d,value:f,alwaysSet:u.alwaysSet})}return l}).then(l=>$n.mergeObjectSync(r,l)):$n.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return ae.errToObj,new zn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:ae.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new zn({...this._def,unknownKeys:"strip"})}passthrough(){return new zn({...this._def,unknownKeys:"passthrough"})}extend(t){return new zn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new zn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:A.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new zn({...this._def,catchall:t})}pick(t){let n={};for(let r of ze.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new zn({...this._def,shape:()=>n})}omit(t){let n={};for(let r of ze.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new zn({...this._def,shape:()=>n})}deepPartial(){return Ra(this)}partial(t){let n={};for(let r of ze.objectKeys(this.shape)){let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new zn({...this._def,shape:()=>n})}required(t){let n={};for(let r of ze.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof ui;)a=a._def.innerType;n[r]=a}return new zn({...this._def,shape:()=>n})}keyof(){return I1(ze.objectKeys(this.shape))}};qr.create=(e,t)=>new qr({shape:()=>e,unknownKeys:"strip",catchall:wi.create(),typeName:A.ZodObject,...Ce(t)});qr.strictCreate=(e,t)=>new qr({shape:()=>e,unknownKeys:"strict",catchall:wi.create(),typeName:A.ZodObject,...Ce(t)});qr.lazycreate=(e,t)=>new qr({shape:e,unknownKeys:"strip",catchall:wi.create(),typeName:A.ZodObject,...Ce(t)});var Uu=class extends Ue{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function i(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(o=>new la(o.ctx.common.issues));return J(n,{code:Z.invalid_union,unionErrors:s}),$e}if(n.common.async)return Promise.all(r.map(async a=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let a,s=[];for(let c of r){let l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(c=>new la(c));return J(n,{code:Z.invalid_union,unionErrors:o}),$e}}get options(){return this._def.options}};Uu.create=(e,t)=>new Uu({options:e,typeName:A.ZodUnion,...Ce(t)});function Sg(e,t){let n=ti(e),r=ti(t);if(e===t)return{valid:!0,data:e};if(n===re.object&&r===re.object){let i=ze.objectKeys(t),a=ze.objectKeys(e).filter(o=>i.indexOf(o)!==-1),s={...e,...t};for(let o of a){let c=Sg(e[o],t[o]);if(!c.valid)return{valid:!1};s[o]=c.data}return{valid:!0,data:s}}else if(n===re.array&&r===re.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let a=0;a<e.length;a++){let s=e[a],o=t[a],c=Sg(s,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===re.date&&r===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Lu=class extends Ue{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(a,s)=>{if(G$(a)||G$(s))return $e;let o=Sg(a.value,s.value);return o.valid?((H$(a)||H$(s))&&n.dirty(),{status:n.value,value:o.data}):(J(r,{code:Z.invalid_intersection_types}),$e)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Lu.create=(e,t,n)=>new Lu({left:e,right:t,typeName:A.ZodIntersection,...Ce(n)});var Fo=class x1 extends Ue{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.array)return J(r,{code:Z.invalid_type,expected:re.array,received:r.parsedType}),$e;if(r.data.length<this._def.items.length)return J(r,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$e;!this._def.rest&&r.data.length>this._def.items.length&&(J(r,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...r.data].map((s,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new br(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>$n.mergeArray(n,s)):$n.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new x1({...this._def,rest:t})}};Fo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fo({items:e,typeName:A.ZodTuple,rest:null,...Ce(t)})};var iS=class extends Ue{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.map)return J(r,{code:Z.invalid_type,expected:re.map,received:r.parsedType}),$e;let i=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([o,c],l)=>({key:i._parse(new br(r,o,r.path,[l,"key"])),value:a._parse(new br(r,c,r.path,[l,"value"]))}));if(r.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of s){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return $e;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(l.value,u.value)}return{status:n.value,value:o}})}else{let o=new Map;for(let c of s){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return $e;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(l.value,u.value)}return{status:n.value,value:o}}}};iS.create=(e,t,n)=>new iS({valueType:t,keyType:e,typeName:A.ZodMap,...Ce(n)});var aS=class kg extends Ue{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==re.set)return J(r,{code:Z.invalid_type,expected:re.set,received:r.parsedType}),$e;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(J(r,{code:Z.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(J(r,{code:Z.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let a=this._def.valueType;function s(c){let l=new Set;for(let u of c){if(u.status==="aborted")return $e;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}let o=[...r.data.values()].map((c,l)=>a._parse(new br(r,c,r.path,l)));return r.common.async?Promise.all(o).then(c=>s(c)):s(o)}min(t,n){return new kg({...this._def,minSize:{value:t,message:ae.toString(n)}})}max(t,n){return new kg({...this._def,maxSize:{value:t,message:ae.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};aS.create=(e,t)=>new aS({valueType:e,minSize:null,maxSize:null,typeName:A.ZodSet,...Ce(t)});var sS=class extends Ue{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};sS.create=(e,t)=>new sS({getter:e,typeName:A.ZodLazy,...Ce(t)});var oS=class extends Ue{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return J(n,{received:n.data,code:Z.invalid_literal,expected:this._def.value}),$e}return{status:"valid",value:t.data}}get value(){return this._def.value}};oS.create=(e,t)=>new oS({value:e,typeName:A.ZodLiteral,...Ce(t)});function I1(e,t){return new gv({values:e,typeName:A.ZodEnum,...Ce(t)})}var gv=class xg extends Ue{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return J(n,{expected:ze.joinValues(r),received:n.parsedType,code:Z.invalid_type}),$e}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),r=this._def.values;return J(n,{received:n.data,code:Z.invalid_enum_value,options:r}),$e}return Pn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return xg.create(t,{...this._def,...n})}exclude(t,n=this._def){return xg.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};gv.create=I1;var zu=class extends Ue{_parse(t){let n=ze.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==re.string&&r.parsedType!==re.number){let i=ze.objectValues(n);return J(r,{expected:ze.joinValues(i),received:r.parsedType,code:Z.invalid_type}),$e}if(this._cache||(this._cache=new Set(ze.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=ze.objectValues(n);return J(r,{received:r.data,code:Z.invalid_enum_value,options:i}),$e}return Pn(t.data)}get enum(){return this._def.values}};zu.create=(e,t)=>new zu({values:e,typeName:A.ZodNativeEnum,...Ce(t)});var Fu=class extends Ue{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.promise&&n.common.async===!1)return J(n,{code:Z.invalid_type,expected:re.promise,received:n.parsedType}),$e;let r=n.parsedType===re.promise?n.data:Promise.resolve(n.data);return Pn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Fu.create=(e,t)=>new Fu({type:e,typeName:A.ZodPromise,...Ce(t)});var $i=class extends Ue{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===A.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:s=>{J(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let s=i.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return $e;let c=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return c.status==="aborted"?$e:c.status==="dirty"||n.value==="dirty"?to(c.value):c});{if(n.value==="aborted")return $e;let o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?$e:o.status==="dirty"||n.value==="dirty"?to(o.value):o}}if(i.type==="refinement"){let s=o=>{let c=i.refinement(o,a);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?$e:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?$e:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!_s(s))return $e;let o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>_s(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:n.value,value:o})):$e);ze.assertNever(i)}};$i.create=(e,t,n)=>new $i({schema:e,typeName:A.ZodEffects,effect:t,...Ce(n)});$i.createWithPreprocess=(e,t,n)=>new $i({schema:t,effect:{type:"preprocess",transform:e},typeName:A.ZodEffects,...Ce(n)});var ui=class extends Ue{_parse(t){return this._getType(t)===re.undefined?Pn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ui.create=(e,t)=>new ui({innerType:e,typeName:A.ZodOptional,...Ce(t)});var vs=class extends Ue{_parse(t){return this._getType(t)===re.null?Pn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};vs.create=(e,t)=>new vs({innerType:e,typeName:A.ZodNullable,...Ce(t)});var Ig=class extends Ue{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===re.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ig.create=(e,t)=>new Ig({innerType:e,typeName:A.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ce(t)});var Eg=class extends Ue{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Mu(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new la(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new la(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Eg.create=(e,t)=>new Eg({innerType:e,typeName:A.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ce(t)});var cS=class extends Ue{_parse(t){if(this._getType(t)!==re.nan){let r=this._getOrReturnCtx(t);return J(r,{code:Z.invalid_type,expected:re.nan,received:r.parsedType}),$e}return{status:"valid",value:t.data}}};cS.create=e=>new cS({typeName:A.ZodNaN,...Ce(e)});var Tg=class extends Ue{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Og=class e extends Ue{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?$e:a.status==="dirty"?(n.dirty(),to(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?$e:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new e({in:t,out:n,typeName:A.ZodPipeline})}},Ag=class extends Ue{_parse(t){let n=this._def.innerType._parse(t),r=i=>(_s(i)&&(i.value=Object.freeze(i.value)),i);return Mu(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Ag.create=(e,t)=>new Ag({innerType:e,typeName:A.ZodReadonly,...Ce(t)});function S5(e,t={},n){return Du.create()}var A;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(A||(A={}));var Bf=bg.create,lS=Du.create;wi.create;ys.create;var jc=qr.create;Uu.create;Lu.create;Fo.create;gv.create;Fu.create;ui.create;vs.create;function k5(e,t){let n={type:"array"};return e.type?._def&&e.type?._def?.typeName!==A.ZodAny&&(n.items=Ze(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&qe(n,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&qe(n,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(qe(n,"minItems",e.exactLength.value,e.exactLength.message,t),qe(n,"maxItems",e.exactLength.value,e.exactLength.message,t)),n}function x5(e,t){let n={type:"integer",format:"int64"};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case"min":t.target==="jsonSchema7"?r.inclusive?qe(n,"minimum",r.value,r.message,t):qe(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),qe(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?qe(n,"maximum",r.value,r.message,t):qe(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),qe(n,"maximum",r.value,r.message,t));break;case"multipleOf":qe(n,"multipleOf",r.value,r.message,t);break}return n}function I5(){return{type:"boolean"}}function E1(e,t){return Ze(e.type._def,t)}var E5=(e,t)=>Ze(e.innerType._def,t);function T1(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(i=>T1(e,t,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return T5(e,t)}}var T5=(e,t)=>{let n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(let r of e.checks)switch(r.kind){case"min":qe(n,"minimum",r.value,r.message,t);break;case"max":qe(n,"maximum",r.value,r.message,t);break}return n};function O5(e,t){return{...Ze(e.innerType._def,t),default:e.defaultValue()}}function A5(e,t){return t.effectStrategy==="input"?Ze(e.schema._def,t):fn(t)}function C5(e){return{type:"string",enum:Array.from(e.values)}}var N5=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function P5(e,t){let n=[Ze(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Ze(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(a=>!!a),r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return n.forEach(a=>{if(N5(a))i.push(...a.allOf),a.unevaluatedProperties===void 0&&(r=void 0);else{let s=a;if("additionalProperties"in a&&a.additionalProperties===!1){let{additionalProperties:o,...c}=a;s=c}else r=void 0;i.push(s)}}),i.length?{allOf:i,...r}:void 0}function R5(e,t){let n=typeof e.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[e.value]}:{type:n==="bigint"?"integer":n,const:e.value}}var tm,Mn={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(tm===void 0&&(tm=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),tm),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function O1(e,t){let n={type:"string"};if(e.checks)for(let r of e.checks)switch(r.kind){case"min":qe(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,r.message,t);break;case"max":qe(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Dn(n,"email",r.message,t);break;case"format:idn-email":Dn(n,"idn-email",r.message,t);break;case"pattern:zod":Gt(n,Mn.email,r.message,t);break}break;case"url":Dn(n,"uri",r.message,t);break;case"uuid":Dn(n,"uuid",r.message,t);break;case"regex":Gt(n,r.regex,r.message,t);break;case"cuid":Gt(n,Mn.cuid,r.message,t);break;case"cuid2":Gt(n,Mn.cuid2,r.message,t);break;case"startsWith":Gt(n,RegExp(`^${nm(r.value,t)}`),r.message,t);break;case"endsWith":Gt(n,RegExp(`${nm(r.value,t)}$`),r.message,t);break;case"datetime":Dn(n,"date-time",r.message,t);break;case"date":Dn(n,"date",r.message,t);break;case"time":Dn(n,"time",r.message,t);break;case"duration":Dn(n,"duration",r.message,t);break;case"length":qe(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,r.message,t),qe(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case"includes":Gt(n,RegExp(nm(r.value,t)),r.message,t);break;case"ip":r.version!=="v6"&&Dn(n,"ipv4",r.message,t),r.version!=="v4"&&Dn(n,"ipv6",r.message,t);break;case"base64url":Gt(n,Mn.base64url,r.message,t);break;case"jwt":Gt(n,Mn.jwt,r.message,t);break;case"cidr":r.version!=="v6"&&Gt(n,Mn.ipv4Cidr,r.message,t),r.version!=="v4"&&Gt(n,Mn.ipv6Cidr,r.message,t);break;case"emoji":Gt(n,Mn.emoji(),r.message,t);break;case"ulid":Gt(n,Mn.ulid,r.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":Dn(n,"binary",r.message,t);break;case"contentEncoding:base64":qe(n,"contentEncoding","base64",r.message,t);break;case"pattern:zod":Gt(n,Mn.base64,r.message,t);break}break;case"nanoid":Gt(n,Mn.nanoid,r.message,t);break}return n}function nm(e,t){return t.patternStrategy==="escape"?M5(e):e}var j5=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function M5(e){let t="";for(let n=0;n<e.length;n++)j5.has(e[n])||(t+="\\"),t+=e[n];return t}function Dn(e,t,n,r){e.format||e.anyOf?.some(i=>i.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):qe(e,"format",t,n,r)}function Gt(e,t,n,r){e.pattern||e.allOf?.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:uS(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):qe(e,"pattern",uS(t,r),n,r)}function uS(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=n.i?e.source.toLowerCase():e.source,i="",a=!1,s=!1,o=!1;for(let c=0;c<r.length;c++){if(a){i+=r[c],a=!1;continue}if(n.i){if(s){if(r[c].match(/[a-z]/)){o?(i+=r[c],i+=`${r[c-2]}-${r[c]}`.toUpperCase(),o=!1):r[c+1]==="-"&&r[c+2]?.match(/[a-z]/)?(i+=r[c],o=!0):i+=`${r[c]}${r[c].toUpperCase()}`;continue}}else if(r[c].match(/[a-z]/)){i+=`[${r[c]}${r[c].toUpperCase()}]`;continue}}if(n.m){if(r[c]==="^"){i+=`(^|(?<=[\r
564
- ]))`;continue}else if(r[c]==="$"){i+=`($|(?=[\r
565
- ]))`;continue}}if(n.s&&r[c]==="."){i+=s?`${r[c]}\r
566
- `:`[${r[c]}\r
567
- ]`;continue}i+=r[c],r[c]==="\\"?a=!0:s&&r[c]==="]"?s=!1:!s&&r[c]==="["&&(s=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function A1(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===A.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,i)=>({...r,[i]:Ze(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",i]})??fn(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let n={type:"object",additionalProperties:Ze(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return n;if(e.keyType?._def.typeName===A.ZodString&&e.keyType._def.checks?.length){let{type:r,...i}=O1(e.keyType._def,t);return{...n,propertyNames:i}}else{if(e.keyType?._def.typeName===A.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===A.ZodBranded&&e.keyType._def.type._def.typeName===A.ZodString&&e.keyType._def.type._def.checks?.length){let{type:r,...i}=E1(e.keyType._def,t);return{...n,propertyNames:i}}}return n}function D5(e,t){return t.mapStrategy==="record"?A1(e,t):{type:"array",maxItems:125,items:{type:"array",items:[Ze(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||fn(t),Ze(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||fn(t)],minItems:2,maxItems:2}}}function U5(e){let t=e.values,n=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),r=Array.from(new Set(n.map(i=>typeof i)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}function L5(e){return e.target==="openAi"?void 0:{not:fn({...e,currentPath:[...e.currentPath,"not"]})}}function z5(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Bu={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function F5(e,t){if(t.target==="openApi3")return dS(e,t);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in Bu&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((i,a)=>{let s=Bu[a._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=n.reduce((i,a)=>{let s=typeof a._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":return a._def.value===null?[...i,"null"]:i;default:return i}},[]);if(r.length===n.length){let i=r.filter((a,s,o)=>o.indexOf(a)===s);return{type:i.length>1?i:i[0],enum:n.reduce((a,s)=>a.includes(s._def.value)?a:[...a,s._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(a=>!r.includes(a))],[])};return dS(e,t)}var dS=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>Ze(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function B5(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Bu[e.innerType._def.typeName],nullable:!0}:{type:[Bu[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let r=Ze(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}let n=Ze(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Z5(e,t){let n={type:"number"};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case"int":n.type="integer",b1(n,"type",r.message,t);break;case"min":t.target==="jsonSchema7"?r.inclusive?qe(n,"minimum",r.value,r.message,t):qe(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),qe(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?qe(n,"maximum",r.value,r.message,t):qe(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),qe(n,"maximum",r.value,r.message,t));break;case"multipleOf":qe(n,"multipleOf",r.value,r.message,t);break}return n}function V5(e,t){let n=t.target==="openAi",r={type:"object",properties:{}},i=[],a=e.shape();for(let o in a){let c=a[o];if(c===void 0||c._def===void 0)continue;let l=G5(c);l&&n&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=!1);let u=Ze(c._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});u!==void 0&&(r.properties[o]=u,l||i.push(o))}i.length&&(r.required=i);let s=q5(e,t);return s!==void 0&&(r.additionalProperties=s),r}function q5(e,t){if(e.catchall._def.typeName!=="ZodNever")return Ze(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function G5(e){try{return e.isOptional()}catch{return!0}}var H5=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return Ze(e.innerType._def,t);let n=Ze(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:fn(t)},n]}:fn(t)},J5=(e,t)=>{if(t.pipeStrategy==="input")return Ze(e.in._def,t);if(t.pipeStrategy==="output")return Ze(e.out._def,t);let n=Ze(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[n,Ze(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]})].filter(r=>r!==void 0)}};function W5(e,t){return Ze(e.type._def,t)}function K5(e,t){let n={type:"array",uniqueItems:!0,items:Ze(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&qe(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&qe(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}function X5(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Ze(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ze(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Ze(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function Y5(e){return{not:fn(e)}}function Q5(e){return fn(e)}var e3=(e,t)=>Ze(e.innerType._def,t),t3=(e,t,n)=>{switch(t){case A.ZodString:return O1(e,n);case A.ZodNumber:return Z5(e,n);case A.ZodObject:return V5(e,n);case A.ZodBigInt:return x5(e,n);case A.ZodBoolean:return I5();case A.ZodDate:return T1(e,n);case A.ZodUndefined:return Y5(n);case A.ZodNull:return z5(n);case A.ZodArray:return k5(e,n);case A.ZodUnion:case A.ZodDiscriminatedUnion:return F5(e,n);case A.ZodIntersection:return P5(e,n);case A.ZodTuple:return X5(e,n);case A.ZodRecord:return A1(e,n);case A.ZodLiteral:return R5(e,n);case A.ZodEnum:return C5(e);case A.ZodNativeEnum:return U5(e);case A.ZodNullable:return B5(e,n);case A.ZodOptional:return H5(e,n);case A.ZodMap:return D5(e,n);case A.ZodSet:return K5(e,n);case A.ZodLazy:return()=>e.getter()._def;case A.ZodPromise:return W5(e,n);case A.ZodNaN:case A.ZodNever:return L5(n);case A.ZodEffects:return A5(e,n);case A.ZodAny:return fn(n);case A.ZodUnknown:return Q5(n);case A.ZodDefault:return O5(e,n);case A.ZodBranded:return E1(e,n);case A.ZodReadonly:return e3(e,n);case A.ZodCatch:return E5(e,n);case A.ZodPipeline:return J5(e,n);case A.ZodFunction:case A.ZodVoid:case A.ZodSymbol:return;default:return(r=>{})()}};function Ze(e,t,n=!1){let r=t.seen.get(e);if(t.override){let o=t.override?.(e,t,r,n);if(o!==JF)return o}if(r&&!n){let o=n3(r,t);if(o!==void 0)return o}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=t3(e,e.typeName,t),s=typeof a=="function"?Ze(a(),t):a;if(s&&r3(e,t,s),t.postProcess){let o=t.postProcess(s,e,t);return i.jsonSchema=s,o}return i.jsonSchema=s,s}var n3=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:v1(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),fn(t)):t.$refStrategy==="seen"?fn(t):void 0}},r3=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),i3=(e,t)=>{let n=XF(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((o,[c,l])=>({...o,[c]:Ze(l._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0)??fn(n)}),{}):void 0,i=typeof t=="string"?t:t?.name,a=Ze(e._def,n,!1)??fn(n);n.flags.hasReferencedOpenAiAnyType&&(r||(r={}),r[n.openAiAnyTypeName]||(r[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:n.$refStrategy==="relative"?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));let s=i===void 0?r?{...a,[n.definitionPath]:r}:a:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,i].join("/"),[n.definitionPath]:{...r,[i]:a}};return n.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(n.target==="jsonSchema2019-09"||n.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),n.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s};function ea(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let r=e.length;if(r!==t.length)return!1;for(let i=0;i<r;i++)if(!ea(e[i],t[i]))return!1;return!0}if(n==="object"){if(!e||!t)return e===t;let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let s of r)if(!ea(e[s],t[s]))return!1;return!0}return e===t}function Fn(e){return encodeURI(a3(e))}function a3(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var s3={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},o3={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},c3={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},l3=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");function ii(e,t=Object.create(null),n=l3,r=""){if(e&&typeof e=="object"&&!Array.isArray(e)){let a=e.$id||e.id;if(a){let s=new URL(a,n.href);s.hash.length>1?t[s.href]=e:(s.hash="",r===""?n=s:ii(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?"#"+r:"");if(t[i]!==void 0)throw new Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let a=new URL(e.$ref,n.href);a.hash=a.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:a.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let a=new URL(e.$recursiveRef,n.href);a.hash=a.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:a.href})}if(e.$anchor){let a=new URL("#"+e.$anchor,n.href);t[a.href]=e}for(let a in e){if(c3[a])continue;let s=`${r}/${Fn(a)}`,o=e[a];if(Array.isArray(o)){if(s3[a]){let c=o.length;for(let l=0;l<c;l++)ii(o[l],t,n,`${s}/${l}`)}}else if(o3[a])for(let c in o)ii(o[c],t,n,`${s}/${Fn(c)}`);else ii(o,t,n,s)}return t}var u3=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,d3=[0,31,28,31,30,31,30,31,31,30,31,30,31],f3=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,h3=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,p3=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,m3=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,g3=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,_3=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,y3=/^(?:\/(?:[^~/]|~0|~1)*)*$/,v3=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,b3=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,w3=e=>{if(e[0]==='"')return!1;let[t,n,...r]=e.split("@");return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]==="."||t.endsWith(".")||t.includes("..")||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(".").every(i=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(i))},$3=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,S3=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,k3=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function nr(e){return e.test.bind(e)}var fS={date:C1,time:N1.bind(void 0,!1),"date-time":E3,duration:k3,uri:A3,"uri-reference":nr(p3),"uri-template":nr(m3),url:nr(g3),email:w3,hostname:nr(h3),ipv4:nr($3),ipv6:nr(S3),regex:N3,uuid:nr(_3),"json-pointer":nr(y3),"json-pointer-uri-fragment":nr(v3),"relative-json-pointer":nr(b3)};function x3(e){return e%4===0&&(e%100!==0||e%400===0)}function C1(e){let t=e.match(u3);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&x3(n)?29:d3[r])}function N1(e,t){let n=t.match(f3);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],s=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||s)}var I3=/t|\s/i;function E3(e){let t=e.split(I3);return t.length==2&&C1(t[0])&&N1(!0,t[1])}var T3=/\/|:/,O3=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function A3(e){return T3.test(e)&&O3.test(e)}var C3=/[^\\]\\Z/;function N3(e){if(C3.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}function P3(e){let t=0,n=e.length,r=0,i;for(;r<n;)t++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return t}function at(e,t,n="2019-09",r=ii(t),i=!0,a=null,s="#",o="#",c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:s,keyword:"false",keywordLocation:s,error:"False boolean schema."}]};let l=typeof e,u;switch(l){case"boolean":case"number":case"string":u=l;break;case"object":e===null?u="null":Array.isArray(e)?u="array":u="object";break;default:throw new Error(`Instances of "${l}" type are not supported.`)}let{$ref:d,$recursiveRef:f,$recursiveAnchor:h,type:p,const:m,enum:v,required:g,not:y,anyOf:$,allOf:S,oneOf:x,if:C,then:T,else:b,format:D,properties:O,patternProperties:M,additionalProperties:he,unevaluatedProperties:Me,minProperties:V,maxProperties:z,propertyNames:B,dependentRequired:ee,dependentSchemas:se,dependencies:te,prefixItems:le,items:Ee,additionalItems:be,unevaluatedItems:Be,contains:ut,minContains:Le,maxContains:w,minItems:_,maxItems:P,uniqueItems:I,minimum:Ne,maximum:He,exclusiveMinimum:yt,exclusiveMaximum:dt,multipleOf:Dt,minLength:xn,maxLength:ft,pattern:er,__absolute_ref__:$a,__absolute_recursive_ref__:nl}=t,H=[];if(h===!0&&a===null&&(a=t),f==="#"){let ge=a===null?r[nl]:a,ce=`${o}/$recursiveRef`,ve=at(e,a===null?t:a,n,r,i,ge,s,ce,c);ve.valid||H.push({instanceLocation:s,keyword:"$recursiveRef",keywordLocation:ce,error:"A subschema had errors."},...ve.errors)}if(d!==void 0){let ce=r[$a||d];if(ce===void 0){let G=`Unresolved $ref "${d}".`;throw $a&&$a!==d&&(G+=` Absolute URI "${$a}".`),G+=`
568
- Known schemas:
569
- - ${Object.keys(r).join(`
570
- - `)}`,new Error(G)}let ve=`${o}/$ref`,X=at(e,ce,n,r,i,a,s,ve,c);if(X.valid||H.push({instanceLocation:s,keyword:"$ref",keywordLocation:ve,error:"A subschema had errors."},...X.errors),n==="4"||n==="7")return{valid:H.length===0,errors:H}}if(Array.isArray(p)){let ge=p.length,ce=!1;for(let ve=0;ve<ge;ve++)if(u===p[ve]||p[ve]==="integer"&&u==="number"&&e%1===0&&e===e){ce=!0;break}ce||H.push({instanceLocation:s,keyword:"type",keywordLocation:`${o}/type`,error:`Instance type "${u}" is invalid. Expected "${p.join('", "')}".`})}else p==="integer"?(u!=="number"||e%1||e!==e)&&H.push({instanceLocation:s,keyword:"type",keywordLocation:`${o}/type`,error:`Instance type "${u}" is invalid. Expected "${p}".`}):p!==void 0&&u!==p&&H.push({instanceLocation:s,keyword:"type",keywordLocation:`${o}/type`,error:`Instance type "${u}" is invalid. Expected "${p}".`});if(m!==void 0&&(u==="object"||u==="array"?ea(e,m)||H.push({instanceLocation:s,keyword:"const",keywordLocation:`${o}/const`,error:`Instance does not match ${JSON.stringify(m)}.`}):e!==m&&H.push({instanceLocation:s,keyword:"const",keywordLocation:`${o}/const`,error:`Instance does not match ${JSON.stringify(m)}.`})),v!==void 0&&(u==="object"||u==="array"?v.some(ge=>ea(e,ge))||H.push({instanceLocation:s,keyword:"enum",keywordLocation:`${o}/enum`,error:`Instance does not match any of ${JSON.stringify(v)}.`}):v.some(ge=>e===ge)||H.push({instanceLocation:s,keyword:"enum",keywordLocation:`${o}/enum`,error:`Instance does not match any of ${JSON.stringify(v)}.`})),y!==void 0){let ge=`${o}/not`;at(e,y,n,r,i,a,s,ge).valid&&H.push({instanceLocation:s,keyword:"not",keywordLocation:ge,error:'Instance matched "not" schema.'})}let Ni=[];if($!==void 0){let ge=`${o}/anyOf`,ce=H.length,ve=!1;for(let X=0;X<$.length;X++){let G=$[X],ye=Object.create(c),_e=at(e,G,n,r,i,h===!0?a:null,s,`${ge}/${X}`,ye);H.push(..._e.errors),ve=ve||_e.valid,_e.valid&&Ni.push(ye)}ve?H.length=ce:H.splice(ce,0,{instanceLocation:s,keyword:"anyOf",keywordLocation:ge,error:"Instance does not match any subschemas."})}if(S!==void 0){let ge=`${o}/allOf`,ce=H.length,ve=!0;for(let X=0;X<S.length;X++){let G=S[X],ye=Object.create(c),_e=at(e,G,n,r,i,h===!0?a:null,s,`${ge}/${X}`,ye);H.push(..._e.errors),ve=ve&&_e.valid,_e.valid&&Ni.push(ye)}ve?H.length=ce:H.splice(ce,0,{instanceLocation:s,keyword:"allOf",keywordLocation:ge,error:"Instance does not match every subschema."})}if(x!==void 0){let ge=`${o}/oneOf`,ce=H.length,ve=x.filter((X,G)=>{let ye=Object.create(c),_e=at(e,X,n,r,i,h===!0?a:null,s,`${ge}/${G}`,ye);return H.push(..._e.errors),_e.valid&&Ni.push(ye),_e.valid}).length;ve===1?H.length=ce:H.splice(ce,0,{instanceLocation:s,keyword:"oneOf",keywordLocation:ge,error:`Instance does not match exactly one subschema (${ve} matches).`})}if((u==="object"||u==="array")&&Object.assign(c,...Ni),C!==void 0){let ge=`${o}/if`;if(at(e,C,n,r,i,a,s,ge,c).valid){if(T!==void 0){let ve=at(e,T,n,r,i,a,s,`${o}/then`,c);ve.valid||H.push({instanceLocation:s,keyword:"if",keywordLocation:ge,error:'Instance does not match "then" schema.'},...ve.errors)}}else if(b!==void 0){let ve=at(e,b,n,r,i,a,s,`${o}/else`,c);ve.valid||H.push({instanceLocation:s,keyword:"if",keywordLocation:ge,error:'Instance does not match "else" schema.'},...ve.errors)}}if(u==="object"){if(g!==void 0)for(let X of g)X in e||H.push({instanceLocation:s,keyword:"required",keywordLocation:`${o}/required`,error:`Instance does not have required property "${X}".`});let ge=Object.keys(e);if(V!==void 0&&ge.length<V&&H.push({instanceLocation:s,keyword:"minProperties",keywordLocation:`${o}/minProperties`,error:`Instance does not have at least ${V} properties.`}),z!==void 0&&ge.length>z&&H.push({instanceLocation:s,keyword:"maxProperties",keywordLocation:`${o}/maxProperties`,error:`Instance does not have at least ${z} properties.`}),B!==void 0){let X=`${o}/propertyNames`;for(let G in e){let ye=`${s}/${Fn(G)}`,_e=at(G,B,n,r,i,a,ye,X);_e.valid||H.push({instanceLocation:s,keyword:"propertyNames",keywordLocation:X,error:`Property name "${G}" does not match schema.`},..._e.errors)}}if(ee!==void 0){let X=`${o}/dependantRequired`;for(let G in ee)if(G in e){let ye=ee[G];for(let _e of ye)_e in e||H.push({instanceLocation:s,keyword:"dependentRequired",keywordLocation:X,error:`Instance has "${G}" but does not have "${_e}".`})}}if(se!==void 0)for(let X in se){let G=`${o}/dependentSchemas`;if(X in e){let ye=at(e,se[X],n,r,i,a,s,`${G}/${Fn(X)}`,c);ye.valid||H.push({instanceLocation:s,keyword:"dependentSchemas",keywordLocation:G,error:`Instance has "${X}" but does not match dependant schema.`},...ye.errors)}}if(te!==void 0){let X=`${o}/dependencies`;for(let G in te)if(G in e){let ye=te[G];if(Array.isArray(ye))for(let _e of ye)_e in e||H.push({instanceLocation:s,keyword:"dependencies",keywordLocation:X,error:`Instance has "${G}" but does not have "${_e}".`});else{let _e=at(e,ye,n,r,i,a,s,`${X}/${Fn(G)}`);_e.valid||H.push({instanceLocation:s,keyword:"dependencies",keywordLocation:X,error:`Instance has "${G}" but does not match dependant schema.`},..._e.errors)}}}let ce=Object.create(null),ve=!1;if(O!==void 0){let X=`${o}/properties`;for(let G in O){if(!(G in e))continue;let ye=`${s}/${Fn(G)}`,_e=at(e[G],O[G],n,r,i,a,ye,`${X}/${Fn(G)}`);if(_e.valid)c[G]=ce[G]=!0;else if(ve=i,H.push({instanceLocation:s,keyword:"properties",keywordLocation:X,error:`Property "${G}" does not match schema.`},..._e.errors),ve)break}}if(!ve&&M!==void 0){let X=`${o}/patternProperties`;for(let G in M){let ye=new RegExp(G,"u"),_e=M[G];for(let nn in e){if(!ye.test(nn))continue;let rw=`${s}/${Fn(nn)}`,iw=at(e[nn],_e,n,r,i,a,rw,`${X}/${Fn(G)}`);iw.valid?c[nn]=ce[nn]=!0:(ve=i,H.push({instanceLocation:s,keyword:"patternProperties",keywordLocation:X,error:`Property "${nn}" matches pattern "${G}" but does not match associated schema.`},...iw.errors))}}}if(!ve&&he!==void 0){let X=`${o}/additionalProperties`;for(let G in e){if(ce[G])continue;let ye=`${s}/${Fn(G)}`,_e=at(e[G],he,n,r,i,a,ye,X);_e.valid?c[G]=!0:(ve=i,H.push({instanceLocation:s,keyword:"additionalProperties",keywordLocation:X,error:`Property "${G}" does not match additional properties schema.`},..._e.errors))}}else if(!ve&&Me!==void 0){let X=`${o}/unevaluatedProperties`;for(let G in e)if(!c[G]){let ye=`${s}/${Fn(G)}`,_e=at(e[G],Me,n,r,i,a,ye,X);_e.valid?c[G]=!0:H.push({instanceLocation:s,keyword:"unevaluatedProperties",keywordLocation:X,error:`Property "${G}" does not match unevaluated properties schema.`},..._e.errors)}}}else if(u==="array"){P!==void 0&&e.length>P&&H.push({instanceLocation:s,keyword:"maxItems",keywordLocation:`${o}/maxItems`,error:`Array has too many items (${e.length} > ${P}).`}),_!==void 0&&e.length<_&&H.push({instanceLocation:s,keyword:"minItems",keywordLocation:`${o}/minItems`,error:`Array has too few items (${e.length} < ${_}).`});let ge=e.length,ce=0,ve=!1;if(le!==void 0){let X=`${o}/prefixItems`,G=Math.min(le.length,ge);for(;ce<G;ce++){let ye=at(e[ce],le[ce],n,r,i,a,`${s}/${ce}`,`${X}/${ce}`);if(c[ce]=!0,!ye.valid&&(ve=i,H.push({instanceLocation:s,keyword:"prefixItems",keywordLocation:X,error:"Items did not match schema."},...ye.errors),ve))break}}if(Ee!==void 0){let X=`${o}/items`;if(Array.isArray(Ee)){let G=Math.min(Ee.length,ge);for(;ce<G;ce++){let ye=at(e[ce],Ee[ce],n,r,i,a,`${s}/${ce}`,`${X}/${ce}`);if(c[ce]=!0,!ye.valid&&(ve=i,H.push({instanceLocation:s,keyword:"items",keywordLocation:X,error:"Items did not match schema."},...ye.errors),ve))break}}else for(;ce<ge;ce++){let G=at(e[ce],Ee,n,r,i,a,`${s}/${ce}`,X);if(c[ce]=!0,!G.valid&&(ve=i,H.push({instanceLocation:s,keyword:"items",keywordLocation:X,error:"Items did not match schema."},...G.errors),ve))break}if(!ve&&be!==void 0){let G=`${o}/additionalItems`;for(;ce<ge;ce++){let ye=at(e[ce],be,n,r,i,a,`${s}/${ce}`,G);c[ce]=!0,ye.valid||(ve=i,H.push({instanceLocation:s,keyword:"additionalItems",keywordLocation:G,error:"Items did not match additional items schema."},...ye.errors))}}}if(ut!==void 0)if(ge===0&&Le===void 0)H.push({instanceLocation:s,keyword:"contains",keywordLocation:`${o}/contains`,error:"Array is empty. It must contain at least one item matching the schema."});else if(Le!==void 0&&ge<Le)H.push({instanceLocation:s,keyword:"minContains",keywordLocation:`${o}/minContains`,error:`Array has less items (${ge}) than minContains (${Le}).`});else{let X=`${o}/contains`,G=H.length,ye=0;for(let _e=0;_e<ge;_e++){let nn=at(e[_e],ut,n,r,i,a,`${s}/${_e}`,X);nn.valid?(c[_e]=!0,ye++):H.push(...nn.errors)}ye>=(Le||0)&&(H.length=G),Le===void 0&&w===void 0&&ye===0?H.splice(G,0,{instanceLocation:s,keyword:"contains",keywordLocation:X,error:"Array does not contain item matching schema."}):Le!==void 0&&ye<Le?H.push({instanceLocation:s,keyword:"minContains",keywordLocation:`${o}/minContains`,error:`Array must contain at least ${Le} items matching schema. Only ${ye} items were found.`}):w!==void 0&&ye>w&&H.push({instanceLocation:s,keyword:"maxContains",keywordLocation:`${o}/maxContains`,error:`Array may contain at most ${w} items matching schema. ${ye} items were found.`})}if(!ve&&Be!==void 0){let X=`${o}/unevaluatedItems`;for(ce;ce<ge;ce++){if(c[ce])continue;let G=at(e[ce],Be,n,r,i,a,`${s}/${ce}`,X);c[ce]=!0,G.valid||H.push({instanceLocation:s,keyword:"unevaluatedItems",keywordLocation:X,error:"Items did not match unevaluated items schema."},...G.errors)}}if(I)for(let X=0;X<ge;X++){let G=e[X],ye=typeof G=="object"&&G!==null;for(let _e=0;_e<ge;_e++){if(X===_e)continue;let nn=e[_e];(G===nn||ye&&(typeof nn=="object"&&nn!==null)&&ea(G,nn))&&(H.push({instanceLocation:s,keyword:"uniqueItems",keywordLocation:`${o}/uniqueItems`,error:`Duplicate items at indexes ${X} and ${_e}.`}),X=Number.MAX_SAFE_INTEGER,_e=Number.MAX_SAFE_INTEGER)}}}else if(u==="number"){if(n==="4"?(Ne!==void 0&&(yt===!0&&e<=Ne||e<Ne)&&H.push({instanceLocation:s,keyword:"minimum",keywordLocation:`${o}/minimum`,error:`${e} is less than ${yt?"or equal to ":""} ${Ne}.`}),He!==void 0&&(dt===!0&&e>=He||e>He)&&H.push({instanceLocation:s,keyword:"maximum",keywordLocation:`${o}/maximum`,error:`${e} is greater than ${dt?"or equal to ":""} ${He}.`})):(Ne!==void 0&&e<Ne&&H.push({instanceLocation:s,keyword:"minimum",keywordLocation:`${o}/minimum`,error:`${e} is less than ${Ne}.`}),He!==void 0&&e>He&&H.push({instanceLocation:s,keyword:"maximum",keywordLocation:`${o}/maximum`,error:`${e} is greater than ${He}.`}),yt!==void 0&&e<=yt&&H.push({instanceLocation:s,keyword:"exclusiveMinimum",keywordLocation:`${o}/exclusiveMinimum`,error:`${e} is less than ${yt}.`}),dt!==void 0&&e>=dt&&H.push({instanceLocation:s,keyword:"exclusiveMaximum",keywordLocation:`${o}/exclusiveMaximum`,error:`${e} is greater than or equal to ${dt}.`})),Dt!==void 0){let ge=e%Dt;Math.abs(0-ge)>=11920929e-14&&Math.abs(Dt-ge)>=11920929e-14&&H.push({instanceLocation:s,keyword:"multipleOf",keywordLocation:`${o}/multipleOf`,error:`${e} is not a multiple of ${Dt}.`})}}else if(u==="string"){let ge=xn===void 0&&ft===void 0?0:P3(e);xn!==void 0&&ge<xn&&H.push({instanceLocation:s,keyword:"minLength",keywordLocation:`${o}/minLength`,error:`String is too short (${ge} < ${xn}).`}),ft!==void 0&&ge>ft&&H.push({instanceLocation:s,keyword:"maxLength",keywordLocation:`${o}/maxLength`,error:`String is too long (${ge} > ${ft}).`}),er!==void 0&&!new RegExp(er,"u").test(e)&&H.push({instanceLocation:s,keyword:"pattern",keywordLocation:`${o}/pattern`,error:"String does not match pattern."}),D!==void 0&&fS[D]&&!fS[D](e)&&H.push({instanceLocation:s,keyword:"format",keywordLocation:`${o}/format`,error:`String does not match format "${D}".`})}return{valid:H.length===0,errors:H}}var Cg=class{schema;draft;shortCircuit;lookup;constructor(t,n="2019-09",r=!0){this.schema=t,this.draft=n,this.shortCircuit=r,this.lookup=ii(t)}validate(t){return at(t,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(t,n){n&&(t={...t,$id:n}),ii(t,this.lookup)}},R3=Q({Validator:()=>Cg,deepCompareStrict:()=>ea,toJsonSchema:()=>Et,validatesOnlyStrings:()=>$o}),hS=new WeakMap;function Et(e,t){let n=!t&&e!=null&&typeof e=="object";if(n){let i=hS.get(e);if(i)return i}let r;if(cy(e)&&!it(e))r=e["~standard"].jsonSchema.input({target:"draft-07"});else if(it(e)){let i=_1(e,!0);mr(i)?r=Lo(ju(i,!0),t):r=Lo(e,t)}else _t(e)?r=i3(e):r=e;return n&&r!=null&&typeof r=="object"&&hS.set(e,r),r}function $o(e){if(!e||typeof e!="object"||Object.keys(e).length===0||Array.isArray(e))return!1;if("type"in e)return typeof e.type=="string"?e.type==="string":Array.isArray(e.type)?e.type.every(t=>t==="string"):!1;if("enum"in e)return Array.isArray(e.enum)&&e.enum.length>0&&e.enum.every(t=>typeof t=="string");if("const"in e)return typeof e.const=="string";if("allOf"in e&&Array.isArray(e.allOf))return e.allOf.some(t=>$o(t));if("anyOf"in e&&Array.isArray(e.anyOf)||"oneOf"in e&&Array.isArray(e.oneOf)){let t="anyOf"in e?e.anyOf:e.oneOf;return t.length>0&&t.every(n=>$o(n))}if("not"in e)return!1;if("$ref"in e&&typeof e.$ref=="string"){let t=e.$ref,n=ii(e);return n[t]?$o(n[t]):!1}return!1}function _v(e){return e?e.lc_runnable:!1}var j3=class{includeNames;includeTypes;includeTags;excludeNames;excludeTypes;excludeTags;constructor(e){this.includeNames=e.includeNames,this.includeTypes=e.includeTypes,this.includeTags=e.includeTags,this.excludeNames=e.excludeNames,this.excludeTypes=e.excludeTypes,this.excludeTags=e.excludeTags}includeEvent(e,t){let n=this.includeNames===void 0&&this.includeTypes===void 0&&this.includeTags===void 0,r=e.tags??[];return this.includeNames!==void 0&&(n=n||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(n=n||this.includeTypes.includes(t)),this.includeTags!==void 0&&(n=n||r.some(i=>this.includeTags?.includes(i))),this.excludeNames!==void 0&&(n=n&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(n=n&&!this.excludeTypes.includes(t)),this.excludeTags!==void 0&&(n=n&&r.every(i=>!this.excludeTags?.includes(i))),n}},M3=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function rm(e){return e.replace(/[^a-zA-Z-_0-9]/g,"_")}var D3=["*","_","`"];function U3(e){let t="";for(let[n,r]of Object.entries(e))t+=` classDef ${n} ${r};
571
- `;return t}function L3(e,t,n){let{firstNode:r,lastNode:i,nodeColors:a,withStyles:s=!0,curveStyle:o="linear",wrapLabelNWords:c=9}=n??{},l=s?`%%{init: {'flowchart': {'curve': '${o}'}}}%%
572
- graph TD;
573
- `:`graph TD;
574
- `;if(s){let p="default",m={[p]:"{0}({1})"};r!==void 0&&(m[r]="{0}([{1}]):::first"),i!==void 0&&(m[i]="{0}([{1}]):::last");for(let[v,g]of Object.entries(e)){let y=g.name.split(":").pop()??"",$=D3.some(x=>y.startsWith(x)&&y.endsWith(x))?`<p>${y}</p>`:y;Object.keys(g.metadata??{}).length&&($+=`<hr/><small><em>${Object.entries(g.metadata??{}).map(([x,C])=>`${x} = ${C}`).join(`
575
- `)}</em></small>`);let S=(m[v]??m[p]).replace("{0}",rm(v)).replace("{1}",$);l+=` ${S}
576
- `}}let u={};for(let p of t){let m=p.source.split(":"),v=p.target.split(":"),g=m.filter((y,$)=>y===v[$]).join(":");u[g]||(u[g]=[]),u[g].push(p)}let d=new Set;function f(p){return[...p].sort((m,v)=>m.split(":").length-v.split(":").length)}function h(p,m){let v=p.length===1&&p[0].source===p[0].target;if(m&&!v){let y=m.split(":").pop();if(d.has(m))throw new Error(`Found duplicate subgraph '${y}' at '${m} -- this likely means that you're reusing a subgraph node with the same name. Please adjust your graph to have subgraph nodes with unique names.`);d.add(m),l+=` subgraph ${y}
577
- `}let g=f(Object.keys(u).filter(y=>y.startsWith(`${m}:`)&&y!==m&&y.split(":").length===m.split(":").length+1));for(let y of g)h(u[y],y);for(let y of p){let{source:$,target:S,data:x,conditional:C}=y,T="";if(x!==void 0){let b=x,D=b.split(" ");D.length>c&&(b=Array.from({length:Math.ceil(D.length/c)},(O,M)=>D.slice(M*c,(M+1)*c).join(" ")).join("&nbsp;<br>&nbsp;")),T=C?` -. &nbsp;${b}&nbsp; .-> `:` -- &nbsp;${b}&nbsp; --> `}else T=C?" -.-> ":" --> ";l+=` ${rm($)}${T}${rm(S)};
578
- `}m&&!v&&(l+=` end
579
- `)}h(u[""]??[],"");for(let p in u)!p.includes(":")&&p!==""&&h(u[p],p);return s&&(l+=U3(a??{})),l}async function z3(e,t){let n=t?.backgroundColor??"white",r=t?.imageType??"png",i=M3(e);n!==void 0&&(/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(n)||(n=`!${n}`));let a=`https://mermaid.ink/img/${i}?bgColor=${n}&type=${r}`,s=await fetch(a);if(!s.ok)throw new Error(["Failed to render the graph using the Mermaid.INK API.",`Status code: ${s.status}`,`Status text: ${s.statusText}`].join(`
580
- `));return await s.blob()}var F3=Q({Graph:()=>Bo});function B3(e,t){if(e!==void 0&&!bo(e))return e;if(_v(t))try{let n=t.getName();return n=n.startsWith("Runnable")?n.slice(8):n,n}catch{return t.getName()}else return t.name??"UnknownSchema"}function Z3(e){return _v(e.data)?{type:"runnable",data:{id:e.data.lc_id,name:e.data.getName()}}:{type:"schema",data:{...Et(e.data.schema),title:e.data.name}}}var Bo=class P1{nodes={};edges=[];constructor(t){this.nodes=t?.nodes??this.nodes,this.edges=t?.edges??this.edges}toJSON(){let t={};return Object.values(this.nodes).forEach((n,r)=>{t[n.id]=bo(n.id)?r:n.id}),{nodes:Object.values(this.nodes).map(n=>({id:t[n.id],...Z3(n)})),edges:this.edges.map(n=>{let r={source:t[n.source],target:t[n.target]};return typeof n.data<"u"&&(r.data=n.data),typeof n.conditional<"u"&&(r.conditional=n.conditional),r})}}addNode(t,n,r){if(n!==void 0&&this.nodes[n]!==void 0)throw new Error(`Node with id ${n} already exists`);let i=n??Yj(),a={id:i,data:t,name:B3(n,t),metadata:r};return this.nodes[i]=a,a}removeNode(t){delete this.nodes[t.id],this.edges=this.edges.filter(n=>n.source!==t.id&&n.target!==t.id)}addEdge(t,n,r,i){if(this.nodes[t.id]===void 0)throw new Error(`Source node ${t.id} not in graph`);if(this.nodes[n.id]===void 0)throw new Error(`Target node ${n.id} not in graph`);let a={source:t.id,target:n.id,data:r,conditional:i};return this.edges.push(a),a}firstNode(){return pS(this)}lastNode(){return mS(this)}extend(t,n=""){let r=n;Object.values(t.nodes).map(c=>c.id).every(bo)&&(r="");let i=c=>r?`${r}:${c}`:c;Object.entries(t.nodes).forEach(([c,l])=>{this.nodes[i(c)]={...l,id:i(c)}});let a=t.edges.map(c=>({...c,source:i(c.source),target:i(c.target)}));this.edges=[...this.edges,...a];let s=t.firstNode(),o=t.lastNode();return[s?{id:i(s.id),data:s.data}:void 0,o?{id:i(o.id),data:o.data}:void 0]}trimFirstNode(){let t=this.firstNode();t&&pS(this,[t.id])&&this.removeNode(t)}trimLastNode(){let t=this.lastNode();t&&mS(this,[t.id])&&this.removeNode(t)}reid(){let t=Object.fromEntries(Object.values(this.nodes).map(i=>[i.id,i.name])),n=new Map;Object.values(t).forEach(i=>{n.set(i,(n.get(i)||0)+1)});let r=i=>{let a=t[i];return bo(i)&&n.get(a)===1?a:i};return new P1({nodes:Object.fromEntries(Object.entries(this.nodes).map(([i,a])=>[r(i),{...a,id:r(i)}])),edges:this.edges.map(i=>({...i,source:r(i.source),target:r(i.target)}))})}drawMermaid(t){let{withStyles:n,curveStyle:r,nodeColors:i={default:"fill:#f2f0ff,line-height:1.2",first:"fill-opacity:0",last:"fill:#bfb6fc"},wrapLabelNWords:a}=t??{},s=this.reid(),o=s.firstNode(),c=s.lastNode();return L3(s.nodes,s.edges,{firstNode:o?.id,lastNode:c?.id,withStyles:n,curveStyle:r,nodeColors:i,wrapLabelNWords:a})}async drawMermaidPng(t){return z3(this.drawMermaid(t),{backgroundColor:t?.backgroundColor})}};function pS(e,t=[]){let n=new Set(e.edges.filter(i=>!t.includes(i.source)).map(i=>i.target)),r=[];for(let i of Object.values(e.nodes))!t.includes(i.id)&&!n.has(i.id)&&r.push(i);return r.length===1?r[0]:void 0}function mS(e,t=[]){let n=new Set(e.edges.filter(i=>!t.includes(i.target)).map(i=>i.source)),r=[];for(let i of Object.values(e.nodes))!t.includes(i.id)&&!n.has(i.id)&&r.push(i);return r.length===1?r[0]:void 0}function Sl({name:e,serialized:t}){return e!==void 0?e:t?.name!==void 0?t.name:t?.id!==void 0&&Array.isArray(t?.id)?t.id[t.id.length-1]:"Unnamed"}var V3=e=>e.name==="event_stream_tracer",q3=class extends Jr{autoClose=!0;includeNames;includeTypes;includeTags;excludeNames;excludeTypes;excludeTags;runInfoMap=new Map;tappedPromises=new Map;transformStream;writer;receiveStream;readableStreamClosed=!1;name="event_stream_tracer";lc_prefer_streaming=!0;constructor(e){super({_awaitHandler:!0,...e}),this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this.transformStream=new TransformStream({flush:()=>{this.readableStreamClosed=!0}}),this.writer=this.transformStream.writable.getWriter(),this.receiveStream=dn.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){let t=e.tags??[],n=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(n=n||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(n=n||this.includeTypes.includes(e.runType)),this.includeTags!==void 0&&(n=n||t.find(r=>this.includeTags?.includes(r))!==void 0),this.excludeNames!==void 0&&(n=n&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(n=n&&!this.excludeTypes.includes(e.runType)),this.excludeTags!==void 0&&(n=n&&t.every(r=>!this.excludeTags?.includes(r))),n}async*tapOutputIterable(e,t){let n=await t.next();if(n.done)return;let r=this.runInfoMap.get(e);if(r===void 0){yield n.value;return}function i(s,o){return s==="llm"&&typeof o=="string"?new os({text:o}):o}let a=this.tappedPromises.get(e);if(a===void 0){let s;a=new Promise(o=>{s=o}),this.tappedPromises.set(e,a);try{let o={event:`on_${r.runType}_stream`,run_id:e,name:r.name,tags:r.tags,metadata:r.metadata,data:{}};await this.send({...o,data:{chunk:i(r.runType,n.value)}},r),yield n.value;for await(let c of t)r.runType!=="tool"&&r.runType!=="retriever"&&await this.send({...o,data:{chunk:i(r.runType,c)}},r),yield c}finally{s?.()}}else{yield n.value;for await(let s of t)yield s}}async send(e,t){this.readableStreamClosed||this._includeRun(t)&&await this.writer.write(e)}async sendEndEvent(e,t){let n=this.tappedPromises.get(e.run_id);n!==void 0?n.then(()=>{this.send(e,t)}):await this.send(e,t)}async onLLMStart(e){let t=Sl(e),n=e.inputs.messages!==void 0?"chat_model":"llm",r={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:n,inputs:e.inputs};this.runInfoMap.set(e.id,r);let i=`on_${n}_start`;await this.send({event:i,data:{input:e.inputs},name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},r)}async onLLMNewToken(e,t,n){let r=this.runInfoMap.get(e.id),i,a;if(r===void 0)throw new Error(`onLLMNewToken: Run ID ${e.id} not found in run map.`);if(this.runInfoMap.size!==1){if(r.runType==="chat_model")a="on_chat_model_stream",n?.chunk===void 0?i=new un({content:t,id:`run-${e.id}`}):i=n.chunk.message;else if(r.runType==="llm")a="on_llm_stream",n?.chunk===void 0?i=new os({text:t}):i=n.chunk;else throw new Error(`Unexpected run type ${r.runType}`);await this.send({event:a,data:{chunk:i},run_id:e.id,name:r.name,tags:r.tags,metadata:r.metadata},r)}}async onLLMEnd(e){let t=this.runInfoMap.get(e.id);this.runInfoMap.delete(e.id);let n;if(t===void 0)throw new Error(`onLLMEnd: Run ID ${e.id} not found in run map.`);let r=e.outputs?.generations,i;if(t.runType==="chat_model"){for(let a of r??[]){if(i!==void 0)break;i=a[0]?.message}n="on_chat_model_end"}else if(t.runType==="llm")i={generations:r?.map(a=>a.map(s=>({text:s.text,generationInfo:s.generationInfo}))),llmOutput:e.outputs?.llmOutput??{}},n="on_llm_end";else throw new Error(`onLLMEnd: Unexpected run type: ${t.runType}`);await this.sendEndEvent({event:n,data:{output:i,input:t.inputs},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async onChainStart(e){let t=Sl(e),n=e.run_type??"chain",r={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:e.run_type},i={};e.inputs.input===""&&Object.keys(e.inputs).length===1?(i={},r.inputs={}):e.inputs.input!==void 0?(i.input=e.inputs.input,r.inputs=e.inputs.input):(i.input=e.inputs,r.inputs=e.inputs),this.runInfoMap.set(e.id,r),await this.send({event:`on_${n}_start`,data:i,name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},r)}async onChainEnd(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onChainEnd: Run ID ${e.id} not found in run map.`);let n=`on_${e.run_type}_end`,r=e.inputs??t.inputs??{},i={output:e.outputs?.output??e.outputs,input:r};r.input&&Object.keys(r).length===1&&(i.input=r.input,t.inputs=r.input),await this.sendEndEvent({event:n,data:i,run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata??{}},t)}async onToolStart(e){let t=Sl(e),n={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:"tool",inputs:e.inputs??{}};this.runInfoMap.set(e.id,n),await this.send({event:"on_tool_start",data:{input:e.inputs??{}},name:t,run_id:e.id,tags:e.tags??[],metadata:e.extra?.metadata??{}},n)}async onToolEnd(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onToolEnd: Run ID ${e.id} not found in run map.`);if(t.inputs===void 0)throw new Error(`onToolEnd: Run ID ${e.id} is a tool call, and is expected to have traced inputs.`);let n=e.outputs?.output===void 0?e.outputs:e.outputs.output;await this.sendEndEvent({event:"on_tool_end",data:{output:n,input:t.inputs},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async onToolError(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onToolEnd: Run ID ${e.id} not found in run map.`);if(t.inputs===void 0)throw new Error(`onToolEnd: Run ID ${e.id} is a tool call, and is expected to have traced inputs.`);await this.sendEndEvent({event:"on_tool_error",data:{input:t.inputs,error:e.error},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async onRetrieverStart(e){let t=Sl(e),n={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:"retriever",inputs:{query:e.inputs.query}};this.runInfoMap.set(e.id,n),await this.send({event:"on_retriever_start",data:{input:{query:e.inputs.query}},name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},n)}async onRetrieverEnd(e){let t=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),t===void 0)throw new Error(`onRetrieverEnd: Run ID ${e.id} not found in run map.`);await this.sendEndEvent({event:"on_retriever_end",data:{output:e.outputs?.documents??e.outputs,input:t.inputs},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async handleCustomEvent(e,t,n){let r=this.runInfoMap.get(n);if(r===void 0)throw new Error(`handleCustomEvent: Run ID ${n} not found in run map.`);await this.send({event:"on_custom_event",run_id:n,name:e,tags:r.tags,metadata:r.metadata,data:t},r)}async finish(){let e=[...this.tappedPromises.values()];Promise.all(e).finally(()=>{this.writer.close()})}},R1=class extends Jr{name="RootListenersTracer";rootId;config;argOnStart;argOnEnd;argOnError;constructor({config:e,onStart:t,onEnd:n,onError:r}){super({_awaitHandler:!0}),this.config=e,this.argOnStart=t,this.argOnEnd=n,this.argOnError=r}persistRun(e){return Promise.resolve()}async onRunCreate(e){this.rootId||(this.rootId=e.id,this.argOnStart&&await this.argOnStart(e,this.config))}async onRunUpdate(e){e.id===this.rootId&&(e.error?this.argOnError&&await this.argOnError(e,this.config):this.argOnEnd&&await this.argOnEnd(e,this.config))}};function G3(e){let t=new TextEncoder,n=new ReadableStream({async start(r){for await(let i of e)r.enqueue(t.encode(`event: data
581
- data: ${JSON.stringify(i)}
582
-
583
- `));r.enqueue(t.encode(`event: end
584
-
585
- `)),r.close()}});return dn.fromReadableStream(n)}function gS(e){return typeof e=="object"&&e!==null&&typeof e[Symbol.iterator]=="function"&&typeof e.next=="function"}var H3=e=>e!=null&&typeof e=="object"&&"next"in e&&typeof e.next=="function";function Ng(e){return typeof e=="object"&&e!==null&&typeof e[Symbol.asyncIterator]=="function"}function j1(e){return e!=null&&typeof e=="object"&&typeof e.next=="function"}async function J3(e,t){try{let n=await e.next();for(;!n.done;)await t?.(n.value),n=await e.next();return n.value}finally{await e.return?.(void 0)}}function*_S(e,t){for(;;){let{value:n,done:r}=Mt.runWithConfig(Br(e),t.next.bind(t),!0);if(r)break;yield n}}async function*Pg(e,t){let n=t[Symbol.asyncIterator]();for(;;){let{value:r,done:i}=await Mt.runWithConfig(Br(e),n.next.bind(t),!0);if(i)break;yield r}}function $t(e,t){return e&&!Array.isArray(e)&&!(e instanceof Date)&&typeof e=="object"?e:{[t]:e}}var Re=class extends An{lc_runnable=!0;name;getName(e){let t=this.name??this.constructor.lc_name()??this.constructor.name;return e?`${t}${e}`:t}withRetry(e){return new yv({bound:this,kwargs:{},config:{},maxAttemptNumber:e?.stopAfterAttempt,...e})}withConfig(e){return new Si({bound:this,config:e,kwargs:{}})}withFallbacks(e){let t=Array.isArray(e)?e:e.fallbacks;return new F1({runnable:this,fallbacks:t})}_getOptionsList(e,t=0){if(Array.isArray(e)&&e.length!==t)throw new Error(`Passed "options" must be an array with the same length as the inputs, but got ${e.length} options for ${t} inputs`);if(Array.isArray(e))return e.map(De);if(t>1&&!Array.isArray(e)&&e.runId){console.warn("Provided runId will be used only for the first element of the batch.");let n=Object.fromEntries(Object.entries(e).filter(([r])=>r!=="runId"));return Array.from({length:t},(r,i)=>De(i===0?e:n))}return Array.from({length:t},()=>De(e))}async batch(e,t,n){let r=this._getOptionsList(t??{},e.length),i=new bc({maxConcurrency:r[0]?.maxConcurrency??n?.maxConcurrency,onFailedAttempt:s=>{throw s}}),a=e.map((s,o)=>i.call(async()=>{try{return await this.invoke(s,r[o])}catch(c){if(n?.returnExceptions)return c;throw c}}));return Promise.all(a)}async*_streamIterator(e,t){yield this.invoke(e,t)}async stream(e,t){let n=De(t),r=new _a({generator:this._streamIterator(e,n),config:n});return await r.setup,dn.fromAsyncGenerator(r)}_separateRunnableConfigFromCallOptions(e){let t;e===void 0?t=De(e):t=De({callbacks:e.callbacks,tags:e.tags,metadata:e.metadata,runName:e.runName,configurable:e.configurable,recursionLimit:e.recursionLimit,maxConcurrency:e.maxConcurrency,runId:e.runId,timeout:e.timeout,signal:e.signal});let n={...e};return delete n.callbacks,delete n.tags,delete n.metadata,delete n.runName,delete n.configurable,delete n.recursionLimit,delete n.maxConcurrency,delete n.runId,delete n.timeout,delete n.signal,[t,n]}async _callWithConfig(e,t,n){let r=De(n),i=await(await Qt(r))?.handleChainStart(this.toJSON(),$t(t,"input"),r.runId,r?.runType,void 0,void 0,r?.runName??this.getName());delete r.runId;let a;try{a=await vr(e.call(this,t,r,i),r.signal)}catch(s){throw await i?.handleChainError(s),s}return await i?.handleChainEnd($t(a,"output")),a}async _batchWithConfig(e,t,n,r){let i=this._getOptionsList(n??{},t.length),a=await Promise.all(i.map(Qt)),s=await Promise.all(a.map(async(c,l)=>{let u=await c?.handleChainStart(this.toJSON(),$t(t[l],"input"),i[l].runId,i[l].runType,void 0,void 0,i[l].runName??this.getName());return delete i[l].runId,u})),o;try{o=await vr(e.call(this,t,i,s,r),i?.[0]?.signal)}catch(c){throw await Promise.all(s.map(l=>l?.handleChainError(c))),c}return await Promise.all(s.map(c=>c?.handleChainEnd($t(o,"output")))),o}_concatOutputChunks(e,t){return _i(e,t)}async*_transformStreamWithConfig(e,t,n){let r,i=!0,a,s=!0,o=De(n),c=await Qt(o),l=this;async function*u(){for await(let f of e){if(i)if(r===void 0)r=f;else try{r=l._concatOutputChunks(r,f)}catch{r=void 0,i=!1}yield f}}let d;try{let f=await Kx(t.bind(this),u(),async()=>c?.handleChainStart(this.toJSON(),{input:""},o.runId,o.runType,void 0,void 0,o.runName??this.getName(),void 0,{lc_defers_inputs:!0}),o.signal,o);delete o.runId,d=f.setup;let h=d?.handlers.find(V3),p=f.output;h!==void 0&&d!==void 0&&(p=h.tapOutputIterable(d.runId,p));let m=d?.handlers.find(Qx);m!==void 0&&d!==void 0&&(p=m.tapOutputIterable(d.runId,p));for await(let v of p)if(yield v,s)if(a===void 0)a=v;else try{a=this._concatOutputChunks(a,v)}catch{a=void 0,s=!1}}catch(f){throw await d?.handleChainError(f,void 0,void 0,void 0,{inputs:$t(r,"input")}),f}await d?.handleChainEnd(a??{},void 0,void 0,void 0,{inputs:$t(r,"input")})}getGraph(e){let t=new Bo,n=t.addNode({name:`${this.getName()}Input`,schema:lS()}),r=t.addNode(this),i=t.addNode({name:`${this.getName()}Output`,schema:lS()});return t.addEdge(n,r),t.addEdge(r,i),t}pipe(e){return new ki({first:this,last:jt(e)})}pick(e){return this.pipe(new B1(e))}assign(e){return this.pipe(new vv(new Ls({steps:e})))}async*transform(e,t){let n;for await(let r of e)n===void 0?n=r:n=this._concatOutputChunks(n,r);yield*this._streamIterator(n,De(t))}async*streamLog(e,t,n){let r=new dg({...n,autoClose:!1,_schemaFormat:"original"}),i=De(t);yield*this._streamLog(e,r,i)}async*_streamLog(e,t,n){let{callbacks:r}=n;if(r===void 0)n.callbacks=[t];else if(Array.isArray(r))n.callbacks=r.concat([t]);else{let o=r.copy();o.addHandler(t,!0),n.callbacks=o}let i=this.stream(e,n);async function a(){try{let o=await i;for await(let c of o){let l=new Nr({ops:[{op:"add",path:"/streamed_output/-",value:c}]});await t.writer.write(l)}}finally{await t.writer.close()}}let s=a();try{for await(let o of t)yield o}finally{await s}}streamEvents(e,t,n){let r;if(t.version==="v1")r=this._streamEventsV1(e,t,n);else if(t.version==="v2")r=this._streamEventsV2(e,t,n);else throw new Error('Only versions "v1" and "v2" of the schema are currently supported.');return t.encoding==="text/event-stream"?G3(r):dn.fromAsyncGenerator(r)}async*_streamEventsV2(e,t,n){let r=new q3({...n,autoClose:!1}),i=De(t),a=i.runId??ei();i.runId=a;let s=i.callbacks;if(s===void 0)i.callbacks=[r];else if(Array.isArray(s))i.callbacks=s.concat(r);else{let h=s.copy();h.addHandler(r,!0),i.callbacks=h}let o=new AbortController,c=this;async function l(){let h;try{if(i.signal)if("any"in AbortSignal)h=AbortSignal.any([o.signal,i.signal]);else{let v=new AbortController;i.signal.addEventListener("abort",()=>v.abort(),{once:!0}),o.signal.addEventListener("abort",()=>v.abort(),{once:!0}),h=v.signal}else h=o.signal;let p=await c.stream(e,{...i,signal:h}),m=r.tapOutputIterable(a,p);for await(let v of m)if(o.signal.aborted)break}finally{await r.finish()}}let u=l(),d=!1,f;try{for await(let h of r){if(!d){h.data.input=e,d=!0,f=h.run_id,yield h;continue}h.run_id===f&&h.event.endsWith("_end")&&h.data?.input&&delete h.data.input,yield h}}finally{o.abort(),await u}}async*_streamEventsV1(e,t,n){let r,i=!1,a=De(t),s=a.tags??[],o=a.metadata??{},c=a.runName??this.getName(),l=new dg({...n,autoClose:!1,_schemaFormat:"streaming_events"}),u=new j3({...n}),d=this._streamLog(e,l,a);for await(let h of d){if(r?r=r.concat(h):r=oy.fromRunLogPatch(h),r.state===void 0)throw new Error('Internal error: "streamEvents" state is missing. Please open a bug report.');if(!i){i=!0;let g={...r.state},y={run_id:g.id,event:`on_${g.type}_start`,name:c,tags:s,metadata:o,data:{input:e}};u.includeEvent(y,g.type)&&(yield y)}let p=h.ops.filter(g=>g.path.startsWith("/logs/")).map(g=>g.path.split("/")[2]),m=[...new Set(p)];for(let g of m){let y,$={},S=r.state.logs[g];if(S.end_time===void 0?S.streamed_output.length>0?y="stream":y="start":y="end",y==="start")S.inputs!==void 0&&($.input=S.inputs);else if(y==="end")S.inputs!==void 0&&($.input=S.inputs),$.output=S.final_output;else if(y==="stream"){let x=S.streamed_output.length;if(x!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${x} instead. Encountered in: "${S.name}"`);$={chunk:S.streamed_output[0]},S.streamed_output=[]}yield{event:`on_${S.type}_${y}`,name:S.name,run_id:S.id,tags:S.tags,metadata:S.metadata,data:$}}let{state:v}=r;if(v.streamed_output.length>0){let g=v.streamed_output.length;if(g!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${g} instead. Encountered in: "${v.name}"`);let y={chunk:v.streamed_output[0]};v.streamed_output=[];let $={event:`on_${v.type}_stream`,run_id:v.id,tags:s,metadata:o,name:c,data:y};u.includeEvent($,v.type)&&(yield $)}}let f=r?.state;if(f!==void 0){let h={event:`on_${f.type}_end`,name:c,run_id:f.id,tags:s,metadata:o,data:{output:f.final_output}};u.includeEvent(h,f.type)&&(yield h)}}static isRunnable(e){return _v(e)}withListeners({onStart:e,onEnd:t,onError:n}){return new Si({bound:this,config:{},configFactories:[r=>({callbacks:[new R1({config:r,onStart:e,onEnd:t,onError:n})]})]})}asTool(e){return Q3(this,e)}},Si=class M1 extends Re{static lc_name(){return"RunnableBinding"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;bound;config;kwargs;configFactories;constructor(t){super(t),this.bound=t.bound,this.kwargs=t.kwargs,this.config=t.config,this.configFactories=t.configFactories}getName(t){return this.bound.getName(t)}async _mergeConfig(...t){let n=Tn(this.config,...t);return Tn(n,...this.configFactories?await Promise.all(this.configFactories.map(async r=>await r(n))):[])}withConfig(t){return new this.constructor({bound:this.bound,kwargs:this.kwargs,config:{...this.config,...t}})}withRetry(t){return new yv({bound:this.bound,kwargs:this.kwargs,config:this.config,maxAttemptNumber:t?.stopAfterAttempt,...t})}async invoke(t,n){return this.bound.invoke(t,await this._mergeConfig(n,this.kwargs))}async batch(t,n,r){let i=Array.isArray(n)?await Promise.all(n.map(async a=>this._mergeConfig(De(a),this.kwargs))):await this._mergeConfig(De(n),this.kwargs);return this.bound.batch(t,i,r)}_concatOutputChunks(t,n){return this.bound._concatOutputChunks(t,n)}async*_streamIterator(t,n){yield*this.bound._streamIterator(t,await this._mergeConfig(De(n),this.kwargs))}async stream(t,n){return this.bound.stream(t,await this._mergeConfig(De(n),this.kwargs))}async*transform(t,n){yield*this.bound.transform(t,await this._mergeConfig(De(n),this.kwargs))}streamEvents(t,n,r){let i=this,a=async function*(){yield*i.bound.streamEvents(t,{...await i._mergeConfig(De(n),i.kwargs),version:n.version},r)};return dn.fromAsyncGenerator(a())}static isRunnableBinding(t){return t.bound&&Re.isRunnable(t.bound)}withListeners({onStart:t,onEnd:n,onError:r}){return new M1({bound:this.bound,kwargs:this.kwargs,config:this.config,configFactories:[i=>({callbacks:[new R1({config:i,onStart:t,onEnd:n,onError:r})]})]})}},W3=class D1 extends Re{static lc_name(){return"RunnableEach"}lc_serializable=!0;lc_namespace=["langchain_core","runnables"];bound;constructor(t){super(t),this.bound=t.bound}async invoke(t,n){return this._callWithConfig(this._invoke.bind(this),t,n)}async _invoke(t,n,r){return this.bound.batch(t,Ve(n,{callbacks:r?.getChild()}))}withListeners({onStart:t,onEnd:n,onError:r}){return new D1({bound:this.bound.withListeners({onStart:t,onEnd:n,onError:r})})}},yv=class extends Si{static lc_name(){return"RunnableRetry"}lc_namespace=["langchain_core","runnables"];maxAttemptNumber=3;onFailedAttempt=()=>{};constructor(e){super(e),this.maxAttemptNumber=e.maxAttemptNumber??this.maxAttemptNumber,this.onFailedAttempt=e.onFailedAttempt??this.onFailedAttempt}_patchConfigForRetry(e,t,n){let r=e>1?`retry:attempt:${e}`:void 0;return Ve(t,{callbacks:n?.getChild(r)})}async _invoke(e,t,n){return fg(r=>super.invoke(e,this._patchConfigForRetry(r,t,n)),{onFailedAttempt:({error:r})=>this.onFailedAttempt(r,e),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}async invoke(e,t){return this._callWithConfig(this._invoke.bind(this),e,t)}async _batch(e,t,n,r){let i={};try{await fg(async a=>{let s=e.map((d,f)=>f).filter(d=>i[d.toString()]===void 0||i[d.toString()]instanceof Error),o=s.map(d=>e[d]),c=s.map(d=>this._patchConfigForRetry(a,t?.[d],n?.[d])),l=await super.batch(o,c,{...r,returnExceptions:!0}),u;for(let d=0;d<l.length;d+=1){let f=l[d],h=s[d];f instanceof Error&&u===void 0&&(u=f,u.input=o[d]),i[h.toString()]=f}if(u)throw u;return l},{onFailedAttempt:({error:a})=>this.onFailedAttempt(a,a.input),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}catch(a){if(r?.returnExceptions!==!0)throw a}return Object.keys(i).sort((a,s)=>parseInt(a,10)-parseInt(s,10)).map(a=>i[parseInt(a,10)])}async batch(e,t,n){return this._batchWithConfig(this._batch.bind(this),e,t,n)}},ki=class ro extends Re{static lc_name(){return"RunnableSequence"}first;middle=[];last;omitSequenceTags=!1;lc_serializable=!0;lc_namespace=["langchain_core","runnables"];constructor(t){super(t),this.first=t.first,this.middle=t.middle??this.middle,this.last=t.last,this.name=t.name,this.omitSequenceTags=t.omitSequenceTags??this.omitSequenceTags}get steps(){return[this.first,...this.middle,this.last]}async invoke(t,n){let r=De(n),i=await(await Qt(r))?.handleChainStart(this.toJSON(),$t(t,"input"),r.runId,void 0,void 0,void 0,r?.runName);delete r.runId;let a=t,s;try{let o=[this.first,...this.middle];for(let c=0;c<o.length;c+=1)a=await vr(o[c].invoke(a,Ve(r,{callbacks:i?.getChild(this.omitSequenceTags?void 0:`seq:step:${c+1}`)})),r.signal);if(r.signal?.aborted)throw Ro(r.signal);s=await this.last.invoke(a,Ve(r,{callbacks:i?.getChild(this.omitSequenceTags?void 0:`seq:step:${this.steps.length}`)}))}catch(o){throw await i?.handleChainError(o),o}return await i?.handleChainEnd($t(s,"output")),s}async batch(t,n,r){let i=this._getOptionsList(n??{},t.length),a=await Promise.all(i.map(Qt)),s=await Promise.all(a.map(async(c,l)=>{let u=await c?.handleChainStart(this.toJSON(),$t(t[l],"input"),i[l].runId,void 0,void 0,void 0,i[l].runName);return delete i[l].runId,u})),o=t;try{for(let c=0;c<this.steps.length;c+=1)o=await vr(this.steps[c].batch(o,s.map((l,u)=>{let d=l?.getChild(this.omitSequenceTags?void 0:`seq:step:${c+1}`);return Ve(i[u],{callbacks:d})}),r),i[0]?.signal)}catch(c){throw await Promise.all(s.map(l=>l?.handleChainError(c))),c}return await Promise.all(s.map(c=>c?.handleChainEnd($t(o,"output")))),o}_concatOutputChunks(t,n){return this.last._concatOutputChunks(t,n)}async*_streamIterator(t,n){let r=await Qt(n),{runId:i,...a}=n??{},s=await r?.handleChainStart(this.toJSON(),$t(t,"input"),i,void 0,void 0,void 0,a?.runName),o=[this.first,...this.middle,this.last],c=!0,l;async function*u(){yield t}try{let d=o[0].transform(u(),Ve(a,{callbacks:s?.getChild(this.omitSequenceTags?void 0:"seq:step:1")}));for(let f=1;f<o.length;f+=1)d=await o[f].transform(d,Ve(a,{callbacks:s?.getChild(this.omitSequenceTags?void 0:`seq:step:${f+1}`)}));for await(let f of d)if(n?.signal?.throwIfAborted(),yield f,c)if(l===void 0)l=f;else try{l=this._concatOutputChunks(l,f)}catch{l=void 0,c=!1}}catch(d){throw await s?.handleChainError(d),d}await s?.handleChainEnd($t(l,"output"))}getGraph(t){let n=new Bo,r=null;return this.steps.forEach((i,a)=>{let s=i.getGraph(t);a!==0&&s.trimFirstNode(),a!==this.steps.length-1&&s.trimLastNode(),n.extend(s);let o=s.firstNode();if(!o)throw new Error(`Runnable ${i} has no first node`);r&&n.addEdge(r,o),r=s.lastNode()}),n}pipe(t){return ro.isRunnableSequence(t)?new ro({first:this.first,middle:this.middle.concat([this.last,t.first,...t.middle]),last:t.last,name:this.name??t.name}):new ro({first:this.first,middle:[...this.middle,this.last],last:jt(t),name:this.name})}static isRunnableSequence(t){return Array.isArray(t.middle)&&Re.isRunnable(t)}static from([t,...n],r){let i={};return typeof r=="string"?i.name=r:r!==void 0&&(i=r),new ro({...i,first:jt(t),middle:n.slice(0,-1).map(jt),last:jt(n[n.length-1])})}},Ls=class U1 extends Re{static lc_name(){return"RunnableMap"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;steps;getStepsKeys(){return Object.keys(this.steps)}constructor(t){super(t),this.steps={};for(let[n,r]of Object.entries(t.steps))this.steps[n]=jt(r)}static from(t){return new U1({steps:t})}async invoke(t,n){let r=De(n),i=await(await Qt(r))?.handleChainStart(this.toJSON(),{input:t},r.runId,void 0,void 0,void 0,r?.runName);delete r.runId;let a={};try{let s=Object.entries(this.steps).map(async([o,c])=>{a[o]=await c.invoke(t,Ve(r,{callbacks:i?.getChild(`map:key:${o}`)}))});await vr(Promise.all(s),r.signal)}catch(s){throw await i?.handleChainError(s),s}return await i?.handleChainEnd(a),a}async*_transform(t,n,r){let i={...this.steps},a=sy(t,Object.keys(i).length),s=new Map(Object.entries(i).map(([o,c],l)=>{let u=c.transform(a[l],Ve(r,{callbacks:n?.getChild(`map:key:${o}`)}));return[o,u.next().then(d=>({key:o,gen:u,result:d}))]}));for(;s.size;){let{key:o,result:c,gen:l}=await vr(Promise.race(s.values()),r?.signal);s.delete(o),c.done||(yield{[o]:c.value},s.set(o,l.next().then(u=>({key:o,gen:l,result:u}))))}}transform(t,n){return this._transformStreamWithConfig(t,this._transform.bind(this),n)}async stream(t,n){async function*r(){yield t}let i=De(n),a=new _a({generator:this.transform(r(),i),config:i});return await a.setup,dn.fromAsyncGenerator(a)}},K3=class L1 extends Re{lc_serializable=!1;lc_namespace=["langchain_core","runnables"];func;constructor(t){if(super(t),!ay(t.func))throw new Error("RunnableTraceable requires a function that is wrapped in traceable higher-order function");this.func=t.func}async invoke(t,n){let[r]=this._getOptionsList(n??{},1),i=await Qt(r);return vr(this.func(Ve(r,{callbacks:i}),t),r?.signal)}async*_streamIterator(t,n){let[r]=this._getOptionsList(n??{},1),i=await this.invoke(t,n);if(Ng(i)){for await(let a of i)r?.signal?.throwIfAborted(),yield a;return}if(H3(i)){for(;;){r?.signal?.throwIfAborted();let a=i.next();if(a.done)break;yield a.value}return}yield i}static from(t){return new L1({func:t})}};function X3(e){if(ay(e))throw new Error("RunnableLambda requires a function that is not wrapped in traceable higher-order function. This shouldn't happen.")}var Qn=class z1 extends Re{static lc_name(){return"RunnableLambda"}lc_namespace=["langchain_core","runnables"];func;constructor(t){if(ay(t.func))return K3.from(t.func);super(t),X3(t.func),this.func=t.func}static from(t){return new z1({func:t})}async _invoke(t,n,r){return new Promise((i,a)=>{let s=Ve(n,{callbacks:r?.getChild(),recursionLimit:(n?.recursionLimit??25)-1});Mt.runWithConfig(Br(s),async()=>{try{let o=await this.func(t,{...s});if(o&&Re.isRunnable(o)){if(n?.recursionLimit===0)throw new Error("Recursion limit reached.");o=await o.invoke(t,{...s,recursionLimit:(s.recursionLimit??25)-1})}else if(Ng(o)){let c;for await(let l of Pg(s,o))if(n?.signal?.throwIfAborted(),c===void 0)c=l;else try{c=this._concatOutputChunks(c,l)}catch{c=l}o=c}else if(gS(o)){let c;for(let l of _S(s,o))if(n?.signal?.throwIfAborted(),c===void 0)c=l;else try{c=this._concatOutputChunks(c,l)}catch{c=l}o=c}i(o)}catch(o){a(o)}})})}async invoke(t,n){return this._callWithConfig(this._invoke.bind(this),t,n)}async*_transform(t,n,r){let i;for await(let o of t)if(i===void 0)i=o;else try{i=this._concatOutputChunks(i,o)}catch{i=o}let a=Ve(r,{callbacks:n?.getChild(),recursionLimit:(r?.recursionLimit??25)-1}),s=await new Promise((o,c)=>{Mt.runWithConfig(Br(a),async()=>{try{o(await this.func(i,{...a,config:a}))}catch(l){c(l)}})});if(s&&Re.isRunnable(s)){if(r?.recursionLimit===0)throw new Error("Recursion limit reached.");let o=await s.stream(i,a);for await(let c of o)yield c}else if(Ng(s))for await(let o of Pg(a,s))r?.signal?.throwIfAborted(),yield o;else if(gS(s))for(let o of _S(a,s))r?.signal?.throwIfAborted(),yield o;else yield s}transform(t,n){return this._transformStreamWithConfig(t,this._transform.bind(this),n)}async stream(t,n){async function*r(){yield t}let i=De(n),a=new _a({generator:this.transform(r(),i),config:i});return await a.setup,dn.fromAsyncGenerator(a)}},Y3=class extends Ls{},F1=class extends Re{static lc_name(){return"RunnableWithFallbacks"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;runnable;fallbacks;constructor(e){super(e),this.runnable=e.runnable,this.fallbacks=e.fallbacks}*runnables(){yield this.runnable;for(let e of this.fallbacks)yield e}async invoke(e,t){let n=De(t),r=await Qt(n),{runId:i,...a}=n,s=await r?.handleChainStart(this.toJSON(),$t(e,"input"),i,void 0,void 0,void 0,a?.runName),o=Ve(a,{callbacks:s?.getChild()});return await Mt.runWithConfig(o,async()=>{let c;for(let l of this.runnables()){n?.signal?.throwIfAborted();try{let u=await l.invoke(e,o);return await s?.handleChainEnd($t(u,"output")),u}catch(u){c===void 0&&(c=u)}}throw c===void 0?new Error("No error stored at end of fallback."):(await s?.handleChainError(c),c)})}async*_streamIterator(e,t){let n=De(t),r=await Qt(n),{runId:i,...a}=n,s=await r?.handleChainStart(this.toJSON(),$t(e,"input"),i,void 0,void 0,void 0,a?.runName),o,c;for(let u of this.runnables()){n?.signal?.throwIfAborted();let d=Ve(a,{callbacks:s?.getChild()});try{c=Pg(d,await u.stream(e,d));break}catch(f){o===void 0&&(o=f)}}if(c===void 0){let u=o??new Error("No error stored at end of fallback.");throw await s?.handleChainError(u),u}let l;try{for await(let u of c){yield u;try{l=l===void 0?l:this._concatOutputChunks(l,u)}catch{l=void 0}}}catch(u){throw await s?.handleChainError(u),u}await s?.handleChainEnd($t(l,"output"))}async batch(e,t,n){if(n?.returnExceptions)throw new Error("Not implemented.");let r=this._getOptionsList(t??{},e.length),i=await Promise.all(r.map(o=>Qt(o))),a=await Promise.all(i.map(async(o,c)=>{let l=await o?.handleChainStart(this.toJSON(),$t(e[c],"input"),r[c].runId,void 0,void 0,void 0,r[c].runName);return delete r[c].runId,l})),s;for(let o of this.runnables()){r[0].signal?.throwIfAborted();try{let c=await o.batch(e,a.map((l,u)=>Ve(r[u],{callbacks:l?.getChild()})),n);return await Promise.all(a.map((l,u)=>l?.handleChainEnd($t(c[u],"output")))),c}catch(c){s===void 0&&(s=c)}}throw s?(await Promise.all(a.map(o=>o?.handleChainError(s))),s):new Error("No error stored at end of fallbacks.")}};function jt(e){if(typeof e=="function")return new Qn({func:e});if(Re.isRunnable(e))return e;if(!Array.isArray(e)&&typeof e=="object"){let t={};for(let[n,r]of Object.entries(e))t[n]=jt(r);return new Ls({steps:t})}else throw new Error(`Expected a Runnable, function or object.
586
- Instead got an unsupported type.`)}var vv=class extends Re{static lc_name(){return"RunnableAssign"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;mapper;constructor(e){e instanceof Ls&&(e={mapper:e}),super(e),this.mapper=e.mapper}async invoke(e,t){let n=await this.mapper.invoke(e,t);return{...e,...n}}async*_transform(e,t,n){let r=this.mapper.getStepsKeys(),[i,a]=sy(e),s=this.mapper.transform(a,Ve(n,{callbacks:t?.getChild()})),o=s.next();for await(let c of i){if(typeof c!="object"||Array.isArray(c))throw new Error(`RunnableAssign can only be used with objects as input, got ${typeof c}`);let l=Object.fromEntries(Object.entries(c).filter(([u])=>!r.includes(u)));Object.keys(l).length>0&&(yield l)}yield(await o).value;for await(let c of s)yield c}transform(e,t){return this._transformStreamWithConfig(e,this._transform.bind(this),t)}async stream(e,t){async function*n(){yield e}let r=De(t),i=new _a({generator:this.transform(n(),r),config:r});return await i.setup,dn.fromAsyncGenerator(i)}},B1=class extends Re{static lc_name(){return"RunnablePick"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;keys;constructor(e){(typeof e=="string"||Array.isArray(e))&&(e={keys:e}),super(e),this.keys=e.keys}async _pick(e){if(typeof this.keys=="string")return e[this.keys];{let t=this.keys.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0);return t.length===0?void 0:Object.fromEntries(t)}}async invoke(e,t){return this._callWithConfig(this._pick.bind(this),e,t)}async*_transform(e){for await(let t of e){let n=await this._pick(t);n!==void 0&&(yield n)}}transform(e,t){return this._transformStreamWithConfig(e,this._transform.bind(this),t)}async stream(e,t){async function*n(){yield e}let r=De(t),i=new _a({generator:this.transform(n(),r),config:r});return await i.setup,dn.fromAsyncGenerator(i)}},Rg=class extends Si{name;description;schema;constructor(e){let t=ki.from([Qn.from(async n=>{let r;if(vo(n))try{r=await Lf(this.schema,n.args)}catch{throw new yu("Received tool input did not match expected schema",JSON.stringify(n.args))}else r=n;return r}).withConfig({runName:`${e.name}:parse_input`}),e.bound]).withConfig({runName:e.name});super({bound:t,config:e.config??{}}),this.name=e.name,this.description=e.description,this.schema=e.schema}static lc_name(){return"RunnableToolLike"}};function Q3(e,t){let n=t.name??e.getName(),r=t.description??gs(t.schema);return pv(t.schema)?new Rg({name:n,description:r,schema:jc({input:Bf()}).transform(i=>i.input),bound:e}):new Rg({name:n,description:r,schema:t.schema,bound:e})}var Zu=(e,t)=>{let n=[...new Set(t?.map(i=>{if(typeof i=="string")return i;let a=new i({});if(!("getType"in a)||typeof a.getType!="function")throw new Error("Invalid type provided.");return a.getType()}))],r=e.getType();return n.some(i=>i===r)};function e9(e,t){return Array.isArray(e)?yS(e,t):Qn.from(n=>yS(n,e))}function yS(e,t={}){let{includeNames:n,excludeNames:r,includeTypes:i,excludeTypes:a,includeIds:s,excludeIds:o}=t,c=[];for(let l of e)if(!(r&&l.name&&r.includes(l.name))){{if(a&&Zu(l,a))continue;if(o&&l.id&&o.includes(l.id))continue}i||s||n?(n&&l.name&&n.some(u=>u===l.name)||i&&Zu(l,i)||s&&l.id&&s.some(u=>u===l.id))&&c.push(l):c.push(l)}return c}function t9(e){return Array.isArray(e)?vS(e):Qn.from(vS)}function vS(e){if(!e.length)return[];let t=[];for(let n of e){let r=n,i=t.pop();if(!i)t.push(r);else if(r.getType()==="tool"||r.getType()!==i.getType())t.push(i,r);else{let a=bu(i),s=bu(r),o=a.concat(s);typeof a.content=="string"&&typeof s.content=="string"&&(o.content=`${a.content}
587
- ${s.content}`),t.push(i9(o))}}return t}function n9(e,t){if(Array.isArray(e)){let n=e;if(!t)throw new Error("Options parameter is required when providing messages.");return bS(n,t)}else{let n=e;return Qn.from(r=>bS(r,n)).withConfig({runName:"trim_messages"})}}async function bS(e,t){let{maxTokens:n,tokenCounter:r,strategy:i="last",allowPartial:a=!1,endOn:s,startOn:o,includeSystem:c=!1,textSplitter:l}=t;if(o&&i==="first")throw new Error("`startOn` should only be specified if `strategy` is 'last'.");if(c&&i==="first")throw new Error("`includeSystem` should only be specified if `strategy` is 'last'.");let u;"getNumTokens"in r?u=async f=>(await Promise.all(f.map(h=>r.getNumTokens(h.content)))).reduce((h,p)=>h+p,0):u=async f=>r(f);let d=V1;if(l&&("splitText"in l?d=l.splitText:d=async f=>l(f)),i==="first")return Z1(e,{maxTokens:n,tokenCounter:u,textSplitter:d,partialStrategy:a?"first":void 0,endOn:s});if(i==="last")return r9(e,{maxTokens:n,tokenCounter:u,textSplitter:d,allowPartial:a,includeSystem:c,startOn:o,endOn:s});throw new Error(`Unrecognized strategy: '${i}'. Must be one of 'first' or 'last'.`)}async function Z1(e,t){let{maxTokens:n,tokenCounter:r,textSplitter:i,partialStrategy:a,endOn:s}=t,o=[...e],c=0;for(let l=0;l<o.length;l+=1)if(await r(l>0?o.slice(0,-l):o)<=n){c=o.length-l;break}if(c<o.length&&a){let l=!1;if(Array.isArray(o[c].content)){let u=o[c];if(typeof u.content=="string")throw new Error("Expected content to be an array.");let d=u.content.length,f=a==="last"?[...u.content].reverse():u.content;for(let h=1;h<=d;h+=1){let p=a==="first"?f.slice(0,h):f.slice(-h),m=Object.fromEntries(Object.entries(u).filter(([y])=>y!=="type"&&!y.startsWith("lc_"))),v=bv(u.getType(),{...m,content:p}),g=[...o.slice(0,c),v];if(await r(g)<=n)o=g,c+=1,l=!0;else break}l&&a==="last"&&(u.content=[...f].reverse())}if(!l){let u=o[c],d;if(Array.isArray(u.content)&&u.content.some(f=>typeof f=="string"||f.type==="text")?d=u.content.find(f=>f.type==="text"&&f.text)?.text:typeof u.content=="string"&&(d=u.content),d){let f=await i(d),h=f.length;a==="last"&&f.reverse();for(let p=0;p<h-1;p+=1)if(f.pop(),u.content=f.join(""),await r([...o.slice(0,c),u])<=n){a==="last"&&(u.content=[...f].reverse().join("")),o=[...o.slice(0,c),u],c+=1;break}}}}if(s){let l=Array.isArray(s)?s:[s];for(;c>0&&!Zu(o[c-1],l);)c-=1}return o.slice(0,c)}async function r9(e,t){let{allowPartial:n=!1,includeSystem:r=!1,endOn:i,startOn:a,...s}=t,o=e.map(u=>{let d=Object.fromEntries(Object.entries(u).filter(([f])=>f!=="type"&&!f.startsWith("lc_")));return bv(u.getType(),d,Co(u))});if(i){let u=Array.isArray(i)?i:[i];for(;o.length>0&&!Zu(o[o.length-1],u);)o=o.slice(0,-1)}let c=r&&o[0]?.getType()==="system",l=c?o.slice(0,1).concat(o.slice(1).reverse()):o.reverse();return l=await Z1(l,{...s,partialStrategy:n?"last":void 0,endOn:a}),c?[l[0],...l.slice(1).reverse()]:l.reverse()}var wS={human:{message:Vt,messageChunk:gc},ai:{message:Ke,messageChunk:un},system:{message:_r,messageChunk:mi},developer:{message:_r,messageChunk:mi},tool:{message:Cn,messageChunk:hc},function:{message:pf,messageChunk:mc},generic:{message:Hr,messageChunk:pc},remove:{message:Xi,messageChunk:Xi}};function bv(e,t,n){let r,i;switch(e){case"human":n?r=new gc(t):i=new Vt(t);break;case"ai":if(n){let a={...t};"tool_calls"in a&&(a={...a,tool_call_chunks:a.tool_calls?.map(s=>({...s,type:"tool_call_chunk",index:void 0,args:JSON.stringify(s.args)}))}),r=new un(a)}else i=new Ke(t);break;case"system":n?r=new mi(t):i=new _r(t);break;case"developer":n?r=new mi({...t,additional_kwargs:{...t.additional_kwargs,__openai_role__:"developer"}}):i=new _r({...t,additional_kwargs:{...t.additional_kwargs,__openai_role__:"developer"}});break;case"tool":if("tool_call_id"in t)n?r=new hc(t):i=new Cn(t);else throw new Error("Can not convert ToolMessage to ToolMessageChunk if 'tool_call_id' field is not defined.");break;case"function":if(n)r=new mc(t);else{if(!t.name)throw new Error("FunctionMessage must have a 'name' field");i=new pf(t)}break;case"generic":if("role"in t)n?r=new pc(t):i=new Hr(t);else throw new Error("Can not convert ChatMessage to ChatMessageChunk if 'role' field is not defined.");break;default:throw new Error(`Unrecognized message type ${e}`)}if(n&&r)return r;if(i)return i;throw new Error(`Unrecognized message type ${e}`)}function i9(e){let t=e.getType(),n,r=Object.fromEntries(Object.entries(e).filter(([i])=>!["type","tool_call_chunks"].includes(i)&&!i.startsWith("lc_")));if(t in wS&&(n=bv(t,r)),!n)throw new Error(`Unrecognized message chunk class ${t}. Supported classes are ${Object.keys(wS)}`);return n}function V1(e){let t=e.split(`
588
- `);return Promise.resolve([...t.slice(0,-1).map(n=>`${n}
589
- `),t[t.length-1]])}var a9=["tool_call","tool_call_chunk","invalid_tool_call","server_tool_call","server_tool_call_chunk","server_tool_call_result"],s9=["image","video","audio","text-plain","file"],o9=["text","reasoning",...a9,...s9],c9=Q({AIMessage:()=>Ke,AIMessageChunk:()=>un,BaseMessage:()=>Xt,BaseMessageChunk:()=>Oi,ChatMessage:()=>Hr,ChatMessageChunk:()=>pc,DEFAULT_MERGE_IGNORE_KEYS:()=>Xk,FunctionMessage:()=>pf,FunctionMessageChunk:()=>mc,HumanMessage:()=>Vt,HumanMessageChunk:()=>gc,KNOWN_BLOCK_TYPES:()=>o9,RemoveMessage:()=>Xi,SystemMessage:()=>_r,SystemMessageChunk:()=>mi,ToolMessage:()=>Cn,ToolMessageChunk:()=>hc,_isMessageFieldWithRole:()=>ex,_mergeDicts:()=>Ft,_mergeLists:()=>ts,_mergeObj:()=>Yk,_mergeStatus:()=>Kk,coerceMessageLikeToMessage:()=>pr,collapseToolCallChunks:()=>ox,convertToChunk:()=>bu,convertToOpenAIImageBlock:()=>Gk,convertToProviderContentBlock:()=>L_,defaultTextSplitter:()=>V1,defaultToolCallParser:()=>Z_,filterMessages:()=>e9,getBufferString:()=>H_,iife:()=>sx,isAIMessage:()=>hf,isAIMessageChunk:()=>zm,isBase64ContentBlock:()=>U_,isBaseMessage:()=>Rt,isBaseMessageChunk:()=>Co,isChatMessage:()=>Ej,isChatMessageChunk:()=>Tj,isDataContentBlock:()=>gr,isDirectToolOutput:()=>B_,isFunctionMessage:()=>Oj,isFunctionMessageChunk:()=>Aj,isHumanMessage:()=>Cj,isHumanMessageChunk:()=>Nj,isIDContentBlock:()=>qk,isMessage:()=>Wk,isOpenAIToolCallArray:()=>cj,isPlainTextContentBlock:()=>q4,isSystemMessage:()=>Pj,isSystemMessageChunk:()=>Rj,isToolMessage:()=>V_,isToolMessageChunk:()=>tx,isURLContentBlock:()=>D_,mapChatMessagesToStoredMessages:()=>zj,mapStoredMessageToChatMessage:()=>J_,mapStoredMessagesToChatMessages:()=>Lj,mergeContent:()=>Fr,mergeMessageRuns:()=>t9,mergeResponseMetadata:()=>rx,mergeUsageMetadata:()=>G_,parseBase64DataUrl:()=>Ao,parseMimeType:()=>Lm,trimMessages:()=>n9}),l9=Q({BaseChatMessageHistory:()=>q1,BaseListChatMessageHistory:()=>wv,InMemoryChatMessageHistory:()=>u9}),q1=class extends An{async addMessages(e){for(let t of e)await this.addMessage(t)}},wv=class extends An{addUserMessage(e){return this.addMessage(new Vt(e))}addAIMessage(e){return this.addMessage(new Ke(e))}async addMessages(e){for(let t of e)await this.addMessage(t)}clear(){throw new Error("Not implemented.")}},u9=class extends wv{lc_namespace=["langchain","stores","message","in_memory"];messages=[];constructor(e){super(...arguments),this.messages=e??[]}async getMessages(){return this.messages}async addMessage(e){this.messages.push(e)}async clear(){this.messages=[]}},di=class{pageContent;metadata;id;constructor(e){this.pageContent=e.pageContent!==void 0?e.pageContent.toString():"",this.metadata=e.metadata??{},this.id=e.id}},G1=class extends Re{lc_namespace=["langchain_core","documents","transformers"];invoke(e,t){return this.transformDocuments(e)}},d9=class extends G1{async transformDocuments(e){let t=[];for(let n of e){let r=await this._transformDocument(n);t.push(r)}return t}},f9=Q({BaseDocumentTransformer:()=>G1,Document:()=>di,MappingDocumentTransformer:()=>d9}),h9=Q({BaseDocumentLoader:()=>H1}),H1=class{},p9=Q({LangSmithLoader:()=>m9}),m9=class extends H1{datasetId;datasetName;exampleIds;asOf;splits;inlineS3Urls;offset;limit;metadata;filter;contentKey;formatContent;client;constructor(e){if(super(),e.client&&e.clientConfig)throw new Error("client and clientConfig cannot both be provided.");this.client=e.client??new is(e?.clientConfig),this.contentKey=e.contentKey?e.contentKey.split("."):[],this.formatContent=e.formatContent??g9,this.datasetId=e.datasetId,this.datasetName=e.datasetName,this.exampleIds=e.exampleIds,this.asOf=e.asOf,this.splits=e.splits,this.inlineS3Urls=e.inlineS3Urls,this.offset=e.offset,this.limit=e.limit,this.metadata=e.metadata,this.filter=e.filter}async load(){let e=[];for await(let t of this.client.listExamples({datasetId:this.datasetId,datasetName:this.datasetName,exampleIds:this.exampleIds,asOf:this.asOf,splits:this.splits,inlineS3Urls:this.inlineS3Urls,offset:this.offset,limit:this.limit,metadata:this.metadata,filter:this.filter})){let n=t.inputs;for(let a of this.contentKey)n=n[a];let r=this.formatContent(n),i=t;["created_at","modified_at"].forEach(a=>{a in i&&typeof i[a]=="object"&&(i[a]=i[a].toString())}),e.push({pageContent:r,metadata:i})}return e}};function g9(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}var _9=Q({Embeddings:()=>Zf}),Zf=class{caller;constructor(t){this.caller=new bc(t??{})}},$v=class extends An{lc_namespace=["langchain_core","example_selectors","base"]},J1=class{async getPromptAsync(e,t){return this.getPrompt(e).partial(t?.partialVariables??{})}},y9=class extends J1{defaultPrompt;conditionals;constructor(e,t=[]){super(),this.defaultPrompt=e,this.conditionals=t}getPrompt(e){for(let[t,n]of this.conditionals)if(t(e))return n;return this.defaultPrompt}};function v9(e){return e._modelType()==="base_llm"}function b9(e){return e._modelType()==="base_chat_model"}function $S(e){return e.split(/\n| /).length}var w9=class W1 extends $v{examples=[];examplePrompt;getTextLength=$S;maxLength=2048;exampleTextLengths=[];constructor(t){super(t),this.examplePrompt=t.examplePrompt,this.maxLength=t.maxLength??2048,this.getTextLength=t.getTextLength??$S}async addExample(t){this.examples.push(t);let n=await this.examplePrompt.format(t);this.exampleTextLengths.push(this.getTextLength(n))}async calculateExampleTextLengths(t,n){if(t.length>0)return t;let{examples:r,examplePrompt:i}=n;return(await Promise.all(r.map(a=>i.format(a)))).map(a=>this.getTextLength(a))}async selectExamples(t){let n=Object.values(t).join(" "),r=this.maxLength-this.getTextLength(n),i=0,a=[];for(;r>0&&i<this.examples.length;){let s=r-this.exampleTextLengths[i];if(s<0)break;a.push(this.examples[i]),r=s,i+=1}return a}static async fromExamples(t,n){let r=new W1(n);return await Promise.all(t.map(i=>r.addExample(i))),r}};function im(e){return Object.keys(e).sort().map(t=>e[t])}var $9=class K1 extends $v{vectorStoreRetriever;exampleKeys;inputKeys;constructor(t){if(super(t),this.exampleKeys=t.exampleKeys,this.inputKeys=t.inputKeys,t.vectorStore!==void 0)this.vectorStoreRetriever=t.vectorStore.asRetriever({k:t.k??4,filter:t.filter});else if(t.vectorStoreRetriever)this.vectorStoreRetriever=t.vectorStoreRetriever;else throw new Error('You must specify one of "vectorStore" and "vectorStoreRetriever".')}async addExample(t){let n=im((this.inputKeys??Object.keys(t)).reduce((r,i)=>({...r,[i]:t[i]}),{})).join(" ");await this.vectorStoreRetriever.addDocuments([new di({pageContent:n,metadata:t})])}async selectExamples(t){let n=im((this.inputKeys??Object.keys(t)).reduce((i,a)=>({...i,[a]:t[a]}),{})).join(" "),r=(await this.vectorStoreRetriever.invoke(n)).map(i=>i.metadata);return this.exampleKeys?r.map(i=>this.exampleKeys.reduce((a,s)=>({...a,[s]:i[s]}),{})):r}static async fromExamples(t,n,r,i={}){let a=i.inputKeys??null,s=t.map(o=>im(a?a.reduce((c,l)=>({...c,[l]:o[l]}),{}):o).join(" "));return new K1({vectorStore:await r.fromTexts(s,t,n,i),k:i.k??4,exampleKeys:i.exampleKeys,inputKeys:i.inputKeys})}},S9=Q({BaseExampleSelector:()=>$v,BasePromptSelector:()=>J1,ConditionalPromptSelector:()=>y9,LengthBasedExampleSelector:()=>w9,SemanticSimilarityExampleSelector:()=>$9,isChatModel:()=>b9,isLLM:()=>v9}),jg="10f90ea3-90a4-4962-bf75-83a0f3c1c62a",k9=class extends An{lc_namespace=["langchain","recordmanagers"]},X1=class{uid;hash_;contentHash;metadataHash;pageContent;metadata;keyEncoder=j_;constructor(e){this.uid=e.uid,this.pageContent=e.pageContent,this.metadata=e.metadata}makeDefaultKeyEncoder(e){this.keyEncoder=e}calculateHashes(){let e=["hash_","content_hash","metadata_hash"];for(let n of e)if(n in this.metadata)throw new Error(`Metadata cannot contain key ${n} as it is reserved for internal use. Restricted keys: [${e.join(", ")}]`);let t=this._hashStringToUUID(this.pageContent);try{let n=this._hashNestedDictToUUID(this.metadata);this.contentHash=t,this.metadataHash=n}catch(n){throw new Error(`Failed to hash metadata: ${n}. Please use a dict that can be serialized using json.`)}this.hash_=this._hashStringToUUID(this.contentHash+this.metadataHash),this.uid||(this.uid=this.hash_)}toDocument(){return new di({pageContent:this.pageContent,metadata:this.metadata})}static fromDocument(e,t){let n=new this({pageContent:e.pageContent,metadata:e.metadata,uid:t||e.uid});return n.calculateHashes(),n}_hashStringToUUID(e){return wu(this.keyEncoder(e),jg)}_hashNestedDictToUUID(e){let t=JSON.stringify(e,Object.keys(e).sort());return wu(this.keyEncoder(t),jg)}};function Y1(e,t){let n=[],r=[];return t.forEach(i=>{r.push(i),r.length>=e&&(n.push(r),r=[])}),r.length>0&&n.push(r),n}function Q1(e){let t=new Set,n=[];for(let r of e){if(!r.hash_)throw new Error("Hashed document does not have a hash");t.has(r.hash_)||(t.add(r.hash_),n.push(r))}return n}function eA(e){if(e===null)return t=>null;if(typeof e=="string")return t=>t.metadata[e];if(typeof e=="function")return e;throw new Error(`sourceIdKey should be null, a string or a function, got ${typeof e}`)}var tA=e=>"load"in e&&typeof e.load=="function"&&"loadAndSplit"in e&&typeof e.loadAndSplit=="function";async function x9(e){let{docsSource:t,recordManager:n,vectorStore:r,options:i}=e,{batchSize:a=100,cleanup:s,sourceIdKey:o,cleanupBatchSize:c=1e3,forceUpdate:l=!1}=i??{};if(s==="incremental"&&!o)throw new Error("sourceIdKey is required when cleanup mode is incremental. Please provide through 'options.sourceIdKey'.");let u=tA(t)?await t.load():t,d=eA(o??null),f=await n.getTime(),h=0,p=0,m=0,v=0,g=Y1(a??100,u);for(let y of g){let $=Q1(y.map(O=>X1.fromDocument(O))),S=$.map(O=>d(O));s==="incremental"&&$.forEach((O,M)=>{if(S[M]===null)throw new Error("sourceIdKey must be provided when cleanup is incremental")});let x=await n.exists($.map(O=>O.uid)),C=[],T=[],b=[],D=new Set;if($.forEach((O,M)=>{if(x[M])if(l)D.add(O.uid);else{b.push(O.uid);return}C.push(O.uid),T.push(O.toDocument())}),b.length>0&&(await n.update(b,{timeAtLeast:f}),v+=b.length),T.length>0&&(await r.addDocuments(T,{ids:C}),h+=T.length-D.size,m+=D.size),await n.update($.map(O=>O.uid),{timeAtLeast:f,groupIds:S}),s==="incremental"){S.forEach(M=>{if(!M)throw new Error("Source id cannot be null")});let O=await n.listKeys({before:f,groupIds:S});O.length>0&&(await r.delete({ids:O}),await n.deleteKeys(O),p+=O.length)}}if(s==="full"){let y=await n.listKeys({before:f,limit:c});for(;y.length>0;)await r.delete({ids:y}),await n.deleteKeys(y),p+=y.length,y=await n.listKeys({before:f,limit:c})}return{numAdded:h,numDeleted:p,numUpdated:m,numSkipped:v}}var I9=Q({RecordManager:()=>k9,UUIDV5_NAMESPACE:()=>jg,_HashedDocument:()=>X1,_batch:()=>Y1,_deduplicateInOrder:()=>Q1,_getSourceIdAssigner:()=>eA,_isBaseDocumentLoader:()=>tA,index:()=>x9}),E9=Q({BasePromptValue:()=>Vf,ChatPromptValue:()=>kv,ImagePromptValue:()=>nA,StringPromptValue:()=>Sv}),Vf=class extends An{},Sv=class extends Vf{static lc_name(){return"StringPromptValue"}lc_namespace=["langchain_core","prompt_values"];lc_serializable=!0;value;constructor(e){super({value:e}),this.value=e}toString(){return this.value}toChatMessages(){return[new Vt(this.value)]}},kv=class extends Vf{lc_namespace=["langchain_core","prompt_values"];lc_serializable=!0;static lc_name(){return"ChatPromptValue"}messages;constructor(e){Array.isArray(e)&&(e={messages:e}),super(e),this.messages=e.messages}toString(){return H_(this.messages)}toChatMessages(){return this.messages}},nA=class extends Vf{lc_namespace=["langchain_core","prompt_values"];lc_serializable=!0;static lc_name(){return"ImagePromptValue"}imageUrl;value;constructor(e){"imageUrl"in e||(e={imageUrl:e}),super(e),this.imageUrl=e.imageUrl}toString(){return this.imageUrl.url}toChatMessages(){return[new Vt({content:[{type:"image_url",image_url:{detail:this.imageUrl.detail,url:this.imageUrl.url}}]})]}},Js={},SS;function T9(){if(SS)return Js;SS=1,Js.byteLength=o,Js.toByteArray=l,Js.fromByteArray=f;for(var e=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,a=r.length;i<a;++i)e[i]=r[i],t[r.charCodeAt(i)]=i;t[45]=62,t[95]=63;function s(h){var p=h.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var m=h.indexOf("=");m===-1&&(m=p);var v=m===p?0:4-m%4;return[m,v]}function o(h){var p=s(h),m=p[0],v=p[1];return(m+v)*3/4-v}function c(h,p,m){return(p+m)*3/4-m}function l(h){var p,m=s(h),v=m[0],g=m[1],y=new n(c(h,v,g)),$=0,S=g>0?v-4:v,x;for(x=0;x<S;x+=4)p=t[h.charCodeAt(x)]<<18|t[h.charCodeAt(x+1)]<<12|t[h.charCodeAt(x+2)]<<6|t[h.charCodeAt(x+3)],y[$++]=p>>16&255,y[$++]=p>>8&255,y[$++]=p&255;return g===2&&(p=t[h.charCodeAt(x)]<<2|t[h.charCodeAt(x+1)]>>4,y[$++]=p&255),g===1&&(p=t[h.charCodeAt(x)]<<10|t[h.charCodeAt(x+1)]<<4|t[h.charCodeAt(x+2)]>>2,y[$++]=p>>8&255,y[$++]=p&255),y}function u(h){return e[h>>18&63]+e[h>>12&63]+e[h>>6&63]+e[h&63]}function d(h,p,m){for(var v,g=[],y=p;y<m;y+=3)v=(h[y]<<16&16711680)+(h[y+1]<<8&65280)+(h[y+2]&255),g.push(u(v));return g.join("")}function f(h){for(var p,m=h.length,v=m%3,g=[],y=16383,$=0,S=m-v;$<S;$+=y)g.push(d(h,$,$+y>S?S:$+y));return v===1?(p=h[m-1],g.push(e[p>>2]+e[p<<4&63]+"==")):v===2&&(p=(h[m-2]<<8)+h[m-1],g.push(e[p>>10]+e[p>>4&63]+e[p<<2&63]+"=")),g.join("")}return Js}var O9=T9(),A9=Sa(O9),C9=Object.defineProperty,N9=(e,t,n)=>t in e?C9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P9=(e,t,n)=>(N9(e,t+"",n),n);function R9(e,t){let n=Array.from({length:e.length},(r,i)=>({start:i,end:i+1}));for(;n.length>1;){let r=null;for(let i=0;i<n.length-1;i++){let a=e.slice(n[i].start,n[i+1].end),s=t.get(a.join(","));s!=null&&(r==null||s<r[0])&&(r=[s,i])}if(r!=null){let i=r[1];n[i]={start:n[i].start,end:n[i+1].end},n.splice(i+1,1)}else break}return n}function j9(e,t){return e.length===1?[t.get(e.join(","))]:R9(e,t).map(n=>t.get(e.slice(n.start,n.end).join(","))).filter(n=>n!=null)}function M9(e){return e.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}var Mg=class{specialTokens;inverseSpecialTokens;patStr;textEncoder=new TextEncoder;textDecoder=new TextDecoder("utf-8");rankMap=new Map;textMap=new Map;constructor(e,t){this.patStr=e.pat_str;let n=e.bpe_ranks.split(`
590
- `).filter(Boolean).reduce((r,i)=>{let[a,s,...o]=i.split(" "),c=Number.parseInt(s,10);return o.forEach((l,u)=>r[l]=c+u),r},{});for(let[r,i]of Object.entries(n)){let a=A9.toByteArray(r);this.rankMap.set(a.join(","),i),this.textMap.set(i,a)}this.specialTokens={...e.special_tokens,...t},this.inverseSpecialTokens=Object.entries(this.specialTokens).reduce((r,[i,a])=>(r[a]=this.textEncoder.encode(i),r),{})}encode(e,t=[],n="all"){let r=new RegExp(this.patStr,"ug"),i=Mg.specialTokenRegex(Object.keys(this.specialTokens)),a=[],s=new Set(t==="all"?Object.keys(this.specialTokens):t),o=new Set(n==="all"?Object.keys(this.specialTokens).filter(l=>!s.has(l)):n);if(o.size>0){let l=Mg.specialTokenRegex([...o]),u=e.match(l);if(u!=null)throw new Error(`The text contains a special token that is not allowed: ${u[0]}`)}let c=0;for(;;){let l=null,u=c;for(;i.lastIndex=u,l=i.exec(e),!(l==null||s.has(l[0]));)u=l.index+1;let d=l?.index??e.length;for(let h of e.substring(c,d).matchAll(r)){let p=this.textEncoder.encode(h[0]),m=this.rankMap.get(p.join(","));if(m!=null){a.push(m);continue}a.push(...j9(p,this.rankMap))}if(l==null)break;let f=this.specialTokens[l[0]];a.push(f),c=l.index+l[0].length}return a}decode(e){let t=[],n=0;for(let a=0;a<e.length;++a){let s=e[a],o=this.textMap.get(s)??this.inverseSpecialTokens[s];o!=null&&(t.push(o),n+=o.length)}let r=new Uint8Array(n),i=0;for(let a of t)r.set(a,i),i+=a.length;return this.textDecoder.decode(r)}},rA=Mg;P9(rA,"specialTokenRegex",e=>new RegExp(e.map(t=>M9(t)).join("|"),"g"));function D9(e){switch(e){case"gpt2":return"gpt2";case"code-cushman-001":case"code-cushman-002":case"code-davinci-001":case"code-davinci-002":case"cushman-codex":case"davinci-codex":case"davinci-002":case"text-davinci-002":case"text-davinci-003":return"p50k_base";case"code-davinci-edit-001":case"text-davinci-edit-001":return"p50k_edit";case"ada":case"babbage":case"babbage-002":case"code-search-ada-code-001":case"code-search-babbage-code-001":case"curie":case"davinci":case"text-ada-001":case"text-babbage-001":case"text-curie-001":case"text-davinci-001":case"text-search-ada-doc-001":case"text-search-babbage-doc-001":case"text-search-curie-doc-001":case"text-search-davinci-doc-001":case"text-similarity-ada-001":case"text-similarity-babbage-001":case"text-similarity-curie-001":case"text-similarity-davinci-001":return"r50k_base";case"gpt-3.5-turbo-instruct-0914":case"gpt-3.5-turbo-instruct":case"gpt-3.5-turbo-16k-0613":case"gpt-3.5-turbo-16k":case"gpt-3.5-turbo-0613":case"gpt-3.5-turbo-0301":case"gpt-3.5-turbo":case"gpt-4-32k-0613":case"gpt-4-32k-0314":case"gpt-4-32k":case"gpt-4-0613":case"gpt-4-0314":case"gpt-4":case"gpt-3.5-turbo-1106":case"gpt-35-turbo":case"gpt-4-1106-preview":case"gpt-4-vision-preview":case"gpt-3.5-turbo-0125":case"gpt-4-turbo":case"gpt-4-turbo-2024-04-09":case"gpt-4-turbo-preview":case"gpt-4-0125-preview":case"text-embedding-ada-002":case"text-embedding-3-small":case"text-embedding-3-large":return"cl100k_base";case"gpt-4o":case"gpt-4o-2024-05-13":case"gpt-4o-2024-08-06":case"gpt-4o-2024-11-20":case"gpt-4o-mini-2024-07-18":case"gpt-4o-mini":case"gpt-4o-search-preview":case"gpt-4o-search-preview-2025-03-11":case"gpt-4o-mini-search-preview":case"gpt-4o-mini-search-preview-2025-03-11":case"gpt-4o-audio-preview":case"gpt-4o-audio-preview-2024-12-17":case"gpt-4o-audio-preview-2024-10-01":case"gpt-4o-mini-audio-preview":case"gpt-4o-mini-audio-preview-2024-12-17":case"o1":case"o1-2024-12-17":case"o1-mini":case"o1-mini-2024-09-12":case"o1-preview":case"o1-preview-2024-09-12":case"o1-pro":case"o1-pro-2025-03-19":case"o3":case"o3-2025-04-16":case"o3-mini":case"o3-mini-2025-01-31":case"o4-mini":case"o4-mini-2025-04-16":case"chatgpt-4o-latest":case"gpt-4o-realtime":case"gpt-4o-realtime-preview-2024-10-01":case"gpt-4o-realtime-preview-2024-12-17":case"gpt-4o-mini-realtime-preview":case"gpt-4o-mini-realtime-preview-2024-12-17":case"gpt-4.1":case"gpt-4.1-2025-04-14":case"gpt-4.1-mini":case"gpt-4.1-mini-2025-04-14":case"gpt-4.1-nano":case"gpt-4.1-nano-2025-04-14":case"gpt-4.5-preview":case"gpt-4.5-preview-2025-02-27":case"gpt-5":case"gpt-5-2025-08-07":case"gpt-5-nano":case"gpt-5-nano-2025-08-07":case"gpt-5-mini":case"gpt-5-mini-2025-08-07":case"gpt-5-chat-latest":return"o200k_base";default:throw new Error("Unknown model")}}var U9=Q({encodingForModel:()=>xv,getEncoding:()=>iA}),kl={},L9=new bc({});async function iA(e){return e in kl||(kl[e]=L9.fetch(`https://tiktoken.pages.dev/js/${e}.json`).then(t=>t.json()).then(t=>new rA(t)).catch(t=>{throw delete kl[e],t})),await kl[e]}async function xv(e){return iA(D9(e))}var z9=Q({BaseLangChain:()=>Ev,BaseLanguageModel:()=>Tv,calculateMaxTokens:()=>B9,getEmbeddingContextSize:()=>F9,getModelContextSize:()=>aA,getModelNameForTiktoken:()=>qf,isOpenAITool:()=>Iv}),qf=e=>e.startsWith("gpt-5")?"gpt-5":e.startsWith("gpt-3.5-turbo-16k")?"gpt-3.5-turbo-16k":e.startsWith("gpt-3.5-turbo-")?"gpt-3.5-turbo":e.startsWith("gpt-4-32k")?"gpt-4-32k":e.startsWith("gpt-4-")?"gpt-4":e.startsWith("gpt-4o")?"gpt-4o":e,F9=e=>{switch(e){case"text-embedding-ada-002":return 8191;default:return 2046}},aA=e=>{switch(qf(e)){case"gpt-5":case"gpt-5-turbo":case"gpt-5-turbo-preview":return 4e5;case"gpt-4o":case"gpt-4o-mini":case"gpt-4o-2024-05-13":case"gpt-4o-2024-08-06":return 128e3;case"gpt-4-turbo":case"gpt-4-turbo-preview":case"gpt-4-turbo-2024-04-09":case"gpt-4-0125-preview":case"gpt-4-1106-preview":return 128e3;case"gpt-4-32k":case"gpt-4-32k-0314":case"gpt-4-32k-0613":return 32768;case"gpt-4":case"gpt-4-0314":case"gpt-4-0613":return 8192;case"gpt-3.5-turbo-16k":case"gpt-3.5-turbo-16k-0613":return 16384;case"gpt-3.5-turbo":case"gpt-3.5-turbo-0301":case"gpt-3.5-turbo-0613":case"gpt-3.5-turbo-1106":case"gpt-3.5-turbo-0125":return 4096;case"text-davinci-003":case"text-davinci-002":return 4097;case"text-davinci-001":return 2049;case"text-curie-001":case"text-babbage-001":case"text-ada-001":return 2048;case"code-davinci-002":case"code-davinci-001":return 8e3;case"code-cushman-001":return 2048;case"claude-3-5-sonnet-20241022":case"claude-3-5-sonnet-20240620":case"claude-3-opus-20240229":case"claude-3-sonnet-20240229":case"claude-3-haiku-20240307":case"claude-2.1":return 2e5;case"claude-2.0":case"claude-instant-1.2":return 1e5;case"gemini-1.5-pro":case"gemini-1.5-pro-latest":case"gemini-1.5-flash":case"gemini-1.5-flash-latest":return 1e6;case"gemini-pro":case"gemini-pro-vision":return 32768;default:return 4097}};function Iv(e){return typeof e!="object"||!e?!1:!!("type"in e&&e.type==="function"&&"function"in e&&typeof e.function=="object"&&e.function&&"name"in e.function&&"parameters"in e.function)}var B9=async({prompt:e,modelName:t})=>{let n;try{n=(await xv(qf(t))).encode(e).length}catch{console.warn("Failed to calculate number of tokens, falling back to approximate count"),n=Math.ceil(e.length/4)}return aA(t)-n},Z9=()=>!1,Ev=class extends Re{verbose;callbacks;tags;metadata;get lc_attributes(){return{callbacks:void 0,verbose:void 0}}constructor(e){super(e),this.verbose=e.verbose??Z9(),this.callbacks=e.callbacks,this.tags=e.tags??[],this.metadata=e.metadata??{},this._addVersion("@langchain/core","1.1.38")}_addVersion(e,t){let n=this.metadata?.versions;this.metadata={...this.metadata,versions:{...typeof n=="object"&&n!==null?n:{},[e]:t}}}},Tv=class extends Ev{get callKeys(){return["stop","timeout","signal","tags","metadata","callbacks"]}caller;cache;constructor({callbacks:e,callbackManager:t,...n}){let{cache:r,...i}=n;super({callbacks:e??t,...i}),typeof r=="object"?this.cache=r:r?this.cache=ux.global():this.cache=void 0,this.caller=new bc(n??{})}_encoding;async getNumTokens(e){let t;typeof e=="string"?t=e:t=e.map(r=>typeof r=="string"?r:r.type==="text"&&"text"in r?r.text:"").join("");let n=Math.ceil(t.length/4);if(!this._encoding)try{this._encoding=await xv("modelName"in this?qf(this.modelName):"gpt2")}catch(r){console.warn("Failed to calculate number of tokens, falling back to approximate count",r)}if(this._encoding)try{n=this._encoding.encode(t).length}catch(r){console.warn("Failed to calculate number of tokens, falling back to approximate count",r)}return n}static _convertInputToPromptValue(e){return typeof e=="string"?new Sv(e):Array.isArray(e)?new kv(e.map(pr)):e}_identifyingParams(){return{}}_getSerializedCacheKeyParametersForCall({config:e,...t}){let n={...this._identifyingParams(),...t,_type:this._llmType(),_model:this._modelType()};return Object.entries(n).filter(([r,i])=>i!==void 0).map(([r,i])=>`${r}:${JSON.stringify(i)}`).sort().join(",")}serialize(){return{...this._identifyingParams(),_type:this._llmType(),_model:this._modelType()}}static async deserialize(e){throw new Error("Use .toJSON() instead")}get profile(){return{}}},Zo=class extends Re{static lc_name(){return"RunnablePassthrough"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;func;constructor(e){super(e),e&&(this.func=e.func)}async invoke(e,t){let n=De(t);return this.func&&await this.func(e,n),this._callWithConfig(r=>Promise.resolve(r),e,n)}async*transform(e,t){let n=De(t),r,i=!0;for await(let a of this._transformStreamWithConfig(e,s=>s,n))if(yield a,i)if(r===void 0)r=a;else try{r=_i(r,a)}catch{r=void 0,i=!1}this.func&&r!==void 0&&await this.func(r,n)}static assign(e){return new vv(new Ls({steps:e}))}},V9=class extends Re{static lc_name(){return"RouterRunnable"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;runnables;constructor(e){super(e),this.runnables=e.runnables}async invoke(e,t){let{key:n,input:r}=e,i=this.runnables[n];if(i===void 0)throw new Error(`No runnable associated with key "${n}".`);return i.invoke(r,De(t))}async batch(e,t,n){let r=e.map(u=>u.key),i=e.map(u=>u.input);if(r.find(u=>this.runnables[u]===void 0)!==void 0)throw new Error("One or more keys do not have a corresponding runnable.");let a=r.map(u=>this.runnables[u]),s=this._getOptionsList(t??{},e.length),o=s[0]?.maxConcurrency??n?.maxConcurrency,c=o&&o>0?o:e.length,l=[];for(let u=0;u<i.length;u+=c){let d=i.slice(u,u+c).map((h,p)=>a[p].invoke(h,s[p])),f=await Promise.all(d);l.push(f)}return l.flat()}async stream(e,t){let{key:n,input:r}=e,i=this.runnables[n];if(i===void 0)throw new Error(`No runnable associated with key "${n}".`);return i.stream(r,t)}},q9=class extends Re{static lc_name(){return"RunnableBranch"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;default;branches;constructor(e){super(e),this.branches=e.branches,this.default=e.default}static from(e){if(e.length<1)throw new Error("RunnableBranch requires at least one branch");let t=e.slice(0,-1).map(([r,i])=>[jt(r),jt(i)]),n=jt(e[e.length-1]);return new this({branches:t,default:n})}async _invoke(e,t,n){let r;for(let i=0;i<this.branches.length;i+=1){let[a,s]=this.branches[i];if(await a.invoke(e,Ve(t,{callbacks:n?.getChild(`condition:${i+1}`)}))){r=await s.invoke(e,Ve(t,{callbacks:n?.getChild(`branch:${i+1}`)}));break}}return r||(r=await this.default.invoke(e,Ve(t,{callbacks:n?.getChild("branch:default")}))),r}async invoke(e,t={}){return this._callWithConfig(this._invoke,e,t)}async*_streamIterator(e,t){let n=await(await Qt(t))?.handleChainStart(this.toJSON(),$t(e,"input"),t?.runId,void 0,void 0,void 0,t?.runName),r,i=!0,a;try{for(let s=0;s<this.branches.length;s+=1){let[o,c]=this.branches[s];if(await o.invoke(e,Ve(t,{callbacks:n?.getChild(`condition:${s+1}`)}))){a=await c.stream(e,Ve(t,{callbacks:n?.getChild(`branch:${s+1}`)}));for await(let l of a)if(yield l,i)if(r===void 0)r=l;else try{r=_i(r,l)}catch{r=void 0,i=!1}break}}if(a===void 0){a=await this.default.stream(e,Ve(t,{callbacks:n?.getChild("branch:default")}));for await(let s of a)if(yield s,i)if(r===void 0)r=s;else try{r=_i(r,s)}catch{r=void 0,i=!1}}}catch(s){throw await n?.handleChainError(s),s}await n?.handleChainEnd(r??{})}},G9=class extends Si{runnable;inputMessagesKey;outputMessagesKey;historyMessagesKey;getMessageHistory;constructor(e){let t=Qn.from((a,s)=>this._enterHistory(a,s??{})).withConfig({runName:"loadHistory"}),n=e.historyMessagesKey??e.inputMessagesKey;n&&(t=Zo.assign({[n]:t}).withConfig({runName:"insertHistory"}));let r=t.pipe(e.runnable.withListeners({onEnd:(a,s)=>this._exitHistory(a,s??{})})).withConfig({runName:"RunnableWithMessageHistory"}),i=e.config??{};super({...e,config:i,bound:r}),this.runnable=e.runnable,this.getMessageHistory=e.getMessageHistory,this.inputMessagesKey=e.inputMessagesKey,this.outputMessagesKey=e.outputMessagesKey,this.historyMessagesKey=e.historyMessagesKey}_getInputMessages(e){let t;if(typeof e=="object"&&!Array.isArray(e)&&!Rt(e)){let n;this.inputMessagesKey?n=this.inputMessagesKey:Object.keys(e).length===1?n=Object.keys(e)[0]:n="input",Array.isArray(e[n])&&Array.isArray(e[n][0])?t=e[n][0]:t=e[n]}else t=e;if(typeof t=="string")return[new Vt(t)];if(Array.isArray(t))return t;if(Rt(t))return[t];throw new Error(`Expected a string, BaseMessage, or array of BaseMessages.
591
- Got ${JSON.stringify(t,null,2)}`)}_getOutputMessages(e){let t;if(!Array.isArray(e)&&!Rt(e)&&typeof e!="string"){let n;this.outputMessagesKey!==void 0?n=this.outputMessagesKey:Object.keys(e).length===1?n=Object.keys(e)[0]:n="output",e.generations!==void 0?t=e.generations[0][0].message:t=e[n]}else t=e;if(typeof t=="string")return[new Ke(t)];if(Array.isArray(t))return t;if(Rt(t))return[t];throw new Error(`Expected a string, BaseMessage, or array of BaseMessages. Received: ${JSON.stringify(t,null,2)}`)}async _enterHistory(e,t){let n=await(t?.configurable?.messageHistory).getMessages();return this.historyMessagesKey===void 0?n.concat(this._getInputMessages(e)):n}async _exitHistory(e,t){let n=t.configurable?.messageHistory,r;Array.isArray(e.inputs)&&Array.isArray(e.inputs[0])?r=e.inputs[0]:r=e.inputs;let i=this._getInputMessages(r);if(this.historyMessagesKey===void 0){let o=await n.getMessages();i=i.slice(o.length)}let a=e.outputs;if(!a)throw new Error(`Output values from 'Run' undefined. Run: ${JSON.stringify(e,null,2)}`);let s=this._getOutputMessages(a);await n.addMessages([...i,...s])}async _mergeConfig(...e){let t=await super._mergeConfig(...e);if(!t.configurable||!t.configurable.sessionId){let r={[this.inputMessagesKey??"input"]:"foo"};throw new Error(`sessionId is required. Pass it in as part of the config argument to .invoke() or .stream()
592
- eg. chain.invoke(${JSON.stringify(r)}, ${JSON.stringify({configurable:{sessionId:"123"}})})`)}let{sessionId:n}=t.configurable;return t.configurable.messageHistory=await this.getMessageHistory(n),t}},H9=Q({RouterRunnable:()=>V9,Runnable:()=>Re,RunnableAssign:()=>vv,RunnableBinding:()=>Si,RunnableBranch:()=>q9,RunnableEach:()=>W3,RunnableLambda:()=>Qn,RunnableMap:()=>Ls,RunnableParallel:()=>Y3,RunnablePassthrough:()=>Zo,RunnablePick:()=>B1,RunnableRetry:()=>yv,RunnableSequence:()=>ki,RunnableToolLike:()=>Rg,RunnableWithFallbacks:()=>F1,RunnableWithMessageHistory:()=>G9,_coerceToRunnable:()=>jt,ensureConfig:()=>De,getCallbackManagerForConfig:()=>Qt,mergeConfigs:()=>Tn,patchConfig:()=>Ve,pickRunnableConfigKeys:()=>Br,raceWithSignal:()=>vr}),J9=Q({applyPatch:()=>ss,compare:()=>bf}),Gf=class extends Re{parseResultWithPrompt(e,t,n){return this.parseResult(e,n)}_baseMessageToString(e){return typeof e.content=="string"?e.content:this._baseMessageContentToString(e.content)}_baseMessageContentToString(e){return JSON.stringify(e)}async invoke(e,t){return typeof e=="string"?this._callWithConfig(async(n,r)=>this.parseResult([{text:n}],r?.callbacks),e,{...t,runType:"parser"}):this._callWithConfig(async(n,r)=>this.parseResult([{message:n,text:this._baseMessageToString(n)}],r?.callbacks),e,{...t,runType:"parser"})}},zs=class extends Gf{parseResult(e,t){return this.parse(e[0].text,t)}async parseWithPrompt(e,t,n){return this.parse(e,n)}_type(){throw new Error("_type not implemented")}},Wn=class extends Error{llmOutput;observation;sendToLLM;constructor(e,t,n,r=!1){if(super(e),this.llmOutput=t,this.observation=n,this.sendToLLM=r,r&&(n===void 0||t===void 0))throw new Error("Arguments 'observation' & 'llmOutput' are required if 'sendToLlm' is true");fc(this,"OUTPUT_PARSING_FAILURE")}},Mc=class extends zs{async*_transform(e){for await(let t of e)typeof t=="string"?yield this.parseResult([{text:t}]):yield this.parseResult([{message:t,text:this._baseMessageToString(t)}])}async*transform(e,t){yield*this._transformStreamWithConfig(e,this._transform.bind(this),{...t,runType:"parser"})}},Dc=class extends Mc{diff=!1;constructor(e){super(e),this.diff=e?.diff??this.diff}async*_transform(e){let t,n;for await(let r of e){if(typeof r!="string"&&typeof r.content!="string")throw new Error("Cannot handle non-string output.");let i;if(Co(r)){if(typeof r.content!="string")throw new Error("Cannot handle non-string message output.");i=new Zr({message:r,text:r.content})}else if(Rt(r)){if(typeof r.content!="string")throw new Error("Cannot handle non-string message output.");i=new Zr({message:bu(r),text:r.content})}else i=new os({text:r});n===void 0?n=i:n=n.concat(i);let a=await this.parsePartialResult([n]);a!=null&&!ea(a,t)&&(this.diff?yield this._diff(t,a):yield a,t=a)}}getFormatInstructions(){return""}},W9=class extends Mc{static lc_name(){return"BytesOutputParser"}lc_namespace=["langchain_core","output_parsers","bytes"];lc_serializable=!0;textEncoder=new TextEncoder;parse(e){return Promise.resolve(this.textEncoder.encode(e))}getFormatInstructions(){return""}},Uc=class extends Mc{re;async*_transform(e){let t="";for await(let n of e)if(typeof n=="string"?t+=n:t+=n.content,this.re){let r=[...t.matchAll(this.re)];if(r.length>1){let i=0;for(let a of r.slice(0,-1))yield[a[1]],i+=(a.index??0)+a[0].length;t=t.slice(i)}}else{let r=await this.parse(t);if(r.length>1){for(let i of r.slice(0,-1))yield[i];t=r[r.length-1]}}for(let n of await this.parse(t))yield[n]}},K9=class extends Uc{static lc_name(){return"CommaSeparatedListOutputParser"}lc_namespace=["langchain_core","output_parsers","list"];lc_serializable=!0;async parse(e){try{return e.trim().split(",").map(t=>t.trim())}catch{throw new Wn(`Could not parse output: ${e}`,e)}}getFormatInstructions(){return"Your response should be a list of comma separated values, eg: `foo, bar, baz`"}},X9=class extends Uc{lc_namespace=["langchain_core","output_parsers","list"];length;separator;constructor({length:e,separator:t}){super(...arguments),this.length=e,this.separator=t||","}async parse(e){try{let t=e.trim().split(this.separator).map(n=>n.trim());if(this.length!==void 0&&t.length!==this.length)throw new Wn(`Incorrect number of items. Expected ${this.length}, got ${t.length}.`);return t}catch(t){throw Object.getPrototypeOf(t)===Wn.prototype?t:new Wn(`Could not parse output: ${e}`)}}getFormatInstructions(){return`Your response should be a list of ${this.length===void 0?"":`${this.length} `}items separated by "${this.separator}" (eg: \`foo${this.separator} bar${this.separator} baz\`)`}},Y9=class extends Uc{static lc_name(){return"NumberedListOutputParser"}lc_namespace=["langchain_core","output_parsers","list"];lc_serializable=!0;getFormatInstructions(){return`Your response should be a numbered list with each item on a new line. For example:
593
-
594
- 1. foo
595
-
596
- 2. bar
597
-
598
- 3. baz`}re=/\d+\.\s([^\n]+)/g;async parse(e){return[...e.matchAll(this.re)??[]].map(t=>t[1])}},Q9=class extends Uc{static lc_name(){return"NumberedListOutputParser"}lc_namespace=["langchain_core","output_parsers","list"];lc_serializable=!0;getFormatInstructions(){return`Your response should be a numbered list with each item on a new line. For example:
599
-
600
- 1. foo
601
-
602
- 2. bar
603
-
604
- 3. baz`}re=/^\s*[-*]\s([^\n]+)$/gm;async parse(e){return[...e.matchAll(this.re)??[]].map(t=>t[1])}},eB=class extends Mc{static lc_name(){return"StrOutputParser"}lc_namespace=["langchain_core","output_parsers","string"];lc_serializable=!0;parse(e){return Promise.resolve(e)}getFormatInstructions(){return""}_textContentToString(e){return e.text}_imageUrlContentToString(e){throw new Error('Cannot coerce a multimodal "image_url" message part into a string.')}_messageContentToString(e){switch(e.type){case"text":case"text_delta":if("text"in e)return this._textContentToString(e);break;case"image_url":if("image_url"in e)return this._imageUrlContentToString(e);break;case"reasoning":case"thinking":case"redacted_thinking":return"";default:throw new Error(`Cannot coerce "${e.type}" message part into a string.`)}throw new Error(`Invalid content type: ${e.type}`)}_baseMessageContentToString(e){return e.reduce((t,n)=>t+this._messageContentToString(n),"")}},Ov=class extends Dc{static lc_name(){return"JsonOutputParser"}lc_namespace=["langchain_core","output_parsers"];lc_serializable=!0;_concatOutputChunks(e,t){return this.diff?super._concatOutputChunks(e,t):t}_diff(e,t){if(t)return e?bf(e,t):[{op:"replace",path:"",value:t}]}async parsePartialResult(e){return vu(e[0].text)}async parse(e){return vu(e,JSON.parse)}getFormatInstructions(){return""}_baseMessageToString(e){return e.text}},sA=class extends zs{static lc_name(){return"StandardSchemaOutputParser"}lc_namespace=["langchain","output_parsers","standard_schema"];schema;constructor(e){super(),this.schema=e}static fromSerializableSchema(e){return new this(e)}async parse(e){try{let t=vu(e,JSON.parse),n=await this.schema["~standard"].validate(t);if(n.issues)throw new Error(`Validation failed: ${JSON.stringify(n.issues)}`);return n.value}catch(t){throw new Wn(`Failed to parse. Text: "${e}". Error: ${t}`,e)}}getFormatInstructions(){return""}},Av=class extends zs{static lc_name(){return"StructuredOutputParser"}lc_namespace=["langchain","output_parsers","structured"];toJSON(){return this.toJSONNotImplemented()}constructor(e){super(e),this.schema=e}static fromZodSchema(e){return new this(e)}static fromNamesAndDescriptions(e){let t=jc(Object.fromEntries(Object.entries(e).map(([n,r])=>[n,Bf().describe(r)])));return new this(t)}getFormatInstructions(){return`You must format your output as a JSON value that adheres to a given "JSON Schema" instance.
605
-
606
- "JSON Schema" is a declarative language that allows you to annotate and validate JSON documents.
607
-
608
- For example, the example "JSON Schema" instance {{"properties": {{"foo": {{"description": "a list of test words", "type": "array", "items": {{"type": "string"}}}}}}, "required": ["foo"]}}
609
- would match an object with one required property, "foo". The "type" property specifies "foo" must be an "array", and the "description" property semantically describes it as "a list of test words". The items within "foo" must be strings.
610
- Thus, the object {{"foo": ["bar", "baz"]}} is a well-formatted instance of this example "JSON Schema". The object {{"properties": {{"foo": ["bar", "baz"]}}}} is not well-formatted.
611
-
612
- Your output will be parsed and type-checked according to the provided schema instance, so make sure all fields in your output match the schema exactly and there are no trailing commas!
613
-
614
- Here is the JSON Schema instance your output must adhere to. Include the enclosing markdown codeblock:
615
- \`\`\`json
616
- ${JSON.stringify(Et(this.schema))}
617
- \`\`\`
618
- `}async parse(e){try{let t=e.trim(),n=(t.match(/^```(?:json)?\s*([\s\S]*?)```/)?.[1]||t.match(/```json\s*([\s\S]*?)```/)?.[1]||t).replace(/"([^"\\]*(\\.[^"\\]*)*)"/g,(r,i)=>`"${i.replace(/\n/g,"\\n")}"`).replace(/\n/g,"");return await Lf(this.schema,JSON.parse(n))}catch(t){throw new Wn(`Failed to parse. Text: "${e}". Error: ${t}`,e)}}},oA=class extends Av{static lc_name(){return"JsonMarkdownStructuredOutputParser"}getFormatInstructions(e){let t=e?.interpolationDepth??1;if(t<1)throw new Error("f string interpolation depth must be at least 1");return`Return a markdown code snippet with a JSON object formatted to look like:
619
- \`\`\`json
620
- ${this._schemaToInstruction(Et(this.schema)).replaceAll("{","{".repeat(t)).replaceAll("}","}".repeat(t))}
621
- \`\`\``}_schemaToInstruction(e,t=2){let n=e;if("type"in n){let r=!1,i;if(Array.isArray(n.type)){let o=n.type.findIndex(c=>c==="null");o!==-1&&(r=!0,n.type.splice(o,1)),i=n.type.join(" | ")}else i=n.type;if(n.type==="object"&&n.properties){let o=n.description?` // ${n.description}`:"";return`{
622
- ${Object.entries(n.properties).map(([c,l])=>{let u=n.required?.includes(c)?"":" (optional)";return`${" ".repeat(t)}"${c}": ${this._schemaToInstruction(l,t+2)}${u}`}).join(`
623
- `)}
624
- ${" ".repeat(t-2)}}${o}`}if(n.type==="array"&&n.items){let o=n.description?` // ${n.description}`:"";return`array[
625
- ${" ".repeat(t)}${this._schemaToInstruction(n.items,t+2)}
626
- ${" ".repeat(t-2)}] ${o}`}let a=r?" (nullable)":"",s=n.description?` // ${n.description}`:"";return`${i}${s}${a}`}if("anyOf"in n)return n.anyOf.map(r=>this._schemaToInstruction(r,t)).join(`
627
- ${" ".repeat(t-2)}`);throw new Error("unsupported schema type")}static fromZodSchema(e){return new this(e)}static fromNamesAndDescriptions(e){let t=jc(Object.fromEntries(Object.entries(e).map(([n,r])=>[n,Bf().describe(r)])));return new this(t)}},tB=class extends zs{structuredInputParser;constructor({inputSchema:e}){super(...arguments),this.structuredInputParser=new oA(e)}async parse(e){let t;try{t=await this.structuredInputParser.parse(e)}catch(n){throw new Wn(`Failed to parse. Text: "${e}". Error: ${n}`,e)}return this.outputProcessor(t)}getFormatInstructions(){return this.structuredInputParser.getFormatInstructions()}},nB=function(){let e={};e.parser=function(w,_){return new n(w,_)},e.SAXParser=n,e.SAXStream=l,e.createStream=c,e.MAX_BUFFER_LENGTH=64*1024;let t=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function n(w,_){if(!(this instanceof n))return new n(w,_);var P=this;i(P),P.q=P.c="",P.bufferCheckPosition=e.MAX_BUFFER_LENGTH,P.opt=_||{},P.opt.lowercase=P.opt.lowercase||P.opt.lowercasetags,P.looseCase=P.opt.lowercase?"toLowerCase":"toUpperCase",P.tags=[],P.closed=P.closedRoot=P.sawRoot=!1,P.tag=P.error=null,P.strict=!!w,P.noscript=!!(w||P.opt.noscript),P.state=b.BEGIN,P.strictEntities=P.opt.strictEntities,P.ENTITIES=P.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),P.attribList=[],P.opt.xmlns&&(P.ns=Object.create(p)),P.trackPosition=P.opt.position!==!1,P.trackPosition&&(P.position=P.line=P.column=0),O(P,"onready")}Object.create||(Object.create=function(w){function _(){}return _.prototype=w,new _}),Object.keys||(Object.keys=function(w){var _=[];for(var P in w)w.hasOwnProperty(P)&&_.push(P);return _});function r(w){for(var _=Math.max(e.MAX_BUFFER_LENGTH,10),P=0,I=0,Ne=t.length;I<Ne;I++){var He=w[t[I]].length;if(He>_)switch(t[I]){case"textNode":he(w);break;case"cdata":M(w,"oncdata",w.cdata),w.cdata="";break;case"script":M(w,"onscript",w.script),w.script="";break;default:V(w,"Max buffer length exceeded: "+t[I])}P=Math.max(P,He)}w.bufferCheckPosition=e.MAX_BUFFER_LENGTH-P+w.position}function i(w){for(var _=0,P=t.length;_<P;_++)w[t[_]]=""}function a(w){he(w),w.cdata!==""&&(M(w,"oncdata",w.cdata),w.cdata=""),w.script!==""&&(M(w,"onscript",w.script),w.script="")}n.prototype={end:function(){z(this)},write:Le,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){a(this)}};var s=ReadableStream;s||(s=function(){});var o=e.EVENTS.filter(function(w){return w!=="error"&&w!=="end"});function c(w,_){return new l(w,_)}function l(w,_){if(!(this instanceof l))return new l(w,_);s.apply(this),this._parser=new n(w,_),this.writable=!0,this.readable=!0;var P=this;this._parser.onend=function(){P.emit("end")},this._parser.onerror=function(I){P.emit("error",I),P._parser.error=null},this._decoder=null,o.forEach(function(I){Object.defineProperty(P,"on"+I,{get:function(){return P._parser["on"+I]},set:function(Ne){if(!Ne)return P.removeAllListeners(I),P._parser["on"+I]=Ne,Ne;P.on(I,Ne)},enumerable:!0,configurable:!1})})}l.prototype=Object.create(s.prototype,{constructor:{value:l}}),l.prototype.write=function(w){return this._parser.write(w.toString()),this.emit("data",w),!0},l.prototype.end=function(w){return w&&w.length&&this.write(w),this._parser.end(),!0},l.prototype.on=function(w,_){var P=this;return!P._parser["on"+w]&&o.indexOf(w)!==-1&&(P._parser["on"+w]=function(){var I=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);I.splice(0,0,w),P.emit.apply(P,I)}),s.prototype.on.call(P,w,_)};var u="[CDATA[",d="DOCTYPE",f="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/2000/xmlns/",p={xml:f,xmlns:h},m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,g=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function $(w){return w===" "||w===`
628
- `||w==="\r"||w===" "}function S(w){return w==='"'||w==="'"}function x(w){return w===">"||$(w)}function C(w,_){return w.test(_)}function T(w,_){return!C(w,_)}var b=0;e.STATE={BEGIN:b++,BEGIN_WHITESPACE:b++,TEXT:b++,TEXT_ENTITY:b++,OPEN_WAKA:b++,SGML_DECL:b++,SGML_DECL_QUOTED:b++,DOCTYPE:b++,DOCTYPE_QUOTED:b++,DOCTYPE_DTD:b++,DOCTYPE_DTD_QUOTED:b++,COMMENT_STARTING:b++,COMMENT:b++,COMMENT_ENDING:b++,COMMENT_ENDED:b++,CDATA:b++,CDATA_ENDING:b++,CDATA_ENDING_2:b++,PROC_INST:b++,PROC_INST_BODY:b++,PROC_INST_ENDING:b++,OPEN_TAG:b++,OPEN_TAG_SLASH:b++,ATTRIB:b++,ATTRIB_NAME:b++,ATTRIB_NAME_SAW_WHITE:b++,ATTRIB_VALUE:b++,ATTRIB_VALUE_QUOTED:b++,ATTRIB_VALUE_CLOSED:b++,ATTRIB_VALUE_UNQUOTED:b++,ATTRIB_VALUE_ENTITY_Q:b++,ATTRIB_VALUE_ENTITY_U:b++,CLOSE_TAG:b++,CLOSE_TAG_SAW_WHITE:b++,SCRIPT:b++,SCRIPT_ENDING:b++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach(function(w){var _=e.ENTITIES[w],P=typeof _=="number"?String.fromCharCode(_):_;e.ENTITIES[w]=P});for(var D in e.STATE)e.STATE[e.STATE[D]]=D;b=e.STATE;function O(w,_,P){w[_]&&w[_](P)}function M(w,_,P){w.textNode&&he(w),O(w,_,P)}function he(w){w.textNode=Me(w.opt,w.textNode),w.textNode&&O(w,"ontext",w.textNode),w.textNode=""}function Me(w,_){return w.trim&&(_=_.trim()),w.normalize&&(_=_.replace(/\s+/g," ")),_}function V(w,_){return he(w),w.trackPosition&&(_+=`
629
- Line: `+w.line+`
630
- Column: `+w.column+`
631
- Char: `+w.c),_=new Error(_),w.error=_,O(w,"onerror",_),w}function z(w){return w.sawRoot&&!w.closedRoot&&B(w,"Unclosed root tag"),w.state!==b.BEGIN&&w.state!==b.BEGIN_WHITESPACE&&w.state!==b.TEXT&&V(w,"Unexpected end"),he(w),w.c="",w.closed=!0,O(w,"onend"),n.call(w,w.strict,w.opt),w}function B(w,_){if(typeof w!="object"||!(w instanceof n))throw new Error("bad call to strictFail");w.strict&&V(w,_)}function ee(w){w.strict||(w.tagName=w.tagName[w.looseCase]());var _=w.tags[w.tags.length-1]||w,P=w.tag={name:w.tagName,attributes:{}};w.opt.xmlns&&(P.ns=_.ns),w.attribList.length=0,M(w,"onopentagstart",P)}function se(w,_){var P=w.indexOf(":")<0?["",w]:w.split(":"),I=P[0],Ne=P[1];return _&&w==="xmlns"&&(I="xmlns",Ne=""),{prefix:I,local:Ne}}function te(w){if(w.strict||(w.attribName=w.attribName[w.looseCase]()),w.attribList.indexOf(w.attribName)!==-1||w.tag.attributes.hasOwnProperty(w.attribName)){w.attribName=w.attribValue="";return}if(w.opt.xmlns){var _=se(w.attribName,!0),P=_.prefix,I=_.local;if(P==="xmlns")if(I==="xml"&&w.attribValue!==f)B(w,"xml: prefix must be bound to "+f+`
632
- Actual: `+w.attribValue);else if(I==="xmlns"&&w.attribValue!==h)B(w,"xmlns: prefix must be bound to "+h+`
633
- Actual: `+w.attribValue);else{var Ne=w.tag,He=w.tags[w.tags.length-1]||w;Ne.ns===He.ns&&(Ne.ns=Object.create(He.ns)),Ne.ns[I]=w.attribValue}w.attribList.push([w.attribName,w.attribValue])}else w.tag.attributes[w.attribName]=w.attribValue,M(w,"onattribute",{name:w.attribName,value:w.attribValue});w.attribName=w.attribValue=""}function le(w,_){if(w.opt.xmlns){var P=w.tag,I=se(w.tagName);P.prefix=I.prefix,P.local=I.local,P.uri=P.ns[I.prefix]||"",P.prefix&&!P.uri&&(B(w,"Unbound namespace prefix: "+JSON.stringify(w.tagName)),P.uri=I.prefix);var Ne=w.tags[w.tags.length-1]||w;P.ns&&Ne.ns!==P.ns&&Object.keys(P.ns).forEach(function(Ni){M(w,"onopennamespace",{prefix:Ni,uri:P.ns[Ni]})});for(var He=0,yt=w.attribList.length;He<yt;He++){var dt=w.attribList[He],Dt=dt[0],xn=dt[1],ft=se(Dt,!0),er=ft.prefix,$a=ft.local,nl=er===""?"":P.ns[er]||"",H={name:Dt,value:xn,prefix:er,local:$a,uri:nl};er&&er!=="xmlns"&&!nl&&(B(w,"Unbound namespace prefix: "+JSON.stringify(er)),H.uri=er),w.tag.attributes[Dt]=H,M(w,"onattribute",H)}w.attribList.length=0}w.tag.isSelfClosing=!!_,w.sawRoot=!0,w.tags.push(w.tag),M(w,"onopentag",w.tag),_||(!w.noscript&&w.tagName.toLowerCase()==="script"?w.state=b.SCRIPT:w.state=b.TEXT,w.tag=null,w.tagName=""),w.attribName=w.attribValue="",w.attribList.length=0}function Ee(w){if(!w.tagName){B(w,"Weird empty close tag."),w.textNode+="</>",w.state=b.TEXT;return}if(w.script){if(w.tagName!=="script"){w.script+="</"+w.tagName+">",w.tagName="",w.state=b.SCRIPT;return}M(w,"onscript",w.script),w.script=""}var _=w.tags.length,P=w.tagName;w.strict||(P=P[w.looseCase]());for(var I=P;_--&&w.tags[_].name!==I;)B(w,"Unexpected close tag");if(_<0){B(w,"Unmatched closing tag: "+w.tagName),w.textNode+="</"+w.tagName+">",w.state=b.TEXT;return}w.tagName=P;for(var Ne=w.tags.length;Ne-- >_;){var He=w.tag=w.tags.pop();w.tagName=w.tag.name,M(w,"onclosetag",w.tagName);var yt={};for(var dt in He.ns)yt[dt]=He.ns[dt];var Dt=w.tags[w.tags.length-1]||w;w.opt.xmlns&&He.ns!==Dt.ns&&Object.keys(He.ns).forEach(function(xn){var ft=He.ns[xn];M(w,"onclosenamespace",{prefix:xn,uri:ft})})}_===0&&(w.closedRoot=!0),w.tagName=w.attribValue=w.attribName="",w.attribList.length=0,w.state=b.TEXT}function be(w){var _=w.entity,P=_.toLowerCase(),I,Ne="";return w.ENTITIES[_]?w.ENTITIES[_]:w.ENTITIES[P]?w.ENTITIES[P]:(_=P,_.charAt(0)==="#"&&(_.charAt(1)==="x"?(_=_.slice(2),I=parseInt(_,16),Ne=I.toString(16)):(_=_.slice(1),I=parseInt(_,10),Ne=I.toString(10))),_=_.replace(/^0+/,""),isNaN(I)||Ne.toLowerCase()!==_?(B(w,"Invalid character entity"),"&"+w.entity+";"):String.fromCodePoint(I))}function Be(w,_){_==="<"?(w.state=b.OPEN_WAKA,w.startTagPosition=w.position):$(_)||(B(w,"Non-whitespace before first tag."),w.textNode=_,w.state=b.TEXT)}function ut(w,_){var P="";return _<w.length&&(P=w.charAt(_)),P}function Le(w){var _=this;if(this.error)throw this.error;if(_.closed)return V(_,"Cannot write after close. Assign an onready handler.");if(w===null)return z(_);typeof w=="object"&&(w=w.toString());for(var P=0,I="";I=ut(w,P++),_.c=I,!!I;)switch(_.trackPosition&&(_.position++,I===`
634
- `?(_.line++,_.column=0):_.column++),_.state){case b.BEGIN:if(_.state=b.BEGIN_WHITESPACE,I==="\uFEFF")continue;Be(_,I);continue;case b.BEGIN_WHITESPACE:Be(_,I);continue;case b.TEXT:if(_.sawRoot&&!_.closedRoot){for(var Ne=P-1;I&&I!=="<"&&I!=="&";)I=ut(w,P++),I&&_.trackPosition&&(_.position++,I===`
635
- `?(_.line++,_.column=0):_.column++);_.textNode+=w.substring(Ne,P-1)}I==="<"&&!(_.sawRoot&&_.closedRoot&&!_.strict)?(_.state=b.OPEN_WAKA,_.startTagPosition=_.position):(!$(I)&&(!_.sawRoot||_.closedRoot)&&B(_,"Text data outside of root node."),I==="&"?_.state=b.TEXT_ENTITY:_.textNode+=I);continue;case b.SCRIPT:I==="<"?_.state=b.SCRIPT_ENDING:_.script+=I;continue;case b.SCRIPT_ENDING:I==="/"?_.state=b.CLOSE_TAG:(_.script+="<"+I,_.state=b.SCRIPT);continue;case b.OPEN_WAKA:if(I==="!")_.state=b.SGML_DECL,_.sgmlDecl="";else if(!$(I))if(C(m,I))_.state=b.OPEN_TAG,_.tagName=I;else if(I==="/")_.state=b.CLOSE_TAG,_.tagName="";else if(I==="?")_.state=b.PROC_INST,_.procInstName=_.procInstBody="";else{if(B(_,"Unencoded <"),_.startTagPosition+1<_.position){var He=_.position-_.startTagPosition;I=new Array(He).join(" ")+I}_.textNode+="<"+I,_.state=b.TEXT}continue;case b.SGML_DECL:(_.sgmlDecl+I).toUpperCase()===u?(M(_,"onopencdata"),_.state=b.CDATA,_.sgmlDecl="",_.cdata=""):_.sgmlDecl+I==="--"?(_.state=b.COMMENT,_.comment="",_.sgmlDecl=""):(_.sgmlDecl+I).toUpperCase()===d?(_.state=b.DOCTYPE,(_.doctype||_.sawRoot)&&B(_,"Inappropriately located doctype declaration"),_.doctype="",_.sgmlDecl=""):I===">"?(M(_,"onsgmldeclaration",_.sgmlDecl),_.sgmlDecl="",_.state=b.TEXT):(S(I)&&(_.state=b.SGML_DECL_QUOTED),_.sgmlDecl+=I);continue;case b.SGML_DECL_QUOTED:I===_.q&&(_.state=b.SGML_DECL,_.q=""),_.sgmlDecl+=I;continue;case b.DOCTYPE:I===">"?(_.state=b.TEXT,M(_,"ondoctype",_.doctype),_.doctype=!0):(_.doctype+=I,I==="["?_.state=b.DOCTYPE_DTD:S(I)&&(_.state=b.DOCTYPE_QUOTED,_.q=I));continue;case b.DOCTYPE_QUOTED:_.doctype+=I,I===_.q&&(_.q="",_.state=b.DOCTYPE);continue;case b.DOCTYPE_DTD:_.doctype+=I,I==="]"?_.state=b.DOCTYPE:S(I)&&(_.state=b.DOCTYPE_DTD_QUOTED,_.q=I);continue;case b.DOCTYPE_DTD_QUOTED:_.doctype+=I,I===_.q&&(_.state=b.DOCTYPE_DTD,_.q="");continue;case b.COMMENT:I==="-"?_.state=b.COMMENT_ENDING:_.comment+=I;continue;case b.COMMENT_ENDING:I==="-"?(_.state=b.COMMENT_ENDED,_.comment=Me(_.opt,_.comment),_.comment&&M(_,"oncomment",_.comment),_.comment=""):(_.comment+="-"+I,_.state=b.COMMENT);continue;case b.COMMENT_ENDED:I!==">"?(B(_,"Malformed comment"),_.comment+="--"+I,_.state=b.COMMENT):_.state=b.TEXT;continue;case b.CDATA:I==="]"?_.state=b.CDATA_ENDING:_.cdata+=I;continue;case b.CDATA_ENDING:I==="]"?_.state=b.CDATA_ENDING_2:(_.cdata+="]"+I,_.state=b.CDATA);continue;case b.CDATA_ENDING_2:I===">"?(_.cdata&&M(_,"oncdata",_.cdata),M(_,"onclosecdata"),_.cdata="",_.state=b.TEXT):I==="]"?_.cdata+="]":(_.cdata+="]]"+I,_.state=b.CDATA);continue;case b.PROC_INST:I==="?"?_.state=b.PROC_INST_ENDING:$(I)?_.state=b.PROC_INST_BODY:_.procInstName+=I;continue;case b.PROC_INST_BODY:if(!_.procInstBody&&$(I))continue;I==="?"?_.state=b.PROC_INST_ENDING:_.procInstBody+=I;continue;case b.PROC_INST_ENDING:I===">"?(M(_,"onprocessinginstruction",{name:_.procInstName,body:_.procInstBody}),_.procInstName=_.procInstBody="",_.state=b.TEXT):(_.procInstBody+="?"+I,_.state=b.PROC_INST_BODY);continue;case b.OPEN_TAG:C(v,I)?_.tagName+=I:(ee(_),I===">"?le(_):I==="/"?_.state=b.OPEN_TAG_SLASH:($(I)||B(_,"Invalid character in tag name"),_.state=b.ATTRIB));continue;case b.OPEN_TAG_SLASH:I===">"?(le(_,!0),Ee(_)):(B(_,"Forward-slash in opening tag not followed by >"),_.state=b.ATTRIB);continue;case b.ATTRIB:if($(I))continue;I===">"?le(_):I==="/"?_.state=b.OPEN_TAG_SLASH:C(m,I)?(_.attribName=I,_.attribValue="",_.state=b.ATTRIB_NAME):B(_,"Invalid attribute name");continue;case b.ATTRIB_NAME:I==="="?_.state=b.ATTRIB_VALUE:I===">"?(B(_,"Attribute without value"),_.attribValue=_.attribName,te(_),le(_)):$(I)?_.state=b.ATTRIB_NAME_SAW_WHITE:C(v,I)?_.attribName+=I:B(_,"Invalid attribute name");continue;case b.ATTRIB_NAME_SAW_WHITE:if(I==="=")_.state=b.ATTRIB_VALUE;else{if($(I))continue;B(_,"Attribute without value"),_.tag.attributes[_.attribName]="",_.attribValue="",M(_,"onattribute",{name:_.attribName,value:""}),_.attribName="",I===">"?le(_):C(m,I)?(_.attribName=I,_.state=b.ATTRIB_NAME):(B(_,"Invalid attribute name"),_.state=b.ATTRIB)}continue;case b.ATTRIB_VALUE:if($(I))continue;S(I)?(_.q=I,_.state=b.ATTRIB_VALUE_QUOTED):(B(_,"Unquoted attribute value"),_.state=b.ATTRIB_VALUE_UNQUOTED,_.attribValue=I);continue;case b.ATTRIB_VALUE_QUOTED:if(I!==_.q){I==="&"?_.state=b.ATTRIB_VALUE_ENTITY_Q:_.attribValue+=I;continue}te(_),_.q="",_.state=b.ATTRIB_VALUE_CLOSED;continue;case b.ATTRIB_VALUE_CLOSED:$(I)?_.state=b.ATTRIB:I===">"?le(_):I==="/"?_.state=b.OPEN_TAG_SLASH:C(m,I)?(B(_,"No whitespace between attributes"),_.attribName=I,_.attribValue="",_.state=b.ATTRIB_NAME):B(_,"Invalid attribute name");continue;case b.ATTRIB_VALUE_UNQUOTED:if(!x(I)){I==="&"?_.state=b.ATTRIB_VALUE_ENTITY_U:_.attribValue+=I;continue}te(_),I===">"?le(_):_.state=b.ATTRIB;continue;case b.CLOSE_TAG:if(_.tagName)I===">"?Ee(_):C(v,I)?_.tagName+=I:_.script?(_.script+="</"+_.tagName,_.tagName="",_.state=b.SCRIPT):($(I)||B(_,"Invalid tagname in closing tag"),_.state=b.CLOSE_TAG_SAW_WHITE);else{if($(I))continue;T(m,I)?_.script?(_.script+="</"+I,_.state=b.SCRIPT):B(_,"Invalid tagname in closing tag."):_.tagName=I}continue;case b.CLOSE_TAG_SAW_WHITE:if($(I))continue;I===">"?Ee(_):B(_,"Invalid characters in closing tag");continue;case b.TEXT_ENTITY:case b.ATTRIB_VALUE_ENTITY_Q:case b.ATTRIB_VALUE_ENTITY_U:var yt,dt;switch(_.state){case b.TEXT_ENTITY:yt=b.TEXT,dt="textNode";break;case b.ATTRIB_VALUE_ENTITY_Q:yt=b.ATTRIB_VALUE_QUOTED,dt="attribValue";break;case b.ATTRIB_VALUE_ENTITY_U:yt=b.ATTRIB_VALUE_UNQUOTED,dt="attribValue";break}if(I===";")if(_.opt.unparsedEntities){var Dt=be(_);_.entity="",_.state=yt,_.write(Dt)}else _[dt]+=be(_),_.entity="",_.state=yt;else C(_.entity.length?y:g,I)?_.entity+=I:(B(_,"Invalid character in entity name"),_[dt]+="&"+_.entity+I,_.entity="",_.state=yt);continue;default:throw new Error(_,"Unknown state: "+_.state)}return _.position>=_.bufferCheckPosition&&r(_),_}return String.fromCodePoint||(function(){var w=String.fromCharCode,_=Math.floor,P=function(){var I=16384,Ne=[],He,yt,dt=-1,Dt=arguments.length;if(!Dt)return"";for(var xn="";++dt<Dt;){var ft=Number(arguments[dt]);if(!isFinite(ft)||ft<0||ft>1114111||_(ft)!==ft)throw RangeError("Invalid code point: "+ft);ft<=65535?Ne.push(ft):(ft-=65536,He=(ft>>10)+55296,yt=ft%1024+56320,Ne.push(He,yt)),(dt+1===Dt||Ne.length>I)&&(xn+=w.apply(null,Ne),Ne.length=0)}return xn};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:P,configurable:!0,writable:!0}):String.fromCodePoint=P})(),e},rB=nB(),Dg=`The output should be formatted as a XML file.
636
- 1. Output should conform to the tags below.
637
- 2. If tags are not given, make them on your own.
638
- 3. Remember to always open and close all the tags.
639
-
640
- As an example, for the tags ["foo", "bar", "baz"]:
641
- 1. String "<foo>
642
- <bar>
643
- <baz></baz>
644
- </bar>
645
- </foo>" is a well-formatted instance of the schema.
646
- 2. String "<foo>
647
- <bar>
648
- </foo>" is a badly-formatted instance.
649
- 3. String "<foo>
650
- <tag>
651
- </tag>
652
- </foo>" is a badly-formatted instance.
653
-
654
- Here are the output tags:
655
- \`\`\`
656
- {tags}
657
- \`\`\``,iB=class extends Dc{tags;constructor(e){super(e),this.tags=e?.tags}static lc_name(){return"XMLOutputParser"}lc_namespace=["langchain_core","output_parsers"];lc_serializable=!0;_diff(e,t){if(t)return e?bf(e,t):[{op:"replace",path:"",value:t}]}async parsePartialResult(e){return Ug(e[0].text)}async parse(e){return Ug(e)}getFormatInstructions(){return this.tags&&this.tags.length>0?Dg.replace("{tags}",this.tags?.join(", ")??""):Dg}},aB=e=>e.split(`
658
- `).map(t=>t.replace(/^\s+/,"")).join(`
659
- `).trim(),cA=e=>{if(Object.keys(e).length===0)return{};let t={};return e.children.length>0?(t[e.name]=e.children.map(cA),t):(t[e.name]=e.text??void 0,t)};function Ug(e){let t=aB(e),n=rB.parser(!0),r={},i=[];n.onopentag=o=>{let c={name:o.name,attributes:o.attributes,children:[],text:"",isSelfClosing:o.isSelfClosing};i.length>0?i[i.length-1].children.push(c):r=c,o.isSelfClosing||i.push(c)},n.onclosetag=()=>{if(i.length>0){let o=i.pop();i.length===0&&o&&(r=o)}},n.ontext=o=>{if(i.length>0){let c=i[i.length-1];c.text+=o}},n.onattribute=o=>{if(i.length>0){let c=i[i.length-1];c.attributes[o.name]=o.value}};let a=/```(xml)?(.*)```/s.exec(t),s=a?a[2]:t;return n.write(s).close(),r&&r.name==="?xml"&&(r=r.children[0]),cA(r)}var sB=Q({AsymmetricStructuredOutputParser:()=>tB,BaseCumulativeTransformOutputParser:()=>Dc,BaseLLMOutputParser:()=>Gf,BaseOutputParser:()=>zs,BaseTransformOutputParser:()=>Mc,BytesOutputParser:()=>W9,CommaSeparatedListOutputParser:()=>K9,CustomListOutputParser:()=>X9,JsonMarkdownStructuredOutputParser:()=>oA,JsonOutputParser:()=>Ov,ListOutputParser:()=>Uc,MarkdownListOutputParser:()=>Q9,NumberedListOutputParser:()=>Y9,OutputParserException:()=>Wn,StandardSchemaOutputParser:()=>sA,StringOutputParser:()=>eB,StructuredOutputParser:()=>Av,XMLOutputParser:()=>iB,XML_FORMAT_INSTRUCTIONS:()=>Dg,parseJsonMarkdown:()=>vu,parsePartialJson:()=>ns,parseXMLMarkdown:()=>Ug}),oB=Q({extendInteropZodObject:()=>m1,getInteropZodDefaultGetter:()=>g1,getInteropZodObjectShape:()=>zo,getSchemaDescription:()=>gs,interopParse:()=>Kl,interopParseAsync:()=>Lf,interopSafeParse:()=>ZF,interopSafeParseAsync:()=>f1,interopZodObjectMakeFieldsOptional:()=>HF,interopZodObjectPartial:()=>mv,interopZodObjectPassthrough:()=>yg,interopZodObjectStrict:()=>ju,interopZodTransformInputSchema:()=>_1,isInteropZodError:()=>y1,isInteropZodLiteral:()=>BF,isInteropZodObject:()=>En,isInteropZodSchema:()=>bn,isShapelessZodSchema:()=>VF,isSimpleStringZodSchema:()=>pv,isZodArrayV4:()=>Ff,isZodLiteralV3:()=>u1,isZodLiteralV4:()=>d1,isZodNullableV4:()=>p1,isZodObjectV3:()=>zf,isZodObjectV4:()=>mr,isZodOptionalV4:()=>h1,isZodSchema:()=>FF,isZodSchemaV3:()=>_t,isZodSchemaV4:()=>it});function Hf(e,t){if(e.function===void 0)return;let n;if(t?.partial)try{n=ns(e.function.arguments??"{}")}catch{return}else try{n=JSON.parse(e.function.arguments)}catch(i){throw new Wn([`Function "${e.function.name}" arguments:`,"",e.function.arguments,"","are not valid JSON.",`Error: ${i.message}`].join(`
660
- `))}let r={name:e.function.name,args:n,type:"tool_call"};return t?.returnId&&(r.id=e.id),r}function lA(e){if(e.id===void 0)throw new Error('All OpenAI tool calls must have an "id" field.');return{id:e.id,type:"function",function:{name:e.name,arguments:JSON.stringify(e.args)}}}function So(e,t){return{name:e.function?.name,args:e.function?.arguments,id:e.id,error:t,type:"invalid_tool_call"}}var uA=class extends Dc{static lc_name(){return"JsonOutputToolsParser"}returnId=!1;lc_namespace=["langchain","output_parsers","openai_tools"];lc_serializable=!0;constructor(e){super(e),this.returnId=e?.returnId??this.returnId}_diff(){throw new Error("Not supported.")}async parse(){throw new Error("Not implemented.")}async parseResult(e){return await this.parsePartialResult(e,!1)}async parsePartialResult(e,t=!0){let n=e[0].message,r;if(hf(n)&&n.tool_calls?.length?r=n.tool_calls.map(a=>{let{id:s,...o}=a;return this.returnId?{id:s,...o}:o}):n.additional_kwargs.tool_calls!==void 0&&(r=JSON.parse(JSON.stringify(n.additional_kwargs.tool_calls)).map(a=>Hf(a,{returnId:this.returnId,partial:t}))),!r)return[];let i=[];for(let a of r)if(a!==void 0){let s={type:a.name,args:a.args,id:a.id};i.push(s)}return i}},dA=class extends uA{static lc_name(){return"JsonOutputKeyToolsParser"}lc_namespace=["langchain","output_parsers","openai_tools"];lc_serializable=!0;returnId=!1;keyName;returnSingle=!1;zodSchema;serializableSchema;constructor(e){super(e),this.keyName=e.keyName,this.returnSingle=e.returnSingle??this.returnSingle,"zodSchema"in e&&(this.zodSchema=e.zodSchema),"serializableSchema"in e&&(this.serializableSchema=e.serializableSchema)}async _validateResult(e){if(this.serializableSchema!==void 0){let n=await this.serializableSchema["~standard"].validate(e);if(n.issues)throw new Wn(`Failed to parse. Text: "${JSON.stringify(e,null,2)}". Error: ${JSON.stringify(n.issues)}`,JSON.stringify(e,null,2));return n.value}if(this.zodSchema===void 0)return e;let t=await f1(this.zodSchema,e);if(t.success)return t.data;throw new Wn(`Failed to parse. Text: "${JSON.stringify(e,null,2)}". Error: ${JSON.stringify(t.error?.issues)}`,JSON.stringify(e,null,2))}async parsePartialResult(e){let t=(await super.parsePartialResult(e)).filter(r=>r.type===this.keyName),n=t;if(t.length)return this.returnId||(n=t.map(r=>r.args)),this.returnSingle?n[0]:n}async parseResult(e){let t=(await super.parsePartialResult(e,!1)).filter(r=>r.type===this.keyName),n=t;if(t.length)return this.returnId||(n=t.map(r=>r.args)),this.returnSingle?this._validateResult(n[0]):await Promise.all(n.map(r=>this._validateResult(r)))}},cB=Q({assembleStructuredOutputPipeline:()=>Cv,createContentParser:()=>Lg,createFunctionCallingParser:()=>fA});function Lg(e){return bn(e)?Av.fromZodSchema(e):aa(e)?sA.fromSerializableSchema(e):new Ov}function fA(e,t,n){let r=n??dA;return bn(e)?new r({returnSingle:!0,keyName:t,zodSchema:e}):aa(e)?new r({returnSingle:!0,keyName:t,serializableSchema:e}):new r({returnSingle:!0,keyName:t})}function Cv(e,t,n,r){if(!n){let c=e.pipe(t);return r?c.withConfig({runName:r}):c}let i=Zo.assign({parsed:(c,l)=>t.invoke(c.raw,l)}),a=Zo.assign({parsed:()=>null}),s=i.withFallbacks({fallbacks:[a]}),o=ki.from([{raw:e},s]);return r?o.withConfig({runName:r}):o}var lB=e=>e();function am(e){let t=e.constructor;return new t({...e,content:e.contentBlocks,response_metadata:{...e.response_metadata,output_version:"v1"}})}var uB=Q({BaseChatModel:()=>va,SimpleChatModel:()=>dB});function sm(e){let t=[];for(let n of e){let r=n;if(Array.isArray(n.content))for(let i=0;i<n.content.length;i++){let a=n.content[i];(D_(a)||U_(a))&&r===n&&(r=new n.constructor({...r,content:[...n.content.slice(0,i),Gk(a),...n.content.slice(i+1)]}))}t.push(r)}return t}var va=class Mi extends Tv{lc_namespace=["langchain","chat_models",this._llmType()];disableStreaming=!1;outputVersion;get callKeys(){return[...super.callKeys,"outputVersion"]}constructor(t){super(t),this.outputVersion=lB(()=>{let n=t.outputVersion??wn("LC_OUTPUT_VERSION");return n&&["v0","v1"].includes(n)?n:"v0"})}_separateRunnableConfigFromCallOptionsCompat(t){let[n,r]=super._separateRunnableConfigFromCallOptions(t);return r.signal=n.signal,[n,r]}async invoke(t,n){let r=Mi._convertInputToPromptValue(t);return(await this.generatePrompt([r],n,n?.callbacks)).generations[0][0].message}async*_streamResponseChunks(t,n,r){throw new Error("Not implemented.")}async*_streamIterator(t,n){if(this._streamResponseChunks===Mi.prototype._streamResponseChunks||this.disableStreaming)yield this.invoke(t,n);else{let r=Mi._convertInputToPromptValue(t).toChatMessages(),[i,a]=this._separateRunnableConfigFromCallOptionsCompat(n),s={...i.metadata,...this.getLsParamsWithDefaults(a)},o=await Yt.configure(i.callbacks,this.callbacks,i.tags,this.tags,s,this.metadata,{verbose:this.verbose}),c={options:a,invocation_params:this?.invocationParams(a),batch_size:1},l=a.outputVersion??this.outputVersion,u=await o?.handleChatModelStart(this.toJSON(),[sm(r)],i.runId,void 0,c,void 0,void 0,i.runName),d,f;try{for await(let h of this._streamResponseChunks(r,a,u?.[0])){if(a.signal?.throwIfAborted(),h.message.id==null){let p=u?.at(0)?.runId;p!=null&&h.message._updateId(`run-${p}`)}h.message.response_metadata={...h.generationInfo,...h.message.response_metadata},l==="v1"?yield am(h.message):yield h.message,d?d=d.concat(h):d=h,zm(h.message)&&h.message.usage_metadata!==void 0&&(f={tokenUsage:{promptTokens:h.message.usage_metadata.input_tokens,completionTokens:h.message.usage_metadata.output_tokens,totalTokens:h.message.usage_metadata.total_tokens}})}a.signal?.throwIfAborted()}catch(h){throw await Promise.all((u??[]).map(p=>p?.handleLLMError(h))),h}await Promise.all((u??[]).map(h=>h?.handleLLMEnd({generations:[[d]],llmOutput:f})))}}getLsParams(t){let n=this.getName().startsWith("Chat")?this.getName().replace("Chat",""):this.getName();return{ls_model_type:"chat",ls_stop:t.stop,ls_provider:n}}getLsParamsWithDefaults(t){return{...this.getLsParams(t),ls_integration:"langchain_chat_model"}}async _generateUncached(t,n,r,i){let a=t.map(d=>d.map(pr)),s;if(i!==void 0&&i.length===a.length)s=i;else{let d={...r.metadata,...this.getLsParamsWithDefaults(n)},f=await Yt.configure(r.callbacks,this.callbacks,r.tags,this.tags,d,this.metadata,{verbose:this.verbose}),h={options:n,invocation_params:this?.invocationParams(n),batch_size:1};s=await f?.handleChatModelStart(this.toJSON(),a.map(sm),r.runId,void 0,h,void 0,void 0,r.runName)}let o=n.outputVersion??this.outputVersion,c=[],l=[];if(s?.[0].handlers.find(K_)&&!this.disableStreaming&&a.length===1&&this._streamResponseChunks!==Mi.prototype._streamResponseChunks)try{let d=await this._streamResponseChunks(a[0],n,s?.[0]),f,h;for await(let p of d){if(n.signal?.aborted){let m=f?.message;throw new Um("Model invocation was aborted.",m)}if(p.message.id==null){let m=s?.at(0)?.runId;m!=null&&p.message._updateId(`run-${m}`)}f===void 0?f=p:f=_i(f,p),zm(p.message)&&p.message.usage_metadata!==void 0&&(h={tokenUsage:{promptTokens:p.message.usage_metadata.input_tokens,completionTokens:p.message.usage_metadata.output_tokens,totalTokens:p.message.usage_metadata.total_tokens}})}if(n.signal?.aborted){let p=f?.message;throw new Um("Model invocation was aborted.",p)}if(f===void 0)throw new Error("Received empty response from chat model call.");c.push([f]),await s?.[0].handleLLMEnd({generations:c,llmOutput:h})}catch(d){throw await s?.[0].handleLLMError(d),d}else{let d=await Promise.allSettled(a.map(async(f,h)=>{let p=await this._generate(f,{...n,promptIndex:h},s?.[h]);if(o==="v1")for(let m of p.generations)m.message=am(m.message);return p}));await Promise.all(d.map(async(f,h)=>{if(f.status==="fulfilled"){let p=f.value;for(let m of p.generations){if(m.message.id==null){let v=s?.at(0)?.runId;v!=null&&m.message._updateId(`run-${v}`)}m.message.response_metadata={...m.generationInfo,...m.message.response_metadata}}return p.generations.length===1&&(p.generations[0].message.response_metadata={...p.llmOutput,...p.generations[0].message.response_metadata}),c[h]=p.generations,l[h]=p.llmOutput,s?.[h]?.handleLLMEnd({generations:[p.generations],llmOutput:p.llmOutput})}else return await s?.[h]?.handleLLMError(f.reason),Promise.reject(f.reason)}))}let u={generations:c,llmOutput:l.length?this._combineLLMOutput?.(...l):void 0};return Object.defineProperty(u,Mo,{value:s?{runIds:s?.map(d=>d.runId)}:void 0,configurable:!0}),u}async _generateCached({messages:t,cache:n,llmStringKey:r,parsedOptions:i,handledOptions:a}){let s=t.map(v=>v.map(pr)),o={...a.metadata,...this.getLsParamsWithDefaults(i)},c=await Yt.configure(a.callbacks,this.callbacks,a.tags,this.tags,o,this.metadata,{verbose:this.verbose}),l={options:i,invocation_params:this?.invocationParams(i),batch_size:1},u=await c?.handleChatModelStart(this.toJSON(),s.map(sm),a.runId,void 0,l,void 0,void 0,a.runName),d=[],f=(await Promise.allSettled(s.map(async(v,g)=>{let y=Mi._convertInputToPromptValue(v).toString(),$=await n.lookup(y,r);return $==null&&d.push(g),$}))).map((v,g)=>({result:v,runManager:u?.[g]})).filter(({result:v})=>v.status==="fulfilled"&&v.value!=null||v.status==="rejected"),h=i.outputVersion??this.outputVersion,p=[];await Promise.all(f.map(async({result:v,runManager:g},y)=>{if(v.status==="fulfilled"){let $=v.value;return p[y]=$.map(S=>("message"in S&&Rt(S.message)&&hf(S.message)&&(S.message.usage_metadata={input_tokens:0,output_tokens:0,total_tokens:0},h==="v1"&&(S.message=am(S.message))),S.generationInfo={...S.generationInfo,tokenUsage:{}},S)),$.length&&await g?.handleLLMNewToken($[0].text),g?.handleLLMEnd({generations:[$]},void 0,void 0,void 0,{cached:!0})}else return await g?.handleLLMError(v.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject(v.reason)}));let m={generations:p,missingPromptIndices:d,startedRunManagers:u};return Object.defineProperty(m,Mo,{value:u?{runIds:u?.map(v=>v.runId)}:void 0,configurable:!0}),m}async generate(t,n,r){let i;Array.isArray(n)?i={stop:n}:i=n;let a=t.map(p=>p.map(pr)),[s,o]=this._separateRunnableConfigFromCallOptionsCompat(i);if(s.callbacks=s.callbacks??r,!this.cache)return this._generateUncached(a,o,s);let{cache:c}=this,l=this._getSerializedCacheKeyParametersForCall(o),{generations:u,missingPromptIndices:d,startedRunManagers:f}=await this._generateCached({messages:a,cache:c,llmStringKey:l,parsedOptions:o,handledOptions:s}),h={};if(d.length>0){let p=await this._generateUncached(d.map(m=>a[m]),o,s,f!==void 0?d.map(m=>f?.[m]):void 0);await Promise.all(p.generations.map(async(m,v)=>{let g=d[v];u[g]=m;let y=Mi._convertInputToPromptValue(a[g]).toString();return c.update(y,l,m)})),h=p.llmOutput??{}}return{generations:u,llmOutput:h}}invocationParams(t){return{}}_modelType(){return"base_chat_model"}async generatePrompt(t,n,r){let i=t.map(a=>a.toChatMessages());return this.generate(i,n,r)}withStructuredOutput(t,n){if(typeof this.bindTools!="function")throw new Error('Chat model must implement ".bindTools()" to use withStructuredOutput.');if(n?.strict)throw new Error('"strict" mode is not supported for this model by default.');let r=t,i=n?.name,a=gs(r)??"A function available to call.",s=n?.method,o=n?.includeRaw;if(s==="jsonMode")throw new Error('Base withStructuredOutput implementation only supports "functionCalling" as a method.');let c=i??"extract";!bn(r)&&!aa(r)&&"name"in r&&(c=r.name);let l=bn(r)||aa(r)?Et(r):r,u=[{type:"function",function:{name:c,description:a,parameters:l}}];return Cv(this.bindTools(u),Qn.from(d=>{if(!un.isInstance(d))throw new Error("Input is not an AIMessageChunk.");if(!d.tool_calls||d.tool_calls.length===0)throw new Error("No tool calls found in the response.");let f=d.tool_calls.find(h=>h.name===c);if(!f)throw new Error(`No tool call found with name ${c}.`);return f.args}),o,o?"StructuredOutputRunnable":"StructuredOutput")}},dB=class extends va{async _generate(e,t,n){let r=new Ke(await this._call(e,t,n));if(typeof r.content!="string")throw new Error("Cannot generate with a simple chat model when output is not a string.");return{generations:[{text:r.content,message:r}]}}},fB=Q({BaseLLM:()=>hA,LLM:()=>Nv}),hA=class io extends Tv{lc_namespace=["langchain","llms",this._llmType()];async invoke(t,n){let r=io._convertInputToPromptValue(t);return(await this.generatePrompt([r],n,n?.callbacks)).generations[0][0].text}async*_streamResponseChunks(t,n,r){throw new Error("Not implemented.")}_separateRunnableConfigFromCallOptionsCompat(t){let[n,r]=super._separateRunnableConfigFromCallOptions(t);return r.signal=n.signal,[n,r]}async*_streamIterator(t,n){if(this._streamResponseChunks===io.prototype._streamResponseChunks)yield this.invoke(t,n);else{let r=io._convertInputToPromptValue(t),[i,a]=this._separateRunnableConfigFromCallOptionsCompat(n),s=await Yt.configure(i.callbacks,this.callbacks,i.tags,this.tags,i.metadata,this.metadata,{verbose:this.verbose}),o={options:a,invocation_params:this?.invocationParams(a),batch_size:1},c=await s?.handleLLMStart(this.toJSON(),[r.toString()],i.runId,void 0,o,void 0,void 0,i.runName),l=new os({text:""});try{for await(let u of this._streamResponseChunks(r.toString(),a,c?.[0]))l?l=l.concat(u):l=u,typeof u.text=="string"&&(yield u.text)}catch(u){throw await Promise.all((c??[]).map(d=>d?.handleLLMError(u))),u}await Promise.all((c??[]).map(u=>u?.handleLLMEnd({generations:[[l]]})))}}async generatePrompt(t,n,r){let i=t.map(a=>a.toString());return this.generate(i,n,r)}invocationParams(t){return{}}_flattenLLMResult(t){let n=[];for(let r=0;r<t.generations.length;r+=1){let i=t.generations[r];if(r===0)n.push({generations:[i],llmOutput:t.llmOutput});else{let a=t.llmOutput?{...t.llmOutput,tokenUsage:{}}:void 0;n.push({generations:[i],llmOutput:a})}}return n}async _generateUncached(t,n,r,i){let a;if(i!==void 0&&i.length===t.length)a=i;else{let l=await Yt.configure(r.callbacks,this.callbacks,r.tags,this.tags,r.metadata,this.metadata,{verbose:this.verbose}),u={options:n,invocation_params:this?.invocationParams(n),batch_size:t.length};a=await l?.handleLLMStart(this.toJSON(),t,r.runId,void 0,u,void 0,void 0,r?.runName)}let s=!!a?.[0].handlers.find(K_),o;if(s&&t.length===1&&this._streamResponseChunks!==io.prototype._streamResponseChunks)try{let l=await this._streamResponseChunks(t[0],n,a?.[0]),u;for await(let d of l)u===void 0?u=d:u=_i(u,d);if(u===void 0)throw new Error("Received empty response from chat model call.");o={generations:[[u]],llmOutput:{}},await a?.[0].handleLLMEnd(o)}catch(l){throw await a?.[0].handleLLMError(l),l}else{try{o=await this._generate(t,n,a?.[0])}catch(u){throw await Promise.all((a??[]).map(d=>d?.handleLLMError(u))),u}let l=this._flattenLLMResult(o);await Promise.all((a??[]).map((u,d)=>u?.handleLLMEnd(l[d])))}let c=a?.map(l=>l.runId)||void 0;return Object.defineProperty(o,Mo,{value:c?{runIds:c}:void 0,configurable:!0}),o}async _generateCached({prompts:t,cache:n,llmStringKey:r,parsedOptions:i,handledOptions:a,runId:s}){let o=await Yt.configure(a.callbacks,this.callbacks,a.tags,this.tags,a.metadata,this.metadata,{verbose:this.verbose}),c={options:i,invocation_params:this?.invocationParams(i),batch_size:t.length},l=await o?.handleLLMStart(this.toJSON(),t,s,void 0,c,void 0,void 0,a?.runName),u=[],d=(await Promise.allSettled(t.map(async(p,m)=>{let v=await n.lookup(p,r);return v==null&&u.push(m),v}))).map((p,m)=>({result:p,runManager:l?.[m]})).filter(({result:p})=>p.status==="fulfilled"&&p.value!=null||p.status==="rejected"),f=[];await Promise.all(d.map(async({result:p,runManager:m},v)=>{if(p.status==="fulfilled"){let g=p.value;return f[v]=g.map(y=>(y.generationInfo={...y.generationInfo,tokenUsage:{}},y)),g.length&&await m?.handleLLMNewToken(g[0].text),m?.handleLLMEnd({generations:[g]},void 0,void 0,void 0,{cached:!0})}else return await m?.handleLLMError(p.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject(p.reason)}));let h={generations:f,missingPromptIndices:u,startedRunManagers:l};return Object.defineProperty(h,Mo,{value:l?{runIds:l?.map(p=>p.runId)}:void 0,configurable:!0}),h}async generate(t,n,r){if(!Array.isArray(t))throw new Error("Argument 'prompts' is expected to be a string[]");let i;Array.isArray(n)?i={stop:n}:i=n;let[a,s]=this._separateRunnableConfigFromCallOptionsCompat(i);if(a.callbacks=a.callbacks??r,!this.cache)return this._generateUncached(t,s,a);let{cache:o}=this,c=this._getSerializedCacheKeyParametersForCall(s),{generations:l,missingPromptIndices:u,startedRunManagers:d}=await this._generateCached({prompts:t,cache:o,llmStringKey:c,parsedOptions:s,handledOptions:a,runId:a.runId}),f={};if(u.length>0){let h=await this._generateUncached(u.map(p=>t[p]),s,a,d!==void 0?u.map(p=>d?.[p]):void 0);await Promise.all(h.generations.map(async(p,m)=>{let v=u[m];return l[v]=p,o.update(t[v],c,p)})),f=h.llmOutput??{}}return{generations:l,llmOutput:f}}_identifyingParams(){return{}}_modelType(){return"base_llm"}},Nv=class extends hA{async _generate(e,t,n){return{generations:await Promise.all(e.map((r,i)=>this._call(r,{...t,promptIndex:i},n).then(a=>[{text:a}])))}}},hB=Q({}),pB=Q({BaseMemory:()=>mB,getInputValue:()=>gB,getOutputValue:()=>_B,getPromptInputKey:()=>yB}),mB=class{},pA=(e,t)=>{if(t!==void 0)return e[t];let n=Object.keys(e);if(n.length===1)return e[n[0]]},gB=(e,t)=>{let n=pA(e,t);if(!n){let r=Object.keys(e);throw new Error(`input values have ${r.length} keys, you must specify an input key or pass only 1 key as input`)}return n},_B=(e,t)=>{let n=pA(e,t);if(!n&&n!==""){let r=Object.keys(e);throw new Error(`output values have ${r.length} keys, you must specify an output key or pass only 1 key as output`)}return n};function yB(e,t){let n=Object.keys(e).filter(r=>!t.includes(r)&&r!=="stop");if(n.length!==1)throw new Error(`One input key expected, but got ${n.length}`);return n[0]}var mA=class extends Gf{static lc_name(){return"OutputFunctionsParser"}lc_namespace=["langchain","output_parsers","openai_functions"];lc_serializable=!0;argsOnly=!0;constructor(e){super(),this.argsOnly=e?.argsOnly??this.argsOnly}async parseResult(e){if("message"in e[0]){let t=e[0].message.additional_kwargs.function_call;if(!t)throw new Error(`No function_call in message ${JSON.stringify(e)}`);if(!t.arguments)throw new Error(`No arguments in function_call ${JSON.stringify(e)}`);return this.argsOnly?t.arguments:JSON.stringify(t)}else throw new Error(`No message in generations ${JSON.stringify(e)}`)}},gA=class extends Dc{static lc_name(){return"JsonOutputFunctionsParser"}lc_namespace=["langchain","output_parsers","openai_functions"];lc_serializable=!0;outputParser;argsOnly=!0;constructor(e){super(e),this.argsOnly=e?.argsOnly??this.argsOnly,this.outputParser=new mA(e)}_diff(e,t){if(t)return bf(e??{},t)}async parsePartialResult(e){let t=e[0];if(!t.message)return;let{message:n}=t,r=n.additional_kwargs.function_call;if(r)return this.argsOnly?ns(r.arguments):{...r,arguments:ns(r.arguments)}}async parseResult(e){let t=await this.outputParser.parseResult(e);if(!t)throw new Error(`No result from "OutputFunctionsParser" ${JSON.stringify(e)}`);return this.parse(t)}async parse(e){let t=JSON.parse(e);return this.argsOnly||(t.arguments=JSON.parse(t.arguments)),t}getFormatInstructions(){return""}},vB=class extends Gf{static lc_name(){return"JsonKeyOutputFunctionsParser"}lc_namespace=["langchain","output_parsers","openai_functions"];lc_serializable=!0;outputParser=new gA;attrName;get lc_aliases(){return{attrName:"key_name"}}constructor(e){super(e),this.attrName=e.attrName}async parseResult(e){return(await this.outputParser.parseResult(e))[this.attrName]}},bB=Q({JsonKeyOutputFunctionsParser:()=>vB,JsonOutputFunctionsParser:()=>gA,OutputFunctionsParser:()=>mA}),wB=Q({JsonOutputKeyToolsParser:()=>dA,JsonOutputToolsParser:()=>uA,convertLangChainToolCallToOpenAI:()=>lA,makeInvalidToolCall:()=>So,parseToolCall:()=>Hf}),Lc=class extends Re{lc_serializable=!0;lc_namespace=["langchain_core","prompts",this._getPromptType()];get lc_attributes(){return{partialVariables:void 0}}inputVariables;outputParser;partialVariables;metadata;tags;constructor(e){super(e);let{inputVariables:t}=e;if(t.includes("stop"))throw new Error("Cannot have an input variable named 'stop', as it is used internally, please rename.");Object.assign(this,e)}async mergePartialAndUserVariables(e){let t=this.partialVariables??{},n={};for(let[r,i]of Object.entries(t))typeof i=="string"?n[r]=i:n[r]=await i();return{...n,...e}}async invoke(e,t){let n={...this.metadata,...t?.metadata},r=[...this.tags??[],...t?.tags??[]];return this._callWithConfig(i=>this.formatPromptValue(i),e,{...t,tags:r,metadata:n,runType:"prompt"})}},Vo=class extends Lc{async formatPromptValue(e){return new Sv(await this.format(e))}},$B=Object.prototype.toString,Fs=Array.isArray||function(t){return $B.call(t)==="[object Array]"};function Pv(e){return typeof e=="function"}function SB(e){return Fs(e)?"array":typeof e}function om(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function kS(e,t){return e!=null&&typeof e=="object"&&t in e}function kB(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var xB=RegExp.prototype.test;function IB(e,t){return xB.call(e,t)}var EB=/\S/;function TB(e){return!IB(EB,e)}var OB={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function AB(e){return String(e).replace(/[&<>"'`=\/]/g,function(n){return OB[n]})}var CB=/\s*/,NB=/\s+/,xS=/\s*=/,PB=/\s*\}/,RB=/#|\^|\/|>|\{|&|=|!/;function jB(e,t){if(!e)return[];var n=!1,r=[],i=[],a=[],s=!1,o=!1,c="",l=0;function u(){if(s&&!o)for(;a.length;)delete i[a.pop()];else a=[];s=!1,o=!1}var d,f,h;function p(b){if(typeof b=="string"&&(b=b.split(NB,2)),!Fs(b)||b.length!==2)throw new Error("Invalid tags: "+b);d=new RegExp(om(b[0])+"\\s*"),f=new RegExp("\\s*"+om(b[1])),h=new RegExp("\\s*"+om("}"+b[1]))}p(t||hn.tags);for(var m=new zc(e),v,g,y,$,S,x;!m.eos();){if(v=m.pos,y=m.scanUntil(d),y)for(var C=0,T=y.length;C<T;++C)$=y.charAt(C),TB($)?(a.push(i.length),c+=$):(o=!0,n=!0,c+=" "),i.push(["text",$,v,v+1]),v+=1,$===`
661
- `&&(u(),c="",l=0,n=!1);if(!m.scan(d))break;if(s=!0,g=m.scan(RB)||"name",m.scan(CB),g==="="?(y=m.scanUntil(xS),m.scan(xS),m.scanUntil(f)):g==="{"?(y=m.scanUntil(h),m.scan(PB),m.scanUntil(f),g="&"):y=m.scanUntil(f),!m.scan(f))throw new Error("Unclosed tag at "+m.pos);if(g==">"?S=[g,y,v,m.pos,c,l,n]:S=[g,y,v,m.pos],l++,i.push(S),g==="#"||g==="^")r.push(S);else if(g==="/"){if(x=r.pop(),!x)throw new Error('Unopened section "'+y+'" at '+v);if(x[1]!==y)throw new Error('Unclosed section "'+x[1]+'" at '+v)}else g==="name"||g==="{"||g==="&"?o=!0:g==="="&&p(y)}if(u(),x=r.pop(),x)throw new Error('Unclosed section "'+x[1]+'" at '+m.pos);return DB(MB(i))}function MB(e){for(var t=[],n,r,i=0,a=e.length;i<a;++i)n=e[i],n&&(n[0]==="text"&&r&&r[0]==="text"?(r[1]+=n[1],r[3]=n[3]):(t.push(n),r=n));return t}function DB(e){for(var t=[],n=t,r=[],i,a,s=0,o=e.length;s<o;++s)switch(i=e[s],i[0]){case"#":case"^":n.push(i),r.push(i),n=i[4]=[];break;case"/":a=r.pop(),a[5]=i[2],n=r.length>0?r[r.length-1][4]:t;break;default:n.push(i)}return t}function zc(e){this.string=e,this.tail=e,this.pos=0}zc.prototype.eos=function(){return this.tail===""};zc.prototype.scan=function(t){var n=this.tail.match(t);if(!n||n.index!==0)return"";var r=n[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};zc.prototype.scanUntil=function(t){var n=this.tail.search(t),r;switch(n){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=r.length,r};function bs(e,t){this.view=e,this.cache={".":this.view},this.parent=t}bs.prototype.push=function(t){return new bs(t,this)};bs.prototype.lookup=function(t){var n=this.cache,r;if(n.hasOwnProperty(t))r=n[t];else{for(var i=this,a,s,o,c=!1;i;){if(t.indexOf(".")>0)for(a=i.view,s=t.split("."),o=0;a!=null&&o<s.length;)o===s.length-1&&(c=kS(a,s[o])||kB(a,s[o])),a=a[s[o++]];else a=i.view[t],c=kS(i.view,t);if(c){r=a;break}i=i.parent}n[t]=r}return Pv(r)&&(r=r.call(this.view)),r};function tn(){this.templateCache={_cache:{},set:function(t,n){this._cache[t]=n},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}tn.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};tn.prototype.parse=function(t,n){var r=this.templateCache,i=t+":"+(n||hn.tags).join(":"),a=typeof r<"u",s=a?r.get(i):void 0;return s==null&&(s=jB(t,n),a&&r.set(i,s)),s};tn.prototype.render=function(t,n,r,i){var a=this.getConfigTags(i),s=this.parse(t,a),o=n instanceof bs?n:new bs(n,void 0);return this.renderTokens(s,o,r,t,i)};tn.prototype.renderTokens=function(t,n,r,i,a){for(var s="",o,c,l,u=0,d=t.length;u<d;++u)l=void 0,o=t[u],c=o[0],c==="#"?l=this.renderSection(o,n,r,i,a):c==="^"?l=this.renderInverted(o,n,r,i,a):c===">"?l=this.renderPartial(o,n,r,a):c==="&"?l=this.unescapedValue(o,n):c==="name"?l=this.escapedValue(o,n,a):c==="text"&&(l=this.rawValue(o)),l!==void 0&&(s+=l);return s};tn.prototype.renderSection=function(t,n,r,i,a){var s=this,o="",c=n.lookup(t[1]);function l(f){return s.render(f,n,r,a)}if(c){if(Fs(c))for(var u=0,d=c.length;u<d;++u)o+=this.renderTokens(t[4],n.push(c[u]),r,i,a);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")o+=this.renderTokens(t[4],n.push(c),r,i,a);else if(Pv(c)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(n.view,i.slice(t[3],t[5]),l),c!=null&&(o+=c)}else o+=this.renderTokens(t[4],n,r,i,a);return o}};tn.prototype.renderInverted=function(t,n,r,i,a){var s=n.lookup(t[1]);if(!s||Fs(s)&&s.length===0)return this.renderTokens(t[4],n,r,i,a)};tn.prototype.indentPartial=function(t,n,r){for(var i=n.replace(/[^ \t]/g,""),a=t.split(`
662
- `),s=0;s<a.length;s++)a[s].length&&(s>0||!r)&&(a[s]=i+a[s]);return a.join(`
663
- `)};tn.prototype.renderPartial=function(t,n,r,i){if(r){var a=this.getConfigTags(i),s=Pv(r)?r(t[1]):r[t[1]];if(s!=null){var o=t[6],c=t[5],l=t[4],u=s;c==0&&l&&(u=this.indentPartial(s,l,o));var d=this.parse(u,a);return this.renderTokens(d,n,r,u,i)}}};tn.prototype.unescapedValue=function(t,n){var r=n.lookup(t[1]);if(r!=null)return r};tn.prototype.escapedValue=function(t,n,r){var i=this.getConfigEscape(r)||hn.escape,a=n.lookup(t[1]);if(a!=null)return typeof a=="number"&&i===hn.escape?String(a):i(a)};tn.prototype.rawValue=function(t){return t[1]};tn.prototype.getConfigTags=function(t){return Fs(t)?t:t&&typeof t=="object"?t.tags:void 0};tn.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!Fs(t))return t.escape};var hn={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){qo.templateCache=e},get templateCache(){return qo.templateCache}},qo=new tn;hn.clearCache=function(){return qo.clearCache()};hn.parse=function(t,n){return qo.parse(t,n)};hn.render=function(t,n,r,i){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+SB(t)+'" was given as the first argument for mustache#render(template, view, partials)');return qo.render(t,n,r,i)};hn.escape=AB;hn.Scanner=zc;hn.Context=bs;hn.Writer=tn;function _A(){hn.escape=e=>e}var Go=e=>{let t=e.split(""),n=[],r=(a,s)=>{for(let o=s;o<t.length;o+=1)if(a.includes(t[o]))return o;return-1},i=0;for(;i<t.length;)if(t[i]==="{"&&i+1<t.length&&t[i+1]==="{")n.push({type:"literal",text:"{"}),i+=2;else if(t[i]==="}"&&i+1<t.length&&t[i+1]==="}")n.push({type:"literal",text:"}"}),i+=2;else if(t[i]==="{"){let a=r("}",i);if(a<0)throw new Error("Unclosed '{' in template.");n.push({type:"variable",name:t.slice(i+1,a).join("")}),i=a+1}else{if(t[i]==="}")throw new Error("Single '}' in template.");{let a=r("{}",i),s=(a<0?t.slice(i):t.slice(i,a)).join("");n.push({type:"literal",text:s}),i=a<0?t.length:a}}return n},yA=(e,t=[])=>{let n=[];for(let r of e)if(r[0]==="name"){let i=r[1].includes(".")?r[1].split(".")[0]:r[1];n.push({type:"variable",name:i})}else if(["#","&","^",">"].includes(r[0])){if(n.push({type:"variable",name:r[1]}),r[0]==="#"&&r.length>4&&Array.isArray(r[4])){let i=[...t,r[1]],a=yA(r[4],i);n.push(...a)}}else n.push({type:"literal",text:r[1]});return n},Vu=e=>(_A(),yA(hn.parse(e))),vA=(e,t)=>Go(e).reduce((n,r)=>{if(r.type==="variable"){if(r.name in t)return n+(typeof t[r.name]=="string"?t[r.name]:JSON.stringify(t[r.name]));throw new Error(`(f-string) Missing value for input ${r.name}`)}return n+r.text},""),bA=(e,t)=>(_A(),hn.render(e,t)),qu={"f-string":vA,mustache:bA},wA={"f-string":Go,mustache:Vu},Jn=(e,t,n)=>{try{return qu[t](e,n)}catch(r){throw fc(r,"INVALID_PROMPT_INPUT")}},Gu=(e,t)=>wA[t](e),Fc=(e,t,n)=>{if(!(t in qu)){let r=Object.keys(qu);throw new Error(`Invalid template format. Got \`${t}\`;
664
- should be one of ${r}`)}try{let r=Object.fromEntries(n.map(i=>[i,"foo"]));Array.isArray(e)?e.forEach(i=>{if(i.type==="text"&&"text"in i&&typeof i.text=="string")Jn(i.text,t,r);else if(i.type==="image_url"){if(typeof i.image_url=="string")Jn(i.image_url,t,r);else if(typeof i.image_url=="object"&&i.image_url!==null&&"url"in i.image_url&&typeof i.image_url.url=="string"){let a=i.image_url.url;Jn(a,t,r)}}else throw new Error(`Invalid message template received. ${JSON.stringify(i,null,2)}`)}):Jn(e,t,r)}catch(r){throw new Error(`Invalid prompt schema: ${r.message}`)}},fi=class ao extends Vo{static lc_name(){return"PromptTemplate"}template;templateFormat="f-string";validateTemplate=!0;additionalContentFields;constructor(t){if(super(t),t.templateFormat==="mustache"&&t.validateTemplate===void 0&&(this.validateTemplate=!1),Object.assign(this,t),this.validateTemplate){if(this.templateFormat==="mustache")throw new Error("Mustache templates cannot be validated.");let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),Fc(this.template,this.templateFormat,n)}}_getPromptType(){return"prompt"}async format(t){let n=await this.mergePartialAndUserVariables(t);return Jn(this.template,this.templateFormat,n)}static fromExamples(t,n,r,i=`
665
-
666
- `,a=""){return new ao({inputVariables:r,template:[a,...t,n].join(i)})}static fromTemplate(t,n){let{templateFormat:r="f-string",...i}=n??{},a=new Set;return Gu(t,r).forEach(s=>{s.type==="variable"&&a.add(s.name)}),new ao({inputVariables:[...a],templateFormat:r,template:t,...i})}async partial(t){let n=this.inputVariables.filter(i=>!(i in t)),r={...this.partialVariables??{},...t};return new ao({...this,inputVariables:n,partialVariables:r})}serialize(){if(this.outputParser!==void 0)throw new Error("Cannot serialize a prompt template with an output parser");return{_type:this._getPromptType(),input_variables:this.inputVariables,template:this.template,template_format:this.templateFormat}}static async deserialize(t){if(!t.template)throw new Error("Prompt template must have a template");return new ao({inputVariables:t.input_variables,template:t.template,templateFormat:t.template_format})}},Yl=class $A extends Lc{static lc_name(){return"ImagePromptTemplate"}lc_namespace=["langchain_core","prompts","image"];template;templateFormat="f-string";validateTemplate=!0;additionalContentFields;constructor(t){if(super(t),this.template=t.template,this.templateFormat=t.templateFormat??this.templateFormat,this.validateTemplate=t.validateTemplate??this.validateTemplate,this.additionalContentFields=t.additionalContentFields,this.validateTemplate){let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),Fc([{type:"image_url",image_url:this.template}],this.templateFormat,n)}}_getPromptType(){return"prompt"}async partial(t){let n=this.inputVariables.filter(i=>!(i in t)),r={...this.partialVariables??{},...t};return new $A({...this,inputVariables:n,partialVariables:r})}async format(t){let n={};for(let[s,o]of Object.entries(this.template))typeof o=="string"?n[s]=Jn(o,this.templateFormat,t):n[s]=o;let r=t.url||n.url,i=t.detail||n.detail;if(!r)throw new Error("Must provide either an image URL.");if(typeof r!="string")throw new Error("url must be a string.");let a={url:r};return i&&(a.detail=i),a}async formatPromptValue(t){return new nA(await this.format(t))}},zg=class extends Re{lc_namespace=["langchain_core","prompts","dict"];lc_serializable=!0;template;templateFormat;inputVariables;static lc_name(){return"DictPromptTemplate"}constructor(e){let t=e.templateFormat??"f-string",n=Fg(e.template,t);super({inputVariables:n,...e}),this.template=e.template,this.templateFormat=t,this.inputVariables=n}async format(e){return Bg(this.template,e,this.templateFormat)}async invoke(e){return await this._callWithConfig(this.format.bind(this),e,{runType:"prompt"})}};function Fg(e,t){let n=[];for(let r of Object.values(e))if(typeof r=="string")Gu(r,t).forEach(i=>{i.type==="variable"&&n.push(i.name)});else if(Array.isArray(r))for(let i of r)typeof i=="string"?Gu(i,t).forEach(a=>{a.type==="variable"&&n.push(a.name)}):typeof i=="object"&&n.push(...Fg(i,t));else typeof r=="object"&&r!==null&&n.push(...Fg(r,t));return Array.from(new Set(n))}function Bg(e,t,n){let r={};for(let[i,a]of Object.entries(e))if(typeof a=="string")r[i]=Jn(a,n,t);else if(Array.isArray(a)){let s=[];for(let o of a)typeof o=="string"?s.push(Jn(o,n,t)):typeof o=="object"&&s.push(Bg(o,t,n));r[i]=s}else typeof a=="object"&&a!==null?r[i]=Bg(a,t,n):r[i]=a;return r}var Jf=class extends Re{lc_namespace=["langchain_core","prompts","chat"];lc_serializable=!0;async invoke(e,t){return this._callWithConfig(n=>this.formatMessages(n),e,{...t,runType:"prompt"})}},Zg=class extends Jf{static lc_name(){return"MessagesPlaceholder"}variableName;optional;constructor(e){typeof e=="string"&&(e={variableName:e}),super(e),this.variableName=e.variableName,this.optional=e.optional??!1}get inputVariables(){return[this.variableName]}async formatMessages(e){let t=e[this.variableName];if(this.optional&&!t)return[];if(!t){let r=new Error(`Field "${this.variableName}" in prompt uses a MessagesPlaceholder, which expects an array of BaseMessages as an input value. Received: undefined`);throw r.name="InputFormatError",r}let n;try{Array.isArray(t)?n=t.map(pr):n=[pr(t)]}catch(r){let i=typeof t=="string"?t:JSON.stringify(t,null,2),a=new Error([`Field "${this.variableName}" in prompt uses a MessagesPlaceholder, which expects an array of BaseMessages or coerceable values as input.`,`Received value: ${i}`,`Additional message: ${r.message}`].join(`
667
-
668
- `));throw a.name="InputFormatError",a.lc_error_code=r.lc_error_code,a}return n}},SA=class extends Jf{prompt;constructor(e){"prompt"in e||(e={prompt:e}),super(e),this.prompt=e.prompt}get inputVariables(){return this.prompt.inputVariables}async formatMessages(e){return[await this.format(e)]}},Rv=class extends Lc{constructor(e){super(e)}async format(e){return(await this.formatPromptValue(e)).toString()}async formatPromptValue(e){return new kv(await this.formatMessages(e))}},kA=class extends SA{static lc_name(){return"ChatMessagePromptTemplate"}role;constructor(e,t){"prompt"in e||(e={prompt:e,role:t}),super(e),this.role=e.role}async format(e){return new Hr(await this.prompt.format(e),this.role)}static fromTemplate(e,t,n){return new this(fi.fromTemplate(e,{templateFormat:n?.templateFormat}),t)}};function UB(e){return e===null||typeof e!="object"||Array.isArray(e)?!1:Object.keys(e).length===1&&"text"in e&&typeof e.text=="string"}function LB(e){return e===null||typeof e!="object"||Array.isArray(e)?!1:"image_url"in e&&(typeof e.image_url=="string"||typeof e.image_url=="object"&&e.image_url!==null&&"url"in e.image_url&&typeof e.image_url.url=="string")}var jv=class extends Jf{lc_namespace=["langchain_core","prompts","chat"];lc_serializable=!0;inputVariables=[];additionalOptions={};prompt;messageClass;static _messageClass(){throw new Error("Can not invoke _messageClass from inside _StringImageMessagePromptTemplate")}chatMessageClass;constructor(e,t){if("prompt"in e||(e={prompt:e}),super(e),this.prompt=e.prompt,Array.isArray(this.prompt)){let n=[];this.prompt.forEach(r=>{"inputVariables"in r&&(n=n.concat(r.inputVariables))}),this.inputVariables=n}else this.inputVariables=this.prompt.inputVariables;this.additionalOptions=t??this.additionalOptions}createMessage(e){let t=this.constructor;if(t._messageClass())return new(t._messageClass())({content:e});if(t.chatMessageClass){let n=t.chatMessageClass();return new n({content:e,role:this.getRoleFromMessageClass(n.lc_name())})}else throw new Error("No message class defined")}getRoleFromMessageClass(e){switch(e){case"HumanMessage":return"human";case"AIMessage":return"ai";case"SystemMessage":return"system";case"ChatMessage":return"chat";default:throw new Error("Invalid message class name")}}static fromTemplate(e,t){if(typeof e=="string")return new this(fi.fromTemplate(e,t));let n=[];for(let r of e)if(typeof r=="string")n.push(fi.fromTemplate(r,t));else if(r!==null)if(UB(r)){let i="";typeof r.text=="string"&&(i=r.text??"");let a={...t,additionalContentFields:r};n.push(fi.fromTemplate(i,a))}else if(LB(r)){let i=r.image_url??"",a,s=[];if(typeof i=="string"){let o;t?.templateFormat==="mustache"?o=Vu(i):o=Go(i);let c=o.flatMap(l=>l.type==="variable"?[l.name]:[]);if((c?.length??0)>0){if(c.length>1)throw new Error(`Only one format variable allowed per image template.
669
- Got: ${c}
670
- From: ${i}`);s=[c[0]]}else s=[];i={url:i},a=new Yl({template:i,inputVariables:s,templateFormat:t?.templateFormat,additionalContentFields:r})}else if(typeof i=="object"){if("url"in i){let o;t?.templateFormat==="mustache"?o=Vu(i.url):o=Go(i.url),s=o.flatMap(c=>c.type==="variable"?[c.name]:[])}else s=[];a=new Yl({template:i,inputVariables:s,templateFormat:t?.templateFormat,additionalContentFields:r})}else throw new Error("Invalid image template");n.push(a)}else typeof r=="object"&&n.push(new zg({template:r,templateFormat:t?.templateFormat}));return new this({prompt:n,additionalOptions:t})}async format(e){if(this.prompt instanceof Vo){let t=await this.prompt.format(e);return this.createMessage(t)}else{let t=[];for(let n of this.prompt){let r={};if(!("inputVariables"in n))throw new Error(`Prompt ${n} does not have inputVariables defined.`);for(let i of n.inputVariables)r||(r={[i]:e[i]}),r={...r,[i]:e[i]};if(n instanceof Vo){let i=await n.format(r),a;"additionalContentFields"in n&&(a=n.additionalContentFields),i!==""&&t.push({...a,type:"text",text:i})}else if(n instanceof Yl){let i=await n.format(r),a;"additionalContentFields"in n&&(a=n.additionalContentFields),t.push({...a,type:"image_url",image_url:i})}else if(n instanceof zg){let i=await n.format(r),a;"additionalContentFields"in n&&(a=n.additionalContentFields),t.push({...a,...i})}}return this.createMessage(t)}}async formatMessages(e){return[await this.format(e)]}},Mv=class extends jv{static _messageClass(){return Vt}static lc_name(){return"HumanMessagePromptTemplate"}},xA=class extends jv{static _messageClass(){return Ke}static lc_name(){return"AIMessagePromptTemplate"}},Dv=class extends jv{static _messageClass(){return _r}static lc_name(){return"SystemMessagePromptTemplate"}};function zB(e){return typeof e.formatMessages=="function"}function FB(e,t){if(zB(e)||Rt(e))return e;if(Array.isArray(e)&&e[0]==="placeholder"){let i=e[1];if(t?.templateFormat==="mustache"&&typeof i=="string"&&i.slice(0,2)==="{{"&&i.slice(-2)==="}}")return new Zg({variableName:i.slice(2,-2),optional:!0});if(typeof i=="string"&&i[0]==="{"&&i[i.length-1]==="}")return new Zg({variableName:i.slice(1,-1),optional:!0});throw new Error(`Invalid placeholder template for format ${t?.templateFormat??'"f-string"'}: "${e[1]}". Expected a variable name surrounded by ${t?.templateFormat==="mustache"?"double":"single"} curly braces.`)}let n=pr(e),r;if(typeof n.content=="string"?r=n.content:r=n.content.map(i=>"text"in i?{...i,text:i.text}:"image_url"in i?{...i,image_url:i.image_url}:i),n._getType()==="human")return Mv.fromTemplate(r,t);if(n._getType()==="ai")return xA.fromTemplate(r,t);if(n._getType()==="system")return Dv.fromTemplate(r,t);if(Hr.isInstance(n))return kA.fromTemplate(n.content,n.role,t);throw new Error(`Could not coerce message prompt template from input. Received message type: "${n._getType()}".`)}function BB(e){return e.constructor.lc_name()==="MessagesPlaceholder"}var Wf=class Ql extends Rv{static lc_name(){return"ChatPromptTemplate"}get lc_aliases(){return{promptMessages:"messages"}}promptMessages;validateTemplate=!0;templateFormat="f-string";constructor(t){if(super(t),t.templateFormat==="mustache"&&t.validateTemplate===void 0&&(this.validateTemplate=!1),Object.assign(this,t),this.validateTemplate){let n=new Set;for(let o of this.promptMessages)if(!(o instanceof Xt))for(let c of o.inputVariables)n.add(c);let r=this.inputVariables,i=new Set(this.partialVariables?r.concat(Object.keys(this.partialVariables)):r),a=new Set([...i].filter(o=>!n.has(o)));if(a.size>0)throw new Error(`Input variables \`${[...a]}\` are not used in any of the prompt messages.`);let s=new Set([...n].filter(o=>!i.has(o)));if(s.size>0)throw new Error(`Input variables \`${[...s]}\` are used in prompt messages but not in the prompt template.`)}}_getPromptType(){return"chat"}async _parseImagePrompts(t,n){return typeof t.content=="string"||(t.content=await Promise.all(t.content.map(async r=>{if(r.type!=="image_url")return r;let i="";typeof r.image_url=="string"?i=r.image_url:typeof r.image_url=="object"&&r.image_url!==null&&"url"in r.image_url&&typeof r.image_url.url=="string"&&(i=r.image_url.url);let a=await fi.fromTemplate(i,{templateFormat:this.templateFormat}).format(n);return typeof r.image_url=="object"&&r.image_url!==null&&"url"in r.image_url?r.image_url.url=a:r.image_url=a,r}))),t}async formatMessages(t){let n=await this.mergePartialAndUserVariables(t),r=[];for(let i of this.promptMessages)if(i instanceof Xt)r.push(await this._parseImagePrompts(i,n));else{let a;this.templateFormat==="mustache"?a={...n}:a=i.inputVariables.reduce((o,c)=>{if(!(c in n)&&!(BB(i)&&i.optional))throw fc(new Error(`Missing value for input variable \`${c.toString()}\``),"INVALID_PROMPT_INPUT");return o[c]=n[c],o},{});let s=await i.formatMessages(a);r=r.concat(s)}return r}async partial(t){let n=this.inputVariables.filter(i=>!(i in t)),r={...this.partialVariables??{},...t};return new Ql({...this,inputVariables:n,partialVariables:r})}static fromTemplate(t,n){let r=new Mv({prompt:fi.fromTemplate(t,n)});return this.fromMessages([r])}static fromMessages(t,n){let r=t.reduce((s,o)=>s.concat(o instanceof Ql?o.promptMessages:[FB(o,n)]),[]),i=t.reduce((s,o)=>o instanceof Ql?Object.assign(s,o.partialVariables):s,Object.create(null)),a=new Set;for(let s of r)if(!(s instanceof Xt))for(let o of s.inputVariables)o in i||a.add(o);return new this({...n,inputVariables:[...a],promptMessages:r,partialVariables:i,templateFormat:n?.templateFormat})}},ZB=class Vg extends Vo{lc_serializable=!1;examples;exampleSelector;examplePrompt;suffix="";exampleSeparator=`
671
-
672
- `;prefix="";templateFormat="f-string";validateTemplate=!0;constructor(t){if(super(t),Object.assign(this,t),this.examples!==void 0&&this.exampleSelector!==void 0)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(this.examples===void 0&&this.exampleSelector===void 0)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),Fc(this.prefix+this.suffix,this.templateFormat,n)}}_getPromptType(){return"few_shot"}static lc_name(){return"FewShotPromptTemplate"}async getExamples(t){if(this.examples!==void 0)return this.examples;if(this.exampleSelector!==void 0)return this.exampleSelector.selectExamples(t);throw new Error("One of 'examples' and 'example_selector' should be provided")}async partial(t){let n=this.inputVariables.filter(i=>!(i in t)),r={...this.partialVariables??{},...t};return new Vg({...this,inputVariables:n,partialVariables:r})}async format(t){let n=await this.mergePartialAndUserVariables(t),r=await this.getExamples(n),i=await Promise.all(r.map(a=>this.examplePrompt.format(a)));return Jn([this.prefix,...i,this.suffix].join(this.exampleSeparator),this.templateFormat,n)}serialize(){if(this.exampleSelector||!this.examples)throw new Error("Serializing an example selector is not currently supported");if(this.outputParser!==void 0)throw new Error("Serializing an output parser is not currently supported");return{_type:this._getPromptType(),input_variables:this.inputVariables,example_prompt:this.examplePrompt.serialize(),example_separator:this.exampleSeparator,suffix:this.suffix,prefix:this.prefix,template_format:this.templateFormat,examples:this.examples}}static async deserialize(t){let{example_prompt:n}=t;if(!n)throw new Error("Missing example prompt");let r=await fi.deserialize(n),i;if(Array.isArray(t.examples))i=t.examples;else throw new Error("Invalid examples format. Only list or string are supported.");return new Vg({inputVariables:t.input_variables,examplePrompt:r,examples:i,exampleSeparator:t.example_separator,prefix:t.prefix,suffix:t.suffix,templateFormat:t.template_format})}},VB=class IA extends Rv{lc_serializable=!0;examples;exampleSelector;examplePrompt;suffix="";exampleSeparator=`
673
-
674
- `;prefix="";templateFormat="f-string";validateTemplate=!0;_getPromptType(){return"few_shot_chat"}static lc_name(){return"FewShotChatMessagePromptTemplate"}constructor(t){if(super(t),this.examples=t.examples,this.examplePrompt=t.examplePrompt,this.exampleSeparator=t.exampleSeparator??`
675
-
676
- `,this.exampleSelector=t.exampleSelector,this.prefix=t.prefix??"",this.suffix=t.suffix??"",this.templateFormat=t.templateFormat??"f-string",this.validateTemplate=t.validateTemplate??!0,this.examples!==void 0&&this.exampleSelector!==void 0)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(this.examples===void 0&&this.exampleSelector===void 0)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),Fc(this.prefix+this.suffix,this.templateFormat,n)}}async getExamples(t){if(this.examples!==void 0)return this.examples;if(this.exampleSelector!==void 0)return this.exampleSelector.selectExamples(t);throw new Error("One of 'examples' and 'example_selector' should be provided")}async formatMessages(t){let n=await this.mergePartialAndUserVariables(t),r=await this.getExamples(n);r=r.map(a=>{let s={};return this.examplePrompt.inputVariables.forEach(o=>{s[o]=a[o]}),s});let i=[];for(let a of r){let s=await this.examplePrompt.formatMessages(a);i.push(...s)}return i}async format(t){let n=await this.mergePartialAndUserVariables(t),r=await this.getExamples(n),i=(await Promise.all(r.map(a=>this.examplePrompt.formatMessages(a)))).flat().map(a=>a.content);return Jn([this.prefix,...i,this.suffix].join(this.exampleSeparator),this.templateFormat,n)}async partial(t){let n=this.inputVariables.filter(i=>!(i in t)),r={...this.partialVariables??{},...t};return new IA({...this,inputVariables:n,partialVariables:r})}},qB=class eu extends Lc{static lc_name(){return"PipelinePromptTemplate"}pipelinePrompts;finalPrompt;constructor(t){super({...t,inputVariables:[]}),this.pipelinePrompts=t.pipelinePrompts,this.finalPrompt=t.finalPrompt,this.inputVariables=this.computeInputValues()}computeInputValues(){let t=this.pipelinePrompts.map(r=>r.name),n=this.pipelinePrompts.map(r=>r.prompt.inputVariables.filter(i=>!t.includes(i))).flat();return[...new Set(n)]}static extractRequiredInputValues(t,n){return n.reduce((r,i)=>(r[i]=t[i],r),{})}async formatPipelinePrompts(t){let n=await this.mergePartialAndUserVariables(t);for(let{name:r,prompt:i}of this.pipelinePrompts){let a=eu.extractRequiredInputValues(n,i.inputVariables);i instanceof Wf?n[r]=await i.formatMessages(a):n[r]=await i.format(a)}return eu.extractRequiredInputValues(n,this.finalPrompt.inputVariables)}async formatPromptValue(t){return this.finalPrompt.formatPromptValue(await this.formatPipelinePrompts(t))}async format(t){return this.finalPrompt.format(await this.formatPipelinePrompts(t))}async partial(t){let n={...this};return n.inputVariables=this.inputVariables.filter(r=>!(r in t)),n.partialVariables={...this.partialVariables??{},...t},new eu(n)}serialize(){throw new Error("Not implemented.")}_getPromptType(){return"pipeline"}};function IS(e){return typeof e=="object"&&e!=null&&"withStructuredOutput"in e&&typeof e.withStructuredOutput=="function"}function GB(e){return typeof e=="object"&&e!=null&&"lc_id"in e&&Array.isArray(e.lc_id)&&e.lc_id.join("/")==="langchain_core/runnables/RunnableBinding"}var HB=class EA extends Wf{schema;method;lc_namespace=["langchain_core","prompts","structured"];get lc_aliases(){return{...super.lc_aliases,schema:"schema_"}}constructor(t){super(t),this.schema=t.schema,this.method=t.method}pipe(t){if(IS(t))return super.pipe(t.withStructuredOutput(this.schema));if(GB(t)&&IS(t.bound))return super.pipe(new Si({bound:t.bound.withStructuredOutput(this.schema,...this.method?[{method:this.method}]:[]),kwargs:t.kwargs??{},config:t.config,configFactories:t.configFactories}));throw new Error('Structured prompts need to be piped to a language model that supports the "withStructuredOutput()" method.')}static fromMessagesAndSchema(t,n,r){return EA.fromMessages(t,{schema:n,method:r})}},JB=Q({AIMessagePromptTemplate:()=>xA,BaseChatPromptTemplate:()=>Rv,BaseMessagePromptTemplate:()=>Jf,BaseMessageStringPromptTemplate:()=>SA,BasePromptTemplate:()=>Lc,BaseStringPromptTemplate:()=>Vo,ChatMessagePromptTemplate:()=>kA,ChatPromptTemplate:()=>Wf,DEFAULT_FORMATTER_MAPPING:()=>qu,DEFAULT_PARSER_MAPPING:()=>wA,DictPromptTemplate:()=>zg,FewShotChatMessagePromptTemplate:()=>VB,FewShotPromptTemplate:()=>ZB,HumanMessagePromptTemplate:()=>Mv,ImagePromptTemplate:()=>Yl,MessagesPlaceholder:()=>Zg,PipelinePromptTemplate:()=>qB,PromptTemplate:()=>fi,StructuredPrompt:()=>HB,SystemMessagePromptTemplate:()=>Dv,checkValidTemplate:()=>Fc,interpolateFString:()=>vA,interpolateMustache:()=>bA,parseFString:()=>Go,parseMustache:()=>Vu,parseTemplate:()=>Gu,renderTemplate:()=>Jn}),WB=Q({BaseDocumentCompressor:()=>KB}),KB=class{static isBaseDocumentCompressor(e){return e?.compressDocuments!==void 0}},XB=Q({BaseRetriever:()=>Uv}),Uv=class extends Re{callbacks;tags;metadata;verbose;constructor(e){super(e),this.callbacks=e?.callbacks,this.tags=e?.tags??[],this.metadata=e?.metadata??{},this.verbose=e?.verbose??!1}_getRelevantDocuments(e,t){throw new Error("Not implemented!")}async invoke(e,t){let n=De(yc(t)),r=await(await Yt.configure(n.callbacks,this.callbacks,n.tags,this.tags,n.metadata,this.metadata,{verbose:this.verbose}))?.handleRetrieverStart(this.toJSON(),e,n.runId,void 0,void 0,void 0,n.runName);try{let i=await this._getRelevantDocuments(e,r);return await r?.handleRetrieverEnd(i),i}catch(i){throw await r?.handleRetrieverError(i),i}}},YB=Q({BaseStore:()=>TA,InMemoryStore:()=>QB}),TA=class extends An{},QB=class extends TA{lc_namespace=["langchain","storage"];store={};async mget(e){return e.map(t=>this.store[t])}async mset(e){for(let[t,n]of e)this.store[t]=n}async mdelete(e){for(let t of e)delete this.store[t]}async*yieldKeys(e){let t=Object.keys(this.store);for(let n of t)(e===void 0||n.startsWith(e))&&(yield n)}},ai={and:"and",or:"or",not:"not"},Pe={eq:"eq",ne:"ne",lt:"lt",gt:"gt",lte:"lte",gte:"gte"},OA=class{},Lv=class{accept(e){if(this.exprName==="Operation")return e.visitOperation(this);if(this.exprName==="Comparison")return e.visitComparison(this);if(this.exprName==="StructuredQuery")return e.visitStructuredQuery(this);throw new Error("Unknown Expression type")}},zv=class extends Lv{},eZ=class extends zv{exprName="Comparison";constructor(e,t,n){super(),this.comparator=e,this.attribute=t,this.value=n}},tZ=class extends zv{exprName="Operation";constructor(e,t){super(),this.operator=e,this.args=t}},nZ=class extends Lv{exprName="StructuredQuery";constructor(e,t){super(),this.query=e,this.filter=t}};function AA(e){return e&&typeof e=="object"&&!Array.isArray(e)}function qn(e){return e?typeof e=="string"&&e.length>0||typeof e=="function"?!1:AA(e)&&Object.keys(e).length===0:!0}function CA(e){if(typeof e=="number")return e%1===0;if(typeof e=="string"){let t=parseInt(e,10);return!Number.isNaN(t)&&t%1===0&&t.toString()===e}return!1}function NA(e){if(typeof e=="number")return e%1!==0;if(typeof e=="string"){let t=parseFloat(e);return!Number.isNaN(t)&&t%1!==0&&t.toString()===e}return!1}function PA(e){return typeof e=="string"&&(Number.isNaN(parseFloat(e))||parseFloat(e).toString()!==e)}function RA(e){return typeof e=="boolean"}function Fv(e){let t;if(PA(e))t=e;else if(CA(e))t=parseInt(e,10);else if(NA(e))t=parseFloat(e);else if(RA(e))t=!!e;else throw new Error("Unsupported value type");return t}var Bv=class extends OA{},rZ=class extends Bv{allowedOperators;allowedComparators;constructor(e){super(),this.allowedOperators=e?.allowedOperators??[ai.and,ai.or],this.allowedComparators=e?.allowedComparators??[Pe.eq,Pe.ne,Pe.gt,Pe.gte,Pe.lt,Pe.lte]}formatFunction(e){if(e in Pe){if(this.allowedComparators.length>0&&this.allowedComparators.indexOf(e)===-1)throw new Error(`Comparator ${e} not allowed. Allowed comparators: ${this.allowedComparators.join(", ")}`)}else if(e in ai){if(this.allowedOperators.length>0&&this.allowedOperators.indexOf(e)===-1)throw new Error(`Operator ${e} not allowed. Allowed operators: ${this.allowedOperators.join(", ")}`)}else throw new Error("Unknown comparator or operator");return`$${e}`}visitOperation(e){let t=e.args?.map(n=>n.accept(this));return{[this.formatFunction(e.operator)]:t}}visitComparison(e){return{[e.attribute]:{[this.formatFunction(e.comparator)]:Fv(e.value)}}}visitStructuredQuery(e){let t={};return e.filter&&(t={filter:e.filter.accept(this)}),t}mergeFilters(e,t,n="and",r=!1){if(!(qn(e)&&qn(t))){if(qn(e)||n==="replace")return qn(t)?void 0:t;if(qn(t))return r?e:n==="and"?void 0:e;if(n==="and")return{$and:[e,t]};if(n==="or")return{$or:[e,t]};throw new Error("Unknown merge type")}}},iZ=class extends Bv{allowedOperators=[ai.and,ai.or];allowedComparators=[Pe.eq,Pe.ne,Pe.gt,Pe.gte,Pe.lt,Pe.lte];formatFunction(){throw new Error("Not implemented")}getAllowedComparatorsForType(e){switch(e){case"string":return[Pe.eq,Pe.ne,Pe.gt,Pe.gte,Pe.lt,Pe.lte];case"number":return[Pe.eq,Pe.ne,Pe.gt,Pe.gte,Pe.lt,Pe.lte];case"boolean":return[Pe.eq,Pe.ne];default:throw new Error(`Unsupported data type: ${e}`)}}getComparatorFunction(e){switch(e){case Pe.eq:return(t,n)=>t===n;case Pe.ne:return(t,n)=>t!==n;case Pe.gt:return(t,n)=>t>n;case Pe.gte:return(t,n)=>t>=n;case Pe.lt:return(t,n)=>t<n;case Pe.lte:return(t,n)=>t<=n;default:throw new Error("Unknown comparator")}}getOperatorFunction(e){switch(e){case ai.and:return(t,n)=>t&&n;case ai.or:return(t,n)=>t||n;default:throw new Error("Unknown operator")}}visitOperation(e){let{operator:t,args:n}=e;if(this.allowedOperators.includes(t)){let r=this.getOperatorFunction(t);return i=>n?n.reduce((a,s)=>{let o=s.accept(this);if(typeof o=="function")return r(a,o(i));throw new Error("Filter is not a function")},!0):!0}else throw new Error("Operator not allowed")}visitComparison(e){let{comparator:t,attribute:n,value:r}=e,i=[Pe.ne];if(this.allowedComparators.includes(t)){if(!this.getAllowedComparatorsForType(typeof r).includes(t))throw new Error(`'${t}' comparator not allowed to be used with ${typeof r}`);let a=this.getComparatorFunction(t);return s=>{let o=s.metadata[n];return o===void 0?!!i.includes(t):a(o,Fv(r))}}else throw new Error("Comparator not allowed")}visitStructuredQuery(e){if(!e.filter)return{};let t=e.filter?.accept(this);if(typeof t!="function")throw new Error("Structured query filter is not a function");return{filter:t}}mergeFilters(e,t,n="and"){if(!(qn(e)&&qn(t))){if(qn(e)||n==="replace")return qn(t)?void 0:t;if(qn(t))return n==="and"?void 0:e;if(n==="and")return r=>e(r)&&t(r);if(n==="or")return r=>e(r)||t(r);throw new Error("Unknown merge type")}}},aZ=Q({BaseTranslator:()=>Bv,BasicTranslator:()=>rZ,Comparators:()=>Pe,Comparison:()=>eZ,Expression:()=>Lv,FilterDirective:()=>zv,FunctionalTranslator:()=>iZ,Operation:()=>tZ,Operators:()=>ai,StructuredQuery:()=>nZ,Visitor:()=>OA,castValue:()=>Fv,isBoolean:()=>RA,isFilterEmpty:()=>qn,isFloat:()=>NA,isInt:()=>CA,isObject:()=>AA,isString:()=>PA});function Ho(e){return Xt.isInstance(e)?e.constructor.name||e.type:typeof e}function Kf(e,t){return function(n,r){let{isNot:i,utils:a}=this;if(!t(n))return{pass:!1,message:()=>`${a.matcherHint(`toBe${e}`,void 0,void 0)}
677
-
678
- Expected: ${i?"not ":""}${e}
679
- Received: ${Ho(n)}`,actual:Ho(n),expected:e};if(r===void 0)return{pass:!0,message:()=>`${a.matcherHint(`toBe${e}`,void 0,void 0)}
680
-
681
- Expected: not ${e}
682
- Received: ${e}`};let s=n;return typeof r=="string"?{pass:s.content===r,message:()=>`${a.matcherHint(`toBe${e}`,void 0,void 0)}
683
-
684
- Expected: ${e} with content ${a.printExpected(r)}
685
- Received: ${e} with content ${a.printReceived(s.content)}`,actual:s.content,expected:r}:{pass:Object.entries(r).every(([o,c])=>this.equals(s[o],c)),message:()=>{let o={};for(let c of Object.keys(r))o[c]=s[c];return`${a.matcherHint(`toBe${e}`,void 0,void 0)}
686
-
687
- Expected: ${e} matching ${a.printExpected(r)}
688
- Received: ${e} with ${a.printReceived(o)}`},actual:(()=>{let o={};for(let c of Object.keys(r))o[c]=s[c];return o})(),expected:r}}}var jA=Kf("HumanMessage",Vt.isInstance),MA=Kf("AIMessage",Ke.isInstance),DA=Kf("SystemMessage",_r.isInstance),UA=Kf("ToolMessage",Cn.isInstance);function LA(e,t){let{isNot:n,utils:r}=this;if(!Ke.isInstance(e))return{pass:!1,message:()=>`${r.matcherHint("toHaveToolCalls")}
689
-
690
- Expected: AIMessage
691
- Received: ${Ho(e)}`};let i=e.tool_calls??[];if(i.length!==t.length)return{pass:!1,message:()=>`${r.matcherHint("toHaveToolCalls")}
692
-
693
- Expected ${n?"not ":""}${t.length} tool call(s), received ${i.length}`,actual:i.length,expected:t.length};let a=t.filter(s=>!i.some(o=>Object.entries(s).every(([c,l])=>this.equals(o[c],l))));return a.length>0?{pass:!1,message:()=>`${r.matcherHint("toHaveToolCalls")}
694
-
695
- Could not find matching tool call(s) for:
696
- ${r.printExpected(a)}
697
- Received tool calls: ${r.printReceived(i.map(s=>({name:s.name,id:s.id,args:s.args})))}`,actual:i.map(s=>({name:s.name,id:s.id,args:s.args})),expected:t}:{pass:!0,message:()=>`${r.matcherHint("toHaveToolCalls")}
698
-
699
- Expected AIMessage not to have matching tool calls`}}function zA(e,t){let{isNot:n,utils:r}=this;if(!Ke.isInstance(e))return{pass:!1,message:()=>`${r.matcherHint("toHaveToolCallCount")}
700
-
701
- Expected: AIMessage
702
- Received: ${Ho(e)}`};let i=e.tool_calls?.length??0;return{pass:i===t,message:()=>`${r.matcherHint("toHaveToolCallCount")}
703
-
704
- Expected ${n?"not ":""}${t} tool call(s)
705
- Received: ${i}`,actual:i,expected:t}}function FA(e,t){let{isNot:n,utils:r}=this;if(!Ke.isInstance(e))return{pass:!1,message:()=>`${r.matcherHint("toContainToolCall")}
706
-
707
- Expected: AIMessage
708
- Received: ${Ho(e)}`};let i=e.tool_calls??[];return{pass:i.some(a=>Object.entries(t).every(([s,o])=>this.equals(a[s],o))),message:()=>`${r.matcherHint("toContainToolCall")}
709
-
710
- Expected AIMessage ${n?"not ":""}to contain a tool call matching ${r.printExpected(t)}
711
- Received tool calls: ${r.printReceived(i.map(a=>({name:a.name,id:a.id})))}`,actual:i.map(a=>({name:a.name,id:a.id})),expected:t}}function BA(e,t){let{isNot:n,utils:r}=this;if(!Array.isArray(e))return{pass:!1,message:()=>`${r.matcherHint("toHaveToolMessages")}
712
-
713
- Expected an array of messages
714
- Received: ${typeof e}`};let i=e.filter(Cn.isInstance);if(i.length!==t.length)return{pass:!1,message:()=>`${r.matcherHint("toHaveToolMessages")}
715
-
716
- Expected ${n?"not ":""}${t.length} tool message(s), found ${i.length}`,actual:i.length,expected:t.length};for(let a=0;a<t.length;a++)if(!Object.entries(t[a]).every(([s,o])=>this.equals(i[a][s],o)))return{pass:!1,message:()=>{let s={};for(let o of Object.keys(t[a]))s[o]=i[a][o];return`${r.matcherHint("toHaveToolMessages")}
717
-
718
- Tool message at index ${a} did not match:
719
- Expected: ${r.printExpected(t[a])}
720
- Received: ${r.printReceived(s)}`},actual:i[a],expected:t[a]};return{pass:!0,message:()=>`${r.matcherHint("toHaveToolMessages")}
721
-
722
- Expected messages not to contain matching tool messages`}}function ZA(e,t){let{isNot:n,utils:r}=this,i=e?.__interrupt__;if(!(Array.isArray(i)&&i.length>0))return{pass:!1,message:()=>`${r.matcherHint("toHaveBeenInterrupted")}
723
-
724
- Expected result ${n?"not ":""}to have been interrupted
725
- Received __interrupt__: ${r.printReceived(i)}`};if(t===void 0)return{pass:!0,message:()=>`${r.matcherHint("toHaveBeenInterrupted")}
726
-
727
- Expected result not to have been interrupted
728
- Received ${i.length} interrupt(s)`};let a=i[0]?.value;return{pass:this.equals(a,t),message:()=>`${r.matcherHint("toHaveBeenInterrupted")}
729
-
730
- Expected interrupt value: ${r.printExpected(t)}
731
- Received interrupt value: ${r.printReceived(a)}`,actual:a,expected:t}}function VA(e,t){let{isNot:n,utils:r}=this,i=e?.structuredResponse;return i===void 0?{pass:!1,message:()=>`${r.matcherHint("toHaveStructuredResponse")}
732
-
733
- Expected result ${n?"not ":""}to have a structured response
734
- Received structuredResponse: undefined`}:t===void 0?{pass:!0,message:()=>`${r.matcherHint("toHaveStructuredResponse")}
735
-
736
- Expected result not to have a structured response`}:{pass:Object.entries(t).every(([a,s])=>this.equals(i[a],s)),message:()=>`${r.matcherHint("toHaveStructuredResponse")}
737
-
738
- Expected structured response: ${r.printExpected(t)}
739
- Received structured response: ${r.printReceived(i)}`,actual:i,expected:t}}var sZ={toBeHumanMessage:jA,toBeAIMessage:MA,toBeSystemMessage:DA,toBeToolMessage:UA,toHaveToolCalls:LA,toHaveToolCallCount:zA,toContainToolCall:FA,toHaveToolMessages:BA,toHaveBeenInterrupted:ZA,toHaveStructuredResponse:VA};function oZ(e){return e.map(t=>t.text).filter(Boolean).join("-")}var ES=0;function cZ(){return ES+=1,`fake_tc_${ES}`}var qA=class GA extends va{queue=[];_alwaysThrowError;_structuredResponseValue;_tools=[];_callIndex=0;_calls=[];get calls(){return this._calls}get callCount(){return this._calls.length}constructor(){super({})}_llmType(){return"fake-model-builder"}_combineLLMOutput(){return[]}respond(t){return typeof t=="function"?this.queue.push({kind:"factory",factory:t}):Xt.isInstance(t)?this.queue.push({kind:"message",message:t}):this.queue.push({kind:"error",error:t}),this}respondWithTools(t){return this.queue.push({kind:"toolCalls",toolCalls:t.map(n=>({name:n.name,args:n.args,id:n.id??cZ(),type:"tool_call"}))}),this}alwaysThrow(t){return this._alwaysThrowError=t,this}structuredResponse(t){return this._structuredResponseValue=t,this}bindTools(t){let n=[...this._tools,...t],r=new GA;return r.queue=this.queue,r._alwaysThrowError=this._alwaysThrowError,r._structuredResponseValue=this._structuredResponseValue,r._tools=n,r._calls=this._calls,r._callIndex=this._callIndex,r.withConfig({})}withStructuredOutput(t,n){let{_structuredResponseValue:r}=this;return Qn.from(async()=>r)}async _generate(t,n,r){this._calls.push({messages:[...t],options:n});let i=this._callIndex;if(this._callIndex+=1,this._alwaysThrowError)throw this._alwaysThrowError;let a=this.queue[i];if(!a)throw new Error(`FakeModel: no response queued for invocation ${i} (${this.queue.length} total queued).`);if(a.kind==="error")throw a.error;if(a.kind==="factory"){let o=a.factory(t);if(!Xt.isInstance(o))throw o;return{generations:[{text:"",message:o}]}}if(a.kind==="message")return{generations:[{text:"",message:a.message}]};let s=oZ(t);return{generations:[{text:s,message:new Ke({content:s,id:i.toString(),tool_calls:a.toolCalls.length>0?a.toolCalls.map(o=>({...o,type:"tool_call"})):void 0})}],llmOutput:{}}}};function lZ(){return new qA}var uZ=Q({FakeBuiltModel:()=>qA,fakeModel:()=>lZ,langchainMatchers:()=>sZ,toBeAIMessage:()=>MA,toBeHumanMessage:()=>jA,toBeSystemMessage:()=>DA,toBeToolMessage:()=>UA,toContainToolCall:()=>FA,toHaveBeenInterrupted:()=>ZA,toHaveStructuredResponse:()=>VA,toHaveToolCallCount:()=>zA,toHaveToolCalls:()=>LA,toHaveToolMessages:()=>BA});function Zv(e){return e!==void 0&&Array.isArray(e.lc_namespace)}function Vv(e){return e!==void 0&&Re.isRunnable(e)&&"lc_name"in e.constructor&&typeof e.constructor.lc_name=="function"&&e.constructor.lc_name()==="RunnableToolLike"}function qv(e){return!!e&&typeof e=="object"&&"name"in e&&"schema"in e&&(bn(e.schema)||e.schema!=null&&typeof e.schema=="object"&&"type"in e.schema&&typeof e.schema.type=="string"&&["null","boolean","object","array","number","string"].includes(e.schema.type))}function Bc(e){return qv(e)||Vv(e)||Zv(e)}var dZ=Object.freeze(Object.defineProperty({__proto__:null,endsWith:Nf,gt:vi,gte:cn,includes:Af,length:Pc,lowercase:Tf,lt:yi,lte:On,maxLength:Nc,maxSize:Us,mime:Pf,minLength:ca,minSize:bi,multipleOf:fs,negative:cv,nonnegative:uv,nonpositive:lv,normalize:Rf,overwrite:Wr,positive:ov,property:dv,regex:Ef,size:Cc,slugify:Uf,startsWith:Cf,toLowerCase:Mf,toUpperCase:Df,trim:jf,uppercase:Of},Symbol.toStringTag,{value:"Module"})),Gv=k("ZodISODateTime",(e,t)=>{ME.init(e,t),Ye.init(e,t)});function HA(e){return GT(Gv,e)}var Hv=k("ZodISODate",(e,t)=>{DE.init(e,t),Ye.init(e,t)});function JA(e){return HT(Hv,e)}var Jv=k("ZodISOTime",(e,t)=>{UE.init(e,t),Ye.init(e,t)});function WA(e){return JT(Jv,e)}var Wv=k("ZodISODuration",(e,t)=>{LE.init(e,t),Ye.init(e,t)});function KA(e){return WT(Wv,e)}var XA=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:Hv,ZodISODateTime:Gv,ZodISODuration:Wv,ZodISOTime:Jv,date:JA,datetime:HA,duration:KA,time:WA},Symbol.toStringTag,{value:"Module"})),YA=(e,t)=>{hy.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>my(e,n)},flatten:{value:n=>py(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ou,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ou,2)}},isEmpty:{get(){return e.issues.length===0}}})},fZ=k("ZodError",YA),kn=k("ZodError",YA,{Parent:Error}),QA=$c(kn),eC=Sc(kn),tC=kc(kn),nC=xc(kn),rC=_y(kn),iC=yy(kn),aC=vy(kn),sC=by(kn),oC=wy(kn),cC=$y(kn),lC=Sy(kn),uC=ky(kn),xe=k("ZodType",(e,t)=>(ke.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Uo(e,"input"),output:Uo(e,"output")}}),e.toJSONSchema=IO(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(wr(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>mt(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>QA(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>tC(e,n,r),e.parseAsync=async(n,r)=>eC(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>nC(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>rC(e,n,r),e.decode=(n,r)=>iC(e,n,r),e.encodeAsync=async(n,r)=>aC(e,n,r),e.decodeAsync=async(n,r)=>sC(e,n,r),e.safeEncode=(n,r)=>oC(e,n,r),e.safeDecode=(n,r)=>cC(e,n,r),e.safeEncodeAsync=async(n,r)=>lC(e,n,r),e.safeDecodeAsync=async(n,r)=>uC(e,n,r),e.refine=(n,r)=>e.check(jb(n,r)),e.superRefine=n=>e.check(Mb(n)),e.overwrite=n=>e.check(Wr(n)),e.optional=()=>Wo(e),e.exactOptional=()=>_b(e),e.nullable=()=>$s(e),e.nullish=()=>Wo($s(e)),e.nonoptional=n=>Sb(e,n),e.array=()=>lt(e),e.or=n=>$r([e,n]),e.and=n=>cb(e,n),e.transform=n=>Ko(e,bh(n)),e.default=n=>bb(e,n),e.prefault=n=>$b(e,n),e.catch=n=>Ib(e,n),e.pipe=n=>Ko(e,n),e.readonly=()=>Ob(e),e.describe=n=>{let r=e.clone();return nt.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return nt.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return nt.get(e);let r=e.clone();return nt.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Xf=k("_ZodString",(e,t)=>{Oc.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,i,a)=>EO(e,r,i);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Ef(...r)),e.includes=(...r)=>e.check(Af(...r)),e.startsWith=(...r)=>e.check(Cf(...r)),e.endsWith=(...r)=>e.check(Nf(...r)),e.min=(...r)=>e.check(ca(...r)),e.max=(...r)=>e.check(Nc(...r)),e.length=(...r)=>e.check(Pc(...r)),e.nonempty=(...r)=>e.check(ca(1,...r)),e.lowercase=r=>e.check(Tf(r)),e.uppercase=r=>e.check(Of(r)),e.trim=()=>e.check(jf()),e.normalize=(...r)=>e.check(Rf(...r)),e.toLowerCase=()=>e.check(Mf()),e.toUpperCase=()=>e.check(Df()),e.slugify=()=>e.check(Uf())}),Zc=k("ZodString",(e,t)=>{Oc.init(e,t),Xf.init(e,t),e.email=n=>e.check(Ly(Yf,n)),e.url=n=>e.check(If(Vc,n)),e.jwt=n=>e.check(iv(hh,n)),e.emoji=n=>e.check(Vy(Qf,n)),e.guid=n=>e.check(Ru(Jo,n)),e.uuid=n=>e.check(zy(dr,n)),e.uuidv4=n=>e.check(Fy(dr,n)),e.uuidv6=n=>e.check(By(dr,n)),e.uuidv7=n=>e.check(Zy(dr,n)),e.nanoid=n=>e.check(qy(eh,n)),e.guid=n=>e.check(Ru(Jo,n)),e.cuid=n=>e.check(Gy(th,n)),e.cuid2=n=>e.check(Hy(nh,n)),e.ulid=n=>e.check(Jy(rh,n)),e.base64=n=>e.check(tv(uh,n)),e.base64url=n=>e.check(nv(dh,n)),e.xid=n=>e.check(Wy(ih,n)),e.ksuid=n=>e.check(Ky(ah,n)),e.ipv4=n=>e.check(Xy(sh,n)),e.ipv6=n=>e.check(Yy(oh,n)),e.cidrv4=n=>e.check(Qy(ch,n)),e.cidrv6=n=>e.check(ev(lh,n)),e.e164=n=>e.check(rv(fh,n)),e.datetime=n=>e.check(HA(n)),e.date=n=>e.check(JA(n)),e.time=n=>e.check(WA(n)),e.duration=n=>e.check(KA(n))});function de(e){return BT(Zc,e)}var Ye=k("ZodStringFormat",(e,t)=>{Xe.init(e,t),Xf.init(e,t)}),Yf=k("ZodEmail",(e,t)=>{EE.init(e,t),Ye.init(e,t)});function dC(e){return Ly(Yf,e)}var Jo=k("ZodGUID",(e,t)=>{xE.init(e,t),Ye.init(e,t)});function fC(e){return Ru(Jo,e)}var dr=k("ZodUUID",(e,t)=>{IE.init(e,t),Ye.init(e,t)});function hC(e){return zy(dr,e)}function pC(e){return Fy(dr,e)}function mC(e){return By(dr,e)}function gC(e){return Zy(dr,e)}var Vc=k("ZodURL",(e,t)=>{TE.init(e,t),Ye.init(e,t)});function _C(e){return If(Vc,e)}function yC(e){return If(Vc,{protocol:/^https?$/,hostname:ZI,...N(e)})}var Qf=k("ZodEmoji",(e,t)=>{OE.init(e,t),Ye.init(e,t)});function vC(e){return Vy(Qf,e)}var eh=k("ZodNanoID",(e,t)=>{AE.init(e,t),Ye.init(e,t)});function bC(e){return qy(eh,e)}var th=k("ZodCUID",(e,t)=>{CE.init(e,t),Ye.init(e,t)});function wC(e){return Gy(th,e)}var nh=k("ZodCUID2",(e,t)=>{NE.init(e,t),Ye.init(e,t)});function $C(e){return Hy(nh,e)}var rh=k("ZodULID",(e,t)=>{PE.init(e,t),Ye.init(e,t)});function SC(e){return Jy(rh,e)}var ih=k("ZodXID",(e,t)=>{RE.init(e,t),Ye.init(e,t)});function kC(e){return Wy(ih,e)}var ah=k("ZodKSUID",(e,t)=>{jE.init(e,t),Ye.init(e,t)});function xC(e){return Ky(ah,e)}var sh=k("ZodIPv4",(e,t)=>{zE.init(e,t),Ye.init(e,t)});function IC(e){return Xy(sh,e)}var Kv=k("ZodMAC",(e,t)=>{BE.init(e,t),Ye.init(e,t)});function EC(e){return VT(Kv,e)}var oh=k("ZodIPv6",(e,t)=>{FE.init(e,t),Ye.init(e,t)});function TC(e){return Yy(oh,e)}var ch=k("ZodCIDRv4",(e,t)=>{ZE.init(e,t),Ye.init(e,t)});function OC(e){return Qy(ch,e)}var lh=k("ZodCIDRv6",(e,t)=>{VE.init(e,t),Ye.init(e,t)});function AC(e){return ev(lh,e)}var uh=k("ZodBase64",(e,t)=>{qE.init(e,t),Ye.init(e,t)});function CC(e){return tv(uh,e)}var dh=k("ZodBase64URL",(e,t)=>{HE.init(e,t),Ye.init(e,t)});function NC(e){return nv(dh,e)}var fh=k("ZodE164",(e,t)=>{JE.init(e,t),Ye.init(e,t)});function PC(e){return rv(fh,e)}var hh=k("ZodJWT",(e,t)=>{KE.init(e,t),Ye.init(e,t)});function RC(e){return iv(hh,e)}var Bs=k("ZodCustomStringFormat",(e,t)=>{XE.init(e,t),Ye.init(e,t)});function jC(e,t,n={}){return Rc(Bs,e,t,n)}function MC(e){return Rc(Bs,"hostname",BI,e)}function DC(e){return Rc(Bs,"hex",iE,e)}function UC(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,i=Ey[r];if(!i)throw new Error(`Unrecognized hash format: ${r}`);return Rc(Bs,r,i,t)}var qc=k("ZodNumber",(e,t)=>{Cy.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,i,a)=>TO(e,r,i),e.gt=(r,i)=>e.check(vi(r,i)),e.gte=(r,i)=>e.check(cn(r,i)),e.min=(r,i)=>e.check(cn(r,i)),e.lt=(r,i)=>e.check(yi(r,i)),e.lte=(r,i)=>e.check(On(r,i)),e.max=(r,i)=>e.check(On(r,i)),e.int=r=>e.check(Hu(r)),e.safe=r=>e.check(Hu(r)),e.positive=r=>e.check(vi(0,r)),e.nonnegative=r=>e.check(cn(0,r)),e.negative=r=>e.check(yi(0,r)),e.nonpositive=r=>e.check(On(0,r)),e.multipleOf=(r,i)=>e.check(fs(r,i)),e.step=(r,i)=>e.check(fs(r,i)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function rt(e){return KT(qc,e)}var ba=k("ZodNumberFormat",(e,t)=>{YE.init(e,t),qc.init(e,t)});function Hu(e){return YT(ba,e)}function LC(e){return QT(ba,e)}function zC(e){return eO(ba,e)}function FC(e){return tO(ba,e)}function BC(e){return nO(ba,e)}var Gc=k("ZodBoolean",(e,t)=>{Ny.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>OO(e,n,r)});function ph(e){return rO(Gc,e)}var Hc=k("ZodBigInt",(e,t)=>{Py.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,i,a)=>AO(e,r),e.gte=(r,i)=>e.check(cn(r,i)),e.min=(r,i)=>e.check(cn(r,i)),e.gt=(r,i)=>e.check(vi(r,i)),e.gte=(r,i)=>e.check(cn(r,i)),e.min=(r,i)=>e.check(cn(r,i)),e.lt=(r,i)=>e.check(yi(r,i)),e.lte=(r,i)=>e.check(On(r,i)),e.max=(r,i)=>e.check(On(r,i)),e.positive=r=>e.check(vi(BigInt(0),r)),e.negative=r=>e.check(yi(BigInt(0),r)),e.nonpositive=r=>e.check(On(BigInt(0),r)),e.nonnegative=r=>e.check(cn(BigInt(0),r)),e.multipleOf=(r,i)=>e.check(fs(r,i));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function ZC(e){return aO(Hc,e)}var mh=k("ZodBigIntFormat",(e,t)=>{QE.init(e,t),Hc.init(e,t)});function VC(e){return oO(mh,e)}function qC(e){return cO(mh,e)}var Xv=k("ZodSymbol",(e,t)=>{eT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CO(e,n)});function GC(e){return lO(Xv,e)}var Yv=k("ZodUndefined",(e,t)=>{tT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PO(e,n)});function HC(e){return uO(Yv,e)}var Qv=k("ZodNull",(e,t)=>{nT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>NO(e,n,r)});function gh(e){return dO(Qv,e)}var eb=k("ZodAny",(e,t)=>{rT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MO()});function Ga(){return fO(eb)}var tb=k("ZodUnknown",(e,t)=>{Ry.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DO()});function ua(){return av(tb)}var nb=k("ZodNever",(e,t)=>{jy.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>jO(e,n,r)});function _h(e){return sv(nb,e)}var rb=k("ZodVoid",(e,t)=>{iT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RO(e,n)});function JC(e){return hO(rb,e)}var yh=k("ZodDate",(e,t)=>{aT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,i,a)=>UO(e,r),e.min=(r,i)=>e.check(cn(r,i)),e.max=(r,i)=>e.check(On(r,i));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function WC(e){return pO(yh,e)}var ib=k("ZodArray",(e,t)=>{sT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>KO(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(ca(n,r)),e.nonempty=n=>e.check(ca(1,n)),e.max=(n,r)=>e.check(Nc(n,r)),e.length=(n,r)=>e.check(Pc(n,r)),e.unwrap=()=>e.element});function lt(e,t){return _O(ib,e,t)}function KC(e){let t=e._zod.def.shape;return Sr(Object.keys(t))}var Jc=k("ZodObject",(e,t)=>{uT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XO(e,n,r,i),Oe(e,"shape",()=>t.shape),e.keyof=()=>Sr(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ua()}),e.loose=()=>e.clone({...e._zod.def,catchall:ua()}),e.strict=()=>e.clone({...e._zod.def,catchall:_h()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>dy(e,n),e.safeExtend=n=>pI(e,n),e.merge=n=>mI(e,n),e.pick=n=>fI(e,n),e.omit=n=>hI(e,n),e.partial=(...n)=>fy(wh,e,n[0]),e.required=(...n)=>gI($h,e,n[0])});function je(e,t){let n={type:"object",shape:e??{},...N(t)};return new Jc(n)}function XC(e,t){return new Jc({type:"object",shape:e,catchall:_h(),...N(t)})}function YC(e,t){return new Jc({type:"object",shape:e,catchall:ua(),...N(t)})}var Wc=k("ZodUnion",(e,t)=>{xf.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fv(e,n,r,i),e.options=t.options});function $r(e,t){return new Wc({type:"union",options:e,...N(t)})}var ab=k("ZodXor",(e,t)=>{Wc.init(e,t),dT.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fv(e,n,r,i),e.options=t.options});function QC(e,t){return new ab({type:"union",options:e,inclusive:!1,...N(t)})}var sb=k("ZodDiscriminatedUnion",(e,t)=>{Wc.init(e,t),fT.init(e,t)});function eN(e,t,n){return new sb({type:"union",options:t,discriminator:e,...N(n)})}var ob=k("ZodIntersection",(e,t)=>{hT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>YO(e,n,r,i)});function cb(e,t){return new ob({type:"intersection",left:e,right:t})}var lb=k("ZodTuple",(e,t)=>{My.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QO(e,n,r,i),e.rest=n=>e.clone({...e._zod.def,rest:n})});function ub(e,t,n){let r=t instanceof ke,i=r?n:t,a=r?t:null;return new lb({type:"tuple",items:e,rest:a,...N(i)})}var Kc=k("ZodRecord",(e,t)=>{pT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>e1(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function vh(e,t,n){return new Kc({type:"record",keyType:e,valueType:t,...N(n)})}function tN(e,t,n){let r=mt(e);return r._zod.values=void 0,new Kc({type:"record",keyType:r,valueType:t,...N(n)})}function nN(e,t,n){return new Kc({type:"record",keyType:e,valueType:t,mode:"loose",...N(n)})}var db=k("ZodMap",(e,t)=>{mT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JO(e,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(bi(...n)),e.nonempty=n=>e.check(bi(1,n)),e.max=(...n)=>e.check(Us(...n)),e.size=(...n)=>e.check(Cc(...n))});function rN(e,t,n){return new db({type:"map",keyType:e,valueType:t,...N(n)})}var fb=k("ZodSet",(e,t)=>{gT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>WO(e,n),e.min=(...n)=>e.check(bi(...n)),e.nonempty=n=>e.check(bi(1,n)),e.max=(...n)=>e.check(Us(...n)),e.size=(...n)=>e.check(Cc(...n))});function iN(e,t){return new fb({type:"set",valueType:e,...N(t)})}var ws=k("ZodEnum",(e,t)=>{_T.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,i,a)=>LO(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{let a={};for(let s of r)if(n.has(s))a[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ws({...t,checks:[],...N(i),entries:a})},e.exclude=(r,i)=>{let a={...t.entries};for(let s of r)if(n.has(s))delete a[s];else throw new Error(`Key ${s} not found in enum`);return new ws({...t,checks:[],...N(i),entries:a})}});function Sr(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ws({type:"enum",entries:n,...N(t)})}function aN(e,t){return new ws({type:"enum",entries:e,...N(t)})}var hb=k("ZodLiteral",(e,t)=>{yT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zO(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function gt(e,t){return new hb({type:"literal",values:Array.isArray(e)?e:[e],...N(t)})}var pb=k("ZodFile",(e,t)=>{vT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZO(e,n,r),e.min=(n,r)=>e.check(bi(n,r)),e.max=(n,r)=>e.check(Us(n,r)),e.mime=(n,r)=>e.check(Pf(Array.isArray(n)?n:[n],r))});function sN(e){return yO(pb,e)}var mb=k("ZodTransform",(e,t)=>{bT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>HO(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new cs(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(us(a,n.value,t));else{let s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(us(s))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function bh(e){return new mb({type:"transform",transform:e})}var wh=k("ZodOptional",(e,t)=>{Ac.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hv(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Wo(e){return new wh({type:"optional",innerType:e})}var gb=k("ZodExactOptional",(e,t)=>{wT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hv(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function _b(e){return new gb({type:"optional",innerType:e})}var yb=k("ZodNullable",(e,t)=>{$T.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>t1(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function $s(e){return new yb({type:"nullable",innerType:e})}function oN(e){return Wo($s(e))}var vb=k("ZodDefault",(e,t)=>{ST.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>r1(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function bb(e,t){return new vb({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():$f(t)}})}var wb=k("ZodPrefault",(e,t)=>{kT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>i1(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function $b(e,t){return new wb({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():$f(t)}})}var $h=k("ZodNonOptional",(e,t)=>{xT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>n1(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Sb(e,t){return new $h({type:"nonoptional",innerType:e,...N(t)})}var kb=k("ZodSuccess",(e,t)=>{IT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VO(e,n,r),e.unwrap=()=>e._zod.def.innerType});function cN(e){return new kb({type:"success",innerType:e})}var xb=k("ZodCatch",(e,t)=>{ET.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>a1(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ib(e,t){return new xb({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Eb=k("ZodNaN",(e,t)=>{TT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FO(e,n)});function lN(e){return gO(Eb,e)}var Sh=k("ZodPipe",(e,t)=>{OT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>s1(e,n,r,i),e.in=t.in,e.out=t.out});function Ko(e,t){return new Sh({type:"pipe",in:e,out:t})}var kh=k("ZodCodec",(e,t)=>{Sh.init(e,t),Dy.init(e,t)});function uN(e,t,n){return new kh({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}var Tb=k("ZodReadonly",(e,t)=>{AT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>o1(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Ob(e){return new Tb({type:"readonly",innerType:e})}var Ab=k("ZodTemplateLiteral",(e,t)=>{CT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BO(e,n,r)});function dN(e,t){return new Ab({type:"template_literal",parts:e,...N(t)})}var Cb=k("ZodLazy",(e,t)=>{RT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>l1(e,n,r,i),e.unwrap=()=>e._zod.def.getter()});function Nb(e){return new Cb({type:"lazy",getter:e})}var Pb=k("ZodPromise",(e,t)=>{PT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>c1(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function fN(e){return new Pb({type:"promise",innerType:e})}var Rb=k("ZodFunction",(e,t)=>{NT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GO(e,n)});function Ju(e){return new Rb({type:"function",input:Array.isArray(e?.input)?ub(e?.input):e?.input??lt(ua()),output:e?.output??ua()})}var Xc=k("ZodCustom",(e,t)=>{jT.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qO(e,n)});function hN(e){let t=new ot({check:"custom"});return t._zod.check=e,t}function Wu(e,t){return vO(Xc,e??(()=>!0),t)}function jb(e,t={}){return bO(Xc,e,t)}function Mb(e){return wO(e)}var pN=SO,mN=kO;function gN(e,t={}){let n=new Xc({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...N(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var _N=(...e)=>xO({Codec:kh,Boolean:Gc,String:Zc},...e);function yN(e){let t=Nb(()=>$r([de(e),rt(),ph(),gh(),lt(t),vh(de(),t)]));return t}function vN(e,t){return Ko(bh(e),t)}var hZ=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:eb,ZodArray:ib,ZodBase64:uh,ZodBase64URL:dh,ZodBigInt:Hc,ZodBigIntFormat:mh,ZodBoolean:Gc,ZodCIDRv4:ch,ZodCIDRv6:lh,ZodCUID:th,ZodCUID2:nh,ZodCatch:xb,ZodCodec:kh,ZodCustom:Xc,ZodCustomStringFormat:Bs,ZodDate:yh,ZodDefault:vb,ZodDiscriminatedUnion:sb,ZodE164:fh,ZodEmail:Yf,ZodEmoji:Qf,ZodEnum:ws,ZodExactOptional:gb,ZodFile:pb,ZodFunction:Rb,ZodGUID:Jo,ZodIPv4:sh,ZodIPv6:oh,ZodIntersection:ob,ZodJWT:hh,ZodKSUID:ah,ZodLazy:Cb,ZodLiteral:hb,ZodMAC:Kv,ZodMap:db,ZodNaN:Eb,ZodNanoID:eh,ZodNever:nb,ZodNonOptional:$h,ZodNull:Qv,ZodNullable:yb,ZodNumber:qc,ZodNumberFormat:ba,ZodObject:Jc,ZodOptional:wh,ZodPipe:Sh,ZodPrefault:wb,ZodPromise:Pb,ZodReadonly:Tb,ZodRecord:Kc,ZodSet:fb,ZodString:Zc,ZodStringFormat:Ye,ZodSuccess:kb,ZodSymbol:Xv,ZodTemplateLiteral:Ab,ZodTransform:mb,ZodTuple:lb,ZodType:xe,ZodULID:rh,ZodURL:Vc,ZodUUID:dr,ZodUndefined:Yv,ZodUnion:Wc,ZodUnknown:tb,ZodVoid:rb,ZodXID:ih,ZodXor:ab,_ZodString:Xf,_default:bb,_function:Ju,any:Ga,array:lt,base64:CC,base64url:NC,bigint:ZC,boolean:ph,catch:Ib,check:hN,cidrv4:OC,cidrv6:AC,codec:uN,cuid:wC,cuid2:$C,custom:Wu,date:WC,describe:pN,discriminatedUnion:eN,e164:PC,email:dC,emoji:vC,enum:Sr,exactOptional:_b,file:sN,float32:LC,float64:zC,function:Ju,guid:fC,hash:UC,hex:DC,hostname:MC,httpUrl:yC,instanceof:gN,int:Hu,int32:FC,int64:VC,intersection:cb,ipv4:IC,ipv6:TC,json:yN,jwt:RC,keyof:KC,ksuid:xC,lazy:Nb,literal:gt,looseObject:YC,looseRecord:nN,mac:EC,map:rN,meta:mN,nan:lN,nanoid:bC,nativeEnum:aN,never:_h,nonoptional:Sb,null:gh,nullable:$s,nullish:oN,number:rt,object:je,optional:Wo,partialRecord:tN,pipe:Ko,prefault:$b,preprocess:vN,promise:fN,readonly:Ob,record:vh,refine:jb,set:iN,strictObject:XC,string:de,stringFormat:jC,stringbool:_N,success:cN,superRefine:Mb,symbol:GC,templateLiteral:dN,transform:bh,tuple:ub,uint32:BC,uint64:qC,ulid:SC,undefined:HC,union:$r,unknown:ua,url:_C,uuid:hC,uuidv4:pC,uuidv6:mC,uuidv7:gC,void:JC,xid:kC,xor:QC},Symbol.toStringTag,{value:"Module"})),pZ={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function mZ(e){Bt({customError:e})}function gZ(){return Bt().customError}var qg;qg||(qg={});var q={...hZ,...dZ,iso:XA},_Z=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function yZ(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function vZ(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let i=n[1];if(!i||!t.defs[i])throw new Error(`Reference not found: ${e}`);return t.defs[i]}throw new Error(`Reference not found: ${e}`)}function bN(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return q.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let i=e.$ref;if(t.refs.has(i))return t.refs.get(i);if(t.processing.has(i))return q.lazy(()=>{if(!t.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return t.refs.get(i)});t.processing.add(i);let a=vZ(i,t),s=Lt(a,t);return t.refs.set(i,s),t.processing.delete(i),s}if(e.enum!==void 0){let i=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&i.length===1&&i[0]===null)return q.null();if(i.length===0)return q.never();if(i.length===1)return q.literal(i[0]);if(i.every(s=>typeof s=="string"))return q.enum(i);let a=i.map(s=>q.literal(s));return a.length<2?a[0]:q.union([a[0],a[1],...a.slice(2)])}if(e.const!==void 0)return q.literal(e.const);let n=e.type;if(Array.isArray(n)){let i=n.map(a=>{let s={...e,type:a};return bN(s,t)});return i.length===0?q.never():i.length===1?i[0]:q.union(i)}if(!n)return q.any();let r;switch(n){case"string":{let i=q.string();if(e.format){let a=e.format;a==="email"?i=i.check(q.email()):a==="uri"||a==="uri-reference"?i=i.check(q.url()):a==="uuid"||a==="guid"?i=i.check(q.uuid()):a==="date-time"?i=i.check(q.iso.datetime()):a==="date"?i=i.check(q.iso.date()):a==="time"?i=i.check(q.iso.time()):a==="duration"?i=i.check(q.iso.duration()):a==="ipv4"?i=i.check(q.ipv4()):a==="ipv6"?i=i.check(q.ipv6()):a==="mac"?i=i.check(q.mac()):a==="cidr"?i=i.check(q.cidrv4()):a==="cidr-v6"?i=i.check(q.cidrv6()):a==="base64"?i=i.check(q.base64()):a==="base64url"?i=i.check(q.base64url()):a==="e164"?i=i.check(q.e164()):a==="jwt"?i=i.check(q.jwt()):a==="emoji"?i=i.check(q.emoji()):a==="nanoid"?i=i.check(q.nanoid()):a==="cuid"?i=i.check(q.cuid()):a==="cuid2"?i=i.check(q.cuid2()):a==="ulid"?i=i.check(q.ulid()):a==="xid"?i=i.check(q.xid()):a==="ksuid"&&(i=i.check(q.ksuid()))}typeof e.minLength=="number"&&(i=i.min(e.minLength)),typeof e.maxLength=="number"&&(i=i.max(e.maxLength)),e.pattern&&(i=i.regex(new RegExp(e.pattern))),r=i;break}case"number":case"integer":{let i=n==="integer"?q.number().int():q.number();typeof e.minimum=="number"&&(i=i.min(e.minimum)),typeof e.maximum=="number"&&(i=i.max(e.maximum)),typeof e.exclusiveMinimum=="number"?i=i.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(i=i.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?i=i.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(i=i.lt(e.maximum)),typeof e.multipleOf=="number"&&(i=i.multipleOf(e.multipleOf)),r=i;break}case"boolean":{r=q.boolean();break}case"null":{r=q.null();break}case"object":{let i={},a=e.properties||{},s=new Set(e.required||[]);for(let[c,l]of Object.entries(a)){let u=Lt(l,t);i[c]=s.has(c)?u:u.optional()}if(e.propertyNames){let c=Lt(e.propertyNames,t),l=e.additionalProperties&&typeof e.additionalProperties=="object"?Lt(e.additionalProperties,t):q.any();if(Object.keys(i).length===0){r=q.record(c,l);break}let u=q.object(i).passthrough(),d=q.looseRecord(c,l);r=q.intersection(u,d);break}if(e.patternProperties){let c=e.patternProperties,l=Object.keys(c),u=[];for(let f of l){let h=Lt(c[f],t),p=q.string().regex(new RegExp(f));u.push(q.looseRecord(p,h))}let d=[];if(Object.keys(i).length>0&&d.push(q.object(i).passthrough()),d.push(...u),d.length===0)r=q.object({}).passthrough();else if(d.length===1)r=d[0];else{let f=q.intersection(d[0],d[1]);for(let h=2;h<d.length;h++)f=q.intersection(f,d[h]);r=f}break}let o=q.object(i);e.additionalProperties===!1?r=o.strict():typeof e.additionalProperties=="object"?r=o.catchall(Lt(e.additionalProperties,t)):r=o.passthrough();break}case"array":{let i=e.prefixItems,a=e.items;if(i&&Array.isArray(i)){let s=i.map(c=>Lt(c,t)),o=a&&typeof a=="object"&&!Array.isArray(a)?Lt(a,t):void 0;o?r=q.tuple(s).rest(o):r=q.tuple(s),typeof e.minItems=="number"&&(r=r.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(q.maxLength(e.maxItems)))}else if(Array.isArray(a)){let s=a.map(c=>Lt(c,t)),o=e.additionalItems&&typeof e.additionalItems=="object"?Lt(e.additionalItems,t):void 0;o?r=q.tuple(s).rest(o):r=q.tuple(s),typeof e.minItems=="number"&&(r=r.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(q.maxLength(e.maxItems)))}else if(a!==void 0){let s=Lt(a,t),o=q.array(s);typeof e.minItems=="number"&&(o=o.min(e.minItems)),typeof e.maxItems=="number"&&(o=o.max(e.maxItems)),r=o}else r=q.array(q.any());break}default:throw new Error(`Unsupported type: ${n}`)}return e.description&&(r=r.describe(e.description)),e.default!==void 0&&(r=r.default(e.default)),r}function Lt(e,t){if(typeof e=="boolean")return e?q.any():q.never();let n=bN(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let o=e.anyOf.map(l=>Lt(l,t)),c=q.union(o);n=r?q.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let o=e.oneOf.map(l=>Lt(l,t)),c=q.xor(o);n=r?q.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:q.any();else{let o=r?n:Lt(e.allOf[0],t),c=r?0:1;for(let l=c;l<e.allOf.length;l++)o=q.intersection(o,Lt(e.allOf[l],t));n=o}e.nullable===!0&&t.version==="openapi-3.0"&&(n=q.nullable(n)),e.readOnly===!0&&(n=q.readonly(n));let i={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let o of a)o in e&&(i[o]=e[o]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let o of s)o in e&&(i[o]=e[o]);for(let o of Object.keys(e))_Z.has(o)||(i[o]=e[o]);return Object.keys(i).length>0&&t.registry.add(n,i),n}function bZ(e,t){if(typeof e=="boolean")return e?q.any():q.never();let n=yZ(e,t?.defaultTarget),r=e.$defs||e.definitions||{},i={version:n,defs:r,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??nt};return Lt(e,i)}function wZ(e){return ZT(Zc,e)}function $Z(e){return XT(qc,e)}function SZ(e){return iO(Gc,e)}function kZ(e){return sO(Hc,e)}function xZ(e){return mO(yh,e)}var IZ=Object.freeze(Object.defineProperty({__proto__:null,bigint:kZ,boolean:SZ,date:xZ,number:$Z,string:wZ},Symbol.toStringTag,{value:"Module"}));Bt(MT());var pt=Object.freeze(Object.defineProperty({__proto__:null,$brand:iI,$input:FT,$output:zT,NEVER:rI,TimePrecision:qT,ZodAny:eb,ZodArray:ib,ZodBase64:uh,ZodBase64URL:dh,ZodBigInt:Hc,ZodBigIntFormat:mh,ZodBoolean:Gc,ZodCIDRv4:ch,ZodCIDRv6:lh,ZodCUID:th,ZodCUID2:nh,ZodCatch:xb,ZodCodec:kh,ZodCustom:Xc,ZodCustomStringFormat:Bs,ZodDate:yh,ZodDefault:vb,ZodDiscriminatedUnion:sb,ZodE164:fh,ZodEmail:Yf,ZodEmoji:Qf,ZodEnum:ws,ZodError:fZ,ZodExactOptional:gb,ZodFile:pb,get ZodFirstPartyTypeKind(){return qg},ZodFunction:Rb,ZodGUID:Jo,ZodIPv4:sh,ZodIPv6:oh,ZodISODate:Hv,ZodISODateTime:Gv,ZodISODuration:Wv,ZodISOTime:Jv,ZodIntersection:ob,ZodIssueCode:pZ,ZodJWT:hh,ZodKSUID:ah,ZodLazy:Cb,ZodLiteral:hb,ZodMAC:Kv,ZodMap:db,ZodNaN:Eb,ZodNanoID:eh,ZodNever:nb,ZodNonOptional:$h,ZodNull:Qv,ZodNullable:yb,ZodNumber:qc,ZodNumberFormat:ba,ZodObject:Jc,ZodOptional:wh,ZodPipe:Sh,ZodPrefault:wb,ZodPromise:Pb,ZodReadonly:Tb,ZodRealError:kn,ZodRecord:Kc,ZodSet:fb,ZodString:Zc,ZodStringFormat:Ye,ZodSuccess:kb,ZodSymbol:Xv,ZodTemplateLiteral:Ab,ZodTransform:mb,ZodTuple:lb,ZodType:xe,ZodULID:rh,ZodURL:Vc,ZodUUID:dr,ZodUndefined:Yv,ZodUnion:Wc,ZodUnknown:tb,ZodVoid:rb,ZodXID:ih,ZodXor:ab,_ZodString:Xf,_default:bb,_function:Ju,any:Ga,array:lt,base64:CC,base64url:NC,bigint:ZC,boolean:ph,catch:Ib,check:hN,cidrv4:OC,cidrv6:AC,clone:mt,codec:uN,coerce:IZ,config:Bt,core:zF,cuid:wC,cuid2:$C,custom:Wu,date:WC,decode:iC,decodeAsync:sC,describe:pN,discriminatedUnion:eN,e164:PC,email:dC,emoji:vC,encode:rC,encodeAsync:aC,endsWith:Nf,enum:Sr,exactOptional:_b,file:sN,flattenError:py,float32:LC,float64:zC,formatError:my,fromJSONSchema:bZ,function:Ju,getErrorMap:gZ,globalRegistry:nt,gt:vi,gte:cn,guid:fC,hash:UC,hex:DC,hostname:MC,httpUrl:yC,includes:Af,instanceof:gN,int:Hu,int32:FC,int64:VC,intersection:cb,ipv4:IC,ipv6:TC,iso:XA,json:yN,jwt:RC,keyof:KC,ksuid:xC,lazy:Nb,length:Pc,literal:gt,locales:LT,looseObject:YC,looseRecord:nN,lowercase:Tf,lt:yi,lte:On,mac:EC,map:rN,maxLength:Nc,maxSize:Us,meta:mN,mime:Pf,minLength:ca,minSize:bi,multipleOf:fs,nan:lN,nanoid:bC,nativeEnum:aN,negative:cv,never:_h,nonnegative:uv,nonoptional:Sb,nonpositive:lv,normalize:Rf,null:gh,nullable:$s,nullish:oN,number:rt,object:je,optional:Wo,overwrite:Wr,parse:QA,parseAsync:eC,partialRecord:tN,pipe:Ko,positive:ov,prefault:$b,preprocess:vN,prettifyError:gy,promise:fN,property:dv,readonly:Ob,record:vh,refine:jb,regex:Ef,regexes:Ey,registry:Uy,safeDecode:cC,safeDecodeAsync:uC,safeEncode:oC,safeEncodeAsync:lC,safeParse:tC,safeParseAsync:nC,set:iN,setErrorMap:mZ,size:Cc,slugify:Uf,startsWith:Cf,strictObject:XC,string:de,stringFormat:jC,stringbool:_N,success:cN,superRefine:Mb,symbol:GC,templateLiteral:dN,toJSONSchema:Lo,toLowerCase:Mf,toUpperCase:Df,transform:bh,treeifyError:wI,trim:jf,tuple:ub,uint32:BC,uint64:qC,ulid:SC,undefined:HC,union:$r,unknown:ua,uppercase:Of,url:_C,util:vI,uuid:hC,uuidv4:pC,uuidv6:mC,uuidv7:gC,void:JC,xid:kC,xor:QC},Symbol.toStringTag,{value:"Module"})),EZ=Q({BaseToolkit:()=>TZ,DynamicStructuredTool:()=>SN,DynamicTool:()=>$N,StructuredTool:()=>xh,Tool:()=>wN,ToolInputParsingException:()=>yu,isLangChainTool:()=>Bc,isRunnableToolLike:()=>Vv,isStructuredTool:()=>Zv,isStructuredToolParams:()=>qv,tool:()=>OZ}),xh=class extends Ev{extras;returnDirect=!1;verboseParsingErrors=!1;get lc_namespace(){return["langchain","tools"]}responseFormat="content";defaultConfig;constructor(e){super(e??{}),this.verboseParsingErrors=e?.verboseParsingErrors??this.verboseParsingErrors,this.responseFormat=e?.responseFormat??this.responseFormat,this.defaultConfig=e?.defaultConfig??this.defaultConfig,this.metadata=e?.metadata??this.metadata,this.extras=e?.extras??this.extras}async invoke(e,t){let n,r=De(Tn(this.defaultConfig,t));return vo(e)?(n=e.args,r={...r,toolCall:e}):n=e,this.call(n,r)}async call(e,t,n){let r=vo(e)?e.args:e,i;if(bn(this.schema))try{i=await Lf(this.schema,r)}catch(h){let p="Received tool input did not match expected schema";throw this.verboseParsingErrors&&(p=`${p}
740
- Details: ${h.message}`),y1(h)&&(p=`${p}
741
-
742
- ${gy(h)}`),new yu(p,JSON.stringify(e))}else{let h=at(r,this.schema);if(!h.valid){let p="Received tool input did not match expected schema";throw this.verboseParsingErrors&&(p=`${p}
743
- Details: ${h.errors.map(m=>`${m.keywordLocation}: ${m.error}`).join(`
744
- `)}`),new yu(p,JSON.stringify(e))}i=r}let a=yc(t),s=Yt.configure(a.callbacks,this.callbacks,a.tags||n,this.tags,a.metadata,this.metadata,{verbose:this.verbose}),o;vo(e)&&(o=e.id),!o&&fj(a)&&(o=a.toolCall.id);let c=await s?.handleToolStart(this.toJSON(),typeof e=="string"?e:JSON.stringify(e),a.runId,void 0,void 0,void 0,a.runName,o);delete a.runId;let l;try{let h=await this._call(i,c,a);l=j1(h)?await J3(h,async p=>{try{await c?.handleToolEvent(p)}catch(m){await c?.handleToolError(m)}}):h}catch(h){throw await c?.handleToolError(h),h}let u,d;if(this.responseFormat==="content_and_artifact")if(Array.isArray(l)&&l.length===2)[u,d]=l;else throw new Error(`Tool response format is "content_and_artifact" but the output was not a two-tuple.
745
- Result: ${JSON.stringify(l)}`);else u=l;let f=AZ({content:u,artifact:d,toolCallId:o,name:this.name,metadata:this.metadata});return await c?.handleToolEnd(f),f}},wN=class extends xh{schema=jc({input:Bf().optional()}).transform(e=>e.input);constructor(e){super(e)}call(e,t){let n=typeof e=="string"||e==null?{input:e}:e;return super.call(n,t)}},$N=class extends wN{static lc_name(){return"DynamicTool"}name;description;func;constructor(e){super(e),this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect}async call(e,t){let n=yc(t);return n.runName===void 0&&(n.runName=this.name),super.call(e,n)}_call(e,t,n){return this.func(e,t,n)}},SN=class extends xh{static lc_name(){return"DynamicStructuredTool"}description;func;schema;constructor(e){super(e),this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect,this.schema=e.schema}async call(e,t,n){let r=yc(t);return r.runName===void 0&&(r.runName=this.name),super.call(e,r,n)}_call(e,t,n){return this.func(e,t,n)}},TZ=class{getTools(){return this.tools}};function OZ(e,t){let n=pv(t.schema),r=$o(t.schema);if(!t.schema||n||r)return new $N({...t,description:t.description??t.schema?.description??`${t.name} tool`,func:async(s,o,c)=>new Promise((l,u)=>{let d=Ve(c,{callbacks:o?.getChild()});Mt.runWithConfig(Br(d),async()=>{try{l(e(s,d))}catch(f){u(f)}})})});let i=t.schema,a=t.description??t.schema.description??`${t.name} tool`;return new SN({...t,description:a,schema:i,func:async(s,o,c)=>new Promise((l,u)=>{let d,f=()=>{c?.signal&&d&&c.signal.removeEventListener("abort",d)};c?.signal&&(d=()=>{f(),u(Ro(c.signal))},c.signal.addEventListener("abort",d,{once:!0}));let h=Ve(c,{callbacks:o?.getChild()});Mt.runWithConfig(Br(h),async()=>{try{let p=await e(s,h);if(j1(p)){l(p);return}if(c?.signal?.aborted){f();return}f(),l(p)}catch(p){f(),u(p)}})})})}function AZ(e){let{content:t,artifact:n,toolCallId:r,metadata:i}=e;return r&&!B_(t)?typeof t=="string"||Array.isArray(t)&&t.every(a=>typeof a=="object")?new Cn({status:"success",content:t,artifact:n,tool_call_id:r,name:e.name,metadata:i}):new Cn({status:"success",content:CZ(t),artifact:n,tool_call_id:r,name:e.name,metadata:i}):t}function CZ(e){try{return JSON.stringify(e)??""}catch{return`${e}`}}var NZ=Q({RunCollectorCallbackHandler:()=>PZ}),PZ=class extends Jr{name="run_collector";exampleId;tracedRuns;constructor({exampleId:e}={}){super({_awaitHandler:!0}),this.exampleId=e,this.tracedRuns=[]}async persistRun(e){let t={...e};t.reference_example_id=this.exampleId,this.tracedRuns.push(t)}},RZ=Q({}),jZ=Q({chunkArray:()=>kN}),kN=(e,t)=>e.reduce((n,r,i)=>{let a=Math.floor(i/t);return n[a]=(n[a]||[]).concat([r]),n},[]),MZ=Q({context:()=>DZ});function DZ(e,...t){let n=e.raw,r="";for(let i=0;i<n.length;i++){let a=n[i].replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\\{/g,"{");if(r+=a,i<t.length){let s=UZ(t[i],r);r+=typeof s=="string"?s:JSON.stringify(s)}}return r=LZ(r),r=r.trim(),r=r.replace(/\\n/g,`
746
- `),r}function UZ(e,t){if(typeof e!="string"||!e.includes(`
747
- `))return e;let n=t.slice(t.lastIndexOf(`
748
- `)+1).match(/^(\s+)/);if(n){let r=n[1];return e.replace(/\n/g,`
749
- ${r}`)}return e}function LZ(e){let t=e.split(`
750
- `),n=null;for(let r of t){let i=r.match(/^(\s+)\S+/);if(i){let a=i[1].length;n===null?n=a:n=Math.min(n,a)}}return n===null?e:t.map(r=>r[0]===" "||r[0]===" "?r.slice(n):r).join(`
751
- `)}var zZ=Q({EventStreamContentType:()=>FZ,convertEventStreamToIterableReadableDataStream:()=>ZZ,getBytes:()=>xN,getLines:()=>IN,getMessages:()=>EN}),FZ="text/event-stream";async function xN(e,t){if(e instanceof ReadableStream){let n=e.getReader();for(;;){let r=await n.read();if(r.done){t(new Uint8Array,!0);break}t(r.value)}}else try{for await(let n of e)t(new Uint8Array(n));t(new Uint8Array,!0)}catch(n){throw new Error(["Parsing event source stream failed.","Ensure your implementation of fetch returns a web or Node readable stream.",`Error: ${n.message}`].join(`
752
- `))}}var Ha=(function(e){return e[e.NewLine=10]="NewLine",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.Colon=58]="Colon",e})(Ha||{});function IN(e){let t,n,r,i=!1;return function(s,o){if(o){e(s,0,!0);return}t===void 0?(t=s,n=0,r=-1):t=BZ(t,s);let c=t.length,l=0;for(;n<c;){i&&(t[n]===Ha.NewLine&&(l=++n),i=!1);let u=-1;for(;n<c&&u===-1;++n)switch(t[n]){case Ha.Colon:r===-1&&(r=n-l);break;case Ha.CarriageReturn:i=!0;case Ha.NewLine:u=n;break}if(u===-1)break;e(t.subarray(l,u),r),l=n,r=-1}l===c?t=void 0:l!==0&&(t=t.subarray(l),n-=l)}}function EN(e,t,n){let r=cm(),i=new TextDecoder;return function(s,o,c){if(c){VZ(r)||(e?.(r),r=cm());return}if(s.length===0)e?.(r),r=cm();else if(o>0){let l=i.decode(s.subarray(0,o)),u=o+(s[o+1]===Ha.Space?2:1),d=i.decode(s.subarray(u));switch(l){case"data":r.data=r.data?r.data+`
753
- `+d:d;break;case"event":r.event=d;break;case"id":t?.(r.id=d);break;case"retry":{let f=parseInt(d,10);Number.isNaN(f)||n?.(r.retry=f);break}}}}}function BZ(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function cm(){return{data:"",event:"",id:"",retry:void 0}}function ZZ(e,t){let n=new ReadableStream({async start(r){let i=EN(s=>{if(s.event==="error")throw new Error(s.data??"Unspecified event streaming error.");s.event==="metadata"?t?.(s):s.data&&r.enqueue(s.data)});await xN(e,IN((s,o,c)=>{i(s,o,c),c&&r.close()}))}});return dn.fromReadableStream(n)}function VZ(e){return e.data===""&&e.event===""&&e.id===""&&e.retry===void 0}var qZ=Q({}),GZ=Q({convertToOpenAIFunction:()=>TN,convertToOpenAITool:()=>ON,isLangChainTool:()=>Bc,isRunnableToolLike:()=>Vv,isStructuredTool:()=>Zv,isStructuredToolParams:()=>qv});function TN(e,t){let n=typeof t=="number"?void 0:t;return{name:e.name,description:e.description,parameters:Et(e.schema),...n?.strict!==void 0?{strict:n.strict}:{}}}function ON(e,t){let n=typeof t=="number"?void 0:t,r;return Bc(e)?r={type:"function",function:TN(e)}:r=e,n?.strict!==void 0&&(r.function.strict=n.strict),r}function AN(e,t){let n=0,r=0,i=0;for(let a=0;a<e.length;a++)n+=e[a]*t[a],r+=e[a]*e[a],i+=t[a]*t[a];return n/(Math.sqrt(r)*Math.sqrt(i))}function HZ(e,t){let n=0;for(let r=0;r<e.length;r++)n+=e[r]*t[r];return n}function JZ(e,t){let n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t[r])*(e[r]-t[r]);return n}function WZ(e,t){return Math.sqrt(JZ(e,t))}var KZ=Q({cosineSimilarity:()=>Gg,euclideanDistance:()=>QZ,innerProduct:()=>YZ,matrixFunc:()=>Ih,maximalMarginalRelevance:()=>e8,normalize:()=>XZ});function Ih(e,t,n){if(e.length===0||e[0].length===0||t.length===0||t[0].length===0)return[[]];if(e[0].length!==t[0].length)throw new Error(`Number of columns in X and Y must be the same. X has shape ${[e.length,e[0].length]} and Y has shape ${[t.length,t[0].length]}.`);return e.map(r=>t.map(i=>n(r,i)).map(i=>Number.isNaN(i)?0:i))}function XZ(e,t=!1){let n=t8(e);return e.map(r=>r.map(i=>t?1-i/n:i/n))}function Gg(e,t){return Ih(e,t,AN)}function YZ(e,t){return Ih(e,t,HZ)}function QZ(e,t){return Ih(e,t,WZ)}function e8(e,t,n=.5,r=4){if(Math.min(r,t.length)<=0)return[];let i=Gg(Array.isArray(e[0])?e:[e],t)[0],a=CN(i).maxIndex,s=[t[a]],o=[a];for(;o.length<Math.min(r,t.length);){let c=-1/0,l=-1,u=Gg(t,s);i.forEach((d,f)=>{if(o.includes(f))return;let h=Math.max(...u[f]),p=n*d-(1-n)*h;p>c&&(c=p,l=f)}),s.push(t[l]),o.push(l)}return o}function CN(e){if(e.length===0)return{maxIndex:-1,maxValue:NaN};let t=e[0],n=0;for(let r=1;r<e.length;r+=1)e[r]>t&&(n=r,t=e[r]);return{maxIndex:n,maxValue:t}}function t8(e){return e.reduce((t,n)=>Math.max(t,CN(n).maxValue),0)}var n8=Q({isCloudMetadata:()=>Hg,isLocalhost:()=>Jg,isPrivateIp:()=>MN,isSafeUrl:()=>u8,isSameOrigin:()=>d8,validateSafeUrl:()=>DN}),r8=["10.0.0.0/8","172.16.0.0/12","192.168.0.0/16","127.0.0.0/8","169.254.0.0/16","0.0.0.0/8","::1/128","fc00::/7","fe80::/10","ff00::/8"],i8=["169.254.169.254","169.254.170.2","100.100.100.200"],a8=["metadata.google.internal","metadata","instance-data"],s8=["localhost","localhost.localdomain"],o8=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function NN(e){return o8.test(e)}function Eh(e){return jN(e)!==null}function PN(e){return NN(e)||Eh(e)}function RN(e){if(NN(e))return e.split(".").map(t=>parseInt(t,10));if(Eh(e)){let t=jN(e);if(!t)return null;let n=t.split(":"),r=[];for(let i of n)r.push(parseInt(i,16));return r}return null}function jN(e){if(!e||typeof e!="string"||!e.includes(":")||!/^[0-9a-fA-F:]+$/.test(e))return null;let t=e;if(t.includes("::")){let r=t.split("::");if(r.length>2)return null;let[i,a]=r,s=i?i.split(":"):[],o=a?a.split(":"):[],c=8-(s.length+o.length);if(c<0)return null;let l=Array(c).fill("0");t=[...s,...l,...o].filter(u=>u!=="").join(":")}let n=t.split(":");if(n.length!==8)return null;for(let r of n)if(r.length===0||r.length>4||!/^[0-9a-fA-F]+$/.test(r))return null;return n.map(r=>r.padStart(4,"0").toLowerCase()).join(":")}function c8(e){let[t,n]=e.split("/");if(!t||!n)return null;let r=RN(t);if(!r)return null;let i=parseInt(n,10);if(isNaN(i))return null;let a=Eh(t);return a&&i>128||!a&&i>32?null:{addr:r,prefixLen:i,isIpv6:a}}function l8(e,t){let n=RN(e);if(!n)return!1;let r=c8(t);if(!r)return!1;let i=Eh(e);if(i!==r.isIpv6)return!1;let{addr:a,prefixLen:s}=r;if(i)for(let o=0;o<Math.ceil(s/16);o++){let c=65535<<16-Math.min(16,s-o*16)&65535;if((n[o]&c)!==(a[o]&c))return!1}else for(let o=0;o<Math.ceil(s/8);o++){let c=255<<8-Math.min(8,s-o*8)&255;if((n[o]&c)!==(a[o]&c))return!1}return!0}function MN(e){if(!PN(e))return!1;for(let t of r8)if(l8(e,t))return!0;return!1}function Hg(e,t){if(i8.includes(t||""))return!0;let n=e.toLowerCase();return!!a8.includes(n)}function Jg(e,t){if(t&&(t==="127.0.0.1"||t==="::1"||t==="0.0.0.0"||t.startsWith("127.")))return!0;let n=e.toLowerCase();return!!s8.includes(n)}function DN(e,t){let n=t?.allowPrivate??!1,r=t?.allowHttp??!1;try{let i;try{i=new URL(e)}catch{throw new Error(`Invalid URL: ${e}`)}let a=i.hostname;if(!a)throw new Error("URL missing hostname.");if(Hg(a))throw new Error(`URL points to cloud metadata endpoint: ${a}`);if(Jg(a)){if(!n)throw new Error(`URL points to localhost: ${a}`);return e}let s=i.protocol;if(s!=="http:"&&s!=="https:")throw new Error(`Invalid URL scheme: ${s}. Only http and https are allowed.`);if(s==="http:"&&!r)throw new Error("HTTP scheme not allowed. Use HTTPS or set allowHttp: true.");if(PN(a)){let o=a;if(Jg(a,o)){if(!n)throw new Error(`URL points to localhost: ${a}`);return e}if(Hg(a,o))throw new Error(`URL resolves to cloud metadata IP: ${o} (${a})`);if(MN(o)&&!n)throw new Error(`URL resolves to private IP: ${o} (${a}). Set allowPrivate: true to allow.`);return e}return e}catch(i){throw i&&typeof i=="object"&&"message"in i?i:new Error(`URL validation failed: ${i}`)}}function u8(e,t){try{return DN(e,t),!0}catch{return!1}}function d8(e,t){try{return new URL(e).origin===new URL(t).origin}catch{return!1}}var f8=Q({SaveableVectorStore:()=>h8,VectorStore:()=>Db,VectorStoreRetriever:()=>tu}),tu=class extends Uv{static lc_name(){return"VectorStoreRetriever"}get lc_namespace(){return["langchain_core","vectorstores"]}vectorStore;k=4;searchType="similarity";searchKwargs;filter;_vectorstoreType(){return this.vectorStore._vectorstoreType()}constructor(e){super(e),this.vectorStore=e.vectorStore,this.k=e.k??this.k,this.searchType=e.searchType??this.searchType,this.filter=e.filter,e.searchType==="mmr"&&(this.searchKwargs=e.searchKwargs)}async _getRelevantDocuments(e,t){if(this.searchType==="mmr"){if(typeof this.vectorStore.maxMarginalRelevanceSearch!="function")throw new Error(`The vector store backing this retriever, ${this._vectorstoreType()} does not support max marginal relevance search.`);return this.vectorStore.maxMarginalRelevanceSearch(e,{k:this.k,filter:this.filter,...this.searchKwargs},t?.getChild("vectorstore"))}return this.vectorStore.similaritySearch(e,this.k,this.filter,t?.getChild("vectorstore"))}async addDocuments(e,t){return this.vectorStore.addDocuments(e,t)}},Db=class extends An{lc_namespace=["langchain","vectorstores",this._vectorstoreType()];embeddings;constructor(e,t){super(t),this.embeddings=e}async delete(e){throw new Error("Not implemented.")}async similaritySearch(e,t=4,n=void 0,r=void 0){return(await this.similaritySearchVectorWithScore(await this.embeddings.embedQuery(e),t,n)).map(i=>i[0])}async similaritySearchWithScore(e,t=4,n=void 0,r=void 0){return this.similaritySearchVectorWithScore(await this.embeddings.embedQuery(e),t,n)}static fromTexts(e,t,n,r){throw new Error("the Langchain vectorstore implementation you are using forgot to override this, please report a bug")}static fromDocuments(e,t,n){throw new Error("the Langchain vectorstore implementation you are using forgot to override this, please report a bug")}asRetriever(e,t,n,r,i,a){if(typeof e=="number")return new tu({vectorStore:this,k:e,filter:t,tags:[...r??[],this._vectorstoreType()],metadata:i,verbose:a,callbacks:n});{let s={vectorStore:this,k:e?.k,filter:e?.filter,tags:[...e?.tags??[],this._vectorstoreType()],metadata:e?.metadata,verbose:e?.verbose,callbacks:e?.callbacks,searchType:e?.searchType};return e?.searchType==="mmr"?new tu({...s,searchKwargs:e.searchKwargs}):new tu({...s})}}},h8=class extends Db{static load(e,t){throw new Error("Not implemented")}},p8=class extends va{_combineLLMOutput(){return[]}_llmType(){return"fake"}async _generate(e,t,n){if(t?.stop?.length)return{generations:[{message:new Ke(t.stop[0]),text:t.stop[0]}]};let r=e.map(i=>typeof i.content=="string"?i.content:JSON.stringify(i.content,null,2)).join(`
754
- `);return await n?.handleLLMNewToken(r),{generations:[{message:new Ke(r),text:r}],llmOutput:{}}}},m8=class UN extends va{sleep=50;responses=[];chunks=[];toolStyle="openai";thrownErrorString;tools=[];constructor({sleep:t=50,responses:n=[],chunks:r=[],toolStyle:i="openai",thrownErrorString:a,...s}){super(s),this.sleep=t,this.responses=n,this.chunks=r,this.toolStyle=i,this.thrownErrorString=a}_llmType(){return"fake"}bindTools(t){let n=[...this.tools,...t],r=n.map(s=>{switch(this.toolStyle){case"openai":return{type:"function",function:{name:s.name,description:s.description,parameters:Et(s.schema)}};case"anthropic":return{name:s.name,description:s.description,input_schema:Et(s.schema)};case"bedrock":return{toolSpec:{name:s.name,description:s.description,inputSchema:Et(s.schema)}};case"google":return{name:s.name,description:s.description,parameters:Et(s.schema)};default:throw new Error(`Unsupported tool style: ${this.toolStyle}`)}}),i=this.toolStyle==="google"?[{functionDeclarations:r}]:r,a=new UN({sleep:this.sleep,responses:this.responses,chunks:this.chunks,toolStyle:this.toolStyle,thrownErrorString:this.thrownErrorString});return a.tools=n,a.withConfig({tools:i})}async _generate(t,n,r){if(this.thrownErrorString)throw new Error(this.thrownErrorString);return{generations:[{text:"",message:new Ke({content:this.responses?.[0]?.content??t[0].content??"",tool_calls:this.chunks?.[0]?.tool_calls})}]}}async*_streamResponseChunks(t,n,r){if(this.thrownErrorString)throw new Error(this.thrownErrorString);if(this.chunks?.length){for(let s of this.chunks){let o=new Zr({message:new un({content:s.content,tool_calls:s.tool_calls,additional_kwargs:s.additional_kwargs??{}}),text:s.content?.toString()??""});if(n.signal?.aborted)break;yield o,await r?.handleLLMNewToken(s.content,void 0,void 0,void 0,void 0,{chunk:o})}return}let i=this.responses?.[0]??new Ke(typeof t[0].content=="string"?t[0].content:""),a=typeof i.content=="string"?i.content:"";for(let s of a){await new Promise(c=>setTimeout(c,this.sleep));let o=new Zr({message:new un({content:s}),text:s});if(n.signal?.aborted)break;yield o,await r?.handleLLMNewToken(s,void 0,void 0,void 0,void 0,{chunk:o})}}},g8=class LN extends va{static lc_name(){return"FakeListChatModel"}lc_serializable=!0;responses;i=0;sleep;emitCustomEvent=!1;generationInfo;tools=[];toolStyle="openai";constructor(t){super(t);let{responses:n,sleep:r,emitCustomEvent:i,generationInfo:a}=t;this.responses=n,this.sleep=r,this.emitCustomEvent=i??this.emitCustomEvent,this.generationInfo=a}_combineLLMOutput(){return[]}_llmType(){return"fake-list"}async _generate(t,n,r){if(await this._sleepIfRequested(),n?.thrownErrorString)throw new Error(n.thrownErrorString);if(this.emitCustomEvent&&await r?.handleCustomEvent("some_test_event",{someval:!0}),n?.stop?.length)return{generations:[this._formatGeneration(n.stop[0])]};{let i=this._currentResponse();return this._incrementResponse(),{generations:[this._formatGeneration(i)],llmOutput:{}}}}_formatGeneration(t){return{message:new Ke(t),text:t}}async*_streamResponseChunks(t,n,r){let i=this._currentResponse();this._incrementResponse(),this.emitCustomEvent&&await r?.handleCustomEvent("some_test_event",{someval:!0});let a=[...i];for(let s=0;s<a.length;s++){let o=a[s],c=s===a.length-1;if(await this._sleepIfRequested(),n?.thrownErrorString)throw new Error(n.thrownErrorString);let l=this._createResponseChunk(o,c?this.generationInfo:void 0);if(n.signal?.aborted)break;yield l,r?.handleLLMNewToken(o)}}async _sleepIfRequested(){this.sleep!==void 0&&await this._sleep()}async _sleep(){return new Promise(t=>{setTimeout(()=>t(),this.sleep)})}_createResponseChunk(t,n){return new Zr({message:new un({content:t}),text:t,generationInfo:n})}_currentResponse(){return this.responses[this.i]}_incrementResponse(){this.i<this.responses.length-1?this.i+=1:this.i=0}bindTools(t){let n=[...this.tools,...t],r=n.map(s=>{switch(this.toolStyle){case"openai":return{type:"function",function:{name:s.name,description:s.description,parameters:Et(s.schema)}};case"anthropic":return{name:s.name,description:s.description,input_schema:Et(s.schema)};case"bedrock":return{toolSpec:{name:s.name,description:s.description,inputSchema:Et(s.schema)}};case"google":return{name:s.name,description:s.description,parameters:Et(s.schema)};default:throw new Error(`Unsupported tool style: ${this.toolStyle}`)}}),i=this.toolStyle==="google"?[{functionDeclarations:r}]:r,a=new LN({responses:this.responses,sleep:this.sleep,emitCustomEvent:this.emitCustomEvent,generationInfo:this.generationInfo});return a.tools=n,a.toolStyle=this.toolStyle,a.i=this.i,a.withConfig({tools:i})}withStructuredOutput(t,n){return Qn.from(async r=>{let i=await this.invoke(r);if(i.tool_calls?.[0]?.args)return i.tool_calls[0].args;if(typeof i.content=="string")return JSON.parse(i.content);throw new Error("No structured output found")})}},_8=class extends Zf{vectorSize;constructor(e){super(e??{}),this.vectorSize=e?.vectorSize??4}async embedDocuments(e){return Promise.all(e.map(t=>this.embedQuery(t)))}async embedQuery(e){let t=e;t=t.toLowerCase().replaceAll(/[^a-z ]/g,"");let n=t.length%this.vectorSize,r=n===0?0:this.vectorSize-n,i=t.length+r;t=t.padEnd(i," ");let a=t.length/this.vectorSize,s=[];for(let o=0;o<t.length;o+=a)s.push(t.slice(o,o+a));return s.map(o=>{let c=0;for(let l=0;l<o.length;l+=1)c+=o===" "?0:o.charCodeAt(l);return c%26/26})}},y8=class extends Zf{constructor(e){super(e??{})}embedDocuments(e){return Promise.resolve(e.map(()=>[.1,.2,.3,.4]))}embedQuery(e){return Promise.resolve([.1,.2,.3,.4])}},v8=class extends Nv{response;thrownErrorString;constructor(e){super(e),this.response=e.response,this.thrownErrorString=e.thrownErrorString}_llmType(){return"fake"}async _call(e,t,n){if(this.thrownErrorString)throw new Error(this.thrownErrorString);let r=this.response??e;return await n?.handleLLMNewToken(r),r}},b8=class extends Nv{sleep=50;responses;thrownErrorString;constructor(e){super(e),this.sleep=e.sleep??this.sleep,this.responses=e.responses,this.thrownErrorString=e.thrownErrorString}_llmType(){return"fake"}async _call(e){if(this.thrownErrorString)throw new Error(this.thrownErrorString);let t=this.responses?.[0];return this.responses=this.responses?.slice(1),t??e}async*_streamResponseChunks(e,t,n){if(this.thrownErrorString)throw new Error(this.thrownErrorString);let r=this.responses?.[0];this.responses=this.responses?.slice(1);for(let i of r??e)await new Promise(a=>setTimeout(a,this.sleep)),yield{text:i,generationInfo:{}},await n?.handleLLMNewToken(i)}},w8=class extends q1{lc_namespace=["langchain_core","message","fake"];messages=[];constructor(){super()}async getMessages(){return this.messages}async addMessage(e){this.messages.push(e)}async addUserMessage(e){this.messages.push(new Vt(e))}async addAIMessage(e){this.messages.push(new Ke(e))}async clear(){this.messages=[]}},$8=class extends wv{lc_namespace=["langchain_core","message","fake"];messages=[];constructor(){super()}async addMessage(e){this.messages.push(e)}async getMessages(){return this.messages}},S8=class extends Jr{name="fake_tracer";runs=[];constructor(){super()}persistRun(e){return this.runs.push(e),Promise.resolve()}},k8=class extends zs{lc_namespace=["tests","fake"];getFormatInstructions(){return""}async parse(e){return e.split(",").map(t=>t.trim())}},x8=class extends Uv{lc_namespace=["test","fake"];output=[new di({pageContent:"foo"}),new di({pageContent:"bar"})];constructor(e){super(),this.output=e?.output??this.output}async _getRelevantDocuments(e){return this.output}},I8=class extends Re{lc_namespace=["tests","fake"];returnOptions;constructor(e){super(e),this.returnOptions=e.returnOptions}async invoke(e,t){return this.returnOptions?t??{}:{input:e}}},E8=class extends xh{name;description;schema;constructor(e){super(e),this.name=e.name,this.description=e.description,this.schema=e.schema}async _call(e,t){return JSON.stringify(e)}},T8=class extends Jr{runPromiseResolver;runPromise;name="single_run_extractor";constructor(){super(),this.runPromise=new Promise(e=>{this.runPromiseResolver=e})}async persistRun(e){this.runPromiseResolver(e)}async extract(){return this.runPromise}},O8=class zN extends Db{memoryVectors=[];similarity;_vectorstoreType(){return"memory"}constructor(t,{similarity:n,...r}={}){super(t,r),this.similarity=n??AN}async addDocuments(t){let n=t.map(({pageContent:r})=>r);return this.addVectors(await this.embeddings.embedDocuments(n),t)}async addVectors(t,n){let r=t.map((i,a)=>({content:n[a].pageContent,embedding:i,metadata:n[a].metadata}));this.memoryVectors=this.memoryVectors.concat(r)}async similaritySearchVectorWithScore(t,n,r){let i=s=>r?r(new di({metadata:s.metadata,pageContent:s.content})):!0,a=this.memoryVectors.filter(i);return a.map((s,o)=>({similarity:this.similarity(t,s.embedding),index:o})).sort((s,o)=>s.similarity>o.similarity?-1:0).slice(0,n).map(s=>[new di({metadata:a[s.index].metadata,pageContent:a[s.index].content}),s.similarity])}static async fromTexts(t,n,r,i){let a=[];for(let s=0;s<t.length;s+=1){let o=Array.isArray(n)?n[s]:n,c=new di({pageContent:t[s],metadata:o});a.push(c)}return zN.fromDocuments(a,r,i)}static async fromDocuments(t,n,r){let i=new this(n,r);return await i.addDocuments(t),i}static async fromExistingIndex(t,n){return new this(t,n)}},A8=Q({FakeChatMessageHistory:()=>w8,FakeChatModel:()=>p8,FakeEmbeddings:()=>y8,FakeLLM:()=>v8,FakeListChatMessageHistory:()=>$8,FakeListChatModel:()=>g8,FakeRetriever:()=>x8,FakeRunnable:()=>I8,FakeSplitIntoListParser:()=>k8,FakeStreamingChatModel:()=>m8,FakeStreamingLLM:()=>b8,FakeTool:()=>E8,FakeTracer:()=>S8,FakeVectorStore:()=>O8,SingleRunExtractor:()=>T8,SyntheticEmbeddings:()=>_8}),C8=Q({agents:()=>z4,caches:()=>Fj,callbacks__base:()=>rM,callbacks__manager:()=>sL,callbacks__promises:()=>nL,chat_history:()=>l9,document_loaders__base:()=>h9,document_loaders__langsmith:()=>p9,documents:()=>f9,embeddings:()=>_9,errors:()=>V4,example_selectors:()=>S9,index:()=>L4,indexing:()=>I9,language_models__base:()=>z9,language_models__chat_models:()=>uB,language_models__llms:()=>fB,language_models__profile:()=>hB,language_models__structured_output:()=>cB,load__serializable:()=>j4,memory:()=>pB,messages:()=>c9,messages__tool:()=>dj,output_parsers:()=>sB,output_parsers__openai_functions:()=>bB,output_parsers__openai_tools:()=>wB,outputs:()=>wL,prompt_values:()=>E9,prompts:()=>JB,retrievers:()=>XB,retrievers__document_compressors:()=>WB,runnables:()=>H9,runnables__graph:()=>F3,singletons:()=>lL,stores:()=>YB,structured_query:()=>aZ,testing:()=>uZ,tools:()=>EZ,tracers__base:()=>zU,tracers__console:()=>VU,tracers__log_stream:()=>vL,tracers__run_collector:()=>NZ,tracers__tracer_langchain:()=>KU,types__stream:()=>RZ,utils__async_caller:()=>AL,utils__chunk_array:()=>jZ,utils__context:()=>MZ,utils__env:()=>D4,utils__event_source_parse:()=>zZ,utils__format:()=>qZ,utils__function_calling:()=>GZ,utils__hash:()=>B4,utils__json_patch:()=>J9,utils__json_schema:()=>R3,utils__math:()=>KZ,utils__ssrf:()=>n8,utils__standard_schema:()=>PL,utils__stream:()=>dL,utils__testing:()=>A8,utils__tiktoken:()=>U9,utils__types:()=>oB,vectorstores:()=>f8}),N8=50;function P8(e){let t={};for(let n=e;n&&n.prototype;n=Object.getPrototypeOf(n))Object.assign(t,Reflect.get(n.prototype,"lc_aliases"));return Object.entries(t).reduce((n,[r,i])=>(n[i]=r,n),{})}async function nu(e){let{optionalImportsMap:t,optionalImportEntrypoints:n,importMap:r,secretsMap:i,secretsFromEnv:a,path:s,depth:o,maxDepth:c}=this,l=s.join(".");if(o>c)throw new Error(`Maximum recursion depth (${c}) exceeded during deserialization. This may indicate a malicious payload or you may need to increase maxDepth.`);if(typeof e!="object"||e==null)return e;if(Array.isArray(e))return Promise.all(e.map((f,h)=>nu.call({...this,path:[...s,`${h}`],depth:o+1},f)));let u=e;if(jk(u))return Dm(u);if("lc"in u&&"type"in u&&"id"in u&&u.lc===1&&u.type==="secret"){let[f]=u.id;if(f in i)return i[f];if(a){let h=wn(f);if(h)return h}throw new Error(`Missing secret "${f}" at ${l}`)}if("lc"in u&&"type"in u&&"id"in u&&u.lc===1&&u.type==="not_implemented"){let h=JSON.stringify(u);throw new Error(`Trying to load an object that doesn't implement serialization: ${l} -> ${h}`)}if("lc"in u&&"type"in u&&"id"in u&&"kwargs"in u&&u.lc===1&&u.type==="constructor"){let f=u,h=JSON.stringify(f),[p,...m]=f.id.slice().reverse(),v=m.reverse(),g={langchain_core:C8,langchain:r},y=null,$=[v.join("/")];v[0]==="langchain_community"&&$.push(["langchain",...v.slice(1)].join("/"));let S=$.find(T=>T in t);if(U4.concat(n).includes(v.join("/"))||S)if(S!==void 0)y=await t[S];else throw new Error(`Missing key "${v.join("/")}" for ${l} in load(optionalImportsMap={})`);else{let T;if(v[0]==="langchain"||v[0]==="langchain_core")T=g[v[0]],v.shift();else throw new Error(`Invalid namespace: ${l} -> ${h}`);if(v.length===0)throw new Error(`Invalid namespace: ${l} -> ${h}`);let b;do{if(b=v.join("__"),b in T)break;v.pop()}while(v.length>0);b in T&&(y=T[b])}if(typeof y!="object"||y===null)throw new Error(`Invalid namespace: ${l} -> ${h}`);let x=y[p]??Object.values(y).find(T=>typeof T=="function"&&uf(T)===p);if(typeof x!="function")throw new Error(`Invalid identifer: ${l} -> ${h}`);let C=new x(Pk(await nu.call({...this,path:[...s,"kwargs"],depth:o+1},f.kwargs),A4,P8(x)));return Object.defineProperty(C.constructor,"name",{value:p}),C}let d={};for(let[f,h]of Object.entries(u))d[f]=await nu.call({...this,path:[...s,f],depth:o+1},h);return d}async function R8(e,t){let n=JSON.parse(e),r={optionalImportsMap:{},optionalImportEntrypoints:[],secretsMap:{},secretsFromEnv:!1,importMap:{},path:["$"],depth:0,maxDepth:N8};return nu.call(r,n)}function j8(e){return e!==null&&e.lc===1&&e.type==="constructor"&&Array.isArray(e.id)}async function Wg(e){if(e&&typeof e=="object"){if(Array.isArray(e))return await Promise.all(e.map(t=>Wg(t)));{let t={};for(let[n,r]of Object.entries(e))t[n]=await Wg(r);if(t.lc===2&&t.type==="undefined")return;if(t.lc===2&&t.type==="constructor"&&Array.isArray(t.id))try{let n=t.id[t.id.length-1],r;switch(n){case"Set":r=Set;break;case"Map":r=Map;break;case"RegExp":r=RegExp;break;case"Error":r=Error;break;case"Uint8Array":r=Uint8Array;break;default:return t}return t.method?r[t.method](...t.args||[]):new r(...t.args||[])}catch{return t}else if(j8(t))return R8(JSON.stringify(t));return t}}return e}function xl(e,t,n,r){return{lc:2,type:"constructor",id:[e.name],method:t??null,args:n??[],kwargs:r??{}}}function M8(e){return e===void 0?{lc:2,type:"undefined"}:e instanceof Set||e instanceof Map?xl(e.constructor,void 0,[Array.from(e)]):e instanceof RegExp?xl(RegExp,void 0,[e.source,e.flags]):e instanceof Error?xl(e.constructor,void 0,[e.message]):e?.lg_name==="Send"?{node:e.node,args:e.args}:e instanceof Uint8Array?xl(Uint8Array,"from",[Array.from(e)]):e}var D8=class{_dumps(e){return new TextEncoder().encode(w4(e,(t,n)=>M8(n)))}async dumpsTyped(e){return e instanceof Uint8Array?["bytes",e]:["json",this._dumps(e)]}async _loads(e){return Wg(JSON.parse(e))}async loadsTyped(e,t){if(e==="bytes")return typeof t=="string"?new TextEncoder().encode(t):t;if(e==="json")return this._loads(typeof t=="string"?t:new TextDecoder().decode(t));throw new Error(`Unknown serialization type: ${e}`)}};function FN(e){if(typeof e!="object"||e===null)return e;let t=Array.isArray(e)?[]:{};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=FN(e[n]));return t}function BN(){return{v:4,id:Nk(-2),ts:new Date().toISOString(),channel_values:{},channel_versions:{},versions_seen:{}}}function Ku(e){return{v:e.v,id:e.id,ts:e.ts,channel_values:{...e.channel_values},channel_versions:{...e.channel_versions},versions_seen:FN(e.versions_seen)}}function ZN(e,t){return typeof e=="number"&&typeof t=="number"?Math.sign(e-t):String(e).localeCompare(String(t))}function U8(...e){return e.reduce((t,n,r)=>r===0?n:ZN(t,n)>=0?t:n)}var L8={[g4]:-1,[ql]:-2,[_4]:-3,[y4]:-4},Ws=class extends Error{constructor(e){super(e),this.name="InvalidNamespaceError"}};function z8(e){if(e.length===0)throw new Ws("Namespace cannot be empty.");for(let t of e){if(typeof t!="string")throw new Ws(`Invalid namespace label '${t}' found in ${e}. Namespace labels must be strings, but got ${typeof t}.`);if(t.includes("."))throw new Ws(`Invalid namespace label '${t}' found in ${e}. Namespace labels cannot contain periods ('.').`);if(t==="")throw new Ws(`Namespace labels cannot be empty strings. Got ${t} in ${e}`)}if(e[0]==="langgraph")throw new Ws(`Root label for namespace cannot be "langgraph". Got: ${e}`)}var F8=class{async get(e,t){return(await this.batch([{namespace:e,key:t}]))[0]}async search(e,t={}){let{filter:n,limit:r=10,offset:i=0,query:a}=t;return(await this.batch([{namespacePrefix:e,filter:n,limit:r,offset:i,query:a}]))[0]}async put(e,t,n,r){z8(e),await this.batch([{namespace:e,key:t,value:n,index:r}])}async delete(e,t){await this.batch([{namespace:e,key:t,value:null}])}async listNamespaces(e={}){let{prefix:t,suffix:n,maxDepth:r,limit:i=100,offset:a=0}=e,s=[];return t&&s.push({matchType:"prefix",path:t}),n&&s.push({matchType:"suffix",path:n}),(await this.batch([{matchConditions:s.length?s:void 0,maxDepth:r,limit:i,offset:a}]))[0]}start(){}stop(){}},B8=e=>"lg_name"in e&&e.lg_name==="AsyncBatchedStore"?e.store:e,Z8=class extends F8{lg_name="AsyncBatchedStore";store;queue=new Map;nextKey=0;running=!1;processingTask=null;constructor(e){super(),this.store=B8(e)}get isRunning(){return this.running}async batch(e){throw new Error("The `batch` method is not implemented on `AsyncBatchedStore`.\n Instead, it calls the `batch` method on the wrapped store.\n If you are seeing this error, something is wrong.")}async get(e,t){return this.enqueueOperation({namespace:e,key:t})}async search(e,t){let{filter:n,limit:r=10,offset:i=0,query:a}=t||{};return this.enqueueOperation({namespacePrefix:e,filter:n,limit:r,offset:i,query:a})}async put(e,t,n){return this.enqueueOperation({namespace:e,key:t,value:n})}async delete(e,t){return this.enqueueOperation({namespace:e,key:t,value:null})}start(){this.running||(this.running=!0,this.processingTask=this.processBatchQueue())}async stop(){this.running=!1,this.processingTask&&await this.processingTask}enqueueOperation(e){return new Promise((t,n)=>{let r=this.nextKey;this.nextKey+=1,this.queue.set(r,{operation:e,resolve:t,reject:n})})}async processBatchQueue(){for(;this.running;){if(await new Promise(t=>{setTimeout(t,0)}),this.queue.size===0)continue;let e=new Map(this.queue);this.queue.clear();try{let t=Array.from(e.values()).map(({operation:r})=>r),n=await this.store.batch(t);e.forEach(({resolve:r},i)=>{r(n[Array.from(e.keys()).indexOf(i)])})}catch(t){e.forEach(({reject:n})=>{n(t)})}}}toJSON(){return{queue:this.queue,nextKey:this.nextKey,running:this.running,store:"[LangGraphStore]"}}},V8=class{serde=new D8;constructor(e){this.serde=e||this.serde}};function VN(e){return e!=null&&e.lg_is_channel===!0}var Ci=class{ValueType;UpdateType;lg_is_channel=!0;consume(){return!1}finish(){return!1}isAvailable(){try{return this.get(),!0}catch(e){if(e.name===Tt.unminifiable_name)return!1;throw e}}equals(e){return this===e}},Kg=Symbol.for("LG_IS_ONLY_BASE_CHANNEL");function Ub(e){if(e[Kg]===!0)return e;let t={};for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=e[n];VN(r)&&(t[n]=r)}return Object.assign(t,{[Kg]:!0}),t}function Xu(e,t){let n=Ub(e),r={};for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i))continue;let a=t.channel_values[i];r[i]=n[i].fromCheckpoint(a)}return Object.assign(r,{[Kg]:!0}),r}function Fi(e,t,n,r){let i;if(t===void 0)i=e.channel_values;else{i={};for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a))try{i[a]=t[a].checkpoint()}catch(s){if(s.name!==Tt.unminifiable_name)throw s}}return{v:4,id:r?.id??Nk(n),ts:new Date().toISOString(),channel_values:i,channel_versions:e.channel_versions,versions_seen:e.versions_seen}}var q8=e=>e!=null&&e.lc_graph_name==="BinaryOperatorAggregate",Yu=class qN extends Ci{lc_graph_name="BinaryOperatorAggregate";value;operator;initialValueFactory;constructor(t,n){super(),this.operator=t,this.initialValueFactory=n,this.value=n?.()}fromCheckpoint(t){let n=new qN(this.operator,this.initialValueFactory);return typeof t<"u"&&(n.value=t),n}update(t){let n=t;if(!n.length)return!1;if(this.value===void 0){let i=n[0],[a,s]=Pm(i);a?this.value=s:this.value=i,n=n.slice(1)}let r=!1;for(let i of n)if(KR(i)){if(r)throw new Qe("Can receive only one Overwrite value per step.");let[,a]=Pm(i);this.value=a,r=!0;continue}else!r&&this.value!==void 0&&(this.value=this.operator(this.value,i));return!0}get(){if(this.value===void 0)throw new Tt;return this.value}checkpoint(){if(this.value===void 0)throw new Tt;return this.value}isAvailable(){return this.value!==void 0}equals(t){return this===t?!0:q8(t)?this.operator===t.operator:!1}},Th=class GN extends Ci{lc_graph_name="LastValue";value=[];constructor(t){super(),this.initialValueFactory=t,t&&(this.value=[t()])}fromCheckpoint(t){let n=new GN(this.initialValueFactory);return typeof t<"u"&&(n.value=[t]),n}update(t){if(t.length===0)return!1;if(t.length!==1)throw new Qe("LastValue can only receive one value per step.",{lc_error_code:"INVALID_CONCURRENT_GRAPH_UPDATE"});return this.value=[t[t.length-1]],!0}get(){if(this.value.length===0)throw new Tt;return this.value[0]}checkpoint(){if(this.value.length===0)throw new Tt;return this.value[0]}isAvailable(){return this.value.length!==0}},G8=class HN extends Ci{lc_graph_name="LastValueAfterFinish";value=[];finished=!1;fromCheckpoint(t){let n=new HN;if(typeof t<"u"){let[r,i]=t;n.value=[r],n.finished=i}return n}update(t){return t.length===0?!1:(this.finished=!1,this.value=[t[t.length-1]],!0)}get(){if(this.value.length===0||!this.finished)throw new Tt;return this.value[0]}checkpoint(){if(this.value.length!==0)return[this.value[0],this.finished]}consume(){return this.finished?(this.finished=!1,this.value=[],!0):!1}finish(){return!this.finished&&this.value.length>0?(this.finished=!0,!0):!1}isAvailable(){return this.value.length!==0&&this.finished}},Xg=class{lc_graph_name="AnnotationRoot";spec;constructor(e){this.spec=e}static isInstance(e){return typeof e=="object"&&e!==null&&"lc_graph_name"in e&&e.lc_graph_name==="AnnotationRoot"}},Ae=function(e){return e?Yg(e):new Th};Ae.Root=e=>new Xg(e);function Yg(e){return typeof e=="object"&&e&&"reducer"in e&&e.reducer?new Yu(e.reducer,e.default):typeof e=="object"&&e&&"value"in e&&e.value?new Yu(e.value,e.default):new Th}var H8=["tags","metadata","callbacks","configurable"],J8=["tags","metadata","callbacks","runName","maxConcurrency","recursionLimit","configurable","runId","outputKeys","streamMode","store","writer","interrupt","context","interruptBefore","interruptAfter","checkpointDuring","durability","signal"],W8=25;function JN(...e){let t={tags:[],metadata:{},callbacks:void 0,recursionLimit:W8,configurable:{}},n=Mt.getRunnableConfig();if(n!==void 0){for(let[r,i]of Object.entries(n))if(i!==void 0)if(H8.includes(r)){let a;Array.isArray(i)?a=[...i]:typeof i=="object"?r==="callbacks"&&"copy"in i&&typeof i.copy=="function"?a=i.copy():a={...i}:a=i,t[r]=a}else t[r]=i}for(let r of e)if(r!==void 0)for(let[i,a]of Object.entries(r))a!==void 0&&J8.includes(i)&&(t[i]=a);for(let[r,i]of Object.entries(t.configurable))t.metadata=t.metadata??{},!r.startsWith("__")&&(typeof i=="string"||typeof i=="number"||typeof i=="boolean")&&!(r in t.metadata)&&(t.metadata[r]=i);return t}function K8(){return Mt.getRunnableConfig()}function lm(e){return e.split("|").filter(t=>!t.match(/^\d+$/)).map(t=>t.split(":")[0]).join("|")}function X8(e){let t=e.split("|");for(;t.length>1&&t[t.length-1].match(/^\d+$/);)t.pop();return t.slice(0,-1).join("|")}var F=e=>BigInt(e),Je=(e,t=0)=>new DataView(e.buffer,e.byteOffset+t,e.byteLength-t),WN=F("0x9E3779B1"),KN=F("0x85EBCA77"),Y8=F("0xC2B2AE3D"),xi=F("0x9E3779B185EBCA87"),da=F("0xC2B2AE3D27D4EB4F"),XN=F("0x165667B19E3779F9"),Lb=F("0x85EBCA77C2B2AE63"),Q8=F("0x27D4EB2F165667C5"),eV=F("0x165667919E3779F9"),tV=F("0x9FB21C651E98DF25"),nV=e=>{let t=e.length;if(t%2!==0)throw new Error("String should have an even number of characters");let n=t/2,r=new Uint8Array(n),i=0,a=0;for(;a<n;){let s=e.slice(i,i+=2);r[a]=Number.parseInt(s,16),a+=1}return Je(r)},ar=nV("b8fe6c3923a44bbe7c01812cf721ad1cded46de9839097db7240a4a4b7b3671fcb79e64eccc0e578825ad07dccff7221b8084674f743248ee03590e6813a264c3c2852bb91c300cb88d0658b1b532ea371644897a20df94e3819ef46a9deacd8a8fa763fe39c343ff9dcbbc7c70b4f1d8a51e04bcdb45931c89f7ec9d9787364eac5ac8334d3ebc3c581a0fffa1363eb170ddd51b7f0da49d316552629d4689e2b16be587d47a1fc8ff8b8d17ad031ce45cb3a8f95160428afd7fbcabb4b407e"),Ya=(F(1)<<F(128))-F(1),Te=(F(1)<<F(64))-F(1),Qu=(F(1)<<F(32))-F(1),Pr=64,YN=Pr/8,rV=8,Il=4;function Ss(e){if(!e)throw new Error("Assert failed")}function iV(e){let t=new DataView(new ArrayBuffer(8));return t.setBigUint64(0,e,!0),t.getBigUint64(0,!1)}function aV(e){let t=e;return t=(t&F(65535))<<F(16)|(t&F(4294901760))>>F(16),t=(t&F(16711935))<<F(8)|(t&F(4278255360))>>F(8),t}function sV(e,t){return(e&Qu)*(t&Qu)&Te}function oV(e,t){return(e<<t|e>>F(32)-t)&Qu}function QN(e,t,n){for(let r=0;r<YN;r+=1){let i=t.getBigUint64(r*8,!0),a=i^n.getBigUint64(r*8,!0);e[r^1]+=i,e[r]+=sV(a,a>>F(32))}return e}function TS(e,t,n,r){for(let i=0;i<r;i+=1)QN(e,Je(t,i*Pr),Je(n,i*8));return e}function cV(e,t){for(let n=0;n<YN;n+=1){let r=t.getBigUint64(n*8,!0),i=e[n];i=Qg(i,F(47)),i^=r,i*=WN,e[n]=i&Te}return e}function El(e,t){return eP(e[0]^t.getBigUint64(0,!0),e[1]^t.getBigUint64(rV,!0))}function OS(e,t,n){let r=n;return r+=El(e.slice(0),Je(t,0*Il)),r+=El(e.slice(2),Je(t,4*Il)),r+=El(e.slice(4),Je(t,8*Il)),r+=El(e.slice(6),Je(t,12*Il)),fr(r&Te)}function lV(e,t,n,r,i){let a=e,s=Math.floor((n.byteLength-Pr)/8),o=Pr*s,c=Math.floor((t.byteLength-1)/o);for(let l=0;l<c;l+=1)a=TS(a,Je(t,l*o),n,s),a=i(a,Je(n,n.byteLength-Pr));{let l=Math.floor((t.byteLength-1-o*c)/Pr);a=TS(a,Je(t,c*o),n,l),a=r(a,Je(t,t.byteLength-Pr),Je(n,n.byteLength-Pr-7))}return a}function uV(e,t){let n=new BigUint64Array([Y8,xi,da,XN,Lb,KN,Q8,WN]);Ss(e.byteLength>128),n=lV(n,e,t,QN,cV),Ss(n.length*8===64);{let r=OS(n,Je(t,11),F(e.byteLength)*xi&Te);return OS(n,Je(t,t.byteLength-Pr-11),~(F(e.byteLength)*da)&Te)<<F(64)|r}}function eP(e,t){let n=e*t&Ya;return n&Te^n>>F(64)}function AS(e,t,n){return eP((e.getBigUint64(0,!0)^t.getBigUint64(0,!0)+n)&Te,(e.getBigUint64(8,!0)^t.getBigUint64(8,!0)-n)&Te)}function ru(e,t,n,r,i){let a=e&Te,s=e>>F(64)&Te;return a+=AS(t,r,i),a^=n.getBigUint64(0,!0)+n.getBigUint64(8,!0),a&=Te,s+=AS(n,Je(r,16),i),s^=t.getBigUint64(0,!0)+t.getBigUint64(8,!0),s&=Te,s<<F(64)|a}function fr(e){let t=e;return t^=t>>F(37),t*=eV,t&=Te,t^=t>>F(32),t}function ed(e){let t=e;return t^=t>>F(33),t*=da,t&=Te,t^=t>>F(29),t*=XN,t&=Te,t^=t>>F(32),t}function dV(e,t,n){let r=e.byteLength;Ss(r>0&&r<=3);let i=F(e.getUint8(r-1))|F(r<<8)|F(e.getUint8(0)<<16)|F(e.getUint8(r>>1)<<24),a=(i^(F(t.getUint32(0,!0))^F(t.getUint32(4,!0)))+n)&Te,s=(F(t.getUint32(8,!0))^F(t.getUint32(12,!0)))-n;return(ed((oV(aV(i),F(13))^s)&Te)&Te)<<F(64)|ed(a)}function Qg(e,t){return e^e>>t}function fV(e,t,n){let r=e.byteLength;Ss(r>=4&&r<=8);{let i=e.getUint32(0,!0),a=e.getUint32(r-4,!0),s=((F(i)|F(a)<<F(32))^(t.getBigUint64(16,!0)^t.getBigUint64(24,!0))+n&Te)*(xi+(F(r)<<F(2)))&Ya;return s+=(s&Te)<<F(65),s&=Ya,s^=s>>F(67),Qg(Qg(s&Te,F(35))*tV&Te,F(28))|fr(s>>F(64))<<F(64)}}function hV(e,t,n){let r=e.byteLength;Ss(r>=9&&r<=16);{let i=(t.getBigUint64(32,!0)^t.getBigUint64(40,!0))+n&Te,a=(t.getBigUint64(48,!0)^t.getBigUint64(56,!0))-n&Te,s=e.getBigUint64(0,!0),o=e.getBigUint64(r-8,!0),c=(s^o^i)*xi,l=(c&Te)+(F(r-1)<<F(54));c=c&(Ya^Te)|l,o^=a,c+=o+(o&Qu)*(KN-F(1))<<F(64),c&=Ya,c^=iV(c>>F(64));let u=(c&Te)*da;return u+=(c>>F(64))*da<<F(64),u&=Ya,fr(u&Te)|fr(u>>F(64))<<F(64)}}function pV(e,t){let n=e.byteLength;return Ss(n<=16),n>8?hV(e,ar,t):n>=4?fV(e,ar,t):n>0?dV(e,ar,t):ed(t^ar.getBigUint64(64,!0)^ar.getBigUint64(72,!0))|ed(t^ar.getBigUint64(80,!0)^ar.getBigUint64(88,!0))<<F(64)}function e_(e){return~e+F(1)&Te}function mV(e,t,n){let r=F(e.byteLength)*xi&Te,i=F(e.byteLength-1)/F(32);for(;i>=0;){let o=Number(i);r=ru(r,Je(e,16*o),Je(e,e.byteLength-16*(o+1)),Je(t,32*o),n),i-=F(1)}let a=r+(r>>F(64))&Te;a=fr(a);let s=(r&Te)*xi+(r>>F(64))*Lb+(F(e.byteLength)-n&Te)*da;return s&=Te,s=e_(fr(s)),a|s<<F(64)}function gV(e,t,n){let r=F(e.byteLength)*xi&Te;for(let s=32;s<160;s+=32)r=ru(r,Je(e,s-32),Je(e,s-16),Je(t,s-32),n);r=fr(r&Te)|fr(r>>F(64))<<F(64);for(let s=160;s<=e.byteLength;s+=32)r=ru(r,Je(e,s-32),Je(e,s-16),Je(t,3+s-160),n);r=ru(r,Je(e,e.byteLength-16),Je(e,e.byteLength-32),Je(t,103),e_(n));let i=r+(r>>F(64))&Te;i=fr(i);let a=(r&Te)*xi+(r>>F(64))*Lb+(F(e.byteLength)-n&Te)*da;return a&=Te,a=e_(fr(a)),i|a<<F(64)}function Di(e,t=F(0)){let n=new TextEncoder,r=Je(typeof e=="string"?n.encode(e):e),i=r.byteLength,a=s=>s.toString(16).padStart(32,"0");return i<=16?a(pV(r,t)):i<=128?a(mV(r,ar,t)):i<=240?a(gV(r,ar,t)):a(uV(r,ar))}function tP(e){return/^[0-9a-f]{32}$/.test(e)}function _V(e){let t=Mt.getRunnableConfig();if(!t)throw new Error("Called interrupt() outside the context of a graph.");let n=t.configurable;if(!n)throw new Error("No configurable found in config");if(!n.__pregel_checkpointer)throw new Zl("No checkpointer set",{lc_error_code:"MISSING_CHECKPOINTER"});let r=n[oi];r.interruptCounter+=1;let i=r.interruptCounter;if(r.resume.length>0&&i<r.resume.length)return n[si]?.([[hi,r.resume]]),r.resume[i];if(r.nullResume!==void 0){if(r.resume.length!==i)throw new Error(`Resume length mismatch: ${r.resume.length} !== ${i}`);let s=r.consumeNullResume();return r.resume.push(s),n[si]?.([[hi,r.resume]]),s}let a=n[jr]?.split("|");throw new Ka([{id:a?Di(a.join("|")):void 0,value:e}])}var wa=class extends Re{lc_namespace=["langgraph"];func;tags;config;trace=!0;recurse=!0;constructor(e){super(),this.name=e.name??e.func.name,this.func=e.func,this.config=e.tags?{tags:e.tags}:void 0,this.trace=e.trace??this.trace,this.recurse=e.recurse??this.recurse}async _tracedInvoke(e,t,n){return new Promise((r,i)=>{let a=Ve(t,{callbacks:n?.getChild()});Mt.runWithConfig(a,async()=>{try{r(await this.func(e,a))}catch(s){i(s)}})})}async invoke(e,t){let n,r=JN(t),i=Tn(this.config,r);return this.trace?n=await this._callWithConfig(this._tracedInvoke,e,i):n=await Mt.runWithConfig(i,async()=>this.func(e,i)),Re.isRunnable(n)&&this.recurse?await Mt.runWithConfig(i,async()=>n.invoke(e,i)):n}};function*Xr(e,t){if(t===void 0)yield*e;else for(let n of e)yield[t,n]}async function ri(e){let t=[];for await(let n of await e)t.push(n);return t}function so(e){let t=[];for(let n of e)t.push(n);return t}function Ia(e,t){return e?"configurable"in e?{...e,configurable:{...e.configurable,...t}}:{...e,configurable:t}:{configurable:t}}function yV(e){return typeof e=="object"&&e?.[Symbol.for("LG_SKIP_WRITE")]!==void 0}var ta={[Symbol.for("LG_PASSTHROUGH")]:!0};function Tl(e){return typeof e=="object"&&e?.[Symbol.for("LG_PASSTHROUGH")]!==void 0}var um=Symbol("IS_WRITER"),Wt=class t_ extends wa{writes;constructor(t,n){let r=`ChannelWrite<${t.map(i=>ln(i)?i.node:"channel"in i?i.channel:"...").join(",")}>`;super({writes:t,name:r,tags:n,trace:!1,func:async(i,a)=>this._write(i,a??{})}),this.writes=t}async _write(t,n){let r=this.writes.map(i=>dm(i)&&Tl(i.value)?{mapper:i.mapper,value:t}:iu(i)&&Tl(i.value)?{channel:i.channel,value:t,skipNone:i.skipNone,mapper:i.mapper}:i);return await t_.doWrite(n,r),t}static async doWrite(t,n){for(let a of n){if(iu(a)){if(a.channel==="__pregel_tasks")throw new Qe("Cannot write to the reserved channel TASKS");if(Tl(a.value))throw new Qe("PASSTHROUGH value must be replaced")}if(dm(a)&&Tl(a.value))throw new Qe("PASSTHROUGH value must be replaced")}let r=[];for(let a of n)if(ln(a))r.push([es,a]);else if(dm(a)){let s=await a.mapper.invoke(a.value,t);s!=null&&s.length>0&&r.push(...s)}else if(iu(a)){let s=a.mapper!==void 0?await a.mapper.invoke(a.value,t):a.value;if(yV(s)||a.skipNone&&s===void 0)continue;r.push([a.channel,s])}else throw new Error(`Invalid write entry: ${JSON.stringify(a)}`);let i=t.configurable?.[si];i(r)}static isWriter(t){return t instanceof t_||um in t&&!!t[um]}static registerWriter(t){return Object.defineProperty(t,um,{value:!0})}};function iu(e){return e!==void 0&&typeof e.channel=="string"}function dm(e){return e!==void 0&&!iu(e)&&Re.isRunnable(e.mapper)}var vV=class nP extends wa{lc_graph_name="ChannelRead";channel;fresh=!1;mapper;constructor(t,n,r=!1){super({trace:!1,func:(i,a)=>nP.doRead(a,this.channel,this.fresh,this.mapper)}),this.fresh=r,this.mapper=n,this.channel=t,this.name=Array.isArray(t)?`ChannelRead<${t.join(",")}>`:`ChannelRead<${t}>`}static doRead(t,n,r,i){let a=t.configurable?.[Ki];if(!a)throw new Error("Runnable is not configured with a read function. Make sure to call in the context of a Pregel process");return i?i(a(n,r)):a(n,r)}},Ea=new Zo,Xo=class oo extends Si{lc_graph_name="PregelNode";channels;triggers=[];mapper;writers=[];bound=Ea;kwargs={};metadata={};tags=[];retryPolicy;cachePolicy;subgraphs;ends;constructor(t){let{channels:n,triggers:r,mapper:i,writers:a,bound:s,kwargs:o,metadata:c,retryPolicy:l,cachePolicy:u,tags:d,subgraphs:f,ends:h}=t,p=[...t.config?.tags?t.config.tags:[],...d??[]];super({...t,bound:t.bound??Ea,config:{...t.config?t.config:{},tags:p}}),this.channels=n,this.triggers=r,this.mapper=i,this.writers=a??this.writers,this.bound=s??this.bound,this.kwargs=o??this.kwargs,this.metadata=c??this.metadata,this.tags=p,this.retryPolicy=l,this.cachePolicy=u,this.subgraphs=f,this.ends=h}getWriters(){let t=[...this.writers];for(;t.length>1&&t[t.length-1]instanceof Wt&&t[t.length-2]instanceof Wt;){let n=t.slice(-2),r=n[0].writes.concat(n[1].writes);t[t.length-2]=new Wt(r,n[0].config?.tags),t.pop()}return t}getNode(){let t=this.getWriters();if(!(this.bound===Ea&&t.length===0))return this.bound===Ea&&t.length===1?t[0]:this.bound===Ea?new ki({first:t[0],middle:t.slice(1,t.length-1),last:t[t.length-1],omitSequenceTags:!0}):t.length>0?new ki({first:this.bound,middle:t.slice(0,t.length-1),last:t[t.length-1],omitSequenceTags:!0}):this.bound}join(t){if(!Array.isArray(t))throw new Error("channels must be a list");if(typeof this.channels!="object")throw new Error("all channels must be named when using .join()");return new oo({channels:{...this.channels,...Object.fromEntries(t.map(n=>[n,n]))},triggers:this.triggers,mapper:this.mapper,writers:this.writers,bound:this.bound,kwargs:this.kwargs,config:this.config,retryPolicy:this.retryPolicy,cachePolicy:this.cachePolicy})}pipe(t){return Wt.isWriter(t)?new oo({channels:this.channels,triggers:this.triggers,mapper:this.mapper,writers:[...this.writers,t],bound:this.bound,config:this.config,kwargs:this.kwargs,retryPolicy:this.retryPolicy,cachePolicy:this.cachePolicy}):this.bound===Ea?new oo({channels:this.channels,triggers:this.triggers,mapper:this.mapper,writers:this.writers,bound:jt(t),config:this.config,kwargs:this.kwargs,retryPolicy:this.retryPolicy,cachePolicy:this.cachePolicy}):new oo({channels:this.channels,triggers:this.triggers,mapper:this.mapper,writers:this.writers,bound:this.bound.pipe(t),config:this.config,kwargs:this.kwargs,retryPolicy:this.retryPolicy,cachePolicy:this.cachePolicy})}};function bV(e){return"steps"in e&&Array.isArray(e.steps)}function zb(e){return"lg_is_pregel"in e&&e.lg_is_pregel===!0}function rP(e){let t=[e];for(let n of t){if(zb(n))return n;bV(n)&&t.push(...n.steps)}}function Qa(e,t,n=!0,r=!1){try{return e[t].get()}catch(i){if(i.name===Tt.unminifiable_name){if(r)return i;if(n)return null}throw i}}function fa(e,t,n=!0){if(Array.isArray(t)){let r={};for(let i of t)try{r[i]=Qa(e,i,!n)}catch(a){if(a.name===Tt.unminifiable_name)continue}return r}else return Qa(e,t)}function*wV(e,t){if(e.graph===lr.PARENT)throw new Qe("There is no parent graph.");if(e.goto){let n;Array.isArray(e.goto)?n=e.goto:n=[e.goto];for(let r of n)if(ln(r))yield[or,es,r];else if(typeof r=="string")yield[or,`branch:to:${r}`,"__start__"];else throw new Error(`In Command.send, expected Send or string, got ${typeof r}`)}if(e.resume)if(typeof e.resume=="object"&&Object.keys(e.resume).length&&Object.keys(e.resume).every(tP))for(let[n,r]of Object.entries(e.resume)){let i=t.filter(a=>a[0]===n&&a[1]==="__resume__").map(a=>a[2]).slice(0,1)??[];i.push(r),yield[n,hi,i]}else yield[or,hi,e.resume];if(e.update){if(typeof e.update!="object"||!e.update)throw new Error("Expected cmd.update to be a dict mapping channel names to update values");if(Array.isArray(e.update))for(let[n,r]of e.update)yield[or,n,r];else for(let[n,r]of Object.entries(e.update))yield[or,n,r]}}function*iP(e,t){if(t!=null)if(Array.isArray(e)&&typeof t=="object"&&!Array.isArray(t))for(let n in t)e.includes(n)&&(yield[n,t[n]]);else{if(Array.isArray(e))throw new Error('Input chunk must be an object when "inputChannels" is an array');yield[e,t]}}function*fm(e,t,n){Array.isArray(e)?(t===!0||t.find(([r,i])=>e.includes(r)))&&(yield fa(n,e)):(t===!0||t.some(([r,i])=>r===e))&&(yield Qa(n,e))}function*$V(e,t,n){let r=t.filter(([o,c])=>(o.config===void 0||!o.config.tags?.includes("langsmith:hidden"))&&c[0][0]!=="__error__"&&c[0][0]!=="__interrupt__");if(!r.length)return;let i;r.some(([o])=>o.writes.some(([c,l])=>c==="__return__"))?i=r.flatMap(([o])=>o.writes.filter(([c,l])=>c===lf).map(([c,l])=>[o.name,l])):Array.isArray(e)?i=r.flatMap(([o])=>{let{writes:c}=o,l={};for(let[u]of c)e.includes(u)&&(l[u]=(l[u]||0)+1);return Object.values(l).some(u=>u>1)?c.filter(([u])=>e.includes(u)).map(([u,d])=>[o.name,{[u]:d}]):[[o.name,Object.fromEntries(c.filter(([u])=>e.includes(u)))]]}):i=r.flatMap(([o])=>o.writes.filter(([c,l])=>c===e).map(([c,l])=>[o.name,l]));let a={};for(let[o,c]of i)o in a||(a[o]=[]),a[o].push(c);let s={};for(let o in a)if(a[o].length===1){let[c]=a[o];s[o]=c}else s[o]=a[o];n&&(s.__metadata__={cached:n}),yield s}function Fb(e){let t=typeof e[wt];if(t==="number")return 0;if(t==="string")return"";for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=typeof e[n];if(r==="number")return 0;if(r==="string")return"";break}}function au(e,t){if(Object.keys(e).length>0){let n=Fb(t);return Object.fromEntries(Object.entries(t).filter(([r,i])=>i>(e[r]??n)))}else return t}function SV(e,t){return e&&!Array.isArray(e)&&!(e instanceof Date)&&typeof e=="object"?e:{[t]:e}}function Vn(e,t){return e===null?{configurable:t}:e?.configurable===void 0?{...e,configurable:t}:{...e,configurable:{...e.configurable,...t}}}function Pi(e,t){let n=t?.parents??{};return Object.keys(n).length>0?Vn(e,{[Ar]:{...n,[e.configurable?.checkpoint_ns??""]:e.configurable?.checkpoint_id}}):e}function td(...e){let t=[...new Set(e.filter(Boolean))];if(t.length===0)return{signal:void 0,dispose:void 0};if(t.length===1)return{signal:t[0],dispose:void 0};let n=new AbortController,r=()=>{let a=t.find(s=>s.aborted)?.reason;n.abort(a),t.forEach(s=>s.removeEventListener("abort",r))};t.forEach(a=>a.addEventListener("abort",r,{once:!0}));let i=t.find(a=>a.aborted);return i&&n.abort(i.reason),{signal:n.signal,dispose:()=>{t.forEach(a=>a.removeEventListener("abort",r))}}}var kV=(e,t)=>{if(!(!e&&!t))return e?t?Array.isArray(e)&&Array.isArray(t)?[...e,...t]:Array.isArray(e)?[...e,t]:Array.isArray(t)?[e,...t]:[e,t]:e:t},xV=class{func;name;input;retry;cache;callbacks;__lg_type="call";constructor({func:e,name:t,input:n,retry:r,cache:i,callbacks:a}){this.func=e,this.name=t,this.input=n,this.retry=r,this.cache=i,this.callbacks=a}};function IV(e){return typeof e=="object"&&e!==null&&"__lg_type"in e&&e.__lg_type==="call"}function EV(e,t){return new ki({name:e,first:new wa({func:n=>t(...n),name:e,trace:!1,recurse:!1}),last:new Wt([{channel:lf,value:ta}],[sn])})}var TV=e=>e!==void 0?e+1:1;function OV(e,t){if(t==null)return!1;for(let n of e)if(t[n])return!0;return!1}function AV(e){let t;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t==null?t=e[n]:t=U8(t,e[n]));return t}function Ol(e,t,n){let r=Fb(e.channel_versions),i=e.versions_seen.__interrupt__??{},a=!1;if((e.channel_versions.__start__??r)>(i.__start__??r))a=!0;else for(let o in e.channel_versions)if(Object.prototype.hasOwnProperty.call(e.channel_versions,o)&&e.channel_versions[o]>(i[o]??r)){a=!0;break}let s=n.some(o=>t==="*"?!o.config?.tags?.includes(sn):t.includes(o.name));return a&&s}function su(e,t,n,r,i=!1){let a=new Set;if(Array.isArray(r))a=new Set(r.filter(o=>n.writes.some(([c,l])=>c===o)));else{for(let[o]of n.writes)if(o===r){a=new Set([o]);break}a=a||new Set}let s;if(i&&a.size>0){let o=Object.fromEntries(Object.entries(t).filter(([u,d])=>a.has(u))),c=Fi(e,o,-1),l=Xu(o,c);vn(Ku(c),l,[n],void 0,void 0),s=fa({...t,...l},r)}else s=fa(t,r);return s}function hm(e,t,n){for(let[r,i]of n)if(["__pregel_push","__pregel_tasks"].includes(r)&&i!=null){if(!ln(i))throw new Qe(`Invalid packet type, expected SendProtocol, got ${JSON.stringify(i)}`);if(!(i.node in t))throw new Qe(`Invalid node name "${i.node}" in Send packet`)}e(n)}var CV=new Set([N_,Mr,hi,It,lf,cf]);function vn(e,t,n,r,i){n.sort((f,h)=>{let p=f.path?.slice(0,3)||[],m=h.path?.slice(0,3)||[];for(let v=0;v<Math.min(p.length,m.length);v+=1){if(p[v]<m[v])return-1;if(p[v]>m[v])return 1}return p.length-m.length});let a=n.some(f=>f.triggers.length>0),s=Ub(t);for(let f of n){e.versions_seen[f.name]??={};for(let h of f.triggers)h in e.channel_versions&&(e.versions_seen[f.name][h]=e.channel_versions[h])}let o=AV(e.channel_versions),c=new Set(n.flatMap(f=>f.triggers).filter(f=>!HR.includes(f))),l=!1;for(let f of c)f in s&&s[f].consume()&&r!==void 0&&(e.channel_versions[f]=r(o),l=!0);let u={};for(let f of n)for(let[h,p]of f.writes)CV.has(h)||h in s&&(u[h]??=[],u[h].push(p));o!=null&&r!=null&&(o=l?r(o):o);let d=new Set;for(let[f,h]of Object.entries(u))if(f in s){let p=s[f],m;try{m=p.update(h)}catch(v){if(v.name===Qe.unminifiable_name){let g=new Qe(`Invalid update for channel "${f}" with values ${JSON.stringify(h)}: ${v.message}`);throw g.lc_error_code=v.lc_error_code,g}else throw v}m&&r!==void 0&&(e.channel_versions[f]=r(o),p.isAvailable()&&d.add(f))}if(a)for(let f in s){if(!Object.prototype.hasOwnProperty.call(s,f))continue;let h=s[f];h.isAvailable()&&!d.has(f)&&h.update([])&&r!==void 0&&(e.channel_versions[f]=r(o),h.isAvailable()&&d.add(f))}if(a&&!OV(d,i))for(let f in s){if(!Object.prototype.hasOwnProperty.call(s,f))continue;let h=s[f];h.finish()&&r!==void 0&&(e.channel_versions[f]=r(o),h.isAvailable()&&d.add(f))}return d}function*NV(e,t,n){if(n.updatedChannels!=null&&n.triggerToNodes!=null){let r=new Set;for(let i of n.updatedChannels){let a=n.triggerToNodes[i];for(let s of a??[])r.add(s)}yield*[...r].sort();return}if(!(()=>{for(let r in e.channel_versions)if(e.channel_versions[r]!==null)return!1;return!0})())for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(yield r)}function Ja(e,t,n,r,i,a,s){let o={},c=r[es];if(c?.isAvailable()){let l=c.get().length;for(let u=0;u<l;u+=1){let d=n_([Mr,u],e,t,n,r,i,a,s);d!==void 0&&(o[d.id]=d)}}for(let l of NV(e,n,s)){let u=n_([Cm,l],e,t,n,r,i,a,s);u!==void 0&&(o[u.id]=u)}return o}function n_(e,t,n,r,i,a,s,o){let{step:c,checkpointer:l,manager:u}=o,d=a.configurable??{},f=d.checkpoint_ns??"";if(e[0]==="__pregel_push"&&IV(e[e.length-1])){let h=e[e.length-1],p=EV(h.name,h.func),m=[Mr],v=f===""?h.name:`${f}|${h.name}`,g=Fa(JSON.stringify([v,c.toString(),h.name,Mr,e[1],e[2]]),t.id),y=`${v}:${g}`,$=[...e.slice(0,3),!0],S={langgraph_step:c,langgraph_node:h.name,langgraph_triggers:m,langgraph_path:$,langgraph_checkpoint_ns:y};if(s){let x=[];return{name:h.name,input:h.input,proc:p,writes:x,config:Ve(Tn(a,{metadata:S,store:o.store??a.store}),{runName:h.name,callbacks:u?.getChild(`graph:step:${c}`),configurable:{[zl]:g,[si]:C=>hm(T=>x.push(...T),r,C),[Ki]:(C,T=!1)=>su(t,i,{name:h.name,writes:x,triggers:m,path:$},C,T),[Rr]:l??d.__pregel_checkpointer,[Ar]:{...d[Ar],[f]:t.id},[oi]:pm({pendingWrites:n??[],taskId:g,currentTaskInput:h.input,resumeMap:a.configurable?.[Fl],namespaceHash:Di(y)}),[Bl]:t.channel_values[Dh],checkpoint_id:void 0,checkpoint_ns:y}}),triggers:m,retry_policy:h.retry,cache_key:h.cache?{key:Di((h.cache.keyFunc??JSON.stringify)([h.input])),ns:[Mh,h.name??"__dynamic__"],ttl:h.cache.ttl}:void 0,id:g,path:$,writers:[]}}else return{id:g,name:h.name,interrupts:[],path:$}}else if(e[0]==="__pregel_push"){let h=typeof e[1]=="number"?e[1]:parseInt(e[1],10);if(!i.__pregel_tasks?.isAvailable())return;let p=i[es].get();if(h<0||h>=p.length)return;let m=Nm(p[h])&&!ln(p[h])?new To(p[h].node,p[h].args):p[h];if(!Nm(m)){console.warn(`Ignoring invalid packet ${JSON.stringify(m)} in pending sends.`);return}if(!(m.node in r)){console.warn(`Ignoring unknown node name ${m.node} in pending sends.`);return}let v=[Mr],g=f===""?m.node:`${f}|${m.node}`,y=Fa(JSON.stringify([g,c.toString(),m.node,Mr,h.toString()]),t.id),$=`${g}:${y}`,S={langgraph_step:c,langgraph_node:m.node,langgraph_triggers:v,langgraph_path:e.slice(0,3),langgraph_checkpoint_ns:$};if(s){let x=r[m.node],C=x.getNode();if(C!==void 0){x.metadata!==void 0&&(S={...S,...x.metadata});let T=[];return{name:m.node,input:m.args,proc:C,subgraphs:x.subgraphs,writes:T,config:Ve(Tn(a,{metadata:S,tags:x.tags,store:o.store??a.store}),{runName:m.node,callbacks:u?.getChild(`graph:step:${c}`),configurable:{[zl]:y,[si]:b=>hm(D=>T.push(...D),r,b),[Ki]:(b,D=!1)=>su(t,i,{name:m.node,writes:T,triggers:v,path:e},b,D),[Rr]:l??d.__pregel_checkpointer,[Ar]:{...d[Ar],[f]:t.id},[oi]:pm({pendingWrites:n??[],taskId:y,currentTaskInput:m.args,resumeMap:a.configurable?.[Fl],namespaceHash:Di($)}),[Bl]:t.channel_values[Dh],checkpoint_id:void 0,checkpoint_ns:$}}),triggers:v,retry_policy:x.retryPolicy,cache_key:x.cachePolicy?{key:Di((x.cachePolicy.keyFunc??JSON.stringify)([m.args])),ns:[Mh,x.name??"__dynamic__",m.node],ttl:x.cachePolicy.ttl}:void 0,id:y,path:e,writers:x.getWriters()}}}else return{id:y,name:m.node,interrupts:[],path:e}}else if(e[0]==="__pregel_pull"){let h=e[1].toString(),p=r[h];if(p===void 0)return;if(n?.length){let y=f===""?h:`${f}|${h}`,$=Fa(JSON.stringify([y,c.toString(),h,Cm,h]),t.id);if(n.some(S=>S[0]===$&&S[1]!=="__error__"))return}let m=Fb(t.channel_versions);if(m===void 0)return;let v=t.versions_seen[h]??{},g=p.triggers.find(y=>i[y].isAvailable()?(t.channel_versions[y]??m)>(v[y]??m):!1);if(g!==void 0){let y=PV(p,i,s);if(y===void 0)return;let $=f===""?h:`${f}|${h}`,S=Fa(JSON.stringify([$,c.toString(),h,Cm,[g]]),t.id),x=`${$}:${S}`,C={langgraph_step:c,langgraph_node:h,langgraph_triggers:[g],langgraph_path:e,langgraph_checkpoint_ns:x};if(s){let T=p.getNode();if(T!==void 0){p.metadata!==void 0&&(C={...C,...p.metadata});let b=[];return{name:h,input:y,proc:T,subgraphs:p.subgraphs,writes:b,config:Ve(Tn(a,{metadata:C,tags:p.tags,store:o.store??a.store}),{runName:h,callbacks:u?.getChild(`graph:step:${c}`),configurable:{[zl]:S,[si]:D=>hm(O=>{b.push(...O)},r,D),[Ki]:(D,O=!1)=>su(t,i,{name:h,writes:b,triggers:[g],path:e},D,O),[Rr]:l??d.__pregel_checkpointer,[Ar]:{...d[Ar],[f]:t.id},[oi]:pm({pendingWrites:n??[],taskId:S,currentTaskInput:y,resumeMap:a.configurable?.[Fl],namespaceHash:Di(x)}),[Bl]:t.channel_values[Dh],checkpoint_id:void 0,checkpoint_ns:x}}),triggers:[g],retry_policy:p.retryPolicy,cache_key:p.cachePolicy?{key:Di((p.cachePolicy.keyFunc??JSON.stringify)([y])),ns:[Mh,p.name??"__dynamic__",h],ttl:p.cachePolicy.ttl}:void 0,id:S,path:e,writers:p.getWriters()}}}else return{id:S,name:h,interrupts:[],path:e}}}}function PV(e,t,n){let r;if(typeof e.channels=="object"&&!Array.isArray(e.channels)){r={};for(let[i,a]of Object.entries(e.channels))if(e.triggers.includes(a))try{r[i]=Qa(t,a,!1)}catch(s){if(s.name===Tt.unminifiable_name)return;throw s}else if(a in t)try{r[i]=Qa(t,a,!1)}catch(s){if(s.name===Tt.unminifiable_name)continue;throw s}}else if(Array.isArray(e.channels)){let i=!1;for(let a of e.channels)try{r=Qa(t,a,!1),i=!0;break}catch(s){if(s.name===Tt.unminifiable_name)continue;throw s}if(!i)return}else throw new Error(`Invalid channels type, expected list or dict, got ${e.channels}`);return n&&e.mapper!==void 0&&(r=e.mapper(r)),r}function RV(e,t){if(typeof e.args!="object"||e.args===null)return e;let n={};for(let[r,i]of Object.entries(e.args)){let a=t[r];(!a||a.lc_graph_name!=="UntrackedValue")&&(n[r]=i)}return new To(e.node,n)}function pm({pendingWrites:e,taskId:t,currentTaskInput:n,resumeMap:r,namespaceHash:i}){let a=e.find(([o,c])=>o==="00000000-0000-0000-0000-000000000000"&&c==="__resume__")?.[2],s={callCounter:0,interruptCounter:-1,resume:(()=>{let o=e.filter(([c,l])=>c===t&&l==="__resume__").flatMap(([c,l,u])=>u);if(r!=null&&i in r){let c=r[i];o.push(c)}return o})(),nullResume:a,subgraphCounter:0,currentTaskInput:n,consumeNullResume:()=>{if(s.nullResume)return delete s.nullResume,e.splice(e.findIndex(([o,c])=>o==="00000000-0000-0000-0000-000000000000"&&c==="__resume__"),1),a}};return s}var Yo={blue:{start:"\x1B[34m",end:"\x1B[0m"},green:{start:"\x1B[32m",end:"\x1B[0m"},yellow:{start:"\x1B[33;1m",end:"\x1B[0m"}},Qo=(e,t)=>`${e.start}${t}${e.end}`;function*CS(e){for(let{id:t,name:n,input:r,config:i,triggers:a,writes:s}of e)i?.tags?.includes("langsmith:hidden")||(yield{id:t,name:n,input:r,triggers:a,interrupts:s.filter(([o,c])=>o===t&&c==="__interrupt__").map(([,o])=>o)})}function jV(e){return typeof e!="object"||e===null?!1:"$writes"in e&&Array.isArray(e.$writes)}function aP(e){let t={};for(let[n,r]of e){let i=String(n);if(i in t){let a=jV(t[i])?t[i].$writes:[t[i]];a.push(r),t[i]={$writes:a}}else t[i]=r}return t}function*MV(e,t){for(let[{id:n,name:r,config:i},a]of e)i?.tags?.includes("langsmith:hidden")||(yield{id:n,name:r,result:aP(a.filter(([s])=>Array.isArray(t)?t.includes(s):s===t)),interrupts:a.filter(s=>s[0]===It).map(s=>s[1])})}function*DV(e,t,n,r,i,a,s,o){function c(d){let f={};return d.callbacks!=null&&(f.callbacks=d.callbacks),d.configurable!=null&&(f.configurable=d.configurable),d.maxConcurrency!=null&&(f.max_concurrency=d.maxConcurrency),d.metadata!=null&&(f.metadata=d.metadata),d.recursionLimit!=null&&(f.recursion_limit=d.recursionLimit),d.runId!=null&&(f.run_id=d.runId),d.runName!=null&&(f.run_name=d.runName),d.tags!=null&&(f.tags=d.tags),f}let l=e.configurable?.checkpoint_ns,u={};for(let d of i){if(!(d.subgraphs?.length?d.subgraphs:[d.proc]).find(rP))continue;let f=`${d.name}:${d.id}`;l&&(f=`${l}|${f}`),u[d.id]={configurable:{thread_id:e.configurable?.thread_id,checkpoint_ns:f}}}yield{config:c(e),values:fa(t,n),metadata:r,next:i.map(d=>d.name),tasks:sP(i,a,u,o),parentConfig:s?c(s):void 0}}function sP(e,t,n,r){return e.map(i=>{let a=t.find(([l,u])=>l===i.id&&u==="__error__")?.[2],s=t.filter(([l,u])=>l===i.id&&u==="__interrupt__").map(([,,l])=>l),o=(()=>{if(a||s.length||!t.length)return;let l=t.findIndex(([u,d])=>u===i.id&&d==="__return__");if(l>=0)return t[l][2];if(typeof r=="string")return t.find(([u,d])=>u===i.id&&d===r)?.[2];if(Array.isArray(r)){let u=t.filter(([d,f])=>d===i.id&&r.includes(f)).map(([,d,f])=>[d,f]);return u.length?aP(u):void 0}})();if(a)return{id:i.id,name:i.name,path:i.path,error:a,interrupts:s,result:o};let c=n?.[i.id];return{id:i.id,name:i.name,path:i.path,interrupts:s,...c!==void 0?{state:c}:{},result:o}})}function UV(e,t,n){console.log([`${Qo(Yo.blue,`[${e}:checkpoint]`)}`,`\x1B[1m State at the end of step ${e}:\x1B[0m
755
- `,JSON.stringify(fa(t,n),null,2)].join(""))}function oP(e,t){let n=t.length;console.log([`${Qo(Yo.blue,`[${e}:tasks]`)}`,`\x1B[1m Starting step ${e} with ${n} task${n===1?"":"s"}:\x1B[0m
756
- `,t.map(r=>`- ${Qo(Yo.green,String(r.name))} -> ${JSON.stringify(r.input,null,2)}`).join(`
757
- `)].join(""))}function LV(e,t,n){let r={};for(let[i,a]of t)n.includes(i)&&(r[i]||(r[i]=[]),r[i].push(a));console.log([`${Qo(Yo.blue,`[${e}:writes]`)}`,`\x1B[1m Finished step ${e} with writes to ${Object.keys(r).length} channel${Object.keys(r).length!==1?"s":""}:\x1B[0m
758
- `,Object.entries(r).map(([i,a])=>`- ${Qo(Yo.yellow,i)} -> ${a.map(s=>JSON.stringify(s)).join(", ")}`).join(`
759
- `)].join(""))}var NS=class extends dn{_abortController;_innerReader;constructor(e,t){let n=e.getReader(),r=t??new AbortController;super({start(i){return a();function a(){return n.read().then(({done:s,value:o})=>{if(s){i.close();return}return i.enqueue(o),a()})}}}),this._abortController=r,this._innerReader=n}async cancel(e){this._abortController.abort(e),this._innerReader.releaseLock()}get signal(){return this._abortController.signal}},cP=class extends dn{modes;controller;passthroughFn;_closed=!1;get closed(){return this._closed}constructor(e){let t,n=new Promise(r=>{t=r});super({start:r=>{t(r)}}),n.then(r=>{this.controller=r}),this.passthroughFn=e.passthroughFn,this.modes=e.modes}push(e){this.passthroughFn?.(e),this.controller.enqueue(e)}close(){try{this.controller.close()}catch{}finally{this._closed=!0}}error(e){this.controller.error(e)}},zV=class extends ga{name="StreamToolsHandler";streamFn;runs={};constructor(e){super(),this.streamFn=e}handleToolStart(e,t,n,r,i,a,s,o){if(!a||i&&i.includes("langsmith:hidden"))return;let c=a.langgraph_checkpoint_ns?.split("|")??[],l={ns:c,toolCallId:o,toolName:s??"unknown",input:t};this.runs[n]=l,this.streamFn([c,"tools",{event:"on_tool_start",toolCallId:l.toolCallId,name:l.toolName,input:t}])}handleToolEvent(e,t){let n=this.runs[t];n&&this.streamFn([n.ns,"tools",{event:"on_tool_event",toolCallId:n.toolCallId,name:n.toolName,data:e}])}handleToolEnd(e,t){let n=this.runs[t];delete this.runs[t],n&&this.streamFn([n.ns,"tools",{event:"on_tool_end",toolCallId:n.toolCallId,name:n.toolName,output:e}])}handleToolError(e,t){let n=this.runs[t];delete this.runs[t],n&&this.streamFn([n.ns,"tools",{event:"on_tool_error",toolCallId:n.toolCallId,name:n.toolName,error:e}])}};function FV(e){return JSON.stringify(e,function(t,n){let r=this[t];if(r!=null&&typeof r=="object"&&"toDict"in r&&typeof r.toDict=="function"){let{type:i,data:a}=r.toDict();return{...a,type:i}}return n})}function BV(e){return e instanceof Error?{error:e.name,message:e.message}:{error:"Error",message:JSON.stringify(e)}}function Bb(e){return typeof e!="object"||e==null?!1:"configurable"in e&&typeof e.configurable=="object"&&e.configurable!=null}function mm(e){return!Bb(e)||!e.configurable.thread_id?null:{thread_id:e.configurable.thread_id,checkpoint_ns:e.configurable.checkpoint_ns||"",checkpoint_id:e.configurable.checkpoint_id||null,checkpoint_map:e.configurable.checkpoint_map||null}}function PS(e){if(Bb(e)){let t=Object.fromEntries(Object.entries(e.configurable).filter(([r])=>!r.startsWith("__"))),n={...e,configurable:t};return delete n.callbacks,n}return e}function RS(e){let t={...e,checkpoint:mm(e.config),parent_checkpoint:mm(e.parentConfig),config:PS(e.config),parent_config:PS(e.parentConfig),tasks:e.tasks.map(n=>{if(Bb(n.state)){let r=mm(n.state);if(r!=null){let i={...n,checkpoint:r};return delete i.state,i}}return n})};return delete t.parentConfig,t}function ZV(e){let t=new TextEncoder;return new ReadableStream({async start(n){let r=i=>{n.enqueue(t.encode(`event: ${i.event}
760
- data: ${FV(i.data)}
761
-
762
- `))};try{for await(let i of e){let[a,s,o]=i,c=o;if(s==="debug"){let l=o;l.type==="checkpoint"&&(c={...l,payload:RS(l.payload)})}s==="checkpoints"&&(c=RS(o)),r({event:a?.length?`${s}|${a.join("|")}`:s,data:c})}}catch(i){r({event:"error",data:BV(i)})}n.close()}})}var Al=Symbol.for("INPUT_DONE"),gm=Symbol.for("INPUT_RESUMING"),VV=25;function qV(...e){return new cP({passthroughFn:t=>{for(let n of e)n.modes.has(t[1])&&n.push(t)},modes:new Set(e.flatMap(t=>Array.from(t.modes)))})}var GV=class extends V8{cache;queue=Promise.resolve();constructor(e){super(),this.cache=e}async get(e){return this.enqueueOperation("get",e)}async set(e){return this.enqueueOperation("set",e)}async clear(e){return this.enqueueOperation("clear",e)}async stop(){await this.queue}enqueueOperation(e,...t){let n=this.queue.then(()=>this.cache[e](...t));return this.queue=n.then(()=>{},()=>{}),n}},HV=class lP{input;output;config;checkpointer;checkpointerGetNextVersion;channels;checkpoint;checkpointIdSaved;checkpointConfig;checkpointMetadata;checkpointNamespace;checkpointPendingWrites=[];checkpointPreviousVersions;step;stop;durability;outputKeys;streamKeys;nodes;skipDoneTasks;prevCheckpointConfig;updatedChannels;status="pending";tasks={};stream;checkpointerPromises=new Set;isNested;_checkpointerChainedPromise=Promise.resolve();_trackCheckpointerPromise(t){let n=t.then(r=>(this.checkpointerPromises.delete(n),r),r=>{throw r});this.checkpointerPromises.add(n)}store;cache;manager;interruptAfter;interruptBefore;toInterrupt=[];debug=!1;triggerToNodes;get isResuming(){let t=!1;if("__start__"in this.checkpoint.channel_versions)t=!0;else for(let o in this.checkpoint.channel_versions)if(Object.prototype.hasOwnProperty.call(this.checkpoint.channel_versions,o)){t=!0;break}let n=this.config.configurable?.__pregel_resuming!==void 0&&this.config.configurable?.__pregel_resuming,r=this.input===null||this.input===void 0,i=zt(this.input)&&this.input.resume!=null,a=this.input===gm,s=!this.isNested&&this.config.metadata?.run_id!==void 0&&this.checkpointMetadata?.run_id!==void 0&&this.config.metadata.run_id===this.checkpointMetadata?.run_id;return t&&(n||r||i||a||s)}constructor(t){this.input=t.input,this.checkpointer=t.checkpointer,this.checkpointer!==void 0?this.checkpointerGetNextVersion=this.checkpointer.getNextVersion.bind(this.checkpointer):this.checkpointerGetNextVersion=TV,this.checkpoint=t.checkpoint,this.checkpointMetadata=t.checkpointMetadata,this.checkpointPreviousVersions=t.checkpointPreviousVersions,this.channels=t.channels,this.checkpointPendingWrites=t.checkpointPendingWrites,this.step=t.step,this.stop=t.stop,this.config=t.config,this.checkpointConfig=t.checkpointConfig,this.isNested=t.isNested,this.manager=t.manager,this.outputKeys=t.outputKeys,this.streamKeys=t.streamKeys,this.nodes=t.nodes,this.skipDoneTasks=t.skipDoneTasks,this.store=t.store,this.cache=t.cache?new GV(t.cache):void 0,this.stream=t.stream,this.checkpointNamespace=t.checkpointNamespace,this.prevCheckpointConfig=t.prevCheckpointConfig,this.interruptAfter=t.interruptAfter,this.interruptBefore=t.interruptBefore,this.durability=t.durability,this.debug=t.debug,this.triggerToNodes=t.triggerToNodes}static async initialize(t){let{config:n,stream:r}=t;r!==void 0&&n.configurable?.__pregel_stream!==void 0&&(r=qV(r,n.configurable[C_]));let i=n.configurable?!("checkpoint_id"in n.configurable):!0,a=n.configurable?.[oi];n.configurable&&a&&(a.subgraphCounter>0&&(n=Vn(n,{[jr]:[n.configurable[jr],a.subgraphCounter.toString()].join("|")})),a.subgraphCounter+=1);let s=Ki in(n.configurable??{});!s&&n.configurable?.checkpoint_ns!==void 0&&n.configurable?.checkpoint_ns!==""&&(n=Vn(n,{checkpoint_ns:"",checkpoint_id:void 0}));let o=n;n.configurable?.checkpoint_map!==void 0&&n.configurable?.checkpoint_map?.[n.configurable?.checkpoint_ns]&&(o=Vn(n,{checkpoint_id:n.configurable[Ar][n.configurable?.checkpoint_ns]}));let c=n.configurable?.checkpoint_ns?.split("|")??[],l=await t.checkpointer?.getTuple(o)??{config:n,checkpoint:BN(),metadata:{source:"input",step:-2,parents:{}},pendingWrites:[]};o={...n,...l.config,configurable:{checkpoint_ns:"",...n.configurable,...l.config.configurable}};let u=l.parentConfig,d=Ku(l.checkpoint),f={...l.metadata},h=l.pendingWrites??[],p=Xu(t.channelSpecs,d),m=(f.step??0)+1,v=m+(n.recursionLimit??VV)+1,g={...d.channel_versions},y=t.store?new Z8(t.store):void 0;return y&&await y.start(),new lP({input:t.input,config:n,checkpointer:t.checkpointer,checkpoint:d,checkpointMetadata:f,checkpointConfig:o,prevCheckpointConfig:u,checkpointNamespace:c,channels:p,isNested:s,manager:t.manager,skipDoneTasks:i,step:m,stop:v,checkpointPreviousVersions:g,checkpointPendingWrites:h,outputKeys:t.outputKeys??[],streamKeys:t.streamKeys??[],nodes:t.nodes,stream:r,store:y,cache:t.cache,interruptAfter:t.interruptAfter,interruptBefore:t.interruptBefore,durability:t.durability,debug:t.debug,triggerToNodes:t.triggerToNodes})}_checkpointerPutAfterPrevious(t){this._checkpointerChainedPromise=this._checkpointerChainedPromise.then(()=>this.checkpointer?.put(t.config,t.checkpoint,t.metadata,t.newVersions)),this._trackCheckpointerPromise(this._checkpointerChainedPromise)}putWrites(t,n){let r=n;if(r.length===0)return;r.every(([c])=>c in L8)&&(r=Array.from(new Map(r.map(c=>[c[0],c])).values()));let i=!1;for(let c in this.channels)if(Object.prototype.hasOwnProperty.call(this.channels,c)&&this.channels[c].lc_graph_name==="UntrackedValue"){i=!0;break}let a=r;i&&(a=r.filter(([c])=>{let l=this.channels[c];return!l||l.lc_graph_name!=="UntrackedValue"}).map(([c,l])=>c==="__pregel_tasks"&&ln(l)?[c,RV(l,this.channels)]:[c,l])),this.checkpointPendingWrites=this.checkpointPendingWrites.filter(c=>c[0]!==t);for(let[c,l]of a)this.checkpointPendingWrites.push([t,c,l]);let s=Vn(this.checkpointConfig,{[jr]:this.config.configurable?.checkpoint_ns??"",[Am]:this.checkpoint.id});if(this.durability!=="exit"&&this.checkpointer!=null&&this._trackCheckpointerPromise(this.checkpointer.putWrites(s,a,t)),this.tasks&&this._outputWrites(t,r),!n.length||!this.cache||!this.tasks)return;let o=this.tasks[t];o==null||o.cache_key==null||n[0][0]==="__error__"||n[0][0]==="__interrupt__"||this.cache.set([{key:[o.cache_key.ns,o.cache_key.key],value:o.writes,ttl:o.cache_key.ttl}])}_outputWrites(t,n,r=!1){let i=this.tasks[t];if(i!==void 0){if(i.config!==void 0&&(i.config.tags??[]).includes("langsmith:hidden"))return;if(n.length>0)if(n[0][0]==="__interrupt__"){if(i.path?.[0]==="__pregel_push"&&i.path?.[i.path.length-1]===!0)return;let a=n.filter(s=>s[0]===It).flatMap(s=>s[1]);this._emit([["updates",{[It]:a}],["values",{[It]:a}]])}else n[0][0]!=="__error__"&&this._emit(so(Xr($V(this.outputKeys,[[i,n]],r),"updates")));r||this._emit(so(Xr(MV([[i,n]],this.streamKeys),"tasks")))}}async _matchCachedWrites(){if(!this.cache)return[];let t=[],n=([s,o])=>`ns:${s.join(",")}|key:${o}`,r=[],i={};for(let s of Object.values(this.tasks))s.cache_key!=null&&!s.writes.length&&(r.push([s.cache_key.ns,s.cache_key.key]),i[n([s.cache_key.ns,s.cache_key.key])]=s);if(r.length===0)return[];let a=await this.cache.get(r);for(let{key:s,value:o}of a){let c=i[n(s)];c!=null&&(c.writes.push(...o),t.push({task:c,result:o}))}return t}async tick(t){this.store&&!this.store.isRunning&&await this.store?.start();let{inputKeys:n=[]}=t;if(this.status!=="pending")throw new Error(`Cannot tick when status is no longer "pending". Current status: "${this.status}"`);if(![Al,gm].includes(this.input))await this._first(n);else{if(this.toInterrupt.length>0)throw this.status="interrupt_before",new Ka;if(Object.values(this.tasks).every(i=>i.writes.length>0)){let i=Object.values(this.tasks).flatMap(s=>s.writes);this.updatedChannels=vn(this.checkpoint,this.channels,Object.values(this.tasks),this.checkpointerGetNextVersion,this.triggerToNodes);let a=await ri(Xr(fm(this.outputKeys,i,this.channels),"values"));if(this._emit(a),this.checkpointPendingWrites=[],await this._putCheckpoint({source:"loop"}),Ol(this.checkpoint,this.interruptAfter,Object.values(this.tasks)))throw this.status="interrupt_after",new Ka;this.config.configurable?.__pregel_resuming!==void 0&&delete this.config.configurable?.[gu]}else return!1}if(this.step>this.stop)return this.status="out_of_steps",!1;if(this.tasks=Ja(this.checkpoint,this.checkpointPendingWrites,this.nodes,this.channels,this.config,!0,{step:this.step,checkpointer:this.checkpointer,isResuming:this.isResuming,manager:this.manager,store:this.store,stream:this.stream,triggerToNodes:this.triggerToNodes,updatedChannels:this.updatedChannels}),this.checkpointer&&this._emit(await ri(Xr(DV(this.checkpointConfig,this.channels,this.streamKeys,this.checkpointMetadata,Object.values(this.tasks),this.checkpointPendingWrites,this.prevCheckpointConfig,this.outputKeys),"checkpoints"))),Object.values(this.tasks).length===0)return this.status="done",!1;if(this.skipDoneTasks&&this.checkpointPendingWrites.length>0){for(let[i,a,s]of this.checkpointPendingWrites){if(a==="__error__"||a==="__interrupt__"||a==="__resume__")continue;let o=Object.values(this.tasks).find(c=>c.id===i);o&&o.writes.push([a,s])}for(let i of Object.values(this.tasks))i.writes.length>0&&this._outputWrites(i.id,i.writes,!0)}if(Object.values(this.tasks).every(i=>i.writes.length>0))return this.tick({inputKeys:n});if(Ol(this.checkpoint,this.interruptBefore,Object.values(this.tasks)))throw this.status="interrupt_before",new Ka;let r=await ri(Xr(CS(Object.values(this.tasks)),"tasks"));return this._emit(r),!0}async finishAndHandleError(t){this.durability==="exit"&&(!this.isNested||typeof t<"u"||this.checkpointNamespace.every(r=>!r.includes(":")))&&(this._putCheckpoint(this.checkpointMetadata),this._flushPendingWrites());let n=this._suppressInterrupt(t);return(n||t===void 0)&&(this.output=fa(this.channels,this.outputKeys)),n&&(this.tasks!==void 0&&this.checkpointPendingWrites.length>0&&Object.values(this.tasks).some(r=>r.writes.length>0)&&(this.updatedChannels=vn(this.checkpoint,this.channels,Object.values(this.tasks),this.checkpointerGetNextVersion,this.triggerToNodes),this._emit(so(Xr(fm(this.outputKeys,Object.values(this.tasks).flatMap(r=>r.writes),this.channels),"values")))),za(t)&&!t.interrupts.length&&this._emit([["updates",{[It]:[]}],["values",{[It]:[]}]])),n}async acceptPush(t,n,r){if(this.interruptAfter?.length>0&&Ol(this.checkpoint,this.interruptAfter,[t])){this.toInterrupt.push(t);return}let i=n_([Mr,t.path??[],n,t.id,r],this.checkpoint,this.checkpointPendingWrites,this.nodes,this.channels,t.config??{},!0,{step:this.step,checkpointer:this.checkpointer,manager:this.manager,store:this.store,stream:this.stream});if(!i)return;if(this.interruptBefore?.length>0&&Ol(this.checkpoint,this.interruptBefore,[i])){this.toInterrupt.push(i);return}this._emit(so(Xr(CS([i]),"tasks"))),this.debug&&oP(this.step,[i]),this.tasks[i.id]=i,this.skipDoneTasks&&this._matchWrites({[i.id]:i});let a=await this._matchCachedWrites();for(let{task:s}of a)this._outputWrites(s.id,s.writes,!0);return i}_suppressInterrupt(t){return za(t)&&!this.isNested}async _first(t){let{configurable:n}=this.config,r=n?.[oi];if(r&&r.nullResume!==void 0&&this.putWrites(or,[[hi,r.nullResume]]),zt(this.input)){let s=this.input.resume!=null;if(this.input.resume!=null&&typeof this.input.resume=="object"&&Object.keys(this.input.resume).every(tP)&&(this.config.configurable??={},this.config.configurable[Fl]=this.input.resume),s&&this.checkpointer==null)throw new Error("Cannot use Command(resume=...) without checkpointer");let o={};for(let[c,l,u]of wV(this.input,this.checkpointPendingWrites))o[c]??=[],o[c].push([l,u]);if(Object.keys(o).length===0)throw new Iw("Received empty Command input");for(let[c,l]of Object.entries(o))this.putWrites(c,l)}let i=(this.checkpointPendingWrites??[]).filter(s=>s[0]===or).map(s=>s.slice(1));i.length>0&&vn(this.checkpoint,this.channels,[{name:ni,writes:i,triggers:[]}],this.checkpointerGetNextVersion,this.triggerToNodes);let a=zt(this.input)&&i.length>0;if(this.isResuming||a){for(let o in this.channels)if(Object.prototype.hasOwnProperty.call(this.channels,o)&&this.checkpoint.channel_versions[o]!==void 0){let c=this.checkpoint.channel_versions[o];this.checkpoint.versions_seen[It]={...this.checkpoint.versions_seen[It],[o]:c}}let s=await ri(Xr(fm(this.outputKeys,!0,this.channels),"values"));this._emit(s)}if(this.isResuming)this.input=gm;else if(a)await this._putCheckpoint({source:"input"}),this.input=Al;else{let s=await ri(iP(t,this.input));if(s.length>0){let o=Ja(this.checkpoint,this.checkpointPendingWrites,this.nodes,this.channels,this.config,!0,{step:this.step});this.updatedChannels=vn(this.checkpoint,this.channels,Object.values(o).concat([{name:ni,writes:s,triggers:[]}]),this.checkpointerGetNextVersion,this.triggerToNodes),await this._putCheckpoint({source:"input"}),this.input=Al}else if("__pregel_resuming"in(this.config.configurable??{}))this.input=Al;else throw new Iw(`Received no input writes for ${JSON.stringify(t,null,2)}`)}this.isNested||(this.config=Vn(this.config,{[gu]:this.isResuming}))}_emit(t){for(let[n,r]of t)if(this.stream.modes.has(n)&&this.stream.push([this.checkpointNamespace,n,r]),(n==="checkpoints"||n==="tasks")&&this.stream.modes.has("debug")){let i=n==="checkpoints"?this.step-1:this.step,a=new Date().toISOString(),s=n==="checkpoints"?"checkpoint":typeof r=="object"&&r!=null&&"result"in r?"task_result":"task";this.stream.push([this.checkpointNamespace,"debug",{step:i,type:s,timestamp:a,payload:r}])}}_putCheckpoint(t){let n=this.checkpointMetadata===t,r=this.checkpointer!=null&&(this.durability!=="exit"||n),i=a=>{this.prevCheckpointConfig=this.checkpointConfig?.configurable?.checkpoint_id?this.checkpointConfig:void 0,this.checkpointConfig=Vn(this.checkpointConfig,{[jr]:this.config.configurable?.checkpoint_ns??""});let s={...this.checkpoint.channel_versions},o=au(this.checkpointPreviousVersions,s);this.checkpointPreviousVersions=s,this._checkpointerPutAfterPrevious({config:{...this.checkpointConfig},checkpoint:Ku(a),metadata:{...this.checkpointMetadata},newVersions:o}),this.checkpointConfig={...this.checkpointConfig,configurable:{...this.checkpointConfig.configurable,checkpoint_id:this.checkpoint.id}}};n||(this.checkpointMetadata={...t,step:this.step,parents:this.config.configurable?.checkpoint_map??{}}),this.checkpoint=Fi(this.checkpoint,r?this.channels:void 0,this.step,n?{id:this.checkpoint.id}:void 0),r&&i(this.checkpoint),n||(this.step+=1)}_flushPendingWrites(){if(this.checkpointer==null||this.checkpointPendingWrites.length===0)return;let t=Vn(this.checkpointConfig,{[jr]:this.config.configurable?.checkpoint_ns??"",[Am]:this.checkpoint.id}),n={};for(let[r,i,a]of this.checkpointPendingWrites)n[r]??=[],n[r].push([i,a]);for(let[r,i]of Object.entries(n))this._trackCheckpointerPromise(this.checkpointer.putWrites(t,i,r))}_matchWrites(t){for(let[n,r,i]of this.checkpointPendingWrites){if(r==="__error__"||r==="__interrupt__"||r==="__resume__")continue;let a=Object.values(t).find(s=>s.id===n);a&&a.writes.push([r,i])}for(let n of Object.values(t))n.writes.length>0&&this._outputWrites(n.id,n.writes,!0)}};function JV(e){return Rt(e?.message)}var WV=class extends ga{name="StreamMessagesHandler";streamFn;metadatas={};seen={};emittedChatModelRunIds={};stableMessageIdMap={};lc_prefer_streaming=!0;constructor(e){super(),this.streamFn=e}_emit(e,t,n,r=!1){if(r&&t.id!==void 0&&this.seen[t.id]!==void 0)return;let i=t.id;n!=null&&(V_(t)?i??=`run-${n}-tool-${t.tool_call_id}`:((i==null||i===`run-${n}`)&&(i=this.stableMessageIdMap[n]??i??`run-${n}`),this.stableMessageIdMap[n]??=i)),i!==t.id&&(t.id=i,t.lc_kwargs.id=i),t.id!=null&&(this.seen[t.id]=t),this.streamFn([e[0],"messages",[t,e[1]]])}handleChatModelStart(e,t,n,r,i,a,s,o){s&&(!a||!a.includes("langsmith:nostream")&&!a.includes("nostream"))&&(this.metadatas[n]=[s.langgraph_checkpoint_ns.split("|"),{tags:a,name:o,...s}])}handleLLMNewToken(e,t,n,r,i,a){let s=a?.chunk;this.emittedChatModelRunIds[n]=!0,this.metadatas[n]!==void 0&&(JV(s)?this._emit(this.metadatas[n],s.message,n):this._emit(this.metadatas[n],new un({content:e}),n))}handleLLMEnd(e,t){if(this.metadatas[t]!==void 0){if(!this.emittedChatModelRunIds[t]){let n=e.generations?.[0]?.[0];Rt(n?.message)&&this._emit(this.metadatas[t],n?.message,t,!0),delete this.emittedChatModelRunIds[t]}delete this.metadatas[t],delete this.stableMessageIdMap[t]}}handleLLMError(e,t){delete this.metadatas[t]}handleChainStart(e,t,n,r,i,a,s,o){if(a!==void 0&&o===a.langgraph_node&&(i===void 0||!i.includes("langsmith:hidden"))&&(this.metadatas[n]=[a.langgraph_checkpoint_ns.split("|"),{tags:i,name:o,...a}],typeof t=="object")){for(let c of Object.values(t))if((Rt(c)||Co(c))&&c.id!==void 0)this.seen[c.id]=c;else if(Array.isArray(c))for(let l of c)(Rt(l)||Co(l))&&l.id!==void 0&&(this.seen[l.id]=l)}}handleChainEnd(e,t){let n=this.metadatas[t];if(delete this.metadatas[t],n!==void 0){if(Rt(e))this._emit(n,e,t,!0);else if(Array.isArray(e))for(let r of e)Rt(r)&&this._emit(n,r,t,!0);else if(e!=null&&typeof e=="object"){for(let r of Object.values(e))if(Rt(r))this._emit(n,r,t,!0);else if(Array.isArray(r))for(let i of r)Rt(i)&&this._emit(n,i,t,!0)}}}handleChainError(e,t){delete this.metadatas[t]}},KV=[400,401,402,403,404,405,406,407,409],XV=e=>{if(e.message.startsWith("Cancel")||e.message.startsWith("AbortError")||e.name==="AbortError"||e.name==="GraphValueError"||e?.code==="ECONNABORTED")return!1;let t=e?.response?.status??e?.status;return!(t&&KV.includes(+t)||e?.error?.code==="insufficient_quota")};async function uP(e,t,n,r){let i=e.retry_policy??t,a=i!==void 0?i.initialInterval??500:0,s=0,o,c,{config:l}=e;for(n&&(l=Vn(l,n)),l={...l,signal:r};!r?.aborted;){e.writes.splice(0,e.writes.length),o=void 0;try{c=await e.proc.invoke(e.input,l);break}catch(u){if(o=u,o.pregelTaskId=e.id,YR(o)){let h=l?.configurable?.checkpoint_ns,p=o.command;if(p.graph===h){for(let m of e.writers)await m.invoke(p,l);o=void 0;break}else if(p.graph===lr.PARENT){let m=X8(h);o.command=new lr({...o.command,graph:m})}}if(Vl(o)||i===void 0||(s+=1,s>=(i.maxAttempts??3))||!(i.retryOn??XV)(o))break;a=Math.min(i.maxInterval??128e3,a*(i.backoffFactor??2));let d=i.jitter?Math.floor(a+Math.random()*1e3):a;await new Promise(h=>setTimeout(h,d));let f=o.name??o.constructor.unminifiable_name??o.constructor.name;(i?.logWarning??!0)&&console.log(`Retrying task "${String(e.name)}" after ${a.toFixed(2)}ms (attempt ${s}) after ${f}: ${o}`),l=Vn(l,{[gu]:!0})}}return{task:e,result:c,error:o,signalAborted:r?.aborted}}var r_=Symbol.for("promiseAdded");function YV(){let e={next:()=>{},wait:Promise.resolve(r_)};function t(n){e.next=()=>{e.wait=new Promise(t),n(r_)}}return e.wait=new Promise(t),e}var QV=class{nodeFinished;loop;constructor({loop:e,nodeFinished:t}){this.loop=e,this.nodeFinished=t}async tick(e={}){let{timeout:t,retryPolicy:n,onStepWrite:r,maxConcurrency:i}=e,a=new Set,s,o=new AbortController,c=o.signal,l=t?AbortSignal.timeout(t):void 0,u=Object.values(this.loop.tasks).filter(p=>p.writes.length===0),{signals:d,disposeCombinedSignal:f}=this._initializeAbortSignals({exceptionSignal:c,stepTimeoutSignal:l,signal:e.signal}),h=this._executeTasksWithRetry(u,{signals:d,retryPolicy:n,maxConcurrency:i});for await(let{task:p,error:m,signalAborted:v}of h)this._commit(p,m),za(m)||Vl(m)&&!za(s)?s=m:m&&(a.size===0||!v)&&(o.abort(),a.add(m));if(f?.(),r?.(this.loop.step,Object.values(this.loop.tasks).map(p=>p.writes).flat()),a.size===1)throw Array.from(a)[0];if(a.size>1)throw new AggregateError(Array.from(a),`Multiple errors occurred during superstep ${this.loop.step}. See the "errors" field of this exception for more details.`);if(za(s)||Vl(s)&&this.loop.isNested)throw s}_initializeAbortSignals({exceptionSignal:e,stepTimeoutSignal:t,signal:n}){let r=this.loop.config.configurable?.__pregel_abort_signals??{},i=r.externalAbortSignal??n,a=t??r.timeoutAbortSignal,{signal:s,dispose:o}=td(i,a,e),c={externalAbortSignal:i,timeoutAbortSignal:a,composedAbortSignal:s};return this.loop.config=Vn(this.loop.config,{[GR]:c}),{signals:c,disposeCombinedSignal:o}}async*_executeTasksWithRetry(e,t){let{retryPolicy:n,maxConcurrency:r,signals:i}=t??{},a=YV(),s={},o={executingTasksMap:s,barrier:a,retryPolicy:n,scheduleTask:async(f,h,p)=>this.loop.acceptPush(f,h,p)};if(i?.composedAbortSignal?.aborted)throw new Error("Abort");let c=0,l,u=td(i?.externalAbortSignal,i?.timeoutAbortSignal),d=u.signal?new Promise((f,h)=>{l=()=>h(new Error("Abort")),u.signal?.addEventListener("abort",l,{once:!0})}):void 0;for(;(c===0||Object.keys(s).length>0)&&e.length;){for(;Object.values(s).length<(r??e.length)&&c<e.length;c+=1){let h=e[c];s[h.id]=uP(h,n,{[A_]:dP?.bind(o,this,h)},i?.composedAbortSignal).catch(p=>({task:h,error:p,signalAborted:i?.composedAbortSignal?.aborted}))}let f=await Promise.race([...Object.values(s),...d?[d]:[],a.wait]);f!==r_&&(yield f,l!=null&&(u.signal?.removeEventListener("abort",l),u.dispose?.()),delete s[f.task.id])}}_commit(e,t){if(t!==void 0)if(za(t)){if(t.interrupts.length){let n=t.interrupts.map(i=>[It,i]),r=e.writes.filter(i=>i[0]===hi);r.length&&n.push(...r),this.loop.putWrites(e.id,n)}}else Vl(t)&&e.writes.length?this.loop.putWrites(e.id,e.writes):this.loop.putWrites(e.id,[[cf,{message:t.message,name:t.name}]]);else this.nodeFinished&&(e.config?.tags==null||!e.config.tags.includes("langsmith:hidden"))&&this.nodeFinished(String(e.name)),e.writes.length===0&&e.writes.push([N_,null]),this.loop.putWrites(e.id,e.writes)}};async function dP(e,t,n,r,i,a={}){let s=t.config?.configurable?.[oi];if(!s)throw new Error(`BUG: No scratchpad found on task ${t.name}__${t.id}`);let o=s.callCounter;s.callCounter+=1;let c=new xV({func:n,name:r,input:i,cache:a.cache,retry:a.retry,callbacks:a.callbacks}),l=await this.scheduleTask(t,o,c);if(!l)return;let u=this.executingTasksMap[l.id];if(u!==void 0)return u;if(l.writes.length>0){let d=l.writes.filter(([h])=>h===lf),f=l.writes.filter(([h])=>h===cf);if(d.length>0){if(d.length===1)return Promise.resolve(d[0][1]);throw new Error(`BUG: multiple returns found for task ${l.name}__${l.id}`)}if(f.length>0){if(f.length===1){let h=f[0][1],p=h instanceof Error?h:new Error(String(h));return Promise.reject(p)}throw new Error(`BUG: multiple errors found for task ${l.name}__${l.id}`)}return}else{let d=uP(l,a.retry,{[A_]:dP.bind(this,e,l)});return this.executingTasksMap[l.id]=d,this.barrier.next(),d.then(({result:f,error:h})=>h?Promise.reject(h):f)}}var Ir=class extends Error{constructor(e){super(e),this.name="GraphValidationError"}};function eq({nodes:e,channels:t,inputChannels:n,outputChannels:r,streamChannels:i,interruptAfterNodes:a,interruptBeforeNodes:s}){if(!t)throw new Ir("Channels not provided");let o=new Set,c=new Set;for(let[l,u]of Object.entries(e)){if(l==="__interrupt__")throw new Ir(`"Node name ${It} is reserved"`);if(u.constructor===Xo)u.triggers.forEach(d=>o.add(d));else throw new Ir(`Invalid node type ${typeof u}, expected PregelNode`)}for(let l of o)if(!(l in t))throw new Ir(`Subscribed channel '${String(l)}' not in channels`);if(Array.isArray(n)){if(n.every(l=>!o.has(l)))throw new Ir(`None of the input channels ${n} are subscribed to by any node`)}else if(!o.has(n))throw new Ir(`Input channel ${String(n)} is not subscribed to by any node`);Array.isArray(r)?r.forEach(l=>c.add(l)):c.add(r),i&&!Array.isArray(i)?c.add(i):Array.isArray(i)&&i.forEach(l=>c.add(l));for(let l of c)if(!(l in t))throw new Ir(`Output channel '${String(l)}' not in channels`);if(a&&a!=="*"){for(let l of a)if(!(l in e))throw new Ir(`Node ${String(l)} not in nodes`)}if(s&&s!=="*"){for(let l of s)if(!(l in e))throw new Ir(`Node ${String(l)} not in nodes`)}}function jS(e,t){if(Array.isArray(e)){for(let n of e)if(!(n in t))throw new Error(`Key ${String(n)} not found in channels`)}else if(!(e in t))throw new Error(`Key ${String(e)} not found in channels`)}var tq=class fP extends Ci{lc_graph_name="Topic";unique=!1;accumulate=!1;seen;values;constructor(t){super(),this.unique=t?.unique??this.unique,this.accumulate=t?.accumulate??this.accumulate,this.seen=new Set,this.values=[]}fromCheckpoint(t){let n=new fP({unique:this.unique,accumulate:this.accumulate});return typeof t<"u"&&(n.seen=new Set(t[0]),n.values=t[1]),n}update(t){let n=!1;this.accumulate||(n=this.values.length>0,this.values=[]);let r=t.flat();if(r.length>0)if(this.unique)for(let i of r)this.seen.has(i)||(n=!0,this.seen.add(i),this.values.push(i));else n=!0,this.values.push(...r);return n}get(){if(this.values.length===0)throw new Tt;return this.values}checkpoint(){return[[...this.seen],this.values]}isAvailable(){return this.values.length!==0}},nq=class{static subscribeTo(e,t){let{key:n,tags:r}={key:void 0,tags:void 0,...t??{}};if(Array.isArray(e)&&n!==void 0)throw new Error("Can't specify a key when subscribing to multiple channels");let i;return typeof e=="string"?n?i={[n]:e}:i=[e]:i=Object.fromEntries(e.map(a=>[a,a])),new Xo({channels:i,triggers:Array.isArray(e)?e:[e],tags:r})}static writeTo(e,t){let n=[];for(let r of e)n.push({channel:r,value:ta,skipNone:!1});for(let[r,i]of Object.entries(t??{}))Re.isRunnable(i)||typeof i=="function"?n.push({channel:r,value:ta,skipNone:!0,mapper:jt(i)}):n.push({channel:r,value:i,skipNone:!1});return new Wt(n)}},rq=class extends Re{lc_namespace=["langgraph","pregel"];invoke(e,t){throw new Error("Not implemented")}withConfig(e){return super.withConfig(e)}stream(e,t){return super.stream(e,t)}},iq=class extends rq{static lc_name(){return"LangGraph"}lc_namespace=["langgraph","pregel"];lg_is_pregel=!0;nodes;channels;inputChannels;outputChannels;autoValidate=!0;streamMode=["values"];streamChannels;interruptAfter;interruptBefore;stepTimeout;debug=!1;checkpointer;retryPolicy;config;store;cache;userInterrupt;triggerToNodes={};constructor(e){super(e);let{streamMode:t}=e;if(t!=null&&!Array.isArray(t)&&(t=[t]),this.nodes=e.nodes,this.channels=e.channels,"__pregel_tasks"in this.channels&&"lc_graph_name"in this.channels.__pregel_tasks&&this.channels.__pregel_tasks.lc_graph_name!=="Topic")throw new Error(`Channel '${es}' is reserved and cannot be used in the graph.`);this.channels[es]=new tq({accumulate:!1}),this.autoValidate=e.autoValidate??this.autoValidate,this.streamMode=t??this.streamMode,this.inputChannels=e.inputChannels,this.outputChannels=e.outputChannels,this.streamChannels=e.streamChannels??this.streamChannels,this.interruptAfter=e.interruptAfter,this.interruptBefore=e.interruptBefore,this.stepTimeout=e.stepTimeout??this.stepTimeout,this.debug=e.debug??this.debug,this.checkpointer=e.checkpointer,this.retryPolicy=e.retryPolicy,this.config=e.config,this.store=e.store,this.cache=e.cache,this.name=e.name,this.triggerToNodes=e.triggerToNodes??this.triggerToNodes,this.userInterrupt=e.userInterrupt,this.autoValidate&&this.validate()}withConfig(e){let t=Tn(this.config,e);return new this.constructor({...this,config:t})}validate(){eq({nodes:this.nodes,channels:this.channels,outputChannels:this.outputChannels,inputChannels:this.inputChannels,streamChannels:this.streamChannels,interruptAfterNodes:this.interruptAfter,interruptBeforeNodes:this.interruptBefore});for(let[e,t]of Object.entries(this.nodes))for(let n of t.triggers)this.triggerToNodes[n]??=[],this.triggerToNodes[n].push(e);return this}get streamChannelsList(){return Array.isArray(this.streamChannels)?this.streamChannels:this.streamChannels?[this.streamChannels]:Object.keys(this.channels)}get streamChannelsAsIs(){return this.streamChannels?this.streamChannels:Object.keys(this.channels)}async getGraphAsync(e){return this.getGraph(e)}*getSubgraphs(e,t){for(let[n,r]of Object.entries(this.nodes)){if(e!==void 0&&!e.startsWith(n))continue;let i=r.subgraphs?.length?r.subgraphs:[r.bound];for(let a of i){let s=rP(a);if(s!==void 0){if(n===e){yield[n,s];return}if(e===void 0&&(yield[n,s]),t){let o=e;e!==void 0&&(o=e.slice(n.length+1));for(let[c,l]of s.getSubgraphs(o,t))yield[`${n}|${c}`,l]}}}}}async*getSubgraphsAsync(e,t){yield*this.getSubgraphs(e,t)}async _prepareStateSnapshot({config:e,saved:t,subgraphCheckpointer:n,applyPendingWrites:r=!1}){if(t===void 0)return{values:{},next:[],config:e,tasks:[]};let i=Xu(this.channels,t.checkpoint);if(t.pendingWrites?.length){let d=t.pendingWrites.filter(([f,h])=>f===or).map(([f,h,p])=>[String(h),p]);d.length>0&&vn(t.checkpoint,i,[{name:ni,writes:d,triggers:[]}],void 0,this.triggerToNodes)}let a=Object.values(Ja(t.checkpoint,t.pendingWrites,this.nodes,i,t.config,!0,{step:(t.metadata?.step??-1)+1,store:this.store})),s=await ri(this.getSubgraphsAsync()),o=t.config.configurable?.checkpoint_ns??"",c={};for(let d of a){let f=s.find(([p])=>p===d.name);if(!f)continue;let h=`${String(d.name)}:${d.id}`;if(o&&(h=`${o}|${h}`),n===void 0){let p={configurable:{thread_id:t.config.configurable?.thread_id,checkpoint_ns:h}};c[d.id]=p}else{let p={configurable:{[Rr]:n,thread_id:t.config.configurable?.thread_id,checkpoint_ns:h}},m=f[1];c[d.id]=await m.getState(p,{subgraphs:!0})}}if(r&&t.pendingWrites?.length){let d=Object.fromEntries(a.map(h=>[h.id,h]));for(let[h,p,m]of t.pendingWrites)["__error__","__interrupt__",ql].includes(p)||h in d&&d[h].writes.push([String(p),m]);let f=a.filter(h=>h.writes.length>0);f.length>0&&vn(t.checkpoint,i,f,void 0,this.triggerToNodes)}let l=t?.metadata;l&&t?.config?.configurable?.thread_id&&(l={...l,thread_id:t.config.configurable.thread_id});let u=a.filter(d=>d.writes.length===0).map(d=>d.name);return{values:fa(i,this.streamChannelsAsIs),next:u,tasks:sP(a,t?.pendingWrites??[],c,this.streamChannelsAsIs),metadata:l,config:Pi(t.config,t.metadata),createdAt:t.checkpoint.ts,parentConfig:t.parentConfig}}async getState(e,t){let n=e.configurable?.__pregel_checkpointer??this.checkpointer;if(!n)throw new Zl("No checkpointer set",{lc_error_code:"MISSING_CHECKPOINTER"});let r=e.configurable?.checkpoint_ns??"";if(r!==""&&e.configurable?.__pregel_checkpointer===void 0){let s=lm(r);for await(let[o,c]of this.getSubgraphsAsync(s,!0))if(o===s)return await c.getState(Ia(e,{[Rr]:n}),{subgraphs:t?.subgraphs})}let i=Tn(this.config,e),a=await n.getTuple(e);return await this._prepareStateSnapshot({config:i,saved:a,subgraphCheckpointer:t?.subgraphs?n:void 0,applyPendingWrites:!e.configurable?.checkpoint_id})}async*getStateHistory(e,t){let n=e.configurable?.__pregel_checkpointer??this.checkpointer;if(!n)throw new Zl("No checkpointer set",{lc_error_code:"MISSING_CHECKPOINTER"});let r=e.configurable?.checkpoint_ns??"";if(r!==""&&e.configurable?.__pregel_checkpointer===void 0){let a=lm(r);for await(let[s,o]of this.getSubgraphsAsync(a,!0))if(s===a){yield*o.getStateHistory(Ia(e,{[Rr]:n}),t);return}}let i=Tn(this.config,e,{configurable:{checkpoint_ns:r}});for await(let a of n.list(i,t))yield this._prepareStateSnapshot({config:a.config,saved:a})}async bulkUpdateState(e,t){let n=e.configurable?.__pregel_checkpointer??this.checkpointer;if(!n)throw new Zl("No checkpointer set",{lc_error_code:"MISSING_CHECKPOINTER"});if(t.length===0)throw new Error("No supersteps provided");if(t.some(s=>s.updates.length===0))throw new Error("No updates provided");let r=e.configurable?.checkpoint_ns??"";if(r!==""&&e.configurable?.__pregel_checkpointer===void 0){let s=lm(r);for await(let[,o]of this.getSubgraphsAsync(s,!0))return await o.bulkUpdateState(Ia(e,{[Rr]:n}),t);throw new Error(`Subgraph "${s}" not found`)}let i=async(s,o)=>{let c=this.config?Tn(this.config,s):s,l=await n.getTuple(c),u=l!==void 0?Ku(l.checkpoint):BN(),d={...l?.checkpoint.channel_versions},f=l?.metadata?.step??-1,h=Ia(c,{checkpoint_ns:c.configurable?.checkpoint_ns??""}),p=c.metadata??{};l?.config.configurable&&(h=Ia(c,l.config.configurable),p={...l.metadata,...p});let{values:m,asNode:v}=o[0];if(m==null&&v===void 0){if(o.length>1)throw new Qe("Cannot create empty checkpoint with multiple updates");return Pi(await n.put(h,Fi(u,void 0,f),{source:"update",step:f+1,parents:l?.metadata?.parents??{}},{}),l?l.metadata:void 0)}let g=Xu(this.channels,u);if(m===null&&v==="__end__"){if(o.length>1)throw new Qe("Cannot apply multiple updates when clearing state");if(l){let T=Ja(u,l.pendingWrites||[],this.nodes,g,l.config,!0,{step:(l.metadata?.step??-1)+1,checkpointer:n,store:this.store}),b=(l.pendingWrites||[]).filter(D=>D[0]===or).map(D=>D.slice(1));b.length>0&&vn(u,g,[{name:ni,writes:b,triggers:[]}],n.getNextVersion.bind(n),this.triggerToNodes);for(let[D,O,M]of l.pendingWrites||[])["__error__","__interrupt__",ql].includes(O)||D in T&&T[D].writes.push([O,M]);vn(u,g,Object.values(T),n.getNextVersion.bind(n),this.triggerToNodes)}return Pi(await n.put(h,Fi(u,g,f),{...p,source:"update",step:f+1,parents:l?.metadata?.parents??{}},au(d,u.channel_versions)),l?l.metadata:void 0)}if(v==="__copy__"){if(o.length>1)throw new Qe("Cannot copy checkpoint with multiple updates");if(l==null)throw new Qe("Cannot copy a non-existent checkpoint");let T=O=>!Array.isArray(O)||O.length===0?!1:O.every(M=>Array.isArray(M)&&M.length===2),b=Fi(u,void 0,f),D=await n.put(l.parentConfig??Ia(l.config,{checkpoint_id:void 0}),b,{source:"fork",step:f+1,parents:l.metadata?.parents??{}},{});if(T(m)){let O=Ja(b,l.pendingWrites,this.nodes,g,D,!1,{step:f+2}),M=Object.values(O).reduce((Me,{name:V,id:z})=>(Me[V]??=[],Me[V].push({id:z}),Me),{}),he=m.reduce((Me,V)=>{let[z,B]=V;Me[B]??=[];let ee=Me[B].length,se=M[B]?.[ee]?.id;return Me[B].push({values:z,asNode:B,taskId:se}),Me},{});return i(Pi(D,l.metadata),Object.values(he).flat())}return Pi(D,l.metadata)}if(v==="__input__"){if(o.length>1)throw new Qe("Cannot apply multiple updates when updating as input");let T=await ri(iP(this.inputChannels,m));if(T.length===0)throw new Qe(`Received no input writes for ${JSON.stringify(this.inputChannels,null,2)}`);vn(u,g,[{name:ni,writes:T,triggers:[]}],n.getNextVersion.bind(this.checkpointer),this.triggerToNodes);let b=l?.metadata?.step!=null?l.metadata.step+1:-1,D=await n.put(h,Fi(u,g,b),{source:"input",step:b,parents:l?.metadata?.parents??{}},au(d,u.channel_versions));return await n.putWrites(D,T,Fa(ni,u.id)),Pi(D,l?l.metadata:void 0)}if(c.configurable?.checkpoint_id===void 0&&l?.pendingWrites!==void 0&&l.pendingWrites.length>0){let T=Ja(u,l.pendingWrites,this.nodes,g,l.config,!0,{store:this.store,checkpointer:this.checkpointer,step:(l.metadata?.step??-1)+1}),b=(l.pendingWrites??[]).filter(O=>O[0]===or).map(O=>O.slice(1));b.length>0&&vn(l.checkpoint,g,[{name:ni,writes:b,triggers:[]}],void 0,this.triggerToNodes);for(let[O,M,he]of l.pendingWrites)["__error__","__interrupt__",ql].includes(M)||T[O]===void 0||T[O].writes.push([M,he]);let D=Object.values(T).filter(O=>O.writes.length>0);D.length>0&&vn(u,g,D,void 0,this.triggerToNodes)}let y=Object.values(u.versions_seen).map(T=>Object.values(T)).flat().find(T=>!!T),$=[];if(o.length===1){let{values:T,asNode:b,taskId:D}=o[0];if(b===void 0&&Object.keys(this.nodes).length===1)[b]=Object.keys(this.nodes);else if(b===void 0&&y===void 0)typeof this.inputChannels=="string"&&this.nodes[this.inputChannels]!==void 0&&(b=this.inputChannels);else if(b===void 0){let O=Object.entries(u.versions_seen).map(([M,he])=>Object.values(he).map(Me=>[Me,M])).flat().filter(([M,he])=>he!==It).sort(([M],[he])=>ZN(M,he));O&&(O.length===1?b=O[0][1]:O[O.length-1][0]!==O[O.length-2][0]&&(b=O[O.length-1][1]))}if(b===void 0)throw new Qe('Ambiguous update, specify "asNode"');$.push({values:T,asNode:b,taskId:D})}else for(let{asNode:T,values:b,taskId:D}of o){if(T==null)throw new Qe('"asNode" is required when applying multiple updates');$.push({values:b,asNode:T,taskId:D})}let S=[];for(let{asNode:T,values:b,taskId:D}of $){if(this.nodes[T]===void 0)throw new Qe(`Node "${T.toString()}" does not exist`);let O=this.nodes[T].getWriters();if(!O.length)throw new Qe(`No writers found for node "${T.toString()}"`);S.push({name:T,input:b,proc:O.length>1?ki.from(O,{omitSequenceTags:!0}):O[0],writes:[],triggers:[It],id:D??Fa("__interrupt__",u.id),writers:[]})}for(let T of S)await T.proc.invoke(T.input,Ve({...c,store:c?.store??this.store},{runName:c.runName??`${this.getName()}UpdateState`,configurable:{[si]:b=>T.writes.push(...b),[Ki]:(b,D=!1)=>su(u,g,T,b,D)}}));for(let T of S){let b=T.writes.filter(D=>D[0]!==Mr);l!==void 0&&b.length>0&&await n.putWrites(h,b,T.id)}vn(u,g,S,n.getNextVersion.bind(this.checkpointer),this.triggerToNodes);let x=au(d,u.channel_versions),C=await n.put(h,Fi(u,g,f+1),{source:"update",step:f+1,parents:l?.metadata?.parents??{}},x);for(let T of S){let b=T.writes.filter(D=>D[0]===Mr);b.length>0&&await n.putWrites(C,b,T.id)}return Pi(C,l?l.metadata:void 0)},a=e;for(let{updates:s}of t)a=await i(a,s);return a}async updateState(e,t,n){return this.bulkUpdateState(e,[{updates:[{values:t,asNode:n}]}])}_defaults(e){let{debug:t,streamMode:n,inputKeys:r,outputKeys:i,interruptAfter:a,interruptBefore:s,...o}=e,c=!0,l=t!==void 0?t:this.debug,u=i;u===void 0?u=this.streamChannelsAsIs:jS(u,this.channels);let d=r;d===void 0?d=this.inputChannels:jS(d,this.channels);let f=s??this.interruptBefore??[],h=a??this.interruptAfter??[],p;n!==void 0?(p=Array.isArray(n)?n:[n],c=typeof n=="string"):(e.configurable?.__pregel_task_id!==void 0?p=["values"]:p=this.streamMode,c=!0);let m;if(this.checkpointer===!1)m=void 0;else if(e!==void 0&&e.configurable?.__pregel_checkpointer!==void 0)m=e.configurable[Rr];else{if(this.checkpointer===!0)throw new Error("checkpointer: true cannot be used for root graphs.");m=this.checkpointer}let v=e.store??this.store,g=e.cache??this.cache;if(e.durability!=null&&e.checkpointDuring!=null)throw new Error("Cannot use both `durability` and `checkpointDuring` at the same time.");let y=(()=>{if(e.checkpointDuring!=null)return e.checkpointDuring===!1?"exit":"async"})(),$=e.durability??y??e?.configurable?.__pregel_durability??"async";return[l,p,d,u,o,f,h,m,v,c,g,$]}async stream(e,t){let n=new AbortController,r={recursionLimit:this.config?.recursionLimit,...t,signal:td(t?.signal,n.signal).signal},i=await super.stream(e,r);return new NS(t?.encoding==="text/event-stream"?ZV(i):i,n)}streamEvents(e,t,n){let r=new AbortController,i={recursionLimit:this.config?.recursionLimit,...t,callbacks:kV(this.config?.callbacks,t?.callbacks),signal:td(t?.signal,r.signal).signal};return new NS(super.streamEvents(e,i,n),r)}async _validateInput(e){return e}async _validateContext(e){return e}async*_streamIterator(e,t){let n="version"in(t??{})?void 0:t?.encoding??void 0,r=t?.subgraphs,i=JN(this.config,t);if(i.recursionLimit===void 0||i.recursionLimit<1)throw new Error('Passed "recursionLimit" must be at least 1.');if(this.checkpointer!==void 0&&this.checkpointer!==!1&&i.configurable===void 0)throw new Error('Checkpointer requires one or more of the following "configurable" keys: "thread_id", "checkpoint_ns", "checkpoint_id"');let a=await this._validateInput(e),{runId:s,...o}=i,[c,l,,u,d,f,h,p,m,v,g,y]=this._defaults(o);d.metadata={ls_integration:"langgraph",...d.metadata},typeof d.context<"u"?d.context=await this._validateContext(d.context):d.configurable=await this._validateContext(d.configurable);let $=new cP({modes:new Set(l)});if(this.checkpointer===!0){d.configurable??={};let O=d.configurable.checkpoint_ns??"";d.configurable[jr]=O.split("|").map(M=>M.split(":")[0]).join("|")}if(l.includes("messages")){let O=new WV(he=>$.push(he)),{callbacks:M}=d;if(M===void 0)d.callbacks=[O];else if(Array.isArray(M))d.callbacks=M.concat(O);else{let he=M.copy();he.addHandler(O,!0),d.callbacks=he}}if(l.includes("tools")){let O=new zV(he=>$.push(he)),{callbacks:M}=d;if(M===void 0)d.callbacks=[O];else if(Array.isArray(M))d.callbacks=M.concat(O);else{let he=M.copy();he.addHandler(O,!0),d.callbacks=he}}d.writer??=O=>{if(!l.includes("custom"))return;let M=K8()?.configurable?.[jr]?.split("|").slice(0,-1);$.push([M??[],"custom",O])},d.interrupt??=this.userInterrupt??_V;let S=await(await Qt(d))?.handleChainStart(this.toJSON(),SV(e,"input"),s,void 0,void 0,void 0,d?.runName??this.getName()),x=Ub(this.channels),C,T,D=(async()=>{try{C=await HV.initialize({input:a,config:d,checkpointer:p,nodes:this.nodes,channelSpecs:x,outputKeys:u,streamKeys:this.streamChannelsAsIs,store:m,cache:g,stream:$,interruptAfter:h,interruptBefore:f,manager:S,debug:this.debug,triggerToNodes:this.triggerToNodes,durability:y});let O=new QV({loop:C,nodeFinished:d.configurable?.[qR]});t?.subgraphs&&(C.config.configurable={...C.config.configurable,[C_]:C.stream}),await this._runLoop({loop:C,runner:O,debug:c,config:d}),y==="sync"&&await Promise.all(C?.checkpointerPromises??[])}catch(O){T=O}finally{try{C&&(await C.store?.stop(),await C.cache?.stop()),await Promise.all(C?.checkpointerPromises??[])}catch(O){T=T??O}T?$.error(T):$.close()}})();try{for await(let O of $){if(O===void 0)throw new Error("Data structure error.");let[M,he,Me]=O;if(l.includes(he)){if(n==="text/event-stream"){r?yield[M,he,Me]:yield[null,he,Me];continue}r&&!v?yield[M,he,Me]:v?r?yield[M,Me]:yield Me:yield[he,Me]}}}catch(O){throw await S?.handleChainError(T),O}finally{await D}await S?.handleChainEnd(C?.output??{},s,void 0,void 0,void 0)}async invoke(e,t){let n=t?.streamMode??"values",r={...t,outputKeys:t?.outputKeys??this.outputChannels,streamMode:n,encoding:void 0},i=[],a=await this.stream(e,r),s=[],o;for await(let c of a)n==="values"?Ik(c)?s.push(c[It]):o=c:i.push(c);if(n==="values"){if(s.length>0){let c=s.flat(1);if(o==null)return{[It]:c};if(typeof o=="object")return{...o,[It]:c}}return o}return i}async _runLoop(e){let{loop:t,runner:n,debug:r,config:i}=e,a;try{for(;await t.tick({inputKeys:this.inputChannels});){for(let{task:s}of await t._matchCachedWrites())t._outputWrites(s.id,s.writes,!0);r&&UV(t.checkpointMetadata.step,t.channels,this.streamChannelsList),r&&oP(t.step,Object.values(t.tasks)),await n.tick({timeout:this.stepTimeout,retryPolicy:this.retryPolicy,onStepWrite:(s,o)=>{r&&LV(s,o,this.streamChannelsList)},maxConcurrency:i.maxConcurrency,signal:i.signal})}if(t.status==="out_of_steps")throw new XR([`Recursion limit of ${i.recursionLimit} reached`,"without hitting a stop condition. You can increase the",'limit by setting the "recursionLimit" config key.'].join(" "),{lc_error_code:"GRAPH_RECURSION_LIMIT"})}catch(s){if(a=s,!await t.finishAndHandleError(a))throw s}finally{a===void 0&&await t.finishAndHandleError()}}async clearCache(){await this.cache?.clear([])}},ks=class hP extends Ci{lc_graph_name="EphemeralValue";guard;value=[];constructor(t=!0){super(),this.guard=t}fromCheckpoint(t){let n=new hP(this.guard);return typeof t<"u"&&(n.value=[t]),n}update(t){if(t.length===0){let n=this.value.length>0;return this.value=[],n}if(t.length!==1&&this.guard)throw new Qe("EphemeralValue can only receive one value per step.");return this.value=[t[t.length-1]],!0}get(){if(this.value.length===0)throw new Tt;return this.value[0]}checkpoint(){if(this.value.length===0)throw new Tt;return this.value[0]}isAvailable(){return this.value.length!==0}},pP=class{path;ends;constructor(e){Re.isRunnable(e.path)?this.path=e.path:this.path=jt(e.path),this.ends=Array.isArray(e.pathMap)?e.pathMap.reduce((t,n)=>(t[n]=n,t),{}):e.pathMap}run(e,t){return Wt.registerWriter(new wa({name:"<branch_run>",trace:!1,func:async(n,r)=>{try{return await this._route(n,r,e,t)}catch(i){throw i.name===pi.unminifiable_name&&console.warn(`[WARN]: 'NodeInterrupt' thrown in conditional edge. This is likely a bug in your graph implementation.
763
- NodeInterrupt should only be thrown inside a node, not in edge conditions.`),i}}}))}async _route(e,t,n,r){let i=await this.path.invoke(r?r(t):e,t);Array.isArray(i)||(i=[i]);let a;if(this.ends?a=i.map(s=>ln(s)?s:this.ends[s]):a=i,a.some(s=>!s))throw new Error("Branch condition returned unknown or null destination");if(a.filter(ln).some(s=>s.node==="__end__"))throw new Qe("Cannot send a packet to the END node");return await n(a,t)??e}},aq=class{nodes;edges;branches;entryPoint;compiled=!1;constructor(){this.nodes={},this.edges=new Set,this.branches={}}warnIfCompiled(e){this.compiled&&console.warn(e)}get allEdges(){return this.edges}addNode(...e){function t(r){return r.length>=1&&typeof r[0]!="string"}let n=t(e)?Array.isArray(e[0])?e[0]:Object.entries(e[0]):[[e[0],e[1],e[2]]];if(n.length===0)throw new Error("No nodes provided in `addNode`");for(let[r,i,a]of n){for(let o of["|",":"])if(r.includes(o))throw new Error(`"${o}" is a reserved character and is not allowed in node names.`);if(this.warnIfCompiled("Adding a node to a graph that has already been compiled. This will not be reflected in the compiled graph."),r in this.nodes)throw new Error(`Node \`${r}\` already present.`);if(r==="__end__")throw new Error(`Node \`${r}\` is reserved.`);let s=jt(i);this.nodes[r]={runnable:s,metadata:a?.metadata,subgraphs:zb(s)?[s]:a?.subgraphs,ends:a?.ends}}return this}addEdge(e,t){if(this.warnIfCompiled("Adding an edge to a graph that has already been compiled. This will not be reflected in the compiled graph."),e==="__end__")throw new Error("END cannot be a start node");if(t==="__start__")throw new Error("START cannot be an end node");if(Array.from(this.edges).some(([n])=>n===e)&&!("channels"in this))throw new Error(`Already found path for ${e}. For multiple edges, use StateGraph.`);return this.edges.add([e,t]),this}addConditionalEdges(e,t,n){let r=typeof e=="object"?e:{source:e,path:t,pathMap:n};this.warnIfCompiled("Adding an edge to a graph that has already been compiled. This will not be reflected in the compiled graph."),Re.isRunnable(r.path)||(r.path=jt(r.path));let i=r.path.getName()==="RunnableLambda"?"condition":r.path.getName();if(this.branches[r.source]&&this.branches[r.source][i])throw new Error(`Condition \`${i}\` already present for node \`${e}\``);return this.branches[r.source]??={},this.branches[r.source][i]=new pP(r),this}setEntryPoint(e){return this.warnIfCompiled("Setting the entry point of a graph that has already been compiled. This will not be reflected in the compiled graph."),this.addEdge(wt,e)}setFinishPoint(e){return this.warnIfCompiled("Setting a finish point of a graph that has already been compiled. This will not be reflected in the compiled graph."),this.addEdge(e,xt)}compile({checkpointer:e,interruptBefore:t,interruptAfter:n,name:r}={}){this.validate([...Array.isArray(t)?t:[],...Array.isArray(n)?n:[]]);let i=new mP({builder:this,checkpointer:e,interruptAfter:n,interruptBefore:t,autoValidate:!1,nodes:{},channels:{[wt]:new ks,[xt]:new ks},inputChannels:wt,outputChannels:xt,streamChannels:[],streamMode:"values",name:r});for(let[a,s]of Object.entries(this.nodes))i.attachNode(a,s);for(let[a,s]of this.edges)i.attachEdge(a,s);for(let[a,s]of Object.entries(this.branches))for(let[o,c]of Object.entries(s))i.attachBranch(a,o,c);return i.validate()}validate(e){let t=new Set([...this.allEdges].map(([r,i])=>r));for(let[r]of Object.entries(this.branches))t.add(r);for(let r of t)if(r!=="__start__"&&!(r in this.nodes))throw new Error(`Found edge starting at unknown node \`${r}\``);let n=new Set([...this.allEdges].map(([r,i])=>i));for(let[r,i]of Object.entries(this.branches))for(let a of Object.values(i))if(a.ends!=null)for(let s of Object.values(a.ends))n.add(s);else{n.add(xt);for(let s of Object.keys(this.nodes))s!==r&&n.add(s)}for(let r of Object.values(this.nodes))for(let i of r.ends??[])n.add(i);for(let r of Object.keys(this.nodes))if(!n.has(r))throw new QR([`Node \`${r}\` is not reachable.`,"","If you are returning Command objects from your node,",'make sure you are passing names of potential destination nodes as an "ends" array','into ".addNode(..., { ends: ["node1", "node2"] })".'].join(`
764
- `),{lc_error_code:"UNREACHABLE_NODE"});for(let r of n)if(r!=="__end__"&&!(r in this.nodes))throw new Error(`Found edge ending at unknown node \`${r}\``);if(e){for(let r of e)if(!(r in this.nodes))throw new Error(`Interrupt node \`${r}\` is not present`)}this.compiled=!0}},mP=class extends iq{builder;constructor({builder:e,...t}){super(t),this.builder=e}attachNode(e,t){this.channels[e]=new ks,this.nodes[e]=new Xo({channels:[],triggers:[],metadata:t.metadata,subgraphs:t.subgraphs,ends:t.ends}).pipe(t.runnable).pipe(new Wt([{channel:e,value:ta}],[sn])),this.streamChannels.push(e)}attachEdge(e,t){if(t==="__end__"){if(e==="__start__")throw new Error("Cannot have an edge from START to END");this.nodes[e].writers.push(new Wt([{channel:xt,value:ta}],[sn]))}else this.nodes[t].triggers.push(e),this.nodes[t].channels.push(e)}attachBranch(e,t,n){e==="__start__"&&!this.nodes.__start__&&(this.nodes[wt]=nq.subscribeTo(wt,{tags:[sn]})),this.nodes[e].pipe(n.run(i=>new Wt(i.map(a=>ln(a)?a:{channel:a==="__end__"?xt:`branch:${e}:${t}:${a}`,value:ta}),[sn])));let r=n.ends?Object.values(n.ends):Object.keys(this.nodes);for(let i of r)if(i!=="__end__"){let a=`branch:${e}:${t}:${i}`;this.channels[a]=new ks,this.nodes[i].triggers.push(a),this.nodes[i].channels.push(a)}}async getGraphAsync(e){let t=e?.xray,n=new Bo,r={[wt]:n.addNode({schema:Ga()},wt)},i={},a={};t&&(a=Object.fromEntries((await ri(this.getSubgraphsAsync())).filter(c=>MS(c[1]))));function s(c,l,u,d=!1){if(l==="__end__"&&i.__end__===void 0&&(i[xt]=n.addNode({schema:Ga()},xt)),r[c]!==void 0){if(i[l]===void 0)throw new Error(`End node ${l} not found!`);return n.addEdge(r[c],i[l],u!==l?u:void 0,d)}}for(let[c,l]of Object.entries(this.builder.nodes)){let u=Ut(c),d=l.runnable,f=l.metadata??{};if(this.interruptBefore?.includes(c)&&this.interruptAfter?.includes(c)?f.__interrupt="before,after":this.interruptBefore?.includes(c)?f.__interrupt="before":this.interruptAfter?.includes(c)&&(f.__interrupt="after"),t){let h=typeof t=="number"?t-1:t,p=a[c]!==void 0?await a[c].getGraphAsync({...e,xray:h}):d.getGraph(e);if(p.trimFirstNode(),p.trimLastNode(),Object.keys(p.nodes).length>1){let m=function($){return $?$.lc_runnable:!1},v=function($,S){if($!==void 0&&!Rm($))return $;if(m(S))try{let x=S.getName();return x=x.startsWith("Runnable")?x.slice(8):x,x}catch{return S.getName()}else return S.name??"UnknownSchema"},[g,y]=n.extend(p,u);if(g===void 0)throw new Error(`Could not extend subgraph "${c}" due to missing entrypoint.`);y!==void 0&&(r[u]={name:v(y.id,y.data),...y}),i[u]={name:v(g.id,g.data),...g}}else{let m=n.addNode(d,u,f);r[u]=m,i[u]=m}}else{let h=n.addNode(d,u,f);r[u]=h,i[u]=h}}let o=[...this.builder.allEdges].sort(([c],[l])=>c<l?-1:l>c?1:0);for(let[c,l]of o)s(Ut(c),Ut(l));for(let[c,l]of Object.entries(this.builder.branches)){let u={...Object.fromEntries(Object.keys(this.builder.nodes).filter(d=>d!==c).map(d=>[Ut(d),Ut(d)])),[xt]:xt};for(let d of Object.values(l)){let f;d.ends!==void 0?f=d.ends:f=u;for(let[h,p]of Object.entries(f))s(Ut(c),Ut(p),h,!0)}}for(let[c,l]of Object.entries(this.builder.nodes))if(l.ends!==void 0)for(let u of l.ends)s(Ut(c),Ut(u),void 0,!0);return n}getGraph(e){let t=e?.xray,n=new Bo,r={[wt]:n.addNode({schema:Ga()},wt)},i={},a={};t&&(a=Object.fromEntries(so(this.getSubgraphs()).filter(c=>MS(c[1]))));function s(c,l,u,d=!1){return l==="__end__"&&i.__end__===void 0&&(i[xt]=n.addNode({schema:Ga()},xt)),n.addEdge(r[c],i[l],u!==l?u:void 0,d)}for(let[c,l]of Object.entries(this.builder.nodes)){let u=Ut(c),d=l.runnable,f=l.metadata??{};if(this.interruptBefore?.includes(c)&&this.interruptAfter?.includes(c)?f.__interrupt="before,after":this.interruptBefore?.includes(c)?f.__interrupt="before":this.interruptAfter?.includes(c)&&(f.__interrupt="after"),t){let h=typeof t=="number"?t-1:t,p=a[c]!==void 0?a[c].getGraph({...e,xray:h}):d.getGraph(e);if(p.trimFirstNode(),p.trimLastNode(),Object.keys(p.nodes).length>1){let m=function($){return $?$.lc_runnable:!1},v=function($,S){if($!==void 0&&!Rm($))return $;if(m(S))try{let x=S.getName();return x=x.startsWith("Runnable")?x.slice(8):x,x}catch{return S.getName()}else return S.name??"UnknownSchema"},[g,y]=n.extend(p,u);if(g===void 0)throw new Error(`Could not extend subgraph "${c}" due to missing entrypoint.`);y!==void 0&&(r[u]={name:v(y.id,y.data),...y}),i[u]={name:v(g.id,g.data),...g}}else{let m=n.addNode(d,u,f);r[u]=m,i[u]=m}}else{let h=n.addNode(d,u,f);r[u]=h,i[u]=h}}let o=[...this.builder.allEdges].sort(([c],[l])=>c<l?-1:l>c?1:0);for(let[c,l]of o)s(Ut(c),Ut(l));for(let[c,l]of Object.entries(this.builder.branches)){let u={...Object.fromEntries(Object.keys(this.builder.nodes).filter(d=>d!==c).map(d=>[Ut(d),Ut(d)])),[xt]:xt};for(let d of Object.values(l)){let f;d.ends!==void 0?f=d.ends:f=u;for(let[h,p]of Object.entries(f))s(Ut(c),Ut(p),h,!0)}}return n}};function MS(e){return typeof e.attachNode=="function"&&typeof e.attachEdge=="function"}function Ut(e){return e==="subgraph"?`"${e}"`:e}function co(e){return typeof e=="object"&&e!==null&&"~standard"in e&&typeof e["~standard"]=="object"&&e["~standard"]!==null&&"validate"in e["~standard"]}function sq(e){return typeof e=="object"&&e!==null&&"~standard"in e&&typeof e["~standard"]=="object"&&e["~standard"]!==null&&"jsonSchema"in e["~standard"]}function Ta(e){if(sq(e))try{return e["~standard"].jsonSchema.input({target:"draft-07"})}catch{return}}function Oa(e){if(e!=null&&co(e))try{let t=e["~standard"].validate(void 0);if(t&&typeof t=="object"&&!("then"in t&&typeof t.then=="function")){let n=t;if(!n.issues){let r=n.value;return()=>r}}}catch{}}var _m=Symbol.for("langgraph.channel.missing"),oq=class gP extends Ci{lc_graph_name="UntrackedValue";guard;_value=_m;initialValueFactory;constructor(t){super(),this.guard=t?.guard??!0,this.initialValueFactory=t?.initialValueFactory,this.initialValueFactory&&(this._value=this.initialValueFactory())}fromCheckpoint(t){return new gP({guard:this.guard,initialValueFactory:this.initialValueFactory})}update(t){if(t.length===0)return!1;if(t.length!==1&&this.guard)throw new Qe("UntrackedValue(guard=true) can receive only one value per step. Use guard=false if you want to store any one of multiple values.",{lc_error_code:"INVALID_CONCURRENT_GRAPH_UPDATE"});return this._value=t[t.length-1],!0}get(){if(this._value===_m)throw new Tt;return this._value}checkpoint(){}isAvailable(){return this._value!==_m}},qi=(e,t)=>e.size===t.size&&[...e].every(n=>t.has(n)),cq=class _P extends Ci{lc_graph_name="NamedBarrierValue";names;seen;constructor(t){super(),this.names=t,this.seen=new Set}fromCheckpoint(t){let n=new _P(this.names);return typeof t<"u"&&(n.seen=new Set(t)),n}update(t){let n=!1;for(let r of t)if(this.names.has(r))this.seen.has(r)||(this.seen.add(r),n=!0);else throw new Qe(`Value ${JSON.stringify(r)} not in names ${JSON.stringify(this.names)}`);return n}get(){if(!qi(this.names,this.seen))throw new Tt}checkpoint(){return[...this.seen]}consume(){return this.seen&&this.names&&qi(this.seen,this.names)?(this.seen=new Set,!0):!1}isAvailable(){return!!this.names&&qi(this.names,this.seen)}},lq=class yP extends Ci{lc_graph_name="NamedBarrierValueAfterFinish";names;seen;finished;constructor(t){super(),this.names=t,this.seen=new Set,this.finished=!1}fromCheckpoint(t){let n=new yP(this.names);if(typeof t<"u"){let[r,i]=t;n.seen=new Set(r),n.finished=i}return n}update(t){let n=!1;for(let r of t)if(this.names.has(r)&&!this.seen.has(r))this.seen.add(r),n=!0;else if(!this.names.has(r))throw new Qe(`Value ${JSON.stringify(r)} not in names ${JSON.stringify(this.names)}`);return n}get(){if(!this.finished||!qi(this.names,this.seen))throw new Tt}checkpoint(){return[[...this.seen],this.finished]}consume(){return this.finished&&this.seen&&this.names&&qi(this.seen,this.names)?(this.seen=new Set,this.finished=!1,!0):!1}finish(){return!this.finished&&this.names&&qi(this.names,this.seen)?(this.finished=!0,!0):!1}isAvailable(){return this.finished&&!!this.names&&qi(this.names,this.seen)}},ym=Symbol.for("langgraph.state.reduced_value"),ja=class{[ym]=!0;valueSchema;inputSchema;reducer;jsonSchemaExtra;constructor(e,t){this.reducer=t.reducer,this.jsonSchemaExtra=t.jsonSchemaExtra,this.valueSchema=e,this.inputSchema="inputSchema"in t?t.inputSchema:e,this.jsonSchemaExtra=t.jsonSchemaExtra}static isInstance(e){return typeof e=="object"&&e!==null&&ym in e&&e[ym]===!0}},DS=Symbol.for("langgraph.state.untracked_value"),Ks=class{[DS]=!0;schema;guard;constructor(e,t){this.schema=e,this.guard=t?.guard??!0}static isInstance(e){return typeof e=="object"&&e!==null&&DS in e}},vm=Symbol.for("langgraph.state.state_schema"),Gi=class{[vm]=!0;constructor(e){this.fields=e}getChannels(){let e={};for(let[t,n]of Object.entries(this.fields))if(ja.isInstance(n)){let r=Oa(n.valueSchema);e[t]=new Yu(n.reducer,r)}else if(Ks.isInstance(n)){let r=n.schema?Oa(n.schema):void 0;e[t]=new oq({guard:n.guard,initialValueFactory:r})}else if(co(n))e[t]=new Th(Oa(n));else throw new Error(`Invalid state field "${t}": must be a schema, ReducedValue, UntrackedValue, or ManagedValue`);return e}getJsonSchema(){let e={},t=[];for(let[n,r]of Object.entries(this.fields)){let i;if(ja.isInstance(r)?(i=Ta(r.valueSchema),r.jsonSchemaExtra&&(i={...i??{},...r.jsonSchemaExtra})):Ks.isInstance(r)?i=r.schema?Ta(r.schema):void 0:co(r)&&(i=Ta(r)),i){e[n]=i;let a=!1;ja.isInstance(r)?a=Oa(r.valueSchema)!==void 0:Ks.isInstance(r)?a=r.schema?Oa(r.schema)!==void 0:!1:a=Oa(r)!==void 0,a||t.push(n)}}return{type:"object",properties:e,required:t.length>0?t:void 0}}getInputJsonSchema(){let e={};for(let[t,n]of Object.entries(this.fields)){let r;ja.isInstance(n)?(r=Ta(n.inputSchema),n.jsonSchemaExtra&&(r={...r??{},...n.jsonSchemaExtra})):Ks.isInstance(n)?r=n.schema?Ta(n.schema):void 0:co(n)&&(r=Ta(n)),r&&(e[t]=r)}return{type:"object",properties:e}}getChannelKeys(){return Object.entries(this.fields).map(([e])=>e)}getAllKeys(){return Object.keys(this.fields)}async validateInput(e){if(e==null||typeof e!="object")return e;let t={};for(let[n,r]of Object.entries(e)){let i=this.fields[n];if(i===void 0){t[n]=r;continue}let a;if(ja.isInstance(i)?a=i.inputSchema:Ks.isInstance(i)?a=i.schema:co(i)&&(a=i),a){let s=await a["~standard"].validate(r);if(s.issues)throw new Error(`Validation failed for field "${n}": ${JSON.stringify(s.issues)}`);t[n]=s.value}else t[n]=r}return t}static isInstance(e){return typeof e=="object"&&e!==null&&vm in e&&e[vm]===!0}};function Oh(e,t){let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t],i=n.map(pr),a=r.map(pr);for(let u of i)(u.id===null||u.id===void 0)&&(u.id=zi(),u.lc_kwargs.id=u.id);let s;for(let u=0;u<a.length;u+=1){let d=a[u];(d.id===null||d.id===void 0)&&(d.id=zi(),d.lc_kwargs.id=d.id),Xi.isInstance(d)&&d.id==="__remove_all__"&&(s=u)}if(s!=null)return a.slice(s+1);let o=[...i],c=new Map(o.map((u,d)=>[u.id,d])),l=new Set;for(let u of a){let d=c.get(u.id);if(d!==void 0)Xi.isInstance(u)?l.add(u.id):(l.delete(u.id),o[d]=u);else{if(Xi.isInstance(u))throw new Error(`Attempting to delete a message with an ID that doesn't exist ('${u.id}')`);c.set(u.id,o.length),o.push(u)}}return o.filter(u=>!l.has(u.id))}new ja(Wu().default(()=>[]),{inputSchema:Wu(),reducer:Oh,jsonSchemaExtra:{langgraph_type:"messages",description:"A list of chat messages"}});var uq=class{_map=new Map;_extensionCache=new Map;get(e){return this._map.get(e)}extend(e,t){let n=this.get(e);this._map.set(e,t(n))}remove(e){return this._map.delete(e),this}has(e){return this._map.has(e)}getChannelsForSchema(e){let t={},n=zo(e);for(let[r,i]of Object.entries(n)){let a=this.get(i);a?.reducer?t[r]=new Yu(a.reducer.fn,a.default):t[r]=new Th(a?.default)}return t}getExtendedChannelSchemas(e,t){if(Object.keys(t).length===0)return e;let n=Object.entries(t).filter(([,a])=>a===!0).sort(([a],[s])=>a.localeCompare(s)).map(([a,s])=>`${a}:${s}`).join("|"),r=this._extensionCache.get(n)??new Map;if(r.has(e))return r.get(e);let i=e;if(t.withReducerSchema||t.withJsonSchemaExtrasAsDescription){let a=Object.entries(zo(e)).map(([s,o])=>{let c=this.get(o),l=t.withReducerSchema?c?.reducer?.schema??o:o;if(t.withJsonSchemaExtrasAsDescription&&c?.jsonSchemaExtra){let u=gs(l)??gs(o),d=JSON.stringify({...c.jsonSchemaExtra,description:u});l=l.describe(`lg:${d}`)}return[s,l]});i=m1(e,Object.fromEntries(a)),_t(i)&&(i._def.unknownKeys="strip")}return t.asPartial&&(i=mv(i)),r.set(e,i),this._extensionCache.set(n,r),i}},nd=new uq;function dq(e,t){if(t.reducer&&!t.default){let n=g1(e);n!=null&&(t.default=n)}if(t.reducer){let n=Object.assign(e,{lg_reducer_schema:t.reducer?.schema??e});return nd.extend(n,()=>t),n}else return nd.extend(e,()=>t),e}function Ma(e){return e==null?!1:!!(Gi.isInstance(e)||En(e)||typeof e=="object"&&"lc_graph_name"in e&&e.lc_graph_name==="AnnotationRoot"||typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0&&Object.values(e).every(t=>typeof t=="function"||VN(t)))}function fq(e){if(typeof e!="object"||e==null)return!1;let t=e,n="state"in t&&Ma(t.state),r="stateSchema"in t&&Ma(t.stateSchema),i="input"in t&&Ma(t.input);return!(!n&&!r&&!i||"input"in t&&t.input!=null&&!Ma(t.input)||"output"in t&&t.output!=null&&!Ma(t.output))}var Dr="__root__",rd=Symbol.for("langgraph.state.partial"),Zb=class extends aq{channels={};waitingEdges=new Set;_schemaDefinition;_schemaRuntimeDefinition;_inputDefinition;_inputRuntimeDefinition;_outputDefinition;_outputRuntimeDefinition;_schemaDefinitions=new Map;_metaRegistry=nd;_configSchema;_configRuntimeSchema;_interrupt;_writer;constructor(e,t){super();let n=this._normalizeToStateGraphInit(e,t),r=n.state??n.stateSchema??n.input;if(!r)throw new Uh;let i=this._getChannelsFromSchema(r);this._schemaDefinition=i,Gi.isInstance(r)?this._schemaRuntimeDefinition=r:En(r)&&(this._schemaRuntimeDefinition=r),n.input?Gi.isInstance(n.input)?this._inputRuntimeDefinition=n.input:En(n.input)?this._inputRuntimeDefinition=n.input:this._inputRuntimeDefinition=rd:this._inputRuntimeDefinition=rd,n.output?Gi.isInstance(n.output)?this._outputRuntimeDefinition=n.output:En(n.output)?this._outputRuntimeDefinition=n.output:this._outputRuntimeDefinition=this._schemaRuntimeDefinition:this._outputRuntimeDefinition=this._schemaRuntimeDefinition;let a=n.input?this._getChannelsFromSchema(n.input):i,s=n.output?this._getChannelsFromSchema(n.output):i;this._inputDefinition=a,this._outputDefinition=s,this._addSchema(this._schemaDefinition),this._addSchema(this._inputDefinition),this._addSchema(this._outputDefinition),n.context&&En(n.context)&&(this._configRuntimeSchema=n.context),this._interrupt=n.interrupt,this._writer=n.writer}_normalizeToStateGraphInit(e,t){if(fq(e)){if(En(t)||Xg.isInstance(t))return{...e,context:t};let n=t;return{...e,input:e.input??n?.input,output:e.output??n?.output,context:e.context??n?.context,interrupt:e.interrupt??n?.interrupt,writer:e.writer??n?.writer,nodes:e.nodes??n?.nodes}}if(Ma(e)){if(En(t)||Xg.isInstance(t))return{state:e,context:t};let n=t;return{state:e,input:n?.input,output:n?.output,context:n?.context,interrupt:n?.interrupt,writer:n?.writer,nodes:n?.nodes}}if(mq(e))return{state:hq(e.channels)};throw new Uh}_getChannelsFromSchema(e){if(Gi.isInstance(e))return e.getChannels();if(En(e))return this._metaRegistry.getChannelsForSchema(e);if(typeof e=="object"&&"lc_graph_name"in e&&e.lc_graph_name==="AnnotationRoot")return e.spec;if(typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length>0)return e;throw new Uh("Invalid schema type. Expected StateSchema, Zod object, AnnotationRoot, or StateDefinition.")}get allEdges(){return new Set([...this.edges,...Array.from(this.waitingEdges).flatMap(([e,t])=>e.map(n=>[n,t]))])}_addSchema(e){if(!this._schemaDefinitions.has(e)){this._schemaDefinitions.set(e,e);for(let[t,n]of Object.entries(e)){let r;if(typeof n=="function"?r=n():r=n,this.channels[t]!==void 0){if(!this.channels[t].equals(r)&&r.lc_graph_name!=="LastValue")throw new Error(`Channel "${t}" already exists with a different type.`)}else this.channels[t]=r}}}addNode(...e){function t(r){return r.length>=1&&typeof r[0]!="string"}let n=t(e)?Array.isArray(e[0])?e[0]:Object.entries(e[0]).map(([r,i])=>[r,i]):[[e[0],e[1],e[2]]];if(n.length===0)throw new Error("No nodes provided in `addNode`");for(let[r,i,a]of n){if(r in this.channels)throw new Error(`${r} is already being used as a state attribute (a.k.a. a channel), cannot also be used as a node name.`);for(let u of["|",":"])if(r.includes(u))throw new Error(`"${u}" is a reserved character and is not allowed in node names.`);if(this.warnIfCompiled("Adding a node to a graph that has already been compiled. This will not be reflected in the compiled graph."),r in this.nodes)throw new Error(`Node \`${r}\` already present.`);if(r==="__end__"||r==="__start__")throw new Error(`Node \`${r}\` is reserved.`);let s=this._schemaDefinition;a?.input!==void 0&&(s=this._getChannelsFromSchema(a.input)),this._addSchema(s);let o;Re.isRunnable(i)?o=i:typeof i=="function"?o=new wa({func:i,name:r,trace:!1}):o=jt(i);let c=a?.cachePolicy;typeof c=="boolean"&&(c=c?{}:void 0);let l={runnable:o,retryPolicy:a?.retryPolicy,cachePolicy:c,metadata:a?.metadata,input:s??this._schemaDefinition,subgraphs:zb(o)?[o]:a?.subgraphs,ends:a?.ends,defer:a?.defer};this.nodes[r]=l}return this}addEdge(e,t){if(typeof e=="string")return super.addEdge(e,t);this.compiled&&console.warn("Adding an edge to a graph that has already been compiled. This will not be reflected in the compiled graph.");for(let n of e){if(n==="__end__")throw new Error("END cannot be a start node");if(!Object.keys(this.nodes).some(r=>r===n))throw new Error(`Need to add a node named "${n}" first`)}if(t==="__end__")throw new Error("END cannot be an end node");if(!Object.keys(this.nodes).some(n=>n===t))throw new Error(`Need to add a node named "${t}" first`);return this.waitingEdges.add([e,t]),this}addSequence(e){let t=Array.isArray(e)?e:Object.entries(e);if(t.length===0)throw new Error("Sequence requires at least one node.");let n;for(let[r,i,a]of t){if(r in this.nodes)throw new Error(`Node names must be unique: node with the name "${r}" already exists.`);let s=r;this.addNode(s,i,a),n!=null&&this.addEdge(n,s),n=s}return this}compile({checkpointer:e,store:t,cache:n,interruptBefore:r,interruptAfter:i,name:a,description:s}={}){this.validate([...Array.isArray(r)?r:[],...Array.isArray(i)?i:[]]);let o=Object.keys(this._schemaDefinitions.get(this._outputDefinition)),c=o.length===1&&o[0]===Dr?Dr:o,l=Object.keys(this.channels),u=l.length===1&&l[0]===Dr?Dr:l,d=this._interrupt,f=new pq({builder:this,checkpointer:e,interruptAfter:i,interruptBefore:r,autoValidate:!1,nodes:{},channels:{...this.channels,[wt]:new ks},inputChannels:wt,outputChannels:c,streamChannels:u,streamMode:"updates",store:t,cache:n,name:a,description:s,userInterrupt:d});f.attachNode(wt);for(let[h,p]of Object.entries(this.nodes))f.attachNode(h,p);f.attachBranch(wt,kw,US(),{withReader:!1});for(let[h]of Object.entries(this.nodes))f.attachBranch(h,kw,US(),{withReader:!1});for(let[h,p]of this.edges)f.attachEdge(h,p);for(let[h,p]of this.waitingEdges)f.attachEdge(h,p);for(let[h,p]of Object.entries(this.branches))for(let[m,v]of Object.entries(p))f.attachBranch(h,m,v);return f.validate()}};function hq(e){let t={};for(let[n,r]of Object.entries(e))t[n]=Yg(r);return t}var pq=class extends mP{description;_metaRegistry=nd;constructor({description:e,...t}){super(t),this.description=e}attachNode(e,t){let n;e==="__start__"?n=Object.entries(this.builder._schemaDefinitions.get(this.builder._inputDefinition)).map(([o])=>o):n=Object.keys(this.builder.channels);function r(o){if(zt(o))return o.graph===lr.PARENT?null:o._updateAsTuples();if(Array.isArray(o)&&o.length>0&&o.some(c=>zt(c))){let c=[];for(let l of o)if(zt(l)){if(l.graph===lr.PARENT)continue;c.push(...l._updateAsTuples())}else c.push([Dr,l]);return c}else if(o!=null)return[[Dr,o]];return null}let i=e;function a(o){if(o){if(zt(o))return o.graph===lr.PARENT?null:o._updateAsTuples().filter(([c])=>n.includes(c));if(Array.isArray(o)&&o.length>0&&o.some(zt)){let c=[];for(let l of o)if(zt(l)){if(l.graph===lr.PARENT)continue;c.push(...l._updateAsTuples().filter(([u])=>n.includes(u)))}else{let u=a(l);u&&c.push(...u??[])}return c}else{if(typeof o=="object"&&!Array.isArray(o))return Object.entries(o).filter(([c])=>n.includes(c));{let c=Array.isArray(o)?"array":typeof o;throw new Qe(`Expected node "${i.toString()}" to return an object or an array containing at least one Command object, received ${c}`,{lc_error_code:"INVALID_GRAPH_NODE_RETURN_VALUE"})}}}else return null}let s=[{value:ta,mapper:new wa({func:n.length&&n[0]===Dr?r:a,trace:!1,recurse:!1})}];if(e==="__start__")this.nodes[e]=new Xo({tags:[sn],triggers:[wt],channels:[wt],writers:[new Wt(s,[sn])]});else{let o=t?.input??this.builder._schemaDefinition,c=Object.fromEntries(Object.keys(this.builder._schemaDefinitions.get(o)).map(d=>[d,d])),l=Object.keys(c).length===1&&Dr in c,u=`branch:to:${e}`;this.channels[u]=t?.defer?new G8:new ks(!1),this.nodes[e]=new Xo({triggers:[u],channels:l?Object.keys(c):c,writers:[new Wt(s,[sn])],mapper:l?void 0:d=>Object.fromEntries(Object.entries(d).filter(([f])=>f in c)),bound:t?.runnable,metadata:t?.metadata,retryPolicy:t?.retryPolicy,cachePolicy:t?.cachePolicy,subgraphs:t?.subgraphs,ends:t?.ends})}}attachEdge(e,t){if(t!=="__end__"){if(typeof e=="string")this.nodes[e].writers.push(new Wt([{channel:`branch:to:${t}`,value:null}],[sn]));else if(Array.isArray(e)){let n=`join:${e.join("+")}:${t}`;this.channels[n]=this.builder.nodes[t].defer?new lq(new Set(e)):new cq(new Set(e)),this.nodes[t].triggers.push(n);for(let r of e)this.nodes[r].writers.push(new Wt([{channel:n,value:r}],[sn]))}}}attachBranch(e,t,n,r={withReader:!0}){let i=async(a,s)=>{let o=a.filter(l=>l!==xt);if(!o.length)return;let c=o.map(l=>ln(l)?l:{channel:l==="__end__"?l:`branch:to:${l}`,value:e});await Wt.doWrite({...s,tags:(s.tags??[]).concat([sn])},c)};this.nodes[e].writers.push(n.run(i,r.withReader?a=>vV.doRead(a,this.streamChannels??this.outputChannels,!0):void 0))}async _validateInput(e){if(e==null)return e;let t=this.builder._inputRuntimeDefinition,n=this.builder._schemaRuntimeDefinition;if(Gi.isInstance(t)){if(zt(e)){let i=e;return e.update&&(i.update=await t.validateInput(Array.isArray(e.update)?Object.fromEntries(e.update):e.update)),i}return await t.validateInput(e)}if(t===rd&&Gi.isInstance(n)){if(zt(e)){let i=e;return e.update&&(i.update=await n.validateInput(Array.isArray(e.update)?Object.fromEntries(e.update):e.update)),i}return await n.validateInput(e)}let r=(()=>{let i=a=>{if(a!=null)return this._metaRegistry.getExtendedChannelSchemas(a,{withReducerSchema:!0})};if(En(t))return i(t);if(t===rd)return En(n)?mv(i(n)):void 0})();if(zt(e)){let i=e;return e.update&&r!=null&&(i.update=Kl(r,e.update)),i}return r!=null?Kl(r,e):e}isInterrupted(e){return Ik(e)}async _validateContext(e){let t=this.builder._configRuntimeSchema;return En(t)&&Kl(t,e),e}};function mq(e){return typeof e=="object"&&e!==null&&e.channels!==void 0}function gq(e){if(ln(e))return[e];let t=[];zt(e)?t.push(e):Array.isArray(e)&&t.push(...e.filter(zt));let n=[];for(let r of t){if(r.graph===lr.PARENT)throw new Tk(r);ln(r.goto)||typeof r.goto=="string"?n.push(r.goto):Array.isArray(r.goto)&&n.push(...r.goto)}return n}function US(){return new pP({path:new wa({func:gq,tags:[sn],trace:!1,recurse:!1,name:"<control_branch>"})})}Ae.Root({messages:Ae({reducer:Oh,default:()=>[]})});var _q={reducer:{fn:Oh},jsonSchemaExtra:{langgraph_type:"messages"},default:()=>[]};jc({messages:dq(S5(),_q)});async function yq(e,t,n){if(n===void 0)throw new Error(["Unable to dispatch a custom event without a parent run id.",'"dispatchCustomEvent" can only be called from within an existing run (e.g.,',"inside a tool or a RunnableLambda).",`
765
-
766
- If you continue to see this error, please import from "@langchain/core/callbacks/dispatch/web"`,"and explicitly pass in a config parameter.",`
767
-
768
- Or, if you are calling this from a custom tool, ensure you're using the "tool" helper constructor as documented here:`,`
769
- |`,`
770
- \u2514-> https://js.langchain.com/docs/how_to/custom_tools#tool-function`,`
771
- `].join(" "));let r=await Qt(n),i=r?.getParentRunId();r!==void 0&&i!==void 0&&await r.handleCustomEvent?.(e,t,i)}function Cl(e,t){return e.lc_error_code=t,e.message=`${e.message}
772
-
773
- Troubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${t}/
774
- `,e}function pe(e,t,n,r,i){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}function E(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}var vP=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return vP=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))};function i_(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}var a_=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){let t=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)},oe=class extends Error{},Zt=class e extends oe{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get("x-request-id"),this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(t,n,r){let i=n?.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return t&&i?`${t} ${i}`:t?`${t} status code (no body)`:i||"(no status code or body)"}static generate(t,n,r,i){if(!t||!i)return new xs({message:r,cause:a_(n)});let a=n?.error;return t===400?new id(t,a,r,i):t===401?new ad(t,a,r,i):t===403?new sd(t,a,r,i):t===404?new od(t,a,r,i):t===409?new cd(t,a,r,i):t===422?new ld(t,a,r,i):t===429?new ud(t,a,r,i):t>=500?new dd(t,a,r,i):new e(t,a,r,i)}},Kt=class extends Zt{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},xs=class extends Zt{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}},Is=class extends xs{constructor({message:t}={}){super({message:t??"Request timed out."})}},id=class extends Zt{},ad=class extends Zt{},sd=class extends Zt{},od=class extends Zt{},cd=class extends Zt{},ld=class extends Zt{},ud=class extends Zt{},dd=class extends Zt{},fd=class extends oe{constructor(){super("Could not parse response content as the length limit was reached")}},hd=class extends oe{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},Hi=class extends Error{constructor(t){super(t)}},vq=/^[a-z][a-z0-9+.-]*:/i,bq=e=>vq.test(e),an=e=>(an=Array.isArray,an(e)),LS=an;function bP(e){return typeof e!="object"?{}:e??{}}function zS(e){if(!e)return!0;for(let t in e)return!1;return!0}function wq(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function bm(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}var $q=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new oe(`${e} must be an integer`);if(t<0)throw new oe(`${e} must be a positive integer`);return t},Sq=e=>{try{return JSON.parse(e)}catch{return}},Yc=e=>new Promise(t=>setTimeout(t,e)),Da="6.33.0",kq=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function xq(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var Iq=()=>{let e=xq();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Da,"X-Stainless-OS":BS(Deno.build.os),"X-Stainless-Arch":FS(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Da,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(e==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Da,"X-Stainless-OS":BS(globalThis.process.platform??"unknown"),"X-Stainless-Arch":FS(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=Eq();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Da,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Da,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function Eq(){if(typeof navigator>"u"||!navigator)return null;let e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:t,pattern:n}of e){let r=n.exec(navigator.userAgent);if(r){let i=r[1]||0,a=r[2]||0,s=r[3]||0;return{browser:t,version:`${i}.${a}.${s}`}}}return null}var FS=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",BS=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown"),ZS,Tq=()=>ZS??(ZS=Iq());function Oq(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function wP(...e){let t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function $P(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return wP({start(){},async pull(n){let{done:r,value:i}=await t.next();r?n.close():n.enqueue(i)},async cancel(){await t.return?.()}})}function SP(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let n=await t.read();return n?.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){let n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function Aq(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var Cq=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)}),kP="RFC3986",xP=e=>String(e),VS={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:xP},Nq="RFC1738",s_=(e,t)=>(s_=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),s_(e,t)),rr=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),wm=1024,Pq=(e,t,n,r,i)=>{if(e.length===0)return e;let a=e;if(typeof e=="symbol"?a=Symbol.prototype.toString.call(e):typeof e!="string"&&(a=String(e)),n==="iso-8859-1")return escape(a).replace(/%u[0-9a-f]{4}/gi,function(o){return"%26%23"+parseInt(o.slice(2),16)+"%3B"});let s="";for(let o=0;o<a.length;o+=wm){let c=a.length>=wm?a.slice(o,o+wm):a,l=[];for(let u=0;u<c.length;++u){let d=c.charCodeAt(u);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||i===Nq&&(d===40||d===41)){l[l.length]=c.charAt(u);continue}if(d<128){l[l.length]=rr[d];continue}if(d<2048){l[l.length]=rr[192|d>>6]+rr[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=rr[224|d>>12]+rr[128|d>>6&63]+rr[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|c.charCodeAt(u)&1023),l[l.length]=rr[240|d>>18]+rr[128|d>>12&63]+rr[128|d>>6&63]+rr[128|d&63]}s+=l.join("")}return s};function Rq(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function qS(e,t){if(an(e)){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)}var IP={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},EP=function(e,t){Array.prototype.push.apply(e,an(t)?t:[t])},GS,bt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Pq,encodeValuesOnly:!1,format:kP,formatter:xP,indices:!1,serializeDate(e){return(GS??(GS=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1};function jq(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"}var $m={};function TP(e,t,n,r,i,a,s,o,c,l,u,d,f,h,p,m,v,g){let y=e,$=g,S=0,x=!1;for(;($=$.get($m))!==void 0&&!x;){let O=$.get(e);if(S+=1,typeof O<"u"){if(O===S)throw new RangeError("Cyclic object value");x=!0}typeof $.get($m)>"u"&&(S=0)}if(typeof l=="function"?y=l(t,y):y instanceof Date?y=f?.(y):n==="comma"&&an(y)&&(y=qS(y,function(O){return O instanceof Date?f?.(O):O})),y===null){if(a)return c&&!m?c(t,bt.encoder,v,"key",h):t;y=""}if(jq(y)||Rq(y)){if(c){let O=m?t:c(t,bt.encoder,v,"key",h);return[p?.(O)+"="+p?.(c(y,bt.encoder,v,"value",h))]}return[p?.(t)+"="+p?.(String(y))]}let C=[];if(typeof y>"u")return C;let T;if(n==="comma"&&an(y))m&&c&&(y=qS(y,c)),T=[{value:y.length>0?y.join(",")||null:void 0}];else if(an(l))T=l;else{let O=Object.keys(y);T=u?O.sort(u):O}let b=o?String(t).replace(/\./g,"%2E"):String(t),D=r&&an(y)&&y.length===1?b+"[]":b;if(i&&an(y)&&y.length===0)return D+"[]";for(let O=0;O<T.length;++O){let M=T[O],he=typeof M=="object"&&typeof M.value<"u"?M.value:y[M];if(s&&he===null)continue;let Me=d&&o?M.replace(/\./g,"%2E"):M,V=an(y)?typeof n=="function"?n(D,Me):D:D+(d?"."+Me:"["+Me+"]");g.set(e,S);let z=new WeakMap;z.set($m,g),EP(C,TP(he,V,n,r,i,a,s,o,n==="comma"&&m&&an(y)?null:c,l,u,d,f,h,p,m,v,z))}return C}function Mq(e=bt){if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");let t=e.charset||bt.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let n=kP;if(typeof e.format<"u"){if(!s_(VS,e.format))throw new TypeError("Unknown format option provided.");n=e.format}let r=VS[n],i=bt.filter;(typeof e.filter=="function"||an(e.filter))&&(i=e.filter);let a;if(e.arrayFormat&&e.arrayFormat in IP?a=e.arrayFormat:"indices"in e?a=e.indices?"indices":"repeat":a=bt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");let s=typeof e.allowDots>"u"?e.encodeDotInKeys?!0:bt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:bt.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:bt.allowEmptyArrays,arrayFormat:a,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:bt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?bt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:bt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:bt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:bt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:bt.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:bt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:bt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:bt.strictNullHandling}}function Dq(e,t={}){let n=e,r=Mq(t),i,a;typeof r.filter=="function"?(a=r.filter,n=a("",n)):an(r.filter)&&(a=r.filter,i=a);let s=[];if(typeof n!="object"||n===null)return"";let o=IP[r.arrayFormat],c=o==="comma"&&r.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);let l=new WeakMap;for(let f=0;f<i.length;++f){let h=i[f];r.skipNulls&&n[h]===null||EP(s,TP(n[h],h,o,c,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,l))}let u=s.join(r.delimiter),d=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?d+="utf8=%26%2310003%3B&":d+="utf8=%E2%9C%93&"),u.length>0?d+u:""}function Uq(e){return Dq(e,{arrayFormat:"brackets"})}function Lq(e){let t=0;for(let i of e)t+=i.length;let n=new Uint8Array(t),r=0;for(let i of e)n.set(i,r),r+=i.length;return n}var HS;function Vb(e){let t;return(HS??(t=new globalThis.TextEncoder,HS=t.encode.bind(t)))(e)}var JS;function WS(e){let t;return(JS??(t=new globalThis.TextDecoder,JS=t.decode.bind(t)))(e)}var gn,_n,Es=class{constructor(){gn.set(this,void 0),_n.set(this,void 0),pe(this,gn,new Uint8Array),pe(this,_n,null)}decode(t){if(t==null)return[];let n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?Vb(t):t;pe(this,gn,Lq([E(this,gn,"f"),n]));let r=[],i;for(;(i=zq(E(this,gn,"f"),E(this,_n,"f")))!=null;){if(i.carriage&&E(this,_n,"f")==null){pe(this,_n,i.index);continue}if(E(this,_n,"f")!=null&&(i.index!==E(this,_n,"f")+1||i.carriage)){r.push(WS(E(this,gn,"f").subarray(0,E(this,_n,"f")-1))),pe(this,gn,E(this,gn,"f").subarray(E(this,_n,"f"))),pe(this,_n,null);continue}let a=E(this,_n,"f")!==null?i.preceding-1:i.preceding,s=WS(E(this,gn,"f").subarray(0,a));r.push(s),pe(this,gn,E(this,gn,"f").subarray(i.index)),pe(this,_n,null)}return r}flush(){return E(this,gn,"f").length?this.decode(`
775
- `):[]}};gn=new WeakMap,_n=new WeakMap;Es.NEWLINE_CHARS=new Set([`
776
- `,"\r"]);Es.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function zq(e,t){for(let i=t??0;i<e.length;i++){if(e[i]===10)return{preceding:i,index:i+1,carriage:!1};if(e[i]===13)return{preceding:i,index:i+1,carriage:!0}}return null}function Fq(e){for(let r=0;r<e.length-1;r++){if(e[r]===10&&e[r+1]===10||e[r]===13&&e[r+1]===13)return r+2;if(e[r]===13&&e[r+1]===10&&r+3<e.length&&e[r+2]===13&&e[r+3]===10)return r+4}return-1}var pd={off:0,error:200,warn:300,info:400,debug:500},KS=(e,t,n)=>{if(e){if(wq(pd,e))return e;Ct(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(pd))}`)}};function lo(){}function Nl(e,t,n){return!t||pd[e]>pd[n]?lo:t[e].bind(t)}var Bq={error:lo,warn:lo,info:lo,debug:lo},XS=new WeakMap;function Ct(e){let t=e.logger,n=e.logLevel??"off";if(!t)return Bq;let r=XS.get(t);if(r&&r[0]===n)return r[1];let i={error:Nl("error",t,n),warn:Nl("warn",t,n),info:Nl("info",t,n),debug:Nl("debug",t,n)};return XS.set(t,[n,i]),i}var Ui=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,n])=>[t,t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),Xs,ha=class e{constructor(t,n,r){this.iterator=t,Xs.set(this,void 0),this.controller=n,pe(this,Xs,r)}static fromSSEResponse(t,n,r,i){let a=!1,s=r?Ct(r):console;async function*o(){if(a)throw new oe("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let c=!1;try{for await(let l of Zq(t,n))if(!c){if(l.data.startsWith("[DONE]")){c=!0;continue}if(l.event===null||!l.event.startsWith("thread.")){let u;try{u=JSON.parse(l.data)}catch(d){throw s.error("Could not parse message into JSON:",l.data),s.error("From chunk:",l.raw),d}if(u&&u.error)throw new Zt(void 0,u.error,void 0,t.headers);yield i?{event:l.event,data:u}:u}else{let u;try{u=JSON.parse(l.data)}catch(d){throw console.error("Could not parse message into JSON:",l.data),console.error("From chunk:",l.raw),d}if(l.event=="error")throw new Zt(void 0,u.error,u.message,void 0);yield{event:l.event,data:u}}}c=!0}catch(l){if(i_(l))return;throw l}finally{c||n.abort()}}return new e(o,n,r)}static fromReadableStream(t,n,r){let i=!1;async function*a(){let o=new Es,c=SP(t);for await(let l of c)for(let u of o.decode(l))yield u;for(let l of o.flush())yield l}async function*s(){if(i)throw new oe("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let o=!1;try{for await(let c of a())o||c&&(yield JSON.parse(c));o=!0}catch(c){if(i_(c))return;throw c}finally{o||n.abort()}}return new e(s,n,r)}[(Xs=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],n=[],r=this.iterator(),i=a=>({next:()=>{if(a.length===0){let s=r.next();t.push(s),n.push(s)}return a.shift()}});return[new e(()=>i(t),this.controller,E(this,Xs,"f")),new e(()=>i(n),this.controller,E(this,Xs,"f"))]}toReadableStream(){let t=this,n;return wP({async start(){n=t[Symbol.asyncIterator]()},async pull(r){try{let{value:i,done:a}=await n.next();if(a)return r.close();let s=Vb(JSON.stringify(i)+`
777
- `);r.enqueue(s)}catch(i){r.error(i)}},async cancel(){await n.return?.()}})}};async function*Zq(e,t){if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new oe("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new oe("Attempted to iterate over a response with no body");let n=new o_,r=new Es,i=SP(e.body);for await(let a of Vq(i))for(let s of r.decode(a)){let o=n.decode(s);o&&(yield o)}for(let a of r.flush()){let s=n.decode(a);s&&(yield s)}}async function*Vq(e){let t=new Uint8Array;for await(let n of e){if(n==null)continue;let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n=="string"?Vb(n):n,i=new Uint8Array(t.length+r.length);i.set(t),i.set(r,t.length),t=i;let a;for(;(a=Fq(t))!==-1;)yield t.slice(0,a),t=t.slice(a)}t.length>0&&(yield t)}var o_=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;let a={event:this.event,data:this.data.join(`
778
- `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],a}if(this.chunks.push(t),t.startsWith(":"))return null;let[n,r,i]=qq(t,":");return i.startsWith(" ")&&(i=i.substring(1)),n==="event"?this.event=i:n==="data"&&this.data.push(i),null}};function qq(e,t){let n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}async function OP(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:i,startTime:a}=t,s=await(async()=>{if(t.options.stream)return Ct(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(n,t.controller,e,t.options.__synthesizeEventData):ha.fromSSEResponse(n,t.controller,e,t.options.__synthesizeEventData);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let c=n.headers.get("content-type")?.split(";")[0]?.trim();if(c?.includes("application/json")||c?.endsWith("+json")){if(n.headers.get("content-length")==="0")return;let f=await n.json();return AP(f,n)}return await n.text()})();return Ct(e).debug(`[${r}] response parsed`,Ui({retryOfRequestLogID:i,url:n.url,status:n.status,body:s,durationMs:Date.now()-a})),s}function AP(e,t){return!e||typeof e!="object"||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get("x-request-id"),enumerable:!1})}var uo,md=class e extends Promise{constructor(t,n,r=OP){super(i=>{i(null)}),this.responsePromise=n,this.parseResponse=r,uo.set(this,void 0),pe(this,uo,t)}_thenUnwrap(t){return new e(E(this,uo,"f"),this.responsePromise,async(n,r)=>AP(t(await this.parseResponse(n,r),r),r.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){let[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n,request_id:n.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(E(this,uo,"f"),t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}};uo=new WeakMap;var Pl,ec=class{constructor(t,n,r,i){Pl.set(this,void 0),pe(this,Pl,t),this.options=i,this.response=n,this.body=r}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let t=this.nextPageRequestOptions();if(!t)throw new oe("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await E(this,Pl,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(Pl=new WeakMap,Symbol.asyncIterator)](){for await(let t of this.iterPages())for(let n of t.getPaginatedItems())yield n}},c_=class extends md{constructor(t,n,r){super(t,n,async(i,a)=>new r(i,a.response,await OP(i,a),a.options))}async*[Symbol.asyncIterator](){let t=await this;for await(let n of t)yield n}},Ts=class extends ec{constructor(t,n,r,i){super(t,n,r,i),this.data=r.data||[],this.object=r.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}},st=class extends ec{constructor(t,n,r,i){super(t,n,r,i),this.data=r.data||[],this.has_more=r.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let t=this.getPaginatedItems(),n=t[t.length-1]?.id;return n?{...this.options,query:{...bP(this.options.query),after:n}}:null}},pa=class extends ec{constructor(t,n,r,i){super(t,n,r,i),this.data=r.data||[],this.has_more=r.has_more||!1,this.last_id=r.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let t=this.last_id;return t?{...this.options,query:{...bP(this.options.query),after:t}}:null}},CP=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&parseInt(e.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function ko(e,t,n){return CP(),new File(e,t??"unknown_file",n)}function ou(e){return(typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}var qb=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",Ah=async(e,t)=>l_(e.body)?{...e,body:await NP(e.body,t)}:e,hr=async(e,t)=>({...e,body:await NP(e.body,t)}),YS=new WeakMap;function Gq(e){let t=typeof e=="function"?e:e.fetch,n=YS.get(t);if(n)return n;let r=(async()=>{try{let i="Response"in t?t.Response:(await t("data:,")).constructor,a=new FormData;return a.toString()!==await new i(a).text()}catch{return!0}})();return YS.set(t,r),r}var NP=async(e,t)=>{if(!await Gq(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(e||{}).map(([r,i])=>u_(n,r,i))),n},PP=e=>e instanceof Blob&&"name"in e,Hq=e=>typeof e=="object"&&e!==null&&(e instanceof Response||qb(e)||PP(e)),l_=e=>{if(Hq(e))return!0;if(Array.isArray(e))return e.some(l_);if(e&&typeof e=="object"){for(let t in e)if(l_(e[t]))return!0}return!1},u_=async(e,t,n)=>{if(n!==void 0){if(n==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")e.append(t,String(n));else if(n instanceof Response)e.append(t,ko([await n.blob()],ou(n)));else if(qb(n))e.append(t,ko([await new Response($P(n)).blob()],ou(n)));else if(PP(n))e.append(t,n,ou(n));else if(Array.isArray(n))await Promise.all(n.map(r=>u_(e,t+"[]",r)));else if(typeof n=="object")await Promise.all(Object.entries(n).map(([r,i])=>u_(e,`${t}[${r}]`,i)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}},RP=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",Jq=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&RP(e),Wq=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function Kq(e,t,n){if(CP(),e=await e,Jq(e))return e instanceof File?e:ko([await e.arrayBuffer()],e.name);if(Wq(e)){let i=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),ko(await d_(i),t,n)}let r=await d_(e);if(t||(t=ou(e)),!n?.type){let i=r.find(a=>typeof a=="object"&&"type"in a&&a.type);typeof i=="string"&&(n={...n,type:i})}return ko(r,t,n)}async function d_(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(RP(e))t.push(e instanceof Blob?e:await e.arrayBuffer());else if(qb(e))for await(let n of e)t.push(...await d_(n));else{let n=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${n?`; constructor: ${n}`:""}${Xq(e)}`)}return t}function Xq(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}var ne=class{constructor(t){this._client=t}};function jP(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var QS=Object.freeze(Object.create(null)),Yq=(e=jP)=>function(n,...r){if(n.length===1)return n[0];let i=!1,a=[],s=n.reduce((u,d,f)=>{/[?#]/.test(d)&&(i=!0);let h=r[f],p=(i?encodeURIComponent:e)(""+h);return f!==r.length&&(h==null||typeof h=="object"&&h.toString===Object.getPrototypeOf(Object.getPrototypeOf(h.hasOwnProperty??QS)??QS)?.toString)&&(p=h+"",a.push({start:u.length+d.length,length:p.length,error:`Value of type ${Object.prototype.toString.call(h).slice(8,-1)} is not a valid path parameter`})),u+d+(f===r.length?"":p)},""),o=s.split(/[?#]/,1)[0],c=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;for(;(l=c.exec(o))!==null;)a.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(a.sort((u,d)=>u.start-d.start),a.length>0){let u=0,d=a.reduce((f,h)=>{let p=" ".repeat(h.start-u),m="^".repeat(h.length);return u=h.start+h.length,f+p+m},"");throw new oe(`Path parameters result in path with invalid segments:
779
- ${a.map(f=>f.error).join(`
780
- `)}
781
- ${s}
782
- ${d}`)}return s},R=Yq(jP),MP=class extends ne{list(t,n={},r){return this._client.getAPIList(R`/chat/completions/${t}/messages`,st,{query:n,...r})}};function gd(e){return e!==void 0&&"function"in e&&e.function!==void 0}function Qq(e,t){let n={...e};return Object.defineProperties(n,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:t,enumerable:!1}}),n}function Gb(e){return e?.$brand==="auto-parseable-response-format"}function Qc(e){return e?.$brand==="auto-parseable-tool"}function eG(e,t){return!t||!DP(t)?{...e,choices:e.choices.map(n=>(UP(n.message.tool_calls),{...n,message:{...n.message,parsed:null,...n.message.tool_calls?{tool_calls:n.message.tool_calls}:void 0}}))}:Hb(e,t)}function Hb(e,t){let n=e.choices.map(r=>{if(r.finish_reason==="length")throw new fd;if(r.finish_reason==="content_filter")throw new hd;return UP(r.message.tool_calls),{...r,message:{...r.message,...r.message.tool_calls?{tool_calls:r.message.tool_calls?.map(i=>nG(t,i))??void 0}:void 0,parsed:r.message.content&&!r.message.refusal?tG(t,r.message.content):null}}});return{...e,choices:n}}function tG(e,t){return e.response_format?.type!=="json_schema"?null:e.response_format?.type==="json_schema"?"$parseRaw"in e.response_format?e.response_format.$parseRaw(t):JSON.parse(t):null}function nG(e,t){let n=e.tools?.find(r=>gd(r)&&r.function?.name===t.function.name);return{...t,function:{...t.function,parsed_arguments:Qc(n)?n.$parseRaw(t.function.arguments):n?.function.strict?JSON.parse(t.function.arguments):null}}}function rG(e,t){if(!e||!("tools"in e)||!e.tools)return!1;let n=e.tools?.find(r=>gd(r)&&r.function?.name===t.function.name);return gd(n)&&(Qc(n)||n?.function.strict||!1)}function DP(e){return Gb(e.response_format)?!0:e.tools?.some(t=>Qc(t)||t.type==="function"&&t.function.strict===!0)??!1}function UP(e){for(let t of e||[])if(t.type!=="function")throw new oe(`Currently only \`function\` tool calls are supported; Received \`${t.type}\``)}function iG(e){for(let t of e??[]){if(t.type!=="function")throw new oe(`Currently only \`function\` tool types support auto-parsing; Received \`${t.type}\``);if(t.function.strict!==!0)throw new oe(`The \`${t.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var _d=e=>e?.role==="assistant",LP=e=>e?.role==="tool",f_,cu,lu,fo,ho,uu,po,Tr,mo,yd,vd,Ua,zP,tc=class{constructor(){f_.add(this),this.controller=new AbortController,cu.set(this,void 0),lu.set(this,()=>{}),fo.set(this,()=>{}),ho.set(this,void 0),uu.set(this,()=>{}),po.set(this,()=>{}),Tr.set(this,{}),mo.set(this,!1),yd.set(this,!1),vd.set(this,!1),Ua.set(this,!1),pe(this,cu,new Promise((t,n)=>{pe(this,lu,t,"f"),pe(this,fo,n,"f")})),pe(this,ho,new Promise((t,n)=>{pe(this,uu,t,"f"),pe(this,po,n,"f")})),E(this,cu,"f").catch(()=>{}),E(this,ho,"f").catch(()=>{})}_run(t){setTimeout(()=>{t().then(()=>{this._emitFinal(),this._emit("end")},E(this,f_,"m",zP).bind(this))},0)}_connected(){this.ended||(E(this,lu,"f").call(this),this._emit("connect"))}get ended(){return E(this,mo,"f")}get errored(){return E(this,yd,"f")}get aborted(){return E(this,vd,"f")}abort(){this.controller.abort()}on(t,n){return(E(this,Tr,"f")[t]||(E(this,Tr,"f")[t]=[])).push({listener:n}),this}off(t,n){let r=E(this,Tr,"f")[t];if(!r)return this;let i=r.findIndex(a=>a.listener===n);return i>=0&&r.splice(i,1),this}once(t,n){return(E(this,Tr,"f")[t]||(E(this,Tr,"f")[t]=[])).push({listener:n,once:!0}),this}emitted(t){return new Promise((n,r)=>{pe(this,Ua,!0),t!=="error"&&this.once("error",r),this.once(t,n)})}async done(){pe(this,Ua,!0),await E(this,ho,"f")}_emit(t,...n){if(E(this,mo,"f"))return;t==="end"&&(pe(this,mo,!0),E(this,uu,"f").call(this));let r=E(this,Tr,"f")[t];if(r&&(E(this,Tr,"f")[t]=r.filter(i=>!i.once),r.forEach(({listener:i})=>i(...n))),t==="abort"){let i=n[0];!E(this,Ua,"f")&&!r?.length&&Promise.reject(i),E(this,fo,"f").call(this,i),E(this,po,"f").call(this,i),this._emit("end");return}if(t==="error"){let i=n[0];!E(this,Ua,"f")&&!r?.length&&Promise.reject(i),E(this,fo,"f").call(this,i),E(this,po,"f").call(this,i),this._emit("end")}}_emitFinal(){}};cu=new WeakMap,lu=new WeakMap,fo=new WeakMap,ho=new WeakMap,uu=new WeakMap,po=new WeakMap,Tr=new WeakMap,mo=new WeakMap,yd=new WeakMap,vd=new WeakMap,Ua=new WeakMap,f_=new WeakSet,zP=function(t){if(pe(this,yd,!0),t instanceof Error&&t.name==="AbortError"&&(t=new Kt),t instanceof Kt)return pe(this,vd,!0),this._emit("abort",t);if(t instanceof oe)return this._emit("error",t);if(t instanceof Error){let n=new oe(t.message);return n.cause=t,this._emit("error",n)}return this._emit("error",new oe(String(t)))};function aG(e){return typeof e.parse=="function"}var Jt,h_,bd,p_,m_,g_,FP,BP,sG=10,wd=class extends tc{constructor(){super(...arguments),Jt.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(t){this._chatCompletions.push(t),this._emit("chatCompletion",t);let n=t.choices[0]?.message;return n&&this._addMessage(n),t}_addMessage(t,n=!0){if("content"in t||(t.content=null),this.messages.push(t),n){if(this._emit("message",t),LP(t)&&t.content)this._emit("functionToolCallResult",t.content);else if(_d(t)&&t.tool_calls)for(let r of t.tool_calls)r.type==="function"&&this._emit("functionToolCall",r.function)}}async finalChatCompletion(){await this.done();let t=this._chatCompletions[this._chatCompletions.length-1];if(!t)throw new oe("stream ended without producing a ChatCompletion");return t}async finalContent(){return await this.done(),E(this,Jt,"m",h_).call(this)}async finalMessage(){return await this.done(),E(this,Jt,"m",bd).call(this)}async finalFunctionToolCall(){return await this.done(),E(this,Jt,"m",p_).call(this)}async finalFunctionToolCallResult(){return await this.done(),E(this,Jt,"m",m_).call(this)}async totalUsage(){return await this.done(),E(this,Jt,"m",g_).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let t=this._chatCompletions[this._chatCompletions.length-1];t&&this._emit("finalChatCompletion",t);let n=E(this,Jt,"m",bd).call(this);n&&this._emit("finalMessage",n);let r=E(this,Jt,"m",h_).call(this);r&&this._emit("finalContent",r);let i=E(this,Jt,"m",p_).call(this);i&&this._emit("finalFunctionToolCall",i);let a=E(this,Jt,"m",m_).call(this);a!=null&&this._emit("finalFunctionToolCallResult",a),this._chatCompletions.some(s=>s.usage)&&this._emit("totalUsage",E(this,Jt,"m",g_).call(this))}async _createChatCompletion(t,n,r){let i=r?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort())),E(this,Jt,"m",FP).call(this,n);let a=await t.chat.completions.create({...n,stream:!1},{...r,signal:this.controller.signal});return this._connected(),this._addChatCompletion(Hb(a,n))}async _runChatCompletion(t,n,r){for(let i of n.messages)this._addMessage(i,!1);return await this._createChatCompletion(t,n,r)}async _runTools(t,n,r){let i="tool",{tool_choice:a="auto",stream:s,...o}=n,c=typeof a!="string"&&a.type==="function"&&a?.function?.name,{maxChatCompletions:l=sG}=r||{},u=n.tools.map(h=>{if(Qc(h)){if(!h.$callback)throw new oe("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:h.$callback,name:h.function.name,description:h.function.description||"",parameters:h.function.parameters,parse:h.$parseRaw,strict:!0}}}return h}),d={};for(let h of u)h.type==="function"&&(d[h.function.name||h.function.function.name]=h.function);let f="tools"in n?u.map(h=>h.type==="function"?{type:"function",function:{name:h.function.name||h.function.function.name,parameters:h.function.parameters,description:h.function.description,strict:h.function.strict}}:h):void 0;for(let h of n.messages)this._addMessage(h,!1);for(let h=0;h<l;++h){let m=(await this._createChatCompletion(t,{...o,tool_choice:a,tools:f,messages:[...this.messages]},r)).choices[0]?.message;if(!m)throw new oe("missing message in ChatCompletion response");if(!m.tool_calls?.length)return;for(let v of m.tool_calls){if(v.type!=="function")continue;let g=v.id,{name:y,arguments:$}=v.function,S=d[y];if(S){if(c&&c!==y){let b=`Invalid tool_call: ${JSON.stringify(y)}. ${JSON.stringify(c)} requested. Please try again`;this._addMessage({role:i,tool_call_id:g,content:b});continue}}else{let b=`Invalid tool_call: ${JSON.stringify(y)}. Available options are: ${Object.keys(d).map(D=>JSON.stringify(D)).join(", ")}. Please try again`;this._addMessage({role:i,tool_call_id:g,content:b});continue}let x;try{x=aG(S)?await S.parse($):$}catch(b){let D=b instanceof Error?b.message:String(b);this._addMessage({role:i,tool_call_id:g,content:D});continue}let C=await S.function(x,this),T=E(this,Jt,"m",BP).call(this,C);if(this._addMessage({role:i,tool_call_id:g,content:T}),c)return}}}};Jt=new WeakSet,h_=function(){return E(this,Jt,"m",bd).call(this).content??null},bd=function(){let t=this.messages.length;for(;t-- >0;){let n=this.messages[t];if(_d(n))return{...n,content:n.content??null,refusal:n.refusal??null}}throw new oe("stream ended without producing a ChatCompletionMessage with role=assistant")},p_=function(){for(let t=this.messages.length-1;t>=0;t--){let n=this.messages[t];if(_d(n)&&n?.tool_calls?.length)return n.tool_calls.filter(r=>r.type==="function").at(-1)?.function}},m_=function(){for(let t=this.messages.length-1;t>=0;t--){let n=this.messages[t];if(LP(n)&&n.content!=null&&typeof n.content=="string"&&this.messages.some(r=>r.role==="assistant"&&r.tool_calls?.some(i=>i.type==="function"&&i.id===n.tool_call_id)))return n.content}},g_=function(){let t={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:n}of this._chatCompletions)n&&(t.completion_tokens+=n.completion_tokens,t.prompt_tokens+=n.prompt_tokens,t.total_tokens+=n.total_tokens);return t},FP=function(t){if(t.n!=null&&t.n>1)throw new oe("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},BP=function(t){return typeof t=="string"?t:t===void 0?"undefined":JSON.stringify(t)};var __=class e extends wd{static runTools(t,n,r){let i=new e,a={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runTools"}};return i._run(()=>i._runTools(t,n,a)),i}_addMessage(t,n=!0){super._addMessage(t,n),_d(t)&&t.content&&this._emit("content",t.content)}},ZP=1,VP=2,qP=4,GP=8,HP=16,JP=32,WP=64,KP=128,XP=256,YP=KP|XP,QP=HP|JP|YP|WP,eR=ZP|VP|QP,tR=qP|GP,oG=eR|tR,kt={STR:ZP,NUM:VP,ARR:qP,OBJ:GP,NULL:HP,BOOL:JP,NAN:WP,INFINITY:KP,MINUS_INFINITY:XP,INF:YP,SPECIAL:QP,ATOM:eR,COLLECTION:tR,ALL:oG},y_=class extends Error{},v_=class extends Error{};function cG(e,t=kt.ALL){if(typeof e!="string")throw new TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw new Error(`${e} is empty`);return lG(e.trim(),t)}var lG=(e,t)=>{let n=e.length,r=0,i=f=>{throw new y_(`${f} at position ${r}`)},a=f=>{throw new v_(`${f} at position ${r}`)},s=()=>(d(),r>=n&&i("Unexpected end of input"),e[r]==='"'?o():e[r]==="{"?c():e[r]==="["?l():e.substring(r,r+4)==="null"||kt.NULL&t&&n-r<4&&"null".startsWith(e.substring(r))?(r+=4,null):e.substring(r,r+4)==="true"||kt.BOOL&t&&n-r<4&&"true".startsWith(e.substring(r))?(r+=4,!0):e.substring(r,r+5)==="false"||kt.BOOL&t&&n-r<5&&"false".startsWith(e.substring(r))?(r+=5,!1):e.substring(r,r+8)==="Infinity"||kt.INFINITY&t&&n-r<8&&"Infinity".startsWith(e.substring(r))?(r+=8,1/0):e.substring(r,r+9)==="-Infinity"||kt.MINUS_INFINITY&t&&1<n-r&&n-r<9&&"-Infinity".startsWith(e.substring(r))?(r+=9,-1/0):e.substring(r,r+3)==="NaN"||kt.NAN&t&&n-r<3&&"NaN".startsWith(e.substring(r))?(r+=3,NaN):u()),o=()=>{let f=r,h=!1;for(r++;r<n&&(e[r]!=='"'||h&&e[r-1]==="\\");)h=e[r]==="\\"?!h:!1,r++;if(e.charAt(r)=='"')try{return JSON.parse(e.substring(f,++r-Number(h)))}catch(p){a(String(p))}else if(kt.STR&t)try{return JSON.parse(e.substring(f,r-Number(h))+'"')}catch{return JSON.parse(e.substring(f,e.lastIndexOf("\\"))+'"')}i("Unterminated string literal")},c=()=>{r++,d();let f={};try{for(;e[r]!=="}";){if(d(),r>=n&&kt.OBJ&t)return f;let h=o();d(),r++;try{let p=s();Object.defineProperty(f,h,{value:p,writable:!0,enumerable:!0,configurable:!0})}catch(p){if(kt.OBJ&t)return f;throw p}d(),e[r]===","&&r++}}catch{if(kt.OBJ&t)return f;i("Expected '}' at end of object")}return r++,f},l=()=>{r++;let f=[];try{for(;e[r]!=="]";)f.push(s()),d(),e[r]===","&&r++}catch{if(kt.ARR&t)return f;i("Expected ']' at end of array")}return r++,f},u=()=>{if(r===0){e==="-"&&kt.NUM&t&&i("Not sure what '-' is");try{return JSON.parse(e)}catch(h){if(kt.NUM&t)try{return e[e.length-1]==="."?JSON.parse(e.substring(0,e.lastIndexOf("."))):JSON.parse(e.substring(0,e.lastIndexOf("e")))}catch{}a(String(h))}}let f=r;for(e[r]==="-"&&r++;e[r]&&!",]}".includes(e[r]);)r++;r==n&&!(kt.NUM&t)&&i("Unterminated number literal");try{return JSON.parse(e.substring(f,r))}catch{e.substring(f,r)==="-"&&kt.NUM&t&&i("Not sure what '-' is");try{return JSON.parse(e.substring(f,e.lastIndexOf("e")))}catch(p){a(String(p))}}},d=()=>{for(;r<n&&`
783
- \r `.includes(e[r]);)r++};return s()},ek=e=>cG(e,kt.ALL^kt.NUM),vt,Er,Aa,Yr,Sm,Rl,km,xm,Im,jl,Em,tk,$d=class e extends wd{constructor(t){super(),vt.add(this),Er.set(this,void 0),Aa.set(this,void 0),Yr.set(this,void 0),pe(this,Er,t),pe(this,Aa,[])}get currentChatCompletionSnapshot(){return E(this,Yr,"f")}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createChatCompletion(t,n,r){let i=new e(n);return i._run(()=>i._runChatCompletion(t,{...n,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),i}async _createChatCompletion(t,n,r){super._createChatCompletion;let i=r?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort())),E(this,vt,"m",Sm).call(this);let a=await t.chat.completions.create({...n,stream:!0},{...r,signal:this.controller.signal});this._connected();for await(let s of a)E(this,vt,"m",km).call(this,s);if(a.controller.signal?.aborted)throw new Kt;return this._addChatCompletion(E(this,vt,"m",jl).call(this))}async _fromReadableStream(t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),E(this,vt,"m",Sm).call(this),this._connected();let i=ha.fromReadableStream(t,this.controller),a;for await(let s of i)a&&a!==s.id&&this._addChatCompletion(E(this,vt,"m",jl).call(this)),E(this,vt,"m",km).call(this,s),a=s.id;if(i.controller.signal?.aborted)throw new Kt;return this._addChatCompletion(E(this,vt,"m",jl).call(this))}[(Er=new WeakMap,Aa=new WeakMap,Yr=new WeakMap,vt=new WeakSet,Sm=function(){this.ended||pe(this,Yr,void 0)},Rl=function(n){let r=E(this,Aa,"f")[n.index];return r||(r={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},E(this,Aa,"f")[n.index]=r,r)},km=function(n){if(this.ended)return;let r=E(this,vt,"m",tk).call(this,n);this._emit("chunk",n,r);for(let i of n.choices){let a=r.choices[i.index];i.delta.content!=null&&a.message?.role==="assistant"&&a.message?.content&&(this._emit("content",i.delta.content,a.message.content),this._emit("content.delta",{delta:i.delta.content,snapshot:a.message.content,parsed:a.message.parsed})),i.delta.refusal!=null&&a.message?.role==="assistant"&&a.message?.refusal&&this._emit("refusal.delta",{delta:i.delta.refusal,snapshot:a.message.refusal}),i.logprobs?.content!=null&&a.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:i.logprobs?.content,snapshot:a.logprobs?.content??[]}),i.logprobs?.refusal!=null&&a.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:i.logprobs?.refusal,snapshot:a.logprobs?.refusal??[]});let s=E(this,vt,"m",Rl).call(this,a);a.finish_reason&&(E(this,vt,"m",Im).call(this,a),s.current_tool_call_index!=null&&E(this,vt,"m",xm).call(this,a,s.current_tool_call_index));for(let o of i.delta.tool_calls??[])s.current_tool_call_index!==o.index&&(E(this,vt,"m",Im).call(this,a),s.current_tool_call_index!=null&&E(this,vt,"m",xm).call(this,a,s.current_tool_call_index)),s.current_tool_call_index=o.index;for(let o of i.delta.tool_calls??[]){let c=a.message.tool_calls?.[o.index];c?.type&&(c?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:c.function?.name,index:o.index,arguments:c.function.arguments,parsed_arguments:c.function.parsed_arguments,arguments_delta:o.function?.arguments??""}):(c?.type,void 0))}}},xm=function(n,r){if(E(this,vt,"m",Rl).call(this,n).done_tool_calls.has(r))return;let a=n.message.tool_calls?.[r];if(!a)throw new Error("no tool call snapshot");if(!a.type)throw new Error("tool call snapshot missing `type`");if(a.type==="function"){let s=E(this,Er,"f")?.tools?.find(o=>gd(o)&&o.function.name===a.function.name);this._emit("tool_calls.function.arguments.done",{name:a.function.name,index:r,arguments:a.function.arguments,parsed_arguments:Qc(s)?s.$parseRaw(a.function.arguments):s?.function.strict?JSON.parse(a.function.arguments):null})}else a.type},Im=function(n){let r=E(this,vt,"m",Rl).call(this,n);if(n.message.content&&!r.content_done){r.content_done=!0;let i=E(this,vt,"m",Em).call(this);this._emit("content.done",{content:n.message.content,parsed:i?i.$parseRaw(n.message.content):null})}n.message.refusal&&!r.refusal_done&&(r.refusal_done=!0,this._emit("refusal.done",{refusal:n.message.refusal})),n.logprobs?.content&&!r.logprobs_content_done&&(r.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:n.logprobs.content})),n.logprobs?.refusal&&!r.logprobs_refusal_done&&(r.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:n.logprobs.refusal}))},jl=function(){if(this.ended)throw new oe("stream has ended, this shouldn't happen");let n=E(this,Yr,"f");if(!n)throw new oe("request ended without sending any chunks");return pe(this,Yr,void 0),pe(this,Aa,[]),uG(n,E(this,Er,"f"))},Em=function(){let n=E(this,Er,"f")?.response_format;return Gb(n)?n:null},tk=function(n){var r,i,a,s;let o=E(this,Yr,"f"),{choices:c,...l}=n;o?Object.assign(o,l):o=pe(this,Yr,{...l,choices:[]});for(let{delta:u,finish_reason:d,index:f,logprobs:h=null,...p}of n.choices){let m=o.choices[f];if(m||(m=o.choices[f]={finish_reason:d,index:f,message:{},logprobs:h,...p}),h)if(!m.logprobs)m.logprobs=Object.assign({},h);else{let{content:C,refusal:T,...b}=h;Object.assign(m.logprobs,b),C&&((r=m.logprobs).content??(r.content=[]),m.logprobs.content.push(...C)),T&&((i=m.logprobs).refusal??(i.refusal=[]),m.logprobs.refusal.push(...T))}if(d&&(m.finish_reason=d,E(this,Er,"f")&&DP(E(this,Er,"f")))){if(d==="length")throw new fd;if(d==="content_filter")throw new hd}if(Object.assign(m,p),!u)continue;let{content:v,refusal:g,function_call:y,role:$,tool_calls:S,...x}=u;if(Object.assign(m.message,x),g&&(m.message.refusal=(m.message.refusal||"")+g),$&&(m.message.role=$),y&&(m.message.function_call?(y.name&&(m.message.function_call.name=y.name),y.arguments&&((a=m.message.function_call).arguments??(a.arguments=""),m.message.function_call.arguments+=y.arguments)):m.message.function_call=y),v&&(m.message.content=(m.message.content||"")+v,!m.message.refusal&&E(this,vt,"m",Em).call(this)&&(m.message.parsed=ek(m.message.content))),S){m.message.tool_calls||(m.message.tool_calls=[]);for(let{index:C,id:T,type:b,function:D,...O}of S){let M=(s=m.message.tool_calls)[C]??(s[C]={});Object.assign(M,O),T&&(M.id=T),b&&(M.type=b),D&&(M.function??(M.function={name:D.name??"",arguments:""})),D?.name&&(M.function.name=D.name),D?.arguments&&(M.function.arguments+=D.arguments,rG(E(this,Er,"f"),M)&&(M.function.parsed_arguments=ek(M.function.arguments)))}}}return o},Symbol.asyncIterator)](){let t=[],n=[],r=!1;return this.on("chunk",i=>{let a=n.shift();a?a.resolve(i):t.push(i)}),this.on("end",()=>{r=!0;for(let i of n)i.resolve(void 0);n.length=0}),this.on("abort",i=>{r=!0;for(let a of n)a.reject(i);n.length=0}),this.on("error",i=>{r=!0;for(let a of n)a.reject(i);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((a,s)=>n.push({resolve:a,reject:s})).then(a=>a?{value:a,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new ha(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}};function uG(e,t){let{id:n,choices:r,created:i,model:a,system_fingerprint:s,...o}=e,c={...o,id:n,choices:r.map(({message:l,finish_reason:u,index:d,logprobs:f,...h})=>{if(!u)throw new oe(`missing finish_reason for choice ${d}`);let{content:p=null,function_call:m,tool_calls:v,...g}=l,y=l.role;if(!y)throw new oe(`missing role for choice ${d}`);if(m){let{arguments:$,name:S}=m;if($==null)throw new oe(`missing function_call.arguments for choice ${d}`);if(!S)throw new oe(`missing function_call.name for choice ${d}`);return{...h,message:{content:p,function_call:{arguments:$,name:S},role:y,refusal:l.refusal??null},finish_reason:u,index:d,logprobs:f}}return v?{...h,index:d,finish_reason:u,logprobs:f,message:{...g,role:y,content:p,refusal:l.refusal??null,tool_calls:v.map(($,S)=>{let{function:x,type:C,id:T,...b}=$,{arguments:D,name:O,...M}=x||{};if(T==null)throw new oe(`missing choices[${d}].tool_calls[${S}].id
784
- ${Ml(e)}`);if(C==null)throw new oe(`missing choices[${d}].tool_calls[${S}].type
785
- ${Ml(e)}`);if(O==null)throw new oe(`missing choices[${d}].tool_calls[${S}].function.name
786
- ${Ml(e)}`);if(D==null)throw new oe(`missing choices[${d}].tool_calls[${S}].function.arguments
787
- ${Ml(e)}`);return{...b,id:T,type:C,function:{...M,name:O,arguments:D}}})}}:{...h,message:{...g,content:p,role:y,refusal:l.refusal??null},finish_reason:u,index:d,logprobs:f}}),created:i,model:a,object:"chat.completion",...s?{system_fingerprint:s}:{}};return eG(c,t)}function Ml(e){return JSON.stringify(e)}var b_=class e extends $d{static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static runTools(t,n,r){let i=new e(n),a={...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"runTools"}};return i._run(()=>i._runTools(t,n,a)),i}},Jb=class extends ne{constructor(){super(...arguments),this.messages=new MP(this._client)}create(t,n){return this._client.post("/chat/completions",{body:t,...n,stream:t.stream??!1})}retrieve(t,n){return this._client.get(R`/chat/completions/${t}`,n)}update(t,n,r){return this._client.post(R`/chat/completions/${t}`,{body:n,...r})}list(t={},n){return this._client.getAPIList("/chat/completions",st,{query:t,...n})}delete(t,n){return this._client.delete(R`/chat/completions/${t}`,n)}parse(t,n){return iG(t.tools),this._client.chat.completions.create(t,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(r=>Hb(r,t))}runTools(t,n){return t.stream?b_.runTools(this._client,t,n):__.runTools(this._client,t,n)}stream(t,n){return $d.createChatCompletion(this._client,t,n)}};Jb.Messages=MP;var nc=class extends ne{constructor(){super(...arguments),this.completions=new Jb(this._client)}};nc.Completions=Jb;var nR=Symbol("brand.privateNullableHeaders");function*dG(e){if(!e)return;if(nR in e){let{values:r,nulls:i}=e;yield*r.entries();for(let a of i)yield[a,null];return}let t=!1,n;e instanceof Headers?n=e.entries():LS(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let r of n){let i=r[0];if(typeof i!="string")throw new TypeError("expected header name to be a string");let a=LS(r[1])?r[1]:[r[1]],s=!1;for(let o of a)o!==void 0&&(t&&!s&&(s=!0,yield[i,null]),yield[i,o])}}var W=e=>{let t=new Headers,n=new Set;for(let r of e){let i=new Set;for(let[a,s]of dG(r)){let o=a.toLowerCase();i.has(o)||(t.delete(a),i.add(o)),s===null?(t.delete(a),n.add(o)):(t.append(a,s),n.delete(o))}}return{[nR]:!0,values:t,nulls:n}},Sd=class extends ne{create(t,n){return this._client.post("/audio/speech",{body:t,...n,headers:W([{Accept:"application/octet-stream"},n?.headers]),__binaryResponse:!0})}},kd=class extends ne{create(t,n){return this._client.post("/audio/transcriptions",hr({body:t,...n,stream:t.stream??!1,__metadata:{model:t.model}},this._client))}},xd=class extends ne{create(t,n){return this._client.post("/audio/translations",hr({body:t,...n,__metadata:{model:t.model}},this._client))}},ma=class extends ne{constructor(){super(...arguments),this.transcriptions=new kd(this._client),this.translations=new xd(this._client),this.speech=new Sd(this._client)}};ma.Transcriptions=kd;ma.Translations=xd;ma.Speech=Sd;var Id=class extends ne{create(t,n){return this._client.post("/batches",{body:t,...n})}retrieve(t,n){return this._client.get(R`/batches/${t}`,n)}list(t={},n){return this._client.getAPIList("/batches",st,{query:t,...n})}cancel(t,n){return this._client.post(R`/batches/${t}/cancel`,n)}},Ed=class extends ne{create(t,n){return this._client.post("/assistants",{body:t,...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(t,n){return this._client.get(R`/assistants/${t}`,{...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(t,n,r){return this._client.post(R`/assistants/${t}`,{body:n,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(t={},n){return this._client.getAPIList("/assistants",st,{query:t,...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}delete(t,n){return this._client.delete(R`/assistants/${t}`,{...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}},rR=class extends ne{create(t,n){return this._client.post("/realtime/sessions",{body:t,...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}},Td=class extends ne{create(t,n){return this._client.post("/realtime/transcription_sessions",{body:t,...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}},Ch=class extends ne{constructor(){super(...arguments),this.sessions=new rR(this._client),this.transcriptionSessions=new Td(this._client)}};Ch.Sessions=rR;Ch.TranscriptionSessions=Td;var Od=class extends ne{create(t,n){return this._client.post("/chatkit/sessions",{body:t,...n,headers:W([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers])})}cancel(t,n){return this._client.post(R`/chatkit/sessions/${t}/cancel`,{...n,headers:W([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers])})}},iR=class extends ne{retrieve(t,n){return this._client.get(R`/chatkit/threads/${t}`,{...n,headers:W([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers])})}list(t={},n){return this._client.getAPIList("/chatkit/threads",pa,{query:t,...n,headers:W([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers])})}delete(t,n){return this._client.delete(R`/chatkit/threads/${t}`,{...n,headers:W([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers])})}listItems(t,n={},r){return this._client.getAPIList(R`/chatkit/threads/${t}/items`,pa,{query:n,...r,headers:W([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers])})}},Os=class extends ne{constructor(){super(...arguments),this.sessions=new Od(this._client),this.threads=new iR(this._client)}};Os.Sessions=Od;Os.Threads=iR;var Ad=class extends ne{create(t,n,r){return this._client.post(R`/threads/${t}/messages`,{body:n,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}retrieve(t,n,r){let{thread_id:i}=n;return this._client.get(R`/threads/${i}/messages/${t}`,{...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}update(t,n,r){let{thread_id:i,...a}=n;return this._client.post(R`/threads/${i}/messages/${t}`,{body:a,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(t,n={},r){return this._client.getAPIList(R`/threads/${t}/messages`,st,{query:n,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}delete(t,n,r){let{thread_id:i}=n;return this._client.delete(R`/threads/${i}/messages/${t}`,{...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}},Cd=class extends ne{retrieve(t,n,r){let{thread_id:i,run_id:a,...s}=n;return this._client.get(R`/threads/${i}/runs/${a}/steps/${t}`,{query:s,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(t,n,r){let{thread_id:i,...a}=n;return this._client.getAPIList(R`/threads/${i}/runs/${t}/steps`,st,{query:a,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}},fG=e=>{if(typeof Buffer<"u"){let t=Buffer.from(e,"base64");return Array.from(new Float32Array(t.buffer,t.byteOffset,t.length/Float32Array.BYTES_PER_ELEMENT))}else{let t=atob(e),n=t.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=t.charCodeAt(i);return Array.from(new Float32Array(r.buffer))}},Ca=e=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[e]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(e)?.trim()},Nt,Ji,w_,sr,du,Zn,Wi,Wa,Bi,Nd,yn,fu,hu,xo,go,_o,nk,rk,ik,ak,sk,ok,ck,na=class extends tc{constructor(){super(...arguments),Nt.add(this),w_.set(this,[]),sr.set(this,{}),du.set(this,{}),Zn.set(this,void 0),Wi.set(this,void 0),Wa.set(this,void 0),Bi.set(this,void 0),Nd.set(this,void 0),yn.set(this,void 0),fu.set(this,void 0),hu.set(this,void 0),xo.set(this,void 0)}[(w_=new WeakMap,sr=new WeakMap,du=new WeakMap,Zn=new WeakMap,Wi=new WeakMap,Wa=new WeakMap,Bi=new WeakMap,Nd=new WeakMap,yn=new WeakMap,fu=new WeakMap,hu=new WeakMap,xo=new WeakMap,Nt=new WeakSet,Symbol.asyncIterator)](){let t=[],n=[],r=!1;return this.on("event",i=>{let a=n.shift();a?a.resolve(i):t.push(i)}),this.on("end",()=>{r=!0;for(let i of n)i.resolve(void 0);n.length=0}),this.on("abort",i=>{r=!0;for(let a of n)a.reject(i);n.length=0}),this.on("error",i=>{r=!0;for(let a of n)a.reject(i);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((a,s)=>n.push({resolve:a,reject:s})).then(a=>a?{value:a,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(t){let n=new Ji;return n._run(()=>n._fromReadableStream(t)),n}async _fromReadableStream(t,n){let r=n?.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),this._connected();let i=ha.fromReadableStream(t,this.controller);for await(let a of i)E(this,Nt,"m",go).call(this,a);if(i.controller.signal?.aborted)throw new Kt;return this._addRun(E(this,Nt,"m",_o).call(this))}toReadableStream(){return new ha(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(t,n,r,i){let a=new Ji;return a._run(()=>a._runToolAssistantStream(t,n,r,{...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"stream"}})),a}async _createToolAssistantStream(t,n,r,i){let a=i?.signal;a&&(a.aborted&&this.controller.abort(),a.addEventListener("abort",()=>this.controller.abort()));let s={...r,stream:!0},o=await t.submitToolOutputs(n,s,{...i,signal:this.controller.signal});this._connected();for await(let c of o)E(this,Nt,"m",go).call(this,c);if(o.controller.signal?.aborted)throw new Kt;return this._addRun(E(this,Nt,"m",_o).call(this))}static createThreadAssistantStream(t,n,r){let i=new Ji;return i._run(()=>i._threadAssistantStream(t,n,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),i}static createAssistantStream(t,n,r,i){let a=new Ji;return a._run(()=>a._runAssistantStream(t,n,r,{...i,headers:{...i?.headers,"X-Stainless-Helper-Method":"stream"}})),a}currentEvent(){return E(this,fu,"f")}currentRun(){return E(this,hu,"f")}currentMessageSnapshot(){return E(this,Zn,"f")}currentRunStepSnapshot(){return E(this,xo,"f")}async finalRunSteps(){return await this.done(),Object.values(E(this,sr,"f"))}async finalMessages(){return await this.done(),Object.values(E(this,du,"f"))}async finalRun(){if(await this.done(),!E(this,Wi,"f"))throw Error("Final run was not received.");return E(this,Wi,"f")}async _createThreadAssistantStream(t,n,r){let i=r?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort()));let a={...n,stream:!0},s=await t.createAndRun(a,{...r,signal:this.controller.signal});this._connected();for await(let o of s)E(this,Nt,"m",go).call(this,o);if(s.controller.signal?.aborted)throw new Kt;return this._addRun(E(this,Nt,"m",_o).call(this))}async _createAssistantStream(t,n,r,i){let a=i?.signal;a&&(a.aborted&&this.controller.abort(),a.addEventListener("abort",()=>this.controller.abort()));let s={...r,stream:!0},o=await t.create(n,s,{...i,signal:this.controller.signal});this._connected();for await(let c of o)E(this,Nt,"m",go).call(this,c);if(o.controller.signal?.aborted)throw new Kt;return this._addRun(E(this,Nt,"m",_o).call(this))}static accumulateDelta(t,n){for(let[r,i]of Object.entries(n)){if(!t.hasOwnProperty(r)){t[r]=i;continue}let a=t[r];if(a==null){t[r]=i;continue}if(r==="index"||r==="type"){t[r]=i;continue}if(typeof a=="string"&&typeof i=="string")a+=i;else if(typeof a=="number"&&typeof i=="number")a+=i;else if(bm(a)&&bm(i))a=this.accumulateDelta(a,i);else if(Array.isArray(a)&&Array.isArray(i)){if(a.every(s=>typeof s=="string"||typeof s=="number")){a.push(...i);continue}for(let s of i){if(!bm(s))throw new Error(`Expected array delta entry to be an object but got: ${s}`);let o=s.index;if(o==null)throw console.error(s),new Error("Expected array delta entry to have an `index` property");if(typeof o!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${o}`);let c=a[o];c==null?a.push(s):a[o]=this.accumulateDelta(c,s)}continue}else throw Error(`Unhandled record type: ${r}, deltaValue: ${i}, accValue: ${a}`);t[r]=a}return t}_addRun(t){return t}async _threadAssistantStream(t,n,r){return await this._createThreadAssistantStream(n,t,r)}async _runAssistantStream(t,n,r,i){return await this._createAssistantStream(n,t,r,i)}async _runToolAssistantStream(t,n,r,i){return await this._createToolAssistantStream(n,t,r,i)}};Ji=na,go=function(t){if(!this.ended)switch(pe(this,fu,t),E(this,Nt,"m",ik).call(this,t),t.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":E(this,Nt,"m",ck).call(this,t);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":E(this,Nt,"m",rk).call(this,t);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":E(this,Nt,"m",nk).call(this,t);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},_o=function(){if(this.ended)throw new oe("stream has ended, this shouldn't happen");if(!E(this,Wi,"f"))throw Error("Final run has not been received");return E(this,Wi,"f")},nk=function(t){let[n,r]=E(this,Nt,"m",sk).call(this,t,E(this,Zn,"f"));pe(this,Zn,n),E(this,du,"f")[n.id]=n;for(let i of r){let a=n.content[i.index];a?.type=="text"&&this._emit("textCreated",a.text)}switch(t.event){case"thread.message.created":this._emit("messageCreated",t.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",t.data.delta,n),t.data.delta.content)for(let i of t.data.delta.content){if(i.type=="text"&&i.text){let a=i.text,s=n.content[i.index];if(s&&s.type=="text")this._emit("textDelta",a,s.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(i.index!=E(this,Wa,"f")){if(E(this,Bi,"f"))switch(E(this,Bi,"f").type){case"text":this._emit("textDone",E(this,Bi,"f").text,E(this,Zn,"f"));break;case"image_file":this._emit("imageFileDone",E(this,Bi,"f").image_file,E(this,Zn,"f"));break}pe(this,Wa,i.index)}pe(this,Bi,n.content[i.index])}break;case"thread.message.completed":case"thread.message.incomplete":if(E(this,Wa,"f")!==void 0){let i=t.data.content[E(this,Wa,"f")];if(i)switch(i.type){case"image_file":this._emit("imageFileDone",i.image_file,E(this,Zn,"f"));break;case"text":this._emit("textDone",i.text,E(this,Zn,"f"));break}}E(this,Zn,"f")&&this._emit("messageDone",t.data),pe(this,Zn,void 0)}},rk=function(t){let n=E(this,Nt,"m",ak).call(this,t);switch(pe(this,xo,n),t.event){case"thread.run.step.created":this._emit("runStepCreated",t.data);break;case"thread.run.step.delta":let r=t.data.delta;if(r.step_details&&r.step_details.type=="tool_calls"&&r.step_details.tool_calls&&n.step_details.type=="tool_calls")for(let a of r.step_details.tool_calls)a.index==E(this,Nd,"f")?this._emit("toolCallDelta",a,n.step_details.tool_calls[a.index]):(E(this,yn,"f")&&this._emit("toolCallDone",E(this,yn,"f")),pe(this,Nd,a.index),pe(this,yn,n.step_details.tool_calls[a.index]),E(this,yn,"f")&&this._emit("toolCallCreated",E(this,yn,"f")));this._emit("runStepDelta",t.data.delta,n);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":pe(this,xo,void 0),t.data.step_details.type=="tool_calls"&&E(this,yn,"f")&&(this._emit("toolCallDone",E(this,yn,"f")),pe(this,yn,void 0)),this._emit("runStepDone",t.data,n);break}},ik=function(t){E(this,w_,"f").push(t),this._emit("event",t)},ak=function(t){switch(t.event){case"thread.run.step.created":return E(this,sr,"f")[t.data.id]=t.data,t.data;case"thread.run.step.delta":let n=E(this,sr,"f")[t.data.id];if(!n)throw Error("Received a RunStepDelta before creation of a snapshot");let r=t.data;if(r.delta){let i=Ji.accumulateDelta(n,r.delta);E(this,sr,"f")[t.data.id]=i}return E(this,sr,"f")[t.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":E(this,sr,"f")[t.data.id]=t.data;break}if(E(this,sr,"f")[t.data.id])return E(this,sr,"f")[t.data.id];throw new Error("No snapshot available")},sk=function(t,n){let r=[];switch(t.event){case"thread.message.created":return[t.data,r];case"thread.message.delta":if(!n)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let i=t.data;if(i.delta.content)for(let a of i.delta.content)if(a.index in n.content){let s=n.content[a.index];n.content[a.index]=E(this,Nt,"m",ok).call(this,a,s)}else n.content[a.index]=a,r.push(a);return[n,r];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(n)return[n,r];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},ok=function(t,n){return Ji.accumulateDelta(n,t)},ck=function(t){switch(pe(this,hu,t.data),t.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":pe(this,Wi,t.data),E(this,yn,"f")&&(this._emit("toolCallDone",E(this,yn,"f")),pe(this,yn,void 0));break}};var Wb=class extends ne{constructor(){super(...arguments),this.steps=new Cd(this._client)}create(t,n,r){let{include:i,...a}=n;return this._client.post(R`/threads/${t}/runs`,{query:{include:i},body:a,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers]),stream:n.stream??!1,__synthesizeEventData:!0})}retrieve(t,n,r){let{thread_id:i}=n;return this._client.get(R`/threads/${i}/runs/${t}`,{...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}update(t,n,r){let{thread_id:i,...a}=n;return this._client.post(R`/threads/${i}/runs/${t}`,{body:a,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(t,n={},r){return this._client.getAPIList(R`/threads/${t}/runs`,st,{query:n,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}cancel(t,n,r){let{thread_id:i}=n;return this._client.post(R`/threads/${i}/runs/${t}/cancel`,{...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}async createAndPoll(t,n,r){let i=await this.create(t,n,r);return await this.poll(i.id,{thread_id:t},r)}createAndStream(t,n,r){return na.createAssistantStream(t,this._client.beta.threads.runs,n,r)}async poll(t,n,r){let i=W([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:a,response:s}=await this.retrieve(t,n,{...r,headers:{...r?.headers,...i}}).withResponse();switch(a.status){case"queued":case"in_progress":case"cancelling":let o=5e3;if(r?.pollIntervalMs)o=r.pollIntervalMs;else{let c=s.headers.get("openai-poll-after-ms");if(c){let l=parseInt(c);isNaN(l)||(o=l)}}await Yc(o);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return a}}}stream(t,n,r){return na.createAssistantStream(t,this._client.beta.threads.runs,n,r)}submitToolOutputs(t,n,r){let{thread_id:i,...a}=n;return this._client.post(R`/threads/${i}/runs/${t}/submit_tool_outputs`,{body:a,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers]),stream:n.stream??!1,__synthesizeEventData:!0})}async submitToolOutputsAndPoll(t,n,r){let i=await this.submitToolOutputs(t,n,r);return await this.poll(i.id,n,r)}submitToolOutputsStream(t,n,r){return na.createToolAssistantStream(t,this._client.beta.threads.runs,n,r)}};Wb.Steps=Cd;var As=class extends ne{constructor(){super(...arguments),this.runs=new Wb(this._client),this.messages=new Ad(this._client)}create(t={},n){return this._client.post("/threads",{body:t,...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(t,n){return this._client.get(R`/threads/${t}`,{...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(t,n,r){return this._client.post(R`/threads/${t}`,{body:n,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}delete(t,n){return this._client.delete(R`/threads/${t}`,{...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}createAndRun(t,n){return this._client.post("/threads/runs",{body:t,...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers]),stream:t.stream??!1,__synthesizeEventData:!0})}async createAndRunPoll(t,n){let r=await this.createAndRun(t,n);return await this.runs.poll(r.id,{thread_id:r.thread_id},n)}createAndRunStream(t,n){return na.createThreadAssistantStream(t,this._client.beta.threads,n)}};As.Runs=Wb;As.Messages=Ad;var Ii=class extends ne{constructor(){super(...arguments),this.realtime=new Ch(this._client),this.chatkit=new Os(this._client),this.assistants=new Ed(this._client),this.threads=new As(this._client)}};Ii.Realtime=Ch;Ii.ChatKit=Os;Ii.Assistants=Ed;Ii.Threads=As;var Pd=class extends ne{create(t,n){return this._client.post("/completions",{body:t,...n,stream:t.stream??!1})}},aR=class extends ne{retrieve(t,n,r){let{container_id:i}=n;return this._client.get(R`/containers/${i}/files/${t}/content`,{...r,headers:W([{Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}},Kb=class extends ne{constructor(){super(...arguments),this.content=new aR(this._client)}create(t,n,r){return this._client.post(R`/containers/${t}/files`,Ah({body:n,...r},this._client))}retrieve(t,n,r){let{container_id:i}=n;return this._client.get(R`/containers/${i}/files/${t}`,r)}list(t,n={},r){return this._client.getAPIList(R`/containers/${t}/files`,st,{query:n,...r})}delete(t,n,r){let{container_id:i}=n;return this._client.delete(R`/containers/${i}/files/${t}`,{...r,headers:W([{Accept:"*/*"},r?.headers])})}};Kb.Content=aR;var rc=class extends ne{constructor(){super(...arguments),this.files=new Kb(this._client)}create(t,n){return this._client.post("/containers",{body:t,...n})}retrieve(t,n){return this._client.get(R`/containers/${t}`,n)}list(t={},n){return this._client.getAPIList("/containers",st,{query:t,...n})}delete(t,n){return this._client.delete(R`/containers/${t}`,{...n,headers:W([{Accept:"*/*"},n?.headers])})}};rc.Files=Kb;var Rd=class extends ne{create(t,n,r){let{include:i,...a}=n;return this._client.post(R`/conversations/${t}/items`,{query:{include:i},body:a,...r})}retrieve(t,n,r){let{conversation_id:i,...a}=n;return this._client.get(R`/conversations/${i}/items/${t}`,{query:a,...r})}list(t,n={},r){return this._client.getAPIList(R`/conversations/${t}/items`,pa,{query:n,...r})}delete(t,n,r){let{conversation_id:i}=n;return this._client.delete(R`/conversations/${i}/items/${t}`,r)}},ic=class extends ne{constructor(){super(...arguments),this.items=new Rd(this._client)}create(t={},n){return this._client.post("/conversations",{body:t,...n})}retrieve(t,n){return this._client.get(R`/conversations/${t}`,n)}update(t,n,r){return this._client.post(R`/conversations/${t}`,{body:n,...r})}delete(t,n){return this._client.delete(R`/conversations/${t}`,n)}};ic.Items=Rd;var jd=class extends ne{create(t,n){let r=!!t.encoding_format,i=r?t.encoding_format:"base64";r&&Ct(this._client).debug("embeddings/user defined encoding_format:",t.encoding_format);let a=this._client.post("/embeddings",{body:{...t,encoding_format:i},...n});return r?a:(Ct(this._client).debug("embeddings/decoding base64 embeddings from base64"),a._thenUnwrap(s=>(s&&s.data&&s.data.forEach(o=>{let c=o.embedding;o.embedding=fG(c)}),s)))}},Md=class extends ne{retrieve(t,n,r){let{eval_id:i,run_id:a}=n;return this._client.get(R`/evals/${i}/runs/${a}/output_items/${t}`,r)}list(t,n,r){let{eval_id:i,...a}=n;return this._client.getAPIList(R`/evals/${i}/runs/${t}/output_items`,st,{query:a,...r})}},ac=class extends ne{constructor(){super(...arguments),this.outputItems=new Md(this._client)}create(t,n,r){return this._client.post(R`/evals/${t}/runs`,{body:n,...r})}retrieve(t,n,r){let{eval_id:i}=n;return this._client.get(R`/evals/${i}/runs/${t}`,r)}list(t,n={},r){return this._client.getAPIList(R`/evals/${t}/runs`,st,{query:n,...r})}delete(t,n,r){let{eval_id:i}=n;return this._client.delete(R`/evals/${i}/runs/${t}`,r)}cancel(t,n,r){let{eval_id:i}=n;return this._client.post(R`/evals/${i}/runs/${t}`,r)}};ac.OutputItems=Md;var sc=class extends ne{constructor(){super(...arguments),this.runs=new ac(this._client)}create(t,n){return this._client.post("/evals",{body:t,...n})}retrieve(t,n){return this._client.get(R`/evals/${t}`,n)}update(t,n,r){return this._client.post(R`/evals/${t}`,{body:n,...r})}list(t={},n){return this._client.getAPIList("/evals",st,{query:t,...n})}delete(t,n){return this._client.delete(R`/evals/${t}`,n)}};sc.Runs=ac;var sR=class extends ne{create(t,n){return this._client.post("/files",hr({body:t,...n},this._client))}retrieve(t,n){return this._client.get(R`/files/${t}`,n)}list(t={},n){return this._client.getAPIList("/files",st,{query:t,...n})}delete(t,n){return this._client.delete(R`/files/${t}`,n)}content(t,n){return this._client.get(R`/files/${t}/content`,{...n,headers:W([{Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}async waitForProcessing(t,{pollInterval:n=5e3,maxWait:r=1800*1e3}={}){let i=new Set(["processed","error","deleted"]),a=Date.now(),s=await this.retrieve(t);for(;!s.status||!i.has(s.status);)if(await Yc(n),s=await this.retrieve(t),Date.now()-a>r)throw new Is({message:`Giving up on waiting for file ${t} to finish processing after ${r} milliseconds.`});return s}},Dd=class extends ne{},oR=class extends ne{run(t,n){return this._client.post("/fine_tuning/alpha/graders/run",{body:t,...n})}validate(t,n){return this._client.post("/fine_tuning/alpha/graders/validate",{body:t,...n})}},oc=class extends ne{constructor(){super(...arguments),this.graders=new oR(this._client)}};oc.Graders=oR;var Ud=class extends ne{create(t,n,r){return this._client.getAPIList(R`/fine_tuning/checkpoints/${t}/permissions`,Ts,{body:n,method:"post",...r})}retrieve(t,n={},r){return this._client.get(R`/fine_tuning/checkpoints/${t}/permissions`,{query:n,...r})}list(t,n={},r){return this._client.getAPIList(R`/fine_tuning/checkpoints/${t}/permissions`,pa,{query:n,...r})}delete(t,n,r){let{fine_tuned_model_checkpoint:i}=n;return this._client.delete(R`/fine_tuning/checkpoints/${i}/permissions/${t}`,r)}},Xb=class extends ne{constructor(){super(...arguments),this.permissions=new Ud(this._client)}};Xb.Permissions=Ud;var Ld=class extends ne{list(t,n={},r){return this._client.getAPIList(R`/fine_tuning/jobs/${t}/checkpoints`,st,{query:n,...r})}},cc=class extends ne{constructor(){super(...arguments),this.checkpoints=new Ld(this._client)}create(t,n){return this._client.post("/fine_tuning/jobs",{body:t,...n})}retrieve(t,n){return this._client.get(R`/fine_tuning/jobs/${t}`,n)}list(t={},n){return this._client.getAPIList("/fine_tuning/jobs",st,{query:t,...n})}cancel(t,n){return this._client.post(R`/fine_tuning/jobs/${t}/cancel`,n)}listEvents(t,n={},r){return this._client.getAPIList(R`/fine_tuning/jobs/${t}/events`,st,{query:n,...r})}pause(t,n){return this._client.post(R`/fine_tuning/jobs/${t}/pause`,n)}resume(t,n){return this._client.post(R`/fine_tuning/jobs/${t}/resume`,n)}};cc.Checkpoints=Ld;var Ei=class extends ne{constructor(){super(...arguments),this.methods=new Dd(this._client),this.jobs=new cc(this._client),this.checkpoints=new Xb(this._client),this.alpha=new oc(this._client)}};Ei.Methods=Dd;Ei.Jobs=cc;Ei.Checkpoints=Xb;Ei.Alpha=oc;var zd=class extends ne{},lc=class extends ne{constructor(){super(...arguments),this.graderModels=new zd(this._client)}};lc.GraderModels=zd;var Fd=class extends ne{createVariation(t,n){return this._client.post("/images/variations",hr({body:t,...n},this._client))}edit(t,n){return this._client.post("/images/edits",hr({body:t,...n,stream:t.stream??!1},this._client))}generate(t,n){return this._client.post("/images/generations",{body:t,...n,stream:t.stream??!1})}},Bd=class extends ne{retrieve(t,n){return this._client.get(R`/models/${t}`,n)}list(t){return this._client.getAPIList("/models",Ts,t)}delete(t,n){return this._client.delete(R`/models/${t}`,n)}},Zd=class extends ne{create(t,n){return this._client.post("/moderations",{body:t,...n})}},Vd=class extends ne{accept(t,n,r){return this._client.post(R`/realtime/calls/${t}/accept`,{body:n,...r,headers:W([{Accept:"*/*"},r?.headers])})}hangup(t,n){return this._client.post(R`/realtime/calls/${t}/hangup`,{...n,headers:W([{Accept:"*/*"},n?.headers])})}refer(t,n,r){return this._client.post(R`/realtime/calls/${t}/refer`,{body:n,...r,headers:W([{Accept:"*/*"},r?.headers])})}reject(t,n={},r){return this._client.post(R`/realtime/calls/${t}/reject`,{body:n,...r,headers:W([{Accept:"*/*"},r?.headers])})}},qd=class extends ne{create(t,n){return this._client.post("/realtime/client_secrets",{body:t,...n})}},Cs=class extends ne{constructor(){super(...arguments),this.clientSecrets=new qd(this._client),this.calls=new Vd(this._client)}};Cs.ClientSecrets=qd;Cs.Calls=Vd;function hG(e,t){return!t||!mG(t)?{...e,output_parsed:null,output:e.output.map(n=>n.type==="function_call"?{...n,parsed_arguments:null}:n.type==="message"?{...n,content:n.content.map(r=>({...r,parsed:null}))}:n)}:cR(e,t)}function cR(e,t){let n=e.output.map(i=>{if(i.type==="function_call")return{...i,parsed_arguments:yG(t,i)};if(i.type==="message"){let a=i.content.map(s=>s.type==="output_text"?{...s,parsed:pG(t,s.text)}:s);return{...i,content:a}}return i}),r=Object.assign({},e,{output:n});return Object.getOwnPropertyDescriptor(e,"output_text")||$_(r),Object.defineProperty(r,"output_parsed",{enumerable:!0,get(){for(let i of r.output)if(i.type==="message"){for(let a of i.content)if(a.type==="output_text"&&a.parsed!==null)return a.parsed}return null}}),r}function pG(e,t){return e.text?.format?.type!=="json_schema"?null:"$parseRaw"in e.text?.format?(e.text?.format).$parseRaw(t):JSON.parse(t)}function mG(e){return!!Gb(e.text?.format)}function gG(e){return e?.$brand==="auto-parseable-tool"}function _G(e,t){return e.find(n=>n.type==="function"&&n.name===t)}function yG(e,t){let n=_G(e.tools??[],t.name);return{...t,...t,parsed_arguments:gG(n)?n.$parseRaw(t.arguments):n?.strict?JSON.parse(t.arguments):null}}function $_(e){let t=[];for(let n of e.output)if(n.type==="message")for(let r of n.content)r.type==="output_text"&&t.push(r.text);e.output_text=t.join("")}var Na,Dl,Qr,Ul,lk,uk,dk,fk,S_=class e extends tc{constructor(t){super(),Na.add(this),Dl.set(this,void 0),Qr.set(this,void 0),Ul.set(this,void 0),pe(this,Dl,t)}static createResponse(t,n,r){let i=new e(n);return i._run(()=>i._createOrRetrieveResponse(t,n,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"stream"}})),i}async _createOrRetrieveResponse(t,n,r){let i=r?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort())),E(this,Na,"m",lk).call(this);let a,s=null;"response_id"in n?(a=await t.responses.retrieve(n.response_id,{stream:!0},{...r,signal:this.controller.signal,stream:!0}),s=n.starting_after??null):a=await t.responses.create({...n,stream:!0},{...r,signal:this.controller.signal}),this._connected();for await(let o of a)E(this,Na,"m",uk).call(this,o,s);if(a.controller.signal?.aborted)throw new Kt;return E(this,Na,"m",dk).call(this)}[(Dl=new WeakMap,Qr=new WeakMap,Ul=new WeakMap,Na=new WeakSet,lk=function(){this.ended||pe(this,Qr,void 0)},uk=function(n,r){if(this.ended)return;let i=(s,o)=>{(r==null||o.sequence_number>r)&&this._emit(s,o)},a=E(this,Na,"m",fk).call(this,n);switch(i("event",n),n.type){case"response.output_text.delta":{let s=a.output[n.output_index];if(!s)throw new oe(`missing output at index ${n.output_index}`);if(s.type==="message"){let o=s.content[n.content_index];if(!o)throw new oe(`missing content at index ${n.content_index}`);if(o.type!=="output_text")throw new oe(`expected content to be 'output_text', got ${o.type}`);i("response.output_text.delta",{...n,snapshot:o.text})}break}case"response.function_call_arguments.delta":{let s=a.output[n.output_index];if(!s)throw new oe(`missing output at index ${n.output_index}`);s.type==="function_call"&&i("response.function_call_arguments.delta",{...n,snapshot:s.arguments});break}default:i(n.type,n);break}},dk=function(){if(this.ended)throw new oe("stream has ended, this shouldn't happen");let n=E(this,Qr,"f");if(!n)throw new oe("request ended without sending any events");pe(this,Qr,void 0);let r=vG(n,E(this,Dl,"f"));return pe(this,Ul,r),r},fk=function(n){let r=E(this,Qr,"f");if(!r){if(n.type!=="response.created")throw new oe(`When snapshot hasn't been set yet, expected 'response.created' event, got ${n.type}`);return r=pe(this,Qr,n.response),r}switch(n.type){case"response.output_item.added":{r.output.push(n.item);break}case"response.content_part.added":{let i=r.output[n.output_index];if(!i)throw new oe(`missing output at index ${n.output_index}`);let a=i.type,s=n.part;a==="message"&&s.type!=="reasoning_text"?i.content.push(s):a==="reasoning"&&s.type==="reasoning_text"&&(i.content||(i.content=[]),i.content.push(s));break}case"response.output_text.delta":{let i=r.output[n.output_index];if(!i)throw new oe(`missing output at index ${n.output_index}`);if(i.type==="message"){let a=i.content[n.content_index];if(!a)throw new oe(`missing content at index ${n.content_index}`);if(a.type!=="output_text")throw new oe(`expected content to be 'output_text', got ${a.type}`);a.text+=n.delta}break}case"response.function_call_arguments.delta":{let i=r.output[n.output_index];if(!i)throw new oe(`missing output at index ${n.output_index}`);i.type==="function_call"&&(i.arguments+=n.delta);break}case"response.reasoning_text.delta":{let i=r.output[n.output_index];if(!i)throw new oe(`missing output at index ${n.output_index}`);if(i.type==="reasoning"){let a=i.content?.[n.content_index];if(!a)throw new oe(`missing content at index ${n.content_index}`);if(a.type!=="reasoning_text")throw new oe(`expected content to be 'reasoning_text', got ${a.type}`);a.text+=n.delta}break}case"response.completed":{pe(this,Qr,n.response);break}}return r},Symbol.asyncIterator)](){let t=[],n=[],r=!1;return this.on("event",i=>{let a=n.shift();a?a.resolve(i):t.push(i)}),this.on("end",()=>{r=!0;for(let i of n)i.resolve(void 0);n.length=0}),this.on("abort",i=>{r=!0;for(let a of n)a.reject(i);n.length=0}),this.on("error",i=>{r=!0;for(let a of n)a.reject(i);n.length=0}),{next:async()=>t.length?{value:t.shift(),done:!1}:r?{value:void 0,done:!0}:new Promise((a,s)=>n.push({resolve:a,reject:s})).then(a=>a?{value:a,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();let t=E(this,Ul,"f");if(!t)throw new oe("stream ended without producing a ChatCompletion");return t}};function vG(e,t){return hG(e,t)}var Gd=class extends ne{list(t,n={},r){return this._client.getAPIList(R`/responses/${t}/input_items`,st,{query:n,...r})}},Hd=class extends ne{count(t={},n){return this._client.post("/responses/input_tokens",{body:t,...n})}},Ns=class extends ne{constructor(){super(...arguments),this.inputItems=new Gd(this._client),this.inputTokens=new Hd(this._client)}create(t,n){return this._client.post("/responses",{body:t,...n,stream:t.stream??!1})._thenUnwrap(r=>("object"in r&&r.object==="response"&&$_(r),r))}retrieve(t,n={},r){return this._client.get(R`/responses/${t}`,{query:n,...r,stream:n?.stream??!1})._thenUnwrap(i=>("object"in i&&i.object==="response"&&$_(i),i))}delete(t,n){return this._client.delete(R`/responses/${t}`,{...n,headers:W([{Accept:"*/*"},n?.headers])})}parse(t,n){return this._client.responses.create(t,n)._thenUnwrap(r=>cR(r,t))}stream(t,n){return S_.createResponse(this._client,t,n)}cancel(t,n){return this._client.post(R`/responses/${t}/cancel`,n)}compact(t,n){return this._client.post("/responses/compact",{body:t,...n})}};Ns.InputItems=Gd;Ns.InputTokens=Hd;var lR=class extends ne{retrieve(t,n){return this._client.get(R`/skills/${t}/content`,{...n,headers:W([{Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}},Jd=class extends ne{retrieve(t,n,r){let{skill_id:i}=n;return this._client.get(R`/skills/${i}/versions/${t}/content`,{...r,headers:W([{Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}},uc=class extends ne{constructor(){super(...arguments),this.content=new Jd(this._client)}create(t,n={},r){return this._client.post(R`/skills/${t}/versions`,Ah({body:n,...r},this._client))}retrieve(t,n,r){let{skill_id:i}=n;return this._client.get(R`/skills/${i}/versions/${t}`,r)}list(t,n={},r){return this._client.getAPIList(R`/skills/${t}/versions`,st,{query:n,...r})}delete(t,n,r){let{skill_id:i}=n;return this._client.delete(R`/skills/${i}/versions/${t}`,r)}};uc.Content=Jd;var Ps=class extends ne{constructor(){super(...arguments),this.content=new lR(this._client),this.versions=new uc(this._client)}create(t={},n){return this._client.post("/skills",Ah({body:t,...n},this._client))}retrieve(t,n){return this._client.get(R`/skills/${t}`,n)}update(t,n,r){return this._client.post(R`/skills/${t}`,{body:n,...r})}list(t={},n){return this._client.getAPIList("/skills",st,{query:t,...n})}delete(t,n){return this._client.delete(R`/skills/${t}`,n)}};Ps.Content=lR;Ps.Versions=uc;var Wd=class extends ne{create(t,n,r){return this._client.post(R`/uploads/${t}/parts`,hr({body:n,...r},this._client))}},dc=class extends ne{constructor(){super(...arguments),this.parts=new Wd(this._client)}create(t,n){return this._client.post("/uploads",{body:t,...n})}cancel(t,n){return this._client.post(R`/uploads/${t}/cancel`,n)}complete(t,n,r){return this._client.post(R`/uploads/${t}/complete`,{body:n,...r})}};dc.Parts=Wd;var bG=async e=>{let t=await Promise.allSettled(e),n=t.filter(i=>i.status==="rejected");if(n.length){for(let i of n)console.error(i.reason);throw new Error(`${n.length} promise(s) failed - see the above errors`)}let r=[];for(let i of t)i.status==="fulfilled"&&r.push(i.value);return r},Kd=class extends ne{create(t,n,r){return this._client.post(R`/vector_stores/${t}/file_batches`,{body:n,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}retrieve(t,n,r){let{vector_store_id:i}=n;return this._client.get(R`/vector_stores/${i}/file_batches/${t}`,{...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}cancel(t,n,r){let{vector_store_id:i}=n;return this._client.post(R`/vector_stores/${i}/file_batches/${t}/cancel`,{...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}async createAndPoll(t,n,r){let i=await this.create(t,n);return await this.poll(t,i.id,r)}listFiles(t,n,r){let{vector_store_id:i,...a}=n;return this._client.getAPIList(R`/vector_stores/${i}/file_batches/${t}/files`,st,{query:a,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}async poll(t,n,r){let i=W([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:a,response:s}=await this.retrieve(n,{vector_store_id:t},{...r,headers:i}).withResponse();switch(a.status){case"in_progress":let o=5e3;if(r?.pollIntervalMs)o=r.pollIntervalMs;else{let c=s.headers.get("openai-poll-after-ms");if(c){let l=parseInt(c);isNaN(l)||(o=l)}}await Yc(o);break;case"failed":case"cancelled":case"completed":return a}}}async uploadAndPoll(t,{files:n,fileIds:r=[]},i){if(n==null||n.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let a=i?.maxConcurrency??5,s=Math.min(a,n.length),o=this._client,c=n.values(),l=[...r];async function u(f){for(let h of f){let p=await o.files.create({file:h,purpose:"assistants"},i);l.push(p.id)}}let d=Array(s).fill(c).map(u);return await bG(d),await this.createAndPoll(t,{file_ids:l})}},Xd=class extends ne{create(t,n,r){return this._client.post(R`/vector_stores/${t}/files`,{body:n,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}retrieve(t,n,r){let{vector_store_id:i}=n;return this._client.get(R`/vector_stores/${i}/files/${t}`,{...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}update(t,n,r){let{vector_store_id:i,...a}=n;return this._client.post(R`/vector_stores/${i}/files/${t}`,{body:a,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(t,n={},r){return this._client.getAPIList(R`/vector_stores/${t}/files`,st,{query:n,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}delete(t,n,r){let{vector_store_id:i}=n;return this._client.delete(R`/vector_stores/${i}/files/${t}`,{...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}async createAndPoll(t,n,r){let i=await this.create(t,n,r);return await this.poll(t,i.id,r)}async poll(t,n,r){let i=W([r?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":r?.pollIntervalMs?.toString()??void 0}]);for(;;){let a=await this.retrieve(n,{vector_store_id:t},{...r,headers:i}).withResponse(),s=a.data;switch(s.status){case"in_progress":let o=5e3;if(r?.pollIntervalMs)o=r.pollIntervalMs;else{let c=a.response.headers.get("openai-poll-after-ms");if(c){let l=parseInt(c);isNaN(l)||(o=l)}}await Yc(o);break;case"failed":case"completed":return s}}}async upload(t,n,r){let i=await this._client.files.create({file:n,purpose:"assistants"},r);return this.create(t,{file_id:i.id},r)}async uploadAndPoll(t,n,r){let i=await this.upload(t,n,r);return await this.poll(t,i.id,r)}content(t,n,r){let{vector_store_id:i}=n;return this._client.getAPIList(R`/vector_stores/${i}/files/${t}/content`,Ts,{...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}},Rs=class extends ne{constructor(){super(...arguments),this.files=new Xd(this._client),this.fileBatches=new Kd(this._client)}create(t,n){return this._client.post("/vector_stores",{body:t,...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(t,n){return this._client.get(R`/vector_stores/${t}`,{...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(t,n,r){return this._client.post(R`/vector_stores/${t}`,{body:n,...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}list(t={},n){return this._client.getAPIList("/vector_stores",st,{query:t,...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}delete(t,n){return this._client.delete(R`/vector_stores/${t}`,{...n,headers:W([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}search(t,n,r){return this._client.getAPIList(R`/vector_stores/${t}/search`,Ts,{body:n,method:"post",...r,headers:W([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}};Rs.Files=Xd;Rs.FileBatches=Kd;var Yd=class extends ne{create(t,n){return this._client.post("/videos",hr({body:t,...n},this._client))}retrieve(t,n){return this._client.get(R`/videos/${t}`,n)}list(t={},n){return this._client.getAPIList("/videos",pa,{query:t,...n})}delete(t,n){return this._client.delete(R`/videos/${t}`,n)}createCharacter(t,n){return this._client.post("/videos/characters",hr({body:t,...n},this._client))}downloadContent(t,n={},r){return this._client.get(R`/videos/${t}/content`,{query:n,...r,headers:W([{Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}edit(t,n){return this._client.post("/videos/edits",hr({body:t,...n},this._client))}extend(t,n){return this._client.post("/videos/extensions",hr({body:t,...n},this._client))}getCharacter(t,n){return this._client.get(R`/videos/characters/${t}`,n)}remix(t,n,r){return this._client.post(R`/videos/${t}/remix`,Ah({body:n,...r},this._client))}},La,uR,pu,Qd=class extends ne{constructor(){super(...arguments),La.add(this)}async unwrap(t,n,r=this._client.webhookSecret,i=300){return await this.verifySignature(t,n,r,i),JSON.parse(t)}async verifySignature(t,n,r=this._client.webhookSecret,i=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!="function"||typeof crypto.subtle.verify!="function")throw new Error("Webhook signature verification is only supported when the `crypto` global is defined");E(this,La,"m",uR).call(this,r);let a=W([n]).values,s=E(this,La,"m",pu).call(this,a,"webhook-signature"),o=E(this,La,"m",pu).call(this,a,"webhook-timestamp"),c=E(this,La,"m",pu).call(this,a,"webhook-id"),l=parseInt(o,10);if(isNaN(l))throw new Hi("Invalid webhook timestamp format");let u=Math.floor(Date.now()/1e3);if(u-l>i)throw new Hi("Webhook timestamp is too old");if(l>u+i)throw new Hi("Webhook timestamp is too new");let d=s.split(" ").map(m=>m.startsWith("v1,")?m.substring(3):m),f=r.startsWith("whsec_")?Buffer.from(r.replace("whsec_",""),"base64"):Buffer.from(r,"utf-8"),h=c?`${c}.${o}.${t}`:`${o}.${t}`,p=await crypto.subtle.importKey("raw",f,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(let m of d)try{let v=Buffer.from(m,"base64");if(await crypto.subtle.verify("HMAC",p,v,new TextEncoder().encode(h)))return}catch{continue}throw new Hi("The given webhook signature does not match the expected signature")}};La=new WeakSet,uR=function(t){if(typeof t!="string"||t.length===0)throw new Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},pu=function(t,n){if(!t)throw new Error("Headers are required");let r=t.get(n);if(r==null)throw new Error(`Missing required header: ${n}`);return r};var k_,Yb,mu,dR,Se=class{constructor({baseURL:t=Ca("OPENAI_BASE_URL"),apiKey:n=Ca("OPENAI_API_KEY"),organization:r=Ca("OPENAI_ORG_ID")??null,project:i=Ca("OPENAI_PROJECT_ID")??null,webhookSecret:a=Ca("OPENAI_WEBHOOK_SECRET")??null,...s}={}){if(k_.add(this),mu.set(this,void 0),this.completions=new Pd(this),this.chat=new nc(this),this.embeddings=new jd(this),this.files=new sR(this),this.images=new Fd(this),this.audio=new ma(this),this.moderations=new Zd(this),this.models=new Bd(this),this.fineTuning=new Ei(this),this.graders=new lc(this),this.vectorStores=new Rs(this),this.webhooks=new Qd(this),this.beta=new Ii(this),this.batches=new Id(this),this.uploads=new dc(this),this.responses=new Ns(this),this.realtime=new Cs(this),this.conversations=new ic(this),this.evals=new sc(this),this.containers=new rc(this),this.skills=new Ps(this),this.videos=new Yd(this),n===void 0)throw new oe("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");let o={apiKey:n,organization:r,project:i,webhookSecret:a,...s,baseURL:t||"https://api.openai.com/v1"};if(!o.dangerouslyAllowBrowser&&kq())throw new oe(`It looks like you're running in a browser-like environment.
788
-
789
- This is disabled by default, as it risks exposing your secret API credentials to attackers.
790
- If you understand the risks and have appropriate mitigations in place,
791
- you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
792
-
793
- new OpenAI({ apiKey, dangerouslyAllowBrowser: true });
794
-
795
- https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
796
- `);this.baseURL=o.baseURL,this.timeout=o.timeout??Yb.DEFAULT_TIMEOUT,this.logger=o.logger??console;let c="warn";this.logLevel=c,this.logLevel=KS(o.logLevel,"ClientOptions.logLevel",this)??KS(Ca("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??c,this.fetchOptions=o.fetchOptions,this.maxRetries=o.maxRetries??2,this.fetch=o.fetch??Oq(),pe(this,mu,Cq),this._options=o,this.apiKey=typeof n=="string"?n:"Missing Key",this.organization=r,this.project=i,this.webhookSecret=a}withOptions(t){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...t})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:n}){}async authHeaders(t){return W([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(t){return Uq(t)}getUserAgent(){return`${this.constructor.name}/JS ${Da}`}defaultIdempotencyKey(){return`stainless-node-retry-${vP()}`}makeStatusError(t,n,r,i){return Zt.generate(t,n,r,i)}async _callApiKey(){let t=this._options.apiKey;if(typeof t!="function")return!1;let n;try{n=await t()}catch(r){throw r instanceof oe?r:new oe(`Failed to get token from 'apiKey' function: ${r.message}`,{cause:r})}if(typeof n!="string"||!n)throw new oe(`Expected 'apiKey' function argument to return a string but it returned ${n}`);return this.apiKey=n,!0}buildURL(t,n,r){let i=!E(this,k_,"m",dR).call(this)&&r||this.baseURL,a=bq(t)?new URL(t):new URL(i+(i.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),s=this.defaultQuery(),o=Object.fromEntries(a.searchParams);return(!zS(s)||!zS(o))&&(n={...o,...s,...n}),typeof n=="object"&&n&&!Array.isArray(n)&&(a.search=this.stringifyQuery(n)),a.toString()}async prepareOptions(t){await this._callApiKey()}async prepareRequest(t,{url:n,options:r}){}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,r){return this.request(Promise.resolve(r).then(i=>({method:t,path:n,...i})))}request(t,n=null){return new md(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,r){let i=await t,a=i.maxRetries??this.maxRetries;n==null&&(n=a),await this.prepareOptions(i);let{req:s,url:o,timeout:c}=await this.buildRequest(i,{retryCount:a-n});await this.prepareRequest(s,{url:o,options:i});let l="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),u=r===void 0?"":`, retryOf: ${r}`,d=Date.now();if(Ct(this).debug(`[${l}] sending request`,Ui({retryOfRequestLogID:r,method:i.method,url:o,options:i,headers:s.headers})),i.signal?.aborted)throw new Kt;let f=new AbortController,h=await this.fetchWithTimeout(o,s,c,f).catch(a_),p=Date.now();if(h instanceof globalThis.Error){let g=`retrying, ${n} attempts remaining`;if(i.signal?.aborted)throw new Kt;let y=i_(h)||/timed? ?out/i.test(String(h)+("cause"in h?String(h.cause):""));if(n)return Ct(this).info(`[${l}] connection ${y?"timed out":"failed"} - ${g}`),Ct(this).debug(`[${l}] connection ${y?"timed out":"failed"} (${g})`,Ui({retryOfRequestLogID:r,url:o,durationMs:p-d,message:h.message})),this.retryRequest(i,n,r??l);throw Ct(this).info(`[${l}] connection ${y?"timed out":"failed"} - error; no more retries left`),Ct(this).debug(`[${l}] connection ${y?"timed out":"failed"} (error; no more retries left)`,Ui({retryOfRequestLogID:r,url:o,durationMs:p-d,message:h.message})),y?new Is:new xs({cause:h})}let m=[...h.headers.entries()].filter(([g])=>g==="x-request-id").map(([g,y])=>", "+g+": "+JSON.stringify(y)).join(""),v=`[${l}${u}${m}] ${s.method} ${o} ${h.ok?"succeeded":"failed"} with status ${h.status} in ${p-d}ms`;if(!h.ok){let g=await this.shouldRetry(h);if(n&&g){let T=`retrying, ${n} attempts remaining`;return await Aq(h.body),Ct(this).info(`${v} - ${T}`),Ct(this).debug(`[${l}] response error (${T})`,Ui({retryOfRequestLogID:r,url:h.url,status:h.status,headers:h.headers,durationMs:p-d})),this.retryRequest(i,n,r??l,h.headers)}let y=g?"error; no more retries left":"error; not retryable";Ct(this).info(`${v} - ${y}`);let $=await h.text().catch(T=>a_(T).message),S=Sq($),x=S?void 0:$;throw Ct(this).debug(`[${l}] response error (${y})`,Ui({retryOfRequestLogID:r,url:h.url,status:h.status,headers:h.headers,message:x,durationMs:Date.now()-d})),this.makeStatusError(h.status,S,x,h.headers)}return Ct(this).info(v),Ct(this).debug(`[${l}] response start`,Ui({retryOfRequestLogID:r,url:h.url,status:h.status,headers:h.headers,durationMs:p-d})),{response:h,options:i,controller:f,requestLogID:l,retryOfRequestLogID:r,startTime:d}}getAPIList(t,n,r){return this.requestAPIList(n,r&&"then"in r?r.then(i=>({method:"get",path:t,...i})):{method:"get",path:t,...r})}requestAPIList(t,n){let r=this.makeRequest(n,null,void 0);return new c_(this,r,t)}async fetchWithTimeout(t,n,r,i){let{signal:a,method:s,...o}=n||{},c=this._makeAbort(i);a&&a.addEventListener("abort",c,{once:!0});let l=setTimeout(c,r),u=globalThis.ReadableStream&&o.body instanceof globalThis.ReadableStream||typeof o.body=="object"&&o.body!==null&&Symbol.asyncIterator in o.body,d={signal:i.signal,...u?{duplex:"half"}:{},method:"GET",...o};s&&(d.method=s.toUpperCase());try{return await this.fetch.call(void 0,t,d)}finally{clearTimeout(l)}}async shouldRetry(t){let n=t.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,r,i){let a,s=i?.get("retry-after-ms");if(s){let c=parseFloat(s);Number.isNaN(c)||(a=c)}let o=i?.get("retry-after");if(o&&!a){let c=parseFloat(o);Number.isNaN(c)?a=Date.parse(o)-Date.now():a=c*1e3}if(a===void 0){let c=t.maxRetries??this.maxRetries;a=this.calculateDefaultRetryTimeoutMillis(n,c)}return await Yc(a),this.makeRequest(t,n-1,r)}calculateDefaultRetryTimeoutMillis(t,n){let a=n-t,s=Math.min(.5*Math.pow(2,a),8),o=1-Math.random()*.25;return s*o*1e3}async buildRequest(t,{retryCount:n=0}={}){let r={...t},{method:i,path:a,query:s,defaultBaseURL:o}=r,c=this.buildURL(a,s,o);"timeout"in r&&$q("timeout",r.timeout),r.timeout=r.timeout??this.timeout;let{bodyHeaders:l,body:u}=this.buildBody({options:r}),d=await this.buildHeaders({options:t,method:i,bodyHeaders:l,retryCount:n});return{req:{method:i,headers:d,...r.signal&&{signal:r.signal},...globalThis.ReadableStream&&u instanceof globalThis.ReadableStream&&{duplex:"half"},...u&&{body:u},...this.fetchOptions??{},...r.fetchOptions??{}},url:c,timeout:r.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:r,retryCount:i}){let a={};this.idempotencyHeader&&n!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),a[this.idempotencyHeader]=t.idempotencyKey);let s=W([a,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(i),...t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{},...Tq(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(t),this._options.defaultHeaders,r,t.headers]);return this.validateHeaders(s),s.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};let r=W([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&r.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:$P(t)}:typeof t=="object"&&r.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)}:E(this,mu,"f").call(this,{body:t,headers:r})}};Yb=Se,mu=new WeakMap,k_=new WeakSet,dR=function(){return this.baseURL!=="https://api.openai.com/v1"};Se.OpenAI=Yb;Se.DEFAULT_TIMEOUT=6e5;Se.OpenAIError=oe;Se.APIError=Zt;Se.APIConnectionError=xs;Se.APIConnectionTimeoutError=Is;Se.APIUserAbortError=Kt;Se.NotFoundError=od;Se.ConflictError=cd;Se.RateLimitError=ud;Se.BadRequestError=id;Se.AuthenticationError=ad;Se.InternalServerError=dd;Se.PermissionDeniedError=sd;Se.UnprocessableEntityError=ld;Se.InvalidWebhookSignatureError=Hi;Se.toFile=Kq;Se.Completions=Pd;Se.Chat=nc;Se.Embeddings=jd;Se.Files=sR;Se.Images=Fd;Se.Audio=ma;Se.Moderations=Zd;Se.Models=Bd;Se.FineTuning=Ei;Se.Graders=lc;Se.VectorStores=Rs;Se.Webhooks=Qd;Se.Beta=Ii;Se.Batches=Id;Se.Uploads=dc;Se.Responses=Ns;Se.Realtime=Cs;Se.Conversations=ic;Se.Evals=sc;Se.Containers=rc;Se.Skills=Ps;Se.Videos=Yd;function wG(e){return!!(String(e).includes("context_length_exceeded")||"message"in e&&typeof e.message=="string"&&(e.message.includes("Input tokens exceed the configured limit")||e.message.includes("exceeds the context window")||e.message.includes("maximum context length")))}function Nh(e){if(!e||typeof e!="object")return e;let t;return e.constructor.name===Is.name&&"message"in e&&typeof e.message=="string"?(t=new Error(e.message),t.name="TimeoutError"):e.constructor.name===Kt.name&&"message"in e&&typeof e.message=="string"?(t=new Error(e.message),t.name="AbortError"):wG(e)?t=Zk.fromError(e):"status"in e&&e.status===400&&"message"in e&&typeof e.message=="string"&&e.message.includes("tool_calls")?t=Cl(e,"INVALID_TOOL_RESULTS"):"status"in e&&e.status===401?t=Cl(e,"MODEL_AUTHENTICATION"):"status"in e&&e.status===429?t=Cl(e,"MODEL_RATE_LIMIT"):"status"in e&&e.status===404?t=Cl(e,"MODEL_NOT_FOUND"):t=e,t}var Ur=e=>e();function el(e){return e?!!(/^o\d/.test(e??"")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat")):!1}function $G(e){return e.role!=="system"&&e.role!=="developer"&&e.role!=="assistant"&&e.role!=="user"&&e.role!=="function"&&e.role!=="tool"&&console.warn(`Unknown message role: ${e.role}`),e.role}function hk(e){return e.metadata?.filename??e.metadata?.name??e.metadata?.title}function ef(e){let t=e.metadata?.filename??e.metadata?.name??e.metadata?.title;if(!t)throw new Error("a filename or name or title is needed via meta-data for OpenAI when working with multimodal blocks");return t}function tl(e){let t=e._getType();switch(t){case"system":return"system";case"ai":return"assistant";case"human":return"user";case"function":return"function";case"tool":return"tool";case"generic":if(!Hr.isInstance(e))throw new Error("Invalid generic chat message");return $G(e);default:throw new Error(`Unknown message type: ${t}`)}}function SG(e){return!!(e.includes("gpt-5.2-pro")||e.includes("gpt-5.4-pro")||e.includes("codex"))}function fR(e){let{azureOpenAIApiDeploymentName:t,azureOpenAIApiInstanceName:n,azureOpenAIApiKey:r,azureOpenAIBasePath:i,baseURL:a,azureADTokenProvider:s,azureOpenAIEndpoint:o}=e;if((r||s)&&i&&t)return`${i}/${t}`;if((r||s)&&o&&t)return`${o}/openai/deployments/${t}`;if(r||s){if(!n)throw new Error("azureOpenAIApiInstanceName is required when using azureOpenAIApiKey");if(!t)throw new Error("azureOpenAIApiDeploymentName is a required parameter when using azureOpenAIApiKey");return`https://${n}.openai.azure.com/openai/deployments/${t}`}return a}function pk(e){return typeof Headers<"u"&&e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Headers]"}function kG(e){let t=Ur(()=>{if(pk(e))return e;if(Array.isArray(e))return new Headers(e);if(typeof e=="object"&&e!==null&&"values"in e&&pk(e.values))return e.values;if(typeof e=="object"&&e!==null){let n=Object.entries(e).filter(([,r])=>typeof r=="string").map(([r,i])=>[r,i]);return new Headers(n)}return new Headers});return Object.fromEntries(t.entries())}function xG(){let e=R_();return(e==="node"||e==="deno")&&(e=`(${e}/${process.version}; ${process.platform}; ${process.arch})`),e}function hR(e,t=!1,n="1.0.0"){let r=kG(e),i=xG(),a=`langchainjs${t?"-azure":""}-openai`;return{...r,"User-Agent":r["User-Agent"]?`${a}/${n} (${i})${r["User-Agent"]}`:`${a}/${n} (${i})`}}function IG(e,t){let n;return Bc(e)?n=ON(e):n=e,t?.strict!==void 0&&(n.function.strict=t.strict),n}function EG(e){return e.anyOf!==void 0&&Array.isArray(e.anyOf)}function TG(e){let t=["namespace functions {",""];for(let n of e)n.description&&t.push(`// ${n.description}`),Object.keys(n.parameters.properties??{}).length>0?(t.push(`type ${n.name} = (_: {`),t.push(pR(n.parameters,0)),t.push("}) => any;")):t.push(`type ${n.name} = () => any;`),t.push("");return t.push("} // namespace functions"),t.join(`
797
- `)}function pR(e,t){let n=[];for(let[r,i]of Object.entries(e.properties??{}))i.description&&t<2&&n.push(`// ${i.description}`),e.required?.includes(r)?n.push(`${r}: ${tf(i,t)},`):n.push(`${r}?: ${tf(i,t)},`);return n.map(r=>" ".repeat(t)+r).join(`
798
- `)}function tf(e,t){if(EG(e))return e.anyOf.map(n=>tf(n,t)).join(" | ");switch(e.type){case"string":return e.enum?e.enum.map(n=>`"${n}"`).join(" | "):"string";case"number":return e.enum?e.enum.map(n=>`${n}`).join(" | "):"number";case"integer":return e.enum?e.enum.map(n=>`${n}`).join(" | "):"number";case"boolean":return"boolean";case"null":return"null";case"object":return["{",pR(e,t+2),"}"].join(`
799
- `);case"array":return e.items?`${tf(e.items,t)}[]`:"any[]";default:return""}}function mR(e){if(e)return e==="any"||e==="required"?"required":e==="auto"?"auto":e==="none"?"none":typeof e=="string"?{type:"function",function:{name:e}}:e}function Qb(e){return"type"in e&&e.type!=="function"}function OG(e){return typeof e=="object"&&e!==null&&"extras"in e&&typeof e.extras=="object"&&e.extras!==null&&"providerToolDefinition"in e.extras&&typeof e.extras.providerToolDefinition=="object"&&e.extras.providerToolDefinition!==null}function AG(e){return e!=null&&typeof e=="object"&&"type"in e&&e.type!=="function"}function nf(e){return typeof e=="object"&&e!==null&&"metadata"in e&&typeof e.metadata=="object"&&e.metadata!==null&&"customTool"in e.metadata&&typeof e.metadata.customTool=="object"&&e.metadata.customTool!==null}function gR(e){return"type"in e&&e.type==="custom"&&"custom"in e&&typeof e.custom=="object"&&e.custom!==null}function CG(e){if(e.type==="custom_tool_call")return{...e,type:"tool_call",call_id:e.id,id:e.call_id,name:e.name,isCustomTool:!0,args:{input:e.input}}}function NG(e){if(e.type==="computer_call")return{...e,type:"tool_call",call_id:e.id,id:e.call_id,name:"computer_use",isComputerTool:!0,args:{action:e.action}}}function PG(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="tool_call"&&"isComputerTool"in e&&e.isComputerTool===!0}function RG(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="tool_call"&&"isCustomTool"in e&&e.isCustomTool===!0}function jG(e){let t=()=>{if(e.custom.format){if(e.custom.format.type==="grammar")return{type:"grammar",definition:e.custom.format.grammar.definition,syntax:e.custom.format.grammar.syntax};if(e.custom.format.type==="text")return{type:"text"}}};return{type:"custom",name:e.custom.name,description:e.custom.description,format:t()}}function MG(e){let t=()=>{if(e.format){if(e.format.type==="grammar")return{type:"grammar",grammar:{definition:e.format.definition,syntax:e.format.syntax}};if(e.format.type==="text")return{type:"text"}}};return{type:"custom",custom:{name:e.name,description:e.description,format:t()}}}var DG=Symbol("Let zodToJsonSchema decide on which parser to use"),mk={name:void 0,$refStrategy:"root",effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",nullableStrategy:"from-target",removeAdditionalStrategy:"passthrough",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},UG=e=>typeof e=="string"?{...mk,basePath:["#"],definitions:{},name:e}:{...mk,basePath:["#"],definitions:{},...e},x_=e=>"_def"in e?e._def:e;function LG(e){if(!e)return!0;for(let t in e)return!1;return!0}var zG=e=>{let t=UG(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seenRefs:new Set,seen:new Map(Object.entries(t.definitions).map(([r,i])=>[x_(i),{def:x_(i),path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}};function _R(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function Ge(e,t,n,r,i){e[t]=n,_R(e,t,r,i)}function FG(){return{}}function BG(e,t){let n={type:"array"};return e.type?._def?.typeName!==A.ZodAny&&(n.items=Fe(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&Ge(n,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&Ge(n,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(Ge(n,"minItems",e.exactLength.value,e.exactLength.message,t),Ge(n,"maxItems",e.exactLength.value,e.exactLength.message,t)),n}function ZG(e,t){let n={type:"integer",format:"int64"};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case"min":t.target==="jsonSchema7"?r.inclusive?Ge(n,"minimum",r.value,r.message,t):Ge(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),Ge(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?Ge(n,"maximum",r.value,r.message,t):Ge(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),Ge(n,"maximum",r.value,r.message,t));break;case"multipleOf":Ge(n,"multipleOf",r.value,r.message,t);break}return n}function VG(){return{type:"boolean"}}function qG(e,t){return Fe(e.type._def,t)}var GG=(e,t)=>Fe(e.innerType._def,t);function yR(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,a)=>yR(e,t,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return HG(e,t)}}var HG=(e,t)=>{let n={type:"integer",format:"unix-time"};if(t.target==="openApi3")return n;for(let r of e.checks)switch(r.kind){case"min":Ge(n,"minimum",r.value,r.message,t);break;case"max":Ge(n,"maximum",r.value,r.message,t);break}return n};function JG(e,t){return{...Fe(e.innerType._def,t),default:e.defaultValue()}}function WG(e,t,n){return t.effectStrategy==="input"?Fe(e.schema._def,t,n):{}}function KG(e){return{type:"string",enum:[...e.values]}}var XG=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function YG(e,t){let n=[Fe(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Fe(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(a=>!!a),r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return n.forEach(a=>{if(XG(a))i.push(...a.allOf),a.unevaluatedProperties===void 0&&(r=void 0);else{let s=a;if("additionalProperties"in a&&a.additionalProperties===!1){let{additionalProperties:o,...c}=a;s=c}else r=void 0;i.push(s)}}),i.length?{allOf:i,...r}:void 0}function QG(e,t){let n=typeof e.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[e.value]}:{type:n==="bigint"?"integer":n,const:e.value}}var Tm,Ri={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Tm===void 0&&(Tm=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Tm),base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/};function vR(e,t){let n={type:"string"};function r(i){return t.patternStrategy==="escape"?eH(i):i}if(e.checks)for(let i of e.checks)switch(i.kind){case"min":Ge(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t);break;case"max":Ge(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Un(n,"email",i.message,t);break;case"format:idn-email":Un(n,"idn-email",i.message,t);break;case"pattern:zod":Ln(n,Ri.email,i.message,t);break}break;case"url":Un(n,"uri",i.message,t);break;case"uuid":Un(n,"uuid",i.message,t);break;case"regex":Ln(n,i.regex,i.message,t);break;case"cuid":Ln(n,Ri.cuid,i.message,t);break;case"cuid2":Ln(n,Ri.cuid2,i.message,t);break;case"startsWith":Ln(n,RegExp(`^${r(i.value)}`),i.message,t);break;case"endsWith":Ln(n,RegExp(`${r(i.value)}$`),i.message,t);break;case"datetime":Un(n,"date-time",i.message,t);break;case"date":Un(n,"date",i.message,t);break;case"time":Un(n,"time",i.message,t);break;case"duration":Un(n,"duration",i.message,t);break;case"length":Ge(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,i.value):i.value,i.message,t),Ge(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,i.value):i.value,i.message,t);break;case"includes":{Ln(n,RegExp(r(i.value)),i.message,t);break}case"ip":{i.version!=="v6"&&Un(n,"ipv4",i.message,t),i.version!=="v4"&&Un(n,"ipv6",i.message,t);break}case"emoji":Ln(n,Ri.emoji,i.message,t);break;case"ulid":{Ln(n,Ri.ulid,i.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Un(n,"binary",i.message,t);break}case"contentEncoding:base64":{Ge(n,"contentEncoding","base64",i.message,t);break}case"pattern:zod":{Ln(n,Ri.base64,i.message,t);break}}break}case"nanoid":Ln(n,Ri.nanoid,i.message,t)}return n}var eH=e=>Array.from(e).map(t=>/[a-zA-Z0-9]/.test(t)?t:`\\${t}`).join(""),Un=(e,t,n,r)=>{e.format||e.anyOf?.some(i=>i.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):Ge(e,"format",t,n,r)},Ln=(e,t,n,r)=>{e.pattern||e.allOf?.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:gk(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):Ge(e,"pattern",gk(t,r),n,r)},gk=(e,t)=>{let n=typeof e=="function"?e():e;if(!t.applyRegexFlags||!n.flags)return n.source;let r={i:n.flags.includes("i"),m:n.flags.includes("m"),s:n.flags.includes("s")},i=r.i?n.source.toLowerCase():n.source,a="",s=!1,o=!1,c=!1;for(let l=0;l<i.length;l++){if(s){a+=i[l],s=!1;continue}if(r.i){if(o){if(i[l].match(/[a-z]/)){c?(a+=i[l],a+=`${i[l-2]}-${i[l]}`.toUpperCase(),c=!1):i[l+1]==="-"&&i[l+2]?.match(/[a-z]/)?(a+=i[l],c=!0):a+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){a+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){a+=`(^|(?<=[\r
800
- ]))`;continue}else if(i[l]==="$"){a+=`($|(?=[\r
801
- ]))`;continue}}if(r.s&&i[l]==="."){a+=o?`${i[l]}\r
802
- `:`[${i[l]}\r
803
- ]`;continue}a+=i[l],i[l]==="\\"?s=!0:o&&i[l]==="]"?o=!1:!o&&i[l]==="["&&(o=!0)}try{let l=new RegExp(a)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),n.source}return a};function bR(e,t){if(t.target==="openApi3"&&e.keyType?._def.typeName===A.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,i)=>({...r,[i]:Fe(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",i]})??{}}),{}),additionalProperties:!1};let n={type:"object",additionalProperties:Fe(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??{}};if(t.target==="openApi3")return n;if(e.keyType?._def.typeName===A.ZodString&&e.keyType._def.checks?.length){let r=Object.entries(vR(e.keyType._def,t)).reduce((i,[a,s])=>a==="type"?i:{...i,[a]:s},{});return{...n,propertyNames:r}}else if(e.keyType?._def.typeName===A.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};return n}function tH(e,t){if(t.mapStrategy==="record")return bR(e,t);let n=Fe(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},r=Fe(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function nH(e){let t=e.values,r=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),i=Array.from(new Set(r.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function rH(){return{not:{}}}function iH(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var rf={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function aH(e,t){if(t.target==="openApi3")return _k(e,t);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in rf&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((i,a)=>{let s=rf[a._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=n.reduce((i,a)=>{let s=typeof a._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(r.length===n.length){let i=r.filter((a,s,o)=>o.indexOf(a)===s);return{type:i.length>1?i:i[0],enum:n.reduce((a,s)=>a.includes(s._def.value)?a:[...a,s._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(a=>!r.includes(a))],[])};return _k(e,t)}var _k=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>Fe(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function sH(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"||t.nullableStrategy==="property"?{type:rf[e.innerType._def.typeName],nullable:!0}:{type:[rf[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let r=Fe(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:!0}:r&&{...r,nullable:!0}}let n=Fe(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function oH(e,t){let n={type:"number"};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case"int":n.type="integer",_R(n,"type",r.message,t);break;case"min":t.target==="jsonSchema7"?r.inclusive?Ge(n,"minimum",r.value,r.message,t):Ge(n,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),Ge(n,"minimum",r.value,r.message,t));break;case"max":t.target==="jsonSchema7"?r.inclusive?Ge(n,"maximum",r.value,r.message,t):Ge(n,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),Ge(n,"maximum",r.value,r.message,t));break;case"multipleOf":Ge(n,"multipleOf",r.value,r.message,t);break}return n}function cH(e,t){return t.removeAdditionalStrategy==="strict"?e.catchall._def.typeName==="ZodNever"?e.unknownKeys!=="strict":Fe(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0:e.catchall._def.typeName==="ZodNever"?e.unknownKeys==="passthrough":Fe(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0}function lH(e,t){let n={type:"object",...Object.entries(e.shape()).reduce((r,[i,a])=>{if(a===void 0||a._def===void 0)return r;let s=[...t.currentPath,"properties",i],o=Fe(a._def,{...t,currentPath:s,propertyPath:s});if(o===void 0)return r;if(t.openaiStrictMode&&a.isOptional()&&!a.isNullable()&&typeof a._def?.defaultValue>"u")throw new Error(`Zod field at \`${s.join("/")}\` uses \`.optional()\` without \`.nullable()\` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required`);return{properties:{...r.properties,[i]:o},required:a.isOptional()&&!t.openaiStrictMode?r.required:[...r.required,i]}},{properties:{},required:[]}),additionalProperties:cH(e,t)};return n.required.length||delete n.required,n}var uH=(e,t)=>{if(t.propertyPath&&t.currentPath.slice(0,t.propertyPath.length).toString()===t.propertyPath.toString())return Fe(e.innerType._def,{...t,currentPath:t.currentPath});let n=Fe(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:{}},n]}:{}},dH=(e,t)=>{if(t.pipeStrategy==="input")return Fe(e.in._def,t);if(t.pipeStrategy==="output")return Fe(e.out._def,t);let n=Fe(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Fe(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function fH(e,t){return Fe(e.type._def,t)}function hH(e,t){let r={type:"array",uniqueItems:!0,items:Fe(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&Ge(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&Ge(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function pH(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Fe(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Fe(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Fe(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function mH(){return{not:{}}}function gH(){return{}}var _H=(e,t)=>Fe(e.innerType._def,t);function Fe(e,t,n=!1){let r=t.seen.get(e);if(t.override){let s=t.override?.(e,t,r,n);if(s!==DG)return s}if(r&&!n){let s=yH(r,t);if(s!==void 0)return"$ref"in s&&t.seenRefs.add(s.$ref),s}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=bH(e,e.typeName,t,n);return a&&wH(e,t,a),i.jsonSchema=a,a}var yH=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"extract-to-root":let n=e.path.slice(t.basePath.length+1).join("_");return n!==t.name&&t.nameStrategy==="duplicate-ref"&&(t.definitions[n]=e.def),{$ref:[...t.basePath,t.definitionPath,n].join("/")};case"relative":return{$ref:vH(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,i)=>t.currentPath[i]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},vH=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},bH=(e,t,n,r)=>{switch(t){case A.ZodString:return vR(e,n);case A.ZodNumber:return oH(e,n);case A.ZodObject:return lH(e,n);case A.ZodBigInt:return ZG(e,n);case A.ZodBoolean:return VG();case A.ZodDate:return yR(e,n);case A.ZodUndefined:return mH();case A.ZodNull:return iH(n);case A.ZodArray:return BG(e,n);case A.ZodUnion:case A.ZodDiscriminatedUnion:return aH(e,n);case A.ZodIntersection:return YG(e,n);case A.ZodTuple:return pH(e,n);case A.ZodRecord:return bR(e,n);case A.ZodLiteral:return QG(e,n);case A.ZodEnum:return KG(e);case A.ZodNativeEnum:return nH(e);case A.ZodNullable:return sH(e,n);case A.ZodOptional:return uH(e,n);case A.ZodMap:return tH(e,n);case A.ZodSet:return hH(e,n);case A.ZodLazy:return Fe(e.getter()._def,n);case A.ZodPromise:return fH(e,n);case A.ZodNaN:case A.ZodNever:return rH();case A.ZodEffects:return WG(e,n,r);case A.ZodAny:return FG();case A.ZodUnknown:return gH();case A.ZodDefault:return JG(e,n);case A.ZodBranded:return qG(e,n);case A.ZodReadonly:return _H(e,n);case A.ZodCatch:return GG(e,n);case A.ZodPipeline:return dH(e,n);case A.ZodFunction:case A.ZodVoid:case A.ZodSymbol:return;default:return(i=>{})()}},wH=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),$H=(e,t)=>{let n=zG(t),r=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=Fe(e._def,r===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,r]},!1)??{},a=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;a!==void 0&&(i.title=a);let s=(()=>{if(LG(n.definitions))return;let c={},l=new Set;for(let u=0;u<500;u++){let d=Object.entries(n.definitions).filter(([f])=>!l.has(f));if(d.length===0)break;for(let[f,h]of d)c[f]=Fe(x_(h),{...n,currentPath:[...n.basePath,n.definitionPath,f]},!0)??{},l.add(f)}return c})(),o=r===void 0?s?{...i,[n.definitionPath]:s}:i:n.nameStrategy==="duplicate-ref"?{...i,...s||n.seenRefs.size?{[n.definitionPath]:{...s,...n.seenRefs.size?{[r]:i}:void 0}}:void 0}:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,r].join("/"),[n.definitionPath]:{...s,[r]:i}};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":n.target==="jsonSchema2019-09"&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),o};function SH(e){if(e.type!=="object")throw new Error(`Root schema must have type: 'object' but got type: ${e.type?`'${e.type}'`:"undefined"}`);let t=structuredClone(e);return Or(t,[],t)}function I_(e){if(typeof e=="boolean")return!1;if(e.type==="null")return!0;for(let t of e.oneOf??[])if(I_(t))return!0;for(let t of e.anyOf??[])if(I_(t))return!0;return!1}function Or(e,t,n){if(typeof e=="boolean")throw new TypeError(`Expected object schema but got boolean; path=${t.join("/")}`);if(!Li(e))throw new TypeError(`Expected ${JSON.stringify(e)} to be an object; path=${t.join("/")}`);let r=e.$defs;if(Li(r))for(let[f,h]of Object.entries(r))Or(h,[...t,"$defs",f],n);let i=e.definitions;if(Li(i))for(let[f,h]of Object.entries(i))Or(h,[...t,"definitions",f],n);e.type==="object"&&!("additionalProperties"in e)&&(e.additionalProperties=!1);let s=e.required??[],o=e.properties;if(Li(o)){for(let[f,h]of Object.entries(o))if(!I_(h)&&!s.includes(f))throw new Error(`Zod field at \`${[...t,"properties",f].join("/")}\` uses \`.optional()\` without \`.nullable()\` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required`);e.required=Object.keys(o),e.properties=Object.fromEntries(Object.entries(o).map(([f,h])=>[f,Or(h,[...t,"properties",f],n)]))}let c=e.items;Li(c)&&(e.items=Or(c,[...t,"items"],n));let l=e.anyOf;Array.isArray(l)&&(e.anyOf=l.map((f,h)=>Or(f,[...t,"anyOf",String(h)],n)));let u=e.allOf;if(Array.isArray(u))if(u.length===1){let f=Or(u[0],[...t,"allOf","0"],n);Object.assign(e,f),delete e.allOf}else e.allOf=u.map((f,h)=>Or(f,[...t,"allOf",String(h)],n));e.default===null&&delete e.default;let d=e.$ref;if(d&&xH(e,1)){if(typeof d!="string")throw new TypeError(`Received non-string $ref - ${d}; path=${t.join("/")}`);let f=kH(n,d);if(typeof f=="boolean")throw new Error(`Expected \`$ref: ${d}\` to resolve to an object schema but got boolean`);if(!Li(f))throw new Error(`Expected \`$ref: ${d}\` to resolve to an object but got ${JSON.stringify(f)}`);return Object.assign(e,{...f,...e}),delete e.$ref,Or(e,t,n)}return e}function kH(e,t){if(!t.startsWith("#/"))throw new Error(`Unexpected $ref format ${JSON.stringify(t)}; Does not start with #/`);let n=t.slice(2).split("/"),r=e;for(let i of n){if(!Li(r))throw new Error(`encountered non-object entry while resolving ${t} - ${JSON.stringify(r)}`);let a=r[i];if(a===void 0)throw new Error(`Key ${i} not found while resolving ${t}`);r=a}return r}function Li(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xH(e,t){let n=0;for(let r in e)if(n++,n>t)return!0;return!1}function IH(e,t){return $H(e,{openaiStrictMode:!0,name:t.name,nameStrategy:"duplicate-ref",$refStrategy:"extract-to-root",nullableStrategy:"property"})}function EH(e){return SH(Lo(e,{target:"draft-7"}))}function TH(e){return"_zod"in e}function OH(e,t,n){return Qq({type:"json_schema",json_schema:{...n,name:t,strict:!0,schema:TH(e)?EH(e):IH(e,{name:t})}},r=>e.parse(JSON.parse(r)))}var yk=["jsonSchema","functionCalling","jsonMode"];function AH(e,t){if(typeof t<"u"&&!yk.includes(t))throw new Error(`Invalid method: ${t}. Supported methods are: ${yk.join(", ")}`);let n=!e.startsWith("gpt-3")&&!e.startsWith("gpt-4-")&&e!=="gpt-4";if(n&&!t)return"jsonSchema";if(!n&&t==="jsonSchema")throw new Error(`JSON Schema is not supported for model "${e}". Please use a different method, e.g. "functionCalling" or "jsonMode".`);return t??"functionCalling"}function CH(e,t){let n={...e};return Object.defineProperties(n,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:t,enumerable:!1}}),n}function NH(e,t,n){if(_t(e))return OH(e,t,n);if(it(e))return CH({type:"json_schema",json_schema:{...n,name:t,strict:!0,schema:Et(e,{cycles:"ref",reused:"ref",override(r){r.jsonSchema.title=t}})}},r=>oa(e,JSON.parse(r)));throw new Error("Unsupported schema response format")}function PH(e,t){if(t&&typeof t=="object"&&"images"in t&&Array.isArray(t.images)){let n=t.images.filter(r=>typeof r?.image_url?.url=="string").map(r=>({type:"image",url:r.image_url.url}));return[{type:"text",text:e},...n]}return e}var RH={"gpt-4o-2024-11-20":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:16384,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.3-codex":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5-codex":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5-pro":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:272e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4o-mini":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:16384,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"text-embedding-ada-002":{maxInputTokens:8192,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1536,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5-chat-latest":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"codex-mini-latest":{maxInputTokens:2e5,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.1-codex-max":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4o-2024-05-13":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:4096,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.2-chat-latest":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:16384,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.2-codex":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o3-deep-research":{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},o1:{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.1":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o4-mini-deep-research":{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.3-codex-spark":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:32e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},o3:{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"text-embedding-3-small":{maxInputTokens:8191,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1536,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4.1-nano":{maxInputTokens:1047576,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:32768,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"text-embedding-3-large":{maxInputTokens:8191,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:3072,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-3.5-turbo":{maxInputTokens:16385,imageInputs:!1,audioInputs:!1,pdfInputs:!1,videoInputs:!1,maxOutputTokens:4096,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!1,imageUrlInputs:!1,pdfToolMessage:!1,imageToolMessage:!1,toolChoice:!0},"gpt-5.1-codex-mini":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.2":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4.1":{maxInputTokens:1047576,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:32768,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o3-pro":{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4-turbo":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:4096,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o4-mini":{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4.1-mini":{maxInputTokens:1047576,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:32768,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.4":{maxInputTokens:105e4,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o1-preview":{maxInputTokens:128e3,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:32768,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.4-pro":{maxInputTokens:105e4,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o1-pro":{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.1-codex":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.2-pro":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o3-mini":{maxInputTokens:2e5,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4o-2024-08-06":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:16384,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5-mini":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.1-chat-latest":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:16384,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4":{maxInputTokens:8192,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:8192,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5-nano":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o1-mini":{maxInputTokens:128e3,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4o":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:16384,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0}};function ew(e,t){return typeof e=="string"?{model:e,...t??{}}:e??t}var tw=class extends va{temperature;topP;frequencyPenalty;presencePenalty;n;logitBias;model="gpt-3.5-turbo";modelKwargs;stop;stopSequences;user;timeout;streaming=!1;streamUsage=!0;maxTokens;logprobs;topLogprobs;apiKey;organization;__includeRawResponse;client;clientConfig;supportsStrictToolCalling;audio;modalities;reasoning;zdrEnabled;service_tier;promptCacheKey;promptCacheRetention;verbosity;defaultOptions;_llmType(){return"openai"}static lc_name(){return"ChatOpenAI"}get callKeys(){return[...super.callKeys,"options","function_call","functions","tools","tool_choice","promptIndex","response_format","seed","reasoning","reasoning_effort","service_tier"]}lc_serializable=!0;get lc_secrets(){return{apiKey:"OPENAI_API_KEY",organization:"OPENAI_ORGANIZATION"}}get lc_aliases(){return{apiKey:"openai_api_key",modelName:"model"}}get lc_serializable_keys(){return["configuration","logprobs","topLogprobs","prefixMessages","supportsStrictToolCalling","modalities","audio","temperature","maxTokens","topP","frequencyPenalty","presencePenalty","n","logitBias","user","streaming","streamUsage","model","modelName","modelKwargs","stop","stopSequences","timeout","apiKey","cache","maxConcurrency","maxRetries","verbose","callbacks","tags","metadata","disableStreaming","zdrEnabled","reasoning","promptCacheKey","promptCacheRetention","verbosity"]}getLsParams(e){let t=this.invocationParams(e);return{ls_provider:"openai",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:t.temperature??void 0,ls_max_tokens:t.max_tokens??void 0,ls_stop:e.stop}}_identifyingParams(){return{model_name:this.model,...this.invocationParams(),...this.clientConfig}}identifyingParams(){return this._identifyingParams()}constructor(e){super(e??{});let t=typeof e?.configuration?.apiKey=="string"||typeof e?.configuration?.apiKey=="function"?e?.configuration?.apiKey:void 0;this.apiKey=e?.apiKey??t??wn("OPENAI_API_KEY"),this.organization=e?.configuration?.organization??wn("OPENAI_ORGANIZATION"),this.model=e?.model??e?.modelName??this.model,this.modelKwargs=e?.modelKwargs??{},this.timeout=e?.timeout,this.temperature=e?.temperature??this.temperature,this.topP=e?.topP??this.topP,this.frequencyPenalty=e?.frequencyPenalty??this.frequencyPenalty,this.presencePenalty=e?.presencePenalty??this.presencePenalty,this.logprobs=e?.logprobs,this.topLogprobs=e?.topLogprobs,this.n=e?.n??this.n,this.logitBias=e?.logitBias,this.stop=e?.stopSequences??e?.stop,this.stopSequences=this.stop,this.user=e?.user,this.__includeRawResponse=e?.__includeRawResponse,this.audio=e?.audio,this.modalities=e?.modalities,this.reasoning=e?.reasoning,this.maxTokens=e?.maxCompletionTokens??e?.maxTokens,this.promptCacheKey=e?.promptCacheKey??this.promptCacheKey,this.promptCacheRetention=e?.promptCacheRetention??this.promptCacheRetention,this.verbosity=e?.verbosity??this.verbosity,this.disableStreaming=e?.disableStreaming===!0,this.streaming=e?.streaming===!0,this.disableStreaming&&(this.streaming=!1),e?.streaming===!1&&(this.disableStreaming=!0),this.streamUsage=e?.streamUsage??this.streamUsage,this.disableStreaming&&(this.streamUsage=!1),this.clientConfig={apiKey:this.apiKey,organization:this.organization,dangerouslyAllowBrowser:!0,...e?.configuration},e?.supportsStrictToolCalling!==void 0&&(this.supportsStrictToolCalling=e.supportsStrictToolCalling),e?.service_tier!==void 0&&(this.service_tier=e.service_tier),this.zdrEnabled=e?.zdrEnabled??!1,this._addVersion("@langchain/openai","1.4.1")}_getReasoningParams(e){if(!el(this.model))return;let t;return this.reasoning!==void 0&&(t={...t,...this.reasoning}),e?.reasoning!==void 0&&(t={...t,...e.reasoning}),e?.reasoningEffort!==void 0&&t?.effort===void 0&&(t={...t,effort:e.reasoningEffort}),t}_getResponseFormat(e){return e&&e.type==="json_schema"&&e.json_schema.schema&&bn(e.json_schema.schema)?NH(e.json_schema.schema,e.json_schema.name,{description:e.json_schema.description}):e}_combineCallOptions(e){return{...this.defaultOptions,...e??{}}}_getClientOptions(e){if(!this.client){let t=fR({baseURL:this.clientConfig.baseURL}),n={...this.clientConfig,baseURL:t,timeout:this.timeout,maxRetries:0};n.baseURL||delete n.baseURL,n.defaultHeaders=hR(n.defaultHeaders),this.client=new Se(n)}return{...this.clientConfig,...e}}_convertChatOpenAIToolToCompletionsTool(e,t){return nf(e)?MG(e.metadata.customTool):Iv(e)?t?.strict!==void 0?{...e,function:{...e.function,strict:t.strict}}:e:IG(e,t)}bindTools(e,t){let n;return t?.strict!==void 0?n=t.strict:this.supportsStrictToolCalling!==void 0&&(n=this.supportsStrictToolCalling),this.withConfig({tools:e.map(r=>{if(Qb(r)||nf(r))return r;if(OG(r))return r.extras.providerToolDefinition;let i=this._convertChatOpenAIToolToCompletionsTool(r,{strict:n});return Bc(r)&&r.extras?.defer_loading===!0?{...i,defer_loading:!0}:i}),...t})}async stream(e,t){return super.stream(e,this._combineCallOptions(t))}async invoke(e,t){return super.invoke(e,this._combineCallOptions(t))}_combineLLMOutput(...e){return e.reduce((t,n)=>(n&&n.tokenUsage&&(t.tokenUsage.completionTokens+=n.tokenUsage.completionTokens??0,t.tokenUsage.promptTokens+=n.tokenUsage.promptTokens??0,t.tokenUsage.totalTokens+=n.tokenUsage.totalTokens??0),t),{tokenUsage:{completionTokens:0,promptTokens:0,totalTokens:0}})}async getNumTokensFromMessages(e){let t=0,n=0,r=0;this.model==="gpt-3.5-turbo-0301"?(n=4,r=-1):(n=3,r=1);let i=await Promise.all(e.map(async a=>{let[s,o]=await Promise.all([this.getNumTokens(a.content),this.getNumTokens(tl(a))]),c=a.name!==void 0?r+await this.getNumTokens(a.name):0,l=s+n+o+c,u=a;if(u._getType()==="function"&&(l-=2),u.additional_kwargs?.function_call&&(l+=3),u?.additional_kwargs.function_call?.name&&(l+=await this.getNumTokens(u.additional_kwargs.function_call?.name)),u.additional_kwargs.function_call?.arguments)try{l+=await this.getNumTokens(JSON.stringify(JSON.parse(u.additional_kwargs.function_call?.arguments)))}catch(d){console.error("Error parsing function arguments",d,JSON.stringify(u.additional_kwargs.function_call)),l+=await this.getNumTokens(u.additional_kwargs.function_call?.arguments)}return t+=l,l}));return t+=3,{totalCount:t,countPerMessage:i}}async _getNumTokensFromGenerations(e){return(await Promise.all(e.map(async t=>t.message.additional_kwargs?.function_call?(await this.getNumTokensFromMessages([t.message])).countPerMessage[0]:await this.getNumTokens(t.message.content)))).reduce((t,n)=>t+n,0)}async _getEstimatedTokenCountFromPrompt(e,t,n){let r=(await this.getNumTokensFromMessages(e)).totalCount;if(t&&n!=="auto"){let i=TG(t);r+=await this.getNumTokens(i),r+=9}return t&&e.find(i=>i._getType()==="system")&&(r-=4),n==="none"?r+=1:typeof n=="object"&&(r+=await this.getNumTokens(n.name)+4),r}async moderateContent(e,t){let n=this._getClientOptions(t?.options),r={input:e,model:t?.model??"omni-moderation-latest"};return this.caller.call(async()=>{try{return await this.client.moderations.create(r,n)}catch(i){throw Nh(i)}})}get profile(){return RH[this.model]??{}}_getStructuredOutputMethod(e){let t={...e};if(!this.model.startsWith("gpt-3")&&!this.model.startsWith("gpt-4-")&&this.model!=="gpt-4"){if(t?.method===void 0)return"jsonSchema"}else t.method==="jsonSchema"&&console.warn(`[WARNING]: JSON Schema is not supported for model "${this.model}". Falling back to tool calling.`);return t.method}withStructuredOutput(e,t){let n,r,{schema:i,name:a,includeRaw:s}={...t,schema:e};if(t?.strict!==void 0&&t.method==="jsonMode")throw new Error("Argument `strict` is only supported for `method` = 'function_calling'");let o=AH(this.model,t?.method);if(o==="jsonMode"){r=Lg(i);let c=Et(i);n=this.withConfig({outputVersion:"v0",response_format:{type:"json_object"},ls_structured_output_format:{kwargs:{method:"json_mode"},schema:{title:a??"extract",...c}}})}else if(o==="jsonSchema"){let c=Et(i),l={name:a??"extract",description:gs(c),schema:bn(i)?i:c,strict:t?.strict};if(n=this.withConfig({outputVersion:"v0",response_format:{type:"json_schema",json_schema:l},ls_structured_output_format:{kwargs:{method:"json_schema"},schema:{title:l.name,description:l.description,...c}}}),bn(i)||aa(i)){let u=Lg(i);r=Qn.from(async d=>"parsed"in d.additional_kwargs?d.additional_kwargs.parsed:u.invoke(d.content))}else r=new Ov}else{let c=a??"extract",l=Et(i),u;bn(i)||aa(i)?u={name:c,description:l.description,parameters:l}:typeof i.name=="string"&&typeof i.parameters=="object"&&i.parameters!=null?(u=i,c=i.name):(c=i.title??c,u={name:c,description:i.description??"",parameters:i}),n=this.withConfig({outputVersion:"v0",tools:[{type:"function",function:u}],tool_choice:{type:"function",function:{name:c}},ls_structured_output_format:{kwargs:{method:"function_calling"},schema:{title:c,...l}},...t?.strict!==void 0?{strict:t.strict}:{}}),r=fA(i,c)}return Cv(n,r,s)}},wR={providerName:"ChatOpenAI",fromStandardTextBlock(e){return{type:"text",text:e.text}},fromStandardImageBlock(e){if(e.source_type==="url")return{type:"image_url",image_url:{url:e.url,...e.metadata?.detail?{detail:e.metadata.detail}:{}}};if(e.source_type==="base64")return{type:"image_url",image_url:{url:`data:${e.mime_type??""};base64,${e.data}`,...e.metadata?.detail?{detail:e.metadata.detail}:{}}};throw new Error(`Image content blocks with source_type ${e.source_type} are not supported for ChatOpenAI`)},fromStandardAudioBlock(e){if(e.source_type==="url"){let t=Ao({dataUrl:e.url});if(!t)throw new Error(`URL audio blocks with source_type ${e.source_type} must be formatted as a data URL for ChatOpenAI`);let n=t.mime_type||e.mime_type||"",r;try{r=Lm(n)}catch{throw new Error(`Audio blocks with source_type ${e.source_type} must have mime type of audio/wav or audio/mp3`)}if(r.type!=="audio"||r.subtype!=="wav"&&r.subtype!=="mp3")throw new Error(`Audio blocks with source_type ${e.source_type} must have mime type of audio/wav or audio/mp3`);return{type:"input_audio",input_audio:{format:r.subtype,data:t.data}}}if(e.source_type==="base64"){let t;try{t=Lm(e.mime_type??"")}catch{throw new Error(`Audio blocks with source_type ${e.source_type} must have mime type of audio/wav or audio/mp3`)}if(t.type!=="audio"||t.subtype!=="wav"&&t.subtype!=="mp3")throw new Error(`Audio blocks with source_type ${e.source_type} must have mime type of audio/wav or audio/mp3`);return{type:"input_audio",input_audio:{format:t.subtype,data:e.data}}}throw new Error(`Audio content blocks with source_type ${e.source_type} are not supported for ChatOpenAI`)},fromStandardFileBlock(e){if(e.source_type==="url"){let t=Ao({dataUrl:e.url}),n=ef(e);if(!t)throw new Error(`URL file blocks with source_type ${e.source_type} must be formatted as a data URL for ChatOpenAI`);return{type:"file",file:{file_data:e.url,...e.metadata?.filename||e.metadata?.name?{filename:n}:{}}}}if(e.source_type==="base64"){let t=ef(e);return{type:"file",file:{file_data:`data:${e.mime_type??""};base64,${e.data}`,...e.metadata?.filename||e.metadata?.name||e.metadata?.title?{filename:t}:{}}}}if(e.source_type==="id")return{type:"file",file:{file_id:e.id}};throw new Error(`File content blocks with source_type ${e.source_type} are not supported for ChatOpenAI`)}},jH=({message:e,rawResponse:t,includeRawResponse:n})=>{let r=e.tool_calls,i=e.reasoning_content;switch(e.role){case"assistant":{let a=[],s=[];for(let l of r??[])try{a.push(Hf(l,{returnId:!0}))}catch(u){s.push(So(l,u.message))}let o={function_call:e.function_call,tool_calls:r};n!==void 0&&(o.__raw_response=t),i!==void 0&&(o.reasoning_content=i);let c={model_provider:"openai",model_name:t.model,...t.system_fingerprint?{usage:{...t.usage},system_fingerprint:t.system_fingerprint}:{}};return e.audio&&(o.audio=e.audio),new Ke({content:PH(e.content||"",t.choices?.[0]?.message),tool_calls:a,invalid_tool_calls:s,additional_kwargs:o,response_metadata:c,id:t.id})}default:return new Hr(e.content||"",e.role??"unknown")}},MH=({delta:e,rawResponse:t,includeRawResponse:n,defaultRole:r})=>{let i=e.role??r,a=e.content??"",s;e.function_call?s={function_call:e.function_call}:e.tool_calls?s={tool_calls:e.tool_calls}:s={},n&&(s.__raw_response=t),e.reasoning_content!==void 0&&(s.reasoning_content=e.reasoning_content),e.audio&&(s.audio={...e.audio,index:t.choices[0].index});let o={model_provider:"openai",usage:{...t.usage}};if(i==="user")return new gc({content:a,response_metadata:o});if(i==="assistant"){let c=[];if(Array.isArray(e.tool_calls))for(let l of e.tool_calls)c.push({name:l.function?.name,args:l.function?.arguments,id:l.id,index:l.index,type:"tool_call_chunk"});return new un({content:a,tool_call_chunks:c,additional_kwargs:s,id:t.id,response_metadata:o})}else return i==="system"?new mi({content:a,response_metadata:o}):i==="developer"?new mi({content:a,response_metadata:o,additional_kwargs:{__openai_role__:"developer"}}):i==="function"?new mc({content:a,additional_kwargs:s,name:e.name,response_metadata:o}):i==="tool"?new hc({content:a,additional_kwargs:s,tool_call_id:e.tool_call_id,response_metadata:o}):new pc({content:a,role:i,response_metadata:o})},DH=e=>{if(e.type==="image"){if(e.url)return{type:"image_url",image_url:{url:e.url}};if(e.data)return{type:"image_url",image_url:{url:`data:${e.mimeType};base64,${e.data}`}}}if(e.type==="audio"&&e.data){let t=sx(()=>{let[,n]=e.mimeType.split("/");return n==="wav"||n==="mp3"?n:"wav"});return{type:"input_audio",input_audio:{data:e.data.toString(),format:t}}}if(e.type==="file"){if(e.data){let t=ef(e);return{type:"file",file:{file_data:`data:${e.mimeType};base64,${e.data}`,filename:t}}}if(e.fileId)return{type:"file",file:{file_id:e.fileId}}}},UH=({message:e,model:t})=>{let n=tl(e);if(n==="system"&&el(t)&&(n="developer"),n==="developer")return{role:"developer",content:e.contentBlocks.filter(i=>i.type==="text")};if(n==="system")return{role:"system",content:e.contentBlocks.filter(i=>i.type==="text")};if(n==="assistant")return{role:"assistant",content:e.contentBlocks.filter(i=>i.type==="text")};if(n==="tool"&&Cn.isInstance(e))return{role:"tool",tool_call_id:e.tool_call_id,content:e.contentBlocks.filter(i=>i.type==="text")};if(n==="function")return{role:"function",name:e.name??"",content:e.contentBlocks.filter(i=>i.type==="text").join("")};function*r(i){for(let a of i){a.type==="text"&&(yield{type:"text",text:a.text});let s=DH(a);s&&(yield s)}}return{role:"user",content:Array.from(r(e.contentBlocks))}},vk=({messages:e,model:t})=>e.flatMap(n=>{if("output_version"in n.response_metadata&&n.response_metadata?.output_version==="v1")return UH({message:n});let r=tl(n);r==="system"&&el(t)&&(r="developer");let i=typeof n.content=="string"?n.content:n.content.flatMap(s=>gr(s)?L_(s,wR):typeof s=="object"&&s!==null&&"type"in s&&s.type==="tool_use"?[]:s),a={role:r,content:i};return n.name!=null&&(a.name=n.name),n.additional_kwargs.function_call!=null&&(a.function_call=n.additional_kwargs.function_call),Ke.isInstance(n)&&n.tool_calls?.length?a.tool_calls=n.tool_calls.map(lA):(n.additional_kwargs.tool_calls!=null&&(a.tool_calls=n.additional_kwargs.tool_calls),Cn.isInstance(n)&&n.tool_call_id!=null&&(a.tool_call_id=n.tool_call_id)),n.additional_kwargs.audio&&typeof n.additional_kwargs.audio=="object"&&"id"in n.additional_kwargs.audio?[a,{role:"assistant",audio:{id:n.additional_kwargs.audio.id}}]:a}),LH=class extends tw{constructor(e,t){super(ew(e,t))}invocationParams(e,t){let n;e?.strict!==void 0?n=e.strict:this.supportsStrictToolCalling!==void 0&&(n=this.supportsStrictToolCalling);let r={};e?.stream_options!==void 0?r={stream_options:e.stream_options}:this.streamUsage&&(this.streaming||t?.streaming)&&(r={stream_options:{include_usage:!0}});let i={model:this.model,temperature:this.temperature,top_p:this.topP,frequency_penalty:this.frequencyPenalty,presence_penalty:this.presencePenalty,logprobs:this.logprobs,top_logprobs:this.topLogprobs,n:this.n,logit_bias:this.logitBias,stop:e?.stop??this.stopSequences,user:this.user,stream:this.streaming,functions:e?.functions,function_call:e?.function_call,tools:e?.tools?.length?e.tools.map(s=>this._convertChatOpenAIToolToCompletionsTool(s,{strict:n})):void 0,tool_choice:mR(e?.tool_choice),response_format:this._getResponseFormat(e?.response_format),seed:e?.seed,...r,parallel_tool_calls:e?.parallel_tool_calls,...this.audio||e?.audio?{audio:this.audio||e?.audio}:{},...this.modalities||e?.modalities?{modalities:this.modalities||e?.modalities}:{},...this.modelKwargs,prompt_cache_key:e?.promptCacheKey??this.promptCacheKey,prompt_cache_retention:e?.promptCacheRetention??this.promptCacheRetention,verbosity:e?.verbosity??this.verbosity};e?.prediction!==void 0&&(i.prediction=e.prediction),this.service_tier!==void 0&&(i.service_tier=this.service_tier),e?.service_tier!==void 0&&(i.service_tier=e.service_tier);let a=this._getReasoningParams(e);return a!==void 0&&a.effort!==void 0&&(i.reasoning_effort=a.effort),el(i.model)?i.max_completion_tokens=this.maxTokens===-1?void 0:this.maxTokens:i.max_tokens=this.maxTokens===-1?void 0:this.maxTokens,i}async _generate(e,t,n){t.signal?.throwIfAborted();let r={},i=this.invocationParams(t),a=vk({messages:e,model:this.model});if(i.stream){let s=this._streamResponseChunks(e,t,n),o={};for await(let h of s){h.message.response_metadata={...h.generationInfo,...h.message.response_metadata};let p=h.generationInfo?.completion??0;o[p]===void 0?o[p]=h:o[p]=o[p].concat(h)}let c=Object.entries(o).sort(([h],[p])=>parseInt(h,10)-parseInt(p,10)).map(([h,p])=>p),{functions:l,function_call:u}=this.invocationParams(t),d=await this._getEstimatedTokenCountFromPrompt(e,l,u),f=await this._getNumTokensFromGenerations(c);return r.input_tokens=d,r.output_tokens=f,r.total_tokens=d+f,{generations:c,llmOutput:{estimatedTokenUsage:{promptTokens:r.input_tokens,completionTokens:r.output_tokens,totalTokens:r.total_tokens}}}}else{let s=await this.completionWithRetry({...i,stream:!1,messages:a},{signal:t?.signal,...t?.options}),{completion_tokens:o,prompt_tokens:c,total_tokens:l,prompt_tokens_details:u,completion_tokens_details:d}=s?.usage??{};o&&(r.output_tokens=(r.output_tokens??0)+o),c&&(r.input_tokens=(r.input_tokens??0)+c),l&&(r.total_tokens=(r.total_tokens??0)+l),(u?.audio_tokens!==null||u?.cached_tokens!==null)&&(r.input_token_details={...u?.audio_tokens!==null&&{audio:u?.audio_tokens},...u?.cached_tokens!==null&&{cache_read:u?.cached_tokens}}),(d?.audio_tokens!==null||d?.reasoning_tokens!==null)&&(r.output_token_details={...d?.audio_tokens!==null&&{audio:d?.audio_tokens},...d?.reasoning_tokens!==null&&{reasoning:d?.reasoning_tokens}});let f=[];for(let h of s?.choices??[]){let p={text:h.message?.content??"",message:this._convertCompletionsMessageToBaseMessage(h.message??{role:"assistant"},s)};p.generationInfo={...h.finish_reason?{finish_reason:h.finish_reason}:{},...h.logprobs?{logprobs:h.logprobs}:{}},hf(p.message)&&(p.message.usage_metadata=r),p.message=new Ke(Object.fromEntries(Object.entries(p.message).filter(([m])=>!m.startsWith("lc_")))),f.push(p)}return{generations:f,llmOutput:{tokenUsage:{promptTokens:r.input_tokens,completionTokens:r.output_tokens,totalTokens:r.total_tokens}}}}}async*_streamResponseChunks(e,t,n){let r=vk({messages:e,model:this.model}),i={...this.invocationParams(t,{streaming:!0}),messages:r,stream:!0},a,s=await this.completionWithRetry(i,t),o;for await(let c of s){if(t.signal?.aborted)return;let l=c?.choices?.[0];if(c.usage&&(o=c.usage),!l)continue;let{delta:u}=l;if(!u)continue;let d=this._convertCompletionsDeltaToBaseMessageChunk(u,c,a);a=u.role??a;let f={prompt:t.promptIndex??0,completion:l.index??0};if(typeof d.content!="string"){console.log("[WARNING]: Received non-string content from OpenAI. This is currently not supported.");continue}let h={...f};l.finish_reason!=null&&(h.finish_reason=l.finish_reason,h.system_fingerprint=c.system_fingerprint,h.model_name=c.model,h.service_tier=c.service_tier),this.logprobs&&(h.logprobs=l.logprobs);let p=new Zr({message:d,text:d.content,generationInfo:h});yield p,await n?.handleLLMNewToken(p.text??"",f,void 0,void 0,void 0,{chunk:p})}if(o){let c={...o.prompt_tokens_details?.audio_tokens!==null&&{audio:o.prompt_tokens_details?.audio_tokens},...o.prompt_tokens_details?.cached_tokens!==null&&{cache_read:o.prompt_tokens_details?.cached_tokens}},l={...o.completion_tokens_details?.audio_tokens!==null&&{audio:o.completion_tokens_details?.audio_tokens},...o.completion_tokens_details?.reasoning_tokens!==null&&{reasoning:o.completion_tokens_details?.reasoning_tokens}},u=new Zr({message:new un({content:"",response_metadata:{usage:{...o}},usage_metadata:{input_tokens:o.prompt_tokens,output_tokens:o.completion_tokens,total_tokens:o.total_tokens,...Object.keys(c).length>0&&{input_token_details:c},...Object.keys(l).length>0&&{output_token_details:l}}}),text:""});yield u,await n?.handleLLMNewToken(u.text??"",{prompt:0,completion:0},void 0,void 0,void 0,{chunk:u})}if(t.signal?.aborted)throw new Error("AbortError")}async completionWithRetry(e,t){let n=this._getClientOptions(t),r=e.response_format&&e.response_format.type==="json_schema";return this.caller.call(async()=>{try{return r&&!e.stream?await this.client.chat.completions.parse(e,n):await this.client.chat.completions.create(e,n)}catch(i){throw Nh(i)}})}_convertCompletionsDeltaToBaseMessageChunk(e,t,n){return MH({delta:e,rawResponse:t,includeRawResponse:this.__includeRawResponse,defaultRole:n})}_convertCompletionsMessageToBaseMessage(e,t){return jH({message:e,rawResponse:t,includeRawResponse:this.__includeRawResponse})}},af="__openai_function_call_ids__";function $R(e){return e.type==="url_citation"?{type:"citation",source:"url_citation",url:e.url,title:e.title,startIndex:e.start_index,endIndex:e.end_index}:e.type==="file_citation"?{type:"citation",source:"file_citation",title:e.filename,startIndex:e.index,file_id:e.file_id}:e.type==="container_file_citation"?{type:"citation",source:"container_file_citation",title:e.filename,startIndex:e.start_index,endIndex:e.end_index,file_id:e.file_id,container_id:e.container_id}:e.type==="file_path"?{type:"citation",source:"file_path",startIndex:e.index,file_id:e.file_id}:{type:"non_standard",value:e}}function zH(e){if(e.type==="url_citation"||e.type==="file_citation"||e.type==="container_file_citation"||e.type==="file_path")return e;if(e.type==="citation"){let t=e;if(t.source==="url_citation")return{type:"url_citation",url:t.url??"",title:t.title??"",start_index:t.startIndex??0,end_index:t.endIndex??0};if(t.source==="file_citation")return{type:"file_citation",file_id:t.file_id??"",filename:t.title??"",index:t.startIndex??0};if(t.source==="container_file_citation")return{type:"container_file_citation",file_id:t.file_id??"",filename:t.title??"",container_id:t.container_id??"",start_index:t.startIndex??0,end_index:t.endIndex??0};if(t.source==="file_path")return{type:"file_path",file_id:t.file_id??"",index:t.startIndex??0}}return e.type==="non_standard"?e.value:e}var SR=e=>{let t={...e?.input_tokens_details?.cached_tokens!=null&&{cache_read:e?.input_tokens_details?.cached_tokens}},n={...e?.output_tokens_details?.reasoning_tokens!=null&&{reasoning:e?.output_tokens_details?.reasoning_tokens}};return{input_tokens:e?.input_tokens??0,output_tokens:e?.output_tokens??0,total_tokens:e?.total_tokens??0,input_token_details:t,output_token_details:n}},kR=e=>{if(e.error){let c=new Error(e.error.message);throw c.name=e.error.code,c}let t,n=[],r=[],i=[],a=e.output.map(c=>{if(c.type==="function_call"&&"parsed_arguments"in c){let l={...c};return delete l.parsed_arguments,l}return c}),s={model_provider:"openai",model:e.model,created_at:e.created_at,id:e.id,incomplete_details:e.incomplete_details,metadata:e.metadata,object:e.object,output:a,status:e.status,user:e.user,service_tier:e.service_tier,model_name:e.model},o={};for(let c of e.output)if(c.type==="message")t=c.id,n.push(...c.content.flatMap(l=>l.type==="output_text"?("parsed"in l&&l.parsed!=null&&(o.parsed=l.parsed),{type:"text",text:l.text,annotations:l.annotations.map($R),...c.phase!==null?{phase:c.phase}:{}}):l.type==="refusal"?(o.refusal=l.refusal,[]):l));else if(c.type==="function_call"){let l={function:{name:c.name,arguments:c.arguments},id:c.call_id};try{r.push(Hf(l,{returnId:!0}))}catch(u){let d;typeof u=="object"&&u!=null&&"message"in u&&typeof u.message=="string"&&(d=u.message),i.push(So(l,d))}o[af]??={},c.id&&(o[af][c.call_id]=c.id)}else if(c.type==="reasoning"){o.reasoning=c;let l=c.summary?.map(u=>u.text).filter(Boolean).join("");l&&n.push({type:"reasoning",reasoning:l})}else if(c.type==="custom_tool_call"){let l=CG(c);l?r.push(l):i.push(So(c,"Malformed custom tool call"))}else if(c.type==="computer_call"){let l=NG(c);l?r.push(l):i.push(So(c,"Malformed computer call"))}else c.type==="image_generation_call"?(c.result&&n.push({type:"image",mimeType:"image/png",data:c.result,id:c.id,metadata:{status:c.status}}),o.tool_outputs??=[],o.tool_outputs.push(c)):(o.tool_outputs??=[],o.tool_outputs.push(c));return new Ke({id:t,content:n,tool_calls:r,invalid_tool_calls:i,usage_metadata:SR(e.usage),additional_kwargs:o,response_metadata:s})},FH=e=>{let t=(e.summary.length>1?e.summary.reduce((n,r)=>{let i=n[n.length-1];return i.index===r.index?i.text+=r.text:n.push(r),n},[{...e.summary[0]}]):e.summary).map(n=>Object.fromEntries(Object.entries(n).filter(([r])=>r!=="index")));return{...e,summary:t}},BH=e=>{let t=[],n={},r,i=[],a={model_provider:"openai"},s={},o;if(e.type==="response.output_text.delta")t.push({type:"text",text:e.delta,index:e.content_index});else if(e.type==="response.output_text.annotation.added")t.push({type:"text",text:"",annotations:[$R(e.annotation)],index:e.content_index});else if(e.type==="response.output_item.added"&&e.item.type==="message"){o=e.item.id;let c="phase"in e.item?e.item.phase:void 0;c&&t.push({type:"text",text:"",phase:c,index:0})}else if(e.type==="response.output_item.added"&&e.item.type==="function_call")i.push({type:"tool_call_chunk",name:e.item.name,args:e.item.arguments,id:e.item.call_id,index:e.output_index}),s[af]={[e.item.call_id]:e.item.id};else if(e.type==="response.output_item.done"&&e.item.type==="computer_call")i.push({type:"tool_call_chunk",name:"computer_use",args:JSON.stringify({action:e.item.action}),id:e.item.call_id,index:e.output_index}),s.tool_outputs=[e.item];else if(e.type==="response.output_item.done"&&e.item.type==="image_generation_call")e.item.result&&t.push({type:"image",mimeType:"image/png",data:e.item.result,id:e.item.id,metadata:{status:e.item.status}}),s.tool_outputs=[e.item];else if(e.type==="response.output_item.done"&&["web_search_call","file_search_call","code_interpreter_call","shell_call","local_shell_call","mcp_call","mcp_list_tools","mcp_approval_request","custom_tool_call","tool_search_call","tool_search_output"].includes(e.item.type))s.tool_outputs=[e.item];else if(e.type==="response.created")a.id=e.response.id,a.model_name=e.response.model,a.model=e.response.model;else if(e.type==="response.completed"){let c=kR(e.response);r=SR(e.response.usage),e.response.text?.format?.type==="json_schema"&&c.text&&(s.parsed??=JSON.parse(c.text));for(let[l,u]of Object.entries(e.response))l!=="id"&&(l==="output"?a[l]=c.response_metadata.output:a[l]=u)}else if(e.type==="response.function_call_arguments.delta"||e.type==="response.custom_tool_call_input.delta")i.push({type:"tool_call_chunk",args:e.delta,index:e.output_index});else if(e.type==="response.web_search_call.completed"||e.type==="response.file_search_call.completed")n={tool_outputs:{id:e.item_id,type:e.type.replace("response.","").replace(".completed",""),status:"completed"}};else if(e.type==="response.refusal.done")s.refusal=e.refusal;else if(e.type==="response.output_item.added"&&"item"in e&&e.item.type==="reasoning"){let c=e.item.summary?e.item.summary.map((u,d)=>({...u,index:d})):void 0;s.reasoning={id:e.item.id,type:e.item.type,...c?{summary:c}:{}};let l=e.item.summary?.map(u=>u.text).filter(Boolean).join("");l&&t.push({type:"reasoning",reasoning:l})}else if(e.type==="response.reasoning_summary_part.added")s.reasoning={type:"reasoning",summary:[{...e.part,index:e.summary_index}]},e.part.text&&t.push({type:"reasoning",reasoning:e.part.text});else if(e.type==="response.reasoning_summary_text.delta")s.reasoning={type:"reasoning",summary:[{text:e.delta,type:"summary_text",index:e.summary_index}]},e.delta&&t.push({type:"reasoning",reasoning:e.delta});else return e.type==="response.image_generation_call.partial_image",null;return new Zr({text:t.map(c=>c.text).join(""),message:new un({id:o,content:t,tool_call_chunks:i,usage_metadata:r,additional_kwargs:s,response_metadata:a}),generationInfo:n})},ZH=e=>{let t=Ke.isInstance(e)&&e.response_metadata?.model_provider==="openai";function*n(){let r=Ur(()=>{try{let g=tl(e);return g==="system"||g==="developer"||g==="assistant"||g==="user"?g:"assistant"}catch{return"assistant"}}),i,a=new Set,s=new Set,o=new Map,c=new Map;function*l(){if(!i)return;let g=i.content;(typeof g=="string"&&g.length>0||Array.isArray(g)&&g.length>0)&&(yield i),i=void 0}let u=(g,y)=>{i||(i={type:"message",role:r,content:[],...y?{phase:y}:{}}),typeof i.content=="string"?i.content=i.content.length>0?[{type:"input_text",text:i.content},...g]:[...g]:i.content.push(...g)},d=g=>{if(typeof g=="string")return g;try{return JSON.stringify(g??{})}catch{return"{}"}},f=g=>{let y=Ur(()=>{let $=g.metadata?.detail;return $==="low"||$==="high"||$==="auto"?$:"auto"});if(g.fileId)return{type:"input_image",detail:y,file_id:g.fileId};if(g.url)return{type:"input_image",detail:y,image_url:g.url};if(g.data){let $=typeof g.data=="string"?g.data:Buffer.from(g.data).toString("base64");return{type:"input_image",detail:y,image_url:`data:${g.mimeType??"image/png"};base64,${$}`}}},h=g=>{if(g.fileId){let y=hk(g);return{type:"input_file",file_id:g.fileId,...y?{filename:y}:{}}}if(g.url){let y=hk(g);return{...y?{filename:y}:{},type:"input_file",file_url:g.url}}if(g.data){let y=ef(g),$=typeof g.data=="string"?g.data:Buffer.from(g.data).toString("base64");return{type:"input_file",file_data:`data:${g.mimeType??"application/octet-stream"};base64,${$}`,...y?{filename:y}:{}}}},p=g=>{let y=Ur(()=>{if(Array.isArray(g.summary)){let x=g.summary?.map(C=>C?.text).filter(C=>typeof C=="string")??[];if(x.length>0)return x}return g.reasoning?[g.reasoning]:[]}),$=y.length>0?y.map(x=>({type:"summary_text",text:x})):[{type:"summary_text",text:""}],S={type:"reasoning",id:g.id??"",summary:$};return g.reasoning&&(S.content=[{type:"reasoning_text",text:g.reasoning}]),S},m=g=>({type:"function_call",name:g.name??"",call_id:g.id??"",arguments:d(g.args)}),v=g=>{let y=d(g.output),$=g.status==="success"?"completed":g.status==="error"?"incomplete":void 0;return{type:"function_call_output",call_id:g.toolCallId??"",output:y,...$?{status:$}:{}}};for(let g of e.contentBlocks)if(g.type==="text"){let y=Ur(()=>{if("extras"in g&&typeof g.extras=="object"&&g.extras!==null&&"phase"in g.extras)return g.extras.phase});u([{type:"input_text",text:g.text}],y)}else if(g.type!=="invalid_tool_call"){if(g.type==="reasoning")yield*l(),yield p(g);else if(g.type==="tool_call"){yield*l();let y=g.id??"";y&&(a.add(y),o.delete(y)),yield m(g)}else if(g.type==="tool_call_chunk"){if(g.id){let y=o.get(g.id)??{name:g.name,args:[]};g.name&&(y.name=g.name),g.args&&y.args.push(g.args),o.set(g.id,y)}}else if(g.type==="server_tool_call"){yield*l();let y=g.id??"";y&&(s.add(y),c.delete(y)),yield m(g)}else if(g.type==="server_tool_call_chunk"){if(g.id){let y=c.get(g.id)??{name:g.name,args:[]};g.name&&(y.name=g.name),g.args&&y.args.push(g.args),c.set(g.id,y)}}else if(g.type==="server_tool_call_result")yield*l(),yield v(g);else if(g.type!=="audio")if(g.type==="file"){let y=h(g);y&&u([y])}else if(g.type==="image"){let y=f(g);y&&u([y])}else if(g.type==="video"){let y=h(g);y&&u([y])}else g.type==="text-plain"?g.text&&u([{type:"input_text",text:g.text}]):g.type==="non_standard"&&t&&(yield*l(),yield g.value)}yield*l();for(let[g,y]of o){if(!g||a.has(g))continue;let $=y.args.join("");!y.name&&!$||(yield{type:"function_call",call_id:g,name:y.name??"",arguments:$})}for(let[g,y]of c){if(!g||s.has(g))continue;let $=y.args.join("");!y.name&&!$||(yield{type:"function_call",call_id:g,name:y.name??"",arguments:$})}}return Array.from(n())},bk=({messages:e,zdrEnabled:t,model:n})=>e.flatMap(r=>{let i=r.response_metadata;if(i?.output_version==="v1")return ZH(r);let a=r.additional_kwargs,s=tl(r);if(s==="system"&&el(n)&&(s="developer"),s==="function")throw new Error("Function messages are not supported in Responses API");if(s==="tool"){let o=r;if(a?.type==="computer_call_output")return{type:"computer_call_output",output:(()=>{if(typeof o.content=="string")return{type:"input_image",image_url:o.content};if(Array.isArray(o.content)){let l=o.content.find(f=>f.type==="input_image");if(l)return l;let u=o.content.find(f=>f.type==="computer_screenshot");if(u)return u;let d=o.content.find(f=>f.type==="image_url");if(d)return{type:"input_image",image_url:typeof d.image_url=="string"?d.image_url:d.image_url.url}}throw new Error("Invalid computer call output")})(),call_id:o.tool_call_id};if(o.additional_kwargs?.customTool)return{type:"custom_tool_call_output",call_id:o.tool_call_id,output:o.content};let c=Array.isArray(o.content)&&o.content.every(l=>typeof l=="object"&&l!==null&&"type"in l&&(l.type==="input_file"||l.type==="input_image"||l.type==="input_text"));return{type:"function_call_output",call_id:o.tool_call_id,id:o.id?.startsWith("fc_")?o.id:void 0,output:c?o.content:typeof o.content!="string"?JSON.stringify(o.content):o.content}}if(s==="assistant"){if(!t&&i?.output!=null&&Array.isArray(i?.output)&&i?.output.length>0&&i?.output.every(p=>"type"in p))return i?.output;let o=[],c=a?.reasoning,l=!!c?.encrypted_content;if(c&&(!t||l)){let p=FH(c);o.push(p)}let{content:u}=r;if(a?.refusal&&(typeof u=="string"&&(u=[{type:"output_text",text:u,annotations:[]}]),u=[...u,{type:"refusal",refusal:a.refusal}]),typeof u=="string"||u.length>0){let p={type:"message",role:"assistant",...r.id&&!t&&r.id.startsWith("msg_")?{id:r.id}:{},content:Ur(()=>typeof u=="string"?u:u.flatMap(m=>{if(m.type==="text"){let v=m;return{type:"output_text",text:v.text,annotations:(v.annotations??[]).map(zH)}}return m.type==="output_text"||m.type==="refusal"?m:[]})),phase:Ur(()=>{let m=u.findIndex(v=>"phase"in v&&typeof v.phase=="string");if(m>=0)return u[m].phase})};o.push(p)}let d=a?.[af];Ke.isInstance(r)&&r.tool_calls?.length?o.push(...r.tool_calls.map(p=>RG(p)?{type:"custom_tool_call",id:p.call_id,call_id:p.id??"",input:p.args.input,name:p.name}:PG(p)?{type:"computer_call",id:p.call_id,call_id:p.id??"",action:p.args.action}:{type:"function_call",name:p.name,arguments:JSON.stringify(p.args),call_id:p.id,...t?{}:{id:d?.[p.id]}})):a?.tool_calls&&o.push(...a.tool_calls.map(p=>({type:"function_call",name:p.function.name,call_id:p.id,arguments:p.function.arguments,...t?{}:{id:d?.[p.id]}})));let f=i?.output?.length?i?.output:a.tool_outputs,h=["computer_call","mcp_call","code_interpreter_call","image_generation_call","shell_call","local_shell_call"];if(f!=null){let p=f?.filter(m=>h.includes(m.type));p.length>0&&o.push(...p)}return o}if(s==="user"||s==="system"||s==="developer"){if(typeof r.content=="string")return{type:"message",role:s,content:r.content};let o=[],c=r.content.flatMap(l=>(l.type==="mcp_approval_response"&&o.push({type:"mcp_approval_response",approval_request_id:l.approval_request_id,approve:l.approve}),gr(l)?L_(l,wR):l.type==="text"?{type:"input_text",text:l.text}:l.type==="image_url"?{type:"input_image",image_url:Ur(()=>{if(typeof l.image_url=="string")return l.image_url;if(typeof l.image_url=="object"&&l.image_url!==null&&"url"in l.image_url)return l.image_url.url}),detail:Ur(()=>{if(typeof l.image_url=="string")return"auto";if(typeof l.image_url=="object"&&l.image_url!==null&&"detail"in l.image_url)return l.image_url.detail})}:l.type==="input_text"||l.type==="input_image"||l.type==="input_file"?l:[]));return c.length>0&&o.push({type:"message",role:s,content:c}),o}return console.warn(`Unsupported role found when converting to OpenAI Responses API: ${s}`),[]}),VH=class extends tw{constructor(e,t){super(ew(e,t))}invocationParams(e){let t;e?.strict!==void 0&&(t=e.strict),t===void 0&&this.supportsStrictToolCalling!==void 0&&(t=this.supportsStrictToolCalling);let n={model:this.model,temperature:this.temperature,top_p:this.topP,user:this.user,service_tier:this.service_tier,stream:this.streaming,previous_response_id:e?.previous_response_id,truncation:e?.truncation,include:e?.include,tools:e?.tools?.length?this._reduceChatOpenAITools(e.tools,{stream:this.streaming,strict:t}):void 0,tool_choice:AG(e?.tool_choice)?e?.tool_choice:(()=>{let i=mR(e?.tool_choice);if(typeof i=="object"&&"type"in i){if(i.type==="function")return{type:"function",name:i.function.name};if(i.type==="allowed_tools")return{type:"allowed_tools",mode:i.allowed_tools.mode,tools:i.allowed_tools.tools};if(i.type==="custom")return{type:"custom",name:i.custom.name}}})(),text:(()=>{if(e?.text)return e.text;let i=this._getResponseFormat(e?.response_format);return i?.type==="json_schema"?i.json_schema.schema!=null?{format:{type:"json_schema",schema:i.json_schema.schema,description:i.json_schema.description,name:i.json_schema.name,strict:i.json_schema.strict},verbosity:e?.verbosity}:void 0:{format:i,verbosity:e?.verbosity}})(),parallel_tool_calls:e?.parallel_tool_calls,max_output_tokens:this.maxTokens===-1?void 0:this.maxTokens,prompt_cache_key:e?.promptCacheKey??this.promptCacheKey,prompt_cache_retention:e?.promptCacheRetention??this.promptCacheRetention,...this.zdrEnabled?{store:!1}:{},...this.modelKwargs},r=this._getReasoningParams(e);return r!==void 0&&(n.reasoning=r),n}async _generate(e,t,n){t.signal?.throwIfAborted();let r=this.invocationParams(t);if(r.stream){let i=this._streamResponseChunks(e,t,n),a;for await(let s of i)s.message.response_metadata={...s.generationInfo,...s.message.response_metadata},a=a?.concat(s)??s;return{generations:a?[a]:[],llmOutput:{estimatedTokenUsage:a?.message?.usage_metadata}}}else{let i=await this.completionWithRetry({input:bk({messages:e,zdrEnabled:this.zdrEnabled??!1,model:this.model}),...r,stream:!1},{signal:t?.signal,...t?.options});return{generations:[{text:i.output_text,message:kR(i)}],llmOutput:{id:i.id,estimatedTokenUsage:i.usage?{promptTokens:i.usage.input_tokens,completionTokens:i.usage.output_tokens,totalTokens:i.usage.total_tokens}:void 0}}}}async*_streamResponseChunks(e,t,n){let r=await this.completionWithRetry({...this.invocationParams(t),input:bk({messages:e,zdrEnabled:this.zdrEnabled??!1,model:this.model}),stream:!0},t);for await(let i of r){if(t.signal?.aborted)return;let a=BH(i);a!=null&&(yield a,await n?.handleLLMNewToken(a.text||"",{prompt:t.promptIndex??0,completion:0},void 0,void 0,void 0,{chunk:a}))}}async completionWithRetry(e,t){return this.caller.call(async()=>{let n=this._getClientOptions(t);try{return e.text?.format?.type==="json_schema"&&!e.stream?await this.client.responses.parse(e,n):await this.client.responses.create(e,n)}catch(r){throw Nh(r)}})}_reduceChatOpenAITools(e,t){let n=[];for(let r of e)if(Qb(r))r.type==="image_generation"&&t?.stream&&(r.partial_images=1),n.push(r);else if(nf(r)){let i=r.metadata.customTool;n.push({type:"custom",name:i.name,description:i.description,format:i.format})}else if(Iv(r)){let i={};for(let[a,s]of Object.entries(r))a!=="type"&&a!=="function"&&(i[a]=s);n.push({type:"function",name:r.function.name,parameters:r.function.parameters,description:r.function.description,strict:t?.strict??null,...i})}else gR(r)&&n.push(jG(r));return n}},qH=class xR extends tw{useResponsesApi=!1;responses;completions;get lc_serializable_keys(){return[...super.lc_serializable_keys,"useResponsesApi"]}get callKeys(){return[...super.callKeys,"useResponsesApi"]}fields;constructor(t,n){let r=ew(t,n);super(r),this.fields=r,this.useResponsesApi=r?.useResponsesApi??!1,this.responses=r?.responses??new VH(r),this.completions=r?.completions??new LH(r)}_useResponsesApi(t){let n=t?.tools?.some(Qb),r=t?.previous_response_id!=null||t?.text!=null||t?.truncation!=null||t?.include!=null||t?.reasoning?.summary!=null||this.reasoning?.summary!=null,i=t?.tools?.some(gR)||t?.tools?.some(nf);return this.useResponsesApi||n||r||i||SG(this.model)}getLsParams(t){let n=this._combineCallOptions(t);return this._useResponsesApi(t)?this.responses.getLsParams(n):this.completions.getLsParams(n)}invocationParams(t){let n=this._combineCallOptions(t);return this._useResponsesApi(t)?this.responses.invocationParams(n):this.completions.invocationParams(n)}async _generate(t,n,r){return this._useResponsesApi(n)?this.responses._generate(t,n,r):this.completions._generate(t,n,r)}async*_streamResponseChunks(t,n,r){if(this._useResponsesApi(n)){yield*this.responses._streamResponseChunks(t,this._combineCallOptions(n),r);return}yield*this.completions._streamResponseChunks(t,this._combineCallOptions(n),r)}withConfig(t){let n=new xR(this.fields);return n.defaultOptions={...this.defaultOptions,...t},n}},GH=class extends Zf{model="text-embedding-ada-002";modelName;batchSize=512;stripNewLines=!0;dimensions;timeout;organization;encodingFormat;client;clientConfig;apiKey;constructor(e){let t={maxConcurrency:2,...e};super(t);let n=t?.apiKey??t?.openAIApiKey??wn("OPENAI_API_KEY");this.organization=t?.configuration?.organization??wn("OPENAI_ORGANIZATION"),this.model=t?.model??t?.modelName??this.model,this.modelName=this.model,this.batchSize=t?.batchSize??this.batchSize,this.stripNewLines=t?.stripNewLines??this.stripNewLines,this.timeout=t?.timeout,this.dimensions=t?.dimensions,this.encodingFormat=t?.encodingFormat,this.clientConfig={apiKey:n,organization:this.organization,dangerouslyAllowBrowser:!0,...e?.configuration}}async embedDocuments(e){let t=kN(this.stripNewLines?e.map(a=>a.replace(/\n/g," ")):e,this.batchSize),n=t.map(a=>{let s={model:this.model,input:a};return this.dimensions&&(s.dimensions=this.dimensions),this.encodingFormat&&(s.encoding_format=this.encodingFormat),this.embeddingWithRetry(s)}),r=await Promise.all(n),i=[];for(let a=0;a<r.length;a+=1){let s=t[a],{data:o}=r[a];for(let c=0;c<s.length;c+=1)i.push(o[c].embedding)}return i}async embedQuery(e){let t={model:this.model,input:this.stripNewLines?e.replace(/\n/g," "):e};this.dimensions&&(t.dimensions=this.dimensions),this.encodingFormat&&(t.encoding_format=this.encodingFormat);let{data:n}=await this.embeddingWithRetry(t);return n[0].embedding}async embeddingWithRetry(e){if(!this.client){let n=fR({baseURL:this.clientConfig.baseURL}),r={...this.clientConfig,baseURL:n,timeout:this.timeout,maxRetries:0};r.baseURL||delete r.baseURL,r.defaultHeaders=hR(r.defaultHeaders),this.client=new Se(r)}let t={};return this.caller.call(async()=>{try{return await this.client.embeddings.create(e,t)}catch(n){throw Nh(n)}})}},HH=je({type:gt("screenshot")}),JH=je({type:gt("click"),x:rt(),y:rt(),button:Sr(["left","right","wheel","back","forward"]).default("left")}),WH=je({type:gt("double_click"),x:rt(),y:rt(),button:Sr(["left","right","wheel","back","forward"]).default("left")}),KH=je({type:gt("drag"),path:lt(je({x:rt(),y:rt()}))}),XH=je({type:gt("keypress"),keys:lt(de())}),YH=je({type:gt("move"),x:rt(),y:rt()}),QH=je({type:gt("scroll"),x:rt(),y:rt(),scroll_x:rt(),scroll_y:rt()}),eJ=je({type:gt("type"),text:de()}),tJ=je({type:gt("wait"),duration:rt().optional()}),nJ=$r([HH,JH,WH,KH,XH,YH,QH,eJ,tJ]);je({action:nJ});var rJ=je({type:gt("exec"),command:lt(de()),env:vh(de(),de()).optional(),working_directory:de().optional(),timeout_ms:rt().optional(),user:de().optional()});$r([rJ]);je({commands:lt(de()).describe("Array of shell commands to execute"),timeout_ms:rt().optional().describe("Optional timeout in milliseconds for the commands"),max_output_length:rt().optional().describe("Optional maximum number of characters to return from each command")});var iJ=je({type:gt("create_file"),path:de(),diff:de()}),aJ=je({type:gt("update_file"),path:de(),diff:de()}),sJ=je({type:gt("delete_file"),path:de()});$r([iJ,aJ,sJ]);var IR={advanced:"gpt-5.2",default:"gpt-5-mini"},nw={default:"text-embedding-ada-002"},Om=new Map,Ll=null,oJ=()=>{let e=O_.getDefault().helperServices;if(!e?.aiModels?.url)throw new Error("AI Models Service URL is not defined in the portal's helper services.");return e.aiModels.url},ER=async e=>{let t=oJ();Om.size===0&&(Ll||(Ll=(async()=>{try{let r=await fetch(`${t}/models`);if(!r.ok)throw new Error("Failed to fetch AI service discovery data.");(await r.json()).models.forEach(i=>Om.set(i.name,i))}catch(r){throw Ll=null,r}})()),await Ll);let n=Om.get(e);if(!n)throw new Error(`Model '${e}' is not available in the discovery service.`);return n.endpoint},cJ=async(e="default")=>await ER(IR[e]),lJ=async(e="default")=>await ER(nw[e]),wk=(e,t)=>t,uJ=(e,t)=>({...e,...t});Ae.Root({agentExecutionContext:Ae({default:()=>({userRequest:"",assignedTask:"",priorSteps:[],messages:[]}),reducer:uJ}),pendingIntents:Ae({default:()=>[],reducer:wk}),currentIntent:Ae({default:()=>"none",reducer:wk})});var Gr=async(e,t)=>{await yq("trace_message",e,t)},TR=e=>async(t,n)=>{let r=new Headers(n?.headers);return r.delete("Authorization"),r.delete("api-key"),e&&e.length>0&&(r.set("X-Esri-Authorization",`Bearer ${e}`),r.set("X-Esri-Request-Source","MapsSDK")),await fetch(t,{...n,headers:r})},OR=async(e="default",t=0)=>{let n=O_.getDefault(),r=await xk.getCredential(`${n.url}/sharing`),i=IR[e],a=await cJ(e);return new qH({modelName:i,apiKey:"dummy-key",...e!=="default"&&{temperature:t},configuration:{baseURL:a,fetch:TR(r.token)}})},dJ=async(e="default")=>{let t=O_.getDefault(),n=await xk.getCredential(`${t.url}/sharing`),r=nw[e],i=await lJ(e);return new GH({modelName:r,apiKey:"dummy-key",configuration:{baseURL:i,fetch:TR(n.token)},batchSize:2048,maxConcurrency:10})},AR=(e,t)=>{let n=Dv.fromTemplate(e);return Wf.fromMessages([n,...t])},fJ=async e=>{let{promptText:t,modelTier:n,temperature:r,messages:i}=e,a=AR(t,i??[]),s=await OR(n,r);return a.pipe(s)},hJ=async e=>{let{promptText:t,modelTier:n="default",temperature:r=0,messages:i,inputVariables:a}=e,s=await(await fJ({promptText:t,modelTier:n,temperature:r,messages:i})).invoke(a??{});if(typeof s=="string")return s;let o=s.content;return typeof o=="string"?o:JSON.stringify(o)},ra=async e=>{let{promptText:t,modelTier:n="default",temperature:r=0,messages:i,inputVariables:a,schema:s}=e,o=AR(t,i??[]),c=(await OR(n,r)).withStructuredOutput(s);return await o.pipe(c).invoke(a??{})};je({id:de().min(1),name:de().min(1),description:de().min(1)});var pJ=async e=>{try{return await(await dJ()).embedDocuments(e)}catch(t){throw console.error("Failed to generate embeddings:",t),t}},mJ="0.1",Ys=1536,gJ="openai",_J=nw.default,yJ=`Name: {name}
804
- Title: {title}
805
- Description: {description}`,vJ=`Name: {name}
806
- Alias: {alias}
807
- Description: {description}`;je({schemaVersion:gt(mJ),modified:rt().int().nonnegative(),embeddings:je({modelProvider:gt(gJ),model:gt(_J),dimensions:gt(Ys),templates:je({layer:de().default(yJ),field:de().default(vJ)})}),layers:lt(je({id:de().min(1),name:de().min(1),title:de().catch(""),description:de().catch(""),vector:lt(rt()).length(Ys,{message:`Layer vector must be exactly ${Ys} dimensions`}),fields:lt(je({name:de().min(1),alias:de().catch(""),description:de().catch(""),vector:lt(rt()).length(Ys,{message:`Field vector must be exactly ${Ys} dimensions`})}))})).default([])});var bJ=pt.object({name:pt.string(),description:pt.string(),valueType:pt.string(),alias:pt.string()});pt.object({fields:pt.array(bJ)});pt.object({title:pt.string(),description:pt.string(),name:pt.string().nullable()});var wJ=(e,t)=>{if(e.length!==t.length)throw new Error("Vectors must be the same length");let n=0,r=0,i=0;for(let o=0;o<e.length;++o){let c=e[o],l=t[o];n+=c*l,r+=c*c,i+=l*l}let a=Math.sqrt(r*i);if(a===0)return 0;let s=n/a;return Math.max(-1,Math.min(1,s))};async function cr(e,t){let n=Object.entries(e).find(([r])=>r.endsWith(`/${t}.md`));if(!n)throw new Error(`Prompt not found: ${t}
808
- Available prompts:
809
- ${Object.keys(e).join(`
810
- `)}`);return await n[1]()}function pn(e){return e?.configurable?.context?.translations}var CR=e=>{if(e&&Array.isArray(e.id)&&e.id.length>0)return e.id[e.id.length-1].replace("Message","").toLowerCase();if(e&&typeof e._getType=="function")try{return e._getType()}catch{return"human"}return"human"},$J=e=>{let t=CR(e);if(e&&e.kwargs)return{role:t,...e.kwargs};if(e&&typeof e=="object"){let n={role:t,content:typeof e.content=="string"?e.content:String(e.content||"")};return e.id&&(n.id=e.id),e.name&&(n.name=e.name),e.additional_kwargs&&(n.additional_kwargs=e.additional_kwargs),e.response_metadata&&(n.response_metadata=e.response_metadata),n}return{role:"human",content:String(e)}},SJ=e=>CR(e)==="human",js=(e,t=3)=>{let n=e.map((i,a)=>SJ(i)?a:-1).filter(i=>i!==-1);if(n.length===0)return[];let r=n.length>t?n[n.length-t]:n[0];return e.slice(r).map($J)},NR=Object.assign({"./prompts/solutions_assistant_description.md":()=>import("./DJTOZZZA.js").then(e=>e.default),"./prompts/solutions_assistant_prompts.md":()=>import("./JMO7ZFWL.js").then(e=>e.default)}),PR=Ae.Root({agentExecutionContext:Ae({reducer:(e,t)=>({...e,...t}),default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[]})}),outputMessage:Ae({reducer:(e="",t)=>typeof t=="string"&&t.trim()?e?`${e}
811
-
812
- ${t}`:t:e,default:()=>""})}),kJ=async(e,t)=>{let n=pn(t);await Gr({text:n?.executingSolutionsAssistantAgent||"Preparing a response..."},t);let r=await cr(NR,"solutions_assistant_prompts"),i=e.agentExecutionContext.messages.slice(-10),a=await hJ({promptText:r,modelTier:"default",temperature:.7,messages:js(i)}),s=t?.configurable?.context?.clearSuggestedPrompts;return s&&s(),{outputMessage:a}},xJ=()=>new Zb(PR).addNode("assistantLLM",kJ).addEdge(wt,"assistantLLM").addEdge("assistantLLM",xt),IJ=await cr(NR,"solutions_assistant_description"),EJ={id:"solutionsAssistant",name:"Solutions Assistant Agent",description:IJ,createGraph:xJ,workspace:PR};function TJ(e,t,n){let r=["params","httpMethod","rawResponse","authentication","hideToken","portal","credentials","maxUrlLength","headers","signal","suppressWarnings","request"],i=Object.assign(Object.assign({params:{}},n),e);return i.params=t.reduce((a,s)=>((e[s]||typeof e[s]=="boolean"||typeof e[s]=="number"&&e[s]===0)&&(a[s]=e[s]),a),i.params),r.reduce((a,s)=>(i[s]&&(a[s]=i[s]),a),{})}var Io=class e{constructor(t=""){this.termStack=[],this.rangeStack=[],this.openGroups=0,this.q=t}match(...t){return this.termStack=this.termStack.concat(t),this}in(t){let n=`\`in(${t?`"${t}"`:""})\``;return!this.hasRange&&!this.hasTerms?(kr(`${n} was called with no call to \`match(...)\` or \`from(...)\`/\`to(...)\`. Your query was not modified.`),this):(t&&t!=="*"&&(this.q+=`${t}:`),this.commit())}startGroup(){return this.commit(),this.openGroups>0&&(this.q+=" "),this.openGroups++,this.q+="(",this}endGroup(){return this.openGroups<=0?(kr("`endGroup(...)` was called without calling `startGroup(...)` first. Your query was not modified."),this):(this.commit(),this.openGroups--,this.q+=")",this)}and(){return this.addModifier("and")}or(){return this.addModifier("or")}not(){return this.addModifier("not")}from(t){return this.hasTerms?(kr('`from(...)` is not allowed after `match(...)` try using `.from(...).to(...).in(...)`. Optionally, you may see this because dates are incorrectly formatted. Dates should be a primative Date value, aka a number in milliseconds or Date object, ie new Date("2020-01-01"). Your query was not modified.'),this):(this.rangeStack[0]=t,this)}to(t){return this.hasTerms?(kr('`to(...)` is not allowed after `match(...)` try using `.from(...).to(...).in(...)`. Optionally, you may see this because dates are incorrectly formatted. Dates should be a primative Date value, aka a number in milliseconds or Date object, ie new Date("2020-01-01"). Your query was not modified.'),this):(this.rangeStack[1]=t,this)}boost(t){return this.commit(),this.q+=`^${t}`,this}toParam(){return this.commit(),this.cleanup(),this.q}clone(){return this.commit(),this.cleanup(),new e(this.q+"")}addModifier(t){return this.currentModifer?(kr(`You have called \`${this.currentModifer}()\` after \`${t}()\`. Your current query was not modified.`),this):(this.commit(),this.q===""&&t!=="not"?(kr(`You have called \`${t}()\` without calling another method to modify your query first. Try calling \`match()\` first.`),this):(this.currentModifer=t,this.q+=this.q===""?"":" ",this.q+=`${t.toUpperCase()} `,this))}hasWhiteSpace(t){return/\s/g.test(t)}formatTerm(t){return t instanceof Date?t.getTime():typeof t=="string"&&this.hasWhiteSpace(t)?`"${t}"`:t}commit(){return this.currentModifer=void 0,this.hasRange&&(this.q+=`[${this.formatTerm(this.rangeStack[0])} TO ${this.formatTerm(this.rangeStack[1])}]`,this.rangeStack=[void 0,void 0]),this.hasTerms&&(this.q+=this.termStack.map(t=>this.formatTerm(t)).join(" "),this.termStack=[]),this}get hasTerms(){return this.termStack.length>0}get hasRange(){return this.rangeStack.length&&this.rangeStack[0]&&this.rangeStack[1]}cleanup(){if(this.openGroups>0)for(kr(`Automatically closing ${this.openGroups} group(s). You can use \`endGroup(...)\` to remove this warning.`);this.openGroups>0;)this.q+=")",this.openGroups--;let t=this.q;this.q=t.replace(/( AND ?| NOT ?| OR ?)*$/,""),t!==this.q&&kr("`startGroup(...)` was called without calling `endGroup(...)` first. Your query was not modified."),this.q=this.q.replace(/(\(\))*/,"")}};function RR(e,t){let n;typeof e=="string"||e instanceof Io?n={httpMethod:"GET",params:{q:e}}:n=TJ(e,["q","num","start","sortField","sortOrder","searchUserAccess","searchUserName","filter","countFields","countSize","categories","categoryFilters"],{httpMethod:"GET"});let r;switch(t){case"item":r="/search";break;case"group":r="/community/groups";break;case"groupContent":if(typeof e!="string"&&!(e instanceof Io)&&e.groupId)r=`/content/groups/${e.groupId}/search`;else return Promise.reject(new Error("you must pass a `groupId` option to `searchGroupContent`"));break;case"communityUser":r="/community/users";break;default:r="/portals/self/users/search";break}let i=ww(n)+r;return bw(i,n).then(a=>(a.nextStart&&a.nextStart!==-1&&(a.nextPage=function(){let s;return typeof e=="string"||e instanceof Io?s={q:e,start:a.nextStart}:(s=e,s.start=a.nextStart),RR(s,t)}),a))}function jR(e){return RR(e,"item")}var OJ=je({key:de(),value:de(),description:de()}),AJ=Sr(["Feature Layer (hosted)","Feature Layer (hosted, view)","Web Map","Instant App","Dashboard","Web Experience","Form","Table (hosted)","Table (hosted, view)","Hub Site Application","Hub Page","CSV","Data Pipeline","Desktop Application Template","Group","Notebook","QuickCapture Project"]),CJ=je({name:de(),type:Sr(["oid","guid","globalid","integer","double","date"]),alias:de(),description:de()}),NJ=je({name:de(),type:gt("string"),alias:de(),description:de(),choiceList:$s(lt(de())),length:rt().int()}),$k=$r([NJ,CJ]),PJ=$r([gh(),lt(de())]),RJ=je({name:de(),type:gt("string"),alias:de(),description:de(),choiceList:PJ,length:rt().int()}),jJ=je({name:de(),type:Sr(["integer","double","date"]),alias:de(),description:de()}),MJ=$r([RJ,jJ]),DJ=je({id:rt().int(),type:Sr(["Point","Polyline","Polygon","Table"]),name:de(),customFields:lt(MJ),requiredFields:lt($k),systemFields:lt($k)}),UJ=je({itemId:de().regex(/^[a-fA-F0-9]{32}$/),addLayers:ph(),layers:lt(DJ)}),LJ=je({id:de().regex(/^[a-fA-F0-9]{32}$/),title:de(),description:de(),type:AJ}),zJ=je({title:de(),description:de(),tags:lt(de()),strings:lt(OJ)}),FJ=je({solution:zJ,items:lt(LJ),featureLayer:UJ}),sf="966b251241bb4e3bb9ee3f2b92921aa5",BJ="Build",ZJ="Embeddings",yo={"field inspections":{id:"b5327547c3fd4f77aa605c055dd9bb65",display:"Field Inspections"},"spatial data management":{id:"39488e3668364d9488089d47f77499aa",display:"Spatial Data Management"},"points of interest":{id:"db71359ab2f4405f9777718a9b93e373",display:"Points of Interest"}},VJ=[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset.",choiceList:null},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record.",choiceList:null},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created.",choiceList:null},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record.",choiceList:null},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited.",choiceList:null},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record.",choiceList:null}],Zi=Object.assign({"./prompts/create_design_prompt.md":()=>import("./JZFSA4OH.js").then(e=>e.default),"./prompts/description.md":()=>import("./M6HNHWAM.js").then(e=>e.default),"./prompts/matching_solution_prompt.md":()=>import("./NUVTCMAW.js").then(e=>e.default),"./prompts/prompts.md":()=>import("./46C7TV4N.js").then(e=>e.default),"./prompts/review_use_case_prompt.md":()=>import("./BDKWDKBM.js").then(e=>e.default),"./prompts/system_prompt.md":()=>import("./O3G7OWBQ.js").then(e=>e.default),"./prompts/update_existing_design_prompt.md":()=>import("./XQJY2TSR.js").then(e=>e.default),"./prompts/user_prompt.md":()=>import("./F6GQA5OC.js").then(e=>e.default),"./prompts/valid_tempates.md":()=>import("./AKBA4TMK.js").then(e=>e.default),"./prompts/workflow_1_step_1.md":()=>import("./KRJKI7JF.js").then(e=>e.default),"./prompts/workflow_1_step_4.md":()=>import("./HQE4ABPK.js").then(e=>e.default)}),Eo=e=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("arcgis-solution-design-update",{detail:e}))},MR=Ae.Root({messages:Ae({reducer:Oh,default:()=>[]}),outputMessage:Ae({reducer:(e="",t)=>typeof t=="string"&&t.trim()?e?`${e}
813
-
814
- ${t}`:t:e,default:()=>""}),ticket:Ae({reducer:(e,t)=>t??null,default:()=>null}),solutionDesign:Ae({reducer:(e,t)=>t??null,default:()=>null}),buildSolutionParameters:Ae({reducer:(e,t)=>t??null,default:()=>null}),solutionHistory:Ae({reducer:(e,t)=>Array.isArray(t)?t:e??[],default:()=>[]}),historyIndex:Ae({reducer:(e,t)=>typeof t=="number"?t:e??0,default:()=>0}),activePanel:Ae({reducer:(e,t)=>t==="chat"||t==="builder"?t:e??"chat",default:()=>"chat"}),isAssistantBusy:Ae({reducer:(e,t)=>typeof t=="boolean"?t:e??!1,default:()=>!1}),isBuilderEditing:Ae({reducer:(e,t)=>typeof t=="boolean"?t:e??!1,default:()=>!1}),templateItems:Ae({reducer:(e,t)=>Array.isArray(t)?t:e??[],default:()=>[]}),topFiveMatches:Ae({reducer:(e,t)=>Array.isArray(t)?t:e??[],default:()=>[]}),cancelled:Ae({reducer:(e,t)=>typeof t=="boolean"?t:e??!1,default:()=>!1}),isAppropriate:Ae({reducer:(e,t)=>t===null||typeof t=="boolean"?t:e??null,default:()=>null}),solutionMatch:Ae({reducer:(e,t)=>typeof t=="string"||t===null?t:e??null,default:()=>null}),templateMatch:Ae({reducer:(e,t)=>typeof t=="string"||t===null?t:e??null,default:()=>null}),history:Ae({reducer:(e,t)=>Array.isArray(t)?t:[],default:()=>[]}),redoStack:Ae({reducer:(e,t)=>Array.isArray(t)?t:[],default:()=>[]}),iterate:Ae({reducer:(e,t)=>typeof t=="boolean"?t:e??!1,default:()=>!1}),iterateAgain:Ae({reducer:(e,t)=>typeof t=="boolean"?t:e??!1,default:()=>!1})}),DR=e=>{let t=e?.trim().toLowerCase();return["field inspections","inspections","fieldinspections"].includes(t)?"Field Inspections":["spatial data management","spatial","data management"].includes(t)?"Spatial Data Management":["points of interest","poi"].includes(t)?"Points of Interest":""},Ph=e=>({outputMessage:pn(e)?.builderMessages?.cancelledMessage,ticket:null,cancelled:!0}),Sk=(e,t)=>({solution:{title:`${yo[e].display} Solution`,description:`Solution created for: ${t}`,tags:[e],strings:[{key:"defaultTitle",value:`${yo[e].display} solution`,description:"Default display title for the solution"}]},items:[{id:crypto.randomUUID?.()??"00000000000000000000000000000000",title:`${yo[e].display} item`,description:`Item for ${t}`,type:yo[e].display}],featureLayer:{itemId:"00000000000000000000000000000000",addLayers:!0,layers:[{id:0,type:"Point",name:"MainLayer",customFields:[],requiredFields:[],systemFields:VJ}]}}),qJ=async(e=sf,t)=>{let n=`typekeywords:${BJ} ${e?`AND group:${e}`:""}`.trim();return(await jR({q:n,authentication:t?{token:t}:void 0,num:100}))?.results??[]},GJ=async(e=sf,t)=>{let n=`typekeywords:${ZJ} ${e?`AND group:${e}`:""}`.trim();return(await jR({q:n,authentication:t?{token:t}:void 0,num:100}))?.results??[]},HJ=async(e,t)=>await $w(e,{authentication:t?{token:t}:void 0}),of=e=>e.replaceAll("{","{{").replaceAll("}","}}"),E_=(e,t)=>{let n=e;for(let[r,i]of Object.entries(t)){let a=`{${r.toUpperCase()}}`,s=typeof i=="string"?i:JSON.stringify(i);n=n.replace(new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),s)}return n},kk=e=>{let t=JJ(e);return t&&Object.prototype.hasOwnProperty.call(yo,t)?t:null},JJ=e=>{let t=e&&e.trim().toLowerCase();return t==="inspections"||t==="inspection"?"field inspections":t==="poi"?"points of interest":t==="spatial"?"spatial data management":t},UR=e=>!(!e||!e.solution?.title||!e.solution?.description||!Array.isArray(e.items)||!e.featureLayer),WJ=e=>/^(new (conversation|chat)|start over)$/i.test(e.trim()),KJ=e=>/^(undo)$/i.test(e.trim()),XJ=e=>/^(redo)$/i.test(e.trim()),LR=e=>{let n=[...e.messages||[]].reverse().find(r=>(r.type||"").toLowerCase()==="human");if(n){let r=n;if(typeof r.content=="string")return r.content;if(typeof r.text=="string")return r.text}return""},YJ=async(e,t)=>{let n=pn(t),r=LR(e).trim(),i=t?.configurable?.context.solutionDesignJson;if(i&&UR(JSON.parse(i))&&!e.solutionDesign)return{iterate:!0,solutionDesign:JSON.parse(i),ticket:{template:"",useCase:""}};if(!r)return e;if(console.log("check context here??"),console.log(t?.configurable?.context.solutionDesignJson),WJ(r))return Eo(null),{outputMessage:n?.builderMessages?.newConversationStarted||"New conversation started.",ticket:null,solutionDesign:null,history:[],redoStack:[],solutionMatch:null};if(KJ(r)&&e.history&&e.history.length>0){let s=[...e.history],o=s.pop();return Eo(o),{outputMessage:n?.builderMessages?.undoDesignChange||"Undid the last solution design change.",solutionDesign:o,history:s,redoStack:[...e.redoStack||[],e.solutionDesign??o]}}if(XJ(r)&&e.redoStack&&e.redoStack.length>0){let s=[...e.redoStack],o=s.pop();return Eo(o),{outputMessage:n?.builderMessages?.redoDesignChange||"Redid the last undone change.",solutionDesign:o,history:[...e.history??[],o],redoStack:s}}return e},QJ=async(e,t)=>{let n=pn(t);await Gr({text:n?.agentProgress?.builderAgentExecuting||"Executing Solutions Builder Agent..."},t),await Gr({text:n?.agentProgress?.builderAgentUnderstanding||"Understanding your request..."},t);let r=js(e.messages),i=(async()=>{let d=await cr(Zi,"workflow_1_step_1"),f=await cr(Zi,"valid_tempates"),h=d.replace("{{validTemplates}}",f),p=pt.object({useCase:pt.string().nullable()});return(await ra({promptText:h,modelTier:"default",temperature:0,messages:r,schema:p}))?.useCase?.trim()||null})(),a=(async()=>{let d=await cr(Zi,"review_use_case_prompt"),f=LR(e),h=E_(d,{USECASE:f}),p=pt.object({isAppropriate:pt.boolean()});return(await ra({promptText:h,modelTier:"default",temperature:0,messages:r,schema:p}))?.isAppropriate??!0})(),s=(async()=>{let d=await cr(Zi,"workflow_1_step_1"),f=await cr(Zi,"valid_tempates"),h=d.replace("{{validTemplates}}",f),p=pt.object({template:pt.string().nullable()});return(await ra({promptText:h,modelTier:"default",temperature:0,messages:r,schema:p}))?.template??null})(),[o,c,l]=await Promise.all([i,a,s]);return{ticket:{template:DR(l??""),useCase:o??""},isAppropriate:c}},e7=(e,t)=>{if(e.cancelled)return e;let n=pn(t),r=t?.configurable?.hitlResponse,i="appropriatenessGate";if(r?.agentId==="solutionsBuilder"&&r?.id===i){let a=String(r.payload||"").trim();return a.toLowerCase()==="cancel"?Ph(t):{ticket:{template:"",useCase:a},isAppropriate:null,messages:[...e.messages??[],new Vt(a)]}}if(e.isAppropriate===!1)throw new pi({agentId:"solutionsBuilder",id:i,kind:"textInput",message:n?.builderMessages?.inappropriateUseCase||"I can't help build a solution for this use case. Please update it and try again."});return e},t7=(e,t)=>{if(e.cancelled)return e;let n=pn(t),r=t?.configurable?.hitlResponse,i="ensureUseCase";if(r?.agentId==="solutionsBuilder"&&r?.id===i){let s=String(r.payload||"").trim();return s.toLowerCase()==="cancel"?Ph(t):{ticket:{template:e.ticket?.template??"",useCase:s},isAppropriate:null,messages:[...e.messages??[],new Vt(s)]}}if(!(e.ticket?.useCase??""))throw new pi({agentId:"solutionsBuilder",id:i,kind:"textInput",message:n?.builderMessages?.describeWorkflowPrompt||"What kind of workflow are you looking to support? Share a brief description of what the solution should help with."});return e},n7=(e,t)=>{if(e.cancelled)return e;let n=pn(t),r=t?.configurable?.hitlResponse,i="resolveTemplate";if(r?.agentId==="solutionsBuilder"&&r?.id===i){let s=String(r.payload||"").trim();if(s.toLowerCase()==="cancel")return Ph(t);let o=DR(s);if(o)return{ticket:{...e.ticket,template:o}}}if(!(e.ticket?.template??""))throw new pi({agentId:"solutionsBuilder",id:i,kind:"singleSelection",message:n?.builderMessages?.selectTemplatePrompt||"Templates provide a starting structure for your solution, including layers, maps, and apps. Choose a template to get started building your solution.",metadata:["Field Inspections","Spatial Data Management","Points of Interest"]});return e},r7=async(e,t)=>{if(!e.ticket||e.cancelled)return e;let n=pn(t);await Gr({text:n?.agentProgress?.builderAgentSearching||"Searching for existing solutions..."},t);try{let r=t?.configurable?.context?.token,i=await qJ(sf,r),a=await GJ(sf,r),s=await HJ(a[0]?.id??"",t?.configurable?.context?.token),o=[];return await pJ([e.messages[0].content.toString()??""]).then(c=>{let l={};s.items.forEach((f,h)=>{l[h]=wJ(c[0],f.embedding)});let u=Object.entries(l);u.sort((f,h)=>h[1]-f[1]),u.slice(0,5).forEach(([f])=>{o.push({item:s.items[parseInt(f,10)]})})}),console.log("Top five matches:",o),{templateItems:i,topFiveMatches:o}}catch(r){return console.warn("Failed to search existing solutions:",r),{templateItems:[]}}},i7=async(e,t)=>{if(!e.ticket||e.cancelled)return e;let n=pn(t);await Gr({text:n?.agentProgress?.builderAgentFindingMatch||"Finding matching solution..."},t);let r=await cr(Zi,"matching_solution_prompt"),i=[];Object.keys(e.topFiveMatches).forEach(l=>{let u=e.topFiveMatches[parseInt(l,10)]?.item;i.push({title:u.title,snippet:u.snippet||"",description:u.description||""})});let a=of(E_(r,{TEMPLATE:e.ticket?.template||"",USECASE:e.ticket?.useCase||"",CANDIDATES:i})),s=pt.object({solutionMatch:pt.string().nullable()}),o=await ra({promptText:a,modelTier:"default",temperature:0,messages:js(e.messages),schema:s});i=(e.templateItems||[]).map(l=>({title:l.title,snippet:l.snippet||"",description:l.description||""})),a=of(E_(r,{TEMPLATE:e.ticket?.template||"",USECASE:e.ticket?.useCase||"",CANDIDATES:i}));let c=await ra({promptText:a,modelTier:"default",temperature:0,messages:js(e.messages),schema:s});return{solutionMatch:o?.solutionMatch??null,templateMatch:c?.solutionMatch??null}},a7=(e,t)=>{if(e.cancelled)return e;let n=pn(t),r="confirmContinueExistingSolution",i=t?.configurable?.hitlResponse;if(e.solutionMatch&&(!i||i.agentId!=="solutionsBuilder"||i.id!==r))throw new pi({agentId:"solutionsBuilder",id:r,kind:"booleanChoice",message:(n?.builderMessages?.existingSolutionMatch||'We have an existing solution, <a href="www.esri.com">{{solutionMatch}}</a>, that closely matches your use case and may already meet your needs. Do you want to continue building your solution?').replace("{{solutionMatch}}",e.solutionMatch),metadata:["Yes","No"]});if(!e.solutionMatch&&e.templateMatch&&(!i||i.agentId!=="solutionsBuilder"||i.id!==r))throw new pi({agentId:"solutionsBuilder",id:r,kind:"booleanChoice",message:(n?.builderMessages?.existingTemplateMatch||"We have an existing template, {{templateMatch}}, that closely matches your use case. Do you want to continue building your solution?").replace("{{templateMatch}}",e.templateMatch),metadata:["Yes","No"]});let a=String(i?.payload||"").trim().toLowerCase();if(a==="false"||a==="no")return Ph(t);let s=null;return e.templateItems.some(o=>{o.title===e.templateMatch&&(s=o)}),s||e.topFiveMatches.some(o=>o.item.title===e.solutionMatch?(s=o.item,!0):!1),{...e,solutionDesign:s}},s7=async(e,t)=>{if(!e.ticket||e.cancelled)return e;let n=pn(t);await Gr({text:n?.agentProgress?.builderAgentCreatingDesign||"Creating a solution design..."},t);let r=pt.object({reply:pt.string(),solutionDesign:FJ});if(e.iterate){console.log("Solution design already exists, skipping creation.");let i=`Use this JSON template as the starting point: ${JSON.stringify(e.solutionDesign)} Return JSON: {reply: string, solutionDesign: object}.`,a=await ra({promptText:of(i),messages:js(e.messages),schema:r,modelTier:"default",temperature:.3}),s=a?.solutionDesign||Sk(kk(e.ticket.template)??"field inspections",e.ticket.useCase),o=e.solutionDesign?[...e.history??[],e.solutionDesign]:[...e.history??[]];return Eo(s),{outputMessage:a?.reply||n?.builderMessages?.designUpdated||"I updated the solution design for you.",solutionDesign:s,history:o,redoStack:[],iterate:!0,iterateAgain:!0}}else{let i=`Based on the selected template '${e.ticket.template}' and use case '${e.ticket.useCase}', create a solution design object matching the following structure: {solution:{title,description,tags,strings}, items:[...], featureLayer:{itemId,addLayers,layers:[...]}}. Use this JSON template as the starting point: ${JSON.stringify(e.templateItems[0])} Return JSON: {reply: string, solutionDesign: object}.`,a=await ra({promptText:of(i),messages:js(e.messages),schema:r,modelTier:"default",temperature:.3}),s=a?.solutionDesign||Sk(kk(e.ticket.template)??"field inspections",e.ticket.useCase);if(!UR(s))throw new Error("Generated design failed validation.");let o=e.solutionDesign?[...e.history??[],e.solutionDesign]:[...e.history??[]];return Eo(s),{outputMessage:a?.reply||n?.builderMessages?.designCreated||"I created an initial solution design for you.",solutionDesign:s,history:o,redoStack:[],iterate:!0}}},o7=async(e,t)=>{let n=pn(t);return await Gr({text:n?.agentProgress?.builderAgentValidating||"Validating the solution design..."},t),e},c7=(e,t)=>{if(!e.solutionDesign)return e;let n=pn(t),r=t?.configurable?.hitlResponse,i="iterateOnDesign",a=String(r?.payload||"").trim(),s=e.messages&&e.messages.length>0?e.messages[e.messages.length-1]:null,o=s&&s.content?String(s.content).trim():"";if(!r||r.agentId!=="solutionsBuilder"||r.id!==i||e.iterateAgain&&r.id===i&&String(r.payload||"").trim()&&o.indexOf(a)>-1)throw new pi({agentId:"solutionsBuilder",id:i,kind:"textInput",message:n?.builderMessages?.iteratePrompt||`The solution design has been created. Would you like to make any changes or additions to it? If so, describe what you'd like to modify (e.g., add layers, change fields, update description). Leave blank or say "no" to proceed.`,metadata:[]});return a&&a.toLowerCase()!=="no"&&a.toLowerCase()!=="none"&&a!==o?{messages:[...e.messages??[],new Vt(`Additional requirements: ${a}`)],iterate:!0,iterateAgain:!1}:{iterate:!1,iterateAgain:!1}},l7=()=>new Zb(MR).addNode("commandHandler",YJ).addNode("parallelIntentAnalysis",QJ).addNode("appropriatenessGate",e7).addNode("ensureUseCase",t7).addNode("resolveTemplate",n7).addNode("searchExistingSolutions",r7).addNode("findMatchingSolution",i7).addNode("confirmContinueExistingSolution",a7).addNode("createSolutionDesign",s7).addNode("iterateOnDesign",c7).addNode("validateSolutionDesign",o7).addEdge(wt,"commandHandler").addConditionalEdges("commandHandler",t=>t.iterate===!0&&t.solutionDesign?"createSolutionDesign":"parallelIntentAnalysis").addEdge("parallelIntentAnalysis","appropriatenessGate").addConditionalEdges("appropriatenessGate",t=>t.isAppropriate===null&&!t.cancelled?"parallelIntentAnalysis":"ensureUseCase").addConditionalEdges("ensureUseCase",t=>t.isAppropriate===null&&!t.cancelled?"parallelIntentAnalysis":"resolveTemplate").addEdge("resolveTemplate","searchExistingSolutions").addEdge("searchExistingSolutions","findMatchingSolution").addEdge("findMatchingSolution","confirmContinueExistingSolution").addEdge("confirmContinueExistingSolution","createSolutionDesign").addConditionalEdges("createSolutionDesign",t=>t.iterate===!0?"iterateOnDesign":"validateSolutionDesign").addConditionalEdges("iterateOnDesign",t=>t.iterate===!0?"createSolutionDesign":"validateSolutionDesign").addEdge("validateSolutionDesign",xt),u7=await cr(Zi,"description"),d7={id:"solutionsBuilder",name:"Solutions Builder Agent",description:u7,createGraph:l7,workspace:MR},f7=Object.assign({"./prompts/solutions_explorer_description.md":()=>import("./36TEZXBH.js").then(e=>e.default)});function h7(e){return e.replace(/<sup>\[\[(\d+)\]\]\(([^)]+)\)<\/sup>/g,'<sup><a href="$2">&#91;$1&#93;</a></sup>')}function p7(e,t){if(t.startsWith(e))return t.slice(e.length);let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return t.slice(n)}function m7(e){return e&&e.helperServices.aiAssistantServices?`${e.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/chat`:null}var g7=e=>new Promise(t=>setTimeout(t,e)),zR=Ae.Root({agentExecutionContext:Ae({reducer:(e,t)=>({...e,...t}),default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[]})}),outputMessage:Ae({default:()=>"",reducer:(e,t)=>typeof t!="string"||t.length===0?e:e+t}),_lastFullOutput:Ae({default:()=>"",reducer:(e,t)=>typeof t!="string"?e:t}),solutionResponse:Ae({reducer:(e,t)=>t??null,default:()=>null}),documentSkillUrl:Ae({reducer:(e,t)=>t??null,default:()=>null}),conversationId:Ae({reducer:(e,t)=>t??e,default:()=>null})}),_7=()=>new Zb(zR).addNode("initializeAgent",v7).addNode("askSolutionsQuestions",y7).addEdge(wt,"initializeAgent").addEdge("initializeAgent","askSolutionsQuestions").addEdge("askSolutionsQuestions",xt),y7=async(e,t)=>{let n=pn(t),r=e.documentSkillUrl;await Gr({text:n.agentProgress.explorerAgentSearching},t);let i=async d=>{let f=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",token:t?.configurable?.context?.token},body:JSON.stringify(d)});if(!f.ok)throw new Error(`HTTP ${f.status} calling ${r}`);return f.json()},a=await i({message:e.agentExecutionContext.userRequest,conversationId:t?.configurable?.context?.convoId??void 0,context:{kind:"DocAIAssistantRequest",filters:{persona:{persona:"solutions"}}}});a.conversationId&&t?.configurable?.context?.setConversationId&&t.configurable.context.setConversationId(a.conversationId);let s={message:a.message,conversationId:a.conversationId,hasMore:a.hasMore,ackSequenceNumber:a.sequenceNumber,inquiryId:a.inquiryId},o=e._lastFullOutput??"",c="",l=null,u=async d=>{let f=d.context?.results?.[0]?.reply??"",h=h7(f),p=p7(o,h);c+=p,o=h,h!==""&&d.context?.results?.[0]?.followupQuestions&&(l=d.context.results[0].followupQuestions);let m=d.context?.results?.[0]?.status?.currentStatusStep;if(m){let v="";m===1?v=n.agentProgress.explorerAgentReading:m===2?v=n.agentProgress.explorerAgentReviewing:m===3&&(v=n.agentProgress.explorerAgentPreparing),await Gr({text:v},t)}};for(await u(a);s.hasMore;)await g7(500),a=await i({conversationId:s.conversationId,ackSequenceNumber:s.ackSequenceNumber,inquiryId:s.inquiryId}),s={message:a.message,conversationId:a.conversationId,hasMore:a.hasMore,ackSequenceNumber:a.sequenceNumber,inquiryId:a.inquiryId},await u(a);if(l&&t?.configurable?.context?.updateSuggestedPrompts){let d=t.configurable.context.updateSuggestedPrompts,f=l;setTimeout(()=>d(f),0)}return{outputMessage:c,_lastFullOutput:o,solutionResponse:s,conversationId:s.conversationId}},v7=async(e,t)=>{let n=null;return e.documentSkillUrl===null&&t?.configurable?.context?.portal&&(n=m7(t.configurable.context.portal)),{documentSkillUrl:n}},b7=await cr(f7,"solutions_explorer_description"),w7={id:"solutionsExplorer",name:"Solutions Explorer Agent",description:b7,createGraph:_7,workspace:zR},$7="https://links.esri.com/solutions/agol-organizational-account",S7="https://links.esri.com/solutions/configure-assistants",T_=class extends hw{constructor(){super(),this.open=!1,this.userFirstName="",this._conversationId=void 0,this._orgSettings={aiAssistantsEnabled:!1,blockBetaApps:!0,colocateCompute:!1},this._suggestedPrompts=[],this._hasInteracted=!1,this._translations=mw({name:"arcgis-solutions-assistant",blocking:!0}),this._builderVisible=!0,this._builderWidth=48,this._solutionDesignJson='{ "solution": null }',this._isAssistantBusy=!1,this._isBuilderBusy=!1,this._assistantRef=dw(),this._configContextConsumer=gw({context:_w,subscribe:!0,callback:t=>{t?.userSession&&!this.userFirstName&&this._loadUserFirstName(),t?.authentication?.PortalSubset?.orgSettings&&(this._orgSettings=t?.authentication?.PortalSubset?.orgSettings)}}),this.closeAssistant=ow(),this._handleAssistantLinkClick=t=>{let n=t.composedPath().find(r=>r instanceof HTMLAnchorElement);n?.href&&(t.preventDefault(),window.open(n.href,"_blank","noopener,noreferrer"))},this._onSolutionDesignUpdate=t=>{let r=t.detail;this._solutionDesignJson=r?JSON.stringify(r,null,2):'{ "solution": null }'},this._handleSignIn=()=>{this._configContextConsumer.value?.authentication?.signIn("aiOpen")},this._checkURLOpenParameter=()=>{this.open=this._configContextConsumer.value?.authentication?.SignInParam==="aiOpen"||this.open}}static{this.properties={open:[5,{},{type:Boolean}],userFirstName:1,_conversationId:[16,{},{state:!0}],_orgSettings:[16,{},{state:!0}],_suggestedPrompts:[16,{},{state:!0}],_hasInteracted:[16,{},{state:!0}],_translations:[16,{},{state:!0}],_builderVisible:[16,{},{state:!0}],_builderWidth:[16,{},{state:!0}],_solutionDesignJson:[16,{},{state:!0}],_isAssistantBusy:[16,{},{state:!0}],_isBuilderBusy:[16,{},{state:!0}]}}static{this.styles=BR}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}connectedCallback(){super.connectedCallback(),this.el.addEventListener("arcgis-solution-design-update",this._onSolutionDesignUpdate),this.el.addEventListener("click",this._handleAssistantLinkClick)}disconnectedCallback(){this.el.removeEventListener("arcgis-solution-design-update",this._onSolutionDesignUpdate),this.el.removeEventListener("click",this._handleAssistantLinkClick),super.disconnectedCallback()}loaded(){this._checkURLOpenParameter()}load(){this._configContextConsumer.value?.portalURL&&(FR.portalUrl=this._configContextConsumer.value.portalURL)}firstUpdated(t){this._loadUserFirstName()}willUpdate(t){t.has("open")&&this.open&&window.dispatchEvent(new CustomEvent("openAssistant")),this._configContextConsumer.value?.userSession?.token&&this._configContextConsumer.value?.authentication?.CanUseAI}_renderNoSign(){return Zs`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage??jh} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`}_renderNoPermission(){return Zs`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Sw(this._translations.noPermissionMessage.replace("{{orgUrl}}",$7).replace("{{configAI}}",S7))}</div></calcite-notice>`}render(){let t=this._suggestedPrompts.length>0?this._suggestedPrompts:Object.values(this._translations.defaultFollowUpQuestions);return this._suggestedPrompts.length>0?t=this._suggestedPrompts:this._hasInteracted||(t=[...Object.values(this._translations.defaultFollowUpQuestions)]),Zs`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span><calcite-chip class="beta-chip" kind=brand .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip></div>${this._configContextConsumer.value?.userSession?.token?this._configContextConsumer.value?.authentication?.CanUseAI?Zs`<calcite-button appearance=transparent id=newChatButton icon-end=speech-bubble-plus kind=neutral label="New conversation" @click=${()=>{this._conversationId=void 0,this._suggestedPrompts=[],this._hasInteracted=!1,this._assistantRef.value?.clearChatHistory()}} scale=l slot=header-actions-end></calcite-button><calcite-tooltip placement=bottom reference-element=newChatButton><span>${this._translations.tooltips.newConversation}</span></calcite-tooltip><arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage??jh} .suggestedPrompts=${t} @arcgisSubmit=${n=>{console.log("arcgis submit: ",n.detail),this._suggestedPrompts=[],this._hasInteracted=!0;let r=Date.now(),i=vw(r),a=n.detail||"Unknown";this._telemetry?.logEvent({category:yw.ASSISTANT,action:"Chat",dimensions:[a],metrics:[i]})}} @arcgisFeedback=${n=>{n.detail}} ${fw(this._assistantRef)}><arcgis-assistant-agent .agent=${w7} .context=${{token:this._configContextConsumer.value?.userSession?.token,convoId:this._conversationId,portal:this._configContextConsumer.value?.authentication.Portal,assistantRef:this._assistantRef,translations:this._translations,updateSuggestedPrompts:n=>{this._suggestedPrompts=n},setConversationId:n=>{this._conversationId=n}}}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${EJ} .context=${{translations:this._translations,clearSuggestedPrompts:()=>{this._suggestedPrompts=[]}}}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${d7} .context=${{solutionDesignJson:this._solutionDesignJson,translations:this._translations}}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-icon icon=information scale=s></calcite-icon><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern target=_blank>${this._translations.reportConcern}</a></span></div>`:this._renderNoPermission():this._renderNoSign()}<calcite-action icon=x id=closeAssistantButton label=Close @click=${()=>{this.closeAssistant.emit(!0)}} slot=header-actions-end text=Close></calcite-action><calcite-tooltip placement=bottom reference-element=closeAssistantButton><span>${this._translations.tooltips.close}</span></calcite-tooltip></calcite-panel>`}async _loadUserFirstName(){try{let t=await this._configContextConsumer.value?.userSession?.getUser();if(t?.fullName){let n=t.fullName.split(" ")[0];this.userFirstName=n}}catch{}}};pw("arcgis-solutions-assistant",T_);return T_},"config","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request",a)