@decocms/mesh 1.0.4 → 1.0.6

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 (104) hide show
  1. package/dist/client/assets/{AlertCircle-D0nDWFmW.js → AlertCircle-BpngO4aw.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-Dy5EiaSz.js → ArrowLeft-DnNeLtGd.js} +1 -1
  3. package/dist/client/assets/{Calendar-BJxxu5C2.js → Calendar-D9128Zt6.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CIZ-G0cr.js → CheckCircle-pvl06c1v.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BaUXzk6S.js → ChevronDown-DDObtPy0.js} +1 -1
  6. package/dist/client/assets/{Clock-ByLvVVaa.js → Clock-Bhch8Dmk.js} +1 -1
  7. package/dist/client/assets/{Copy01-qQVvX-ag.js → Copy01-D0UvfCIS.js} +1 -1
  8. package/dist/client/assets/{CpuChip02-D94fV7L1.js → CpuChip02-CHkUken-.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-Bwr84gxu.js → DotsVertical-Dx8byzRL.js} +1 -1
  10. package/dist/client/assets/{File06-wdks9UDf.js → File06-BhKX70V2.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-BEddVBkT.js → GitBranch01-B4CzhWKg.js} +1 -1
  12. package/dist/client/assets/{Inbox01-Z0aW0--W.js → Inbox01-C3XiWYYM.js} +1 -1
  13. package/dist/client/assets/{InfoCircle-DlRKJuiF.js → InfoCircle-RxSckwOE.js} +1 -1
  14. package/dist/client/assets/{Key01-Dnk7VSvJ.js → Key01-Df_FMcod.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-9eWvk-rl.js → LinkExternal01-BKGS1ajv.js} +1 -1
  16. package/dist/client/assets/{Loading01-DimFEMf8.js → Loading01-BKEuP0BH.js} +1 -1
  17. package/dist/client/assets/{Plus-Dq2PT6Y9.js → Plus-QVXsH8wr.js} +1 -1
  18. package/dist/client/assets/{SearchMd-B721Dhru.js → SearchMd-C9aO1pvs.js} +1 -1
  19. package/dist/client/assets/{Trash01-k3joih0I.js → Trash01-Dz5QBjzt.js} +1 -1
  20. package/dist/client/assets/{Upload01-CaIFJ1wc.js → Upload01-D2Q9ozBI.js} +1 -1
  21. package/dist/client/assets/{X-DLJOSrBL.js → X-B6099MPR.js} +1 -1
  22. package/dist/client/assets/{XClose-CE9-wvzR.js → XClose-DSJxdHjH.js} +1 -1
  23. package/dist/client/assets/{alert-dialog-DSXTwITs.js → alert-dialog-Bsv_icPD.js} +1 -1
  24. package/dist/client/assets/{auth-DW5xyVSX.js → auth-DRlnk2xb.js} +1 -1
  25. package/dist/client/assets/{auth-catchall-lLRsq2bv.js → auth-catchall-BBXFE5-p.js} +1 -1
  26. package/dist/client/assets/{avatar-Cdwojtd9.js → avatar-DBXvQJLu.js} +1 -1
  27. package/dist/client/assets/{badge-BKAVZN76.js → badge-EdnCME49.js} +1 -1
  28. package/dist/client/assets/{button-Cbx1psx0.js → button-BBbnP-v9.js} +1 -1
  29. package/dist/client/assets/{card-DPj2Jhqd.js → card-oQzKnd4e.js} +1 -1
  30. package/dist/client/assets/{checkbox-zcMnPIpA.js → checkbox-AVyYmXWI.js} +1 -1
  31. package/dist/client/assets/{collection-detail-ChLk2o5y.js → collection-detail-CnS3NqzF.js} +1 -1
  32. package/dist/client/assets/{collection-display-button-CASXIcfv.js → collection-display-button-DVo3HJTi.js} +1 -1
  33. package/dist/client/assets/{collection-header-DYCWQd6V.js → collection-header-BpXu8Vzd.js} +1 -1
  34. package/dist/client/assets/{collection-page-C7DppZNC.js → collection-page-BDOciB5D.js} +1 -1
  35. package/dist/client/assets/{collection-search-CkrsYVHK.js → collection-search-Clscyxb6.js} +1 -1
  36. package/dist/client/assets/{collection-table-wrapper-DYHssETe.js → collection-table-wrapper-DrJQ8qIR.js} +1 -1
  37. package/dist/client/assets/{connection-card-Ccv2RGnA.js → connection-card-DNEpv4P8.js} +1 -1
  38. package/dist/client/assets/{connection-detail-C4ySrNnu.js → connection-detail-DJQ5DpK4.js} +1 -1
  39. package/dist/client/assets/{connections-1K9OuPLG.js → connections-B8KLLrqT.js} +1 -1
  40. package/dist/client/assets/{core-CDKYwt4t.js → core-B2H4SHem.js} +1 -1
  41. package/dist/client/assets/{create-organization-dialog-CMqfWkSO.js → create-organization-dialog-BgaQBiov.js} +1 -1
  42. package/dist/client/assets/{dialog-b1ZSD0yQ.js → dialog-zSQgybFt.js} +1 -1
  43. package/dist/client/assets/{dropdown-menu-CDqLiYRK.js → dropdown-menu-DjQlOq7B.js} +1 -1
  44. package/dist/client/assets/{error-boundary-Kdc9g4VW.js → error-boundary-DnOs9ptq.js} +1 -1
  45. package/dist/client/assets/{extract-connection-data-C1-YxFs5.js → extract-connection-data-C4TbfE2g.js} +1 -1
  46. package/dist/client/assets/{form-8svTn9hb.js → form-DbXTocCZ.js} +1 -1
  47. package/dist/client/assets/{formatDistanceToNow-CUwQS-xD.js → formatDistanceToNow-DXvTo8fz.js} +1 -1
  48. package/dist/client/assets/{gateway-detail-hfG6iBJG.js → gateway-detail-D_Eeu8GA.js} +1 -1
  49. package/dist/client/assets/{gateways-C_zZYP4A.js → gateways-CpOqHGPf.js} +1 -1
  50. package/dist/client/assets/{home-BjWql1uD.js → home-DH79MOVs.js} +1 -1
  51. package/dist/client/assets/{index-C-wz9XDG.js → index-CGQ5MQzC.js} +1 -1
  52. package/dist/client/assets/index-CLqXtDUO.js +1 -0
  53. package/dist/client/assets/{index-CUKSaF48.js → index-DIMg3McT.js} +2 -2
  54. package/dist/client/assets/{index-BwIl7ggr.js → index-DmnZvHNs.js} +1 -1
  55. package/dist/client/assets/{input-H6VT8E5Y.js → input-DuLixXzs.js} +1 -1
  56. package/dist/client/assets/json-BR-1n4UW.js +1 -0
  57. package/dist/client/assets/{json-syntax-highlighter-BVdiHUZ0.js → json-syntax-highlighter-DzeQqB3N.js} +2 -2
  58. package/dist/client/assets/{layout-BQd1I6xa.js → layout-BXMoCa5p.js} +1 -1
  59. package/dist/client/assets/{lazy-highlighter-B5RwvSZU.js → lazy-highlighter-DlCJvY4E.js} +1 -1
  60. package/dist/client/assets/{localstorage-keys-DjtPyJdf.js → localstorage-keys-DUsAqGtJ.js} +1 -1
  61. package/dist/client/assets/{login-DzimQUQo.js → login-DzOOW3NK.js} +1 -1
  62. package/dist/client/assets/{mcp-oauth-B_sv-TkE.js → mcp-oauth-u1f9o4pW.js} +1 -1
  63. package/dist/client/assets/{members-CRouHlMm.js → members-BcgmC3Q2.js} +1 -1
  64. package/dist/client/assets/{monitoring-CcJvqpst.js → monitoring-Ci-6RfIl.js} +1 -1
  65. package/dist/client/assets/{oauth-callback-BPKJmJXt.js → oauth-callback-D7HKnm8-.js} +1 -1
  66. package/dist/client/assets/{page-D5Fp2CZa.js → page-D8EXKf1f.js} +1 -1
  67. package/dist/client/assets/{popover-Bk6CGVAU.js → popover-CSmu1XQf.js} +1 -1
  68. package/dist/client/assets/prism-light-DdlubWED.js +1 -0
  69. package/dist/client/assets/{resizable-DmzyZoqu.js → resizable-DaIbtpXr.js} +4 -4
  70. package/dist/client/assets/{resource-tabs-CHwi6mUQ.js → resource-tabs-UHT4jRlB.js} +1 -1
  71. package/dist/client/assets/{schema-Bmw1udN9.js → schema-DLujv0-N.js} +1 -1
  72. package/dist/client/assets/{select-CMEQTzOd.js → select-yhQhGgIP.js} +1 -1
  73. package/dist/client/assets/{settings-cNvY-rFi.js → settings-LFw_pLDl.js} +1 -1
  74. package/dist/client/assets/{shell-layout-BU-xHCbm.js → shell-layout-BcDSRee_.js} +1 -1
  75. package/dist/client/assets/{spinner-Cla_bqD5.js → spinner-BZx2tm9C.js} +1 -1
  76. package/dist/client/assets/{store-DOUbL8HI.js → store-QDtOTGzB.js} +1 -1
  77. package/dist/client/assets/{store-app-detail-CLx7Tiyl.js → store-app-detail-gbykHeE1.js} +1 -1
  78. package/dist/client/assets/{switch-DkW26u3q.js → switch-7ykyI8eT.js} +1 -1
  79. package/dist/client/assets/{tools-list-DSipnNXa.js → tools-list-Cg7Vdfai.js} +1 -1
  80. package/dist/client/assets/{tooltip-6DkXiGB3.js → tooltip-C8Lb1JlD.js} +1 -1
  81. package/dist/client/assets/{types-DY58s8k_.js → types-mJaNg2R7.js} +1 -1
  82. package/dist/client/assets/{use-binding-CTox1Niq.js → use-binding-DGE2EQtT.js} +1 -1
  83. package/dist/client/assets/{use-connection-Cj_N-56I.js → use-connection-CdhlvEhz.js} +1 -1
  84. package/dist/client/assets/{use-connection-resources-Er78LVOz.js → use-connection-resources-DLA7YNHa.js} +1 -1
  85. package/dist/client/assets/{use-gateway-B64MZgV5.js → use-gateway-DGSuI4Pr.js} +1 -1
  86. package/dist/client/assets/{use-list-state-D7R4e82G.js → use-list-state-BCOB_OIi.js} +1 -1
  87. package/dist/client/assets/{use-mcp-DgPyQ4aq.js → use-mcp-i7kSvKqD.js} +1 -1
  88. package/dist/client/assets/{use-members-BC7usg5N.js → use-members-C4WkWKg7.js} +1 -1
  89. package/dist/client/assets/{use-mobile-Bi0wd_6D.js → use-mobile-DJp6G0-T.js} +1 -1
  90. package/dist/client/assets/{use-organization-settings-HuuZ3X-G.js → use-organization-settings-Dhw1as1Y.js} +1 -1
  91. package/dist/client/assets/{use-tool-call-DP5wwhCb.js → use-tool-call-ZoYxiLnk.js} +1 -1
  92. package/dist/client/assets/useQuery-CMnzSYEG.js +1 -0
  93. package/dist/client/assets/utils-B0Sj2akX.js +1 -0
  94. package/dist/client/assets/{view-mode-toggle-BLmASoqb.js → view-mode-toggle-CgM7sjNw.js} +1 -1
  95. package/dist/client/assets/{well-known-mcp-C14XnQVT.js → well-known-mcp-59JQWa69.js} +1 -1
  96. package/dist/client/index.html +1 -1
  97. package/dist/server/cli.js +3 -3
  98. package/dist/server/server.js +2 -2
  99. package/package.json +1 -1
  100. package/dist/client/assets/index-De7NV5ze.js +0 -1
  101. package/dist/client/assets/json-DXDmXnbb.js +0 -1
  102. package/dist/client/assets/prism-light-rMaH_Wpf.js +0 -1
  103. package/dist/client/assets/useQuery-CBbBOkDY.js +0 -1
  104. package/dist/client/assets/utils-D1z8mp5k.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-B5RwvSZU.js","assets/index-CUKSaF48.js","assets/index-Bw8uh6yx.css","assets/core-CDKYwt4t.js","assets/json-BESjz4hO.js"])))=>i.map(i=>d[i]);
2
- import{aE as B,aF as nh,aG as ts,aH as ns,aI as Ir,aJ as rh,aK as _e,aL as ka,aM as tn,aN as ai,aO as si,aP as ih,aQ as ah,aR as il,aS as al,aT as Zn,aU as Aa,aV as sh,aW as uh,aX as sr,aY as br,aZ as oh,a_ as rs,a$ as sl,b0 as lh,b1 as ee,r as D,c as X,j as E,b2 as Ln,a2 as ul,ai as is,aw as ch,f as dh,t as Qr,Y as ol,K as it,p as as,b3 as fh,b4 as hh,b5 as ph,b6 as mh,b7 as gh,b8 as bh,b9 as Eh,ba as Th,bb as xh,bc as _h,bd as yh,be as kh,bf as Ah,bg as ll,bh as Ch,bi as ce,al as Sh}from"./index-CUKSaF48.js";import{c as ue}from"./utils-D1z8mp5k.js";import{B as Yt,u as nn}from"./button-Cbx1psx0.js";import{j as Ih,c as Nh}from"./dropdown-menu-CDqLiYRK.js";import{T as wh}from"./dialog-b1ZSD0yQ.js";import{i as un,u as Dn,c as cl,b as dl,T as fl}from"./tooltip-6DkXiGB3.js";import{i as ss}from"./CpuChip02-D94fV7L1.js";import{i as hl}from"./SearchMd-B721Dhru.js";import{I as pl,b as vh,U as Rh,e as Oh,c as Lh,u as Dh}from"./use-connection-Cj_N-56I.js";import{b as Ph,a as Mh,c as Bh,S as Fh,n as zh}from"./select-CMEQTzOd.js";import{u as Uh}from"./use-mobile-Bi0wd_6D.js";import{u as Hh}from"./use-gateway-B64MZgV5.js";import{t as ml}from"./ChevronDown-BaUXzk6S.js";import{a as _i}from"./Copy01-qQVvX-ag.js";import{i as $h}from"./AlertCircle-D0nDWFmW.js";import{C as jh}from"./connection-card-Ccv2RGnA.js";import{n as Zh}from"./LinkExternal01-9eWvk-rl.js";import{S as Yh}from"./spinner-Cla_bqD5.js";import{i as qh}from"./File06-wdks9UDf.js";import{i as Vh}from"./InfoCircle-DlRKJuiF.js";import{u as Wh,E as Gh}from"./use-binding-CTox1Niq.js";const Qh=/^[cC][^\s-]{8,}$/,Kh=/^[0-9a-z]+$/,Xh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Jh=/^[0-9a-vA-V]{20}$/,ep=/^[A-Za-z0-9]{27}$/,tp=/^[a-zA-Z0-9_-]{21}$/,np=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rp=/^([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})$/,Vs=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,ip=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ap="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function sp(){return new RegExp(ap,"u")}const up=/^(?:(?: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])$/,op=/^(([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})$/,lp=/^((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])$/,cp=/^(([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])$/,dp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,gl=/^[A-Za-z0-9_-]*$/,fp=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,hp=/^\+(?:[0-9]){6,14}[0-9]$/,bl="(?:(?:\\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])))",pp=new RegExp(`^${bl}$`);function El(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function mp(t){return new RegExp(`^${El(t)}$`)}function gp(t){const e=El({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${e}(?:${n.join("|")})`;return new RegExp(`^${bl}T(?:${r})$`)}const bp=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Ep=/^\d+$/,Tp=/^-?\d+(?:\.\d+)?/i,xp=/true|false/i,_p=/null/i,yp=/^[^A-Z]*$/,kp=/^[^a-z]*$/,at=B("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Tl={number:"number",bigint:"bigint",object:"date"},xl=B("$ZodCheckLessThan",(t,e)=>{at.init(t,e);const n=Tl[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,a=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<a&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),_l=B("$ZodCheckGreaterThan",(t,e)=>{at.init(t,e);const n=Tl[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,a=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>a&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Ap=B("$ZodCheckMultipleOf",(t,e)=>{at.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):nh(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),Cp=B("$ZodCheckNumberFormat",(t,e)=>{at.init(t,e),e.format=e.format||"float64";const n=e.format?.includes("int"),r=n?"int":"number",[i,a]=rh[e.format];t._zod.onattach.push(s=>{const u=s._zod.bag;u.format=e.format,u.minimum=i,u.maximum=a,n&&(u.pattern=Ep)}),t._zod.check=s=>{const u=s.value;if(n){if(!Number.isInteger(u)){s.issues.push({expected:r,format:e.format,code:"invalid_type",input:u,inst:t});return}if(!Number.isSafeInteger(u)){u>0?s.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort}):s.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort});return}}u<i&&s.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),u>a&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inst:t})}}),Sp=B("$ZodCheckMaxLength",(t,e)=>{var n;at.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!ts(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const i=r.value;if(i.length<=e.maximum)return;const s=ns(i);r.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),Ip=B("$ZodCheckMinLength",(t,e)=>{var n;at.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!ts(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const i=r.value;if(i.length>=e.minimum)return;const s=ns(i);r.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),Np=B("$ZodCheckLengthEquals",(t,e)=>{var n;at.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!ts(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=r=>{const i=r.value,a=i.length;if(a===e.length)return;const s=ns(i),u=a>e.length;r.issues.push({origin:s,...u?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),yi=B("$ZodCheckStringFormat",(t,e)=>{var n,r;at.init(t,e),t._zod.onattach.push(i=>{const a=i._zod.bag;a.format=e.format,e.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),wp=B("$ZodCheckRegex",(t,e)=>{yi.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),vp=B("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=yp),yi.init(t,e)}),Rp=B("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=kp),yi.init(t,e)}),Op=B("$ZodCheckIncludes",(t,e)=>{at.init(t,e);const n=Ir(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),Lp=B("$ZodCheckStartsWith",(t,e)=>{at.init(t,e);const n=new RegExp(`^${Ir(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Dp=B("$ZodCheckEndsWith",(t,e)=>{at.init(t,e);const n=new RegExp(`.*${Ir(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),Pp=B("$ZodCheckOverwrite",(t,e)=>{at.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class Mp{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-DlCJvY4E.js","assets/index-DIMg3McT.js","assets/index-Bw8uh6yx.css","assets/core-B2H4SHem.js","assets/json-BESjz4hO.js"])))=>i.map(i=>d[i]);
2
+ import{aE as B,aF as nh,aG as ts,aH as ns,aI as Ir,aJ as rh,aK as _e,aL as ka,aM as tn,aN as ai,aO as si,aP as ih,aQ as ah,aR as il,aS as al,aT as Zn,aU as Aa,aV as sh,aW as uh,aX as sr,aY as br,aZ as oh,a_ as rs,a$ as sl,b0 as lh,b1 as ee,r as D,c as X,j as E,b2 as Ln,a2 as ul,ai as is,aw as ch,f as dh,t as Qr,Y as ol,K as it,p as as,b3 as fh,b4 as hh,b5 as ph,b6 as mh,b7 as gh,b8 as bh,b9 as Eh,ba as Th,bb as xh,bc as _h,bd as yh,be as kh,bf as Ah,bg as ll,bh as Ch,bi as ce,al as Sh}from"./index-DIMg3McT.js";import{c as ue}from"./utils-B0Sj2akX.js";import{B as Yt,u as nn}from"./button-BBbnP-v9.js";import{j as Ih,c as Nh}from"./dropdown-menu-DjQlOq7B.js";import{T as wh}from"./dialog-zSQgybFt.js";import{i as un,u as Dn,c as cl,b as dl,T as fl}from"./tooltip-C8Lb1JlD.js";import{i as ss}from"./CpuChip02-CHkUken-.js";import{i as hl}from"./SearchMd-C9aO1pvs.js";import{I as pl,b as vh,U as Rh,e as Oh,c as Lh,u as Dh}from"./use-connection-CdhlvEhz.js";import{b as Ph,a as Mh,c as Bh,S as Fh,n as zh}from"./select-yhQhGgIP.js";import{u as Uh}from"./use-mobile-DJp6G0-T.js";import{u as Hh}from"./use-gateway-DGSuI4Pr.js";import{t as ml}from"./ChevronDown-DDObtPy0.js";import{a as _i}from"./Copy01-D0UvfCIS.js";import{i as $h}from"./AlertCircle-BpngO4aw.js";import{C as jh}from"./connection-card-DNEpv4P8.js";import{n as Zh}from"./LinkExternal01-BKGS1ajv.js";import{S as Yh}from"./spinner-BZx2tm9C.js";import{i as qh}from"./File06-BhKX70V2.js";import{i as Vh}from"./InfoCircle-RxSckwOE.js";import{u as Wh,E as Gh}from"./use-binding-DGE2EQtT.js";const Qh=/^[cC][^\s-]{8,}$/,Kh=/^[0-9a-z]+$/,Xh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Jh=/^[0-9a-vA-V]{20}$/,ep=/^[A-Za-z0-9]{27}$/,tp=/^[a-zA-Z0-9_-]{21}$/,np=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rp=/^([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})$/,Vs=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,ip=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ap="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function sp(){return new RegExp(ap,"u")}const up=/^(?:(?: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])$/,op=/^(([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})$/,lp=/^((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])$/,cp=/^(([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])$/,dp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,gl=/^[A-Za-z0-9_-]*$/,fp=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,hp=/^\+(?:[0-9]){6,14}[0-9]$/,bl="(?:(?:\\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])))",pp=new RegExp(`^${bl}$`);function El(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function mp(t){return new RegExp(`^${El(t)}$`)}function gp(t){const e=El({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${e}(?:${n.join("|")})`;return new RegExp(`^${bl}T(?:${r})$`)}const bp=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Ep=/^\d+$/,Tp=/^-?\d+(?:\.\d+)?/i,xp=/true|false/i,_p=/null/i,yp=/^[^A-Z]*$/,kp=/^[^a-z]*$/,at=B("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Tl={number:"number",bigint:"bigint",object:"date"},xl=B("$ZodCheckLessThan",(t,e)=>{at.init(t,e);const n=Tl[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,a=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<a&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),_l=B("$ZodCheckGreaterThan",(t,e)=>{at.init(t,e);const n=Tl[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,a=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>a&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Ap=B("$ZodCheckMultipleOf",(t,e)=>{at.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):nh(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),Cp=B("$ZodCheckNumberFormat",(t,e)=>{at.init(t,e),e.format=e.format||"float64";const n=e.format?.includes("int"),r=n?"int":"number",[i,a]=rh[e.format];t._zod.onattach.push(s=>{const u=s._zod.bag;u.format=e.format,u.minimum=i,u.maximum=a,n&&(u.pattern=Ep)}),t._zod.check=s=>{const u=s.value;if(n){if(!Number.isInteger(u)){s.issues.push({expected:r,format:e.format,code:"invalid_type",input:u,inst:t});return}if(!Number.isSafeInteger(u)){u>0?s.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort}):s.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort});return}}u<i&&s.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),u>a&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inst:t})}}),Sp=B("$ZodCheckMaxLength",(t,e)=>{var n;at.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!ts(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const i=r.value;if(i.length<=e.maximum)return;const s=ns(i);r.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),Ip=B("$ZodCheckMinLength",(t,e)=>{var n;at.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!ts(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const i=r.value;if(i.length>=e.minimum)return;const s=ns(i);r.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),Np=B("$ZodCheckLengthEquals",(t,e)=>{var n;at.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!ts(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=r=>{const i=r.value,a=i.length;if(a===e.length)return;const s=ns(i),u=a>e.length;r.issues.push({origin:s,...u?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),yi=B("$ZodCheckStringFormat",(t,e)=>{var n,r;at.init(t,e),t._zod.onattach.push(i=>{const a=i._zod.bag;a.format=e.format,e.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),wp=B("$ZodCheckRegex",(t,e)=>{yi.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),vp=B("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=yp),yi.init(t,e)}),Rp=B("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=kp),yi.init(t,e)}),Op=B("$ZodCheckIncludes",(t,e)=>{at.init(t,e);const n=Ir(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),Lp=B("$ZodCheckStartsWith",(t,e)=>{at.init(t,e);const n=new RegExp(`^${Ir(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Dp=B("$ZodCheckEndsWith",(t,e)=>{at.init(t,e);const n=new RegExp(`.*${Ir(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),Pp=B("$ZodCheckOverwrite",(t,e)=>{at.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class Mp{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
3
3
  `).filter(s=>s),i=Math.min(...r.map(s=>s.length-s.trimStart().length)),a=r.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(const s of a)this.content.push(s)}compile(){const e=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new e(...n,i.join(`
4
4
  `))}}const Bp={major:4,minor:0,patch:0},Re=B("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Bp;const r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(const i of r)for(const a of i._zod.onattach)a(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const i=(a,s,u)=>{let o=sr(a),l;for(const f of s){if(f._zod.def.when){if(!f._zod.def.when(a))continue}else if(o)continue;const c=a.issues.length,p=f._zod.check(a);if(p instanceof Promise&&u?.async===!1)throw new Aa;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,a.issues.length!==c&&(o||(o=sr(a,c)))});else{if(a.issues.length===c)continue;o||(o=sr(a,c))}}return l?l.then(()=>a):a};t._zod.run=(a,s)=>{const u=t._zod.parse(a,s);if(u instanceof Promise){if(s.async===!1)throw new Aa;return u.then(o=>i(o,r,s))}return i(u,r,s)}}t["~standard"]={validate:i=>{try{const a=sh(t,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return uh(t,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),us=B("$ZodString",(t,e)=>{Re.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??bp(t._zod.bag),t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Me=B("$ZodStringFormat",(t,e)=>{yi.init(t,e),us.init(t,e)}),Fp=B("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=rp),Me.init(t,e)}),zp=B("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Vs(r))}else e.pattern??(e.pattern=Vs());Me.init(t,e)}),Up=B("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=ip),Me.init(t,e)}),Hp=B("$ZodURL",(t,e)=>{Me.init(t,e),t._zod.check=n=>{try{const r=n.value,i=new URL(r),a=i.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:fp.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),!r.endsWith("/")&&a.endsWith("/")?n.value=a.slice(0,-1):n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),$p=B("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=sp()),Me.init(t,e)}),jp=B("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=tp),Me.init(t,e)}),Zp=B("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Qh),Me.init(t,e)}),Yp=B("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Kh),Me.init(t,e)}),qp=B("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Xh),Me.init(t,e)}),Vp=B("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Jh),Me.init(t,e)}),Wp=B("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=ep),Me.init(t,e)}),Gp=B("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=gp(e)),Me.init(t,e)}),Qp=B("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=pp),Me.init(t,e)}),Kp=B("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=mp(e)),Me.init(t,e)}),Xp=B("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=np),Me.init(t,e)}),Jp=B("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=up),Me.init(t,e),t._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),e0=B("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=op),Me.init(t,e),t._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),t0=B("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=lp),Me.init(t,e)}),n0=B("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=cp),Me.init(t,e),t._zod.check=n=>{const[r,i]=n.value.split("/");try{if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function yl(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const r0=B("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=dp),Me.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),t._zod.check=n=>{yl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function i0(t){if(!gl.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return yl(n)}const a0=B("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=gl),Me.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),t._zod.check=n=>{i0(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),s0=B("$ZodE164",(t,e)=>{e.pattern??(e.pattern=hp),Me.init(t,e)});function u0(t,e=null){try{const n=t.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const o0=B("$ZodJWT",(t,e)=>{Me.init(t,e),t._zod.check=n=>{u0(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),kl=B("$ZodNumber",(t,e)=>{Re.init(t,e),t._zod.pattern=t._zod.bag.pattern??Tp,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...a?{received:a}:{}}),n}}),l0=B("$ZodNumber",(t,e)=>{Cp.init(t,e),kl.init(t,e)}),c0=B("$ZodBoolean",(t,e)=>{Re.init(t,e),t._zod.pattern=xp,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),n}}),d0=B("$ZodNull",(t,e)=>{Re.init(t,e),t._zod.pattern=_p,t._zod.values=new Set([null]),t._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),n}}),f0=B("$ZodUnknown",(t,e)=>{Re.init(t,e),t._zod.parse=n=>n}),h0=B("$ZodNever",(t,e)=>{Re.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function Ws(t,e,n){t.issues.length&&e.issues.push(...tn(n,t.issues)),e.value[n]=t.value}const p0=B("$ZodArray",(t,e)=>{Re.init(t,e),t._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),n;n.value=Array(i.length);const a=[];for(let s=0;s<i.length;s++){const u=i[s],o=e.element._zod.run({value:u,issues:[]},r);o instanceof Promise?a.push(o.then(l=>Ws(l,n,s))):Ws(o,n,s)}return a.length?Promise.all(a).then(()=>n):n}});function Ur(t,e,n){t.issues.length&&e.issues.push(...tn(n,t.issues)),e.value[n]=t.value}function Gs(t,e,n,r){t.issues.length?r[n]===void 0?n in r?e.value[n]=void 0:e.value[n]=t.value:e.issues.push(...tn(n,t.issues)):t.value===void 0?n in r&&(e.value[n]=void 0):e.value[n]=t.value}const m0=B("$ZodObject",(t,e)=>{Re.init(t,e);const n=il(()=>{const c=Object.keys(e.shape);for(const h of c)if(!(e.shape[h]instanceof Re))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);const p=oh(e.shape);return{shape:e.shape,keys:c,keySet:new Set(c),numKeys:c.length,optionalKeys:new Set(p)}});_e(t._zod,"propValues",()=>{const c=e.shape,p={};for(const h in c){const m=c[h]._zod;if(m.values){p[h]??(p[h]=new Set);for(const b of m.values)p[h].add(b)}}return p});const r=c=>{const p=new Mp(["shape","payload","ctx"]),h=n.value,m=k=>{const g=Zn(k);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};p.write("const input = payload.value;");const b=Object.create(null);let x=0;for(const k of h.keys)b[k]=`key_${x++}`;p.write("const newResult = {}");for(const k of h.keys)if(h.optionalKeys.has(k)){const g=b[k];p.write(`const ${g} = ${m(k)};`);const N=Zn(k);p.write(`
5
5
  if (${g}.issues.length) {
@@ -110,14 +110,14 @@ Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An err
110
110
  `))+1))}const s="#".repeat(i),u=n.enter("headingAtx"),o=n.enter("phrasing");a.move(s+" ");let l=n.containerPhrasing(t,{before:"# ",after:`
111
111
  `,...a.current()});return/^[\t ]/.test(l)&&(l=_r(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,n.options.closeAtx&&(l+=" "+s),o(),u(),l}kd.peek=Y3;function kd(t){return t.value||""}function Y3(){return"<"}Ad.peek=q3;function Ad(t,e,n,r){const i=Ms(n),a=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let u=n.enter("label");const o=n.createTracker(r);let l=o.move("![");return l+=o.move(n.safe(t.alt,{before:l,after:"]",...o.current()})),l+=o.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=o.move("<"),l+=o.move(n.safe(t.url,{before:l,after:">",...o.current()})),l+=o.move(">")):(u=n.enter("destinationRaw"),l+=o.move(n.safe(t.url,{before:l,after:t.title?" ":")",...o.current()}))),u(),t.title&&(u=n.enter(`title${a}`),l+=o.move(" "+i),l+=o.move(n.safe(t.title,{before:l,after:i,...o.current()})),l+=o.move(i),u()),l+=o.move(")"),s(),l}function q3(){return"!"}Cd.peek=V3;function Cd(t,e,n,r){const i=t.referenceType,a=n.enter("imageReference");let s=n.enter("label");const u=n.createTracker(r);let o=u.move("![");const l=n.safe(t.alt,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=f,a(),i==="full"||!l||l!==c?o+=u.move(c+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function V3(){return"!"}Sd.peek=W3;function Sd(t,e,n){let r=t.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const s=n.unsafe[a],u=n.compilePattern(s);let o;if(s.atBreak)for(;o=u.exec(r);){let l=o.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(o.index+1)}}return i+r+i}function W3(){return"`"}function Id(t,e){const n=ys(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Nd.peek=G3;function Nd(t,e,n,r){const i=Ms(n),a=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let u,o;if(Id(t,n)){const f=n.stack;n.stack=[],u=n.enter("autolink");let c=s.move("<");return c+=s.move(n.containerPhrasing(t,{before:c,after:">",...s.current()})),c+=s.move(">"),u(),n.stack=f,c}u=n.enter("link"),o=n.enter("label");let l=s.move("[");return l+=s.move(n.containerPhrasing(t,{before:l,after:"](",...s.current()})),l+=s.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(n.safe(t.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(o=n.enter("destinationRaw"),l+=s.move(n.safe(t.url,{before:l,after:t.title?" ":")",...s.current()}))),o(),t.title&&(o=n.enter(`title${a}`),l+=s.move(" "+i),l+=s.move(n.safe(t.title,{before:l,after:i,...s.current()})),l+=s.move(i),o()),l+=s.move(")"),u(),l}function G3(t,e,n){return Id(t,n)?"<":"["}wd.peek=Q3;function wd(t,e,n,r){const i=t.referenceType,a=n.enter("linkReference");let s=n.enter("label");const u=n.createTracker(r);let o=u.move("[");const l=n.containerPhrasing(t,{before:o,after:"]",...u.current()});o+=u.move(l+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(t),{before:o,after:"]",...u.current()});return s(),n.stack=f,a(),i==="full"||!l||l!==c?o+=u.move(c+"]"):i==="shortcut"?o=o.slice(0,-1):o+=u.move("]"),o}function Q3(){return"["}function Bs(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function K3(t){const e=Bs(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function X3(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function vd(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function J3(t,e,n,r){const i=n.enter("list"),a=n.bulletCurrent;let s=t.ordered?X3(n):Bs(n);const u=t.ordered?s==="."?")":".":K3(n);let o=e&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!t.ordered){const f=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(o=!0),vd(n)===s&&f){let c=-1;for(;++c<t.children.length;){const p=t.children[c];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){o=!0;break}}}}o&&(s=u),n.bulletCurrent=s;const l=n.containerFlow(t,r);return n.bulletLastUsed=s,n.bulletCurrent=a,i(),l}function ey(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function ty(t,e,n,r){const i=ey(n);let a=n.bulletCurrent||Bs(n);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let s=a.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);const u=n.createTracker(r);u.move(a+" ".repeat(s-a.length)),u.shift(s);const o=n.enter("listItem"),l=n.indentLines(n.containerFlow(t,u.current()),f);return o(),l;function f(c,p,h){return p?(h?"":" ".repeat(s))+c:(h?a:a+" ".repeat(s-a.length))+c}}function ny(t,e,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),s=n.containerPhrasing(t,r);return a(),i(),s}const ry=Oi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function iy(t,e,n,r){return(t.children.some(function(s){return ry(s)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function ay(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Rd.peek=sy;function Rd(t,e,n,r){const i=ay(n),a=n.enter("strong"),s=n.createTracker(r),u=s.move(i+i);let o=s.move(n.containerPhrasing(t,{after:i,before:u,...s.current()}));const l=o.charCodeAt(0),f=gi(r.before.charCodeAt(r.before.length-1),l,i);f.inside&&(o=_r(l)+o.slice(1));const c=o.charCodeAt(o.length-1),p=gi(r.after.charCodeAt(0),c,i);p.inside&&(o=o.slice(0,-1)+_r(c));const h=s.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},u+o+h}function sy(t,e,n){return n.options.strong||"*"}function uy(t,e,n,r){return n.safe(t.value,r)}function oy(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function ly(t,e,n){const r=(vd(n)+(n.options.ruleSpaces?" ":"")).repeat(oy(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Od={blockquote:O3,break:xo,code:F3,definition:U3,emphasis:yd,hardBreak:xo,heading:Z3,html:kd,image:Ad,imageReference:Cd,inlineCode:Sd,link:Nd,linkReference:wd,list:J3,listItem:ty,paragraph:ny,root:iy,strong:Rd,text:uy,thematicBreak:ly};function cy(){return{enter:{table:dy,tableData:_o,tableHeader:_o,tableRow:hy},exit:{codeText:py,table:fy,tableData:ha,tableHeader:ha,tableRow:ha}}}function dy(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function fy(t){this.exit(t),this.data.inTable=void 0}function hy(t){this.enter({type:"tableRow",children:[]},t)}function ha(t){this.exit(t)}function _o(t){this.enter({type:"tableCell",children:[]},t)}function py(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,my));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function my(t,e){return e==="|"?e:t}function gy(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
112
112
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:o,tableRow:u}};function s(h,m,b,x){return l(f(h,b,x),h.align)}function u(h,m,b,x){const T=c(h,b,x),k=l([T]);return k.slice(0,k.indexOf(`
113
- `))}function o(h,m,b,x){const T=b.enter("tableCell"),k=b.enter("phrasing"),g=b.containerPhrasing(h,{...x,before:a,after:a});return k(),T(),g}function l(h,m){return v3(h,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(h,m,b){const x=h.children;let T=-1;const k=[],g=m.enter("table");for(;++T<x.length;)k[T]=c(x[T],m,b);return g(),k}function c(h,m,b){const x=h.children;let T=-1;const k=[],g=m.enter("tableRow");for(;++T<x.length;)k[T]=o(x[T],h,m,b);return g(),k}function p(h,m,b){let x=Od.inlineCode(h,m,b);return b.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function by(){return{exit:{taskListCheckValueChecked:yo,taskListCheckValueUnchecked:yo,paragraph:Ty}}}function Ey(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xy}}}function yo(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function Ty(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let a=-1,s;for(;++a<i.length;){const u=i[a];if(u.type==="paragraph"){s=u;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function xy(t,e,n,r){const i=t.children[0],a=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(s);let o=Od.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(f){return f+s}}function _y(){return[J_(),x3(),A3(),cy(),by()]}function yy(t){return{extensions:[e3(),_3(t),C3(),gy(t),Ey()]}}const ky={tokenize:wy,partial:!0},Ld={tokenize:vy,partial:!0},Dd={tokenize:Ry,partial:!0},Pd={tokenize:Oy,partial:!0},Ay={tokenize:Ly,partial:!0},Md={name:"wwwAutolink",tokenize:Iy,previous:Fd},Bd={name:"protocolAutolink",tokenize:Ny,previous:zd},Dt={name:"emailAutolink",tokenize:Sy,previous:Ud},It={};function Cy(){return{text:It}}let Kt=48;for(;Kt<123;)It[Kt]=Dt,Kt++,Kt===58?Kt=65:Kt===91&&(Kt=97);It[43]=Dt;It[45]=Dt;It[46]=Dt;It[95]=Dt;It[72]=[Dt,Bd];It[104]=[Dt,Bd];It[87]=[Dt,Md];It[119]=[Dt,Md];function Sy(t,e,n){const r=this;let i,a;return s;function s(c){return!ja(c)||!Ud.call(r,r.previous)||Fs(r.events)?n(c):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(c))}function u(c){return ja(c)?(t.consume(c),u):c===64?(t.consume(c),o):n(c)}function o(c){return c===46?t.check(Ay,f,l)(c):c===45||c===95||We(c)?(a=!0,t.consume(c),o):f(c)}function l(c){return t.consume(c),i=!0,o}function f(c){return a&&i&&Je(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(c)):n(c)}}function Iy(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Fd.call(r,r.previous)||Fs(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(ky,t.attempt(Ld,t.attempt(Dd,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function Ny(t,e,n){const r=this;let i="",a=!1;return s;function s(c){return(c===72||c===104)&&zd.call(r,r.previous)&&!Fs(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),t.consume(c),u):n(c)}function u(c){if(Je(c)&&i.length<5)return i+=String.fromCodePoint(c),t.consume(c),u;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(c),o}return n(c)}function o(c){return c===47?(t.consume(c),a?l:(a=!0,o)):n(c)}function l(c){return c===null||di(c)||we(c)||ln(c)||wi(c)?n(c):t.attempt(Ld,t.attempt(Dd,f),n)(c)}function f(c){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(c)}}function wy(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function vy(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(Pd,o,u)(l):l===null||we(l)||ln(l)||l!==45&&wi(l)?o(l):(a=!0,t.consume(l),s)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),s}function o(l){return i||r||!a?n(l):e(l)}}function Ry(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(Pd,e,a)(s):s===null||we(s)||ln(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function Oy(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),a):u===93?(t.consume(u),i):u===60||u===null||we(u)||ln(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||we(u)||ln(u)?e(u):r(u)}function a(u){return Je(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):Je(u)?(t.consume(u),s):n(u)}}function Ly(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return We(a)?n(a):e(a)}}function Fd(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||we(t)}function zd(t){return!Je(t)}function Ud(t){return!(t===47||ja(t))}function ja(t){return t===43||t===45||t===46||t===95||We(t)}function Fs(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Dy={tokenize:$y,partial:!0};function Py(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:zy,continuation:{tokenize:Uy},exit:Hy}},text:{91:{name:"gfmFootnoteCall",tokenize:Fy},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:My,resolveTo:By}}}}function My(t,e,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){s=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!s||!s._balanced)return n(o);const l=Et(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function By(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function Fy(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(c){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),o}function o(c){return c!==94?n(c):(t.enter("gfmFootnoteCallMarker"),t.consume(c),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(c){if(a>999||c===93&&!s||c===null||c===91||we(c))return n(c);if(c===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(Et(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(c)}return we(c)||(s=!0),a++,t.consume(c),c===92?f:l}function f(c){return c===91||c===92||c===93?(t.consume(c),a++,l):l(c)}}function zy(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,u;return o;function o(m){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):n(m)}function f(m){if(s>999||m===93&&!u||m===null||m===91||we(m))return n(m);if(m===93){t.exit("chunkString");const b=t.exit("gfmFootnoteDefinitionLabelString");return a=Et(r.sliceSerialize(b)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return we(m)||(u=!0),s++,t.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(t.consume(m),s++,f):f(m)}function p(m){return m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),i.includes(a)||i.push(a),be(t,h,"gfmFootnoteDefinitionWhitespace")):n(m)}function h(m){return e(m)}}function Uy(t,e,n){return t.check(Or,e,t.attempt(Dy,e,n))}function Hy(t){t.exit("gfmFootnoteDefinition")}function $y(t,e,n){const r=this;return be(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function jy(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let o=-1;for(;++o<s.length;)if(s[o][0]==="enter"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._close){let l=o;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[o][1].end.offset-s[o][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[o][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},c={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},p=[["enter",f,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",c,u]],h=u.parser.constructs.insideSpan.null;h&&ct(p,p.length,0,vi(h,s.slice(l+1,o),u)),ct(p,p.length,0,[["exit",c,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",f,u]]),ct(s,l-1,o-l+3,p),o=l+p.length-2;break}}for(o=-1;++o<s.length;)s[o][1].type==="strikethroughSequenceTemporary"&&(s[o][1].type="data");return s}function a(s,u,o){const l=this.previous,f=this.events;let c=0;return p;function p(m){return l===126&&f[f.length-1][1].type!=="characterEscape"?o(m):(s.enter("strikethroughSequenceTemporary"),h(m))}function h(m){const b=wn(l);if(m===126)return c>1?o(m):(s.consume(m),c++,h);if(c<2&&!n)return o(m);const x=s.exit("strikethroughSequenceTemporary"),T=wn(m);return x._open=!T||T===2&&!!b,x._close=!b||b===2&&!!T,u(m)}}}class Zy{constructor(){this.map=[]}add(e,n,r){Yy(this,e,n,r)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const a of i)e.push(a);i=r.pop()}this.map.length=0}}function Yy(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function qy(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function Vy(){return{flow:{null:{name:"table",tokenize:Wy,resolveAll:Gy}}}}function Wy(t,e,n){const r=this;let i=0,a=0,s;return u;function u(w){let P=r.events.length-1;for(;P>-1;){const Z=r.events[P][1].type;if(Z==="lineEnding"||Z==="linePrefix")P--;else break}const H=P>-1?r.events[P][1].type:null,te=H==="tableHead"||H==="tableRow"?C:o;return te===C&&r.parser.lazy[r.now().line]?n(w):te(w)}function o(w){return t.enter("tableHead"),t.enter("tableRow"),l(w)}function l(w){return w===124||(s=!0,a+=1),f(w)}function f(w){return w===null?n(w):re(w)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),h):n(w):he(w)?be(t,f,"whitespace")(w):(a+=1,s&&(s=!1,i+=1),w===124?(t.enter("tableCellDivider"),t.consume(w),t.exit("tableCellDivider"),s=!0,f):(t.enter("data"),c(w)))}function c(w){return w===null||w===124||we(w)?(t.exit("data"),f(w)):(t.consume(w),w===92?p:c)}function p(w){return w===92||w===124?(t.consume(w),c):c(w)}function h(w){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(w):(t.enter("tableDelimiterRow"),s=!1,he(w)?be(t,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):m(w))}function m(w){return w===45||w===58?x(w):w===124?(s=!0,t.enter("tableCellDivider"),t.consume(w),t.exit("tableCellDivider"),b):v(w)}function b(w){return he(w)?be(t,x,"whitespace")(w):x(w)}function x(w){return w===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(w),t.exit("tableDelimiterMarker"),T):w===45?(a+=1,T(w)):w===null||re(w)?N(w):v(w)}function T(w){return w===45?(t.enter("tableDelimiterFiller"),k(w)):v(w)}function k(w){return w===45?(t.consume(w),k):w===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(w),t.exit("tableDelimiterMarker"),g):(t.exit("tableDelimiterFiller"),g(w))}function g(w){return he(w)?be(t,N,"whitespace")(w):N(w)}function N(w){return w===124?m(w):w===null||re(w)?!s||i!==a?v(w):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(w)):v(w)}function v(w){return n(w)}function C(w){return t.enter("tableRow"),R(w)}function R(w){return w===124?(t.enter("tableCellDivider"),t.consume(w),t.exit("tableCellDivider"),R):w===null||re(w)?(t.exit("tableRow"),e(w)):he(w)?be(t,R,"whitespace")(w):(t.enter("data"),M(w))}function M(w){return w===null||w===124||we(w)?(t.exit("data"),R(w)):(t.consume(w),w===92?U:M)}function U(w){return w===92||w===124?(t.consume(w),M):M(w)}}function Gy(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,f,c;const p=new Zy;for(;++n<t.length;){const h=t[n],m=h[1];h[0]==="enter"?m.type==="tableHead"?(u=!1,o!==0&&(ko(p,e,o,l,f),f=void 0,o=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",l,e]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",f,e]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],c=qr(p,e,a,i,void 0,c),a=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],c=qr(p,e,a,i,void 0,c)),a=s,s=[a[1],n,0,0])):m.type==="tableHead"?(u=!0,o=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(o=n,a[1]!==0?(s[0]=s[1],c=qr(p,e,a,i,n,c)):s[1]!==0&&(c=qr(p,e,s,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&ko(p,e,o,l,f),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=qy(e.events,n))}return t}function qr(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},_n(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=_n(e.events,n[1]);if(a={type:s,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const l=_n(e.events,n[2]),f=_n(e.events,n[3]),c={type:u,start:Object.assign({},l),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",c,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,b=n[3]-n[2]-1;t.add(m,b,[])}}t.add(n[3]+1,0,[["exit",c,e]])}return i!==void 0&&(a.end=Object.assign({},_n(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function ko(t,e,n,r,i){const a=[],s=_n(e.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),r.end=Object.assign({},s),a.push(["exit",r,e]),t.add(n+1,0,a)}function _n(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const Qy={name:"tasklistCheck",tokenize:Xy};function Ky(){return{text:{91:Qy}}}function Xy(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),a)}function a(o){return we(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),s):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),s):n(o)}function s(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return re(o)?e(o):he(o)?t.check({tokenize:Jy},e,n)(o):n(o)}}function Jy(t,e,n){return be(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function ek(t){return mc([Cy(),Py(),jy(t),Vy(),Ky()])}const tk={};function nk(t){const e=this,n=t||tk,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ek(n)),a.push(_y()),s.push(yy(n))}const rk=D.lazy(()=>ch(()=>import("./lazy-highlighter-B5RwvSZU.js"),__vite__mapDeps([0,1,2,3,4])));function Hd(){const t=X.c(3),[e,n]=D.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function ik(){const t=X.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=E.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(ak)}),t[1]=r):r=t[1],r}function ak(t,e){return E.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&E.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&E.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&E.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),E.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&E.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function sk(t){const e=X.c(12),n=D.useRef(null),{handleCopy:r,copied:i}=Hd(),a=uk;let s;e[0]!==r?(s=async()=>{const p=a(n.current);await r(p)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?E.jsx(un,{size:12}):E.jsx(_i,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=E.jsx("div",{className:"flex justify-end items-center",children:E.jsxs(Yt,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=l):l=e[6];let f;e[7]!==t?(f=E.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:E.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=f):f=e[8];let c;return e[9]!==l||e[10]!==f?(c=E.jsxs(E.Fragment,{children:[l,f]}),e[9]=l,e[10]=f,e[11]=c):c=e[11],c}function uk(t){return t?Array.from(t.querySelectorAll("tr")).map(ok).join(`
113
+ `))}function o(h,m,b,x){const T=b.enter("tableCell"),k=b.enter("phrasing"),g=b.containerPhrasing(h,{...x,before:a,after:a});return k(),T(),g}function l(h,m){return v3(h,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(h,m,b){const x=h.children;let T=-1;const k=[],g=m.enter("table");for(;++T<x.length;)k[T]=c(x[T],m,b);return g(),k}function c(h,m,b){const x=h.children;let T=-1;const k=[],g=m.enter("tableRow");for(;++T<x.length;)k[T]=o(x[T],h,m,b);return g(),k}function p(h,m,b){let x=Od.inlineCode(h,m,b);return b.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function by(){return{exit:{taskListCheckValueChecked:yo,taskListCheckValueUnchecked:yo,paragraph:Ty}}}function Ey(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xy}}}function yo(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function Ty(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let a=-1,s;for(;++a<i.length;){const u=i[a];if(u.type==="paragraph"){s=u;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function xy(t,e,n,r){const i=t.children[0],a=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);a&&u.move(s);let o=Od.listItem(t,e,n,{...r,...u.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),o;function l(f){return f+s}}function _y(){return[J_(),x3(),A3(),cy(),by()]}function yy(t){return{extensions:[e3(),_3(t),C3(),gy(t),Ey()]}}const ky={tokenize:wy,partial:!0},Ld={tokenize:vy,partial:!0},Dd={tokenize:Ry,partial:!0},Pd={tokenize:Oy,partial:!0},Ay={tokenize:Ly,partial:!0},Md={name:"wwwAutolink",tokenize:Iy,previous:Fd},Bd={name:"protocolAutolink",tokenize:Ny,previous:zd},Dt={name:"emailAutolink",tokenize:Sy,previous:Ud},It={};function Cy(){return{text:It}}let Kt=48;for(;Kt<123;)It[Kt]=Dt,Kt++,Kt===58?Kt=65:Kt===91&&(Kt=97);It[43]=Dt;It[45]=Dt;It[46]=Dt;It[95]=Dt;It[72]=[Dt,Bd];It[104]=[Dt,Bd];It[87]=[Dt,Md];It[119]=[Dt,Md];function Sy(t,e,n){const r=this;let i,a;return s;function s(c){return!ja(c)||!Ud.call(r,r.previous)||Fs(r.events)?n(c):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(c))}function u(c){return ja(c)?(t.consume(c),u):c===64?(t.consume(c),o):n(c)}function o(c){return c===46?t.check(Ay,f,l)(c):c===45||c===95||We(c)?(a=!0,t.consume(c),o):f(c)}function l(c){return t.consume(c),i=!0,o}function f(c){return a&&i&&Je(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(c)):n(c)}}function Iy(t,e,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Fd.call(r,r.previous)||Fs(r.events)?n(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(ky,t.attempt(Ld,t.attempt(Dd,a),n),n)(s))}function a(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function Ny(t,e,n){const r=this;let i="",a=!1;return s;function s(c){return(c===72||c===104)&&zd.call(r,r.previous)&&!Fs(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),t.consume(c),u):n(c)}function u(c){if(Je(c)&&i.length<5)return i+=String.fromCodePoint(c),t.consume(c),u;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(c),o}return n(c)}function o(c){return c===47?(t.consume(c),a?l:(a=!0,o)):n(c)}function l(c){return c===null||di(c)||we(c)||ln(c)||wi(c)?n(c):t.attempt(Ld,t.attempt(Dd,f),n)(c)}function f(c){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(c)}}function wy(t,e,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,t.consume(s),i):s===46&&r===3?(t.consume(s),a):n(s)}function a(s){return s===null?n(s):e(s)}}function vy(t,e,n){let r,i,a;return s;function s(l){return l===46||l===95?t.check(Pd,o,u)(l):l===null||we(l)||ln(l)||l!==45&&wi(l)?o(l):(a=!0,t.consume(l),s)}function u(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),s}function o(l){return i||r||!a?n(l):e(l)}}function Ry(t,e){let n=0,r=0;return i;function i(s){return s===40?(n++,t.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(Pd,e,a)(s):s===null||we(s)||ln(s)?e(s):(t.consume(s),i)}function a(s){return s===41&&r++,t.consume(s),i}}function Oy(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),a):u===93?(t.consume(u),i):u===60||u===null||we(u)||ln(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||we(u)||ln(u)?e(u):r(u)}function a(u){return Je(u)?s(u):n(u)}function s(u){return u===59?(t.consume(u),r):Je(u)?(t.consume(u),s):n(u)}}function Ly(t,e,n){return r;function r(a){return t.consume(a),i}function i(a){return We(a)?n(a):e(a)}}function Fd(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||we(t)}function zd(t){return!Je(t)}function Ud(t){return!(t===47||ja(t))}function ja(t){return t===43||t===45||t===46||t===95||We(t)}function Fs(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Dy={tokenize:$y,partial:!0};function Py(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:zy,continuation:{tokenize:Uy},exit:Hy}},text:{91:{name:"gfmFootnoteCall",tokenize:Fy},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:My,resolveTo:By}}}}function My(t,e,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){s=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return u;function u(o){if(!s||!s._balanced)return n(o);const l=Et(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!a.includes(l.slice(1))?n(o):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(o),t.exit("gfmFootnoteCallLabelMarker"),e(o))}}function By(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",a,e],["enter",s,e],["exit",s,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function Fy(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return u;function u(c){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),o}function o(c){return c!==94?n(c):(t.enter("gfmFootnoteCallMarker"),t.consume(c),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(c){if(a>999||c===93&&!s||c===null||c===91||we(c))return n(c);if(c===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(Et(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(c)}return we(c)||(s=!0),a++,t.consume(c),c===92?f:l}function f(c){return c===91||c===92||c===93?(t.consume(c),a++,l):l(c)}}function zy(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,u;return o;function o(m){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):n(m)}function f(m){if(s>999||m===93&&!u||m===null||m===91||we(m))return n(m);if(m===93){t.exit("chunkString");const b=t.exit("gfmFootnoteDefinitionLabelString");return a=Et(r.sliceSerialize(b)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return we(m)||(u=!0),s++,t.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(t.consume(m),s++,f):f(m)}function p(m){return m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),i.includes(a)||i.push(a),be(t,h,"gfmFootnoteDefinitionWhitespace")):n(m)}function h(m){return e(m)}}function Uy(t,e,n){return t.check(Or,e,t.attempt(Dy,e,n))}function Hy(t){t.exit("gfmFootnoteDefinition")}function $y(t,e,n){const r=this;return be(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(a):n(a)}}function jy(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,u){let o=-1;for(;++o<s.length;)if(s[o][0]==="enter"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._close){let l=o;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[o][1].end.offset-s[o][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[o][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[o][1].end)},c={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[o][1].start)},p=[["enter",f,u],["enter",s[l][1],u],["exit",s[l][1],u],["enter",c,u]],h=u.parser.constructs.insideSpan.null;h&&ct(p,p.length,0,vi(h,s.slice(l+1,o),u)),ct(p,p.length,0,[["exit",c,u],["enter",s[o][1],u],["exit",s[o][1],u],["exit",f,u]]),ct(s,l-1,o-l+3,p),o=l+p.length-2;break}}for(o=-1;++o<s.length;)s[o][1].type==="strikethroughSequenceTemporary"&&(s[o][1].type="data");return s}function a(s,u,o){const l=this.previous,f=this.events;let c=0;return p;function p(m){return l===126&&f[f.length-1][1].type!=="characterEscape"?o(m):(s.enter("strikethroughSequenceTemporary"),h(m))}function h(m){const b=wn(l);if(m===126)return c>1?o(m):(s.consume(m),c++,h);if(c<2&&!n)return o(m);const x=s.exit("strikethroughSequenceTemporary"),T=wn(m);return x._open=!T||T===2&&!!b,x._close=!b||b===2&&!!T,u(m)}}}class Zy{constructor(){this.map=[]}add(e,n,r){Yy(this,e,n,r)}consume(e){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const a of i)e.push(a);i=r.pop()}this.map.length=0}}function Yy(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function qy(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function Vy(){return{flow:{null:{name:"table",tokenize:Wy,resolveAll:Gy}}}}function Wy(t,e,n){const r=this;let i=0,a=0,s;return u;function u(w){let P=r.events.length-1;for(;P>-1;){const Z=r.events[P][1].type;if(Z==="lineEnding"||Z==="linePrefix")P--;else break}const H=P>-1?r.events[P][1].type:null,te=H==="tableHead"||H==="tableRow"?C:o;return te===C&&r.parser.lazy[r.now().line]?n(w):te(w)}function o(w){return t.enter("tableHead"),t.enter("tableRow"),l(w)}function l(w){return w===124||(s=!0,a+=1),f(w)}function f(w){return w===null?n(w):re(w)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),h):n(w):he(w)?be(t,f,"whitespace")(w):(a+=1,s&&(s=!1,i+=1),w===124?(t.enter("tableCellDivider"),t.consume(w),t.exit("tableCellDivider"),s=!0,f):(t.enter("data"),c(w)))}function c(w){return w===null||w===124||we(w)?(t.exit("data"),f(w)):(t.consume(w),w===92?p:c)}function p(w){return w===92||w===124?(t.consume(w),c):c(w)}function h(w){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(w):(t.enter("tableDelimiterRow"),s=!1,he(w)?be(t,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):m(w))}function m(w){return w===45||w===58?x(w):w===124?(s=!0,t.enter("tableCellDivider"),t.consume(w),t.exit("tableCellDivider"),b):v(w)}function b(w){return he(w)?be(t,x,"whitespace")(w):x(w)}function x(w){return w===58?(a+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(w),t.exit("tableDelimiterMarker"),T):w===45?(a+=1,T(w)):w===null||re(w)?N(w):v(w)}function T(w){return w===45?(t.enter("tableDelimiterFiller"),k(w)):v(w)}function k(w){return w===45?(t.consume(w),k):w===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(w),t.exit("tableDelimiterMarker"),g):(t.exit("tableDelimiterFiller"),g(w))}function g(w){return he(w)?be(t,N,"whitespace")(w):N(w)}function N(w){return w===124?m(w):w===null||re(w)?!s||i!==a?v(w):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(w)):v(w)}function v(w){return n(w)}function C(w){return t.enter("tableRow"),R(w)}function R(w){return w===124?(t.enter("tableCellDivider"),t.consume(w),t.exit("tableCellDivider"),R):w===null||re(w)?(t.exit("tableRow"),e(w)):he(w)?be(t,R,"whitespace")(w):(t.enter("data"),M(w))}function M(w){return w===null||w===124||we(w)?(t.exit("data"),R(w)):(t.consume(w),w===92?U:M)}function U(w){return w===92||w===124?(t.consume(w),M):M(w)}}function Gy(t,e){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],u=!1,o=0,l,f,c;const p=new Zy;for(;++n<t.length;){const h=t[n],m=h[1];h[0]==="enter"?m.type==="tableHead"?(u=!1,o!==0&&(ko(p,e,o,l,f),f=void 0,o=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",l,e]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,a=[0,0,0,0],s=[0,n+1,0,0],u&&(u=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(n,0,[["enter",f,e]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],c=qr(p,e,a,i,void 0,c),a=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],c=qr(p,e,a,i,void 0,c)),a=s,s=[a[1],n,0,0])):m.type==="tableHead"?(u=!0,o=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(o=n,a[1]!==0?(s[0]=s[1],c=qr(p,e,a,i,n,c)):s[1]!==0&&(c=qr(p,e,s,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(o!==0&&ko(p,e,o,l,f),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=qy(e.events,n))}return t}function qr(t,e,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(a.end=Object.assign({},_n(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const o=_n(e.events,n[1]);if(a={type:s,start:Object.assign({},o),end:Object.assign({},o)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const l=_n(e.events,n[2]),f=_n(e.events,n[3]),c={type:u,start:Object.assign({},l),end:Object.assign({},f)};if(t.add(n[2],0,[["enter",c,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,b=n[3]-n[2]-1;t.add(m,b,[])}}t.add(n[3]+1,0,[["exit",c,e]])}return i!==void 0&&(a.end=Object.assign({},_n(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function ko(t,e,n,r,i){const a=[],s=_n(e.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,e])),r.end=Object.assign({},s),a.push(["exit",r,e]),t.add(n+1,0,a)}function _n(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const Qy={name:"tasklistCheck",tokenize:Xy};function Ky(){return{text:{91:Qy}}}function Xy(t,e,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),a)}function a(o){return we(o)?(t.enter("taskListCheckValueUnchecked"),t.consume(o),t.exit("taskListCheckValueUnchecked"),s):o===88||o===120?(t.enter("taskListCheckValueChecked"),t.consume(o),t.exit("taskListCheckValueChecked"),s):n(o)}function s(o){return o===93?(t.enter("taskListCheckMarker"),t.consume(o),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(o)}function u(o){return re(o)?e(o):he(o)?t.check({tokenize:Jy},e,n)(o):n(o)}}function Jy(t,e,n){return be(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function ek(t){return mc([Cy(),Py(),jy(t),Vy(),Ky()])}const tk={};function nk(t){const e=this,n=t||tk,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ek(n)),a.push(_y()),s.push(yy(n))}const rk=D.lazy(()=>ch(()=>import("./lazy-highlighter-DlCJvY4E.js"),__vite__mapDeps([0,1,2,3,4])));function Hd(){const t=X.c(3),[e,n]=D.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function ik(){const t=X.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=E.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(ak)}),t[1]=r):r=t[1],r}function ak(t,e){return E.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&E.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&E.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&E.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),E.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&E.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function sk(t){const e=X.c(12),n=D.useRef(null),{handleCopy:r,copied:i}=Hd(),a=uk;let s;e[0]!==r?(s=async()=>{const p=a(n.current);await r(p)},e[0]=r,e[1]=s):s=e[1];const u=s;let o;e[2]!==i?(o=i?E.jsx(un,{size:12}):E.jsx(_i,{size:12}),e[2]=i,e[3]=o):o=e[3];let l;e[4]!==u||e[5]!==o?(l=E.jsx("div",{className:"flex justify-end items-center",children:E.jsxs(Yt,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",o]})}),e[4]=u,e[5]=o,e[6]=l):l=e[6];let f;e[7]!==t?(f=E.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:E.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=f):f=e[8];let c;return e[9]!==l||e[10]!==f?(c=E.jsxs(E.Fragment,{children:[l,f]}),e[9]=l,e[10]=f,e[11]=c):c=e[11],c}function uk(t){return t?Array.from(t.querySelectorAll("tr")).map(ok).join(`
114
114
  `):""}function ok(t){return Array.from(t.querySelectorAll("th,td")).map(lk).join(",")}function lk(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const ck=[nk],dk=[V_],fk={p:t=>E.jsx("p",{...t,className:"leading-relaxed text-sm"}),strong:t=>E.jsx("strong",{...t,className:"font-bold"}),em:t=>E.jsx("em",{...t,className:"italic"}),a:t=>E.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>E.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>E.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>E.jsx("li",{...t,className:"leading-relaxed text-sm"}),code:t=>E.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-sm font-mono break-all"}),pre:t=>E.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:E.jsx("code",{className:"flex-1 min-w-0 p-4 text-sm font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>E.jsx(sk,{...t}),thead:t=>E.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>E.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>E.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>E.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},$d=D.memo(t=>{const e=X.c(2),{content:n}=t;let r;return e[0]!==n?(r=E.jsx(R2,{remarkPlugins:ck,rehypePlugins:dk,components:fk,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function hk(t){const e=X.c(20),{language:n,content:r}=t,{handleCopy:i,copied:a}=Hd(),s=n||"text";let u;e[0]!==s?(u=E.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:s}),e[0]=s,e[1]=u):u=e[1];let o;e[2]!==r||e[3]!==i?(o=()=>i(r),e[2]=r,e[3]=i,e[4]=o):o=e[4];let l;e[5]!==a?(l=a?E.jsx(un,{size:14}):E.jsx(_i,{size:14}),e[5]=a,e[6]=l):l=e[6];let f;e[7]!==o||e[8]!==l?(f=E.jsx(Yt,{size:"icon",variant:"ghost",onClick:o,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:l}),e[7]=o,e[8]=l,e[9]=f):f=e[9];let c;e[10]!==u||e[11]!==f?(c=E.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,f]}),e[10]=u,e[11]=f,e[12]=c):c=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=E.jsx(ik,{}),e[13]=p):p=e[13];let h;e[14]!==r||e[15]!==n?(h=E.jsx(D.Suspense,{fallback:p,children:E.jsx(rk,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let m;return e[17]!==c||e[18]!==h?(m=E.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[c,h]}),e[17]=c,e[18]=h,e[19]=m):m=e[19],m}$d.displayName="MemoizedMarkdownBlock";const zs=t=>{const e=X.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=Ae.lexer(r),e[0]=r,e[1]=i):i=e[1];const a=i;let s;if(e[2]!==a||e[3]!==n){let u;e[5]!==n?(u=(o,l)=>o.type==="code"?E.jsx(hk,{language:o.lang,content:o.text},`${n}-block_${l}`):E.jsx($d,{content:o.raw},`${n}-block_${l}`),e[5]=n,e[6]=u):u=e[6],s=a.map(u),e[2]=a,e[3]=n,e[4]=s}else s=e[4];return s};zs.displayName="MemoizedMarkdown";function pk(t,e){switch(e.type){case"TOGGLE":return{isExpanded:!t.isExpanded,wasManuallyToggled:!0};case"SET_EXPANDED":return t.wasManuallyToggled?t:{...t,isExpanded:e.payload};default:return t}}function mk(t){const e=X.c(38),{part:n,id:r}=t,{state:i}=n,a=i==="streaming";let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={isExpanded:!1,wasManuallyToggled:!1},e[0]=s):s=e[0];const[u,o]=D.useReducer(pk,s),{isExpanded:l}=u;let f,c;e[1]!==a?(f=()=>{o({type:"SET_EXPANDED",payload:a})},c=[a],e[1]=a,e[2]=f,e[3]=c):(f=e[2],c=e[3]),D.useEffect(f,c);let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{o({type:"TOGGLE"})},e[4]=p):p=e[4];const h=p,m=a&&"animate-pulse";let b;e[5]!==m?(b=ue("text-muted-foreground transition-opacity",m),e[5]=m,e[6]=b):b=e[6];let x;e[7]!==b?(x=E.jsx(ki,{className:b}),e[7]=b,e[8]=x):x=e[8];const T=a&&"text-shimmer";let k;e[9]!==T?(k=ue("text-sm font-medium text-muted-foreground",T),e[9]=T,e[10]=k):k=e[10];let g;e[11]!==k?(g=E.jsx("span",{className:k,children:"Agent thinking"}),e[11]=k,e[12]=g):g=e[12];const N=l?"rotate-180":"";let v;e[13]!==N?(v=ue("text-muted-foreground transition-transform duration-200",N),e[13]=N,e[14]=v):v=e[14];let C;e[15]!==v?(C=E.jsx(ml,{className:v}),e[15]=v,e[16]=C):C=e[16];let R;e[17]!==g||e[18]!==C||e[19]!==x?(R=E.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-2 py-2 transition-colors cursor-pointer",children:[x,g,C]}),e[17]=g,e[18]=C,e[19]=x,e[20]=R):R=e[20];const M=l?a?"max-h-[400px] opacity-100":"max-h-[200px] opacity-80":"max-h-0 opacity-0 overflow-hidden";let U;e[21]!==M?(U=ue("transition-all duration-200 ease-in-out",M),e[21]=M,e[22]=U):U=e[22];const w=a?"max-h-[400px]":"max-h-[200px]";let P;e[23]!==w?(P=ue("border-l-2 pl-4 overflow-y-auto",w),e[23]=w,e[24]=P):P=e[24];let H;e[25]===Symbol.for("react.memo_cache_sentinel")?(H=ue("text-muted-foreground markdown-sm pb-2"),e[25]=H):H=e[25];let te;e[26]!==r||e[27]!==n.text?(te=E.jsx("div",{className:H,children:E.jsx(zs,{id:r,text:n.text})}),e[26]=r,e[27]=n.text,e[28]=te):te=e[28];let Z;e[29]!==P||e[30]!==te?(Z=E.jsx("div",{className:P,children:te}),e[29]=P,e[30]=te,e[31]=Z):Z=e[31];let z;e[32]!==U||e[33]!==Z?(z=E.jsx("div",{className:U,children:Z}),e[32]=U,e[33]=Z,e[34]=z):z=e[34];let Q;return e[35]!==R||e[36]!==z?(Q=E.jsxs("div",{className:"flex flex-col",children:[R,z]}),e[35]=R,e[36]=z,e[37]=Q):Q=e[37],Q}function gk(){const t=X.c(3),[e,n]=D.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async s=>{await navigator.clipboard.writeText(s),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const i=r;let a;return t[1]!==e?(a={handleCopy:i,copied:e},t[1]=e,t[2]=a):a=t[2],a}function jd(t){const e=X.c(15),{id:n,text:r,copyable:i,extraActions:a}=t,s=i===void 0?!1:i,{handleCopy:u}=gk(),[o,l]=D.useState(!1);let f;e[0]!==u||e[1]!==r?(f=async()=>{await u(r),l(!0),setTimeout(()=>l(!1),2e3)},e[0]=u,e[1]=r,e[2]=f):f=e[2];const c=f,p=s||a;let h;e[3]!==n||e[4]!==r?(h=E.jsx(zs,{id:n,text:r}),e[3]=n,e[4]=r,e[5]=h):h=e[5];let m;e[6]!==s||e[7]!==a||e[8]!==c||e[9]!==o||e[10]!==p?(m=p&&E.jsx("div",{className:"flex w-full items-center text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto mt-2",children:E.jsxs("div",{className:"flex items-center gap-1",children:[s&&E.jsx(Yt,{onClick:c,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:o?E.jsx(un,{size:12}):E.jsx(_i,{size:12})}),a]})}),e[6]=s,e[7]=a,e[8]=c,e[9]=o,e[10]=p,e[11]=m):m=e[11];let b;return e[12]!==h||e[13]!==m?(b=E.jsxs("div",{className:"group/part relative",children:[h,m]}),e[12]=h,e[13]=m,e[14]=b):b=e[14],b}function bk(t){const e=X.c(28),{toolName:n,input:r,output:i,isError:a}=t;let s;if(e[0]!==i){const l=JSON.stringify(i,null,2);s=l.length>2e3?l.slice(0,2e3)+"...[TRUNCATED]":l,e[0]=i,e[1]=s}else s=e[1];const u=s;if(n==="READ_MCP_TOOLS"){const l=r?.id;if(l){let f;return e[2]!==l?(f=E.jsx(Ao,{connectionId:l}),e[2]=l,e[3]=f):f=e[3],f}}if(n==="CALL_MCP_TOOL"){const l=r?.connectionId;let f;e[4]!==l?(f=l&&E.jsx(Ao,{connectionId:l,compact:!0}),e[4]=l,e[5]=f):f=e[5];let c;e[6]!==i?(c=JSON.stringify(i,null,2),e[6]=i,e[7]=c):c=e[7];let p;e[8]!==c?(p=E.jsx("div",{className:"absolute top-1 right-1 z-10",children:E.jsx(Ek,{text:c})}),e[8]=c,e[9]=p):p=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=E.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider",children:"Input"}),e[10]=h):h=e[10];let m;e[11]!==r?(m=JSON.stringify(r,null,2),e[11]=r,e[12]=m):m=e[12];let b;e[13]!==m?(b=E.jsx("pre",{className:"whitespace-pre-wrap break-all text-muted-foreground mb-2",children:m}),e[13]=m,e[14]=b):b=e[14];let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=E.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider",children:"Output"}),e[15]=x):x=e[15];const T=`whitespace-pre-wrap break-all ${a?"text-destructive":"text-foreground"}`;let k;e[16]!==u||e[17]!==T?(k=E.jsx("pre",{className:T,children:u}),e[16]=u,e[17]=T,e[18]=k):k=e[18];let g;e[19]!==k||e[20]!==p||e[21]!==b?(g=E.jsxs("div",{className:"relative bg-muted rounded-md p-2 text-xs font-mono overflow-auto max-h-[200px]",children:[p,h,b,x,k]}),e[19]=k,e[20]=p,e[21]=b,e[22]=g):g=e[22];let N;return e[23]!==g||e[24]!==f?(N=E.jsxs("div",{className:"flex flex-col gap-2",children:[f,g]}),e[23]=g,e[24]=f,e[25]=N):N=e[25],N}let o;return e[26]!==u?(o=E.jsx("div",{className:"bg-muted rounded-md p-2 text-xs font-mono overflow-auto max-h-[200px]",children:E.jsx("pre",{className:"whitespace-pre-wrap break-all",children:u})}),e[26]=u,e[27]=o):o=e[27],o}function Ao(t){const e=X.c(15),{connectionId:n,compact:r}=t,i=vh(n),{org:a}=Dn(),{slug:s}=a,u=dh();if(!i)return null;let o;e[0]!==i.id||e[1]!==u||e[2]!==s?(o=()=>{u({to:"/$org/mcps/$connectionId",params:{org:s,connectionId:i.id}})},e[0]=i.id,e[1]=u,e[2]=s,e[3]=o):o=e[3];const l=o;if(r){let c;e[4]!==i.title?(c=E.jsx("span",{className:"font-medium text-foreground",children:i.title}),e[4]=i.title,e[5]=c):c=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=E.jsx(Zh,{size:12}),e[6]=p):p=e[6];let h;e[7]!==l?(h=E.jsx("button",{type:"button",onClick:l,className:"hover:text-foreground transition-colors",title:"Open connection",children:p}),e[7]=l,e[8]=h):h=e[8];let m;return e[9]!==c||e[10]!==h?(m=E.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 px-2 py-1 rounded-md w-fit",children:[c,h]}),e[9]=c,e[10]=h,e[11]=m):m=e[11],m}let f;return e[12]!==i||e[13]!==l?(f=E.jsx(jh,{connection:i,onClick:l}),e[12]=i,e[13]=l,e[14]=f):f=e[14],f}function Ek({text:t}){const e=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(t),Qr.success("Copied to clipboard");else throw new Error("Clipboard API unavailable")}catch(n){try{const r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.left="-9999px",r.style.top="0",document.body.appendChild(r),r.focus(),r.select();const i=document.execCommand("copy");if(document.body.removeChild(r),i)Qr.success("Copied to clipboard");else throw new Error("Fallback copy failed")}catch(r){console.error("Copy failed",n,r),Qr.error("Failed to copy to clipboard")}}};return E.jsx(Yt,{size:"icon",variant:"ghost",className:"h-5 w-5 hover:bg-background/50",onClick:e,children:E.jsx(_i,{size:12})})}function Tk(t){const e=X.c(39),{part:n}=t,{state:r}=n;let i;e[0]!==n?(i="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=i):i=e[1];const a=i;let s;e[2]!==r?(s=r==="output-error"?E.jsx($h,{className:"h-3.5 w-3.5 text-destructive"}):E.jsx(Bl,{className:"h-3.5 w-3.5"}),e[2]=r,e[3]=s):s=e[3];const u=r==="output-error"&&"text-destructive/90";let o;e[4]!==u?(o=ue(u),e[4]=u,e[5]=o):o=e[5];const l=r==="input-streaming"&&`Streaming ${a} arguments`,f=r==="input-available"&&`Calling ${a}`,c=r==="output-available"&&`Called ${a}`,p=r==="output-error"&&`Error calling ${a}`;let h;e[6]!==o||e[7]!==l||e[8]!==f||e[9]!==c||e[10]!==p?(h=E.jsxs("span",{className:o,children:[l,f,c,p]}),e[6]=o,e[7]=l,e[8]=f,e[9]=c,e[10]=p,e[11]=h):h=e[11];let m;e[12]!==r?(m=(r==="input-streaming"||r==="input-available")&&E.jsx("span",{className:"animate-spin",children:E.jsx(Yh,{size:"xs"})}),e[12]=r,e[13]=m):m=e[13];let b;e[14]!==m||e[15]!==s||e[16]!==h?(b=E.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[s,h,m]}),e[14]=m,e[15]=s,e[16]=h,e[17]=b):b=e[17];const x=r==="output-error"?"border-destructive/50":"border-border";let T;e[18]!==x?(T=ue("transition-all duration-200 ease-in-out","border-l-2 pl-3",x),e[18]=x,e[19]=T):T=e[19];let k;e[20]!==n.input||e[21]!==r?(k=(r==="input-streaming"||r==="input-available")&&!!n.input&&E.jsx("div",{className:"text-xs font-mono text-muted-foreground bg-muted/30 p-2 rounded",children:JSON.stringify(n.input,null,2)}),e[20]=n.input,e[21]=r,e[22]=k):k=e[22];let g;e[23]!==n.input||e[24]!==n.output||e[25]!==r||e[26]!==a?(g=r==="output-available"&&E.jsx(bk,{toolName:a,input:n.input,output:n.output}),e[23]=n.input,e[24]=n.output,e[25]=r,e[26]=a,e[27]=g):g=e[27];let N;e[28]!==n||e[29]!==r?(N=r==="output-error"&&E.jsx("div",{className:"text-xs font-mono bg-destructive/10 text-destructive p-2 rounded border border-destructive/20",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"}),e[28]=n,e[29]=r,e[30]=N):N=e[30];let v;e[31]!==T||e[32]!==k||e[33]!==g||e[34]!==N?(v=E.jsxs("div",{className:T,children:[k,g,N]}),e[31]=T,e[32]=k,e[33]=g,e[34]=N,e[35]=v):v=e[35];let C;return e[36]!==b||e[37]!==v?(C=E.jsxs("div",{className:"flex flex-col gap-1.5 py-1",children:[b,v]}),e[36]=b,e[37]=v,e[38]=C):C=e[38],C}const xk={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function _k(t){if(!t?.providerMetadata)return null;for(const e of Object.values(xk)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function yk(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+(_k(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function Zd(t){const e=X.c(38),{messages:n}=t;let r,i,a,s,u,o,l,f,c,p,h,m;if(e[0]!==n){m=Symbol.for("react.early_return_sentinel");e:{const N=yk(n);if(!N){m=null;break e}const{totalTokens:v,inputTokens:C,outputTokens:R,cost:M}=N;if(a=M,!v&&!C&&!R){m=null;break e}i=cl;let U;e[13]===Symbol.for("react.memo_cache_sentinel")?(U=E.jsx(Nl,{size:12}),e[13]=U):U=e[13];const w=E.jsxs(Yt,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap",children:[U,E.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:v.toLocaleString()})]});e[14]!==w?(h=E.jsx(dl,{asChild:!0,children:w}),e[14]=w,e[15]=h):h=e[15],r=fl,c="top",p="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(o=E.jsx("span",{className:"text-muted",children:"in"}),e[16]=o):o=e[16],l=E.jsx("span",{children:C.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(f=E.jsx("span",{className:"text-muted",children:"out"}),e[17]=f):f=e[17],s=R.toLocaleString()}e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=s,e[5]=u,e[6]=o,e[7]=l,e[8]=f,e[9]=c,e[10]=p,e[11]=h,e[12]=m}else r=e[1],i=e[2],a=e[3],s=e[4],u=e[5],o=e[6],l=e[7],f=e[8],c=e[9],p=e[10],h=e[11],m=e[12];if(m!==Symbol.for("react.early_return_sentinel"))return m;let b;e[18]!==s?(b=E.jsx("span",{children:s}),e[18]=s,e[19]=b):b=e[19];let x;e[20]!==a?(x=a>0&&E.jsxs(E.Fragment,{children:[E.jsx("span",{className:"text-muted",children:"cost"}),E.jsxs("span",{children:["$",a.toFixed(4)]})]}),e[20]=a,e[21]=x):x=e[21];let T;e[22]!==b||e[23]!==x||e[24]!==u||e[25]!==o||e[26]!==l||e[27]!==f?(T=E.jsxs("div",{className:u,children:[o,l,f,b,x]}),e[22]=b,e[23]=x,e[24]=u,e[25]=o,e[26]=l,e[27]=f,e[28]=T):T=e[28];let k;e[29]!==r||e[30]!==T||e[31]!==c||e[32]!==p?(k=E.jsx(r,{side:c,className:p,children:T}),e[29]=r,e[30]=T,e[31]=c,e[32]=p,e[33]=k):k=e[33];let g;return e[34]!==i||e[35]!==k||e[36]!==h?(g=E.jsxs(i,{children:[h,k]}),e[34]=i,e[35]=k,e[36]=h,e[37]=g):g=e[37],g}const kk={planning:{icon:E.jsx(Ml,{className:"text-muted-foreground animate-pulse",size:20}),label:"Planning next moves"},thinking:{icon:E.jsx(ki,{className:"text-muted-foreground animate-pulse",size:20}),label:"Thinking"}},Ak=1200;function Ck(){const t=X.c(7),[e,n]=D.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const o=setTimeout(()=>{n("thinking")},Ak);return()=>{clearTimeout(o)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),D.useEffect(r,i);const a=kk[e];let s;t[2]!==a.label?(s=E.jsxs("span",{className:"text-sm font-medium text-muted-foreground text-shimmer",children:[a.label,"..."]}),t[2]=a.label,t[3]=s):s=t[3];let u;return t[4]!==a.icon||t[5]!==s?(u=E.jsxs("div",{className:"flex items-center gap-2 py-2",children:[a.icon,s]}),t[4]=a.icon,t[5]=s,t[6]=u):u=t[6],u}function Sk(t){const e=X.c(5),{duration:n}=t,r=n/1e3;let i;e[0]!==r?(i=r.toFixed(1),e[0]=r,e[1]=i):i=e[1];const a=i;let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=E.jsx(Ol,{className:"text-muted-foreground",size:16}),e[2]=s):s=e[2];let u;return e[3]!==a?(u=E.jsxs("div",{className:"flex items-center gap-2 py-2 opacity-60",children:[s,E.jsxs("span",{className:"text-xs text-muted-foreground",children:["Thought · ",a,"s"]})]}),e[3]=a,e[4]=u):u=e[4],u}function Ik(t,e,n,r){const i=t.type.startsWith("tool-")||t.type==="dynamic-tool";if(t.type==="step-start"||t.type==="file"||t.type==="source-url"||t.type==="source-document")return null;if(i)return E.jsx(Tk,{part:t,id:e},`${e}-${n}`);switch(t.type){case"text":return E.jsx(jd,{id:e,text:t.text,copyable:!0,extraActions:r},`${e}-${n}`);case"reasoning":return E.jsx(mk,{part:t,id:e},`${e}-${n}`)}throw new Error(`Unknown part type: ${t.type}`)}function Nk(t){const e=X.c(27),{message:n,status:r,className:i}=t,{id:a,parts:s}=n,l=r==="streaming"||r==="submitted",f=D.useRef(null);let c;e[0]!==a?(c=()=>{const w=localStorage.getItem(`msg-duration-${a}`);return w?Number(w):null},e[0]=a,e[1]=c):c=e[1];const[p,h]=D.useState(c);let m,b;e[2]!==l?(m=()=>{l&&f.current===null&&(f.current=Date.now())},b=[l],e[2]=l,e[3]=m,e[4]=b):(m=e[3],b=e[4]),D.useEffect(m,b);let x,T;e[5]!==p||e[6]!==a||e[7]!==s.length?(x=()=>{if(s.length>0&&p===null&&f.current!==null){const w=Date.now()-f.current;h(w),localStorage.setItem(`msg-duration-${a}`,w.toString())}},T=[s.length,p,a],e[5]=p,e[6]=a,e[7]=s.length,e[8]=x,e[9]=T):(x=e[8],T=e[9]),D.useEffect(x,T);const k=s.length>0,g=k&&!l&&p!==null;let N;e[10]!==n?(N=E.jsx(Zd,{messages:[n]}),e[10]=n,e[11]=N):N=e[11];const v=N;let C;e[12]!==i?(C=ue("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",i),e[12]=i,e[13]=C):C=e[13];let R;e[14]!==p||e[15]!==k||e[16]!==a||e[17]!==l||e[18]!==s||e[19]!==g||e[20]!==v?(R=k?E.jsxs(E.Fragment,{children:[g&&E.jsx(Sk,{duration:p}),s.map((w,P)=>Ik(w,a,P,P===s.length-1?v:void 0))]}):l?E.jsx(Ck,{}):null,e[14]=p,e[15]=k,e[16]=a,e[17]=l,e[18]=s,e[19]=g,e[20]=v,e[21]=R):R=e[21];let M;e[22]!==R?(M=E.jsx("div",{className:"flex flex-col gap-2 min-w-0 w-full items-start",children:E.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-sm wrap-break-word overflow-wrap-anywhere bg-transparent",children:R})}),e[22]=R,e[23]=M):M=e[23];let U;return e[24]!==C||e[25]!==M?(U=E.jsx("div",{className:C,children:M}),e[24]=C,e[25]=M,e[26]=U):U=e[26],U}const Yd=D.createContext(null);function qd(t){const e=X.c(2),{children:n}=t;let r;return e[0]!==n?(r=E.jsx(E.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function wk(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!D.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const a=t[n-1],s=D.isValidElement(a)&&a.props?.message?.role,u=a&&D.isValidElement(a)&&s==="user"?a:null;e.push({user:u,assistant:r})}}return e}function vk(t){const e=X.c(27),{children:n,className:r,minHeightOffset:i}=t,a=D.useRef(null);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[0]=s):s=e[0];const u=D.useRef(s);let o,l,f,c,p,h,m;if(e[1]!==n||e[2]!==r||e[3]!==i){const k=D.Children.toArray(n),g=k[k.length-1];l=g&&D.isValidElement(g)&&g.type===qd?g:null;const N=l?k.slice(0,-1):k,v=wk(N);let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=M=>{const U=u.current[M];if(U&&a.current){const w=a.current.offsetTop,P=U.offsetTop;a.current.scrollTo({top:P-w,behavior:"smooth"})}},e[11]=C):C=e[11];const R=C;o=Yd.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(m={scrollToPair:R},e[12]=m):m=e[12],p=a,e[13]!==r?(h=ue("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=h):h=e[14],f="flex flex-col min-w-0 max-w-2xl mx-auto w-full",c=v.map((M,U)=>{const w=U===v.length-1;return E.jsxs("div",{ref:P=>{u.current[U]=P},className:"flex flex-col gap-2 pb-2",style:w&&i?{minHeight:`calc(100vh - ${i}px)`}:void 0,children:[E.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),E.jsx("div",{className:"sticky top-4 z-50",children:M.user&&D.isValidElement(M.user)?D.cloneElement(M.user,{pairIndex:U}):M.user}),M.assistant]},U)}),e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=f,e[7]=c,e[8]=p,e[9]=h,e[10]=m}else o=e[4],l=e[5],f=e[6],c=e[7],p=e[8],h=e[9],m=e[10];let b;e[15]!==l||e[16]!==f||e[17]!==c?(b=E.jsxs("div",{className:f,children:[c,l]}),e[15]=l,e[16]=f,e[17]=c,e[18]=b):b=e[18];let x;e[19]!==p||e[20]!==h||e[21]!==b?(x=E.jsx("div",{ref:p,className:h,children:b}),e[19]=p,e[20]=h,e[21]=b,e[22]=x):x=e[22];let T;return e[23]!==o||e[24]!==m||e[25]!==x?(T=E.jsx(o,{value:m,children:x}),e[23]=o,e[24]=m,e[25]=x,e[26]=T):T=e[26],T}function Rk(t){const e=X.c(29),{message:n,className:r,pairIndex:i}=t,{id:a,parts:s}=n,u=D.useRef(null),o=D.useContext(Yd),[l,f]=D.useState(!1);if(!s||s.length===0)return null;const p=s.reduce(Ok,0)>60;let h;e[0]!==o||e[1]!==i?(h=()=>{i!==void 0&&o?.scrollToPair(i)},e[0]=o,e[1]=i,e[2]=h):h=e[2];const m=h;let b;e[3]!==r?(b=ue("message-block w-full min-w-0 group relative flex items-start gap-4 px-2 text-foreground flex-row-reverse",r),e[3]=r,e[4]=b):b=e[4];const x=p&&!l&&"overflow-hidden relative max-h-[60px]";let T;e[5]!==x?(T=ue(x),e[5]=x,e[6]=T):T=e[6];let k;if(e[7]!==a||e[8]!==s){let M;e[10]!==a?(M=(U,w)=>U.type==="text"?E.jsx(jd,{id:a,text:U.text},`${a}-${w}`):null,e[10]=a,e[11]=M):M=e[11],k=s.map(M),e[7]=a,e[8]=s,e[9]=k}else k=e[9];let g;e[12]!==l||e[13]!==p?(g=p&&!l&&E.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-muted to-transparent pointer-events-none"}),e[12]=l,e[13]=p,e[14]=g):g=e[14];let N;e[15]!==T||e[16]!==k||e[17]!==g?(N=E.jsxs("div",{className:T,children:[k,g]}),e[15]=T,e[16]=k,e[17]=g,e[18]=N):N=e[18];let v;e[19]!==l||e[20]!==p?(v=p&&E.jsx("div",{className:"flex justify-center",children:E.jsx(Yt,{onClick:M=>{M.stopPropagation(),f(!l)},variant:"ghost",size:"xs",className:"text-xs w-full text-muted-foreground hover:text-foreground",children:l?E.jsx(zh,{className:"text-sm"}):E.jsx(ml,{className:"text-sm"})})}),e[19]=l,e[20]=p,e[21]=v):v=e[21];let C;e[22]!==m||e[23]!==N||e[24]!==v?(C=E.jsxs("div",{onClick:m,className:"w-full border min-w-0 shadow-[0_3px_6px_-1px_rgba(0,0,0,0.1)] rounded-lg text-[0.9375rem] break-words overflow-wrap-anywhere bg-muted px-4 py-2 cursor-pointer transition-colors",children:[N,v]}),e[22]=m,e[23]=N,e[24]=v,e[25]=C):C=e[25];let R;return e[26]!==b||e[27]!==C?(R=E.jsxs("div",{ref:u,className:b,children:[" ",C]}),e[26]=b,e[27]=C,e[28]=R):R=e[28],R}function Ok(t,e){return e.type==="text"?t+e.text.length:t}function Lk(t,e){const n=X.c(4);let r;n[0]!==e?(r={},n[0]=e,n[1]=r):r=n[1];const i=r,a=t??Rh;let s;return n[2]!==a?(s=Lh(a),n[2]=a,n[3]=s):s=n[3],Oh(a,"LLM",s,i)}function Dk(){const t=X.c(8),e=Dh();let n;t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1];const[r]=Wh(n),i=Lk(r?.id);if(!i||!r){let s;return t[2]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[2]=s):s=t[2],s}let a;if(t[3]!==r||t[4]!==i){let s;t[6]!==r?(s=u=>({...u,name:u.title,contextWindow:u.limits?.contextWindow,outputLimit:u.limits?.maxOutputTokens,inputCost:u.costs?.input,outputCost:u.costs?.output,provider:u.provider,connectionId:r.id,connectionName:r.title}),t[6]=r,t[7]=s):s=t[7],a=i.map(s).sort(Pk),t[3]=r,t[4]=i,t[5]=a}else a=t[5];return a}function Pk(t,e){return t.name.localeCompare(e.name)}const Mk={reasoning:{icon:E.jsx(ki,{className:"size-4"}),bg:"bg-purple-100",text:"text-purple-700",label:"Reasoning"},"image-upload":{icon:E.jsx(Rl,{className:"size-4"}),bg:"bg-teal-100",text:"text-teal-700",label:"Can analyze images"},"file-upload":{icon:E.jsx(qh,{className:"size-4"}),bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:E.jsx(hl,{className:"size-4"}),bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},Vd=D.memo(function(e){const n=X.c(11),{capability:r}=e,i=Mk[r];let a;n[0]!==r||n[1]!==i?(a=i||{icon:E.jsx(un,{className:"size-4"}),bg:"bg-slate-200",text:"text-slate-700",label:r},n[0]=r,n[1]=i,n[2]=a):a=n[2];const s=a,u=`flex items-center justify-center h-6 w-6 rounded-sm ${s.bg} ${s.text}`;let o;n[3]!==s.icon||n[4]!==u?(o=E.jsx(dl,{asChild:!0,children:E.jsx("div",{className:u,children:s.icon})}),n[3]=s.icon,n[4]=u,n[5]=o):o=n[5];let l;n[6]!==s.label?(l=E.jsx(fl,{children:E.jsx("p",{children:s.label})}),n[6]=s.label,n[7]=l):l=n[7];let f;return n[8]!==o||n[9]!==l?(f=E.jsxs(cl,{children:[o,l]}),n[8]=o,n[9]=l,n[10]=f):f=n[10],f}),Co=D.memo(function(e){const n=X.c(54),{model:r,compact:i}=e,a=i===void 0?!1:i;if(!r){let T;return n[0]===Symbol.for("react.memo_cache_sentinel")?(T=E.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=T):T=n[0],T}const s=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!s&&!a){let T;n[1]!==r.logo||n[2]!==r.name?(T=r.logo&&E.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[1]=r.logo,n[2]=r.name,n[3]=T):T=n[3];let k;n[4]!==r.name?(k=E.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=k):k=n[5];let g;n[6]!==T||n[7]!==k?(g=E.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[T,k]}),n[6]=T,n[7]=k,n[8]=g):g=n[8];let N;n[9]!==r.description?(N=r.description&&E.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),n[9]=r.description,n[10]=N):N=n[10];let v;return n[11]!==g||n[12]!==N?(v=E.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[g,N]}),n[11]=g,n[12]=N,n[13]=v):v=n[13],v}if(!s&&a)return null;if(a){let T;n[14]!==r.contextWindow?(T=r.contextWindow&&E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("span",{className:"text-muted-foreground",children:"Context"}),E.jsxs("span",{className:"text-foreground font-medium",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[14]=r.contextWindow,n[15]=T):T=n[15];let k;n[16]!==r.inputCost?(k=r.inputCost&&E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),E.jsxs("span",{className:"text-foreground font-medium",children:["$",r.inputCost.toFixed(2)," / 1M"]})]}),n[16]=r.inputCost,n[17]=k):k=n[17];let g;n[18]!==r.outputCost?(g=r.outputCost&&E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),E.jsxs("span",{className:"text-foreground font-medium",children:["$",r.outputCost.toFixed(2)," / 1M"]})]}),n[18]=r.outputCost,n[19]=g):g=n[19];let N;n[20]!==r.outputLimit?(N=r.outputLimit&&E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),E.jsxs("span",{className:"text-foreground font-medium",children:[r.outputLimit.toLocaleString()," tokens"]})]}),n[20]=r.outputLimit,n[21]=N):N=n[21];let v;return n[22]!==T||n[23]!==k||n[24]!==g||n[25]!==N?(v=E.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-xl text-xs",children:[T,k,g,N]}),n[22]=T,n[23]=k,n[24]=g,n[25]=N,n[26]=v):v=n[26],v}let u;n[27]!==r.logo||n[28]!==r.name?(u=r.logo&&E.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[27]=r.logo,n[28]=r.name,n[29]=u):u=n[29];let o;n[30]!==r.name?(o=E.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[30]=r.name,n[31]=o):o=n[31];let l;n[32]!==u||n[33]!==o?(l=E.jsxs("div",{className:"flex items-center gap-3",children:[u,o]}),n[32]=u,n[33]=o,n[34]=l):l=n[34];let f;n[35]!==r.capabilities?(f=r.capabilities&&r.capabilities.length>0&&E.jsx("div",{className:"flex items-center gap-2",children:r.capabilities.map(Uk)}),n[35]=r.capabilities,n[36]=f):f=n[36];let c;n[37]!==l||n[38]!==f?(c=E.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,f]}),n[37]=l,n[38]=f,n[39]=c):c=n[39];let p;n[40]!==r.contextWindow?(p=r.contextWindow&&E.jsxs("div",{className:"flex flex-col gap-1.5",children:[E.jsxs("div",{className:"flex items-center gap-1.5",children:[E.jsx(Nh,{className:"w-3.5 h-3.5 text-muted-foreground"}),E.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),E.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[40]=r.contextWindow,n[41]=p):p=n[41];let h;n[42]!==r.inputCost||n[43]!==r.outputCost?(h=(r.inputCost||r.outputCost)&&E.jsxs("div",{className:"flex flex-col gap-1.5",children:[E.jsxs("div",{className:"flex items-center gap-1.5",children:[E.jsx(wl,{className:"w-3.5 h-3.5 text-muted-foreground"}),E.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),E.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.inputCost!==null&&r.inputCost!==void 0&&E.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.inputCost.toFixed(2)," / 1M tokens (input)"]}),r.outputCost!==null&&r.outputCost!==void 0&&E.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.outputCost.toFixed(2)," / 1M tokens (output)"]})]})]}),n[42]=r.inputCost,n[43]=r.outputCost,n[44]=h):h=n[44];let m;n[45]!==r.outputLimit?(m=r.outputLimit&&E.jsxs("div",{className:"flex flex-col gap-1.5",children:[E.jsxs("div",{className:"flex items-center gap-1.5",children:[E.jsx(Ll,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),E.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),E.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.outputLimit.toLocaleString()," token limit"]})]}),n[45]=r.outputLimit,n[46]=m):m=n[46];let b;n[47]!==p||n[48]!==h||n[49]!==m?(b=E.jsxs("div",{className:"flex flex-col gap-4",children:[p,h,m]}),n[47]=p,n[48]=h,n[49]=m,n[50]=b):b=n[50];let x;return n[51]!==b||n[52]!==c?(x=E.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[c,b]}),n[51]=b,n[52]=c,n[53]=x):x=n[53],x}),Bk=D.memo(function(e){const n=X.c(27),{model:r,onHover:i,isSelected:a,hasExpandedInfo:s}=e,u=s?"rounded-t-xl":"rounded-xl";let o;n[0]!==u?(o=ue("flex items-center gap-2 h-10 py-4 px-3 hover:bg-accent cursor-pointer",u),n[0]=u,n[1]=o):o=n[1];let l;n[2]!==r||n[3]!==i?(l=()=>i(r),n[2]=r,n[3]=i,n[4]=l):l=n[4];let f;n[5]!==r.logo||n[6]!==r.name?(f=r.logo&&E.jsx("img",{src:r.logo,className:"w-5 h-5 shrink-0",alt:r.name}),n[5]=r.logo,n[6]=r.name,n[7]=f):f=n[7];let c;n[8]!==r.name?(c=E.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=c):c=n[9];let p;n[10]!==s||n[11]!==r.capabilities?(p=s&&r.capabilities&&r.capabilities.length>0&&E.jsx("div",{className:"md:hidden flex items-center gap-1.5 ml-auto",children:r.capabilities.map(Hk)}),n[10]=s,n[11]=r.capabilities,n[12]=p):p=n[12];let h;n[13]!==s||n[14]!==a?(h=a&&!s&&E.jsx(un,{className:"w-4 h-4 text-foreground ml-auto"}),n[13]=s,n[14]=a,n[15]=h):h=n[15];let m;n[16]!==s||n[17]!==a?(m=a&&s&&E.jsx(un,{className:"w-4 h-4 text-foreground ml-2 shrink-0"}),n[16]=s,n[17]=a,n[18]=m):m=n[18];let b;return n[19]!==o||n[20]!==l||n[21]!==f||n[22]!==c||n[23]!==p||n[24]!==h||n[25]!==m?(b=E.jsxs("div",{className:o,onMouseEnter:l,children:[f,c,p,h,m]}),n[19]=o,n[20]=l,n[21]=f,n[22]=c,n[23]=p,n[24]=h,n[25]=m,n[26]=b):b=n[26],b});function Fk(t){const e=X.c(9),{model:n}=t;if(!n){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=E.jsx("span",{className:"text-sm text-muted-foreground",children:"Select model"}),e[0]=s):s=e[0],s}let r;e[1]!==n.logo||e[2]!==n.name?(r=n.logo&&E.jsx("img",{src:n.logo,className:"w-4 h-4",alt:n.name}),e[1]=n.logo,e[2]=n.name,e[3]=r):r=e[3];let i;e[4]!==n.name?(i=E.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors",children:n.name}),e[4]=n.name,e[5]=i):i=e[5];let a;return e[6]!==r||e[7]!==i?(a=E.jsxs("div",{className:"flex items-center gap-2",children:[r,i]}),e[6]=r,e[7]=i,e[8]=a):a=e[8],a}function zk(t){const e=X.c(57),{selectedModel:n,onModelChange:r,variant:i,className:a,placeholder:s}=t,u=i===void 0?"borderless":i,o=s===void 0?"Select model":s,[l,f]=D.useState(!1),[c,p]=D.useState(null),[h,m]=D.useState(!1),b=Dk();let x;e[0]!==b||e[1]!==n?(x=n?b.find(W=>W.id===n.id&&W.connectionId===n.connectionId)?.id:void 0,e[0]=b,e[1]=n,e[2]=x):x=e[2];const T=x;let k;if(e[3]!==b||e[4]!==T){let W;e[6]!==T?(W=K=>K.id===T,e[6]=T,e[7]=W):W=e[7],k=b.find(W),e[3]=b,e[4]=T,e[5]=k}else k=e[5];const g=k;let N;e[8]!==b||e[9]!==r?(N=W=>{const K=b.find(G=>G.id===W);K&&(r({id:K.id,connectionId:K.connectionId,provider:K.provider??void 0}),f(!1))},e[8]=b,e[9]=r,e[10]=N):N=e[10];const v=N;if(b.length===0)return null;const C=T||"",R=u==="borderless"&&"md:border-none";let M;e[11]!==a||e[12]!==R?(M=ue("h-8! text-sm hover:bg-accent rounded-lg py-1 px-2 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0",R,a),e[11]=a,e[12]=R,e[13]=M):M=e[13];let U;e[14]!==g?(U=E.jsx(Fk,{model:g}),e[14]=g,e[15]=U):U=e[15];let w;e[16]!==o||e[17]!==U?(w=E.jsx($l,{placeholder:o,children:U}),e[16]=o,e[17]=U,e[18]=w):w=e[18];let P;e[19]!==w||e[20]!==M?(P=E.jsx(Hl,{className:M,children:w}),e[19]=w,e[20]=M,e[21]=P):P=e[21];let H;e[22]!==h?(H=()=>m(!h),e[22]=h,e[23]=H):H=e[23];const te=h?"text-foreground":"text-muted-foreground";let Z;e[24]!==te?(Z=ue("w-5 h-5 transition-colors",te),e[24]=te,e[25]=Z):Z=e[25];let z;e[26]!==Z?(z=E.jsx(Vh,{className:Z}),e[26]=Z,e[27]=z):z=e[27];let Q;e[28]!==H||e[29]!==z?(Q=E.jsx("button",{type:"button",onClick:H,className:"md:hidden flex items-center justify-center h-8 w-8 rounded-lg hover:bg-accent transition-colors","aria-label":"Toggle model info",children:z}),e[28]=H,e[29]=z,e[30]=Q):Q=e[30];let ae;if(e[31]!==v||e[32]!==b||e[33]!==T||e[34]!==h){let W;e[36]!==v||e[37]!==T||e[38]!==h?(W=K=>E.jsxs("div",{onClick:()=>v(K.id),className:ue("rounded-xl mb-1",K.id===T&&"bg-accent"),children:[E.jsx(Bk,{model:K,onHover:p,isSelected:K.id===T,hasExpandedInfo:h}),h&&E.jsx("div",{className:"md:hidden",children:E.jsx(Co,{model:K,compact:!0})})]},K.id),e[36]=v,e[37]=T,e[38]=h,e[39]=W):W=e[39],ae=b.map(W),e[31]=v,e[32]=b,e[33]=T,e[34]=h,e[35]=ae}else ae=e[35];let Ee;e[40]!==ae?(Ee=E.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 md:border-r",children:ae}),e[40]=ae,e[41]=Ee):Ee=e[41];const Se=c||g||null;let I;e[42]!==Se?(I=E.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:E.jsx(Co,{model:Se})}),e[42]=Se,e[43]=I):I=e[43];let xe;e[44]!==Ee||e[45]!==I?(xe=E.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[Ee,I]}),e[44]=Ee,e[45]=I,e[46]=xe):xe=e[46];let Te;e[47]!==o||e[48]!==Q||e[49]!==xe?(Te=E.jsx(Ul,{title:o,className:"w-full md:w-auto md:min-w-[600px] [&_button[aria-label='Scroll down']]:!hidden [&_button[aria-label='Scroll up']]:!hidden",headerActions:Q,children:xe}),e[47]=o,e[48]=Q,e[49]=xe,e[50]=Te):Te=e[50];let y;return e[51]!==v||e[52]!==l||e[53]!==P||e[54]!==Te||e[55]!==C?(y=E.jsxs(zl,{open:l,onOpenChange:f,value:C,onValueChange:v,children:[P,Te]}),e[51]=v,e[52]=l,e[53]=P,e[54]=Te,e[55]=C,e[56]=y):y=e[56],y}function Uk(t){return E.jsx(Vd,{capability:t},t)}function Hk(t){return E.jsx(Vd,{capability:t},t)}function $k({messageCount:t,sentinelRef:e}){const n=D.useRef(t),r=D.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function bi(t,e){const n=D.Children.toArray(t);for(const r of n)if(D.isValidElement(r)&&r.type===e)return r;return null}function jk(t,e){return D.Children.toArray(t).filter(n=>D.isValidElement(n)?!e.includes(n.type):!0)}function Zk(t){const e=X.c(5),{className:n,children:r}=t;let i;e[0]!==n?(i=ue("h-full",n),e[0]=n,e[1]=i):i=e[1];let a;return e[2]!==r||e[3]!==i?(a=E.jsx(Ai,{className:i,children:r}),e[2]=r,e[3]=i,e[4]=a):a=e[4],a}function Yk(t){const e=X.c(11),{children:n}=t;let r;e[0]!==n?(r=bi(n,Wd),e[0]=n,e[1]=r):r=e[1];const i=r;let a;e[2]!==n?(a=bi(n,Gd),e[2]=n,e[3]=a):a=e[3];const s=a,u=i?.props.children;let o;e[4]!==u?(o=E.jsx("div",{className:"flex items-center gap-2",children:u}),e[4]=u,e[5]=o):o=e[5];const l=s?.props.children;let f;e[6]!==l?(f=E.jsx("div",{className:"flex items-center gap-1",children:l}),e[6]=l,e[7]=f):f=e[7];let c;return e[8]!==o||e[9]!==f?(c=E.jsxs(Ai.Header,{children:[o,f]}),e[8]=o,e[9]=f,e[10]=c):c=e[10],c}function Wd(t){const e=X.c(2),{children:n}=t;let r;return e[0]!==n?(r=E.jsx(E.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function Gd(t){const e=X.c(2),{children:n}=t;let r;return e[0]!==n?(r=E.jsx(E.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function qk(t){const e=X.c(3),{children:n,className:r}=t;let i;return e[0]!==n||e[1]!==r?(i=E.jsx(Ai.Content,{className:r,children:n}),e[0]=n,e[1]=r,e[2]=i):i=e[2],i}function Vk(t){const e=X.c(2),{children:n}=t;let r;return e[0]!==n?(r=E.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Wk(t){const e=X.c(12),{messages:n,status:r,minHeightOffset:i}=t,a=i===void 0?240:i,s=D.useRef(null);let u;e[0]!==n.length?(u={messageCount:n.length,sentinelRef:s},e[0]=n.length,e[1]=u):u=e[1],$k(u);let o;if(e[2]!==n||e[3]!==r){let c;e[5]!==n.length||e[6]!==r?(c=(p,h)=>p.role==="user"?E.jsx(Rk,{message:p},p.id):p.role==="assistant"?E.jsx(Nk,{message:p,status:h===n.length-1?r:void 0},p.id):null,e[5]=n.length,e[6]=r,e[7]=c):c=e[7],o=n.map(c),e[2]=n,e[3]=r,e[4]=o}else o=e[4];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=E.jsx(qd,{children:E.jsx("div",{ref:s,className:"h-0"})}),e[8]=l):l=e[8];let f;return e[9]!==a||e[10]!==o?(f=E.jsxs(vk,{minHeightOffset:a,children:[o,l]}),e[9]=a,e[10]=o,e[11]=f):f=e[11],f}function Gk(t){const e=X.c(2),{children:n}=t;let r;return e[0]!==n?(r=E.jsx(Ai.Footer,{className:"max-w-2xl mx-auto w-full min-w-0",children:n}),e[0]=n,e[1]=r):r=e[1],r}function Za(t){return null}function Ya(t){return null}function Qk(t){const e=X.c(31),{onSubmit:n,onStop:r,disabled:i,isStreaming:a,placeholder:s,usageMessages:u,children:o}=t,[l,f]=D.useState("");let c,p,h,m,b;if(e[0]!==o||e[1]!==l||e[2]!==a||e[3]!==n){const N=bi(o,Za),v=bi(o,Ya);let C;e[9]!==o?(C=jk(o,[Za,Ya]),e[9]=o,e[10]=C):C=e[10],p=C;let R;e[11]!==l||e[12]!==a||e[13]!==n?(R=async M=>{if(M?.preventDefault(),!l?.trim()||a)return;const U=l.trim();try{await n(U),f("")}catch(w){const P=w;console.error("Failed to send message:",P);const H=P instanceof Error?P.message:"Failed to send message";Qr.error(H)}},e[11]=l,e[12]=a,e[13]=n,e[14]=R):R=e[14],c=R,h="flex items-center gap-2 min-w-0",m=v?E.jsx("div",{className:ue("flex items-center gap-2 flex-wrap min-w-0",v.props.disabled&&"pointer-events-none opacity-60"),children:E.jsx($m,{selectedGatewayId:v.props.selectedGatewayId,onGatewayChange:v.props.onGatewayChange,placeholder:"Gateway",variant:"bordered",className:v.props.className})}):null,b=N?E.jsx("div",{className:ue("flex items-center gap-2 flex-wrap min-w-0",N.props.disabled&&"pointer-events-none opacity-60"),children:E.jsx(zk,{selectedModel:N.props.selectedModel,onModelChange:N.props.onModelChange,placeholder:"Model",variant:"borderless",className:N.props.className})}):null,e[0]=o,e[1]=l,e[2]=a,e[3]=n,e[4]=c,e[5]=p,e[6]=h,e[7]=m,e[8]=b}else c=e[4],p=e[5],h=e[6],m=e[7],b=e[8];let x;e[15]!==u?(x=u?E.jsx(Zd,{messages:u}):null,e[15]=u,e[16]=x):x=e[16];let T;e[17]!==p||e[18]!==h||e[19]!==m||e[20]!==b||e[21]!==x?(T=E.jsxs("div",{className:h,children:[m,b,p,x]}),e[17]=p,e[18]=h,e[19]=m,e[20]=b,e[21]=x,e[22]=T):T=e[22];const k=T;let g;return e[23]!==i||e[24]!==c||e[25]!==l||e[26]!==a||e[27]!==k||e[28]!==r||e[29]!==s?(g=E.jsx(wm,{value:l,onChange:f,onSubmit:c,onStop:r,disabled:i,isStreaming:a,placeholder:s,leftActions:k}),e[23]=i,e[24]=c,e[25]=l,e[26]=a,e[27]=k,e[28]=r,e[29]=s,e[30]=g):g=e[30],g}const XI=Object.assign(Zk,{Header:Object.assign(Yk,{Left:Wd,Right:Gd}),Main:qk,Messages:Wk,EmptyState:Vk,Footer:Gk,Input:Object.assign(Qk,{ModelSelector:Za,GatewaySelector:Ya})});function cn(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Kk(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=cn(i),n.then(a=>{a.onclose=()=>n=void 0},()=>{}),n};return(i,a)=>r().then(s=>a(s.transaction(e,i).objectStore(e)))}let pa;function zi(){return pa||(pa=Kk("keyval-store","keyval")),pa}function Us(t,e=zi()){return e("readonly",n=>cn(n.get(t)))}function gr(t,e,n=zi()){return n("readwrite",r=>(r.put(e,t),cn(r.transaction)))}function Qd(t,e=zi()){return e("readwrite",n=>(n.delete(t),cn(n.transaction)))}function Xk(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},cn(t.transaction)}function Kd(t=zi()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([cn(e.getAllKeys()),cn(e.getAll())]).then(([r,i])=>r.map((a,s)=>[a,i[s]]));const n=[];return t("readonly",r=>Xk(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function Jk(t,e){const n=`${t}:threads:${e}`;return await Us(n)??null}async function eA(t){const e=`${t}:threads:`;return(await Kd()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,a)=>String(a.updated_at).localeCompare(String(i.updated_at)))}function tA(t,e){const n=`${t}:messages:`;return Kd().then(r=>r.filter(([a])=>typeof a=="string"&&a.startsWith(n)).map(([,a])=>a).filter(a=>a.metadata?.thread_id===e||a.threadId===e).sort((a,s)=>{const u=a.metadata?.created_at||a.createdAt||"",o=s.metadata?.created_at||s.createdAt||"";return String(u).localeCompare(String(o))}))}function JI(){const t=X.c(12),{locator:e}=Dn();let n;t[0]!==e?(n=it.threads(e),t[0]=e,t[1]=n):n=t[1];let r;t[2]!==e?(r=()=>eA(e),t[2]=e,t[3]=r):r=t[3];let i;t[4]!==n||t[5]!==r?(i={queryKey:n,queryFn:r,staleTime:3e4},t[4]=n,t[5]=r,t[6]=i):i=t[6];const{data:a,refetch:s}=as(i);let u;t[7]!==a?(u=a??[],t[7]=a,t[8]=u):u=t[8];let o;return t[9]!==s||t[10]!==u?(o={threads:u,refetch:s},t[9]=s,t[10]=u,t[11]=o):o=t[11],o}function nA(t){const e=X.c(11),{locator:n}=Dn();let r;e[0]!==n||e[1]!==t?(r=it.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>tA(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let a;e[6]!==r||e[7]!==i?(a={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=a):a=e[8];const{data:s}=as(a);let u;return e[9]!==s?(u=s??[],e[9]=s,e[10]=u):u=e[10],u}function rA(){const t=X.c(28),{locator:e}=Dn(),n=ol();let r;t[0]!==e?(r=async x=>{const T=`${e}:threads:${x.id}`;return await gr(T,x),x},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=()=>{n.invalidateQueries({queryKey:it.threads(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=nn(a);let u;t[8]!==e?(u=async x=>{const{id:T,updates:k}=x,g=`${e}:threads:${T}`,N=await Us(g);if(!N)throw new Error(`Thread ${T} not found`);const v={...N,...k};return await gr(g,v),v},t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=x=>{n.invalidateQueries({queryKey:it.threads(e)}),n.invalidateQueries({queryKey:it.thread(e,x.id)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=nn(l);let c;t[16]!==e?(c=async x=>{const T=`${e}:threads:${x}`;return await Qd(T),x},t[16]=e,t[17]=c):c=t[17];let p;t[18]!==e||t[19]!==n?(p=()=>{n.invalidateQueries({queryKey:it.threads(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==c||t[22]!==p?(h={mutationFn:c,onSuccess:p},t[21]=c,t[22]=p,t[23]=h):h=t[23];const m=nn(h);let b;return t[24]!==m||t[25]!==s||t[26]!==f?(b={insert:s,update:f,delete:m},t[24]=m,t[25]=s,t[26]=f,t[27]=b):b=t[27],b}function iA(){const t=X.c(37),{locator:e}=Dn(),n=ol();let r;t[0]!==e?(r=async N=>{const v=`${e}:messages:${N.id}`;return await gr(v,N),N},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=N=>{const v=N.metadata?.thread_id||N.threadId;v&&n.invalidateQueries({queryKey:it.threadMessages(e,v)}),n.invalidateQueries({queryKey:it.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let a;t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7];const s=nn(a);let u;t[8]!==e?(u=async N=>(await Promise.all(N.map(v=>{const C=`${e}:messages:${v.id}`;return gr(C,v)})),N),t[8]=e,t[9]=u):u=t[9];let o;t[10]!==e||t[11]!==n?(o=N=>{const v=new Set;for(const C of N){const R=C.metadata?.thread_id||C.threadId;R&&v.add(R)}for(const C of v)n.invalidateQueries({queryKey:it.threadMessages(e,C)});n.invalidateQueries({queryKey:it.messages(e)})},t[10]=e,t[11]=n,t[12]=o):o=t[12];let l;t[13]!==u||t[14]!==o?(l={mutationFn:u,onSuccess:o},t[13]=u,t[14]=o,t[15]=l):l=t[15];const f=nn(l);let c;t[16]!==e?(c=async N=>{const{id:v,updates:C}=N,R=`${e}:messages:${v}`,M=await Us(R);if(!M)throw new Error(`Message ${v} not found`);const U={...M,...C};return await gr(R,U),U},t[16]=e,t[17]=c):c=t[17];let p;t[18]!==e||t[19]!==n?(p=N=>{const v=N.metadata?.thread_id||N.threadId;v&&n.invalidateQueries({queryKey:it.threadMessages(e,v)}),n.invalidateQueries({queryKey:it.messages(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==c||t[22]!==p?(h={mutationFn:c,onSuccess:p},t[21]=c,t[22]=p,t[23]=h):h=t[23];const m=nn(h);let b;t[24]!==e?(b=async N=>{const v=`${e}:messages:${N}`;return await Qd(v),N},t[24]=e,t[25]=b):b=t[25];let x;t[26]!==e||t[27]!==n?(x=()=>{n.invalidateQueries({queryKey:it.messages(e)})},t[26]=e,t[27]=n,t[28]=x):x=t[28];let T;t[29]!==x||t[30]!==b?(T={mutationFn:b,onSuccess:x},t[29]=x,t[30]=b,t[31]=T):T=t[31];const k=nn(T);let g;return t[32]!==k||t[33]!==s||t[34]!==f||t[35]!==m?(g={insert:s,insertMany:f,update:m,delete:k},t[32]=k,t[33]=s,t[34]=f,t[35]=m,t[36]=g):g=t[36],g}var Xd="vercel.ai.error",aA=Symbol.for(Xd),So,Io,Zt=class Jd extends(Io=Error,So=aA,Io){constructor({name:e,message:n,cause:r}){super(n),this[So]=!0,this.name=e,this.cause=r}static isInstance(e){return Jd.hasMarker(e,Xd)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function ef(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var tf="AI_InvalidArgumentError",nf=`vercel.ai.error.${tf}`,sA=Symbol.for(nf),No,wo,uA=class extends(wo=Zt,No=sA,wo){constructor({message:t,cause:e,argument:n}){super({name:tf,message:t,cause:e}),this[No]=!0,this.argument=n}static isInstance(t){return Zt.hasMarker(t,nf)}},rf="AI_JSONParseError",af=`vercel.ai.error.${rf}`,oA=Symbol.for(af),vo,Ro,Oo=class extends(Ro=Zt,vo=oA,Ro){constructor({text:t,cause:e}){super({name:rf,message:`JSON parsing failed: Text: ${t}.
115
115
  Error message: ${ef(e)}`,cause:e}),this[vo]=!0,this.text=t}static isInstance(t){return Zt.hasMarker(t,af)}},sf="AI_TypeValidationError",uf=`vercel.ai.error.${sf}`,lA=Symbol.for(uf),Lo,Do,On=class qa extends(Do=Zt,Lo=lA,Do){constructor({value:e,cause:n}){super({name:sf,message:`Type validation failed: Value: ${JSON.stringify(e)}.
116
116
  Error message: ${ef(n)}`,cause:n}),this[Lo]=!0,this.value=e}static isInstance(e){return Zt.hasMarker(e,uf)}static wrap({value:e,cause:n}){return qa.isInstance(n)&&n.value===e?n:new qa({value:e,cause:n})}};const cA=B("ZodISODateTime",(t,e)=>{Gp.init(t,e),Fe.init(t,e)});function dA(t){return tm(cA,t)}const fA=B("ZodISODate",(t,e)=>{Qp.init(t,e),Fe.init(t,e)});function hA(t){return nm(fA,t)}const pA=B("ZodISOTime",(t,e)=>{Kp.init(t,e),Fe.init(t,e)});function mA(t){return rm(pA,t)}const gA=B("ZodISODuration",(t,e)=>{Xp.init(t,e),Fe.init(t,e)});function bA(t){return im(gA,t)}const EA=(t,e)=>{fh.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>ph(t,n)},flatten:{value:n=>hh(t,n)},addIssue:{value:n=>t.issues.push(n)},addIssues:{value:n=>t.issues.push(...n)},isEmpty:{get(){return t.issues.length===0}}})},Ui=B("ZodError",EA,{Parent:Error}),TA=gh(Ui),xA=Eh(Ui),_A=bh(Ui),of=mh(Ui),Be=B("ZodType",(t,e)=>(Re.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),t.clone=(n,r)=>Ch(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>TA(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>_A(t,n,r),t.parseAsync=async(n,r)=>xA(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>of(t,n,r),t.spa=t.safeParseAsync,t.refine=(n,r)=>t.check(gC(n,r)),t.superRefine=n=>t.check(bC(n)),t.overwrite=n=>t.check(Nr(n)),t.optional=()=>Bo(t),t.nullable=()=>Fo(t),t.nullish=()=>Bo(Fo(t)),t.nonoptional=n=>uC(t,n),t.array=()=>Un(t),t.or=n=>tt([t,n]),t.and=n=>KA(t,n),t.transform=n=>zo(t,tC(n)),t.default=n=>iC(t,n),t.prefault=n=>sC(t,n),t.catch=n=>lC(t,n),t.pipe=n=>zo(t,n),t.readonly=()=>fC(t),t.describe=n=>{const r=t.clone();return Jn.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){return Jn.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return Jn.get(t);const r=t.clone();return Jn.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),lf=B("_ZodString",(t,e)=>{us.init(t,e),Be.init(t,e);const n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(dm(...r)),t.includes=(...r)=>t.check(pm(...r)),t.startsWith=(...r)=>t.check(mm(...r)),t.endsWith=(...r)=>t.check(gm(...r)),t.min=(...r)=>t.check(ui(...r)),t.max=(...r)=>t.check(Sl(...r)),t.length=(...r)=>t.check(Il(...r)),t.nonempty=(...r)=>t.check(ui(1,...r)),t.lowercase=r=>t.check(fm(r)),t.uppercase=r=>t.check(hm(r)),t.trim=()=>t.check(Em()),t.normalize=(...r)=>t.check(bm(...r)),t.toLowerCase=()=>t.check(Tm()),t.toUpperCase=()=>t.check(xm())}),yA=B("ZodString",(t,e)=>{us.init(t,e),lf.init(t,e),t.email=n=>t.check(D0(kA,n)),t.url=n=>t.check(z0(AA,n)),t.jwt=n=>t.check(em(zA,n)),t.emoji=n=>t.check(U0(CA,n)),t.guid=n=>t.check(ru(Po,n)),t.uuid=n=>t.check(P0(Vr,n)),t.uuidv4=n=>t.check(M0(Vr,n)),t.uuidv6=n=>t.check(B0(Vr,n)),t.uuidv7=n=>t.check(F0(Vr,n)),t.nanoid=n=>t.check(H0(SA,n)),t.guid=n=>t.check(ru(Po,n)),t.cuid=n=>t.check($0(IA,n)),t.cuid2=n=>t.check(j0(NA,n)),t.ulid=n=>t.check(Z0(wA,n)),t.base64=n=>t.check(K0(MA,n)),t.base64url=n=>t.check(X0(BA,n)),t.xid=n=>t.check(Y0(vA,n)),t.ksuid=n=>t.check(q0(RA,n)),t.ipv4=n=>t.check(V0(OA,n)),t.ipv6=n=>t.check(W0(LA,n)),t.cidrv4=n=>t.check(G0(DA,n)),t.cidrv6=n=>t.check(Q0(PA,n)),t.e164=n=>t.check(J0(FA,n)),t.datetime=n=>t.check(dA(n)),t.date=n=>t.check(hA(n)),t.time=n=>t.check(mA(n)),t.duration=n=>t.check(bA(n))});function V(t){return L0(yA,t)}const Fe=B("ZodStringFormat",(t,e)=>{Me.init(t,e),lf.init(t,e)}),kA=B("ZodEmail",(t,e)=>{Up.init(t,e),Fe.init(t,e)}),Po=B("ZodGUID",(t,e)=>{Fp.init(t,e),Fe.init(t,e)}),Vr=B("ZodUUID",(t,e)=>{zp.init(t,e),Fe.init(t,e)}),AA=B("ZodURL",(t,e)=>{Hp.init(t,e),Fe.init(t,e)}),CA=B("ZodEmoji",(t,e)=>{$p.init(t,e),Fe.init(t,e)}),SA=B("ZodNanoID",(t,e)=>{jp.init(t,e),Fe.init(t,e)}),IA=B("ZodCUID",(t,e)=>{Zp.init(t,e),Fe.init(t,e)}),NA=B("ZodCUID2",(t,e)=>{Yp.init(t,e),Fe.init(t,e)}),wA=B("ZodULID",(t,e)=>{qp.init(t,e),Fe.init(t,e)}),vA=B("ZodXID",(t,e)=>{Vp.init(t,e),Fe.init(t,e)}),RA=B("ZodKSUID",(t,e)=>{Wp.init(t,e),Fe.init(t,e)}),OA=B("ZodIPv4",(t,e)=>{Jp.init(t,e),Fe.init(t,e)}),LA=B("ZodIPv6",(t,e)=>{e0.init(t,e),Fe.init(t,e)}),DA=B("ZodCIDRv4",(t,e)=>{t0.init(t,e),Fe.init(t,e)}),PA=B("ZodCIDRv6",(t,e)=>{n0.init(t,e),Fe.init(t,e)}),MA=B("ZodBase64",(t,e)=>{r0.init(t,e),Fe.init(t,e)}),BA=B("ZodBase64URL",(t,e)=>{a0.init(t,e),Fe.init(t,e)}),FA=B("ZodE164",(t,e)=>{s0.init(t,e),Fe.init(t,e)}),zA=B("ZodJWT",(t,e)=>{o0.init(t,e),Fe.init(t,e)}),cf=B("ZodNumber",(t,e)=>{kl.init(t,e),Be.init(t,e),t.gt=(r,i)=>t.check(au(r,i)),t.gte=(r,i)=>t.check(Wi(r,i)),t.min=(r,i)=>t.check(Wi(r,i)),t.lt=(r,i)=>t.check(iu(r,i)),t.lte=(r,i)=>t.check(Vi(r,i)),t.max=(r,i)=>t.check(Vi(r,i)),t.int=r=>t.check(Mo(r)),t.safe=r=>t.check(Mo(r)),t.positive=r=>t.check(au(0,r)),t.nonnegative=r=>t.check(Wi(0,r)),t.negative=r=>t.check(iu(0,r)),t.nonpositive=r=>t.check(Vi(0,r)),t.multipleOf=(r,i)=>t.check(su(r,i)),t.step=(r,i)=>t.check(su(r,i)),t.finite=()=>t;const n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function UA(t){return am(cf,t)}const HA=B("ZodNumberFormat",(t,e)=>{l0.init(t,e),cf.init(t,e)});function Mo(t){return sm(HA,t)}const $A=B("ZodBoolean",(t,e)=>{c0.init(t,e),Be.init(t,e)});function Xe(t){return um($A,t)}const jA=B("ZodNull",(t,e)=>{d0.init(t,e),Be.init(t,e)});function ZA(t){return om(jA,t)}const YA=B("ZodUnknown",(t,e)=>{f0.init(t,e),Be.init(t,e)});function At(){return lm(YA)}const qA=B("ZodNever",(t,e)=>{h0.init(t,e),Be.init(t,e)});function df(t){return cm(qA,t)}const VA=B("ZodArray",(t,e)=>{p0.init(t,e),Be.init(t,e),t.element=e.element,t.min=(n,r)=>t.check(ui(n,r)),t.nonempty=n=>t.check(ui(1,n)),t.max=(n,r)=>t.check(Sl(n,r)),t.length=(n,r)=>t.check(Il(n,r)),t.unwrap=()=>t.element});function Un(t,e){return _m(VA,t,e)}const ff=B("ZodObject",(t,e)=>{m0.init(t,e),Be.init(t,e),_e(t,"shape",()=>e.shape),t.keyof=()=>pf(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:At()}),t.loose=()=>t.clone({...t._zod.def,catchall:At()}),t.strict=()=>t.clone({...t._zod.def,catchall:df()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>Th(t,n),t.merge=n=>xh(t,n),t.pick=n=>_h(t,n),t.omit=n=>yh(t,n),t.partial=(...n)=>kh(mf,t,n[0]),t.required=(...n)=>Ah(gf,t,n[0])});function Ne(t,e){const n={type:"object",get shape(){return ll(this,"shape",{...t}),this.shape},...ee(e)};return new ff(n)}function Oe(t,e){return new ff({type:"object",get shape(){return ll(this,"shape",{...t}),this.shape},catchall:df(),...ee(e)})}const hf=B("ZodUnion",(t,e)=>{Al.init(t,e),Be.init(t,e),t.options=e.options});function tt(t,e){return new hf({type:"union",options:t,...ee(e)})}const WA=B("ZodDiscriminatedUnion",(t,e)=>{hf.init(t,e),g0.init(t,e)});function GA(t,e,n){return new WA({type:"union",options:e,discriminator:t,...ee(n)})}const QA=B("ZodIntersection",(t,e)=>{b0.init(t,e),Be.init(t,e)});function KA(t,e){return new QA({type:"intersection",left:t,right:e})}const XA=B("ZodRecord",(t,e)=>{E0.init(t,e),Be.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function yr(t,e,n){return new XA({type:"record",keyType:t,valueType:e,...ee(n)})}const Va=B("ZodEnum",(t,e)=>{T0.init(t,e),Be.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));t.extract=(r,i)=>{const a={};for(const s of r)if(n.has(s))a[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Va({...e,checks:[],...ee(i),entries:a})},t.exclude=(r,i)=>{const a={...e.entries};for(const s of r)if(n.has(s))delete a[s];else throw new Error(`Key ${s} not found in enum`);return new Va({...e,checks:[],...ee(i),entries:a})}});function pf(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Va({type:"enum",entries:n,...ee(e)})}const JA=B("ZodLiteral",(t,e)=>{x0.init(t,e),Be.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function ie(t,e){return new JA({type:"literal",values:Array.isArray(t)?t:[t],...ee(e)})}const eC=B("ZodTransform",(t,e)=>{_0.init(t,e),Be.init(t,e),t._zod.parse=(n,r)=>{n.addIssue=a=>{if(typeof a=="string")n.issues.push(br(a,n.value,e));else{const s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!0),n.issues.push(br(s))}};const i=e.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function tC(t){return new eC({type:"transform",transform:t})}const mf=B("ZodOptional",(t,e)=>{y0.init(t,e),Be.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Bo(t){return new mf({type:"optional",innerType:t})}const nC=B("ZodNullable",(t,e)=>{k0.init(t,e),Be.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Fo(t){return new nC({type:"nullable",innerType:t})}const rC=B("ZodDefault",(t,e)=>{A0.init(t,e),Be.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function iC(t,e){return new rC({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}const aC=B("ZodPrefault",(t,e)=>{C0.init(t,e),Be.init(t,e),t.unwrap=()=>t._zod.def.innerType});function sC(t,e){return new aC({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}const gf=B("ZodNonOptional",(t,e)=>{S0.init(t,e),Be.init(t,e),t.unwrap=()=>t._zod.def.innerType});function uC(t,e){return new gf({type:"nonoptional",innerType:t,...ee(e)})}const oC=B("ZodCatch",(t,e)=>{I0.init(t,e),Be.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function lC(t,e){return new oC({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const cC=B("ZodPipe",(t,e)=>{N0.init(t,e),Be.init(t,e),t.in=e.in,t.out=e.out});function zo(t,e){return new cC({type:"pipe",in:t,out:e})}const dC=B("ZodReadonly",(t,e)=>{w0.init(t,e),Be.init(t,e)});function fC(t){return new dC({type:"readonly",innerType:t})}const hC=B("ZodLazy",(t,e)=>{v0.init(t,e),Be.init(t,e),t.unwrap=()=>t._zod.def.getter()});function pC(t){return new hC({type:"lazy",getter:t})}const Hs=B("ZodCustom",(t,e)=>{R0.init(t,e),Be.init(t,e)});function mC(t){const e=new at({check:"custom"});return e._zod.check=t,e}function bf(t,e){return ym(Hs,t??(()=>!0),e)}function gC(t,e={}){return km(Hs,t,e)}function bC(t){const e=mC(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(br(r,n.value,e._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),n.issues.push(br(i))}},t(n.value,n)));return e}function Ei(t,e={error:`Input not instance of ${t.name}`}){const n=new Hs({type:"custom",check:"custom",fn:r=>r instanceof t,abort:!0,...ee(e)});return n._zod.bag.Class=t,n}var Mr=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const a=n.length,s=new Array(e);for(let u=0;u<e;u++)s[u]=n[Math.random()*a|0];return s.join("")};if(t==null)return i;if(n.includes(r))throw new uA({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},EC=Mr();function Uo(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Jt(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function Ho(t,...e){const n=new Headers(Jt(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var TC=/"__proto__"\s*:/,xC=/"constructor"\s*:/;function $o(t){const e=JSON.parse(t);return e===null||typeof e!="object"||TC.test(t)===!1&&xC.test(t)===!1?e:_C(e)}function _C(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const a=r[i];a&&typeof a=="object"&&e.push(a)}}}return t}function yC(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return $o(t)}try{return $o(t)}finally{Error.stackTraceLimit=e}}function ti(t){if(t.type==="object"){t.additionalProperties=!1;const e=t.properties;if(e!=null)for(const n in e)e[n]=ti(e[n])}return t.type==="array"&&t.items!=null&&(Array.isArray(t.items)?t.items=t.items.map(e=>ti(e)):t.items=ti(t.items)),t}var kC=Symbol("Let zodToJsonSchema decide on which parser to use"),jo={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},AC=t=>typeof t=="string"?{...jo,name:t}:{...jo,...t};function dt(){return{}}function CC(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==ce.ZodAny&&(a.items=Ce(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(a.minItems=t.minLength.value),t.maxLength&&(a.maxItems=t.maxLength.value),t.exactLength&&(a.minItems=t.exactLength.value,a.maxItems=t.exactLength.value),a}function SC(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function IC(){return{type:"boolean"}}function Ef(t,e){return Ce(t.type._def,e)}var NC=(t,e)=>Ce(t.innerType._def,e);function Tf(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,a)=>Tf(t,e,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return wC(t)}}var wC=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function vC(t,e){return{...Ce(t.innerType._def,e),default:t.defaultValue()}}function RC(t,e){return e.effectStrategy==="input"?Ce(t.schema._def,e):dt()}function OC(t){return{type:"string",enum:Array.from(t.values)}}var LC=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function DC(t,e){const n=[Ce(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Ce(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(LC(i))r.push(...i.allOf);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:s,...u}=i;a=u}r.push(a)}}),r.length?{allOf:r}:void 0}function PC(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var ma=void 0,gt={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:()=>(ma===void 0&&(ma=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ma),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 xf(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":bt(n,"email",r.message,e);break;case"format:idn-email":bt(n,"idn-email",r.message,e);break;case"pattern:zod":Ke(n,gt.email,r.message,e);break}break;case"url":bt(n,"uri",r.message,e);break;case"uuid":bt(n,"uuid",r.message,e);break;case"regex":Ke(n,r.regex,r.message,e);break;case"cuid":Ke(n,gt.cuid,r.message,e);break;case"cuid2":Ke(n,gt.cuid2,r.message,e);break;case"startsWith":Ke(n,RegExp(`^${ga(r.value,e)}`),r.message,e);break;case"endsWith":Ke(n,RegExp(`${ga(r.value,e)}$`),r.message,e);break;case"datetime":bt(n,"date-time",r.message,e);break;case"date":bt(n,"date",r.message,e);break;case"time":bt(n,"time",r.message,e);break;case"duration":bt(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{Ke(n,RegExp(ga(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&bt(n,"ipv4",r.message,e),r.version!=="v4"&&bt(n,"ipv6",r.message,e);break}case"base64url":Ke(n,gt.base64url,r.message,e);break;case"jwt":Ke(n,gt.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&Ke(n,gt.ipv4Cidr,r.message,e),r.version!=="v4"&&Ke(n,gt.ipv6Cidr,r.message,e);break}case"emoji":Ke(n,gt.emoji(),r.message,e);break;case"ulid":{Ke(n,gt.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{bt(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Ke(n,gt.base64,r.message,e);break}}break}case"nanoid":Ke(n,gt.nanoid,r.message,e)}return n}function ga(t,e){return e.patternStrategy==="escape"?BC(t):t}var MC=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function BC(t){let e="";for(let n=0;n<t.length;n++)MC.has(t[n])||(e+="\\"),e+=t[n];return e}function bt(t,e,n,r){var i;t.format||(i=t.anyOf)!=null&&i.some(a=>a.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function Ke(t,e,n,r){var i;t.pattern||(i=t.allOf)!=null&&i.some(a=>a.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Zo(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=Zo(e,r)}function Zo(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},i=r.i?t.source.toLowerCase():t.source;let a="",s=!1,u=!1,o=!1;for(let l=0;l<i.length;l++){if(s){a+=i[l],s=!1;continue}if(r.i){if(u){if(i[l].match(/[a-z]/)){o?(a+=i[l],a+=`${i[l-2]}-${i[l]}`.toUpperCase(),o=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(a+=i[l],o=!0):a+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){a+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){a+=`(^|(?<=[\r
117
117
  ]))`;continue}else if(i[l]==="$"){a+=`($|(?=[\r
118
118
  ]))`;continue}}if(r.s&&i[l]==="."){a+=u?`${i[l]}\r
119
119
  `:`[${i[l]}\r
120
- ]`;continue}a+=i[l],i[l]==="\\"?s=!0:u&&i[l]==="]"?u=!1:!u&&i[l]==="["&&(u=!0)}try{new RegExp(a)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return a}function _f(t,e){var n,r,i,a,s,u;const o={type:"object",additionalProperties:(n=Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===ce.ZodString&&((i=t.keyType._def.checks)!=null&&i.length)){const{type:l,...f}=xf(t.keyType._def,e);return{...o,propertyNames:f}}else{if(((a=t.keyType)==null?void 0:a._def.typeName)===ce.ZodEnum)return{...o,propertyNames:{enum:t.keyType._def.values}};if(((s=t.keyType)==null?void 0:s._def.typeName)===ce.ZodBranded&&t.keyType._def.type._def.typeName===ce.ZodString&&((u=t.keyType._def.type._def.checks)!=null&&u.length)){const{type:l,...f}=Ef(t.keyType._def,e);return{...o,propertyNames:f}}}return o}function FC(t,e){if(e.mapStrategy==="record")return _f(t,e);const n=Ce(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||dt(),r=Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||dt();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function zC(t){const e=t.values,r=Object.keys(t.values).filter(a=>typeof e[e[a]]!="number").map(a=>e[a]),i=Array.from(new Set(r.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function UC(){return{not:dt()}}function HC(){return{type:"null"}}var Wa={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function $C(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Wa&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,a)=>{const s=Wa[a._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,a)=>{const s=typeof a._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];default:return i}},[]);if(r.length===n.length){const i=r.filter((a,s,u)=>u.indexOf(a)===s);return{type:i.length>1?i:i[0],enum:n.reduce((a,s)=>a.includes(s._def.value)?a:[...a,s._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(a=>!r.includes(a))],[])};return jC(t,e)}var jC=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,i)=>Ce(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function ZC(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Wa[t.innerType._def.typeName],"null"]};const n=Ce(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function YC(t){const e={type:"number"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"int":e.type="integer";break;case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function qC(t,e){const n={type:"object",properties:{}},r=[],i=t.shape();for(const s in i){let u=i[s];if(u===void 0||u._def===void 0)continue;const o=WC(u),l=Ce(u._def,{...e,currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]});l!==void 0&&(n.properties[s]=l,o||r.push(s))}r.length&&(n.required=r);const a=VC(t,e);return a!==void 0&&(n.additionalProperties=a),n}function VC(t,e){if(t.catchall._def.typeName!=="ZodNever")return Ce(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function WC(t){try{return t.isOptional()}catch{return!0}}var GC=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return Ce(t.innerType._def,e);const r=Ce(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:dt()},r]}:dt()},QC=(t,e)=>{if(e.pipeStrategy==="input")return Ce(t.in._def,e);if(e.pipeStrategy==="output")return Ce(t.out._def,e);const n=Ce(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=Ce(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function KC(t,e){return Ce(t.type._def,e)}function XC(t,e){const r={type:"array",uniqueItems:!0,items:Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(r.minItems=t.minSize.value),t.maxSize&&(r.maxItems=t.maxSize.value),r}function JC(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>Ce(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ce(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>Ce(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function eS(){return{not:dt()}}function tS(){return dt()}var nS=(t,e)=>Ce(t.innerType._def,e),rS=(t,e,n)=>{switch(e){case ce.ZodString:return xf(t,n);case ce.ZodNumber:return YC(t);case ce.ZodObject:return qC(t,n);case ce.ZodBigInt:return SC(t);case ce.ZodBoolean:return IC();case ce.ZodDate:return Tf(t,n);case ce.ZodUndefined:return eS();case ce.ZodNull:return HC();case ce.ZodArray:return CC(t,n);case ce.ZodUnion:case ce.ZodDiscriminatedUnion:return $C(t,n);case ce.ZodIntersection:return DC(t,n);case ce.ZodTuple:return JC(t,n);case ce.ZodRecord:return _f(t,n);case ce.ZodLiteral:return PC(t);case ce.ZodEnum:return OC(t);case ce.ZodNativeEnum:return zC(t);case ce.ZodNullable:return ZC(t,n);case ce.ZodOptional:return GC(t,n);case ce.ZodMap:return FC(t,n);case ce.ZodSet:return XC(t,n);case ce.ZodLazy:return()=>t.getter()._def;case ce.ZodPromise:return KC(t,n);case ce.ZodNaN:case ce.ZodNever:return UC();case ce.ZodEffects:return RC(t,n);case ce.ZodAny:return dt();case ce.ZodUnknown:return tS();case ce.ZodDefault:return vC(t,n);case ce.ZodBranded:return Ef(t,n);case ce.ZodReadonly:return nS(t,n);case ce.ZodCatch:return NC(t,n);case ce.ZodPipeline:return QC(t,n);case ce.ZodFunction:case ce.ZodVoid:case ce.ZodSymbol:return;default:return(r=>{})()}},iS=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function Ce(t,e,n=!1){var r;const i=e.seen.get(t);if(e.override){const o=(r=e.override)==null?void 0:r.call(e,t,e,i,n);if(o!==kC)return o}if(i&&!n){const o=aS(i,e);if(o!==void 0)return o}const a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);const s=rS(t,t.typeName,e),u=typeof s=="function"?Ce(s(),e):s;if(u&&sS(t,e,u),e.postProcess){const o=e.postProcess(u,t,e);return a.jsonSchema=u,o}return a.jsonSchema=u,u}var aS=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:iS(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),dt()):e.$refStrategy==="seen"?dt():void 0}},sS=(t,e,n)=>(t.description&&(n.description=t.description),n),uS=t=>{const e=AC(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))}},oS=(t,e)=>{var n;const r=uS(e);let i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[f,c])=>{var p;return{...l,[f]:(p=Ce(c._def,{...r,currentPath:[...r.basePath,r.definitionPath,f]},!0))!=null?p:dt()}},{}):void 0;const a=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=(n=Ce(t._def,a===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,a]},!1))!=null?n:dt(),u=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;u!==void 0&&(s.title=u);const o=a===void 0?i?{...s,[r.definitionPath]:i}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...i,[a]:s}};return o.$schema="http://json-schema.org/draft-07/schema#",o},Ga=Symbol.for("vercel.ai.schema");function lS(t){let e;return()=>(e==null&&(e=t()),e)}function Hi(t,{validate:e}={}){return{[Ga]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function cS(t){return typeof t=="object"&&t!==null&&Ga in t&&t[Ga]===!0&&"jsonSchema"in t&&"validate"in t}function $s(t){return t==null?Hi({properties:{},additionalProperties:!1}):cS(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?yf(t):dS(t):t()}function dS(t){return Hi(()=>t["~standard"].jsonSchema.input({target:"draft-07"}),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new On({value:e,cause:n.issues})}}})}function fS(t,e){var n;const r=(n=void 0)!=null?n:!1;return Hi(()=>oS(t,{$refStrategy:r?"root":"none"}),{validate:async i=>{const a=await t.safeParseAsync(i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function hS(t,e){var n;const r=(n=void 0)!=null?n:!1;return Hi(()=>ti(Am(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const a=await of(t,i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function pS(t){return"_zod"in t}function yf(t,e){return pS(t)?hS(t):fS(t)}async function Yo({value:t,schema:e}){const n=await kr({value:t,schema:e});if(!n.success)throw On.wrap({value:t,cause:n.error});return n.value}async function kr({value:t,schema:e}){const n=$s(e);try{if(n.validate==null)return{success:!0,value:t,rawValue:t};const r=await n.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:On.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:On.wrap({value:t,cause:r}),rawValue:t}}}async function dn({text:t,schema:e}){try{const n=yC(t);return e==null?{success:!0,value:n,rawValue:n}:await kr({value:n,schema:e})}catch(n){return{success:!1,error:Oo.isInstance(n)?n:new Oo({text:t,cause:n}),rawValue:void 0}}}function mS({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new Gh).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await dn({text:n,schema:e}))}}))}async function Ut(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var gS=Object.defineProperty,bS=(t,e)=>{for(var n in e)gS(t,n,{get:e[n],enumerable:!0})},kf="AI_NoObjectGeneratedError",Af=`vercel.ai.error.${kf}`,ES=Symbol.for(Af),Cf,jt=class extends Zt{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:i,finishReason:a}){super({name:kf,message:t,cause:e}),this[Cf]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(t){return Zt.hasMarker(t,Af)}};Cf=ES;var qo="6.0.3",Sf=tt([V(),Ei(Uint8Array),Ei(ArrayBuffer),bf(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),Ar=pC(()=>tt([ZA(),V(),UA(),Xe(),yr(V(),Ar.optional()),Un(Ar)])),ge=yr(V(),yr(V(),Ar.optional())),If=Ne({type:ie("text"),text:V(),providerOptions:ge.optional()}),TS=Ne({type:ie("image"),image:tt([Sf,Ei(URL)]),mediaType:V().optional(),providerOptions:ge.optional()}),Nf=Ne({type:ie("file"),data:tt([Sf,Ei(URL)]),filename:V().optional(),mediaType:V(),providerOptions:ge.optional()}),xS=Ne({type:ie("reasoning"),text:V(),providerOptions:ge.optional()}),_S=Ne({type:ie("tool-call"),toolCallId:V(),toolName:V(),input:At(),providerOptions:ge.optional(),providerExecuted:Xe().optional()}),yS=GA("type",[Ne({type:ie("text"),value:V(),providerOptions:ge.optional()}),Ne({type:ie("json"),value:Ar,providerOptions:ge.optional()}),Ne({type:ie("execution-denied"),reason:V().optional(),providerOptions:ge.optional()}),Ne({type:ie("error-text"),value:V(),providerOptions:ge.optional()}),Ne({type:ie("error-json"),value:Ar,providerOptions:ge.optional()}),Ne({type:ie("content"),value:Un(tt([Ne({type:ie("text"),text:V(),providerOptions:ge.optional()}),Ne({type:ie("media"),data:V(),mediaType:V()}),Ne({type:ie("file-data"),data:V(),mediaType:V(),filename:V().optional(),providerOptions:ge.optional()}),Ne({type:ie("file-url"),url:V(),providerOptions:ge.optional()}),Ne({type:ie("file-id"),fileId:tt([V(),yr(V(),V())]),providerOptions:ge.optional()}),Ne({type:ie("image-data"),data:V(),mediaType:V(),providerOptions:ge.optional()}),Ne({type:ie("image-url"),url:V(),providerOptions:ge.optional()}),Ne({type:ie("image-file-id"),fileId:tt([V(),yr(V(),V())]),providerOptions:ge.optional()}),Ne({type:ie("custom"),providerOptions:ge.optional()})]))})]),wf=Ne({type:ie("tool-result"),toolCallId:V(),toolName:V(),output:yS,providerOptions:ge.optional()}),kS=Ne({type:ie("tool-approval-request"),approvalId:V(),toolCallId:V()}),AS=Ne({type:ie("tool-approval-response"),approvalId:V(),approved:Xe(),reason:V().optional()}),CS=Ne({role:ie("system"),content:V(),providerOptions:ge.optional()}),SS=Ne({role:ie("user"),content:tt([V(),Un(tt([If,TS,Nf]))]),providerOptions:ge.optional()}),IS=Ne({role:ie("assistant"),content:tt([V(),Un(tt([If,Nf,xS,_S,wf,kS]))]),providerOptions:ge.optional()}),NS=Ne({role:ie("tool"),content:Un(tt([wf,AS])),providerOptions:ge.optional()});tt([CS,SS,IS,NS]);function vf(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=e[r];if(i===void 0)continue;const a=r in t?t[r]:void 0,s=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),u=a!=null&&typeof a=="object"&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);s&&u?n[r]=vf(a,i):n[r]=i}return n}var wS={};bS(wS,{array:()=>LS,choice:()=>DS,json:()=>PS,object:()=>OS,text:()=>RS});function vS(t){const e=["ROOT"];let n=-1,r=null;function i(o,l,f){switch(o){case'"':{n=l,e.pop(),e.push(f),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=l,r=l,e.pop(),e.push(f),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(f),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l,e.pop(),e.push(f),e.push("INSIDE_NUMBER");break}case"{":{n=l,e.pop(),e.push(f),e.push("INSIDE_OBJECT_START");break}case"[":{n=l,e.pop(),e.push(f),e.push("INSIDE_ARRAY_START");break}}}function a(o,l){switch(o){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,e.pop();break}}}function s(o,l){switch(o){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}}}for(let o=0;o<t.length;o++){const l=t[o];switch(e[e.length-1]){case"ROOT":i(l,o,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=o,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(l,o,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(l,o);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),n=o;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=o}break}case"INSIDE_ARRAY_START":{l==="]"?(n=o,e.pop()):(n=o,i(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=o,e.pop();break}default:{n=o;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(l,o,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=o;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=o;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,o);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,o);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const c=t.substring(r,o+1);!"false".startsWith(c)&&!"true".startsWith(c)&&!"null".startsWith(c)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(l,o):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o)):n=o;break}}}let u=t.slice(0,n+1);for(let o=e.length-1;o>=0;o--)switch(e[o]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const f=t.substring(r,t.length);"true".startsWith(f)?u+="true".slice(f.length):"false".startsWith(f)?u+="false".slice(f.length):"null".startsWith(f)&&(u+="null".slice(f.length))}}return u}async function Br(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await dn({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await dn({text:vS(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var RS=()=>({responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}}}),OS=({schema:t,name:e,description:n})=>{const r=$s(t);return{responseFormat:Ut(r.jsonSchema).then(i=>({type:"json",schema:i,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},a){const s=await dn({text:i});if(!s.success)throw new jt({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=await kr({value:s.value,schema:r});if(!u.success)throw new jt({message:"No object generated: response did not match schema.",cause:u.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});return u.value},async parsePartialOutput({text:i}){const a=await Br(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:a.value}}}}},LS=({element:t,name:e,description:n})=>{const r=$s(t);return{responseFormat:Ut(r.jsonSchema).then(i=>{const{$schema:a,...s}=i;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:s}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}}),async parseCompleteOutput({text:i},a){const s=await dn({text:i});if(!s.success)throw new jt({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=s.value;if(u==null||typeof u!="object"||!("elements"in u)||!Array.isArray(u.elements))throw new jt({message:"No object generated: response did not match schema.",cause:new On({value:u,cause:"response must be an object with an elements array"}),text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});for(const o of u.elements){const l=await kr({value:o,schema:r});if(!l.success)throw new jt({message:"No object generated: response did not match schema.",cause:l.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason})}return u.elements},async parsePartialOutput({text:i}){const a=await Br(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=a.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))return;const u=a.state==="repaired-parse"&&s.elements.length>0?s.elements.slice(0,-1):s.elements,o=[];for(const l of u){const f=await kr({value:l,schema:r});f.success&&o.push(f.value)}return{partial:o}}}}}},DS=({options:t,name:e,description:n})=>({responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},i){const a=await dn({text:r});if(!a.success)throw new jt({message:"No object generated: could not parse the response.",cause:a.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const s=a.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string"||!t.includes(s.result))throw new jt({message:"No object generated: response did not match schema.",cause:new On({value:s,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return s.result},async parsePartialOutput({text:r}){const i=await Br(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=i.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string")return;const s=t.filter(u=>u.startsWith(a.result));return i.state==="successful-parse"?s.includes(a.result)?{partial:a.result}:void 0:s.length===1?{partial:s[0]}:void 0}}}}),PS=({name:t,description:e}={})=>({responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const i=await dn({text:n});if(!i.success)throw new jt({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await Br(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}}});Mr({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
120
+ ]`;continue}a+=i[l],i[l]==="\\"?s=!0:u&&i[l]==="]"?u=!1:!u&&i[l]==="["&&(u=!0)}try{new RegExp(a)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return a}function _f(t,e){var n,r,i,a,s,u;const o={type:"object",additionalProperties:(n=Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===ce.ZodString&&((i=t.keyType._def.checks)!=null&&i.length)){const{type:l,...f}=xf(t.keyType._def,e);return{...o,propertyNames:f}}else{if(((a=t.keyType)==null?void 0:a._def.typeName)===ce.ZodEnum)return{...o,propertyNames:{enum:t.keyType._def.values}};if(((s=t.keyType)==null?void 0:s._def.typeName)===ce.ZodBranded&&t.keyType._def.type._def.typeName===ce.ZodString&&((u=t.keyType._def.type._def.checks)!=null&&u.length)){const{type:l,...f}=Ef(t.keyType._def,e);return{...o,propertyNames:f}}}return o}function FC(t,e){if(e.mapStrategy==="record")return _f(t,e);const n=Ce(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||dt(),r=Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||dt();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function zC(t){const e=t.values,r=Object.keys(t.values).filter(a=>typeof e[e[a]]!="number").map(a=>e[a]),i=Array.from(new Set(r.map(a=>typeof a)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function UC(){return{not:dt()}}function HC(){return{type:"null"}}var Wa={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function $C(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Wa&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,a)=>{const s=Wa[a._def.typeName];return s&&!i.includes(s)?[...i,s]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,a)=>{const s=typeof a._def.value;switch(s){case"string":case"number":case"boolean":return[...i,s];case"bigint":return[...i,"integer"];case"object":if(a._def.value===null)return[...i,"null"];default:return i}},[]);if(r.length===n.length){const i=r.filter((a,s,u)=>u.indexOf(a)===s);return{type:i.length>1?i:i[0],enum:n.reduce((a,s)=>a.includes(s._def.value)?a:[...a,s._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(a=>!r.includes(a))],[])};return jC(t,e)}var jC=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,i)=>Ce(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function ZC(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Wa[t.innerType._def.typeName],"null"]};const n=Ce(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function YC(t){const e={type:"number"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"int":e.type="integer";break;case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function qC(t,e){const n={type:"object",properties:{}},r=[],i=t.shape();for(const s in i){let u=i[s];if(u===void 0||u._def===void 0)continue;const o=WC(u),l=Ce(u._def,{...e,currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]});l!==void 0&&(n.properties[s]=l,o||r.push(s))}r.length&&(n.required=r);const a=VC(t,e);return a!==void 0&&(n.additionalProperties=a),n}function VC(t,e){if(t.catchall._def.typeName!=="ZodNever")return Ce(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function WC(t){try{return t.isOptional()}catch{return!0}}var GC=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return Ce(t.innerType._def,e);const r=Ce(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:dt()},r]}:dt()},QC=(t,e)=>{if(e.pipeStrategy==="input")return Ce(t.in._def,e);if(e.pipeStrategy==="output")return Ce(t.out._def,e);const n=Ce(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=Ce(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function KC(t,e){return Ce(t.type._def,e)}function XC(t,e){const r={type:"array",uniqueItems:!0,items:Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(r.minItems=t.minSize.value),t.maxSize&&(r.maxItems=t.maxSize.value),r}function JC(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>Ce(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ce(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>Ce(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function eS(){return{not:dt()}}function tS(){return dt()}var nS=(t,e)=>Ce(t.innerType._def,e),rS=(t,e,n)=>{switch(e){case ce.ZodString:return xf(t,n);case ce.ZodNumber:return YC(t);case ce.ZodObject:return qC(t,n);case ce.ZodBigInt:return SC(t);case ce.ZodBoolean:return IC();case ce.ZodDate:return Tf(t,n);case ce.ZodUndefined:return eS();case ce.ZodNull:return HC();case ce.ZodArray:return CC(t,n);case ce.ZodUnion:case ce.ZodDiscriminatedUnion:return $C(t,n);case ce.ZodIntersection:return DC(t,n);case ce.ZodTuple:return JC(t,n);case ce.ZodRecord:return _f(t,n);case ce.ZodLiteral:return PC(t);case ce.ZodEnum:return OC(t);case ce.ZodNativeEnum:return zC(t);case ce.ZodNullable:return ZC(t,n);case ce.ZodOptional:return GC(t,n);case ce.ZodMap:return FC(t,n);case ce.ZodSet:return XC(t,n);case ce.ZodLazy:return()=>t.getter()._def;case ce.ZodPromise:return KC(t,n);case ce.ZodNaN:case ce.ZodNever:return UC();case ce.ZodEffects:return RC(t,n);case ce.ZodAny:return dt();case ce.ZodUnknown:return tS();case ce.ZodDefault:return vC(t,n);case ce.ZodBranded:return Ef(t,n);case ce.ZodReadonly:return nS(t,n);case ce.ZodCatch:return NC(t,n);case ce.ZodPipeline:return QC(t,n);case ce.ZodFunction:case ce.ZodVoid:case ce.ZodSymbol:return;default:return(r=>{})()}},iS=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function Ce(t,e,n=!1){var r;const i=e.seen.get(t);if(e.override){const o=(r=e.override)==null?void 0:r.call(e,t,e,i,n);if(o!==kC)return o}if(i&&!n){const o=aS(i,e);if(o!==void 0)return o}const a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);const s=rS(t,t.typeName,e),u=typeof s=="function"?Ce(s(),e):s;if(u&&sS(t,e,u),e.postProcess){const o=e.postProcess(u,t,e);return a.jsonSchema=u,o}return a.jsonSchema=u,u}var aS=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:iS(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),dt()):e.$refStrategy==="seen"?dt():void 0}},sS=(t,e,n)=>(t.description&&(n.description=t.description),n),uS=t=>{const e=AC(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))}},oS=(t,e)=>{var n;const r=uS(e);let i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[f,c])=>{var p;return{...l,[f]:(p=Ce(c._def,{...r,currentPath:[...r.basePath,r.definitionPath,f]},!0))!=null?p:dt()}},{}):void 0;const a=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=(n=Ce(t._def,a===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,a]},!1))!=null?n:dt(),u=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;u!==void 0&&(s.title=u);const o=a===void 0?i?{...s,[r.definitionPath]:i}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...i,[a]:s}};return o.$schema="http://json-schema.org/draft-07/schema#",o},Ga=Symbol.for("vercel.ai.schema");function lS(t){let e;return()=>(e==null&&(e=t()),e)}function Hi(t,{validate:e}={}){return{[Ga]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function cS(t){return typeof t=="object"&&t!==null&&Ga in t&&t[Ga]===!0&&"jsonSchema"in t&&"validate"in t}function $s(t){return t==null?Hi({properties:{},additionalProperties:!1}):cS(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?yf(t):dS(t):t()}function dS(t){return Hi(()=>t["~standard"].jsonSchema.input({target:"draft-07"}),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new On({value:e,cause:n.issues})}}})}function fS(t,e){var n;const r=(n=void 0)!=null?n:!1;return Hi(()=>oS(t,{$refStrategy:r?"root":"none"}),{validate:async i=>{const a=await t.safeParseAsync(i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function hS(t,e){var n;const r=(n=void 0)!=null?n:!1;return Hi(()=>ti(Am(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const a=await of(t,i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function pS(t){return"_zod"in t}function yf(t,e){return pS(t)?hS(t):fS(t)}async function Yo({value:t,schema:e}){const n=await kr({value:t,schema:e});if(!n.success)throw On.wrap({value:t,cause:n.error});return n.value}async function kr({value:t,schema:e}){const n=$s(e);try{if(n.validate==null)return{success:!0,value:t,rawValue:t};const r=await n.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:On.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:On.wrap({value:t,cause:r}),rawValue:t}}}async function dn({text:t,schema:e}){try{const n=yC(t);return e==null?{success:!0,value:n,rawValue:n}:await kr({value:n,schema:e})}catch(n){return{success:!1,error:Oo.isInstance(n)?n:new Oo({text:t,cause:n}),rawValue:void 0}}}function mS({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new Gh).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await dn({text:n,schema:e}))}}))}async function Ut(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var gS=Object.defineProperty,bS=(t,e)=>{for(var n in e)gS(t,n,{get:e[n],enumerable:!0})},kf="AI_NoObjectGeneratedError",Af=`vercel.ai.error.${kf}`,ES=Symbol.for(Af),Cf,jt=class extends Zt{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:i,finishReason:a}){super({name:kf,message:t,cause:e}),this[Cf]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(t){return Zt.hasMarker(t,Af)}};Cf=ES;var qo="6.0.4",Sf=tt([V(),Ei(Uint8Array),Ei(ArrayBuffer),bf(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),Ar=pC(()=>tt([ZA(),V(),UA(),Xe(),yr(V(),Ar.optional()),Un(Ar)])),ge=yr(V(),yr(V(),Ar.optional())),If=Ne({type:ie("text"),text:V(),providerOptions:ge.optional()}),TS=Ne({type:ie("image"),image:tt([Sf,Ei(URL)]),mediaType:V().optional(),providerOptions:ge.optional()}),Nf=Ne({type:ie("file"),data:tt([Sf,Ei(URL)]),filename:V().optional(),mediaType:V(),providerOptions:ge.optional()}),xS=Ne({type:ie("reasoning"),text:V(),providerOptions:ge.optional()}),_S=Ne({type:ie("tool-call"),toolCallId:V(),toolName:V(),input:At(),providerOptions:ge.optional(),providerExecuted:Xe().optional()}),yS=GA("type",[Ne({type:ie("text"),value:V(),providerOptions:ge.optional()}),Ne({type:ie("json"),value:Ar,providerOptions:ge.optional()}),Ne({type:ie("execution-denied"),reason:V().optional(),providerOptions:ge.optional()}),Ne({type:ie("error-text"),value:V(),providerOptions:ge.optional()}),Ne({type:ie("error-json"),value:Ar,providerOptions:ge.optional()}),Ne({type:ie("content"),value:Un(tt([Ne({type:ie("text"),text:V(),providerOptions:ge.optional()}),Ne({type:ie("media"),data:V(),mediaType:V()}),Ne({type:ie("file-data"),data:V(),mediaType:V(),filename:V().optional(),providerOptions:ge.optional()}),Ne({type:ie("file-url"),url:V(),providerOptions:ge.optional()}),Ne({type:ie("file-id"),fileId:tt([V(),yr(V(),V())]),providerOptions:ge.optional()}),Ne({type:ie("image-data"),data:V(),mediaType:V(),providerOptions:ge.optional()}),Ne({type:ie("image-url"),url:V(),providerOptions:ge.optional()}),Ne({type:ie("image-file-id"),fileId:tt([V(),yr(V(),V())]),providerOptions:ge.optional()}),Ne({type:ie("custom"),providerOptions:ge.optional()})]))})]),wf=Ne({type:ie("tool-result"),toolCallId:V(),toolName:V(),output:yS,providerOptions:ge.optional()}),kS=Ne({type:ie("tool-approval-request"),approvalId:V(),toolCallId:V()}),AS=Ne({type:ie("tool-approval-response"),approvalId:V(),approved:Xe(),reason:V().optional()}),CS=Ne({role:ie("system"),content:V(),providerOptions:ge.optional()}),SS=Ne({role:ie("user"),content:tt([V(),Un(tt([If,TS,Nf]))]),providerOptions:ge.optional()}),IS=Ne({role:ie("assistant"),content:tt([V(),Un(tt([If,Nf,xS,_S,wf,kS]))]),providerOptions:ge.optional()}),NS=Ne({role:ie("tool"),content:Un(tt([wf,AS])),providerOptions:ge.optional()});tt([CS,SS,IS,NS]);function vf(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=e[r];if(i===void 0)continue;const a=r in t?t[r]:void 0,s=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),u=a!=null&&typeof a=="object"&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);s&&u?n[r]=vf(a,i):n[r]=i}return n}var wS={};bS(wS,{array:()=>LS,choice:()=>DS,json:()=>PS,object:()=>OS,text:()=>RS});function vS(t){const e=["ROOT"];let n=-1,r=null;function i(o,l,f){switch(o){case'"':{n=l,e.pop(),e.push(f),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=l,r=l,e.pop(),e.push(f),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(f),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l,e.pop(),e.push(f),e.push("INSIDE_NUMBER");break}case"{":{n=l,e.pop(),e.push(f),e.push("INSIDE_OBJECT_START");break}case"[":{n=l,e.pop(),e.push(f),e.push("INSIDE_ARRAY_START");break}}}function a(o,l){switch(o){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,e.pop();break}}}function s(o,l){switch(o){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}}}for(let o=0;o<t.length;o++){const l=t[o];switch(e[e.length-1]){case"ROOT":i(l,o,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=o,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(l,o,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(l,o);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),n=o;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=o}break}case"INSIDE_ARRAY_START":{l==="]"?(n=o,e.pop()):(n=o,i(l,o,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=o,e.pop();break}default:{n=o;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(l,o,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=o;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=o;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,o);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(l,o);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const c=t.substring(r,o+1);!"false".startsWith(c)&&!"true".startsWith(c)&&!"null".startsWith(c)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(l,o):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(l,o)):n=o;break}}}let u=t.slice(0,n+1);for(let o=e.length-1;o>=0;o--)switch(e[o]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const f=t.substring(r,t.length);"true".startsWith(f)?u+="true".slice(f.length):"false".startsWith(f)?u+="false".slice(f.length):"null".startsWith(f)&&(u+="null".slice(f.length))}}return u}async function Br(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await dn({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await dn({text:vS(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var RS=()=>({responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}}}),OS=({schema:t,name:e,description:n})=>{const r=$s(t);return{responseFormat:Ut(r.jsonSchema).then(i=>({type:"json",schema:i,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},a){const s=await dn({text:i});if(!s.success)throw new jt({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=await kr({value:s.value,schema:r});if(!u.success)throw new jt({message:"No object generated: response did not match schema.",cause:u.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});return u.value},async parsePartialOutput({text:i}){const a=await Br(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:a.value}}}}},LS=({element:t,name:e,description:n})=>{const r=$s(t);return{responseFormat:Ut(r.jsonSchema).then(i=>{const{$schema:a,...s}=i;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:s}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}}),async parseCompleteOutput({text:i},a){const s=await dn({text:i});if(!s.success)throw new jt({message:"No object generated: could not parse the response.",cause:s.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=s.value;if(u==null||typeof u!="object"||!("elements"in u)||!Array.isArray(u.elements))throw new jt({message:"No object generated: response did not match schema.",cause:new On({value:u,cause:"response must be an object with an elements array"}),text:i,response:a.response,usage:a.usage,finishReason:a.finishReason});for(const o of u.elements){const l=await kr({value:o,schema:r});if(!l.success)throw new jt({message:"No object generated: response did not match schema.",cause:l.error,text:i,response:a.response,usage:a.usage,finishReason:a.finishReason})}return u.elements},async parsePartialOutput({text:i}){const a=await Br(i);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=a.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))return;const u=a.state==="repaired-parse"&&s.elements.length>0?s.elements.slice(0,-1):s.elements,o=[];for(const l of u){const f=await kr({value:l,schema:r});f.success&&o.push(f.value)}return{partial:o}}}}}},DS=({options:t,name:e,description:n})=>({responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},i){const a=await dn({text:r});if(!a.success)throw new jt({message:"No object generated: could not parse the response.",cause:a.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const s=a.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string"||!t.includes(s.result))throw new jt({message:"No object generated: response did not match schema.",cause:new On({value:s,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return s.result},async parsePartialOutput({text:r}){const i=await Br(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=i.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string")return;const s=t.filter(u=>u.startsWith(a.result));return i.state==="successful-parse"?s.includes(a.result)?{partial:a.result}:void 0:s.length===1?{partial:s[0]}:void 0}}}}),PS=({name:t,description:e}={})=>({responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const i=await dn({text:n});if(!i.success)throw new jt({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await Br(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}}});Mr({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
121
121
 
122
122
  `)},flush(t){t.enqueue(`data: [DONE]
123
123
 
@@ -1 +1 @@
1
- import{c as p,j as u}from"./index-CUKSaF48.js";import{c}from"./utils-D1z8mp5k.js";import{B as x}from"./badge-BKAVZN76.js";import{B as g}from"./button-Cbx1psx0.js";function B(f){const e=p.c(12),{tabs:d,activeTab:n,onTabChange:s,className:l}=f;let t;e[0]!==l?(t=c("flex items-center gap-2 overflow-x-auto no-scrollbar",l),e[0]=l,e[1]=t):t=e[1];let o;if(e[2]!==n||e[3]!==s||e[4]!==d){let i;e[6]!==n||e[7]!==s?(i=r=>{const m=n===r.id;return u.jsxs(g,{variant:"outline",size:"sm",onClick:()=>s(r.id),className:c("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",m&&"bg-muted border-input text-foreground font-medium",!m&&"text-muted-foreground font-normal"),children:[r.label,r.count!==void 0&&u.jsx(x,{variant:"secondary",className:c("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",m?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:r.count})]},r.id)},e[6]=n,e[7]=s,e[8]=i):i=e[8],o=d.map(i),e[2]=n,e[3]=s,e[4]=d,e[5]=o}else o=e[5];let a;return e[9]!==t||e[10]!==o?(a=u.jsx("div",{className:t,children:o}),e[9]=t,e[10]=o,e[11]=a):a=e[11],a}export{B as R};
1
+ import{c as p,j as u}from"./index-DIMg3McT.js";import{c}from"./utils-B0Sj2akX.js";import{B as x}from"./badge-EdnCME49.js";import{B as g}from"./button-BBbnP-v9.js";function B(f){const e=p.c(12),{tabs:d,activeTab:n,onTabChange:s,className:l}=f;let t;e[0]!==l?(t=c("flex items-center gap-2 overflow-x-auto no-scrollbar",l),e[0]=l,e[1]=t):t=e[1];let o;if(e[2]!==n||e[3]!==s||e[4]!==d){let i;e[6]!==n||e[7]!==s?(i=r=>{const m=n===r.id;return u.jsxs(g,{variant:"outline",size:"sm",onClick:()=>s(r.id),className:c("h-8 rounded-lg border border-transparent bg-transparent px-3 py-1 hover:bg-muted",m&&"bg-muted border-input text-foreground font-medium",!m&&"text-muted-foreground font-normal"),children:[r.label,r.count!==void 0&&u.jsx(x,{variant:"secondary",className:c("ml-2 h-5 min-w-5 px-1 rounded-full text-[10px] font-mono",m?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:r.count})]},r.id)},e[6]=n,e[7]=s,e[8]=i):i=e[8],o=d.map(i),e[2]=n,e[3]=s,e[4]=d,e[5]=o}else o=e[5];let a;return e[9]!==t||e[10]!==o?(a=u.jsx("div",{className:t,children:o}),e[9]=t,e[10]=o,e[11]=a):a=e[11],a}export{B as R};
@@ -1 +1 @@
1
- import{s as a,br as i,V as n,W as t,v as e,bs as o}from"./index-CUKSaF48.js";const r=a({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:n(e()),grantType:i(["authorization_code","client_credentials"])}),s=a({name:e(),description:e().optional(),inputSchema:t(o()),outputSchema:t(o()).optional()}),c=a({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),connection_type:i(["HTTP","SSE","Websocket"]).describe("Type of connection"),connection_url:e().describe("URL for the connection"),connection_token:e().nullable().describe("Authentication token"),connection_headers:t(e(),e()).nullable().describe("Custom headers"),oauth_config:r.nullable().describe("OAuth configuration"),configuration_state:t(o()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:n(e()).nullable().optional().describe("Configuration scopes"),metadata:t(o()).nullable().describe("Additional metadata (includes repository info)"),tools:n(s).nullable().describe("Discovered tools from MCP"),bindings:n(e()).nullable().describe("Detected bindings"),status:i(["active","inactive","error"]).describe("Current status")});c.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});c.partial();export{c as C};
1
+ import{s as a,br as i,V as n,W as t,v as e,bs as o}from"./index-DIMg3McT.js";const r=a({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:n(e()),grantType:i(["authorization_code","client_credentials"])}),s=a({name:e(),description:e().optional(),inputSchema:t(o()),outputSchema:t(o()).optional()}),c=a({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),connection_type:i(["HTTP","SSE","Websocket"]).describe("Type of connection"),connection_url:e().describe("URL for the connection"),connection_token:e().nullable().describe("Authentication token"),connection_headers:t(e(),e()).nullable().describe("Custom headers"),oauth_config:r.nullable().describe("OAuth configuration"),configuration_state:t(o()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:n(e()).nullable().optional().describe("Configuration scopes"),metadata:t(o()).nullable().describe("Additional metadata (includes repository info)"),tools:n(s).nullable().describe("Discovered tools from MCP"),bindings:n(e()).nullable().describe("Detected bindings"),status:i(["active","inactive","error"]).describe("Current status")});c.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});c.partial();export{c as C};