@arcgis/portal-components 5.2.0-next.98 → 6.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1217) hide show
  1. package/dist/cdn/23X56P4K.js +2 -0
  2. package/dist/cdn/{OBBYT2AV.js → 25XJ66JO.js} +1 -1
  3. package/dist/cdn/2I5SLQC5.js +2 -0
  4. package/dist/cdn/3R4PPD5N.js +2 -0
  5. package/dist/cdn/3SO52LKS.js +2 -0
  6. package/dist/cdn/{T3BCFS2M.js → 456JKNCU.js} +1 -1
  7. package/dist/cdn/4SHXR62X.js +2 -0
  8. package/dist/cdn/4TQWZ2KF.js +9 -0
  9. package/dist/cdn/{W4GBRVNN.js → 4ZTWQN6Q.js} +1 -1
  10. package/dist/cdn/5EFYJYWM.js +2 -0
  11. package/dist/cdn/5FDUO7J4.js +2 -0
  12. package/dist/cdn/5FOWUL6I.js +2 -0
  13. package/dist/cdn/5YDITHQA.js +3 -0
  14. package/dist/cdn/{VJ4STLVD.js → 6BMWSGLA.js} +1 -1
  15. package/dist/cdn/{GBYHBRUW.js → 6EY5GHKE.js} +1 -1
  16. package/dist/cdn/6LST5YZY.js +2 -0
  17. package/dist/cdn/6MWSS5YF.js +2 -0
  18. package/dist/cdn/7NK6UF47.js +2 -0
  19. package/dist/cdn/7NQY5QJK.js +2 -0
  20. package/dist/cdn/7TGCBYRK.js +2 -0
  21. package/dist/cdn/ADZAKBOJ.js +2 -0
  22. package/dist/cdn/AE574B3G.js +2 -0
  23. package/dist/cdn/AWCYG2JJ.js +2 -0
  24. package/dist/cdn/B3NVWHCS.js +2 -0
  25. package/dist/cdn/BEAUY47J.js +2 -0
  26. package/dist/cdn/BIXJGL7B.js +2 -0
  27. package/dist/cdn/BRJE3G3H.js +2 -0
  28. package/dist/cdn/{S7IRYX4A.js → C5U7YKVI.js} +1 -1
  29. package/dist/cdn/C5VUNN4M.js +2 -0
  30. package/dist/cdn/CJHR4UK5.js +2 -0
  31. package/dist/cdn/CWSEBETE.js +4 -0
  32. package/dist/cdn/D6QHNXEH.js +2 -0
  33. package/dist/cdn/{EHQVLI6M.js → D7LRCAK4.js} +1 -1
  34. package/dist/cdn/DF5GVVDW.js +2 -0
  35. package/dist/cdn/DIKRXF22.js +2 -0
  36. package/dist/cdn/DKIYHE4A.js +2 -0
  37. package/dist/cdn/E3FQ4QWE.js +2 -0
  38. package/dist/cdn/FEBUVUR5.js +2 -0
  39. package/dist/cdn/{FJSGWELR.js → FFLIAQOL.js} +1 -1
  40. package/dist/cdn/FQOOFBPI.js +2 -0
  41. package/dist/cdn/FQYC25GN.js +2 -0
  42. package/dist/cdn/FSACXOM3.js +68 -0
  43. package/dist/cdn/FTKD53UG.js +209 -0
  44. package/dist/cdn/{PKSH2HSK.js → GEZH4D32.js} +1 -1
  45. package/dist/cdn/GTZ4LKEQ.js +2 -0
  46. package/dist/cdn/GYA7R4F6.js +2 -0
  47. package/dist/cdn/J537SBGI.js +2 -0
  48. package/dist/cdn/{33IZVRD6.js → JUDF3TYJ.js} +1 -1
  49. package/dist/cdn/KC4FTTKP.js +2 -0
  50. package/dist/cdn/{GUTV5BR3.js → KIKEE2KY.js} +1 -1
  51. package/dist/cdn/LCO2BWDK.js +2 -0
  52. package/dist/cdn/{ZJ7GT4N2.js → LNWWUPFK.js} +1 -1
  53. package/dist/cdn/LP4IB3PV.js +2 -0
  54. package/dist/cdn/LRHPL6B5.js +2 -0
  55. package/dist/cdn/LYOR4B2O.js +2 -0
  56. package/dist/cdn/MCX22B23.js +2 -0
  57. package/dist/cdn/{OEMNHYK6.js → MQISQ7P3.js} +1 -1
  58. package/dist/cdn/MY7AYBBR.js +2 -0
  59. package/dist/cdn/NDRCB2K3.js +2 -0
  60. package/dist/cdn/NICTB76A.js +2 -0
  61. package/dist/cdn/{G2CJ5PLI.js → NXFE6R2N.js} +1 -1
  62. package/dist/cdn/O5LFDRK2.js +2 -0
  63. package/dist/cdn/ODH2VAWC.js +2 -0
  64. package/dist/cdn/OJNU7H3F.js +2 -0
  65. package/dist/cdn/OKUI3HQ4.js +2 -0
  66. package/dist/cdn/{LLRHHAXZ.js → OQGUCK3G.js} +1 -1
  67. package/dist/cdn/{VQKLCN3V.js → OV5O7YP4.js} +1 -1
  68. package/dist/cdn/QBV7VDQK.js +2 -0
  69. package/dist/cdn/QCOJMMT3.js +2 -0
  70. package/dist/cdn/QDWOQBO3.js +3 -0
  71. package/dist/cdn/QKBGX2OY.js +2 -0
  72. package/dist/cdn/QKK6N2AN.js +2 -0
  73. package/dist/cdn/QNCMFQSA.js +2 -0
  74. package/dist/cdn/QSAZVVVL.js +2 -0
  75. package/dist/cdn/{2QCYQYNA.js → QUOPWSRC.js} +1 -1
  76. package/dist/cdn/QYMSY57N.js +2 -0
  77. package/dist/cdn/{XWLOXRJZ.js → R3QN5WF2.js} +1 -1
  78. package/dist/cdn/R74ZHFA6.js +2 -0
  79. package/dist/cdn/RUB2GDBE.js +2 -0
  80. package/dist/cdn/SG7Z5VLB.js +2 -0
  81. package/dist/cdn/T2HQNZ36.js +2 -0
  82. package/dist/cdn/T3RJKB2A.js +2 -0
  83. package/dist/cdn/TJYPEMON.js +2 -0
  84. package/dist/cdn/UGRFT75G.js +2 -0
  85. package/dist/cdn/UKHCSMA4.js +2 -0
  86. package/dist/cdn/UQKT5JQZ.js +2 -0
  87. package/dist/cdn/USGROSML.js +2 -0
  88. package/dist/cdn/V5YXPHYD.js +2 -0
  89. package/dist/cdn/WDMNL6PJ.js +2 -0
  90. package/dist/cdn/X4G32AIG.js +2 -0
  91. package/dist/cdn/XKC6SPS4.js +2 -0
  92. package/dist/cdn/XOFCMJBQ.js +150 -0
  93. package/dist/cdn/XROCYFKH.js +2 -0
  94. package/dist/cdn/XU3QHJD7.js +2 -0
  95. package/dist/cdn/{ACCEI7S4.js → XUPYBBRI.js} +1 -1
  96. package/dist/cdn/Y3YIMI2Z.js +463 -0
  97. package/dist/cdn/YG5VQATB.js +2 -0
  98. package/dist/cdn/YUQFNMEZ.js +2 -0
  99. package/dist/cdn/ZAIRH5DL.js +2 -0
  100. package/dist/cdn/ZSILF72K.js +2 -0
  101. package/dist/cdn/assets/portal-account-switcher/t9n/messages.ar.json +1 -0
  102. package/dist/cdn/assets/portal-account-switcher/t9n/messages.bg.json +1 -0
  103. package/dist/cdn/assets/portal-account-switcher/t9n/messages.bs.json +1 -0
  104. package/dist/cdn/assets/portal-account-switcher/t9n/messages.ca.json +1 -0
  105. package/dist/cdn/assets/portal-account-switcher/t9n/messages.cs.json +1 -0
  106. package/dist/cdn/assets/portal-account-switcher/t9n/messages.da.json +1 -0
  107. package/dist/cdn/assets/portal-account-switcher/t9n/messages.de.json +1 -0
  108. package/dist/cdn/assets/portal-account-switcher/t9n/messages.el.json +1 -0
  109. package/dist/cdn/assets/portal-account-switcher/t9n/messages.en.json +1 -1
  110. package/dist/cdn/assets/portal-account-switcher/t9n/messages.es.json +1 -0
  111. package/dist/cdn/assets/portal-account-switcher/t9n/messages.et.json +1 -0
  112. package/dist/cdn/assets/portal-account-switcher/t9n/messages.fi.json +1 -0
  113. package/dist/cdn/assets/portal-account-switcher/t9n/messages.fr.json +1 -0
  114. package/dist/cdn/assets/portal-account-switcher/t9n/messages.he.json +1 -0
  115. package/dist/cdn/assets/portal-account-switcher/t9n/messages.hr.json +1 -0
  116. package/dist/cdn/assets/portal-account-switcher/t9n/messages.hu.json +1 -0
  117. package/dist/cdn/assets/portal-account-switcher/t9n/messages.id.json +1 -0
  118. package/dist/cdn/assets/portal-account-switcher/t9n/messages.it.json +1 -0
  119. package/dist/cdn/assets/portal-account-switcher/t9n/messages.ja.json +1 -0
  120. package/dist/cdn/assets/portal-account-switcher/t9n/messages.ko.json +1 -0
  121. package/dist/cdn/assets/portal-account-switcher/t9n/messages.lt.json +1 -0
  122. package/dist/cdn/assets/portal-account-switcher/t9n/messages.lv.json +1 -0
  123. package/dist/cdn/assets/portal-account-switcher/t9n/messages.nl.json +1 -0
  124. package/dist/cdn/assets/portal-account-switcher/t9n/messages.no.json +1 -0
  125. package/dist/cdn/assets/portal-account-switcher/t9n/messages.pl.json +1 -0
  126. package/dist/cdn/assets/portal-account-switcher/t9n/messages.pt-BR.json +1 -0
  127. package/dist/cdn/assets/portal-account-switcher/t9n/messages.pt-PT.json +1 -0
  128. package/dist/cdn/assets/portal-account-switcher/t9n/messages.ro.json +1 -0
  129. package/dist/cdn/assets/portal-account-switcher/t9n/messages.ru.json +1 -0
  130. package/dist/cdn/assets/portal-account-switcher/t9n/messages.sk.json +1 -0
  131. package/dist/cdn/assets/portal-account-switcher/t9n/messages.sl.json +1 -0
  132. package/dist/cdn/assets/portal-account-switcher/t9n/messages.sr.json +1 -0
  133. package/dist/cdn/assets/portal-account-switcher/t9n/messages.sv.json +1 -0
  134. package/dist/cdn/assets/portal-account-switcher/t9n/messages.th.json +1 -0
  135. package/dist/cdn/assets/portal-account-switcher/t9n/messages.tr.json +1 -0
  136. package/dist/cdn/assets/portal-account-switcher/t9n/messages.uk.json +1 -0
  137. package/dist/cdn/assets/portal-account-switcher/t9n/messages.vi.json +1 -0
  138. package/dist/cdn/assets/portal-account-switcher/t9n/messages.zh-CN.json +1 -0
  139. package/dist/cdn/assets/portal-account-switcher/t9n/messages.zh-HK.json +1 -0
  140. package/dist/cdn/assets/portal-account-switcher/t9n/messages.zh-TW.json +1 -0
  141. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.ar.json +1 -0
  142. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.bg.json +1 -0
  143. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.bs.json +1 -0
  144. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.ca.json +1 -0
  145. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.cs.json +1 -0
  146. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.da.json +1 -0
  147. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.de.json +1 -0
  148. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.el.json +1 -0
  149. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.en.json +1 -1
  150. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.es.json +1 -0
  151. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.et.json +1 -0
  152. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.fi.json +1 -0
  153. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.fr.json +1 -0
  154. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.he.json +1 -0
  155. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.hr.json +1 -0
  156. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.hu.json +1 -0
  157. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.id.json +1 -0
  158. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.it.json +1 -0
  159. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.ja.json +1 -0
  160. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.ko.json +1 -0
  161. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.lt.json +1 -0
  162. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.lv.json +1 -0
  163. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.nl.json +1 -0
  164. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.no.json +1 -0
  165. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.pl.json +1 -0
  166. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.pt-BR.json +1 -0
  167. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.pt-PT.json +1 -0
  168. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.ro.json +1 -0
  169. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.ru.json +1 -0
  170. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.sk.json +1 -0
  171. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.sl.json +1 -0
  172. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.sr.json +1 -0
  173. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.sv.json +1 -0
  174. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.th.json +1 -0
  175. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.tr.json +1 -0
  176. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.uk.json +1 -0
  177. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.vi.json +1 -0
  178. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.zh-CN.json +1 -0
  179. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.zh-HK.json +1 -0
  180. package/dist/cdn/assets/portal-add-gps-metadata/t9n/messages.zh-TW.json +1 -0
  181. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ar.json +1 -1
  182. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.bg.json +1 -1
  183. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.bs.json +1 -1
  184. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ca.json +1 -1
  185. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.cs.json +1 -1
  186. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.da.json +1 -1
  187. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.de.json +1 -1
  188. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.el.json +1 -1
  189. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.es.json +1 -1
  190. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.et.json +1 -1
  191. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.fi.json +1 -1
  192. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.fr.json +1 -1
  193. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.he.json +1 -1
  194. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.hr.json +1 -1
  195. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.hu.json +1 -1
  196. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.id.json +1 -1
  197. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.it.json +1 -1
  198. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ja.json +1 -1
  199. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ko.json +1 -1
  200. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.lt.json +1 -1
  201. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.lv.json +1 -1
  202. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.nl.json +1 -1
  203. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.no.json +1 -1
  204. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.pl.json +1 -1
  205. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.pt-BR.json +1 -1
  206. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.pt-PT.json +1 -1
  207. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ro.json +1 -1
  208. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.ru.json +1 -1
  209. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.sk.json +1 -1
  210. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.sl.json +1 -1
  211. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.sr.json +1 -1
  212. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.sv.json +1 -1
  213. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.th.json +1 -1
  214. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.tr.json +1 -1
  215. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.uk.json +1 -1
  216. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.vi.json +1 -1
  217. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.zh-CN.json +1 -1
  218. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.zh-HK.json +1 -1
  219. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.zh-TW.json +1 -1
  220. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ar.json +1 -1
  221. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.bg.json +1 -1
  222. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.bs.json +1 -1
  223. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ca.json +1 -1
  224. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.cs.json +1 -1
  225. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.da.json +1 -1
  226. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.de.json +1 -1
  227. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.el.json +1 -1
  228. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.es.json +1 -1
  229. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.et.json +1 -1
  230. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.fi.json +1 -1
  231. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.fr.json +1 -1
  232. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.he.json +1 -1
  233. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.hr.json +1 -1
  234. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.hu.json +1 -1
  235. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.id.json +1 -1
  236. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.it.json +1 -1
  237. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ja.json +1 -1
  238. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ko.json +1 -1
  239. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.lt.json +1 -1
  240. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.lv.json +1 -1
  241. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.nl.json +1 -1
  242. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.no.json +1 -1
  243. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.pl.json +1 -1
  244. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.pt-BR.json +1 -1
  245. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.pt-PT.json +1 -1
  246. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ro.json +1 -1
  247. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.ru.json +1 -1
  248. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.sk.json +1 -1
  249. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.sl.json +1 -1
  250. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.sr.json +1 -1
  251. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.sv.json +1 -1
  252. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.th.json +1 -1
  253. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.tr.json +1 -1
  254. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.uk.json +1 -1
  255. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.vi.json +1 -1
  256. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.zh-CN.json +1 -1
  257. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.zh-HK.json +1 -1
  258. package/dist/cdn/assets/portal-ai-assistant-interrupt/t9n/messages.zh-TW.json +1 -1
  259. package/dist/cdn/assets/portal-browser/t9n/messages.ar.json +1 -0
  260. package/dist/cdn/assets/portal-browser/t9n/messages.bg.json +1 -0
  261. package/dist/cdn/assets/portal-browser/t9n/messages.bs.json +1 -0
  262. package/dist/cdn/assets/portal-browser/t9n/messages.ca.json +1 -0
  263. package/dist/cdn/assets/portal-browser/t9n/messages.cs.json +1 -0
  264. package/dist/cdn/assets/portal-browser/t9n/messages.da.json +1 -0
  265. package/dist/cdn/assets/portal-browser/t9n/messages.de.json +1 -0
  266. package/dist/cdn/assets/portal-browser/t9n/messages.el.json +1 -0
  267. package/dist/cdn/assets/portal-browser/t9n/messages.es.json +1 -0
  268. package/dist/cdn/assets/portal-browser/t9n/messages.et.json +1 -0
  269. package/dist/cdn/assets/portal-browser/t9n/messages.fi.json +1 -0
  270. package/dist/cdn/assets/portal-browser/t9n/messages.fr.json +1 -0
  271. package/dist/cdn/assets/portal-browser/t9n/messages.he.json +1 -0
  272. package/dist/cdn/assets/portal-browser/t9n/messages.hr.json +1 -0
  273. package/dist/cdn/assets/portal-browser/t9n/messages.hu.json +1 -0
  274. package/dist/cdn/assets/portal-browser/t9n/messages.id.json +1 -0
  275. package/dist/cdn/assets/portal-browser/t9n/messages.it.json +1 -0
  276. package/dist/cdn/assets/portal-browser/t9n/messages.ja.json +1 -0
  277. package/dist/cdn/assets/portal-browser/t9n/messages.ko.json +1 -0
  278. package/dist/cdn/assets/portal-browser/t9n/messages.lt.json +1 -0
  279. package/dist/cdn/assets/portal-browser/t9n/messages.lv.json +1 -0
  280. package/dist/cdn/assets/portal-browser/t9n/messages.nl.json +1 -0
  281. package/dist/cdn/assets/portal-browser/t9n/messages.no.json +1 -0
  282. package/dist/cdn/assets/portal-browser/t9n/messages.pl.json +1 -0
  283. package/dist/cdn/assets/portal-browser/t9n/messages.pt-BR.json +1 -0
  284. package/dist/cdn/assets/portal-browser/t9n/messages.pt-PT.json +1 -0
  285. package/dist/cdn/assets/portal-browser/t9n/messages.ro.json +1 -0
  286. package/dist/cdn/assets/portal-browser/t9n/messages.ru.json +1 -0
  287. package/dist/cdn/assets/portal-browser/t9n/messages.sk.json +1 -0
  288. package/dist/cdn/assets/portal-browser/t9n/messages.sl.json +1 -0
  289. package/dist/cdn/assets/portal-browser/t9n/messages.sr.json +1 -0
  290. package/dist/cdn/assets/portal-browser/t9n/messages.sv.json +1 -0
  291. package/dist/cdn/assets/portal-browser/t9n/messages.th.json +1 -0
  292. package/dist/cdn/assets/portal-browser/t9n/messages.tr.json +1 -0
  293. package/dist/cdn/assets/portal-browser/t9n/messages.uk.json +1 -0
  294. package/dist/cdn/assets/portal-browser/t9n/messages.vi.json +1 -0
  295. package/dist/cdn/assets/portal-browser/t9n/messages.zh-CN.json +1 -0
  296. package/dist/cdn/assets/portal-browser/t9n/messages.zh-HK.json +1 -0
  297. package/dist/cdn/assets/portal-browser/t9n/messages.zh-TW.json +1 -0
  298. package/dist/cdn/assets/portal-delete-items/t9n/messages.ar.json +1 -0
  299. package/dist/cdn/assets/portal-delete-items/t9n/messages.bg.json +1 -0
  300. package/dist/cdn/assets/portal-delete-items/t9n/messages.ca.json +1 -0
  301. package/dist/cdn/assets/portal-delete-items/t9n/messages.cs.json +1 -0
  302. package/dist/cdn/assets/portal-delete-items/t9n/messages.da.json +1 -0
  303. package/dist/cdn/assets/portal-delete-items/t9n/messages.de.json +1 -0
  304. package/dist/cdn/assets/portal-delete-items/t9n/messages.el.json +1 -0
  305. package/dist/cdn/assets/portal-delete-items/t9n/messages.en.json +1 -0
  306. package/dist/cdn/assets/portal-delete-items/t9n/messages.es.json +1 -0
  307. package/dist/cdn/assets/portal-delete-items/t9n/messages.et.json +1 -0
  308. package/dist/cdn/assets/portal-delete-items/t9n/messages.fi.json +1 -0
  309. package/dist/cdn/assets/portal-delete-items/t9n/messages.fr.json +1 -0
  310. package/dist/cdn/assets/portal-delete-items/t9n/messages.he.json +1 -0
  311. package/dist/cdn/assets/portal-delete-items/t9n/messages.hr.json +1 -0
  312. package/dist/cdn/assets/portal-delete-items/t9n/messages.hu.json +1 -0
  313. package/dist/cdn/assets/portal-delete-items/t9n/messages.id.json +1 -0
  314. package/dist/cdn/assets/portal-delete-items/t9n/messages.it.json +1 -0
  315. package/dist/cdn/assets/portal-delete-items/t9n/messages.ja.json +1 -0
  316. package/dist/cdn/assets/portal-delete-items/t9n/messages.ko.json +1 -0
  317. package/dist/cdn/assets/portal-delete-items/t9n/messages.lt.json +1 -0
  318. package/dist/cdn/assets/portal-delete-items/t9n/messages.lv.json +1 -0
  319. package/dist/cdn/assets/portal-delete-items/t9n/messages.nl.json +1 -0
  320. package/dist/cdn/assets/portal-delete-items/t9n/messages.no.json +1 -0
  321. package/dist/cdn/assets/portal-delete-items/t9n/messages.pl.json +1 -0
  322. package/dist/cdn/assets/portal-delete-items/t9n/messages.pt-BR.json +1 -0
  323. package/dist/cdn/assets/portal-delete-items/t9n/messages.pt-PT.json +1 -0
  324. package/dist/cdn/assets/portal-delete-items/t9n/messages.ro.json +1 -0
  325. package/dist/cdn/assets/portal-delete-items/t9n/messages.ru.json +1 -0
  326. package/dist/cdn/assets/portal-delete-items/t9n/messages.sk.json +1 -0
  327. package/dist/cdn/assets/portal-delete-items/t9n/messages.sl.json +1 -0
  328. package/dist/cdn/assets/portal-delete-items/t9n/messages.sr.json +1 -0
  329. package/dist/cdn/assets/portal-delete-items/t9n/messages.sv.json +1 -0
  330. package/dist/cdn/assets/portal-delete-items/t9n/messages.th.json +1 -0
  331. package/dist/cdn/assets/portal-delete-items/t9n/messages.tr.json +1 -0
  332. package/dist/cdn/assets/portal-delete-items/t9n/messages.uk.json +1 -0
  333. package/dist/cdn/assets/portal-delete-items/t9n/messages.vi.json +1 -0
  334. package/dist/cdn/assets/portal-delete-items/t9n/messages.zh-CN.json +1 -0
  335. package/dist/cdn/assets/portal-delete-items/t9n/messages.zh-TW.json +1 -0
  336. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.ar.json +1 -0
  337. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.bg.json +1 -0
  338. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.ca.json +1 -0
  339. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.cs.json +1 -0
  340. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.da.json +1 -0
  341. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.de.json +1 -0
  342. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.el.json +1 -0
  343. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.en.json +1 -0
  344. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.es.json +1 -0
  345. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.et.json +1 -0
  346. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.fi.json +1 -0
  347. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.fr.json +1 -0
  348. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.he.json +1 -0
  349. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.hr.json +1 -0
  350. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.hu.json +1 -0
  351. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.id.json +1 -0
  352. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.it.json +1 -0
  353. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.ja.json +1 -0
  354. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.ko.json +1 -0
  355. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.lt.json +1 -0
  356. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.lv.json +1 -0
  357. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.nl.json +1 -0
  358. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.no.json +1 -0
  359. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.pl.json +1 -0
  360. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.pt-BR.json +1 -0
  361. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.pt-PT.json +1 -0
  362. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.ro.json +1 -0
  363. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.ru.json +1 -0
  364. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.sk.json +1 -0
  365. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.sl.json +1 -0
  366. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.sr.json +1 -0
  367. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.sv.json +1 -0
  368. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.th.json +1 -0
  369. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.tr.json +1 -0
  370. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.uk.json +1 -0
  371. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.vi.json +1 -0
  372. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.zh-CN.json +1 -0
  373. package/dist/cdn/assets/portal-delete-items-review/t9n/messages.zh-TW.json +1 -0
  374. package/dist/cdn/assets/portal-entity-picker/t9n/messages.ar.json +1 -0
  375. package/dist/cdn/assets/portal-entity-picker/t9n/messages.bg.json +1 -0
  376. package/dist/cdn/assets/portal-entity-picker/t9n/messages.ca.json +1 -0
  377. package/dist/cdn/assets/portal-entity-picker/t9n/messages.cs.json +1 -0
  378. package/dist/cdn/assets/portal-entity-picker/t9n/messages.da.json +1 -0
  379. package/dist/cdn/assets/portal-entity-picker/t9n/messages.de.json +1 -0
  380. package/dist/cdn/assets/portal-entity-picker/t9n/messages.el.json +1 -0
  381. package/dist/cdn/assets/portal-entity-picker/t9n/messages.en.json +1 -0
  382. package/dist/cdn/assets/portal-entity-picker/t9n/messages.es.json +1 -0
  383. package/dist/cdn/assets/portal-entity-picker/t9n/messages.et.json +1 -0
  384. package/dist/cdn/assets/portal-entity-picker/t9n/messages.fi.json +1 -0
  385. package/dist/cdn/assets/portal-entity-picker/t9n/messages.fr.json +1 -0
  386. package/dist/cdn/assets/portal-entity-picker/t9n/messages.he.json +1 -0
  387. package/dist/cdn/assets/portal-entity-picker/t9n/messages.hr.json +1 -0
  388. package/dist/cdn/assets/portal-entity-picker/t9n/messages.hu.json +1 -0
  389. package/dist/cdn/assets/portal-entity-picker/t9n/messages.id.json +1 -0
  390. package/dist/cdn/assets/portal-entity-picker/t9n/messages.it.json +1 -0
  391. package/dist/cdn/assets/portal-entity-picker/t9n/messages.ja.json +1 -0
  392. package/dist/cdn/assets/portal-entity-picker/t9n/messages.ko.json +1 -0
  393. package/dist/cdn/assets/portal-entity-picker/t9n/messages.lt.json +1 -0
  394. package/dist/cdn/assets/portal-entity-picker/t9n/messages.lv.json +1 -0
  395. package/dist/cdn/assets/portal-entity-picker/t9n/messages.nl.json +1 -0
  396. package/dist/cdn/assets/portal-entity-picker/t9n/messages.no.json +1 -0
  397. package/dist/cdn/assets/portal-entity-picker/t9n/messages.pl.json +1 -0
  398. package/dist/cdn/assets/portal-entity-picker/t9n/messages.pt-BR.json +1 -0
  399. package/dist/cdn/assets/portal-entity-picker/t9n/messages.pt-PT.json +1 -0
  400. package/dist/cdn/assets/portal-entity-picker/t9n/messages.ro.json +1 -0
  401. package/dist/cdn/assets/portal-entity-picker/t9n/messages.ru.json +1 -0
  402. package/dist/cdn/assets/portal-entity-picker/t9n/messages.sk.json +1 -0
  403. package/dist/cdn/assets/portal-entity-picker/t9n/messages.sl.json +1 -0
  404. package/dist/cdn/assets/portal-entity-picker/t9n/messages.sr.json +1 -0
  405. package/dist/cdn/assets/portal-entity-picker/t9n/messages.sv.json +1 -0
  406. package/dist/cdn/assets/portal-entity-picker/t9n/messages.th.json +1 -0
  407. package/dist/cdn/assets/portal-entity-picker/t9n/messages.tr.json +1 -0
  408. package/dist/cdn/assets/portal-entity-picker/t9n/messages.uk.json +1 -0
  409. package/dist/cdn/assets/portal-entity-picker/t9n/messages.vi.json +1 -0
  410. package/dist/cdn/assets/portal-entity-picker/t9n/messages.zh-CN.json +1 -0
  411. package/dist/cdn/assets/portal-entity-picker/t9n/messages.zh-TW.json +1 -0
  412. package/dist/cdn/assets/portal-group-badges/t9n/messages.ar.json +1 -0
  413. package/dist/cdn/assets/portal-group-badges/t9n/messages.bg.json +1 -0
  414. package/dist/cdn/assets/portal-group-badges/t9n/messages.bs.json +1 -0
  415. package/dist/cdn/assets/portal-group-badges/t9n/messages.ca.json +1 -0
  416. package/dist/cdn/assets/portal-group-badges/t9n/messages.cs.json +1 -0
  417. package/dist/cdn/assets/portal-group-badges/t9n/messages.da.json +1 -0
  418. package/dist/cdn/assets/portal-group-badges/t9n/messages.de.json +1 -0
  419. package/dist/cdn/assets/portal-group-badges/t9n/messages.el.json +1 -0
  420. package/dist/cdn/assets/portal-group-badges/t9n/messages.es.json +1 -0
  421. package/dist/cdn/assets/portal-group-badges/t9n/messages.et.json +1 -0
  422. package/dist/cdn/assets/portal-group-badges/t9n/messages.fi.json +1 -0
  423. package/dist/cdn/assets/portal-group-badges/t9n/messages.fr.json +1 -0
  424. package/dist/cdn/assets/portal-group-badges/t9n/messages.he.json +1 -0
  425. package/dist/cdn/assets/portal-group-badges/t9n/messages.hr.json +1 -0
  426. package/dist/cdn/assets/portal-group-badges/t9n/messages.hu.json +1 -0
  427. package/dist/cdn/assets/portal-group-badges/t9n/messages.id.json +1 -0
  428. package/dist/cdn/assets/portal-group-badges/t9n/messages.it.json +1 -0
  429. package/dist/cdn/assets/portal-group-badges/t9n/messages.ja.json +1 -0
  430. package/dist/cdn/assets/portal-group-badges/t9n/messages.ko.json +1 -0
  431. package/dist/cdn/assets/portal-group-badges/t9n/messages.lt.json +1 -0
  432. package/dist/cdn/assets/portal-group-badges/t9n/messages.lv.json +1 -0
  433. package/dist/cdn/assets/portal-group-badges/t9n/messages.nl.json +1 -0
  434. package/dist/cdn/assets/portal-group-badges/t9n/messages.no.json +1 -0
  435. package/dist/cdn/assets/portal-group-badges/t9n/messages.pl.json +1 -0
  436. package/dist/cdn/assets/portal-group-badges/t9n/messages.pt-BR.json +1 -0
  437. package/dist/cdn/assets/portal-group-badges/t9n/messages.pt-PT.json +1 -0
  438. package/dist/cdn/assets/portal-group-badges/t9n/messages.ro.json +1 -0
  439. package/dist/cdn/assets/portal-group-badges/t9n/messages.ru.json +1 -0
  440. package/dist/cdn/assets/portal-group-badges/t9n/messages.sk.json +1 -0
  441. package/dist/cdn/assets/portal-group-badges/t9n/messages.sl.json +1 -0
  442. package/dist/cdn/assets/portal-group-badges/t9n/messages.sr.json +1 -0
  443. package/dist/cdn/assets/portal-group-badges/t9n/messages.sv.json +1 -0
  444. package/dist/cdn/assets/portal-group-badges/t9n/messages.th.json +1 -0
  445. package/dist/cdn/assets/portal-group-badges/t9n/messages.tr.json +1 -0
  446. package/dist/cdn/assets/portal-group-badges/t9n/messages.uk.json +1 -0
  447. package/dist/cdn/assets/portal-group-badges/t9n/messages.vi.json +1 -0
  448. package/dist/cdn/assets/portal-group-badges/t9n/messages.zh-CN.json +1 -0
  449. package/dist/cdn/assets/portal-group-badges/t9n/messages.zh-HK.json +1 -0
  450. package/dist/cdn/assets/portal-group-badges/t9n/messages.zh-TW.json +1 -0
  451. package/dist/cdn/assets/portal-group-browser/t9n/messages.ar.json +1 -0
  452. package/dist/cdn/assets/portal-group-browser/t9n/messages.bg.json +1 -0
  453. package/dist/cdn/assets/portal-group-browser/t9n/messages.bs.json +1 -0
  454. package/dist/cdn/assets/portal-group-browser/t9n/messages.ca.json +1 -0
  455. package/dist/cdn/assets/portal-group-browser/t9n/messages.cs.json +1 -0
  456. package/dist/cdn/assets/portal-group-browser/t9n/messages.da.json +1 -0
  457. package/dist/cdn/assets/portal-group-browser/t9n/messages.de.json +1 -0
  458. package/dist/cdn/assets/portal-group-browser/t9n/messages.el.json +1 -0
  459. package/dist/cdn/assets/portal-group-browser/t9n/messages.en.json +1 -1
  460. package/dist/cdn/assets/portal-group-browser/t9n/messages.es.json +1 -0
  461. package/dist/cdn/assets/portal-group-browser/t9n/messages.et.json +1 -0
  462. package/dist/cdn/assets/portal-group-browser/t9n/messages.fi.json +1 -0
  463. package/dist/cdn/assets/portal-group-browser/t9n/messages.fr.json +1 -0
  464. package/dist/cdn/assets/portal-group-browser/t9n/messages.he.json +1 -0
  465. package/dist/cdn/assets/portal-group-browser/t9n/messages.hr.json +1 -0
  466. package/dist/cdn/assets/portal-group-browser/t9n/messages.hu.json +1 -0
  467. package/dist/cdn/assets/portal-group-browser/t9n/messages.id.json +1 -0
  468. package/dist/cdn/assets/portal-group-browser/t9n/messages.it.json +1 -0
  469. package/dist/cdn/assets/portal-group-browser/t9n/messages.ja.json +1 -0
  470. package/dist/cdn/assets/portal-group-browser/t9n/messages.ko.json +1 -0
  471. package/dist/cdn/assets/portal-group-browser/t9n/messages.lt.json +1 -0
  472. package/dist/cdn/assets/portal-group-browser/t9n/messages.lv.json +1 -0
  473. package/dist/cdn/assets/portal-group-browser/t9n/messages.nl.json +1 -0
  474. package/dist/cdn/assets/portal-group-browser/t9n/messages.no.json +1 -0
  475. package/dist/cdn/assets/portal-group-browser/t9n/messages.pl.json +1 -0
  476. package/dist/cdn/assets/portal-group-browser/t9n/messages.pt-BR.json +1 -0
  477. package/dist/cdn/assets/portal-group-browser/t9n/messages.pt-PT.json +1 -0
  478. package/dist/cdn/assets/portal-group-browser/t9n/messages.ro.json +1 -0
  479. package/dist/cdn/assets/portal-group-browser/t9n/messages.ru.json +1 -0
  480. package/dist/cdn/assets/portal-group-browser/t9n/messages.sk.json +1 -0
  481. package/dist/cdn/assets/portal-group-browser/t9n/messages.sl.json +1 -0
  482. package/dist/cdn/assets/portal-group-browser/t9n/messages.sr.json +1 -0
  483. package/dist/cdn/assets/portal-group-browser/t9n/messages.sv.json +1 -0
  484. package/dist/cdn/assets/portal-group-browser/t9n/messages.th.json +1 -0
  485. package/dist/cdn/assets/portal-group-browser/t9n/messages.tr.json +1 -0
  486. package/dist/cdn/assets/portal-group-browser/t9n/messages.uk.json +1 -0
  487. package/dist/cdn/assets/portal-group-browser/t9n/messages.vi.json +1 -0
  488. package/dist/cdn/assets/portal-group-browser/t9n/messages.zh-CN.json +1 -0
  489. package/dist/cdn/assets/portal-group-browser/t9n/messages.zh-HK.json +1 -0
  490. package/dist/cdn/assets/portal-group-browser/t9n/messages.zh-TW.json +1 -0
  491. package/dist/cdn/assets/portal-group-card/t9n/messages.ar.json +1 -0
  492. package/dist/cdn/assets/portal-group-card/t9n/messages.bg.json +1 -0
  493. package/dist/cdn/assets/portal-group-card/t9n/messages.bs.json +1 -0
  494. package/dist/cdn/assets/portal-group-card/t9n/messages.ca.json +1 -0
  495. package/dist/cdn/assets/portal-group-card/t9n/messages.cs.json +1 -0
  496. package/dist/cdn/assets/portal-group-card/t9n/messages.da.json +1 -0
  497. package/dist/cdn/assets/portal-group-card/t9n/messages.de.json +1 -0
  498. package/dist/cdn/assets/portal-group-card/t9n/messages.el.json +1 -0
  499. package/dist/cdn/assets/portal-group-card/t9n/messages.es.json +1 -0
  500. package/dist/cdn/assets/portal-group-card/t9n/messages.et.json +1 -0
  501. package/dist/cdn/assets/portal-group-card/t9n/messages.fi.json +1 -0
  502. package/dist/cdn/assets/portal-group-card/t9n/messages.fr.json +1 -0
  503. package/dist/cdn/assets/portal-group-card/t9n/messages.he.json +1 -0
  504. package/dist/cdn/assets/portal-group-card/t9n/messages.hr.json +1 -0
  505. package/dist/cdn/assets/portal-group-card/t9n/messages.hu.json +1 -0
  506. package/dist/cdn/assets/portal-group-card/t9n/messages.id.json +1 -0
  507. package/dist/cdn/assets/portal-group-card/t9n/messages.it.json +1 -0
  508. package/dist/cdn/assets/portal-group-card/t9n/messages.ja.json +1 -0
  509. package/dist/cdn/assets/portal-group-card/t9n/messages.ko.json +1 -0
  510. package/dist/cdn/assets/portal-group-card/t9n/messages.lt.json +1 -0
  511. package/dist/cdn/assets/portal-group-card/t9n/messages.lv.json +1 -0
  512. package/dist/cdn/assets/portal-group-card/t9n/messages.nl.json +1 -0
  513. package/dist/cdn/assets/portal-group-card/t9n/messages.no.json +1 -0
  514. package/dist/cdn/assets/portal-group-card/t9n/messages.pl.json +1 -0
  515. package/dist/cdn/assets/portal-group-card/t9n/messages.pt-BR.json +1 -0
  516. package/dist/cdn/assets/portal-group-card/t9n/messages.pt-PT.json +1 -0
  517. package/dist/cdn/assets/portal-group-card/t9n/messages.ro.json +1 -0
  518. package/dist/cdn/assets/portal-group-card/t9n/messages.ru.json +1 -0
  519. package/dist/cdn/assets/portal-group-card/t9n/messages.sk.json +1 -0
  520. package/dist/cdn/assets/portal-group-card/t9n/messages.sl.json +1 -0
  521. package/dist/cdn/assets/portal-group-card/t9n/messages.sr.json +1 -0
  522. package/dist/cdn/assets/portal-group-card/t9n/messages.sv.json +1 -0
  523. package/dist/cdn/assets/portal-group-card/t9n/messages.th.json +1 -0
  524. package/dist/cdn/assets/portal-group-card/t9n/messages.tr.json +1 -0
  525. package/dist/cdn/assets/portal-group-card/t9n/messages.uk.json +1 -0
  526. package/dist/cdn/assets/portal-group-card/t9n/messages.vi.json +1 -0
  527. package/dist/cdn/assets/portal-group-card/t9n/messages.zh-CN.json +1 -0
  528. package/dist/cdn/assets/portal-group-card/t9n/messages.zh-HK.json +1 -0
  529. package/dist/cdn/assets/portal-group-card/t9n/messages.zh-TW.json +1 -0
  530. package/dist/cdn/assets/portal-item-badges/t9n/messages.ar.json +1 -0
  531. package/dist/cdn/assets/portal-item-badges/t9n/messages.bg.json +1 -0
  532. package/dist/cdn/assets/portal-item-badges/t9n/messages.bs.json +1 -0
  533. package/dist/cdn/assets/portal-item-badges/t9n/messages.ca.json +1 -0
  534. package/dist/cdn/assets/portal-item-badges/t9n/messages.cs.json +1 -0
  535. package/dist/cdn/assets/portal-item-badges/t9n/messages.da.json +1 -0
  536. package/dist/cdn/assets/portal-item-badges/t9n/messages.de.json +1 -0
  537. package/dist/cdn/assets/portal-item-badges/t9n/messages.el.json +1 -0
  538. package/dist/cdn/assets/portal-item-badges/t9n/messages.es.json +1 -0
  539. package/dist/cdn/assets/portal-item-badges/t9n/messages.et.json +1 -0
  540. package/dist/cdn/assets/portal-item-badges/t9n/messages.fi.json +1 -0
  541. package/dist/cdn/assets/portal-item-badges/t9n/messages.fr.json +1 -0
  542. package/dist/cdn/assets/portal-item-badges/t9n/messages.he.json +1 -0
  543. package/dist/cdn/assets/portal-item-badges/t9n/messages.hr.json +1 -0
  544. package/dist/cdn/assets/portal-item-badges/t9n/messages.hu.json +1 -0
  545. package/dist/cdn/assets/portal-item-badges/t9n/messages.id.json +1 -0
  546. package/dist/cdn/assets/portal-item-badges/t9n/messages.it.json +1 -0
  547. package/dist/cdn/assets/portal-item-badges/t9n/messages.ja.json +1 -0
  548. package/dist/cdn/assets/portal-item-badges/t9n/messages.ko.json +1 -0
  549. package/dist/cdn/assets/portal-item-badges/t9n/messages.lt.json +1 -0
  550. package/dist/cdn/assets/portal-item-badges/t9n/messages.lv.json +1 -0
  551. package/dist/cdn/assets/portal-item-badges/t9n/messages.nl.json +1 -0
  552. package/dist/cdn/assets/portal-item-badges/t9n/messages.no.json +1 -0
  553. package/dist/cdn/assets/portal-item-badges/t9n/messages.pl.json +1 -0
  554. package/dist/cdn/assets/portal-item-badges/t9n/messages.pt-BR.json +1 -0
  555. package/dist/cdn/assets/portal-item-badges/t9n/messages.pt-PT.json +1 -0
  556. package/dist/cdn/assets/portal-item-badges/t9n/messages.ro.json +1 -0
  557. package/dist/cdn/assets/portal-item-badges/t9n/messages.ru.json +1 -0
  558. package/dist/cdn/assets/portal-item-badges/t9n/messages.sk.json +1 -0
  559. package/dist/cdn/assets/portal-item-badges/t9n/messages.sl.json +1 -0
  560. package/dist/cdn/assets/portal-item-badges/t9n/messages.sr.json +1 -0
  561. package/dist/cdn/assets/portal-item-badges/t9n/messages.sv.json +1 -0
  562. package/dist/cdn/assets/portal-item-badges/t9n/messages.th.json +1 -0
  563. package/dist/cdn/assets/portal-item-badges/t9n/messages.tr.json +1 -0
  564. package/dist/cdn/assets/portal-item-badges/t9n/messages.uk.json +1 -0
  565. package/dist/cdn/assets/portal-item-badges/t9n/messages.vi.json +1 -0
  566. package/dist/cdn/assets/portal-item-badges/t9n/messages.zh-CN.json +1 -0
  567. package/dist/cdn/assets/portal-item-badges/t9n/messages.zh-HK.json +1 -0
  568. package/dist/cdn/assets/portal-item-badges/t9n/messages.zh-TW.json +1 -0
  569. package/dist/cdn/assets/portal-item-card/t9n/messages.ar.json +1 -0
  570. package/dist/cdn/assets/portal-item-card/t9n/messages.bg.json +1 -0
  571. package/dist/cdn/assets/portal-item-card/t9n/messages.bs.json +1 -0
  572. package/dist/cdn/assets/portal-item-card/t9n/messages.ca.json +1 -0
  573. package/dist/cdn/assets/portal-item-card/t9n/messages.cs.json +1 -0
  574. package/dist/cdn/assets/portal-item-card/t9n/messages.da.json +1 -0
  575. package/dist/cdn/assets/portal-item-card/t9n/messages.de.json +1 -0
  576. package/dist/cdn/assets/portal-item-card/t9n/messages.el.json +1 -0
  577. package/dist/cdn/assets/portal-item-card/t9n/messages.es.json +1 -0
  578. package/dist/cdn/assets/portal-item-card/t9n/messages.et.json +1 -0
  579. package/dist/cdn/assets/portal-item-card/t9n/messages.fi.json +1 -0
  580. package/dist/cdn/assets/portal-item-card/t9n/messages.fr.json +1 -0
  581. package/dist/cdn/assets/portal-item-card/t9n/messages.he.json +1 -0
  582. package/dist/cdn/assets/portal-item-card/t9n/messages.hr.json +1 -0
  583. package/dist/cdn/assets/portal-item-card/t9n/messages.hu.json +1 -0
  584. package/dist/cdn/assets/portal-item-card/t9n/messages.id.json +1 -0
  585. package/dist/cdn/assets/portal-item-card/t9n/messages.it.json +1 -0
  586. package/dist/cdn/assets/portal-item-card/t9n/messages.ja.json +1 -0
  587. package/dist/cdn/assets/portal-item-card/t9n/messages.ko.json +1 -0
  588. package/dist/cdn/assets/portal-item-card/t9n/messages.lt.json +1 -0
  589. package/dist/cdn/assets/portal-item-card/t9n/messages.lv.json +1 -0
  590. package/dist/cdn/assets/portal-item-card/t9n/messages.nl.json +1 -0
  591. package/dist/cdn/assets/portal-item-card/t9n/messages.no.json +1 -0
  592. package/dist/cdn/assets/portal-item-card/t9n/messages.pl.json +1 -0
  593. package/dist/cdn/assets/portal-item-card/t9n/messages.pt-BR.json +1 -0
  594. package/dist/cdn/assets/portal-item-card/t9n/messages.pt-PT.json +1 -0
  595. package/dist/cdn/assets/portal-item-card/t9n/messages.ro.json +1 -0
  596. package/dist/cdn/assets/portal-item-card/t9n/messages.ru.json +1 -0
  597. package/dist/cdn/assets/portal-item-card/t9n/messages.sk.json +1 -0
  598. package/dist/cdn/assets/portal-item-card/t9n/messages.sl.json +1 -0
  599. package/dist/cdn/assets/portal-item-card/t9n/messages.sr.json +1 -0
  600. package/dist/cdn/assets/portal-item-card/t9n/messages.sv.json +1 -0
  601. package/dist/cdn/assets/portal-item-card/t9n/messages.th.json +1 -0
  602. package/dist/cdn/assets/portal-item-card/t9n/messages.tr.json +1 -0
  603. package/dist/cdn/assets/portal-item-card/t9n/messages.uk.json +1 -0
  604. package/dist/cdn/assets/portal-item-card/t9n/messages.vi.json +1 -0
  605. package/dist/cdn/assets/portal-item-card/t9n/messages.zh-CN.json +1 -0
  606. package/dist/cdn/assets/portal-item-card/t9n/messages.zh-HK.json +1 -0
  607. package/dist/cdn/assets/portal-item-card/t9n/messages.zh-TW.json +1 -0
  608. package/dist/cdn/assets/portal-item-favorite/t9n/messages.ar.json +1 -0
  609. package/dist/cdn/assets/portal-item-favorite/t9n/messages.bg.json +1 -0
  610. package/dist/cdn/assets/portal-item-favorite/t9n/messages.bs.json +1 -0
  611. package/dist/cdn/assets/portal-item-favorite/t9n/messages.ca.json +1 -0
  612. package/dist/cdn/assets/portal-item-favorite/t9n/messages.cs.json +1 -0
  613. package/dist/cdn/assets/portal-item-favorite/t9n/messages.da.json +1 -0
  614. package/dist/cdn/assets/portal-item-favorite/t9n/messages.de.json +1 -0
  615. package/dist/cdn/assets/portal-item-favorite/t9n/messages.el.json +1 -0
  616. package/dist/cdn/assets/portal-item-favorite/t9n/messages.es.json +1 -0
  617. package/dist/cdn/assets/portal-item-favorite/t9n/messages.et.json +1 -0
  618. package/dist/cdn/assets/portal-item-favorite/t9n/messages.fi.json +1 -0
  619. package/dist/cdn/assets/portal-item-favorite/t9n/messages.fr.json +1 -0
  620. package/dist/cdn/assets/portal-item-favorite/t9n/messages.he.json +1 -0
  621. package/dist/cdn/assets/portal-item-favorite/t9n/messages.hr.json +1 -0
  622. package/dist/cdn/assets/portal-item-favorite/t9n/messages.hu.json +1 -0
  623. package/dist/cdn/assets/portal-item-favorite/t9n/messages.id.json +1 -0
  624. package/dist/cdn/assets/portal-item-favorite/t9n/messages.it.json +1 -0
  625. package/dist/cdn/assets/portal-item-favorite/t9n/messages.ja.json +1 -0
  626. package/dist/cdn/assets/portal-item-favorite/t9n/messages.ko.json +1 -0
  627. package/dist/cdn/assets/portal-item-favorite/t9n/messages.lt.json +1 -0
  628. package/dist/cdn/assets/portal-item-favorite/t9n/messages.lv.json +1 -0
  629. package/dist/cdn/assets/portal-item-favorite/t9n/messages.nl.json +1 -0
  630. package/dist/cdn/assets/portal-item-favorite/t9n/messages.no.json +1 -0
  631. package/dist/cdn/assets/portal-item-favorite/t9n/messages.pl.json +1 -0
  632. package/dist/cdn/assets/portal-item-favorite/t9n/messages.pt-BR.json +1 -0
  633. package/dist/cdn/assets/portal-item-favorite/t9n/messages.pt-PT.json +1 -0
  634. package/dist/cdn/assets/portal-item-favorite/t9n/messages.ro.json +1 -0
  635. package/dist/cdn/assets/portal-item-favorite/t9n/messages.ru.json +1 -0
  636. package/dist/cdn/assets/portal-item-favorite/t9n/messages.sk.json +1 -0
  637. package/dist/cdn/assets/portal-item-favorite/t9n/messages.sl.json +1 -0
  638. package/dist/cdn/assets/portal-item-favorite/t9n/messages.sr.json +1 -0
  639. package/dist/cdn/assets/portal-item-favorite/t9n/messages.sv.json +1 -0
  640. package/dist/cdn/assets/portal-item-favorite/t9n/messages.th.json +1 -0
  641. package/dist/cdn/assets/portal-item-favorite/t9n/messages.tr.json +1 -0
  642. package/dist/cdn/assets/portal-item-favorite/t9n/messages.uk.json +1 -0
  643. package/dist/cdn/assets/portal-item-favorite/t9n/messages.vi.json +1 -0
  644. package/dist/cdn/assets/portal-item-favorite/t9n/messages.zh-CN.json +1 -0
  645. package/dist/cdn/assets/portal-item-favorite/t9n/messages.zh-HK.json +1 -0
  646. package/dist/cdn/assets/portal-item-favorite/t9n/messages.zh-TW.json +1 -0
  647. package/dist/cdn/assets/portal-item-thumbnail/administrativereport.avif +0 -0
  648. package/dist/cdn/assets/portal-item-thumbnail/analysismodel.avif +0 -0
  649. package/dist/cdn/assets/portal-item-thumbnail/apacheparquet.avif +0 -0
  650. package/dist/cdn/assets/portal-item-thumbnail/apikey.avif +0 -0
  651. package/dist/cdn/assets/portal-item-thumbnail/applicationtheme.avif +0 -0
  652. package/dist/cdn/assets/portal-item-thumbnail/bigdataanalytic.avif +0 -0
  653. package/dist/cdn/assets/portal-item-thumbnail/classificationschema.avif +0 -0
  654. package/dist/cdn/assets/portal-item-thumbnail/classifierdefinition.avif +0 -0
  655. package/dist/cdn/assets/portal-item-thumbnail/dashboards.avif +0 -0
  656. package/dist/cdn/assets/portal-item-thumbnail/dataengineeringmodel.avif +0 -0
  657. package/dist/cdn/assets/portal-item-thumbnail/dataengineeringworkbook.avif +0 -0
  658. package/dist/cdn/assets/portal-item-thumbnail/datapipeline.avif +0 -0
  659. package/dist/cdn/assets/portal-item-thumbnail/deeplearningpackage.avif +0 -0
  660. package/dist/cdn/assets/portal-item-thumbnail/deeplearningstudioproject.avif +0 -0
  661. package/dist/cdn/assets/portal-item-thumbnail/default.avif +0 -0
  662. package/dist/cdn/assets/portal-item-thumbnail/dictionarystyle.avif +0 -0
  663. package/dist/cdn/assets/portal-item-thumbnail/discussion.avif +0 -0
  664. package/dist/cdn/assets/portal-item-thumbnail/earthconfiguration.avif +0 -0
  665. package/dist/cdn/assets/portal-item-thumbnail/excaliburimageryproject.avif +0 -0
  666. package/dist/cdn/assets/portal-item-thumbnail/experiencebuilderwidget.avif +0 -0
  667. package/dist/cdn/assets/portal-item-thumbnail/experiencebuilderwidgetpackage.avif +0 -0
  668. package/dist/cdn/assets/portal-item-thumbnail/feed.avif +0 -0
  669. package/dist/cdn/assets/portal-item-thumbnail/gaussiansplatlayer.avif +0 -0
  670. package/dist/cdn/assets/portal-item-thumbnail/geodataservice.avif +0 -0
  671. package/dist/cdn/assets/portal-item-thumbnail/hubevent.avif +0 -0
  672. package/dist/cdn/assets/portal-item-thumbnail/hubinitiative.avif +0 -0
  673. package/dist/cdn/assets/portal-item-thumbnail/hubinitiativetemplate.avif +0 -0
  674. package/dist/cdn/assets/portal-item-thumbnail/hubpage.avif +0 -0
  675. package/dist/cdn/assets/portal-item-thumbnail/hubproject.avif +0 -0
  676. package/dist/cdn/assets/portal-item-thumbnail/hubsite.avif +0 -0
  677. package/dist/cdn/assets/portal-item-thumbnail/imagerylayer.avif +0 -0
  678. package/dist/cdn/assets/portal-item-thumbnail/indoor-positioning-data-service.avif +0 -0
  679. package/dist/cdn/assets/portal-item-thumbnail/insightsscript.avif +0 -0
  680. package/dist/cdn/assets/portal-item-thumbnail/insightstheme.avif +0 -0
  681. package/dist/cdn/assets/portal-item-thumbnail/insightsworkbookpackage.avif +0 -0
  682. package/dist/cdn/assets/portal-item-thumbnail/investigation.avif +0 -0
  683. package/dist/cdn/assets/portal-item-thumbnail/kernelgatewayconnection.avif +0 -0
  684. package/dist/cdn/assets/portal-item-thumbnail/knowledgegraph.avif +0 -0
  685. package/dist/cdn/assets/portal-item-thumbnail/knowledgegraphconfiguration.avif +0 -0
  686. package/dist/cdn/assets/portal-item-thumbnail/knowledgegraphlayer.avif +0 -0
  687. package/dist/cdn/assets/portal-item-thumbnail/knowledgestudio.avif +0 -0
  688. package/dist/cdn/assets/portal-item-thumbnail/linkchart.avif +0 -0
  689. package/dist/cdn/assets/portal-item-thumbnail/locationtrackingservice.avif +0 -0
  690. package/dist/cdn/assets/portal-item-thumbnail/mapshowcase.avif +0 -0
  691. package/dist/cdn/assets/portal-item-thumbnail/mediaservice.avif +0 -0
  692. package/dist/cdn/assets/portal-item-thumbnail/mission.avif +0 -0
  693. package/dist/cdn/assets/portal-item-thumbnail/missionreport.avif +0 -0
  694. package/dist/cdn/assets/portal-item-thumbnail/missiontemplate.avif +0 -0
  695. package/dist/cdn/assets/portal-item-thumbnail/mobileapp.avif +0 -0
  696. package/dist/cdn/assets/portal-item-thumbnail/mobilescenepackage.avif +0 -0
  697. package/dist/cdn/assets/portal-item-thumbnail/notebook.avif +0 -0
  698. package/dist/cdn/assets/portal-item-thumbnail/notebookcodesnippets.avif +0 -0
  699. package/dist/cdn/assets/portal-item-thumbnail/notebookwebtool.avif +0 -0
  700. package/dist/cdn/assets/portal-item-thumbnail/opsdashboard.avif +0 -0
  701. package/dist/cdn/assets/portal-item-thumbnail/orthomappingproject.avif +0 -0
  702. package/dist/cdn/assets/portal-item-thumbnail/orthomappingtemplate.avif +0 -0
  703. package/dist/cdn/assets/portal-item-thumbnail/pro-presentation.avif +0 -0
  704. package/dist/cdn/assets/portal-item-thumbnail/propackage.avif +0 -0
  705. package/dist/cdn/assets/portal-item-thumbnail/proreport.avif +0 -0
  706. package/dist/cdn/assets/portal-item-thumbnail/proreporttemplate.avif +0 -0
  707. package/dist/cdn/assets/portal-item-thumbnail/quickcaptureproject.avif +0 -0
  708. package/dist/cdn/assets/portal-item-thumbnail/rasterfunctiontemplate.avif +0 -0
  709. package/dist/cdn/assets/portal-item-thumbnail/realitymappingproject.avif +0 -0
  710. package/dist/cdn/assets/portal-item-thumbnail/realtimeanalytic.avif +0 -0
  711. package/dist/cdn/assets/portal-item-thumbnail/scene.avif +0 -0
  712. package/dist/cdn/assets/portal-item-thumbnail/serviceconnection.avif +0 -0
  713. package/dist/cdn/assets/portal-item-thumbnail/solution.avif +0 -0
  714. package/dist/cdn/assets/portal-item-thumbnail/spectrallibrary.avif +0 -0
  715. package/dist/cdn/assets/portal-item-thumbnail/storymap.avif +0 -0
  716. package/dist/cdn/assets/portal-item-thumbnail/storymapcollection.avif +0 -0
  717. package/dist/cdn/assets/portal-item-thumbnail/storymaptheme.avif +0 -0
  718. package/dist/cdn/assets/portal-item-thumbnail/style.avif +0 -0
  719. package/dist/cdn/assets/portal-item-thumbnail/suitabilitymodel.avif +0 -0
  720. package/dist/cdn/assets/portal-item-thumbnail/survey123addin.avif +0 -0
  721. package/dist/cdn/assets/portal-item-thumbnail/tiledimagerylayer.avif +0 -0
  722. package/dist/cdn/assets/portal-item-thumbnail/urbanmodel.avif +0 -0
  723. package/dist/cdn/assets/portal-item-thumbnail/urbanproject.avif +0 -0
  724. package/dist/cdn/assets/portal-item-thumbnail/webapp.avif +0 -0
  725. package/dist/cdn/assets/portal-item-thumbnail/webexperience.avif +0 -0
  726. package/dist/cdn/assets/portal-item-thumbnail/webexperiencetemplate.avif +0 -0
  727. package/dist/cdn/assets/portal-item-thumbnail/webtool.avif +0 -0
  728. package/dist/cdn/assets/portal-item-thumbnail/workflow.avif +0 -0
  729. package/dist/cdn/assets/portal-item-thumbnail/workforceproject.avif +0 -0
  730. package/dist/cdn/assets/portal-item-thumbnail/xrexperience.avif +0 -0
  731. package/dist/cdn/assets/portal-item-type/icons/360vr16.svg +0 -0
  732. package/dist/cdn/assets/portal-item-type/icons/360vr32.svg +0 -0
  733. package/dist/cdn/assets/portal-item-type/icons/insightstheme16.svg +0 -0
  734. package/dist/cdn/assets/portal-item-type/icons/insightstheme32.svg +0 -0
  735. package/dist/cdn/assets/portal-item-type/icons/knowledgegraphconfiguration16.svg +0 -0
  736. package/dist/cdn/assets/portal-item-type/icons/knowledgegraphconfiguration32.svg +0 -0
  737. package/dist/cdn/assets/portal-item-type/icons/knowledgegraphlayer16.svg +0 -0
  738. package/dist/cdn/assets/portal-item-type/icons/knowledgegraphlayer32.svg +0 -0
  739. package/dist/cdn/assets/portal-item-type/icons/missiontemplate16.svg +0 -0
  740. package/dist/cdn/assets/portal-item-type/icons/missiontemplate32.svg +0 -0
  741. package/dist/cdn/assets/portal-item-type/icons/propresentation16.svg +0 -0
  742. package/dist/cdn/assets/portal-item-type/icons/propresentation32.svg +0 -0
  743. package/dist/cdn/assets/portal-item-type/t9n/messages.ar.json +1 -1
  744. package/dist/cdn/assets/portal-item-type/t9n/messages.bg.json +1 -1
  745. package/dist/cdn/assets/portal-item-type/t9n/messages.bs.json +1 -1
  746. package/dist/cdn/assets/portal-item-type/t9n/messages.ca.json +1 -1
  747. package/dist/cdn/assets/portal-item-type/t9n/messages.cs.json +1 -1
  748. package/dist/cdn/assets/portal-item-type/t9n/messages.da.json +1 -1
  749. package/dist/cdn/assets/portal-item-type/t9n/messages.de.json +1 -1
  750. package/dist/cdn/assets/portal-item-type/t9n/messages.el.json +1 -1
  751. package/dist/cdn/assets/portal-item-type/t9n/messages.es.json +1 -1
  752. package/dist/cdn/assets/portal-item-type/t9n/messages.et.json +1 -1
  753. package/dist/cdn/assets/portal-item-type/t9n/messages.fi.json +1 -1
  754. package/dist/cdn/assets/portal-item-type/t9n/messages.fr.json +1 -1
  755. package/dist/cdn/assets/portal-item-type/t9n/messages.he.json +1 -1
  756. package/dist/cdn/assets/portal-item-type/t9n/messages.hr.json +1 -1
  757. package/dist/cdn/assets/portal-item-type/t9n/messages.hu.json +1 -1
  758. package/dist/cdn/assets/portal-item-type/t9n/messages.id.json +1 -1
  759. package/dist/cdn/assets/portal-item-type/t9n/messages.it.json +1 -1
  760. package/dist/cdn/assets/portal-item-type/t9n/messages.ja.json +1 -1
  761. package/dist/cdn/assets/portal-item-type/t9n/messages.ko.json +1 -1
  762. package/dist/cdn/assets/portal-item-type/t9n/messages.lt.json +1 -1
  763. package/dist/cdn/assets/portal-item-type/t9n/messages.lv.json +1 -1
  764. package/dist/cdn/assets/portal-item-type/t9n/messages.nl.json +1 -1
  765. package/dist/cdn/assets/portal-item-type/t9n/messages.no.json +1 -1
  766. package/dist/cdn/assets/portal-item-type/t9n/messages.pl.json +1 -1
  767. package/dist/cdn/assets/portal-item-type/t9n/messages.pt-BR.json +1 -1
  768. package/dist/cdn/assets/portal-item-type/t9n/messages.pt-PT.json +1 -1
  769. package/dist/cdn/assets/portal-item-type/t9n/messages.ro.json +1 -1
  770. package/dist/cdn/assets/portal-item-type/t9n/messages.ru.json +1 -1
  771. package/dist/cdn/assets/portal-item-type/t9n/messages.sk.json +1 -1
  772. package/dist/cdn/assets/portal-item-type/t9n/messages.sl.json +1 -1
  773. package/dist/cdn/assets/portal-item-type/t9n/messages.sr.json +1 -1
  774. package/dist/cdn/assets/portal-item-type/t9n/messages.sv.json +1 -1
  775. package/dist/cdn/assets/portal-item-type/t9n/messages.th.json +1 -1
  776. package/dist/cdn/assets/portal-item-type/t9n/messages.tr.json +1 -1
  777. package/dist/cdn/assets/portal-item-type/t9n/messages.uk.json +1 -1
  778. package/dist/cdn/assets/portal-item-type/t9n/messages.vi.json +1 -1
  779. package/dist/cdn/assets/portal-item-type/t9n/messages.zh-CN.json +1 -1
  780. package/dist/cdn/assets/portal-item-type/t9n/messages.zh-HK.json +1 -1
  781. package/dist/cdn/assets/portal-item-type/t9n/messages.zh-TW.json +1 -1
  782. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-api-for-python-glyph-32.svg +0 -0
  783. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-connectors-for-power-automate-glyph-32.svg +0 -0
  784. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-drone2map-glyph-32.svg +0 -0
  785. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-earth-glyph-32.svg +0 -0
  786. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-enterprise-glyph-32.svg +0 -0
  787. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-excalibur-glyph-32.svg +0 -0
  788. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-excalibur-gray-glyph-32.svg +0 -0
  789. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-explorer-glyph-32.svg +0 -0
  790. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-autodesk-forma-glyph-32.svg +0 -0
  791. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-living-atlas-of-the-world-glyph-32.svg +0 -0
  792. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-logo-glyph-32.svg +0 -0
  793. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-monitor-glyph-32.svg +0 -0
  794. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-monitor-white-glyph-32.svg +0 -0
  795. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-navigator-glyph-32.svg +0 -0
  796. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-online-glyph-32.svg +0 -0
  797. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-ortho-maker-glyph-32.svg +0 -0
  798. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pro-glyph-32.svg +0 -0
  799. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-survey123-connect-glyph-32.svg +0 -0
  800. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-survey123-glyph-32.svg +0 -0
  801. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-web-appbuilder-glyph-32.svg +0 -0
  802. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-web-editor-glyph-32.svg +0 -0
  803. package/dist/cdn/assets/portal-navigation/product-logos/calcite-design-system-glyph-32.svg +0 -0
  804. package/dist/cdn/assets/portal-navigation/product-logos/esri-offline-documentation-center--glyph-32.svg +0 -0
  805. package/dist/cdn/assets/portal-navigation/product-logos/sceneviewer-glyph-32.svg +0 -0
  806. package/dist/cdn/assets/portal-navigation/product-logos/xr-viewer-glyph-32.svg +0 -0
  807. package/dist/cdn/assets/portal-navigation/t9n/messages.ar.json +1 -0
  808. package/dist/cdn/assets/portal-navigation/t9n/messages.bg.json +1 -0
  809. package/dist/cdn/assets/portal-navigation/t9n/messages.bs.json +1 -0
  810. package/dist/cdn/assets/portal-navigation/t9n/messages.ca.json +1 -0
  811. package/dist/cdn/assets/portal-navigation/t9n/messages.cs.json +1 -0
  812. package/dist/cdn/assets/portal-navigation/t9n/messages.da.json +1 -0
  813. package/dist/cdn/assets/portal-navigation/t9n/messages.de.json +1 -0
  814. package/dist/cdn/assets/portal-navigation/t9n/messages.el.json +1 -0
  815. package/dist/cdn/assets/portal-navigation/t9n/messages.es.json +1 -0
  816. package/dist/cdn/assets/portal-navigation/t9n/messages.et.json +1 -0
  817. package/dist/cdn/assets/portal-navigation/t9n/messages.fi.json +1 -0
  818. package/dist/cdn/assets/portal-navigation/t9n/messages.fr.json +1 -0
  819. package/dist/cdn/assets/portal-navigation/t9n/messages.he.json +1 -0
  820. package/dist/cdn/assets/portal-navigation/t9n/messages.hr.json +1 -0
  821. package/dist/cdn/assets/portal-navigation/t9n/messages.hu.json +1 -0
  822. package/dist/cdn/assets/portal-navigation/t9n/messages.id.json +1 -0
  823. package/dist/cdn/assets/portal-navigation/t9n/messages.it.json +1 -0
  824. package/dist/cdn/assets/portal-navigation/t9n/messages.ja.json +1 -0
  825. package/dist/cdn/assets/portal-navigation/t9n/messages.ko.json +1 -0
  826. package/dist/cdn/assets/portal-navigation/t9n/messages.lt.json +1 -0
  827. package/dist/cdn/assets/portal-navigation/t9n/messages.lv.json +1 -0
  828. package/dist/cdn/assets/portal-navigation/t9n/messages.nl.json +1 -0
  829. package/dist/cdn/assets/portal-navigation/t9n/messages.no.json +1 -0
  830. package/dist/cdn/assets/portal-navigation/t9n/messages.pl.json +1 -0
  831. package/dist/cdn/assets/portal-navigation/t9n/messages.pt-BR.json +1 -0
  832. package/dist/cdn/assets/portal-navigation/t9n/messages.pt-PT.json +1 -0
  833. package/dist/cdn/assets/portal-navigation/t9n/messages.ro.json +1 -0
  834. package/dist/cdn/assets/portal-navigation/t9n/messages.ru.json +1 -0
  835. package/dist/cdn/assets/portal-navigation/t9n/messages.sk.json +1 -0
  836. package/dist/cdn/assets/portal-navigation/t9n/messages.sl.json +1 -0
  837. package/dist/cdn/assets/portal-navigation/t9n/messages.sr.json +1 -0
  838. package/dist/cdn/assets/portal-navigation/t9n/messages.sv.json +1 -0
  839. package/dist/cdn/assets/portal-navigation/t9n/messages.th.json +1 -0
  840. package/dist/cdn/assets/portal-navigation/t9n/messages.tr.json +1 -0
  841. package/dist/cdn/assets/portal-navigation/t9n/messages.uk.json +1 -0
  842. package/dist/cdn/assets/portal-navigation/t9n/messages.vi.json +1 -0
  843. package/dist/cdn/assets/portal-navigation/t9n/messages.zh-CN.json +1 -0
  844. package/dist/cdn/assets/portal-navigation/t9n/messages.zh-HK.json +1 -0
  845. package/dist/cdn/assets/portal-navigation/t9n/messages.zh-TW.json +1 -0
  846. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.ar.json +1 -0
  847. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.bg.json +1 -0
  848. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.ca.json +1 -0
  849. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.cs.json +1 -0
  850. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.da.json +1 -0
  851. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.de.json +1 -0
  852. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.el.json +1 -0
  853. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.en.json +1 -0
  854. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.es.json +1 -0
  855. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.et.json +1 -0
  856. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.fi.json +1 -0
  857. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.fr.json +1 -0
  858. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.he.json +1 -0
  859. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.hr.json +1 -0
  860. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.hu.json +1 -0
  861. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.id.json +1 -0
  862. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.it.json +1 -0
  863. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.ja.json +1 -0
  864. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.ko.json +1 -0
  865. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.lt.json +1 -0
  866. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.lv.json +1 -0
  867. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.nl.json +1 -0
  868. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.no.json +1 -0
  869. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.pl.json +1 -0
  870. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.pt-BR.json +1 -0
  871. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.pt-PT.json +1 -0
  872. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.ro.json +1 -0
  873. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.ru.json +1 -0
  874. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.sk.json +1 -0
  875. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.sl.json +1 -0
  876. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.sr.json +1 -0
  877. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.sv.json +1 -0
  878. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.th.json +1 -0
  879. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.tr.json +1 -0
  880. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.uk.json +1 -0
  881. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.vi.json +1 -0
  882. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.zh-CN.json +1 -0
  883. package/dist/cdn/assets/portal-related-items-list-item/t9n/messages.zh-TW.json +1 -0
  884. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.bg.json +1 -1
  885. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.cs.json +1 -1
  886. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.de.json +1 -1
  887. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.el.json +1 -1
  888. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.et.json +1 -1
  889. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.fi.json +1 -1
  890. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.he.json +1 -1
  891. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.hu.json +1 -1
  892. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.it.json +1 -1
  893. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.ja.json +1 -1
  894. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.lt.json +1 -1
  895. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.nl.json +1 -1
  896. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.no.json +1 -1
  897. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.pt-BR.json +1 -1
  898. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sk.json +1 -1
  899. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.sv.json +1 -1
  900. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.vi.json +1 -1
  901. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.zh-CN.json +1 -1
  902. package/dist/cdn/assets/portal-review-related-items/t9n/messages.ar.json +1 -0
  903. package/dist/cdn/assets/portal-review-related-items/t9n/messages.bg.json +1 -0
  904. package/dist/cdn/assets/portal-review-related-items/t9n/messages.ca.json +1 -0
  905. package/dist/cdn/assets/portal-review-related-items/t9n/messages.cs.json +1 -0
  906. package/dist/cdn/assets/portal-review-related-items/t9n/messages.da.json +1 -0
  907. package/dist/cdn/assets/portal-review-related-items/t9n/messages.de.json +1 -0
  908. package/dist/cdn/assets/portal-review-related-items/t9n/messages.el.json +1 -0
  909. package/dist/cdn/assets/portal-review-related-items/t9n/messages.en.json +1 -0
  910. package/dist/cdn/assets/portal-review-related-items/t9n/messages.es.json +1 -0
  911. package/dist/cdn/assets/portal-review-related-items/t9n/messages.et.json +1 -0
  912. package/dist/cdn/assets/portal-review-related-items/t9n/messages.fi.json +1 -0
  913. package/dist/cdn/assets/portal-review-related-items/t9n/messages.fr.json +1 -0
  914. package/dist/cdn/assets/portal-review-related-items/t9n/messages.he.json +1 -0
  915. package/dist/cdn/assets/portal-review-related-items/t9n/messages.hr.json +1 -0
  916. package/dist/cdn/assets/portal-review-related-items/t9n/messages.hu.json +1 -0
  917. package/dist/cdn/assets/portal-review-related-items/t9n/messages.id.json +1 -0
  918. package/dist/cdn/assets/portal-review-related-items/t9n/messages.it.json +1 -0
  919. package/dist/cdn/assets/portal-review-related-items/t9n/messages.ja.json +1 -0
  920. package/dist/cdn/assets/portal-review-related-items/t9n/messages.ko.json +1 -0
  921. package/dist/cdn/assets/portal-review-related-items/t9n/messages.lt.json +1 -0
  922. package/dist/cdn/assets/portal-review-related-items/t9n/messages.lv.json +1 -0
  923. package/dist/cdn/assets/portal-review-related-items/t9n/messages.nl.json +1 -0
  924. package/dist/cdn/assets/portal-review-related-items/t9n/messages.no.json +1 -0
  925. package/dist/cdn/assets/portal-review-related-items/t9n/messages.pl.json +1 -0
  926. package/dist/cdn/assets/portal-review-related-items/t9n/messages.pt-BR.json +1 -0
  927. package/dist/cdn/assets/portal-review-related-items/t9n/messages.pt-PT.json +1 -0
  928. package/dist/cdn/assets/portal-review-related-items/t9n/messages.ro.json +1 -0
  929. package/dist/cdn/assets/portal-review-related-items/t9n/messages.ru.json +1 -0
  930. package/dist/cdn/assets/portal-review-related-items/t9n/messages.sk.json +1 -0
  931. package/dist/cdn/assets/portal-review-related-items/t9n/messages.sl.json +1 -0
  932. package/dist/cdn/assets/portal-review-related-items/t9n/messages.sr.json +1 -0
  933. package/dist/cdn/assets/portal-review-related-items/t9n/messages.sv.json +1 -0
  934. package/dist/cdn/assets/portal-review-related-items/t9n/messages.th.json +1 -0
  935. package/dist/cdn/assets/portal-review-related-items/t9n/messages.tr.json +1 -0
  936. package/dist/cdn/assets/portal-review-related-items/t9n/messages.uk.json +1 -0
  937. package/dist/cdn/assets/portal-review-related-items/t9n/messages.vi.json +1 -0
  938. package/dist/cdn/assets/portal-review-related-items/t9n/messages.zh-CN.json +1 -0
  939. package/dist/cdn/assets/portal-review-related-items/t9n/messages.zh-TW.json +1 -0
  940. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.ar.json +1 -0
  941. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.bg.json +1 -0
  942. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.bs.json +1 -0
  943. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.ca.json +1 -0
  944. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.cs.json +1 -0
  945. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.da.json +1 -0
  946. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.de.json +1 -0
  947. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.el.json +1 -0
  948. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.en.json +1 -0
  949. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.es.json +1 -0
  950. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.et.json +1 -0
  951. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.fi.json +1 -0
  952. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.fr.json +1 -0
  953. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.he.json +1 -0
  954. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.hr.json +1 -0
  955. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.hu.json +1 -0
  956. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.id.json +1 -0
  957. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.it.json +1 -0
  958. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.ja.json +1 -0
  959. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.ko.json +1 -0
  960. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.lt.json +1 -0
  961. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.lv.json +1 -0
  962. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.nl.json +1 -0
  963. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.no.json +1 -0
  964. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.pl.json +1 -0
  965. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.pt-BR.json +1 -0
  966. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.pt-PT.json +1 -0
  967. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.ro.json +1 -0
  968. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.ru.json +1 -0
  969. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.sk.json +1 -0
  970. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.sl.json +1 -0
  971. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.sr.json +1 -0
  972. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.sv.json +1 -0
  973. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.th.json +1 -0
  974. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.tr.json +1 -0
  975. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.uk.json +1 -0
  976. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.vi.json +1 -0
  977. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.zh-CN.json +1 -0
  978. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.zh-HK.json +1 -0
  979. package/dist/cdn/assets/portal-sublayer-type/t9n/messages.zh-TW.json +1 -0
  980. package/dist/cdn/assets/portal-user-popup/t9n/messages.ar.json +1 -0
  981. package/dist/cdn/assets/portal-user-popup/t9n/messages.bg.json +1 -0
  982. package/dist/cdn/assets/portal-user-popup/t9n/messages.bs.json +1 -0
  983. package/dist/cdn/assets/portal-user-popup/t9n/messages.ca.json +1 -0
  984. package/dist/cdn/assets/portal-user-popup/t9n/messages.cs.json +1 -0
  985. package/dist/cdn/assets/portal-user-popup/t9n/messages.da.json +1 -0
  986. package/dist/cdn/assets/portal-user-popup/t9n/messages.de.json +1 -0
  987. package/dist/cdn/assets/portal-user-popup/t9n/messages.el.json +1 -0
  988. package/dist/cdn/assets/portal-user-popup/t9n/messages.es.json +1 -0
  989. package/dist/cdn/assets/portal-user-popup/t9n/messages.et.json +1 -0
  990. package/dist/cdn/assets/portal-user-popup/t9n/messages.fi.json +1 -0
  991. package/dist/cdn/assets/portal-user-popup/t9n/messages.fr.json +1 -0
  992. package/dist/cdn/assets/portal-user-popup/t9n/messages.he.json +1 -0
  993. package/dist/cdn/assets/portal-user-popup/t9n/messages.hr.json +1 -0
  994. package/dist/cdn/assets/portal-user-popup/t9n/messages.hu.json +1 -0
  995. package/dist/cdn/assets/portal-user-popup/t9n/messages.id.json +1 -0
  996. package/dist/cdn/assets/portal-user-popup/t9n/messages.it.json +1 -0
  997. package/dist/cdn/assets/portal-user-popup/t9n/messages.ja.json +1 -0
  998. package/dist/cdn/assets/portal-user-popup/t9n/messages.ko.json +1 -0
  999. package/dist/cdn/assets/portal-user-popup/t9n/messages.lt.json +1 -0
  1000. package/dist/cdn/assets/portal-user-popup/t9n/messages.lv.json +1 -0
  1001. package/dist/cdn/assets/portal-user-popup/t9n/messages.nl.json +1 -0
  1002. package/dist/cdn/assets/portal-user-popup/t9n/messages.no.json +1 -0
  1003. package/dist/cdn/assets/portal-user-popup/t9n/messages.pl.json +1 -0
  1004. package/dist/cdn/assets/portal-user-popup/t9n/messages.pt-BR.json +1 -0
  1005. package/dist/cdn/assets/portal-user-popup/t9n/messages.pt-PT.json +1 -0
  1006. package/dist/cdn/assets/portal-user-popup/t9n/messages.ro.json +1 -0
  1007. package/dist/cdn/assets/portal-user-popup/t9n/messages.ru.json +1 -0
  1008. package/dist/cdn/assets/portal-user-popup/t9n/messages.sk.json +1 -0
  1009. package/dist/cdn/assets/portal-user-popup/t9n/messages.sl.json +1 -0
  1010. package/dist/cdn/assets/portal-user-popup/t9n/messages.sr.json +1 -0
  1011. package/dist/cdn/assets/portal-user-popup/t9n/messages.sv.json +1 -0
  1012. package/dist/cdn/assets/portal-user-popup/t9n/messages.th.json +1 -0
  1013. package/dist/cdn/assets/portal-user-popup/t9n/messages.tr.json +1 -0
  1014. package/dist/cdn/assets/portal-user-popup/t9n/messages.uk.json +1 -0
  1015. package/dist/cdn/assets/portal-user-popup/t9n/messages.vi.json +1 -0
  1016. package/dist/cdn/assets/portal-user-popup/t9n/messages.zh-CN.json +1 -0
  1017. package/dist/cdn/assets/portal-user-popup/t9n/messages.zh-HK.json +1 -0
  1018. package/dist/cdn/assets/portal-user-popup/t9n/messages.zh-TW.json +1 -0
  1019. package/dist/cdn/index.js +1 -1
  1020. package/dist/cdn/main.css +1 -1
  1021. package/dist/chunks/functional.js +9 -0
  1022. package/dist/chunks/groups.js +61 -8
  1023. package/dist/chunks/groups2.js +8 -61
  1024. package/dist/chunks/item.js +17 -13
  1025. package/dist/chunks/item2.js +57 -53
  1026. package/dist/chunks/{thumbnail.js → itemThumbnail.js} +29 -25
  1027. package/dist/chunks/loadClassificationData.js +1 -1
  1028. package/dist/chunks/portal-account-switcher.js +3 -3
  1029. package/dist/chunks/portal-browser.js +36 -36
  1030. package/dist/chunks/portal-delete-items-review.js +58 -0
  1031. package/dist/chunks/portal-related-items-list-item.js +6 -0
  1032. package/dist/chunks/query.js +3 -3
  1033. package/dist/chunks/store.js +14 -10
  1034. package/dist/chunks/string.js +15 -9
  1035. package/dist/chunks/utils.js +28 -83
  1036. package/dist/chunks/utils2.js +75 -651
  1037. package/dist/chunks/utils3.js +664 -0
  1038. package/dist/components/arcgis-portal-account-switcher/customElement.d.ts +39 -2
  1039. package/dist/components/arcgis-portal-account-switcher/customElement.js +188 -143
  1040. package/dist/components/arcgis-portal-account-switcher/index.js +2 -0
  1041. package/dist/components/arcgis-portal-account-switcher/types.d.ts +20 -0
  1042. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.d.ts +28 -2
  1043. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.js +6 -6
  1044. package/dist/components/arcgis-portal-account-switcher-list/customElement.d.ts +30 -3
  1045. package/dist/components/arcgis-portal-account-switcher-list/customElement.js +58 -30
  1046. package/dist/components/arcgis-portal-account-switcher-signout/customElement.d.ts +146 -0
  1047. package/dist/components/arcgis-portal-account-switcher-signout/customElement.js +29 -0
  1048. package/dist/components/arcgis-portal-account-switcher-signout/index.d.ts +1 -0
  1049. package/dist/components/arcgis-portal-account-switcher-signout/index.js +6 -0
  1050. package/dist/components/arcgis-portal-add-gps-metadata/customElement.d.ts +8 -5
  1051. package/dist/components/arcgis-portal-add-gps-metadata/customElement.js +240 -152
  1052. package/dist/components/arcgis-portal-add-gps-metadata/index.js +3 -4
  1053. package/dist/components/arcgis-portal-ai-assistant/agents/portalRouteKeys.d.ts +7 -1
  1054. package/dist/components/arcgis-portal-ai-assistant/customElement.js +1255 -981
  1055. package/dist/components/arcgis-portal-ai-assistant/data/capability-registries/types.d.ts +1 -1
  1056. package/dist/components/arcgis-portal-browser/customElement.d.ts +0 -5
  1057. package/dist/components/arcgis-portal-browser/utils/store.d.ts +1 -1
  1058. package/dist/components/arcgis-portal-browser-top-bar/customElement.js +1 -1
  1059. package/dist/components/arcgis-portal-classification-config/customElement.js +69 -69
  1060. package/dist/components/arcgis-portal-delete-items/customElement.d.ts +214 -0
  1061. package/dist/components/arcgis-portal-delete-items/customElement.js +586 -0
  1062. package/dist/components/arcgis-portal-delete-items/index.d.ts +1 -0
  1063. package/dist/components/arcgis-portal-delete-items/index.js +17 -0
  1064. package/dist/components/arcgis-portal-delete-items/services.d.ts +7 -0
  1065. package/dist/components/arcgis-portal-delete-items/types.d.ts +19 -0
  1066. package/dist/components/arcgis-portal-delete-items-review/customElement.d.ts +40 -0
  1067. package/dist/components/arcgis-portal-delete-items-review/customElement.js +12 -0
  1068. package/dist/components/arcgis-portal-delete-items-review/index.d.ts +1 -0
  1069. package/dist/components/arcgis-portal-delete-items-review/index.js +3 -0
  1070. package/dist/components/arcgis-portal-entity-picker/customElement.d.ts +87 -0
  1071. package/dist/components/arcgis-portal-entity-picker/customElement.js +247 -0
  1072. package/dist/components/arcgis-portal-entity-picker/index.d.ts +1 -0
  1073. package/dist/components/arcgis-portal-entity-picker/index.js +11 -0
  1074. package/dist/components/arcgis-portal-extent-picker/customElement.js +285 -243
  1075. package/dist/components/arcgis-portal-extent-picker/index.js +3 -0
  1076. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +8 -8
  1077. package/dist/components/arcgis-portal-field-delete/customElement.js +215 -125
  1078. package/dist/components/arcgis-portal-group-badges/customElement.js +9 -9
  1079. package/dist/components/arcgis-portal-group-browser/customElement.d.ts +15 -4
  1080. package/dist/components/arcgis-portal-group-browser/customElement.js +240 -197
  1081. package/dist/components/arcgis-portal-group-browser/types.d.ts +2 -21
  1082. package/dist/components/arcgis-portal-group-browser-card/customElement.d.ts +30 -0
  1083. package/dist/components/arcgis-portal-group-browser-card/customElement.js +41 -0
  1084. package/dist/components/arcgis-portal-group-browser-card/index.d.ts +1 -0
  1085. package/dist/components/arcgis-portal-group-browser-card/index.js +2 -0
  1086. package/dist/components/arcgis-portal-group-browser-preview/customElement.d.ts +4 -2
  1087. package/dist/components/arcgis-portal-group-browser-preview/customElement.js +16 -16
  1088. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +4 -4
  1089. package/dist/components/arcgis-portal-group-card/customElement.d.ts +4 -8
  1090. package/dist/components/arcgis-portal-group-card/customElement.js +100 -66
  1091. package/dist/components/arcgis-portal-group-card/types.d.ts +8 -0
  1092. package/dist/components/arcgis-portal-group-picker/customElement.d.ts +20 -0
  1093. package/dist/components/arcgis-portal-group-picker/customElement.js +15 -0
  1094. package/dist/components/arcgis-portal-group-picker/index.d.ts +1 -0
  1095. package/dist/components/arcgis-portal-group-picker/index.js +2 -0
  1096. package/dist/components/arcgis-portal-item-actions/customElement.js +1 -1
  1097. package/dist/components/arcgis-portal-item-card/customElement.js +45 -52
  1098. package/dist/components/arcgis-portal-item-card/index.js +1 -0
  1099. package/dist/components/arcgis-portal-item-favorite/customElement.js +1 -1
  1100. package/dist/components/arcgis-portal-item-picker/customElement.d.ts +20 -0
  1101. package/dist/components/arcgis-portal-item-picker/customElement.js +15 -0
  1102. package/dist/components/arcgis-portal-item-picker/index.d.ts +1 -0
  1103. package/dist/components/arcgis-portal-item-picker/index.js +2 -0
  1104. package/dist/components/arcgis-portal-item-thumbnail/customElement.d.ts +43 -0
  1105. package/dist/components/arcgis-portal-item-thumbnail/customElement.js +309 -0
  1106. package/dist/components/arcgis-portal-item-thumbnail/index.d.ts +1 -0
  1107. package/dist/components/arcgis-portal-item-thumbnail/index.js +1 -0
  1108. package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
  1109. package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +75 -101
  1110. package/dist/components/arcgis-portal-navigation/customElement.js +73 -66
  1111. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +1 -1
  1112. package/dist/components/arcgis-portal-review-related-items/customElement.d.ts +27 -0
  1113. package/dist/components/arcgis-portal-review-related-items/customElement.js +30 -0
  1114. package/dist/components/arcgis-portal-review-related-items/index.d.ts +1 -0
  1115. package/dist/components/arcgis-portal-review-related-items/index.js +2 -0
  1116. package/dist/components/arcgis-portal-sublayer-type/customElement.d.ts +76 -0
  1117. package/dist/components/arcgis-portal-sublayer-type/customElement.js +121 -0
  1118. package/dist/components/arcgis-portal-sublayer-type/index.d.ts +1 -0
  1119. package/dist/components/arcgis-portal-sublayer-type/index.js +2 -0
  1120. package/dist/components/arcgis-portal-sublayer-type/utils.d.ts +30 -0
  1121. package/dist/components/arcgis-portal-user-picker/customElement.d.ts +20 -0
  1122. package/dist/components/arcgis-portal-user-picker/customElement.js +15 -0
  1123. package/dist/components/arcgis-portal-user-picker/index.d.ts +1 -0
  1124. package/dist/components/arcgis-portal-user-picker/index.js +2 -0
  1125. package/dist/components/arcgis-portal-user-popup/customElement.js +38 -37
  1126. package/dist/components/portal-group-browser-filters/customElement.js +74 -71
  1127. package/dist/components/portal-related-items-list-item/customElement.js +20 -0
  1128. package/dist/components/portal-related-items-list-item/index.js +5 -0
  1129. package/dist/docs/api.json +1 -1
  1130. package/dist/docs/docs.json +1 -1
  1131. package/dist/docs/vscode.html-custom-data.json +1 -1
  1132. package/dist/docs/web-types.json +1 -1
  1133. package/dist/index.d.ts +92 -0
  1134. package/dist/loader.js +18 -7
  1135. package/dist/services/thumbnail/ags.d.ts +5 -0
  1136. package/dist/types/geometry.d.ts +8 -0
  1137. package/dist/types/item.d.ts +6 -6
  1138. package/dist/types/lumina.d.ts +74 -5
  1139. package/dist/types/portalEntityPicker.d.ts +18 -0
  1140. package/dist/types/preact.d.ts +85 -5
  1141. package/dist/types/react.d.ts +96 -5
  1142. package/dist/types/services.d.ts +9 -0
  1143. package/dist/types/stencil.d.ts +74 -5
  1144. package/package.json +12 -10
  1145. package/dist/cdn/27WR6TKM.js +0 -66
  1146. package/dist/cdn/2LROLM5D.js +0 -2
  1147. package/dist/cdn/2M7ICZ55.js +0 -2
  1148. package/dist/cdn/2RPQKCIL.js +0 -2
  1149. package/dist/cdn/2SUHE7I3.js +0 -2
  1150. package/dist/cdn/2Z5BVWD4.js +0 -2
  1151. package/dist/cdn/3OBIA66A.js +0 -69
  1152. package/dist/cdn/4PPXBKIJ.js +0 -4
  1153. package/dist/cdn/4QA4AYHJ.js +0 -3
  1154. package/dist/cdn/4R5TLPGN.js +0 -2
  1155. package/dist/cdn/63THOLAY.js +0 -49
  1156. package/dist/cdn/6NHNSWIQ.js +0 -2
  1157. package/dist/cdn/A6YWV3MB.js +0 -2
  1158. package/dist/cdn/AMBLICID.js +0 -2
  1159. package/dist/cdn/AVNFYSR4.js +0 -2
  1160. package/dist/cdn/BA3HGV4Q.js +0 -2
  1161. package/dist/cdn/BCYZTGDC.js +0 -2
  1162. package/dist/cdn/BFH3HBUT.js +0 -2
  1163. package/dist/cdn/BIJ755UR.js +0 -2
  1164. package/dist/cdn/BXDQIHOS.js +0 -2
  1165. package/dist/cdn/BY6ZY3C4.js +0 -2
  1166. package/dist/cdn/C7ZFXRPS.js +0 -122
  1167. package/dist/cdn/DFTUMKSN.js +0 -3
  1168. package/dist/cdn/EFY6BRUW.js +0 -2
  1169. package/dist/cdn/FD7DZ3IE.js +0 -2
  1170. package/dist/cdn/H6QY5OJL.js +0 -2
  1171. package/dist/cdn/HFP5F435.js +0 -2
  1172. package/dist/cdn/HLQD6W3F.js +0 -2
  1173. package/dist/cdn/IGZ7A7S3.js +0 -2
  1174. package/dist/cdn/IJ3CLFAU.js +0 -22
  1175. package/dist/cdn/INPDIPW5.js +0 -2
  1176. package/dist/cdn/JCYCRSPL.js +0 -451
  1177. package/dist/cdn/KCJDG4OE.js +0 -2
  1178. package/dist/cdn/KNRJ3WXR.js +0 -98
  1179. package/dist/cdn/KQCTBRGJ.js +0 -2
  1180. package/dist/cdn/L6KBBJEC.js +0 -36
  1181. package/dist/cdn/LDTVM22U.js +0 -2
  1182. package/dist/cdn/LDVTUC6I.js +0 -2
  1183. package/dist/cdn/M6EVMQYT.js +0 -2
  1184. package/dist/cdn/MA5HWGFW.js +0 -2
  1185. package/dist/cdn/NAAAOC2Z.js +0 -2
  1186. package/dist/cdn/NQX5UAUH.js +0 -664
  1187. package/dist/cdn/OT4PZJNB.js +0 -136
  1188. package/dist/cdn/PAFEMDUL.js +0 -2
  1189. package/dist/cdn/PH4LUNY2.js +0 -2
  1190. package/dist/cdn/PLVQ3AZ4.js +0 -2
  1191. package/dist/cdn/QE4CNVDQ.js +0 -34
  1192. package/dist/cdn/QKCV7CY2.js +0 -77
  1193. package/dist/cdn/QNFTJR2M.js +0 -2
  1194. package/dist/cdn/QVLQEBPD.js +0 -2
  1195. package/dist/cdn/SLTFLCVR.js +0 -99
  1196. package/dist/cdn/T3LU5V74.js +0 -2
  1197. package/dist/cdn/TFCRFHRE.js +0 -2
  1198. package/dist/cdn/TKCE4WYE.js +0 -3
  1199. package/dist/cdn/V4EYW3O6.js +0 -56
  1200. package/dist/cdn/VENYHN3O.js +0 -2
  1201. package/dist/cdn/VHNV45FQ.js +0 -2
  1202. package/dist/cdn/VKYMORWN.js +0 -2
  1203. package/dist/cdn/VW7DSKPH.js +0 -109
  1204. package/dist/cdn/W2SYL7IJ.js +0 -71
  1205. package/dist/cdn/W4FGRGLV.js +0 -146
  1206. package/dist/cdn/W4SAWMXS.js +0 -31
  1207. package/dist/cdn/WAEULETE.js +0 -2
  1208. package/dist/cdn/WBZLQZYR.js +0 -134
  1209. package/dist/cdn/WYXW3ETE.js +0 -2
  1210. package/dist/cdn/XEH2E6NR.js +0 -2
  1211. package/dist/cdn/YFT47SCG.js +0 -2
  1212. package/dist/cdn/YQHVXBGD.js +0 -2
  1213. package/dist/cdn/ZI3JA3SL.js +0 -2
  1214. package/dist/cdn/ZWDOT3HF.js +0 -2
  1215. /package/dist/cdn/{OHEUIODH.js → 55FL7WQV.js} +0 -0
  1216. /package/dist/cdn/{NQQLTGIK.js → UTA2UBBS.js} +0 -0
  1217. /package/dist/cdn/{3YCG5UCH.js → UZCHLKLO.js} +0 -0
@@ -0,0 +1,209 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{$ as UA,$a as Ui,A as kA,Aa as hp,B as AA,Ba as xo,C as fp,Ca as gp,D as qc,Da as yp,E as Jc,Ea as XA,F as _s,Fa as GA,G as IA,Ga as Mi,H as $A,Ha as YA,I as SA,J as OA,Ja as _p,K as PA,Ka as QA,L as TA,M as EA,Ma as hC,N as RA,O as CA,P as zA,Pa as xs,Q as NA,R as Vr,Ra as vp,S as vs,U as mp,V as Ar,Va as bp,W as Ri,Wa as mn,X as jA,Y as DA,Ya as Qt,Z as MA,_ as bs,_a as Ct,a as oe,aa as ws,ab as Pe,ba as Ci,bb as De,c as yA,ca as Hc,cb as Ft,da as LA,ea as ZA,f as _A,fa as st,g as Vc,ga as wo,ha as Xc,ia as ut,ja as Un,ka as zi,la as FA,ma as BA,n as lp,na as Gc,oa as Ni,p as vA,pa as WA,q as yt,qa as KA,ra as pn,s as bA,sa as ji,t as pr,ta as VA,u as wA,ua as qA,v as cg,va as Yc,w as xA,wa as Di,x as ys,xa as fn,y as dp,ya as JA,z as pp,za as HA}from"./XOFCMJBQ.js";import{a as gA,b as Kr,c as ug}from"./UZLQALHY.js";var XS=gA(tm=>{"use strict";tm.byteLength=yD;tm.toByteArray=vD;tm.fromByteArray=xD;var Sn=[],Er=[],gD=typeof Uint8Array<"u"?Uint8Array:Array,rw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ha=0,JS=rw.length;ha<JS;++ha)Sn[ha]=rw[ha],Er[rw.charCodeAt(ha)]=ha;var ha,JS;Er[45]=62;Er[95]=63;function HS(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}function yD(e){var t=HS(e),r=t[0],o=t[1];return(r+o)*3/4-o}function _D(e,t,r){return(t+r)*3/4-r}function vD(e){var t,r=HS(e),o=r[0],n=r[1],i=new gD(_D(e,o,n)),a=0,s=n>0?o-4:o,u;for(u=0;u<s;u+=4)t=Er[e.charCodeAt(u)]<<18|Er[e.charCodeAt(u+1)]<<12|Er[e.charCodeAt(u+2)]<<6|Er[e.charCodeAt(u+3)],i[a++]=t>>16&255,i[a++]=t>>8&255,i[a++]=t&255;return n===2&&(t=Er[e.charCodeAt(u)]<<2|Er[e.charCodeAt(u+1)]>>4,i[a++]=t&255),n===1&&(t=Er[e.charCodeAt(u)]<<10|Er[e.charCodeAt(u+1)]<<4|Er[e.charCodeAt(u+2)]>>2,i[a++]=t>>8&255,i[a++]=t&255),i}function bD(e){return Sn[e>>18&63]+Sn[e>>12&63]+Sn[e>>6&63]+Sn[e&63]}function wD(e,t,r){for(var o,n=[],i=t;i<r;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),n.push(bD(o));return n.join("")}function xD(e){for(var t,r=e.length,o=r%3,n=[],i=16383,a=0,s=r-o;a<s;a+=i)n.push(wD(e,a,a+i>s?s:a+i));return o===1?(t=e[r-1],n.push(Sn[t>>2]+Sn[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],n.push(Sn[t>>10]+Sn[t>>4&63]+Sn[t<<2&63]+"=")),n.join("")}});var aP=gA((We,Vm)=>{"use strict";if(typeof Vm<"u"&&Vm!==globalThis.module&&typeof We<"u"&&Vm.exports===We){Object.defineProperty(We,"__esModule",{value:!0}),We.findX509Credential=We.rememberX509Credential=We.findX509OAuthError=We.rememberX509OAuthError=We.isApprovedX509Client=We.markApprovedX509Client=We.isRetryableX509IssuerError=We.markRetryableX509IssuerError=We.isTransientX509ConnectionError=We.markTransientX509ConnectionError=We.rememberRegisteredX509Transport=We.findRegisteredX509Transport=void 0;let e=new WeakMap,t=new WeakSet,r=new WeakSet,o=new WeakSet,n=new WeakMap,i=new WeakMap;We.findRegisteredX509Transport=WeakMap.prototype.get.bind(e),We.rememberRegisteredX509Transport=WeakMap.prototype.set.bind(e),We.markTransientX509ConnectionError=WeakSet.prototype.add.bind(t),We.isTransientX509ConnectionError=WeakSet.prototype.has.bind(t),We.markRetryableX509IssuerError=WeakSet.prototype.add.bind(r),We.isRetryableX509IssuerError=WeakSet.prototype.has.bind(r),We.markApprovedX509Client=WeakSet.prototype.add.bind(o),We.isApprovedX509Client=WeakSet.prototype.has.bind(o),We.rememberX509OAuthError=WeakMap.prototype.set.bind(n),We.findX509OAuthError=WeakMap.prototype.get.bind(n),We.rememberX509Credential=WeakMap.prototype.set.bind(i),We.findX509Credential=WeakMap.prototype.get.bind(i)}});async function fr(e,t){if(t===void 0)return e;let r;return Promise.race([e.catch(o=>{if(!t?.aborted)throw o}),new Promise((o,n)=>{r=()=>{n(ko(t))},t.addEventListener("abort",r,{once:!0}),t.aborted&&n(ko(t))})]).finally(()=>t.removeEventListener("abort",r))}function ko(e){return e?.reason instanceof Error?e.reason:typeof e?.reason=="string"?new Error(e.reason):new Error("Aborted")}var Bn={};Kr(Bn,{$ZodAny:()=>Qy,$ZodArray:()=>r_,$ZodAsyncError:()=>qr,$ZodBase64:()=>By,$ZodBase64URL:()=>Wy,$ZodBigInt:()=>Lp,$ZodBigIntFormat:()=>Hy,$ZodBoolean:()=>dl,$ZodCIDRv4:()=>Ly,$ZodCIDRv6:()=>Zy,$ZodCUID:()=>Oy,$ZodCUID2:()=>Py,$ZodCatch:()=>b_,$ZodCheck:()=>Ke,$ZodCheckBigIntFormat:()=>oy,$ZodCheckEndsWith:()=>gy,$ZodCheckGreaterThan:()=>zp,$ZodCheckIncludes:()=>my,$ZodCheckLengthEquals:()=>ly,$ZodCheckLessThan:()=>Cp,$ZodCheckLowerCase:()=>py,$ZodCheckMaxLength:()=>uy,$ZodCheckMaxSize:()=>iy,$ZodCheckMimeType:()=>_y,$ZodCheckMinLength:()=>cy,$ZodCheckMinSize:()=>ay,$ZodCheckMultipleOf:()=>ry,$ZodCheckNumberFormat:()=>ny,$ZodCheckOverwrite:()=>vy,$ZodCheckProperty:()=>yy,$ZodCheckRegex:()=>dy,$ZodCheckSizeEquals:()=>sy,$ZodCheckStartsWith:()=>hy,$ZodCheckStringFormat:()=>Ts,$ZodCheckUpperCase:()=>fy,$ZodCodec:()=>hl,$ZodCustom:()=>O_,$ZodCustomStringFormat:()=>qy,$ZodDate:()=>t_,$ZodDefault:()=>g_,$ZodDiscriminatedUnion:()=>i_,$ZodE164:()=>Ky,$ZodEmail:()=>Ay,$ZodEmoji:()=>$y,$ZodEncodeError:()=>Ao,$ZodEnum:()=>l_,$ZodError:()=>il,$ZodExactOptional:()=>m_,$ZodFile:()=>p_,$ZodFunction:()=>I_,$ZodGUID:()=>xy,$ZodIPv4:()=>Dy,$ZodIPv6:()=>My,$ZodISODate:()=>zy,$ZodISODateTime:()=>Cy,$ZodISODuration:()=>jy,$ZodISOTime:()=>Ny,$ZodIntersection:()=>a_,$ZodJWT:()=>Vy,$ZodKSUID:()=>Ry,$ZodLazy:()=>S_,$ZodLiteral:()=>d_,$ZodMAC:()=>Uy,$ZodMap:()=>u_,$ZodNaN:()=>w_,$ZodNanoID:()=>Sy,$ZodNever:()=>fl,$ZodNonOptional:()=>__,$ZodNull:()=>Yy,$ZodNullable:()=>h_,$ZodNumber:()=>Up,$ZodNumberFormat:()=>Jy,$ZodObject:()=>TI,$ZodObjectJIT:()=>n_,$ZodOptional:()=>Ki,$ZodPipe:()=>Fp,$ZodPrefault:()=>y_,$ZodPreprocess:()=>x_,$ZodPromise:()=>$_,$ZodReadonly:()=>k_,$ZodRealError:()=>tr,$ZodRecord:()=>s_,$ZodRegistry:()=>Vp,$ZodSet:()=>c_,$ZodString:()=>Wi,$ZodStringFormat:()=>Le,$ZodSuccess:()=>v_,$ZodSymbol:()=>Xy,$ZodTemplateLiteral:()=>A_,$ZodTransform:()=>f_,$ZodTuple:()=>Zp,$ZodType:()=>ye,$ZodULID:()=>Ty,$ZodURL:()=>Iy,$ZodUUID:()=>ky,$ZodUndefined:()=>Gy,$ZodUnion:()=>ml,$ZodUnknown:()=>pl,$ZodVoid:()=>e_,$ZodXID:()=>Ey,$ZodXor:()=>o_,$brand:()=>dg,$constructor:()=>P,$input:()=>T_,$output:()=>P_,Doc:()=>ll,JSONSchema:()=>R$,JSONSchemaGenerator:()=>xf,NEVER:()=>lg,TimePrecision:()=>z_,_any:()=>tv,_array:()=>av,_base64:()=>lf,_base64url:()=>df,_bigint:()=>J_,_boolean:()=>V_,_catch:()=>MN,_check:()=>E$,_cidrv4:()=>uf,_cidrv6:()=>cf,_coercedBigint:()=>H_,_coercedBoolean:()=>q_,_coercedDate:()=>ov,_coercedNumber:()=>L_,_coercedString:()=>R_,_cuid:()=>ef,_cuid2:()=>tf,_custom:()=>uv,_date:()=>nv,_decode:()=>Ap,_decodeAsync:()=>$p,_default:()=>NN,_discriminatedUnion:()=>kN,_e164:()=>pf,_email:()=>qp,_emoji:()=>Yp,_encode:()=>kp,_encodeAsync:()=>Ip,_endsWith:()=>Ms,_enum:()=>PN,_file:()=>sv,_float32:()=>F_,_float64:()=>B_,_gt:()=>yn,_gte:()=>Wt,_guid:()=>_l,_includes:()=>js,_int:()=>Z_,_int32:()=>W_,_int64:()=>X_,_intersection:()=>AN,_ipv4:()=>af,_ipv6:()=>sf,_isoDate:()=>j_,_isoDateTime:()=>N_,_isoDuration:()=>M_,_isoTime:()=>D_,_jwt:()=>ff,_ksuid:()=>of,_lazy:()=>FN,_length:()=>Ji,_literal:()=>EN,_lowercase:()=>zs,_lt:()=>gn,_lte:()=>hr,_mac:()=>C_,_map:()=>SN,_max:()=>hr,_maxLength:()=>qi,_maxSize:()=>To,_mime:()=>Us,_min:()=>Wt,_minLength:()=>Zn,_minSize:()=>_n,_multipleOf:()=>Po,_nan:()=>iv,_nanoid:()=>Qp,_nativeEnum:()=>TN,_negative:()=>hf,_never:()=>wl,_nonnegative:()=>yf,_nonoptional:()=>jN,_nonpositive:()=>gf,_normalize:()=>Ls,_null:()=>ev,_nullable:()=>zN,_number:()=>U_,_optional:()=>CN,_overwrite:()=>Jr,_parse:()=>$s,_parseAsync:()=>Ss,_pipe:()=>UN,_positive:()=>mf,_promise:()=>BN,_property:()=>_f,_readonly:()=>LN,_record:()=>$N,_refine:()=>cv,_regex:()=>Cs,_safeDecode:()=>Op,_safeDecodeAsync:()=>Tp,_safeEncode:()=>Sp,_safeEncodeAsync:()=>Pp,_safeParse:()=>Os,_safeParseAsync:()=>Ps,_set:()=>ON,_size:()=>Vi,_slugify:()=>Ws,_startsWith:()=>Ds,_string:()=>E_,_stringFormat:()=>Ks,_stringbool:()=>fv,_success:()=>DN,_superRefine:()=>lv,_symbol:()=>Y_,_templateLiteral:()=>ZN,_toLowerCase:()=>Fs,_toUpperCase:()=>Bs,_transform:()=>RN,_trim:()=>Zs,_tuple:()=>IN,_uint32:()=>K_,_uint64:()=>G_,_ulid:()=>rf,_undefined:()=>Q_,_union:()=>wN,_unknown:()=>bl,_uppercase:()=>Ns,_url:()=>vl,_uuid:()=>Jp,_uuidv4:()=>Hp,_uuidv6:()=>Xp,_uuidv7:()=>Gp,_void:()=>rv,_xid:()=>nf,_xor:()=>xN,clone:()=>Je,config:()=>tt,createStandardJSONSchemaMethod:()=>Vs,createToJSONSchemaMethod:()=>mv,decode:()=>BC,decodeAsync:()=>KC,describe:()=>dv,encode:()=>FC,encodeAsync:()=>WC,extractDefs:()=>Ro,finalize:()=>Co,flattenError:()=>al,formatError:()=>sl,globalConfig:()=>Li,globalRegistry:()=>je,initializeContext:()=>Eo,isValidBase64:()=>Fy,isValidBase64URL:()=>$I,isValidJWT:()=>SI,locales:()=>yl,meta:()=>pv,parse:()=>hn,parseAsync:()=>Fi,prettifyError:()=>Ag,process:()=>Me,regexes:()=>mr,registry:()=>Rs,safeDecode:()=>qC,safeDecodeAsync:()=>HC,safeEncode:()=>VC,safeEncodeAsync:()=>JC,safeParse:()=>Ig,safeParseAsync:()=>$g,toDotPath:()=>iI,toJSONSchema:()=>Fn,treeifyError:()=>kg,util:()=>L,version:()=>by});var eI,lg=Object.freeze({status:"aborted"});function P(e,t,r){function o(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);let c=a.prototype,l=Object.keys(c);for(let d=0;d<l.length;d++){let p=l[d];p in s||(s[p]=c[p].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var u;let c=r?.Parent?new i:this;o(c,s),(u=c._zod).deferred??(u.deferred=[]);for(let l of c._zod.deferred)l();return c}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var dg=Symbol("zod_brand"),qr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ao=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(eI=globalThis).__zod_globalConfig??(eI.__zod_globalConfig={});var Li=globalThis.__zod_globalConfig;function tt(e){return e&&Object.assign(Li,e),Li}var L={};Kr(L,{BIGINT_FORMAT_RANGES:()=>wg,Class:()=>fg,NUMBER_FORMAT_RANGES:()=>bg,aborted:()=>Oo,allowsEval:()=>gg,assert:()=>bC,assertEqual:()=>gC,assertIs:()=>_C,assertNever:()=>vC,assertNotEqual:()=>yC,assignProp:()=>$o,base64ToUint8Array:()=>rI,base64urlToUint8Array:()=>DC,cached:()=>As,captureStackTrace:()=>xp,cleanEnum:()=>jC,cleanRegex:()=>tl,clone:()=>Je,cloneDef:()=>xC,createTransparentProxy:()=>OC,defineLazy:()=>Ie,esc:()=>wp,escapeRegex:()=>Ir,explicitlyAborted:()=>xg,extend:()=>EC,finalizeIssue:()=>Bt,floatSafeRemainder:()=>mg,getElementAtPath:()=>kC,getEnumValues:()=>el,getLengthableOrigin:()=>ol,getParsedType:()=>SC,getSizableOrigin:()=>nl,hexToUint8Array:()=>UC,isObject:()=>Zi,isPlainObject:()=>So,issue:()=>Is,joinValues:()=>T,jsonStringifyReplacer:()=>ks,merge:()=>CC,mergeDefs:()=>Ln,normalizeParams:()=>B,nullish:()=>Io,numKeys:()=>$C,objectClone:()=>wC,omit:()=>TC,optionalKeys:()=>vg,parsedType:()=>U,partial:()=>zC,pick:()=>PC,prefixIssues:()=>er,primitiveTypes:()=>_g,promiseAllObject:()=>AC,propertyKeyTypes:()=>rl,randomString:()=>IC,required:()=>NC,safeExtend:()=>RC,shallowClone:()=>yg,slugify:()=>hg,stringifyPrimitive:()=>M,uint8ArrayToBase64:()=>nI,uint8ArrayToBase64url:()=>MC,uint8ArrayToHex:()=>LC,unwrapMessage:()=>Qc});function gC(e){return e}function yC(e){return e}function _C(e){}function vC(e){throw new Error("Unexpected value in exhaustive check")}function bC(e){}function el(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function T(e,t="|"){return e.map(r=>M(r)).join(t)}function ks(e,t){return typeof t=="bigint"?t.toString():t}function As(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Io(e){return e==null}function tl(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function mg(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var tI=Symbol("evaluating");function Ie(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==tI)return o===void 0&&(o=tI,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function wC(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function $o(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ln(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function xC(e){return Ln(e._zod.def)}function kC(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function AC(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function IC(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function wp(e){return JSON.stringify(e)}function hg(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var xp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Zi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var gg=As(()=>{if(Li.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function So(e){if(Zi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Zi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function yg(e){return So(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function $C(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var SC=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}`)}},rl=new Set(["string","number","symbol"]),_g=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ir(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Je(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function B(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 OC(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function M(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function vg(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var bg={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]},wg={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function PC(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Ln(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return $o(this,"shape",a),a},checks:[]});return Je(e,i)}function TC(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Ln(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return $o(this,"shape",a),a},checks:[]});return Je(e,i)}function EC(e,t){if(!So(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=Ln(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return $o(this,"shape",i),i}});return Je(e,n)}function RC(e,t){if(!So(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ln(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return $o(this,"shape",o),o}});return Je(e,r)}function CC(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Ln(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return $o(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Je(e,r)}function zC(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=Ln(t._zod.def,{get shape(){let s=t._zod.def.shape,u={...s};if(r)for(let c in r){if(!(c in s))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(u[c]=e?new e({type:"optional",innerType:s[c]}):s[c])}else for(let c in s)u[c]=e?new e({type:"optional",innerType:s[c]}):s[c];return $o(this,"shape",u),u},checks:[]});return Je(t,a)}function NC(e,t,r){let o=Ln(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return $o(this,"shape",i),i}});return Je(t,o)}function Oo(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function xg(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function er(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Qc(e){return typeof e=="string"?e:e?.message}function Bt(e,t,r){let o=e.message?e.message:Qc(e.inst?._zod.def?.error?.(e))??Qc(t?.error?.(e))??Qc(r.customError?.(e))??Qc(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function nl(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ol(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function U(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 r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Is(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function jC(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function rI(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function nI(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function DC(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return rI(t+r)}function MC(e){return nI(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function UC(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function LC(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var fg=class{constructor(...t){}};var oI=(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,ks,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},il=P("$ZodError",oI),tr=P("$ZodError",oI,{Parent:Error});function al(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function sl(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let u=r,c=0;for(;c<s.length;){let l=s[c];c===s.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(t(a))):u[l]=u[l]||{_errors:[]},u=u[l],c++}}}};return o(e),r}function kg(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>o({issues:c},[...i,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...i,...u.path]);else{let c=[...i,...u.path];if(c.length===0){r.errors.push(t(u));continue}let l=r,d=0;for(;d<c.length;){let p=c[d],f=d===c.length-1;typeof p=="string"?(l.properties??(l.properties={}),(a=l.properties)[p]??(a[p]={errors:[]}),l=l.properties[p]):(l.items??(l.items=[]),(s=l.items)[p]??(s[p]={errors:[]}),l=l.items[p]),f&&l.errors.push(t(u)),d++}}};return o(e),r}function iI(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Ag(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${iI(o.path)}`);return t.join(`
3
+ `)}var $s=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new qr;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(u=>Bt(u,i,tt())));throw xp(s,n?.callee),s}return a.value},hn=$s(tr),Ss=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(u=>Bt(u,i,tt())));throw xp(s,n?.callee),s}return a.value},Fi=Ss(tr),Os=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new qr;return i.issues.length?{success:!1,error:new(e??il)(i.issues.map(a=>Bt(a,n,tt())))}:{success:!0,data:i.value}},Ig=Os(tr),Ps=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Bt(a,n,tt())))}:{success:!0,data:i.value}},$g=Ps(tr),kp=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return $s(e)(t,r,n)},FC=kp(tr),Ap=e=>(t,r,o)=>$s(e)(t,r,o),BC=Ap(tr),Ip=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ss(e)(t,r,n)},WC=Ip(tr),$p=e=>async(t,r,o)=>Ss(e)(t,r,o),KC=$p(tr),Sp=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Os(e)(t,r,n)},VC=Sp(tr),Op=e=>(t,r,o)=>Os(e)(t,r,o),qC=Op(tr),Pp=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ps(e)(t,r,n)},JC=Pp(tr),Tp=e=>async(t,r,o)=>Ps(e)(t,r,o),HC=Tp(tr);var mr={};Kr(mr,{base64:()=>Fg,base64url:()=>Ep,bigint:()=>Hg,boolean:()=>Gg,browserEmail:()=>nz,cidrv4:()=>Lg,cidrv6:()=>Zg,cuid:()=>Sg,cuid2:()=>Og,date:()=>Kg,datetime:()=>qg,domain:()=>az,duration:()=>Cg,e164:()=>Wg,email:()=>Ng,emoji:()=>jg,extendedDuration:()=>XC,guid:()=>zg,hex:()=>sz,hostname:()=>iz,html5Email:()=>ez,httpProtocol:()=>Bg,idnEmail:()=>rz,integer:()=>Xg,ipv4:()=>Dg,ipv6:()=>Mg,ksuid:()=>Eg,lowercase:()=>ey,mac:()=>Ug,md5_base64:()=>cz,md5_base64url:()=>lz,md5_hex:()=>uz,nanoid:()=>Rg,null:()=>Yg,number:()=>Rp,rfc5322Email:()=>tz,sha1_base64:()=>pz,sha1_base64url:()=>fz,sha1_hex:()=>dz,sha256_base64:()=>hz,sha256_base64url:()=>gz,sha256_hex:()=>mz,sha384_base64:()=>_z,sha384_base64url:()=>vz,sha384_hex:()=>yz,sha512_base64:()=>wz,sha512_base64url:()=>xz,sha512_hex:()=>bz,string:()=>Jg,time:()=>Vg,ulid:()=>Pg,undefined:()=>Qg,unicodeEmail:()=>aI,uppercase:()=>ty,uuid:()=>Bi,uuid4:()=>GC,uuid6:()=>YC,uuid7:()=>QC,xid:()=>Tg});var Sg=/^[cC][0-9a-z]{6,}$/,Og=/^[0-9a-z]+$/,Pg=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Tg=/^[0-9a-vA-V]{20}$/,Eg=/^[A-Za-z0-9]{27}$/,Rg=/^[a-zA-Z0-9_-]{21}$/,Cg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,XC=/^[-+]?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)?)??$/,zg=/^([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})$/,Bi=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)$/,GC=Bi(4),YC=Bi(6),QC=Bi(7),Ng=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ez=/^[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])?)*$/,tz=/^(([^<>()\[\]\\.,;:\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,}))$/,aI=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,rz=aI,nz=/^[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])?)*$/,oz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function jg(){return new RegExp(oz,"u")}var Dg=/^(?:(?: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])$/,Mg=/^(([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}|:))$/,Ug=e=>{let t=Ir(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Lg=/^((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])$/,Zg=/^(([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])$/,Fg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ep=/^[A-Za-z0-9_-]*$/,iz=/^(?=.{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])?)*\.?$/,az=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Bg=/^https?$/,Wg=/^\+[1-9]\d{6,14}$/,sI="(?:(?:\\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])))",Kg=new RegExp(`^${sI}$`);function uI(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 Vg(e){return new RegExp(`^${uI(e)}$`)}function qg(e){let t=uI({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${sI}T(?:${o})$`)}var Jg=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Hg=/^-?\d+n?$/,Xg=/^-?\d+$/,Rp=/^-?\d+(?:\.\d+)?$/,Gg=/^(?:true|false)$/i,Yg=/^null$/i;var Qg=/^undefined$/i;var ey=/^[^A-Z]*$/,ty=/^[^a-z]*$/,sz=/^[0-9a-fA-F]*$/;function ul(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function cl(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var uz=/^[0-9a-fA-F]{32}$/,cz=ul(22,"=="),lz=cl(22),dz=/^[0-9a-fA-F]{40}$/,pz=ul(27,"="),fz=cl(27),mz=/^[0-9a-fA-F]{64}$/,hz=ul(43,"="),gz=cl(43),yz=/^[0-9a-fA-F]{96}$/,_z=ul(64,""),vz=cl(64),bz=/^[0-9a-fA-F]{128}$/,wz=ul(86,"=="),xz=cl(86);var Ke=P("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),lI={number:"number",bigint:"bigint",object:"date"},Cp=P("$ZodCheckLessThan",(e,t)=>{Ke.init(e,t);let r=lI[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zp=P("$ZodCheckGreaterThan",(e,t)=>{Ke.init(e,t);let r=lI[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ry=P("$ZodCheckMultipleOf",(e,t)=>{Ke.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):mg(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ny=P("$ZodCheckNumberFormat",(e,t)=>{Ke.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=bg[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=Xg)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),oy=P("$ZodCheckBigIntFormat",(e,t)=>{Ke.init(e,t);let[r,o]=wg[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),iy=P("$ZodCheckMaxSize",(e,t)=>{var r;Ke.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Io(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:nl(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ay=P("$ZodCheckMinSize",(e,t)=>{var r;Ke.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Io(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:nl(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),sy=P("$ZodCheckSizeEquals",(e,t)=>{var r;Ke.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Io(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:nl(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),uy=P("$ZodCheckMaxLength",(e,t)=>{var r;Ke.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Io(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=ol(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),cy=P("$ZodCheckMinLength",(e,t)=>{var r;Ke.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Io(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=ol(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ly=P("$ZodCheckLengthEquals",(e,t)=>{var r;Ke.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Io(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=ol(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ts=P("$ZodCheckStringFormat",(e,t)=>{var r,o;Ke.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),dy=P("$ZodCheckRegex",(e,t)=>{Ts.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),py=P("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ey),Ts.init(e,t)}),fy=P("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ty),Ts.init(e,t)}),my=P("$ZodCheckIncludes",(e,t)=>{Ke.init(e,t);let r=Ir(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),hy=P("$ZodCheckStartsWith",(e,t)=>{Ke.init(e,t);let r=new RegExp(`^${Ir(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),gy=P("$ZodCheckEndsWith",(e,t)=>{Ke.init(e,t);let r=new RegExp(`.*${Ir(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function cI(e,t,r){e.issues.length&&t.issues.push(...er(r,e.issues))}var yy=P("$ZodCheckProperty",(e,t)=>{Ke.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>cI(n,r,t.property));cI(o,r,t.property)}}),_y=P("$ZodCheckMimeType",(e,t)=>{Ke.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),vy=P("$ZodCheckOverwrite",(e,t)=>{Ke.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var ll=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 o=t.split(`
4
+ `).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
5
+ `))}};var by={major:4,minor:4,patch:3};var ye=P("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=by;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,u)=>{let c=Oo(a),l;for(let d of s){if(d._zod.def.when){if(xg(a)||!d._zod.def.when(a))continue}else if(c)continue;let p=a.issues.length,f=d._zod.check(a);if(f instanceof Promise&&u?.async===!1)throw new qr;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,a.issues.length!==p&&(c||(c=Oo(a,p)))});else{if(a.issues.length===p)continue;c||(c=Oo(a,p))}}return l?l.then(()=>a):a},i=(a,s,u)=>{if(Oo(a))return a.aborted=!0,a;let c=n(s,o,u);if(c instanceof Promise){if(u.async===!1)throw new qr;return c.then(l=>e._zod.parse(l,u))}return e._zod.parse(c,u)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let c=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(l=>i(l,a,s)):i(c,a,s)}let u=e._zod.parse(a,s);if(u instanceof Promise){if(s.async===!1)throw new qr;return u.then(c=>n(c,o,s))}return n(u,o,s)}}Ie(e,"~standard",()=>({validate:n=>{try{let i=Ig(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return $g(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Wi=P("$ZodString",(e,t)=>{ye.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Jg(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Le=P("$ZodStringFormat",(e,t)=>{Ts.init(e,t),Wi.init(e,t)}),xy=P("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zg),Le.init(e,t)}),ky=P("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Bi(o))}else t.pattern??(t.pattern=Bi());Le.init(e,t)}),Ay=P("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ng),Le.init(e,t)}),Iy=P("$ZodURL",(e,t)=>{Le.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Bg.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),$y=P("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=jg()),Le.init(e,t)}),Sy=P("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Rg),Le.init(e,t)}),Oy=P("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Sg),Le.init(e,t)}),Py=P("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Og),Le.init(e,t)}),Ty=P("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Pg),Le.init(e,t)}),Ey=P("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Tg),Le.init(e,t)}),Ry=P("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Eg),Le.init(e,t)}),Cy=P("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=qg(t)),Le.init(e,t)}),zy=P("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Kg),Le.init(e,t)}),Ny=P("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Vg(t)),Le.init(e,t)}),jy=P("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Cg),Le.init(e,t)}),Dy=P("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Dg),Le.init(e,t),e._zod.bag.format="ipv4"}),My=P("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Mg),Le.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Uy=P("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Ug(t.delimiter)),Le.init(e,t),e._zod.bag.format="mac"}),Ly=P("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Lg),Le.init(e,t)}),Zy=P("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Zg),Le.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Fy(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var By=P("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Fg),Le.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Fy(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function $I(e){if(!Ep.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Fy(r)}var Wy=P("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ep),Le.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{$I(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Ky=P("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Wg),Le.init(e,t)});function SI(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Vy=P("$ZodJWT",(e,t)=>{Le.init(e,t),e._zod.check=r=>{SI(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),qy=P("$ZodCustomStringFormat",(e,t)=>{Le.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Up=P("$ZodNumber",(e,t)=>{ye.init(e,t),e._zod.pattern=e._zod.bag.pattern??Rp,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),Jy=P("$ZodNumberFormat",(e,t)=>{ny.init(e,t),Up.init(e,t)}),dl=P("$ZodBoolean",(e,t)=>{ye.init(e,t),e._zod.pattern=Gg,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Lp=P("$ZodBigInt",(e,t)=>{ye.init(e,t),e._zod.pattern=Hg,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),Hy=P("$ZodBigIntFormat",(e,t)=>{oy.init(e,t),Lp.init(e,t)}),Xy=P("$ZodSymbol",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Gy=P("$ZodUndefined",(e,t)=>{ye.init(e,t),e._zod.pattern=Qg,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Yy=P("$ZodNull",(e,t)=>{ye.init(e,t),e._zod.pattern=Yg,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Qy=P("$ZodAny",(e,t)=>{ye.init(e,t),e._zod.parse=r=>r}),pl=P("$ZodUnknown",(e,t)=>{ye.init(e,t),e._zod.parse=r=>r}),fl=P("$ZodNever",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),e_=P("$ZodVoid",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),t_=P("$ZodDate",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});function pI(e,t,r){e.issues.length&&t.issues.push(...er(r,e.issues)),t.value[r]=e.value}var r_=P("$ZodArray",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],u=t.element._zod.run({value:s,issues:[]},o);u instanceof Promise?i.push(u.then(c=>pI(c,r,a))):pI(u,r,a)}return i.length?Promise.all(i).then(()=>r):r}});function Mp(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...er(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function OI(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=vg(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function PI(e,t,r,o,n,i){let a=[],s=n.keySet,u=n.catchall._zod,c=u.def.type,l=u.optin==="optional",d=u.optout==="optional";for(let p in t){if(p==="__proto__"||s.has(p))continue;if(c==="never"){a.push(p);continue}let f=u.run({value:t[p],issues:[]},o);f instanceof Promise?e.push(f.then(h=>Mp(h,r,p,t,l,d))):Mp(f,r,p,t,l,d)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}var TI=P("$ZodObject",(e,t)=>{if(ye.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...s};return Object.defineProperty(t,"shape",{value:u}),u}})}let o=As(()=>OI(t));Ie(e._zod,"propValues",()=>{let s=t.shape,u={};for(let c in s){let l=s[c]._zod;if(l.values){u[c]??(u[c]=new Set);for(let d of l.values)u[c].add(d)}}return u});let n=Zi,i=t.catchall,a;e._zod.parse=(s,u)=>{a??(a=o.value);let c=s.value;if(!n(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),s;s.value={};let l=[],d=a.shape;for(let p of a.keys){let f=d[p],h=f._zod.optin==="optional",y=f._zod.optout==="optional",_=f._zod.run({value:c[p],issues:[]},u);_ instanceof Promise?l.push(_.then($=>Mp($,s,p,c,h,y))):Mp(_,s,p,c,h,y)}return i?PI(l,c,s,u,o.value,e):l.length?Promise.all(l).then(()=>s):s}}),n_=P("$ZodObjectJIT",(e,t)=>{TI.init(e,t);let r=e._zod.parse,o=As(()=>OI(t)),n=p=>{let f=new ll(["shape","payload","ctx"]),h=o.value,y=x=>{let S=wp(x);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};f.write("const input = payload.value;");let _=Object.create(null),$=0;for(let x of h.keys)_[x]=`key_${$++}`;f.write("const newResult = {};");for(let x of h.keys){let S=_[x],C=wp(x),j=p[x],F=j?._zod?.optin==="optional",A=j?._zod?.optout==="optional";f.write(`const ${S} = ${y(x)};`),F&&A?f.write(`
6
+ if (${S}.issues.length) {
7
+ if (${C} in input) {
8
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
9
+ ...iss,
10
+ path: iss.path ? [${C}, ...iss.path] : [${C}]
11
+ })));
12
+ }
13
+ }
14
+
15
+ if (${S}.value === undefined) {
16
+ if (${C} in input) {
17
+ newResult[${C}] = undefined;
18
+ }
19
+ } else {
20
+ newResult[${C}] = ${S}.value;
21
+ }
22
+
23
+ `):F?f.write(`
24
+ if (${S}.issues.length) {
25
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
26
+ ...iss,
27
+ path: iss.path ? [${C}, ...iss.path] : [${C}]
28
+ })));
29
+ }
30
+
31
+ if (${S}.value === undefined) {
32
+ if (${C} in input) {
33
+ newResult[${C}] = undefined;
34
+ }
35
+ } else {
36
+ newResult[${C}] = ${S}.value;
37
+ }
38
+
39
+ `):f.write(`
40
+ const ${S}_present = ${C} in input;
41
+ if (${S}.issues.length) {
42
+ payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
43
+ ...iss,
44
+ path: iss.path ? [${C}, ...iss.path] : [${C}]
45
+ })));
46
+ }
47
+ if (!${S}_present && !${S}.issues.length) {
48
+ payload.issues.push({
49
+ code: "invalid_type",
50
+ expected: "nonoptional",
51
+ input: undefined,
52
+ path: [${C}]
53
+ });
54
+ }
55
+
56
+ if (${S}_present) {
57
+ if (${S}.value === undefined) {
58
+ newResult[${C}] = undefined;
59
+ } else {
60
+ newResult[${C}] = ${S}.value;
61
+ }
62
+ }
63
+
64
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");let v=f.compile();return(x,S)=>v(p,x,S)},i,a=Zi,s=!Li.jitless,c=s&&gg.value,l=t.catchall,d;e._zod.parse=(p,f)=>{d??(d=o.value);let h=p.value;return a(h)?s&&c&&f?.async===!1&&f.jitless!==!0?(i||(i=n(t.shape)),p=i(p,f),l?PI([],h,p,f,d,e):p):r(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p)}});function fI(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Oo(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Bt(a,o,tt())))}),t)}var ml=P("$ZodUnion",(e,t)=>{ye.init(e,t),Ie(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ie(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ie(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ie(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>tl(n.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let u=s._zod.run({value:o.value,issues:[]},n);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(s=>fI(s,o,e,n)):fI(a,o,e,n)}});function mI(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>Bt(a,o,tt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var o_=P("$ZodXor",(e,t)=>{ml.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,a=[];for(let s of t.options){let u=s._zod.run({value:o.value,issues:[]},n);u instanceof Promise?(a.push(u),i=!0):a.push(u)}return i?Promise.all(a).then(s=>mI(s,o,e,n)):mI(a,o,e,n)}}),i_=P("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ml.init(e,t);let r=e._zod.parse;Ie(e._zod,"propValues",()=>{let n={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[s,u]of Object.entries(a)){n[s]||(n[s]=new Set);for(let c of u)n[s].add(c)}}return n});let o=As(()=>{let n=t.options,i=new Map;for(let a of n){let s=a._zod.propValues?.[t.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let u of s){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,a)}}return i});e._zod.parse=(n,i)=>{let a=n.value;if(!Zi(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),n;let s=o.value.get(a?.[t.discriminator]);return s?s._zod.run(n,i):t.unionFallback||i.direction==="backward"?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:a,path:[t.discriminator],inst:e}),n)}}),a_=P("$ZodIntersection",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),a=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([u,c])=>hI(r,u,c)):hI(r,i,a)}});function wy(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(So(e)&&So(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=wy(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=wy(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function hI(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let u of s.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let u of s.keys)o.has(u)||o.set(u,{}),o.get(u).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),Oo(e))return e;let a=wy(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var Zp=P("$ZodTuple",(e,t)=>{ye.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let a=[],s=gI(r,"optin"),u=gI(r,"optout");if(!t.rest){if(i.length<s)return o.issues.push({code:"too_small",minimum:s,inclusive:!0,input:i,inst:e,origin:"array"}),o;i.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let c=new Array(r.length);for(let l=0;l<r.length;l++){let d=r[l]._zod.run({value:i[l],issues:[]},n);d instanceof Promise?a.push(d.then(p=>{c[l]=p})):c[l]=d}if(t.rest){let l=r.length-1,d=i.slice(r.length);for(let p of d){l++;let f=t.rest._zod.run({value:p,issues:[]},n);f instanceof Promise?a.push(f.then(h=>yI(h,o,l))):yI(f,o,l)}}return a.length?Promise.all(a).then(()=>_I(c,o,r,i,u)):_I(c,o,r,i,u)}});function gI(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function yI(e,t,r){e.issues.length&&t.issues.push(...er(r,e.issues)),t.value[r]=e.value}function _I(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...er(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var s_=P("$ZodRecord",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!So(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],a=t.keyType._zod.values;if(a){r.value={};let s=new Set;for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){s.add(typeof c=="number"?c.toString():c);let l=t.keyType._zod.run({value:c,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Bt(f,o,tt())),input:c,path:[c],inst:e});continue}let d=l.value,p=t.valueType._zod.run({value:n[c],issues:[]},o);p instanceof Promise?i.push(p.then(f=>{f.issues.length&&r.issues.push(...er(c,f.issues)),r.value[d]=f.value})):(p.issues.length&&r.issues.push(...er(c,p.issues)),r.value[d]=p.value)}let u;for(let c in n)s.has(c)||(u=u??[],u.push(c));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{r.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,s))continue;let u=t.keyType._zod.run({value:s,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Rp.test(s)&&u.issues.length){let d=t.keyType._zod.run({value:Number(s),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(u=d)}if(u.issues.length){t.mode==="loose"?r.value[s]=n[s]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>Bt(d,o,tt())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:n[s],issues:[]},o);l instanceof Promise?i.push(l.then(d=>{d.issues.length&&r.issues.push(...er(s,d.issues)),r.value[u.value]=d.value})):(l.issues.length&&r.issues.push(...er(s,l.issues)),r.value[u.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),u_=P("$ZodMap",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[a,s]of n){let u=t.keyType._zod.run({value:a,issues:[]},o),c=t.valueType._zod.run({value:s,issues:[]},o);u instanceof Promise||c instanceof Promise?i.push(Promise.all([u,c]).then(([l,d])=>{vI(l,d,r,a,n,e,o)})):vI(u,c,r,a,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function vI(e,t,r,o,n,i,a){e.issues.length&&(rl.has(typeof o)?r.issues.push(...er(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>Bt(s,a,tt()))})),t.issues.length&&(rl.has(typeof o)?r.issues.push(...er(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>Bt(s,a,tt()))})),r.value.set(e.value,t.value)}var c_=P("$ZodSet",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of n){let s=t.valueType._zod.run({value:a,issues:[]},o);s instanceof Promise?i.push(s.then(u=>bI(u,r))):bI(s,r)}return i.length?Promise.all(i).then(()=>r):r}});function bI(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var l_=P("$ZodEnum",(e,t)=>{ye.init(e,t);let r=el(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>rl.has(typeof n)).map(n=>typeof n=="string"?Ir(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:e}),n}}),d_=P("$ZodLiteral",(e,t)=>{if(ye.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?Ir(o):o?Ir(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),p_=P("$ZodFile",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),f_=P("$ZodTransform",(e,t)=>{ye.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ao(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r.fallback=!0,r));if(n instanceof Promise)throw new qr;return r.value=n,r.fallback=!0,r}});function wI(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ki=P("$ZodOptional",(e,t)=>{ye.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ie(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ie(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${tl(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);return i instanceof Promise?i.then(a=>wI(a,n)):wI(i,n)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),m_=P("$ZodExactOptional",(e,t)=>{Ki.init(e,t),Ie(e._zod,"values",()=>t.innerType._zod.values),Ie(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),h_=P("$ZodNullable",(e,t)=>{ye.init(e,t),Ie(e._zod,"optin",()=>t.innerType._zod.optin),Ie(e._zod,"optout",()=>t.innerType._zod.optout),Ie(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${tl(r.source)}|null)$`):void 0}),Ie(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),g_=P("$ZodDefault",(e,t)=>{ye.init(e,t),e._zod.optin="optional",Ie(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>xI(i,t)):xI(n,t)}});function xI(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var y_=P("$ZodPrefault",(e,t)=>{ye.init(e,t),e._zod.optin="optional",Ie(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),__=P("$ZodNonOptional",(e,t)=>{ye.init(e,t),Ie(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>kI(i,e)):kI(n,e)}});function kI(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 v_=P("$ZodSuccess",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ao("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),b_=P("$ZodCatch",(e,t)=>{ye.init(e,t),e._zod.optin="optional",Ie(e._zod,"optout",()=>t.innerType._zod.optout),Ie(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(a=>Bt(a,o,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>Bt(i,o,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),w_=P("$ZodNaN",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),Fp=P("$ZodPipe",(e,t)=>{ye.init(e,t),Ie(e._zod,"values",()=>t.in._zod.values),Ie(e._zod,"optin",()=>t.in._zod.optin),Ie(e._zod,"optout",()=>t.out._zod.optout),Ie(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>Np(a,t.in,o)):Np(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Np(i,t.out,o)):Np(n,t.out,o)}});function Np(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}var hl=P("$ZodCodec",(e,t)=>{ye.init(e,t),Ie(e._zod,"values",()=>t.in._zod.values),Ie(e._zod,"optin",()=>t.in._zod.optin),Ie(e._zod,"optout",()=>t.out._zod.optout),Ie(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(a=>jp(a,t,o)):jp(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(a=>jp(a,t,o)):jp(i,t,o)}}});function jp(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Dp(e,i,t.out,r)):Dp(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Dp(e,i,t.in,r)):Dp(e,n,t.in,r)}}function Dp(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}var x_=P("$ZodPreprocess",(e,t)=>{Fp.init(e,t)}),k_=P("$ZodReadonly",(e,t)=>{ye.init(e,t),Ie(e._zod,"propValues",()=>t.innerType._zod.propValues),Ie(e._zod,"values",()=>t.innerType._zod.values),Ie(e._zod,"optin",()=>t.innerType?._zod?.optin),Ie(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(AI):AI(n)}});function AI(e){return e.value=Object.freeze(e.value),e}var A_=P("$ZodTemplateLiteral",(e,t)=>{ye.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,a))}else if(o===null||_g.has(typeof o))r.push(Ir(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),I_=P("$ZodFunction",(e,t)=>(ye.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?hn(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?hn(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await Fi(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await Fi(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new Zp({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),$_=P("$ZodPromise",(e,t)=>{ye.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),S_=P("$ZodLazy",(e,t)=>{ye.init(e,t),Ie(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),Ie(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ie(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ie(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ie(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),O_=P("$ZodCustom",(e,t)=>{Ke.init(e,t),ye.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>II(i,r,o,e));II(n,r,o,e)}});function II(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(Is(n))}}var yl={};Kr(yl,{ar:()=>EI,az:()=>RI,be:()=>zI,bg:()=>NI,ca:()=>jI,cs:()=>DI,da:()=>MI,de:()=>UI,el:()=>LI,en:()=>Bp,eo:()=>ZI,es:()=>FI,fa:()=>BI,fi:()=>WI,fr:()=>KI,frCA:()=>VI,he:()=>qI,hr:()=>JI,hu:()=>HI,hy:()=>GI,id:()=>YI,is:()=>QI,it:()=>e$,ja:()=>t$,ka:()=>r$,kh:()=>n$,km:()=>Wp,ko:()=>o$,lt:()=>a$,mk:()=>s$,ms:()=>u$,nl:()=>c$,no:()=>l$,ota:()=>d$,pl:()=>f$,ps:()=>p$,pt:()=>m$,ro:()=>h$,ru:()=>y$,sl:()=>_$,sv:()=>v$,ta:()=>b$,th:()=>w$,tr:()=>x$,ua:()=>k$,uk:()=>Kp,ur:()=>A$,uz:()=>I$,vi:()=>$$,yo:()=>P$,zhCN:()=>S$,zhTW:()=>O$});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(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.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 ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return n.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 ${M(n.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: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${n.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${T(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.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 ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function EI(){return{localeError:Az()}}var Iz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${s}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${M(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function RI(){return{localeError:Iz()}}function CI(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var $z=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return n.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 ${M(n.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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=CI(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.maximum.toString()} ${u}`}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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),u=CI(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${n.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function zI(){return{localeError:$z()}}var Sz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${M(n.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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.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 "${i.prefix}"`;if(i.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 "${i.suffix}"`;if(i.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 "${i.includes}"`;if(i.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 ${i.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.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 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function NI(){return{localeError:Sz()}}var Oz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${s}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${M(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${T(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",a=t(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function jI(){return{localeError:Oz()}}var Pz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${s}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${M(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${T(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function DI(){return{localeError:Pz()}}var Tz=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${s}`:`Ugyldigt input: forventede ${i}, fik ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${M(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${i} ${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`For lille: forventede ${s} ${a.verb} ${i} ${n.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function MI(){return{localeError:Tz()}}var Ez=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${s}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${M(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function UI(){return{localeError:Ez()}}var Rz=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${M(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${a.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${a.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`:i.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`:i.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`:i.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function LI(){return{localeError:Rz()}}var Cz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return`Invalid input: expected ${i}, received ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${M(n.values[0])}`:`Invalid option: expected one of ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${a.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(a=>`'${a}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Bp(){return{localeError:Cz()}}var zz=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${s}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${M(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function ZI(){return{localeError:zz()}}var Nz=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={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"},o={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 n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${M(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${i}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function FI(){return{localeError:Nz()}}var jz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${M(n.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 ${T(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.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 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${T(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.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 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function BI(){return{localeError:jz()}}var Dz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${s}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${M(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${T(n.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 WI(){return{localeError:Dz()}}var Mz=()=>{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(n){return e[n]??null}let r={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"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${s} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${M(n.values[0])} attendu`:`Option invalide : une valeur parmi ${T(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Trop grand : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Trop petit : ${o[n.origin]??"valeur"} doit ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${T(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function KI(){return{localeError:Mz()}}var Uz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${s}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${M(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",a=t(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",a=t(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${T(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function VI(){return{localeError:Uz()}}var Lz=()=>{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"}},r=c=>c?e[c]:void 0,o=c=>{let l=r(c);return l?l.label:c??e.unknown.label},n=c=>`\u05D4${o(c)}`,i=c=>(r(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=c=>c?t[c]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{let l=c.expected,d=u[l??""]??o(l),p=U(c.input),f=u[p]??e[p]?.label??p;return/^[A-Z]/.test(c.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${c.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(c.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 ${M(c.values[0])}`;let l=c.values.map(f=>M(f));if(c.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 ${l[0]} \u05D0\u05D5 ${l[1]}`;let d=l[l.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 ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let l=a(c.origin),d=n(c.origin??"value");if(c.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${l?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let h=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(c.origin==="array"||c.origin==="set"){let h=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=c.inclusive?`${c.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let p=c.inclusive?"<=":"<",f=i(c.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${c.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${c.maximum.toString()}`}case"too_small":{let l=a(c.origin),d=n(c.origin??"value");if(c.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${l?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let h=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${h}`}if(c.origin==="array"||c.origin==="set"){let h=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let _=(c.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`}let y=c.inclusive?`${c.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${h} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let p=c.inclusive?">=":">",f=i(c.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${c.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${p}${c.minimum.toString()}`}case"invalid_format":{let l=c;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.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 ${l.pattern}`;let d=s[l.format],p=d?.label??l.format,h=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${h}`}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 ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${T(c.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${n(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function qI(){return{localeError:Lz()}}var Zz=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${s}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${M(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${i}${n.maximum.toString()} ${a.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=o[n.origin]??n.origin;return a?`Premalo: o\u010Dekivano da ${s} ima ${i}${n.minimum.toString()} ${a.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${T(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function JI(){return{localeError:Zz()}}var Fz=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${M(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function HI(){return{localeError:Fz()}}function XI(e,t,r){return Math.abs(e)===1?t:r}function Es(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var Bz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.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 ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return n.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 ${M(n.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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=XI(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Es(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${u}`}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 ${Es(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),u=XI(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Es(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${u}`}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 ${Es(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.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 ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.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 ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${T(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Es(n.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 ${Es(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function GI(){return{localeError:Bz()}}var Wz=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${M(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function YI(){return{localeError:Wz()}}var Kz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${M(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${T(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function QI(){return{localeError:Kz()}}var Vz=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${s}`:`Input non valido: atteso ${i}, ricevuto ${s}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${M(n.values[0])}`:`Opzione non valida: atteso uno tra ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${T(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function e$(){return{localeError:Vz()}}var qz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${M(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${T(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.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${n.keys.length>1?"\u7FA4":""}: ${T(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function t$(){return{localeError:qz()}}var Jz=()=>{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(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.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 ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return n.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 ${M(n.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 ${T(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.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 ${n.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${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.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 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function r$(){return{localeError:Jz()}}var Hz=()=>{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(n){return e[n]??null}let r={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"},o={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 n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.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 ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return n.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 ${M(n.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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${T(n.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 ${n.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 ${n.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 Wp(){return{localeError:Hz()}}function n$(){return Wp()}var Xz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${M(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${T(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),u=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${a}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=t(n.origin),u=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${i}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${T(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function o$(){return{localeError:Xz()}}var gl=e=>e.charAt(0).toUpperCase()+e.slice(1);function i$(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var Gz=()=>{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(n,i,a,s){let u=e[n]??null;return u===null?u:{unit:u.unit[i],verb:u.verb[s][a?"inclusive":"notInclusive"]}}let r={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"},o={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 n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${M(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${T(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,a=t(n.origin,i$(Number(n.maximum)),n.inclusive??!1,"smaller");if(a?.verb)return`${gl(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.maximum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${gl(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.maximum.toString()} ${a?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,a=t(n.origin,i$(Number(n.minimum)),n.inclusive??!1,"bigger");if(a?.verb)return`${gl(i??n.origin??"reik\u0161m\u0117")} ${a.verb} ${n.minimum.toString()} ${a.unit??"element\u0173"}`;let s=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${gl(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${n.minimum.toString()} ${a?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${T(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${gl(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function a$(){return{localeError:Gz()}}var Yz=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${M(n.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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`Invalid ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`${n.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"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.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 ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function s$(){return{localeError:Yz()}}var Qz=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${s}`:`Input tidak sah: dijangka ${i}, diterima ${s}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${M(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${T(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function u$(){return{localeError:Qz()}}var eN=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${i}, ontving ${s}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${M(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin),s=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin),s=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function c$(){return{localeError:eN()}}var tN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${s}`:`Ugyldig input: forventet ${i}, fikk ${s}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${M(n.values[0])}`:`Ugyldig valg: forventet en av ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function l$(){return{localeError:tN()}}var rN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${M(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function d$(){return{localeError:rN()}}var nN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${M(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${T(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${T(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.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 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function p$(){return{localeError:nN()}}var oN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${s}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${M(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function f$(){return{localeError:oN()}}var iN=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${s}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${M(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function m$(){return{localeError:iN()}}var aN=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${s}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${M(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Prea mic: a\u0219teptat ca ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`:i.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`:i.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`:i.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`:`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${T(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};function h$(){return{localeError:aN()}}function g$(e,t,r,o){let n=Math.abs(e),i=n%10,a=n%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?r:o}var sN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${M(n.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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);if(a){let s=Number(n.maximum),u=g$(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${u}`}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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);if(a){let s=Number(n.minimum),u=g$(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${u}`}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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.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 ${n.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 y$(){return{localeError:sN()}}var uN=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${s}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${M(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${T(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function _$(){return{localeError:uN()}}var cN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${s}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${M(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function v$(){return{localeError:cN()}}var lN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.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 ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return n.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 ${M(n.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 ${T(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.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 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.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${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.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`${n.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 b$(){return{localeError:lN()}}var dN=()=>{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(n){return e[n]??null}let r={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"},o={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 n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.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 ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${M(n.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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.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 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.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 ${n.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: ${T(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.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 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function w$(){return{localeError:dN()}}var pN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${s}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${M(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function x$(){return{localeError:pN()}}var fN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.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 ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return n.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 ${M(n.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 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.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 "${i.suffix}"`:i.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 "${i.includes}"`:i.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 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${T(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.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 Kp(){return{localeError:fN()}}function k$(){return Kp()}var mN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${M(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${T(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.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${n.keys.length>1?"\u0632":""}: ${T(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function A$(){return{localeError:mN()}}var hN=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${s}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${M(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function I$(){return{localeError:hN()}}var gN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${M(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${i}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${T(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.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 ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function $$(){return{localeError:gN()}}var yN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${M(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function S$(){return{localeError:yN()}}var _N=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${M(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${T(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function O$(){return{localeError:_N()}}var vN=()=>{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(n){return e[n]??null}let r={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"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,a=U(n.input),s=o[a]??a;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${M(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${T(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",a=t(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${i}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",a=t(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${i}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.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 "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${T(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.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 ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function P$(){return{localeError:vN()}}var T$,P_=Symbol("ZodOutput"),T_=Symbol("ZodInput"),Vp=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Rs(){return new Vp}(T$=globalThis).__zod_globalRegistry??(T$.__zod_globalRegistry=Rs());var je=globalThis.__zod_globalRegistry;function E_(e,t){return new e({type:"string",...B(t)})}function R_(e,t){return new e({type:"string",coerce:!0,...B(t)})}function qp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...B(t)})}function _l(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...B(t)})}function Jp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...B(t)})}function Hp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...B(t)})}function Xp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...B(t)})}function Gp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...B(t)})}function vl(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...B(t)})}function Yp(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...B(t)})}function Qp(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...B(t)})}function ef(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...B(t)})}function tf(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...B(t)})}function rf(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...B(t)})}function nf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...B(t)})}function of(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...B(t)})}function af(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...B(t)})}function sf(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...B(t)})}function C_(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...B(t)})}function uf(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...B(t)})}function cf(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...B(t)})}function lf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...B(t)})}function df(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...B(t)})}function pf(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...B(t)})}function ff(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...B(t)})}var z_={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function N_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...B(t)})}function j_(e,t){return new e({type:"string",format:"date",check:"string_format",...B(t)})}function D_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...B(t)})}function M_(e,t){return new e({type:"string",format:"duration",check:"string_format",...B(t)})}function U_(e,t){return new e({type:"number",checks:[],...B(t)})}function L_(e,t){return new e({type:"number",coerce:!0,checks:[],...B(t)})}function Z_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...B(t)})}function F_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...B(t)})}function B_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...B(t)})}function W_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...B(t)})}function K_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...B(t)})}function V_(e,t){return new e({type:"boolean",...B(t)})}function q_(e,t){return new e({type:"boolean",coerce:!0,...B(t)})}function J_(e,t){return new e({type:"bigint",...B(t)})}function H_(e,t){return new e({type:"bigint",coerce:!0,...B(t)})}function X_(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...B(t)})}function G_(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...B(t)})}function Y_(e,t){return new e({type:"symbol",...B(t)})}function Q_(e,t){return new e({type:"undefined",...B(t)})}function ev(e,t){return new e({type:"null",...B(t)})}function tv(e){return new e({type:"any"})}function bl(e){return new e({type:"unknown"})}function wl(e,t){return new e({type:"never",...B(t)})}function rv(e,t){return new e({type:"void",...B(t)})}function nv(e,t){return new e({type:"date",...B(t)})}function ov(e,t){return new e({type:"date",coerce:!0,...B(t)})}function iv(e,t){return new e({type:"nan",...B(t)})}function gn(e,t){return new Cp({check:"less_than",...B(t),value:e,inclusive:!1})}function hr(e,t){return new Cp({check:"less_than",...B(t),value:e,inclusive:!0})}function yn(e,t){return new zp({check:"greater_than",...B(t),value:e,inclusive:!1})}function Wt(e,t){return new zp({check:"greater_than",...B(t),value:e,inclusive:!0})}function mf(e){return yn(0,e)}function hf(e){return gn(0,e)}function gf(e){return hr(0,e)}function yf(e){return Wt(0,e)}function Po(e,t){return new ry({check:"multiple_of",...B(t),value:e})}function To(e,t){return new iy({check:"max_size",...B(t),maximum:e})}function _n(e,t){return new ay({check:"min_size",...B(t),minimum:e})}function Vi(e,t){return new sy({check:"size_equals",...B(t),size:e})}function qi(e,t){return new uy({check:"max_length",...B(t),maximum:e})}function Zn(e,t){return new cy({check:"min_length",...B(t),minimum:e})}function Ji(e,t){return new ly({check:"length_equals",...B(t),length:e})}function Cs(e,t){return new dy({check:"string_format",format:"regex",...B(t),pattern:e})}function zs(e){return new py({check:"string_format",format:"lowercase",...B(e)})}function Ns(e){return new fy({check:"string_format",format:"uppercase",...B(e)})}function js(e,t){return new my({check:"string_format",format:"includes",...B(t),includes:e})}function Ds(e,t){return new hy({check:"string_format",format:"starts_with",...B(t),prefix:e})}function Ms(e,t){return new gy({check:"string_format",format:"ends_with",...B(t),suffix:e})}function _f(e,t,r){return new yy({check:"property",property:e,schema:t,...B(r)})}function Us(e,t){return new _y({check:"mime_type",mime:e,...B(t)})}function Jr(e){return new vy({check:"overwrite",tx:e})}function Ls(e){return Jr(t=>t.normalize(e))}function Zs(){return Jr(e=>e.trim())}function Fs(){return Jr(e=>e.toLowerCase())}function Bs(){return Jr(e=>e.toUpperCase())}function Ws(){return Jr(e=>hg(e))}function av(e,t,r){return new e({type:"array",element:t,...B(r)})}function wN(e,t,r){return new e({type:"union",options:t,...B(r)})}function xN(e,t,r){return new e({type:"union",options:t,inclusive:!1,...B(r)})}function kN(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...B(o)})}function AN(e,t,r){return new e({type:"intersection",left:t,right:r})}function IN(e,t,r,o){let n=r instanceof ye,i=n?o:r,a=n?r:null;return new e({type:"tuple",items:t,rest:a,...B(i)})}function $N(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...B(o)})}function SN(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...B(o)})}function ON(e,t,r){return new e({type:"set",valueType:t,...B(r)})}function PN(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...B(r)})}function TN(e,t,r){return new e({type:"enum",entries:t,...B(r)})}function EN(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...B(r)})}function sv(e,t){return new e({type:"file",...B(t)})}function RN(e,t){return new e({type:"transform",transform:t})}function CN(e,t){return new e({type:"optional",innerType:t})}function zN(e,t){return new e({type:"nullable",innerType:t})}function NN(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():yg(r)}})}function jN(e,t,r){return new e({type:"nonoptional",innerType:t,...B(r)})}function DN(e,t){return new e({type:"success",innerType:t})}function MN(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function UN(e,t,r){return new e({type:"pipe",in:t,out:r})}function LN(e,t){return new e({type:"readonly",innerType:t})}function ZN(e,t,r){return new e({type:"template_literal",parts:t,...B(r)})}function FN(e,t){return new e({type:"lazy",getter:t})}function BN(e,t){return new e({type:"promise",innerType:t})}function uv(e,t,r){let o=B(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function cv(e,t,r){return new e({type:"custom",check:"custom",fn:t,...B(r)})}function lv(e,t){let r=E$(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(Is(n,o.value,r._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(Is(i))}},e(o.value,o)),t);return r}function E$(e,t){let r=new Ke({check:"custom",...B(t)});return r._zod.check=e,r}function dv(e){let t=new Ke({check:"describe"});return t._zod.onattach=[r=>{let o=je.get(r)??{};je.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function pv(e){let t=new Ke({check:"meta"});return t._zod.onattach=[r=>{let o=je.get(r)??{};je.add(r,{...o,...e})}],t._zod.check=()=>{},t}function fv(e,t){let r=B(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let i=new Set(o),a=new Set(n),s=e.Codec??hl,u=e.Boolean??dl,c=e.String??Wi,l=new c({type:"string",error:r.error}),d=new u({type:"boolean",error:r.error}),p=new s({type:"pipe",in:l,out:d,transform:((f,h)=>{let y=f;return r.case!=="sensitive"&&(y=y.toLowerCase()),i.has(y)?!0:a.has(y)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:h.value,inst:p,continue:!1}),{})}),reverseTransform:((f,h)=>f===!0?o[0]||"true":n[0]||"false"),error:r.error});return p}function Ks(e,t,r,o={}){let n=B(o),i={...B(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Eo(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??je,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 Me(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,l);else{let p=a.schema,f=t.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);f(e,t,p,l)}let d=e._zod.parent;d&&(a.ref||(a.ref=d),Me(d,t,l),t.seen.get(d).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(a.schema,u),t.io==="input"&&Kt(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Ro(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let a of e.seen.entries()){let s=e.metadataRegistry.get(a[0])?.id;if(s){let u=o.get(s);if(u&&u!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(s,a[0])}}let n=a=>{let s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(a[0])?.id,p=e.external.uri??(h=>h);if(d)return{ref:p(d)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${p("__shared")}#/${s}/${f}`}}if(a[1]===r)return{ref:"#"};let c=`#/${s}/`,l=a[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+l}},i=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:u,defId:c}=n(a);s.def={...s.schema},c&&(s.defId=c);let l=s.schema;for(let d in l)delete l[d];l.$ref=u};if(e.cycles==="throw")for(let a of e.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
65
+
66
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let s=a[1];if(t===a[0]){i(a);continue}if(e.external){let c=e.external.registry.get(a[0])?.id;if(t!==a[0]&&c){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function Co(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let u=e.seen.get(s);if(u.ref===null)return;let c=u.def??u.schema,l={...c},d=u.ref;if(u.ref=null,d){o(d);let f=e.seen.get(d),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===d)for(let _ in c)_==="$ref"||_==="allOf"||_ in l||delete c[_];if(h.$ref&&f.def)for(let _ in c)_==="$ref"||_==="allOf"||_ in f.def&&JSON.stringify(c[_])===JSON.stringify(f.def[_])&&delete c[_]}let p=s._zod.parent;if(p&&p!==d){o(p);let f=e.seen.get(p);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:u.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$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");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&n.id===i&&delete n.id;let a=e.external?.defs??{};for(let s of e.seen.entries()){let u=s[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,a[u.defId]=u.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?n.$defs=a:n.definitions=a);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Vs(t,"input",e.processors),output:Vs(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Kt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Kt(o.element,r);if(o.type==="set")return Kt(o.valueType,r);if(o.type==="lazy")return Kt(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Kt(o.innerType,r);if(o.type==="intersection")return Kt(o.left,r)||Kt(o.right,r);if(o.type==="record"||o.type==="map")return Kt(o.keyType,r)||Kt(o.valueType,r);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Kt(o.in,r)||Kt(o.out,r);if(o.type==="object"){for(let n in o.shape)if(Kt(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Kt(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Kt(n,r))return!0;return!!(o.rest&&Kt(o.rest,r))}return!1}var mv=(e,t={})=>r=>{let o=Eo({...r,processors:t});return Me(e,o),Ro(o,e),Co(o,e)},Vs=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},a=Eo({...n??{},target:i,io:t,processors:r});return Me(e,a),Ro(a,e),Co(a,e)};var WN={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},hv=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:a,format:s,patterns:u,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof a=="number"&&(n.maxLength=a),s&&(n.format=WN[s]??s,n.format===""&&delete n.format,s==="time"&&delete n.format),c&&(n.contentEncoding=c),u&&u.size>0){let l=[...u];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},gv=(e,t,r,o)=>{let n=r,{minimum:i,maximum:a,format:s,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;typeof s=="string"&&s.includes("int")?n.type="integer":n.type="number";let d=typeof l=="number"&&l>=(i??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(a??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";d?f?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof i=="number"&&(n.minimum=i),p?f?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c:typeof a=="number"&&(n.maximum=a),typeof u=="number"&&(n.multipleOf=u)},yv=(e,t,r,o)=>{r.type="boolean"},_v=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},vv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},bv=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},wv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},xv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},kv=(e,t,r,o)=>{r.not={}},Av=(e,t,r,o)=>{},Iv=(e,t,r,o)=>{},$v=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Sv=(e,t,r,o)=>{let n=e._zod.def,i=el(n.entries);i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),r.enum=i},Ov=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let a of n.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){let a=i[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else i.every(a=>typeof a=="number")&&(r.type="number"),i.every(a=>typeof a=="string")&&(r.type="string"),i.every(a=>typeof a=="boolean")&&(r.type="boolean"),i.every(a=>a===null)&&(r.type="null"),r.enum=i},Pv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Tv=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},Ev=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:u}=e._zod.bag;a!==void 0&&(i.minLength=a),s!==void 0&&(i.maxLength=s),u?u.length===1?(i.contentMediaType=u[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=u.map(c=>({contentMediaType:c}))):Object.assign(n,i)},Rv=(e,t,r,o)=>{r.type="boolean"},Cv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Nv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},jv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Dv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Mv=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(n.minItems=a),typeof s=="number"&&(n.maxItems=s),n.type="array",n.items=Me(i.element,t,{...o,path:[...o.path,"items"]})},Uv=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let c in a)n.properties[c]=Me(a[c],t,{...o,path:[...o.path,"properties",c]});let s=new Set(Object.keys(a)),u=new Set([...s].filter(c=>{let l=i.shape[c]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));u.size>0&&(n.required=Array.from(u)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=Me(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},bf=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,a=n.options.map((s,u)=>Me(s,t,{...o,path:[...o.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=a:r.anyOf=a},Lv=(e,t,r,o)=>{let n=e._zod.def,i=Me(n.left,t,{...o,path:[...o.path,"allOf",0]}),a=Me(n.right,t,{...o,path:[...o.path,"allOf",1]}),s=c=>"allOf"in c&&Object.keys(c).length===1,u=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];r.allOf=u},Zv=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let a=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((p,f)=>Me(p,t,{...o,path:[...o.path,a,f]})),c=i.rest?Me(i.rest,t,{...o,path:[...o.path,s,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=u,c&&(n.items=c)):t.target==="openapi-3.0"?(n.items={anyOf:u},c&&n.items.anyOf.push(c),n.minItems=u.length,c||(n.maxItems=u.length)):(n.items=u,c&&(n.additionalItems=c));let{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(n.minItems=l),typeof d=="number"&&(n.maxItems=d)},Fv=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let a=i.keyType,u=a._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let l=Me(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of u)n.patternProperties[d.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=Me(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=Me(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let c=a._zod.values;if(c){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l)}},Bv=(e,t,r,o)=>{let n=e._zod.def,i=Me(n.innerType,t,o),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},Wv=(e,t,r,o)=>{let n=e._zod.def;Me(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Kv=(e,t,r,o)=>{let n=e._zod.def;Me(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},Vv=(e,t,r,o)=>{let n=e._zod.def;Me(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},qv=(e,t,r,o)=>{let n=e._zod.def;Me(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let a;try{a=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},Jv=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),a=t.io==="input"?i?n.out:n.in:n.out;Me(a,t,o);let s=t.seen.get(e);s.ref=a},Hv=(e,t,r,o)=>{let n=e._zod.def;Me(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},Xv=(e,t,r,o)=>{let n=e._zod.def;Me(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},wf=(e,t,r,o)=>{let n=e._zod.def;Me(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Gv=(e,t,r,o)=>{let n=e._zod.innerType;Me(n,t,o);let i=t.seen.get(e);i.ref=n},vf={string:hv,number:gv,boolean:yv,bigint:_v,symbol:vv,null:bv,undefined:wv,void:xv,never:kv,any:Av,unknown:Iv,date:$v,enum:Sv,literal:Ov,nan:Pv,template_literal:Tv,file:Ev,success:Rv,custom:Cv,function:zv,transform:Nv,map:jv,set:Dv,array:Mv,object:Uv,union:bf,intersection:Lv,tuple:Zv,record:Fv,nullable:Bv,nonoptional:Wv,default:Kv,prefault:Vv,catch:qv,pipe:Jv,readonly:Hv,promise:Xv,optional:wf,lazy:Gv};function Fn(e,t){if("_idmap"in e){let o=e,n=Eo({...t,processors:vf}),i={};for(let u of o._idmap.entries()){let[c,l]=u;Me(l,n)}let a={},s={registry:o,uri:t?.uri,defs:i};n.external=s;for(let u of o._idmap.entries()){let[c,l]=u;Ro(n,l),a[c]=Co(n,l)}if(Object.keys(i).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:i}}return{schemas:a}}let r=Eo({...t,processors:vf});return Me(e,r),Ro(r,e),Co(r,e)}var xf=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 r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Eo({processors:vf,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return Me(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Ro(this.ctx,t);let o=Co(this.ctx,t),{"~standard":n,...i}=o;return i}};var R$={};function Ze(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_zod"in t))return!1;let r=t._zod;return typeof r=="object"&&r!==null&&"def"in r}function rt(e){if(typeof e!="object"||e===null)return!1;let t=e;if(!("_def"in t)||"_zod"in t)return!1;let r=t._def;return typeof r=="object"&&r!=null&&"typeName"in r}function C$(e){return Ze(e)&&console.warn("[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior."),rt(e)}function _t(e){return!e||typeof e!="object"||Array.isArray(e)?!1:!!(Ze(e)||rt(e))}function Yv(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 Qv(e){return Ze(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 z$(e){return!!(Yv(e)||Qv(e))}async function If(e,t){if(Ze(e))try{return{success:!0,data:await Fi(e,t)}}catch(r){return{success:!1,error:r}}if(rt(e))return await e.safeParseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}async function zo(e,t){if(Ze(e))return await Fi(e,t);if(rt(e))return await e.parseAsync(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function N$(e,t){if(Ze(e))try{return{success:!0,data:hn(e,t)}}catch(r){return{success:!1,error:r}}if(rt(e))return e.safeParse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function j$(e,t){if(Ze(e))return hn(e,t);if(rt(e))return e.parse(t);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function No(e){if(Ze(e))return je.get(e)?.description;if(rt(e)||"description"in e&&typeof e.description=="string")return e.description}function D$(e){if(!_t(e))return!1;if(rt(e)){let t=e._def;if(t.typeName==="ZodObject"){let r=e;return!r.shape||Object.keys(r.shape).length===0}if(t.typeName==="ZodRecord")return!0}if(Ze(e)){let t=e._zod.def;if(t.type==="object"){let r=e;return!r.shape||Object.keys(r.shape).length===0}if(t.type==="record")return!0}return typeof e=="object"&&e!==null&&!("shape"in e)}function Js(e){return _t(e)?rt(e)?e._def.typeName==="ZodString":Ze(e)?e._zod.def.type==="string":!1:!1}function xl(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 $r(e){return Ze(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 kl(e){return Ze(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 eb(e){return Ze(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 tb(e){return Ze(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 M$(e){return!!(xl(e)||$r(e))}function kf(e){if(rt(e))return e.shape;if(Ze(e))return e._zod.def.shape;throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function U$(e,t){if(rt(e))return e.extend(t);if(Ze(e))return L.extend(e,t);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function L$(e){if(rt(e))return e.partial();if(Ze(e))return L.partial(Ki,e,void 0);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function qs(e,t=!1){if(xl(e))return e.strict();if($r(e)){let r=e._zod.def.shape;if(t)for(let[i,a]of Object.entries(e._zod.def.shape)){if($r(a))r[i]=qs(a,t);else if(kl(a)){let u=a._zod.def.element;$r(u)&&(u=qs(u,t)),r[i]=Je(a,{...a._zod.def,element:u})}else r[i]=a;let s=je.get(a);s&&je.add(r[i],s)}let o=Je(e,{...e._zod.def,shape:r,catchall:wl(fl)}),n=je.get(e);return n&&je.add(o,n),o}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Af(e,t=!1){if(xl(e))return e.passthrough();if($r(e)){let r=e._zod.def.shape;if(t)for(let[i,a]of Object.entries(e._zod.def.shape)){if($r(a))r[i]=Af(a,t);else if(kl(a)){let u=a._zod.def.element;$r(u)&&(u=Af(u,t)),r[i]=Je(a,{...a._zod.def,element:u})}else r[i]=a;let s=je.get(a);s&&je.add(r[i],s)}let o=Je(e,{...e._zod.def,shape:r,catchall:bl(pl)}),n=je.get(e);return n&&je.add(o,n),o}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Z$(e){if(rt(e))try{let t=e.parse(void 0);return()=>t}catch{return}if(Ze(e))try{let t=hn(e,void 0);return()=>t}catch{return}}function VN(e){return rt(e)&&"typeName"in e._def&&e._def.typeName==="ZodEffects"}function qN(e){return Ze(e)&&e._zod.def.type==="pipe"}function Hi(e,t,r){let o=r.get(e);if(o!==void 0)return o;if(rt(e))return VN(e)?Hi(e._def.schema,t,r):e;if(Ze(e)){let n=e;if(qN(e)&&(n=Hi(e._zod.def.in,t,r)),t){if($r(n)){let a={};for(let[s,u]of Object.entries(n._zod.def.shape))a[s]=Hi(u,t,r);n=Je(n,{...n._zod.def,shape:a})}else if(kl(n)){let a=Hi(n._zod.def.element,t,r);n=Je(n,{...n._zod.def,element:a})}else if(eb(n)){let a=Hi(n._zod.def.innerType,t,r);n=Je(n,{...n._zod.def,innerType:a})}else if(tb(n)){let a=Hi(n._zod.def.innerType,t,r);n=Je(n,{...n._zod.def,innerType:a})}}let i=je.get(e);return i&&je.add(n,i),r.set(e,n),n}throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function $f(e,t=!1){return Hi(e,t,new WeakMap)}function F$(e,t){if(rt(e)){let r=kf(e),o={};for(let[n,i]of Object.entries(r))t(n,i)?o[n]=i.optional():o[n]=i;return e.extend(o)}if(Ze(e)){let r=kf(e),o={...e._zod.def.shape};for(let[a,s]of Object.entries(r))t(a,s)&&(o[a]=new Ki({type:"optional",innerType:s}));let n=Je(e,{...e._zod.def,shape:o}),i=je.get(e);return i&&je.add(n,i),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function Sf(e){return e instanceof Error&&(e.constructor.name==="ZodError"||e.constructor.name==="$ZodError")}var nb=Symbol("Let zodToJsonSchema decide on which parser to use"),rb={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"},ob=e=>typeof e=="string"?{...rb,name:e}:{...rb,...e};var ib=e=>{let t=ob(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([o,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,o],jsonSchema:void 0}]))}};var Al=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function He(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?Al(t,e.currentPath):t.join("/")}}function Of(e,t,r,o){o?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function Te(e,t,r,o,n){e[t]=r,Of(e,t,o,n)}var Vt={};Kr(Vt,{BRAND:()=>v1,DIRTY:()=>Xi,EMPTY_PATH:()=>GN,INVALID:()=>ue,NEVER:()=>nj,OK:()=>zt,ParseStatus:()=>Ot,Schema:()=>Ae,ZodAny:()=>Mo,ZodArray:()=>qn,ZodBigInt:()=>Yi,ZodBoolean:()=>Qi,ZodBranded:()=>$l,ZodCatch:()=>la,ZodDate:()=>ea,ZodDefault:()=>ca,ZodDiscriminatedUnion:()=>Ef,ZodEffects:()=>Pr,ZodEnum:()=>sa,ZodError:()=>rr,ZodFirstPartyTypeKind:()=>E,ZodFunction:()=>Cf,ZodIntersection:()=>oa,ZodIssueCode:()=>Z,ZodLazy:()=>ia,ZodLiteral:()=>aa,ZodMap:()=>eu,ZodNaN:()=>ru,ZodNativeEnum:()=>ua,ZodNever:()=>Hr,ZodNull:()=>ra,ZodNullable:()=>wn,ZodNumber:()=>Gi,ZodObject:()=>nr,ZodOptional:()=>Sr,ZodParsedType:()=>X,ZodPipeline:()=>Sl,ZodPromise:()=>Uo,ZodReadonly:()=>da,ZodRecord:()=>Rf,ZodSchema:()=>Ae,ZodSet:()=>tu,ZodString:()=>Do,ZodSymbol:()=>Ys,ZodTransformer:()=>Pr,ZodTuple:()=>bn,ZodType:()=>Ae,ZodUndefined:()=>ta,ZodUnion:()=>na,ZodUnknown:()=>Vn,ZodVoid:()=>Qs,addIssueToContext:()=>K,any:()=>O1,array:()=>R1,bigint:()=>k1,boolean:()=>Q$,coerce:()=>rj,custom:()=>X$,date:()=>A1,datetimeRegex:()=>J$,defaultErrorMap:()=>Wn,discriminatedUnion:()=>j1,effect:()=>J1,enum:()=>K1,function:()=>F1,getErrorMap:()=>Hs,getParsedType:()=>vn,instanceof:()=>w1,intersection:()=>D1,isAborted:()=>Pf,isAsync:()=>Xs,isDirty:()=>Tf,isValid:()=>jo,late:()=>b1,lazy:()=>B1,literal:()=>W1,makeIssue:()=>Il,map:()=>L1,nan:()=>x1,nativeEnum:()=>V1,never:()=>T1,null:()=>S1,nullable:()=>X1,number:()=>Y$,object:()=>C1,objectUtil:()=>ab,oboolean:()=>tj,onumber:()=>ej,optional:()=>H1,ostring:()=>Q1,pipeline:()=>Y1,preprocess:()=>G1,promise:()=>q1,quotelessJson:()=>JN,record:()=>U1,set:()=>Z1,setErrorMap:()=>XN,strictObject:()=>z1,string:()=>G$,symbol:()=>I1,transformer:()=>J1,tuple:()=>M1,undefined:()=>$1,union:()=>N1,unknown:()=>P1,util:()=>Oe,void:()=>E1});var Oe;(function(e){e.assertEqual=n=>{};function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{let i={};for(let a of n)i[a]=a;return i},e.getValidEnumValues=n=>{let i=e.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),a={};for(let s of i)a[s]=n[s];return e.objectValues(a)},e.objectValues=n=>e.objectKeys(n).map(function(i){return n[i]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let i=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&i.push(a);return i},e.find=(n,i)=>{for(let a of n)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function o(n,i=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(Oe||(Oe={}));var ab;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(ab||(ab={}));var X=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),vn=e=>{switch(typeof e){case"undefined":return X.undefined;case"string":return X.string;case"number":return Number.isNaN(e)?X.nan:X.number;case"boolean":return X.boolean;case"function":return X.function;case"bigint":return X.bigint;case"symbol":return X.symbol;case"object":return Array.isArray(e)?X.array:e===null?X.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?X.promise:typeof Map<"u"&&e instanceof Map?X.map:typeof Set<"u"&&e instanceof Set?X.set:typeof Date<"u"&&e instanceof Date?X.date:X.object;default:return X.unknown}};var Z=Oe.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"]),JN=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),rr=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},o={_errors:[]},n=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)o._errors.push(r(a));else{let s=o,u=0;for(;u<a.path.length;){let c=a.path[u];u===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(r(a))):s[c]=s[c]||{_errors:[]},s=s[c],u++}}};return n(this),o}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),o=[];for(let n of this.issues)if(n.path.length>0){let i=n.path[0];r[i]=r[i]||[],r[i].push(t(n))}else o.push(t(n));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}};rr.create=e=>new rr(e);var HN=(e,t)=>{let r;switch(e.code){case Z.invalid_type:e.received===X.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Oe.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:r=`Unrecognized key(s) in object: ${Oe.joinValues(e.keys,", ")}`;break;case Z.invalid_union:r="Invalid input";break;case Z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Oe.joinValues(e.options)}`;break;case Z.invalid_enum_value:r=`Invalid enum value. Expected ${Oe.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:r="Invalid function arguments";break;case Z.invalid_return_type:r="Invalid function return type";break;case Z.invalid_date:r="Invalid date";break;case Z.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Oe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Z.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Z.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Z.custom:r="Invalid input";break;case Z.invalid_intersection_types:r="Intersection results could not be merged";break;case Z.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:r="Number must be finite";break;default:r=t.defaultError,Oe.assertNever(e)}return{message:r}},Wn=HN;var B$=Wn;function XN(e){B$=e}function Hs(){return B$}var Il=e=>{let{data:t,path:r,errorMaps:o,issueData:n}=e,i=[...r,...n.path||[]],a={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let s="",u=o.filter(c=>!!c).slice().reverse();for(let c of u)s=c(a,{data:t,defaultError:s}).message;return{...n,path:i,message:s}},GN=[];function K(e,t){let r=Hs(),o=Il({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Wn?void 0:Wn].filter(n=>!!n)});e.common.issues.push(o)}var Ot=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let o=[];for(let n of r){if(n.status==="aborted")return ue;n.status==="dirty"&&t.dirty(),o.push(n.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,r){let o=[];for(let n of r){let i=await n.key,a=await n.value;o.push({key:i,value:a})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,r){let o={};for(let n of r){let{key:i,value:a}=n;if(i.status==="aborted"||a.status==="aborted")return ue;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(o[i.value]=a.value)}return{status:t.value,value:o}}},ue=Object.freeze({status:"aborted"}),Xi=e=>({status:"dirty",value:e}),zt=e=>({status:"valid",value:e}),Pf=e=>e.status==="aborted",Tf=e=>e.status==="dirty",jo=e=>e.status==="valid",Xs=e=>typeof Promise<"u"&&e instanceof Promise;var re;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(re||(re={}));var Or=class{constructor(t,r,o,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=o,this._key=n}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}},W$=(e,t)=>{if(jo(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 r=new rr(e.common.issues);return this._error=r,this._error}}};function we(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:o,description:n}=e;if(t&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(a,s)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??s.defaultError}:typeof s.data>"u"?{message:u??o??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:u??r??s.defaultError}},description:n}}var Ae=class{get description(){return this._def.description}_getType(t){return vn(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:vn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ot,ctx:{common:t.parent.common,data:t.data,parsedType:vn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Xs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let o=this.safeParse(t,r);if(o.success)return o.data;throw o.error}safeParse(t,r){let o={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vn(t)},n=this._parseSync({data:t,path:o.path,parent:o});return W$(o,n)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vn(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:r});return jo(o)?{value:o.value}:{issues:r.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(o=>jo(o)?{value:o.value}:{issues:r.common.issues})}async parseAsync(t,r){let o=await this.safeParseAsync(t,r);if(o.success)return o.data;throw o.error}async safeParseAsync(t,r){let o={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:vn(t)},n=this._parse({data:t,path:o.path,parent:o}),i=await(Xs(n)?n:Promise.resolve(n));return W$(o,i)}refine(t,r){let o=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,i)=>{let a=t(n),s=()=>i.addIssue({code:Z.custom,...o(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((o,n)=>t(o)?!0:(n.addIssue(typeof r=="function"?r(o,n):r),!1))}_refinement(t){return new Pr({schema:this,typeName:E.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:r=>this["~validate"](r)}}optional(){return Sr.create(this,this._def)}nullable(){return wn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qn.create(this)}promise(){return Uo.create(this,this._def)}or(t){return na.create([this,t],this._def)}and(t){return oa.create(this,t,this._def)}transform(t){return new Pr({...we(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ca({...we(this._def),innerType:this,defaultValue:r,typeName:E.ZodDefault})}brand(){return new $l({typeName:E.ZodBranded,type:this,...we(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new la({...we(this._def),innerType:this,catchValue:r,typeName:E.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Sl.create(this,t)}readonly(){return da.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},YN=/^c[^\s-]{8,}$/i,QN=/^[0-9a-z]+$/,e1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,t1=/^[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,r1=/^[a-z0-9_-]{21}$/i,n1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,o1=/^[-+]?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)?)??$/,i1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,a1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",sb,s1=/^(?:(?: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])$/,u1=/^(?:(?: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])$/,c1=/^(([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]))$/,l1=/^(([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])$/,d1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,p1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,V$="((\\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])))",f1=new RegExp(`^${V$}$`);function q$(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function m1(e){return new RegExp(`^${q$(e)}$`)}function J$(e){let t=`${V$}T${q$(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function h1(e,t){return!!((t==="v4"||!t)&&s1.test(e)||(t==="v6"||!t)&&c1.test(e))}function g1(e,t){if(!n1.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let o=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(o));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||t&&n.alg!==t)}catch{return!1}}function y1(e,t){return!!((t==="v4"||!t)&&u1.test(e)||(t==="v6"||!t)&&l1.test(e))}var Do=class e extends Ae{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==X.string){let i=this._getOrReturnCtx(t);return K(i,{code:Z.invalid_type,expected:X.string,received:i.parsedType}),ue}let o=new Ot,n;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(n=this._getOrReturnCtx(t,n),K(n,{code:Z.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="max")t.data.length>i.value&&(n=this._getOrReturnCtx(t,n),K(n,{code:Z.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,s=t.data.length<i.value;(a||s)&&(n=this._getOrReturnCtx(t,n),a?K(n,{code:Z.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&K(n,{code:Z.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),o.dirty())}else if(i.kind==="email")i1.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"email",code:Z.invalid_string,message:i.message}),o.dirty());else if(i.kind==="emoji")sb||(sb=new RegExp(a1,"u")),sb.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"emoji",code:Z.invalid_string,message:i.message}),o.dirty());else if(i.kind==="uuid")t1.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"uuid",code:Z.invalid_string,message:i.message}),o.dirty());else if(i.kind==="nanoid")r1.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"nanoid",code:Z.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid")YN.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"cuid",code:Z.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid2")QN.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"cuid2",code:Z.invalid_string,message:i.message}),o.dirty());else if(i.kind==="ulid")e1.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"ulid",code:Z.invalid_string,message:i.message}),o.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),K(n,{validation:"url",code:Z.invalid_string,message:i.message}),o.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"regex",code:Z.invalid_string,message:i.message}),o.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(t,n),K(n,{code:Z.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),o.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(n=this._getOrReturnCtx(t,n),K(n,{code:Z.invalid_string,validation:{startsWith:i.value},message:i.message}),o.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(n=this._getOrReturnCtx(t,n),K(n,{code:Z.invalid_string,validation:{endsWith:i.value},message:i.message}),o.dirty()):i.kind==="datetime"?J$(i).test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{code:Z.invalid_string,validation:"datetime",message:i.message}),o.dirty()):i.kind==="date"?f1.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{code:Z.invalid_string,validation:"date",message:i.message}),o.dirty()):i.kind==="time"?m1(i).test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{code:Z.invalid_string,validation:"time",message:i.message}),o.dirty()):i.kind==="duration"?o1.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"duration",code:Z.invalid_string,message:i.message}),o.dirty()):i.kind==="ip"?h1(t.data,i.version)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"ip",code:Z.invalid_string,message:i.message}),o.dirty()):i.kind==="jwt"?g1(t.data,i.alg)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"jwt",code:Z.invalid_string,message:i.message}),o.dirty()):i.kind==="cidr"?y1(t.data,i.version)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"cidr",code:Z.invalid_string,message:i.message}),o.dirty()):i.kind==="base64"?d1.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"base64",code:Z.invalid_string,message:i.message}),o.dirty()):i.kind==="base64url"?p1.test(t.data)||(n=this._getOrReturnCtx(t,n),K(n,{validation:"base64url",code:Z.invalid_string,message:i.message}),o.dirty()):Oe.assertNever(i);return{status:o.value,value:t.data}}_regex(t,r,o){return this.refinement(n=>t.test(n),{validation:r,code:Z.invalid_string,...re.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...re.errToObj(t)})}url(t){return this._addCheck({kind:"url",...re.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...re.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...re.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...re.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...re.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...re.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...re.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...re.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...re.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...re.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...re.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...re.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,...re.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,...re.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...re.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...re.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...re.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...re.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...re.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...re.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...re.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...re.errToObj(r)})}nonempty(t){return this.min(1,re.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...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 r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Do.create=e=>new Do({checks:[],typeName:E.ZodString,coerce:e?.coerce??!1,...we(e)});function _1(e,t){let r=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,n=r>o?r:o,i=Number.parseInt(e.toFixed(n).replace(".","")),a=Number.parseInt(t.toFixed(n).replace(".",""));return i%a/10**n}var Gi=class e extends Ae{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)!==X.number){let i=this._getOrReturnCtx(t);return K(i,{code:Z.invalid_type,expected:X.number,received:i.parsedType}),ue}let o,n=new Ot;for(let i of this._def.checks)i.kind==="int"?Oe.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),K(o,{code:Z.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(o=this._getOrReturnCtx(t,o),K(o,{code:Z.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),K(o,{code:Z.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?_1(t.data,i.value)!==0&&(o=this._getOrReturnCtx(t,o),K(o,{code:Z.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),K(o,{code:Z.not_finite,message:i.message}),n.dirty()):Oe.assertNever(i);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,re.toString(r))}gt(t,r){return this.setLimit("min",t,!1,re.toString(r))}lte(t,r){return this.setLimit("max",t,!0,re.toString(r))}lt(t,r){return this.setLimit("max",t,!1,re.toString(r))}setLimit(t,r,o,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:o,message:re.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:re.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:re.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:re.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:re.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:re.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:re.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:re.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:re.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:re.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Oe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(t===null||o.value<t)&&(t=o.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Gi.create=e=>new Gi({checks:[],typeName:E.ZodNumber,coerce:e?.coerce||!1,...we(e)});var Yi=class e extends Ae{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)!==X.bigint)return this._getInvalidInput(t);let o,n=new Ot;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(o=this._getOrReturnCtx(t,o),K(o,{code:Z.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),K(o,{code:Z.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),K(o,{code:Z.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):Oe.assertNever(i);return{status:n.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return K(r,{code:Z.invalid_type,expected:X.bigint,received:r.parsedType}),ue}gte(t,r){return this.setLimit("min",t,!0,re.toString(r))}gt(t,r){return this.setLimit("min",t,!1,re.toString(r))}lte(t,r){return this.setLimit("max",t,!0,re.toString(r))}lt(t,r){return this.setLimit("max",t,!1,re.toString(r))}setLimit(t,r,o,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:o,message:re.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:re.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:re.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:re.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:re.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:re.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Yi.create=e=>new Yi({checks:[],typeName:E.ZodBigInt,coerce:e?.coerce??!1,...we(e)});var Qi=class extends Ae{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==X.boolean){let o=this._getOrReturnCtx(t);return K(o,{code:Z.invalid_type,expected:X.boolean,received:o.parsedType}),ue}return zt(t.data)}};Qi.create=e=>new Qi({typeName:E.ZodBoolean,coerce:e?.coerce||!1,...we(e)});var ea=class e extends Ae{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==X.date){let i=this._getOrReturnCtx(t);return K(i,{code:Z.invalid_type,expected:X.date,received:i.parsedType}),ue}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return K(i,{code:Z.invalid_date}),ue}let o=new Ot,n;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(n=this._getOrReturnCtx(t,n),K(n,{code:Z.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),o.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(n=this._getOrReturnCtx(t,n),K(n,{code:Z.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):Oe.assertNever(i);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:re.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:re.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};ea.create=e=>new ea({checks:[],coerce:e?.coerce||!1,typeName:E.ZodDate,...we(e)});var Ys=class extends Ae{_parse(t){if(this._getType(t)!==X.symbol){let o=this._getOrReturnCtx(t);return K(o,{code:Z.invalid_type,expected:X.symbol,received:o.parsedType}),ue}return zt(t.data)}};Ys.create=e=>new Ys({typeName:E.ZodSymbol,...we(e)});var ta=class extends Ae{_parse(t){if(this._getType(t)!==X.undefined){let o=this._getOrReturnCtx(t);return K(o,{code:Z.invalid_type,expected:X.undefined,received:o.parsedType}),ue}return zt(t.data)}};ta.create=e=>new ta({typeName:E.ZodUndefined,...we(e)});var ra=class extends Ae{_parse(t){if(this._getType(t)!==X.null){let o=this._getOrReturnCtx(t);return K(o,{code:Z.invalid_type,expected:X.null,received:o.parsedType}),ue}return zt(t.data)}};ra.create=e=>new ra({typeName:E.ZodNull,...we(e)});var Mo=class extends Ae{constructor(){super(...arguments),this._any=!0}_parse(t){return zt(t.data)}};Mo.create=e=>new Mo({typeName:E.ZodAny,...we(e)});var Vn=class extends Ae{constructor(){super(...arguments),this._unknown=!0}_parse(t){return zt(t.data)}};Vn.create=e=>new Vn({typeName:E.ZodUnknown,...we(e)});var Hr=class extends Ae{_parse(t){let r=this._getOrReturnCtx(t);return K(r,{code:Z.invalid_type,expected:X.never,received:r.parsedType}),ue}};Hr.create=e=>new Hr({typeName:E.ZodNever,...we(e)});var Qs=class extends Ae{_parse(t){if(this._getType(t)!==X.undefined){let o=this._getOrReturnCtx(t);return K(o,{code:Z.invalid_type,expected:X.void,received:o.parsedType}),ue}return zt(t.data)}};Qs.create=e=>new Qs({typeName:E.ZodVoid,...we(e)});var qn=class e extends Ae{_parse(t){let{ctx:r,status:o}=this._processInputParams(t),n=this._def;if(r.parsedType!==X.array)return K(r,{code:Z.invalid_type,expected:X.array,received:r.parsedType}),ue;if(n.exactLength!==null){let a=r.data.length>n.exactLength.value,s=r.data.length<n.exactLength.value;(a||s)&&(K(r,{code:a?Z.too_big:Z.too_small,minimum:s?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),o.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(K(r,{code:Z.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),o.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(K(r,{code:Z.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>n.type._parseAsync(new Or(r,a,r.path,s)))).then(a=>Ot.mergeArray(o,a));let i=[...r.data].map((a,s)=>n.type._parseSync(new Or(r,a,r.path,s)));return Ot.mergeArray(o,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:re.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:re.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:re.toString(r)}})}nonempty(t){return this.min(1,t)}};qn.create=(e,t)=>new qn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...we(t)});function Gs(e){if(e instanceof nr){let t={};for(let r in e.shape){let o=e.shape[r];t[r]=Sr.create(Gs(o))}return new nr({...e._def,shape:()=>t})}else return e instanceof qn?new qn({...e._def,type:Gs(e.element)}):e instanceof Sr?Sr.create(Gs(e.unwrap())):e instanceof wn?wn.create(Gs(e.unwrap())):e instanceof bn?bn.create(e.items.map(t=>Gs(t))):e}var nr=class e extends Ae{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(),r=Oe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==X.object){let c=this._getOrReturnCtx(t);return K(c,{code:Z.invalid_type,expected:X.object,received:c.parsedType}),ue}let{status:o,ctx:n}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Hr&&this._def.unknownKeys==="strip"))for(let c in n.data)a.includes(c)||s.push(c);let u=[];for(let c of a){let l=i[c],d=n.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Or(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof Hr){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of s)u.push({key:{status:"valid",value:l},value:{status:"valid",value:n.data[l]}});else if(c==="strict")s.length>0&&(K(n,{code:Z.unrecognized_keys,keys:s}),o.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of s){let d=n.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Or(n,d,n.path,l)),alwaysSet:l in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let d=await l.key,p=await l.value;c.push({key:d,value:p,alwaysSet:l.alwaysSet})}return c}).then(c=>Ot.mergeObjectSync(o,c)):Ot.mergeObjectSync(o,u)}get shape(){return this._def.shape()}strict(t){return re.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,o)=>{let n=this._def.errorMap?.(r,o).message??o.defaultError;return r.code==="unrecognized_keys"?{message:re.errToObj(t).message??n}:{message:n}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:E.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let o of Oe.objectKeys(t))t[o]&&this.shape[o]&&(r[o]=this.shape[o]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let o of Oe.objectKeys(this.shape))t[o]||(r[o]=this.shape[o]);return new e({...this._def,shape:()=>r})}deepPartial(){return Gs(this)}partial(t){let r={};for(let o of Oe.objectKeys(this.shape)){let n=this.shape[o];t&&!t[o]?r[o]=n:r[o]=n.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let o of Oe.objectKeys(this.shape))if(t&&!t[o])r[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof Sr;)i=i._def.innerType;r[o]=i}return new e({...this._def,shape:()=>r})}keyof(){return H$(Oe.objectKeys(this.shape))}};nr.create=(e,t)=>new nr({shape:()=>e,unknownKeys:"strip",catchall:Hr.create(),typeName:E.ZodObject,...we(t)});nr.strictCreate=(e,t)=>new nr({shape:()=>e,unknownKeys:"strict",catchall:Hr.create(),typeName:E.ZodObject,...we(t)});nr.lazycreate=(e,t)=>new nr({shape:e,unknownKeys:"strip",catchall:Hr.create(),typeName:E.ZodObject,...we(t)});var na=class extends Ae{_parse(t){let{ctx:r}=this._processInputParams(t),o=this._def.options;function n(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new rr(s.ctx.common.issues));return K(r,{code:Z.invalid_union,unionErrors:a}),ue}if(r.common.async)return Promise.all(o.map(async i=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(n);{let i,a=[];for(let u of o){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!i&&(i={result:l,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(u=>new rr(u));return K(r,{code:Z.invalid_union,unionErrors:s}),ue}}get options(){return this._def.options}};na.create=(e,t)=>new na({options:e,typeName:E.ZodUnion,...we(t)});var Kn=e=>e instanceof ia?Kn(e.schema):e instanceof Pr?Kn(e.innerType()):e instanceof aa?[e.value]:e instanceof sa?e.options:e instanceof ua?Oe.objectValues(e.enum):e instanceof ca?Kn(e._def.innerType):e instanceof ta?[void 0]:e instanceof ra?[null]:e instanceof Sr?[void 0,...Kn(e.unwrap())]:e instanceof wn?[null,...Kn(e.unwrap())]:e instanceof $l||e instanceof da?Kn(e.unwrap()):e instanceof la?Kn(e._def.innerType):[],Ef=class e extends Ae{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==X.object)return K(r,{code:Z.invalid_type,expected:X.object,received:r.parsedType}),ue;let o=this.discriminator,n=r.data[o],i=this.optionsMap.get(n);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(K(r,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),ue)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,o){let n=new Map;for(let i of r){let a=Kn(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let s of a){if(n.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);n.set(s,i)}}return new e({typeName:E.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...we(o)})}};function ub(e,t){let r=vn(e),o=vn(t);if(e===t)return{valid:!0,data:e};if(r===X.object&&o===X.object){let n=Oe.objectKeys(t),i=Oe.objectKeys(e).filter(s=>n.indexOf(s)!==-1),a={...e,...t};for(let s of i){let u=ub(e[s],t[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(r===X.array&&o===X.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let i=0;i<e.length;i++){let a=e[i],s=t[i],u=ub(a,s);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return r===X.date&&o===X.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var oa=class extends Ae{_parse(t){let{status:r,ctx:o}=this._processInputParams(t),n=(i,a)=>{if(Pf(i)||Pf(a))return ue;let s=ub(i.value,a.value);return s.valid?((Tf(i)||Tf(a))&&r.dirty(),{status:r.value,value:s.data}):(K(o,{code:Z.invalid_intersection_types}),ue)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([i,a])=>n(i,a)):n(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};oa.create=(e,t,r)=>new oa({left:e,right:t,typeName:E.ZodIntersection,...we(r)});var bn=class e extends Ae{_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==X.array)return K(o,{code:Z.invalid_type,expected:X.array,received:o.parsedType}),ue;if(o.data.length<this._def.items.length)return K(o,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ue;!this._def.rest&&o.data.length>this._def.items.length&&(K(o,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...o.data].map((a,s)=>{let u=this._def.items[s]||this._def.rest;return u?u._parse(new Or(o,a,o.path,s)):null}).filter(a=>!!a);return o.common.async?Promise.all(i).then(a=>Ot.mergeArray(r,a)):Ot.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};bn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bn({items:e,typeName:E.ZodTuple,rest:null,...we(t)})};var Rf=class e extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==X.object)return K(o,{code:Z.invalid_type,expected:X.object,received:o.parsedType}),ue;let n=[],i=this._def.keyType,a=this._def.valueType;for(let s in o.data)n.push({key:i._parse(new Or(o,s,o.path,s)),value:a._parse(new Or(o,o.data[s],o.path,s)),alwaysSet:s in o.data});return o.common.async?Ot.mergeObjectAsync(r,n):Ot.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,o){return r instanceof Ae?new e({keyType:t,valueType:r,typeName:E.ZodRecord,...we(o)}):new e({keyType:Do.create(),valueType:t,typeName:E.ZodRecord,...we(r)})}},eu=class extends Ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==X.map)return K(o,{code:Z.invalid_type,expected:X.map,received:o.parsedType}),ue;let n=this._def.keyType,i=this._def.valueType,a=[...o.data.entries()].map(([s,u],c)=>({key:n._parse(new Or(o,s,o.path,[c,"key"])),value:i._parse(new Or(o,u,o.path,[c,"value"]))}));if(o.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let u of a){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return ue;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(c.value,l.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let u of a){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return ue;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),s.set(c.value,l.value)}return{status:r.value,value:s}}}};eu.create=(e,t,r)=>new eu({valueType:t,keyType:e,typeName:E.ZodMap,...we(r)});var tu=class e extends Ae{_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==X.set)return K(o,{code:Z.invalid_type,expected:X.set,received:o.parsedType}),ue;let n=this._def;n.minSize!==null&&o.data.size<n.minSize.value&&(K(o,{code:Z.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&o.data.size>n.maxSize.value&&(K(o,{code:Z.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let i=this._def.valueType;function a(u){let c=new Set;for(let l of u){if(l.status==="aborted")return ue;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let s=[...o.data.values()].map((u,c)=>i._parse(new Or(o,u,o.path,c)));return o.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:re.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:re.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};tu.create=(e,t)=>new tu({valueType:e,minSize:null,maxSize:null,typeName:E.ZodSet,...we(t)});var Cf=class e extends Ae{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==X.function)return K(r,{code:Z.invalid_type,expected:X.function,received:r.parsedType}),ue;function o(s,u){return Il({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hs(),Wn].filter(c=>!!c),issueData:{code:Z.invalid_arguments,argumentsError:u}})}function n(s,u){return Il({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Hs(),Wn].filter(c=>!!c),issueData:{code:Z.invalid_return_type,returnTypeError:u}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Uo){let s=this;return zt(async function(...u){let c=new rr([]),l=await s._def.args.parseAsync(u,i).catch(f=>{throw c.addIssue(o(u,f)),c}),d=await Reflect.apply(a,this,l);return await s._def.returns._def.type.parseAsync(d,i).catch(f=>{throw c.addIssue(n(d,f)),c})})}else{let s=this;return zt(function(...u){let c=s._def.args.safeParse(u,i);if(!c.success)throw new rr([o(u,c.error)]);let l=Reflect.apply(a,this,c.data),d=s._def.returns.safeParse(l,i);if(!d.success)throw new rr([n(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:bn.create(t).rest(Vn.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,o){return new e({args:t||bn.create([]).rest(Vn.create()),returns:r||Vn.create(),typeName:E.ZodFunction,...we(o)})}},ia=class extends Ae{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ia.create=(e,t)=>new ia({getter:e,typeName:E.ZodLazy,...we(t)});var aa=class extends Ae{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return K(r,{received:r.data,code:Z.invalid_literal,expected:this._def.value}),ue}return{status:"valid",value:t.data}}get value(){return this._def.value}};aa.create=(e,t)=>new aa({value:e,typeName:E.ZodLiteral,...we(t)});function H$(e,t){return new sa({values:e,typeName:E.ZodEnum,...we(t)})}var sa=class e extends Ae{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),o=this._def.values;return K(r,{expected:Oe.joinValues(o),received:r.parsedType,code:Z.invalid_type}),ue}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),o=this._def.values;return K(r,{received:r.data,code:Z.invalid_enum_value,options:o}),ue}return zt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(o=>!t.includes(o)),{...this._def,...r})}};sa.create=H$;var ua=class extends Ae{_parse(t){let r=Oe.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==X.string&&o.parsedType!==X.number){let n=Oe.objectValues(r);return K(o,{expected:Oe.joinValues(n),received:o.parsedType,code:Z.invalid_type}),ue}if(this._cache||(this._cache=new Set(Oe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let n=Oe.objectValues(r);return K(o,{received:o.data,code:Z.invalid_enum_value,options:n}),ue}return zt(t.data)}get enum(){return this._def.values}};ua.create=(e,t)=>new ua({values:e,typeName:E.ZodNativeEnum,...we(t)});var Uo=class extends Ae{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==X.promise&&r.common.async===!1)return K(r,{code:Z.invalid_type,expected:X.promise,received:r.parsedType}),ue;let o=r.parsedType===X.promise?r.data:Promise.resolve(r.data);return zt(o.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Uo.create=(e,t)=>new Uo({type:e,typeName:E.ZodPromise,...we(t)});var Pr=class extends Ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:o}=this._processInputParams(t),n=this._def.effect||null,i={addIssue:a=>{K(o,a),a.fatal?r.abort():r.dirty()},get path(){return o.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){let a=n.transform(o.data,i);if(o.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return ue;let u=await this._def.schema._parseAsync({data:s,path:o.path,parent:o});return u.status==="aborted"?ue:u.status==="dirty"?Xi(u.value):r.value==="dirty"?Xi(u.value):u});{if(r.value==="aborted")return ue;let s=this._def.schema._parseSync({data:a,path:o.path,parent:o});return s.status==="aborted"?ue:s.status==="dirty"?Xi(s.value):r.value==="dirty"?Xi(s.value):s}}if(n.type==="refinement"){let a=s=>{let u=n.refinement(s,i);if(o.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(o.common.async===!1){let s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return s.status==="aborted"?ue:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>s.status==="aborted"?ue:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(n.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!jo(a))return ue;let s=n.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>jo(a)?Promise.resolve(n.transform(a.value,i)).then(s=>({status:r.value,value:s})):ue);Oe.assertNever(n)}};Pr.create=(e,t,r)=>new Pr({schema:e,typeName:E.ZodEffects,effect:t,...we(r)});Pr.createWithPreprocess=(e,t,r)=>new Pr({schema:t,effect:{type:"preprocess",transform:e},typeName:E.ZodEffects,...we(r)});var Sr=class extends Ae{_parse(t){return this._getType(t)===X.undefined?zt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Sr.create=(e,t)=>new Sr({innerType:e,typeName:E.ZodOptional,...we(t)});var wn=class extends Ae{_parse(t){return this._getType(t)===X.null?zt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};wn.create=(e,t)=>new wn({innerType:e,typeName:E.ZodNullable,...we(t)});var ca=class extends Ae{_parse(t){let{ctx:r}=this._processInputParams(t),o=r.data;return r.parsedType===X.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ca.create=(e,t)=>new ca({innerType:e,typeName:E.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...we(t)});var la=class extends Ae{_parse(t){let{ctx:r}=this._processInputParams(t),o={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Xs(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new rr(o.common.issues)},input:o.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new rr(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};la.create=(e,t)=>new la({innerType:e,typeName:E.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...we(t)});var ru=class extends Ae{_parse(t){if(this._getType(t)!==X.nan){let o=this._getOrReturnCtx(t);return K(o,{code:Z.invalid_type,expected:X.nan,received:o.parsedType}),ue}return{status:"valid",value:t.data}}};ru.create=e=>new ru({typeName:E.ZodNaN,...we(e)});var v1=Symbol("zod_brand"),$l=class extends Ae{_parse(t){let{ctx:r}=this._processInputParams(t),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}},Sl=class e extends Ae{_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?ue:i.status==="dirty"?(r.dirty(),Xi(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{let n=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return n.status==="aborted"?ue:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:o.path,parent:o})}}static create(t,r){return new e({in:t,out:r,typeName:E.ZodPipeline})}},da=class extends Ae{_parse(t){let r=this._def.innerType._parse(t),o=n=>(jo(n)&&(n.value=Object.freeze(n.value)),n);return Xs(r)?r.then(n=>o(n)):o(r)}unwrap(){return this._def.innerType}};da.create=(e,t)=>new da({innerType:e,typeName:E.ZodReadonly,...we(t)});function K$(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function X$(e,t={},r){return e?Mo.create().superRefine((o,n)=>{let i=e(o);if(i instanceof Promise)return i.then(a=>{if(!a){let s=K$(t,o),u=s.fatal??r??!0;n.addIssue({code:"custom",...s,fatal:u})}});if(!i){let a=K$(t,o),s=a.fatal??r??!0;n.addIssue({code:"custom",...a,fatal:s})}}):Mo.create()}var b1={object:nr.lazycreate},E;(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"})(E||(E={}));var w1=(e,t={message:`Input not instance of ${e.name}`})=>X$(r=>r instanceof e,t),G$=Do.create,Y$=Gi.create,x1=ru.create,k1=Yi.create,Q$=Qi.create,A1=ea.create,I1=Ys.create,$1=ta.create,S1=ra.create,O1=Mo.create,P1=Vn.create,T1=Hr.create,E1=Qs.create,R1=qn.create,C1=nr.create,z1=nr.strictCreate,N1=na.create,j1=Ef.create,D1=oa.create,M1=bn.create,U1=Rf.create,L1=eu.create,Z1=tu.create,F1=Cf.create,B1=ia.create,W1=aa.create,K1=sa.create,V1=ua.create,q1=Uo.create,J1=Pr.create,H1=Sr.create,X1=wn.create,G1=Pr.createWithPreprocess,Y1=Sl.create,Q1=()=>G$().optional(),ej=()=>Y$().optional(),tj=()=>Q$().optional(),rj={string:(e=>Do.create({...e,coerce:!0})),number:(e=>Gi.create({...e,coerce:!0})),boolean:(e=>Qi.create({...e,coerce:!0})),bigint:(e=>Yi.create({...e,coerce:!0})),date:(e=>ea.create({...e,coerce:!0}))};var nj=ue;function cb(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==E.ZodAny&&(r.items=ce(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&Te(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&Te(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(Te(r,"minItems",e.exactLength.value,e.exactLength.message,t),Te(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}function lb(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let o of e.checks)switch(o.kind){case"min":t.target==="jsonSchema7"?o.inclusive?Te(r,"minimum",o.value,o.message,t):Te(r,"exclusiveMinimum",o.value,o.message,t):(o.inclusive||(r.exclusiveMinimum=!0),Te(r,"minimum",o.value,o.message,t));break;case"max":t.target==="jsonSchema7"?o.inclusive?Te(r,"maximum",o.value,o.message,t):Te(r,"exclusiveMaximum",o.value,o.message,t):(o.inclusive||(r.exclusiveMaximum=!0),Te(r,"maximum",o.value,o.message,t));break;case"multipleOf":Te(r,"multipleOf",o.value,o.message,t);break}return r}function db(){return{type:"boolean"}}function Ol(e,t){return ce(e.type._def,t)}var pb=(e,t)=>ce(e.innerType._def,t);function zf(e,t,r){let o=r??t.dateStrategy;if(Array.isArray(o))return{anyOf:o.map(n=>zf(e,t,n))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return oj(e,t)}}var oj=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let o of e.checks)switch(o.kind){case"min":Te(r,"minimum",o.value,o.message,t);break;case"max":Te(r,"maximum",o.value,o.message,t);break}return r};function fb(e,t){return{...ce(e.innerType._def,t),default:e.defaultValue()}}function mb(e,t){return t.effectStrategy==="input"?ce(e.schema._def,t):He(t)}function hb(e){return{type:"string",enum:Array.from(e.values)}}var ij=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function gb(e,t){let r=[ce(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ce(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),o=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return r.forEach(i=>{if(ij(i))n.push(...i.allOf),i.unevaluatedProperties===void 0&&(o=void 0);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:s,...u}=i;a=u}else o=void 0;n.push(a)}}),n.length?{allOf:n,...o}:void 0}function yb(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var _b,Tr={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:()=>(_b===void 0&&(_b=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_b),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 Pl(e,t){let r={type:"string"};if(e.checks)for(let o of e.checks)switch(o.kind){case"min":Te(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,o.value):o.value,o.message,t);break;case"max":Te(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,o.value):o.value,o.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Xr(r,"email",o.message,t);break;case"format:idn-email":Xr(r,"idn-email",o.message,t);break;case"pattern:zod":qt(r,Tr.email,o.message,t);break}break;case"url":Xr(r,"uri",o.message,t);break;case"uuid":Xr(r,"uuid",o.message,t);break;case"regex":qt(r,o.regex,o.message,t);break;case"cuid":qt(r,Tr.cuid,o.message,t);break;case"cuid2":qt(r,Tr.cuid2,o.message,t);break;case"startsWith":qt(r,RegExp(`^${vb(o.value,t)}`),o.message,t);break;case"endsWith":qt(r,RegExp(`${vb(o.value,t)}$`),o.message,t);break;case"datetime":Xr(r,"date-time",o.message,t);break;case"date":Xr(r,"date",o.message,t);break;case"time":Xr(r,"time",o.message,t);break;case"duration":Xr(r,"duration",o.message,t);break;case"length":Te(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,o.value):o.value,o.message,t),Te(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,o.value):o.value,o.message,t);break;case"includes":qt(r,RegExp(vb(o.value,t)),o.message,t);break;case"ip":o.version!=="v6"&&Xr(r,"ipv4",o.message,t),o.version!=="v4"&&Xr(r,"ipv6",o.message,t);break;case"base64url":qt(r,Tr.base64url,o.message,t);break;case"jwt":qt(r,Tr.jwt,o.message,t);break;case"cidr":o.version!=="v6"&&qt(r,Tr.ipv4Cidr,o.message,t),o.version!=="v4"&&qt(r,Tr.ipv6Cidr,o.message,t);break;case"emoji":qt(r,Tr.emoji(),o.message,t);break;case"ulid":qt(r,Tr.ulid,o.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":Xr(r,"binary",o.message,t);break;case"contentEncoding:base64":Te(r,"contentEncoding","base64",o.message,t);break;case"pattern:zod":qt(r,Tr.base64,o.message,t);break}break;case"nanoid":qt(r,Tr.nanoid,o.message,t);break;case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function vb(e,t){return t.patternStrategy==="escape"?sj(e):e}var aj=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function sj(e){let t="";for(let r=0;r<e.length;r++)aj.has(e[r])||(t+="\\"),t+=e[r];return t}function Xr(e,t,r,o){e.format||e.anyOf?.some(n=>n.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&o.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,...r&&o.errorMessages&&{errorMessage:{format:r}}})):Te(e,"format",t,r,o)}function qt(e,t,r,o){e.pattern||e.allOf?.some(n=>n.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&o.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:eS(t,o),...r&&o.errorMessages&&{errorMessage:{pattern:r}}})):Te(e,"pattern",eS(t,o),r,o)}function eS(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},o=r.i?e.source.toLowerCase():e.source,n="",i=!1,a=!1,s=!1;for(let u=0;u<o.length;u++){if(i){n+=o[u],i=!1;continue}if(r.i){if(a){if(o[u].match(/[a-z]/)){s?(n+=o[u],n+=`${o[u-2]}-${o[u]}`.toUpperCase(),s=!1):o[u+1]==="-"&&o[u+2]?.match(/[a-z]/)?(n+=o[u],s=!0):n+=`${o[u]}${o[u].toUpperCase()}`;continue}}else if(o[u].match(/[a-z]/)){n+=`[${o[u]}${o[u].toUpperCase()}]`;continue}}if(r.m){if(o[u]==="^"){n+=`(^|(?<=[\r
67
+ ]))`;continue}else if(o[u]==="$"){n+=`($|(?=[\r
68
+ ]))`;continue}}if(r.s&&o[u]==="."){n+=a?`${o[u]}\r
69
+ `:`[${o[u]}\r
70
+ ]`;continue}n+=o[u],o[u]==="\\"?i=!0:a&&o[u]==="]"?a=!1:!a&&o[u]==="["&&(a=!0)}try{new RegExp(n)}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 n}function Tl(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===E.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((o,n)=>({...o,[n]:ce(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]})??He(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:ce(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===E.ZodString&&e.keyType._def.checks?.length){let{type:o,...n}=Pl(e.keyType._def,t);return{...r,propertyNames:n}}else{if(e.keyType?._def.typeName===E.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===E.ZodBranded&&e.keyType._def.type._def.typeName===E.ZodString&&e.keyType._def.type._def.checks?.length){let{type:o,...n}=Ol(e.keyType._def,t);return{...r,propertyNames:n}}}return r}function bb(e,t){return t.mapStrategy==="record"?Tl(e,t):{type:"array",maxItems:125,items:{type:"array",items:[ce(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||He(t),ce(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||He(t)],minItems:2,maxItems:2}}}function wb(e){let t=e.values,r=Object.keys(e.values).filter(n=>typeof t[t[n]]!="number").map(n=>t[n]),o=Array.from(new Set(r.map(n=>typeof n)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:r}}function xb(e){return e.target==="openAi"?void 0:{not:He({...e,currentPath:[...e.currentPath,"not"]})}}function kb(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var nu={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Ab(e,t){if(t.target==="openApi3")return tS(e,t);let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(o=>o._def.typeName in nu&&(!o._def.checks||!o._def.checks.length))){let o=r.reduce((n,i)=>{let a=nu[i._def.typeName];return a&&!n.includes(a)?[...n,a]:n},[]);return{type:o.length>1?o:o[0]}}else if(r.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=r.reduce((n,i)=>{let a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...n,a];case"bigint":return[...n,"integer"];case"object":return i._def.value===null?[...n,"null"]:n;default:return n}},[]);if(o.length===r.length){let n=o.filter((i,a,s)=>s.indexOf(i)===a);return{type:n.length>1?n:n[0],enum:r.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(r.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((o,n)=>[...o,...n._def.values.filter(i=>!o.includes(i))],[])};return tS(e,t)}var tS=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((o,n)=>ce(o._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(o=>!!o&&(!t.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return r.length?{anyOf:r}:void 0};function Ib(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:nu[e.innerType._def.typeName],nullable:!0}:{type:[nu[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let o=ce(e.innerType._def,{...t,currentPath:[...t.currentPath]});return o&&"$ref"in o?{allOf:[o],nullable:!0}:o&&{...o,nullable:!0}}let r=ce(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function $b(e,t){let r={type:"number"};if(!e.checks)return r;for(let o of e.checks)switch(o.kind){case"int":r.type="integer",Of(r,"type",o.message,t);break;case"min":t.target==="jsonSchema7"?o.inclusive?Te(r,"minimum",o.value,o.message,t):Te(r,"exclusiveMinimum",o.value,o.message,t):(o.inclusive||(r.exclusiveMinimum=!0),Te(r,"minimum",o.value,o.message,t));break;case"max":t.target==="jsonSchema7"?o.inclusive?Te(r,"maximum",o.value,o.message,t):Te(r,"exclusiveMaximum",o.value,o.message,t):(o.inclusive||(r.exclusiveMaximum=!0),Te(r,"maximum",o.value,o.message,t));break;case"multipleOf":Te(r,"multipleOf",o.value,o.message,t);break}return r}function Sb(e,t){let r=t.target==="openAi",o={type:"object",properties:{}},n=[],i=e.shape();for(let s in i){let u=i[s];if(u===void 0||u._def===void 0)continue;let c=cj(u);c&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),c=!1);let l=ce(u._def,{...t,currentPath:[...t.currentPath,"properties",s],propertyPath:[...t.currentPath,"properties",s]});l!==void 0&&(o.properties[s]=l,c||n.push(s))}n.length&&(o.required=n);let a=uj(e,t);return a!==void 0&&(o.additionalProperties=a),o}function uj(e,t){if(e.catchall._def.typeName!=="ZodNever")return ce(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 cj(e){try{return e.isOptional()}catch{return!0}}var Ob=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return ce(e.innerType._def,t);let r=ce(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:He(t)},r]}:He(t)};var Pb=(e,t)=>{if(t.pipeStrategy==="input")return ce(e.in._def,t);if(t.pipeStrategy==="output")return ce(e.out._def,t);let r=ce(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[r,ce(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]})].filter(o=>o!==void 0)}};function Tb(e,t){return ce(e.type._def,t)}function Eb(e,t){let r={type:"array",uniqueItems:!0,items:ce(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&Te(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&Te(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function Rb(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,o)=>ce(r._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((r,o)=>o===void 0?r:[...r,o],[]),additionalItems:ce(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,o)=>ce(r._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((r,o)=>o===void 0?r:[...r,o],[])}}function Cb(e){return{not:He(e)}}function zb(e){return He(e)}var Nb=(e,t)=>ce(e.innerType._def,t);var jb=(e,t,r)=>{switch(t){case E.ZodString:return Pl(e,r);case E.ZodNumber:return $b(e,r);case E.ZodObject:return Sb(e,r);case E.ZodBigInt:return lb(e,r);case E.ZodBoolean:return db();case E.ZodDate:return zf(e,r);case E.ZodUndefined:return Cb(r);case E.ZodNull:return kb(r);case E.ZodArray:return cb(e,r);case E.ZodUnion:case E.ZodDiscriminatedUnion:return Ab(e,r);case E.ZodIntersection:return gb(e,r);case E.ZodTuple:return Rb(e,r);case E.ZodRecord:return Tl(e,r);case E.ZodLiteral:return yb(e,r);case E.ZodEnum:return hb(e);case E.ZodNativeEnum:return wb(e);case E.ZodNullable:return Ib(e,r);case E.ZodOptional:return Ob(e,r);case E.ZodMap:return bb(e,r);case E.ZodSet:return Eb(e,r);case E.ZodLazy:return()=>e.getter()._def;case E.ZodPromise:return Tb(e,r);case E.ZodNaN:case E.ZodNever:return xb(r);case E.ZodEffects:return mb(e,r);case E.ZodAny:return He(r);case E.ZodUnknown:return zb(r);case E.ZodDefault:return fb(e,r);case E.ZodBranded:return Ol(e,r);case E.ZodReadonly:return Nb(e,r);case E.ZodCatch:return pb(e,r);case E.ZodPipeline:return Pb(e,r);case E.ZodFunction:case E.ZodVoid:case E.ZodSymbol:return;default:return(o=>{})(t)}};function ce(e,t,r=!1){let o=t.seen.get(e);if(t.override){let s=t.override?.(e,t,o,r);if(s!==nb)return s}if(o&&!r){let s=lj(o,t);if(s!==void 0)return s}let n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);let i=jb(e,e.typeName,t),a=typeof i=="function"?ce(i(),t):i;if(a&&dj(e,t,a),t.postProcess){let s=t.postProcess(a,e,t);return n.jsonSchema=a,s}return n.jsonSchema=a,a}var lj=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Al(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,o)=>t.currentPath[o]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),He(t)):t.$refStrategy==="seen"?He(t):void 0}},dj=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);var Db=(e,t)=>{let r=ib(t),o=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[c,l])=>({...u,[c]:ce(l._def,{...r,currentPath:[...r.basePath,r.definitionPath,c]},!0)??He(r)}),{}):void 0,n=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,i=ce(e._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??He(r),a=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;a!==void 0&&(i.title=a),r.flags.hasReferencedOpenAiAnyType&&(o||(o={}),o[r.openAiAnyTypeName]||(o[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let s=n===void 0?o?{...i,[r.definitionPath]:o}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...o,[n]:i}};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),r.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};var sW=oe({isSerializableSchema:()=>xn,isStandardJsonSchema:()=>Nf,isStandardSchema:()=>rS});function rS(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 Nf(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 xn(e){return rS(e)&&Nf(e)}function kn(e,t){let r=typeof e;if(r!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let o=e.length;if(o!==t.length)return!1;for(let n=0;n<o;n++)if(!kn(e[n],t[n]))return!1;return!0}if(r==="object"){if(!e||!t)return e===t;let o=Object.keys(e),n=Object.keys(t);if(o.length!==n.length)return!1;for(let a of o)if(!kn(e[a],t[a]))return!1;return!0}return e===t}function gr(e){return encodeURI(pj(e))}function pj(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var fj={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},mj={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},hj={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},gj=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 Gr(e,t=Object.create(null),r=gj,o=""){if(e&&typeof e=="object"&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=new URL(i,r.href);a.hash.length>1?t[a.href]=e:(a.hash="",o===""?r=a:Gr(e,t,r))}}else if(e!==!0&&e!==!1)return t;let n=r.href+(o?"#"+o:"");if(t[n]!==void 0)throw new Error(`Duplicate schema URI "${n}".`);if(t[n]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:n}),e.$ref&&e.__absolute_ref__===void 0){let i=new URL(e.$ref,r.href);i.hash=i.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:i.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let i=new URL(e.$recursiveRef,r.href);i.hash=i.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:i.href})}if(e.$anchor){let i=new URL("#"+e.$anchor,r.href);t[i.href]=e}for(let i in e){if(hj[i])continue;let a=`${o}/${gr(i)}`,s=e[i];if(Array.isArray(s)){if(fj[i]){let u=s.length;for(let c=0;c<u;c++)Gr(s[c],t,r,`${a}/${c}`)}}else if(mj[i])for(let u in s)Gr(s[u],t,r,`${a}/${gr(u)}`);else Gr(s,t,r,a)}return t}var yj=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,_j=[0,31,28,31,30,31,30,31,31,30,31,30,31],vj=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,bj=/^(?=.{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,wj=/^(?:[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,xj=/^(?:(?:[^\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,kj=/^(?:(?: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,Aj=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Ij=/^(?:\/(?:[^~/]|~0|~1)*)*$/,$j=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Sj=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Oj=e=>{if(e[0]==='"')return!1;let[t,r,...o]=e.split("@");return!t||!r||o.length!==0||t.length>64||r.length>253||t[0]==="."||t.endsWith(".")||t.includes("..")||!/^[a-z0-9.-]+$/i.test(r)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:r.split(".").every(n=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(n))},Pj=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Tj=/^((([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,Ej=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 An(e){return e.test.bind(e)}var Mb={date:nS,time:oS.bind(void 0,!1),"date-time":zj,duration:Ej,uri:Dj,"uri-reference":An(wj),"uri-template":An(xj),url:An(kj),email:Oj,hostname:An(bj),ipv4:An(Pj),ipv6:An(Tj),regex:Uj,uuid:An(Aj),"json-pointer":An(Ij),"json-pointer-uri-fragment":An($j),"relative-json-pointer":An(Sj)};function Rj(e){return e%4===0&&(e%100!==0||e%400===0)}function nS(e){let t=e.match(yj);if(!t)return!1;let r=+t[1],o=+t[2],n=+t[3];return o>=1&&o<=12&&n>=1&&n<=(o==2&&Rj(r)?29:_j[o])}function oS(e,t){let r=t.match(vj);if(!r)return!1;let o=+r[1],n=+r[2],i=+r[3],a=!!r[5];return(o<=23&&n<=59&&i<=59||o==23&&n==59&&i==60)&&(!e||a)}var Cj=/t|\s/i;function zj(e){let t=e.split(Cj);return t.length==2&&nS(t[0])&&oS(!0,t[1])}var Nj=/\/|:/,jj=/^(?:[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 Dj(e){return Nj.test(e)&&jj.test(e)}var Mj=/[^\\]\\Z/;function Uj(e){if(Mj.test(e))return!1;try{return new RegExp(e,"u"),!0}catch{return!1}}var iS;(function(e){e[e.Flag=1]="Flag",e[e.Basic=2]="Basic",e[e.Detailed=4]="Detailed"})(iS||(iS={}));function aS(e){let t=0,r=e.length,o=0,n;for(;o<r;)t++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<r&&(n=e.charCodeAt(o),(n&64512)==56320&&o++);return t}function Ve(e,t,r="2019-09",o=Gr(t),n=!0,i=null,a="#",s="#",u=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:a,keyword:"false",keywordLocation:a,error:"False boolean schema."}]};let c=typeof e,l;switch(c){case"boolean":case"number":case"string":l=c;break;case"object":e===null?l="null":Array.isArray(e)?l="array":l="object";break;default:throw new Error(`Instances of "${c}" type are not supported.`)}let{$ref:d,$recursiveRef:p,$recursiveAnchor:f,type:h,const:y,enum:_,required:$,not:v,anyOf:x,allOf:S,oneOf:C,if:j,then:F,else:A,format:G,properties:W,patternProperties:R,additionalProperties:Y,unevaluatedProperties:ne,minProperties:pe,maxProperties:it,propertyNames:Q,dependentRequired:Tt,dependentSchemas:Ue,dependencies:xr,prefixItems:bt,items:Et,additionalItems:Zt,unevaluatedItems:Mn,contains:wt,minContains:Ne,maxContains:b,minItems:g,maxItems:N,uniqueItems:O,minimum:he,maximum:ke,exclusiveMinimum:Qe,exclusiveMaximum:ze,multipleOf:Rt,minLength:kr,maxLength:at,pattern:dn,__absolute_ref__:gs,__absolute_recursive_ref__:cp}=t,H=[];if(f===!0&&i===null&&(i=t),p==="#"){let fe=i===null?o[cp]:i,se=`${s}/$recursiveRef`,ve=Ve(e,i===null?t:i,r,o,n,fe,a,se,u);ve.valid||H.push({instanceLocation:a,keyword:"$recursiveRef",keywordLocation:se,error:"A subschema had errors."},...ve.errors)}if(d!==void 0){let se=o[gs||d];if(se===void 0){let J=`Unresolved $ref "${d}".`;throw gs&&gs!==d&&(J+=` Absolute URI "${gs}".`),J+=`
71
+ Known schemas:
72
+ - ${Object.keys(o).join(`
73
+ - `)}`,new Error(J)}let ve=`${s}/$ref`,ee=Ve(e,se,r,o,n,i,a,ve,u);if(ee.valid||H.push({instanceLocation:a,keyword:"$ref",keywordLocation:ve,error:"A subschema had errors."},...ee.errors),r==="4"||r==="7")return{valid:H.length===0,errors:H}}if(Array.isArray(h)){let fe=h.length,se=!1;for(let ve=0;ve<fe;ve++)if(l===h[ve]||h[ve]==="integer"&&l==="number"&&e%1===0&&e===e){se=!0;break}se||H.push({instanceLocation:a,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${l}" is invalid. Expected "${h.join('", "')}".`})}else h==="integer"?(l!=="number"||e%1||e!==e)&&H.push({instanceLocation:a,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${l}" is invalid. Expected "${h}".`}):h!==void 0&&l!==h&&H.push({instanceLocation:a,keyword:"type",keywordLocation:`${s}/type`,error:`Instance type "${l}" is invalid. Expected "${h}".`});if(y!==void 0&&(l==="object"||l==="array"?kn(e,y)||H.push({instanceLocation:a,keyword:"const",keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(y)}.`}):e!==y&&H.push({instanceLocation:a,keyword:"const",keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(y)}.`})),_!==void 0&&(l==="object"||l==="array"?_.some(fe=>kn(e,fe))||H.push({instanceLocation:a,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(_)}.`}):_.some(fe=>e===fe)||H.push({instanceLocation:a,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(_)}.`})),v!==void 0){let fe=`${s}/not`;Ve(e,v,r,o,n,i,a,fe).valid&&H.push({instanceLocation:a,keyword:"not",keywordLocation:fe,error:'Instance matched "not" schema.'})}let Ei=[];if(x!==void 0){let fe=`${s}/anyOf`,se=H.length,ve=!1;for(let ee=0;ee<x.length;ee++){let J=x[ee],ge=Object.create(u),me=Ve(e,J,r,o,n,f===!0?i:null,a,`${fe}/${ee}`,ge);H.push(...me.errors),ve=ve||me.valid,me.valid&&Ei.push(ge)}ve?H.length=se:H.splice(se,0,{instanceLocation:a,keyword:"anyOf",keywordLocation:fe,error:"Instance does not match any subschemas."})}if(S!==void 0){let fe=`${s}/allOf`,se=H.length,ve=!0;for(let ee=0;ee<S.length;ee++){let J=S[ee],ge=Object.create(u),me=Ve(e,J,r,o,n,f===!0?i:null,a,`${fe}/${ee}`,ge);H.push(...me.errors),ve=ve&&me.valid,me.valid&&Ei.push(ge)}ve?H.length=se:H.splice(se,0,{instanceLocation:a,keyword:"allOf",keywordLocation:fe,error:"Instance does not match every subschema."})}if(C!==void 0){let fe=`${s}/oneOf`,se=H.length,ve=C.filter((ee,J)=>{let ge=Object.create(u),me=Ve(e,ee,r,o,n,f===!0?i:null,a,`${fe}/${J}`,ge);return H.push(...me.errors),me.valid&&Ei.push(ge),me.valid}).length;ve===1?H.length=se:H.splice(se,0,{instanceLocation:a,keyword:"oneOf",keywordLocation:fe,error:`Instance does not match exactly one subschema (${ve} matches).`})}if((l==="object"||l==="array")&&Object.assign(u,...Ei),j!==void 0){let fe=`${s}/if`;if(Ve(e,j,r,o,n,i,a,fe,u).valid){if(F!==void 0){let ve=Ve(e,F,r,o,n,i,a,`${s}/then`,u);ve.valid||H.push({instanceLocation:a,keyword:"if",keywordLocation:fe,error:'Instance does not match "then" schema.'},...ve.errors)}}else if(A!==void 0){let ve=Ve(e,A,r,o,n,i,a,`${s}/else`,u);ve.valid||H.push({instanceLocation:a,keyword:"if",keywordLocation:fe,error:'Instance does not match "else" schema.'},...ve.errors)}}if(l==="object"){if($!==void 0)for(let ee of $)ee in e||H.push({instanceLocation:a,keyword:"required",keywordLocation:`${s}/required`,error:`Instance does not have required property "${ee}".`});let fe=Object.keys(e);if(pe!==void 0&&fe.length<pe&&H.push({instanceLocation:a,keyword:"minProperties",keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${pe} properties.`}),it!==void 0&&fe.length>it&&H.push({instanceLocation:a,keyword:"maxProperties",keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${it} properties.`}),Q!==void 0){let ee=`${s}/propertyNames`;for(let J in e){let ge=`${a}/${gr(J)}`,me=Ve(J,Q,r,o,n,i,ge,ee);me.valid||H.push({instanceLocation:a,keyword:"propertyNames",keywordLocation:ee,error:`Property name "${J}" does not match schema.`},...me.errors)}}if(Tt!==void 0){let ee=`${s}/dependantRequired`;for(let J in Tt)if(J in e){let ge=Tt[J];for(let me of ge)me in e||H.push({instanceLocation:a,keyword:"dependentRequired",keywordLocation:ee,error:`Instance has "${J}" but does not have "${me}".`})}}if(Ue!==void 0)for(let ee in Ue){let J=`${s}/dependentSchemas`;if(ee in e){let ge=Ve(e,Ue[ee],r,o,n,i,a,`${J}/${gr(ee)}`,u);ge.valid||H.push({instanceLocation:a,keyword:"dependentSchemas",keywordLocation:J,error:`Instance has "${ee}" but does not match dependant schema.`},...ge.errors)}}if(xr!==void 0){let ee=`${s}/dependencies`;for(let J in xr)if(J in e){let ge=xr[J];if(Array.isArray(ge))for(let me of ge)me in e||H.push({instanceLocation:a,keyword:"dependencies",keywordLocation:ee,error:`Instance has "${J}" but does not have "${me}".`});else{let me=Ve(e,ge,r,o,n,i,a,`${ee}/${gr(J)}`);me.valid||H.push({instanceLocation:a,keyword:"dependencies",keywordLocation:ee,error:`Instance has "${J}" but does not match dependant schema.`},...me.errors)}}}let se=Object.create(null),ve=!1;if(W!==void 0){let ee=`${s}/properties`;for(let J in W){if(!(J in e))continue;let ge=`${a}/${gr(J)}`,me=Ve(e[J],W[J],r,o,n,i,ge,`${ee}/${gr(J)}`);if(me.valid)u[J]=se[J]=!0;else if(ve=n,H.push({instanceLocation:a,keyword:"properties",keywordLocation:ee,error:`Property "${J}" does not match schema.`},...me.errors),ve)break}}if(!ve&&R!==void 0){let ee=`${s}/patternProperties`;for(let J in R){let ge=new RegExp(J,"u"),me=R[J];for(let Yt in e){if(!ge.test(Yt))continue;let mA=`${a}/${gr(Yt)}`,hA=Ve(e[Yt],me,r,o,n,i,mA,`${ee}/${gr(J)}`);hA.valid?u[Yt]=se[Yt]=!0:(ve=n,H.push({instanceLocation:a,keyword:"patternProperties",keywordLocation:ee,error:`Property "${Yt}" matches pattern "${J}" but does not match associated schema.`},...hA.errors))}}}if(!ve&&Y!==void 0){let ee=`${s}/additionalProperties`;for(let J in e){if(se[J])continue;let ge=`${a}/${gr(J)}`,me=Ve(e[J],Y,r,o,n,i,ge,ee);me.valid?u[J]=!0:(ve=n,H.push({instanceLocation:a,keyword:"additionalProperties",keywordLocation:ee,error:`Property "${J}" does not match additional properties schema.`},...me.errors))}}else if(!ve&&ne!==void 0){let ee=`${s}/unevaluatedProperties`;for(let J in e)if(!u[J]){let ge=`${a}/${gr(J)}`,me=Ve(e[J],ne,r,o,n,i,ge,ee);me.valid?u[J]=!0:H.push({instanceLocation:a,keyword:"unevaluatedProperties",keywordLocation:ee,error:`Property "${J}" does not match unevaluated properties schema.`},...me.errors)}}}else if(l==="array"){N!==void 0&&e.length>N&&H.push({instanceLocation:a,keyword:"maxItems",keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${N}).`}),g!==void 0&&e.length<g&&H.push({instanceLocation:a,keyword:"minItems",keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${g}).`});let fe=e.length,se=0,ve=!1;if(bt!==void 0){let ee=`${s}/prefixItems`,J=Math.min(bt.length,fe);for(;se<J;se++){let ge=Ve(e[se],bt[se],r,o,n,i,`${a}/${se}`,`${ee}/${se}`);if(u[se]=!0,!ge.valid&&(ve=n,H.push({instanceLocation:a,keyword:"prefixItems",keywordLocation:ee,error:"Items did not match schema."},...ge.errors),ve))break}}if(Et!==void 0){let ee=`${s}/items`;if(Array.isArray(Et)){let J=Math.min(Et.length,fe);for(;se<J;se++){let ge=Ve(e[se],Et[se],r,o,n,i,`${a}/${se}`,`${ee}/${se}`);if(u[se]=!0,!ge.valid&&(ve=n,H.push({instanceLocation:a,keyword:"items",keywordLocation:ee,error:"Items did not match schema."},...ge.errors),ve))break}}else for(;se<fe;se++){let J=Ve(e[se],Et,r,o,n,i,`${a}/${se}`,ee);if(u[se]=!0,!J.valid&&(ve=n,H.push({instanceLocation:a,keyword:"items",keywordLocation:ee,error:"Items did not match schema."},...J.errors),ve))break}if(!ve&&Zt!==void 0){let J=`${s}/additionalItems`;for(;se<fe;se++){let ge=Ve(e[se],Zt,r,o,n,i,`${a}/${se}`,J);u[se]=!0,ge.valid||(ve=n,H.push({instanceLocation:a,keyword:"additionalItems",keywordLocation:J,error:"Items did not match additional items schema."},...ge.errors))}}}if(wt!==void 0)if(fe===0&&Ne===void 0)H.push({instanceLocation:a,keyword:"contains",keywordLocation:`${s}/contains`,error:"Array is empty. It must contain at least one item matching the schema."});else if(Ne!==void 0&&fe<Ne)H.push({instanceLocation:a,keyword:"minContains",keywordLocation:`${s}/minContains`,error:`Array has less items (${fe}) than minContains (${Ne}).`});else{let ee=`${s}/contains`,J=H.length,ge=0;for(let me=0;me<fe;me++){let Yt=Ve(e[me],wt,r,o,n,i,`${a}/${me}`,ee);Yt.valid?(u[me]=!0,ge++):H.push(...Yt.errors)}ge>=(Ne||0)&&(H.length=J),Ne===void 0&&b===void 0&&ge===0?H.splice(J,0,{instanceLocation:a,keyword:"contains",keywordLocation:ee,error:"Array does not contain item matching schema."}):Ne!==void 0&&ge<Ne?H.push({instanceLocation:a,keyword:"minContains",keywordLocation:`${s}/minContains`,error:`Array must contain at least ${Ne} items matching schema. Only ${ge} items were found.`}):b!==void 0&&ge>b&&H.push({instanceLocation:a,keyword:"maxContains",keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${b} items matching schema. ${ge} items were found.`})}if(!ve&&Mn!==void 0){let ee=`${s}/unevaluatedItems`;for(se;se<fe;se++){if(u[se])continue;let J=Ve(e[se],Mn,r,o,n,i,`${a}/${se}`,ee);u[se]=!0,J.valid||H.push({instanceLocation:a,keyword:"unevaluatedItems",keywordLocation:ee,error:"Items did not match unevaluated items schema."},...J.errors)}}if(O)for(let ee=0;ee<fe;ee++){let J=e[ee],ge=typeof J=="object"&&J!==null;for(let me=0;me<fe;me++){if(ee===me)continue;let Yt=e[me];(J===Yt||ge&&(typeof Yt=="object"&&Yt!==null)&&kn(J,Yt))&&(H.push({instanceLocation:a,keyword:"uniqueItems",keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${ee} and ${me}.`}),ee=Number.MAX_SAFE_INTEGER,me=Number.MAX_SAFE_INTEGER)}}}else if(l==="number"){if(r==="4"?(he!==void 0&&(Qe===!0&&e<=he||e<he)&&H.push({instanceLocation:a,keyword:"minimum",keywordLocation:`${s}/minimum`,error:`${e} is less than ${Qe?"or equal to ":""} ${he}.`}),ke!==void 0&&(ze===!0&&e>=ke||e>ke)&&H.push({instanceLocation:a,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ze?"or equal to ":""} ${ke}.`})):(he!==void 0&&e<he&&H.push({instanceLocation:a,keyword:"minimum",keywordLocation:`${s}/minimum`,error:`${e} is less than ${he}.`}),ke!==void 0&&e>ke&&H.push({instanceLocation:a,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ke}.`}),Qe!==void 0&&e<=Qe&&H.push({instanceLocation:a,keyword:"exclusiveMinimum",keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${Qe}.`}),ze!==void 0&&e>=ze&&H.push({instanceLocation:a,keyword:"exclusiveMaximum",keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${ze}.`})),Rt!==void 0){let fe=e%Rt;Math.abs(0-fe)>=11920929e-14&&Math.abs(Rt-fe)>=11920929e-14&&H.push({instanceLocation:a,keyword:"multipleOf",keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${Rt}.`})}}else if(l==="string"){let fe=kr===void 0&&at===void 0?0:aS(e);kr!==void 0&&fe<kr&&H.push({instanceLocation:a,keyword:"minLength",keywordLocation:`${s}/minLength`,error:`String is too short (${fe} < ${kr}).`}),at!==void 0&&fe>at&&H.push({instanceLocation:a,keyword:"maxLength",keywordLocation:`${s}/maxLength`,error:`String is too long (${fe} > ${at}).`}),dn!==void 0&&!new RegExp(dn,"u").test(e)&&H.push({instanceLocation:a,keyword:"pattern",keywordLocation:`${s}/pattern`,error:"String does not match pattern."}),G!==void 0&&Mb[G]&&!Mb[G](e)&&H.push({instanceLocation:a,keyword:"format",keywordLocation:`${s}/format`,error:`String does not match format "${G}".`})}return{valid:H.length===0,errors:H}}var jf=class{schema;draft;shortCircuit;lookup;constructor(t,r="2019-09",o=!0){this.schema=t,this.draft=r,this.shortCircuit=o,this.lookup=Gr(t)}validate(t){return Ve(t,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(t,r){r&&(t={...t,$id:r}),Gr(t,this.lookup)}};var ZW=oe({Validator:()=>jf,deepCompareStrict:()=>kn,toJsonSchema:()=>Nt,validatesOnlyStrings:()=>ou}),sS=new WeakMap;function Nt(e,t){let r=!t&&e!=null&&typeof e=="object";if(r){let n=sS.get(e);if(n)return n}let o;if(Nf(e)&&!Ze(e))o=e["~standard"].jsonSchema.input({target:"draft-07"});else if(Ze(e)){let n=$f(e,!0);$r(n)?o=Fn(qs(n,!0),t):o=Fn(e,t)}else rt(e)?o=Db(e):o=e;return r&&o!=null&&typeof o=="object"&&sS.set(e,o),o}function ou(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=>ou(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(r=>ou(r))}if("not"in e)return!1;if("$ref"in e&&typeof e.$ref=="string"){let t=e.$ref,r=Gr(e);return r[t]?ou(r[t]):!1}return!1}function Ub(e){return typeof e=="object"&&e!==null&&typeof e[Symbol.iterator]=="function"&&typeof e.next=="function"}var uS=e=>e!=null&&typeof e=="object"&&"next"in e&&typeof e.next=="function";function Df(e){return typeof e=="object"&&e!==null&&typeof e[Symbol.asyncIterator]=="function"}function Lb(e){return e!=null&&typeof e=="object"&&typeof e.next=="function"}async function cS(e,t){try{let r=await e.next();for(;!r.done;)await t?.(r.value),r=await e.next();return r.value}finally{await e.return?.(void 0)}}function*Zb(e,t){for(;;){let{value:r,done:o}=Qt.runWithConfig(Ft(e),t.next.bind(t),!0);if(o)break;yield r}}async function*Mf(e,t){let r=t[Symbol.asyncIterator]();for(;;){let{value:o,done:n}=await Qt.runWithConfig(Ft(e),r.next.bind(t),!0);if(n)break;yield o}}var te="0123456789abcdef".split(""),Lj=[-2147483648,8388608,32768,128],Yr=[24,16,8,0],Uf=[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],xt=[];function Qr(e,t){t?(xt[0]=xt[16]=xt[1]=xt[2]=xt[3]=xt[4]=xt[5]=xt[6]=xt[7]=xt[8]=xt[9]=xt[10]=xt[11]=xt[12]=xt[13]=xt[14]=xt[15]=0,this.blocks=xt):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}Qr.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if(r!=="string"){if(r==="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 o,n=0,i,a=e.length,s=this.blocks;n<a;){if(this.hashed&&(this.hashed=!1,s[0]=this.block,this.block=s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),t)for(i=this.start;n<a&&i<64;++n)s[i>>>2]|=e[n]<<Yr[i++&3];else for(i=this.start;n<a&&i<64;++n)o=e.charCodeAt(n),o<128?s[i>>>2]|=o<<Yr[i++&3]:o<2048?(s[i>>>2]|=(192|o>>>6)<<Yr[i++&3],s[i>>>2]|=(128|o&63)<<Yr[i++&3]):o<55296||o>=57344?(s[i>>>2]|=(224|o>>>12)<<Yr[i++&3],s[i>>>2]|=(128|o>>>6&63)<<Yr[i++&3],s[i>>>2]|=(128|o&63)<<Yr[i++&3]):(o=65536+((o&1023)<<10|e.charCodeAt(++n)&1023),s[i>>>2]|=(240|o>>>18)<<Yr[i++&3],s[i>>>2]|=(128|o>>>12&63)<<Yr[i++&3],s[i>>>2]|=(128|o>>>6&63)<<Yr[i++&3],s[i>>>2]|=(128|o&63)<<Yr[i++&3]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=s[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}};Qr.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=Lj[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()}};Qr.prototype.hash=function(){var e=this.h0,t=this.h1,r=this.h2,o=this.h3,n=this.h4,i=this.h5,a=this.h6,s=this.h7,u=this.blocks,c,l,d,p,f,h,y,_,$,v,x;for(c=16;c<64;++c)f=u[c-15],l=(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3,f=u[c-2],d=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,u[c]=u[c-16]+l+u[c-7]+d<<0;for(x=t&r,c=0;c<64;c+=4)this.first?(this.is224?(_=300032,f=u[0]-1413257819,s=f-150054599<<0,o=f+24177077<<0):(_=704751109,f=u[0]-210244248,s=f-1521486534<<0,o=f+143694565<<0),this.first=!1):(l=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),d=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),_=e&t,p=_^e&r^x,y=n&i^~n&a,f=s+d+y+Uf[c]+u[c],h=l+p,s=o+f<<0,o=f+h<<0),l=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),d=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),$=o&e,p=$^o&t^_,y=a&s^~a&n,f=i+d+y+Uf[c+1]+u[c+1],h=l+p,a=r+f<<0,r=f+h<<0,l=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),d=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),v=r&o,p=v^r&e^$,y=i&a^~i&s,f=n+d+y+Uf[c+2]+u[c+2],h=l+p,i=t+f<<0,t=f+h<<0,l=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),d=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),x=t&r,p=x^t&o^v,y=i&a^~i&s,f=n+d+y+Uf[c+3]+u[c+3],h=l+p,n=e+f<<0,e=f+h<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+r<<0,this.h3=this.h3+o<<0,this.h4=this.h4+n<<0,this.h5=this.h5+i<<0,this.h6=this.h6+a<<0,this.h7=this.h7+s<<0};Qr.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,o=this.h3,n=this.h4,i=this.h5,a=this.h6,s=this.h7,u=te[e>>>28&15]+te[e>>>24&15]+te[e>>>20&15]+te[e>>>16&15]+te[e>>>12&15]+te[e>>>8&15]+te[e>>>4&15]+te[e&15]+te[t>>>28&15]+te[t>>>24&15]+te[t>>>20&15]+te[t>>>16&15]+te[t>>>12&15]+te[t>>>8&15]+te[t>>>4&15]+te[t&15]+te[r>>>28&15]+te[r>>>24&15]+te[r>>>20&15]+te[r>>>16&15]+te[r>>>12&15]+te[r>>>8&15]+te[r>>>4&15]+te[r&15]+te[o>>>28&15]+te[o>>>24&15]+te[o>>>20&15]+te[o>>>16&15]+te[o>>>12&15]+te[o>>>8&15]+te[o>>>4&15]+te[o&15]+te[n>>>28&15]+te[n>>>24&15]+te[n>>>20&15]+te[n>>>16&15]+te[n>>>12&15]+te[n>>>8&15]+te[n>>>4&15]+te[n&15]+te[i>>>28&15]+te[i>>>24&15]+te[i>>>20&15]+te[i>>>16&15]+te[i>>>12&15]+te[i>>>8&15]+te[i>>>4&15]+te[i&15]+te[a>>>28&15]+te[a>>>24&15]+te[a>>>20&15]+te[a>>>16&15]+te[a>>>12&15]+te[a>>>8&15]+te[a>>>4&15]+te[a&15];return this.is224||(u+=te[s>>>28&15]+te[s>>>24&15]+te[s>>>20&15]+te[s>>>16&15]+te[s>>>12&15]+te[s>>>8&15]+te[s>>>4&15]+te[s&15]),u};Qr.prototype.toString=Qr.prototype.hex;Qr.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,o=this.h3,n=this.h4,i=this.h5,a=this.h6,s=this.h7,u=[e>>>24&255,e>>>16&255,e>>>8&255,e&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255];return this.is224||u.push(s>>>24&255,s>>>16&255,s>>>8&255,s&255),u};Qr.prototype.array=Qr.prototype.digest;Qr.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 Lf=(...e)=>new Qr(!1,!0).update(e.join("")).hex();var XW=oe({sha256:()=>Lf});var rK=oe({BaseCache:()=>dS,InMemoryCache:()=>Fb,defaultHashKeyEncoder:()=>lS,deserializeStoredGeneration:()=>Zj,serializeGeneration:()=>Fj}),lS=(...e)=>Lf(e.join("_"));function Zj(e){return e.message!==void 0?{text:e.text,message:yp(e.message)}:{text:e.text}}function Fj(e){let t={text:e.text};return e.message!==void 0&&(t.message=e.message.toDict()),t}var dS=class{keyEncoder=lS;makeDefaultKeyEncoder(e){this.keyEncoder=e}},Bj=new Map,Fb=class pS extends dS{cache;constructor(t){super(),this.cache=t??new Map}lookup(t,r){return Promise.resolve(this.cache.get(this.keyEncoder(t,r))??null)}async update(t,r,o){this.cache.set(this.keyEncoder(t,r),o)}static global(){return new pS(Bj)}};var Wj=Object.prototype.toString,Kj=e=>Wj.call(e)==="[object Error]",Vj=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 fS(e){if(!(e&&Kj(e)&&e.name==="TypeError"&&typeof e.message=="string"))return!1;let{message:t,stack:r}=e;return t==="Load failed"?r===void 0||"__sentry_captured__"in e:t.startsWith("error sending request for url")?!0:Vj.has(t)}function qj(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 Zf(e,t,{min:r=0,allowInfinity:o=!1}={}){if(t!==void 0){if(typeof t!="number"||Number.isNaN(t))throw new TypeError(`Expected \`${e}\` to be a number${o?" or Infinity":""}.`);if(!o&&!Number.isFinite(t))throw new TypeError(`Expected \`${e}\` to be a finite number.`);if(t<r)throw new TypeError(`Expected \`${e}\` to be \u2265 ${r}.`)}}var Jj=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 Hj(e,t){let r=Math.max(1,e+1),o=t.randomize?Math.random()+1:1,n=Math.round(o*t.minTimeout*t.factor**(r-1));return n=Math.min(n,t.maxTimeout),n}function mS(e,t){return Number.isFinite(t)?t-(performance.now()-e):t}async function Xj({error:e,attemptNumber:t,retriesConsumed:r,startTime:o,options:n}){let i=e instanceof Error?e:new TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(i instanceof Jj)throw i.originalError;let a=Number.isFinite(n.retries)?Math.max(0,n.retries-r):n.retries,s=n.maxRetryTime??Number.POSITIVE_INFINITY,u=Object.freeze({error:i,attemptNumber:t,retriesLeft:a,retriesConsumed:r});if(await n.onFailedAttempt(u),mS(o,s)<=0)throw i;let c=await n.shouldConsumeRetry(u),l=mS(o,s);if(l<=0||a<=0)throw i;if(i instanceof TypeError&&!fS(i)){if(c)throw i;return n.signal?.throwIfAborted(),!1}if(!await n.shouldRetry(u))throw i;if(!c)return n.signal?.throwIfAborted(),!1;let d=Hj(r,n),p=typeof i.retryAfterMs=="number"&&i.retryAfterMs>=0?i.retryAfterMs:void 0;p!==void 0&&(d=Math.max(d,p));let f=Math.min(d,l);return f>0&&await new Promise((h,y)=>{let _=()=>{clearTimeout($),n.signal?.removeEventListener("abort",_),y(n.signal.reason)},$=setTimeout(()=>{n.signal?.removeEventListener("abort",_),h()},f);n.unref&&$.unref?.(),n.signal?.addEventListener("abort",_,{once:!0})}),n.signal?.throwIfAborted(),!0}async function El(e,t={}){if(t={...t},qj(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,Zf("factor",t.factor,{min:0,allowInfinity:!1}),Zf("minTimeout",t.minTimeout,{min:0,allowInfinity:!1}),Zf("maxTimeout",t.maxTimeout,{min:0,allowInfinity:!0}),Zf("maxRetryTime",t.maxRetryTime,{min:0,allowInfinity:!0}),t.factor>0||(t.factor=1),t.signal?.throwIfAborted();let r=0,o=0,n=performance.now();for(;!Number.isFinite(t.retries)||o<=t.retries;){r++;try{t.signal?.throwIfAborted();let i=await e(r);return t.signal?.throwIfAborted(),i}catch(i){await Xj({error:i,attemptNumber:r,retriesConsumed:o,startTime:n,options:t})&&o++}}throw new Error("Retry attempts exhausted without throwing an error.")}var Ff=ug(hC(),1),fK=oe({AsyncCaller:()=>Jn,classifyRateLimitError:()=>bS,parseRetryAfterMs:()=>vS}),Gj=[400,401,402,403,404,405,406,407,409,413],Yj=6e4,Qj=[/insufficient[_ -]?quota/i,/exceeded (?:your|the current|the available).+quota/i,/usage quota/i,/quota (?:has been )?exhausted/i,/billing/i,/credit balance/i,/out of credits/i,/will reset at/i],eD=/(?:try again in|retry after)\s+(\d+(?:\.\d+)?)\s*(milliseconds?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h)\b/i;function gS(e){return typeof e=="object"&&e!==null&&"response"in e&&typeof e.response=="object"&&e.response!==null&&"status"in e.response&&typeof e.response.status=="number"?e.response.status:void 0}function yS(e){if(!(typeof e!="object"||e===null)){if("status"in e&&typeof e.status=="number")return e.status;if("statusCode"in e&&typeof e.statusCode=="number")return e.statusCode}}function Wb(e){return typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"?e.message:void 0}function _S(e){if(!(typeof e!="object"||e===null))return"code"in e&&typeof e.code=="string"?e.code:"error"in e&&typeof e.error=="object"&&e.error!==null&&"code"in e.error&&typeof e.error.code=="string"?e.error.code:void 0}function tD(e){if(e?.headers)return typeof e.headers.get=="function"?e.headers.get("retry-after"):e.headers["retry-after"]??e.headers["Retry-After"];if(e?.response?.headers)return typeof e.response.headers.get=="function"?e.response.headers.get("retry-after"):e.response.headers["retry-after"]??e.response.headers["Retry-After"]}function rD(e){if(e==null)return;let t=eD.exec(e);if(!t)return;let r=Number(t[1]),o=t[2]?.toLowerCase();if(!(Number.isNaN(r)||!o))return o==="ms"||o.startsWith("millisecond")?r:o==="m"||o.startsWith("min")?r*6e4:o==="h"||o.startsWith("hr")||o.startsWith("hour")?r*36e5:r*1e3}function hS(e,t){if(e instanceof Error)return e;let r=new Error(t);return typeof e=="object"&&e!==null&&Object.assign(r,e),r}function Bb(e,t){if(typeof e!="object"||e===null)return;let r=e;r.rateLimitType=t.action,r.rateLimitReason=t.reason,t.retryAfterMs!==void 0&&(r.retryAfterMs=t.retryAfterMs)}function vS(e){if(e==null)return;let t=e.trim();if(!t)return;let r=Number(t);if(!Number.isNaN(r)&&r>=0)return r*1e3;let o=Date.parse(t);if(!Number.isNaN(o)){let n=o-Date.now();return n>0?n:0}}function bS(e){if((gS(e)??yS(e))!==429)return;if(_S(e)==="insufficient_quota")return{action:"stop",reason:"insufficient_quota"};let t=Wb(e);if(t&&Qj.some(o=>o.test(t)))return{action:"stop",reason:"quota_message"};let r=vS(tD(e))??rD(t);return r!==void 0?r<=Yj?{action:"wait",retryAfterMs:r,reason:"retry_after_hint"}:{action:"capacity",retryAfterMs:r,reason:"retry_after_too_large"}:{action:"capacity",reason:"headerless_429"}}var nD=e=>{if(typeof e!="object"||e===null)return;if(wA(e)===!1)throw e;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")throw pr(e,!1);if("code"in e&&typeof e.code=="string"&&e.code==="ECONNABORTED")throw e;let t=gS(e)??yS(e);if(t&&Gj.includes(+t))throw pr(e,!1);if(_S(e)==="insufficient_quota"){let o=hS(e,Wb(e)??"Insufficient quota");throw o.name="InsufficientQuotaError",Bb(o,{action:"stop",reason:"insufficient_quota"}),pr(o,!1)}let r=bS(e);if(r){if(r.action==="wait"){Bb(e,r),pr(e,!0);return}let o=hS(e,Wb(e)??"Rate limit exceeded");throw o.name==="Error"&&(o.name=r.action==="stop"?"RateLimitQuotaExhaustedError":"RateLimitCapacityError"),Bb(o,r),pr(o,r.action!=="stop")}},Jn=class{maxConcurrency;maxRetries;onFailedAttempt;queue;constructor(e){this.maxConcurrency=e.maxConcurrency??1/0,this.maxRetries=e.maxRetries??6,this.onFailedAttempt=e.onFailedAttempt??nD;let t="default"in Ff.default?Ff.default.default:Ff.default;this.queue=new t({concurrency:this.maxConcurrency})}async call(e,...t){return this.callWithRetries(this.maxRetries,e,t)}callWithRetries(e,t,r){return this.queue.add(()=>El(()=>t(...r).catch(o=>{throw o instanceof Error?o:new Error(o)}),{onFailedAttempt:({error:o})=>this.onFailedAttempt?.(o),retries:e,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(e,t,...r){let o=e.maxRetries??this.maxRetries;if(e.signal){let n;return Promise.race([this.callWithRetries(o,t,r),new Promise((i,a)=>{n=()=>{a(ko(e.signal))},e.signal?.addEventListener("abort",n,{once:!0})})]).finally(()=>{e.signal&&n&&e.signal.removeEventListener("abort",n)})}return this.callWithRetries(o,t,r)}fetch(...e){return this.call(()=>fetch(...e).then(t=>t.ok?t:Promise.reject(t)))}};var wK=oe({AsyncGeneratorWithSetup:()=>Lo,IterableReadableStream:()=>Jt,atee:()=>Bf,concat:()=>yr,pipeGeneratorWithSetup:()=>Vb}),Jt=class Kb 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 r=this.reader.cancel();this.reader.releaseLock(),await r}throw t}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}static fromReadableStream(t){let r=t.getReader();return new Kb({start(o){return n();function n(){return r.read().then(({done:i,value:a})=>{if(i){o.close();return}return o.enqueue(a),n()})}},cancel(){r.releaseLock()}})}static fromAsyncGenerator(t){return new Kb({async pull(r){let{value:o,done:n}=await t.next();n&&r.close(),r.enqueue(o)},async cancel(r){await t.return(r)}})}};function Bf(e,t=2){let r=Array.from({length:t},()=>[]);return r.map(async function*(n){for(;;)if(n.length===0){let i=await e.next();for(let a of r)a.push(i)}else{if(n[0].done)return;yield n.shift().value}})}function yr(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 r={...e};for(let[o,n]of Object.entries(t))o in r&&!Array.isArray(r[o])?r[o]=yr(r[o],n):r[o]=n;return r}else throw new Error(`Cannot concat ${typeof e} and ${typeof t}`)}var Lo=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,r)=>{Qt.runWithConfig(Ft(e.config),async()=>{this.firstResult=this.signal?fr(e.generator.next(),this.signal):e.generator.next(),e.startSetup?this.firstResult.then(e.startSetup).then(t,r):this.firstResult.then(o=>t(void 0),r)},!0)})}async next(...e){return this.signal?.throwIfAborted(),this.firstResultUsed?Qt.runWithConfig(Ft(this.config),this.signal?async()=>fr(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 Vb(e,t,r,o,...n){let i=new Lo({generator:t,startSetup:r,signal:o}),a=await i.setup;return{output:e(i,a,...n),setup:a}}var oD=Object.prototype.hasOwnProperty;function Kf(e,t){return oD.call(e,t)}function Vf(e){if(Array.isArray(e)){let r=new Array(e.length);for(let o=0;o<r.length;o++)r[o]=""+o;return r}if(Object.keys)return Object.keys(e);let t=[];for(let r in e)Kf(e,r)&&t.push(r);return t}function _r(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function qf(e){let t=0,r=e.length,o;for(;t<r;){if(o=e.charCodeAt(t),o>=48&&o<=57){t++;continue}return!1}return!0}function pa(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function xS(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Wf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(let r=0,o=e.length;r<o;r++)if(Wf(e[r]))return!0}else if(typeof e=="object"){let r=Vf(e),o=r.length;for(var t=0;t<o;t++)if(Wf(e[r[t]]))return!0}}return!1}function wS(e,t){let r=[e];for(let o in t){let n=typeof t[o]=="object"?JSON.stringify(t[o],null,2):t[o];typeof n<"u"&&r.push(`${o}: ${n}`)}return r.join(`
74
+ `)}var kS=class extends Error{name;index;operation;tree;constructor(e,t,r,o,n){super(wS(e,{name:t,index:r,operation:o,tree:n})),this.name=t,this.index=r,this.operation=o,this.tree=n,Object.setPrototypeOf(this,new.target.prototype),this.message=wS(e,{name:t,index:r,operation:o,tree:n})}};var AS=oe({JsonPatchError:()=>nt,_areEquals:()=>au,applyOperation:()=>Zo,applyPatch:()=>Hn,applyReducer:()=>IS,deepClone:()=>iD,getValueByPointer:()=>Rl,validate:()=>qb,validator:()=>Cl});var nt=kS,iD=_r,iu={add:function(e,t,r){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:r}},remove:function(e,t,r){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");var o=e[t];return delete e[t],{newDocument:r,removed:o}},replace:function(e,t,r){if(t==="__proto__"||t==="constructor")throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor` prop is banned for security reasons");var o=e[t];return e[t]=this.value,{newDocument:r,removed:o}},move:function(e,t,r){let o=Rl(r,this.path);o&&(o=_r(o));let n=Zo(r,{op:"remove",path:this.from}).removed;return Zo(r,{op:"add",path:this.path,value:n}),{newDocument:r,removed:o}},copy:function(e,t,r){let o=Rl(r,this.from);return Zo(r,{op:"add",path:this.path,value:_r(o)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:au(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},aD={add:function(e,t,r){return qf(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var o=e[t];return e[t]=this.value,{newDocument:r,removed:o}},move:iu.move,copy:iu.copy,test:iu.test,_get:iu._get};function Rl(e,t){if(t=="")return e;var r={op:"_get",path:t};return Zo(e,r),r.value}function Zo(e,t,r=!1,o=!0,n=!0,i=0){if(r&&(typeof r=="function"?r(t,0,e,t.path):Cl(t,0)),t.path===""){let a={newDocument:e};if(t.op==="add")return a.newDocument=t.value,a;if(t.op==="replace")return a.newDocument=t.value,a.removed=e,a;if(t.op==="move"||t.op==="copy")return a.newDocument=Rl(e,t.from),t.op==="move"&&(a.removed=e),a;if(t.op==="test"){if(a.test=au(e,t.value),a.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return a.newDocument=e,a}else{if(t.op==="remove")return a.removed=e,a.newDocument=null,a;if(t.op==="_get")return t.value=e,a;if(r)throw new nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,t,e);return a}}else{o||(e=_r(e));let a=(t.path||"").split("/"),s=e,u=1,c=a.length,l,d,p;for(typeof r=="function"?p=r:p=Cl;;){if(d=a[u],d&&d.indexOf("~")!=-1&&(d=xS(d)),n&&(d=="__proto__"||d=="prototype"&&u>0&&a[u-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(r&&l===void 0&&(s[d]===void 0?l=a.slice(0,u).join("/"):u==c-1&&(l=t.path),l!==void 0&&p(t,0,e,l)),u++,Array.isArray(s)){if(d==="-")d=s.length;else{if(r&&!qf(d))throw new nt("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",i,t,e);qf(d)&&(d=~~d)}if(u>=c){if(r&&t.op==="add"&&d>s.length)throw new nt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,t,e);let f=aD[t.op].call(t,s,d,e);if(f.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return f}}else if(u>=c){let f=iu[t.op].call(t,s,d,e);if(f.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",i,t,e);return f}if(s=s[d],r&&u<c&&(!s||typeof s!="object"))throw new nt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",i,t,e)}}}function Hn(e,t,r,o=!0,n=!0){if(r&&!Array.isArray(t))throw new nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");o||(e=_r(e));let i=new Array(t.length);for(let a=0,s=t.length;a<s;a++)i[a]=Zo(e,t[a],r,!0,n,a),e=i[a].newDocument;return i.newDocument=e,i}function IS(e,t,r){let o=Zo(e,t);if(o.test===!1)throw new nt("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return o.newDocument}function Cl(e,t,r,o){if(typeof e!="object"||e===null||Array.isArray(e))throw new nt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(iu[e.op]){if(typeof e.path!="string")throw new nt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new nt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new nt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Wf(e.value))throw new nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var n=e.path.split("/").length,i=o.split("/").length;if(n!==i+1&&n!==i)throw new nt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==o)throw new nt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var a=qb([{op:"_get",path:e.from,value:void 0}],r);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new nt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function qb(e,t,r){try{if(!Array.isArray(e))throw new nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Hn(_r(t),_r(e),r||!0);else{r=r||Cl;for(var o=0;o<e.length;o++)r(e[o],o,t,void 0)}}catch(n){if(n instanceof nt)return n;throw n}}function au(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),o=Array.isArray(t),n,i,a;if(r&&o){if(i=e.length,i!=t.length)return!1;for(n=i;n--!==0;)if(!au(e[n],t[n]))return!1;return!0}if(r!=o)return!1;var s=Object.keys(e);if(i=s.length,i!==Object.keys(t).length)return!1;for(n=i;n--!==0;)if(!t.hasOwnProperty(s[n]))return!1;for(n=i;n--!==0;)if(a=s[n],!au(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}function $S(e,t,r,o,n){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var i=Vf(t),a=Vf(e),s=!1,u=a.length-1;u>=0;u--){var c=a[u],l=e[c];if(Kf(t,c)&&!(t[c]===void 0&&l!==void 0&&Array.isArray(t)===!1)){var d=t[c];typeof l=="object"&&l!=null&&typeof d=="object"&&d!=null&&Array.isArray(l)===Array.isArray(d)?$S(l,d,r,o+"/"+pa(c),n):l!==d&&(n&&r.push({op:"test",path:o+"/"+pa(c),value:_r(l)}),r.push({op:"replace",path:o+"/"+pa(c),value:_r(d)}))}else Array.isArray(e)===Array.isArray(t)?(n&&r.push({op:"test",path:o+"/"+pa(c),value:_r(l)}),r.push({op:"remove",path:o+"/"+pa(c)}),s=!0):(n&&r.push({op:"test",path:o,value:e}),r.push({op:"replace",path:o,value:t}))}if(!(!s&&i.length==a.length))for(var u=0;u<i.length;u++){var c=i[u];!Kf(e,c)&&t[c]!==void 0&&r.push({op:"add",path:o+"/"+pa(c),value:_r(t[c])})}}}function fa(e,t,r=!1){var o=[];return $S(e,t,o,"",r),o}({...AS});var FK=oe({LogStreamCallbackHandler:()=>Hf,RunLog:()=>Jf,RunLogPatch:()=>In,isLogStreamHandler:()=>Hb}),In=class{ops;constructor(e){this.ops=e.ops??[]}concat(e){let t=this.ops.concat(e.ops),r=Hn({},t);return new Jf({ops:t,state:r[r.length-1].newDocument})}},Jf=class Jb extends In{state;constructor(t){super(t),this.state=t.state}concat(t){let r=this.ops.concat(t.ops),o=Hn(this.state,t.ops);return new Jb({ops:r,state:o[o.length-1].newDocument})}static fromRunLogPatch(t){let r=Hn({},t.ops);return new Jb({ops:t.ops,state:r[r.length-1].newDocument})}},Hb=e=>e.name==="log_stream_tracer";async function SS(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:r}=e;if(["retriever","llm","prompt"].includes(e.run_type))return r;if(!(Object.keys(r).length===1&&r?.input===""))return r.input}async function OS(e,t){let{outputs:r}=e;return t==="original"||["retriever","llm","prompt"].includes(e.run_type)?r:r!==void 0&&Object.keys(r).length===1&&r?.output!==void 0?r.output:r}function sD(e){return e!==void 0&&e.message!==void 0}var Hf=class extends xs{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=Jt.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??[],r=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(r=r||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(r=r||this.includeTypes.includes(e.run_type)),this.includeTags!==void 0&&(r=r||t.find(o=>this.includeTags?.includes(o))!==void 0),this.excludeNames!==void 0&&(r=r&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(r=r&&!this.excludeTypes.includes(e.run_type)),this.excludeTags!==void 0&&(r=r&&t.every(o=>!this.excludeTags?.includes(o))),r}async*tapOutputIterable(e,t){for await(let r of t){if(e!==this.rootId){let o=this.keyMapByRunId[e];o&&await this.writer.write(new In({ops:[{op:"add",path:`/logs/${o}/streamed_output/-`,value:r}]}))}yield r}}async onRunCreate(e){if(this.rootId===void 0&&(this.rootId=e.id,await this.writer.write(new In({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 r={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"&&(r.inputs=await SS(e,this._schemaFormat)),await this.writer.write(new In({ops:[{op:"add",path:`/logs/${this.keyMapByRunId[e.id]}`,value:r}]}))}async onRunUpdate(e){try{let t=this.keyMapByRunId[e.id];if(t===void 0)return;let r=[];this._schemaFormat==="streaming_events"&&r.push({op:"replace",path:`/logs/${t}/inputs`,value:await SS(e,this._schemaFormat)}),r.push({op:"add",path:`/logs/${t}/final_output`,value:await OS(e,this._schemaFormat)}),e.end_time!==void 0&&r.push({op:"add",path:`/logs/${t}/end_time`,value:new Date(e.end_time).toISOString()});let o=new In({ops:r});await this.writer.write(o)}finally{if(e.id===this.rootId){let t=new In({ops:[{op:"replace",path:"/final_output",value:await OS(e,this._schemaFormat)}]});await this.writer.write(t),this.autoClose&&await this.writer.close()}}}async onLLMNewToken(e,t,r){let o=this.keyMapByRunId[e.id];if(o===void 0)return;let n=e.inputs.messages!==void 0,i;n?sD(r?.chunk)?i=r?.chunk:i=new ut({id:`run-${e.id}`,content:t}):i=t;let a=new In({ops:[{op:"add",path:`/logs/${o}/streamed_output_str/-`,value:t},{op:"add",path:`/logs/${o}/streamed_output/-`,value:i}]});await this.writer.write(a)}};var qK=oe({ChatGenerationChunk:()=>Xn,GenerationChunk:()=>$n,RUN_KEY:()=>ma}),ma="__run",$n=class PS{text;generationInfo;constructor(t){this.text=t.text,this.generationInfo=t.generationInfo}concat(t){return new PS({text:this.text+t.text,generationInfo:{...this.generationInfo,...t.generationInfo}})}},Xn=class TS extends $n{message;constructor(t){super(t),this.message=t.message}concat(t){return new TS({text:this.text+t.text,generationInfo:{...this.generationInfo,...t.generationInfo},message:this.message.concat(t.message)})}};function Xf({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 ES=e=>e.name==="event_stream_tracer",RS=class extends xs{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=Jt.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){let t=e.tags??[],r=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(r=r||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(r=r||this.includeTypes.includes(e.runType)),this.includeTags!==void 0&&(r=r||t.find(o=>this.includeTags?.includes(o))!==void 0),this.excludeNames!==void 0&&(r=r&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(r=r&&!this.excludeTypes.includes(e.runType)),this.excludeTags!==void 0&&(r=r&&t.every(o=>!this.excludeTags?.includes(o))),r}async*tapOutputIterable(e,t){let r=await t.next();if(r.done)return;let o=this.runInfoMap.get(e);if(o===void 0){yield r.value;return}function n(a,s){return a==="llm"&&typeof s=="string"?new $n({text:s}):s}let i=this.tappedPromises.get(e);if(i===void 0){let a;i=new Promise(s=>{a=s}),this.tappedPromises.set(e,i);try{let s={event:`on_${o.runType}_stream`,run_id:e,name:o.name,tags:o.tags,metadata:o.metadata,data:{}};await this.send({...s,data:{chunk:n(o.runType,r.value)}},o),yield r.value;for await(let u of t)o.runType!=="tool"&&o.runType!=="retriever"&&await this.send({...s,data:{chunk:n(o.runType,u)}},o),yield u}finally{a?.()}}else{yield r.value;for await(let a of t)yield a}}async send(e,t){this.readableStreamClosed||this._includeRun(t)&&await this.writer.write(e)}async sendEndEvent(e,t){let r=this.tappedPromises.get(e.run_id);r!==void 0?r.then(()=>{this.send(e,t)}):await this.send(e,t)}async onLLMStart(e){let t=Xf(e),r=e.inputs.messages!==void 0?"chat_model":"llm",o={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:r,inputs:e.inputs};this.runInfoMap.set(e.id,o);let n=`on_${r}_start`;await this.send({event:n,data:{input:e.inputs},name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},o)}async onLLMNewToken(e,t,r){let o=this.runInfoMap.get(e.id),n,i;if(o===void 0)throw new Error(`onLLMNewToken: Run ID ${e.id} not found in run map.`);if(this.runInfoMap.size!==1){if(o.runType==="chat_model")i="on_chat_model_stream",r?.chunk===void 0?n=new ut({content:t,id:`run-${e.id}`}):n=r.chunk.message;else if(o.runType==="llm")i="on_llm_stream",r?.chunk===void 0?n=new $n({text:t}):n=r.chunk;else throw new Error(`Unexpected run type ${o.runType}`);await this.send({event:i,data:{chunk:n},run_id:e.id,name:o.name,tags:o.tags,metadata:o.metadata},o)}}async onLLMEnd(e){let t=this.runInfoMap.get(e.id);this.runInfoMap.delete(e.id);let r;if(t===void 0)throw new Error(`onLLMEnd: Run ID ${e.id} not found in run map.`);let o=e.outputs?.generations,n;if(t.runType==="chat_model"){for(let i of o??[]){if(n!==void 0)break;n=i[0]?.message}r="on_chat_model_end"}else if(t.runType==="llm")n={generations:o?.map(i=>i.map(a=>({text:a.text,generationInfo:a.generationInfo}))),llmOutput:e.outputs?.llmOutput??{}},r="on_llm_end";else throw new Error(`onLLMEnd: Unexpected run type: ${t.runType}`);await this.sendEndEvent({event:r,data:{output:n,input:t.inputs},run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata},t)}async onChainStart(e){let t=Xf(e),r=e.run_type??"chain",o={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:e.run_type},n={};e.inputs.input===""&&Object.keys(e.inputs).length===1?(n={},o.inputs={}):e.inputs.input!==void 0?(n.input=e.inputs.input,o.inputs=e.inputs.input):(n.input=e.inputs,o.inputs=e.inputs),this.runInfoMap.set(e.id,o),await this.send({event:`on_${r}_start`,data:n,name:t,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},o)}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 r=`on_${e.run_type}_end`,o=e.inputs??t.inputs??{},n={output:e.outputs?.output??e.outputs,input:o};o.input&&Object.keys(o).length===1&&(n.input=o.input,t.inputs=o.input),await this.sendEndEvent({event:r,data:n,run_id:e.id,name:t.name,tags:t.tags,metadata:t.metadata??{}},t)}async onToolStart(e){let t=Xf(e),r={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:"tool",inputs:e.inputs??{}};this.runInfoMap.set(e.id,r),await this.send({event:"on_tool_start",data:{input:e.inputs??{}},name:t,run_id:e.id,tags:e.tags??[],metadata:e.extra?.metadata??{}},r)}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 r=e.outputs?.output===void 0?e.outputs:e.outputs.output;await this.sendEndEvent({event:"on_tool_end",data:{output:r,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=Xf(e),r={tags:e.tags??[],metadata:e.extra?.metadata??{},name:t,runType:"retriever",inputs:{query:e.inputs.query}};this.runInfoMap.set(e.id,r),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??{}},r)}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,r){let o=this.runInfoMap.get(r);if(o===void 0)throw new Error(`handleCustomEvent: Run ID ${r} not found in run map.`);await this.send({event:"on_custom_event",run_id:r,name:e,tags:o.tags,metadata:o.metadata,data:t},o)}async finish(){let e=[...this.tappedPromises.values()];Promise.all(e).finally(()=>{this.writer.close()})}};var Xb=class extends xs{name="RootListenersTracer";rootId;config;argOnStart;argOnEnd;argOnError;constructor({config:e,onStart:t,onEnd:r,onError:o}){super({_awaitHandler:!0}),this.config=e,this.argOnStart=t,this.argOnEnd=r,this.argOnError=o}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 zl(e){return e?e.lc_runnable:!1}var CS=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 r=this.includeNames===void 0&&this.includeTypes===void 0&&this.includeTags===void 0,o=e.tags??[];return this.includeNames!==void 0&&(r=r||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(r=r||this.includeTypes.includes(t)),this.includeTags!==void 0&&(r=r||o.some(n=>this.includeTags?.includes(n))),this.excludeNames!==void 0&&(r=r&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(r=r&&!this.excludeTypes.includes(t)),this.excludeTags!==void 0&&(r=r&&o.every(n=>!this.excludeTags?.includes(n))),r}},zS=e=>btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");function Gb(e){return e.replace(/[^a-zA-Z-_0-9]/g,"_")}var uD=["*","_","`"];function cD(e){let t="";for(let[r,o]of Object.entries(e))t+=` classDef ${r} ${o};
75
+ `;return t}function NS(e,t,r){let{firstNode:o,lastNode:n,nodeColors:i,withStyles:a=!0,curveStyle:s="linear",wrapLabelNWords:u=9}=r??{},c=a?`%%{init: {'flowchart': {'curve': '${s}'}}}%%
76
+ graph TD;
77
+ `:`graph TD;
78
+ `;if(a){let h="default",y={[h]:"{0}({1})"};o!==void 0&&(y[o]="{0}([{1}]):::first"),n!==void 0&&(y[n]="{0}([{1}]):::last");for(let[_,$]of Object.entries(e)){let v=$.name.split(":").pop()??"",x=uD.some(C=>v.startsWith(C)&&v.endsWith(C))?`<p>${v}</p>`:v;Object.keys($.metadata??{}).length&&(x+=`<hr/><small><em>${Object.entries($.metadata??{}).map(([C,j])=>`${C} = ${j}`).join(`
79
+ `)}</em></small>`);let S=(y[_]??y[h]).replace("{0}",Gb(_)).replace("{1}",x);c+=` ${S}
80
+ `}}let l={};for(let h of t){let y=h.source.split(":"),_=h.target.split(":"),$=y.filter((v,x)=>v===_[x]).join(":");l[$]||(l[$]=[]),l[$].push(h)}let d=new Set;function p(h){return[...h].sort((y,_)=>y.split(":").length-_.split(":").length)}function f(h,y){let _=h.length===1&&h[0].source===h[0].target;if(y&&!_){let v=y.split(":").pop();if(d.has(y))throw new Error(`Found duplicate subgraph '${v}' at '${y} -- 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(y),c+=` subgraph ${v}
81
+ `}let $=p(Object.keys(l).filter(v=>v.startsWith(`${y}:`)&&v!==y&&v.split(":").length===y.split(":").length+1));for(let v of $)f(l[v],v);for(let v of h){let{source:x,target:S,data:C,conditional:j}=v,F="";if(C!==void 0){let A=C,G=A.split(" ");G.length>u&&(A=Array.from({length:Math.ceil(G.length/u)},(W,R)=>G.slice(R*u,(R+1)*u).join(" ")).join("&nbsp;<br>&nbsp;")),F=j?` -. &nbsp;${A}&nbsp; .-> `:` -- &nbsp;${A}&nbsp; --> `}else F=j?" -.-> ":" --> ";c+=` ${Gb(x)}${F}${Gb(S)};
82
+ `}y&&!_&&(c+=` end
83
+ `)}f(l[""]??[],"");for(let h in l)!h.includes(":")&&h!==""&&f(l[h],h);return a&&(c+=cD(i??{})),c}async function jS(e,t){let r=t?.backgroundColor??"white",o=t?.imageType??"png",n=zS(e);r!==void 0&&(/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(r)||(r=`!${r}`));let i=`https://mermaid.ink/img/${n}?bgColor=${r}&type=${o}`,a=await fetch(i);if(!a.ok)throw new Error(["Failed to render the graph using the Mermaid.INK API.",`Status code: ${a.status}`,`Status text: ${a.statusText}`].join(`
84
+ `));return await a.blob()}var fV=oe({Graph:()=>Gf});function lD(e,t){if(e!==void 0&&!Vc(e))return e;if(zl(t))try{let r=t.getName();return r=r.startsWith("Runnable")?r.slice(8):r,r}catch{return t.getName()}else return t.name??"UnknownSchema"}function dD(e){return zl(e.data)?{type:"runnable",data:{id:e.data.lc_id,name:e.data.getName()}}:{type:"schema",data:{...Nt(e.data.schema),title:e.data.name}}}var Gf=class US{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((r,o)=>{t[r.id]=Vc(r.id)?o:r.id}),{nodes:Object.values(this.nodes).map(r=>({id:t[r.id],...dD(r)})),edges:this.edges.map(r=>{let o={source:t[r.source],target:t[r.target]};return typeof r.data<"u"&&(o.data=r.data),typeof r.conditional<"u"&&(o.conditional=r.conditional),o})}}addNode(t,r,o){if(r!==void 0&&this.nodes[r]!==void 0)throw new Error(`Node with id ${r} already exists`);let n=r??yA(),i={id:n,data:t,name:lD(r,t),metadata:o};return this.nodes[n]=i,i}removeNode(t){delete this.nodes[t.id],this.edges=this.edges.filter(r=>r.source!==t.id&&r.target!==t.id)}addEdge(t,r,o,n){if(this.nodes[t.id]===void 0)throw new Error(`Source node ${t.id} not in graph`);if(this.nodes[r.id]===void 0)throw new Error(`Target node ${r.id} not in graph`);let i={source:t.id,target:r.id,data:o,conditional:n};return this.edges.push(i),i}firstNode(){return DS(this)}lastNode(){return MS(this)}extend(t,r=""){let o=r;Object.values(t.nodes).map(u=>u.id).every(Vc)&&(o="");let n=u=>o?`${o}:${u}`:u;Object.entries(t.nodes).forEach(([u,c])=>{this.nodes[n(u)]={...c,id:n(u)}});let i=t.edges.map(u=>({...u,source:n(u.source),target:n(u.target)}));this.edges=[...this.edges,...i];let a=t.firstNode(),s=t.lastNode();return[a?{id:n(a.id),data:a.data}:void 0,s?{id:n(s.id),data:s.data}:void 0]}trimFirstNode(){let t=this.firstNode();t&&DS(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(n=>[n.id,n.name])),r=new Map;Object.values(t).forEach(n=>{r.set(n,(r.get(n)||0)+1)});let o=n=>{let i=t[n];return Vc(n)&&r.get(i)===1?i:n};return new US({nodes:Object.fromEntries(Object.entries(this.nodes).map(([n,i])=>[o(n),{...i,id:o(n)}])),edges:this.edges.map(n=>({...n,source:o(n.source),target:o(n.target)}))})}drawMermaid(t){let{withStyles:r,curveStyle:o,nodeColors:n={default:"fill:#f2f0ff,line-height:1.2",first:"fill-opacity:0",last:"fill:#bfb6fc"},wrapLabelNWords:i}=t??{},a=this.reid(),s=a.firstNode(),u=a.lastNode();return NS(a.nodes,a.edges,{firstNode:s?.id,lastNode:u?.id,withStyles:r,curveStyle:o,nodeColors:n,wrapLabelNWords:i})}async drawMermaidPng(t){return jS(this.drawMermaid(t),{backgroundColor:t?.backgroundColor})}};function DS(e,t=[]){let r=new Set(e.edges.filter(n=>!t.includes(n.source)).map(n=>n.target)),o=[];for(let n of Object.values(e.nodes))!t.includes(n.id)&&!r.has(n.id)&&o.push(n);return o.length===1?o[0]:void 0}function MS(e,t=[]){let r=new Set(e.edges.filter(n=>!t.includes(n.target)).map(n=>n.source)),o=[];for(let n of Object.values(e.nodes))!t.includes(n.id)&&!r.has(n.id)&&o.push(n);return o.length===1?o[0]:void 0}function LS(e){let t=new TextEncoder,r=new ReadableStream({async start(o){for await(let n of e)o.enqueue(t.encode(`event: data
85
+ data: ${JSON.stringify(n)}
86
+
87
+ `));o.enqueue(t.encode(`event: end
88
+
89
+ `)),o.close()}});return Jt.fromReadableStream(r)}function dt(e,t){return e&&!Array.isArray(e)&&!(e instanceof Date)&&typeof e=="object"?e:{[t]:e}}var Fe=class extends lp{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 Qf({bound:this,kwargs:{},config:{},maxAttemptNumber:e?.stopAfterAttempt,...e})}withConfig(e){return new Fo({bound:this,config:e,kwargs:{}})}withFallbacks(e){let t=Array.isArray(e)?e:e.fallbacks;return new Yb({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(Pe);if(t>1&&!Array.isArray(e)&&e.runId){console.warn("Provided runId will be used only for the first element of the batch.");let r=Object.fromEntries(Object.entries(e).filter(([o])=>o!=="runId"));return Array.from({length:t},(o,n)=>Pe(n===0?e:r))}return Array.from({length:t},()=>Pe(e))}async batch(e,t,r){let o=this._getOptionsList(t??{},e.length),n=new Jn({maxConcurrency:o[0]?.maxConcurrency??r?.maxConcurrency,onFailedAttempt:a=>{throw a}}),i=e.map((a,s)=>n.call(async()=>{try{return await this.invoke(a,o[s])}catch(u){if(r?.returnExceptions)return u;throw u}}));return Promise.all(i)}async*_streamIterator(e,t){yield this.invoke(e,t)}async stream(e,t){let r=Pe(t),o=new Lo({generator:this._streamIterator(e,r),config:r});return await o.setup,Jt.fromAsyncGenerator(o)}_separateRunnableConfigFromCallOptions(e){let t;e===void 0?t=Pe(e):t=Pe({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 r={...e};return delete r.callbacks,delete r.tags,delete r.metadata,delete r.runName,delete r.configurable,delete r.recursionLimit,delete r.maxConcurrency,delete r.runId,delete r.timeout,delete r.signal,[t,r]}async _callWithConfig(e,t,r){let o=Pe(r),n=await(await Ct(o))?.handleChainStart(this.toJSON(),dt(t,"input"),o.runId,o?.runType,void 0,void 0,o?.runName??this.getName());delete o.runId;let i;try{i=await fr(e.call(this,t,o,n),o.signal)}catch(a){throw await n?.handleChainError(a),a}return await n?.handleChainEnd(dt(i,"output")),i}async _batchWithConfig(e,t,r,o){let n=this._getOptionsList(r??{},t.length),i=await Promise.all(n.map(Ct)),a=await Promise.all(i.map(async(u,c)=>{let l=await u?.handleChainStart(this.toJSON(),dt(t[c],"input"),n[c].runId,n[c].runType,void 0,void 0,n[c].runName??this.getName());return delete n[c].runId,l})),s;try{s=await fr(e.call(this,t,n,a,o),n?.[0]?.signal)}catch(u){throw await Promise.all(a.map(c=>c?.handleChainError(u))),u}return await Promise.all(a.map(u=>u?.handleChainEnd(dt(s,"output")))),s}_concatOutputChunks(e,t){return yr(e,t)}async*_transformStreamWithConfig(e,t,r){let o,n=!0,i,a=!0,s=Pe(r),u=await Ct(s),c=this;async function*l(){for await(let p of e){if(n)if(o===void 0)o=p;else try{o=c._concatOutputChunks(o,p)}catch{o=void 0,n=!1}yield p}}let d;try{let p=await Vb(t.bind(this),l(),async()=>u?.handleChainStart(this.toJSON(),{input:""},s.runId,s.runType,void 0,void 0,s.runName??this.getName(),void 0,{lc_defers_inputs:!0}),s.signal,s);delete s.runId,d=p.setup;let f=d?.handlers.find(ES),h=p.output;f!==void 0&&d!==void 0&&(h=f.tapOutputIterable(d.runId,h));let y=d?.handlers.find(Hb);y!==void 0&&d!==void 0&&(h=y.tapOutputIterable(d.runId,h));for await(let _ of h)if(yield _,a)if(i===void 0)i=_;else try{i=this._concatOutputChunks(i,_)}catch{i=void 0,a=!1}}catch(p){throw await d?.handleChainError(p,void 0,void 0,void 0,{inputs:dt(o,"input")}),p}await d?.handleChainEnd(i??{},void 0,void 0,void 0,{inputs:dt(o,"input")})}getGraph(e){let t=new Gf,r=t.addNode({name:`${this.getName()}Input`,schema:Vt.any()}),o=t.addNode(this),n=t.addNode({name:`${this.getName()}Output`,schema:Vt.any()});return t.addEdge(r,o),t.addEdge(o,n),t}pipe(e){return new su({first:this,last:vr(e)})}pick(e){return this.pipe(new Qb(e))}assign(e){return this.pipe(new jl(new Bo({steps:e})))}async*transform(e,t){let r;for await(let o of e)r===void 0?r=o:r=this._concatOutputChunks(r,o);yield*this._streamIterator(r,Pe(t))}async*streamLog(e,t,r){let o=new Hf({...r,autoClose:!1,_schemaFormat:"original"}),n=Pe(t);yield*this._streamLog(e,o,n)}async*_streamLog(e,t,r){let{callbacks:o}=r;if(o===void 0)r.callbacks=[t];else if(Array.isArray(o))r.callbacks=o.concat([t]);else{let s=o.copy();s.addHandler(t,!0),r.callbacks=s}let n=this.stream(e,r);async function i(){try{let s=await n;for await(let u of s){let c=new In({ops:[{op:"add",path:"/streamed_output/-",value:u}]});await t.writer.write(c)}}finally{await t.writer.close()}}let a=i();try{for await(let s of t)yield s}finally{await a}}streamEvents(e,t,r){let o;if(t.version==="v1")o=this._streamEventsV1(e,t,r);else if(t.version==="v2")o=this._streamEventsV2(e,t,r);else throw new Error('Only versions "v1" and "v2" of the schema are currently supported.');return t.encoding==="text/event-stream"?LS(o):Jt.fromAsyncGenerator(o)}async*_streamEventsV2(e,t,r){let o=new RS({...r,autoClose:!1}),n=Pe(t),i=n.runId??_A();n.runId=i;let a=n.callbacks;if(a===void 0)n.callbacks=[o];else if(Array.isArray(a))n.callbacks=a.concat(o);else{let f=a.copy();f.addHandler(o,!0),n.callbacks=f}let s=new AbortController,u=this;async function c(){let f;try{if(n.signal)if("any"in AbortSignal)f=AbortSignal.any([s.signal,n.signal]);else{let _=new AbortController;n.signal.addEventListener("abort",()=>_.abort(),{once:!0}),s.signal.addEventListener("abort",()=>_.abort(),{once:!0}),f=_.signal}else f=s.signal;let h=await u.stream(e,{...n,signal:f}),y=o.tapOutputIterable(i,h);for await(let _ of y)if(s.signal.aborted)break}finally{await o.finish()}}let l=c(),d=!1,p;try{for await(let f of o){if(!d){f.data.input=e,d=!0,p=f.run_id,yield f;continue}f.run_id===p&&f.event.endsWith("_end")&&f.data?.input&&delete f.data.input,yield f}}finally{s.abort(),await l}}async*_streamEventsV1(e,t,r){let o,n=!1,i=Pe(t),a=i.tags??[],s=i.metadata??{},u=i.runName??this.getName(),c=new Hf({...r,autoClose:!1,_schemaFormat:"streaming_events"}),l=new CS({...r}),d=this._streamLog(e,c,i);for await(let f of d){if(o?o=o.concat(f):o=Jf.fromRunLogPatch(f),o.state===void 0)throw new Error('Internal error: "streamEvents" state is missing. Please open a bug report.');if(!n){n=!0;let $={...o.state},v={run_id:$.id,event:`on_${$.type}_start`,name:u,tags:a,metadata:s,data:{input:e}};l.includeEvent(v,$.type)&&(yield v)}let h=f.ops.filter($=>$.path.startsWith("/logs/")).map($=>$.path.split("/")[2]),y=[...new Set(h)];for(let $ of y){let v,x={},S=o.state.logs[$];if(S.end_time===void 0?S.streamed_output.length>0?v="stream":v="start":v="end",v==="start")S.inputs!==void 0&&(x.input=S.inputs);else if(v==="end")S.inputs!==void 0&&(x.input=S.inputs),x.output=S.final_output;else if(v==="stream"){let C=S.streamed_output.length;if(C!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${C} instead. Encountered in: "${S.name}"`);x={chunk:S.streamed_output[0]},S.streamed_output=[]}yield{event:`on_${S.type}_${v}`,name:S.name,run_id:S.id,tags:S.tags,metadata:S.metadata,data:x}}let{state:_}=o;if(_.streamed_output.length>0){let $=_.streamed_output.length;if($!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${$} instead. Encountered in: "${_.name}"`);let v={chunk:_.streamed_output[0]};_.streamed_output=[];let x={event:`on_${_.type}_stream`,run_id:_.id,tags:a,metadata:s,name:u,data:v};l.includeEvent(x,_.type)&&(yield x)}}let p=o?.state;if(p!==void 0){let f={event:`on_${p.type}_end`,name:u,run_id:p.id,tags:a,metadata:s,data:{output:p.final_output}};l.includeEvent(f,p.type)&&(yield f)}}static isRunnable(e){return zl(e)}withListeners({onStart:e,onEnd:t,onError:r}){return new Fo({bound:this,config:{},configFactories:[o=>({callbacks:[new Xb({config:o,onStart:e,onEnd:t,onError:r})]})]})}asTool(e){return mD(this,e)}},Fo=class ZS extends Fe{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 r=Ui(this.config,...t);return Ui(r,...this.configFactories?await Promise.all(this.configFactories.map(async o=>await o(r))):[])}withConfig(t){return new this.constructor({bound:this.bound,kwargs:this.kwargs,config:{...this.config,...t}})}withRetry(t){return new Qf({bound:this.bound,kwargs:this.kwargs,config:this.config,maxAttemptNumber:t?.stopAfterAttempt,...t})}async invoke(t,r){return this.bound.invoke(t,await this._mergeConfig(r,this.kwargs))}async batch(t,r,o){let n=Array.isArray(r)?await Promise.all(r.map(async i=>this._mergeConfig(Pe(i),this.kwargs))):await this._mergeConfig(Pe(r),this.kwargs);return this.bound.batch(t,n,o)}_concatOutputChunks(t,r){return this.bound._concatOutputChunks(t,r)}async*_streamIterator(t,r){yield*this.bound._streamIterator(t,await this._mergeConfig(Pe(r),this.kwargs))}async stream(t,r){return this.bound.stream(t,await this._mergeConfig(Pe(r),this.kwargs))}async*transform(t,r){yield*this.bound.transform(t,await this._mergeConfig(Pe(r),this.kwargs))}streamEvents(t,r,o){let n=this,i=async function*(){yield*n.bound.streamEvents(t,{...await n._mergeConfig(Pe(r),n.kwargs),version:r.version},o)};return Jt.fromAsyncGenerator(i())}static isRunnableBinding(t){return t.bound&&Fe.isRunnable(t.bound)}withListeners({onStart:t,onEnd:r,onError:o}){return new ZS({bound:this.bound,kwargs:this.kwargs,config:this.config,configFactories:[n=>({callbacks:[new Xb({config:n,onStart:t,onEnd:r,onError:o})]})]})}},FS=class BS extends Fe{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,r){return this._callWithConfig(this._invoke.bind(this),t,r)}async _invoke(t,r,o){return this.bound.batch(t,De(r,{callbacks:o?.getChild()}))}withListeners({onStart:t,onEnd:r,onError:o}){return new BS({bound:this.bound.withListeners({onStart:t,onEnd:r,onError:o})})}},Qf=class extends Fo{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,r){let o=e>1?`retry:attempt:${e}`:void 0;return De(t,{callbacks:r?.getChild(o)})}async _invoke(e,t,r){return El(o=>super.invoke(e,this._patchConfigForRetry(o,t,r)),{onFailedAttempt:({error:o})=>this.onFailedAttempt(o,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,r,o){let n={};try{await El(async i=>{let a=e.map((d,p)=>p).filter(d=>n[d.toString()]===void 0||n[d.toString()]instanceof Error),s=a.map(d=>e[d]),u=a.map(d=>this._patchConfigForRetry(i,t?.[d],r?.[d])),c=await super.batch(s,u,{...o,returnExceptions:!0}),l;for(let d=0;d<c.length;d+=1){let p=c[d],f=a[d];p instanceof Error&&l===void 0&&(l=p,l.input=s[d]),n[f.toString()]=p}if(l)throw l;return c},{onFailedAttempt:({error:i})=>this.onFailedAttempt(i,i.input),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}catch(i){if(o?.returnExceptions!==!0)throw i}return Object.keys(n).sort((i,a)=>parseInt(i,10)-parseInt(a,10)).map(i=>n[parseInt(i,10)])}async batch(e,t,r){return this._batchWithConfig(this._batch.bind(this),e,t,r)}},su=class Nl extends Fe{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,r){let o=Pe(r),n=await(await Ct(o))?.handleChainStart(this.toJSON(),dt(t,"input"),o.runId,void 0,void 0,void 0,o?.runName);delete o.runId;let i=t,a;try{let s=[this.first,...this.middle];for(let u=0;u<s.length;u+=1)i=await fr(s[u].invoke(i,De(o,{callbacks:n?.getChild(this.omitSequenceTags?void 0:`seq:step:${u+1}`)})),o.signal);if(o.signal?.aborted)throw ko(o.signal);a=await this.last.invoke(i,De(o,{callbacks:n?.getChild(this.omitSequenceTags?void 0:`seq:step:${this.steps.length}`)}))}catch(s){throw await n?.handleChainError(s),s}return await n?.handleChainEnd(dt(a,"output")),a}async batch(t,r,o){let n=this._getOptionsList(r??{},t.length),i=await Promise.all(n.map(Ct)),a=await Promise.all(i.map(async(u,c)=>{let l=await u?.handleChainStart(this.toJSON(),dt(t[c],"input"),n[c].runId,void 0,void 0,void 0,n[c].runName);return delete n[c].runId,l})),s=t;try{for(let u=0;u<this.steps.length;u+=1)s=await fr(this.steps[u].batch(s,a.map((c,l)=>{let d=c?.getChild(this.omitSequenceTags?void 0:`seq:step:${u+1}`);return De(n[l],{callbacks:d})}),o),n[0]?.signal)}catch(u){throw await Promise.all(a.map(c=>c?.handleChainError(u))),u}return await Promise.all(a.map(u=>u?.handleChainEnd(dt(s,"output")))),s}_concatOutputChunks(t,r){return this.last._concatOutputChunks(t,r)}async*_streamIterator(t,r){let o=await Ct(r),{runId:n,...i}=r??{},a=await o?.handleChainStart(this.toJSON(),dt(t,"input"),n,void 0,void 0,void 0,i?.runName),s=[this.first,...this.middle,this.last],u=!0,c;async function*l(){yield t}try{let d=s[0].transform(l(),De(i,{callbacks:a?.getChild(this.omitSequenceTags?void 0:"seq:step:1")}));for(let p=1;p<s.length;p+=1)d=await s[p].transform(d,De(i,{callbacks:a?.getChild(this.omitSequenceTags?void 0:`seq:step:${p+1}`)}));for await(let p of d)if(r?.signal?.throwIfAborted(),yield p,u)if(c===void 0)c=p;else try{c=this._concatOutputChunks(c,p)}catch{c=void 0,u=!1}}catch(d){throw await a?.handleChainError(d),d}await a?.handleChainEnd(dt(c,"output"))}getGraph(t){let r=new Gf,o=null;return this.steps.forEach((n,i)=>{let a=n.getGraph(t);i!==0&&a.trimFirstNode(),i!==this.steps.length-1&&a.trimLastNode(),r.extend(a);let s=a.firstNode();if(!s)throw new Error(`Runnable ${n} has no first node`);o&&r.addEdge(o,s),o=a.lastNode()}),r}pipe(t){return Nl.isRunnableSequence(t)?new Nl({first:this.first,middle:this.middle.concat([this.last,t.first,...t.middle]),last:t.last,name:this.name??t.name}):new Nl({first:this.first,middle:[...this.middle,this.last],last:vr(t),name:this.name})}static isRunnableSequence(t){return Array.isArray(t.middle)&&Fe.isRunnable(t)}static from([t,...r],o){let n={};return typeof o=="string"?n.name=o:o!==void 0&&(n=o),new Nl({...n,first:vr(t),middle:r.slice(0,-1).map(vr),last:vr(r[r.length-1])})}},Bo=class WS extends Fe{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[r,o]of Object.entries(t.steps))this.steps[r]=vr(o)}static from(t){return new WS({steps:t})}async invoke(t,r){let o=Pe(r),n=await(await Ct(o))?.handleChainStart(this.toJSON(),{input:t},o.runId,void 0,void 0,void 0,o?.runName);delete o.runId;let i={};try{let a=Object.entries(this.steps).map(async([s,u])=>{i[s]=await u.invoke(t,De(o,{callbacks:n?.getChild(`map:key:${s}`)}))});await fr(Promise.all(a),o.signal)}catch(a){throw await n?.handleChainError(a),a}return await n?.handleChainEnd(i),i}async*_transform(t,r,o){let n={...this.steps},i=Bf(t,Object.keys(n).length),a=new Map(Object.entries(n).map(([s,u],c)=>{let l=u.transform(i[c],De(o,{callbacks:r?.getChild(`map:key:${s}`)}));return[s,l.next().then(d=>({key:s,gen:l,result:d}))]}));for(;a.size;){let{key:s,result:u,gen:c}=await fr(Promise.race(a.values()),o?.signal);a.delete(s),u.done||(yield{[s]:u.value},a.set(s,c.next().then(l=>({key:s,gen:c,result:l}))))}}transform(t,r){return this._transformStreamWithConfig(t,this._transform.bind(this),r)}async stream(t,r){async function*o(){yield t}let n=Pe(r),i=new Lo({generator:this.transform(o(),n),config:n});return await i.setup,Jt.fromAsyncGenerator(i)}},pD=class KS extends Fe{lc_serializable=!1;lc_namespace=["langchain_core","runnables"];func;constructor(t){if(super(t),!vp(t.func))throw new Error("RunnableTraceable requires a function that is wrapped in traceable higher-order function");this.func=t.func}async invoke(t,r){let[o]=this._getOptionsList(r??{},1),n=await Ct(o);return fr(this.func(De(o,{callbacks:n}),t),o?.signal)}async*_streamIterator(t,r){let[o]=this._getOptionsList(r??{},1),n=await this.invoke(t,r);if(Df(n)){for await(let i of n)o?.signal?.throwIfAborted(),yield i;return}if(uS(n)){for(;;){o?.signal?.throwIfAborted();let i=n.next();if(i.done)break;yield i.value}return}yield n}static from(t){return new KS({func:t})}};function fD(e){if(vp(e))throw new Error("RunnableLambda requires a function that is not wrapped in traceable higher-order function. This shouldn't happen.")}var or=class VS extends Fe{static lc_name(){return"RunnableLambda"}lc_namespace=["langchain_core","runnables"];func;constructor(t){if(vp(t.func))return pD.from(t.func);super(t),fD(t.func),this.func=t.func}static from(t){return new VS({func:t})}async _invoke(t,r,o){return new Promise((n,i)=>{let a=De(r,{callbacks:o?.getChild(),recursionLimit:(r?.recursionLimit??25)-1});Qt.runWithConfig(Ft(a),async()=>{try{let s=await this.func(t,{...a});if(s&&Fe.isRunnable(s)){if(r?.recursionLimit===0)throw new Error("Recursion limit reached.");s=await s.invoke(t,{...a,recursionLimit:(a.recursionLimit??25)-1})}else if(Df(s)){let u;for await(let c of Mf(a,s))if(r?.signal?.throwIfAborted(),u===void 0)u=c;else try{u=this._concatOutputChunks(u,c)}catch{u=c}s=u}else if(Ub(s)){let u;for(let c of Zb(a,s))if(r?.signal?.throwIfAborted(),u===void 0)u=c;else try{u=this._concatOutputChunks(u,c)}catch{u=c}s=u}n(s)}catch(s){i(s)}})})}async invoke(t,r){return this._callWithConfig(this._invoke.bind(this),t,r)}async*_transform(t,r,o){let n;for await(let s of t)if(n===void 0)n=s;else try{n=this._concatOutputChunks(n,s)}catch{n=s}let i=De(o,{callbacks:r?.getChild(),recursionLimit:(o?.recursionLimit??25)-1}),a=await new Promise((s,u)=>{Qt.runWithConfig(Ft(i),async()=>{try{s(await this.func(n,{...i,config:i}))}catch(c){u(c)}})});if(a&&Fe.isRunnable(a)){if(o?.recursionLimit===0)throw new Error("Recursion limit reached.");let s=await a.stream(n,i);for await(let u of s)yield u}else if(Df(a))for await(let s of Mf(i,a))o?.signal?.throwIfAborted(),yield s;else if(Ub(a))for(let s of Zb(i,a))o?.signal?.throwIfAborted(),yield s;else yield a}transform(t,r){return this._transformStreamWithConfig(t,this._transform.bind(this),r)}async stream(t,r){async function*o(){yield t}let n=Pe(r),i=new Lo({generator:this.transform(o(),n),config:n});return await i.setup,Jt.fromAsyncGenerator(i)}},qS=class extends Bo{},Yb=class extends Fe{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 r=Pe(t),o=await Ct(r),{runId:n,...i}=r,a=await o?.handleChainStart(this.toJSON(),dt(e,"input"),n,void 0,void 0,void 0,i?.runName),s=De(i,{callbacks:a?.getChild()});return await Qt.runWithConfig(s,async()=>{let u;for(let c of this.runnables()){r?.signal?.throwIfAborted();try{let l=await c.invoke(e,s);return await a?.handleChainEnd(dt(l,"output")),l}catch(l){u===void 0&&(u=l)}}throw u===void 0?new Error("No error stored at end of fallback."):(await a?.handleChainError(u),u)})}async*_streamIterator(e,t){let r=Pe(t),o=await Ct(r),{runId:n,...i}=r,a=await o?.handleChainStart(this.toJSON(),dt(e,"input"),n,void 0,void 0,void 0,i?.runName),s,u;for(let l of this.runnables()){r?.signal?.throwIfAborted();let d=De(i,{callbacks:a?.getChild()});try{u=Mf(d,await l.stream(e,d));break}catch(p){s===void 0&&(s=p)}}if(u===void 0){let l=s??new Error("No error stored at end of fallback.");throw await a?.handleChainError(l),l}let c;try{for await(let l of u){yield l;try{c=c===void 0?c:this._concatOutputChunks(c,l)}catch{c=void 0}}}catch(l){throw await a?.handleChainError(l),l}await a?.handleChainEnd(dt(c,"output"))}async batch(e,t,r){if(r?.returnExceptions)throw new Error("Not implemented.");let o=this._getOptionsList(t??{},e.length),n=await Promise.all(o.map(s=>Ct(s))),i=await Promise.all(n.map(async(s,u)=>{let c=await s?.handleChainStart(this.toJSON(),dt(e[u],"input"),o[u].runId,void 0,void 0,void 0,o[u].runName);return delete o[u].runId,c})),a;for(let s of this.runnables()){o[0].signal?.throwIfAborted();try{let u=await s.batch(e,i.map((c,l)=>De(o[l],{callbacks:c?.getChild()})),r);return await Promise.all(i.map((c,l)=>c?.handleChainEnd(dt(u[l],"output")))),u}catch(u){a===void 0&&(a=u)}}throw a?(await Promise.all(i.map(s=>s?.handleChainError(a))),a):new Error("No error stored at end of fallbacks.")}};function vr(e){if(typeof e=="function")return new or({func:e});if(Fe.isRunnable(e))return e;if(!Array.isArray(e)&&typeof e=="object"){let t={};for(let[r,o]of Object.entries(e))t[r]=vr(o);return new Bo({steps:t})}else throw new Error(`Expected a Runnable, function or object.
90
+ Instead got an unsupported type.`)}var jl=class extends Fe{static lc_name(){return"RunnableAssign"}lc_namespace=["langchain_core","runnables"];lc_serializable=!0;mapper;constructor(e){e instanceof Bo&&(e={mapper:e}),super(e),this.mapper=e.mapper}async invoke(e,t){let r=await this.mapper.invoke(e,t);return{...e,...r}}async*_transform(e,t,r){let o=this.mapper.getStepsKeys(),[n,i]=Bf(e),a=this.mapper.transform(i,De(r,{callbacks:t?.getChild()})),s=a.next();for await(let u of n){if(typeof u!="object"||Array.isArray(u))throw new Error(`RunnableAssign can only be used with objects as input, got ${typeof u}`);let c=Object.fromEntries(Object.entries(u).filter(([l])=>!o.includes(l)));Object.keys(c).length>0&&(yield c)}yield(await s).value;for await(let u of a)yield u}transform(e,t){return this._transformStreamWithConfig(e,this._transform.bind(this),t)}async stream(e,t){async function*r(){yield e}let o=Pe(t),n=new Lo({generator:this.transform(r(),o),config:o});return await n.setup,Jt.fromAsyncGenerator(n)}},Qb=class extends Fe{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(r=>[r,e[r]]).filter(r=>r[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 r=await this._pick(t);r!==void 0&&(yield r)}}transform(e,t){return this._transformStreamWithConfig(e,this._transform.bind(this),t)}async stream(e,t){async function*r(){yield e}let o=Pe(t),n=new Lo({generator:this.transform(r(),o),config:o});return await n.setup,Jt.fromAsyncGenerator(n)}},Yf=class extends Fo{name;description;schema;constructor(e){let t=su.from([or.from(async r=>{let o;if(bs(r))try{o=await zo(this.schema,r.args)}catch{throw new ws("Received tool input did not match expected schema",JSON.stringify(r.args))}else o=r;return o}).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 mD(e,t){let r=t.name??e.getName(),o=t.description??No(t.schema);return Js(t.schema)?new Yf({name:r,description:o,schema:Vt.object({input:Vt.string()}).transform(n=>n.input),bound:e}):new Yf({name:r,description:o,schema:t.schema,bound:e})}var HV=oe({BasePromptValue:()=>em,ChatPromptValue:()=>tw,ImagePromptValue:()=>hD,StringPromptValue:()=>ew}),em=class extends lp{},ew=class extends em{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 pn(this.value)]}},tw=class extends em{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 gp(this.messages)}toChatMessages(){return this.messages}},hD=class extends em{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 pn({content:[{type:"image_url",image_url:{detail:this.imageUrl.detail,url:this.imageUrl.url}}]})]}};var GS=ug(XS(),1),kD=Object.defineProperty,AD=(e,t,r)=>t in e?kD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ID=(e,t,r)=>(AD(e,typeof t!="symbol"?t+"":t,r),r);function $D(e,t){let r=Array.from({length:e.length},(o,n)=>({start:n,end:n+1}));for(;r.length>1;){let o=null;for(let n=0;n<r.length-1;n++){let i=e.slice(r[n].start,r[n+1].end),a=t.get(i.join(","));a!=null&&(o==null||a<o[0])&&(o=[a,n])}if(o!=null){let n=o[1];r[n]={start:r[n].start,end:r[n+1].end},r.splice(n+1,1)}else break}return r}function SD(e,t){return e.length===1?[t.get(e.join(","))]:$D(e,t).map(r=>t.get(e.slice(r.start,r.end).join(","))).filter(r=>r!=null)}function OD(e){return e.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}var nw=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 r=e.bpe_ranks.split(`
91
+ `).filter(Boolean).reduce((o,n)=>{let[i,a,...s]=n.split(" "),u=Number.parseInt(a,10);return s.forEach((c,l)=>o[c]=u+l),o},{});for(let[o,n]of Object.entries(r)){let i=GS.default.toByteArray(o);this.rankMap.set(i.join(","),n),this.textMap.set(n,i)}this.specialTokens={...e.special_tokens,...t},this.inverseSpecialTokens=Object.entries(this.specialTokens).reduce((o,[n,i])=>(o[i]=this.textEncoder.encode(n),o),{})}encode(e,t=[],r="all"){let o=new RegExp(this.patStr,"ug"),n=nw.specialTokenRegex(Object.keys(this.specialTokens)),i=[],a=new Set(t==="all"?Object.keys(this.specialTokens):t),s=new Set(r==="all"?Object.keys(this.specialTokens).filter(c=>!a.has(c)):r);if(s.size>0){let c=nw.specialTokenRegex([...s]),l=e.match(c);if(l!=null)throw new Error(`The text contains a special token that is not allowed: ${l[0]}`)}let u=0;for(;;){let c=null,l=u;for(;n.lastIndex=l,c=n.exec(e),!(c==null||a.has(c[0]));)l=c.index+1;let d=c?.index??e.length;for(let f of e.substring(u,d).matchAll(o)){let h=this.textEncoder.encode(f[0]),y=this.rankMap.get(h.join(","));if(y!=null){i.push(y);continue}i.push(...SD(h,this.rankMap))}if(c==null)break;let p=this.specialTokens[c[0]];i.push(p),u=c.index+c[0].length}return i}decode(e){let t=[],r=0;for(let i=0;i<e.length;++i){let a=e[i],s=this.textMap.get(a)??this.inverseSpecialTokens[a];s!=null&&(t.push(s),r+=s.length)}let o=new Uint8Array(r),n=0;for(let i of t)o.set(i,n),n+=i.length;return this.textDecoder.decode(o)}},rm=nw;ID(rm,"specialTokenRegex",e=>new RegExp(e.map(t=>OD(t)).join("|"),"g"));function ow(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 cq=oe({encodingForModel:()=>om,getEncoding:()=>YS}),nm={},PD=new Jn({});async function YS(e){return e in nm||(nm[e]=PD.fetch(`https://tiktoken.pages.dev/js/${e}.json`).then(t=>t.json()).then(t=>new rm(t)).catch(t=>{throw delete nm[e],t})),await nm[e]}async function om(e){return YS(ow(e))}var _q=oe({BaseLangChain:()=>am,BaseLanguageModel:()=>Ml,calculateMaxTokens:()=>eO,getEmbeddingContextSize:()=>TD,getModelContextSize:()=>QS,getModelNameForTiktoken:()=>im,isOpenAITool:()=>Dl}),im=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,TD=e=>e==="text-embedding-ada-002"?8191:2046,QS=e=>{switch(im(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 Dl(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 eO=async({prompt:e,modelName:t})=>{let r;try{r=(await om(im(t))).encode(e).length}catch{console.warn("Failed to calculate number of tokens, falling back to approximate count"),r=Math.ceil(e.length/4)}return QS(t)-r},ED=()=>!1,am=class extends Fe{verbose;callbacks;tags;metadata;get lc_attributes(){return{callbacks:void 0,verbose:void 0}}constructor(e){super(e),this.verbose=e.verbose??ED(),this.callbacks=e.callbacks,this.tags=e.tags??[],this.metadata=e.metadata??{},this._addVersion("@langchain/core","1.2.9")}_addVersion(e,t){let r=this.metadata?.versions;this.metadata={...this.metadata,versions:{...typeof r=="object"&&r!==null?r:{},[e]:t}}}},Ml=class extends am{get callKeys(){return["stop","timeout","signal","tags","metadata","callbacks"]}caller;cache;constructor({callbacks:e,callbackManager:t,...r}){let{cache:o,...n}=r;super({callbacks:e??t,...n}),typeof o=="object"?this.cache=o:o?this.cache=Fb.global():this.cache=void 0,this.caller=new Jn(r??{})}_encoding;async getNumTokens(e){let t;typeof e=="string"?t=e:t=e.map(o=>typeof o=="string"?o:o.type==="text"&&"text"in o?o.text:"").join("");let r=Math.ceil(t.length/4);if(!this._encoding)try{this._encoding=await om("modelName"in this?im(this.modelName):"gpt2")}catch(o){console.warn("Failed to calculate number of tokens, falling back to approximate count",o)}if(this._encoding)try{r=this._encoding.encode(t).length}catch(o){console.warn("Failed to calculate number of tokens, falling back to approximate count",o)}return r}static _convertInputToPromptValue(e){return typeof e=="string"?new ew(e):Array.isArray(e)?new tw(e.map(xo)):e}_identifyingParams(){return{}}_getSerializedCacheKeyParametersForCall({config:e,...t}){let r={...this._identifyingParams(),...t,_type:this._llmType(),_model:this._modelType()};return Object.entries(r).filter(([o,n])=>n!==void 0).map(([o,n])=>`${o}:${JSON.stringify(n)}`).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{}}_filterInvocationParamsForTracing(e){let{tools:t,functions:r,messages:o,response_format:n,...i}=e;return i}};function Ul(e){return e!==void 0&&Array.isArray(e.lc_namespace)}function Ll(e){return e!==void 0&&Fe.isRunnable(e)&&"lc_name"in e.constructor&&typeof e.constructor.lc_name=="function"&&e.constructor.lc_name()==="RunnableToolLike"}function Zl(e){return!!e&&typeof e=="object"&&"name"in e&&"schema"in e&&(_t(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 Gn(e){return Zl(e)||Ll(e)||Ul(e)}var V={};Kr(V,{$brand:()=>dg,$input:()=>T_,$output:()=>P_,NEVER:()=>lg,TimePrecision:()=>z_,ZodAny:()=>Sw,ZodArray:()=>Ew,ZodBase64:()=>Sm,ZodBase64URL:()=>Om,ZodBigInt:()=>hu,ZodBigIntFormat:()=>Em,ZodBoolean:()=>mu,ZodCIDRv4:()=>Im,ZodCIDRv6:()=>$m,ZodCUID:()=>_m,ZodCUID2:()=>vm,ZodCatch:()=>Qw,ZodCodec:()=>td,ZodCustom:()=>rd,ZodCustomStringFormat:()=>pu,ZodDate:()=>Xl,ZodDefault:()=>qw,ZodDiscriminatedUnion:()=>Cw,ZodE164:()=>Pm,ZodEmail:()=>hm,ZodEmoji:()=>gm,ZodEnum:()=>lu,ZodError:()=>RD,ZodExactOptional:()=>Ww,ZodFile:()=>Fw,ZodFirstPartyTypeKind:()=>px,ZodFunction:()=>cx,ZodGUID:()=>Kl,ZodIPv4:()=>km,ZodIPv6:()=>Am,ZodISODate:()=>cm,ZodISODateTime:()=>um,ZodISODuration:()=>dm,ZodISOTime:()=>lm,ZodIntersection:()=>zw,ZodIssueCode:()=>zD,ZodJWT:()=>Tm,ZodKSUID:()=>xm,ZodLazy:()=>ax,ZodLiteral:()=>Zw,ZodMAC:()=>bw,ZodMap:()=>Uw,ZodNaN:()=>tx,ZodNanoID:()=>ym,ZodNever:()=>Pw,ZodNonOptional:()=>Dm,ZodNull:()=>Iw,ZodNullable:()=>Vw,ZodNumber:()=>fu,ZodNumberFormat:()=>ya,ZodObject:()=>Yl,ZodOptional:()=>jm,ZodPipe:()=>ed,ZodPrefault:()=>Hw,ZodPreprocess:()=>rx,ZodPromise:()=>ux,ZodReadonly:()=>nx,ZodRealError:()=>ir,ZodRecord:()=>cu,ZodSet:()=>Lw,ZodString:()=>du,ZodStringFormat:()=>Be,ZodSuccess:()=>Yw,ZodSymbol:()=>kw,ZodTemplateLiteral:()=>ix,ZodTransform:()=>Bw,ZodTuple:()=>jw,ZodType:()=>xe,ZodULID:()=>bm,ZodURL:()=>Hl,ZodUUID:()=>On,ZodUndefined:()=>Aw,ZodUnion:()=>Ql,ZodUnknown:()=>Ow,ZodVoid:()=>Tw,ZodXID:()=>wm,ZodXor:()=>Rw,_ZodString:()=>mm,_default:()=>Jw,_function:()=>c0,any:()=>LO,array:()=>Gl,base64:()=>kO,base64url:()=>AO,bigint:()=>NO,boolean:()=>xw,catch:()=>ex,check:()=>l0,cidrv4:()=>wO,cidrv6:()=>xO,clone:()=>Je,codec:()=>i0,coerce:()=>fx,config:()=>tt,core:()=>Bn,cuid:()=>fO,cuid2:()=>mO,custom:()=>d0,date:()=>FO,decode:()=>fw,decodeAsync:()=>hw,describe:()=>p0,discriminatedUnion:()=>JO,e164:()=>IO,email:()=>nO,emoji:()=>dO,encode:()=>pw,encodeAsync:()=>mw,endsWith:()=>Ms,enum:()=>zm,exactOptional:()=>Kw,file:()=>t0,flattenError:()=>al,float32:()=>EO,float64:()=>RO,formatError:()=>sl,fromJSONSchema:()=>v0,function:()=>c0,getErrorMap:()=>jD,globalRegistry:()=>je,gt:()=>yn,gte:()=>Wt,guid:()=>oO,hash:()=>TO,hex:()=>PO,hostname:()=>OO,httpUrl:()=>lO,includes:()=>js,instanceof:()=>m0,int:()=>pm,int32:()=>CO,int64:()=>jO,intersection:()=>Nw,invertCodec:()=>a0,ipv4:()=>_O,ipv6:()=>bO,iso:()=>uu,json:()=>g0,jwt:()=>$O,keyof:()=>BO,ksuid:()=>yO,lazy:()=>sx,length:()=>Ji,literal:()=>e0,locales:()=>yl,looseObject:()=>VO,looseRecord:()=>XO,lowercase:()=>zs,lt:()=>gn,lte:()=>hr,mac:()=>vO,map:()=>GO,maxLength:()=>qi,maxSize:()=>To,meta:()=>f0,mime:()=>Us,minLength:()=>Zn,minSize:()=>_n,multipleOf:()=>Po,nan:()=>o0,nanoid:()=>pO,nativeEnum:()=>QO,negative:()=>hf,never:()=>Rm,nonnegative:()=>yf,nonoptional:()=>Gw,nonpositive:()=>gf,normalize:()=>Ls,null:()=>$w,nullable:()=>ql,nullish:()=>r0,number:()=>ww,object:()=>WO,optional:()=>Vl,overwrite:()=>Jr,parse:()=>Bl,parseAsync:()=>cw,partialRecord:()=>HO,pipe:()=>fm,positive:()=>mf,prefault:()=>Xw,preprocess:()=>y0,prettifyError:()=>Ag,promise:()=>u0,property:()=>_f,readonly:()=>ox,record:()=>Mw,refine:()=>lx,regex:()=>Cs,regexes:()=>mr,registry:()=>Rs,safeDecode:()=>yw,safeDecodeAsync:()=>vw,safeEncode:()=>gw,safeEncodeAsync:()=>_w,safeParse:()=>lw,safeParseAsync:()=>dw,set:()=>YO,setErrorMap:()=>ND,size:()=>Vi,slugify:()=>Ws,startsWith:()=>Ds,strictObject:()=>KO,string:()=>Wl,stringFormat:()=>SO,stringbool:()=>h0,success:()=>n0,superRefine:()=>dx,symbol:()=>MO,templateLiteral:()=>s0,toJSONSchema:()=>Fn,toLowerCase:()=>Fs,toUpperCase:()=>Bs,transform:()=>Nm,treeifyError:()=>kg,trim:()=>Zs,tuple:()=>Dw,uint32:()=>zO,uint64:()=>DO,ulid:()=>hO,undefined:()=>UO,union:()=>Cm,unknown:()=>ga,uppercase:()=>Ns,url:()=>cO,util:()=>L,uuid:()=>iO,uuidv4:()=>aO,uuidv6:()=>sO,uuidv7:()=>uO,void:()=>ZO,xid:()=>gO,xor:()=>qO});var Fl={};Kr(Fl,{ZodAny:()=>Sw,ZodArray:()=>Ew,ZodBase64:()=>Sm,ZodBase64URL:()=>Om,ZodBigInt:()=>hu,ZodBigIntFormat:()=>Em,ZodBoolean:()=>mu,ZodCIDRv4:()=>Im,ZodCIDRv6:()=>$m,ZodCUID:()=>_m,ZodCUID2:()=>vm,ZodCatch:()=>Qw,ZodCodec:()=>td,ZodCustom:()=>rd,ZodCustomStringFormat:()=>pu,ZodDate:()=>Xl,ZodDefault:()=>qw,ZodDiscriminatedUnion:()=>Cw,ZodE164:()=>Pm,ZodEmail:()=>hm,ZodEmoji:()=>gm,ZodEnum:()=>lu,ZodExactOptional:()=>Ww,ZodFile:()=>Fw,ZodFunction:()=>cx,ZodGUID:()=>Kl,ZodIPv4:()=>km,ZodIPv6:()=>Am,ZodIntersection:()=>zw,ZodJWT:()=>Tm,ZodKSUID:()=>xm,ZodLazy:()=>ax,ZodLiteral:()=>Zw,ZodMAC:()=>bw,ZodMap:()=>Uw,ZodNaN:()=>tx,ZodNanoID:()=>ym,ZodNever:()=>Pw,ZodNonOptional:()=>Dm,ZodNull:()=>Iw,ZodNullable:()=>Vw,ZodNumber:()=>fu,ZodNumberFormat:()=>ya,ZodObject:()=>Yl,ZodOptional:()=>jm,ZodPipe:()=>ed,ZodPrefault:()=>Hw,ZodPreprocess:()=>rx,ZodPromise:()=>ux,ZodReadonly:()=>nx,ZodRecord:()=>cu,ZodSet:()=>Lw,ZodString:()=>du,ZodStringFormat:()=>Be,ZodSuccess:()=>Yw,ZodSymbol:()=>kw,ZodTemplateLiteral:()=>ix,ZodTransform:()=>Bw,ZodTuple:()=>jw,ZodType:()=>xe,ZodULID:()=>bm,ZodURL:()=>Hl,ZodUUID:()=>On,ZodUndefined:()=>Aw,ZodUnion:()=>Ql,ZodUnknown:()=>Ow,ZodVoid:()=>Tw,ZodXID:()=>wm,ZodXor:()=>Rw,_ZodString:()=>mm,_default:()=>Jw,_function:()=>c0,any:()=>LO,array:()=>Gl,base64:()=>kO,base64url:()=>AO,bigint:()=>NO,boolean:()=>xw,catch:()=>ex,check:()=>l0,cidrv4:()=>wO,cidrv6:()=>xO,codec:()=>i0,cuid:()=>fO,cuid2:()=>mO,custom:()=>d0,date:()=>FO,describe:()=>p0,discriminatedUnion:()=>JO,e164:()=>IO,email:()=>nO,emoji:()=>dO,enum:()=>zm,exactOptional:()=>Kw,file:()=>t0,float32:()=>EO,float64:()=>RO,function:()=>c0,guid:()=>oO,hash:()=>TO,hex:()=>PO,hostname:()=>OO,httpUrl:()=>lO,instanceof:()=>m0,int:()=>pm,int32:()=>CO,int64:()=>jO,intersection:()=>Nw,invertCodec:()=>a0,ipv4:()=>_O,ipv6:()=>bO,json:()=>g0,jwt:()=>$O,keyof:()=>BO,ksuid:()=>yO,lazy:()=>sx,literal:()=>e0,looseObject:()=>VO,looseRecord:()=>XO,mac:()=>vO,map:()=>GO,meta:()=>f0,nan:()=>o0,nanoid:()=>pO,nativeEnum:()=>QO,never:()=>Rm,nonoptional:()=>Gw,null:()=>$w,nullable:()=>ql,nullish:()=>r0,number:()=>ww,object:()=>WO,optional:()=>Vl,partialRecord:()=>HO,pipe:()=>fm,prefault:()=>Xw,preprocess:()=>y0,promise:()=>u0,readonly:()=>ox,record:()=>Mw,refine:()=>lx,set:()=>YO,strictObject:()=>KO,string:()=>Wl,stringFormat:()=>SO,stringbool:()=>h0,success:()=>n0,superRefine:()=>dx,symbol:()=>MO,templateLiteral:()=>s0,transform:()=>Nm,tuple:()=>Dw,uint32:()=>zO,uint64:()=>DO,ulid:()=>hO,undefined:()=>UO,union:()=>Cm,unknown:()=>ga,url:()=>cO,uuid:()=>iO,uuidv4:()=>aO,uuidv6:()=>sO,uuidv7:()=>uO,void:()=>ZO,xid:()=>gO,xor:()=>qO});var sm={};Kr(sm,{endsWith:()=>Ms,gt:()=>yn,gte:()=>Wt,includes:()=>js,length:()=>Ji,lowercase:()=>zs,lt:()=>gn,lte:()=>hr,maxLength:()=>qi,maxSize:()=>To,mime:()=>Us,minLength:()=>Zn,minSize:()=>_n,multipleOf:()=>Po,negative:()=>hf,nonnegative:()=>yf,nonpositive:()=>gf,normalize:()=>Ls,overwrite:()=>Jr,positive:()=>mf,property:()=>_f,regex:()=>Cs,size:()=>Vi,slugify:()=>Ws,startsWith:()=>Ds,toLowerCase:()=>Fs,toUpperCase:()=>Bs,trim:()=>Zs,uppercase:()=>Ns});var uu={};Kr(uu,{ZodISODate:()=>cm,ZodISODateTime:()=>um,ZodISODuration:()=>dm,ZodISOTime:()=>lm,date:()=>aw,datetime:()=>iw,duration:()=>uw,time:()=>sw});var um=P("ZodISODateTime",(e,t)=>{Cy.init(e,t),Be.init(e,t)});function iw(e){return N_(um,e)}var cm=P("ZodISODate",(e,t)=>{zy.init(e,t),Be.init(e,t)});function aw(e){return j_(cm,e)}var lm=P("ZodISOTime",(e,t)=>{Ny.init(e,t),Be.init(e,t)});function sw(e){return D_(lm,e)}var dm=P("ZodISODuration",(e,t)=>{jy.init(e,t),Be.init(e,t)});function uw(e){return M_(dm,e)}var tO=(e,t)=>{il.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>sl(e,r)},flatten:{value:r=>al(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,ks,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,ks,2)}},isEmpty:{get(){return e.issues.length===0}}})},RD=P("ZodError",tO),ir=P("ZodError",tO,{Parent:Error});var Bl=$s(ir),cw=Ss(ir),lw=Os(ir),dw=Ps(ir),pw=kp(ir),fw=Ap(ir),mw=Ip(ir),hw=$p(ir),gw=Sp(ir),yw=Op(ir),_w=Pp(ir),vw=Tp(ir);var rO=new WeakMap;function Jl(e,t,r){let o=Object.getPrototypeOf(e),n=rO.get(o);if(n||(n=new Set,rO.set(o,n)),!n.has(t)){n.add(t);for(let i in r){let a=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let s=a.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var xe=P("ZodType",(e,t)=>(ye.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Vs(e,"input"),output:Vs(e,"output")}}),e.toJSONSchema=mv(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>Bl(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>lw(e,r,o),e.parseAsync=async(r,o)=>cw(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>dw(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>pw(e,r,o),e.decode=(r,o)=>fw(e,r,o),e.encodeAsync=async(r,o)=>mw(e,r,o),e.decodeAsync=async(r,o)=>hw(e,r,o),e.safeEncode=(r,o)=>gw(e,r,o),e.safeDecode=(r,o)=>yw(e,r,o),e.safeEncodeAsync=async(r,o)=>_w(e,r,o),e.safeDecodeAsync=async(r,o)=>vw(e,r,o),Jl(e,"ZodType",{check(...r){let o=this.def;return this.clone(L.mergeDefs(o,{checks:[...o.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return Je(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(lx(r,o))},superRefine(r,o){return this.check(dx(r,o))},overwrite(r){return this.check(Jr(r))},optional(){return Vl(this)},exactOptional(){return Kw(this)},nullable(){return ql(this)},nullish(){return Vl(ql(this))},nonoptional(r){return Gw(this,r)},array(){return Gl(this)},or(r){return Cm([this,r])},and(r){return Nw(this,r)},transform(r){return fm(this,Nm(r))},default(r){return Jw(this,r)},prefault(r){return Xw(this,r)},catch(r){return ex(this,r)},pipe(r){return fm(this,r)},readonly(){return ox(this)},describe(r){let o=this.clone();return je.add(o,{description:r}),o},meta(...r){if(r.length===0)return je.get(this);let o=this.clone();return je.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return je.get(e)?.description},configurable:!0}),e)),mm=P("_ZodString",(e,t)=>{Wi.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>hv(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,Jl(e,"_ZodString",{regex(...o){return this.check(Cs(...o))},includes(...o){return this.check(js(...o))},startsWith(...o){return this.check(Ds(...o))},endsWith(...o){return this.check(Ms(...o))},min(...o){return this.check(Zn(...o))},max(...o){return this.check(qi(...o))},length(...o){return this.check(Ji(...o))},nonempty(...o){return this.check(Zn(1,...o))},lowercase(o){return this.check(zs(o))},uppercase(o){return this.check(Ns(o))},trim(){return this.check(Zs())},normalize(...o){return this.check(Ls(...o))},toLowerCase(){return this.check(Fs())},toUpperCase(){return this.check(Bs())},slugify(){return this.check(Ws())}})}),du=P("ZodString",(e,t)=>{Wi.init(e,t),mm.init(e,t),e.email=r=>e.check(qp(hm,r)),e.url=r=>e.check(vl(Hl,r)),e.jwt=r=>e.check(ff(Tm,r)),e.emoji=r=>e.check(Yp(gm,r)),e.guid=r=>e.check(_l(Kl,r)),e.uuid=r=>e.check(Jp(On,r)),e.uuidv4=r=>e.check(Hp(On,r)),e.uuidv6=r=>e.check(Xp(On,r)),e.uuidv7=r=>e.check(Gp(On,r)),e.nanoid=r=>e.check(Qp(ym,r)),e.guid=r=>e.check(_l(Kl,r)),e.cuid=r=>e.check(ef(_m,r)),e.cuid2=r=>e.check(tf(vm,r)),e.ulid=r=>e.check(rf(bm,r)),e.base64=r=>e.check(lf(Sm,r)),e.base64url=r=>e.check(df(Om,r)),e.xid=r=>e.check(nf(wm,r)),e.ksuid=r=>e.check(of(xm,r)),e.ipv4=r=>e.check(af(km,r)),e.ipv6=r=>e.check(sf(Am,r)),e.cidrv4=r=>e.check(uf(Im,r)),e.cidrv6=r=>e.check(cf($m,r)),e.e164=r=>e.check(pf(Pm,r)),e.datetime=r=>e.check(iw(r)),e.date=r=>e.check(aw(r)),e.time=r=>e.check(sw(r)),e.duration=r=>e.check(uw(r))});function Wl(e){return E_(du,e)}var Be=P("ZodStringFormat",(e,t)=>{Le.init(e,t),mm.init(e,t)}),hm=P("ZodEmail",(e,t)=>{Ay.init(e,t),Be.init(e,t)});function nO(e){return qp(hm,e)}var Kl=P("ZodGUID",(e,t)=>{xy.init(e,t),Be.init(e,t)});function oO(e){return _l(Kl,e)}var On=P("ZodUUID",(e,t)=>{ky.init(e,t),Be.init(e,t)});function iO(e){return Jp(On,e)}function aO(e){return Hp(On,e)}function sO(e){return Xp(On,e)}function uO(e){return Gp(On,e)}var Hl=P("ZodURL",(e,t)=>{Iy.init(e,t),Be.init(e,t)});function cO(e){return vl(Hl,e)}function lO(e){return vl(Hl,{protocol:mr.httpProtocol,hostname:mr.domain,...L.normalizeParams(e)})}var gm=P("ZodEmoji",(e,t)=>{$y.init(e,t),Be.init(e,t)});function dO(e){return Yp(gm,e)}var ym=P("ZodNanoID",(e,t)=>{Sy.init(e,t),Be.init(e,t)});function pO(e){return Qp(ym,e)}var _m=P("ZodCUID",(e,t)=>{Oy.init(e,t),Be.init(e,t)});function fO(e){return ef(_m,e)}var vm=P("ZodCUID2",(e,t)=>{Py.init(e,t),Be.init(e,t)});function mO(e){return tf(vm,e)}var bm=P("ZodULID",(e,t)=>{Ty.init(e,t),Be.init(e,t)});function hO(e){return rf(bm,e)}var wm=P("ZodXID",(e,t)=>{Ey.init(e,t),Be.init(e,t)});function gO(e){return nf(wm,e)}var xm=P("ZodKSUID",(e,t)=>{Ry.init(e,t),Be.init(e,t)});function yO(e){return of(xm,e)}var km=P("ZodIPv4",(e,t)=>{Dy.init(e,t),Be.init(e,t)});function _O(e){return af(km,e)}var bw=P("ZodMAC",(e,t)=>{Uy.init(e,t),Be.init(e,t)});function vO(e){return C_(bw,e)}var Am=P("ZodIPv6",(e,t)=>{My.init(e,t),Be.init(e,t)});function bO(e){return sf(Am,e)}var Im=P("ZodCIDRv4",(e,t)=>{Ly.init(e,t),Be.init(e,t)});function wO(e){return uf(Im,e)}var $m=P("ZodCIDRv6",(e,t)=>{Zy.init(e,t),Be.init(e,t)});function xO(e){return cf($m,e)}var Sm=P("ZodBase64",(e,t)=>{By.init(e,t),Be.init(e,t)});function kO(e){return lf(Sm,e)}var Om=P("ZodBase64URL",(e,t)=>{Wy.init(e,t),Be.init(e,t)});function AO(e){return df(Om,e)}var Pm=P("ZodE164",(e,t)=>{Ky.init(e,t),Be.init(e,t)});function IO(e){return pf(Pm,e)}var Tm=P("ZodJWT",(e,t)=>{Vy.init(e,t),Be.init(e,t)});function $O(e){return ff(Tm,e)}var pu=P("ZodCustomStringFormat",(e,t)=>{qy.init(e,t),Be.init(e,t)});function SO(e,t,r={}){return Ks(pu,e,t,r)}function OO(e){return Ks(pu,"hostname",mr.hostname,e)}function PO(e){return Ks(pu,"hex",mr.hex,e)}function TO(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=mr[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Ks(pu,o,n,t)}var fu=P("ZodNumber",(e,t)=>{Up.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>gv(e,o,n,i),Jl(e,"ZodNumber",{gt(o,n){return this.check(yn(o,n))},gte(o,n){return this.check(Wt(o,n))},min(o,n){return this.check(Wt(o,n))},lt(o,n){return this.check(gn(o,n))},lte(o,n){return this.check(hr(o,n))},max(o,n){return this.check(hr(o,n))},int(o){return this.check(pm(o))},safe(o){return this.check(pm(o))},positive(o){return this.check(yn(0,o))},nonnegative(o){return this.check(Wt(0,o))},negative(o){return this.check(gn(0,o))},nonpositive(o){return this.check(hr(0,o))},multipleOf(o,n){return this.check(Po(o,n))},step(o,n){return this.check(Po(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ww(e){return U_(fu,e)}var ya=P("ZodNumberFormat",(e,t)=>{Jy.init(e,t),fu.init(e,t)});function pm(e){return Z_(ya,e)}function EO(e){return F_(ya,e)}function RO(e){return B_(ya,e)}function CO(e){return W_(ya,e)}function zO(e){return K_(ya,e)}var mu=P("ZodBoolean",(e,t)=>{dl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yv(e,r,o,n)});function xw(e){return V_(mu,e)}var hu=P("ZodBigInt",(e,t)=>{Lp.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>_v(e,o,n,i),e.gte=(o,n)=>e.check(Wt(o,n)),e.min=(o,n)=>e.check(Wt(o,n)),e.gt=(o,n)=>e.check(yn(o,n)),e.gte=(o,n)=>e.check(Wt(o,n)),e.min=(o,n)=>e.check(Wt(o,n)),e.lt=(o,n)=>e.check(gn(o,n)),e.lte=(o,n)=>e.check(hr(o,n)),e.max=(o,n)=>e.check(hr(o,n)),e.positive=o=>e.check(yn(BigInt(0),o)),e.negative=o=>e.check(gn(BigInt(0),o)),e.nonpositive=o=>e.check(hr(BigInt(0),o)),e.nonnegative=o=>e.check(Wt(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(Po(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function NO(e){return J_(hu,e)}var Em=P("ZodBigIntFormat",(e,t)=>{Hy.init(e,t),hu.init(e,t)});function jO(e){return X_(Em,e)}function DO(e){return G_(Em,e)}var kw=P("ZodSymbol",(e,t)=>{Xy.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vv(e,r,o,n)});function MO(e){return Y_(kw,e)}var Aw=P("ZodUndefined",(e,t)=>{Gy.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wv(e,r,o,n)});function UO(e){return Q_(Aw,e)}var Iw=P("ZodNull",(e,t)=>{Yy.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bv(e,r,o,n)});function $w(e){return ev(Iw,e)}var Sw=P("ZodAny",(e,t)=>{Qy.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Av(e,r,o,n)});function LO(){return tv(Sw)}var Ow=P("ZodUnknown",(e,t)=>{pl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Iv(e,r,o,n)});function ga(){return bl(Ow)}var Pw=P("ZodNever",(e,t)=>{fl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>kv(e,r,o,n)});function Rm(e){return wl(Pw,e)}var Tw=P("ZodVoid",(e,t)=>{e_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xv(e,r,o,n)});function ZO(e){return rv(Tw,e)}var Xl=P("ZodDate",(e,t)=>{t_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>$v(e,o,n,i),e.min=(o,n)=>e.check(Wt(o,n)),e.max=(o,n)=>e.check(hr(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function FO(e){return nv(Xl,e)}var Ew=P("ZodArray",(e,t)=>{r_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Mv(e,r,o,n),e.element=t.element,Jl(e,"ZodArray",{min(r,o){return this.check(Zn(r,o))},nonempty(r){return this.check(Zn(1,r))},max(r,o){return this.check(qi(r,o))},length(r,o){return this.check(Ji(r,o))},unwrap(){return this.element}})});function Gl(e,t){return av(Ew,e,t)}function BO(e){let t=e._zod.def.shape;return zm(Object.keys(t))}var Yl=P("ZodObject",(e,t)=>{n_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uv(e,r,o,n),L.defineLazy(e,"shape",()=>t.shape),Jl(e,"ZodObject",{keyof(){return zm(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ga()})},loose(){return this.clone({...this._zod.def,catchall:ga()})},strict(){return this.clone({...this._zod.def,catchall:Rm()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return L.extend(this,r)},safeExtend(r){return L.safeExtend(this,r)},merge(r){return L.merge(this,r)},pick(r){return L.pick(this,r)},omit(r){return L.omit(this,r)},partial(...r){return L.partial(jm,this,r[0])},required(...r){return L.required(Dm,this,r[0])}})});function WO(e,t){let r={type:"object",shape:e??{},...L.normalizeParams(t)};return new Yl(r)}function KO(e,t){return new Yl({type:"object",shape:e,catchall:Rm(),...L.normalizeParams(t)})}function VO(e,t){return new Yl({type:"object",shape:e,catchall:ga(),...L.normalizeParams(t)})}var Ql=P("ZodUnion",(e,t)=>{ml.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bf(e,r,o,n),e.options=t.options});function Cm(e,t){return new Ql({type:"union",options:e,...L.normalizeParams(t)})}var Rw=P("ZodXor",(e,t)=>{Ql.init(e,t),o_.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bf(e,r,o,n),e.options=t.options});function qO(e,t){return new Rw({type:"union",options:e,inclusive:!1,...L.normalizeParams(t)})}var Cw=P("ZodDiscriminatedUnion",(e,t)=>{Ql.init(e,t),i_.init(e,t)});function JO(e,t,r){return new Cw({type:"union",options:t,discriminator:e,...L.normalizeParams(r)})}var zw=P("ZodIntersection",(e,t)=>{a_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Lv(e,r,o,n)});function Nw(e,t){return new zw({type:"intersection",left:e,right:t})}var jw=P("ZodTuple",(e,t)=>{Zp.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Zv(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Dw(e,t,r){let o=t instanceof ye,n=o?r:t,i=o?t:null;return new jw({type:"tuple",items:e,rest:i,...L.normalizeParams(n)})}var cu=P("ZodRecord",(e,t)=>{s_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fv(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function Mw(e,t,r){return!t||!t._zod?new cu({type:"record",keyType:Wl(),valueType:e,...L.normalizeParams(t)}):new cu({type:"record",keyType:e,valueType:t,...L.normalizeParams(r)})}function HO(e,t,r){let o=Je(e);return o._zod.values=void 0,new cu({type:"record",keyType:o,valueType:t,...L.normalizeParams(r)})}function XO(e,t,r){return new cu({type:"record",keyType:e,valueType:t,mode:"loose",...L.normalizeParams(r)})}var Uw=P("ZodMap",(e,t)=>{u_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>jv(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(_n(...r)),e.nonempty=r=>e.check(_n(1,r)),e.max=(...r)=>e.check(To(...r)),e.size=(...r)=>e.check(Vi(...r))});function GO(e,t,r){return new Uw({type:"map",keyType:e,valueType:t,...L.normalizeParams(r)})}var Lw=P("ZodSet",(e,t)=>{c_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dv(e,r,o,n),e.min=(...r)=>e.check(_n(...r)),e.nonempty=r=>e.check(_n(1,r)),e.max=(...r)=>e.check(To(...r)),e.size=(...r)=>e.check(Vi(...r))});function YO(e,t){return new Lw({type:"set",valueType:e,...L.normalizeParams(t)})}var lu=P("ZodEnum",(e,t)=>{l_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Sv(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let a of o)if(r.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new lu({...t,checks:[],...L.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let a of o)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new lu({...t,checks:[],...L.normalizeParams(n),entries:i})}});function zm(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new lu({type:"enum",entries:r,...L.normalizeParams(t)})}function QO(e,t){return new lu({type:"enum",entries:e,...L.normalizeParams(t)})}var Zw=P("ZodLiteral",(e,t)=>{d_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ov(e,r,o,n),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 e0(e,t){return new Zw({type:"literal",values:Array.isArray(e)?e:[e],...L.normalizeParams(t)})}var Fw=P("ZodFile",(e,t)=>{p_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ev(e,r,o,n),e.min=(r,o)=>e.check(_n(r,o)),e.max=(r,o)=>e.check(To(r,o)),e.mime=(r,o)=>e.check(Us(Array.isArray(r)?r:[r],o))});function t0(e){return sv(Fw,e)}var Bw=P("ZodTransform",(e,t)=>{f_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nv(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ao(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(L.issue(i,r.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(L.issue(a))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});function Nm(e){return new Bw({type:"transform",transform:e})}var jm=P("ZodOptional",(e,t)=>{Ki.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Vl(e){return new jm({type:"optional",innerType:e})}var Ww=P("ZodExactOptional",(e,t)=>{m_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Kw(e){return new Ww({type:"optional",innerType:e})}var Vw=P("ZodNullable",(e,t)=>{h_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bv(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ql(e){return new Vw({type:"nullable",innerType:e})}function r0(e){return Vl(ql(e))}var qw=P("ZodDefault",(e,t)=>{g_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kv(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Jw(e,t){return new qw({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():L.shallowClone(t)}})}var Hw=P("ZodPrefault",(e,t)=>{y_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vv(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Xw(e,t){return new Hw({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():L.shallowClone(t)}})}var Dm=P("ZodNonOptional",(e,t)=>{__.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wv(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Gw(e,t){return new Dm({type:"nonoptional",innerType:e,...L.normalizeParams(t)})}var Yw=P("ZodSuccess",(e,t)=>{v_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Rv(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function n0(e){return new Yw({type:"success",innerType:e})}var Qw=P("ZodCatch",(e,t)=>{b_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qv(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ex(e,t){return new Qw({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var tx=P("ZodNaN",(e,t)=>{w_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Pv(e,r,o,n)});function o0(e){return iv(tx,e)}var ed=P("ZodPipe",(e,t)=>{Fp.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jv(e,r,o,n),e.in=t.in,e.out=t.out});function fm(e,t){return new ed({type:"pipe",in:e,out:t})}var td=P("ZodCodec",(e,t)=>{ed.init(e,t),hl.init(e,t)});function i0(e,t,r){return new td({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function a0(e){let t=e._zod.def;return new td({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var rx=P("ZodPreprocess",(e,t)=>{ed.init(e,t),x_.init(e,t)}),nx=P("ZodReadonly",(e,t)=>{k_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hv(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ox(e){return new nx({type:"readonly",innerType:e})}var ix=P("ZodTemplateLiteral",(e,t)=>{A_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Tv(e,r,o,n)});function s0(e,t){return new ix({type:"template_literal",parts:e,...L.normalizeParams(t)})}var ax=P("ZodLazy",(e,t)=>{S_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gv(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function sx(e){return new ax({type:"lazy",getter:e})}var ux=P("ZodPromise",(e,t)=>{$_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xv(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function u0(e){return new ux({type:"promise",innerType:e})}var cx=P("ZodFunction",(e,t)=>{I_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>zv(e,r,o,n)});function c0(e){return new cx({type:"function",input:Array.isArray(e?.input)?Dw(e?.input):e?.input??Gl(ga()),output:e?.output??ga()})}var rd=P("ZodCustom",(e,t)=>{O_.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Cv(e,r,o,n)});function l0(e){let t=new Ke({check:"custom"});return t._zod.check=e,t}function d0(e,t){return uv(rd,e??(()=>!0),t)}function lx(e,t={}){return cv(rd,e,t)}function dx(e,t){return lv(e,t)}var p0=dv,f0=pv;function m0(e,t={}){let r=new rd({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...L.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var h0=(...e)=>fv({Codec:td,Boolean:mu,String:du},...e);function g0(e){let t=sx(()=>Cm([Wl(e),ww(),xw(),$w(),Gl(t),Mw(Wl(),t)]));return t}function y0(e,t){return new rx({type:"pipe",in:Nm(e),out:t})}var zD={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 ND(e){tt({customError:e})}function jD(){return tt().customError}var px;px||(px={});var q={...Fl,...sm,iso:uu},DD=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 MD(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function UD(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function _0(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 n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return q.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=UD(n,t),a=jt(i,t);return t.refs.set(n,a),t.processing.delete(n),a}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return q.null();if(n.length===0)return q.never();if(n.length===1)return q.literal(n[0]);if(n.every(a=>typeof a=="string"))return q.enum(n);let i=n.map(a=>q.literal(a));return i.length<2?i[0]:q.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return q.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let a={...e,type:i};return _0(a,t)});return n.length===0?q.never():n.length===1?n[0]:q.union(n)}if(!r)return q.any();let o;switch(r){case"string":{let n=q.string();if(e.format){let i=e.format;i==="email"?n=n.check(q.email()):i==="uri"||i==="uri-reference"?n=n.check(q.url()):i==="uuid"||i==="guid"?n=n.check(q.uuid()):i==="date-time"?n=n.check(q.iso.datetime()):i==="date"?n=n.check(q.iso.date()):i==="time"?n=n.check(q.iso.time()):i==="duration"?n=n.check(q.iso.duration()):i==="ipv4"?n=n.check(q.ipv4()):i==="ipv6"?n=n.check(q.ipv6()):i==="mac"?n=n.check(q.mac()):i==="cidr"?n=n.check(q.cidrv4()):i==="cidr-v6"?n=n.check(q.cidrv6()):i==="base64"?n=n.check(q.base64()):i==="base64url"?n=n.check(q.base64url()):i==="e164"?n=n.check(q.e164()):i==="jwt"?n=n.check(q.jwt()):i==="emoji"?n=n.check(q.emoji()):i==="nanoid"?n=n.check(q.nanoid()):i==="cuid"?n=n.check(q.cuid()):i==="cuid2"?n=n.check(q.cuid2()):i==="ulid"?n=n.check(q.ulid()):i==="xid"?n=n.check(q.xid()):i==="ksuid"&&(n=n.check(q.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?q.number().int():q.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=q.boolean();break}case"null":{o=q.null();break}case"object":{let n={},i=e.properties||{},a=new Set(e.required||[]);for(let[u,c]of Object.entries(i)){let l=jt(c,t);n[u]=a.has(u)?l:l.optional()}if(e.propertyNames){let u=jt(e.propertyNames,t),c=e.additionalProperties&&typeof e.additionalProperties=="object"?jt(e.additionalProperties,t):q.any();if(Object.keys(n).length===0){o=q.record(u,c);break}let l=q.object(n).passthrough(),d=q.looseRecord(u,c);o=q.intersection(l,d);break}if(e.patternProperties){let u=e.patternProperties,c=Object.keys(u),l=[];for(let p of c){let f=jt(u[p],t),h=q.string().regex(new RegExp(p));l.push(q.looseRecord(h,f))}let d=[];if(Object.keys(n).length>0&&d.push(q.object(n).passthrough()),d.push(...l),d.length===0)o=q.object({}).passthrough();else if(d.length===1)o=d[0];else{let p=q.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)p=q.intersection(p,d[f]);o=p}break}let s=q.object(n);e.additionalProperties===!1?o=s.strict():typeof e.additionalProperties=="object"?o=s.catchall(jt(e.additionalProperties,t)):o=s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=n.map(u=>jt(u,t)),s=i&&typeof i=="object"&&!Array.isArray(i)?jt(i,t):void 0;s?o=q.tuple(a).rest(s):o=q.tuple(a),typeof e.minItems=="number"&&(o=o.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(q.maxLength(e.maxItems)))}else if(Array.isArray(i)){let a=i.map(u=>jt(u,t)),s=e.additionalItems&&typeof e.additionalItems=="object"?jt(e.additionalItems,t):void 0;s?o=q.tuple(a).rest(s):o=q.tuple(a),typeof e.minItems=="number"&&(o=o.check(q.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(q.maxLength(e.maxItems)))}else if(i!==void 0){let a=jt(i,t),s=q.array(a);typeof e.minItems=="number"&&(s=s.min(e.minItems)),typeof e.maxItems=="number"&&(s=s.max(e.maxItems)),o=s}else o=q.array(q.any());break}default:throw new Error(`Unsupported type: ${r}`)}return o}function jt(e,t){if(typeof e=="boolean")return e?q.any():q.never();let r=_0(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let s=e.anyOf.map(c=>jt(c,t)),u=q.union(s);r=o?q.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let s=e.oneOf.map(c=>jt(c,t)),u=q.xor(s);r=o?q.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:q.any();else{let s=o?r:jt(e.allOf[0],t),u=o?0:1;for(let c=u;c<e.allOf.length;c++)s=q.intersection(s,jt(e.allOf[c],t));r=s}e.nullable===!0&&t.version==="openapi-3.0"&&(r=q.nullable(r)),e.readOnly===!0&&(r=q.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of i)s in e&&(n[s]=e[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in e&&(n[s]=e[s]);for(let s of Object.keys(e))DD.has(s)||(n[s]=e[s]);return Object.keys(n).length>0&&t.registry.add(r,n),e.description&&(r=r.describe(e.description)),r}function v0(e,t){if(typeof e=="boolean")return e?q.any():q.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=MD(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??je};return jt(r,i)}var fx={};Kr(fx,{bigint:()=>BD,boolean:()=>FD,date:()=>WD,number:()=>ZD,string:()=>LD});function LD(e){return R_(du,e)}function ZD(e){return L_(fu,e)}function FD(e){return q_(mu,e)}function BD(e){return H_(hu,e)}function WD(e){return ov(Xl,e)}tt(Bp());var cJ=oe({BaseToolkit:()=>KD,DynamicStructuredTool:()=>b0,DynamicTool:()=>gx,StructuredTool:()=>mx,Tool:()=>hx,ToolInputParsingException:()=>ws,isLangChainTool:()=>Gn,isRunnableToolLike:()=>Ll,isStructuredTool:()=>Ul,isStructuredToolParams:()=>Zl,tool:()=>nd}),mx=class extends am{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 r,o=Pe(Ui(this.defaultConfig,t));return bs(e)?(r=e.args,o={...o,toolCall:e}):r=e,this.call(r,o)}async call(e,t,r){let o=bs(e)?e.args:e,n;if(_t(this.schema))try{n=await zo(this.schema,o)}catch(f){let h="Received tool input did not match expected schema";throw this.verboseParsingErrors&&(h=`${h}
92
+ Details: ${f.message}`),Sf(f)&&(h=`${h}
93
+
94
+ ${V.prettifyError(f)}`),new ws(h,JSON.stringify(e))}else{let f=Ve(o,this.schema);if(!f.valid){let h="Received tool input did not match expected schema";throw this.verboseParsingErrors&&(h=`${h}
95
+ Details: ${f.errors.map(y=>`${y.keywordLocation}: ${y.error}`).join(`
96
+ `)}`),new ws(h,JSON.stringify(e))}n=o}let i=bp(t),a=mn.configure(i.callbacks,this.callbacks,i.tags||r,this.tags,i.metadata,this.metadata,{verbose:this.verbose}),s;bs(e)&&(s=e.id),!s&&UA(i)&&(s=i.toolCall.id);let u=await a?.handleToolStart(this.toJSON(),typeof e=="string"?e:JSON.stringify(e),i.runId,void 0,void 0,void 0,i.runName,s);delete i.runId;let c;try{let f=await this._call(n,u,i);c=Lb(f)?await cS(f,async h=>{try{await u?.handleToolEvent(h)}catch(y){await u?.handleToolError(y)}}):f}catch(f){throw await u?.handleToolError(f),f}let l,d;if(this.responseFormat==="content_and_artifact")if(Array.isArray(c)&&c.length===2)[l,d]=c;else throw new Error(`Tool response format is "content_and_artifact" but the output was not a two-tuple.
97
+ Result: ${JSON.stringify(c)}`);else l=c;let p=qD({content:l,artifact:d,toolCallId:s,name:this.name,metadata:this.metadata});return await u?.handleToolEnd(p),p}},hx=class extends mx{schema=Vt.object({input:Vt.string().optional()}).transform(e=>e.input);constructor(e){super(e)}call(e,t){let r=typeof e=="string"||e==null?{input:e}:e;return super.call(r,t)}},gx=class extends hx{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 r=bp(t);return r.runName===void 0&&(r.runName=this.name),super.call(e,r)}_call(e,t,r){return this.func(e,t,r)}},b0=class extends mx{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,r){let o=bp(t);return o.runName===void 0&&(o.runName=this.name),super.call(e,o,r)}_call(e,t,r){return this.func(e,t,r)}},KD=class{getTools(){return this.tools}};function nd(e,t){let r=Js(t.schema),o=ou(t.schema);if(!t.schema||r||o)return new gx({...t,description:t.description??t.schema?.description??`${t.name} tool`,func:async(a,s,u)=>new Promise((c,l)=>{let d=De(u,{callbacks:s?.getChild()});Qt.runWithConfig(Ft(d),async()=>{try{c(e(a,d))}catch(p){l(p)}})})});let n=t.schema,i=t.description??t.schema.description??`${t.name} tool`;return new b0({...t,description:i,schema:n,func:async(a,s,u)=>new Promise((c,l)=>{let d,p=()=>{u?.signal&&d&&u.signal.removeEventListener("abort",d)};u?.signal&&(d=()=>{p(),l(ko(u.signal))},u.signal.addEventListener("abort",d,{once:!0}));let f=De(u,{callbacks:s?.getChild()});Qt.runWithConfig(Ft(f),async()=>{try{let h=await e(a,f);if(Lb(h)){c(h);return}if(u?.signal?.aborted){p();return}p(),c(h)}catch(h){p(),l(h)}})})})}function VD(e){return typeof e=="object"&&e!==null&&"type"in e}function qD(e){let{content:t,artifact:r,toolCallId:o,metadata:n}=e;return o&&!mp(t)?typeof t=="string"||Array.isArray(t)&&t.every(VD)?new Ar({status:"success",content:t,artifact:r,tool_call_id:o,name:e.name,metadata:n}):new Ar({status:"success",content:JD(t),artifact:r,tool_call_id:o,name:e.name,metadata:n}):t}function JD(e){try{return JSON.stringify(e)??""}catch{return`${e}`}}function od(e,t){return e.lc_error_code=t,e.message=`${e.message}
98
+
99
+ Troubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${t}/
100
+ `,e}function z(e,t,r,o,n){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?n.call(e,r):n?n.value=r:t.set(e,r),r}function m(e,t,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(e):o?o.value:t.get(e)}var Wo=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return Wo=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,o=>(+o^r()&15>>+o/4).toString(16))};function Yn(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}var id=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)};var k=class extends Error{},qe=class e extends k{constructor(t,r,o,n){super(`${e.makeMessage(t,r,o)}`),this.status=t,this.headers=n,this.requestID=n?.get("x-request-id"),this.error=r;let i=r;this.code=i?.code,this.param=i?.param,this.type=i?.type}static makeMessage(t,r,o){let n=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):o;return t&&n?`${t} ${n}`:t?`${t} status code (no body)`:n||"(no status code or body)"}static generate(t,r,o,n){if(!t||!n)return new Rr({message:o,cause:id(r)});let i=r?.error;return t===400?new Ko(t,i,o,n):t===401?new Vo(t,i,o,n):t===403?new qo(t,i,o,n):t===404?new Jo(t,i,o,n):t===409?new Ho(t,i,o,n):t===422?new Xo(t,i,o,n):t===429?new Go(t,i,o,n):t>=500?new Yo(t,i,o,n):new e(t,i,o,n)}},$e=class extends qe{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}},Rr=class extends qe{constructor({message:t,cause:r}){super(void 0,void 0,t||"Connection error.",void 0),r&&(this.cause=r)}},ot=class extends Rr{constructor({message:t}={}){super({message:t??"Request timed out."})}},Ko=class extends qe{},Vo=class extends qe{},qo=class extends qe{},Jo=class extends qe{},Ho=class extends qe{},Xo=class extends qe{},Go=class extends qe{},Yo=class extends qe{},Qo=class extends k{constructor(){super("Could not parse response content as the length limit was reached")}},ei=class extends k{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},ar=class extends Error{constructor(t){super(t)}},Cr=class extends qe{constructor(t,r,o){let n="OAuth2 authentication error",i;if(r&&typeof r=="object"){let a=r;i=a.error;let s=a.error_description;s&&typeof s=="string"?n=s:i&&(n=i)}super(t,r,n,o),this.error_code=i}},_a=class extends k{constructor(t,r,o){super(t),this.provider=r,this.cause=o}};var XD=/^[a-z][a-z0-9+.-]*:/i,w0=e=>XD.test(e),Dt=e=>(Dt=Array.isArray,Dt(e)),yx=Dt;function Mm(e){return typeof e!="object"?{}:e??{}}function _x(e){if(!e)return!0;for(let t in e)return!1;return!0}function ie(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zr(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}var vx=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new k(`${e} must be an integer`);if(t<0)throw new k(`${e} must be a positive integer`);return t};var x0=e=>{try{return JSON.parse(e)}catch{return}};var gu=e=>new Promise(t=>setTimeout(t,e));function ad(){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 bx(...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 sd(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return bx({start(){},async pull(r){let{done:o,value:n}=await t.next();o?r.close():r.enqueue(n)},async cancel(){await t.return?.()}})}function Um(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let r=await t.read();return r?.done&&t.releaseLock(),r}catch(r){throw t.releaseLock(),r}},async return(){let r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function Qn(e){if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),r=t.cancel();t.releaseLock(),await r}var A0;function Pt(e){let t;return(A0??(t=new globalThis.TextEncoder,A0=t.encode.bind(t)))(e)}var I0;function $0(e){let t;return(I0??(t=new globalThis.TextDecoder,I0=t.decode.bind(t)))(e)}var wx,pt,et,ct,Pn,va,O0,ud=64*1024,ba=class{constructor(){wx.add(this),pt.set(this,void 0),et.set(this,void 0),ct.set(this,void 0),Pn.set(this,void 0),va.set(this,void 0),z(this,pt,new Uint8Array,"f"),z(this,et,0,"f"),z(this,ct,0,"f"),z(this,Pn,0,"f"),z(this,va,!1,"f")}decode(t){if(t==null)return[];let r;if(t instanceof ArrayBuffer?r=new Uint8Array(t):typeof t=="string"?r=Pt(t):r=t,r.length===0)return[];if(m(this,va,"f")&&(z(this,va,!1,"f"),r[0]===10&&(r=r.subarray(1)),r.length===0))return[];m(this,wx,"m",O0).call(this,r);let o=[],n;for(;(n=GD(m(this,pt,"f"),m(this,Pn,"f"),m(this,ct,"f")))!=null;){let i=$0(m(this,pt,"f").subarray(m(this,et,"f"),n.preceding));o.push(i),z(this,et,n.index,"f"),n.carriage&&(m(this,et,"f")<m(this,ct,"f")&&m(this,pt,"f")[m(this,et,"f")]===10?z(this,et,m(this,et,"f")+1,"f"):m(this,et,"f")===m(this,ct,"f")&&z(this,va,!0,"f")),z(this,Pn,m(this,et,"f"),"f")}if(z(this,Pn,m(this,ct,"f"),"f"),m(this,et,"f")===m(this,ct,"f"))z(this,et,0,"f"),z(this,ct,0,"f"),z(this,Pn,0,"f"),m(this,pt,"f").length>ud&&z(this,pt,new Uint8Array,"f");else if(o.length>0&&m(this,pt,"f").length>ud){let i=m(this,ct,"f")-m(this,et,"f");if(i<=ud||m(this,pt,"f").length>i*4){let a=i<=ud?Math.min(Math.max(i*2,256),ud):i*2,s=new Uint8Array(a);s.set(m(this,pt,"f").subarray(m(this,et,"f"),m(this,ct,"f"))),z(this,pt,s,"f"),z(this,et,0,"f"),z(this,ct,i,"f"),z(this,Pn,i,"f")}}return o}flush(){return z(this,va,!1,"f"),m(this,et,"f")===m(this,ct,"f")?[]:this.decode(`
101
+ `)}};pt=new WeakMap,et=new WeakMap,ct=new WeakMap,Pn=new WeakMap,va=new WeakMap,wx=new WeakSet,O0=function(t){if(m(this,ct,"f")+t.length>m(this,pt,"f").length){let r=m(this,ct,"f")-m(this,et,"f");if(m(this,et,"f")>=m(this,pt,"f").length/2&&r+t.length<=m(this,pt,"f").length)m(this,pt,"f").copyWithin(0,m(this,et,"f"),m(this,ct,"f"));else{let o=Math.max(m(this,pt,"f").length*2,r+t.length,256),n=new Uint8Array(o);n.set(m(this,pt,"f").subarray(m(this,et,"f"),m(this,ct,"f"))),z(this,pt,n,"f")}z(this,Pn,m(this,Pn,"f")-m(this,et,"f"),"f"),z(this,ct,r,"f"),z(this,et,0,"f")}m(this,pt,"f").set(t,m(this,ct,"f")),z(this,ct,m(this,ct,"f")+t.length,"f")};ba.NEWLINE_CHARS=new Set([`
102
+ `,"\r"]);ba.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function GD(e,t,r){for(let i=t;i<r;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 P0(e){for(let t=0;t<e.length-1;t++){let r=S0(e,t);if(r>0){let o=t+r,n=S0(e,o);if(n>0)return o+n}}return-1}function S0(e,t){return e[t]===10?1:e[t]===13?e[t+1]===10?2:1:0}var Zm={off:0,error:200,warn:300,info:400,debug:500},xx=(e,t,r)=>{if(e){if(ie(Zm,e))return e;lt(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Zm))}`)}};function cd(){}function Lm(e,t,r){return!t||Zm[e]>Zm[r]?cd:t[e].bind(t)}var YD={error:cd,warn:cd,info:cd,debug:cd},T0=new WeakMap;function lt(e){let t=e.logger,r=e.logLevel??"off";if(!t)return YD;let o=T0.get(t);if(o&&o[0]===r)return o[1];let n={error:Lm("error",t,r),warn:Lm("warn",t,r),info:Lm("info",t,r),debug:Lm("debug",t,r)};return T0.set(t,[r,n]),n}var E0=new Set(["apikey","accesstoken","refreshtoken","sessiontoken","sessionid","idtoken","authtoken","authorization","token","password","clientsecret","xamzsecuritytoken","xamzsignature","xamzcredential"]);function ld(e){let t=e.toLowerCase().replace(/[-_]/gu,"");return E0.has(t)||E0.has(t.replace(/^x/u,""))}var QD=new Set(["authorization","proxy-authorization","api-key","x-api-key","x-amz-security-token","cookie","set-cookie","x-session-token","x-session-id","x-auth-token","x-id-token"]);function Bm(e){return QD.has(e.toLowerCase().replace(/_/gu,"-"))||ld(e)}function Fm(e){let t=new URL(e);t.username="",t.password="",t.hash="";for(let r of t.searchParams.keys())ld(r)&&t.searchParams.set(r,"***");return t.href}var eo=e=>{if(e.options){if(e.options={...e.options},delete e.options.headers,e.options.path){let t=e.options.path,r=new URL(Fm(new URL(t,"https://redacted.invalid").href));e.options.path=r.origin==="https://redacted.invalid"?`${t.startsWith("/")?"/":""}${r.pathname.slice(1)}${r.search}`:r.href}e.options.query&&(e.options.query=Object.fromEntries(Object.entries(e.options.query).map(([t,r])=>[t,ld(t)?"***":r])))}return e.url&&(e.url=Fm(e.url)),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,r])=>[t,Bm(t)?"***":r]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e};var dd;function R0(){let e=[],t=0;return{get length(){return e.length-t},enqueue(r){e.push(r)},dequeue(){if(t===e.length)return;let r=e[t];return e[t]=void 0,t+=1,t===e.length?(e=[],t=0):t>=1024&&t*2>=e.length&&(e=e.slice(t),t=0),r}}}var sr=class e{constructor(t,r,o){dd.set(this,void 0),this.iterator=t,this.controller=r,z(this,dd,o,"f")}static fromSSEResponse(t,r,o,n){let i=!1,a=o?lt(o):console;async function*s(){if(i)throw new k("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let u=!1,c=!1;try{for await(let l of t4(t,r)){if(l.data==="[DONE]"){c=!0;break}if(l.event===null||!l.event.startsWith("thread.")){let d;try{d=JSON.parse(l.data)}catch{throw a.error("Could not parse message into JSON:"),a.error("From chunk:"),new SyntaxError("Error reading response: malformed server-sent event JSON.")}if(l.event==="error")throw new qe(void 0,d?.error??d,void 0,t.headers);if(d&&d.error)throw new qe(void 0,d.error,void 0,t.headers);yield n?{event:l.event,data:d}:d}else{let d;try{d=JSON.parse(l.data)}catch{throw a.error("Could not parse message into JSON:"),a.error("From chunk:"),new SyntaxError("Error reading response: malformed server-sent event JSON.")}yield{event:l.event,data:d}}}u=!0}catch(l){if(c||Yn(l)||r.signal.aborted&&l===r.signal.reason)return;throw l}finally{u||r.abort()}}return new e(s,r,o)}static fromReadableStream(t,r,o){let n=!1;async function*i(){let s=new ba,u=t.getReader(),c=!1,l,d=()=>{l??(l=u.cancel()),l.catch(()=>{})};r.signal.addEventListener("abort",d,{once:!0});try{if(r.signal.aborted){d();return}for(;;){let{value:p,done:f}=await u.read();if(f){c=!0;break}if(r.signal.aborted)return;for(let h of s.decode(p)){if(r.signal.aborted)return;yield h}}if(r.signal.aborted)return;for(let p of s.flush()){if(r.signal.aborted)return;yield p}}finally{r.signal.removeEventListener("abort",d),c||d(),u.releaseLock()}}async function*a(){if(n)throw new k("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let s=!1;try{for await(let u of i())if(!s&&u){let c;try{c=JSON.parse(u)}catch(l){throw l instanceof SyntaxError?new SyntaxError("Error reading response: malformed newline-delimited JSON."):l}yield c}s=!0}catch(u){if(r.signal.aborted||Yn(u))return;throw u}finally{s||r.abort()}}return new e(a,r,o)}[(dd=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=R0(),r=R0(),o=this.iterator(),n=i=>({next:()=>{if(i.length===0){let a=o.next();t.enqueue(a),r.enqueue(a)}return i.dequeue()}});return[new e(()=>n(t),this.controller,m(this,dd,"f")),new e(()=>n(r),this.controller,m(this,dd,"f"))]}toReadableStream(){let t;return bx({start:async()=>{t=this[Symbol.asyncIterator]()},async pull(r){try{let{value:o,done:n}=await t.next();if(n)return r.close();let i=Pt(JSON.stringify(o)+`
103
+ `);r.enqueue(i)}catch(o){r.error(o)}},async cancel(){await t.return?.()}})}};function e4(e,t){let r=typeof e.getReader=="function"?e.getReader():void 0,o=r?{next:()=>r.read(),return:()=>r.cancel()}:Um(e)[Symbol.asyncIterator](),n={value:void 0,done:!0},i=!1,a=!1,s,u,c=()=>new Promise(f=>{u=f}),l=()=>{if(a||i)return s;a=!0;try{s=Promise.resolve(o.return?.())}catch(f){s=Promise.reject(f)}return s.catch(()=>{}),s},d=()=>{queueMicrotask(()=>{u?.(),l()})};return{iterator:{async next(){if(t.aborted)return n;let f=c().then(()=>n);try{let h=await Promise.race([o.next(),f]);return t.aborted?n:h.done?(i=!0,n):{value:h.value,done:!1}}catch(h){if(t.aborted&&(Yn(h)||h===t.reason))return n;throw h}finally{u=void 0}},async return(){let f=l();if(f&&!t.aborted){let h=c();try{t.aborted||await Promise.race([f,h])}finally{u=void 0}}return n},[Symbol.asyncIterator](){return this}},start(){t.addEventListener("abort",d,{once:!0}),t.aborted&&d()},async cleanup(f){let h;try{t.removeEventListener("abort",d)}catch(y){h=y}if(!i){let y=l();if(y&&!f&&!t.aborted)try{await y}catch(_){h??(h=_)}}if(r)try{r.releaseLock()}catch(y){h??(h=y)}if(h!==void 0&&!f&&!t.aborted)throw h}}}async function*t4(e,t){if(!e.body)throw t.abort(),globalThis.navigator!==void 0&&globalThis.navigator.product==="ReactNative"?new k("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 k("Attempted to iterate over a response with no body");let r=new kx,o=new ba,{signal:n}=t,i=e4(e.body,n),a=!1;try{i.start();for await(let s of n4(i.iterator)){if(n.aborted)return;for(let u of o.decode(s)){if(n.aborted)return;let c=r.decode(u);c&&(yield c)}}if(n.aborted)return;for(let s of o.flush()){if(n.aborted)return;let u=r.decode(s);u&&(yield u)}}catch(s){if(a=!0,!n.aborted||!Yn(s)&&s!==n.reason)throw s}finally{await i.cleanup(a)}}var r4=3;async function*n4(e){let t=new Uint8Array,r=0,o=0,n=0;for await(let i of e){if(i==null)continue;let a;if(i instanceof ArrayBuffer?a=new Uint8Array(i):typeof i=="string"?a=Pt(i):a=i,o+a.length>t.length){let u=o-r;if(r>=t.length/2&&u+a.length<=t.length)t.copyWithin(0,r,o);else{let c=new Uint8Array(Math.max(t.length*2,u+a.length));c.set(t.subarray(r,o)),t=c}n-=r,r=0,o=u}t.set(a,o),o+=a.length;let s;for(;(s=P0(t.subarray(n,o)))!==-1;)s+=n,yield t.slice(r,s),r=s,n=r;n=Math.max(r,o-r4)}o>r&&(yield t.slice(r,o))}var kx=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.slice(0,-1)),!t){if(!this.event&&!this.data.length)return null;let i={event:this.event,data:this.data.join(`
104
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],i}if(this.chunks.push(t),t.startsWith(":"))return null;let[r,,o]=o4(t,":"),n=o;return n.startsWith(" ")&&(n=n.slice(1)),r==="event"?this.event=n:r==="data"&&this.data.push(n),null}};function o4(e,t){let r=e.indexOf(t);return r!==-1?[e.slice(0,r),t,e.slice(r+t.length)]:[e,"",""]}async function wa(e,t){let{response:r,requestLogID:o,retryOfRequestLogID:n,startTime:i}=t,a=await(async()=>{if(t.options.stream)return lt(e).debug("response",r.status,r.url,r.headers,r.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(r,t.controller,e,t.options.__synthesizeEventData):sr.fromSSEResponse(r,t.controller,e,t.options.__synthesizeEventData);if(r.status===204)return null;if(t.options.__binaryResponse)return r;let u=r.headers.get("content-type")?.split(";")[0]?.trim();if(u?.includes("application/json")||u?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let p=await r.text();if(!p)return;let f=JSON.parse(p);return pd(f,r)}return await r.text()})().catch(s=>{throw i4(s,t.controller.signal)});return lt(e).debug(`[${o}] response parsed`,eo({retryOfRequestLogID:n,url:r.url,status:r.status,body:a,durationMs:Date.now()-i})),a}function i4(e,t){if(!t.aborted||e!==t.reason||Yn(e))return e;let r="This operation was aborted",o=globalThis.DOMException;return typeof o=="function"?new o(r,"AbortError"):Object.assign(new Error(r),{name:"AbortError"})}function pd(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 ti="7.10.0";var j0=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function a4(){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 s4=()=>{let e=a4();if(e==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ti,"X-Stainless-OS":z0(Deno.build.os),"X-Stainless-Arch":C0(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":ti,"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":ti,"X-Stainless-OS":z0(globalThis.process.platform??"unknown"),"X-Stainless-Arch":C0(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let t=u4();return t?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ti,"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":ti,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function u4(){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:r}of e){let o=r.exec(navigator.userAgent);if(o){let n=o[1]||0,i=o[2]||0,a=o[3]||0;return{browser:t,version:`${n}.${i}.${a}`}}}return null}var C0=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",z0=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"),N0,D0=()=>N0??(N0=s4());var fd=new WeakMap;function M0(e,t){let r=fd.get(e);return r||(r=new Set,fd.set(e,r)),r.add(t),()=>{let o=fd.get(e);o&&(o.delete(t),o.size===0&&fd.delete(e))}}var U0=({headers:e,body:t})=>{let r=typeof t=="object"&&t!==null?fd.get(t):void 0,o;if(!r||r.size===0)o=JSON.stringify(t);else{let n=[...r];o=JSON.stringify(t,function(i,a){let s=a;for(let u of n){let c=u.value(this,i,s);c!==void 0&&(s=c)}return s});for(let i of n)i.complete()}return{bodyHeaders:{"content-type":"application/json"},body:o}};var Ax="RFC3986",Ix=String,$x={RFC1738:e=>String(e).replace(/%20/g,"+"),RFC3986:Ix},L0="RFC1738";var Z0,F0=(e,t)=>{let r=Z0??Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty);return Z0=r,r(e,t)};var Tn=(()=>{let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})();var Sx=1024,B0=(e,t,r,o,n)=>{if(e.length===0)return e;let i=e;if(typeof e=="symbol"?i=Symbol.prototype.toString.call(e):typeof e!="string"&&(i=String(e)),r==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,s=>"%26%23"+Number.parseInt(s.slice(2),16)+"%3B");let a="";for(let s=0;s<i.length;){let u=Math.min((Math.floor(s/Sx)+1)*Sx,i.length);u<i.length&&i.codePointAt(u-1)>65535&&(u+=1);let c=i.length>=Sx?i.slice(s,u):i,l=[];for(let d=0;d<c.length;++d){let p=c.charCodeAt(d);if(p===45||p===46||p===95||p===126||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||n===L0&&(p===40||p===41)){l[l.length]=c.charAt(d);continue}if(p<128){l[l.length]=Tn[p];continue}if(p<2048){l[l.length]=Tn[192|p>>6]+Tn[128|p&63];continue}if(p<55296||p>=57344){l[l.length]=Tn[224|p>>12]+Tn[128|p>>6&63]+Tn[128|p&63];continue}d+=1,p=65536+((p&1023)<<10|c.charCodeAt(d)&1023),l[l.length]=Tn[240|p>>18]+Tn[128|p>>12&63]+Tn[128|p>>6&63]+Tn[128|p&63]}a+=l.join(""),s=u}return a};function W0(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function Ox(e,t){if(Dt(e)){let r=[];for(let o of e)r.push(t(o));return r}return t(e)}var V0={brackets(e){return String(e)+"[]"},comma:"comma",indices(e,t){return String(e)+"["+t+"]"},repeat(e){return String(e)}},q0=function(t,r){Array.prototype.push.apply(t,Dt(r)?r:[r])},K0,vt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:B0,encodeValuesOnly:!1,format:Ax,formatter:Ix,indices:!1,serializeDate(e){return(K0??(K0=Function.prototype.call.bind(Date.prototype.toISOString)))(e)},skipNulls:!1,strictNullHandling:!1};function l4(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"}var Px={};function J0(e,t,r,o,n,i,a,s,u,c,l,d,p,f,h,y,_,$){let v=e,x=$,S=0,C=!1;for(;(x=x.get(Px))!==void 0&&!C;){let W=x.get(e);if(S+=1,W!==void 0){if(W===S)throw new RangeError("Cyclic object value");C=!0}x.get(Px)===void 0&&(S=0)}if(typeof c=="function"?v=c(t,v):v instanceof Date?v=p?.(v):r==="comma"&&Dt(v)&&(v=Ox(v,W=>W instanceof Date?p?.(W):W)),v===null){if(i)return u&&!y?u(t,vt.encoder,_,"key",f):t;v=""}if(l4(v)||W0(v)){if(u){let W=y?t:u(t,vt.encoder,_,"key",f);return[h?.(W)+"="+h?.(u(v,vt.encoder,_,"value",f))]}return[h?.(t)+"="+h?.(String(v))]}let j=[];if(v===void 0)return j;let F;if(r==="comma"&&Dt(v))y&&u&&(v=Ox(v,u)),F=[{value:v.length>0?v.join(",")||null:void 0}];else if(Dt(c))F=c;else{let W=Object.keys(v);l&&W.sort(l),F=W}let A=s?String(t).replace(/\./g,"%2E"):String(t),G=o&&Dt(v)&&v.length===1?A+"[]":A;if(n&&Dt(v)&&v.length===0)return G+"[]";for(let W of F){let R=typeof W=="object"&&W.value!==void 0?W.value:v[W];if(a&&R===null)continue;let Y=d&&s?W.replace(/\./g,"%2E"):W,ne;Dt(v)?ne=typeof r=="function"?r(G,Y):G:ne=G+(d?"."+Y:"["+Y+"]"),$.set(e,S);let pe=new WeakMap([[Px,$]]);q0(j,J0(R,ne,r,o,n,i,a,s,r==="comma"&&y&&Dt(v)?null:u,c,l,d,p,f,h,y,_,pe))}return j}function d4(e=vt){if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(e.encodeDotInKeys!==void 0&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");let t=e.charset||vt.charset;if(e.charset!==void 0&&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 r=Ax;if(e.format!==void 0){if(!F0($x,e.format))throw new TypeError("Unknown format option provided.");r=e.format}let o=$x[r],n=vt.filter;(typeof e.filter=="function"||Dt(e.filter))&&(n=e.filter);let i;if(e.arrayFormat&&e.arrayFormat in V0?i=e.arrayFormat:"indices"in e?i=e.indices?"indices":"repeat":i=vt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");let a;return e.allowDots===void 0?a=e.encodeDotInKeys?!0:vt.allowDots:a=!!e.allowDots,{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:vt.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:vt.allowEmptyArrays,arrayFormat:i,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:vt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:e.delimiter===void 0?vt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:vt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:vt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:vt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:vt.encodeValuesOnly,filter:n,format:r,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:vt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:vt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:vt.strictNullHandling}}function H0(e,t={}){let r=e,o=d4(t),n,i;typeof o.filter=="function"?(i=o.filter,r=i("",r)):Dt(o.filter)&&(i=o.filter,n=i);let a=[];if(typeof r!="object"||r===null)return"";let s=V0[o.arrayFormat],u=s==="comma"&&o.commaRoundTrip;n||(n=Object.keys(r)),o.sort&&n.sort(o.sort);let c=new WeakMap;for(let p of n)o.skipNulls&&r[p]===null||q0(a,J0(r[p],p,s,u,o.allowEmptyArrays,o.strictNullHandling,o.skipNulls,o.encodeDotInKeys,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,c));let l=a.join(o.delimiter),d=o.addQueryPrefix===!0?"?":"";return o.charsetSentinel&&(d+=o.charset==="iso-8859-1"?"utf8=%26%2310003%3B&":"utf8=%E2%9C%93&"),l.length>0?d+l:""}function X0(e){return H0(e,{arrayFormat:"brackets"})}var f4=new Map([["global","https://api.openai.com/v1"],["us","https://us.api.openai.com/v1"],["eu","https://eu.api.openai.com/v1"],["ae","https://ae.api.openai.com/v1"]]);function Tx(e){if(e.dataResidency===null||e.dataResidency===void 0)return;if(ie(e,"baseURL"))throw new k("The `dataResidency` and `baseURL` options are mutually exclusive.");let t=f4.get(e.dataResidency);if(t===void 0)throw new k("Invalid `dataResidency`; expected one of: global, us, eu, ae.");return t}var md,xa=class e extends Promise{constructor(t,r,o=wa){super(n=>{n(null)}),this.responsePromise=r,this.parseResponse=o,md.set(this,void 0),z(this,md,t,"f")}_thenUnwrap(t){return new e(m(this,md,"f"),this.responsePromise,async(r,o)=>pd(t(await this.parseResponse(r,o),o),o.response))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){let[t,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:r,request_id:r.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(m(this,md,"f"),t))),this.parsedPromise}then(t,r){return this.parse().then(t,r)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}};md=new WeakMap;var Wm,yu=class{constructor(t,r,o,n){Wm.set(this,void 0),z(this,Wm,t,"f"),this.options=n,this.response=r,this.body=o}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let t=this.nextPageRequestOptions();if(!t)throw new k("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await m(this,Wm,"f").requestAPIList(this.constructor,t)}async*iterPages(){let t=this;for(yield t;t.hasNextPage();)t=await t.getNextPage(),yield t}async*[(Wm=new WeakMap,Symbol.asyncIterator)](){for await(let t of this.iterPages())for(let r of t.getPaginatedItems())yield r}},hd=class extends xa{constructor(t,r,o){super(t,r,async(n,i)=>new o(n,i.response,await wa(n,i),i.options))}async*[Symbol.asyncIterator](){let t=await this;for await(let r of t)yield r}},Mt=class extends yu{constructor(t,r,o,n){super(t,r,o,n),this.data=o.data||[],this.object=o.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}},de=class extends yu{constructor(t,r,o,n){super(t,r,o,n),this.data=o.data||[],this.has_more=o.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let t=this.getPaginatedItems(),r=t[t.length-1]?.id;return r?{...this.options,query:{...Mm(this.options.query),after:r}}:null}},Ee=class extends yu{constructor(t,r,o,n){super(t,r,o,n),this.data=o.data||[],this.has_more=o.has_more||!1,this.last_id=o.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:{...Mm(this.options.query),after:t}}:null}},ft=class extends yu{constructor(t,r,o,n){super(t,r,o,n),this.data=o.data||[],this.has_more=o.has_more||!1,this.next=o.next||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let t=this.next;return t?{...this.options,query:{...Mm(this.options.query),after:t}}:null}};var h4={jwt:"urn:ietf:params:oauth:token-type:jwt",id:"urn:ietf:params:oauth:token-type:id_token"},g4="urn:ietf:params:oauth:grant-type:token-exchange",y4=.5;function _4(e,t,r){let o=(r??1200)*1e3,n=Math.min(o,(e-t)*y4);return e-n}var G0=Response.prototype,v4=G0.arrayBuffer;function b4(e,t){let r=Object.getOwnPropertyDescriptor(t,"constructor")?.value;if(t===e||typeof r!="function"||Object.getOwnPropertyDescriptor(r,"name")?.value!=="Response"||Object.getOwnPropertyDescriptor(r,"prototype")?.value!==t)return!1;let o=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag);return(o?.value==="Response"||typeof o?.get=="function")&&typeof Object.getOwnPropertyDescriptor(t,"headers")?.get=="function"&&typeof Object.getOwnPropertyDescriptor(t,"ok")?.get=="function"&&typeof Object.getOwnPropertyDescriptor(t,"status")?.get=="function"}function w4(e,t){if(e===t)return!0;let r=Object.getOwnPropertyDescriptor(e,"constructor")?.value;return t!==null&&Object.getPrototypeOf(t)===e&&typeof r=="function"&&Object.getOwnPropertyDescriptor(r,"name")?.value==="Body"&&Object.getOwnPropertyDescriptor(r,"prototype")?.value===e}function x4(e){let t=globalThis;return new TextDecoder("utf-8",{ignoreBOM:typeof t.Bun?.version=="string"}).decode(e)}async function k4(e){let t,r=null;for(let n=0,i=e;i!==null&&n<16&&i!==G0;i=Object.getPrototypeOf(i),n+=1){b4(e,i)&&(r=i);let a=Object.getOwnPropertyDescriptor(i,"json");if(!a)continue;if(typeof a.value!="function")break;let s=Object.getOwnPropertyDescriptor(i,"text")?.value;if(typeof s=="function"&&w4(i,r)){t=s;break}return a.value.call(e)}let o=t===void 0?x4(await v4.call(e)):await t.call(e);try{return JSON.parse(o)}catch{throw new SyntaxError("Token exchange response contains invalid JSON")}}function A4(e){return typeof globalThis.Bun?.version=="string"?/[^\t\u0020-\u007E]|^[\t ]|[\t ]$/u.test(e):/[^\t\u0020-\u007E\u0080-\u00FF]|^[\t ]|[\t ]$/u.test(e)}var Km=class e{constructor(t,r){this.cachedToken=null,this.refreshPromise=null,this.tokenGeneration=0,this.tokenExchangeUrl="https://auth.openai.com/oauth/token";let{identityProviderId:o,serviceAccountId:n,clientId:i,refreshBufferSeconds:a,provider:s}=t;this.config={identityProviderId:o,serviceAccountId:n,...i===void 0?{}:{clientId:i},...a===void 0?{}:{refreshBufferSeconds:a},provider:{tokenType:s.tokenType,getToken:s.getToken.bind(s)}},this.fetch=r??ad()}async getToken(){if(!this.cachedToken||e.isTokenExpired(this.cachedToken)){if(this.refreshPromise)return await this.refreshPromise;let t=this.refreshToken(this.tokenGeneration);this.refreshPromise=t;try{return await t}finally{this.refreshPromise===t&&(this.refreshPromise=null)}}if(e.needsRefresh(this.cachedToken)&&!this.refreshPromise){let t=this.refreshToken(this.tokenGeneration).finally(()=>{this.refreshPromise===t&&(this.refreshPromise=null)});this.refreshPromise=t,t.catch(()=>null)}return this.cachedToken.token}async refreshToken(t){let r=await this.config.provider.getToken(),o={grant_type:g4,subject_token:r,subject_token_type:h4[this.config.provider.tokenType],identity_provider_id:this.config.identityProviderId,service_account_id:this.config.serviceAccountId};this.config.clientId&&(o.client_id=this.config.clientId);let n=await this.fetch(this.tokenExchangeUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o),redirect:"manual"});if(!n.ok){let l=await n.text(),d;try{d=JSON.parse(l)}catch{}throw n.status===400||n.status===401||n.status===403?new Cr(n.status,d,n.headers):qe.generate(n.status,d,`Token exchange failed with status ${n.status}`,n.headers)}let i=await k4(n),a=typeof i=="object"&&i!==null&&"access_token"in i?i.access_token:void 0;if(typeof a!="string"||a.trim().length===0||A4(a))throw new k("Token exchange response missing 'access_token' field");let s=i.expires_in??3600;if(typeof s!="number"||!Number.isFinite(s)||s<=0)throw new k("Token exchange response has invalid 'expires_in' field");let u=Date.now(),c=u+s*1e3;if(!Number.isSafeInteger(c)||c<=u)throw new k("Token exchange response has invalid 'expires_in' field");return this.tokenGeneration===t&&(this.cachedToken={token:a,expiresAt:c,refreshAt:_4(c,u,this.config.refreshBufferSeconds)}),a}static isTokenExpired(t){return Date.now()>=t.expiresAt}static needsRefresh(t){return Date.now()>=t.refreshAt}invalidateToken(){this.tokenGeneration+=1,this.cachedToken=null,this.refreshPromise=null}};var Y0="https://mtls.api.openai.com/v1";function _u(e){let t;try{t=new URL(e)}catch{throw new k("X.509 workload identity requires the approved global mTLS API origin.")}if(t.origin!=="https://mtls.api.openai.com"||t.username||t.password)throw new k("X.509 workload identity requires the approved global mTLS API origin.");for(let r of t.searchParams.keys())if(ld(r))throw new k("X.509 workload identity cannot send conflicting query authentication credentials.");return t}var Q0=Symbol("brand.privateNullableHeaders"),I4=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function*$4(e){if(!e)return;if(Q0 in e){let{values:o,nulls:n}=e;yield*o.entries();for(let i of n)yield[i,null];return}let t=!1,r;e instanceof Headers?r=e.entries():yx(e)?r=e:(t=!0,r=Object.entries(e??{}));for(let o of r){let n=o[0];if(typeof n!="string")throw new TypeError("expected header name to be a string");let i=yx(o[1])?o[1]:[o[1]],a=!1;for(let s of i)s!==void 0&&(t&&!a&&(a=!0,yield[n,null]),yield[n,s])}}var D=e=>{let t=new Headers,r=new Set;for(let o of e){let n=new Set;for(let[i,a]of $4(o)){if(!I4.test(i))throw new TypeError(`Header name must be a valid HTTP token ["${i}"]`);let s=i.toLowerCase();n.has(s)||(t.delete(s),n.add(s)),a===null?(t.delete(s),r.add(s)):(t.append(s,a),r.delete(s))}}return{[Q0]:!0,values:t,nulls:r}};var Ex={};Kr(Ex,{findRegisteredX509Transport:()=>S4,findX509Credential:()=>M4,findX509OAuthError:()=>j4,isApprovedX509Client:()=>z4,isRetryableX509IssuerError:()=>R4,isTransientX509ConnectionError:()=>T4,markApprovedX509Client:()=>C4,markRetryableX509IssuerError:()=>E4,markTransientX509ConnectionError:()=>P4,rememberRegisteredX509Transport:()=>O4,rememberX509Credential:()=>D4,rememberX509OAuthError:()=>N4});var eP=new WeakMap,tP=new WeakSet,rP=new WeakSet,nP=new WeakSet,oP=new WeakMap,iP=new WeakMap,S4=WeakMap.prototype.get.bind(eP),O4=WeakMap.prototype.set.bind(eP),P4=WeakSet.prototype.add.bind(tP),T4=WeakSet.prototype.has.bind(tP),E4=WeakSet.prototype.add.bind(rP),R4=WeakSet.prototype.has.bind(rP),C4=WeakSet.prototype.add.bind(nP),z4=WeakSet.prototype.has.bind(nP),N4=WeakMap.prototype.set.bind(oP),j4=WeakMap.prototype.get.bind(oP),D4=WeakMap.prototype.set.bind(iP),M4=WeakMap.prototype.get.bind(iP);var Rx=ug(aP(),1),U4=typeof Rx.findRegisteredX509Transport=="function"?Rx:Ex,{findRegisteredX509Transport:sP,rememberRegisteredX509Transport:y8,markTransientX509ConnectionError:_8,isTransientX509ConnectionError:qm,markRetryableX509IssuerError:v8,isRetryableX509IssuerError:Cx,markApprovedX509Client:uP,isApprovedX509Client:L4,rememberX509OAuthError:b8,findX509OAuthError:cP,rememberX509Credential:w8,findX509Credential:lP}=U4;function dP(e){if(!e||typeof e!="object")throw new k("X.509 workload identity requires an approved X.509 transport capability.");let t=sP(e);if(!t)throw new k("X.509 workload identity requires an approved X.509 transport capability.");return t}var Ce,Ht,ka,Aa,En,Nr,ro,no,kt,Ia,to,Dr,jr,hP,Hm,gP,pP,yP,_P,fP,vP,Xe,Nx,Z4=["dispatcher","agent","client","tls","proxy"],vu=(e,t)=>Headers.prototype.get.call(e,t),F4=1200*1e3,mP=1e3,Jm=e=>{let t=new $e;return Object.defineProperty(t,"cause",{value:e.reason,writable:!0,configurable:!0}),t};function zx(e){for(let t of Headers.prototype.keys.call(e)){let r=t.toLowerCase().split("_").join("-");if(r!=="authorization"&&Bm(r)||r==="host")throw new k("X.509 workload identity cannot send conflicting authentication credentials.")}}function B4(e,t){let r=new AbortController,o=e===void 0?void 0:setTimeout(()=>r.abort(new ot),e),n=o;typeof n=="object"&&n!==null&&"unref"in n&&typeof n.unref=="function"&&n.unref();let i=()=>r.abort(t?.reason);return t?.addEventListener("abort",i,{once:!0}),t?.aborted&&i(),{signal:r.signal,dispose:()=>{t?.removeEventListener("abort",i),o&&clearTimeout(o)}}}function W4(e,t){let r,o=new Promise((n,i)=>{r=()=>i(t.reason),t.addEventListener("abort",r,{once:!0}),t.aborted&&r()});return{result:Promise.race([e.promise,o]),dispose:()=>{r&&t.removeEventListener("abort",r)}}}function Xm(e){if(!e||typeof e!="object")return!1;let t=e;for(;t!==null&&t!==Object.prototype;){let o=Object.getOwnPropertyDescriptor(t,"provider");if(o){if(!("value"in o)||o.value!==void 0)return!1;break}t=Object.getPrototypeOf(t)}let r=e;for(;r!==null&&r!==Object.prototype;){let o=Object.getOwnPropertyDescriptor(r,"type");if(o){if(!("value"in o))throw new k("X.509 workload identity type must be a plain data property.");return o.value==="x509"}r=Object.getPrototypeOf(r)}return!1}function jx(e){if(!e)return;for(let r of Z4)if(ie(e,r))throw new k("X.509 workload identity cannot override its approved transport capability.");let t=Object.getOwnPropertyDescriptor(e,"redirect")?.value;if(t!==void 0&&t!=="manual")throw new k("X.509 workload identity requests require manual redirects.")}function gd(e){if(jx(e),e&&["body","headers","method","signal"].some(t=>ie(e,t)))throw new k("X.509 workload identity cannot override its request body, headers, method, or signal through fetch options.")}function Dx(e){gd(e);let t={...e};return gd(t),t}var Ut=class{constructor(t,r,o,n){if(Ce.add(this),ka.set(this,void 0),Aa.set(this,void 0),En.set(this,void 0),Nr.set(this,void 0),ro.set(this,void 0),no.set(this,void 0),kt.set(this,void 0),Ia.set(this,void 0),to.set(this,void 0),Dr.set(this,void 0),jr.set(this,0),z(this,kt,dP(r),"f"),z(this,ka,t.identityProviderId,"f"),z(this,Aa,t.serviceAccountId,"f"),z(this,En,t.refreshBufferMs,"f"),z(this,Nr,t.refreshBufferSeconds,"f"),z(this,ro,o,"f"),z(this,no,n,"f"),m(this,En,"f")!==void 0&&m(this,Nr,"f")!==void 0)throw new k("X.509 workload identity cannot combine refreshBufferSeconds and refreshBufferMs.");if(m(this,En,"f")!==void 0&&(!Number.isSafeInteger(m(this,En,"f"))||m(this,En,"f")<0))throw new k("X.509 workload identity requires a nonnegative integer refreshBufferMs.");if(m(this,Nr,"f")!==void 0&&(!Number.isSafeInteger(m(this,Nr,"f"))||m(this,Nr,"f")<0||!Number.isSafeInteger(m(this,Nr,"f")*1e3)))throw new k("X.509 workload identity requires a nonnegative integer refreshBufferSeconds.");z(this,Ia,m(this,Nr,"f")===void 0?m(this,En,"f")??F4:m(this,Nr,"f")*1e3,"f")}identitySnapshot(){return{type:"x509",identityProviderId:m(this,ka,"f"),serviceAccountId:m(this,Aa,"f"),...m(this,En,"f")===void 0?{}:{refreshBufferMs:m(this,En,"f")},...m(this,Nr,"f")===void 0?{}:{refreshBufferSeconds:m(this,Nr,"f")}}}static shouldAuthenticate(t,r,o=t.headers){return!D([r,o]).nulls.has("authorization")}snapshotHeaders(t,r){let o=m(this,Ce,"m",Xe).call(this);return o.defaultHeaders??(o.defaultHeaders=D([t])),o.requestHeaders??(o.requestHeaders=D([r])),this.headerSnapshots()}headerSnapshots(){let{defaultHeaders:t,requestHeaders:r}=m(this,Ce,"m",Xe).call(this);if(!t||!r)throw new k("X.509 workload identity requires snapshotted request headers.");return{defaultHeaders:t,requestHeaders:r}}snapshotTenant(t,r){if(t!==m(this,ro,"f")||r!==m(this,no,"f"))throw new k("X.509 workload identity cannot override its enrolled organization or project.");let o=m(this,Ce,"m",Xe).call(this);return o.tenant={organization:t,project:r},o.tenant}tenantSnapshot(){let{tenant:t}=m(this,Ce,"m",Xe).call(this);if(!t)throw new k("X.509 workload identity requires snapshotted tenant selectors.");return t}snapshotAPIURL(t){_u(t),m(this,Ce,"m",Xe).call(this).apiURL=t}requestAPIURL(){let{apiURL:t}=m(this,Ce,"m",Xe).call(this);if(t===void 0)throw new k("X.509 workload identity requires a snapshotted API destination.");return t}snapshotRequest(t,r,o){var n;(n=m(this,Ce,"m",Xe).call(this)).request??(n.request={signal:t,timeout:r,fetchOptions:o})}requestSnapshot(){let{request:t}=m(this,Ce,"m",Xe).call(this);if(!t)throw new k("X.509 workload identity requires snapshotted request settings.");return t}beginRequestPreparation(){let t=m(this,Ce,"m",Xe).call(this);t.deadlineArmed&&t.preparationStartedAt===void 0&&(t.preparationStartedAt=performance.now(),t.preparationWallStartedAt=Date.now())}beginRequestPlanning(){m(this,Ce,"m",Xe).call(this).phase="planning"}beginRequestNetwork(){let t=m(this,Ce,"m",Xe).call(this);t.deadlineArmed?t.preparationStartedAt!==void 0&&(t.monotonicStartedAt+=performance.now()-t.preparationStartedAt,t.wallStartedAt+=Date.now()-(t.preparationWallStartedAt??Date.now()),delete t.preparationStartedAt,delete t.preparationWallStartedAt):(t.wallStartedAt=Date.now(),t.monotonicStartedAt=performance.now(),t.deadlineArmed=!0)}isPlanningRequest(){return m(this,Ce,"m",Xe).call(this).phase==="planning"}authorizePlannedRequest(t,r,o,n=!1){let i=m(this,Ce,"m",Xe).call(this),a=Object.getOwnPropertyDescriptor(r,"headers"),s=Object.getOwnPropertyDescriptor(r,"body"),u=Object.getOwnPropertyDescriptor(r,"signal"),c=Object.getOwnPropertyDescriptor(r,"redirect");if(i.phase!=="planning"||!a||!(a.value instanceof Headers)||!s&&"body"in r||[s,u,c].some(d=>d&&!("value"in d)))throw new k("X.509 workload identity requires an approved final request.");this.snapshotAPIURL(t),jx(r);try{zx(a.value)}catch{throw new k("X.509 workload identity cannot use caller-supplied authentication credentials.")}if(vu(a.value,"Authorization")!==null)throw new k("X.509 workload identity cannot use caller-supplied authorization credentials.");if(m(this,Ce,"m",Nx).call(this,a.value),!n&&(u?.value??void 0)!==(this.requestSnapshot().signal??void 0))throw new k("X.509 workload identity must preserve its approved request signal.");let l=this.requestSnapshot();i.request={...l,timeout:Math.min(l.timeout,o)},i.phase="authorizing"}ownRequestBody(t,r){t instanceof ReadableStream&&t!==r&&(m(this,Ce,"m",Xe).call(this).materializedBody=t)}static isStreamingRequestBody(t){return globalThis.ReadableStream!==void 0&&t instanceof globalThis.ReadableStream||typeof t=="object"&&t!==null&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")}retireRequestBody(){let t=m(this,Ce,"m",Xe).call(this),r=t.materializedBody;delete t.materializedBody,r&&m(Ht,Ht,"m",hP).call(Ht,r)}releaseRequestBody(t){let r=m(this,Ce,"m",Xe).call(this);r.materializedBody===t?delete r.materializedBody:this.retireRequestBody()}setEffectiveSignal(t){t?m(this,Ce,"m",Xe).call(this).effectiveSignal=t:delete m(this,Ce,"m",Xe).call(this).effectiveSignal}effectiveSignal(){let t=m(this,Ce,"m",Xe).call(this);return t.effectiveSignal??t.request?.signal}runRequest(t,r){return m(this,kt,"f").run(async()=>{let o=m(this,kt,"f").current();if(!o)throw new k("X.509 workload identity requires an active certificate request scope.");o.owner=this,o.requestOwner=r;try{return await t()}finally{this.retireRequestBody(),this.releaseRequestCredentials(),delete o.requestOwner,delete o.owner}})}inRequest(t){let r=m(this,kt,"f").current();return r?.owner===this&&r.requestOwner===t&&r.phase!=="authorizing"}matches(t){return m(this,kt,"f")===m(t,kt,"f")&&m(this,ka,"f")===m(t,ka,"f")&&m(this,Aa,"f")===m(t,Aa,"f")&&m(this,ro,"f")===m(t,ro,"f")&&m(this,no,"f")===m(t,no,"f")&&m(this,Ia,"f")===m(t,Ia,"f")}continuation(){let{wallStartedAt:t,monotonicStartedAt:r,deadlineArmed:o,request:n,requestOwner:i,effectiveSignal:a}=m(this,Ce,"m",Xe).call(this),s={wallStartedAt:t,monotonicStartedAt:r,owner:this,...o?{deadlineArmed:o}:{},...n?{request:n}:{},...a?{effectiveSignal:a}:{},...i?{requestOwner:i}:{}};return u=>m(this,kt,"f").resume(s,async()=>{try{return await u()}finally{this.releaseRequestCredentials(),delete s.requestOwner,delete s.owner}})}releaseRequestCredentials(){let t=m(this,Ce,"m",Xe).call(this);delete t.request,delete t.phase,delete t.deadlineArmed,delete t.preparationStartedAt,delete t.preparationWallStartedAt,delete t.effectiveSignal,delete t.materializedBody,delete t.apiURL,delete t.tenant,delete t.token,delete t.defaultHeaders,delete t.requestHeaders,delete t.tokenGeneration,delete t.headers,delete t.authorization}requestStartedAt(t){return m(this,kt,"f").current()?.wallStartedAt}usedWorkloadToken(t){return m(this,kt,"f").current()?.token!==void 0}remainingTimeout(t,r){let o=m(this,kt,"f").current();if(o===void 0)return r;let n=r-(performance.now()-o.monotonicStartedAt);if(n<=0)throw new ot;return n}async waitForRetry(t,r){try{await m(this,kt,"f").sleep(t,r)}catch(o){throw r?.aborted?Jm(r):o}}static isRetryableFailure(t){return typeof t=="object"&&t!==null&&(qm(t)||Cx(t))}static retryHeaders(t){if(!t||typeof t!="object"||!Cx(t))return;let r=Object.getOwnPropertyDescriptor(t,"headers")?.value;return r instanceof Headers?r:void 0}async getToken(t,r){let o=r?r.signal:t?.signal;if(o?.aborted)throw Jm(o);t&&gd(r?r.fetchOptions:t.fetchOptions),m(this,Ce,"m",vP).call(this,r);let n=t?m(this,Ce,"m",Xe).call(this):void 0,i=m(this,to,"f");if(i&&performance.now()<i.refreshAt&&Date.now()<i.wallRefreshAt)return m(Ht,Ht,"m",Hm).call(Ht,n,i);let a=r&&t?this.remainingTimeout(t,r.timeout):r?.timeout,{signal:s,dispose:u}=B4(a,o);if(o?.aborted)throw u(),Jm(o);let c=m(this,Dr,"f")??m(this,Ce,"m",_P).call(this);c.waiters+=1;let l=W4(c,s);try{let d=await l.result,p=m(this,to,"f");if(!p||p.accessToken!==d.accessToken)throw new $e;return m(Ht,Ht,"m",Hm).call(Ht,n,p)}catch(d){return await m(this,Ce,"m",gP).call(this,d,c,i,n,t,r)}finally{l.dispose(),u(),c.waiters-=1,m(this,Ce,"m",yP).call(this,c)}}invalidateToken(){let t=m(this,kt,"f").current();if(!t?.token||m(this,to,"f")?.accessToken!==t.token||m(this,to,"f").generation!==t.tokenGeneration)return;z(this,jr,m(this,jr,"f")+1,"f"),z(this,to,void 0,"f");let r=m(this,Dr,"f");z(this,Dr,void 0,"f"),r?.controller.abort(new $e)}bindRequest(t,r,o){if(!(r.headers instanceof Headers))throw new k("X.509 workload identity requires the original workload authorization headers.");let n=m(this,Ce,"m",Xe).call(this),{token:i}=n,a=t.__security??{bearerAuth:!0},s=i?`Bearer ${i}`:null;!i&&a.adminAPIKeyAuth&&o!==null&&vu(r.headers,"Authorization")!==null&&(s=new Headers({Authorization:`Bearer ${o}`}).get("Authorization")),n.headers=r.headers,n.authorization=s,this.assertRequest(r)}adoptRequestHeaders(t){let r=m(this,Ce,"m",Xe).call(this),o=r.headers;if(!(o instanceof Headers)||!(t.headers instanceof Headers))throw new k("X.509 workload identity must preserve its issued workload authorization.");r.headers=t.headers;try{this.assertRequest(t)}catch(n){throw r.headers=o,n}}assertRequest(t){let{headers:r}=t;if(!(r instanceof Headers))throw new k("X.509 workload identity must preserve its issued workload authorization.");let o=m(this,kt,"f").current();if(!o||o.headers!==r||o.authorization===void 0||vu(r,"Authorization")!==o.authorization)throw new k("X.509 workload identity must preserve its issued workload authorization.");m(this,Ce,"m",Nx).call(this,r),zx(r)}fetch(){return async(t,r={})=>{let o=_u(typeof t=="string"||t instanceof URL?t:t.url);jx(r),this.assertRequest(r);let n=r.headers;if(!(n instanceof Headers))throw new k("X.509 workload identity must preserve its issued workload authorization.");let i=new Headers([...Headers.prototype.entries.call(n)]);return zx(i),r.headers=i,r.redirect="manual",await m(this,kt,"f").dispatch(o,r)}}};Ht=Ut,ka=new WeakMap,Aa=new WeakMap,En=new WeakMap,Nr=new WeakMap,ro=new WeakMap,no=new WeakMap,kt=new WeakMap,Ia=new WeakMap,to=new WeakMap,Dr=new WeakMap,jr=new WeakMap,Ce=new WeakSet,hP=async function(t){try{await Qn(t)}catch{}},Hm=function(t,r){return t&&(t.token=r.accessToken,t.tokenGeneration=r.generation),r.accessToken},gP=async function(t,r,o,n,i,a){let s=a?a.signal:i?.signal;if(s?.aborted)throw Jm(s);if(r.controller.signal.aborted&&r.generation!==m(this,jr,"f"))return await this.getToken(i,a);let u=m(this,Ce,"m",pP).call(this,t,o,n);if(u!==void 0)return u;if(t&&typeof t=="object"&&!(t instanceof Cr)){let c=cP(t);if(c)throw new Cr(c.status,c.error,c.headers)}throw t},pP=function(t,r,o){if(!r||r!==m(this,to,"f")||performance.now()>=r.expiresAt||Date.now()>=r.wallExpiresAt||!Ht.isRetryableFailure(t))return;let n=Ht.retryHeaders(t),i=n?.get("retry-after-ms"),a=i?Number(i):void 0,s=n?.get("retry-after");if(s&&(a===void 0||Number.isNaN(a))){let c=Number(s);a=Number.isNaN(c)?Date.parse(s)-Date.now():c*1e3}let u=a!==void 0&&Number.isFinite(a)&&a>=0&&a<=6e4?Math.max(mP,a):mP;return r.refreshAt=Math.min(r.expiresAt,performance.now()+u),r.wallRefreshAt=Math.min(r.wallExpiresAt,Date.now()+u),m(Ht,Ht,"m",Hm).call(Ht,o,r)},yP=function(t){t.waiters!==0||m(this,Dr,"f")!==t||queueMicrotask(()=>{t.waiters===0&&m(this,Dr,"f")===t&&(z(this,Dr,void 0,"f"),z(this,jr,m(this,jr,"f")+1,"f"),t.controller.abort(new $e))})},_P=function(){let t=new AbortController,r=m(this,jr,"f"),o={controller:t,generation:r,waiters:0,promise:m(this,Ce,"m",fP).call(this,t,r)};return z(this,Dr,o,"f"),o},fP=async function(t,r){let o=performance.now(),n=Date.now();try{let i=await m(this,kt,"f").exchange(m(this,ka,"f"),m(this,Aa,"f"),t.signal),a=i.expiresIn*1e3,s=o+a,u=n+a;if(performance.now()>=s||Date.now()>=u)throw new k("X.509 workload identity token expired before its exchange completed.");if(m(this,jr,"f")!==r||t.signal.aborted||m(this,Dr,"f")?.controller!==t)throw new $e;return z(this,jr,m(this,jr,"f")+1,"f"),z(this,to,{accessToken:i.accessToken,generation:m(this,jr,"f"),expiresAt:s,refreshAt:s-Math.min(m(this,Ia,"f"),a/2),wallExpiresAt:u,wallRefreshAt:u-Math.min(m(this,Ia,"f"),a/2)},"f"),i}finally{m(this,Dr,"f")?.controller===t&&z(this,Dr,void 0,"f")}},vP=function(t){if(!t)return;if(t.organization!==m(this,ro,"f")||t.project!==m(this,no,"f"))throw new k("X.509 workload identity cannot override its enrolled organization or project.");_u(t.apiURL);let r=D([t.defaultHeaders,t.requestHeaders]);if(m(this,ro,"f")!==null&&r.nulls.has("openai-organization")||m(this,no,"f")!==null&&r.nulls.has("openai-project"))throw new k("X.509 workload identity cannot omit its enrolled organization or project.");for(let o of r.values.keys()){let n=o.toLowerCase().split("_").join("-");if((n==="openai-organization"||n==="openai-project")&&(o!==n||vu(r.values,o)!==(n==="openai-organization"?t.organization:t.project)))throw new k("X.509 workload identity cannot override its enrolled organization or project.");if(Bm(n)||n==="host")throw new k("X.509 workload identity cannot use caller-supplied authentication credentials.")}},Xe=function(){let t=m(this,kt,"f").current();if(!t||t.owner!==this)throw new k("X.509 workload identity requires an active certificate request scope.");return t},Nx=function(t){if(vu(t,"OpenAI-Organization")!==m(this,ro,"f")||vu(t,"OpenAI-Project")!==m(this,no,"f"))throw new k("X.509 workload identity cannot override its enrolled organization or project.");for(let r of Headers.prototype.keys.call(t)){let o=r.toLowerCase().split("_").join("-");if((o==="openai-organization"||o==="openai-project")&&r!==o)throw new k("X.509 workload identity cannot override its enrolled organization or project.")}};function bP(e){let{credential:t}=e;if(t===void 0)return{credential:t,options:e};let r=lP(t);if(!r)throw new k("An X.509 credential must be created by the SDK authentication helper.");let o=["apiKey","adminAPIKey","workloadIdentity","x509Transport"].filter(n=>{let i=e[n];return i!=null});if(o.length>0)throw new k(`The \`credential\` option cannot be combined with ${o.map(n=>`\`${n}\``).join(", ")}.`);return{credential:t,options:{...e,apiKey:null,adminAPIKey:null,baseURL:e.baseURL??null,organization:e.organization??null,project:e.project??null,workloadIdentity:r.identity,x509Transport:r.transport}}}function K4({apiKey:e,adminAPIKey:t}){return e!=null||t!=null}function V4(e,t){let r=e.provider,o=t.credential??t.workloadIdentity,n=t.provider??(o?void 0:r);return n!==r&&(delete e.baseURL,delete e.organization,delete e.project,delete e.defaultHeaders,delete e.defaultQuery,delete e.fetchOptions,delete e.fetch),n&&(delete e.apiKey,delete e.adminAPIKey,delete e.credential,delete e.workloadIdentity,delete e.x509Transport,delete e.baseURL),n}function wP(e,t,r,o){let n=ie(t,"workloadIdentity")?t.workloadIdentity:e.workloadIdentity,i=r!==void 0&&(K4(t)&&t.workloadIdentity===void 0||t.provider!==void 0);r!==void 0&&ie(t,"workloadIdentity")&&delete e.x509Transport;let a=r!==void 0&&!i&&t.credential===void 0&&!ie(t,"workloadIdentity")&&!ie(t,"x509Transport")?r:void 0,s=t.credential===void 0?a:t.credential,u=s!==void 0||!i&&Xm(n);return o!==u&&(delete e.fetch,delete e.baseURL,delete e.organization,delete e.project,delete e.defaultHeaders,delete e.defaultQuery,delete e.fetchOptions,u?e.apiKey=null:(delete e.x509Transport,i&&delete e.workloadIdentity)),s!==void 0&&(delete e.apiKey,delete e.adminAPIKey,delete e.workloadIdentity,delete e.x509Transport,e.credential=s,t.credential!==void 0&&(delete e.organization,delete e.project,delete e.defaultHeaders,delete e.defaultQuery,delete e.fetchOptions)),{credential:s,provider:V4(e,t)}}var kP=Symbol("brand.privateStreamingFile");function Ym(e,t,r){if(typeof t!="string"||!t)throw new TypeError("toStreamingFile requires a non-empty file name");let o=r?.type;return o&&OP(o),{[kP]:!0,data:e,name:t,...o?{type:o}:{}}}var Fx=()=>{if(typeof File>"u"){let{process:e}=globalThis,t=typeof e?.versions?.node=="string"&&Number.parseInt(e.versions.node.split("."),10)<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to a supported Node.js LTS release, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function oo(e,t,r){return Fx(),new File(e,t??"unknown_file",r)}function $a(e,t){if(typeof e!="object"||e===null)return;let r="name"in e?e.name:void 0,o=r&&String(r)||"filename"in e&&e.filename&&String(e.filename);if(o)return t?.stripFilename===!1?AP(o):yd(o);let n="url"in e&&e.url&&String(e.url);if(n)try{return yd(new URL(n).pathname)}catch{return yd(n)}let i="path"in e&&e.path&&String(e.path);return i?yd(i):void 0}function yd(e){return e.split(/[\\/]/).pop()||void 0}function AP(e){let t=e.replace(/\\/g,"/");if(t.startsWith("/")||/^[A-Za-z]:/.test(t)||t.split("/").includes(".."))throw new TypeError("Upload file name must be a safe relative path without parent directory segments");return t}var bu=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function",ri=async(e,t,r)=>Ux(e.body)?Gm(e.body)?$P(e,r):{...e,body:await IP(e.body,t,r)}:e,mt=async(e,t,r)=>Gm(e.body)?$P(e,r):{...e,body:await IP(e.body,t,r)},xP=new WeakMap;function q4(e){let t=typeof e=="function"?e:e.fetch,r=xP.get(t);if(r)return r;let o=(async()=>{try{let n;if("Response"in t)n=t.Response;else{let a=await t("data:,");await a.arrayBuffer(),n=a.constructor}let i=new FormData;return i.toString()!==await new n(i).text()}catch{return!0}})();return xP.set(t,o),o}var IP=async(e,t,r={})=>{if(!await q4(t))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let o=new FormData;return await Promise.all(Object.entries(e||{}).map(([n,i])=>Zx(o,n,i,r))),o},Qm=e=>e instanceof Blob,Bx=e=>typeof e=="object"&&e!==null&&"getReader"in e&&typeof e.getReader=="function",vd=e=>typeof e=="object"&&e!==null&&kP in e,eh=e=>typeof e=="object"&&e!==null&&(e instanceof Response||bu(e)||Bx(e)||vd(e)||Qm(e)),Gm=e=>{if(vd(e)||bu(e)||Bx(e))return!0;if(Array.isArray(e))return e.some(Gm);if(e&&typeof e=="object"&&!Qm(e)&&!(e instanceof Response)){for(let t of Object.keys(e))if(Gm(e[t]))return!0}return!1},Ux=e=>{if(eh(e))return!0;if(Array.isArray(e))return e.some(Ux);if(e&&typeof e=="object"){for(let t of Object.keys(e))if(Ux(e[t]))return!0}return!1},J4=(e,t)=>{let r=[];for(let o of e)eh(o.value)&&!t.has(o.value)&&t.set(o.value,SP(o.value,{stripFilenames:!1})),r.push(o);return r},$P=(e,t={})=>{let r=X4(e.body),o=t.stripFilenames===!1?new WeakMap:void 0,n=o?J4(r,o):r,i=`openai-${Math.random().toString(36).slice(2)}`,a=sd(H4(n,i,t,o));return{...e,body:a,headers:D([{"content-type":`multipart/form-data; boundary=${i}`},e.headers])}};async function*H4(e,t,r,o){for await(let{key:n,value:i}of e){if(eh(i)){let a=o?.get(i)??SP(i,r),s=G4(i);yield Pt(`--${t}\r
105
+ `),yield Pt(`Content-Disposition: form-data; name="${Mx(n)}"; filename="${Mx(a)}"\r
106
+ Content-Type: ${s}\r
107
+ \r
108
+ `),yield*_d(Y4(i))}else yield Pt(`--${t}\r
109
+ `),yield Pt(`Content-Disposition: form-data; name="${Mx(n)}"\r
110
+ \r
111
+ ${String(i)}`);yield Pt(`\r
112
+ `)}yield Pt(`--${t}--\r
113
+ `)}function*X4(e){if(!(!e||typeof e!="object"))for(let[t,r]of Object.entries(e))yield*Lx(t,r)}function*Lx(e,t){if(t!==void 0){if(t==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||eh(t))yield{key:e,value:t};else if(Array.isArray(t))for(let r of t)yield*Lx(e+"[]",r);else if(typeof t=="object")for(let[r,o]of Object.entries(t))yield*Lx(`${e}[${r}]`,o);else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${t} instead`)}}function SP(e,t){if(vd(e)){let{name:r}=e;if(typeof r!="string"||!r)throw new TypeError("Streaming upload file name must be a non-empty string");return t.stripFilenames===!1?AP(r):yd(r)??"unknown_file"}return $a(e,{stripFilename:t.stripFilenames})??"unknown_file"}function G4(e){let t;return vd(e)||Qm(e)?{type:t}=e:e instanceof Response&&(t=e.headers.get("content-type")??void 0),OP(t||"application/octet-stream")}function OP(e){if(typeof e!="string")throw new TypeError("Streaming upload content type must be a string");for(let t=0;t<e.length;t+=1){let r=e.codePointAt(t)??0;if(r<=31||r===127)throw new TypeError("Streaming upload content type must not contain control characters")}return e}function Y4(e){return vd(e)?e.data:e}async function*_d(e){if(typeof e=="string")yield Pt(e);else if(ArrayBuffer.isView(e))yield new Uint8Array(e.buffer,e.byteOffset,e.byteLength);else if(e instanceof ArrayBuffer)yield new Uint8Array(e);else if(e instanceof Response)yield*_d(e.body||await e.blob());else if(e instanceof Blob)typeof e.stream=="function"?yield*_d(e.stream()):yield new Uint8Array(await e.arrayBuffer());else if(Bx(e))for await(let t of Um(e))yield*_d(t);else if(bu(e))for await(let t of e)yield*_d(t);else throw new TypeError(`Invalid streaming file chunk: ${String(e)}`)}function Mx(e){return Array.from(e,t=>{let r=t.codePointAt(0)??0;return r<=31||r===127||t==='"'||t==="\\"?encodeURIComponent(t):t}).join("")}var Zx=async(e,t,r,o)=>{if(r!==void 0){if(r==null)throw new TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")e.append(t,String(r));else if(r instanceof Response){let n=await r.blob();e.append(t,oo([n],$a(r,{stripFilename:o.stripFilenames}),{type:n.type}))}else if(bu(r))e.append(t,oo([await new Response(sd(r)).blob()],$a(r,{stripFilename:o.stripFilenames})));else if(Qm(r)){let n=$a(r,{stripFilename:o.stripFilenames});n===void 0?e.append(t,r):e.append(t,r,n)}else if(Array.isArray(r)){let n=await Promise.all(r.map(async i=>{let a=new FormData;return await Zx(a,t+"[]",i,o),a}));for(let i of n)if(i)for(let[a,s]of i.entries())e.append(a,s)}else if(typeof r=="object")await Promise.all(Object.entries(r).map(([n,i])=>Zx(e,`${t}[${n}]`,i,o)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}};var PP=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",Q4=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&PP(e),eM=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function",tM=(e,t)=>t?.type!=null&&t.type!==e.type||t?.lastModified!=null&&t.lastModified!==e.lastModified||t?.endings!=null,rM=(e,t,r)=>(t==null||t===e.name)&&!tM(e,r);async function bd(e,t,r){if(Fx(),e=await e,Q4(e)){let n={...r,type:r?.type??e.type,lastModified:r?.lastModified??e.lastModified};return e instanceof File?rM(e,t,r)?e:oo([e],t??e.name,n):oo([await e.arrayBuffer()],t??e.name,n)}if(eM(e)){let n=await e.blob();t||(t=$a(e));let i=r?.type===void 0&&n.type?{...r,type:n.type}:r;return oo(await Wx(n),t,i)}let o=await Wx(e);if(t||(t=$a(e)),r?.type===void 0){let n=o.find(i=>typeof i=="object"&&"type"in i&&!!i.type);n&&(r={...r,type:n.type})}return oo(o,t,r)}async function Wx(e){let t=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)t.push(e);else if(PP(e))t.push(e instanceof Blob?e:new Blob([await e.arrayBuffer()],{type:e.type}));else if(bu(e))for await(let r of e)t.push(...await Wx(r));else{let r=e?.constructor?.name;throw new Error(`Unexpected data type: ${typeof e}${r?`; constructor: ${r}`:""}${nM(e)}`)}return t}function nM(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(r=>`"${r}"`).join(", ")}]`}var I=class{constructor(t){this._client=t}};function EP(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var TP=Object.freeze(Object.create(null)),iM=(e=EP)=>function(r,...o){if(r.length===1)return r[0];let n=!1,i=[],a="";for(let l=0;l<r.length;l+=1)if(l in r){let d=r[l];/[?#]/.test(d)&&(n=!0);let p=o[l],f=(n?encodeURIComponent:e)(""+p);l!==o.length&&(p==null||typeof p=="object"&&p.toString===Object.getPrototypeOf(Object.getPrototypeOf(p.hasOwnProperty??TP)??TP)?.toString)&&(f=p+"",i.push({start:a.length+d.length,length:f.length,error:`Value of type ${Object.prototype.toString.call(p).slice(8,-1)} is not a valid path parameter`})),a+=d+(l===o.length?"":f)}let s=a.split(/[?#]/,1)[0],u=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,c;for(;(c=u.exec(s))!==null;)i.push({start:c.index,length:c[0].length,error:`Value "${c[0]}" can't be safely passed as a path parameter`});if(i.sort((l,d)=>l.start-d.start),i.length>0){let l=0,d="";for(let p of i){let f=" ".repeat(p.start-l),h="^".repeat(p.length);l=p.start+p.length,d+=f+h}throw new k(`Path parameters result in path with invalid segments:
114
+ ${i.map(p=>p.error).join(`
115
+ `)}
116
+ ${a}
117
+ ${d}`)}return a},w=iM(EP);var Sa=class extends I{list(t,r={},o){return this._client.getAPIList(w`/chat/completions/${t}/messages`,de,{query:r,...o,__security:{bearerAuth:!0}})}};function Rn(e){return e!==void 0&&"function"in e&&e.function!==void 0}function RP(e,t){let r={...e,type:"json_schema"};return r.json_schema={...r.json_schema},delete r.toJSON,delete r.json_schema.toJSON,Object.defineProperties(r,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:t,enumerable:!1}}),r}function sM(e){return e?.$brand==="auto-parseable-response-format"}function Cn(e){return sM(e)||e?.type==="json_schema"}function en(e,t){if(!Cn(e))return null;if(typeof e=="object"&&e!==null&&"$parseRaw"in e&&typeof e.$parseRaw=="function")return e.$parseRaw(t);try{return JSON.parse(t)}catch(r){throw r instanceof SyntaxError?new SyntaxError("Error reading response: invalid structured output JSON."):r}}function tn(e){return e?.$brand==="auto-parseable-tool"}function CP(e,t){return!t||!Vx(t)?{...e,choices:e.choices.map(r=>({...r,message:{...r.message,parsed:null,...r.message.tool_calls?{tool_calls:r.message.tool_calls}:void 0}}))}:wd(e,t)}function wd(e,t){let r=e.choices.map(o=>{if(o.finish_reason==="length")throw new Qo;if(o.finish_reason==="content_filter")throw new ei;return{...o,message:{...o.message,...o.message.tool_calls?{tool_calls:o.message.tool_calls?.map(n=>cM(t,n))??void 0}:void 0,parsed:o.message.content!==null&&o.message.content!==void 0&&!o.message.refusal&&(o.message.content!==""||!o.message.tool_calls?.length&&!o.message.function_call)?uM(t,o.message.content):null}}});return{...e,choices:r}}function uM(e,t){return en(e.response_format,t)}function cM(e,t){if(t.type==="custom")return t;if(t.type!=="function"){let n=t.type;throw new k(`Currently only \`function\` and \`custom\` tool calls are supported; Received \`${n}\``)}let r=e.tools?.find(n=>Rn(n)&&n.function?.name===t.function.name),o=null;return tn(r)?o=r.$parseRaw(t.function.arguments):r?.function.strict&&(o=en({type:"json_schema",$parseRaw:void 0},t.function.arguments)),{...t,function:{...t.function,parsed_arguments:o}}}function th(e,t){if(!e||!("tools"in e)||!e.tools||t.type!=="function")return!1;let r=e.tools?.find(o=>Rn(o)&&o.function?.name===t.function?.name);return Rn(r)&&(tn(r)||r?.function.strict||!1)}function Vx(e){return Cn(e.response_format)?!0:e.tools?.some(t=>tn(t)||t.type==="function"&&t.function.strict===!0)??!1}function zP(e){for(let t of e??[])if(t.type!=="custom"){if(t.type!=="function"){let r=t.type;throw new k(`Currently only \`function\` and \`custom\` tool types are supported; Received \`${r}\``)}if(t.function.strict!==!0)throw new k(`The \`${t.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var io=e=>e?.role==="assistant",xd=e=>e?.role==="tool";var rn,oh,ih,Ad,Id,ah,$d,Mr,uh,Pd,Sd,wu,ni,Oa,ch,lh,xu,ZP,Yx,FP,Qx,sh,NP=4096,Od=8*1024*1024,lM=4096,Td=256,dM=JSON.stringify,pM=JSON.parse,qx=new WeakSet,fM=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),"buffer")?.get,mM=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),"length")?.get,hM=Object.getOwnPropertyDescriptor(DataView.prototype,"buffer")?.get,jP=Object.getOwnPropertyDescriptor(Symbol.prototype,"description")?.get,gM=Date.prototype.getTime,yM=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength")?.get,_M=typeof SharedArrayBuffer=="function"?Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength")?.get:void 0,kd=Object.getOwnPropertyDescriptor(new Error("native stack descriptor"),"stack"),zn=Function.prototype.toString,vM=Object.prototype.toString,rh=Object.getOwnPropertyDescriptor(Error,"isError"),DP=rh&&"value"in rh&&typeof rh.value=="function"?rh.value:void 0,bM=zn.call(Error),wM=zn.call(Date),xM=zn.call(Function),dh=new Set([Rr.prototype,ot.prototype,qe.prototype,k.prototype,$e.prototype,Vo.prototype,Ko.prototype,Ho.prototype,ei.prototype,Yo.prototype,ar.prototype,Qo.prototype,Jo.prototype,Cr.prototype,qo.prototype,Go.prototype,_a.prototype,Xo.prototype]),BP=new Set,WP=new Map,MP=new WeakMap;function kM(){if(!(typeof process>"u"))try{let e=Object.getOwnPropertyDescriptor(process,"getBuiltinModule");if(!e||!("value"in e)||typeof e.value!="function")return;let t=Reflect.apply(e.value,process,["node:util"]);if(typeof t!="object"||t===null)return;let r=Object.getOwnPropertyDescriptor(t,"types");if(!r||!("value"in r)||typeof r.value!="object"||r.value===null)return;let o=Object.getOwnPropertyDescriptor(r.value,"isProxy");return!o||!("value"in o)||typeof o.value!="function"?void 0:o.value}catch{return}}var AM=kM();function ph(e){if(typeof e!="function")return;let t=Object.getOwnPropertyDescriptor(e,"prototype");if(!t||!("value"in t)||typeof t.value!="object"&&typeof t.value!="function")return;dh.add(t.value);let r=zn.call(e);if(/^function [A-Za-z_$][\w$]*\(\) \{ \[native code\] \}$/u.test(r)&&t.configurable===!1&&t.writable===!1){BP.add(r);let o=new Map;for(let n of Reflect.ownKeys(t.value)){let i=Object.getOwnPropertyDescriptor(t.value,n);i&&o.set(n,i)}WP.set(r,o)}}for(let e of[Object,Function,Array,Date,Map,Set,ArrayBuffer,DataView,Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,Int8Array,Int16Array,Int32Array,Float32Array,Float64Array])ph(e);for(let e of["SharedArrayBuffer","AggregateError","Float16Array","BigInt64Array","BigUint64Array","Blob","File","Headers"]){let t=Object.getOwnPropertyDescriptor(globalThis,e);t&&"value"in t&&ph(t.value)}var Jx=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype),"constructor");Jx&&"value"in Jx&&ph(Jx.value);typeof Buffer=="function"&&ph(Buffer);var IM=(()=>{if(typeof Blob=="function")try{let e=new Blob([]);for(let t of Object.getOwnPropertySymbols(e)){let r=Object.getOwnPropertyDescriptor(e,t);if(r&&"value"in r&&typeof r.value=="object"&&r.value)return Object.getPrototypeOf(r.value)}}catch{return}})(),$M=Map.prototype.entries,SM=Set.prototype.values,nh=typeof Headers=="function"?Object.getOwnPropertyDescriptor(Headers.prototype,"entries"):void 0,UP=nh&&"value"in nh&&typeof nh.value=="function"?nh.value:void 0,OM=new Set(["ArrayBuffer","SharedArrayBuffer","Blob","File","Map","Date","Set","Headers"]);function fh(e){let t=Object.getOwnPropertyDescriptor(e,"constructor");if(!t||!("value"in t)||typeof t.value!="function")return;let r=t.value,o=zn.call(r),n=WP.get(o);if(!BP.has(o)||!n)return;let i=Object.getOwnPropertyDescriptor(r,"prototype");if(!(!i||!("value"in i)||i.value!==e||i.configurable!==!1||i.writable!==!1))return{constructor:r,descriptors:n,functionPrototype:Object.getPrototypeOf(r)}}function PM(e){return dh.has(e)||fh(e)!==void 0}function Hx(e,t,r){if(t===void 0)return e===void 0;if(typeof e!="function"||typeof t!="function")return!1;let o=zn.call(t);if(zn.call(e)!==o)return!1;let n=Object.getPrototypeOf(e);if(n===r)return!0;if(!/^function [A-Za-z_$][\w$]*\(\) \{ \[native code\] \}$/u.test(o))return!1;let i=fh(n);return i!==void 0&&zn.call(i.constructor)===xM}function TM(e,t,r){return!t||e.configurable!==t.configurable||e.enumerable!==t.enumerable||"value"in e!="value"in t?!1:"value"in e&&"value"in t?e.writable!==t.writable?!1:typeof t.value=="function"?Hx(e.value,t.value,r):t.value!==null&&typeof t.value=="object"?!1:Object.is(e.value,t.value):Hx(e.get,t.get,r)&&Hx(e.set,t.set,r)}function LP(e){if(DP)return DP.call(Error,e);let t=e;for(let r=0;t!==null&&r<Td;r+=1){if(Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))return!1;t=Object.getPrototypeOf(t)}return t===null&&vM.call(e)==="[object Error]"}function EM(e,t){if(typeof t.get!="function"||typeof t.set!="function")return;let r=Object.getPrototypeOf(e);for(let o=0;r!==null&&o<Td;o+=1){let n=Object.getOwnPropertyDescriptor(r,"constructor");if(n&&"value"in n&&typeof n.value=="function"){let i=n.value;if(zn.call(i)===bM&&PM(r)){let a=Object.getPrototypeOf(i);return Object.getPrototypeOf(t.get)===a&&Object.getPrototypeOf(t.set)===a?{constructor:i,prototype:r}:void 0}}r=Object.getPrototypeOf(r)}}function RM(e,t){if(!LP(e))return!1;if(kd&&!("value"in kd)&&typeof kd.get=="function"&&Object.prototype.isPrototypeOf.call(Error.prototype,e)&&t.get===kd.get&&t.set===kd.set)return!0;let r=EM(e,t);if(!r)return!1;let o=MP.get(r.prototype);if(!o){let n=Reflect.construct(r.constructor,[]);if(typeof n!="object"||n===null||!LP(n)||Object.getPrototypeOf(n)!==r.prototype||(o=Object.getOwnPropertyDescriptor(n,"stack"),!o||"value"in o||typeof o.get!="function"||typeof o.set!="function"))return!1;MP.set(r.prototype,o)}return t.get===o.get&&t.set===o.set}function Xx(){let e=[],t=0;return{get length(){return e.length-t},enqueue(r){e.push(r)},dequeue(){if(t===e.length)return;let r=e[t];return e[t]=void 0,t+=1,t===e.length?(e=[],t=0):t>=1024&&t*2>=e.length&&(e=e.slice(t),t=0),r},clear(){e=[],t=0}}}function CM(e){let t=Object.getPrototypeOf(e);for(let r=0;t!==null&&r<Td;r+=1){if(t===Date.prototype)return"Date";if(!dh.has(t)){let n=Object.getOwnPropertyDescriptor(t,"constructor");if(n&&"value"in n&&typeof n.value=="function"&&zn.call(n.value)===wM&&fh(t))return"Date"}let o=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag);if(o&&"value"in o&&typeof o.value=="string"&&OM.has(o.value))return o.value;t=Object.getPrototypeOf(t)}}function zM(e,t,r){if(ArrayBuffer.isView(e)){let s,u="typed-array";try{s=fM?.call(e)}catch{u="data-view",s=hM?.call(e)}return typeof s!="object"||s===null?{bytes:Number.POSITIVE_INFINITY,kind:u}:(t(s,r+1),{bytes:0,kind:u})}let o=CM(e);if(!o)return;let n,i="buffer";switch(o){case"ArrayBuffer":{n=yM;break}case"SharedArrayBuffer":{n=_M;break}case"Blob":case"File":return{bytes:Number.POSITIVE_INFINITY,kind:"blob"};case"Map":return{bytes:0,kind:"map"};case"Date":return Reflect.apply(gM,e,[]),{bytes:8,kind:"date"};case"Set":return{bytes:0,kind:"set"};case"Headers":return{bytes:0,kind:"headers"};default:return}let a=n?.call(e);return{bytes:typeof a=="number"&&Number.isSafeInteger(a)&&a>=0?a:Number.POSITIVE_INFINITY,kind:i}}function NM(e,t,r){if(t==="map"){for(let[o,n]of $M.call(e))if(!r(o,8)||!r(n,8))return!1}if(t==="set"){for(let o of SM.call(e))if(!r(o,8))return!1}if(t==="headers"){if(!UP)return!1;for(let[o,n]of UP.call(e))if(!r(o,8)||!r(n,8))return!1}return!0}function jM(e,t,r){if(Array.isArray(e)){let n=Object.getOwnPropertyDescriptor(e,"length"),i=n&&"value"in n?n.value:void 0;if(typeof i!="number"||!Number.isSafeInteger(i)||i<0||i>Math.floor(r/16))return}if(t!=="typed-array")return Reflect.ownKeys(e);let o=mM?.call(e);if(!(typeof o!="number"||!Number.isSafeInteger(o)||o<0||o>lM))return Reflect.ownKeys(e).filter(n=>{if(typeof n!="string")return!0;let i=Number(n);return!Number.isInteger(i)||i<0||i>=o||String(i)!==n})}function KP(e,t,r,o,n,i){let a=jM(e,t,o());if(a===void 0)return!1;for(let s of a){if(!n(typeof s=="string"?s.length*2+8:8))return!1;typeof s=="symbol"&&i(s,r+1);let u=Object.getOwnPropertyDescriptor(e,s);if(!u)return!1;if(!("value"in u)){if(s==="stack"&&RM(e,u))continue;return!1}i(u.value,r+1,t==="blob")}return!0}function DM(e,t,r,o,n,i,a,s){let u=Object.getPrototypeOf(e);for(let c=t+1;u!==null;c+=1){if(c>=Td)return!1;if(dh.has(u)||r&&u===IM)return!0;if(o.has(u))return a(u,c),n()>=0;o.add(u);let l=u;if(!s(l,()=>{if(!i(16))return!1;let p=fh(l);if(!p)return KP(l,void 0,c,n,i,a);for(let f of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,f);if(!h)return!1;if(!TM(h,p.descriptors.get(f),p.functionPrototype)){if(!i(typeof f=="string"?f.length*2+8:8)||!("value"in h))return!1;typeof f=="symbol"&&a(f,c+1),a(h.value,c+1)}}return n()>=0}))return!1;u=Object.getPrototypeOf(l)}return!0}var MM=32,UM=32,VP=8,qP=16,LM=128*1024;function Gx(e,t){let r=0,o=0,n=new WeakSet,i=new Set,a=new Set,s=new Map,u,c=()=>t-r,l=y=>!Number.isSafeInteger(y)||y<0?(r=t+1,!1):(r+=y,u?u.bytes+=y:o+=y,r<=t),d=y=>{u?u.edges.add(y):a.add(y)},p=(y,_)=>{d(y);let $={bytes:0,edges:new Set};s.set(y,$);let v=u;u=$;try{return _()}finally{u=v}},f=y=>{if(i.has(y)){d(y),l(8);return}i.add(y),p(y,()=>{if(!jP)return!1;let _=Reflect.apply(jP,y,[]);return l(8+(_?.length??0)*2)})||(r=t+1)},h=(y,_,$=!1)=>{if(!(r>t)){if(typeof y=="string"){l(y.length*2);return}if(typeof y=="symbol"){f(y);return}if(typeof y=="function"){r=t+1;return}if(y===null||typeof y!="object"){l(8);return}if(AM?.(y)){r=t+1;return}if(_>=Td){r=t+1;return}if(n.has(y)){d(y),l(8);return}n.add(y),p(y,()=>{if(!l(16))return!1;let v=zM(y,h,_);return!DM(y,_,$,n,c,l,h,p)||v!==void 0&&!l(v.bytes)||!NM(y,v?.kind,(x,S)=>l(S)?(h(x,_+1),r<=t):!1)?!1:KP(y,v?.kind,_,c,l,h)})||(r=t+1)}};try{h(e,0)}catch{return}return r<=t?{scalarBytes:o,roots:a,nodes:s}:void 0}function ZM(e,t){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}function ek(e,t){return e.bytes+UM+e.edges.size*VP+t*qP}function tk(e){return MM+e.scalarBytes+e.roots.size*VP}function FM(e,t,r,o){let n=new Set,i=[...e];for(;i.length;){if(o.remaining-=1,o.remaining<0)return;let a=i.pop();if(n.has(a))continue;let s=t.get(a)??r.get(a);if(!s)return;n.add(a);for(let u of s.edges)i.push(u)}return n}function rk(e,t,r,o,n){let i=o.get(e);if(i)return n&&(i.node=n),i;let a=n??t.nodes.get(e)??r.get(e);if(!a)return;let s={node:a,ownerDelta:0};return o.set(e,s),s}function BM(e,t,r,o,n){let i=new Set([e]);for(let[a,s]of t.nodes){if(n.remaining-=1,n.remaining<0)return;let u=r.get(a);if(!u)continue;let c=!ZM(u.edges,s.edges);if((u.bytes!==s.bytes||c)&&rk(a,t,r,o,s),!!c)for(let l of u.owners){if(n.remaining-=1,n.remaining<0)return;i.add(l)}}return i}function WM(e,t,r,o,n,i){for(let a of e.identities){if(i.remaining-=1,i.remaining<0)return!1;if(!t.has(a)){let s=rk(a,r,o,n);if(!s)return!1;s.ownerDelta-=1}}for(let a of t){if(i.remaining-=1,i.remaining<0)return!1;if(!e.identities.has(a)){let s=rk(a,r,o,n);if(!s)return!1;s.ownerDelta+=1}}return!0}function KM(e,t,r,o,n,i){let a=new Map;for(let s of r){let u=s===e?t.roots:s.roots,c=FM(u,t.nodes,o,i);if(!c||!WM(s,c,t,o,n,i))return;a.set(s,c)}return a}function VM(e,t,r,o,n,i){let a=e-(o?0:tk(t))+tk(r);for(let[s,u]of n){let c=i.get(s),l=(c?.owners.size??0)+u.ownerDelta;if(l<0)return;c&&(a-=ek(c,c.owners.size)),l&&(a+=ek(u.node,l))}return Number.isSafeInteger(a)&&a>=0&&a<=Od?a:void 0}function qM(e,t,r){for(let[o,n]of t){let i=e.get(o);(i?.owners.size??0)+n.ownerDelta&&(i?(i.bytes=n.node.bytes,i.edges=n.node.edges):e.set(o,{bytes:n.node.bytes,edges:n.node.edges,owners:new Set}))}for(let[o,n]of r){for(let i of o.identities)n.has(i)||e.get(i)?.owners.delete(o);for(let i of n)o.identities.has(i)||e.get(i).owners.add(o);o.identities=n}for(let o of t.keys())e.get(o)?.owners.size===0&&e.delete(o)}function JM(){let e=new Map,t=0,r=(n,i,a)=>{let s={remaining:LM},u=new Map,c=BM(n,i,e,u,s);if(!c)return!1;let l=KM(n,i,c,e,u,s);if(!l)return!1;let d=VM(t,n,i,a,u,e);return d===void 0?!1:(qM(e,u,l),n.scalarBytes=i.scalarBytes,n.roots=i.roots,t=d,!0)};return{retain(n){let i={scalarBytes:0,roots:new Set,identities:new Set};return r(i,n,!0)?i:void 0},refresh(n,i){return r(n,i,!1)},release:n=>{t-=tk(n);for(let i of n.identities){let a=e.get(i);a?.owners.delete(n)&&(t-=qP,a.owners.size===0&&(t-=ek(a,0),e.delete(i)))}n.identities.clear()},clear(){e.clear(),t=0}}}var oi=class{constructor(){rn.add(this),this.controller=new AbortController,oh.set(this,void 0),ih.set(this,()=>{}),Ad.set(this,()=>{}),Id.set(this,void 0),ah.set(this,()=>{}),$d.set(this,()=>{}),Mr.set(this,Object.create(null)),uh.set(this,[]),Pd.set(this,new WeakMap),Sd.set(this,new Set),wu.set(this,new Set),ni.set(this,0),Oa.set(this,!1),ch.set(this,!1),lh.set(this,!1),xu.set(this,!1),z(this,oh,new Promise((t,r)=>{z(this,ih,t,"f"),z(this,Ad,r,"f")}),"f"),z(this,Id,new Promise((t,r)=>{z(this,ah,t,"f"),z(this,$d,r,"f")}),"f"),m(this,oh,"f").catch(()=>{}),m(this,Id,"f").catch(()=>{})}_run(t){setTimeout(()=>{let r=!1;Promise.resolve().then(t).catch(o=>{r=!0,m(this,rn,"m",sh).call(this,o)}).then(()=>{if(!r){try{this._emitFinal()}catch(o){m(this,rn,"m",sh).call(this,o);return}this._emit("end")}})},0)}_connected(){this.ended||(m(this,ih,"f").call(this),this._emit("connect"))}get ended(){return m(this,Oa,"f")}get errored(){return m(this,ch,"f")}get aborted(){return m(this,lh,"f")}abort(){this.controller.abort()}_listenForAbort(t){if(!t||this.ended)return;if(t.aborted){this.controller.abort();return}let r=()=>this.controller.abort();t.addEventListener("abort",r,{once:!0}),m(this,uh,"f").push({signal:t,listener:r})}on(t,r){var o;return((o=m(this,Mr,"f"))[t]||(o[t]=[])).push({listener:r}),this}off(t,r){let o=m(this,Mr,"f")[t];if(!o)return this;let n=m(this,Pd,"f").get(r);if(n?.event===t&&!n.registration.removed&&!n.registration.detached)return m(this,rn,"m",FP).call(this,t,n.registration),this;let i=o.findIndex(a=>!a.removed&&a.listener===r);return i!==-1&&o.splice(i,1),this}once(t,r){var o;return((o=m(this,Mr,"f"))[t]||(o[t]=[])).push({listener:r,once:!0}),this}emitted(t){return new Promise((r,o)=>{z(this,xu,!0,"f");let n=a=>{this.off(t,i),o(a)},i=(...a)=>{t!=="error"&&this.off("error",n),r(a.length>1?a:a[0])};t!=="error"&&m(this,rn,"m",Yx).call(this,"error",n),m(this,rn,"m",Yx).call(this,t,i)})}events(t){return this._createIterator(r=>{let o=(...n)=>{qx.add(n);try{r(n)}finally{qx.delete(n)}};return this.on(t,o),()=>this.off(t,o)},{rejectOnError:t!=="error",rejectOnAbort:t!=="abort"})}_createIterator(t,{rejectOnError:r=!0,rejectOnAbort:o=!0,onReturn:n}={}){let i=Xx(),a=Xx(),s=Xx(),u=JM(),c=this.ended,l,d=!1,p=()=>{},f=()=>({value:void 0,done:!0}),h=()=>{for(;s.length;)s.dequeue().resolve(f())},y=()=>{!l||d||!s.length||(d=!0,s.dequeue().reject(l))},_=()=>{p(),this.off("end",j),r&&this.off("error",C),o&&this.off("abort",C)},$=F=>{F.active=!1,F.check&&(m(this,wu,"f").delete(F.check),F.check=void 0)},v=(F=!1)=>{if(F){for(;a.length;)$(a.dequeue());i.clear(),u.clear()}let A=new k(`Event stream iterator buffer limit exceeded (${NP} events or ${Od} bytes); consume events as they arrive.`);try{m(this,rn,"m",sh).call(this,A)}finally{this.controller.abort()}return A},x=(F,A)=>{if(!A.active||m(this,Oa,"f"))return;let G=Gx(F,Od);(!G||!u.refresh(A.retention,G))&&v(!0)},S=F=>{if(c)return;let A=s.dequeue();if(A)A.resolve({value:F,done:!1});else{if(i.length>=NP){v();return}let G=Gx(F,Od),W=G&&u.retain(G);if(!W){v();return}if(typeof F=="object"&&F!==null&&qx.has(F)){let ne=F;for(let pe=0;pe<ne.length;pe+=1){let it=ne[pe];typeof it=="string"&&(ne[pe]=pM(dM(it)))}}let R={retention:W,active:!0,check:void 0};i.enqueue(F),a.enqueue(R);let Y=()=>{R.check=void 0,x(F,R)};R.check=Y,m(this,wu,"f").add(Y)}},C=F=>{l=F,i.length||y()},j=()=>{c=!0,_(),i.length||(y(),h())};return c||(p=t(S),this.on("end",j),r&&this.on("error",C),o&&this.on("abort",C)),{next:()=>{if(i.length){let F=i.dequeue(),A=a.dequeue();$(A);let G=Gx(F,Od);if(!G||!u.refresh(A.retention,G)){let W=v(!0);return d=!0,Promise.reject(W)}return u.release(A.retention),Promise.resolve({value:F,done:!1})}return l&&!d?(d=!0,Promise.reject(l)):c?Promise.resolve(f()):new Promise((F,A)=>{s.enqueue({resolve:F,reject:A})})},return:()=>{for(c=!0;a.length;)$(a.dequeue());return i.clear(),u.clear(),_(),h(),n&&(this.done().catch(()=>{}),n()),Promise.resolve(f())},[Symbol.asyncIterator](){return this}}}async done(){z(this,xu,!0,"f"),await m(this,Id,"f")}_hasListeners(t){return!!m(this,Mr,"f")[t]?.some(r=>!r.removed)}_emit(t,...r){if(m(this,Oa,"f"))return;t==="end"&&(m(this,rn,"m",ZP).call(this),z(this,Oa,!0,"f"),m(this,ah,"f").call(this));let o=m(this,Mr,"f")[t];if(o){m(this,Mr,"f")[t]=o.filter(n=>(n.once&&(n.detached=!0),!n.once&&!n.removed)),z(this,ni,m(this,ni,"f")+1,"f");try{for(let n of o)n.removed||n.listener(...r)}finally{if(z(this,ni,m(this,ni,"f")-1,"f"),m(this,ni,"f")===0){m(this,rn,"m",Qx).call(this);for(let n of m(this,wu,"f"))m(this,wu,"f").delete(n),m(this,Oa,"f")||n()}}}if(t==="abort"){let n=r[0];!m(this,xu,"f")&&!o?.length&&Promise.reject(n),m(this,Ad,"f").call(this,n),m(this,$d,"f").call(this,n),this._emit("end");return}if(t==="error"){let n=r[0];!m(this,xu,"f")&&!o?.length&&Promise.reject(n),m(this,Ad,"f").call(this,n),m(this,$d,"f").call(this,n),this._emit("end")}}_emitFinal(){}};oh=new WeakMap,ih=new WeakMap,Ad=new WeakMap,Id=new WeakMap,ah=new WeakMap,$d=new WeakMap,Mr=new WeakMap,uh=new WeakMap,Pd=new WeakMap,Sd=new WeakMap,wu=new WeakMap,ni=new WeakMap,Oa=new WeakMap,ch=new WeakMap,lh=new WeakMap,xu=new WeakMap,rn=new WeakSet,ZP=function(){for(let{signal:t,listener:r}of m(this,uh,"f").splice(0))t.removeEventListener("abort",r)},Yx=function(t,r){let o=m(this,Mr,"f")[t],n=o?.length??0;this.once(t,r);let i=m(this,Mr,"f")[t],[a]=i?.slice(-1)??[];(o===void 0||i===o)&&i?.length===n+1&&a?.listener===r&&a.once&&m(this,Pd,"f").set(r,{event:t,registration:a})},FP=function(t,r){r.removed||(r.removed=!0,m(this,Pd,"f").delete(r.listener),m(this,Sd,"f").add(t),m(this,ni,"f")===0&&m(this,rn,"m",Qx).call(this))},Qx=function(){for(let t of m(this,Sd,"f")){let r=t,o=m(this,Mr,"f")[r];o&&(m(this,Mr,"f")[r]=o.filter(n=>!n.removed))}m(this,Sd,"f").clear()},sh=function(t){if(z(this,ch,!0,"f"),t instanceof Error&&t.name==="AbortError"&&(t=new $e),t instanceof $e)return z(this,lh,!0,"f"),this._emit("abort",t);if(t instanceof k)return this._emit("error",t);if(t instanceof Error){let r=new k(t.message);return r.cause=t,this._emit("error",r)}return this._emit("error",new k(String(t)))};function JP(e){return typeof e.parse=="function"}var br,Pa,mh,nk,hh,ok,ik,ak,HP,XP,HM=10;function XM(e){for(let t of e.choices)for(let r of t.message.tool_calls??[])r.id||(r.id=`call_${Wo()}`)}function GM(e){if(!io(e))return e;let t={role:"assistant"};return e.audio!=null&&(t.audio={id:e.audio.id}),e.content!==void 0&&(t.content=e.content),e.function_call!=null&&(t.function_call=e.function_call),e.name!==void 0&&(t.name=e.name),e.refusal!=null&&(t.refusal=e.refusal),e.tool_calls!==void 0&&(t.tool_calls=e.tool_calls.map(r=>r.type==="custom"?{id:r.id,type:r.type,custom:{input:r.custom.input,name:r.custom.name}}:{id:r.id,type:r.type,function:{arguments:r.function.arguments,name:r.function.name}})),t}var Ta=class extends oi{constructor(){super(...arguments),br.add(this),this._chatCompletions=[],mh.set(this,!1),this.messages=[]}_addChatCompletion(t){z(this,mh,!this.controller.signal.aborted,"f"),XM(t),this._chatCompletions.push(t),this._emit("chatCompletion",t);let r=t.choices[0]?.message;return r&&this._addMessage(r),t}_addMessage(t,r=!0){if("content"in t||(t.content=null),this.messages.push(t),r){if(this._emit("message",t),xd(t)&&t.content)this._emit("functionToolCallResult",t.content);else if(io(t)&&t.tool_calls)for(let o of t.tool_calls)o.type==="function"&&this._emit("functionToolCall",o.function)}}async finalChatCompletion(){await this.done();let t=this._chatCompletions[this._chatCompletions.length-1];if(!t)throw new k("stream ended without producing a ChatCompletion");return t}async finalContent(){return await this.done(),m(this,br,"m",nk).call(this)}async finalMessage(){return await this.done(),m(this,br,"m",hh).call(this)}async finalFunctionToolCall(){return await this.done(),m(this,br,"m",ok).call(this)}async finalFunctionToolCallResult(){return await this.done(),m(this,br,"m",ik).call(this)}async totalUsage(){return await this.done(),m(this,br,"m",ak).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let t=this._chatCompletions[this._chatCompletions.length-1];t&&this._emit("finalChatCompletion",t);let r=m(this,br,"m",hh).call(this);r&&this._emit("finalMessage",r);let o=m(this,br,"m",nk).call(this);o&&this._emit("finalContent",o);let n=m(this,br,"m",ok).call(this);n&&this._emit("finalFunctionToolCall",n);let i=m(this,br,"m",ik).call(this);i!=null&&this._emit("finalFunctionToolCallResult",i),this._chatCompletions.some(a=>a.usage)&&this._emit("totalUsage",m(this,br,"m",ak).call(this))}async _createChatCompletion(t,r,o){this._listenForAbort(o?.signal),m(Pa,Pa,"m",HP).call(Pa,r);let n=await t.chat.completions.create({...r,stream:!1},{...o,signal:this.controller.signal});return this._connected(),this._addChatCompletion(wd(n,r))}async _runChatCompletion(t,r,o){for(let n of r.messages)this._addMessage(n,!1);return await this._createChatCompletion(t,r,o)}async _runTools(t,r,o,n){let i="tool",{tool_choice:a="auto",stream:s,toolContext:u,...c}=r,l=u,d=typeof a!="string"&&a.type==="function"&&a?.function?.name,{maxChatCompletions:p=HM,afterCompletion:f}=n||{},h=r.tools.map(x=>{if(tn(x)){if(!x.$callback)throw new k("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:x.$callback,name:x.function.name,description:x.function.description||"",parameters:x.function.parameters,parse:x.$parseRaw,strict:!0}}}return x}),y=Object.create(null);for(let x of h)x.type==="function"&&(y[x.function.name||x.function.function.name]=x.function);let _="tools"in r?h.map(x=>x.type==="function"?{type:"function",function:{name:x.function.name||x.function.function.name,parameters:x.function.parameters,description:x.function.description,strict:x.function.strict}}:x):void 0;for(let x of r.messages)this._addMessage(x,!1);let $=!1,v=async x=>{let S=$;if($=!1,x.type!=="function")return{message:void 0,functionCalled:!1};let C=x.id,{name:j,arguments:F}=x.function,A=y[j];if(!A){let R=`Invalid tool_call: ${JSON.stringify(j)}. Available options are: ${Object.keys(y).map(Y=>JSON.stringify(Y)).join(", ")}. Please try again`;return{message:{role:i,tool_call_id:C,content:R},functionCalled:!1}}if(d&&d!==j){let R=`Invalid tool_call: ${JSON.stringify(j)}. ${JSON.stringify(d)} requested. Please try again`;return{message:{role:i,tool_call_id:C,content:R},functionCalled:!1}}let G;if(JP(A)){let R;try{R=await A.parse(F)}catch(Y){if(this.controller.signal.aborted)throw new $e;let ne=Y instanceof Error?Y.message:String(Y);return{message:{role:i,tool_call_id:C,content:ne},functionCalled:!1}}if(this.controller.signal.aborted)throw new $e;G=await A.function(R,o,l)}else{if(this.controller.signal.aborted&&!S)throw new $e;G=await A.function(F,o,l)}let W=m(Pa,Pa,"m",XP).call(Pa,G);return{message:{role:i,tool_call_id:C,content:W},functionCalled:!0}};for(let x=0;x<p;++x){let S=await this._createChatCompletion(t,{...c,tool_choice:a,tools:_,messages:this.messages.map(GM)},n);$=this.controller.signal.aborted&&m(this,mh,"f");let C=S.choices[0]?.message;if(!C)throw new k("missing message in ChatCompletion response");if(!C.tool_calls?.length){await f?.(S,o);return}if(d||r.parallel_tool_calls===!1)for(let j of C.tool_calls){let F=await v(j);if(F.message&&this._addMessage(F.message),this.controller.signal.aborted)throw new $e;if(d&&F.functionCalled){await f?.(S,o);return}}else{let j=await Promise.allSettled(C.tool_calls.map(v));if(!this.controller.signal.aborted){for(let F of j)if(F.status==="rejected")throw F.reason}for(let F of j)F.status==="fulfilled"&&F.value.message&&this._addMessage(F.value.message);if(this.controller.signal.aborted)throw new $e}await f?.(S,o)}}};Pa=Ta,mh=new WeakMap,br=new WeakSet,nk=function(){return m(this,br,"m",hh).call(this).content??null},hh=function(){let t=this.messages.length;for(;t-- >0;){let r=this.messages[t];if(io(r))return{...r,content:r.content??null,refusal:r.refusal??null}}throw new k("stream ended without producing a ChatCompletionMessage with role=assistant")},ok=function(){for(let t=this.messages.length-1;t>=0;t--){let r=this.messages[t];if(io(r)&&r?.tool_calls?.length)for(let o=r.tool_calls.length-1;o>=0;o--){let n=r.tool_calls[o];if(n?.type==="function")return n.function}}},ik=function(){for(let t=this.messages.length-1;t>=0;t--){let r=this.messages[t];if(xd(r)&&r.content!=null&&typeof r.content=="string"&&this.messages.some(o=>o.role==="assistant"&&o.tool_calls?.some(n=>n.type==="function"&&n.id===r.tool_call_id)))return r.content}},ak=function(){let t={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:r}of this._chatCompletions)r&&(t.completion_tokens+=r.completion_tokens,t.prompt_tokens+=r.prompt_tokens,t.total_tokens+=r.total_tokens);return t},HP=function(t){if(t.n!=null&&t.n>1)throw new k("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},XP=function(t){return typeof t=="string"?t:t===void 0?"undefined":JSON.stringify(t)};var Ed=class e extends Ta{static runTools(t,r,o){let n=new e,i={...o,__metadata:{...o?.__metadata,helperMethod:"runTools"}};return n._run(()=>n._runTools(t,r,n,i)),n}_addMessage(t,r=!0){super._addMessage(t,r),io(t)&&t.content&&this._emit("content",t.content)}};var At={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,INF:384,SPECIAL:496,ATOM:499,COLLECTION:12,ALL:511},sk=class extends Error{},Rd=class extends Error{};function YM(e,t=At.ALL){if(typeof e!="string")throw new TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw new Error(`${e} is empty`);return QM(e.trim(),t)}var QM=(e,t)=>{let r=e.length,o=0,n=p=>{throw new sk(`${p} at position ${o}`)},i=p=>{throw new Rd(`${p} at position ${o}`)},a=()=>(d(),o>=r&&n("Unexpected end of input"),e[o]==='"'?s():e[o]==="{"?u():e[o]==="["?c():e.substring(o,o+4)==="null"||At.NULL&t&&r-o<4&&"null".startsWith(e.substring(o))?(o+=4,null):e.substring(o,o+4)==="true"||At.BOOL&t&&r-o<4&&"true".startsWith(e.substring(o))?(o+=4,!0):e.substring(o,o+5)==="false"||At.BOOL&t&&r-o<5&&"false".startsWith(e.substring(o))?(o+=5,!1):e.substring(o,o+8)==="Infinity"||At.INFINITY&t&&r-o<8&&"Infinity".startsWith(e.substring(o))?(o+=8,1/0):e.substring(o,o+9)==="-Infinity"||At.MINUS_INFINITY&t&&r-o>1&&r-o<9&&"-Infinity".startsWith(e.substring(o))?(o+=9,-1/0):e.substring(o,o+3)==="NaN"||At.NAN&t&&r-o<3&&"NaN".startsWith(e.substring(o))?(o+=3,Number.NaN):l()),s=()=>{let p=o,f=!1;for(o++;o<r&&(e[o]!=='"'||f&&e[o-1]==="\\");)f=e[o]==="\\"?!f:!1,o++;if(e.charAt(o)==='"')try{return JSON.parse(e.substring(p,++o-Number(f)))}catch(h){i(String(h))}else if(At.STR&t)try{return JSON.parse(e.substring(p,o-Number(f))+'"')}catch{return JSON.parse(e.substring(p,e.lastIndexOf("\\"))+'"')}n("Unterminated string literal")},u=()=>{o++,d();let p={};try{for(;e[o]!=="}";){if(d(),o>=r&&At.OBJ&t)return p;let f=s();d(),o++;try{let h=a();Object.defineProperty(p,f,{value:h,writable:!0,enumerable:!0,configurable:!0})}catch(h){if(At.OBJ&t)return p;throw h}d(),e[o]===","&&o++}}catch{if(At.OBJ&t)return p;n("Expected '}' at end of object")}return o++,p},c=()=>{o++;let p=[];try{for(;e[o]!=="]";)p.push(a()),d(),e[o]===","&&o++}catch{if(At.ARR&t)return p;n("Expected ']' at end of array")}return o++,p},l=()=>{if(o===0){e==="-"&&At.NUM&t&&n("Not sure what '-' is");try{return JSON.parse(e)}catch(f){if(At.NUM&t)try{return e[e.length-1]==="."?JSON.parse(e.substring(0,e.lastIndexOf("."))):JSON.parse(e.substring(0,e.lastIndexOf("e")))}catch{}i(String(f))}}let p=o;for(e[o]==="-"&&o++;e[o]&&!",]}".includes(e[o]);)o++;o===r&&!(At.NUM&t)&&n("Unterminated number literal");try{return JSON.parse(e.substring(p,o))}catch{e.substring(p,o)==="-"&&At.NUM&t&&n("Not sure what '-' is");try{return JSON.parse(e.substring(p,e.lastIndexOf("e")))}catch(f){i(String(f))}}},d=()=>{for(;o<r&&`
118
+ \r `.includes(e[o]);)o++};return a()},GP=e=>YM(e,At.ALL^At.NUM);var Ge,ht,ii,Ea,Xt,Ur,wr,uk,ku,ck,lk,dk,Au,Cd,YP;function QP(e){try{return GP(e)}catch(t){if(t instanceof Rd||t instanceof SyntaxError)return en({type:"json_schema",$parseRaw:void 0},e);throw t}}var xk="chat.completion.chunk.message:";function iT(e,t,r){let o={type:"message",message:t,...r?{tool_call_ids:r}:{}};return{id:e.id,choices:[],created:e.created,model:e.model,object:`${xk}${JSON.stringify(o)}`}}function eU(e){return"type"in e&&e.type==="message"&&"message"in e||"object"in e&&typeof e.object=="string"&&e.object.startsWith(xk)}function tU(e){return"type"in e?e:JSON.parse(e.object.slice(xk.length))}var gh=128,ai=128,rU=16*1024*1024,nU=65536,kk=128,aT=64*1024*1024,eT=1024;function _k(){return{bytes:0,depth:0,fragments:0,work:0,escaped:!1,has_non_whitespace:!1,in_string:!1,last_parsed_bytes:0,pending_high_surrogate:!1}}function vk(e,t,r,o){if(t.fragments>=nU)throw new k("Chat completion stream exceeded its structured JSON fragment limit");let n=0,{depth:i,escaped:a,has_non_whitespace:s,in_string:u}=e,c=!1,l=!0;for(let p of r){let f=n,h=p.codePointAt(0);if(l&&e.pending_high_surrogate&&h>=56320&&h<=57343||h<=127?n+=1:h<=2047?n+=2:h<=65535?n+=3:n+=4,l=!1,t.bytes+n>rU)throw new k("Chat completion stream exceeded its structured JSON byte limit");if(o&&o.work+n>aT)throw o.work+=f,new k("Chat completion stream exceeded its structured JSON parse-work limit");if(p!==" "&&p!==`
119
+ `&&p!=="\r"&&p!==" "&&(s=!0),u){a?a=!1:p==="\\"?a=!0:p==='"'&&(u=!1,c||(c=i===0));continue}if(p==='"')u=!0;else if(p==="{"||p==="["){if(i+=1,i>kk)throw new k("Chat completion stream exceeded its structured JSON nesting depth limit")}else(p==="}"||p==="]")&&i>0&&(i-=1,c||(c=i===0))}if(e.bytes+=n,e.fragments+=1,e.depth=i,e.escaped=a,e.has_non_whitespace=s,e.in_string=u,r.length>0){let p=r.codePointAt(r.length-1)??0;e.pending_high_surrogate=p>=55296&&p<=56319}if(t.bytes+=n,t.fragments+=1,o&&(o.work+=n),!s||n===0)return!1;let d=Math.max(eT,Math.floor(e.last_parsed_bytes/2));return!(e.bytes>eT&&!c&&e.bytes-e.last_parsed_bytes<d)}function bk(e,t){return t.work+e.bytes>aT?!1:(t.work+=e.bytes,e.work+=e.bytes,e.last_parsed_bytes=e.bytes,!0)}function Lr(e,t){let r=Object.getOwnPropertyDescriptor(e,t);if(!r){let o=Object.getPrototypeOf(e);for(let n=0;o!==null;n+=1){if(n>=kk||Object.getOwnPropertyDescriptor(o,t))throw new k("Chat completion stream contains an unsafe structured JSON snapshot");o=Object.getPrototypeOf(o)}return}if(!("value"in r)||typeof r.value!="string"&&r.value!==null&&r.value!==void 0)throw new k("Chat completion stream contains an unsafe structured JSON snapshot");return r.value}function zd(e){let t=Object.getOwnPropertyDescriptor(e,"message");if(!t||!("value"in t)||typeof t.value!="object"||t.value===null)throw new k("Chat completion stream contains an unsafe structured JSON snapshot");return t.value}function tT(e,t,r,o){let n=Object.getOwnPropertyDescriptor(e,t);if(!n){let a=Object.getPrototypeOf(e);for(let s=0;a!==null;s+=1){if(s>=kk||Object.getOwnPropertyDescriptor(a,t))throw new k(`Chat completion stream contains an unsafe snapshot ${o} collection`);a=Object.getPrototypeOf(a)}return}if(!("value"in n)||!Array.isArray(n.value))throw new k(`Chat completion stream contains an unsafe snapshot ${o} collection`);let i=Object.getOwnPropertyDescriptor(n.value,"length");if(!i||!("value"in i)||!Number.isSafeInteger(i.value)||i.value>r)throw new k(`Chat completion stream exceeded its snapshot ${o} limit`);return n.value}function pk(e,t){let r=Object.getOwnPropertyDescriptor(e,t);if(r){if(!("value"in r))throw new k("Chat completion stream contains an unsafe structured JSON snapshot");return r.value}}function rT(e,t,r,o){let n=Object.getOwnPropertyDescriptor(e,"length"),i=n&&"value"in n?n.value:void 0;if(typeof i!="number"||!Number.isSafeInteger(i)||i<0||i>t)throw new k(`Chat completion stream exceeded its snapshot ${r} limit`);let a=[];a.length=i;for(let s=0;s<i;s+=1){let u=Object.getOwnPropertyDescriptor(e,s);if(u){if(!("value"in u))throw new k("Chat completion stream contains an unsafe structured JSON snapshot");a[s]=o(u.value,s)}}return a}function Ra(e,t,r){let o=_k(),n=t??{bytes:0,fragments:0,work:0};if(vk(o,n,e,r),!bk(o,n))throw new k("Chat completion stream exceeded its structured JSON parse-work limit");return e}function yh(e){let t=Object.getOwnPropertyDescriptor(e,"type"),r=Object.getOwnPropertyDescriptor(e,"function");if(!t||!("value"in t)||t.value!=="function"||!r||!("value"in r)||typeof r.value!="object"||r.value===null)return;let o=Object.getOwnPropertyDescriptor(r.value,"name");if(!(!o||!("value"in o)||typeof o.value!="string"||o.value.length===0))return{type:"function",name:o.value}}function fk(e,t){let r=yh(e);if(!r||r.name!==t.name||r.type!==t.type)throw new k("Chat completion stream contains a changed tool call identity")}function Nd(e,t){return Object.prototype.propertyIsEnumerable.call(t,"__proto__")&&!ie(e,"__proto__")&&Object.defineProperty(e,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0}),Object.assign(e,t)}function jd(e,t=[]){let r=Object.getOwnPropertyDescriptors(e);for(let o of t){let n=r[o];!n&&!(o in e)||(r[o]={value:n&&"value"in n?n.value:Reflect.get(e,o,e),enumerable:n?.enumerable??!1,configurable:n?.configurable??!0,writable:n&&"writable"in n?n.writable:!1})}return Object.create(Object.getPrototypeOf(e),r)}function oU(e){let t=jd(e);if(e.tools){let r=[],o=Object.getOwnPropertyDescriptor(e.tools,"length"),n=o&&"value"in o?o.value:void 0,i=typeof n=="number"&&Number.isSafeInteger(n)&&n>=0?Math.min(n,ai):0;for(let a=0;a<i;a+=1){let s=Object.getOwnPropertyDescriptor(e.tools,String(a));if(!s||!("value"in s)){r.length=a+1;continue}let u=s.value,c=jd(u,["type","$brand","$parseRaw","$callback","function"]),l=Object.getOwnPropertyDescriptors(c);if(Rn(c)){let d=l.function;l.function={...d&&"value"in d?d:{configurable:!0,enumerable:!0,writable:!0},value:jd(c.function,["name","strict"])}}r[a]=Object.create(Object.getPrototypeOf(u),l)}t.tools=r}return e.response_format&&(t.response_format=jd(e.response_format,["type","$brand","$parseRaw"])),t}var mk=4096,hk=JSON.stringify,iU=1024*1024,aU=64,gk=Symbol("omitted serialized parser value"),It=Symbol("unsafe serialized parser value");function sT(e,t){let r=new WeakSet,o=i=>!Number.isSafeInteger(i)||i<0||t.bytes+i>iU?!1:(t.bytes+=i,!0),n=(i,a)=>{if(a>aU||t.nodes>=mk)return It;if(t.nodes+=1,i===void 0||typeof i=="function"||typeof i=="symbol")return gk;if(typeof i=="bigint")return It;if(i===null||typeof i=="boolean"||typeof i=="number"){let c=hk(i);return typeof c=="string"&&o(c.length)?c:It}if(typeof i=="string")return o(i.length*6+2)?hk(i):It;if(typeof i!="object"||r.has(i))return It;let s=Array.isArray(i),u=Object.getPrototypeOf(i);if(s&&u!==Array.prototype||!s&&u!==null&&u!==Object.prototype)return It;for(let c=i;c!==null;c=Object.getPrototypeOf(c)){let l=Object.getOwnPropertyDescriptor(c,"toJSON");if(l){if(!("value"in l)||typeof l.value=="function")return It;break}}r.add(i);try{if(!o(2))return It;if(s){let p=Object.getOwnPropertyDescriptor(i,"length"),f=p&&"value"in p?p.value:void 0;if(typeof f!="number"||!Number.isSafeInteger(f)||f<0||f>mk-t.nodes)return It;let h=[];for(let y=0;y<f;y+=1){let _=String(y),$=Object.getOwnPropertyDescriptor(i,_);if(!$){if(Object.getOwnPropertyDescriptor(Array.prototype,_)||Object.getOwnPropertyDescriptor(Object.prototype,_)||(t.nodes+=1,!o(4)))return It;h.push("null");continue}if(!("value"in $))return It;let v=n($.value,a+1);if(v===It)return v;h.push(v===gk?"null":v)}return`[${h.join(",")}]`}let c=Reflect.ownKeys(i);if(c.length>mk-t.nodes)return It;let l=[];for(let p of c){if(typeof p!="string")continue;let f=Object.getOwnPropertyDescriptor(i,p);if(!f)return It;if(f.enumerable){if(!("value"in f))return It;l.push([p,f.value])}}l.sort(([p],[f])=>p===f?0:p<f?-1:1);let d=[];for(let[p,f]of l){let h=n(f,a+1);if(h===It)return h;if(h!==gk){if(!o(p.length*6+3))return It;d.push(`${hk(p)}:${h}`)}}return`{${d.join(",")}}`}finally{r.delete(i)}};try{let i=n(e,0);return typeof i=="string"?i:void 0}catch{return}}function nT(e,t,r,o){let n=Object.getOwnPropertyDescriptor(t,"$parseRaw"),i=Object.getOwnPropertyDescriptor(r,o);if(!n||!("value"in n)||typeof n.value!="function"||!i||!("value"in i))return;let a=sT(i.value,{nodes:0,bytes:0});a!==void 0&&e.set(t,a)}function oT(e,t,r,o,n){let i=t&&e.get(t),a=Object.getOwnPropertyDescriptor(r,o);return i!==void 0&&a!==void 0&&"value"in a&&sT(n,{nodes:0,bytes:0})===i}function Iu(e,t){return e&&"value"in e?{...e,value:t}:{configurable:!0,enumerable:!0,writable:!0,value:t}}function wk(e,t,r){for(let o of r){let n=e[o];!n&&!(o in t)||(e[o]=n&&"value"in n?{...n,value:void 0}:{configurable:n?.configurable??!0,enumerable:n?.enumerable??!1,writable:!1,value:void 0})}}function sU(e){let t=e.source??{type:e.type,...e.type==="function"?{function:{}}:{}},r=Object.getOwnPropertyDescriptors(t);if(r.type=Iu(r.type,e.type),e.type!=="function"||!e.function)return r.function&&(r.function=Iu(r.function,void 0)),wk(r,t,["$brand","$parseRaw","$callback"]),Object.create(Object.getPrototypeOf(t),r);let o=r.function,n=o&&"value"in o&&typeof o.value=="object"&&o.value!==null?o.value:{},i=Object.getOwnPropertyDescriptors(n);return i.name=Iu(i.name,e.function.name),i.strict=Iu(i.strict,e.function.strict),r.function=Iu(o,Object.create(Object.getPrototypeOf(n),i)),e.function.schemaMatches||wk(r,t,["$brand","$parseRaw","$callback"]),Object.create(Object.getPrototypeOf(t),r)}function uU(e){let t=e.source??{type:e.type},r=Object.getOwnPropertyDescriptors(t);return r.type=Iu(r.type,e.type),(e.type!=="json_schema"||!e.source||!e.schemaMatches)&&wk(r,t,["$brand","$parseRaw"]),Object.create(Object.getPrototypeOf(t),r)}function yk(e,t){let r=Object.getOwnPropertyDescriptor(e,t);if(!r||!("value"in r))return;let{value:o}=r;return typeof o=="object"&&o!==null?o:void 0}function cU(e,t,r){let o=new WeakMap,n=new WeakMap;if(e.tools)for(let f=0;f<e.tools.length&&f<ai;f+=1){let h=yk(e.tools,String(f)),y=t.tools?.[f];if(h&&y){o.set(h,y);let _=yk(y,"function");_&&nT(n,y,_,"parameters")}}t.response_format&&nT(n,t.response_format,t.response_format,"json_schema");let i,a,s,u,c=[],l=new WeakMap,d=new Map,p=new WeakMap;return M0(e,{value(f,h,y){if(!i&&h===""&&typeof y=="object"&&y!==null){i=y,a=void 0,s=void 0,u=void 0,c=[],l=new WeakMap,d=new Map,p=new WeakMap;return}if(f===i&&h==="response_format"){typeof y=="object"&&y!==null&&(s=y,u={source:yk(f,h)===e.response_format?t.response_format:void 0,schemaMatches:!1});return}if(f===i&&h==="tools")return Array.isArray(y)?(a=new Proxy(y,{get(v,x){let S=Reflect.get(v,x,v);if(typeof x=="string"){let C=Number(x);Number.isSafeInteger(C)&&C>=0&&C<ai&&String(C)===x&&d.set(C,typeof S=="object"&&S!==null?S:void 0)}return S}}),a):void 0;if(f===a){let v=Number(h);if(!Number.isSafeInteger(v)||v<0||v>=ai||typeof y!="object"||y===null)return;let x=d.get(v),C={source:x?o.get(x):void 0};c[v]=C,l.set(y,C);return}let _=l.get(f);if(_){if(h==="type"&&typeof y=="string")_.type=y;else if(h==="function"&&typeof y=="object"&&y!==null){let v={source:_.source,schemaMatches:!1};_.function=v,p.set(y,v)}return}if(f===s&&u){h==="type"&&typeof y=="string"?u.type=y:h==="json_schema"&&(u.schemaMatches=oT(n,u.source,f,h,y));return}let $=p.get(f);$&&(h==="name"&&typeof y=="string"?$.name=y:h==="strict"&&typeof y=="boolean"?$.strict=y:h==="parameters"&&($.schemaMatches=oT(n,$.source,f,h,y)))},complete(){if(!i)return;let f=jd(t);if(a){let h=[];for(let y=0;y<c.length;y+=1){let _=c[y];_&&(h[y]=sU(_))}f.tools=h}else delete f.tools;u?f.response_format=uU(u):delete f.response_format,r(f),i=void 0,a=void 0,s=void 0,u=void 0,c=[],l=new WeakMap,d=new Map,p=new WeakMap}})}var Ca=class e extends Ta{constructor(t){super(),Ge.add(this),ht.set(this,void 0),ii.set(this,void 0),Ea.set(this,void 0),Xt.set(this,void 0),Ur.set(this,void 0),wr.set(this,void 0),z(this,ht,t,"f"),z(this,ii,new Set,"f"),z(this,Ea,[],"f"),z(this,Ur,!1,"f");let r=t?.tools,o=r&&Object.getOwnPropertyDescriptor(r,"length"),n=o&&"value"in o?o.value:void 0;if(r&&typeof n=="number"&&Number.isSafeInteger(n)&&n>=0)for(let i=0;i<Math.min(n,ai);i+=1){let a=Object.getOwnPropertyDescriptor(r,String(i));if(!a||!("value"in a))continue;let s=a.value;if(Rn(s)&&(tn(s)||s.function.strict===!0)){z(this,Ur,!0,"f");break}}z(this,wr,{bytes:0,fragments:0,work:0},"f")}get currentChatCompletionSnapshot(){return m(this,Xt,"f")}static fromReadableStream(t){let r=new e(null);return r._run(()=>r._fromReadableStream(t)),r}static createChatCompletion(t,r,o){let n=new e(r);return n._run(()=>n._runChatCompletion(t,{...r,stream:!0},{...o,__metadata:{...o?.__metadata,helperMethod:"stream"}})),n}async _createChatCompletion(t,r,o){this._listenForAbort(o?.signal);let n={...r,stream:!0};z(this,ht,n,"f"),m(this,Ge,"m",uk).call(this);let i=oU(n);z(this,ht,i,"f"),z(this,Ur,i.tools?.some(u=>Rn(u)&&(tn(u)||u.function.strict===!0))??!1,"f");let a=n.tools||n.response_format?cU(n,i,u=>{z(this,ht,u,"f"),z(this,Ur,u.tools?.some(c=>Rn(c)&&(tn(c)||c.function.strict===!0))??!1,"f")}):void 0,s=await t.chat.completions.create(n,{...o,signal:this.controller.signal}).finally(a);this._connected();for await(let u of s)m(this,Ge,"m",ck).call(this,u);if(s.controller.signal?.aborted)throw new $e;return this._addChatCompletion(m(this,Ge,"m",Cd).call(this))}async _fromReadableStream(t,r){this._listenForAbort(r?.signal),m(this,Ge,"m",uk).call(this),this._connected();let o=sr.fromReadableStream(t,this.controller),n;for await(let a of o){if(eU(a)){let u=tU(a);if(m(this,Xt,"f")){let c=m(this,Xt,"f").choices[0]?.message.tool_calls;for(let[l,d]of u.tool_call_ids?.entries()??[]){let p=c?.[l];p&&d&&(p.id=d)}this._addChatCompletion(m(this,Ge,"m",Cd).call(this)),n=void 0}this._addMessage(u.message);continue}let s=a;n&&s.id&&n!==s.id&&this._addChatCompletion(m(this,Ge,"m",Cd).call(this)),m(this,Ge,"m",ck).call(this,s),s.id&&(n=s.id)}if(o.controller.signal?.aborted)throw new $e;if(m(this,Xt,"f"))return this._addChatCompletion(m(this,Ge,"m",Cd).call(this));let i=this._chatCompletions[this._chatCompletions.length-1];if(i)return i;throw new k("request ended without sending any chunks")}[(ht=new WeakMap,ii=new WeakMap,Ea=new WeakMap,Xt=new WeakMap,Ur=new WeakMap,wr=new WeakMap,Ge=new WeakSet,uk=function(){this.ended||(z(this,ii,new Set,"f"),z(this,Xt,void 0,"f"),z(this,wr,{bytes:0,fragments:0,work:0},"f"))},ku=function(r){let o=m(this,Ea,"f")[r.index];return o||(o={content_done:!1,content_parse_state:void 0,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null,tool_call_parse_states:new Map,tool_call_identities:new Map},m(this,Ea,"f")[r.index]=o,o)},ck=function(r){if(this.ended)return;let o=new WeakMap,n=m(this,Ge,"m",YP).call(this,r,o);this._emit("chunk",r,n);for(let i of r.choices){let a=o.get(i),s=n.choices[a?.index??i.index],u=a?.tool_calls??[],{delta:c}=i,l=Cn(m(this,ht,"f")?.response_format),d=l||m(this,Ur,"f"),p=d?zd(s):s.message,f=d?Lr(p,"refusal"):p.refusal,y=!f&&l?Lr(p,"content"):p.content;c?.content!=null&&p.role==="assistant"&&y&&(this._emit("content",c.content,y),this._emit("content.delta",{delta:c.content,snapshot:y,parsed:p.parsed})),c?.refusal!=null&&p.role==="assistant"&&f&&this._emit("refusal.delta",{delta:c.refusal,snapshot:f}),i.logprobs?.content!=null&&p.role==="assistant"&&this._emit("logprobs.content.delta",{content:i.logprobs?.content,snapshot:s.logprobs?.content??[]}),i.logprobs?.refusal!=null&&p.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:i.logprobs?.refusal,snapshot:s.logprobs?.refusal??[]});let _=m(this,Ge,"m",ku).call(this,s);s.finish_reason&&(m(this,Ge,"m",dk).call(this,s),_.current_tool_call_index!=null&&m(this,Ge,"m",lk).call(this,s,_.current_tool_call_index));for(let $ of u)_.current_tool_call_index!==$.index&&(m(this,Ge,"m",dk).call(this,s),_.current_tool_call_index!=null&&m(this,Ge,"m",lk).call(this,s,_.current_tool_call_index)),_.current_tool_call_index=$.index;for(let $ of u){let v=p.tool_calls?.[$.index];if(v?.type)if(v.type==="function"){let x=_.tool_call_identities.get($.index),S;if(x?.parseable){let C=Lr(v.function,"arguments");if(typeof C!="string")throw new k("Chat completion stream contains an unsafe structured JSON snapshot");S=C}else S=v.function.arguments;this._emit("tool_calls.function.arguments.delta",{name:v.function.name,index:$.index,arguments:S,parsed_arguments:v.function.parsed_arguments,arguments_delta:$.arguments_delta})}else v.type!=="custom"&&v}}},lk=function(r,o){let n=m(this,Ge,"m",ku).call(this,r);if(n.done_tool_calls.has(o))return;let a=(m(this,Ur,"f")?zd(r):r.message).tool_calls?.[o];if(!a)throw new Error("no tool call snapshot");let s=n.tool_call_identities.get(o);if(s&&fk(a,s),!a.type)throw new Error("tool call snapshot missing `type`");if(a.type==="function"){let u=m(this,ht,"f")?.tools?.find(p=>Rn(p)&&p.function.name===a.function.name),c=null,l=tn(u)||u?.function.strict===!0,d;if(l){m(this,Xt,"f")&&m(this,Ge,"m",Au).call(this,m(this,Xt,"f"));let p=Lr(a.function,"arguments");if(typeof p!="string")throw new k("Chat completion stream contains an unsafe structured JSON snapshot");d=p}else d=a.function.arguments;tn(u)?c=u.$parseRaw(Ra(d)):u?.function.strict&&(c=en({type:"json_schema",$parseRaw:void 0},Ra(d))),this._emit("tool_calls.function.arguments.done",{name:a.function.name,index:o,arguments:d,parsed_arguments:c})}else a.type!=="custom"&&a},dk=function(r){let o=m(this,Ge,"m",ku).call(this,r),n=Cn(m(this,ht,"f")?.response_format),i=n||m(this,Ur,"f"),a=i?zd(r):r.message,s=i?Lr(a,"refusal"):a.refusal,u=!s&&n,c=u?Lr(a,"content"):a.content;c!=null&&(c!==""||!s&&!a.tool_calls?.length&&!a.function_call)&&!o.content_done&&(u&&m(this,Xt,"f")&&m(this,Ge,"m",Au).call(this,m(this,Xt,"f")),o.content_done=!0,this._emit("content.done",{content:c,parsed:s?null:en(m(this,ht,"f")?.response_format,u?Ra(c):c)})),s&&!o.refusal_done&&(o.refusal_done=!0,this._emit("refusal.done",{refusal:s})),r.logprobs?.content&&!o.logprobs_content_done&&(o.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:r.logprobs.content})),r.logprobs?.refusal&&!o.logprobs_refusal_done&&(o.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:r.logprobs.refusal}))},Au=function(r){let o={bytes:0,fragments:0,work:0},n=Cn(m(this,ht,"f")?.response_format),i=new WeakMap,a=tT(r,"choices",gh,"choice");if(!a)throw new k("Chat completion stream contains an unsafe snapshot choice collection");for(let s=0;s<a.length;s+=1){let u=pk(a,s);if(!u)continue;let c=zd(u),l=Lr(c,"refusal"),d=Lr(c,"content"),p=new Map,f=tT(c,"tool_calls",ai,"tool-call");i.set(u,Object.freeze({message:c,content:d,refusal:l,toolCallCollection:f,toolCalls:p}));let h=m(this,Ea,"f")[u.index];n&&!l&&typeof d=="string"&&Ra(d,o,m(this,wr,"f"));for(let[y,_]of h?.tool_call_identities??[]){let $=f&&pk(f,y);if(!$)throw new k("Chat completion stream contains a changed tool call identity");fk($,_)}if(m(this,Ur,"f"))for(let y=0;y<(f?.length??0);y+=1){let _=pk(f,y);if(!_)continue;let $=yh(_);if(!$){let C=Object.getOwnPropertyDescriptor(_,"type");if(C&&!("value"in C))throw new k("Chat completion stream contains an unsafe structured JSON snapshot");if(C?.value!=="function")continue;let j=Object.getOwnPropertyDescriptor(_,"function");if(j&&!("value"in j))throw new k("Chat completion stream contains an unsafe structured JSON snapshot");if(j&&typeof j.value=="object"&&j.value!==null){let F=Object.getOwnPropertyDescriptor(j.value,"name");if(F&&!("value"in F))throw new k("Chat completion stream contains an unsafe structured JSON snapshot")}continue}if(!th(m(this,ht,"f"),{type:$.type,function:{name:$.name}}))continue;let v=Object.getOwnPropertyDescriptor(_,"function");if(!v||!("value"in v))throw new k("Chat completion stream contains an unsafe structured JSON snapshot");let x=v.value,S=Lr(x,"arguments");if(typeof S!="string")throw new k("Chat completion stream contains an unsafe structured JSON snapshot");Ra(S,o,m(this,wr,"f")),p.set(y,Object.freeze({tool:_,function:x,type:$.type,name:$.name,arguments:S}))}}return i},Cd=function(){if(this.ended)throw new k("stream has ended, this shouldn't happen");let r=m(this,Xt,"f");if(!r)throw new k("request ended without sending any chunks");let o=m(this,Ge,"m",Au).call(this,r),n=m(this,ii,"f");return z(this,ii,new Set,"f"),z(this,Xt,void 0,"f"),z(this,Ea,[],"f"),lU(r,m(this,ht,"f"),n,o)},YP=function(r,o){var n,i,a,s,u;let c=m(this,Xt,"f"),{choices:l,obfuscation:d,...p}=r;if(c)r.id&&Nd(c,p);else{let y={...p,choices:[]};z(this,Xt,y,"f"),c=y}let f=m(this,ht,"f")?.n,h=typeof f=="number"&&Number.isSafeInteger(f)&&f>0?Math.min(f,gh):gh;for(let y of r.choices){let{delta:_,finish_reason:$,index:v,logprobs:x=null,...S}=y,C=[];if(o.set(y,Object.freeze({index:v,tool_calls:C})),!Number.isSafeInteger(v)||v<0||v>=h)throw new k(`Chat completion stream contains an invalid choice index: ${v}`);let j=c.choices[v];if(!j){let Q={finish_reason:$,index:v,message:{},logprobs:null,...S};c.choices[v]=Q,j=Q}if((Cn(m(this,ht,"f")?.response_format)||m(this,Ur,"f"))&&Lr(zd(j),"refusal"),x)if(j.logprobs){let{content:Q,refusal:Tt,...Ue}=x;Nd(j.logprobs,Ue),Q&&((n=j.logprobs).content??(n.content=[]),j.logprobs.content.push(...Q)),Tt&&((i=j.logprobs).refusal??(i.refusal=[]),j.logprobs.refusal.push(...Tt))}else j.logprobs={...x},x.content&&(j.logprobs.content=[...x.content]),x.refusal&&(j.logprobs.refusal=[...x.refusal]);if($&&(j.finish_reason=$,m(this,ht,"f")&&Vx(m(this,ht,"f")))){if($==="length")throw new Qo;if($==="content_filter")throw new ei}if(Nd(j,S),!_){Object.freeze(C);continue}m(this,ii,"f").delete(v);let{audio:F,content:A,refusal:G,function_call:W,role:R,...Y}=_,{tool_calls:ne,...pe}=Y,it=ie(Y,"tool_calls")?ne:_.tool_calls;if(Nd(j.message,pe),F?.expires_at!=null&&F.id==null&&F.data==null&&F.transcript==null&&A==null&&G==null&&W==null&&R==null&&it==null&&Object.keys(pe).length===0&&m(this,ii,"f").add(v),G&&(j.message.refusal=(j.message.refusal||"")+G),R&&(j.message.role=R),F){let Q=(a=j.message).audio??(a.audio={});F.id!=null&&(Q.id=F.id),F.data!=null&&(Q.data=(Q.data??"")+F.data),F.transcript!=null&&(Q.transcript=(Q.transcript??"")+F.transcript),F.expires_at!=null&&(Q.expires_at=F.expires_at)}if(W&&(j.message.function_call?(W.name&&(j.message.function_call.name=W.name),W.arguments&&((s=j.message.function_call).arguments??(s.arguments=""),j.message.function_call.arguments+=W.arguments)):j.message.function_call=W),A!=null)if(!j.message.refusal&&Cn(m(this,ht,"f")?.response_format)){let Q=m(this,Ge,"m",ku).call(this,j),Tt=Q.content_parse_state??(Q.content_parse_state=_k()),Ue=vk(Tt,m(this,wr,"f"),A);j.message.content=(Lr(j.message,"content")||"")+A,Tt.has_non_whitespace?Ue&&bk(Tt,m(this,wr,"f"))?(m(this,Ge,"m",Au).call(this,c),j.message.parsed=QP(Ra(j.message.content))):A.length>0&&(j.message.parsed=null):j.message.parsed=null}else j.message.content=(j.message.content||"")+A;if(it){let Q=(u=j.message).tool_calls??(u.tool_calls=[]);for(let Tt of it){let{index:Ue,id:xr,type:bt,function:Et,custom:Zt,...Mn}=Tt;if(!Number.isSafeInteger(Ue)||Ue<0||Ue>=ai)throw new k(`Chat completion stream contains an invalid tool call index: ${Ue}`);let wt="",Ne=Q[Ue]??(Q[Ue]={}),b=Et?.name,g=m(this,Ur,"f")?m(this,Ge,"m",ku).call(this,j):void 0,N=g?.tool_call_identities.get(Ue);if(N&&(fk(Ne,N),bt!==void 0&&bt!==N.type||b!==void 0&&b!==N.name))throw new k("Chat completion stream contains a changed tool call identity");if(Nd(Ne,Mn),xr&&(Ne.id=xr),bt&&(Ne.type=bt),Zt){let O=Ne.custom??(Ne.custom={name:Zt.name??"",input:""});Zt.name&&(O.name=Zt.name),Zt.input&&(O.input+=Zt.input)}if(Et){let O=Ne.function??(Ne.function={name:b??"",arguments:""});if(b&&(O.name=b),g&&!N){let ke=yh(Ne),Qe=ke&&m(this,ht,"f")?.tools?.find(ze=>Rn(ze)&&ze.function.name===ke.name);if(ke&&(N={...ke,parseable:Qe!==void 0&&th(m(this,ht,"f"),{type:ke.type,function:{name:ke.name}})},g.tool_call_identities.set(Ue,N),!N.parseable)){let ze=g.tool_call_parse_states.get(Ue);ze&&(m(this,wr,"f").bytes-=ze.bytes,m(this,wr,"f").fragments-=ze.fragments,m(this,wr,"f").work-=ze.work,g.tool_call_parse_states.delete(Ue))}}let he=Et.arguments;if(he!=null)if(wt=he,g&&N?.parseable!==!1){let ke=g.tool_call_parse_states.get(Ue);ke||(ke=_k(),g.tool_call_parse_states.set(Ue,ke));let Qe=vk(ke,m(this,wr,"f"),he),ze=Lr(O,"arguments");if(typeof ze!="string")throw new k("Chat completion stream contains an unsafe structured JSON snapshot");O.arguments=ze+he,Qe&&N?.parseable===!0&&bk(ke,m(this,wr,"f"))?(m(this,Ge,"m",Au).call(this,c),O.parsed_arguments=QP(Ra(O.arguments))):he.length>0&&ie(O,"parsed_arguments")&&(O.parsed_arguments=void 0)}else O.arguments+=he}C.push(Object.freeze({index:Ue,arguments_delta:wt}))}}Object.freeze(C)}return c},Symbol.asyncIterator)](){return this._createIterator(t=>{let r=o=>t(o);return this.on("chunk",r),()=>this.off("chunk",r)},{onReturn:()=>this.abort()})}toReadableStream(){return new sr(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}};function lU(e,t,r,o){let{id:n,choices:i,created:a,model:s,system_fingerprint:u,...c}=e,l={...c,id:n,choices:rT(i,gh,"choice",d=>{let p=o.get(d);if(!p)throw new k("Chat completion stream contains an unsafe structured JSON snapshot");let f=new Proxy(d,{get(Y,ne,pe){return ne==="message"?p.message:Reflect.get(Y,ne,pe)}}),{message:h,finish_reason:y,index:_,logprobs:$,...v}=f,x=new Proxy(h,{get(Y,ne,pe){return ne==="content"?p.content:ne==="refusal"?p.refusal:ne==="tool_calls"?p.toolCallCollection:Reflect.get(Y,ne,pe)}}),{content:S=null,function_call:C,tool_calls:j,audio:F,...A}=x,G=y??(r.has(_)&&dU(F)?"stop":null);if(!G)throw new k(`missing finish_reason for choice ${_}`);let W=F?{audio:F}:{},R=x.role;if(!R)throw new k(`missing role for choice ${_}`);if(C){let{arguments:Y,name:ne}=C;if(Y==null)throw new k(`missing function_call.arguments for choice ${_}`);if(!ne)throw new k(`missing function_call.name for choice ${_}`);return{...v,message:{...W,content:S,function_call:{arguments:Y,name:ne},role:R,refusal:x.refusal??null},finish_reason:G,index:_,logprobs:$}}return j?{...v,index:_,finish_reason:G,logprobs:$,message:{...A,...W,role:R,content:S,refusal:x.refusal??null,tool_calls:rT(j,ai,"tool-call",(Y,ne)=>{let pe=p.toolCalls.get(ne);if(!pe){let wt=yh(Y);if(wt&&th(t,{type:wt.type,function:{name:wt.name}}))throw new k("Chat completion stream contains an unsafe structured JSON snapshot")}if(pe&&pe.tool!==Y)throw new k("Chat completion stream contains a changed tool call identity");let it=pe&&new Proxy(pe.function,{get(wt,Ne,b){return Ne==="arguments"?pe.arguments:Ne==="name"?pe.name:Reflect.get(wt,Ne,b)}}),Q=pe&&it?new Proxy(Y,{get(wt,Ne,b){return Ne==="type"?pe.type:Ne==="function"?it:Reflect.get(wt,Ne,b)}}):Y;if(Q.type==null)throw new k(`missing choices[${_}].tool_calls[${ne}].type`);if(Q.type==="custom"){let{custom:wt,type:Ne,id:b,...g}=Q,{input:N="",name:O,...he}=wt||{};if(O==null)throw new k(`missing choices[${_}].tool_calls[${ne}].custom.name`);return{...g,id:b||`call_${Wo()}`,type:Ne,custom:{...he,name:O,input:N}}}let{function:Tt,type:Ue,id:xr,...bt}=Q,{arguments:Et,name:Zt,...Mn}=Tt||{};if(Zt==null)throw new k(`missing choices[${_}].tool_calls[${ne}].function.name`);if(Et==null)throw new k(`missing choices[${_}].tool_calls[${ne}].function.arguments`);return{...bt,id:xr||`call_${Wo()}`,type:Ue,function:{...Mn,name:Zt,arguments:Et}}})}}:{...v,message:{...A,...W,content:S,role:R,refusal:x.refusal??null},finish_reason:G,index:_,logprobs:$}}),created:a,model:s,object:"chat.completion",...u?{system_fingerprint:u}:{}};return CP(l,t)}function dU(e){return e?.id!=null&&e.data!=null&&e.transcript!=null&&e.expires_at!=null}var Dd=class e extends Ca{static fromReadableStream(t){let r=new e(null);return r._run(()=>r._fromReadableStream(t)),r}toReadableStream(){let t,r,o=this._createIterator(i=>{let a=u=>{t=u,i(u)},s=u=>{if(io(u)){r=u.tool_calls?.map(c=>c.id);return}if(xd(u)){if(!t)throw new k("cannot serialize a tool message before receiving any chunks");i(iT(t,u,r))}};return this.on("chunk",a),this.on("message",s),()=>{this.off("chunk",a),this.off("message",s)}},{onReturn:()=>this.abort()});return new sr(()=>o,this.controller).toReadableStream()}static runTools(t,r,o){let n=new e(r),i={...o,__metadata:{...o?.__metadata,helperMethod:"runTools"}};return n._run(()=>n._runTools(t,r,n,i)),n}};var ao=class extends I{constructor(){super(...arguments),this.messages=new Sa(this._client)}create(t,r){return this._client.post("/chat/completions",{body:t,...r,stream:t.stream??!1,__security:{bearerAuth:!0}})}retrieve(t,r){return this._client.get(w`/chat/completions/${t}`,{...r,__security:{bearerAuth:!0}})}update(t,r,o){return this._client.post(w`/chat/completions/${t}`,{body:r,...o,__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/chat/completions",de,{query:t,...r,__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/chat/completions/${t}`,{...r,__security:{bearerAuth:!0}})}parse(t,r){return zP(t.tools),this._client.chat.completions.create(t,{...r,__metadata:{...r?.__metadata,helperMethod:"chat.completions.parse"}})._thenUnwrap(o=>wd(o,t))}runTools(t,r){return t.stream?Dd.runTools(this._client,t,r):Ed.runTools(this._client,t,r)}stream(t,r){return Ca.createChatCompletion(this._client,t,r)}};ao.Messages=Sa;var si=class extends I{constructor(){super(...arguments),this.completions=new ao(this._client)}};si.Completions=ao;var $u=class extends I{create(t,r){return this._client.post("/organization/admin_api_keys",{body:t,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r){return this._client.get(w`/organization/admin_api_keys/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(t={},r){return this._client.getAPIList("/organization/admin_api_keys",de,{query:t,...r,__security:{adminAPIKeyAuth:!0}})}delete(t,r){return this._client.delete(w`/organization/admin_api_keys/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}};var Su=class extends I{list(t={},r){return this._client.getAPIList("/organization/audit_logs",Ee,{query:t,...r,__security:{adminAPIKeyAuth:!0}})}};var Ou=class extends I{create(t,r){return this._client.post("/organization/certificates",{body:t,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r={},o){return this._client.get(w`/organization/certificates/${t}`,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){return this._client.post(w`/organization/certificates/${t}`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}list(t={},r){return this._client.getAPIList("/organization/certificates",Ee,{query:t,...r,__security:{adminAPIKeyAuth:!0}})}delete(t,r){return this._client.delete(w`/organization/certificates/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}activate(t,r){return this._client.getAPIList("/organization/certificates/activate",Mt,{body:t,method:"post",...r,__security:{adminAPIKeyAuth:!0}})}deactivate(t,r){return this._client.getAPIList("/organization/certificates/deactivate",Mt,{body:t,method:"post",...r,__security:{adminAPIKeyAuth:!0}})}};var Pu=class extends I{retrieve(t){return this._client.get("/organization/data_retention",{...t,__security:{adminAPIKeyAuth:!0}})}update(t,r){return this._client.post("/organization/data_retention",{body:t,...r,__security:{adminAPIKeyAuth:!0}})}};var Tu=class extends I{create(t,r){return this._client.post("/organization/invites",{body:t,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r){return this._client.get(w`/organization/invites/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}list(t={},r){return this._client.getAPIList("/organization/invites",Ee,{query:t,...r,__security:{adminAPIKeyAuth:!0}})}delete(t,r){return this._client.delete(w`/organization/invites/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}};var Eu=class extends I{create(t,r){return this._client.post("/organization/roles",{body:t,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r){return this._client.get(w`/organization/roles/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){return this._client.post(w`/organization/roles/${t}`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}list(t={},r){return this._client.getAPIList("/organization/roles",ft,{query:t,...r,__security:{adminAPIKeyAuth:!0}})}delete(t,r){return this._client.delete(w`/organization/roles/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}};var Ru=class extends I{create(t,r){return this._client.post("/organization/spend_alerts",{body:t,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r){return this._client.get(w`/organization/spend_alerts/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){return this._client.post(w`/organization/spend_alerts/${t}`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}list(t={},r){return this._client.getAPIList("/organization/spend_alerts",Ee,{query:t,...r,__security:{adminAPIKeyAuth:!0}})}delete(t,r){return this._client.delete(w`/organization/spend_alerts/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}};var Cu=class extends I{retrieve(t){return this._client.get("/organization/spend_limit",{...t,__security:{adminAPIKeyAuth:!0}})}update(t,r){return this._client.post("/organization/spend_limit",{body:t,...r,__security:{adminAPIKeyAuth:!0}})}delete(t){return this._client.delete("/organization/spend_limit",{...t,__security:{adminAPIKeyAuth:!0}})}};var zu=class extends I{audioSpeeches(t,r){return this._client.get("/organization/usage/audio_speeches",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}audioTranscriptions(t,r){return this._client.get("/organization/usage/audio_transcriptions",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}codeInterpreterSessions(t,r){return this._client.get("/organization/usage/code_interpreter_sessions",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}completions(t,r){return this._client.get("/organization/usage/completions",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}costs(t,r){return this._client.get("/organization/costs",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}embeddings(t,r){return this._client.get("/organization/usage/embeddings",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}fileSearchCalls(t,r){return this._client.get("/organization/usage/file_search_calls",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}images(t,r){return this._client.get("/organization/usage/images",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}moderations(t,r){return this._client.get("/organization/usage/moderations",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}vectorStores(t,r){return this._client.get("/organization/usage/vector_stores",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}webSearchCalls(t,r){return this._client.get("/organization/usage/web_search_calls",{query:t,...r,__security:{adminAPIKeyAuth:!0}})}};var Nu=class extends I{create(t,r,o){return this._client.post(w`/organization/groups/${t}/roles`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r,o){let{group_id:n}=r;return this._client.get(w`/organization/groups/${n}/roles/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/organization/groups/${t}/roles`,ft,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{group_id:n}=r;return this._client.delete(w`/organization/groups/${n}/roles/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};var ju=class extends I{create(t,r,o){return this._client.post(w`/organization/groups/${t}/users`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r,o){let{group_id:n}=r;return this._client.get(w`/organization/groups/${n}/users/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/organization/groups/${t}/users`,ft,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{group_id:n}=r;return this._client.delete(w`/organization/groups/${n}/users/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};var ui=class extends I{constructor(){super(...arguments),this.users=new ju(this._client),this.roles=new Nu(this._client)}create(t,r){return this._client.post("/organization/groups",{body:t,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r){return this._client.get(w`/organization/groups/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){return this._client.post(w`/organization/groups/${t}`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}list(t={},r){return this._client.getAPIList("/organization/groups",ft,{query:t,...r,__security:{adminAPIKeyAuth:!0}})}delete(t,r){return this._client.delete(w`/organization/groups/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}};ui.Users=ju;ui.Roles=Nu;var Du=class extends I{retrieve(t,r,o){let{project_id:n}=r;return this._client.get(w`/organization/projects/${n}/api_keys/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/organization/projects/${t}/api_keys`,Ee,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{project_id:n}=r;return this._client.delete(w`/organization/projects/${n}/api_keys/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};var Mu=class extends I{list(t,r={},o){return this._client.getAPIList(w`/organization/projects/${t}/certificates`,Ee,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}activate(t,r,o){return this._client.getAPIList(w`/organization/projects/${t}/certificates/activate`,Mt,{body:r,method:"post",...o,__security:{adminAPIKeyAuth:!0}})}deactivate(t,r,o){return this._client.getAPIList(w`/organization/projects/${t}/certificates/deactivate`,Mt,{body:r,method:"post",...o,__security:{adminAPIKeyAuth:!0}})}};var Uu=class extends I{retrieve(t,r){return this._client.get(w`/organization/projects/${t}/data_retention`,{...r,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){return this._client.post(w`/organization/projects/${t}/data_retention`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}};var Lu=class extends I{retrieve(t,r){return this._client.get(w`/organization/projects/${t}/hosted_tool_permissions`,{...r,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){return this._client.post(w`/organization/projects/${t}/hosted_tool_permissions`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}};var Zu=class extends I{retrieve(t,r){return this._client.get(w`/organization/projects/${t}/model_permissions`,{...r,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){return this._client.post(w`/organization/projects/${t}/model_permissions`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r){return this._client.delete(w`/organization/projects/${t}/model_permissions`,{...r,__security:{adminAPIKeyAuth:!0}})}};var Fu=class extends I{listRateLimits(t,r={},o){return this._client.getAPIList(w`/organization/projects/${t}/rate_limits`,Ee,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}updateRateLimit(t,r,o){let{project_id:n,...i}=r;return this._client.post(w`/organization/projects/${n}/rate_limits/${t}`,{body:i,...o,__security:{adminAPIKeyAuth:!0}})}};var Bu=class extends I{create(t,r,o){return this._client.post(w`/projects/${t}/roles`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r,o){let{project_id:n}=r;return this._client.get(w`/projects/${n}/roles/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){let{project_id:n,...i}=r;return this._client.post(w`/projects/${n}/roles/${t}`,{body:i,...o,__security:{adminAPIKeyAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/projects/${t}/roles`,ft,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{project_id:n}=r;return this._client.delete(w`/projects/${n}/roles/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};var Wu=class extends I{create(t,r,o){return this._client.post(w`/organization/projects/${t}/spend_alerts`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r,o){let{project_id:n}=r;return this._client.get(w`/organization/projects/${n}/spend_alerts/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){let{project_id:n,...i}=r;return this._client.post(w`/organization/projects/${n}/spend_alerts/${t}`,{body:i,...o,__security:{adminAPIKeyAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/organization/projects/${t}/spend_alerts`,Ee,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{project_id:n}=r;return this._client.delete(w`/organization/projects/${n}/spend_alerts/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};var Ku=class extends I{retrieve(t,r){return this._client.get(w`/organization/projects/${t}/spend_limit`,{...r,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){return this._client.post(w`/organization/projects/${t}/spend_limit`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r){return this._client.delete(w`/organization/projects/${t}/spend_limit`,{...r,__security:{adminAPIKeyAuth:!0}})}};var Vu=class extends I{create(t,r,o){let{project_id:n,...i}=r;return this._client.post(w`/projects/${n}/groups/${t}/roles`,{body:i,...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r,o){let{project_id:n,group_id:i}=r;return this._client.get(w`/projects/${n}/groups/${i}/roles/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}list(t,r,o){let{project_id:n,...i}=r;return this._client.getAPIList(w`/projects/${n}/groups/${t}/roles`,ft,{query:i,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{project_id:n,group_id:i}=r;return this._client.delete(w`/projects/${n}/groups/${i}/roles/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};var za=class extends I{constructor(){super(...arguments),this.roles=new Vu(this._client)}create(t,r,o){return this._client.post(w`/organization/projects/${t}/groups`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r,o){let{project_id:n,...i}=r;return this._client.get(w`/organization/projects/${n}/groups/${t}`,{query:i,...o,__security:{adminAPIKeyAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/organization/projects/${t}/groups`,ft,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{project_id:n}=r;return this._client.delete(w`/organization/projects/${n}/groups/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};za.Roles=Vu;var qu=class extends I{create(t,r,o){let{project_id:n,...i}=r;return this._client.post(w`/organization/projects/${n}/service_accounts/${t}/api_keys`,{body:i,...o,__security:{adminAPIKeyAuth:!0}})}};var Na=class extends I{constructor(){super(...arguments),this.apiKeys=new qu(this._client)}create(t,r,o){return this._client.post(w`/organization/projects/${t}/service_accounts`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r,o){let{project_id:n}=r;return this._client.get(w`/organization/projects/${n}/service_accounts/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){let{project_id:n,...i}=r;return this._client.post(w`/organization/projects/${n}/service_accounts/${t}`,{body:i,...o,__security:{adminAPIKeyAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/organization/projects/${t}/service_accounts`,Ee,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{project_id:n}=r;return this._client.delete(w`/organization/projects/${n}/service_accounts/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};Na.APIKeys=qu;var Ju=class extends I{create(t,r,o){let{project_id:n,...i}=r;return this._client.post(w`/projects/${n}/users/${t}/roles`,{body:i,...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r,o){let{project_id:n,user_id:i}=r;return this._client.get(w`/projects/${n}/users/${i}/roles/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}list(t,r,o){let{project_id:n,...i}=r;return this._client.getAPIList(w`/projects/${n}/users/${t}/roles`,ft,{query:i,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{project_id:n,user_id:i}=r;return this._client.delete(w`/projects/${n}/users/${i}/roles/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};var ja=class extends I{constructor(){super(...arguments),this.roles=new Ju(this._client)}create(t,r,o){return this._client.post(w`/organization/projects/${t}/users`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r,o){let{project_id:n}=r;return this._client.get(w`/organization/projects/${n}/users/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){let{project_id:n,...i}=r;return this._client.post(w`/organization/projects/${n}/users/${t}`,{body:i,...o,__security:{adminAPIKeyAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/organization/projects/${t}/users`,Ee,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{project_id:n}=r;return this._client.delete(w`/organization/projects/${n}/users/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};ja.Roles=Ju;var $t=class extends I{constructor(){super(...arguments),this.users=new ja(this._client),this.serviceAccounts=new Na(this._client),this.apiKeys=new Du(this._client),this.rateLimits=new Fu(this._client),this.modelPermissions=new Zu(this._client),this.hostedToolPermissions=new Lu(this._client),this.groups=new za(this._client),this.roles=new Bu(this._client),this.dataRetention=new Uu(this._client),this.spendLimit=new Ku(this._client),this.spendAlerts=new Wu(this._client),this.certificates=new Mu(this._client)}create(t,r){return this._client.post("/organization/projects",{body:t,...r,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r){return this._client.get(w`/organization/projects/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){return this._client.post(w`/organization/projects/${t}`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}list(t={},r){return this._client.getAPIList("/organization/projects",Ee,{query:t,...r,__security:{adminAPIKeyAuth:!0}})}archive(t,r){return this._client.post(w`/organization/projects/${t}/archive`,{...r,__security:{adminAPIKeyAuth:!0}})}};$t.Users=ja;$t.ServiceAccounts=Na;$t.APIKeys=Du;$t.RateLimits=Fu;$t.ModelPermissions=Zu;$t.HostedToolPermissions=Lu;$t.Groups=za;$t.Roles=Bu;$t.DataRetention=Uu;$t.SpendLimit=Ku;$t.SpendAlerts=Wu;$t.Certificates=Mu;var Hu=class extends I{create(t,r,o){return this._client.post(w`/organization/users/${t}/roles`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r,o){let{user_id:n}=r;return this._client.get(w`/organization/users/${n}/roles/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/organization/users/${t}/roles`,ft,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{user_id:n}=r;return this._client.delete(w`/organization/users/${n}/roles/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};var Da=class extends I{constructor(){super(...arguments),this.roles=new Hu(this._client)}retrieve(t,r){return this._client.get(w`/organization/users/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}update(t,r,o){return this._client.post(w`/organization/users/${t}`,{body:r,...o,__security:{adminAPIKeyAuth:!0}})}list(t={},r){return this._client.getAPIList("/organization/users",Ee,{query:t,...r,__security:{adminAPIKeyAuth:!0}})}delete(t,r){return this._client.delete(w`/organization/users/${t}`,{...r,__security:{adminAPIKeyAuth:!0}})}};Da.Roles=Hu;var St=class extends I{constructor(){super(...arguments),this.auditLogs=new Su(this._client),this.adminAPIKeys=new $u(this._client),this.usage=new zu(this._client),this.invites=new Tu(this._client),this.users=new Da(this._client),this.groups=new ui(this._client),this.roles=new Eu(this._client),this.dataRetention=new Pu(this._client),this.spendLimit=new Cu(this._client),this.spendAlerts=new Ru(this._client),this.certificates=new Ou(this._client),this.projects=new $t(this._client)}};St.AuditLogs=Su;St.AdminAPIKeys=$u;St.Usage=zu;St.Invites=Tu;St.Users=Da;St.Groups=ui;St.Roles=Eu;St.DataRetention=Pu;St.SpendLimit=Cu;St.SpendAlerts=Ru;St.Certificates=Ou;St.Projects=$t;var ci=class extends I{constructor(){super(...arguments),this.organization=new St(this._client)}};ci.Organization=St;var Xu=class extends I{create(t,r){return this._client.post("/audio/speech",{body:t,...r,headers:D([{Accept:"application/octet-stream"},r?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}};var Gu=class extends I{create(t,r){return this._client.post("/audio/transcriptions",mt({body:t,...r,stream:t.stream??!1,__metadata:{model:t.model},__security:{bearerAuth:!0}},this._client))}};var Yu=class extends I{create(t,r){return this._client.post("/audio/translations",mt({body:t,...r,__metadata:{model:t.model},__security:{bearerAuth:!0}},this._client))}};var Nn=class extends I{constructor(){super(...arguments),this.transcriptions=new Gu(this._client),this.translations=new Yu(this._client),this.speech=new Xu(this._client)}};Nn.Transcriptions=Gu;Nn.Translations=Yu;Nn.Speech=Xu;var Ma=class extends I{create(t,r){return this._client.post("/batches",{body:t,...r,__security:{bearerAuth:!0}})}retrieve(t,r){return this._client.get(w`/batches/${t}`,{...r,__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/batches",de,{query:t,...r,__security:{bearerAuth:!0}})}cancel(t,r){return this._client.post(w`/batches/${t}/cancel`,{...r,__security:{bearerAuth:!0}})}};var Qu=class extends I{create(t,r){return this._client.post("/assistants",{body:t,...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}retrieve(t,r){return this._client.get(w`/assistants/${t}`,{...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}update(t,r,o){return this._client.post(w`/assistants/${t}`,{body:r,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/assistants",de,{query:t,...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/assistants/${t}`,{...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}};var ec=class extends I{create(t,r){return this._client.post("/realtime/sessions",{body:t,...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}};var tc=class extends I{create(t,r){return this._client.post("/realtime/transcription_sessions",{body:t,...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}};var li=class extends I{constructor(){super(...arguments),this.sessions=new ec(this._client),this.transcriptionSessions=new tc(this._client)}};li.Sessions=ec;li.TranscriptionSessions=tc;var rc=class extends I{create(t,r){return this._client.post("/chatkit/sessions",{body:t,...r,headers:D([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers]),__security:{bearerAuth:!0}})}cancel(t,r){return this._client.post(w`/chatkit/sessions/${t}/cancel`,{...r,headers:D([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers]),__security:{bearerAuth:!0}})}};var nc=class extends I{retrieve(t,r){return this._client.get(w`/chatkit/threads/${t}`,{...r,headers:D([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers]),__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/chatkit/threads",Ee,{query:t,...r,headers:D([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers]),__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/chatkit/threads/${t}`,{...r,headers:D([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers]),__security:{bearerAuth:!0}})}listItems(t,r={},o){return this._client.getAPIList(w`/chatkit/threads/${t}/items`,Ee,{query:r,...o,headers:D([{"OpenAI-Beta":"chatkit_beta=v1"},o?.headers]),__security:{bearerAuth:!0}})}};var di=class extends I{constructor(){super(...arguments),this.sessions=new rc(this._client),this.threads=new nc(this._client)}};di.Sessions=rc;di.Threads=nc;var oc=class extends I{list(t,r={},o){let{betas:n,...i}=r??{};return this._client.getAPIList(w`/responses/${t}/input_items?beta=true`,de,{query:i,...o,headers:D([{...n?.toString()!=null?{"openai-beta":n?.toString()}:void 0},o?.headers]),__security:{bearerAuth:!0}})}};var ic=class extends I{count(t={},r){let{betas:o,...n}=t??{};return this._client.post("/responses/input_tokens?beta=true",{body:n,...r,headers:D([{...o?.toString()!=null?{"openai-beta":o?.toString()}:void 0},r?.headers]),__security:{bearerAuth:!0}})}};var pi=class extends I{constructor(){super(...arguments),this.inputItems=new oc(this._client),this.inputTokens=new ic(this._client)}create(t,r){let{betas:o,...n}=t;return this._client.post("/responses?beta=true",{body:n,...r,headers:D([{...o?.toString()!=null?{"openai-beta":o?.toString()}:void 0},r?.headers]),stream:t.stream??!1,__security:{bearerAuth:!0}})}retrieve(t,r={},o){let{betas:n,...i}=r??{};return this._client.get(w`/responses/${t}?beta=true`,{query:i,...o,headers:D([{...n?.toString()!=null?{"openai-beta":n?.toString()}:void 0},o?.headers]),stream:r?.stream??!1,__security:{bearerAuth:!0}})}delete(t,r={},o){let{betas:n}=r??{};return this._client.delete(w`/responses/${t}?beta=true`,{...o,headers:D([{Accept:"*/*",...n?.toString()!=null?{"openai-beta":n?.toString()}:void 0},o?.headers]),__security:{bearerAuth:!0}})}cancel(t,r={},o){let{betas:n}=r??{};return this._client.post(w`/responses/${t}/cancel?beta=true`,{...o,headers:D([{...n?.toString()!=null?{"openai-beta":n?.toString()}:void 0},o?.headers]),__security:{bearerAuth:!0}})}compact(t,r){let{betas:o,...n}=t;return this._client.post("/responses/compact?beta=true",{body:n,...r,headers:D([{...o?.toString()!=null?{"openai-beta":o?.toString()}:void 0},r?.headers]),__security:{bearerAuth:!0}})}};pi.InputItems=oc;pi.InputTokens=ic;var ac=class extends I{create(t,r,o){return this._client.post(w`/threads/${t}/messages`,{body:r,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}retrieve(t,r,o){let{thread_id:n}=r;return this._client.get(w`/threads/${n}/messages/${t}`,{...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}update(t,r,o){let{thread_id:n,...i}=r;return this._client.post(w`/threads/${n}/messages/${t}`,{body:i,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/threads/${t}/messages`,de,{query:r,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}delete(t,r,o){let{thread_id:n}=r;return this._client.delete(w`/threads/${n}/messages/${t}`,{...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}};var sc=class extends I{retrieve(t,r,o){let{thread_id:n,run_id:i,...a}=r;return this._client.get(w`/threads/${n}/runs/${i}/steps/${t}`,{query:a,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}list(t,r,o){let{thread_id:n,...i}=r;return this._client.getAPIList(w`/threads/${n}/runs/${t}/steps`,de,{query:i,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}};var _h=e=>{if(typeof globalThis.Buffer<"u"){let t=globalThis.Buffer.from(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(typeof atob<"u"){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}throw new k("Cannot decode base64 string; Expected `Buffer` or `atob` to be defined")},uT=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),r=t.length,o=new Uint8Array(r);for(let n=0;n<r;n++)o[n]=t.charCodeAt(n);return Array.from(new Float32Array(o.buffer))}};var Zr=e=>{try{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()||void 0}catch{return}};var lT=1024,i2=65536;function a2(e){switch(e){case"value":case"arguments":case"input":case"text":case"content":case"annotations":case"metadata":case"name":case"role":case"status":case"tool_calls":case"step_details":return e;default:return"unknown"}}var Md=new WeakMap,fi=new WeakSet;function dT(e){return{arrays:new Map,cacheArrays:e,records:new WeakMap}}function pT(e){for(let[t,r]of e.arrays)r.cacheable&&!fi.has(t)?Md.set(t,{length:r.length,ownEntryCount:r.ownEntryCount}):Md.delete(t)}function cT(e){return typeof e=="string"||typeof e=="number"}function fT(e,t){return t.every(cT)&&e.every(cT)}function s2(e){let t=0;for(let r of Object.keys(e)){let o=Number(r);Number.isSafeInteger(o)&&o>=0&&o<e.length&&String(o)===r&&(t+=1)}return t}function u2(e,t,r){return t?r?.length===e.length?r.ownEntryCount:s2(e):0}function c2(e,t,r){let{index:o}=e;if(t==="array"&&o==null)throw new Error("Expected array delta entry to have an `index` property");if(t==="array"&&typeof o!="number")throw new TypeError("Expected array delta entry `index` property to be a number but got an invalid value");if(!Number.isSafeInteger(o)||o<0||o>=r+lT||o>=i2){let n=typeof o=="number"?o:"unknown";throw new k(`Assistant stream delta contains an invalid ${t} index: ${n}`)}return o}function mT(e,t,r,o,n){let i=o.arrays.get(e);if(!i){let a=o.cacheArrays&&!fi.has(e),s=a?Md.get(e):void 0;i={baselineLength:e.length,cacheable:a,enforceSparseHoleBudget:a,entries:new Map,length:e.length,ownEntryCount:u2(e,a,s)},o.arrays.set(e,i)}for(let a of t){if(!zr(a))throw new Error("Expected array delta entry to be an object but got an invalid value");let s=c2(a,r,i.baselineLength),u;i.entries.has(s)?u=i.entries.get(s):ie(e,s)?(u=e[s],u==null&&i.entries.set(s,a)):(i.entries.set(s,a),i.ownEntryCount+=1);let c=Math.max(i.length,s+1);if(i.enforceSparseHoleBudget&&c-i.ownEntryCount>lT)throw new k(`Assistant stream delta contains an invalid ${r} index: ${s}`);zr(u)&&n(u,a,o),i.length=c}}function vh(e,t,r){let o=r.records.get(e);for(let[n,i]of Object.entries(t)){if(n==="index"||n==="type")continue;let a;if(o?.has(n)?a=o.get(n):ie(e,n)&&(a=e[n]),a==null){o||(o=new Map,r.records.set(e,o)),o.set(n,i);continue}zr(a)&&zr(i)?vh(a,i,r):Array.isArray(a)&&Array.isArray(i)&&!fT(a,i)&&mT(a,i,"array",r,vh)}}function bh(e){return(zr(e)||Array.isArray(e))&&fi.has(e)}function nn(e){if(!(!zr(e)&&!Array.isArray(e)||fi.has(e))){fi.add(e),Array.isArray(e)&&Md.delete(e);for(let t of Reflect.ownKeys(e)){let r=Object.getOwnPropertyDescriptor(e,t);r&&"value"in r&&nn(r.value)}}}function Ik(e,t,r){fi.has(e)&&nn(r),Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0})}function l2(e){let{index:t}=e;if(t==null)throw new Error("Expected array delta entry to have an `index` property");if(typeof t!="number")throw new TypeError("Expected array delta entry `index` property to be a number but got an invalid value");return t}function d2(e,t,r){if(fT(e,t)){e.push(...t),Md.delete(e);return}for(let o of t){if(!zr(o))throw new Error("Expected array delta entry to be an object but got an invalid value");let n=l2(o);if(ie(e,n)){let i=e[n];i==null?(fi.has(e)&&nn(o),e[n]=o):e[n]=r(i,o)}else Ik(e,n,o)}}function Ak(e,t){let r=fi.has(e);for(let[o,n]of Object.entries(t)){if(o==="__proto__"||o==="constructor"||o==="prototype")throw new k(`Assistant stream delta contains an unsafe property: ${o}`);if(!ie(e,o)){r&&nn(n),e[o]=n;continue}let i=e[o];if(i==null){r&&nn(n),e[o]=n;continue}if(o==="index"||o==="type"){e[o]=n;continue}if(typeof i=="string"&&typeof n=="string")i+=n;else if(typeof i=="number"&&typeof n=="number")i+=n;else if(zr(i)&&zr(n))i=Ak(i,n);else if(Array.isArray(i)&&Array.isArray(n)){d2(i,n,Ak);continue}else throw new TypeError(`Unhandled record type: ${a2(o)}`);e[o]=i}return e}function Ud(e){if(!(!zr(e)&&!Array.isArray(e)))for(let[t,r]of Object.entries(e)){if(t==="__proto__"||t==="constructor"||t==="prototype")throw new k(`Assistant stream delta contains an unsafe property: ${t}`);Ud(r)}}function wh(e,t,r=!1){Ud(t);let o=e,n=t,i=dT(r&&!bh(e));return vh(o,n,i),Ak(o,n),pT(i),e}function hT(e,t,r,o=!0){Ud(t);let n=dT(o&&!bh(e));return mT(e,t,r,n,vh),()=>pT(n)}var _e,Gt,mi,Fr,lc,cc,cr,so,La,hi,uo,Ua,ur,Ld,Zd,gi,Fd,Bd,gT,uc,yT,xh,_T,vT,gt,bT,wT,xT,kT,AT;function p2(e){let t=Object.getOwnPropertyDescriptor(e,"event"),r=Object.getOwnPropertyDescriptor(e,"data"),o=Reflect.get(e,"event",e),n=Reflect.get(e,"data",e),i=n;if(o==="thread.message.created"||o==="thread.message.in_progress"||o==="thread.message.delta"||o==="thread.message.completed"||o==="thread.message.incomplete"||o==="thread.run.step.created"||o==="thread.run.step.in_progress"||o==="thread.run.step.delta"||o==="thread.run.step.completed"||o==="thread.run.step.failed"||o==="thread.run.step.cancelled"||o==="thread.run.step.expired"){let u=Object.getOwnPropertyDescriptor(n,"id");if(u&&"value"in u&&Reflect.get(n,"id",n)!==u.value){let c=u.value;i=new Proxy(n,{get(l,d){return d==="id"?c:Reflect.get(l,d,l)}})}}let a=Object.freeze({event:o,data:i}),s=t!==void 0&&"value"in t&&t.value===o&&r!==void 0&&"value"in r&&r.value===n&&i===n;return{event:a,exposedEvent:s?e:{event:o,data:i}}}var yi=class e extends oi{constructor(){super(...arguments),_e.add(this),Gt.set(this,Object.create(null)),mi.set(this,new Map),Fr.set(this,void 0),lc.set(this,Object.create(null)),cc.set(this,new Map),cr.set(this,void 0),so.set(this,void 0),La.set(this,void 0),hi.set(this,void 0),uo.set(this,void 0),Ua.set(this,void 0),ur.set(this,void 0),Ld.set(this,void 0),Zd.set(this,void 0),gi.set(this,void 0)}[(Gt=new WeakMap,mi=new WeakMap,Fr=new WeakMap,lc=new WeakMap,cc=new WeakMap,cr=new WeakMap,so=new WeakMap,La=new WeakMap,hi=new WeakMap,uo=new WeakMap,Ua=new WeakMap,ur=new WeakMap,Ld=new WeakMap,Zd=new WeakMap,gi=new WeakMap,_e=new WeakSet,Symbol.asyncIterator)](){return this._createIterator(t=>{let r=o=>t(structuredClone(o));return this.on("event",r),()=>this.off("event",r)},{onReturn:()=>this.abort()})}static fromReadableStream(t){let r=new e;return r._run(()=>r._fromReadableStream(t)),r}async _fromReadableStream(t,r){this._listenForAbort(r?.signal),this._connected();let o=sr.fromReadableStream(t,this.controller);for await(let n of o)m(this,_e,"m",Fd).call(this,n);if(o.controller.signal?.aborted)throw new $e;return this._addRun(m(this,_e,"m",Bd).call(this))}toReadableStream(){return new sr(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(t,r,o,n){let i=new e;return i._run(()=>i._runToolAssistantStream(t,r,o,{...n,__metadata:{...n?.__metadata,helperMethod:"stream"}})),i}async _createToolAssistantStream(t,r,o,n){this._listenForAbort(n?.signal);let i={...o,stream:!0},a=await t.submitToolOutputs(r,i,{...n,signal:this.controller.signal});this._connected();for await(let s of a)m(this,_e,"m",Fd).call(this,s);if(a.controller.signal?.aborted)throw new $e;return this._addRun(m(this,_e,"m",Bd).call(this))}static createThreadAssistantStream(t,r,o){let n=new e;return n._run(()=>n._threadAssistantStream(t,r,{...o,__metadata:{...o?.__metadata,helperMethod:"stream"}})),n}static createAssistantStream(t,r,o,n){let i=new e;return i._run(()=>i._runAssistantStream(t,r,o,{...n,__metadata:{...n?.__metadata,helperMethod:"stream"}})),i}currentEvent(){return nn(m(this,Ld,"f")),m(this,Ld,"f")}currentRun(){return nn(m(this,Zd,"f")),m(this,Zd,"f")}currentMessageSnapshot(){return nn(m(this,cr,"f")),m(this,cr,"f")}currentRunStepSnapshot(){return nn(m(this,gi,"f")),m(this,gi,"f")}async finalRunSteps(){return await this.done(),Object.values(m(this,Gt,"f"))}async finalMessages(){return await this.done(),Object.values(m(this,lc,"f"))}async finalRun(){if(await this.done(),!m(this,La,"f"))throw new Error("Final run was not received.");return m(this,La,"f")}async _createThreadAssistantStream(t,r,o){this._listenForAbort(o?.signal);let n={...r,stream:!0},i=await t.createAndRun(n,{...o,signal:this.controller.signal});this._connected();for await(let a of i)m(this,_e,"m",Fd).call(this,a);if(i.controller.signal?.aborted)throw new $e;return this._addRun(m(this,_e,"m",Bd).call(this))}async _createAssistantStream(t,r,o,n){this._listenForAbort(n?.signal);let i={...o,stream:!0},a=await t.create(r,i,{...n,signal:this.controller.signal});this._connected();for await(let s of a)m(this,_e,"m",Fd).call(this,s);if(a.controller.signal?.aborted)throw new $e;return this._addRun(m(this,_e,"m",Bd).call(this))}static accumulateDelta(t,r){return wh(t,r)}_addRun(t){return m(this,_e,"m",gt).call(this,"run",t),t}async _threadAssistantStream(t,r,o){return await this._createThreadAssistantStream(r,t,o)}async _runAssistantStream(t,r,o,n){return await this._createAssistantStream(r,t,o,n)}async _runToolAssistantStream(t,r,o,n){return await this._createToolAssistantStream(r,t,o,n)}};Fd=function(t){if(this.ended)return;let{event:r,exposedEvent:o}=p2(t),n,i,a,s;switch(r.event){case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":{n=m(this,_e,"m",yT).call(this,r),i=r.data;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":{a=m(this,_e,"m",gT).call(this,r),s=r.data;break}}switch(z(this,Ld,o,"f"),m(this,_e,"m",bT).call(this,o),n!==void 0&&i!==void 0&&m(this,_e,"m",xh).call(this,i,n),a!==void 0&&s!==void 0&&m(this,_e,"m",uc).call(this,s,a),a===void 0&&m(this,Fr,"f")!==void 0&&m(this,gi,"f")&&m(this,_e,"m",uc).call(this,m(this,gi,"f"),m(this,Fr,"f")),r.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":{m(this,_e,"m",AT).call(this,r);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":{if(a===void 0)throw new k("Received assistant run-step event without a canonical run-step ID");let u=m(this,Gt,"f")[a];u&&m(this,_e,"m",uc).call(this,u,a),m(this,_e,"m",vT).call(this,r,a),m(this,_e,"m",uc).call(this,r.data,a);let c=m(this,Gt,"f")[a];c&&m(this,_e,"m",uc).call(this,c,a);break}case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":{if(m(this,_e,"m",_T).call(this,r),n!==void 0){m(this,_e,"m",xh).call(this,r.data,n);let u=m(this,lc,"f")[n];u&&m(this,_e,"m",xh).call(this,u,n)}break}case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier");default:}},Bd=function(){if(this.ended)throw new k("stream has ended, this shouldn't happen");if(!m(this,La,"f"))throw new Error("Final run has not been received");return m(this,La,"f")},gT=function(t){let r=Object.getOwnPropertyDescriptor(t.data,"id"),o=r&&"value"in r?r.value:void 0;if(typeof o!="string"||o.length===0)throw new k("Received assistant run-step event with an invalid run-step ID");if(t.event==="thread.run.step.created"){if(m(this,Fr,"f")!==void 0)throw new k(`Received run-step creation for "${o}" before the active run step "${m(this,Fr,"f")}" reached a terminal state`);if(ie(m(this,Gt,"f"),o)||m(this,mi,"f").has(o))throw new k(`Received run-step creation for run step "${o}", which has already been created`);return z(this,Fr,o,"f"),m(this,mi,"f").set(o,o),o}if(m(this,Fr,"f")!==void 0){if(o!==m(this,Fr,"f"))throw new k(`Received ${t.event} for run step "${o}", which does not match the active run step "${m(this,Fr,"f")}"`);return o}if(t.event==="thread.run.step.delta")throw ie(m(this,Gt,"f"),o)?new k(`Received run-step delta for "${o}" with no active run step`):new k("Received a RunStepDelta before creation of a snapshot");if(ie(m(this,Gt,"f"),o)||m(this,mi,"f").has(o))throw new k(`Received run-step event for run step "${o}", which has already been created`);return m(this,mi,"f").set(o,o),t.event==="thread.run.step.in_progress"&&z(this,Fr,o,"f"),o},uc=function(t,r){let o=Object.getOwnPropertyDescriptor(t,"id"),n=o&&"value"in o?o.value:void 0;if(typeof n!="string"||n.length===0)throw new k("Received assistant run-step event with an invalid run-step ID");let i=m(this,mi,"f").get(n);if(i!==void 0&&i!==r)throw new k(`Received run-step creation for run step "${n}", which has already been created`);m(this,mi,"f").set(n,r)},yT=function(t){let r=Object.getOwnPropertyDescriptor(t.data,"id"),o=r&&"value"in r?r.value:void 0;if(typeof o!="string"||o.length===0)throw new k("Received assistant message event with an invalid message ID");if(t.event==="thread.message.created"){if(m(this,cr,"f"))throw new k(`Received message creation for "${o}" before the active message "${m(this,so,"f")}" reached a terminal state`);if(ie(m(this,lc,"f"),o)||m(this,cc,"f").has(o))throw new k(`Received message creation for message "${o}", which has already been created`);return z(this,so,o,"f"),m(this,cc,"f").set(o,o),o}if(!m(this,cr,"f"))throw t.event==="thread.message.delta"?new k("Received a delta with no existing snapshot (there should be one from message creation)"):new k("Received thread message event with no existing snapshot");if(o!==m(this,so,"f"))throw new k(`Received ${t.event} for message "${o}", which does not match the active message "${m(this,so,"f")}"`);return o},xh=function(t,r){let o=Object.getOwnPropertyDescriptor(t,"id"),n=o&&"value"in o?o.value:void 0;if(typeof n!="string"||n.length===0)throw new k("Received assistant message event with an invalid message ID");let i=m(this,cc,"f").get(n);if(i!==void 0&&i!==r)throw new k(`Received message creation for message "${n}", which has already been created`);m(this,cc,"f").set(n,r)},_T=function(t){let[r,o]=m(this,_e,"m",xT).call(this,t,m(this,cr,"f"));if(z(this,cr,r,"f"),!m(this,so,"f"))throw new k("Received thread message event with no active message ID");m(this,lc,"f")[m(this,so,"f")]=r;for(let n of o){let i=r.content[n.index];i?.type==="text"&&m(this,_e,"m",gt).call(this,"textCreated",i.text)}switch(t.event){case"thread.message.created":{z(this,hi,void 0,"f"),z(this,uo,void 0,"f"),m(this,_e,"m",gt).call(this,"messageCreated",t.data);break}case"thread.message.in_progress":break;case"thread.message.delta":{if(m(this,_e,"m",gt).call(this,"messageDelta",t.data.delta,r),t.data.delta.content)for(let n of t.data.delta.content){if(n.type==="text"&&n.text){let i=n.text,a=r.content[n.index];if(a&&a.type==="text")m(this,_e,"m",gt).call(this,"textDelta",i,a.text);else throw new Error("The snapshot associated with this text delta is not text or missing")}if(n.index!==m(this,hi,"f")){if(m(this,uo,"f"))switch(m(this,uo,"f").type){case"text":{m(this,_e,"m",gt).call(this,"textDone",m(this,uo,"f").text,m(this,cr,"f"));break}case"image_file":{m(this,_e,"m",gt).call(this,"imageFileDone",m(this,uo,"f").image_file,m(this,cr,"f"));break}}z(this,hi,n.index,"f")}z(this,uo,r.content[n.index],"f")}break}case"thread.message.completed":case"thread.message.incomplete":{if(m(this,hi,"f")!==void 0){let n=t.data.content[m(this,hi,"f")];if(n)switch(n.type){case"image_file":{m(this,_e,"m",gt).call(this,"imageFileDone",n.image_file,m(this,cr,"f"));break}case"text":{m(this,_e,"m",gt).call(this,"textDone",n.text,m(this,cr,"f"));break}}}m(this,cr,"f")&&m(this,_e,"m",gt).call(this,"messageDone",t.data),z(this,hi,void 0,"f"),z(this,uo,void 0,"f"),z(this,cr,void 0,"f"),z(this,so,void 0,"f")}}},vT=function(t,r){let o=m(this,_e,"m",wT).call(this,t,r);switch(z(this,gi,o,"f"),t.event){case"thread.run.step.created":{z(this,Ua,void 0,"f"),z(this,ur,void 0,"f"),m(this,_e,"m",gt).call(this,"runStepCreated",t.data);break}case"thread.run.step.delta":{let n=t.data.delta;if(n.step_details&&n.step_details.type==="tool_calls"&&n.step_details.tool_calls&&o.step_details.type==="tool_calls")for(let i of n.step_details.tool_calls)i.index===m(this,Ua,"f")?m(this,_e,"m",gt).call(this,"toolCallDelta",i,o.step_details.tool_calls[i.index]):(m(this,ur,"f")&&m(this,_e,"m",gt).call(this,"toolCallDone",m(this,ur,"f")),z(this,Ua,i.index,"f"),z(this,ur,o.step_details.tool_calls[i.index],"f"),m(this,ur,"f")&&m(this,_e,"m",gt).call(this,"toolCallCreated",m(this,ur,"f")));m(this,_e,"m",gt).call(this,"runStepDelta",t.data.delta,o);break}case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":{z(this,gi,void 0,"f"),z(this,Fr,void 0,"f"),t.data.step_details.type==="tool_calls"&&m(this,ur,"f")&&m(this,_e,"m",gt).call(this,"toolCallDone",m(this,ur,"f")),m(this,_e,"m",gt).call(this,"runStepDone",t.data,o),z(this,Ua,void 0,"f"),z(this,ur,void 0,"f");break}case"thread.run.step.in_progress":break}},gt=function(t,...r){if(this._hasListeners(t))for(let o of r)nn(o);this._emit(t,...r)},bT=function(t){m(this,_e,"m",gt).call(this,"event",t)},wT=function(t,r){switch(t.event){case"thread.run.step.created":return m(this,Gt,"f")[r]=t.data,t.data;case"thread.run.step.delta":{let o=m(this,Gt,"f")[r];if(!o)throw new Error("Received a RunStepDelta before creation of a snapshot");let n=t.data;if(n.delta){let i=wh(o,n.delta,!0);m(this,Gt,"f")[r]=i}return m(this,Gt,"f")[r]}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":{m(this,Gt,"f")[r]=t.data;break}}if(m(this,Gt,"f")[r])return m(this,Gt,"f")[r];throw new Error("No snapshot available")},xT=function(t,r){let o=[];switch(t.event){case"thread.message.created":return[t.data,o];case"thread.message.delta":{if(!r)throw new Error("Received a delta with no existing snapshot (there should be one from message creation)");let n=t.data;if(n.delta.content){Ud(n.delta);let i=!bh(r),a=hT(r.content,n.delta.content,"content",i);for(let s of n.delta.content)if(ie(r.content,s.index)){let u=r.content[s.index];r.content[s.index]=m(this,_e,"m",kT).call(this,s,u,i)}else Ik(r.content,s.index,s),o.push(s);a()}return[r,o]}case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":{if(r)return[r,o];throw new Error("Received thread message event with no existing snapshot")}}throw new Error("Tried to accumulate a non-message event")},kT=function(t,r,o){return wh(r,t,o)},AT=function(t){switch(z(this,Zd,t.data,"f"),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":{z(this,La,t.data,"f"),m(this,ur,"f")&&m(this,_e,"m",gt).call(this,"toolCallDone",m(this,ur,"f")),z(this,Ua,void 0,"f"),z(this,ur,void 0,"f");break}case"thread.run.cancelling":break}};function f2(e,t){return new Promise((r,o)=>{let n,i,a=!1,s=l=>{try{t.removeEventListener("abort",l)}catch{}},u=()=>{if(n!==void 0&&(clearTimeout(n),n=void 0),i){let l=i;i=void 0,s(l)}},c=()=>{if(!a){a=!0,u();try{let l=new $e;Object.defineProperty(l,"cause",{value:t.reason,writable:!0,configurable:!0}),o(l)}catch(l){o(l)}}};if(t.aborted){c();return}n=setTimeout(()=>{a||(a=!0,u(),r())},e),i=c;try{t.addEventListener("abort",c,{once:!0}),a?s(c):t.aborted&&c()}catch(l){a?s(c):(a=!0,u(),o(l))}})}async function Wd(e,t,r,o){let n=D([o?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":o?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:i,response:a}=await e(n).withResponse(),{status:s}=i;if(t.includes(s)){let u=5e3;if(o?.pollIntervalMs)u=o.pollIntervalMs;else{let l=a.headers.get("openai-poll-after-ms");if(l){let d=Number.parseInt(l);Number.isNaN(d)||(u=d)}}let c=o&&Object.prototype.propertyIsEnumerable.call(o,"signal")?o.signal:void 0;await(c?f2(u,c):gu(u))}else if(r.includes(s))return i}}function IT(e,t,r,o){return Wd(n=>e.retrieve(t,r,{...o,headers:{...o?.headers,...n}}),["queued","in_progress","cancelling"],["requires_action","incomplete","cancelled","completed","failed","expired"],o)}var Za=class extends I{constructor(){super(...arguments),this.steps=new sc(this._client)}create(t,r,o){let{include:n,...i}=r;return this._client.post(w`/threads/${t}/runs`,{query:{include:n},body:i,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),stream:r.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}retrieve(t,r,o){let{thread_id:n}=r;return this._client.get(w`/threads/${n}/runs/${t}`,{...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}update(t,r,o){let{thread_id:n,...i}=r;return this._client.post(w`/threads/${n}/runs/${t}`,{body:i,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/threads/${t}/runs`,de,{query:r,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}cancel(t,r,o){let{thread_id:n}=r;return this._client.post(w`/threads/${n}/runs/${t}/cancel`,{...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}async createAndPoll(t,r,o){let n=await this.create(t,r,o);return await this.poll(n.id,{thread_id:t},o)}createAndStream(t,r,o){return yi.createAssistantStream(t,this._client.beta.threads.runs,r,o)}async poll(t,r,o){return await IT(this,t,r,o)}stream(t,r,o){return yi.createAssistantStream(t,this._client.beta.threads.runs,r,o)}submitToolOutputs(t,r,o){let{thread_id:n,...i}=r;return this._client.post(w`/threads/${n}/runs/${t}/submit_tool_outputs`,{body:i,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),stream:r.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}async submitToolOutputsAndPoll(t,r,o){let n=await this.submitToolOutputs(t,r,o);return await this.poll(n.id,r,o)}submitToolOutputsStream(t,r,o){return yi.createToolAssistantStream(t,this._client.beta.threads.runs,r,o)}};Za.Steps=sc;var _i=class extends I{constructor(){super(...arguments),this.runs=new Za(this._client),this.messages=new ac(this._client)}create(t={},r){return this._client.post("/threads",{body:t,...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}retrieve(t,r){return this._client.get(w`/threads/${t}`,{...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}update(t,r,o){return this._client.post(w`/threads/${t}`,{body:r,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/threads/${t}`,{...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}createAndRun(t,r){return this._client.post("/threads/runs",{body:t,...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),stream:t.stream??!1,__synthesizeEventData:!0,__security:{bearerAuth:!0}})}async createAndRunPoll(t,r){let o=await this.createAndRun(t,r);return await this.runs.poll(o.id,{thread_id:o.thread_id},r)}createAndRunStream(t,r){return yi.createThreadAssistantStream(t,this._client.beta.threads,r)}};_i.Runs=Za;_i.Messages=ac;var Br=class extends I{constructor(){super(...arguments),this.realtime=new li(this._client),this.responses=new pi(this._client),this.chatkit=new di(this._client),this.assistants=new Qu(this._client),this.threads=new _i(this._client)}};Br.Realtime=li;Br.Responses=pi;Br.ChatKit=di;Br.Assistants=Qu;Br.Threads=_i;var Fa=class extends I{create(t,r){return this._client.post("/completions",{body:t,...r,stream:t.stream??!1,__security:{bearerAuth:!0}})}};var dc=class extends I{retrieve(t,r,o){let{container_id:n}=r;return this._client.get(w`/containers/${n}/files/${t}/content`,{...o,headers:D([{Accept:"application/binary"},o?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}};var Ba=class extends I{constructor(){super(...arguments),this.content=new dc(this._client)}create(t,r,o){return this._client.post(w`/containers/${t}/files`,ri({body:r,...o,__security:{bearerAuth:!0}},this._client))}retrieve(t,r,o){let{container_id:n}=r;return this._client.get(w`/containers/${n}/files/${t}`,{...o,__security:{bearerAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/containers/${t}/files`,de,{query:r,...o,__security:{bearerAuth:!0}})}delete(t,r,o){let{container_id:n}=r;return this._client.delete(w`/containers/${n}/files/${t}`,{...o,headers:D([{Accept:"*/*"},o?.headers]),__security:{bearerAuth:!0}})}};Ba.Content=dc;var vi=class extends I{constructor(){super(...arguments),this.files=new Ba(this._client)}create(t,r){return this._client.post("/containers",{body:t,...r,__security:{bearerAuth:!0}})}retrieve(t,r){return this._client.get(w`/containers/${t}`,{...r,__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/containers",de,{query:t,...r,__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/containers/${t}`,{...r,headers:D([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}};vi.Files=Ba;var Wa=class extends I{create(t,r){return this._client.post("/content_provenance_checks",mt({body:t,...r,__security:{bearerAuth:!0}},this._client))}};var pc=class extends I{create(t,r,o){let{include:n,...i}=r;return this._client.post(w`/conversations/${t}/items`,{query:{include:n},body:i,...o,__security:{bearerAuth:!0}})}retrieve(t,r,o){let{conversation_id:n,...i}=r;return this._client.get(w`/conversations/${n}/items/${t}`,{query:i,...o,__security:{bearerAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/conversations/${t}/items`,Ee,{query:r,...o,__security:{bearerAuth:!0}})}delete(t,r,o){let{conversation_id:n}=r;return this._client.delete(w`/conversations/${n}/items/${t}`,{...o,__security:{bearerAuth:!0}})}};var bi=class extends I{constructor(){super(...arguments),this.items=new pc(this._client)}create(t={},r){return this._client.post("/conversations",{body:t,...r,__security:{bearerAuth:!0}})}retrieve(t,r){return this._client.get(w`/conversations/${t}`,{...r,__security:{bearerAuth:!0}})}update(t,r,o){return this._client.post(w`/conversations/${t}`,{body:r,...o,__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/conversations/${t}`,{...r,__security:{bearerAuth:!0}})}};bi.Items=pc;function $T(e,t,r){let o=!!t.encoding_format,n=o?t.encoding_format:"base64";o&&lt(e).debug("embeddings/user defined encoding_format:",t.encoding_format);let i=e.post("/embeddings",{body:{...t,encoding_format:n},...r,__security:{bearerAuth:!0}});return o?i:(lt(e).debug("embeddings/decoding base64 embeddings from base64"),i._thenUnwrap(a=>{if(a&&a.data){let s=a.data,{length:u}=s;for(let c=0;c<u;c+=1)if(c in s){let l=s[c],d=l.embedding;l.embedding=uT(d)}}return a}))}var Ka=class extends I{create(t,r){return $T(this._client,t,r)}};var fc=class extends I{retrieve(t,r,o){let{eval_id:n,run_id:i}=r;return this._client.get(w`/evals/${n}/runs/${i}/output_items/${t}`,{...o,__security:{bearerAuth:!0}})}list(t,r,o){let{eval_id:n,...i}=r;return this._client.getAPIList(w`/evals/${n}/runs/${t}/output_items`,de,{query:i,...o,__security:{bearerAuth:!0}})}};var Va=class extends I{constructor(){super(...arguments),this.outputItems=new fc(this._client)}create(t,r,o){return this._client.post(w`/evals/${t}/runs`,{body:r,...o,__security:{bearerAuth:!0}})}retrieve(t,r,o){let{eval_id:n}=r;return this._client.get(w`/evals/${n}/runs/${t}`,{...o,__security:{bearerAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/evals/${t}/runs`,de,{query:r,...o,__security:{bearerAuth:!0}})}delete(t,r,o){let{eval_id:n}=r;return this._client.delete(w`/evals/${n}/runs/${t}`,{...o,__security:{bearerAuth:!0}})}cancel(t,r,o){let{eval_id:n}=r;return this._client.post(w`/evals/${n}/runs/${t}`,{...o,__security:{bearerAuth:!0}})}};Va.OutputItems=fc;var wi=class extends I{constructor(){super(...arguments),this.runs=new Va(this._client)}create(t,r){return this._client.post("/evals",{body:t,...r,__security:{bearerAuth:!0}})}retrieve(t,r){return this._client.get(w`/evals/${t}`,{...r,__security:{bearerAuth:!0}})}update(t,r,o){return this._client.post(w`/evals/${t}`,{body:r,...o,__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/evals",de,{query:t,...r,__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/evals/${t}`,{...r,__security:{bearerAuth:!0}})}};wi.Runs=Va;async function ST(e,t,r,o){let n=new Set(["processed","error","deleted"]),i=Date.now(),a=await e.retrieve(t);for(;!a.status||!n.has(a.status);)if(await gu(r),a=await e.retrieve(t),Date.now()-i>o)throw new ot({message:`Giving up on waiting for file ${t} to finish processing after ${o} milliseconds.`});return a}var qa=class extends I{create(t,r){return this._client.post("/files",mt({body:t,...r,__security:{bearerAuth:!0}},this._client))}retrieve(t,r){return this._client.get(w`/files/${t}`,{...r,__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/files",de,{query:t,...r,__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/files/${t}`,{...r,__security:{bearerAuth:!0}})}content(t,r){return this._client.get(w`/files/${t}/content`,{...r,headers:D([{Accept:"application/binary"},r?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}async waitForProcessing(t,{pollInterval:r=5e3,maxWait:o=1800*1e3}={}){return await ST(this,t,r,o)}};var mc=class extends I{};var hc=class extends I{run(t,r){return this._client.post("/fine_tuning/alpha/graders/run",{body:t,...r,__security:{bearerAuth:!0}})}validate(t,r){return this._client.post("/fine_tuning/alpha/graders/validate",{body:t,...r,__security:{bearerAuth:!0}})}};var Ja=class extends I{constructor(){super(...arguments),this.graders=new hc(this._client)}};Ja.Graders=hc;var gc=class extends I{create(t,r,o){return this._client.getAPIList(w`/fine_tuning/checkpoints/${t}/permissions`,Mt,{body:r,method:"post",...o,__security:{adminAPIKeyAuth:!0}})}retrieve(t,r={},o){return this._client.get(w`/fine_tuning/checkpoints/${t}/permissions`,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/fine_tuning/checkpoints/${t}/permissions`,Ee,{query:r,...o,__security:{adminAPIKeyAuth:!0}})}delete(t,r,o){let{fine_tuned_model_checkpoint:n}=r;return this._client.delete(w`/fine_tuning/checkpoints/${n}/permissions/${t}`,{...o,__security:{adminAPIKeyAuth:!0}})}};var Ha=class extends I{constructor(){super(...arguments),this.permissions=new gc(this._client)}};Ha.Permissions=gc;var yc=class extends I{list(t,r={},o){return this._client.getAPIList(w`/fine_tuning/jobs/${t}/checkpoints`,de,{query:r,...o,__security:{bearerAuth:!0}})}};var Xa=class extends I{constructor(){super(...arguments),this.checkpoints=new yc(this._client)}create(t,r){return this._client.post("/fine_tuning/jobs",{body:t,...r,__security:{bearerAuth:!0}})}retrieve(t,r){return this._client.get(w`/fine_tuning/jobs/${t}`,{...r,__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/fine_tuning/jobs",de,{query:t,...r,__security:{bearerAuth:!0}})}cancel(t,r){return this._client.post(w`/fine_tuning/jobs/${t}/cancel`,{...r,__security:{bearerAuth:!0}})}listEvents(t,r={},o){return this._client.getAPIList(w`/fine_tuning/jobs/${t}/events`,de,{query:r,...o,__security:{bearerAuth:!0}})}pause(t,r){return this._client.post(w`/fine_tuning/jobs/${t}/pause`,{...r,__security:{bearerAuth:!0}})}resume(t,r){return this._client.post(w`/fine_tuning/jobs/${t}/resume`,{...r,__security:{bearerAuth:!0}})}};Xa.Checkpoints=yc;var on=class extends I{constructor(){super(...arguments),this.methods=new mc(this._client),this.jobs=new Xa(this._client),this.checkpoints=new Ha(this._client),this.alpha=new Ja(this._client)}};on.Methods=mc;on.Jobs=Xa;on.Checkpoints=Ha;on.Alpha=Ja;var _c=class extends I{};var xi=class extends I{constructor(){super(...arguments),this.graderModels=new _c(this._client)}};xi.GraderModels=_c;var Ga=class extends I{createVariation(t,r){return this._client.post("/images/variations",mt({body:t,...r,__security:{bearerAuth:!0}},this._client))}edit(t,r){return this._client.post("/images/edits",mt({body:t,...r,stream:t.stream??!1,__metadata:{...r?.__metadata,...t.model==null?{}:{model:t.model}},__security:{bearerAuth:!0}},this._client))}generate(t,r){return this._client.post("/images/generations",{body:t,...r,stream:t.stream??!1,__security:{bearerAuth:!0}})}};var Ya=class extends I{retrieve(t,r){return this._client.get(w`/models/${t}`,{...r,__security:{bearerAuth:!0}})}list(t){return this._client.getAPIList("/models",Mt,{...t,__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/models/${t}`,{...r,__security:{bearerAuth:!0}})}};var Qa=class extends I{create(t,r){return this._client.post("/moderations",{body:t,...r,__security:{bearerAuth:!0}})}};async function OT(e,t,r,o=null){if(e.body===null||typeof e.body!="object"||Array.isArray(e.body))throw new TypeError("Multipart request body must be an object");let n=Object.fromEntries(Object.entries(e.body).filter(([,u])=>u!==void 0));if(o!==null&&Object.keys(n).length===1&&Object.prototype.hasOwnProperty.call(n,o)){let u=n[o];if(typeof u!="string")throw new TypeError("Raw multipart alternative must be a string");return{...e,body:u,headers:D([e.headers,{"content-type":r[o].content_type}])}}let i=[];for(let[u,c]of Object.entries(r)){if(!Object.prototype.hasOwnProperty.call(n,u))continue;let l=n[u],d=c.json?JSON.stringify(l):l;if(typeof d!="string")throw new TypeError(`Multipart field ${u} must encode as a string`);i.push([u,oo([d],"",{type:c.content_type})]),delete n[u]}let s=(await mt({...e,body:n},t)).body;if(!(s instanceof FormData))throw await s.cancel(),new TypeError("Unexpected streaming upload in typed multipart request body");for(let[u,c]of i)s.append(u,c,"");return{...e,body:s,headers:D([e.headers,{"content-type":null}])}}var vc=class extends I{create(t,r){return this._client.post("/realtime/calls",OT({body:t,...r,headers:D([{Accept:"application/sdp"},r?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0},this._client,{sdp:{content_type:"application/sdp",json:!1},session:{content_type:"application/json",json:!0}},"sdp"))}accept(t,r,o){return this._client.post(w`/realtime/calls/${t}/accept`,{body:r,...o,headers:D([{Accept:"*/*"},o?.headers]),__security:{bearerAuth:!0}})}hangup(t,r){return this._client.post(w`/realtime/calls/${t}/hangup`,{...r,headers:D([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}refer(t,r,o){return this._client.post(w`/realtime/calls/${t}/refer`,{body:r,...o,headers:D([{Accept:"*/*"},o?.headers]),__security:{bearerAuth:!0}})}reject(t,r={},o){return this._client.post(w`/realtime/calls/${t}/reject`,{body:r,...o,headers:D([{Accept:"*/*"},o?.headers]),__security:{bearerAuth:!0}})}};var bc=class extends I{create(t,r){return this._client.post("/realtime/client_secrets",{body:t,...r,__security:{bearerAuth:!0}})}};var co=class extends I{constructor(){super(...arguments),this.clientSecrets=new bc(this._client),this.calls=new vc(this._client)}};co.ClientSecrets=bc;co.Calls=vc;function PT(e,t){if(!t||!R2(t)){let r={...e,output_parsed:null,output:e.output.map(o=>o.type==="function_call"?{...o,parsed_arguments:null}:o.type==="message"?{...o,content:o.content.map(n=>({...n,parsed:null}))}:o)};return ET(e,r)&&wc(r),r}return $k(e,t)}function $k(e,t){let r=!e.status||e.status==="completed",o=e.output.map(i=>{if(i.type==="function_call")return r?z2(t,i):{...i,parsed_arguments:null};if(i.type==="message"){let a=i.content.map(s=>s.type==="output_text"?{...s,parsed:r?E2(t,s.text):null}:s);return{...i,content:a}}return i}),n={...e,output:o};return ET(e,n)&&wc(n),Object.defineProperty(n,"output_parsed",{enumerable:!0,get(){for(let i of n.output)if(i.type==="message"){for(let a of i.content)if(a.type==="output_text"&&a.parsed!==null)return a.parsed}return null}}),n}function E2(e,t){return en(e.text?.format,t)}function R2(e){return Cn(e.text?.format)?!0:Array.isArray(e.tools)&&e.tools.some(t=>TT(t)||t.type==="function"&&t.strict===!0)}function TT(e){return e?.$brand==="auto-parseable-tool"}function C2(e,t){return e.find(r=>r.type==="function"&&r.name===t)}function z2(e,t){let r=C2(e.tools??[],t.name),o=null;return TT(r)?o=r.$parseRaw(t.arguments):r?.strict&&(o=en({type:"json_schema",$parseRaw:void 0},t.arguments)),{...t,parsed_arguments:o}}function ET(e,t){return!Object.getOwnPropertyDescriptor(e,"output_text")||t.output_text==null}function wc(e){let t=[];for(let r of e.output)if(r.type==="message")for(let o of r.content)o.type==="output_text"&&t.push(o.text);e.output_text=t.join("")}var xc=class{constructor(){this.capacity=1,this.values=[0,0],this.size=0}get length(){return this.size}append(t){this.size===this.capacity&&this.grow();let r=this.size;this.size+=1,this.update(r,t)}update(t,r){if(!Number.isSafeInteger(t)||t<0||t>=this.size)throw new RangeError(`missing output at index ${t}`);let o=this.capacity+t,n=r-(this.values[o]??0);if(n!==0)for(;o>=1;)this.values[o]=(this.values[o]??0)+n,o=Math.floor(o/2)}prefixSum(t){if(!Number.isSafeInteger(t)||t<0||t>this.size)throw new RangeError(`missing output at index ${t}`);let r=this.capacity,o=this.capacity+t,n=0;for(;r<o;)r%2===1&&(n+=this.values[r]??0,r+=1),o%2===1&&(o-=1,n+=this.values[o]??0),r=Math.floor(r/2),o=Math.floor(o/2);return n}grow(){let t=this.capacity;this.capacity*=2;let r=Array.from({length:this.capacity*2},()=>0);for(let o=0;o<this.size;o+=1)r[this.capacity+o]=this.values[t+o]??0;for(let o=this.capacity-1;o>0;o-=1)r[o]=(r[o*2]??0)+(r[o*2+1]??0);this.values=r}};function Sk(){return{canonicalSnapshot:void 0,outputTextLengths:new WeakMap,outputTextIndex:new xc}}function kc(e,t){if(t.type!=="message")return"";let r="";for(let o of t.content)o.type==="output_text"&&(r+=o.text);return e.outputTextLengths.set(t,r.length),r}function ki(e,t){if(e.canonicalSnapshot===t)return;let r=new xc,o="";for(let n of t.output){let i=kc(e,n);o+=i,r.append(i.length)}t.output_text=o,e.outputTextIndex=r,e.canonicalSnapshot=t}function CT(e,t){e.canonicalSnapshot=void 0,e.outputTextLengths=new WeakMap,e.outputTextIndex=new xc;let r=structuredClone(t);return!Object.getOwnPropertyDescriptor(r,"output_text")||r.output_text===null||r.output_text===void 0?ki(e,r):r.output.length===0&&r.output_text===""&&(e.canonicalSnapshot=r),r}function Kd(e,t,r,o,n){let i=e.outputTextLengths.get(t);if(i!==void 0){let a=i-o.length+n.length;e.outputTextLengths.set(t,a),e.outputTextIndex.update(r,a)}}function RT(e,t,r){if(t.length===0){e.output_text+=r;return}e.output_text=e.output_text.slice(0,e.output_text.length-t.length)+r}function N2(e,t,r,o){if(r===void 0||t?.type!=="message")return 0;if(r<t.content.length-r-1){let a=0;for(let s=0;s<r;s+=1){let u=t.content[s];u?.type==="output_text"&&(a+=u.text.length)}return a}let n=0;for(let a=r+1;a<t.content.length;a+=1){let s=t.content[a];s?.type==="output_text"&&(n+=s.text.length)}return(e.outputTextLengths.get(t)??kc(e,t).length)-n-o.length}function Ac(e,t,r,o,n,i){if(o===n)return;let a=t.output[r];if(r===t.output.length-1&&(i===void 0||a?.type==="message"&&i===a.content.length-1)){RT(t,o,n);return}let s=N2(e,a,i,n),u=e.outputTextIndex.prefixSum(r)+s;if(u+o.length===t.output_text.length){RT(t,o,n);return}t.output_text=t.output_text.slice(0,u)+n+t.output_text.slice(u+o.length)}var Ok=new WeakMap;function Ai(e,t,r,o=!1){if(!Number.isSafeInteger(t)||t<0||t>e.length||(t===e.length?!o||t in e:!ie(e,t)))throw new k(`missing ${r} at index ${t}`)}function Ah(e,t,r){if(t!==e.length)throw new k(`missing ${r} at index ${t}`);Ai(e,t,r,!0)}function be(e,t){Ai(e.output,t,"output");let r=e.output[t];if(!r)throw new k(`missing output at index ${t}`);return r}function Pk(e){return e.type==="function_call"||e.type==="custom_tool_call"||e.type==="shell_call"||e.type==="shell_call_output"}function Ih(e,t){if(!ie(e,"type")||typeof e.type!="string")throw new k(`expected an own output item type for ${t}`);let r=e.type==="function_call"||e.type==="custom_tool_call",o=[];if(ie(e,"id")){if(typeof e.id!="string"||e.id.length===0)throw new k(`expected a non-empty output item id for ${t}`);o.push(`id:${e.id}`)}else if(!r)throw new k(`expected a non-empty output item id for ${t}`);if(Pk(e)){if(!ie(e,"call_id")||typeof e.call_id!="string"||e.call_id.length===0)throw new k(`expected a non-empty output item call_id for ${t}`);o.push(`call:${e.type}:${e.call_id}`)}return o}function jT(e,t){for(let r of t)if(e.has(r))throw new k(`duplicate output item identity '${r}'`)}function DT(e,t){jT(e,t);for(let r of t)e.add(r)}function MT(e){let t={snapshot:e,output:e.output,length:e.output.length,identities:new Set};for(let r=0;r<e.output.length;r+=1){let o=be(e,r);DT(t.identities,Ih(o,"response snapshot"))}return t}function j2(e,t){let r=Ok.get(e);if(r&&r.snapshot===t&&r.output===t.output&&r.length===t.output.length)return r;let o=MT(t);return Ok.set(e,o),o}function zT(e,t){let r=Sk(),o=CT(r,t),n=MT(o);return e.canonicalSnapshot=r.canonicalSnapshot,e.outputTextLengths=r.outputTextLengths,e.outputTextIndex=r.outputTextIndex,Ok.set(e,n),o}var Tk={"response.output_text.delta":"message","response.output_text.done":"message","response.output_text.annotation.added":"message","response.refusal.delta":"message","response.refusal.done":"message","response.function_call_arguments.delta":"function_call","response.function_call_arguments.done":"function_call","response.custom_tool_call_input.delta":"custom_tool_call","response.custom_tool_call_input.done":"custom_tool_call","response.mcp_call_arguments.delta":"mcp_call","response.mcp_call_arguments.done":"mcp_call","response.mcp_call.in_progress":"mcp_call","response.mcp_call.completed":"mcp_call","response.mcp_call.failed":"mcp_call","response.shell_call_output_content.delta":"shell_call_output","response.shell_call_output_content.done":"shell_call_output","response.reasoning_text.delta":"reasoning","response.reasoning_text.done":"reasoning","response.reasoning_summary_part.added":"reasoning","response.reasoning_summary_part.done":"reasoning","response.reasoning_summary_text.delta":"reasoning","response.reasoning_summary_text.done":"reasoning","response.code_interpreter_call_code.delta":"code_interpreter_call","response.code_interpreter_call_code.done":"code_interpreter_call","response.code_interpreter_call.in_progress":"code_interpreter_call","response.code_interpreter_call.interpreting":"code_interpreter_call","response.code_interpreter_call.completed":"code_interpreter_call","response.file_search_call.in_progress":"file_search_call","response.file_search_call.searching":"file_search_call","response.file_search_call.completed":"file_search_call","response.web_search_call.in_progress":"web_search_call","response.web_search_call.searching":"web_search_call","response.web_search_call.completed":"web_search_call","response.image_generation_call.in_progress":"image_generation_call","response.image_generation_call.generating":"image_generation_call","response.image_generation_call.completed":"image_generation_call","response.image_generation_call.partial_image":"image_generation_call","response.mcp_list_tools.in_progress":"mcp_list_tools","response.mcp_list_tools.completed":"mcp_list_tools","response.mcp_list_tools.failed":"mcp_list_tools"};function D2(e){return e.type==="response.content_part.added"||e.type==="response.content_part.done"?e.part.type==="reasoning_text"?"reasoning":"message":Tk[e.type]}function M2(e,t){let r=be(t,e.output_index),o=e.item;if(Ih(r,e.type),Ih(o,e.type),!ie(o,"type")||r.type!==o.type)throw new k(`expected output item type '${r.type}', got '${o.type}'`);let n=ie(r,"id")?r.id:void 0,i=ie(o,"id")?o.id:void 0;if(n!==i)throw new k(`expected output item id '${n}', got '${i}'`);if(Pk(r)&&Pk(o)&&r.call_id!==o.call_id)throw new k(`expected output item call_id '${r.call_id}', got '${o.call_id}'`)}function U2(e,t,r){if(e.type==="response.output_item.done"){M2(e,t);return}if(r&&(e.type==="response.shell_call_command.added"||e.type==="response.shell_call_command.delta"||e.type==="response.shell_call_command.done")){let s=be(t,e.output_index);if(!ie(s,"type")||s.type!=="shell_call")throw new k(`expected output item type 'shell_call', got '${s.type}'`);return}if(e.type!=="response.content_part.added"&&e.type!=="response.content_part.done"&&!ie(Tk,e.type))return;let o=e;if(!ie(e,"item_id")||typeof o.item_id!="string"||o.item_id.length===0)throw new k(`expected a non-empty item_id for ${e.type}`);let n=be(t,o.output_index),i=ie(n,"id")?n.id:void 0;if(i!==o.item_id)throw new k(`expected item_id '${i}', got '${o.item_id}'`);let a=D2(o);if(n.type!==a)throw new k(`expected output item type '${a}', got '${n.type}'`)}function lr(e,t){Ai(e,t,"content");let r=e[t];if(!r)throw new k(`missing content at index ${t}`);return r}function NT(e,t,r){let o=e.output.find(n=>n.type==="shell_call"&&n.call_id===t.call_id);for(o?Ai(o.action.commands,r,"command"):Ai(t.output,r,"content",!0);t.output.length<=r;)t.output.push({stdout:"",stderr:"",outcome:{type:"exit",exit_code:0}});return lr(t.output,r)}function L2(e){return new Set(e)}var Z2=L2(["response.output_item.added","response.output_item.done","response.content_part.added","response.content_part.done","response.output_text.delta","response.output_text.done","response.output_text.annotation.added","response.refusal.delta","response.refusal.done","response.function_call_arguments.delta","response.function_call_arguments.done","response.custom_tool_call_input.delta","response.custom_tool_call_input.done","response.mcp_call_arguments.delta","response.mcp_call_arguments.done","response.shell_call_command.added","response.shell_call_command.done","response.shell_call_command.delta","response.shell_call_output_content.delta","response.shell_call_output_content.done","response.reasoning_text.delta","response.reasoning_text.done","response.reasoning_summary_part.added","response.reasoning_summary_part.done","response.reasoning_summary_text.delta","response.reasoning_summary_text.done","response.code_interpreter_call_code.delta","response.code_interpreter_call_code.done","response.code_interpreter_call.in_progress","response.code_interpreter_call.interpreting","response.code_interpreter_call.completed","response.file_search_call.in_progress","response.file_search_call.searching","response.file_search_call.completed","response.web_search_call.in_progress","response.web_search_call.searching","response.web_search_call.completed","response.image_generation_call.in_progress","response.image_generation_call.generating","response.image_generation_call.completed","response.mcp_call.in_progress","response.mcp_call.completed","response.mcp_call.failed","response.created","response.queued","response.in_progress","response.completed","response.failed","response.incomplete","response.audio.delta","response.audio.done","response.audio.transcript.delta","response.audio.transcript.done","response.image_generation_call.partial_image","response.mcp_list_tools.in_progress","response.mcp_list_tools.completed","response.mcp_list_tools.failed","keepalive","error"]);function kh(e){throw new k("Unhandled response stream event: unknown")}var F2=["item_id","output_index","content_index","annotation_index","command_index","summary_index"];function B2(e){let t;try{t=Object.getOwnPropertyDescriptor(e,"type")}catch{return kh(e)}let r=t?.value;if(typeof r!="string"||!Z2.has(r))return kh(e);let o=new Map([["type",r]]);if(r==="response.output_item.added"||r==="response.output_item.done"||r==="response.content_part.added"||r==="response.content_part.done"||r==="response.shell_call_command.added"||r==="response.shell_call_command.delta"||r==="response.shell_call_command.done"||ie(Tk,r))try{for(let i of F2){let a=Object.getOwnPropertyDescriptor(e,i);o.set(i,a?Reflect.get(e,i,e):void 0)}r==="response.output_item.done"?o.set("item",structuredClone(Reflect.get(e,"item",e))):(r==="response.content_part.added"||r==="response.content_part.done")&&o.set("part",structuredClone(Reflect.get(e,"part",e)))}catch{return kh(e)}return new Proxy(e,{get(i,a){return o.has(a)?o.get(a):Reflect.get(i,a,i)}})}function W2(e,t,r){switch(e.type){case"response.output_item.added":{Ah(t.output,e.output_index,"output");let o=j2(r,t),n=structuredClone(e.item),i=Ih(n,e.type);jT(o.identities,i),n.type==="message"&&ki(r,t),t.output.push(n),DT(o.identities,i),o.length=t.output.length;let a=kc(r,n);return r.canonicalSnapshot===t&&r.outputTextIndex.append(a.length),a&&(t.output_text+=a),!0}case"response.output_item.done":{let o=be(t,e.output_index),n=kc(r,o),i=e.item;(o.type==="message"||i.type==="message")&&ki(r,t),t.output[e.output_index]=i;let a=kc(r,i);return r.canonicalSnapshot===t&&r.outputTextIndex.update(e.output_index,a.length),Ac(r,t,e.output_index,n,a),!0}default:return!1}}function K2(e,t,r){switch(e.type){case"response.content_part.added":{let o=be(t,e.output_index),{type:n}=o,{part:i}=e;if(n==="message"&&i.type!=="reasoning_text"){Ah(o.content,e.content_index,"content");let a=i;a.type==="output_text"&&ki(r,t),o.content.push(a),a.type==="output_text"&&(Kd(r,o,e.output_index,"",a.text),Ac(r,t,e.output_index,"",a.text,e.content_index))}else if(n==="reasoning"&&i.type==="reasoning_text"){let a=o.content??[];Ah(a,e.content_index,"content"),o.content||(o.content=a),a.push(i)}return!0}default:return!1}}function V2(e,t,r){switch(e.type){case"response.content_part.done":{let o=be(t,e.output_index),{part:n}=e;if(o.type==="message"&&n.type!=="reasoning_text"){let i=lr(o.content,e.content_index),a=i.type==="output_text"?i.text:"",s=n;(i.type==="output_text"||s.type==="output_text")&&ki(r,t),o.content[e.content_index]=s;let u=s.type==="output_text"?s.text:"";Kd(r,o,e.output_index,a,u),Ac(r,t,e.output_index,a,u,e.content_index)}else if(o.type==="reasoning"&&n.type==="reasoning_text"){let{content:i}=o;if(!i)throw new k(`missing content at index ${e.content_index}`);lr(i,e.content_index),i[e.content_index]=n}return!0}default:return!1}}function q2(e,t,r){switch(e.type){case"response.output_text.delta":{let o=be(t,e.output_index);if(o.type==="message"){let n=lr(o.content,e.content_index);if(n.type!=="output_text")throw new k(`expected content to be 'output_text', got ${n.type}`);let i=n.text;ki(r,t),n.text=i+e.delta,Kd(r,o,e.output_index,i,n.text),e.output_index===t.output.length-1&&e.content_index===o.content.length-1?t.output_text+=e.delta:Ac(r,t,e.output_index,i,n.text,e.content_index)}return!0}case"response.output_text.done":{let o=be(t,e.output_index);if(o.type==="message"){let n=lr(o.content,e.content_index);if(n.type!=="output_text")throw new k(`expected content to be 'output_text', got ${n.type}`);let i=n.text;ki(r,t),n.text=e.text,Kd(r,o,e.output_index,i,e.text),Ac(r,t,e.output_index,i,e.text,e.content_index)}return!0}case"response.output_text.annotation.added":{let o=be(t,e.output_index);if(o.type==="message"){let n=lr(o.content,e.content_index);if(n.type!=="output_text")throw new k(`expected content to be 'output_text', got ${n.type}`);Ai(n.annotations,e.annotation_index,"annotation",!0),n.annotations[e.annotation_index]=structuredClone(e.annotation)}return!0}default:return!1}}function J2(e,t){switch(e.type){case"response.refusal.delta":{let r=be(t,e.output_index);if(r.type==="message"){let o=lr(r.content,e.content_index);if(o.type!=="refusal")throw new k(`expected content to be 'refusal', got ${o.type}`);o.refusal+=e.delta}return!0}case"response.refusal.done":{let r=be(t,e.output_index);if(r.type==="message"){let o=lr(r.content,e.content_index);if(o.type!=="refusal")throw new k(`expected content to be 'refusal', got ${o.type}`);o.refusal=e.refusal}return!0}case"response.function_call_arguments.delta":{let r=be(t,e.output_index);return r.type==="function_call"&&(r.arguments+=e.delta),!0}case"response.function_call_arguments.done":{let r=be(t,e.output_index);return r.type==="function_call"&&(r.arguments=e.arguments),!0}case"response.custom_tool_call_input.delta":{let r=be(t,e.output_index);return r.type==="custom_tool_call"&&(r.input+=e.delta),!0}case"response.custom_tool_call_input.done":{let r=be(t,e.output_index);return r.type==="custom_tool_call"&&(r.input=e.input),!0}case"response.mcp_call_arguments.delta":{let r=be(t,e.output_index);return r.type==="mcp_call"&&(r.arguments+=e.delta),!0}case"response.mcp_call_arguments.done":{let r=be(t,e.output_index);return r.type==="mcp_call"&&(r.arguments=e.arguments),!0}default:return!1}}function H2(e,t){switch(e.type){case"response.shell_call_command.added":case"response.shell_call_command.done":{let r=be(t,e.output_index);if(r.type==="shell_call"){let o=e.type==="response.shell_call_command.added";Ai(r.action.commands,e.command_index,"command",o),r.action.commands[e.command_index]=e.command}return!0}case"response.shell_call_command.delta":{let r=be(t,e.output_index);return r.type==="shell_call"&&(Ai(r.action.commands,e.command_index,"command"),r.action.commands[e.command_index]+=e.delta),!0}case"response.shell_call_output_content.delta":{let r=be(t,e.output_index);if(r.type==="shell_call_output"){let o=NT(t,r,e.command_index);o.stdout+=e.delta.stdout??"",o.stderr+=e.delta.stderr??""}return!0}case"response.shell_call_output_content.done":{let r=be(t,e.output_index);if(r.type==="shell_call_output"){let o=lr(e.output,0);NT(t,r,e.command_index),r.output[e.command_index]=structuredClone(o)}return!0}default:return!1}}function X2(e,t){switch(e.type){case"response.reasoning_text.delta":{let r=be(t,e.output_index);if(r.type==="reasoning"){if(!r.content)throw new k(`missing content at index ${e.content_index}`);let o=lr(r.content,e.content_index);if(o.type!=="reasoning_text")throw new k(`expected content to be 'reasoning_text', got ${o.type}`);o.text+=e.delta}return!0}case"response.reasoning_text.done":{let r=be(t,e.output_index);if(r.type==="reasoning"){if(!r.content)throw new k(`missing content at index ${e.content_index}`);let o=lr(r.content,e.content_index);if(o.type!=="reasoning_text")throw new k(`expected content to be 'reasoning_text', got ${o.type}`);o.text=e.text}return!0}case"response.reasoning_summary_part.added":{let r=be(t,e.output_index);return r.type==="reasoning"&&(Ah(r.summary,e.summary_index,"content"),r.summary.push(structuredClone(e.part))),!0}case"response.reasoning_summary_part.done":{let r=be(t,e.output_index);return r.type==="reasoning"&&(lr(r.summary,e.summary_index),r.summary[e.summary_index]=structuredClone(e.part)),!0}case"response.reasoning_summary_text.delta":{let r=be(t,e.output_index);if(r.type==="reasoning"){let o=lr(r.summary,e.summary_index);o.text+=e.delta}return!0}case"response.reasoning_summary_text.done":{let r=be(t,e.output_index);if(r.type==="reasoning"){let o=lr(r.summary,e.summary_index);o.text=e.text}return!0}default:return!1}}function G2(e,t){switch(e.type){case"response.code_interpreter_call_code.delta":{let r=be(t,e.output_index);return r.type==="code_interpreter_call"&&(r.code=(r.code??"")+e.delta),!0}case"response.code_interpreter_call_code.done":{let r=be(t,e.output_index);return r.type==="code_interpreter_call"&&(r.code=e.code),!0}case"response.code_interpreter_call.in_progress":{let r=be(t,e.output_index);return r.type==="code_interpreter_call"&&(r.status="in_progress"),!0}case"response.code_interpreter_call.interpreting":{let r=be(t,e.output_index);return r.type==="code_interpreter_call"&&(r.status="interpreting"),!0}case"response.code_interpreter_call.completed":{let r=be(t,e.output_index);return r.type==="code_interpreter_call"&&(r.status="completed"),!0}default:return!1}}function Y2(e,t){switch(e.type){case"response.file_search_call.in_progress":{let r=be(t,e.output_index);return r.type==="file_search_call"&&(r.status="in_progress"),!0}case"response.file_search_call.searching":{let r=be(t,e.output_index);return r.type==="file_search_call"&&(r.status="searching"),!0}case"response.file_search_call.completed":{let r=be(t,e.output_index);return r.type==="file_search_call"&&(r.status="completed"),!0}case"response.web_search_call.in_progress":{let r=be(t,e.output_index);return r.type==="web_search_call"&&(r.status="in_progress"),!0}case"response.web_search_call.searching":{let r=be(t,e.output_index);return r.type==="web_search_call"&&(r.status="searching"),!0}case"response.web_search_call.completed":{let r=be(t,e.output_index);return r.type==="web_search_call"&&(r.status="completed"),!0}default:return!1}}function Q2(e,t){switch(e.type){case"response.image_generation_call.in_progress":{let r=be(t,e.output_index);return r.type==="image_generation_call"&&(r.status="in_progress"),!0}case"response.image_generation_call.generating":{let r=be(t,e.output_index);return r.type==="image_generation_call"&&(r.status="generating"),!0}case"response.image_generation_call.completed":{let r=be(t,e.output_index);return r.type==="image_generation_call"&&(r.status="completed"),!0}case"response.mcp_call.in_progress":{let r=be(t,e.output_index);return r.type==="mcp_call"&&(r.status="in_progress"),!0}case"response.mcp_call.completed":{let r=be(t,e.output_index);return r.type==="mcp_call"&&(r.status="completed"),!0}case"response.mcp_call.failed":{let r=be(t,e.output_index);return r.type==="mcp_call"&&(r.status="failed"),!0}default:return!1}}function eL(e){switch(e.type){case"response.created":case"response.queued":case"response.in_progress":case"response.completed":case"response.failed":case"response.incomplete":return!0;default:return!1}}function tL(e){switch(e.type){case"response.audio.delta":case"response.audio.done":case"response.audio.transcript.delta":case"response.audio.transcript.done":case"response.image_generation_call.partial_image":case"response.mcp_list_tools.in_progress":case"response.mcp_list_tools.completed":case"response.mcp_list_tools.failed":case"keepalive":case"error":return!0;default:return!1}}function $h(){return Sk()}function UT(e,t,r,o=!1,n){let i=B2(e);if(n&&i.type!=="keepalive"&&n(i),!t){if(i.type!=="response.created")throw new k(`When snapshot hasn't been set yet, expected 'response.created' event, got ${i.type}`);return zT(r,i.response)}return U2(i,t,o),W2(i,t,r)||K2(i,t,r)||V2(i,t,r)||q2(i,t,r)||J2(i,t)||H2(i,t)||X2(i,t)||G2(i,t)||Y2(i,t)||Q2(i,t)?t:eL(i)?zT(r,i.response):tL(i)?t:kh(i)}var Ii,Sh,es,Oh,Vd,Ek,Rk,Ck,Ph=class e extends oi{constructor(t){super(),Ii.add(this),Sh.set(this,void 0),es.set(this,void 0),Oh.set(this,void 0),Vd.set(this,$h()),z(this,Sh,t,"f")}static createResponse(t,r,o){let n=new e(r);return n._run(()=>n._createOrRetrieveResponse(t,r,{...o,__metadata:{...o?.__metadata,helperMethod:"stream"}})),n}static fromReadableStream(t){let r=new e(null);return r._run(()=>r._fromReadableStream(t)),r}async _createOrRetrieveResponse(t,r,o){this._listenForAbort(o?.signal),m(this,Ii,"m",Ek).call(this);let n,i=null;"response_id"in r?(n=await t.responses.retrieve(r.response_id,{stream:!0},{...o,signal:this.controller.signal,stream:!0}),i=r.starting_after??null):n=await t.responses.create({...r,stream:!0},{...o,signal:this.controller.signal}),this._connected();for await(let a of n)m(this,Ii,"m",Rk).call(this,a,i);if(n.controller.signal?.aborted)throw new $e;return m(this,Ii,"m",Ck).call(this)}async _fromReadableStream(t,r){this._listenForAbort(r?.signal),m(this,Ii,"m",Ek).call(this),this._connected();let o=sr.fromReadableStream(t,this.controller);for await(let n of o)m(this,Ii,"m",Rk).call(this,n,null);if(o.controller.signal?.aborted)throw new $e;return m(this,Ii,"m",Ck).call(this)}[(Sh=new WeakMap,es=new WeakMap,Oh=new WeakMap,Vd=new WeakMap,Ii=new WeakSet,Ek=function(){this.ended||(z(this,es,void 0,"f"),z(this,Vd,$h(),"f"))},Rk=function(r,o){if(this.ended)return;let n=(s,u)=>{(o==null||u.sequence_number>o)&&this._emit(s,u)};if(r.type==="error"){let s="error"in r&&typeof r.error=="object"&&r.error!==null?r.error:r;throw new qe(void 0,s,r.message,void 0)}let i=r,a=UT(r,m(this,es,"f"),m(this,Vd,"f"),!0,s=>{i=s});switch(z(this,es,a,"f"),n("event",r),i.type){case"response.output_text.delta":{let s=a.output[i.output_index];if(!s)throw new k(`missing output at index ${i.output_index}`);if(s.type==="message"){let u=s.content[i.content_index];if(!u)throw new k(`missing content at index ${i.content_index}`);if(u.type!=="output_text")throw new k(`expected content to be 'output_text', got ${u.type}`);n("response.output_text.delta",{...i,type:i.type,item_id:i.item_id,output_index:i.output_index,content_index:i.content_index,snapshot:u.text})}break}case"response.function_call_arguments.delta":{let s=a.output[i.output_index];if(!s)throw new k(`missing output at index ${i.output_index}`);s.type==="function_call"&&n("response.function_call_arguments.delta",{...i,type:i.type,item_id:i.item_id,output_index:i.output_index,snapshot:s.arguments});break}default:{n(i.type,r);break}}},Ck=function(){if(this.ended)throw new k("stream has ended, this shouldn't happen");let r=m(this,es,"f");if(!r)throw new k("request ended without sending any events");z(this,es,void 0,"f"),z(this,Vd,$h(),"f");let o=rL(r,m(this,Sh,"f"));return z(this,Oh,o,"f"),o},Symbol.asyncIterator)](){return this._createIterator(t=>{let r=o=>t(o);return this.on("event",r),()=>this.off("event",r)},{onReturn:()=>this.abort()})}async finalResponse(){await this.done();let t=m(this,Oh,"f");if(!t)throw new k("stream ended without producing a Response");return t}};function rL(e,t){return PT(e,t)}var Ic=class extends I{list(t,r={},o){return this._client.getAPIList(w`/responses/${t}/input_items`,de,{query:r,...o,__security:{bearerAuth:!0}})}};var $c=class extends I{count(t={},r){return this._client.post("/responses/input_tokens",{body:t,...r,__security:{bearerAuth:!0}})}};var jn=class extends I{constructor(){super(...arguments),this.inputItems=new Ic(this._client),this.inputTokens=new $c(this._client)}create(t,r){return this._client.post("/responses",{body:t,...r,stream:t.stream??!1,__security:{bearerAuth:!0}})._thenUnwrap(o=>("object"in o&&o.object==="response"&&wc(o),o))}retrieve(t,r={},o){return this._client.get(w`/responses/${t}`,{query:r,...o,stream:r?.stream??!1,__security:{bearerAuth:!0}})._thenUnwrap(n=>("object"in n&&n.object==="response"&&wc(n),n))}delete(t,r){return this._client.delete(w`/responses/${t}`,{...r,headers:D([{Accept:"*/*"},r?.headers]),__security:{bearerAuth:!0}})}parse(t,r){return this._client.responses.create(t,r)._thenUnwrap(o=>$k(o,t))}stream(t,r){return Ph.createResponse(this._client,t,r)}cancel(t,r){return this._client.post(w`/responses/${t}/cancel`,{...r,__security:{bearerAuth:!0}})}compact(t,r){return this._client.post("/responses/compact",{body:t,...r,__security:{bearerAuth:!0}})}};jn.InputItems=Ic;jn.InputTokens=$c;var Sc=class extends I{retrieve(t,r){return this._client.get(w`/safety/alerts/${t}`,{...r,__security:{bearerAuth:!0}})}};var $i=class extends I{constructor(){super(...arguments),this.alerts=new Sc(this._client)}};$i.Alerts=Sc;var Oc=class extends I{retrieve(t,r){return this._client.get(w`/skills/${t}/content`,{...r,headers:D([{Accept:"application/binary"},r?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}};var Pc=class extends I{retrieve(t,r,o){let{skill_id:n}=r;return this._client.get(w`/skills/${n}/versions/${t}/content`,{...o,headers:D([{Accept:"application/binary"},o?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}};var ts=class extends I{constructor(){super(...arguments),this.content=new Pc(this._client)}create(t,r={},o){return this._client.post(w`/skills/${t}/versions`,ri({body:r,...o,__security:{bearerAuth:!0}},this._client,{stripFilenames:!1}))}retrieve(t,r,o){let{skill_id:n}=r;return this._client.get(w`/skills/${n}/versions/${t}`,{...o,__security:{bearerAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/skills/${t}/versions`,de,{query:r,...o,__security:{bearerAuth:!0}})}delete(t,r,o){let{skill_id:n}=r;return this._client.delete(w`/skills/${n}/versions/${t}`,{...o,__security:{bearerAuth:!0}})}};ts.Content=Pc;var lo=class extends I{constructor(){super(...arguments),this.content=new Oc(this._client),this.versions=new ts(this._client)}create(t={},r){return this._client.post("/skills",ri({body:t,...r,__security:{bearerAuth:!0}},this._client,{stripFilenames:!1}))}retrieve(t,r){return this._client.get(w`/skills/${t}`,{...r,__security:{bearerAuth:!0}})}update(t,r,o){return this._client.post(w`/skills/${t}`,{body:r,...o,__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/skills",de,{query:t,...r,__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/skills/${t}`,{...r,__security:{bearerAuth:!0}})}};lo.Content=Oc;lo.Versions=ts;var Tc=class extends I{create(t,r,o){return this._client.post(w`/uploads/${t}/parts`,mt({body:r,...o,__security:{bearerAuth:!0}},this._client))}};var Si=class extends I{constructor(){super(...arguments),this.parts=new Tc(this._client)}create(t,r){return this._client.post("/uploads",{body:t,...r,__security:{bearerAuth:!0}})}cancel(t,r){return this._client.post(w`/uploads/${t}/cancel`,{...r,__security:{bearerAuth:!0}})}complete(t,r,o){return this._client.post(w`/uploads/${t}/complete`,{body:r,...o,__security:{bearerAuth:!0}})}};Si.Parts=Tc;function LT(e,t,r,o){return Wd(n=>e.retrieve(r,{vector_store_id:t},{...o,headers:n}),["in_progress"],["failed","completed"],o)}function ZT(e,t,r,o){return Wd(n=>e.retrieve(r,{vector_store_id:t},{...o,headers:n}),["in_progress"],["failed","cancelled","completed"],o)}var FT=async e=>{let t=await Promise.allSettled(e),r=t.filter(n=>n.status==="rejected");if(r.length)throw Object.defineProperty(new Error(`${r.length} promise(s) failed`),"rejections",{configurable:!0,value:r.map(({reason:n})=>n),writable:!0});let o=[];for(let n of t)n.status==="fulfilled"&&o.push(n.value);return o};async function BT(e,t,r,o,n,i){if(o==null||o.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,o.length),u=o.values(),c=[...n];async function l(p){for(let f of p){let h=await t.files.create({file:f,purpose:"assistants"},i);c.push(h.id)}}let d=[];d.length=s;for(let p=0;p<d.length;p+=1)d[p]=l(u);return await FT(d),await e.createAndPoll(r,{file_ids:c},i)}var Ec=class extends I{create(t,r,o){return this._client.post(w`/vector_stores/${t}/file_batches`,{body:r,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}retrieve(t,r,o){let{vector_store_id:n}=r;return this._client.get(w`/vector_stores/${n}/file_batches/${t}`,{...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}cancel(t,r,o){let{vector_store_id:n}=r;return this._client.post(w`/vector_stores/${n}/file_batches/${t}/cancel`,{...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}async createAndPoll(t,r,o){let n=await this.create(t,r,o);return await this.poll(t,n.id,o)}listFiles(t,r,o){let{vector_store_id:n,...i}=r;return this._client.getAPIList(w`/vector_stores/${n}/file_batches/${t}/files`,de,{query:i,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}async poll(t,r,o){return await ZT(this,t,r,o)}async uploadAndPoll(t,{files:r,fileIds:o=[]},n){return await BT(this,this._client,t,r,o,n)}};var Rc=class extends I{create(t,r,o){return this._client.post(w`/vector_stores/${t}/files`,{body:r,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}retrieve(t,r,o){let{vector_store_id:n}=r;return this._client.get(w`/vector_stores/${n}/files/${t}`,{...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}update(t,r,o){let{vector_store_id:n,...i}=r;return this._client.post(w`/vector_stores/${n}/files/${t}`,{body:i,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}list(t,r={},o){return this._client.getAPIList(w`/vector_stores/${t}/files`,de,{query:r,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}delete(t,r,o){let{vector_store_id:n}=r;return this._client.delete(w`/vector_stores/${n}/files/${t}`,{...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}async createAndPoll(t,r,o){let n=await this.create(t,r,o);return await this.poll(t,n.id,o)}async poll(t,r,o){return await LT(this,t,r,o)}async upload(t,r,o){let n=await this._client.files.create({file:r,purpose:"assistants"},o);return this.create(t,{file_id:n.id},o)}async uploadAndPoll(t,r,o){let n=await this.upload(t,r,o);return await this.poll(t,n.id,o)}content(t,r,o){let{vector_store_id:n}=r;return this._client.getAPIList(w`/vector_stores/${n}/files/${t}/content`,Mt,{...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}};var po=class extends I{constructor(){super(...arguments),this.files=new Rc(this._client),this.fileBatches=new Ec(this._client)}create(t,r){return this._client.post("/vector_stores",{body:t,...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}retrieve(t,r){return this._client.get(w`/vector_stores/${t}`,{...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}update(t,r,o){return this._client.post(w`/vector_stores/${t}`,{body:r,...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/vector_stores",de,{query:t,...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/vector_stores/${t}`,{...r,headers:D([{"OpenAI-Beta":"assistants=v2"},r?.headers]),__security:{bearerAuth:!0}})}search(t,r,o){return this._client.getAPIList(w`/vector_stores/${t}/search`,Mt,{body:r,method:"post",...o,headers:D([{"OpenAI-Beta":"assistants=v2"},o?.headers]),__security:{bearerAuth:!0}})}};po.Files=Rc;po.FileBatches=Ec;var rs=class extends I{create(t,r){return this._client.post("/videos",mt({body:t,...r,__security:{bearerAuth:!0}},this._client))}retrieve(t,r){return this._client.get(w`/videos/${t}`,{...r,__security:{bearerAuth:!0}})}list(t={},r){return this._client.getAPIList("/videos",Ee,{query:t,...r,__security:{bearerAuth:!0}})}delete(t,r){return this._client.delete(w`/videos/${t}`,{...r,__security:{bearerAuth:!0}})}createCharacter(t,r){return this._client.post("/videos/characters",mt({body:t,...r,__security:{bearerAuth:!0}},this._client))}downloadContent(t,r={},o){return this._client.get(w`/videos/${t}/content`,{query:r,...o,headers:D([{Accept:"application/binary"},o?.headers]),__security:{bearerAuth:!0},__binaryResponse:!0})}edit(t,r){return this._client.post("/videos/edits",mt({body:t,...r,__security:{bearerAuth:!0}},this._client))}extend(t,r){return this._client.post("/videos/extensions",mt({body:t,...r,__security:{bearerAuth:!0}},this._client))}getCharacter(t,r){return this._client.get(w`/videos/characters/${t}`,{...r,__security:{bearerAuth:!0}})}remix(t,r,o){return this._client.post(w`/videos/${t}/remix`,ri({body:r,...o,__security:{bearerAuth:!0}},this._client))}};var WT=32,pL=32;function zk(e){return e.split(" ",WT+1).length>WT}function*Nk(e){let t=0;for(;t<=e.length;){let r=e.indexOf(" ",t),o=e.slice(t,r===-1?void 0:r);if(yield o.startsWith("v1,")?o.slice(3):o,r===-1)break;t=r+1}}function KT(e){try{let t=_h(e);return t.byteLength===pL?t:void 0}catch{return}}function fL(e){for(let t of Nk(e)){let r=KT(t);if(r)return r}}function mL(e,t,r){let o=r;for(let n of Nk(e)){let i=KT(n);if(!i)continue;let a=0;for(let[s,u]of i.entries())a|=u^(t[s]??0);a===0&&(o=i)}return o}async function VT(e,t,r,o,n,i){let a=Number.parseInt(r,10);if(Number.isNaN(a))throw new ar("Invalid webhook timestamp format");let s=Math.floor(Date.now()/1e3);if(s-a>i)throw new ar("Webhook timestamp is too old");if(a>s+i)throw new ar("Webhook timestamp is too new");let u=zk(t),c=u?fL(t):void 0;if(u&&!c)throw new ar("The given webhook signature does not match the expected signature");let l=Uint8Array.from(n.startsWith("whsec_")?_h(n.slice(6)):Pt(n)),d=o?`${o}.${r}.${e}`:`${r}.${e}`,p=Uint8Array.from(Pt(d)),f=await crypto.subtle.importKey("raw",l,{name:"HMAC",hash:"SHA-256"},!1,u?["sign","verify"]:["verify"]);if(u&&c){let h=new Uint8Array(await crypto.subtle.sign("HMAC",f,p)),y=mL(t,h,c);try{if(await crypto.subtle.verify("HMAC",f,Uint8Array.from(y),p))return}catch{}throw new ar("The given webhook signature does not match the expected signature")}for(let h of Nk(t))try{let y=Uint8Array.from(_h(h));if(await crypto.subtle.verify("HMAC",f,y,p))return}catch{}throw new ar("The given webhook signature does not match the expected signature")}var Cc,qT,Th,ns=class extends I{constructor(){super(...arguments),Cc.add(this)}async unwrap(t,r,o=this._client.webhookSecret,n=300){return await this.verifySignature(t,r,o,n),JSON.parse(t)}async verifySignature(t,r,o=this._client.webhookSecret,n=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");m(this,Cc,"m",qT).call(this,o);let i=D([r]).values,a=m(this,Cc,"m",Th).call(this,i,"webhook-signature"),s=m(this,Cc,"m",Th).call(this,i,"webhook-timestamp"),u=m(this,Cc,"m",Th).call(this,i,"webhook-id");if(zk(a)&&typeof crypto.subtle.sign!="function")throw new Error("Webhook signature verification is only supported when the `crypto` global is defined");return await VT(t,a,s,u,o,n)}};Cc=new WeakSet,qT=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")},Th=function(t,r){if(!t)throw new Error("Headers are required");let o=t.get(r);if(o==null)throw new Error(`Missing required header: ${r}`);return o};var HT=Symbol.for("openai.node.providerDefinitions.v1"),XT=globalThis,GT=XT[HT],YT=GT??new WeakMap;GT||Object.defineProperty(XT,HT,{value:YT});function QT(e){let t=YT.get(e);if(!t)throw new Error("Invalid provider. Providers must be created with createProvider().");return t.configure()}var jk,an,qd,Ye,Eh,fo,Hd,Jd,nE;function eE(){if(j0())return!0;let e=globalThis;return typeof e.WorkerGlobalScope=="function"&&e instanceof e.WorkerGlobalScope&&typeof e.WorkerNavigator=="function"&&e.navigator instanceof e.WorkerNavigator&&typeof e.navigator?.userAgent=="string"&&e.navigator.userAgent!=="Cloudflare-Workers"&&e.process?.versions?.node===void 0&&e.Deno===void 0&&e.Bun===void 0&&e.EdgeRuntime===void 0&&e.WebSocketPair===void 0}var hL="workload-identity-auth",tE=Symbol("inheritedDataResidencySelection"),ae=class{constructor(t={}){jk.add(this),qd.set(this,void 0),Ye.set(this,void 0),Eh.set(this,void 0),fo.set(this,void 0),Hd.set(this,!1),Jd.set(this,new WeakMap),this.completions=new Fa(this),this.chat=new si(this),this.embeddings=new Ka(this),this.files=new qa(this),this.images=new Ga(this),this.contentProvenanceChecks=new Wa(this),this.audio=new Nn(this),this.moderations=new Qa(this),this.models=new Ya(this),this.fineTuning=new on(this),this.graders=new xi(this),this.vectorStores=new po(this),this.safety=new $i(this),this.webhooks=new ns(this),this.beta=new Br(this),this.batches=new Ma(this),this.uploads=new Si(this),this.admin=new ci(this),this.responses=new jn(this),this.realtime=new co(this),this.conversations=new bi(this),this.evals=new wi(this),this.containers=new vi(this),this.skills=new lo(this),this.videos=new rs(this);let{credential:r,options:o}=bP(t);t=o;let n=Tx(t),i=t.provider,{baseURL:a=i?null:Zr("OPENAI_BASE_URL"),dataResidency:s,[tE]:u=!1,apiKey:c=i?null:Zr("OPENAI_API_KEY")??null,adminAPIKey:l=i?null:Zr("OPENAI_ADMIN_KEY")??null,organization:d=i?null:Zr("OPENAI_ORG_ID")??null,project:p=i?null:Zr("OPENAI_PROJECT_ID")??null,webhookSecret:f=Zr("OPENAI_WEBHOOK_SECRET")??null,workloadIdentity:h,x509Transport:y,credential:_,...$}=t;if(i){let G=["apiKey","adminAPIKey","workloadIdentity","x509Transport","baseURL","dataResidency"].filter(W=>(W==="workloadIdentity"?h:t[W])!=null);if(G.length)throw new k(`The \`provider\` option cannot be used with ${G.map(W=>`\`${W}\``).join(", ")}. Configure authentication and the base URL through the provider instead.`)}let v=Xm(h)?{x509:h,legacy:void 0}:{x509:void 0,legacy:h},x=v.x509,S=x!==void 0,C=i?QT(i):void 0,j={apiKey:c,adminAPIKey:l,organization:d,project:p,webhookSecret:f,workloadIdentity:h,x509Transport:y,provider:i,...$,baseURL:C?.baseURL??n??(a||(S?Y0:"https://api.openai.com/v1"))};if(y&&!S)throw new k("An X.509 transport requires an X.509 workload identity.");if(S){if(n!==void 0||u)throw new k("X.509 workload identity does not support data residency selection.");if(t.fetch!==void 0)throw new k("X.509 workload identity does not support a custom fetch implementation.");if(_u(j.baseURL),gd(j.fetchOptions),this.fetchWithAuth!==an.prototype.fetchWithAuth||this.fetchWithTimeout!==an.prototype.fetchWithTimeout)throw new k("X.509 workload identity does not support overridden fetch dispatch hooks.")}if(c&&h)throw new k("The `apiKey` and `workloadIdentity` options are mutually exclusive");if(!C&&!c&&!l&&!h)throw new k("Missing credentials. Please pass an `apiKey`, `workloadIdentity`, `adminAPIKey`, or set the `OPENAI_API_KEY` or `OPENAI_ADMIN_KEY` environment variable.");if(!j.dangerouslyAllowBrowser&&eE())throw new k(`It looks like you're running in a browser-like environment.
120
+
121
+ This is disabled by default, as it risks exposing your secret API credentials to attackers.
122
+ If you understand the risks and have appropriate mitigations in place,
123
+ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
124
+
125
+ new OpenAI({ apiKey, dangerouslyAllowBrowser: true });
126
+
127
+ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
128
+ `);this.baseURL=j.baseURL,z(this,Hd,n!==void 0||u,"f"),this.timeout=j.timeout??an.DEFAULT_TIMEOUT,this.logger=j.logger??console;let F="warn";this.logLevel=F,this.logLevel=xx(j.logLevel,"ClientOptions.logLevel",this)??xx(Zr("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??F,this.fetchOptions=j.fetchOptions,this.maxRetries=j.maxRetries??2,this.fetch=j.fetch??ad(),z(this,qd,U0,"f");let A=i||r?void 0:Zr("OPENAI_CUSTOM_HEADERS");if(A){let G={};for(let W of A.split(`
129
+ `)){let R=W.indexOf(":");R>=0&&(G[W.substring(0,R).trim()]=W.substring(R+1).trim())}j.defaultHeaders=D([G,j.defaultHeaders])}if(this._options=j,this._provider=C,x){let G=new Ut(x,y,d,p);this._workloadIdentityAuth=G,z(this,Ye,G,"f"),z(this,Eh,r,"f"),z(this,fo,G.fetch(),"f"),this.fetch=m(this,fo,"f"),uP(this)}else v.legacy&&(this._workloadIdentityAuth=new Km(v.legacy,this.fetch));this.apiKey=typeof c=="string"?c:null,this.adminAPIKey=l,this.organization=d,this.project=p,this.webhookSecret=f}withOptions(t){let r=Tx(t),o=m(this,Ye,"f"),n={...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:m(this,Ye,"f")?void 0:this.fetch,fetchOptions:this.fetchOptions,apiKey:this._options.apiKey,adminAPIKey:this.adminAPIKey,workloadIdentity:o?.identitySnapshot()??this._options.workloadIdentity,x509Transport:this._options.x509Transport,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret},{credential:i,provider:a}=wP(n,t,m(this,Eh,"f"),o!==void 0);r!==void 0&&delete n.baseURL;let s={...n,...t,credential:i,provider:a,[tE]:m(this,Hd,"f")&&r===void 0&&!ie(t,"baseURL")&&t.credential===void 0&&!a},u=new this.constructor(s);return a&&new URL(u.baseURL).origin!==new URL(this.baseURL).origin&&(Object.assign(u._options,{defaultHeaders:t.defaultHeaders,defaultQuery:t.defaultQuery,fetchOptions:t.fetchOptions,fetch:t.fetch}),u.fetchOptions=t.fetchOptions,u.fetch=t.fetch??ad(),u.organization=t.organization??null,u.project=t.project??null),m(this,Ye,"f")&&m(u,Ye,"f")&&this.baseURL===u.baseURL&&m(this,Ye,"f").matches(m(u,Ye,"f"))&&(u._workloadIdentityAuth=m(this,Ye,"f"),z(u,Ye,m(this,Ye,"f"),"f"),z(u,fo,m(this,fo,"f"),"f")),u}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:r},o={bearerAuth:!0,adminAPIKeyAuth:!0}){if(!(t.get("authorization")||t.get("api-key"))&&!(r.has("authorization")||r.has("api-key"))&&!(this._workloadIdentityAuth&&o.bearerAuth))throw new Error('Could not resolve authentication method. Expected either apiKey or adminAPIKey to be set. Or for one of the "Authorization" or "api-key" headers to be explicitly omitted')}async authHeaders(t,r={bearerAuth:!0,adminAPIKeyAuth:!0}){return(m(this,Ye,"f")??this._workloadIdentityAuth)instanceof Ut&&r.adminAPIKeyAuth&&this.adminAPIKey!==null?await this.adminAPIKeyAuth(t):D([r.bearerAuth?await this.bearerAuth(t):null,r.adminAPIKeyAuth?await this.adminAPIKeyAuth(t):null])}async bearerAuth(t){let r=m(this,Ye,"f")??this._workloadIdentityAuth;if(r){if(r instanceof Ut){if(r===this._workloadIdentityAuth&&(this.fetchWithAuth!==an.prototype.fetchWithAuth||this.fetchWithTimeout!==an.prototype.fetchWithTimeout))throw new k("X.509 workload identity does not support overridden fetch dispatch hooks.");let n=r.headerSnapshots();if(!Ut.shouldAuthenticate(t,n.defaultHeaders,n.requestHeaders))return}let o=r instanceof Ut?await r.getToken(t,{apiURL:r.requestAPIURL(),...r.headerSnapshots(),...r.requestSnapshot(),signal:r.effectiveSignal(),...r.tenantSnapshot()}):await r.getToken();return D([{Authorization:`Bearer ${o}`}])}if(this.apiKey!=null)return D([{Authorization:`Bearer ${this.apiKey}`}])}async adminAPIKeyAuth(t){if(this.adminAPIKey!=null)return D([{Authorization:`Bearer ${this.adminAPIKey}`}])}stringifyQuery(t){return X0(t)}getUserAgent(){return`${this.constructor.name}/JS ${ti}`}defaultIdempotencyKey(){return`stainless-node-retry-${Wo()}`}makeStatusError(t,r,o,n){let i=r&&typeof r=="object"&&r.error==null?{error:r}:r;return qe.generate(t,i,o,n)}async _callApiKey(){if(this._provider)return!1;let t=this._options.apiKey;if(typeof t!="function")return!1;let r;try{r=await t()}catch(o){throw o instanceof k?o:new k(`Failed to get token from 'apiKey' function: ${o.message}`,{cause:o})}if(typeof r!="string"||!r)throw new k(`Expected 'apiKey' function argument to return a string but it returned ${r}`);return this.apiKey=r,!0}buildURL(t,r,o){let n=!m(this,jk,"m",nE).call(this)&&o||this.baseURL,i=w0(t)?new URL(t):new URL(n+(n.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),a=this.defaultQuery(),s=Object.fromEntries(i.searchParams);return(!_x(a)||!_x(s))&&(r={...s,...a,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(i.search=this.stringifyQuery(r)),i.toString()}async prepareOptions(t){if(this._provider)return;(t.__security??{bearerAuth:!0}).bearerAuth&&await this._callApiKey()}async prepareRequest(t,{url:r,options:o}){}get(t,r){return this.methodRequest("get",t,r)}post(t,r){return this.methodRequest("post",t,r)}patch(t,r){return this.methodRequest("patch",t,r)}put(t,r){return this.methodRequest("put",t,r)}delete(t,r){return this.methodRequest("delete",t,r)}methodRequest(t,r,o){return this.request(Promise.resolve(o).then(n=>({method:t,path:r,...n})))}request(t,r=null){let o=m(this,Ye,"f")??this._workloadIdentityAuth,n=o instanceof Ut?Promise.resolve(t).then(i=>o.runRequest(()=>this.makeRequest(i,r,void 0),this)):this.makeRequest(t,r,void 0);return this.responsePromise(n)}responsePromise(t,r=(o,n)=>this.parseResponseWithTimeout(o,n)){let o=new xa(this,t,(n,i)=>{let a=m(this,Jd,"f").get(i.controller)?.continueRequest;return a?a(()=>r(n,i)):r(n,i)});return o.withResponse=async()=>{let n=await o,{response:i}=await t;return{data:n,response:i,request_id:i.headers.get("x-request-id")}},o._thenUnwrap=n=>this.responsePromise(t,async(i,a)=>pd(n(await r(i,a),a),a.response)),o}async parseResponseWithTimeout(t,r){if(r.options.stream||r.options.__binaryResponse||r.response.status===204||r.response.headers.get("content-length")==="0")return wa(t,r);for(;;){let o=m(this,Jd,"f").get(r.controller),n=o?.timeout??r.options.timeout??this.timeout,i=o?.authentication,a=i?r.controller.signal:r.options.signal,s=()=>i&&a?this._makeUserAbortError(a):new $e,u;try{u=i?.remainingTimeout(r.options,n)??Math.max(0,r.startTime+n-Date.now())}catch(p){let f=a?.aborted?s():void 0;throw r.controller.abort(),Qn(r.response.body).catch(()=>{}),f??p}let c,l,d=!1;try{if(a?.aborted&&o?.helperMethod!=="runTools")throw s();let p=new Promise((f,h)=>{c=setTimeout(()=>{d=!0,r.controller.abort(),h(new ot)},u),a&&(l=()=>{d||h(s())},a.addEventListener("abort",l,{once:!0}))});return await Promise.race([wa(t,r),p])}catch(p){if(a?.aborted&&!d)throw s();if(!d)throw i&&p instanceof SyntaxError?new SyntaxError("X.509 workload identity API response contains invalid JSON."):i&&!(p instanceof k)?new Rr({message:"X.509 workload identity API response body could not be read."}):p;let f=o?.retriesRemaining??0;if(!f||o?.hasStreamingBody||r.options.__metadata?.hasStreamingBody||globalThis.ReadableStream&&r.options.body instanceof globalThis.ReadableStream||typeof r.options.body=="object"&&r.options.body!==null&&(Symbol.asyncIterator in r.options.body||Symbol.iterator in r.options.body&&"next"in r.options.body&&typeof r.options.body.next=="function"))throw new ot;c!==void 0&&clearTimeout(c),l&&a?.removeEventListener("abort",l),l=void 0;let h=await this.retryRequest(r.options,f,r.retryOfRequestLogID??r.requestLogID);Object.assign(r,h)}finally{c!==void 0&&clearTimeout(c),l&&a?.removeEventListener("abort",l)}}}async readX509ResponseError(t,r,o,n,i){let a=new AbortController,s=n.signal,u=!1,c=()=>a.abort(s.reason);s.addEventListener("abort",c,{once:!0}),s.aborted&&c();try{let l=i.remainingTimeout(r,o),d=i.waitForRetry(l,a.signal).then(()=>{throw new ot}),p=await Promise.race([t.text().catch(()=>"X.509 workload identity API response body could not be read."),d]);if(s.aborted)throw this._makeUserAbortError(s);return p}catch(l){throw l instanceof ot&&(u=!s.aborted,n.abort(),Qn(t.body).catch(()=>{})),s.aborted&&!u?this._makeUserAbortError(s):l}finally{s.removeEventListener("abort",c),a.abort()}}async makeRequest(t,r,o){let n=await t,i=n.maxRetries??this.maxRetries;r==null&&(r=i);let a=m(this,Ye,"f");a?.beginRequestPreparation(),await this.prepareOptions(n),a?.beginRequestPlanning();let s;try{let G=await this.buildRequest(n,{retryCount:i-r});if(s={req:G.req,url:G.url,timeout:G.timeout},a){vx("timeout",s.timeout),a.authorizePlannedRequest(s.url,s.req,s.timeout),Ut.isStreamingRequestBody(s.req.body)&&(n.__metadata={...n.__metadata,hasStreamingBody:!0}),await this.prepareRequest(s.req,{url:s.url,options:n}),await this._provider?.prepareRequest?.(s.req,{url:s.url,options:n}),a.beginRequestPlanning(),a.authorizePlannedRequest(s.url,s.req,s.timeout,!0),Ut.isStreamingRequestBody(s.req.body)&&(n.__metadata={...n.__metadata,hasStreamingBody:!0});let W=a.requestSnapshot().signal;if(W?.aborted||s.req.signal?.aborted)throw this._makeUserAbortError(W?.aborted?W:s.req.signal);a.setEffectiveSignal(s.req.signal||W?rE(s.req.signal??W,W).signal:void 0),a.beginRequestNetwork();let R=n.__security??{bearerAuth:!0},Y=await this.authHeaders(n,R),ne=a.headerSnapshots(),pe=D([ne.defaultHeaders,ne.requestHeaders]);for(let[it,Q]of Y?.values??[])!pe.nulls.has(it)&&!s.req.headers.has(it)&&s.req.headers.set(it,Q);this.validateHeaders(D([pe,s.req.headers]),R)}}catch(G){if(a?.retireRequestBody(),a&&r&&!n.__metadata?.hasStreamingBody&&Ut.isRetryableFailure(G))return await this.retryRequest(n,r,o??"x509-token-exchange",Ut.retryHeaders(G));throw G}let{req:u,url:c}=s,l=a?Math.min(s.timeout,a.requestSnapshot().timeout):s.timeout;a?.bindRequest(n,u,this.adminAPIKey);let d=n.__metadata?.hasStreamingBody===!0;a||(await this.prepareRequest(u,{url:c,options:n}),await this._provider?.prepareRequest?.(u,{url:c,options:n})),a?.adoptRequestHeaders(u),a&&Ut.isStreamingRequestBody(u.body)&&(d=!0);let p="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),f=o===void 0?"":`, retryOf: ${o}`,h=a?.requestStartedAt(n)??Date.now();lt(this).debug(`[${p}] sending request`,eo({retryOfRequestLogID:o,method:n.method,url:c,options:a?{body:u.body,...a.requestSnapshot()}:n,headers:u.headers}));let y=a?a.requestSnapshot().signal:n.signal;if(y?.aborted||u.signal?.aborted)throw this._makeUserAbortError(y?.aborted?y:u.signal);let _=n.__security??{bearerAuth:!0},$=a||this.fetchWithTimeout===an.prototype.fetchWithTimeout?rE(u.signal??(a?y:void 0),a?y:void 0):new AbortController,v=a?.remainingTimeout(n,l)??l,x=a?an.prototype.fetchWithAuth:this.fetchWithAuth;a?.releaseRequestBody(u.body);let S=await x.call(this,c,u,v,$,_).catch(id),C=Date.now();if(S instanceof globalThis.Error){let G=`retrying, ${r} attempts remaining`;if(y?.aborted||u.signal?.aborted)throw this._makeUserAbortError(y?.aborted?y:u.signal);let W=Yn(S)||/timed? ?out/i.test(String(S)+("cause"in S?String(S.cause):""));if(r&&!d&&(!a||qm(S)))return lt(this).info(`[${p}] connection ${W?"timed out":"failed"} - ${G}`),lt(this).debug(`[${p}] connection ${W?"timed out":"failed"} (${G})`,eo({retryOfRequestLogID:o,url:c,durationMs:C-h,message:a?"X.509 workload identity API connection failed.":S.message})),this.retryRequest(n,r,o??p);let R=d?"error; streaming body cannot be retried":"error; no more retries left";if(lt(this).info(`[${p}] connection ${W?"timed out":"failed"} - ${R}`),lt(this).debug(`[${p}] connection ${W?"timed out":"failed"} (${R})`,eo({retryOfRequestLogID:o,url:c,durationMs:C-h,message:a?"X.509 workload identity API connection failed.":S.message})),S instanceof Cr||S instanceof _a)throw S;if(W){let Y="cause"in S?S.cause:void 0,pe=typeof Y=="object"&&Y!==null&&"code"in Y&&Y.code==="UND_ERR_HEADERS_TIMEOUT"?new ot({message:"Request timed out. Node.js fetch timed out waiting for response headers; configure a matching undici fetch and fetchOptions.dispatcher with an Agent whose headersTimeout is at least the SDK timeout."}):new ot;throw a?new ot:Object.assign(pe,{cause:S})}throw a?new Rr({message:"X.509 workload identity API connection failed."}):new Rr({message:gL(S),cause:S})}let j=[...S.headers.entries()].filter(([G])=>G==="x-request-id").map(([G,W])=>", "+G+": "+JSON.stringify(W)).join(""),F=`[${p}${f}${j}] ${u.method} ${Fm(c)} ${S.ok?"succeeded":"failed"} with status ${S.status} in ${C-h}ms`;if(!S.ok){let G=S.status===401&&a&&_.bearerAuth&&a.usedWorkloadToken(n);if(G&&a.invalidateToken(),S.status===401&&(a||this._workloadIdentityAuth)&&_.bearerAuth&&(!a||a.usedWorkloadToken(n))&&(!a||r>0)&&!d&&!n.__metadata?.workloadIdentityTokenRefreshed){a?Qn(S.body).catch(()=>{}):(await Qn(S.body),this._workloadIdentityAuth?.invalidateToken());let Q={...n,__metadata:{...n.__metadata,workloadIdentityTokenRefreshed:!0}};return this.makeRequest(Q,a?r-1:r,o??p)}let W=G&&n.__metadata?.workloadIdentityTokenRefreshed?!1:await this.shouldRetry(S);if(r&&W&&!d){let Q=`retrying, ${r} attempts remaining`;return a?Qn(S.body).catch(()=>{}):await Qn(S.body),lt(this).info(`${F} - ${Q}`),lt(this).debug(`[${p}] response error (${Q})`,eo({retryOfRequestLogID:o,url:S.url,status:S.status,headers:S.headers,durationMs:C-h})),this.retryRequest(n,r,o??p,S.headers)}let R=W?d?"error; streaming body cannot be retried":"error; no more retries left":"error; not retryable";lt(this).info(`${F} - ${R}`);let Y=a?await this.readX509ResponseError(S,n,l,$,a):await S.text().catch(Q=>id(Q).message),ne=x0(Y),pe=ne?void 0:Y;throw lt(this).debug(`[${p}] response error (${R})`,eo({retryOfRequestLogID:o,url:S.url,status:S.status,headers:S.headers,message:pe,durationMs:Date.now()-h})),this.makeStatusError(S.status,ne,pe,S.headers)}lt(this).info(F),lt(this).debug(`[${p}] response start`,eo({retryOfRequestLogID:o,url:S.url,status:S.status,headers:S.headers,durationMs:C-h}));let A=a?.continuation();return a?.releaseRequestCredentials(),m(this,Jd,"f").set($,{timeout:l,retriesRemaining:r,hasStreamingBody:d,...a?{authentication:a}:{},helperMethod:n.__metadata?.helperMethod,...A?{continueRequest:A}:{}}),{response:S,options:n,controller:$,requestLogID:p,retryOfRequestLogID:o,startTime:h}}getAPIList(t,r,o){return this.requestAPIList(r,o&&"then"in o?o.then(n=>({method:"get",path:t,...n})):{method:"get",path:t,...o})}requestAPIList(t,r){let o=m(this,Ye,"f")??this._workloadIdentityAuth,n=o instanceof Ut?Promise.resolve(r).then(s=>o.runRequest(()=>this.makeRequest(s,null,void 0),this)):this.makeRequest(r,null,void 0),i=new hd(this,n,t),a=this.responsePromise(n,async(s,u)=>{let c=await this.parseResponseWithTimeout(s,u);return new t(s,u.response,c,u.options)});return i.then=a.then.bind(a),i.catch=a.catch.bind(a),i.finally=a.finally.bind(a),i.withResponse=a.withResponse.bind(a),i._thenUnwrap=a._thenUnwrap.bind(a),i}async fetchWithAuth(t,r,o,n,i={bearerAuth:!0,adminAPIKeyAuth:!0}){if(this._workloadIdentityAuth&&!m(this,fo,"f")&&i.bearerAuth){let u=r.headers,c=u.get("Authorization");if(!c||c===`Bearer ${hL}`){let l=await this._workloadIdentityAuth.getToken();u.set("Authorization",`Bearer ${l}`)}}return await(m(this,fo,"f")?an.prototype.fetchWithTimeout:this.fetchWithTimeout).call(this,t,r,o,n)}async fetchWithTimeout(t,r,o,n){let{signal:i,method:a,...s}=r||{},u=this._makeAbort(n),c=!!i&&oE.get(n)===i;i&&!c&&i.addEventListener("abort",u,{once:!0});let l=setTimeout(u,o),d=globalThis.ReadableStream&&s.body instanceof globalThis.ReadableStream||typeof s.body=="object"&&s.body!==null&&Symbol.asyncIterator in s.body,p={signal:n.signal,...d?{duplex:"half"}:{},method:"GET",...s};a&&(p.method=a.toUpperCase());try{return await(m(this,fo,"f")??this.fetch).call(void 0,t,p)}catch(f){throw i&&!c&&i.removeEventListener("abort",u),f}finally{clearTimeout(l)}}async shouldRetry(t){let r=t.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,r,o,n){let i,a=n?.get("retry-after-ms");if(a){let c=parseFloat(a);Number.isNaN(c)||(i=c)}let s=n?.get("retry-after");if(s&&i===void 0){let c=parseFloat(s);Number.isNaN(c)?i=Date.parse(s)-Date.now():i=c*1e3}if(i===void 0||!Number.isFinite(i)||i<0||i>60*1e3){let c=t.maxRetries??this.maxRetries;i=this.calculateDefaultRetryTimeoutMillis(r,c)}let u=m(this,Ye,"f");if(u){let c=u.remainingTimeout(t,u.requestSnapshot().timeout);if(i>=c)throw new ot}return u?await u.waitForRetry(i,u.effectiveSignal()):await gu(i),this.makeRequest(t,r-1,o)}calculateDefaultRetryTimeoutMillis(t,r){let i=r-t,a=Math.min(.5*Math.pow(2,i),8),s=1-Math.random()*.25;return a*s*1e3}async buildRequest(t,{retryCount:r=0}={}){if(m(this,Ye,"f")&&!m(this,Ye,"f").inRequest(this)){let S=m(this,Ye,"f");return await S.runRequest(async()=>{let C=await an.prototype.buildRequest.call(this,t,{retryCount:r});return S.releaseRequestBody(C.req.body),C},this)}let o={...t},n=m(this,Ye,"f"),i=n?.snapshotTenant(this.organization,this.project),a=n?.snapshotHeaders(this._options.defaultHeaders,o.headers);a&&(o.headers=a.requestHeaders);let s=n?Dx(this.fetchOptions):void 0,u=n?Dx(o.fetchOptions):void 0,{method:c,path:l,query:d,defaultBaseURL:p}=o,f=this.buildURL(l,d,p);n?.snapshotAPIURL(f);let h="timeout"in o;if(h&&vx("timeout",o.timeout),o.timeout=o.timeout??this.timeout,n&&u&&n.snapshotRequest(o.signal,o.timeout,u),n){let S=n.requestSnapshot();o.timeout=S.timeout,S.signal===void 0?delete o.signal:o.signal=S.signal}let{bodyHeaders:y,body:_,isStreamingBody:$}=this.buildBody({options:o});$&&(t.__metadata={...t.__metadata,hasStreamingBody:!0},n?.ownRequestBody(_,o.body));let v=await this.buildHeaders({options:t,method:c,bodyHeaders:y,retryCount:r,x509Headers:a,x509Timeout:h?o.timeout:void 0,x509Tenant:i});return{req:{method:c,headers:v,...o.signal&&{signal:o.signal},...globalThis.ReadableStream&&_ instanceof globalThis.ReadableStream&&{duplex:"half"},..._&&{body:_},...(n?s:this.fetchOptions)??{},...(n?u:o.fetchOptions)??{}},url:f,timeout:o.timeout}}async buildHeaders({options:t,method:r,bodyHeaders:o,retryCount:n,x509Headers:i,x509Timeout:a,x509Tenant:s}){let u={};this.idempotencyHeader&&r!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),u[this.idempotencyHeader]=t.idempotencyKey);let c=t.__metadata?.helperMethod,l=i?a:t.timeout,d=D([u,{Accept:"application/json",...eE()?void 0:{"User-Agent":this.getUserAgent()},"X-Stainless-Retry-Count":String(n),...l?{"X-Stainless-Timeout":String(Math.trunc(l/1e3))}:{},...D0(),...typeof c=="string"?{"X-Stainless-Helper-Method":c}:{},"OpenAI-Organization":s?s.organization:this.organization,"OpenAI-Project":s?s.project:this.project},this._provider||m(this,Ye,"f")?.isPlanningRequest()?void 0:await this.authHeaders(t,t.__security??{bearerAuth:!0}),i?.defaultHeaders??this._options.defaultHeaders,o,i?.requestHeaders??t.headers]);return!this._provider&&!m(this,Ye,"f")?.isPlanningRequest()&&this.validateHeaders(d,t.__security??{bearerAuth:!0}),d.values}_makeAbort(t){return()=>t.abort()}_makeUserAbortError(t){let r=new $e;return Object.defineProperty(r,"cause",{value:t.reason,writable:!0,configurable:!0}),r}buildBody({options:t}){let{body:r,headers:o}=t;if(!r)return r===void 0&&"body"in t?{...m(this,qd,"f").call(this,{body:r,headers:D([o])}),isStreamingBody:!1}:{bodyHeaders:void 0,body:void 0,isStreamingBody:!1};let n=D([o]),i=typeof globalThis.ReadableStream<"u"&&r instanceof globalThis.ReadableStream,a=!i&&(typeof r=="string"||r instanceof ArrayBuffer||ArrayBuffer.isView(r)||typeof globalThis.Blob<"u"&&r instanceof globalThis.Blob||r instanceof URLSearchParams||r instanceof FormData);return ArrayBuffer.isView(r)||r instanceof ArrayBuffer||r instanceof DataView||typeof r=="string"&&n.values.has("content-type")||globalThis.Blob&&r instanceof globalThis.Blob||r instanceof FormData||r instanceof URLSearchParams||i?{bodyHeaders:void 0,body:r,isStreamingBody:!a}:typeof r=="object"&&(Symbol.asyncIterator in r||Symbol.iterator in r&&"next"in r&&typeof r.next=="function")?{bodyHeaders:void 0,body:sd(r),isStreamingBody:!0}:typeof r=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(r),isStreamingBody:!1}:{...m(this,qd,"f").call(this,{body:r,headers:n}),isStreamingBody:!1}}};an=ae,qd=new WeakMap,Ye=new WeakMap,Eh=new WeakMap,fo=new WeakMap,Hd=new WeakMap,Jd=new WeakMap,jk=new WeakSet,nE=function(){return m(this,Hd,"f")||this._provider!==void 0||this.baseURL!=="https://api.openai.com/v1"};ae.OpenAI=an;ae.DEFAULT_TIMEOUT=6e5;ae.OpenAIError=k;ae.APIError=qe;ae.APIConnectionError=Rr;ae.APIConnectionTimeoutError=ot;ae.APIUserAbortError=$e;ae.NotFoundError=Jo;ae.ConflictError=Ho;ae.RateLimitError=Go;ae.BadRequestError=Ko;ae.AuthenticationError=Vo;ae.InternalServerError=Yo;ae.PermissionDeniedError=qo;ae.UnprocessableEntityError=Xo;ae.InvalidWebhookSignatureError=ar;ae.toFile=bd;ae.toStreamingFile=Ym;ae.Completions=Fa;ae.Chat=si;ae.Embeddings=Ka;ae.Files=qa;ae.Images=Ga;ae.ContentProvenanceChecks=Wa;ae.Audio=Nn;ae.Moderations=Qa;ae.Models=Ya;ae.FineTuning=on;ae.Graders=xi;ae.VectorStores=po;ae.Safety=$i;ae.Webhooks=ns;ae.Beta=Br;ae.Batches=Ma;ae.Uploads=Si;ae.Admin=ci;ae.Responses=jn;ae.Realtime=co;ae.Conversations=bi;ae.Evals=wi;ae.Containers=vi;ae.Skills=lo;ae.Videos=rs;var oE=new WeakMap;function rE(e,t){let r=new AbortController;if(!e)return r;let o=globalThis.AbortSignal;if(typeof o?.any!="function"||!(e instanceof o))return r;try{let n=[r.signal,e];t&&t!==e&&n.push(t);let i=o.any(n);Object.defineProperty(r,"signal",{value:i,configurable:!0}),oE.set(r,e)}catch{}return r}function gL(e){if(yL(e))return"Connection error. This may be caused by passing an undici dispatcher, such as ProxyAgent, that is incompatible with the fetch implementation. If you are using undici's ProxyAgent, pass the fetch implementation from the same undici package: import { fetch, ProxyAgent } from 'undici'; new OpenAI({ fetch, fetchOptions: { dispatcher: new ProxyAgent(...) } });"}function yL(e){let t=e;for(let r=0;r<8&&t&&typeof t=="object";r++){let o=t;if(o.code==="UND_ERR_INVALID_ARG"&&typeof o.message=="string"&&o.message.includes("invalid onRequestStart method"))return!0;t=o.cause}return!1}var iE=Symbol.for("openai.privateBedrockClient");var vL;vL=iE;function bL(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 Wr(e){if(!e||typeof e!="object")return e;let t;return e.constructor.name===ot.name&&"message"in e&&typeof e.message=="string"?(t=new Error(e.message),t.name="TimeoutError",pr(t,!0)):e.constructor.name===$e.name&&"message"in e&&typeof e.message=="string"?(t=new Error(e.message),t.name="AbortError",pr(t,!1)):bL(e)?t=xA.fromError(e):"status"in e&&e.status===400&&"message"in e&&typeof e.message=="string"&&e.message.includes("tool_calls")?t=pr(od(e,"INVALID_TOOL_RESULTS"),!1):"status"in e&&e.status===401?t=pr(od(e,"MODEL_AUTHENTICATION"),!1):"status"in e&&e.status===429?t=pr(od(e,"MODEL_RATE_LIMIT"),!0):"status"in e&&e.status===404?t=pr(od(e,"MODEL_NOT_FOUND"),!1):t=e,t}var Rh=(e,t)=>{let r=[...new Set(t?.map(n=>{if(typeof n=="string")return n;let i=new n({});if(!("getType"in i)||typeof i.getType!="function")throw new Error("Invalid type provided.");return i.getType()}))],o=e.getType();return r.some(n=>n===o)};function lE(e,t){return Array.isArray(e)?aE(e,t):or.from(r=>aE(r,e))}function aE(e,t={}){let{includeNames:r,excludeNames:o,includeTypes:n,excludeTypes:i,includeIds:a,excludeIds:s}=t,u=[];for(let c of e)if(!(o&&c.name&&o.includes(c.name))){{if(i&&Rh(c,i))continue;if(s&&c.id&&s.includes(c.id))continue}n||a||r?(r&&c.name&&r.some(l=>l===c.name)||n&&Rh(c,n)||a&&c.id&&a.some(l=>l===c.id))&&u.push(c):u.push(c)}return u}function dE(e){return Array.isArray(e)?sE(e):or.from(sE)}function sE(e){if(!e.length)return[];let t=[];for(let r of e){let o=r,n=t.pop();if(!n)t.push(o);else if(o.getType()==="tool"||o.getType()!==n.getType())t.push(n,o);else{let i=Mi(n),a=Mi(o),s=i.concat(a);typeof i.content=="string"&&typeof a.content=="string"&&(s.content=`${i.content}
130
+ ${a.content}`),t.push(xL(s))}}return t}function pE(e,t){if(Array.isArray(e)){let r=e;if(!t)throw new Error("Options parameter is required when providing messages.");return uE(r,t)}else{let r=e;return or.from(o=>uE(o,r)).withConfig({runName:"trim_messages"})}}async function uE(e,t){let{maxTokens:r,tokenCounter:o,strategy:n="last",allowPartial:i=!1,endOn:a,startOn:s,includeSystem:u=!1,textSplitter:c}=t;if(s&&n==="first")throw new Error("`startOn` should only be specified if `strategy` is 'last'.");if(u&&n==="first")throw new Error("`includeSystem` should only be specified if `strategy` is 'last'.");let l;"getNumTokens"in o?l=async p=>(await Promise.all(p.map(f=>o.getNumTokens(f.content)))).reduce((f,h)=>f+h,0):l=async p=>o(p);let d=Uk;if(c&&("splitText"in c?d=c.splitText.bind(c):d=async p=>c(p)),n==="first")return fE(e,{maxTokens:r,tokenCounter:l,textSplitter:d,partialStrategy:i?"first":void 0,endOn:a});if(n==="last")return wL(e,{maxTokens:r,tokenCounter:l,textSplitter:d,allowPartial:i,includeSystem:u,startOn:s,endOn:a});throw new Error(`Unrecognized strategy: '${n}'. Must be one of 'first' or 'last'.`)}async function fE(e,t){let{maxTokens:r,tokenCounter:o,textSplitter:n,partialStrategy:i,endOn:a}=t,s=[...e],u=0;for(let c=0;c<s.length;c+=1)if(await o(c>0?s.slice(0,-c):s)<=r){u=s.length-c;break}if(u<s.length&&i){let c=!1;if(Array.isArray(s[u].content)){let l=s[u];if(typeof l.content=="string")throw new Error("Expected content to be an array.");let d=l.content.length,p=i==="last"?[...l.content].reverse():l.content;for(let f=1;f<=d;f+=1){let h=i==="first"?p.slice(0,f):p.slice(-f),y=Object.fromEntries(Object.entries(l).filter(([v])=>v!=="type"&&!v.startsWith("lc_"))),_=Mk(l.getType(),{...y,content:h}),$=[...s.slice(0,u),_];if(await o($)<=r)s=$,u+=1,c=!0;else break}c&&i==="last"&&(l.content=[...p].reverse())}if(!c){let l=s[u],d;if(Array.isArray(l.content)&&l.content.some(p=>typeof p=="string"||p.type==="text")?d=l.content.find(p=>p.type==="text"&&p.text)?.text:typeof l.content=="string"&&(d=l.content),d){let p=await n(d),f=p.length;i==="last"&&p.reverse();for(let h=0;h<f-1;h+=1)if(p.pop(),l.content=p.join(""),await o([...s.slice(0,u),l])<=r){i==="last"&&(l.content=[...p].reverse().join("")),s=[...s.slice(0,u),l],u+=1;break}}}}if(a){let c=Array.isArray(a)?a:[a];for(;u>0&&!Rh(s[u-1],c);)u-=1}return s.slice(0,u)}async function wL(e,t){let{allowPartial:r=!1,includeSystem:o=!1,endOn:n,startOn:i,...a}=t,s=e.map(l=>{let d=Object.fromEntries(Object.entries(l).filter(([p])=>p!=="type"&&!p.startsWith("lc_")));return Mk(l.getType(),d,vs(l))});if(n){let l=Array.isArray(n)?n:[n];for(;s.length>0&&!Rh(s[s.length-1],l);)s=s.slice(0,-1)}let u=o&&s[0]?.getType()==="system",c=u?s.slice(0,1).concat(s.slice(1).reverse()):s.reverse();return c=await fE(c,{...a,partialStrategy:r?"last":void 0,endOn:i}),u?[c[0],...c.slice(1).reverse()]:c.reverse()}var cE={human:{message:pn,messageChunk:ji},ai:{message:st,messageChunk:ut},system:{message:Di,messageChunk:fn},developer:{message:Di,messageChunk:fn},tool:{message:Ar,messageChunk:Ri},function:{message:Gc,messageChunk:Ni},generic:{message:Un,messageChunk:zi},remove:{message:Yc,messageChunk:Yc}};function Mk(e,t,r){let o,n;switch(e){case"human":r?o=new ji(t):n=new pn(t);break;case"ai":if(r){let i={...t};"tool_calls"in i&&(i={...i,tool_call_chunks:i.tool_calls?.map(a=>({...a,type:"tool_call_chunk",index:void 0,args:JSON.stringify(a.args)}))}),o=new ut(i)}else n=new st(t);break;case"system":r?o=new fn(t):n=new Di(t);break;case"developer":r?o=new fn({...t,additional_kwargs:{...t.additional_kwargs,__openai_role__:"developer"}}):n=new Di({...t,additional_kwargs:{...t.additional_kwargs,__openai_role__:"developer"}});break;case"tool":if("tool_call_id"in t)r?o=new Ri(t):n=new Ar(t);else throw new Error("Can not convert ToolMessage to ToolMessageChunk if 'tool_call_id' field is not defined.");break;case"function":if(r)o=new Ni(t);else{if(!t.name)throw new Error("FunctionMessage must have a 'name' field");n=new Gc(t)}break;case"generic":if("role"in t)r?o=new zi(t):n=new Un(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(r&&o)return o;if(n)return n;throw new Error(`Unrecognized message type ${e}`)}function xL(e){let t=e.getType(),r,o=Object.fromEntries(Object.entries(e).filter(([n])=>!["type","tool_call_chunks"].includes(n)&&!n.startsWith("lc_")));if(t in cE&&(r=Mk(t,o)),!r)throw new Error(`Unrecognized message chunk class ${t}. Supported classes are ${Object.keys(cE)}`);return r}function Uk(e){let t=e.split(`
131
+ `);return Promise.resolve([...t.slice(0,-1).map(r=>`${r}
132
+ `),t[t.length-1]])}var mE=["tool_call","tool_call_chunk","invalid_tool_call","server_tool_call","server_tool_call_chunk","server_tool_call_result"];var hE=["image","video","audio","text-plain","file"];var gE=["text","reasoning",...mE,...hE];var xie=oe({AIMessage:()=>st,AIMessageChunk:()=>ut,BaseMessage:()=>OA,BaseMessageChunk:()=>zA,ChatMessage:()=>Un,ChatMessageChunk:()=>zi,DEFAULT_MERGE_IGNORE_KEYS:()=>TA,FunctionMessage:()=>Gc,FunctionMessageChunk:()=>Ni,HumanMessage:()=>pn,HumanMessageChunk:()=>ji,KNOWN_BLOCK_TYPES:()=>gE,RemoveMessage:()=>Yc,SystemMessage:()=>Di,SystemMessageChunk:()=>fn,ToolMessage:()=>Ar,ToolMessageChunk:()=>Ri,_isMessageFieldWithRole:()=>NA,_mergeDicts:()=>EA,_mergeLists:()=>RA,_mergeObj:()=>CA,_mergeStatus:()=>SA,coerceMessageLikeToMessage:()=>xo,collapseToolCallChunks:()=>YA,convertToChunk:()=>Mi,convertToOpenAIImageBlock:()=>fp,convertToProviderContentBlock:()=>_s,defaultTextSplitter:()=>Uk,defaultToolCallParser:()=>jA,filterMessages:()=>lE,getBufferString:()=>gp,iife:()=>hp,isAIMessage:()=>wo,isAIMessageChunk:()=>Xc,isBase64ContentBlock:()=>pp,isBaseMessage:()=>Vr,isBaseMessageChunk:()=>vs,isChatMessage:()=>FA,isChatMessageChunk:()=>BA,isDataContentBlock:()=>ys,isDirectToolOutput:()=>mp,isFunctionMessage:()=>WA,isFunctionMessageChunk:()=>KA,isHumanMessage:()=>VA,isHumanMessageChunk:()=>qA,isIDContentBlock:()=>AA,isMessage:()=>IA,isOpenAIToolCallArray:()=>PA,isPlainTextContentBlock:()=>kA,isSystemMessage:()=>JA,isSystemMessageChunk:()=>HA,isToolMessage:()=>DA,isToolMessageChunk:()=>MA,isURLContentBlock:()=>dp,mapChatMessagesToStoredMessages:()=>GA,mapStoredMessageToChatMessage:()=>yp,mapStoredMessagesToChatMessages:()=>XA,mergeContent:()=>$A,mergeMessageRuns:()=>dE,mergeResponseMetadata:()=>LA,mergeUsageMetadata:()=>ZA,parseBase64DataUrl:()=>Jc,parseMimeType:()=>qc,trimMessages:()=>pE});var sn=e=>e();function mo(e){return e?!!(/^o\d/.test(e??"")||e.startsWith("gpt-5")&&!e.startsWith("gpt-5-chat")):!1}function kL(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 Ch(e){return e.metadata?.filename??e.metadata?.name??e.metadata?.title}var AL="LC_AUTOGENERATED";function os(e){let t=e.metadata?.filename??e.metadata?.name??e.metadata?.title;return t||(console.warn("OpenAI may require a filename for file uploads. Specify a filename in the content block metadata, e.g.: { type: 'file', mimeType: '...', data: '...', metadata: { filename: 'my-file.pdf' } }. Using placeholder filename 'LC_AUTOGENERATED'."),AL)}function ho(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(!Un.isInstance(e))throw new Error("Invalid generic chat message");return kL(e);default:throw new Error(`Unknown message type: ${t}`)}}function yE(e){return!!(e.includes("gpt-5.2-pro")||e.includes("gpt-5.4-pro")||e.includes("gpt-5.5-pro")||e.includes("codex"))}function go(e){let{azureOpenAIApiDeploymentName:t,azureOpenAIApiInstanceName:r,azureOpenAIApiKey:o,azureOpenAIBasePath:n,baseURL:i,azureADTokenProvider:a,azureOpenAIEndpoint:s}=e;if((o||a)&&n&&t)return`${n}/${t}`;if((o||a)&&s&&t)return`${s}/openai/deployments/${t}`;if(o||a){if(!r)throw new Error("azureOpenAIApiInstanceName is required when using azureOpenAIApiKey");if(!t)throw new Error("azureOpenAIApiDeploymentName is a required parameter when using azureOpenAIApiKey");return`https://${r}.openai.azure.com/openai/deployments/${t}`}return i}function Lk(e){return typeof Headers<"u"&&e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Headers]"}function _E(e){let t=sn(()=>{if(Lk(e))return e;if(Array.isArray(e))return new Headers(e);if(typeof e=="object"&&e!==null&&"values"in e&&Lk(e.values))return e.values;if(typeof e=="object"&&e!==null){let r=Object.entries(e).filter(([,o])=>typeof o=="string").map(([o,n])=>[o,n]);return new Headers(r)}return new Headers});return Object.fromEntries(t.entries())}function vE(){let e=vA();return(e==="node"||e==="deno")&&(e=`(${e}/${process.version}; ${process.platform}; ${process.arch})`),e}function yo(e,t=!1,r="1.0.0"){let o=_E(e),n=vE(),i=`langchainjs${t?"-azure":""}-openai`;return{...o,"User-Agent":o["User-Agent"]?`${i}/${r} (${n})${o["User-Agent"]}`:`${i}/${r} (${n})`}}var Tie=oe({chunkArray:()=>zh}),zh=(e,t)=>e.reduce((r,o,n)=>{let i=Math.floor(n/t);return r[i]=(r[i]||[]).concat([o]),r},[]);var zie=oe({Embeddings:()=>Zk}),Zk=class{caller;constructor(e){this.caller=new Jn(e??{})}};var bE=class extends Zk{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 r=t?.apiKey??t?.openAIApiKey??yt("OPENAI_API_KEY");this.organization=t?.configuration?.organization??yt("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:r,organization:this.organization,dangerouslyAllowBrowser:!0,...e?.configuration}}async embedDocuments(e){let t=zh(this.stripNewLines?e.map(i=>i.replace(/\n/g," ")):e,this.batchSize),r=t.map(i=>{let a={model:this.model,input:i};return this.dimensions&&(a.dimensions=this.dimensions),this.encodingFormat&&(a.encoding_format=this.encodingFormat),this.embeddingWithRetry(a)}),o=await Promise.all(r),n=[];for(let i=0;i<o.length;i+=1){let a=t[i],{data:s}=o[i];for(let u=0;u<a.length;u+=1)n.push(s[u].embedding)}return n}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:r}=await this.embeddingWithRetry(t);return r[0].embedding}async embeddingWithRetry(e){if(!this.client){let r={baseURL:this.clientConfig.baseURL},o=go(r),n={...this.clientConfig,baseURL:o,timeout:this.timeout,maxRetries:0};n.baseURL||delete n.baseURL,n.defaultHeaders=yo(n.defaultHeaders),this.client=new ae(n)}let t={};return this.caller.call(async()=>{try{return await this.client.embeddings.create(e,t)}catch(r){throw Wr(r)}})}};var Jie=oe({convertToOpenAIFunction:()=>wE,convertToOpenAITool:()=>Fk,isLangChainTool:()=>Gn,isRunnableToolLike:()=>Ll,isStructuredTool:()=>Ul,isStructuredToolParams:()=>Zl});function wE(e,t){let r=typeof t=="number"?void 0:t;return{name:e.name,description:e.description,parameters:Nt(e.schema),...r?.strict!==void 0?{strict:r.strict}:{}}}function Fk(e,t){let r=typeof t=="number"?void 0:t,o;return Gn(e)?o={type:"function",function:wE(e)}:o=e,r?.strict!==void 0&&(o.function.strict=r.strict),o}var Yie=oe({extendInteropZodObject:()=>U$,getInteropZodDefaultGetter:()=>Z$,getInteropZodObjectShape:()=>kf,getSchemaDescription:()=>No,interopParse:()=>j$,interopParseAsync:()=>zo,interopSafeParse:()=>N$,interopSafeParseAsync:()=>If,interopZodObjectMakeFieldsOptional:()=>F$,interopZodObjectPartial:()=>L$,interopZodObjectPassthrough:()=>Af,interopZodObjectStrict:()=>qs,interopZodTransformInputSchema:()=>$f,isInteropZodError:()=>Sf,isInteropZodLiteral:()=>z$,isInteropZodObject:()=>M$,isInteropZodSchema:()=>_t,isShapelessZodSchema:()=>D$,isSimpleStringZodSchema:()=>Js,isZodArrayV4:()=>kl,isZodLiteralV3:()=>Yv,isZodLiteralV4:()=>Qv,isZodNullableV4:()=>tb,isZodObjectV3:()=>xl,isZodObjectV4:()=>$r,isZodOptionalV4:()=>eb,isZodSchema:()=>C$,isZodSchemaV3:()=>rt,isZodSchemaV4:()=>Ze});function xE(e,t){let r;return Gn(e)?r=Fk(e):r=e,t?.strict!==void 0&&(r.function.strict=t.strict),r}function IL(e){return e.anyOf!==void 0&&Array.isArray(e.anyOf)}function kE(e){let t=["namespace functions {",""];for(let r of e)r.description&&t.push(`// ${r.description}`),Object.keys(r.parameters.properties??{}).length>0?(t.push(`type ${r.name} = (_: {`),t.push(AE(r.parameters,0)),t.push("}) => any;")):t.push(`type ${r.name} = () => any;`),t.push("");return t.push("} // namespace functions"),t.join(`
133
+ `)}function AE(e,t){let r=[];for(let[o,n]of Object.entries(e.properties??{}))n.description&&t<2&&r.push(`// ${n.description}`),e.required?.includes(o)?r.push(`${o}: ${Nh(n,t)},`):r.push(`${o}?: ${Nh(n,t)},`);return r.map(o=>" ".repeat(t)+o).join(`
134
+ `)}function Nh(e,t){if(IL(e))return e.anyOf.map(r=>Nh(r,t)).join(" | ");switch(e.type){case"string":return e.enum?e.enum.map(r=>`"${r}"`).join(" | "):"string";case"number":return e.enum?e.enum.map(r=>`${r}`).join(" | "):"number";case"integer":return e.enum?e.enum.map(r=>`${r}`).join(" | "):"number";case"boolean":return"boolean";case"null":return"null";case"object":return["{",AE(e,t+2),"}"].join(`
135
+ `);case"array":return e.items?`${Nh(e.items,t)}[]`:"any[]";default:return""}}function jh(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 zc(e){return"type"in e&&e.type!=="function"}function IE(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 $E(e){return e!=null&&typeof e=="object"&&"type"in e&&e.type!=="function"}function is(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 Dh(e){return"type"in e&&e.type==="custom"&&"custom"in e&&typeof e.custom=="object"&&e.custom!==null}function SE(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 OE(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 PE(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="tool_call"&&"isComputerTool"in e&&e.isComputerTool===!0}function TE(e,t){return typeof e!="object"||e===null||!("type"in e)||e.type!=="tool_call"?!1:!!("isCustomTool"in e&&e.isCustomTool===!0||t&&"id"in e&&typeof e.id=="string"&&e.id in t)}function EE(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 RE(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()}}}function CE(){return{}}function Bk(e,t,r,o){o?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function Re(e,t,r,o,n){e[t]=r,Bk(e,t,o,n)}function zE(e,t){let r={type:"array"};return(e.type?._def?.typeName!==E.ZodAny||t.openaiStrictMode)&&(r.items=le(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&Re(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&Re(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(Re(r,"minItems",e.exactLength.value,e.exactLength.message,t),Re(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}function NE(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let o of e.checks)switch(o.kind){case"min":{t.target==="jsonSchema7"?o.inclusive?Re(r,"minimum",o.value,o.message,t):Re(r,"exclusiveMinimum",o.value,o.message,t):(o.inclusive||(r.exclusiveMinimum=!0),Re(r,"minimum",o.value,o.message,t));break}case"max":{t.target==="jsonSchema7"?o.inclusive?Re(r,"maximum",o.value,o.message,t):Re(r,"exclusiveMaximum",o.value,o.message,t):(o.inclusive||(r.exclusiveMaximum=!0),Re(r,"maximum",o.value,o.message,t));break}case"multipleOf":{Re(r,"multipleOf",o.value,o.message,t);break}}return r}function jE(){return{type:"boolean"}}function DE(e,t,r){return le(e.type._def,t,r)}var ME=(e,t,r)=>le(e.innerType._def,t,r);function Wk(e,t,r){let o=r??t.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((n,i)=>Wk(e,t,n))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return $L(e,t)}}var $L=(e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let o of e.checks)switch(o.kind){case"min":{Re(r,"minimum",o.value,o.message,t);break}case"max":{Re(r,"maximum",o.value,o.message,t);break}}return r};function UE(e,t,r){return{...le(e.innerType._def,t,r),default:e.defaultValue()}}function LE(e,t,r){return t.effectStrategy==="input"?le(e.schema._def,t,r):{}}function ZE(e){return{type:"string",enum:[...e.values]}}var SL=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function FE(e,t){let r=[le(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),le(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),o=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];for(let i of r)if(SL(i))n.push(...i.allOf),i.unevaluatedProperties===void 0&&(o=void 0);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:s,...u}=i;a=u}else o=void 0;n.push(a)}return n.length?{allOf:n,...o}:void 0}function Mh(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function BE(e,t){if(e.value===null)return t.target==="openApi3"?Mh(t):{type:"null",const:null};let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}var Kk,as={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:()=>{if(Kk===void 0){let e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Kk=new RegExp(e,"u")}return Kk},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])$/,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})))$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/};function Uh(e,t){let r={type:"string"};function o(n){return t.patternStrategy==="escape"?OL(n):n}if(e.checks)for(let n of e.checks)switch(n.kind){case"min":{Re(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break}case"max":{Re(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break}case"email":{switch(t.emailStrategy){case"format:email":{un(r,"email",n.message,t);break}case"format:idn-email":{un(r,"idn-email",n.message,t);break}case"pattern:zod":{cn(r,as.email,n.message,t);break}}break}case"url":{un(r,"uri",n.message,t);break}case"uuid":{un(r,"uuid",n.message,t);break}case"regex":{cn(r,n.regex,n.message,t);break}case"cuid":{cn(r,as.cuid,n.message,t);break}case"cuid2":{cn(r,as.cuid2,n.message,t);break}case"startsWith":{cn(r,new RegExp(`^${o(n.value)}`),n.message,t);break}case"endsWith":{cn(r,new RegExp(`${o(n.value)}$`),n.message,t);break}case"datetime":{un(r,"date-time",n.message,t);break}case"date":{un(r,"date",n.message,t);break}case"time":{un(r,"time",n.message,t);break}case"duration":{un(r,"duration",n.message,t);break}case"length":{Re(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),Re(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break}case"includes":{cn(r,new RegExp(o(n.value)),n.message,t);break}case"ip":{n.version!=="v6"&&un(r,"ipv4",n.message,t),n.version!=="v4"&&un(r,"ipv6",n.message,t);break}case"emoji":{cn(r,as.emoji,n.message,t);break}case"ulid":{cn(r,as.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{un(r,"binary",n.message,t);break}case"contentEncoding:base64":{Re(r,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{cn(r,as.base64,n.message,t);break}}break}case"nanoid":{cn(r,as.nanoid,n.message,t);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}var OL=e=>[...e].map(t=>/[a-zA-Z0-9]/.test(t)?t:`\\${t}`).join(""),un=(e,t,r,o)=>{e.format||e.anyOf?.some(n=>n.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&o.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,...r&&o.errorMessages&&{errorMessage:{format:r}}})):Re(e,"format",t,r,o)},cn=(e,t,r,o)=>{e.pattern||e.allOf?.some(n=>n.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&o.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:WE(t,o),...r&&o.errorMessages&&{errorMessage:{pattern:r}}})):Re(e,"pattern",WE(t,o),r,o)},WE=(e,t)=>{let r=typeof e=="function"?e():e;if(!t.applyRegexFlags||!r.flags)return r.source;let o={i:r.flags.includes("i"),m:r.flags.includes("m"),s:r.flags.includes("s")},n=o.i?r.source.toLowerCase():r.source,i="",a=!1,s=!1,u=!1;for(let c=0;c<n.length;c++){if(a){i+=n[c],a=!1;continue}if(o.i){if(s){if(/[a-z]/.test(n[c])){u?(i+=n[c],i+=`${n[c-2]}-${n[c]}`.toUpperCase(),u=!1):n[c+1]==="-"&&n[c+2]?.match(/[a-z]/)?(i+=n[c],u=!0):i+=`${n[c]}${n[c].toUpperCase()}`;continue}}else if(/[a-z]/.test(n[c])){i+=`[${n[c]}${n[c].toUpperCase()}]`;continue}}if(o.m){if(n[c]==="^"){i+=`(^|(?<=[\r
136
+ ]))`;continue}else if(n[c]==="$"){i+=`($|(?=[\r
137
+ ]))`;continue}}if(o.s&&n[c]==="."){i+=s?`${n[c]}\r
138
+ `:`[${n[c]}\r
139
+ ]`;continue}i+=n[c],n[c]==="\\"?a=!0:s&&n[c]==="]"?s=!1:!s&&n[c]==="["&&(s=!0)}try{let c=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`),r.source}return i};function Lh(e,t){if(t.target==="openApi3"&&e.keyType?._def.typeName===E.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:Object.fromEntries(e.keyType._def.values.map(o=>[o,le(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",o]})??{}])),additionalProperties:!1};let r={type:"object",additionalProperties:le(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??{}};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===E.ZodString&&e.keyType._def.checks?.length){let o=Object.fromEntries(Object.entries(Uh(e.keyType._def,t)).filter(([n])=>n!=="type"));return{...r,propertyNames:o}}else if(e.keyType?._def.typeName===E.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};return r}function KE(e,t){if(t.mapStrategy==="record")return Lh(e,t);let r=le(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},o=le(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[r,o],minItems:2,maxItems:2}}}function VE(e){let t=e.values,o=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),n=[...new Set(o.map(a=>typeof a))],i=["string","number"];return n.length===1&&(i=n[0]==="string"?"string":"number"),{type:i,enum:o}}function qE(){return{not:{}}}var Xd={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function HE(e,t){if(t.target==="openApi3")return JE(e,t);let r=e.options instanceof Map?[...e.options.values()]:e.options;if(r.every(o=>o._def.typeName in Xd&&(!o._def.checks||!o._def.checks.length))){let o=[];for(let n of r){let i=Xd[n._def.typeName];i&&!o.includes(i)&&o.push(i)}return{type:o.length>1?o:o[0]}}else if(r.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=[];for(let n of r){let i=typeof n._def.value;switch(i){case"string":case"number":case"boolean":{o.push(i);break}case"bigint":{o.push("integer");break}case"object":{n._def.value===null&&o.push("null");break}}}if(o.length===r.length){let n=o.filter((a,s,u)=>u.indexOf(a)===s),i=[];for(let a of r)i.includes(a._def.value)||i.push(a._def.value);return{type:n.length>1?n:n[0],enum:i}}}else if(r.every(o=>o._def.typeName==="ZodEnum")){let o=[];for(let n of r)for(let i of n._def.values)o.includes(i)||o.push(i);return{type:"string",enum:o}}return JE(e,t)}var JE=(e,t)=>{let r=(e.options instanceof Map?[...e.options.values()]:e.options).map((o,n)=>le(o._def,{...t,currentPath:[...t.currentPath,"anyOf",`${n}`]})).filter(o=>!!o&&(!t.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return r.length?{anyOf:r}:void 0};function XE(e,t,r){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:Xd[e.innerType._def.typeName],nullable:!0}:{type:[Xd[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let n=le(e.innerType._def,{...t,currentPath:[...t.currentPath]},r);return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let o=le(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return o&&{anyOf:[o,{type:"null"}]}}function GE(e,t){let r={type:"number"};if(!e.checks)return r;for(let o of e.checks)switch(o.kind){case"int":{r.type="integer",Bk(r,"type",o.message,t);break}case"min":{t.target==="jsonSchema7"?o.inclusive?Re(r,"minimum",o.value,o.message,t):Re(r,"exclusiveMinimum",o.value,o.message,t):(o.inclusive||(r.exclusiveMinimum=!0),Re(r,"minimum",o.value,o.message,t));break}case"max":{t.target==="jsonSchema7"?o.inclusive?Re(r,"maximum",o.value,o.message,t):Re(r,"exclusiveMaximum",o.value,o.message,t):(o.inclusive||(r.exclusiveMaximum=!0),Re(r,"maximum",o.value,o.message,t));break}case"multipleOf":{Re(r,"multipleOf",o.value,o.message,t);break}}return r}function PL(e,t){return t.removeAdditionalStrategy==="strict"?e.catchall._def.typeName==="ZodNever"?e.unknownKeys!=="strict":le(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0:e.catchall._def.typeName==="ZodNever"?e.unknownKeys==="passthrough":le(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??!0}function YE(e,t){let r={},o=[];for(let[i,a]of Object.entries(e.shape())){if(a===void 0||a._def===void 0)continue;let s=[...t.currentPath,"properties",i];if(i==="__proto__")throw new Error(`Zod field at \`${s.join("/")}\` uses unsupported property name \`__proto__\`, which Zod omits from parsed output.`);let u=le(a._def,{...t,currentPath:s,propertyPath:s});if(u!==void 0){if(t.openaiStrictMode&&a.isOptional()&&!a.isNullable()&&a._def?.defaultValue===void 0)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`);r[i]=u,(!a.isOptional()||t.openaiStrictMode)&&o.push(i)}}let n={type:"object",properties:r,required:o,additionalProperties:PL(e,t)};return n.required.length||delete n.required,n}var QE=(e,t,r)=>{if(t.propertyPath&&t.currentPath.slice(0,t.propertyPath.length).toString()===t.propertyPath.toString())return le(e.innerType._def,{...t,currentPath:t.currentPath},r);let o=le(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]},r);return o?{anyOf:[{not:{}},o]}:{}};var eR=(e,t,r)=>{if(t.pipeStrategy==="input")return le(e.in._def,t,r);if(t.pipeStrategy==="output")return le(e.out._def,t,r);let o=le(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=le(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",o?"1":"0"]});return{allOf:[o,n].filter(i=>i!==void 0)}};function tR(e,t,r){return le(e.type._def,t,r)}function rR(e,t){let o={type:"array",uniqueItems:!0,items:le(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&Re(o,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&Re(o,"maxItems",e.maxSize.value,e.maxSize.message,t),o}function nR(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,o)=>le(r._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).filter(r=>r!==void 0),additionalItems:le(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,o)=>le(r._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).filter(r=>r!==void 0)}}function oR(){return{not:{}}}function iR(){return{}}var aR=(e,t,r)=>le(e.innerType._def,t,r);var uR=Symbol("Let zodToJsonSchema decide on which parser to use"),sR={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"},cR=e=>{let t=typeof e=="string"?{...sR,basePath:["#"],definitions:{},name:e}:{...sR,basePath:["#"],definitions:{},...e};return typeof e!="string"&&e?.definitions&&t.$refStrategy==="extract-to-root"&&t.nameStrategy==="duplicate-ref"&&(t.definitions={...e.definitions}),t};var ss=e=>"_def"in e?e._def:e;function lR(e){if(!e)return!0;for(let t in e)return!1;return!0}function le(e,t,r=!1){let o=t.seen.get(e);if(t.override){let i=t.override?.(e,t,o,r);if(i!==uR)return i}if(o&&!r){let i=TL(o,t);if(i!==void 0)return"$ref"in i&&t.seenRefs.add(i.$ref),i}let n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);try{let i=CL(e,e.typeName,t,r);return i&&zL(e,t,i),n.jsonSchema=i,i}finally{r&&o&&t.seen.set(e,o)}}var TL=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"extract-to-root":{let r=e.path.slice(t.basePath.length+1).map((i,a)=>a===0?i:EL(i)).join("_"),o=r;if(!(o===t.name&&e.path.length===t.basePath.length+2&&e.path[t.basePath.length]===t.definitionPath)&&t.nameStrategy==="duplicate-ref"){let i=s=>{if(!ie(t.definitions,s))return!1;let u=t.definitions[s];return u===void 0||ss(u)!==e.def},a=0;for(;o===t.name||i(o);)a+=1,o=`${r}_${a}`;ie(t.definitions,o)||(t.definitions[o]=e.def)}return{$ref:[...t.basePath,t.definitionPath,o].join("/")}}case"relative":return{$ref:RL(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,o)=>t.currentPath[o]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},dR="_x_",EL=e=>{if(/^[A-Za-z0-9_-]*$/.test(e)&&!e.startsWith(dR))return e;let t=dR;for(let r=0;r<e.length;r++)t+=e.charCodeAt(r).toString(16).padStart(4,"0");return t},RL=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")},CL=(e,t,r,o)=>{switch(t){case E.ZodString:return Uh(e,r);case E.ZodNumber:return GE(e,r);case E.ZodObject:return YE(e,r);case E.ZodBigInt:return NE(e,r);case E.ZodBoolean:return jE();case E.ZodDate:return Wk(e,r);case E.ZodUndefined:return oR();case E.ZodNull:return Mh(r);case E.ZodArray:return zE(e,r);case E.ZodUnion:case E.ZodDiscriminatedUnion:return HE(e,r);case E.ZodIntersection:return FE(e,r);case E.ZodTuple:return nR(e,r);case E.ZodRecord:return Lh(e,r);case E.ZodLiteral:return BE(e,r);case E.ZodEnum:return ZE(e);case E.ZodNativeEnum:return VE(e);case E.ZodNullable:return XE(e,r,o);case E.ZodOptional:return QE(e,r,o);case E.ZodMap:return KE(e,r);case E.ZodSet:return rR(e,r);case E.ZodLazy:return le(e.getter()._def,r,o);case E.ZodPromise:return tR(e,r,o);case E.ZodNaN:case E.ZodNever:return qE();case E.ZodEffects:return LE(e,r,o);case E.ZodAny:return CE();case E.ZodUnknown:return iR();case E.ZodDefault:return UE(e,r,o);case E.ZodBranded:return DE(e,r,o);case E.ZodReadonly:return aR(e,r,o);case E.ZodCatch:return ME(e,r,o);case E.ZodPipeline:return eR(e,r,o);case E.ZodFunction:case E.ZodVoid:case E.ZodSymbol:return;default:return(n=>{})(t)}},zL=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r);var pR=e=>{let t=cR(e),r=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,currentPath:r,propertyPath:void 0,seenRefs:new Set,seen:new Map(Object.entries(t.definitions).map(([o,n])=>[ss(n),{def:ss(n),path:[...t.basePath,t.definitionPath,o],jsonSchema:void 0}]))}};function NL(e,t,r){if(e===null||typeof e!="object")throw new TypeError("Root schema must be a plain JSON-schema record");let o=Object.getPrototypeOf(e);if(![null,Object.prototype].includes(o))throw new TypeError("Root schema must be a plain JSON-schema record");let n={};for(let[u,c]of Object.entries(Object.getOwnPropertyDescriptors(e))){if(!c.enumerable)continue;if(!("value"in c))throw new TypeError(`Root schema property '${u}' must be a data property`);let l=c.value;if(u==="toJSON"&&typeof l=="function")throw new TypeError("Root schema cannot contain a callable 'toJSON' property");["undefined","function","symbol"].includes(typeof l)||Object.defineProperty(n,u,{configurable:!0,enumerable:!0,value:l,writable:!0})}let{type:i,nullable:a,$ref:s}=n;if(!["undefined","boolean"].includes(typeof a))throw new TypeError("Root schema 'nullable' must be a boolean");if(i!=="object"||a===!0){let u;throw typeof i=="string"?u=a===!0?`${i},null`:i:Array.isArray(i)&&(u=i.join(",")),new Error(`Root schema must have type: 'object' but got type: ${u?`'${u}'`:"undefined"}`)}if(s!==void 0)throw new Error("Root schema must be a concrete object and cannot contain '$ref'");if(t!==void 0&&r!=="duplicate-ref")throw new Error("Root schema must have type: 'object' but got type: undefined");return n}var Vk=(e,t)=>{let r=pR(t);r.openaiStrictMode&&(r.definitions={...r.definitions});let o;typeof t=="string"?o=t:t?.nameStrategy!=="title"&&(o=t?.name);let n=le(e._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},r.openaiStrictMode===!0)??{},i=r.openaiStrictMode?NL(n,o,r.nameStrategy):n,a=r.nameStrategy==="title"?r.name:void 0;a!==void 0&&(i.title=a);let s=(()=>{if(lR(r.definitions))return;let c={},l=new Set;for(let d=0;d<500;d++){let p=Object.entries(r.definitions).filter(([f])=>!l.has(f));if(p.length===0)break;for(let[f,h]of p)c[f]=le(ss(h),{...r,currentPath:[...r.basePath,r.definitionPath,f]},!0)??{},l.add(f)}return c})(),u;return o===void 0?u=s?{...i,[r.definitionPath]:s}:i:r.nameStrategy==="duplicate-ref"?u={...i,...s||r.seenRefs.size?{[r.definitionPath]:{...s,...r.seenRefs.size?{[o]:i}:void 0}}:void 0}:u={$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...s,[o]:i}},r.target==="jsonSchema7"?u.$schema="http://json-schema.org/draft-07/schema#":r.target==="jsonSchema2019-09"&&(u.$schema="https://json-schema.org/draft/2019-09/schema#"),u};var ln=new Set(["$comment","default","description","examples","readOnly","title","writeOnly"]),cs=new Set(["$id","$schema"]),Xk=new Set(["additionalProperties","dependencies","maxProperties","minProperties","patternProperties","properties","propertyNames","required"]),hR=["additionalItems","additionalProperties","contains","contentSchema","else","if","not","propertyNames","then","unevaluatedItems","unevaluatedProperties"],gR=["allOf","anyOf","items","oneOf","prefixItems"],yR=["$defs","definitions","dependentSchemas","dependencies","patternProperties","properties"],jL=new Set(["$anchor","$dynamicAnchor","$dynamicRef","$recursiveAnchor","$recursiveRef","allOf","contains","contentEncoding","contentMediaType","contentSchema","dependentRequired","dependentSchemas","dependencies","else","if","maxContains","maxProperties","minContains","minProperties","not","patternProperties","prefixItems","propertyNames","then","unevaluatedItems","unevaluatedProperties","uniqueItems"]),fR=new Set([...ln,"additionalProperties","properties","required","type"]);function Nc(e,...t){for(let r of t)Object.prototype.propertyIsEnumerable.call(r,"__proto__")&&!ie(e,"__proto__")&&Object.defineProperty(e,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0}),Object.assign(e,r);return e}function dr(e,t,r){let o=e;for(let n of hR)n in o&&r(o[n],[...t,n],n);for(let n of gR){let i=o[n];if(Array.isArray(i))for(let[a,s]of i.entries())r(s,[...t,n,String(a)],n);else i!==void 0&&r(i,[...t,n],n)}for(let n of yR){let i=o[n];if(Se(i))for(let[a,s]of Object.entries(i))n==="dependencies"&&!jc(s)||r(s,[...t,n,a],n)}}function _R(e){let t=structuredClone(e);if(vR(t),bR(t),XL(t),DL(t),t.type!=="object")throw new Error(`Root schema must have type: 'object' but got type: ${t.type?`'${t.type}'`:"undefined"}`);if(t.anyOf!==void 0)throw new Error("Root schema must not use `anyOf` because strict Structured Outputs requires a root object without a union.");Fh(t,[],t),kR(t),Fh(t,[],t),YL(t),Wh(t,[],t);let r=Zh(t,[],t);return Fh(r,[],r),r}function vR(e,t=new Set){if(typeof e=="boolean"||!Se(e)||t.has(e))return;t.add(e);let r=e;for(let o of Object.keys(r))r[o]===void 0&&delete r[o];dr(e,[],o=>{vR(o,t)})}function DL(e){let t=new Set;for(;;){if(typeof e.$ref=="string"){if(t.has(e.$ref))throw new Error("Cyclic local $ref at `<root>` is not supported: "+JSON.stringify(e.$ref));t.add(e.$ref)}ML(e),kR(e,!0),UL(e);let r=LL(e);if(e.$ref===void 0&&!r)return}}function ML(e){let t=e.$ref;if(t===void 0)return;if(mR(t),!BL(e))throw new Error("Schema $ref at `<root>` has non-metadata siblings that Draft 7 ignores and cannot be represented in strict Structured Outputs.");let r=new Set,o=Object.fromEntries(Object.entries(e).filter(([l])=>ln.has(l))),n;for(;;){if(r.has(t))throw new Error("Cyclic local $ref at `<root>` is not supported: "+JSON.stringify(t));r.add(t);let l=Oi(e,t);if(l===void 0)throw new Error("Local $ref at `<root>` does not resolve to an object or boolean schema: "+JSON.stringify(t));if(typeof l=="boolean")throw new TypeError("Expected object schema but got boolean; path=<root>");let d=l.$ref;if(d===void 0){n=l;break}if(mR(d),r.has(d))throw new Error("Cyclic local $ref at `<root>` is not supported: "+JSON.stringify(d));if(!Dc(l))throw new Error("Schema $ref in root chain has non-annotation siblings that Draft 7 ignores and cannot be represented in strict Structured Outputs.");for(let p of ln)!(p in o)&&p in l&&(o[p]=l[p]);t=d}let i=e.$defs,a=e.definitions,s=Object.fromEntries(Object.entries(e).filter(([l])=>ln.has(l)||cs.has(l))),u=structuredClone(n);for(let l of["$defs","definitions"])e[l]!==void 0&&u[l]!==void 0&&delete u[l];let c=e;for(let l of Object.keys(e))delete c[l];Nc(e,u,o,s),i!==void 0&&(e.$defs=i),a!==void 0&&(e.definitions=a)}function UL(e){for(;e.allOf!==void 0;){if(Array.isArray(e.allOf))for(let[a,s]of e.allOf.entries())Wh(s,["allOf",String(a)],e);if(Qk(e,[],e))continue;let t=e.allOf;if(!Array.isArray(t)||t.length!==1||!WL(e))return;let r=t[0];if(typeof r=="boolean"||!Se(r))return;let o={...e};delete o.allOf;let n=structuredClone(r),i=e;for(let a of Object.keys(e))delete i[a];Nc(e,n,o)}}function LL(e){let t=e.anyOf;if(!Array.isArray(t)||!KL(e))return!1;let r=t.map((c,l)=>({branch:c,index:l})).filter(({branch:c})=>c!==!1);if(r.length!==1)return!1;let{branch:o,index:n}=r[0];if(typeof o=="boolean"||!Se(o)||!Bh(o,e))return!1;let i=ZL(e,o);FL(e,n,i);let a={...e};delete a.anyOf;let s=structuredClone(o);for(let c of["$defs","definitions"]){let l=e[c],d=s[c];if(!Se(l)||!Se(d))continue;let p=i.get(c),f={...l};for(let[h,y]of Object.entries(d))Object.defineProperty(f,p?.get(h)??h,{value:y,writable:!0,enumerable:!0,configurable:!0});s[c]=f,delete a[c]}let u=e;for(let c of Object.keys(e))delete u[c];return Nc(e,s,a),!0}function ZL(e,t){let r=new Map;for(let o of["$defs","definitions"]){let n=e[o],i=t[o];if(!Se(n)||!Se(i))continue;let a=new Set([...Object.keys(n),...Object.keys(i)]),s=new Map,u=0;for(let[c,l]of Object.entries(i)){if(!ie(n,c)||Yd(n[c],l))continue;let d="__openai_strict_anyOf_definition_"+u++;for(;a.has(d);)d="__openai_strict_anyOf_definition_"+u++;a.add(d),s.set(c,d)}s.size>0&&r.set(o,s)}return r}function FL(e,t,r){let o=i=>{let a=ls(i);if(a===void 0||a[0]!=="anyOf"||a[1]!==String(t))return i;let s=a.slice(2),u=s[0];if(s.length>1&&(u==="$defs"||u==="definitions")){let c=r.get(u)?.get(s[1]);c!==void 0&&(s[1]=c)}return s.length===0?"#":"#/"+s.map(xR).join("/")},n=i=>{typeof i=="boolean"||!Se(i)||(typeof i.$ref=="string"&&(i.$ref=o(i.$ref)),dr(i,[],a=>{n(a)}))};n(e)}function mR(e){if(typeof e!="string")throw new TypeError("Received non-string $ref - "+String(e)+"; path=<root>");if(!e.startsWith("#"))throw new Error("External $ref at `<root>` is not supported in strict Structured Outputs: "+JSON.stringify(e))}function BL(e){return Object.keys(e).every(t=>t==="$ref"||t==="$defs"||t==="definitions"||cs.has(t)||ln.has(t))}function bR(e){typeof e=="boolean"||!Se(e)||(Array.isArray(e.type)&&e.type.length===1&&(e.type=e.type[0]),dr(e,[],t=>{bR(t)}))}function Gd(e,t,r=new Set){if(typeof e=="boolean")return e;let o=e.$ref;if(o!==void 0){if(typeof o!="string"||!Dc(e)||r.has(o))return!1;let n=Oi(t,o);return n===void 0?!1:Gd(n,t,new Set([...r,o]))}return!(e.type!==void 0&&e.type!=="null"&&!(Array.isArray(e.type)&&e.type.includes("null"))||"const"in e&&e.const!==null||e.enum!==void 0&&(!Array.isArray(e.enum)||!e.enum.includes(null))||e.allOf!==void 0&&(!Array.isArray(e.allOf)||!e.allOf.every(n=>Gd(n,t)))||e.anyOf!==void 0&&(!Array.isArray(e.anyOf)||!e.anyOf.some(n=>Gd(n,t)))||e.oneOf!==void 0&&(!Array.isArray(e.oneOf)||e.oneOf.filter(n=>Gd(n,t)).length!==1)||e.not!==void 0||e.if!==void 0||e.then!==void 0||e.else!==void 0)}function Zh(e,t,r){if(typeof e=="boolean")throw new TypeError(`Expected object schema but got boolean; path=${t.join("/")}`);if(!Se(e))throw new TypeError(`Expected ${JSON.stringify(e)} to be an object; path=${t.join("/")}`);if(Qk(e,t,r))return Zh(e,t,r);if(HL(e),qL(e,t,r),Hk(e)){if(!ie(e,"additionalProperties"))e.additionalProperties=!1;else if(e.additionalProperties!==!1)throw new Error(`Object schema at \`${t.join("/")||"<root>"}\` must set \`additionalProperties: false\` to be compatible with strict Structured Outputs.`)}let o=e.required??[];if(!Array.isArray(o)||o.some(d=>typeof d!="string"))throw new TypeError(`Expected \`required\` to be an array of strings; path=${t.join("/")||"<root>"}`);let n=e.properties;if(Hk(e)){for(let d of o)if(!Se(n)||!ie(n,d))throw new Error(`Object schema at \`${t.join("/")||"<root>"}\` requires property \`${d}\` but does not declare it in \`properties\`.`)}if(Se(n)){for(let[d,p]of Object.entries(n))if(!Gd(p,r)&&!o.includes(d))throw new Error(`Schema field at \`${[...t,"properties",d].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(n)}let i=e.items,a=e.additionalItems;if(Array.isArray(i))throw new TypeError(`Schema at \`${t.join("/")||"<root>"}\` uses tuple-form \`items\`, which cannot be represented in strict Structured Outputs.`);if(a!==void 0)throw new Error(`Schema at \`${t.join("/")||"<root>"}\` uses unsupported keyword \`additionalItems\` and cannot be represented in strict Structured Outputs.`);let s=e.allOf;if(Array.isArray(s)&&s.length===1&&Gk(e,"allOf")){let d=s[0];if(d===!1)throw new Error(`Schema at \`${t.join("/")||"<root>"}\` uses \`allOf: [false]\`, which cannot be represented in strict Structured Outputs.`);if(d===!0)delete e.allOf;else{let p=Zh(d,[...t,"allOf","0"],r),f={...e};delete f.allOf,Nc(e,p,f),delete e.allOf}}JL(e,r);let u=e;for(let d of jL){if(u[d]!==void 0)throw new Error(`Schema at \`${t.join("/")||"<root>"}\` uses unsupported keyword \`${d}\` and cannot be represented in strict Structured Outputs.`);delete u[d]}let c=e.type,l=e.items;if((c==="array"||Array.isArray(c)&&c.includes("array"))&&l===void 0)throw new Error(`Schema at \`${t.join("/")||"<root>"}\` declares an array without \`items\`, which cannot be represented in strict Structured Outputs.`);return dr(e,t,(d,p,f)=>{typeof d=="boolean"&&(f==="additionalProperties"||f==="additionalItems")||Zh(d,p,r)}),e.default===null&&delete e.default,e}function ls(e){if(!e.startsWith("#"))return;let t;try{t=decodeURIComponent(e.slice(1))}catch{return}if(t==="")return[];if(!t.startsWith("/"))return;let r=[];for(let o of t.slice(1).split("/")){if(/~(?:[^01]|$)/.test(o))return;r.push(o.replace(/~1/g,"/").replace(/~0/g,"~"))}return r}function us(e,t){if(Array.isArray(e)){if(!/^(?:0|[1-9]\d*)$/.test(t))return;let r=Number(t);return ie(e,r)?e[r]:void 0}if(!(!Se(e)||!ie(e,t)))return e[t]}function Oi(e,t){let r=ls(t);if(r===void 0)return;let o=e;for(let n=0;n<r.length;){if(!Se(o))return;let i=r[n];if(hR.includes(i)){o=us(o,i),n+=1;continue}if(gR.includes(i)){if(o=us(o,i),n+=1,Array.isArray(o)){if(n>=r.length)return;o=us(o,r[n]),n+=1}continue}if(yR.includes(i)){let a=us(o,i);if(n+=1,!Se(a)||n>=r.length||(o=us(a,r[n]),i==="dependencies"&&!jc(o)))return;n+=1;continue}return}return jc(o)?o:void 0}function Se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jc(e){return typeof e=="boolean"||Se(e)}function Bh(e,t,r=new Set){if(typeof e=="boolean"||!Se(e))return!1;if(e.$ref!==void 0){if(typeof e.$ref!="string"||!Dc(e)||r.has(e.$ref))return!1;let o=Oi(t,e.$ref);return o===void 0?!1:Bh(o,t,new Set([...r,e.$ref]))}if(e.allOf!==void 0){if(!Array.isArray(e.allOf)||e.allOf.length!==1||!Gk(e,"allOf"))return!1;let o=e.allOf[0];return o!==void 0&&o!==!0&&o!==!1?Bh(o,t,r):!1}return e.type==="object"||Array.isArray(e.type)&&e.type.length===1&&e.type[0]==="object"}function Jk(e,t,r=new Set){if(typeof e=="boolean"||!Se(e))return!1;if(e.$ref!==void 0){if(typeof e.$ref!="string"||!Dc(e)||r.has(e.$ref))return!1;let o=Oi(t,e.$ref);return o===void 0?!1:Jk(o,t,new Set([...r,e.$ref]))}if(e.allOf!==void 0){if(!Array.isArray(e.allOf)||e.allOf.length!==1||!Gk(e,"allOf"))return!1;let o=e.allOf[0];return o!==void 0&&o!==!0&&o!==!1?Jk(o,t,r):!1}return e.type==="array"||Array.isArray(e.type)&&e.type.length===1&&e.type[0]==="array"}function Dc(e){return Object.keys(e).every(t=>t==="$ref"||t==="$defs"||t==="definitions"||ln.has(t))}function Gk(e,t){let r=e;return Object.keys(e).every(o=>o===t||(o==="$defs"||o==="definitions")&&Se(r[o])||ln.has(o))}function WL(e){return Object.keys(e).every(t=>t==="allOf"||t==="$defs"||t==="definitions"||cs.has(t)||ln.has(t))}function KL(e){return Object.keys(e).every(t=>t==="anyOf"||t==="$defs"||t==="definitions"||t==="type"&&e.type==="object"||cs.has(t)||ln.has(t))}function VL(e){return Object.keys(e).some(t=>Xk.has(t))}function Hk(e){let t=e.type;return t==="object"||Array.isArray(t)&&t.includes("object")||t===void 0&&VL(e)}function wR(e,t){return e===t||Array.isArray(e)&&e.length===2&&e.includes(t)&&e.includes("null")}function qL(e,t,r){if(e.anyOf===void 0)return;let o=Se(e.properties)&&Object.keys(e.properties).length===0,n=Array.isArray(e.required)&&e.required.length===0;if(o&&delete e.properties,n&&delete e.required,!Hk(e))return;let i=Object.keys(e).some(a=>Xk.has(a));if(wR(e.type,"object")&&!i&&Array.isArray(e.anyOf)&&e.anyOf.every(a=>Bh(a,r))){delete e.type;return}throw new Error("Object anyOf schema at `"+(t.join("/")||"<root>")+"` cannot be represented in strict Structured Outputs without changing Draft 7 validation.")}function JL(e,t){wR(e.type,"array")&&e.items===void 0&&Array.isArray(e.anyOf)&&e.anyOf.every(r=>Jk(r,t))&&delete e.type}function HL(e){if(!Array.isArray(e.anyOf))return;let t=e.anyOf.filter(r=>r!==!1);t.length>0&&t.length!==e.anyOf.length&&(e.anyOf=t)}function XL(e){let t=(r,o)=>{if(!(typeof r=="boolean"||!Se(r))){if(o.length>0&&r.$id!==void 0)throw new Error("Nested $id at "+JSON.stringify(o.join("/"))+" establishes a separate JSON Schema resource scope and cannot be represented in strict Structured Outputs.");dr(r,o,(n,i)=>{t(n,i)})}};t(e,[])}function GL(e,t){let r=ls(t);if(r===void 0)return!1;let o=e;for(let[n,i]of r.entries()){if(i==="allOf"&&Se(o)&&Array.isArray(o.allOf)&&n<r.length-1)return!0;if(o=us(o,i),o===void 0)return!1}return!1}function Yk(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function xR(e){return encodeURIComponent(Yk(e)).replace(/%24/g,"$")}function YL(e){let t=o=>{let n=ls(o);if(n===void 0||n.length===0)return o;let i=[...n],a=e,s=!1;for(let[u,c]of n.entries()){let l=typeof a=="object"&&a!==null&&!Array.isArray(a)?a:void 0;if(c==="anyOf"&&u<n.length-1&&l!==void 0&&Array.isArray(l.anyOf)){let d=l.anyOf,p=n[u+1];if(!/^(?:0|[1-9]\d*)$/.test(p))return o;let f=Number(p);if(!ie(d,f))return o;let h=d.filter(y=>y!==!1);if(h.length>0&&h.length!==d.length){if(d[f]===!1)return o;let y=d.slice(0,f).filter(_=>_!==!1).length;y!==f&&(i[u+1]=String(y),s=!0)}}if(a=us(a,c),a===void 0)return o}return s?"#/"+i.map(xR).join("/"):o},r=o=>{typeof o=="boolean"||!Se(o)||(typeof o.$ref=="string"&&(o.$ref=t(o.$ref)),dr(o,[],n=>{r(n)}))};r(e)}function kR(e,t=!1){let r=new Set,o=u=>{if(!(typeof u=="boolean"||!Se(u))){if(typeof u.$ref=="string"&&GL(e,u.$ref)){let c=ls(u.$ref);(!t||c?.[0]==="allOf")&&r.add(u.$ref)}dr(u,[],c=>{o(c)})}};if(o(e),r.size===0)return;if(e.$defs!==void 0&&!Se(e.$defs))throw new Error("Root schema has invalid $defs and cannot preserve local allOf references.");let n=e.$defs??(e.$defs={}),i=new Map,a=0;for(let u of r){let c=Oi(e,u);if(!jc(c)){if(t)continue;throw new Error("Local $ref cannot be preserved before allOf flattening: "+JSON.stringify(u))}let l="__openai_strict_allOf_ref_"+a++;for(;ie(n,l);)l="__openai_strict_allOf_ref_"+a++;n[l]=structuredClone(c),i.set(u,"#/$defs/"+Yk(l))}let s=u=>{typeof u=="boolean"||!Se(u)||(typeof u.$ref=="string"&&(u.$ref=i.get(u.$ref)??u.$ref),dr(u,[],c=>{s(c)}))};s(e)}function QL(e,t){if(t.length===0)return;let r=new Set,o=u=>{if(!(typeof u=="boolean"||!Se(u))){if(typeof u.$ref=="string"){let c=ls(u.$ref);c!==void 0&&t.some(l=>c.length>=l.length&&l.every((d,p)=>c[p]===d))&&r.add(u.$ref)}dr(u,[],c=>{o(c)})}};if(o(e),r.size===0)return;if(e.$defs!==void 0&&!Se(e.$defs))throw new Error("Root schema has invalid $defs and cannot preserve discarded allOf properties.");let n=e.$defs??(e.$defs={}),i=new Map,a=0;for(let u of r){let c=Oi(e,u);if(!jc(c))throw new Error("Local $ref cannot be preserved before allOf property removal: "+JSON.stringify(u));let l="__openai_strict_allOf_property_ref_"+a++;for(;ie(n,l);)l="__openai_strict_allOf_property_ref_"+a++;n[l]=structuredClone(c),i.set(u,"#/$defs/"+Yk(l))}let s=u=>{typeof u=="boolean"||!Se(u)||(typeof u.$ref=="string"&&(u.$ref=i.get(u.$ref)??u.$ref),dr(u,[],c=>{s(c)}))};s(e)}function Fh(e,t,r){if(typeof e=="boolean"||!Se(e))return;let o=e.$ref;if(o!==void 0){if(typeof o!="string")throw new TypeError(`Received non-string $ref - ${o}; path=${t.join("/")}`);if(!o.startsWith("#"))throw new Error(`External $ref at \`${t.join("/")||"<root>"}\` is not supported in strict Structured Outputs: ${JSON.stringify(o)}`);let n=Oi(r,o);if(n===void 0||!jc(n))throw new Error(`Local $ref at \`${t.join("/")||"<root>"}\` does not resolve to an object or boolean schema: ${JSON.stringify(o)}`);if(typeof n=="boolean")throw new TypeError(`Expected object schema but got boolean; path=${t.join("/")}`);if(!Dc(e))throw new Error(`Schema $ref at \`${t.join("/")||"<root>"}\` has non-annotation siblings that Draft 7 ignores and cannot be represented in strict Structured Outputs.`)}dr(e,t,(n,i)=>{Fh(n,i,r)})}function e6(e,t,r){let o=[e],n=new Set,i=e,a=[];for(;;){for(;i.$ref!==void 0;){let s=i.$ref;if(typeof s!="string"||!Dc(i)||n.has(s))return;n.add(s);let u=Oi(t,s);if(typeof u=="boolean"||!Se(u))return;let c=ls(s);if(c===void 0)return;i=u,a=c,o.push(i)}if(i.allOf!==void 0&&!r.has(i)){let s=i.allOf;if(Wh(i,a,t,r),i.$ref!==void 0||i.allOf!==s)continue}return{schema:i,refChain:o}}}function Wh(e,t,r,o=new Set){if(!(typeof e=="boolean"||!Se(e))&&!o.has(e)){o.add(e);try{for(;;)if(dr(e,t,(n,i)=>{Wh(n,i,r,o)}),!Qk(e,t,r,o))return}finally{o.delete(e)}}}function Qk(e,t,r,o=new Set){let n=e.allOf;if(!Array.isArray(n)||n.length===0)return!1;let i=n.filter((R,Y)=>!n.slice(0,Y).some(ne=>Yd(ne,R)));if(i.length!==n.length)return e.allOf=i,!0;let a=n.filter(R=>R!==!0);if(a.length!==n.length)return a.length===0?delete e.allOf:e.allOf=a,!0;let s=qk(e),u=n.map(R=>Se(R)?e6(R,r,o):void 0),c=u.map(R=>R?.schema).filter(R=>R!==void 0&&qk(R));if(!s&&c.length===0||!s&&n.length===1)return!1;let l=()=>{throw new Error(`Object allOf at \`${t.join("/")||"<root>"}\` cannot be merged without changing Draft 7 validation.`)};!s&&["additionalProperties","properties","required","type"].some(R=>R in e)&&l();for(let R of Object.keys(e))R!=="allOf"&&R!=="$defs"&&R!=="definitions"&&!(t.length===0&&cs.has(R))&&!fR.has(R)&&l();let d=[];s&&d.push({schema:e,sourcePath:t});for(let[R,Y]of n.entries()){Se(Y)||l();let ne=u[R];if(ne===void 0)return l();let pe=ne.schema;qk(pe)?d.push({schema:pe,sourcePath:pe===Y?[...t,"allOf",String(R)]:void 0}):t6(pe)||l()}let p={};for(let R of["$defs","definitions"])e[R]!==void 0&&(p[R]=e[R]);if(t.length===0)for(let R of cs)R in e&&(p[R]=e[R]);let f=Object.create(null),h=new Set,y=[],_=[],$=!1,v=!1,x=!1,S=!1,C=R=>{for(let Y of ln)Y in R&&(Y in p||(p[Y]=R[Y]))};C(e);for(let R of u)if(R!==void 0)for(let Y of R.refChain)C(Y);for(let{schema:R,sourcePath:Y}of d){for(let ne of Object.keys(R))ne==="allOf"&&R===e||(ne==="$defs"||ne==="definitions")&&Se(R[ne])||R===e&&t.length===0&&cs.has(ne)||fR.has(ne)||l();if(R.type!==void 0&&(AR(R.type)||l(),R.type==="object"?x=!0:S=!0),R.properties!==void 0){Se(R.properties)||l(),$=!0;for(let[ne,pe]of Object.entries(R.properties))_.push({key:ne,propertySchema:pe,sourcePath:Y===void 0?void 0:[...Y,"properties",ne]})}if(R.required!==void 0){(!Array.isArray(R.required)||R.required.some(ne=>typeof ne!="string"))&&l(),v=!0;for(let ne of R.required)h.add(ne)}"additionalProperties"in R&&(R.additionalProperties!==!1&&l(),y.push(new Set(Object.keys(R.properties??{}))))}let j;if(y.length>0){j=new Set(y[0]);for(let R of y.slice(1))for(let Y of j)R.has(Y)||j.delete(Y)}let F=j,A=F!==void 0&&[...h].some(R=>!F.has(R)),G=A&&!x&&S,W=_.filter(({key:R,sourcePath:Y})=>Y!==void 0&&(G||j!==void 0&&!j.has(R))).map(({sourcePath:R})=>R);if(QL(r,W),e===r&&r.$defs!==void 0&&(p.$defs=r.$defs),A){if(G){p.type="null";for(let R of Object.keys(e))delete e[R];return Nc(e,p),!0}l()}for(let{key:R,propertySchema:Y}of _)j!==void 0&&!j.has(R)||(ie(f,R)&&!Yd(f[R],Y)&&l(),f[R]=Y);(x||S)&&(p.type=x?"object":["object","null"]),$&&(p.properties=Object.fromEntries(Object.entries(f))),v&&(p.required=[...h]),y.length>0&&(p.additionalProperties=!1);for(let R of Object.keys(e))delete e[R];return Nc(e,p),!0}function qk(e){return e.type!==void 0?AR(e.type):Object.keys(e).some(t=>Xk.has(t))}function t6(e){let t=e;return Object.keys(e).every(r=>ln.has(r)||(r==="$defs"||r==="definitions")&&Se(t[r]))}function AR(e){return e==="object"||Array.isArray(e)&&e.length===2&&e.includes("object")&&e.includes("null")}function Yd(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((a,s)=>Yd(a,t[s]));if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let r=e,o=t,n=Object.keys(r),i=Object.keys(o);return n.sort(),i.sort(),n.length!==i.length?!1:n.every((a,s)=>a===i[s]&&Yd(r[a],o[a]))}var r6={ZodString:"string",ZodNumber:"number",ZodBoolean:"boolean",ZodNull:"null",ZodObject:"object",ZodArray:"array"},n6=new Set(["ZodOptional","ZodNullable","ZodDefault","ZodReadonly"]),o6=new Set(["ZodString","ZodNumber","ZodBoolean","ZodNull","ZodEnum","ZodNativeEnum","ZodAny","ZodUnknown","ZodLiteral"]),i6=new Map([["ZodBigInt","encode integers as decimal strings and convert with BigInt after parsing"],["ZodDate","native dates do not have a synchronous JSON representation"],["ZodMap","native maps do not have a synchronous JSON representation"],["ZodSet","native sets do not have a synchronous JSON representation"],["ZodPromise","asynchronous values do not have a synchronous JSON representation"],["ZodEffects","custom transformations and refinements are opaque to JSON Schema"],["ZodPipeline","custom pipelines are opaque to JSON Schema"],["ZodIntersection","intersections cannot prove that both branches produce the same value"],["ZodCatch","catch fallbacks cannot be proven to produce JSON-native values"],["ZodTuple","tuple schemas require unsupported array-valued items"],["ZodRecord","open-ended record schemas require unsupported additionalProperties"]]),a6=new Set(["trim","toLowerCase","toUpperCase"]),s6=new Set(["regex","cuid","cuid2","startsWith","endsWith","includes","emoji","ulid","nanoid"]);function _o(e,t,r){throw new Error(`Zod schema field \`${e}\` uses \`${t}\`, which cannot be represented by strict Structured Outputs: ${r}`)}function Kh(e){if(e===null)return{type:"null",values:new Set([null])};if(typeof e=="string")return{type:"string",values:new Set([e])};if(typeof e=="boolean")return{type:"boolean",values:new Set([e])};if(typeof e=="number"&&Number.isFinite(e))return{type:"number",values:new Set([e])}}function IR(e){let t=e.values;if(!t||Array.isArray(t))return[];let r=t,o=Object.keys(r).filter(n=>{let i=r[n];return(typeof i=="string"||typeof i=="number")&&typeof r[String(i)]!="number"}).map(n=>r[n]).filter(n=>typeof n=="string"||typeof n=="number"&&Number.isFinite(n));return["string","number"].map(n=>({type:n,values:new Set(o.filter(i=>typeof i===n))})).filter(n=>n.values.size>0)}function $R(e){let t=Array.isArray(e.values)?e.values.filter(r=>typeof r=="string"):[];return{type:"string",values:new Set(t)}}function u6(e){if(e.typeName==="ZodLiteral"){let t=Kh(e.value);return t?[t]:[]}return e.typeName==="ZodEnum"?[$R(e)]:e.typeName==="ZodNativeEnum"?IR(e):[]}function c6(e){let t=new Map;for(let[r,o]of Object.entries(e.shape())){let n=u6(o._def);n.length>0&&n.every(({values:i})=>i!==void 0&&i.size>0)&&t.set(r,n)}return{type:"object",discriminators:t}}function Mc(e,t=new Set){let r=e._def;if(t.has(r))return[{type:"unknown"}];if(t.add(r),r.typeName==="ZodObject")return[c6(r)];let o=r6[r.typeName];if(o!==void 0)return[{type:o}];if(r.typeName==="ZodLiteral"){let n=Kh(r.value);return n?[n]:[{type:"unknown"}]}return r.typeName==="ZodEnum"?[$R(r)]:r.typeName==="ZodNativeEnum"?IR(r):r.typeName==="ZodUnion"||r.typeName==="ZodDiscriminatedUnion"?[...r.options.values()].flatMap(n=>Mc(n,new Set(t))):r.typeName==="ZodNullable"?[...Mc(r.innerType,new Set(t)),{type:"null"}]:n6.has(r.typeName)?Mc(r.innerType,t):r.typeName==="ZodBranded"?Mc(r.type,t):r.typeName==="ZodLazy"?Mc(r.getter(),t):[{type:"unknown"}]}function SR(e,t){if(e.type==="unknown"||t.type==="unknown")return!0;if(e.type!==t.type)return!1;if(e.discriminators&&t.discriminators)for(let[o,n]of e.discriminators){let i=t.discriminators.get(o);if(i&&!n.some(a=>i.some(s=>SR(a,s))))return!1}let r=t.values;return!e.values||!r?!0:[...e.values].some(o=>r.has(o))}function l6(e,t){let r=e.map(o=>Mc(o));for(let[o,n]of r.entries())for(let i of r.slice(o+1))n.some(a=>i.some(s=>SR(a,s)))&&_o(t,"ZodUnion","ambiguous union branches overlap; use disjoint JSON types, distinct literals, or a discriminated union")}function d6(e,t){switch(e.typeName){case"ZodObject":{let r=Object.entries(e.shape()).map(([o,n])=>({schema:n,path:`${t}.${o}`}));return e.catchall&&e.catchall._def.typeName!=="ZodNever"&&r.push({schema:e.catchall,path:`${t}.<catchall>`}),r}case"ZodArray":return[{schema:e.type,path:`${t}[]`}];case"ZodUnion":case"ZodDiscriminatedUnion":return[...e.options.values()].map((r,o)=>({schema:r,path:`${t}[${o}]`}));case"ZodOptional":case"ZodNullable":case"ZodDefault":case"ZodReadonly":return[{schema:e.innerType,path:t}];case"ZodBranded":return[{schema:e.type,path:t}];case"ZodLazy":return[{schema:e.getter(),path:t}];default:return}}function OR(e){let t=e.checks??[];return t.some(({kind:r})=>r==="finite"||r==="int")?!0:t.some(({kind:r,value:o})=>r==="min"&&typeof o=="number"&&Number.isFinite(o))&&t.some(({kind:r,value:o})=>r==="max"&&typeof o=="number"&&Number.isFinite(o))}function p6(e,t,r){return e.unknownKeys!=="passthrough"&&(e.catchall===void 0||e.catchall._def.typeName==="ZodNever")&&Object.values(e.shape()).every(o=>r(o,new Set(t)))}function ds(e,t=new Set){let r=e._def;if(t.has(r))return!0;switch(t.add(r),r.typeName){case"ZodString":case"ZodBoolean":case"ZodNull":case"ZodEnum":case"ZodNativeEnum":return!0;case"ZodLiteral":return Kh(r.value)!==void 0;case"ZodNumber":return OR(r);case"ZodArray":return ds(r.type,t);case"ZodObject":return p6(r,t,ds);case"ZodUnion":case"ZodDiscriminatedUnion":return[...r.options.values()].every(o=>ds(o,new Set(t)));case"ZodNullable":case"ZodDefault":case"ZodReadonly":return ds(r.innerType,t);case"ZodBranded":return ds(r.type,t);case"ZodLazy":return ds(r.getter(),t);default:return!1}}function f6(e,t){let r=i6.get(e.typeName);r&&_o(t,e.typeName,r),e.typeName==="ZodLiteral"&&!Kh(e.value)&&_o(t,e.typeName,"literal values must be finite JSON primitives"),e.typeName==="ZodNumber"&&e.coerce===!0&&!OR(e)&&_o(t,e.typeName,"number coercion must prove its parsed output is finite"),e.typeName==="ZodDefault"&&!ds(e.innerType)&&_o(t,e.typeName,"default factory output is not independently guaranteed to be finite and JSON-native; it may contain bigint"),e.typeName==="ZodString"&&e.checks?.some(({kind:o})=>a6.has(o))&&_o(t,e.typeName,"value-changing string checks are not represented in JSON Schema"),e.typeName==="ZodString"&&(e.checks?.filter(({kind:o})=>s6.has(o)).length??0)>1&&_o(t,e.typeName,"multiple pattern-producing checks require unsupported allOf")}function eA(e,t,r){let o=e._def;if(r.has(o)||(r.add(o),o.typeName==="ZodIntersection"&&t==="$"))return;f6(o,t);let n=d6(o,t);if(!n){o6.has(o.typeName)||_o(t,o.typeName,"this Zod schema is outside the documented JSON-native subset");return}for(let i of n)eA(i.schema,i.path,r);o.typeName==="ZodObject"&&(o.unknownKeys==="passthrough"||o.catchall!==void 0&&o.catchall._def.typeName!=="ZodNever")&&_o(t,o.typeName,"open object schemas require additionalProperties: false"),o.typeName==="ZodUnion"&&t!=="$"&&l6(n.map(({schema:i})=>i),t)}function PR(e,t){let r=new Set;eA(e,"$",r);for(let[o,n]of Object.entries(t??{}))eA(n,`$.definitions.${o}`,r)}function m6(e,t){for(let r=e;r!==null;r=Object.getPrototypeOf(r)){let o=Object.getOwnPropertyDescriptor(r,"toJSON");if(o){if(!("value"in o)||typeof o.value=="function")throw new Error(`Strict Structured Outputs schema field \`${t}\` contains an unsupported \`toJSON\` serialization hook`);return}}}function h6(e,t){if(Object.is(e,-0))throw new TypeError(`Strict Structured Outputs schema field \`${t}\` contains negative zero, which cannot round-trip through JSON`)}function Qd(e,t="$",r=new Set){if(e===null||typeof e=="string"||typeof e=="boolean")return;if(typeof e=="number"&&Number.isFinite(e)){h6(e,t);return}if(typeof e!="object")throw new TypeError(`Strict Structured Outputs schema field \`${t}\` contains a non-JSON ${typeof e} value`);if(r.has(e))throw new Error(`Strict Structured Outputs schema field \`${t}\` contains a circular JSON value`);let o=Object.getPrototypeOf(e);if(!Array.isArray(e)&&o!==Object.prototype&&o!==null)throw new Error(`Strict Structured Outputs schema field \`${t}\` contains a non-JSON native object`);if(m6(e,t),r.add(e),Array.isArray(e))for(let n=0;n<e.length;n+=1){let i=Object.getOwnPropertyDescriptor(e,String(n));if(!i)throw new Error(`Strict Structured Outputs schema field \`${t}[${n}]\` contains a sparse array`);if(!("value"in i))throw new Error(`Strict Structured Outputs schema field \`${t}[${n}]\` contains an array accessor`);Qd(i.value,`${t}[${n}]`,r)}else for(let n of Object.keys(e)){let i=Object.getOwnPropertyDescriptor(e,n);if(!i||!("value"in i))throw new Error(`Strict Structured Outputs schema field \`${t}.${n}\` contains an accessor`);Qd(i.value,`${t}.${n}`,r)}r.delete(e)}function g6(e){return encodeURIComponent(e.replace(/~/g,"~0").replace(/\//g,"~1"))}function y6(e){if(e&&ie(e,"__proto__"))throw new Error('schemaDefinitions cannot include "__proto__" as a definition name')}function TR(e,t){let r=new Map(Object.keys(t??{}).map(i=>[`#/definitions/${i}`,`#/definitions/${g6(i)}`]));if(r.size===0)return e;let o=new Set,n=i=>{if(!i||typeof i!="object"||Array.isArray(i)||o.has(i))return;o.add(i);let a=i,s=a.$ref;if(typeof s=="string"){let u=r.get(s);u!==void 0&&u!==s&&(a.$ref=u)}dr(a,[],n)};return n(e),e}function _6(e,t){if(!t)return e;let r=e;for(;ie(t,r);)r=`${r}_root`;return r}function v6(e,t){PR(e,t.schemaDefinitions);let r=_6(t.name,t.schemaDefinitions),o=Vk(e,{openaiStrictMode:!0,name:r,nameStrategy:"duplicate-ref",$refStrategy:"extract-to-root",nullableStrategy:"property",...t.schemaDefinitions?{definitions:t.schemaDefinitions}:void 0}),n=TR(o,t.schemaDefinitions);return Qd(n),n}function b6(e,t={}){let r=t.schemaDefinitions?Rs():void 0;for(let[i,a]of Object.entries(t.schemaDefinitions??{}))r?.add(a,{id:i});let o=Fn(e,{target:"draft-7",...r?{metadata:r}:void 0,override:({zodSchema:i,jsonSchema:a})=>{let s=i._zod.def;if(s.type==="union"&&"discriminator"in s&&Array.isArray(a.oneOf)){if(a.anyOf!==void 0)throw new Error("Zod discriminated union generated both `anyOf` and `oneOf`, which cannot be represented in an OpenAI strict schema");a.anyOf=a.oneOf,delete a.oneOf}}}),n=TR(o,t.schemaDefinitions);return _R(n)}function ER(e){return"_zod"in e}function w6(e,t){let r=en({type:"json_schema",$parseRaw:void 0},t),o=e.parse;if(typeof o=="function"){let n=o.call(e,r);return ER(e)||Qd(n),n}return Bl(e,r)}function RR(e,t,r){let o=e,{schemaDefinitions:n,...i}=r??{};return y6(n),RP({type:"json_schema",json_schema:{...i,name:t,strict:!0,schema:ER(o)?b6(o,{schemaDefinitions:n}):v6(o,{name:t,schemaDefinitions:n})}},a=>w6(e,a))}var CR=["jsonSchema","functionCalling","jsonMode"];function zR(e,t){if(typeof t<"u"&&!CR.includes(t))throw new Error(`Invalid method: ${t}. Supported methods are: ${CR.join(", ")}`);let r=!e.startsWith("gpt-3")&&!e.startsWith("gpt-4-")&&e!=="gpt-4";if(r&&!t)return"jsonSchema";if(!r&&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 x6(e,t){let r={...e};return Object.defineProperties(r,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:t,enumerable:!1}}),r}function NR(e,t,r){if(rt(e))return RR(e,t,r);if(Ze(e))return x6({type:"json_schema",json_schema:{...r,name:t,strict:!0,schema:Nt(e,{cycles:"ref",reused:"ref",override(o){o.jsonSchema.title=t}})}},o=>hn(e,JSON.parse(o)));throw new Error("Unsupported schema response format")}function jR(e,t){if(t&&typeof t=="object"&&"images"in t&&Array.isArray(t.images)){let r=t.images.filter(o=>typeof o?.image_url?.url=="string").map(o=>({type:"image",url:o.image_url.url}));return[{type:"text",text:e},...r]}return e}var DR={"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},"gpt-5.5":{maxInputTokens:105e4,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:13e4,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5.5-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}};var ice=oe({DEFAULT_LANGSMITH_GATEWAY:()=>MR,resolveLangSmithGatewayConfig:()=>tA}),k6="LANGSMITH_GATEWAY",A6="LANGSMITH_GATEWAY_API_KEY",I6="LANGSMITH_API_KEY",MR="https://gateway.smith.langchain.com",$6=["true","1","yes"],S6=["false","0","no"];function O6(e){let t=yt(k6);if(!(!t||S6.includes(t.toLowerCase())))return`${$6.includes(t.toLowerCase())?MR:t.replace(/\/+$/,"")}/${e}`}function tA({baseURL:e,providerPath:t}){if(e!==void 0)return{baseURL:e};let r=O6(t);return r===void 0?{}:{baseURL:r,apiKey:yt(A6)||yt(I6)}}var UR=e=>e();function ep(e){let t=e.constructor;return new t({...e,content:e.contentBlocks,response_metadata:{...e.response_metadata,output_version:"v1"}})}var ps=class extends Fe{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 r=Pe(t);return this.func&&await this.func(e,r),this._callWithConfig(o=>Promise.resolve(o),e,r)}async*transform(e,t){let r=Pe(t),o,n=!0;for await(let i of this._transformStreamWithConfig(e,a=>a,r))if(yield i,n)if(o===void 0)o=i;else try{o=yr(o,i)}catch{o=void 0,n=!1}this.func&&o!==void 0&&await this.func(o,r)}static assign(e){return new jl(new Bo({steps:e}))}};var LR=class extends Fe{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:r,input:o}=e,n=this.runnables[r];if(n===void 0)throw new Error(`No runnable associated with key "${r}".`);return n.invoke(o,Pe(t))}async batch(e,t,r){let o=e.map(l=>l.key),n=e.map(l=>l.input);if(o.find(l=>this.runnables[l]===void 0)!==void 0)throw new Error("One or more keys do not have a corresponding runnable.");let i=o.map(l=>this.runnables[l]),a=this._getOptionsList(t??{},e.length),s=a[0]?.maxConcurrency??r?.maxConcurrency,u=s&&s>0?s:e.length,c=[];for(let l=0;l<n.length;l+=u){let d=n.slice(l,l+u).map((f,h)=>i[h].invoke(f,a[h])),p=await Promise.all(d);c.push(p)}return c.flat()}async stream(e,t){let{key:r,input:o}=e,n=this.runnables[r];if(n===void 0)throw new Error(`No runnable associated with key "${r}".`);return n.stream(o,t)}};var ZR=class extends Fe{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(([o,n])=>[vr(o),vr(n)]),r=vr(e[e.length-1]);return new this({branches:t,default:r})}async _invoke(e,t,r){let o;for(let n=0;n<this.branches.length;n+=1){let[i,a]=this.branches[n];if(await i.invoke(e,De(t,{callbacks:r?.getChild(`condition:${n+1}`)}))){o=await a.invoke(e,De(t,{callbacks:r?.getChild(`branch:${n+1}`)}));break}}return o||(o=await this.default.invoke(e,De(t,{callbacks:r?.getChild("branch:default")}))),o}async invoke(e,t={}){return this._callWithConfig(this._invoke,e,t)}async*_streamIterator(e,t){let r=await(await Ct(t))?.handleChainStart(this.toJSON(),dt(e,"input"),t?.runId,void 0,void 0,void 0,t?.runName),o,n=!0,i;try{for(let a=0;a<this.branches.length;a+=1){let[s,u]=this.branches[a];if(await s.invoke(e,De(t,{callbacks:r?.getChild(`condition:${a+1}`)}))){i=await u.stream(e,De(t,{callbacks:r?.getChild(`branch:${a+1}`)}));for await(let c of i)if(yield c,n)if(o===void 0)o=c;else try{o=yr(o,c)}catch{o=void 0,n=!1}break}}if(i===void 0){i=await this.default.stream(e,De(t,{callbacks:r?.getChild("branch:default")}));for await(let a of i)if(yield a,n)if(o===void 0)o=a;else try{o=yr(o,a)}catch{o=void 0,n=!1}}}catch(a){throw await r?.handleChainError(a),a}await r?.handleChainEnd(o??{})}};var FR=class extends Fo{runnable;inputMessagesKey;outputMessagesKey;historyMessagesKey;getMessageHistory;constructor(e){let t=or.from((i,a)=>this._enterHistory(i,a??{})).withConfig({runName:"loadHistory"}),r=e.historyMessagesKey??e.inputMessagesKey;r&&(t=ps.assign({[r]:t}).withConfig({runName:"insertHistory"}));let o=t.pipe(e.runnable.withListeners({onEnd:(i,a)=>this._exitHistory(i,a??{})})).withConfig({runName:"RunnableWithMessageHistory"}),n=e.config??{};super({...e,config:n,bound:o}),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)&&!Vr(e)){let r;this.inputMessagesKey?r=this.inputMessagesKey:Object.keys(e).length===1?r=Object.keys(e)[0]:r="input",Array.isArray(e[r])&&Array.isArray(e[r][0])?t=e[r][0]:t=e[r]}else t=e;if(typeof t=="string")return[new pn(t)];if(Array.isArray(t))return t;if(Vr(t))return[t];throw new Error(`Expected a string, BaseMessage, or array of BaseMessages.
140
+ Got ${JSON.stringify(t,null,2)}`)}_getOutputMessages(e){let t;if(!Array.isArray(e)&&!Vr(e)&&typeof e!="string"){let r;this.outputMessagesKey!==void 0?r=this.outputMessagesKey:Object.keys(e).length===1?r=Object.keys(e)[0]:r="output",e.generations!==void 0?t=e.generations[0][0].message:t=e[r]}else t=e;if(typeof t=="string")return[new st(t)];if(Array.isArray(t))return t;if(Vr(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 r=await(t?.configurable?.messageHistory).getMessages();return this.historyMessagesKey===void 0?r.concat(this._getInputMessages(e)):r}async _exitHistory(e,t){let r=t.configurable?.messageHistory,o;Array.isArray(e.inputs)&&Array.isArray(e.inputs[0])?o=e.inputs[0]:o=e.inputs;let n=this._getInputMessages(o);if(this.historyMessagesKey===void 0){let s=await r.getMessages();n=n.slice(s.length)}let i=e.outputs;if(!i)throw new Error(`Output values from 'Run' undefined. Run: ${JSON.stringify(e,null,2)}`);let a=this._getOutputMessages(i);await r.addMessages([...n,...a])}async _mergeConfig(...e){let t=await super._mergeConfig(...e);if(!t.configurable||!t.configurable.sessionId){let o={[this.inputMessagesKey??"input"]:"foo"};throw new Error(`sessionId is required. Pass it in as part of the config argument to .invoke() or .stream()
141
+ eg. chain.invoke(${JSON.stringify(o)}, ${JSON.stringify({configurable:{sessionId:"123"}})})`)}let{sessionId:r}=t.configurable;return t.configurable.messageHistory=await this.getMessageHistory(r),t}};var Mce=oe({RouterRunnable:()=>LR,Runnable:()=>Fe,RunnableAssign:()=>jl,RunnableBinding:()=>Fo,RunnableBranch:()=>ZR,RunnableEach:()=>FS,RunnableLambda:()=>or,RunnableMap:()=>Bo,RunnableParallel:()=>qS,RunnablePassthrough:()=>ps,RunnablePick:()=>Qb,RunnableRetry:()=>Qf,RunnableSequence:()=>su,RunnableToolLike:()=>Yf,RunnableWithFallbacks:()=>Yb,RunnableWithMessageHistory:()=>FR,_coerceToRunnable:()=>vr,ensureConfig:()=>Pe,getCallbackManagerForConfig:()=>Ct,mergeConfigs:()=>Ui,patchConfig:()=>De,pickRunnableConfigKeys:()=>Ft,raceWithSignal:()=>fr});var rA=class extends Fe{parseResultWithPrompt(e,t,r){return this.parseResult(e,r)}_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(r,o)=>this.parseResult([{text:r}],o?.callbacks),e,{...t,runType:"parser"}):this._callWithConfig(async(r,o)=>this.parseResult([{message:r,text:this._baseMessageToString(r)}],o?.callbacks),e,{...t,runType:"parser"})}},vo=class extends rA{parseResult(e,t){return this.parse(e[0].text,t)}async parseWithPrompt(e,t,r){return this.parse(e,r)}_type(){throw new Error("_type not implemented")}},Lt=class extends Error{llmOutput;observation;sendToLLM;constructor(e,t,r,o=!1){if(super(e),this.llmOutput=t,this.observation=r,this.sendToLLM=o,o&&(r===void 0||t===void 0))throw new Error("Arguments 'observation' & 'llmOutput' are required if 'sendToLlm' is true");bA(this,"OUTPUT_PARSING_FAILURE")}};var bo=class extends vo{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"})}},Pi=class extends bo{diff=!1;constructor(e){super(e),this.diff=e?.diff??this.diff}async*_transform(e){let t,r;for await(let o of e){if(typeof o!="string"&&typeof o.content!="string")throw new Error("Cannot handle non-string output.");let n;if(vs(o)){if(typeof o.content!="string")throw new Error("Cannot handle non-string message output.");n=new Xn({message:o,text:o.content})}else if(Vr(o)){if(typeof o.content!="string")throw new Error("Cannot handle non-string message output.");n=new Xn({message:Mi(o),text:o.content})}else n=new $n({text:o});r===void 0?r=n:r=r.concat(n);let i=await this.parsePartialResult([r]);i!=null&&!kn(i,t)&&(this.diff?yield this._diff(t,i):yield i,t=i)}}getFormatInstructions(){return""}};var ile=oe({applyPatch:()=>Hn,compare:()=>fa});var Uc=class extends Pi{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?fa(e,t):[{op:"replace",path:"",value:t}]}async parsePartialResult(e){return Ci(e[0].text)}async parse(e){return Ci(e,JSON.parse)}getFormatInstructions(){return""}_baseMessageToString(e){return e.text}};var Vh=class extends vo{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=Ci(e,JSON.parse),r=await this.schema["~standard"].validate(t);if(r.issues)throw new Error(`Validation failed: ${JSON.stringify(r.issues)}`);return r.value}catch(t){throw new Lt(`Failed to parse. Text: "${e}". Error: ${t}`,e)}}_baseMessageToString(e){return e.text}getFormatInstructions(){return""}};var tp=class extends vo{schema;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=Vt.object(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,Vt.string().describe(o)])));return new this(t)}getFormatInstructions(){return`You must format your output as a JSON value that adheres to a given "JSON Schema" instance.
142
+
143
+ "JSON Schema" is a declarative language that allows you to annotate and validate JSON documents.
144
+
145
+ For example, the example "JSON Schema" instance {{"properties": {{"foo": {{"description": "a list of test words", "type": "array", "items": {{"type": "string"}}}}}}, "required": ["foo"]}}
146
+ 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.
147
+ 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.
148
+
149
+ 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!
150
+
151
+ Here is the JSON Schema instance your output must adhere to. Include the enclosing markdown codeblock:
152
+ \`\`\`json
153
+ ${JSON.stringify(Nt(this.schema))}
154
+ \`\`\`
155
+ `}async parse(e){try{let t=e.trim(),r=(t.match(/^```(?:json)?\s*([\s\S]*?)```/)?.[1]||t.match(/```json\s*([\s\S]*?)```/)?.[1]||t).replace(/"([^"\\]*(\\.[^"\\]*)*)"/g,(o,n)=>`"${n.replace(/\n/g,"\\n")}"`).replace(/\n/g,"");return await zo(this.schema,JSON.parse(r))}catch(t){throw new Lt(`Failed to parse. Text: "${e}". Error: ${t}`,e)}}_baseMessageToString(e){return e.text}},nA=class extends tp{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:
156
+ \`\`\`json
157
+ ${this._schemaToInstruction(Nt(this.schema)).replaceAll("{","{".repeat(t)).replaceAll("}","}".repeat(t))}
158
+ \`\`\``}_schemaToInstruction(e,t=2){let r=e;if("type"in r){let o=!1,n;if(Array.isArray(r.type)){let s=r.type.findIndex(u=>u==="null");s!==-1&&(o=!0,r.type.splice(s,1)),n=r.type.join(" | ")}else n=r.type;if(r.type==="object"&&r.properties){let s=r.description?` // ${r.description}`:"";return`{
159
+ ${Object.entries(r.properties).map(([u,c])=>{let l=r.required?.includes(u)?"":" (optional)";return`${" ".repeat(t)}"${u}": ${this._schemaToInstruction(c,t+2)}${l}`}).join(`
160
+ `)}
161
+ ${" ".repeat(t-2)}}${s}`}if(r.type==="array"&&r.items){let s=r.description?` // ${r.description}`:"";return`array[
162
+ ${" ".repeat(t)}${this._schemaToInstruction(r.items,t+2)}
163
+ ${" ".repeat(t-2)}] ${s}`}let i=o?" (nullable)":"",a=r.description?` // ${r.description}`:"";return`${n}${a}${i}`}if("anyOf"in r)return r.anyOf.map(o=>this._schemaToInstruction(o,t)).join(`
164
+ ${" ".repeat(t-2)}`);throw new Error("unsupported schema type")}static fromZodSchema(e){return new this(e)}static fromNamesAndDescriptions(e){let t=Vt.object(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,Vt.string().describe(o)])));return new this(t)}},BR=class extends vo{structuredInputParser;constructor({inputSchema:e}){super(...arguments),this.structuredInputParser=new nA(e)}async parse(e){let t;try{t=await this.structuredInputParser.parse(e)}catch(r){throw new Lt(`Failed to parse. Text: "${e}". Error: ${r}`,e)}return this.outputProcessor(t)}getFormatInstructions(){return this.structuredInputParser.getFormatInstructions()}};var WR=class extends bo{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""}};var Lc=class extends bo{re;async*_transform(e){let t="";for await(let r of e)if(typeof r=="string"?t+=r:t+=r.content,this.re){let o=[...t.matchAll(this.re)];if(o.length>1){let n=0;for(let i of o.slice(0,-1))yield[i[1]],n+=(i.index??0)+i[0].length;t=t.slice(n)}}else{let o=await this.parse(t);if(o.length>1){for(let n of o.slice(0,-1))yield[n];t=o[o.length-1]}}for(let r of await this.parse(t))yield[r]}},KR=class extends Lc{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 Lt(`Could not parse output: ${e}`,e)}}getFormatInstructions(){return"Your response should be a list of comma separated values, eg: `foo, bar, baz`"}},VR=class extends Lc{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(r=>r.trim());if(this.length!==void 0&&t.length!==this.length)throw new Lt(`Incorrect number of items. Expected ${this.length}, got ${t.length}.`);return t}catch(t){throw Object.getPrototypeOf(t)===Lt.prototype?t:new Lt(`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\`)`}},qR=class extends Lc{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:
165
+
166
+ 1. foo
167
+
168
+ 2. bar
169
+
170
+ 3. baz`}re=/\d+\.\s([^\n]+)/g;async parse(e){return[...e.matchAll(this.re)??[]].map(t=>t[1])}},JR=class extends Lc{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:
171
+
172
+ 1. foo
173
+
174
+ 2. bar
175
+
176
+ 3. baz`}re=/^\s*[-*]\s([^\n]+)$/gm;async parse(e){return[...e.matchAll(this.re)??[]].map(t=>t[1])}};var HR=class extends bo{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,r)=>t+this._messageContentToString(r),"")}};var P6=function(){let e={};e.parser=function(b,g){return new r(b,g)},e.SAXParser=r,e.SAXStream=c,e.createStream=u,e.MAX_BUFFER_LENGTH=65536;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 r(b,g){if(!(this instanceof r))return new r(b,g);var N=this;n(N),N.q=N.c="",N.bufferCheckPosition=e.MAX_BUFFER_LENGTH,N.opt=g||{},N.opt.lowercase=N.opt.lowercase||N.opt.lowercasetags,N.looseCase=N.opt.lowercase?"toLowerCase":"toUpperCase",N.tags=[],N.closed=N.closedRoot=N.sawRoot=!1,N.tag=N.error=null,N.strict=!!b,N.noscript=!!(b||N.opt.noscript),N.state=A.BEGIN,N.strictEntities=N.opt.strictEntities,N.ENTITIES=N.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),N.attribList=[],N.opt.xmlns&&(N.ns=Object.create(h)),N.trackPosition=N.opt.position!==!1,N.trackPosition&&(N.position=N.line=N.column=0),W(N,"onready")}Object.create||(Object.create=function(b){function g(){}return g.prototype=b,new g}),Object.keys||(Object.keys=function(b){var g=[];for(var N in b)b.hasOwnProperty(N)&&g.push(N);return g});function o(b){for(var g=Math.max(e.MAX_BUFFER_LENGTH,10),N=0,O=0,he=t.length;O<he;O++){var ke=b[t[O]].length;if(ke>g)switch(t[O]){case"textNode":Y(b);break;case"cdata":R(b,"oncdata",b.cdata),b.cdata="";break;case"script":R(b,"onscript",b.script),b.script="";break;default:pe(b,"Max buffer length exceeded: "+t[O])}N=Math.max(N,ke)}b.bufferCheckPosition=e.MAX_BUFFER_LENGTH-N+b.position}function n(b){for(var g=0,N=t.length;g<N;g++)b[t[g]]=""}function i(b){Y(b),b.cdata!==""&&(R(b,"oncdata",b.cdata),b.cdata=""),b.script!==""&&(R(b,"onscript",b.script),b.script="")}r.prototype={end:function(){it(this)},write:Ne,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){i(this)}};var a=ReadableStream;a||(a=function(){});var s=e.EVENTS.filter(function(b){return b!=="error"&&b!=="end"});function u(b,g){return new c(b,g)}function c(b,g){if(!(this instanceof c))return new c(b,g);a.apply(this),this._parser=new r(b,g),this.writable=!0,this.readable=!0;var N=this;this._parser.onend=function(){N.emit("end")},this._parser.onerror=function(O){N.emit("error",O),N._parser.error=null},this._decoder=null,s.forEach(function(O){Object.defineProperty(N,"on"+O,{get:function(){return N._parser["on"+O]},set:function(he){if(!he)return N.removeAllListeners(O),N._parser["on"+O]=he,he;N.on(O,he)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(a.prototype,{constructor:{value:c}}),c.prototype.write=function(b){return this._parser.write(b.toString()),this.emit("data",b),!0},c.prototype.end=function(b){return b&&b.length&&this.write(b),this._parser.end(),!0},c.prototype.on=function(b,g){var N=this;return!N._parser["on"+b]&&s.indexOf(b)!==-1&&(N._parser["on"+b]=function(){var O=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);O.splice(0,0,b),N.emit.apply(N,O)}),a.prototype.on.call(N,b,g)};var l="[CDATA[",d="DOCTYPE",p="http://www.w3.org/XML/1998/namespace",f="http://www.w3.org/2000/xmlns/",h={xml:p,xmlns:f},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]/,_=/[:_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-]/,$=/[#:_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-]/;function x(b){return b===" "||b===`
177
+ `||b==="\r"||b===" "}function S(b){return b==='"'||b==="'"}function C(b){return b===">"||x(b)}function j(b,g){return b.test(g)}function F(b,g){return!j(b,g)}var A=0;e.STATE={BEGIN:A++,BEGIN_WHITESPACE:A++,TEXT:A++,TEXT_ENTITY:A++,OPEN_WAKA:A++,SGML_DECL:A++,SGML_DECL_QUOTED:A++,DOCTYPE:A++,DOCTYPE_QUOTED:A++,DOCTYPE_DTD:A++,DOCTYPE_DTD_QUOTED:A++,COMMENT_STARTING:A++,COMMENT:A++,COMMENT_ENDING:A++,COMMENT_ENDED:A++,CDATA:A++,CDATA_ENDING:A++,CDATA_ENDING_2:A++,PROC_INST:A++,PROC_INST_BODY:A++,PROC_INST_ENDING:A++,OPEN_TAG:A++,OPEN_TAG_SLASH:A++,ATTRIB:A++,ATTRIB_NAME:A++,ATTRIB_NAME_SAW_WHITE:A++,ATTRIB_VALUE:A++,ATTRIB_VALUE_QUOTED:A++,ATTRIB_VALUE_CLOSED:A++,ATTRIB_VALUE_UNQUOTED:A++,ATTRIB_VALUE_ENTITY_Q:A++,ATTRIB_VALUE_ENTITY_U:A++,CLOSE_TAG:A++,CLOSE_TAG_SAW_WHITE:A++,SCRIPT:A++,SCRIPT_ENDING:A++},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(b){var g=e.ENTITIES[b],N=typeof g=="number"?String.fromCharCode(g):g;e.ENTITIES[b]=N});for(var G in e.STATE)e.STATE[e.STATE[G]]=G;A=e.STATE;function W(b,g,N){b[g]&&b[g](N)}function R(b,g,N){b.textNode&&Y(b),W(b,g,N)}function Y(b){b.textNode=ne(b.opt,b.textNode),b.textNode&&W(b,"ontext",b.textNode),b.textNode=""}function ne(b,g){return b.trim&&(g=g.trim()),b.normalize&&(g=g.replace(/\s+/g," ")),g}function pe(b,g){return Y(b),b.trackPosition&&(g+=`
178
+ Line: `+b.line+`
179
+ Column: `+b.column+`
180
+ Char: `+b.c),g=new Error(g),b.error=g,W(b,"onerror",g),b}function it(b){return b.sawRoot&&!b.closedRoot&&Q(b,"Unclosed root tag"),b.state!==A.BEGIN&&b.state!==A.BEGIN_WHITESPACE&&b.state!==A.TEXT&&pe(b,"Unexpected end"),Y(b),b.c="",b.closed=!0,W(b,"onend"),r.call(b,b.strict,b.opt),b}function Q(b,g){if(typeof b!="object"||!(b instanceof r))throw new Error("bad call to strictFail");b.strict&&pe(b,g)}function Tt(b){b.strict||(b.tagName=b.tagName[b.looseCase]());var g=b.tags[b.tags.length-1]||b,N=b.tag={name:b.tagName,attributes:{}};b.opt.xmlns&&(N.ns=g.ns),b.attribList.length=0,R(b,"onopentagstart",N)}function Ue(b,g){var N=b.indexOf(":")<0?["",b]:b.split(":"),O=N[0],he=N[1];return g&&b==="xmlns"&&(O="xmlns",he=""),{prefix:O,local:he}}function xr(b){if(b.strict||(b.attribName=b.attribName[b.looseCase]()),b.attribList.indexOf(b.attribName)!==-1||b.tag.attributes.hasOwnProperty(b.attribName)){b.attribName=b.attribValue="";return}if(b.opt.xmlns){var g=Ue(b.attribName,!0),N=g.prefix,O=g.local;if(N==="xmlns")if(O==="xml"&&b.attribValue!==p)Q(b,"xml: prefix must be bound to "+p+`
181
+ Actual: `+b.attribValue);else if(O==="xmlns"&&b.attribValue!==f)Q(b,"xmlns: prefix must be bound to "+f+`
182
+ Actual: `+b.attribValue);else{var he=b.tag,ke=b.tags[b.tags.length-1]||b;he.ns===ke.ns&&(he.ns=Object.create(ke.ns)),he.ns[O]=b.attribValue}b.attribList.push([b.attribName,b.attribValue])}else b.tag.attributes[b.attribName]=b.attribValue,R(b,"onattribute",{name:b.attribName,value:b.attribValue});b.attribName=b.attribValue=""}function bt(b,g){if(b.opt.xmlns){var N=b.tag,O=Ue(b.tagName);N.prefix=O.prefix,N.local=O.local,N.uri=N.ns[O.prefix]||"",N.prefix&&!N.uri&&(Q(b,"Unbound namespace prefix: "+JSON.stringify(b.tagName)),N.uri=O.prefix);var he=b.tags[b.tags.length-1]||b;N.ns&&he.ns!==N.ns&&Object.keys(N.ns).forEach(function(Ei){R(b,"onopennamespace",{prefix:Ei,uri:N.ns[Ei]})});for(var ke=0,Qe=b.attribList.length;ke<Qe;ke++){var ze=b.attribList[ke],Rt=ze[0],kr=ze[1],at=Ue(Rt,!0),dn=at.prefix,gs=at.local,cp=dn===""?"":N.ns[dn]||"",H={name:Rt,value:kr,prefix:dn,local:gs,uri:cp};dn&&dn!=="xmlns"&&!cp&&(Q(b,"Unbound namespace prefix: "+JSON.stringify(dn)),H.uri=dn),b.tag.attributes[Rt]=H,R(b,"onattribute",H)}b.attribList.length=0}b.tag.isSelfClosing=!!g,b.sawRoot=!0,b.tags.push(b.tag),R(b,"onopentag",b.tag),g||(!b.noscript&&b.tagName.toLowerCase()==="script"?b.state=A.SCRIPT:b.state=A.TEXT,b.tag=null,b.tagName=""),b.attribName=b.attribValue="",b.attribList.length=0}function Et(b){if(!b.tagName){Q(b,"Weird empty close tag."),b.textNode+="</>",b.state=A.TEXT;return}if(b.script){if(b.tagName!=="script"){b.script+="</"+b.tagName+">",b.tagName="",b.state=A.SCRIPT;return}R(b,"onscript",b.script),b.script=""}var g=b.tags.length,N=b.tagName;b.strict||(N=N[b.looseCase]());for(var O=N;g--&&b.tags[g].name!==O;)Q(b,"Unexpected close tag");if(g<0){Q(b,"Unmatched closing tag: "+b.tagName),b.textNode+="</"+b.tagName+">",b.state=A.TEXT;return}b.tagName=N;for(var he=b.tags.length;he-- >g;){var ke=b.tag=b.tags.pop();b.tagName=b.tag.name,R(b,"onclosetag",b.tagName);var Qe={};for(var ze in ke.ns)Qe[ze]=ke.ns[ze];var Rt=b.tags[b.tags.length-1]||b;b.opt.xmlns&&ke.ns!==Rt.ns&&Object.keys(ke.ns).forEach(function(kr){var at=ke.ns[kr];R(b,"onclosenamespace",{prefix:kr,uri:at})})}g===0&&(b.closedRoot=!0),b.tagName=b.attribValue=b.attribName="",b.attribList.length=0,b.state=A.TEXT}function Zt(b){var g=b.entity,N=g.toLowerCase(),O,he="";return b.ENTITIES[g]?b.ENTITIES[g]:b.ENTITIES[N]?b.ENTITIES[N]:(g=N,g.charAt(0)==="#"&&(g.charAt(1)==="x"?(g=g.slice(2),O=parseInt(g,16),he=O.toString(16)):(g=g.slice(1),O=parseInt(g,10),he=O.toString(10))),g=g.replace(/^0+/,""),isNaN(O)||he.toLowerCase()!==g?(Q(b,"Invalid character entity"),"&"+b.entity+";"):String.fromCodePoint(O))}function Mn(b,g){g==="<"?(b.state=A.OPEN_WAKA,b.startTagPosition=b.position):x(g)||(Q(b,"Non-whitespace before first tag."),b.textNode=g,b.state=A.TEXT)}function wt(b,g){var N="";return g<b.length&&(N=b.charAt(g)),N}function Ne(b){var g=this;if(this.error)throw this.error;if(g.closed)return pe(g,"Cannot write after close. Assign an onready handler.");if(b===null)return it(g);typeof b=="object"&&(b=b.toString());for(var N=0,O="";O=wt(b,N++),g.c=O,!!O;)switch(g.trackPosition&&(g.position++,O===`
183
+ `?(g.line++,g.column=0):g.column++),g.state){case A.BEGIN:if(g.state=A.BEGIN_WHITESPACE,O==="\uFEFF")continue;Mn(g,O);continue;case A.BEGIN_WHITESPACE:Mn(g,O);continue;case A.TEXT:if(g.sawRoot&&!g.closedRoot){for(var he=N-1;O&&O!=="<"&&O!=="&";)O=wt(b,N++),O&&g.trackPosition&&(g.position++,O===`
184
+ `?(g.line++,g.column=0):g.column++);g.textNode+=b.substring(he,N-1)}O==="<"&&!(g.sawRoot&&g.closedRoot&&!g.strict)?(g.state=A.OPEN_WAKA,g.startTagPosition=g.position):(!x(O)&&(!g.sawRoot||g.closedRoot)&&Q(g,"Text data outside of root node."),O==="&"?g.state=A.TEXT_ENTITY:g.textNode+=O);continue;case A.SCRIPT:O==="<"?g.state=A.SCRIPT_ENDING:g.script+=O;continue;case A.SCRIPT_ENDING:O==="/"?g.state=A.CLOSE_TAG:(g.script+="<"+O,g.state=A.SCRIPT);continue;case A.OPEN_WAKA:if(O==="!")g.state=A.SGML_DECL,g.sgmlDecl="";else if(!x(O))if(j(y,O))g.state=A.OPEN_TAG,g.tagName=O;else if(O==="/")g.state=A.CLOSE_TAG,g.tagName="";else if(O==="?")g.state=A.PROC_INST,g.procInstName=g.procInstBody="";else{if(Q(g,"Unencoded <"),g.startTagPosition+1<g.position){var ke=g.position-g.startTagPosition;O=new Array(ke).join(" ")+O}g.textNode+="<"+O,g.state=A.TEXT}continue;case A.SGML_DECL:(g.sgmlDecl+O).toUpperCase()===l?(R(g,"onopencdata"),g.state=A.CDATA,g.sgmlDecl="",g.cdata=""):g.sgmlDecl+O==="--"?(g.state=A.COMMENT,g.comment="",g.sgmlDecl=""):(g.sgmlDecl+O).toUpperCase()===d?(g.state=A.DOCTYPE,(g.doctype||g.sawRoot)&&Q(g,"Inappropriately located doctype declaration"),g.doctype="",g.sgmlDecl=""):O===">"?(R(g,"onsgmldeclaration",g.sgmlDecl),g.sgmlDecl="",g.state=A.TEXT):(S(O)&&(g.state=A.SGML_DECL_QUOTED),g.sgmlDecl+=O);continue;case A.SGML_DECL_QUOTED:O===g.q&&(g.state=A.SGML_DECL,g.q=""),g.sgmlDecl+=O;continue;case A.DOCTYPE:O===">"?(g.state=A.TEXT,R(g,"ondoctype",g.doctype),g.doctype=!0):(g.doctype+=O,O==="["?g.state=A.DOCTYPE_DTD:S(O)&&(g.state=A.DOCTYPE_QUOTED,g.q=O));continue;case A.DOCTYPE_QUOTED:g.doctype+=O,O===g.q&&(g.q="",g.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:g.doctype+=O,O==="]"?g.state=A.DOCTYPE:S(O)&&(g.state=A.DOCTYPE_DTD_QUOTED,g.q=O);continue;case A.DOCTYPE_DTD_QUOTED:g.doctype+=O,O===g.q&&(g.state=A.DOCTYPE_DTD,g.q="");continue;case A.COMMENT:O==="-"?g.state=A.COMMENT_ENDING:g.comment+=O;continue;case A.COMMENT_ENDING:O==="-"?(g.state=A.COMMENT_ENDED,g.comment=ne(g.opt,g.comment),g.comment&&R(g,"oncomment",g.comment),g.comment=""):(g.comment+="-"+O,g.state=A.COMMENT);continue;case A.COMMENT_ENDED:O!==">"?(Q(g,"Malformed comment"),g.comment+="--"+O,g.state=A.COMMENT):g.state=A.TEXT;continue;case A.CDATA:O==="]"?g.state=A.CDATA_ENDING:g.cdata+=O;continue;case A.CDATA_ENDING:O==="]"?g.state=A.CDATA_ENDING_2:(g.cdata+="]"+O,g.state=A.CDATA);continue;case A.CDATA_ENDING_2:O===">"?(g.cdata&&R(g,"oncdata",g.cdata),R(g,"onclosecdata"),g.cdata="",g.state=A.TEXT):O==="]"?g.cdata+="]":(g.cdata+="]]"+O,g.state=A.CDATA);continue;case A.PROC_INST:O==="?"?g.state=A.PROC_INST_ENDING:x(O)?g.state=A.PROC_INST_BODY:g.procInstName+=O;continue;case A.PROC_INST_BODY:if(!g.procInstBody&&x(O))continue;O==="?"?g.state=A.PROC_INST_ENDING:g.procInstBody+=O;continue;case A.PROC_INST_ENDING:O===">"?(R(g,"onprocessinginstruction",{name:g.procInstName,body:g.procInstBody}),g.procInstName=g.procInstBody="",g.state=A.TEXT):(g.procInstBody+="?"+O,g.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:j(_,O)?g.tagName+=O:(Tt(g),O===">"?bt(g):O==="/"?g.state=A.OPEN_TAG_SLASH:(x(O)||Q(g,"Invalid character in tag name"),g.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:O===">"?(bt(g,!0),Et(g)):(Q(g,"Forward-slash in opening tag not followed by >"),g.state=A.ATTRIB);continue;case A.ATTRIB:if(x(O))continue;O===">"?bt(g):O==="/"?g.state=A.OPEN_TAG_SLASH:j(y,O)?(g.attribName=O,g.attribValue="",g.state=A.ATTRIB_NAME):Q(g,"Invalid attribute name");continue;case A.ATTRIB_NAME:O==="="?g.state=A.ATTRIB_VALUE:O===">"?(Q(g,"Attribute without value"),g.attribValue=g.attribName,xr(g),bt(g)):x(O)?g.state=A.ATTRIB_NAME_SAW_WHITE:j(_,O)?g.attribName+=O:Q(g,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if(O==="=")g.state=A.ATTRIB_VALUE;else{if(x(O))continue;Q(g,"Attribute without value"),g.tag.attributes[g.attribName]="",g.attribValue="",R(g,"onattribute",{name:g.attribName,value:""}),g.attribName="",O===">"?bt(g):j(y,O)?(g.attribName=O,g.state=A.ATTRIB_NAME):(Q(g,"Invalid attribute name"),g.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(x(O))continue;S(O)?(g.q=O,g.state=A.ATTRIB_VALUE_QUOTED):(Q(g,"Unquoted attribute value"),g.state=A.ATTRIB_VALUE_UNQUOTED,g.attribValue=O);continue;case A.ATTRIB_VALUE_QUOTED:if(O!==g.q){O==="&"?g.state=A.ATTRIB_VALUE_ENTITY_Q:g.attribValue+=O;continue}xr(g),g.q="",g.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:x(O)?g.state=A.ATTRIB:O===">"?bt(g):O==="/"?g.state=A.OPEN_TAG_SLASH:j(y,O)?(Q(g,"No whitespace between attributes"),g.attribName=O,g.attribValue="",g.state=A.ATTRIB_NAME):Q(g,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!C(O)){O==="&"?g.state=A.ATTRIB_VALUE_ENTITY_U:g.attribValue+=O;continue}xr(g),O===">"?bt(g):g.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(g.tagName)O===">"?Et(g):j(_,O)?g.tagName+=O:g.script?(g.script+="</"+g.tagName,g.tagName="",g.state=A.SCRIPT):(x(O)||Q(g,"Invalid tagname in closing tag"),g.state=A.CLOSE_TAG_SAW_WHITE);else{if(x(O))continue;F(y,O)?g.script?(g.script+="</"+O,g.state=A.SCRIPT):Q(g,"Invalid tagname in closing tag."):g.tagName=O}continue;case A.CLOSE_TAG_SAW_WHITE:if(x(O))continue;O===">"?Et(g):Q(g,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var Qe,ze;switch(g.state){case A.TEXT_ENTITY:Qe=A.TEXT,ze="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:Qe=A.ATTRIB_VALUE_QUOTED,ze="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:Qe=A.ATTRIB_VALUE_UNQUOTED,ze="attribValue";break}if(O===";")if(g.opt.unparsedEntities){var Rt=Zt(g);g.entity="",g.state=Qe,g.write(Rt)}else g[ze]+=Zt(g),g.entity="",g.state=Qe;else j(g.entity.length?v:$,O)?g.entity+=O:(Q(g,"Invalid character in entity name"),g[ze]+="&"+g.entity+O,g.entity="",g.state=Qe);continue;default:throw new Error(g,"Unknown state: "+g.state)}return g.position>=g.bufferCheckPosition&&o(g),g}return String.fromCodePoint||(function(){var b=String.fromCharCode,g=Math.floor,N=function(){var O=16384,he=[],ke,Qe,ze=-1,Rt=arguments.length;if(!Rt)return"";for(var kr="";++ze<Rt;){var at=Number(arguments[ze]);if(!isFinite(at)||at<0||at>1114111||g(at)!==at)throw RangeError("Invalid code point: "+at);at<=65535?he.push(at):(at-=65536,ke=(at>>10)+55296,Qe=at%1024+56320,he.push(ke,Qe)),(ze+1===Rt||he.length>O)&&(kr+=b.apply(null,he),he.length=0)}return kr};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:N,configurable:!0,writable:!0}):String.fromCodePoint=N})(),e},XR=P6();var qh=`The output should be formatted as a XML file.
185
+ 1. Output should conform to the tags below.
186
+ 2. If tags are not given, make them on your own.
187
+ 3. Remember to always open and close all the tags.
188
+
189
+ As an example, for the tags ["foo", "bar", "baz"]:
190
+ 1. String "<foo>
191
+ <bar>
192
+ <baz></baz>
193
+ </bar>
194
+ </foo>" is a well-formatted instance of the schema.
195
+ 2. String "<foo>
196
+ <bar>
197
+ </foo>" is a badly-formatted instance.
198
+ 3. String "<foo>
199
+ <tag>
200
+ </tag>
201
+ </foo>" is a badly-formatted instance.
202
+
203
+ Here are the output tags:
204
+ \`\`\`
205
+ {tags}
206
+ \`\`\``,GR=class extends Pi{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?fa(e,t):[{op:"replace",path:"",value:t}]}async parsePartialResult(e){return Jh(e[0].text)}async parse(e){return Jh(e)}getFormatInstructions(){return this.tags&&this.tags.length>0?qh.replace("{tags}",this.tags?.join(", ")??""):qh}},T6=e=>e.split(`
207
+ `).map(t=>t.replace(/^\s+/,"")).join(`
208
+ `).trim(),YR=e=>{if(Object.keys(e).length===0)return{};let t={};return e.children.length>0?(t[e.name]=e.children.map(YR),t):(t[e.name]=e.text??void 0,t)};function Jh(e){let t=T6(e),r=XR.parser(!0),o={},n=[];r.onopentag=s=>{let u={name:s.name,attributes:s.attributes,children:[],text:"",isSelfClosing:s.isSelfClosing};n.length>0?n[n.length-1].children.push(u):o=u,s.isSelfClosing||n.push(u)},r.onclosetag=()=>{if(n.length>0){let s=n.pop();n.length===0&&s&&(o=s)}},r.ontext=s=>{if(n.length>0){let u=n[n.length-1];u.text+=s}},r.onattribute=s=>{if(n.length>0){let u=n[n.length-1];u.attributes[s.name]=s.value}};let i=/```(xml)?(.*)```/s.exec(t),a=i?i[2]:t;return r.write(a).close(),o&&o.name==="?xml"&&(o=o.children[0]),YR(o)}var ode=oe({AsymmetricStructuredOutputParser:()=>BR,BaseCumulativeTransformOutputParser:()=>Pi,BaseLLMOutputParser:()=>rA,BaseOutputParser:()=>vo,BaseTransformOutputParser:()=>bo,BytesOutputParser:()=>WR,CommaSeparatedListOutputParser:()=>KR,CustomListOutputParser:()=>VR,JsonMarkdownStructuredOutputParser:()=>nA,JsonOutputParser:()=>Uc,ListOutputParser:()=>Lc,MarkdownListOutputParser:()=>JR,NumberedListOutputParser:()=>qR,OutputParserException:()=>Lt,StandardSchemaOutputParser:()=>Vh,StringOutputParser:()=>HR,StructuredOutputParser:()=>tp,XMLOutputParser:()=>GR,XML_FORMAT_INSTRUCTIONS:()=>qh,parseJsonMarkdown:()=>Ci,parsePartialJson:()=>Hc,parseXMLMarkdown:()=>Jh});function fs(e,t){if(e.function===void 0)return;let r;if(t?.partial)try{r=Hc(e.function.arguments??"{}")}catch{return}else try{r=JSON.parse(e.function.arguments)}catch(n){throw new Lt([`Function "${e.function.name}" arguments:`,"",e.function.arguments,"","are not valid JSON.",`Error: ${n.message}`].join(`
209
+ `))}let o={name:e.function.name,args:r,type:"tool_call"};return t?.returnId&&(o.id=e.id),o}function rp(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 Ti(e,t){return{name:e.function?.name,args:e.function?.arguments,id:e.id,error:t,type:"invalid_tool_call"}}var oA=class extends Pi{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 r=e[0].message,o;if(wo(r)&&r.tool_calls?.length?o=r.tool_calls.map(i=>{let{id:a,...s}=i;return this.returnId?{id:a,...s}:s}):r.additional_kwargs.tool_calls!==void 0&&(o=JSON.parse(JSON.stringify(r.additional_kwargs.tool_calls)).map(i=>fs(i,{returnId:this.returnId,partial:t}))),!o)return[];let n=[];for(let i of o)if(i!==void 0){let a={type:i.name,args:i.args,id:i.id};n.push(a)}return n}},Hh=class extends oA{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 r=await this.serializableSchema["~standard"].validate(e);if(r.issues)throw new Lt(`Failed to parse. Text: "${JSON.stringify(e,null,2)}". Error: ${JSON.stringify(r.issues)}`,JSON.stringify(e,null,2));return r.value}if(this.zodSchema===void 0)return e;let t=await If(this.zodSchema,e);if(t.success)return t.data;throw new Lt(`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(o=>o.type===this.keyName),r=t;if(t.length)return this.returnId||(r=t.map(o=>o.args)),this.returnSingle?r[0]:r}async parseResult(e){let t=(await super.parsePartialResult(e,!1)).filter(o=>o.type===this.keyName),r=t;if(t.length)return this.returnId||(r=t.map(o=>o.args)),this.returnSingle?this._validateResult(r[0]):await Promise.all(r.map(o=>this._validateResult(o)))}};var Sde=oe({assembleStructuredOutputPipeline:()=>np,createContentParser:()=>Xh,createFunctionCallingParser:()=>iA});function Xh(e){return _t(e)?tp.fromZodSchema(e):xn(e)?Vh.fromSerializableSchema(e):new Uc}function iA(e,t,r){let o=r??Hh;return _t(e)?new o({returnSingle:!0,keyName:t,zodSchema:e}):xn(e)?new o({returnSingle:!0,keyName:t,serializableSchema:e}):new o({returnSingle:!0,keyName:t})}function np(e,t,r,o){if(!r){let u=e.pipe(t);return o?u.withConfig({runName:o}):u}let n=ps.assign({parsed:(u,c)=>t.invoke(u.raw,c)}),i=ps.assign({parsed:()=>null}),a=n.withFallbacks({fallbacks:[i]}),s=su.from([{raw:e},a]);return o?s.withConfig({runName:o}):s}var Ede=oe({ChatModelStream:()=>Yh,ReasoningContentStream:()=>rC,TextContentStream:()=>eC,ToolCallsStream:()=>tC,UsageMetadataStream:()=>nC}),E6=class{events=[];finished=!1;waiters=[];error=null;push(e){this.events.push(e);let t=this.waiters.splice(0);for(let r of t)r()}finish(){this.finished=!0;let e=this.waiters.splice(0);for(let t of e)t()}setError(e){this.error=e,this.finished=!0;let t=this.waiters.splice(0);for(let r of t)r()}async*iterate(){if(this.finished){if(this.error)throw this.error;yield*this.events;return}let e=0;for(;;){for(;e<this.events.length;)yield this.events[e],e++;if(this.finished){if(this.error)throw this.error;return}await new Promise(t=>{if(e<this.events.length||this.finished){t();return}this.waiters.push(t)})}}};function R6(e,t){switch(t.type){case"text-delta":return e.type==="text"?{...e,text:(e.text??"")+t.text}:e;case"reasoning-delta":return e.type==="thinking"?{...e,thinking:(e.thinking??"")+t.reasoning}:e.type==="reasoning"?{...e,reasoning:(e.reasoning??"")+t.reasoning}:e;case"data-delta":return{...e,data:(e.data??"")+t.data};case"block-delta":return{...e,...t.fields};default:throw new Error(`Unknown delta type: ${JSON.stringify(t)}`)}}function op(e){if(e.event!=="content-block-delta")return;if("delta"in e&&e.delta)return e.delta;let t=e.content;if(t==null||typeof t!="object")return;let r=t;if(r.type==="text"&&typeof r.text=="string")return{type:"text-delta",text:r.text};if(r.type==="reasoning"&&typeof r.reasoning=="string")return{type:"reasoning-delta",reasoning:r.reasoning};if(r.type==="thinking"&&typeof r.thinking=="string")return{type:"reasoning-delta",reasoning:r.thinking};if(typeof r.data=="string")return{type:"data-delta",data:r.data,encoding:"base64"};if(typeof r.type=="string")return{type:"block-delta",fields:{...r,type:r.type}}}function QR(e){if(e==null||typeof e!="object")return;let t=e;if(t.type==="reasoning"&&typeof t.reasoning=="string")return t.reasoning;if(t.type==="thinking"&&typeof t.thinking=="string")return t.thinking}function Gh(e){if(e==null||typeof e!="object")return!1;let t=e.type;return t==="reasoning"||t==="thinking"}function Zc(e){if(e)return{...e,input_tokens:e.input_tokens??0,output_tokens:e.output_tokens??0,total_tokens:e.total_tokens??0}}function C6(e){if(e!=null&&typeof e=="object"&&!Array.isArray(e))return e;if(typeof e!="string"||e.length===0)return{};try{let t=JSON.parse(e);return t!=null&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function z6(e){let t=e;if(e.type==="tool_call"||e.type!=="tool_call_chunk"&&e.type!=="tool_use"&&e.type!=="input_json_delta")return e;let r=typeof t.name=="string"?t.name:void 0;if(r==null)return e;let o=t.args??t.input;return{...t,type:"tool_call",name:r,args:C6(o)}}var eC=class{_buffer;constructor(e){this._buffer=e}get full(){let e=this._buffer;return{async*[Symbol.asyncIterator](){let t="";for await(let r of e.iterate()){let o=op(r);o?.type==="text-delta"&&(t+=o.text,yield t)}}}}[Symbol.asyncIterator](){let e=this._buffer;async function*t(){for await(let r of e.iterate()){let o=op(r);o?.type==="text-delta"&&(yield o.text)}}return t()}then(e,t){return(async()=>{let r="";for await(let o of this)r+=o;return r})().then(e,t)}},tC=class{_buffer;constructor(e){this._buffer=e}get full(){let e=this._buffer;return{async*[Symbol.asyncIterator](){let t=[];for await(let r of e.iterate())r.event==="content-block-finish"&&r.content.type==="tool_call"&&(t.push(r.content),yield[...t])}}}[Symbol.asyncIterator](){let e=this._buffer;async function*t(){for await(let r of e.iterate())r.event==="content-block-finish"&&r.content.type==="tool_call"&&(yield r.content)}return t()}then(e,t){return(async()=>{let r=[];for await(let o of this)r.push(o);return r})().then(e,t)}},rC=class{_buffer;constructor(e){this._buffer=e}get full(){let e=this._buffer;return{async*[Symbol.asyncIterator](){let t="",r=!1;for await(let o of e.iterate())if(o.event==="content-block-start"){if(!Gh(o.content)){if(r)return;continue}r=!0;let n=QR(o.content);if(n==null||n.length===0)continue;t+=n,yield t}else if(o.event==="content-block-delta"){let n=op(o);if(n?.type!=="reasoning-delta")continue;r=!0;let i=n.reasoning;if(i==null||i.length===0)continue;t+=i,yield t}else{if(o.event==="content-block-finish"&&Gh(o.content))return;if(o.event==="message-finish")return}}}}[Symbol.asyncIterator](){let e=this._buffer;async function*t(){let r=!1;for await(let o of e.iterate())if(o.event==="content-block-start"){if(!Gh(o.content)){if(r)return;continue}r=!0;let n=QR(o.content);n!=null&&n.length>0&&(yield n)}else if(o.event==="content-block-delta"){let n=op(o);if(n?.type!=="reasoning-delta")continue;r=!0;let i=n.reasoning;i!=null&&i.length>0&&(yield i)}else{if(o.event==="content-block-finish"&&Gh(o.content))return;if(o.event==="message-finish")return}}return t()}then(e,t){return(async()=>{let r="";for await(let o of this)r+=o;return r})().then(e,t)}},nC=class{_buffer;constructor(e){this._buffer=e}[Symbol.asyncIterator](){let e=this._buffer;async function*t(){for await(let r of e.iterate())if(r.event==="usage"){let o=Zc(r.usage);o&&(yield o)}else if(r.event==="message-start"&&r.usage){let o=Zc(r.usage);o&&(yield o)}else if(r.event==="message-finish"&&r.usage){let o=Zc(r.usage);o&&(yield o)}}return t()}then(e,t){return(async()=>{let r;for await(let o of this)r=o;return r})().then(e,t)}},Yh=class{_buffer;constructor(e){this._buffer=new E6,this._consume(e)}async _consume(e){try{for await(let t of e)this._buffer.push(t);this._buffer.finish()}catch(t){this._buffer.setError(t instanceof Error?t:new Error(String(t)))}}[Symbol.asyncIterator](){return this._buffer.iterate()}get text(){return new eC(this._buffer)}get toolCalls(){return new tC(this._buffer)}get reasoning(){return new rC(this._buffer)}get usage(){return new nC(this._buffer)}get output(){return this._assembleMessage()}then(e,t){return this._assembleMessage().then(e,t)}async _assembleMessage(){let e=[],t,r,o={},n;for await(let a of this._buffer.iterate())switch(a.event){case"message-start":t=a.id??t,a.usage&&(r=Zc(a.usage));break;case"content-block-start":e[a.index]=a.content;break;case"content-block-delta":{let s=e[a.index],u=op(a);s&&u&&(e[a.index]=R6(s,u));break}case"content-block-finish":e[a.index]=a.content;break;case"usage":r=Zc(a.usage);break;case"message-finish":n=a.reason,a.usage&&(r=Zc(a.usage)),a.responseMetadata&&(o={...o,...a.responseMetadata});break;default:break}let i=e.filter(a=>a!=null).map(z6);return new st({id:t,content:i,usage_metadata:r,response_metadata:{...o,...n?{finish_reason:n}:{},output_version:"v1"}})}};var Zde=oe({convertChunksToEvents:()=>aA,finalizeContentBlock:()=>Fc}),N6={wav:"audio/wav",mp3:"audio/mpeg",flac:"audio/flac",opus:"audio/opus",aac:"audio/aac",pcm16:"audio/pcm"},j6={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpeg",webp:"image/webp",gif:"image/gif"};function oC(e){let t=0;for(let r of e.keys())r>=t&&(t=r+1);return t}function iC(e){let t=e.additional_kwargs;return t!=null&&typeof t=="object"?t:{}}function D6(e){let t=iC(e).tool_outputs;if(!Array.isArray(t))return[];let r=[];for(let o of t){if(o==null||typeof o!="object")continue;let n=o;if(n.type!=="image_generation_call")continue;let i=typeof n.result=="string"?n.result:void 0,a=typeof n.url=="string"?n.url:void 0;if(i==null&&a==null)continue;let s=typeof n.output_format=="string"?n.output_format.toLowerCase():void 0,u=(s!=null?j6[s]:void 0)??"image/png";r.push({type:"image",...typeof n.id=="string"?{id:n.id}:{},...a!=null?{url:a}:{},...i!=null?{data:i}:{},mimeType:u})}return r}function M6(e){let t=iC(e).audio;if(t==null||typeof t!="object")return;let r=t,o=typeof r.data=="string"?r.data:void 0,n=typeof r.url=="string"?r.url:void 0,i=typeof r.transcript=="string"?r.transcript:void 0;if(o==null&&n==null&&i==null)return;let a=typeof r.mime_type=="string"?r.mime_type:typeof r.mimeType=="string"?r.mimeType:void 0,s=typeof r.format=="string"?r.format.toLowerCase():void 0,u=a??(s!=null?N6[s]:void 0)??(o!=null?"audio/wav":"audio/pcm");return{...typeof r.id=="string"?{id:r.id}:{},...o!=null?{data:o}:{},...n!=null?{url:n}:{},...i!=null?{transcript:i}:{},mimeType:u}}async function*aA(e,t){let r=new Map,o=!1,n,i,a=new Set;for await(let s of e){t?.signal?.throwIfAborted();let u=s.message,c=!1;if(!o){o=!0;let p={event:"message-start",id:u.id??void 0};ut.isInstance(u)&&u.usage_metadata&&(p.usage=u.usage_metadata,n={...u.usage_metadata},c=!0),yield p}let l=u.content;if(typeof l=="string"){if(l!==""){if(!r.has(0)){let h={type:"text",text:""};r.set(0,{type:"text",accumulated:h}),yield{event:"content-block-start",index:0,content:h}}let f=r.get(0);f.accumulated={...f.accumulated,text:(f.accumulated.text??"")+l},yield{event:"content-block-delta",index:0,delta:{type:"text-delta",text:l}}}}else if(Array.isArray(l))for(let p of l){let f=typeof p.index=="number"?p.index:r.size;if(!r.has(f))r.set(f,{type:p.type,accumulated:{...p}}),yield{event:"content-block-start",index:f,content:{...p}};else{let h=r.get(f),y=L6(p);h.accumulated=U6(h.accumulated,y),yield{event:"content-block-delta",index:f,delta:y}}}if(ut.isInstance(u)&&u.tool_call_chunks&&u.tool_call_chunks.length>0)for(let p of u.tool_call_chunks){let f=typeof p.index=="number"?p.index:r.size;if(!r.has(f)){let y={type:"tool_call_chunk",id:p.id,name:p.name,args:"",index:f};r.set(f,{type:"tool_call_chunk",accumulated:y}),yield{event:"content-block-start",index:f,content:y}}let h=r.get(f).accumulated;p.id!=null&&(h.id=p.id),p.name!=null&&(h.name=p.name),h.args=(h.args??"")+(p.args??""),yield{event:"content-block-delta",index:f,delta:{type:"block-delta",fields:{type:"tool_call_chunk",..."id"in h&&h.id!=null?{id:h.id}:{},..."name"in h&&h.name!=null?{name:h.name}:{},args:h.args}}}}let d=M6(u);if(d!=null){if(i==null){let f=oC(r);i={index:f,id:d.id,mimeType:d.mimeType,transcript:""};let h={type:"audio",...d.id!=null?{id:d.id}:{},...d.url!=null?{url:d.url}:{},data:"",mimeType:d.mimeType};r.set(f,{type:"audio",accumulated:h}),yield{event:"content-block-start",index:f,content:h}}let p=r.get(i.index);if(p!=null){let f=p.accumulated;d.id!=null&&i.id==null&&(i.id=d.id,f.id=d.id),d.transcript!=null&&(i.transcript+=d.transcript,f.transcript=i.transcript,yield{event:"content-block-delta",index:i.index,delta:{type:"block-delta",fields:{type:"audio",transcript:i.transcript}}}),d.data!=null&&d.data.length>0&&(f.data=(f.data??"")+d.data,yield{event:"content-block-delta",index:i.index,delta:{type:"data-delta",data:d.data,encoding:"base64"}})}}for(let p of D6(u)){let f=p,h=f.id??f.url??(f.data!=null?`${f.data.length}:${f.data.slice(0,32)}`:void 0);if(h!=null&&a.has(h))continue;h!=null&&a.add(h);let y=oC(r);r.set(y,{type:"image",accumulated:p}),yield{event:"content-block-start",index:y,content:p}}if(!c&&ut.isInstance(u)&&u.usage_metadata){let p=u.usage_metadata;n?n={input_tokens:n.input_tokens+p.input_tokens,output_tokens:n.output_tokens+p.output_tokens,total_tokens:n.total_tokens+p.total_tokens}:n={...p},yield{event:"usage",usage:{...n}}}}for(let[s,u]of r)yield{event:"content-block-finish",index:s,content:Fc(u.accumulated)};yield{event:"message-finish",reason:"stop",...n?{usage:n}:{}}}function U6(e,t){switch(t.type){case"text-delta":return e.type==="text"?{...e,text:(e.text??"")+t.text}:e;case"reasoning-delta":return e.type==="thinking"?{...e,thinking:(e.thinking??"")+t.reasoning}:e.type==="reasoning"?{...e,reasoning:(e.reasoning??"")+t.reasoning}:e;case"data-delta":return{...e,data:(e.data??"")+t.data};case"block-delta":return{...e,...t.fields};default:throw new Error(`Unknown delta type: ${JSON.stringify(t)}`)}}function L6(e){if(e.type==="text")return{type:"text-delta",text:e.text};if(e.type==="reasoning")return{type:"reasoning-delta",reasoning:e.reasoning};if(e.type==="thinking"&&typeof e.thinking=="string")return{type:"reasoning-delta",reasoning:e.thinking};if(typeof e.data=="string")return{type:"data-delta",data:e.data,encoding:"base64"};if(typeof e.type=="string")return{type:"block-delta",fields:{...e}};throw new Error(`Unsupported content block delta: ${JSON.stringify(e)}`)}function Fc(e){if(e.type==="tool_call_chunk"){let t=e,r;try{r=JSON.parse(t.args??"{}")}catch{return{type:"invalid_tool_call",id:t.id,name:t.name,args:t.args,error:"Failed to parse tool call arguments as JSON"}}return{type:"tool_call",id:t.id,name:t.name,args:r}}return e}var lpe=oe({BaseChatModel:()=>Qh,SimpleChatModel:()=>Z6});function sA(e){let t=[];for(let r of e){let o=r;if(Array.isArray(r.content))for(let n=0;n<r.content.length;n++){let i=r.content[n];(dp(i)||pp(i))&&o===r&&(o=new r.constructor({...o,content:[...r.content.slice(0,n),fp(i),...r.content.slice(n+1)]}))}t.push(o)}return t}var Qh=class Dn extends Ml{lc_namespace=["langchain","chat_models",this._llmType()];disableStreaming=!1;outputVersion;get callKeys(){return[...super.callKeys,"outputVersion"]}constructor(t){super(t),this.outputVersion=UR(()=>{let r=t.outputVersion??yt("LC_OUTPUT_VERSION");return r&&["v0","v1"].includes(r)?r:"v0"})}_separateRunnableConfigFromCallOptionsCompat(t){let[r,o]=super._separateRunnableConfigFromCallOptions(t);return o.signal=r.signal,[r,o]}async invoke(t,r){let o=Dn._convertInputToPromptValue(t);return(await this.generatePrompt([o],r,r?.callbacks)).generations[0][0].message}async*_streamResponseChunks(t,r,o){throw new Error("Not implemented.")}async*_streamChatModelEvents(t,r,o){yield*aA(this._streamResponseChunks(t,r,o),{signal:r.signal})}streamEvents(t,r,o){if(r?.version==="v1"||r?.version==="v2")return super.streamEvents(t,r,o);let n=Dn._convertInputToPromptValue(t).toChatMessages(),[,i]=this._separateRunnableConfigFromCallOptionsCompat(r);return new Yh(this._streamChatModelEvents(n,i))}streamV2(t,r){return this.streamEvents(t,r)}async*_streamIterator(t,r){if(this._streamResponseChunks===Dn.prototype._streamResponseChunks||this.disableStreaming)yield this.invoke(t,r);else{let o=Dn._convertInputToPromptValue(t).toChatMessages(),[n,i]=this._separateRunnableConfigFromCallOptionsCompat(r),a={...n.metadata,...this.getLsParamsWithDefaults(i)},s=this._getInvocationParamsForTracing(i),u=await mn.configure(n.callbacks,this.callbacks,n.tags,this.tags,a,this.metadata,{verbose:this.verbose,tracerInheritableMetadata:this._filterInvocationParamsForTracing(s)}),c={options:this._getCallOptionsForTracing(i,s),invocation_params:s,batch_size:1},l=i.outputVersion??this.outputVersion,d=await u?.handleChatModelStart(this.toJSON(),[sA(o)],n.runId,void 0,c,void 0,void 0,n.runName),p,f;try{for await(let h of this._streamResponseChunks(o,i,d?.[0])){if(i.signal?.throwIfAborted(),h.message.id==null){let y=d?.at(0)?.runId;y!=null&&h.message._updateId(`run-${y}`)}h.message.response_metadata={...h.generationInfo,...h.message.response_metadata},l==="v1"?yield ep(h.message):yield h.message,p?p=p.concat(h):p=h,Xc(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}})}i.signal?.throwIfAborted()}catch(h){throw await Promise.all((d??[]).map(y=>y?.handleLLMError(h))),h}await Promise.all((d??[]).map(h=>h?.handleLLMEnd({generations:[[p]],llmOutput:f})))}}getLsParams(t){let r=this.getName().startsWith("Chat")?this.getName().replace("Chat",""):this.getName();return{ls_model_type:"chat",ls_stop:t.stop,ls_provider:r}}getLsParamsWithDefaults(t){return{...this.getLsParams(t),ls_integration:"langchain_chat_model"}}async _generateUncached(t,r,o,n){let i=t.map(f=>f.map(xo)),a;if(n!==void 0&&n.length===i.length)a=n;else{let f={...o.metadata,...this.getLsParamsWithDefaults(r)},h=this._getInvocationParamsForTracing(r),y=await mn.configure(o.callbacks,this.callbacks,o.tags,this.tags,f,this.metadata,{verbose:this.verbose,tracerInheritableMetadata:this._filterInvocationParamsForTracing(h)}),_={options:this._getCallOptionsForTracing(r,h),invocation_params:h,batch_size:1};a=await y?.handleChatModelStart(this.toJSON(),i.map(sA),o.runId,void 0,_,void 0,void 0,o.runName)}let s=r.outputVersion??this.outputVersion,u=[],c=[],l=!!a?.[0].handlers.find(QA),d=!!a?.[0].handlers.find(_p);if(l&&!this.disableStreaming&&i.length===1&&(this._streamChatModelEvents!==Dn.prototype._streamChatModelEvents||this._streamResponseChunks!==Dn.prototype._streamResponseChunks))try{let f=!1,h=a?.[0],y=this._streamChatModelEvents(i[0],r),_=await new Yh({async*[Symbol.asyncIterator](){for await(let x of y){r.signal?.throwIfAborted(),f=!0;let S=x.event==="message-start"&&x.id==null&&h?.runId!=null?{...x,id:`run-${h.runId}`}:x;await h?.handleChatModelStreamEvent(S),yield S}}});if(r.signal?.throwIfAborted(),!f)throw new Error("Received empty response from chat model call.");if(_.id==null){let x=a?.at(0)?.runId;x!=null&&_._updateId(`run-${x}`)}let $={text:_.text,message:_};u.push([$]);let v=_.usage_metadata!==void 0?{tokenUsage:{promptTokens:_.usage_metadata.input_tokens,completionTokens:_.usage_metadata.output_tokens,totalTokens:_.usage_metadata.total_tokens}}:void 0;await a?.[0].handleLLMEnd({generations:u,llmOutput:v})}catch(f){throw await a?.[0].handleLLMError(f),f}else if(d&&!this.disableStreaming&&i.length===1&&this._streamResponseChunks!==Dn.prototype._streamResponseChunks)try{let f=await this._streamResponseChunks(i[0],r,a?.[0]),h,y;for await(let _ of f){if(r.signal?.aborted){let $=h?.message;throw new cg("Model invocation was aborted.",$)}if(_.message.id==null){let $=a?.at(0)?.runId;$!=null&&_.message._updateId(`run-${$}`)}h===void 0?h=_:h=yr(h,_),Xc(_.message)&&_.message.usage_metadata!==void 0&&(y={tokenUsage:{promptTokens:_.message.usage_metadata.input_tokens,completionTokens:_.message.usage_metadata.output_tokens,totalTokens:_.message.usage_metadata.total_tokens}})}if(r.signal?.aborted){let _=h?.message;throw new cg("Model invocation was aborted.",_)}if(h===void 0)throw new Error("Received empty response from chat model call.");s==="v1"&&(h.message=ep(h.message)),u.push([h]),await a?.[0].handleLLMEnd({generations:u,llmOutput:y})}catch(f){throw await a?.[0].handleLLMError(f),f}else{let f=await Promise.allSettled(i.map(async(h,y)=>{let _=await this._generate(h,{...r,promptIndex:y},a?.[y]);if(s==="v1")for(let $ of _.generations)$.message=ep($.message);return _}));await Promise.all(f.map(async(h,y)=>{if(h.status==="fulfilled"){let _=h.value;for(let $ of _.generations){if($.message.id==null){let v=a?.at(0)?.runId;v!=null&&$.message._updateId(`run-${v}`)}$.message.response_metadata={...$.generationInfo,...$.message.response_metadata}}return _.generations.length===1&&(_.generations[0].message.response_metadata={..._.llmOutput,..._.generations[0].message.response_metadata}),u[y]=_.generations,c[y]=_.llmOutput,a?.[y]?.handleLLMEnd({generations:[_.generations],llmOutput:_.llmOutput})}else return await a?.[y]?.handleLLMError(h.reason),Promise.reject(h.reason)}))}let p={generations:u,llmOutput:c.length?this._combineLLMOutput?.(...c):void 0};return Object.defineProperty(p,ma,{value:a?{runIds:a?.map(f=>f.runId)}:void 0,configurable:!0}),p}async _generateCached({messages:t,cache:r,llmStringKey:o,parsedOptions:n,handledOptions:i}){let a=t.map($=>$.map(xo)),s={...i.metadata,...this.getLsParamsWithDefaults(n)},u=this._getInvocationParamsForTracing(n),c=await mn.configure(i.callbacks,this.callbacks,i.tags,this.tags,s,this.metadata,{verbose:this.verbose,tracerInheritableMetadata:this._filterInvocationParamsForTracing(u)}),l={options:this._getCallOptionsForTracing(n,u),invocation_params:u,batch_size:1},d=await c?.handleChatModelStart(this.toJSON(),a.map(sA),i.runId,void 0,l,void 0,void 0,i.runName),p=[],f=(await Promise.allSettled(a.map(async($,v)=>{let x=Dn._convertInputToPromptValue($).toString(),S=await r.lookup(x,o);return S==null&&p.push(v),S}))).map(($,v)=>({result:$,runManager:d?.[v]})).filter(({result:$})=>$.status==="fulfilled"&&$.value!=null||$.status==="rejected"),h=n.outputVersion??this.outputVersion,y=[];await Promise.all(f.map(async({result:$,runManager:v},x)=>{if($.status==="fulfilled"){let S=$.value;return y[x]=S.map(C=>("message"in C&&Vr(C.message)&&wo(C.message)&&(C.message.usage_metadata={input_tokens:0,output_tokens:0,total_tokens:0},h==="v1"&&(C.message=ep(C.message))),C.generationInfo={...C.generationInfo,tokenUsage:{}},C)),S.length&&await v?.handleLLMNewToken(S[0].text),v?.handleLLMEnd({generations:[S]},void 0,void 0,void 0,{cached:!0})}else return await v?.handleLLMError($.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject($.reason)}));let _={generations:y,missingPromptIndices:p,startedRunManagers:d};return Object.defineProperty(_,ma,{value:d?{runIds:d?.map($=>$.runId)}:void 0,configurable:!0}),_}async generate(t,r,o){let n;Array.isArray(r)?n={stop:r}:n=r;let i=t.map(h=>h.map(xo)),[a,s]=this._separateRunnableConfigFromCallOptionsCompat(n);if(a.callbacks=a.callbacks??o,!this.cache)return this._generateUncached(i,s,a);let{cache:u}=this,c=this._getSerializedCacheKeyParametersForCall(s),{generations:l,missingPromptIndices:d,startedRunManagers:p}=await this._generateCached({messages:i,cache:u,llmStringKey:c,parsedOptions:s,handledOptions:a}),f={};if(d.length>0){let h=await this._generateUncached(d.map(y=>i[y]),s,a,p!==void 0?d.map(y=>p?.[y]):void 0);await Promise.all(h.generations.map(async(y,_)=>{let $=d[_];l[$]=y;let v=Dn._convertInputToPromptValue(i[$]).toString();return u.update(v,c,y)})),f=h.llmOutput??{}}return{generations:l,llmOutput:f}}_getInvocationParamsForTracing(t){return this.invocationParams(t)}_getCallOptionsForTracing(t,r){return t}invocationParams(t){return{}}_modelType(){return"base_chat_model"}async generatePrompt(t,r,o){let n=t.map(i=>i.toChatMessages());return this.generate(n,r,o)}withStructuredOutput(t,r){if(typeof this.bindTools!="function")throw new Error('Chat model must implement ".bindTools()" to use withStructuredOutput.');if(r?.strict)throw new Error('"strict" mode is not supported for this model by default.');let o=t,n=r?.name,i=No(o)??"A function available to call.",a=r?.method,s=r?.includeRaw;if(a==="jsonMode")throw new Error('Base withStructuredOutput implementation only supports "functionCalling" as a method.');let u=n??"extract";!_t(o)&&!xn(o)&&"name"in o&&(u=o.name);let c=_t(o)||xn(o)?Nt(o):o,l=[{type:"function",function:{name:u,description:i,parameters:c}}];return np(this.bindTools(l),or.from(d=>{if(!ut.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 p=d.tool_calls.find(f=>f.name===u);if(!p)throw new Error(`No tool call found with name ${u}.`);return p.args}),s,s?"StructuredOutputRunnable":"StructuredOutput")}},Z6=class extends Qh{async _generate(e,t,r){let o=new st(await this._call(e,t,r));if(typeof o.content!="string")throw new Error("Cannot generate with a simple chat model when output is not a string.");return{generations:[{text:o.content,message:o}]}}};var eg="**REDACTED**";function Bc(e,t){return typeof e=="string"?{model:e,...t??{}}:e??t}var ms=class extends Qh{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}}_getInvocationParamsForTracing(e){let t=this.invocationParams(e);return Array.isArray(t.tools)?{...t,tools:t.tools.map(r=>{if(r?.type!=="mcp")return r;let o={...r};return"headers"in o&&(o.headers=eg),"authorization"in o&&(o.authorization=eg),o})}:t}_getCallOptionsForTracing(e,t){return Array.isArray(e.tools)?{...e,tools:e.tools.map(r=>{if(typeof r!="object"||r===null||!("type"in r)||r.type!=="mcp")return r;let o={...r};return"headers"in o&&(o.headers=eg),"authorization"in o&&(o.authorization=eg),o})}:e}_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,r=tA({baseURL:e?.configuration?.baseURL??(yt("OPENAI_API_BASE")||yt("OPENAI_BASE_URL")||void 0),providerPath:"openai/v1"});this.apiKey=e?.apiKey??t??r.apiKey??yt("OPENAI_API_KEY"),this.organization=e?.configuration?.organization??yt("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,baseURL:r.baseURL},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.5.11")}_getReasoningParams(e){if(!mo(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&&_t(e.json_schema.schema)?NR(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={baseURL:this.clientConfig.baseURL},r=go(t),o={...this.clientConfig,baseURL:r,timeout:this.timeout,maxRetries:0};o.baseURL||delete o.baseURL,o.defaultHeaders=yo(o.defaultHeaders),this.client=new ae(o)}return{...this.clientConfig,...e}}_convertChatOpenAIToolToCompletionsTool(e,t){return is(e)?RE(e.metadata.customTool):Dl(e)?t?.strict!==void 0?{...e,function:{...e.function,strict:t.strict}}:e:xE(e,t)}bindTools(e,t){let r;return t?.strict!==void 0?r=t.strict:this.supportsStrictToolCalling!==void 0&&(r=this.supportsStrictToolCalling),this.withConfig({tools:e.map(o=>{if(zc(o)||is(o))return o;if(IE(o))return o.extras.providerToolDefinition;let n=this._convertChatOpenAIToolToCompletionsTool(o,{strict:r});return Gn(o)&&o.extras?.defer_loading===!0?{...n,defer_loading:!0}:n}),...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,r)=>(r&&r.tokenUsage&&(t.tokenUsage.completionTokens+=r.tokenUsage.completionTokens??0,t.tokenUsage.promptTokens+=r.tokenUsage.promptTokens??0,t.tokenUsage.totalTokens+=r.tokenUsage.totalTokens??0),t),{tokenUsage:{completionTokens:0,promptTokens:0,totalTokens:0}})}async getNumTokensFromMessages(e){let t=0,r=0,o=0;this.model==="gpt-3.5-turbo-0301"?(r=4,o=-1):(r=3,o=1);let n=await Promise.all(e.map(async i=>{let[a,s]=await Promise.all([this.getNumTokens(i.content),this.getNumTokens(ho(i))]),u=i.name!==void 0?o+await this.getNumTokens(i.name):0,c=a+r+s+u,l=i;if(l._getType()==="function"&&(c-=2),l.additional_kwargs?.function_call&&(c+=3),l?.additional_kwargs.function_call?.name&&(c+=await this.getNumTokens(l.additional_kwargs.function_call?.name)),l.additional_kwargs.function_call?.arguments)try{c+=await this.getNumTokens(JSON.stringify(JSON.parse(l.additional_kwargs.function_call?.arguments)))}catch(d){console.error("Error parsing function arguments",d,JSON.stringify(l.additional_kwargs.function_call)),c+=await this.getNumTokens(l.additional_kwargs.function_call?.arguments)}return t+=c,c}));return t+=3,{totalCount:t,countPerMessage:n}}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,r)=>t+r,0)}async _getEstimatedTokenCountFromPrompt(e,t,r){let o=(await this.getNumTokensFromMessages(e)).totalCount;if(t&&r!=="auto"){let n=kE(t);o+=await this.getNumTokens(n),o+=9}return t&&e.find(n=>n._getType()==="system")&&(o-=4),r==="none"?o+=1:typeof r=="object"&&(o+=await this.getNumTokens(r.name)+4),o}async moderateContent(e,t){let r=this._getClientOptions(t?.options),o={input:e,model:t?.model??"omni-moderation-latest"};return this.caller.call(async()=>{try{return await this.client.moderations.create(o,r)}catch(n){throw Wr(n)}})}get profile(){return DR[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 r,o,{schema:n,name:i,includeRaw:a}={...t,schema:e};if(t?.strict!==void 0&&t.method==="jsonMode")throw new Error("Argument `strict` is only supported for `method` = 'function_calling'");let s=zR(this.model,t?.method);if(s==="jsonMode"){o=Xh(n);let u=Nt(n);r=this.withConfig({outputVersion:"v0",response_format:{type:"json_object"},ls_structured_output_format:{kwargs:{method:"json_mode"},schema:{title:i??"extract",...u}}})}else if(s==="jsonSchema"){let u=Nt(n),c={name:i??"extract",description:No(u),schema:_t(n)?n:u,strict:t?.strict};if(r=this.withConfig({outputVersion:"v0",response_format:{type:"json_schema",json_schema:c},ls_structured_output_format:{kwargs:{method:"json_schema"},schema:{title:c.name,description:c.description,...u}}}),_t(n)||xn(n)){let l=Xh(n);o=or.from(async d=>"parsed"in d.additional_kwargs?d.additional_kwargs.parsed:l.invoke(d.content))}else o=new Uc}else{let u=i??"extract",c=Nt(n),l;_t(n)||xn(n)?l={name:u,description:c.description,parameters:c}:typeof n.name=="string"&&typeof n.parameters=="object"&&n.parameters!=null?(l=n,u=n.name):(u=n.title??u,l={name:u,description:n.description??"",parameters:n}),r=this.withConfig({outputVersion:"v0",tools:[{type:"function",function:l}],tool_choice:{type:"function",function:{name:u}},ls_structured_output_format:{kwargs:{method:"function_calling"},schema:{title:u,...c}},...t?.strict!==void 0?{strict:t.strict}:{}}),o=iA(n,u)}return np(r,o,a)}};var Npe=oe({JsonOutputKeyToolsParser:()=>Hh,JsonOutputToolsParser:()=>oA,convertLangChainToolCallToOpenAI:()=>rp,makeInvalidToolCall:()=>Ti,parseToolCall:()=>fs});var ip={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=Jc({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 r=t.mime_type||e.mime_type||"",o;try{o=qc(r)}catch{throw new Error(`Audio blocks with source_type ${e.source_type} must have mime type of audio/wav or audio/mp3`)}if(o.type!=="audio"||o.subtype!=="wav"&&o.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:o.subtype,data:t.data}}}if(e.source_type==="base64"){let t;try{t=qc(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=Jc({dataUrl:e.url}),r=os(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,filename:r}}}if(e.source_type==="base64"){let t=os(e);return{type:"file",file:{file_data:`data:${e.mime_type??""};base64,${e.data}`,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`)}},tg=({message:e,rawResponse:t,includeRawResponse:r})=>{let o=e.tool_calls,n=e.reasoning_content;switch(e.role){case"assistant":{let i=[],a=[];for(let l of o??[])try{i.push(fs(l,{returnId:!0}))}catch(d){a.push(Ti(l,d.message))}let s={function_call:e.function_call,tool_calls:o};r!==void 0&&(s.__raw_response=t),n!==void 0&&(s.reasoning_content=n);let u={model_provider:"openai",model_name:t.model,usage:{...t.usage},...t.system_fingerprint?{system_fingerprint:t.system_fingerprint}:{}};e.audio&&(s.audio=e.audio);let c=jR(e.content||"",t.choices?.[0]?.message);return new st({content:c,tool_calls:i,invalid_tool_calls:a,additional_kwargs:s,response_metadata:u,id:t.id})}default:return new Un(e.content||"",e.role??"unknown")}},rg=({delta:e,rawResponse:t,includeRawResponse:r,defaultRole:o})=>{let n=e.role??o,i=e.content??"",a;e.function_call?a={function_call:e.function_call}:e.tool_calls?a={tool_calls:e.tool_calls}:a={},r&&(a.__raw_response=t),e.reasoning_content!==void 0&&(a.reasoning_content=e.reasoning_content),e.audio&&(a.audio={...e.audio,index:t.choices[0].index});let s={model_provider:"openai",usage:{...t.usage}};if(n==="user")return new ji({content:i,response_metadata:s});if(n==="assistant"){let u=[];if(Array.isArray(e.tool_calls))for(let c of e.tool_calls)u.push({name:c.function?.name,args:c.function?.arguments,id:c.id,index:c.index,type:"tool_call_chunk"});return new ut({content:i,tool_call_chunks:u,additional_kwargs:a,id:t.id,response_metadata:s})}else return n==="system"?new fn({content:i,response_metadata:s}):n==="developer"?new fn({content:i,response_metadata:s,additional_kwargs:{__openai_role__:"developer"}}):n==="function"?new Ni({content:i,additional_kwargs:a,name:e.name,response_metadata:s}):n==="tool"?new Ri({content:i,additional_kwargs:a,tool_call_id:e.tool_call_id,response_metadata:s}):new zi({content:i,role:n,response_metadata:s})},uA=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=hp(()=>{let[,r]=e.mimeType.split("/");return r==="wav"||r==="mp3"?r:"wav"});return{type:"input_audio",input_audio:{data:e.data.toString(),format:t}}}if(e.type==="file"){if(e.data){let t=os(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}}}},cA=({message:e,model:t})=>{let r=ho(e);if(r==="system"&&mo(t)&&(r="developer"),r==="developer")return{role:"developer",content:e.contentBlocks.filter(n=>n.type==="text")};if(r==="system")return{role:"system",content:e.contentBlocks.filter(n=>n.type==="text")};if(r==="assistant"){let n={role:"assistant",content:e.contentBlocks.filter(i=>i.type==="text")};return st.isInstance(e)&&e.tool_calls?.length?n.tool_calls=e.tool_calls.map(rp):e.additional_kwargs.tool_calls!=null&&(n.tool_calls=e.additional_kwargs.tool_calls),Array.isArray(n.content)&&n.content.length===0&&n.tool_calls!=null&&(n.content=null),n}else{if(r==="tool"&&Ar.isInstance(e))return{role:"tool",tool_call_id:e.tool_call_id,content:e.contentBlocks.filter(n=>n.type==="text")};if(r==="function")return{role:"function",name:e.name??"",content:e.contentBlocks.filter(n=>n.type==="text").join("")}}function*o(n){for(let i of n){i.type==="text"&&(yield{type:"text",text:i.text});let a=uA(i);a&&(yield a)}}return{role:"user",content:Array.from(o(e.contentBlocks))}},hs=({messages:e,model:t})=>e.flatMap(r=>{if("output_version"in r.response_metadata&&r.response_metadata?.output_version==="v1")return cA({message:r});let o=ho(r);o==="system"&&mo(t)&&(o="developer");let n=typeof r.content=="string"?r.content:r.content.flatMap(a=>ys(a)?_s(a,ip):typeof a=="object"&&a!==null&&"type"in a&&(a.type==="tool_use"||a.type==="tool_call"||a.type==="functionCall"||a.type==="reasoning"||a.type==="reasoning_content"||a.type==="thinking")?[]:a),i={role:o,content:n};return r.name!=null&&(i.name=r.name),r.additional_kwargs.function_call!=null&&(i.function_call=r.additional_kwargs.function_call),st.isInstance(r)&&r.tool_calls?.length?i.tool_calls=r.tool_calls.map(rp):(r.additional_kwargs.tool_calls!=null&&(i.tool_calls=r.additional_kwargs.tool_calls),Ar.isInstance(r)&&r.tool_call_id!=null&&(i.tool_call_id=r.tool_call_id)),r.additional_kwargs.audio&&typeof r.additional_kwargs.audio=="object"&&"id"in r.additional_kwargs.audio?[i,{role:"assistant",audio:{id:r.additional_kwargs.audio.id}}]:i});var Wpe=oe({convertOpenAICompletionsStream:()=>ap});async function*ap(e,t={}){let r=t.streamUsage??!0,o=t.provider??"openai",n=t.mapChunk,i=new Map,a=new Map,s=0,u=!1,c,l,d,p=!1,f=(h,y)=>{let _=a.get(h);if(_!==void 0)return{index:_,isNew:!1};let $=s++;return a.set(h,$),i.set($,{...y}),{index:$,isNew:!0}};for await(let h of e){n&&(h=n(h)),u||(u=!0,yield{event:"message-start",id:h.id}),!p&&(h.model||h.service_tier)&&(p=!0,yield{event:"provider",provider:o,name:"stream_metadata",payload:{model:h.model,service_tier:h.service_tier}}),h.usage&&r&&(c=K6(h.usage),yield{event:"usage",usage:c});let y=h.x_groq?.usage;y&&r&&(c=B6(y),yield{event:"usage",usage:c});let _=h.choices?.[0];if(!_)continue;_.finish_reason!=null&&(l=W6(_.finish_reason),d=V6(h,_));let{delta:$}=_;if(!$)continue;let v=F6($);if(v){let{index:x,isNew:S}=f("reasoning",{type:"reasoning",reasoning:""});S&&(yield{event:"content-block-start",index:x,content:{type:"reasoning",reasoning:""}});let C=i.get(x);C.reasoning=(C.reasoning??"")+v,yield{event:"content-block-delta",index:x,delta:{type:"reasoning-delta",reasoning:v}}}if($.content){let{index:x,isNew:S}=f("text",{type:"text",text:""});S&&(yield{event:"content-block-start",index:x,content:{type:"text",text:""}});let C=i.get(x);C.text=(C.text??"")+$.content,yield{event:"content-block-delta",index:x,delta:{type:"text-delta",text:$.content}}}if(Array.isArray($.tool_calls))for(let x of $.tool_calls){let S=x.index??0,{index:C,isNew:j}=f(`tool:${S}`,{type:"tool_call_chunk",id:x.id,name:x.function?.name,args:"",index:S});j&&(yield{event:"content-block-start",index:C,content:{type:"tool_call_chunk",id:x.id,name:x.function?.name,args:"",index:S}});let F=i.get(C);x.id!=null&&(F.id=x.id),x.function?.name!=null&&(F.name=x.function.name);let A=x.function?.arguments??"";F.args=(F.args??"")+A,yield{event:"content-block-delta",index:C,delta:{type:"block-delta",fields:{type:"tool_call_chunk",...F.id!=null?{id:F.id}:{},...F.name!=null?{name:F.name}:{},args:F.args}}}}if($.audio){let{index:x,isNew:S}=f("audio",{type:"audio",id:$.audio.id,data:"",mimeType:"audio/pcm",transcript:$.audio.transcript??""});S&&(yield{event:"content-block-start",index:x,content:{type:"audio",id:$.audio.id,data:"",mimeType:"audio/pcm",transcript:$.audio.transcript??""}});let C=i.get(x);$.audio.transcript&&(C.transcript=(C.transcript??"")+$.audio.transcript,yield{event:"content-block-delta",index:x,delta:{type:"block-delta",fields:{type:"audio",transcript:C.transcript}}}),$.audio.data&&(C.data=(C.data??"")+$.audio.data,yield{event:"content-block-delta",index:x,delta:{type:"data-delta",data:$.audio.data,encoding:"base64"}})}$.function_call&&(yield{event:"provider",provider:o,name:"function_call",payload:$.function_call}),_.logprobs&&(yield{event:"provider",provider:o,name:"logprobs",payload:_.logprobs})}for(let[h,y]of i)yield{event:"content-block-finish",index:h,content:Fc(y)};yield{event:"message-finish",reason:l,...c?{usage:c}:{},...d?{responseMetadata:d}:{}}}function F6(e){let t=e.reasoning_content??e.reasoning;return typeof t=="string"&&t.length>0?t:void 0}function B6(e){return{input_tokens:e.prompt_tokens??0,output_tokens:e.completion_tokens??0,total_tokens:e.total_tokens??0}}function W6(e){switch(e){case"stop":return"stop";case"length":case"max_tokens":return"length";case"tool_calls":case"function_call":return"tool_use";case"content_filter":return"content_filter";default:return"stop"}}function K6(e){let t={...e.prompt_tokens_details?.audio_tokens!=null&&{audio:e.prompt_tokens_details.audio_tokens},...e.prompt_tokens_details?.cached_tokens!=null&&{cache_read:e.prompt_tokens_details.cached_tokens}},r={...e.completion_tokens_details?.audio_tokens!=null&&{audio:e.completion_tokens_details.audio_tokens},...e.completion_tokens_details?.reasoning_tokens!=null&&{reasoning:e.completion_tokens_details.reasoning_tokens}};return{input_tokens:e.prompt_tokens??0,output_tokens:e.completion_tokens??0,total_tokens:e.total_tokens??0,...Object.keys(t).length>0&&{input_token_details:t},...Object.keys(r).length>0&&{output_token_details:r}}}function V6(e,t){return{model_provider:"openai",model_name:e.model,system_fingerprint:e.system_fingerprint,service_tier:e.service_tier,finish_reason:t.finish_reason,...e.usage?{usage:e.usage}:{}}}var ng=class extends ms{constructor(e,t){super(Bc(e,t))}invocationParams(e,t){let r;e?.strict!==void 0?r=e.strict:this.supportsStrictToolCalling!==void 0&&(r=this.supportsStrictToolCalling),!(this.streaming||t?.streaming)&&e?.response_format?.type==="json_schema"&&r!==!1&&(r=!0);let o={};e?.stream_options!==void 0?o={stream_options:e.stream_options}:this.streamUsage&&(this.streaming||t?.streaming)&&(o={stream_options:{include_usage:!0}});let n={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(a=>this._convertChatOpenAIToolToCompletionsTool(a,{strict:r})):void 0,tool_choice:jh(e?.tool_choice),response_format:this._getResponseFormat(e?.response_format),seed:e?.seed,...o,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&&(n.prediction=e.prediction),this.service_tier!==void 0&&(n.service_tier=this.service_tier),e?.service_tier!==void 0&&(n.service_tier=e.service_tier);let i=this._getReasoningParams(e);return i!==void 0&&i.effort!==void 0&&(n.reasoning_effort=i.effort),mo(n.model)?n.max_completion_tokens=this.maxTokens===-1?void 0:this.maxTokens:n.max_tokens=this.maxTokens===-1?void 0:this.maxTokens,n}async _generate(e,t,r){t.signal?.throwIfAborted();let o={},n=this.invocationParams(t),i=hs({messages:e,model:this.model});if(n.stream){let a=this._streamResponseChunks(e,t,r),s={};for await(let f of a){f.message.response_metadata={...f.generationInfo,...f.message.response_metadata};let h=f.generationInfo?.completion??0;s[h]===void 0?s[h]=f:s[h]=s[h].concat(f)}let u=Object.entries(s).sort(([f],[h])=>parseInt(f,10)-parseInt(h,10)).map(([f,h])=>h),{functions:c,function_call:l}=this.invocationParams(t),d=await this._getEstimatedTokenCountFromPrompt(e,c,l),p=await this._getNumTokensFromGenerations(u);return o.input_tokens=d,o.output_tokens=p,o.total_tokens=d+p,{generations:u,llmOutput:{estimatedTokenUsage:{promptTokens:o.input_tokens,completionTokens:o.output_tokens,totalTokens:o.total_tokens}}}}else{let a=await this.completionWithRetry({...n,stream:!1,messages:i},{signal:t?.signal,maxRetries:t?.maxRetries,...t?.options}),{completion_tokens:s,prompt_tokens:u,total_tokens:c,prompt_tokens_details:l,completion_tokens_details:d}=a?.usage??{};s&&(o.output_tokens=(o.output_tokens??0)+s),u&&(o.input_tokens=(o.input_tokens??0)+u),c&&(o.total_tokens=(o.total_tokens??0)+c),(l?.audio_tokens!==null||l?.cached_tokens!==null||l?.cache_write_tokens!=null)&&(o.input_token_details={...l?.audio_tokens!==null&&{audio:l?.audio_tokens},...l?.cached_tokens!==null&&{cache_read:l?.cached_tokens},...l?.cache_write_tokens!=null&&{cache_creation:l?.cache_write_tokens}}),(d?.audio_tokens!==null||d?.reasoning_tokens!==null)&&(o.output_token_details={...d?.audio_tokens!==null&&{audio:d?.audio_tokens},...d?.reasoning_tokens!==null&&{reasoning:d?.reasoning_tokens}});let p=[];for(let f of a?.choices??[]){let h={text:f.message?.content??"",message:this._convertCompletionsMessageToBaseMessage(f.message??{role:"assistant"},a)};h.generationInfo={...f.finish_reason?{finish_reason:f.finish_reason}:{},...f.logprobs?{logprobs:f.logprobs}:{}},wo(h.message)&&(h.message.usage_metadata=o),h.message=new st(Object.fromEntries(Object.entries(h.message).filter(([y])=>!y.startsWith("lc_")))),p.push(h)}return{generations:p,llmOutput:{tokenUsage:{promptTokens:o.input_tokens,completionTokens:o.output_tokens,totalTokens:o.total_tokens}}}}}async*_streamChatModelEvents(e,t,r){let o=hs({messages:e,model:this.model}),n={...this.invocationParams(t,{streaming:!0}),messages:o,stream:!0},i=await this.completionWithRetry(n,t),a=this.streamUsage??t.streamUsage;yield*ap(async function*(u,c){for await(let l of u){if(c?.aborted)return;yield l}}(i,t.signal),{streamUsage:a??!0,provider:this.streamEventProvider})}get streamEventProvider(){return"openai"}async*_streamResponseChunks(e,t,r){let o=hs({messages:e,model:this.model}),n={...this.invocationParams(t,{streaming:!0}),messages:o,stream:!0},i,a=await this.completionWithRetry(n,t),s;for await(let u of a){if(t.signal?.aborted)return;let c=u?.choices?.[0];if(u.usage&&(s=u.usage),!c)continue;let{delta:l}=c;if(!l)continue;let d=this._convertCompletionsDeltaToBaseMessageChunk(l,u,i);i=l.role??i;let p={prompt:t.promptIndex??0,completion:c.index??0};if(typeof d.content!="string"){console.log("[WARNING]: Received non-string content from OpenAI. This is currently not supported.");continue}let f={...p};c.finish_reason!=null&&(f.finish_reason=c.finish_reason,f.system_fingerprint=u.system_fingerprint,f.model_name=u.model,f.service_tier=u.service_tier),this.logprobs&&(f.logprobs=c.logprobs);let h=new Xn({message:d,text:d.content,generationInfo:f});yield h,await r?.handleLLMNewToken(h.text??"",p,void 0,void 0,void 0,{chunk:h})}if(s){let u={...s.prompt_tokens_details?.audio_tokens!==null&&{audio:s.prompt_tokens_details?.audio_tokens},...s.prompt_tokens_details?.cached_tokens!==null&&{cache_read:s.prompt_tokens_details?.cached_tokens},...s.prompt_tokens_details?.cache_write_tokens!=null&&{cache_creation:s.prompt_tokens_details?.cache_write_tokens}},c={...s.completion_tokens_details?.audio_tokens!==null&&{audio:s.completion_tokens_details?.audio_tokens},...s.completion_tokens_details?.reasoning_tokens!==null&&{reasoning:s.completion_tokens_details?.reasoning_tokens}},l=new Xn({message:new ut({content:"",response_metadata:{usage:{...s}},usage_metadata:{input_tokens:s.prompt_tokens,output_tokens:s.completion_tokens,total_tokens:s.total_tokens,...Object.keys(u).length>0&&{input_token_details:u},...Object.keys(c).length>0&&{output_token_details:c}}}),text:""});yield l,await r?.handleLLMNewToken(l.text??"",{prompt:0,completion:0},void 0,void 0,void 0,{chunk:l})}if(t.signal?.aborted)throw new Error("AbortError")}async completionWithRetry(e,t){let{maxRetries:r,...o}=t??{},n=this._getClientOptions(o),i=e.response_format&&e.response_format.type==="json_schema";return this.caller.callWithOptions({maxRetries:r},async()=>{try{return i&&!e.stream?await this.client.chat.completions.parse(e,n):await this.client.chat.completions.create(e,n)}catch(a){throw Wr(a)}})}_convertCompletionsDeltaToBaseMessageChunk(e,t,r){return rg({delta:e,rawResponse:t,includeRawResponse:this.__includeRawResponse,defaultRole:r})}_convertCompletionsMessageToBaseMessage(e,t){return tg({message:e,rawResponse:t,includeRawResponse:this.__includeRawResponse})}};var og="__openai_function_call_ids__",ig="__openai_custom_tool_call_ids__";function pC(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 J6(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 Wc=e=>{let t={...e?.input_tokens_details?.cached_tokens!=null&&{cache_read:e?.input_tokens_details?.cached_tokens},...e?.input_tokens_details?.cache_write_tokens!=null&&{cache_creation:e?.input_tokens_details?.cache_write_tokens}},r={...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:r}},sp=e=>{if(e.error){let s=new Error(e.error.message);throw s.name=e.error.code,s}let t=[],r=[],o=[],n=e.output.map(s=>{if(s.type==="function_call"&&"parsed_arguments"in s){let u={...s};return delete u.parsed_arguments,u}return s}),i={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:n,status:e.status,user:e.user,service_tier:e.service_tier,model_name:e.model},a={};for(let s of e.output)if(s.type==="message")t.push(...s.content.flatMap(u=>u.type==="output_text"?("parsed"in u&&u.parsed!=null&&(a.parsed=u.parsed),{type:"text",text:u.text,annotations:u.annotations.map(pC),...s.phase!==null?{phase:s.phase}:{}}):u.type==="refusal"?(a.refusal=u.refusal,[]):u));else if(s.type==="function_call"){let u={function:{name:s.name,arguments:s.arguments},id:s.call_id};try{r.push(fs(u,{returnId:!0}))}catch(c){let l;typeof c=="object"&&c!=null&&"message"in c&&typeof c.message=="string"&&(l=c.message),o.push(Ti(u,l))}a[og]??={},s.id&&(a[og][s.call_id]=s.id)}else if(s.type==="reasoning"){a.reasoning=s;let u=s.summary?.map(c=>c.text).filter(Boolean).join("");u&&t.push({type:"reasoning",reasoning:u})}else if(s.type==="custom_tool_call"){let u=SE(s);u?(r.push(u),a[ig]??={},s.id&&s.call_id&&(a[ig][s.call_id]=s.id)):o.push(Ti(s,"Malformed custom tool call"))}else if(s.type==="computer_call"){let u=OE(s);u?r.push(u):o.push(Ti(s,"Malformed computer call"))}else s.type==="image_generation_call"?(s.result&&t.push({type:"image",mimeType:"image/png",data:s.result,id:s.id,metadata:{status:s.status}}),a.tool_outputs??=[],a.tool_outputs.push(s)):(a.tool_outputs??=[],a.tool_outputs.push(s));return new st({id:e.id,content:t,tool_calls:r,invalid_tool_calls:o,usage_metadata:Wc(e.usage),additional_kwargs:a,response_metadata:i})},lA=e=>{let t=(e.summary.length>1?e.summary.reduce((r,o)=>{let n=r[r.length-1];return n.index===o.index?n.text+=o.text:r.push(o),r},[{...e.summary[0]}]):e.summary).map(r=>Object.fromEntries(Object.entries(r).filter(([o])=>o!=="index")));return{...e,summary:t}},ag=e=>{let t=[],r={},o,n=[],i={model_provider:"openai"},a={},s;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:[pC(e.annotation)],index:e.content_index});else if(e.type==="response.output_item.added"&&e.item.type==="message"){let u="phase"in e.item?e.item.phase:void 0;u&&t.push({type:"text",text:"",phase:u,index:0})}else if(e.type==="response.output_item.added"&&e.item.type==="function_call")n.push({type:"tool_call_chunk",name:e.item.name,args:e.item.arguments,id:e.item.call_id,index:e.output_index}),a[og]={[e.item.call_id]:e.item.id};else if(e.type==="response.output_item.added"&&e.item.type==="custom_tool_call")n.push({type:"tool_call_chunk",isCustomTool:!0,name:e.item.name,args:e.item.input,id:e.item.call_id,index:e.output_index}),a[ig]={[e.item.call_id]:e.item.id};else if(e.type==="response.output_item.done"&&e.item.type==="reasoning"&&e.item.encrypted_content)a.reasoning={encrypted_content:e.item.encrypted_content};else if(e.type==="response.output_item.done"&&e.item.type==="computer_call")n.push({type:"tool_call_chunk",name:"computer_use",args:JSON.stringify({action:e.item.action}),id:e.item.call_id,index:e.output_index}),a.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}}),a.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))a.tool_outputs=[e.item];else if(e.type==="response.created")s=e.response.id,i.id=e.response.id,i.model_name=e.response.model,i.model=e.response.model;else if(e.type==="response.completed"||e.type==="response.incomplete"){s=e.response.id;let u=sp(e.response);if(o=Wc(e.response.usage),e.response.text?.format?.type==="json_schema"&&u.text)try{a.parsed??=JSON.parse(u.text)}catch{}for(let[c,l]of Object.entries(e.response))c!=="id"&&(c==="output"?i[c]=u.response_metadata.output:i[c]=l)}else if(e.type==="response.function_call_arguments.delta"||e.type==="response.custom_tool_call_input.delta")n.push({type:"tool_call_chunk",args:e.delta,index:e.output_index,...e.type==="response.custom_tool_call_input.delta"?{isCustomTool:!0}:{}});else if(e.type==="response.web_search_call.in_progress"||e.type==="response.web_search_call.searching"||e.type==="response.web_search_call.completed"||e.type==="response.file_search_call.in_progress"||e.type==="response.file_search_call.searching"||e.type==="response.file_search_call.completed"||e.type==="response.image_generation_call.in_progress"||e.type==="response.image_generation_call.generating"||e.type==="response.image_generation_call.completed"){let[,u,c]=e.type.match(/^response\.(.*)\.([^.]+)$/)??["","",""];r={tool_outputs:{id:e.item_id,type:u,status:c}}}else if(e.type==="response.refusal.done")a.refusal=e.refusal;else if(e.type==="response.output_item.added"&&"item"in e&&e.item.type==="reasoning"){let u=e.item.summary?e.item.summary.map((l,d)=>({...l,index:d})):void 0;a.reasoning={id:e.item.id,type:e.item.type,...u?{summary:u}:{}};let c=e.item.summary?.map(l=>l.text).filter(Boolean).join("");c&&t.push({type:"reasoning",reasoning:c})}else if(e.type==="response.reasoning_summary_part.added")a.reasoning={type:"reasoning",summary:[{...e.part,index:e.summary_index}]},e.part.text&&t.push({type:"reasoning",reasoning:e.part.text,index:e.summary_index});else if(e.type==="response.reasoning_summary_text.delta")a.reasoning={type:"reasoning",summary:[{text:e.delta,type:"summary_text",index:e.summary_index}]},e.delta&&t.push({type:"reasoning",reasoning:e.delta,index:e.summary_index});else return e.type==="response.image_generation_call.partial_image",null;return new Xn({text:t.map(u=>u.text).join(""),message:new ut({id:s,content:t,tool_call_chunks:n,usage_metadata:o,additional_kwargs:a,response_metadata:i}),generationInfo:r})},dA=e=>{let t=st.isInstance(e)&&e.response_metadata?.model_provider==="openai";function*r(){let o=sn(()=>{try{let v=ho(e);return v==="system"||v==="developer"||v==="assistant"||v==="user"?v:"assistant"}catch{return"assistant"}}),n=v=>o==="assistant"?{type:"output_text",text:v,annotations:[]}:{type:"input_text",text:v},i,a=new Set,s=new Set,u=new Map,c=new Map;function*l(){if(!i)return;let v=i.content;(typeof v=="string"&&v.length>0||Array.isArray(v)&&v.length>0)&&(yield i),i=void 0}let d=(v,x)=>{i||(i={type:"message",role:o,content:[],...x?{phase:x}:{}}),typeof i.content=="string"?i.content=i.content.length>0?[n(i.content),...v]:[...v]:i.content.push(...v)},p=v=>{if(typeof v=="string")return v;try{return JSON.stringify(v??{})}catch{return"{}"}},f=v=>{let x=sn(()=>{let S=v.metadata?.detail;return S==="low"||S==="high"||S==="auto"?S:"auto"});if(v.fileId)return{type:"input_image",detail:x,file_id:v.fileId};if(v.url)return{type:"input_image",detail:x,image_url:v.url};if(v.data){let S=typeof v.data=="string"?v.data:Buffer.from(v.data).toString("base64");return{type:"input_image",detail:x,image_url:`data:${v.mimeType??"image/png"};base64,${S}`}}},h=v=>{if(v.fileId){let x=Ch(v);return{type:"input_file",file_id:v.fileId,...x?{filename:x}:{}}}if(v.url){let x=Ch(v);return{...x?{filename:x}:{},type:"input_file",file_url:v.url}}if(v.data){let x=os(v),S=typeof v.data=="string"?v.data:Buffer.from(v.data).toString("base64");return{type:"input_file",file_data:`data:${v.mimeType??"application/octet-stream"};base64,${S}`,filename:x}}},y=v=>{let x=sn(()=>{if(Array.isArray(v.summary)){let C=v.summary?.map(j=>j?.text).filter(j=>typeof j=="string")??[];if(C.length>0)return C}return v.reasoning?[v.reasoning]:[]}),S=x.length>0?x.map(C=>({type:"summary_text",text:C})):[{type:"summary_text",text:""}];return{type:"reasoning",...v.id?{id:v.id}:{},summary:S}},_=v=>({type:"function_call",name:v.name??"",call_id:v.id??"",arguments:p(v.args)}),$=v=>{let x=p(v.output),S=v.status==="success"?"completed":v.status==="error"?"incomplete":void 0;return{type:"function_call_output",call_id:v.toolCallId??"",output:x,...S?{status:S}:{}}};for(let v of e.contentBlocks)if(v.type==="text"){let x=sn(()=>{if("extras"in v&&typeof v.extras=="object"&&v.extras!==null&&"phase"in v.extras)return v.extras.phase});d([n(v.text)],x)}else if(v.type!=="invalid_tool_call"){if(v.type==="reasoning")yield*l(),yield y(v);else if(v.type==="tool_call"){yield*l();let x=v.id??"";x&&(a.add(x),u.delete(x)),yield _(v)}else if(v.type==="tool_call_chunk"){if(v.id){let x=u.get(v.id)??{name:v.name,args:[]};v.name&&(x.name=v.name),v.args&&x.args.push(v.args),u.set(v.id,x)}}else if(v.type==="server_tool_call"){yield*l();let x=v.id??"";x&&(s.add(x),c.delete(x)),yield _(v)}else if(v.type==="server_tool_call_chunk"){if(v.id){let x=c.get(v.id)??{name:v.name,args:[]};v.name&&(x.name=v.name),v.args&&x.args.push(v.args),c.set(v.id,x)}}else if(v.type==="server_tool_call_result")yield*l(),yield $(v);else if(v.type!=="audio")if(v.type==="file"){let x=h(v);x&&d([x])}else if(v.type==="image"){let x=f(v);x&&d([x])}else if(v.type==="video"){let x=h(v);x&&d([x])}else v.type==="text-plain"?v.text&&d([n(v.text)]):v.type==="non_standard"&&t&&(yield*l(),yield v.value)}yield*l();for(let[v,x]of u){if(!v||a.has(v))continue;let S=x.args.join("");!x.name&&!S||(yield{type:"function_call",call_id:v,name:x.name??"",arguments:S})}for(let[v,x]of c){if(!v||s.has(v))continue;let S=x.args.join("");!x.name&&!S||(yield{type:"function_call",call_id:v,name:x.name??"",arguments:S})}}return Array.from(r())},Kc=({messages:e,zdrEnabled:t,model:r})=>e.flatMap(o=>{let n=o.response_metadata;if(n?.output_version==="v1")return dA(o);let i=o.additional_kwargs,a=ho(o);if(a==="system"&&mo(r)&&(a="developer"),a==="function")throw new Error("Function messages are not supported in Responses API");if(a==="tool"){let s=o;if(i?.type==="computer_call_output")return{type:"computer_call_output",output:(()=>{if(typeof s.content=="string")return{type:"input_image",image_url:s.content};if(Array.isArray(s.content)){let c=s.content.find(p=>p.type==="input_image");if(c)return c;let l=s.content.find(p=>p.type==="computer_screenshot");if(l)return l;let d=s.content.find(p=>p.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:s.tool_call_id};if(s.additional_kwargs?.customTool)return{type:"custom_tool_call_output",call_id:s.tool_call_id,output:s.content};let u=Array.isArray(s.content)&&s.content.every(c=>typeof c=="object"&&c!==null&&"type"in c&&(c.type==="input_file"||c.type==="input_image"||c.type==="input_text"));return{type:"function_call_output",call_id:s.tool_call_id,id:s.id?.startsWith("fc_")?s.id:void 0,output:u?s.content:typeof s.content!="string"?JSON.stringify(s.content):s.content}}if(a==="assistant"){if(!t&&n?.output!=null&&Array.isArray(n?.output)&&n?.output.length>0&&n?.output.every(y=>"type"in y))return n?.output;let s=[],u=i?.reasoning,c=!!u?.encrypted_content;if(u&&(!t||c)){let y=lA(u);s.push(y)}let{content:l}=o;if(i?.refusal&&(typeof l=="string"&&(l=[{type:"output_text",text:l,annotations:[]}]),l=[...l,{type:"refusal",refusal:i.refusal}]),typeof l=="string"||l.length>0){let y={type:"message",role:"assistant",...o.id&&!t&&o.id.startsWith("msg_")?{id:o.id}:{},content:sn(()=>typeof l=="string"?l:l.flatMap(_=>{if(_.type==="text"){let $=_;return{type:"output_text",text:$.text,annotations:($.annotations??[]).map(J6)}}return _.type==="output_text"||_.type==="refusal"?_:[]})),phase:sn(()=>{if(Array.isArray(l))return l.find(_=>"phase"in _&&typeof _.phase=="string")?.phase})};s.push(y)}let d=i?.[og],p=i?.[ig];st.isInstance(o)&&o.tool_calls?.length?s.push(...o.tool_calls.map(y=>TE(y,p)?{type:"custom_tool_call",id:"call_id"in y&&typeof y.call_id=="string"?y.call_id:p?.[y.id??""]??"",call_id:y.id??"",input:y.args.input,name:y.name}:PE(y)?{type:"computer_call",id:y.call_id,call_id:y.id??"",action:y.args.action}:{type:"function_call",name:y.name,arguments:JSON.stringify(y.args),call_id:y.id,...t?{}:{id:d?.[y.id]}})):i?.tool_calls&&s.push(...i.tool_calls.map(y=>({type:"function_call",name:y.function.name,call_id:y.id,arguments:y.function.arguments,...t?{}:{id:d?.[y.id]}})));let f=n?.output?.length?n?.output:i.tool_outputs,h=["computer_call","mcp_call","code_interpreter_call","image_generation_call","shell_call","local_shell_call"];if(f!=null){let y=f?.filter(_=>h.includes(_.type));y.length>0&&s.push(...y)}return s}if(a==="user"||a==="system"||a==="developer"){if(typeof o.content=="string")return{type:"message",role:a,content:o.content};let s=[],u=o.content.flatMap(c=>{if(c.type==="mcp_approval_response"&&s.push({type:"mcp_approval_response",approval_request_id:c.approval_request_id,approve:c.approve}),ys(c)){if(c.type==="file"){let l=Ch(c);if(c.source_type==="url")return{type:"input_file",file_url:c.url,...l?{filename:l}:{}};if(c.source_type==="id")return{type:"input_file",file_id:c.id,...l?{filename:l}:{}};if(c.source_type==="base64")return{type:"input_file",file_data:`data:${c.mime_type??""};base64,${c.data}`,filename:os(c)}}return _s(c,ip)}return c.type==="text"?{type:"input_text",text:c.text}:c.type==="image_url"?{type:"input_image",image_url:sn(()=>{if(typeof c.image_url=="string")return c.image_url;if(typeof c.image_url=="object"&&c.image_url!==null&&"url"in c.image_url)return c.image_url.url}),detail:sn(()=>{if(typeof c.image_url=="string")return"auto";if(typeof c.image_url=="object"&&c.image_url!==null&&"detail"in c.image_url)return c.image_url.detail})}:c.type==="input_text"||c.type==="input_image"||c.type==="input_file"?c:[]});return u.length>0&&s.push({type:"message",role:a,content:u}),s}return console.warn(`Unsupported role found when converting to OpenAI Responses API: ${a}`),[]});async function*pA(e,t={}){let r=t.streamUsage??!0,o=t.provider??"openai",n=new Map,i=new Map,a=0,s=!1,u,c,l,d,p=new Set,f=(_,$)=>{let v=i.get(_);if(v!==void 0)return{index:v,isNew:!1};let x=a++;return i.set(_,x),n.set(x,{...$}),{index:x,isNew:!0}},h=function*(){s||(s=!0,yield{event:"message-start",id:u})},y=function*(_){if(p.has(_))return;let $=n.get(_);$&&(p.add(_),yield{event:"content-block-finish",index:_,content:Fc($)})};for await(let _ of e){if(_.type==="response.created"){u=_.response.id,yield*h(),yield{event:"provider",provider:o,name:"response.created",payload:{model:_.response.model,id:_.response.id}};continue}if(_.type==="response.output_text.delta"){yield*h();let{index:$,isNew:v}=f(`text:${_.output_index}:${_.content_index}`,{type:"text",text:""});v&&(yield{event:"content-block-start",index:$,content:{type:"text",text:""}});let x=n.get($);x.text=(x.text??"")+_.delta,yield{event:"content-block-delta",index:$,delta:{type:"text-delta",text:_.delta}};continue}if(_.type==="response.reasoning_summary_text.delta"){yield*h();let{index:$,isNew:v}=f(`reasoning:${_.output_index}:${_.summary_index}`,{type:"reasoning",reasoning:""});v&&(yield{event:"content-block-start",index:$,content:{type:"reasoning",reasoning:""}});let x=n.get($);x.reasoning=(x.reasoning??"")+_.delta,yield{event:"content-block-delta",index:$,delta:{type:"reasoning-delta",reasoning:_.delta}};continue}if(_.type==="response.output_item.added"&&(_.item.type==="function_call"||_.item.type==="custom_tool_call")){yield*h();let $=`tool:${_.output_index}`,v=_.item.type==="custom_tool_call",x=_.item.type==="function_call"?_.item.arguments??"":_.item.input??"",{index:S,isNew:C}=f($,{type:"tool_call_chunk",id:_.item.call_id,name:_.item.name,args:x,index:_.output_index,...v?{isCustomTool:!0}:{}});if(C&&(yield{event:"content-block-start",index:S,content:{type:"tool_call_chunk",id:_.item.call_id,name:_.item.name,args:x,index:_.output_index}}),x){let j=n.get(S);yield{event:"content-block-delta",index:S,delta:{type:"block-delta",fields:{type:"tool_call_chunk",...j.id!=null?{id:j.id}:{},...j.name!=null?{name:j.name}:{},args:j.args}}}}continue}if(_.type==="response.function_call_arguments.delta"||_.type==="response.custom_tool_call_input.delta"){yield*h();let{index:$,isNew:v}=f(`tool:${_.output_index}`,{type:"tool_call_chunk",args:"",index:_.output_index,..._.type==="response.custom_tool_call_input.delta"?{isCustomTool:!0}:{}});v&&(yield{event:"content-block-start",index:$,content:{type:"tool_call_chunk",args:"",index:_.output_index}});let x=n.get($);x.args=(x.args??"")+_.delta,yield{event:"content-block-delta",index:$,delta:{type:"block-delta",fields:{type:"tool_call_chunk",...x.id!=null?{id:x.id}:{},...x.name!=null?{name:x.name}:{},args:x.args}}};continue}if(_.type==="response.output_item.done"&&(_.item.type==="function_call"||_.item.type==="custom_tool_call")){yield*h();let $=`tool:${_.output_index}`,v=_.item.type==="function_call"?_.item.arguments??"":_.item.input??"",{index:x,isNew:S}=f($,{type:"tool_call_chunk",id:_.item.call_id,name:_.item.name,args:v,index:_.output_index});if(S)yield{event:"content-block-start",index:x,content:{type:"tool_call_chunk",id:_.item.call_id,name:_.item.name,args:v,index:_.output_index}};else{let C=n.get(x);C.args=v,C.id=_.item.call_id,C.name=_.item.name}yield*y(x);continue}if(_.type==="response.completed"||_.type==="response.incomplete"){yield*h(),u=_.response.id,l=H6(_.response.status,_.type),d={model_provider:o,id:_.response.id,model:_.response.model,status:_.response.status},r&&_.response.usage&&(c=Wc(_.response.usage),yield{event:"usage",usage:c});continue}_.type!=="response.image_generation_call.partial_image"&&(yield*h(),yield{event:"provider",provider:o,name:_.type,payload:_})}s||(yield{event:"message-start"});for(let[_]of n)p.has(_)||(yield*y(_));yield{event:"message-finish",reason:l,...c?{usage:c}:{},...d?{responseMetadata:d}:{}}}function H6(e,t){return t==="response.incomplete"?"length":e==="completed"?"stop":e==="incomplete"?"length":"stop"}var sg=class extends ms{constructor(e,t){super(Bc(e,t))}invocationParams(e){let t;e?.strict!==void 0&&(t=e.strict),t===void 0&&this.supportsStrictToolCalling!==void 0&&(t=this.supportsStrictToolCalling);let r={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:$E(e?.tool_choice)?e?.tool_choice:(()=>{let n=jh(e?.tool_choice);if(typeof n=="object"&&"type"in n){if(n.type==="function")return{type:"function",name:n.function.name};if(n.type==="allowed_tools")return{type:"allowed_tools",mode:n.allowed_tools.mode,tools:n.allowed_tools.tools};if(n.type==="custom")return{type:"custom",name:n.custom.name}}})(),text:(()=>{if(e?.text)return e.text;let n=this._getResponseFormat(e?.response_format);return n?.type==="json_schema"?n.json_schema.schema!=null?{format:{type:"json_schema",schema:n.json_schema.schema,description:n.json_schema.description,name:n.json_schema.name,strict:n.json_schema.strict},verbosity:e?.verbosity}:void 0:{format:n,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},o=this._getReasoningParams(e);return o!==void 0&&(r.reasoning=o),r}async _generate(e,t,r){t.signal?.throwIfAborted();let o=this.invocationParams(t);if(o.stream){let n=this._streamResponseChunks(e,t,r),i;for await(let a of n)a.message.response_metadata={...a.generationInfo,...a.message.response_metadata},i=i?.concat(a)??a;return{generations:i?[i]:[],llmOutput:{estimatedTokenUsage:i?.message?.usage_metadata}}}else{let n=await this.completionWithRetry({input:Kc({messages:e,zdrEnabled:this.zdrEnabled??!1,model:this.model}),...o,stream:!1},{signal:t?.signal,maxRetries:t?.maxRetries,...t?.options});return{generations:[{text:n.output_text,message:sp(n)}],llmOutput:{id:n.id,estimatedTokenUsage:n.usage?{promptTokens:n.usage.input_tokens,completionTokens:n.usage.output_tokens,totalTokens:n.usage.total_tokens}:void 0}}}}async*_streamChatModelEvents(e,t,r){let o=await this.completionWithRetry({...this.invocationParams(t),input:Kc({messages:e,zdrEnabled:this.zdrEnabled??!1,model:this.model}),stream:!0},t),n=this.streamUsage??t.streamUsage;yield*pA(async function*(a,s){for await(let u of a){if(s?.aborted)return;yield u}}(o,t.signal),{streamUsage:n??!0,provider:this.streamEventProvider})}get streamEventProvider(){return"openai"}async*_streamResponseChunks(e,t,r){let o=await this.completionWithRetry({...this.invocationParams(t),input:Kc({messages:e,zdrEnabled:this.zdrEnabled??!1,model:this.model}),stream:!0},t);try{for await(let n of o){if(t.signal?.aborted)return;let i=ag(n);i!=null&&(yield i,await r?.handleLLMNewToken(i.text||"",{prompt:t.promptIndex??0,completion:0},void 0,void 0,void 0,{chunk:i}))}}catch(n){throw Wr(n)}}async completionWithRetry(e,t){let{maxRetries:r,...o}=t??{},n=this._getClientOptions(o);return this.caller.callWithOptions({maxRetries:r},async()=>{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(i){throw Wr(i)}})}_reduceChatOpenAITools(e,t){let r=[];for(let o of e)if(zc(o))o.type==="image_generation"&&t?.stream&&(o.partial_images=1),r.push(o);else if(is(o)){let n=o.metadata.customTool;r.push({type:"custom",name:n.name,description:n.description,format:n.format})}else if(Dl(o)){let n={};for(let[i,a]of Object.entries(o))i!=="type"&&i!=="function"&&(n[i]=a);r.push({type:"function",name:o.function.name,parameters:o.function.parameters,description:o.function.description,strict:t?.strict??null,...n})}else Dh(o)&&r.push(EE(o));return r}};var fC=class mC extends ms{useResponsesApi=!1;responses;completions;get lc_serializable_keys(){return[...super.lc_serializable_keys,"useResponsesApi"]}get callKeys(){return[...super.callKeys,"useResponsesApi"]}fields;constructor(t,r){let o=Bc(t,r);super(o),this.fields=o,this.useResponsesApi=o?.useResponsesApi??!1,this.responses=o?.responses??new sg(o),this.completions=o?.completions??new ng(o)}_useResponsesApi(t){let r=t?.tools?.some(zc),o=t?.previous_response_id!=null||t?.text!=null||t?.truncation!=null||t?.include!=null||t?.reasoning?.summary!=null||this.reasoning?.summary!=null,n=t?.tools?.some(Dh)||t?.tools?.some(is);return this.useResponsesApi||r||o||n||yE(this.model)}getLsParams(t){let r=this._combineCallOptions(t);return this._useResponsesApi(t)?this.responses.getLsParams(r):this.completions.getLsParams(r)}invocationParams(t){let r=this._combineCallOptions(t);return this._useResponsesApi(t)?this.responses.invocationParams(r):this.completions.invocationParams(r)}async _generate(t,r,o){return this._useResponsesApi(r)?this.responses._generate(t,r,o):this.completions._generate(t,r,o)}async*_streamChatModelEvents(t,r,o){if(this._useResponsesApi(r)){yield*this.responses._streamChatModelEvents(t,this._combineCallOptions(r),o);return}yield*this.completions._streamChatModelEvents(t,this._combineCallOptions(r),o)}async*_streamResponseChunks(t,r,o){if(this._useResponsesApi(r)){yield*this.responses._streamResponseChunks(t,this._combineCallOptions(r),o);return}yield*this.completions._streamResponseChunks(t,this._combineCallOptions(r),o)}withConfig(t){let r=new mC(this.fields);return r.defaultOptions={...this.defaultOptions,...t},r}};var Hfe=oe({BaseLLM:()=>fA,LLM:()=>Y6}),fA=class up extends Ml{lc_namespace=["langchain","llms",this._llmType()];async invoke(t,r){let o=up._convertInputToPromptValue(t);return(await this.generatePrompt([o],r,r?.callbacks)).generations[0][0].text}async*_streamResponseChunks(t,r,o){throw new Error("Not implemented.")}_separateRunnableConfigFromCallOptionsCompat(t){let[r,o]=super._separateRunnableConfigFromCallOptions(t);return o.signal=r.signal,[r,o]}async*_streamIterator(t,r){if(this._streamResponseChunks===up.prototype._streamResponseChunks)yield this.invoke(t,r);else{let o=up._convertInputToPromptValue(t),[n,i]=this._separateRunnableConfigFromCallOptionsCompat(r),a=this.invocationParams(i),s=await mn.configure(n.callbacks,this.callbacks,n.tags,this.tags,n.metadata,this.metadata,{verbose:this.verbose,tracerInheritableMetadata:this._filterInvocationParamsForTracing(a)}),u={options:i,invocation_params:a,batch_size:1},c=await s?.handleLLMStart(this.toJSON(),[o.toString()],n.runId,void 0,u,void 0,void 0,n.runName),l=new $n({text:""});try{for await(let d of this._streamResponseChunks(o.toString(),i,c?.[0]))l?l=l.concat(d):l=d,typeof d.text=="string"&&(yield d.text)}catch(d){throw await Promise.all((c??[]).map(p=>p?.handleLLMError(d))),d}await Promise.all((c??[]).map(d=>d?.handleLLMEnd({generations:[[l]]})))}}async generatePrompt(t,r,o){let n=t.map(i=>i.toString());return this.generate(n,r,o)}invocationParams(t){return{}}_flattenLLMResult(t){let r=[];for(let o=0;o<t.generations.length;o+=1){let n=t.generations[o];if(o===0)r.push({generations:[n],llmOutput:t.llmOutput});else{let i=t.llmOutput?{...t.llmOutput,tokenUsage:{}}:void 0;r.push({generations:[n],llmOutput:i})}}return r}async _generateUncached(t,r,o,n){let i;if(n!==void 0&&n.length===t.length)i=n;else{let c=this.invocationParams(r),l=await mn.configure(o.callbacks,this.callbacks,o.tags,this.tags,o.metadata,this.metadata,{verbose:this.verbose,tracerInheritableMetadata:this._filterInvocationParamsForTracing(c)}),d={options:r,invocation_params:c,batch_size:t.length};i=await l?.handleLLMStart(this.toJSON(),t,o.runId,void 0,d,void 0,void 0,o?.runName)}let a=!!i?.[0].handlers.find(_p),s;if(a&&t.length===1&&this._streamResponseChunks!==up.prototype._streamResponseChunks)try{let c=await this._streamResponseChunks(t[0],r,i?.[0]),l;for await(let d of c)l===void 0?l=d:l=yr(l,d);if(l===void 0)throw new Error("Received empty response from chat model call.");s={generations:[[l]],llmOutput:{}},await i?.[0].handleLLMEnd(s)}catch(c){throw await i?.[0].handleLLMError(c),c}else{try{s=await this._generate(t,r,i?.[0])}catch(l){throw await Promise.all((i??[]).map(d=>d?.handleLLMError(l))),l}let c=this._flattenLLMResult(s);await Promise.all((i??[]).map((l,d)=>l?.handleLLMEnd(c[d])))}let u=i?.map(c=>c.runId)||void 0;return Object.defineProperty(s,ma,{value:u?{runIds:u}:void 0,configurable:!0}),s}async _generateCached({prompts:t,cache:r,llmStringKey:o,parsedOptions:n,handledOptions:i,runId:a}){let s=this.invocationParams(n),u=await mn.configure(i.callbacks,this.callbacks,i.tags,this.tags,i.metadata,this.metadata,{verbose:this.verbose,tracerInheritableMetadata:this._filterInvocationParamsForTracing(s)}),c={options:n,invocation_params:s,batch_size:t.length},l=await u?.handleLLMStart(this.toJSON(),t,a,void 0,c,void 0,void 0,i?.runName),d=[],p=(await Promise.allSettled(t.map(async(y,_)=>{let $=await r.lookup(y,o);return $==null&&d.push(_),$}))).map((y,_)=>({result:y,runManager:l?.[_]})).filter(({result:y})=>y.status==="fulfilled"&&y.value!=null||y.status==="rejected"),f=[];await Promise.all(p.map(async({result:y,runManager:_},$)=>{if(y.status==="fulfilled"){let v=y.value;return f[$]=v.map(x=>(x.generationInfo={...x.generationInfo,tokenUsage:{}},x)),v.length&&await _?.handleLLMNewToken(v[0].text),_?.handleLLMEnd({generations:[v]},void 0,void 0,void 0,{cached:!0})}else return await _?.handleLLMError(y.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject(y.reason)}));let h={generations:f,missingPromptIndices:d,startedRunManagers:l};return Object.defineProperty(h,ma,{value:l?{runIds:l?.map(y=>y.runId)}:void 0,configurable:!0}),h}async generate(t,r,o){if(!Array.isArray(t))throw new Error("Argument 'prompts' is expected to be a string[]");let n;Array.isArray(r)?n={stop:r}:n=r;let[i,a]=this._separateRunnableConfigFromCallOptionsCompat(n);if(i.callbacks=i.callbacks??o,!this.cache)return this._generateUncached(t,a,i);let{cache:s}=this,u=this._getSerializedCacheKeyParametersForCall(a),{generations:c,missingPromptIndices:l,startedRunManagers:d}=await this._generateCached({prompts:t,cache:s,llmStringKey:u,parsedOptions:a,handledOptions:i,runId:i.runId}),p={};if(l.length>0){let f=await this._generateUncached(l.map(h=>t[h]),a,i,d!==void 0?l.map(h=>d?.[h]):void 0);await Promise.all(f.generations.map(async(h,y)=>{let _=l[y];return c[_]=h,s.update(t[_],u,h)})),p=f.llmOutput??{}}return{generations:c,llmOutput:p}}_identifyingParams(){return{}}_modelType(){return"base_llm"}},Y6=class extends fA{async _generate(e,t,r){return{generations:await Promise.all(e.map((o,n)=>this._call(o,{...t,promptIndex:n},r).then(i=>[{text:i}])))}}};var eZ=V.object({type:V.literal("screenshot")}),tZ=V.object({type:V.literal("click"),x:V.number(),y:V.number(),button:V.enum(["left","right","wheel","back","forward"]).default("left")}),rZ=V.object({type:V.literal("double_click"),x:V.number(),y:V.number(),button:V.enum(["left","right","wheel","back","forward"]).default("left")}),nZ=V.object({type:V.literal("drag"),path:V.array(V.object({x:V.number(),y:V.number()}))}),oZ=V.object({type:V.literal("keypress"),keys:V.array(V.string())}),iZ=V.object({type:V.literal("move"),x:V.number(),y:V.number()}),aZ=V.object({type:V.literal("scroll"),x:V.number(),y:V.number(),scroll_x:V.number(),scroll_y:V.number()}),sZ=V.object({type:V.literal("type"),text:V.string()}),uZ=V.object({type:V.literal("wait"),duration:V.number().optional()}),cZ=V.union([eZ,tZ,rZ,nZ,oZ,iZ,aZ,sZ,uZ]),Tme=V.object({action:cZ});var lZ=V.object({type:V.literal("exec"),command:V.array(V.string()),env:V.record(V.string(),V.string()).optional(),working_directory:V.string().optional(),timeout_ms:V.number().optional(),user:V.string().optional()}),zme=V.union([lZ]);var Mme=V.object({commands:V.array(V.string()).describe("Array of shell commands to execute"),timeout_ms:V.number().optional().describe("Optional timeout in milliseconds for the commands"),max_output_length:V.number().optional().describe("Optional maximum number of characters to return from each command")});var dZ=V.object({type:V.literal("create_file"),path:V.string(),diff:V.string()}),pZ=V.object({type:V.literal("update_file"),path:V.string(),diff:V.string()}),fZ=V.object({type:V.literal("delete_file"),path:V.string()}),Fme=V.union([dZ,pZ,fZ]);export{Lf as a,XW as b,rK as c,wK as d,Jt as e,fa as f,FK as g,qK as h,Xn as i,fK as j,sW as k,rt as l,j$ as m,No as n,M$ as o,kf as p,U$ as q,L$ as r,Z$ as s,Vt as t,ZW as u,Nt as v,fV as w,Gf as x,Fe as y,Fo as z,su as A,or as B,vr as C,xie as D,zie as E,Zk as F,HV as G,ew as H,tw as I,hD as J,cq as K,_q as L,ps as M,Mce as N,ile as O,rA as P,vo as Q,Pi as R,ode as S,Yie as T,Sde as U,Ede as V,Yh as W,Zde as X,lpe as Y,Qh as Z,Wpe as _,Hfe as $,Y6 as aa,Npe as ba,V as ca,cJ as da,mx as ea,nd as fa,Tie as ga,Jie as ha,ice as ia,fC as ja,bE as ka};