@shumai-one/shumai 0.3.2 → 0.3.4

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 (191) hide show
  1. package/bin/{chunk-qmtvy2j4.js → chunk-03pw611p.js} +2 -2
  2. package/bin/{chunk-1nh6xgek.js → chunk-05m8w09t.js} +1 -1
  3. package/bin/chunk-0ark0qrm.js +1 -0
  4. package/bin/{chunk-arpna31w.js → chunk-1apsnd7e.js} +1 -1
  5. package/bin/{chunk-g2dk56e7.js → chunk-1bfrnc6b.js} +1 -1
  6. package/bin/chunk-21h9kgp5.js +1 -0
  7. package/bin/{chunk-na2nympm.js → chunk-2967rnmn.js} +1 -1
  8. package/bin/chunk-2errtbmb.js +2 -0
  9. package/bin/{chunk-hrzm70wg.js → chunk-2jnyk045.js} +1 -1
  10. package/bin/{chunk-etces6ff.js → chunk-2mr99scd.js} +2 -2
  11. package/bin/chunk-2pxev94x.js +2 -0
  12. package/bin/chunk-2y9t0qxp.js +45 -0
  13. package/bin/{chunk-s7qpj715.js → chunk-2ydhnafa.js} +2 -2
  14. package/bin/chunk-38hp9gfh.js +2 -0
  15. package/bin/chunk-3t7v2de9.js +307 -0
  16. package/bin/{chunk-20y3wte3.js → chunk-3vbx3x11.js} +2 -2
  17. package/bin/{chunk-d3s00sn0.js → chunk-3xfhbvar.js} +2 -2
  18. package/bin/chunk-4153rke8.js +12 -0
  19. package/bin/{chunk-7jjc175m.js → chunk-4a185tez.js} +3 -3
  20. package/bin/{chunk-zxpef55w.js → chunk-4rexdetz.js} +3 -3
  21. package/bin/{chunk-1dawjfk8.js → chunk-58y9bagr.js} +2 -2
  22. package/bin/chunk-5dqn7egd.js +11 -0
  23. package/bin/{chunk-9p2d0mk1.js → chunk-5e48saab.js} +1 -1
  24. package/bin/{chunk-vnfmh5ke.js → chunk-5qwzveck.js} +2 -2
  25. package/bin/chunk-61hfhfce.js +2 -0
  26. package/bin/chunk-6ab9eftx.js +3 -0
  27. package/bin/chunk-6b0f3d07.js +2 -0
  28. package/bin/chunk-6gjn8trh.js +3 -0
  29. package/bin/{chunk-gn8snrnk.js → chunk-75x3w5hx.js} +1 -1
  30. package/bin/chunk-7e39zmss.js +1 -0
  31. package/bin/chunk-7h1m1e0b.js +1 -0
  32. package/bin/chunk-7kdz1eng.js +3 -0
  33. package/bin/chunk-7pcba64w.js +1 -0
  34. package/bin/{chunk-s05f0v9t.js → chunk-7xfx7741.js} +1 -1
  35. package/bin/chunk-898hrxwq.js +2 -0
  36. package/bin/{chunk-ph3e1bpp.js → chunk-89chaa11.js} +2 -2
  37. package/bin/chunk-8btfb5g6.js +2 -0
  38. package/bin/{chunk-gvn079hy.js → chunk-8pa1n500.js} +2 -2
  39. package/bin/{chunk-vy24ncn2.js → chunk-8qe7cpbr.js} +1 -1
  40. package/bin/{chunk-ws07a9kv.js → chunk-8tnq43k9.js} +1 -1
  41. package/bin/{chunk-1d22tysv.js → chunk-8wzepzp3.js} +2 -2
  42. package/bin/chunk-9deae0n7.js +3 -0
  43. package/bin/{chunk-3rcc5s99.js → chunk-ankkm2wz.js} +2 -2
  44. package/bin/chunk-ardp3pze.js +2 -0
  45. package/bin/chunk-axe5rq99.js +7 -0
  46. package/bin/chunk-bagxeg82.js +2 -0
  47. package/bin/{chunk-ss45w8ks.js → chunk-bhqrqt97.js} +2 -2
  48. package/bin/chunk-bn1sts8x.js +3 -0
  49. package/bin/{chunk-31mjcykb.js → chunk-bpb0szs5.js} +2 -2
  50. package/bin/{chunk-tsncwscz.js → chunk-c1j58ekb.js} +2 -2
  51. package/bin/chunk-c4nenmry.js +2 -0
  52. package/bin/chunk-c9f6n4sf.js +3 -0
  53. package/bin/chunk-cwh21vfb.js +2 -0
  54. package/bin/chunk-cwpmf8tx.js +2 -0
  55. package/bin/{chunk-ejfmxjw6.js → chunk-d2xrh0vv.js} +2 -2
  56. package/bin/chunk-d4sg0z3y.js +2 -0
  57. package/bin/chunk-d4sjezbk.js +8 -0
  58. package/bin/{chunk-vgb8bzcg.js → chunk-ddfx823h.js} +2 -2
  59. package/bin/chunk-dtjx1097.js +2 -0
  60. package/bin/chunk-e32bzfza.js +1 -0
  61. package/bin/chunk-e6rmqgzv.js +2 -0
  62. package/bin/chunk-ersxsrz8.js +62 -0
  63. package/bin/chunk-gg1wfpm8.js +3 -0
  64. package/bin/{chunk-qc6dmzn0.js → chunk-gg8dmkwd.js} +2 -2
  65. package/bin/chunk-gnx9g8px.js +2 -0
  66. package/bin/{chunk-xawwxdq9.js → chunk-h0k9zw29.js} +2 -2
  67. package/bin/chunk-htrzgs2a.css +1 -0
  68. package/bin/chunk-j2jdrmaa.js +2 -0
  69. package/bin/{chunk-v2kfr8fx.js → chunk-j5dejr3e.js} +2 -2
  70. package/bin/{chunk-wap08p4j.js → chunk-j5q3t199.js} +2 -2
  71. package/bin/chunk-jgxhv36z.js +3 -0
  72. package/bin/{chunk-dwswqq3g.js → chunk-jnx8p6kj.js} +1 -1
  73. package/bin/chunk-k41vt2gq.js +1 -0
  74. package/bin/chunk-k78m3rar.js +2 -0
  75. package/bin/chunk-kfbztymc.js +4 -0
  76. package/bin/chunk-kgr3ytpb.js +5 -0
  77. package/bin/chunk-khc3dydj.js +2 -0
  78. package/bin/chunk-krpr6g8a.js +1 -0
  79. package/bin/chunk-m8tnsds1.js +2 -0
  80. package/bin/chunk-mfmcsdd7.js +1 -0
  81. package/bin/chunk-msjv1ykh.js +2 -0
  82. package/bin/chunk-n73dbqps.js +1 -0
  83. package/bin/{chunk-5vqan9c4.js → chunk-n7cmya8k.js} +2 -2
  84. package/bin/{chunk-hfp4hpca.js → chunk-nabagpah.js} +2 -2
  85. package/bin/chunk-nn5qpr0q.js +1 -0
  86. package/bin/{chunk-ve7v8wtv.js → chunk-pew69nxg.js} +2 -2
  87. package/bin/{chunk-7eycsyk6.js → chunk-q2shr586.js} +1 -1
  88. package/bin/chunk-q7v8sj72.js +1 -0
  89. package/bin/chunk-q9tm2d21.js +8 -0
  90. package/bin/{chunk-mcxsk75h.js → chunk-qw5yjhab.js} +3 -3
  91. package/bin/{chunk-j0p1peav.js → chunk-r9thyg31.js} +2 -2
  92. package/bin/{chunk-h2wsm7h3.js → chunk-s584wxzj.js} +2 -2
  93. package/bin/{chunk-wr5byz6r.js → chunk-s5s1rk4n.js} +1 -1
  94. package/bin/{chunk-zs9b0f3z.js → chunk-scfbmsy7.js} +2 -2
  95. package/bin/{chunk-k20bhxed.js → chunk-sddrv3ep.js} +1 -1
  96. package/bin/{chunk-amsb41z5.js → chunk-sfmhbk59.js} +1 -1
  97. package/bin/chunk-tbdgkpgw.js +2 -0
  98. package/bin/chunk-twhj7h73.js +1 -0
  99. package/bin/{chunk-mahxw48e.js → chunk-v5zdafv4.js} +2 -2
  100. package/bin/{chunk-3t7mjvdv.js → chunk-vzx1r87y.js} +2 -2
  101. package/bin/{chunk-a76c5r3c.js → chunk-w3xzd86e.js} +2 -2
  102. package/bin/{chunk-nzy3pjjm.js → chunk-xkh6b42h.js} +2 -2
  103. package/bin/chunk-yn7mxpmb.js +7 -0
  104. package/bin/{chunk-yahb7wan.js → chunk-z544s59c.js} +2 -2
  105. package/bin/{chunk-f8cn9m28.js → chunk-zned6mj8.js} +1 -1
  106. package/bin/{chunk-08mxv0sm.js → chunk-zpq34g0w.js} +2 -2
  107. package/bin/shumai-app.html +1 -1
  108. package/bin/shumai-app.js +495 -372
  109. package/package.json +7 -7
  110. package/prisma/migrations/20260801065040_add_audit_log/migration.sql +33 -0
  111. package/prisma/migrations/20260805021613_add_asset_autofill_context/migration.sql +2 -0
  112. package/prisma/migrations/20260806082136_add_sharelink_watermark/migration.sql +69 -0
  113. package/prisma/migrations/20260806085643_add_watermark_file_status/migration.sql +7 -0
  114. package/prisma/migrations/20260807140837_clean_media_remove_raw_transcodes_and_original_download_url/migration.sql +86 -0
  115. package/prisma/migrations/20260808014542_add_sharelink_allow_download/migration.sql +2 -0
  116. package/prisma/schema.prisma +93 -0
  117. package/bin/chunk-08dr94gp.js +0 -2
  118. package/bin/chunk-0t4z17qr.js +0 -2
  119. package/bin/chunk-2ynx0den.js +0 -8
  120. package/bin/chunk-31a3k77j.js +0 -2
  121. package/bin/chunk-3jdef7n4.js +0 -6
  122. package/bin/chunk-4ahve1nf.js +0 -2
  123. package/bin/chunk-4hdnrwh1.js +0 -1
  124. package/bin/chunk-4hdx2tv0.js +0 -2
  125. package/bin/chunk-4htdb0xp.js +0 -1
  126. package/bin/chunk-4p7xpfey.js +0 -2
  127. package/bin/chunk-5f81c951.js +0 -1
  128. package/bin/chunk-5zntjzxw.js +0 -3
  129. package/bin/chunk-6a2eb3b5.js +0 -3
  130. package/bin/chunk-6t3gdd7e.js +0 -2
  131. package/bin/chunk-7d5kep8c.js +0 -2
  132. package/bin/chunk-7kzqkp5z.js +0 -1
  133. package/bin/chunk-7sh6409h.js +0 -1
  134. package/bin/chunk-7y8dng8t.js +0 -2
  135. package/bin/chunk-8e5zvy88.js +0 -307
  136. package/bin/chunk-8m6zg15c.js +0 -4
  137. package/bin/chunk-8qyke29r.js +0 -7
  138. package/bin/chunk-90et6bwm.js +0 -3
  139. package/bin/chunk-9c7fxjej.js +0 -2
  140. package/bin/chunk-a10tf0d8.js +0 -3
  141. package/bin/chunk-b10meywb.js +0 -2
  142. package/bin/chunk-b1e3tec3.js +0 -62
  143. package/bin/chunk-bdjhb77e.js +0 -2
  144. package/bin/chunk-beay9amy.js +0 -1
  145. package/bin/chunk-c3fvs0bv.js +0 -4
  146. package/bin/chunk-c5my1b3k.js +0 -7
  147. package/bin/chunk-dhekxndw.js +0 -3
  148. package/bin/chunk-dwaj1yn4.js +0 -2
  149. package/bin/chunk-er1rb6yj.js +0 -1
  150. package/bin/chunk-etqpzc9e.js +0 -3
  151. package/bin/chunk-fdpjw17x.js +0 -7
  152. package/bin/chunk-gqh4ttjh.js +0 -3
  153. package/bin/chunk-hz31j0hk.js +0 -4
  154. package/bin/chunk-jm6bxtzt.js +0 -41
  155. package/bin/chunk-jstc7pka.js +0 -2
  156. package/bin/chunk-k0a35mg9.js +0 -2
  157. package/bin/chunk-k9w6mk9d.js +0 -3
  158. package/bin/chunk-kgb16ggd.css +0 -1
  159. package/bin/chunk-m4py21f3.js +0 -2
  160. package/bin/chunk-mm1j72a8.js +0 -7
  161. package/bin/chunk-nr89225z.js +0 -2
  162. package/bin/chunk-nrf5r23d.js +0 -1
  163. package/bin/chunk-nt9tfjx6.js +0 -12
  164. package/bin/chunk-p396vw9h.js +0 -8
  165. package/bin/chunk-p9xfyqh1.js +0 -2
  166. package/bin/chunk-pj0fgb2x.js +0 -6
  167. package/bin/chunk-pp072ksj.js +0 -2
  168. package/bin/chunk-q5cdjzbv.js +0 -3
  169. package/bin/chunk-qn96vbke.js +0 -2
  170. package/bin/chunk-qvgc9e08.js +0 -3
  171. package/bin/chunk-rrxjvewm.js +0 -2
  172. package/bin/chunk-s5rfya1p.js +0 -1
  173. package/bin/chunk-scsy69bp.js +0 -1
  174. package/bin/chunk-sf6fwvrs.js +0 -8
  175. package/bin/chunk-t2txvzkp.js +0 -3
  176. package/bin/chunk-td54rdfj.js +0 -8
  177. package/bin/chunk-vb9m47z9.js +0 -1
  178. package/bin/chunk-vf066xwh.js +0 -3
  179. package/bin/chunk-w3a50kz8.js +0 -3
  180. package/bin/chunk-w9w5301f.js +0 -4
  181. package/bin/chunk-wny0qagx.js +0 -3
  182. package/bin/chunk-wqhk76de.js +0 -14
  183. package/bin/chunk-wrz9e73c.js +0 -2
  184. package/bin/chunk-x5dcgk62.js +0 -6
  185. package/bin/chunk-xwmsxg5x.js +0 -1
  186. package/bin/chunk-y2nw8rbx.js +0 -4
  187. package/bin/chunk-y9ttm07y.js +0 -3
  188. package/bin/chunk-z0ej44ak.js +0 -3
  189. package/bin/chunk-zemgtnk0.js +0 -1
  190. package/bin/chunk-zg0vm233.js +0 -2
  191. package/bin/chunk-zhd2mkbr.js +0 -1
@@ -1,3 +0,0 @@
1
- // @bun
2
- function V(q){if(!(q instanceof Error))return{message:F(q),messageCarriesBody:!1};let w=q,A=I(w),D=K(w),H=D===void 0||q.message.includes(D);return{status:A,body:D,message:q.message,messageCarriesBody:H}}function I(q){if(typeof q.statusCode==="number")return q.statusCode;if(typeof q.status==="number")return q.status;if(typeof q.$metadata?.httpStatusCode==="number")return q.$metadata.httpStatusCode;if(typeof q.$response?.statusCode==="number")return q.$response.statusCode;return}function K(q){let w=P(q);if(w===void 0)return;let A=w.trim();if(A.length===0)return;return Q(A,4000)}function P(q){if(typeof q.body==="string")return q.body;if(G(q.error))return F(q.error);let w=q.$response?.body;if(typeof w==="string")return w;if(G(w))return F(w);return}function G(q){return typeof q==="object"&&q!==null&&Object.keys(q).length>0}function W(q,w){if(q.messageCarriesBody||q.status===void 0||q.body===void 0)return w!==void 0&&q.status!==void 0?`${w} (${q.status}): ${q.message}`:q.message;return w!==void 0?`${w} (${q.status}): ${q.body}`:`${q.status}: ${q.body}`}function Q(q,w){if(q.length<=w)return q;return`${q.slice(0,w)}... [truncated ${q.length-w} chars]`}function F(q){try{let w=JSON.stringify(q);return w===void 0?String(q):w}catch{return String(q)}}
3
- export{V as gc,W as hc};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{Dk as G}from"./chunk-hz31j0hk.js";import{Xk as F}from"./chunk-ws07a9kv.js";var y=F(G(),1),H=new Set(['"',"\\","/","b","f","n","r","t","u"]);function K(b){let f=b.codePointAt(0);return f!==void 0&&f>=0&&f<=31}function Q(b){switch(b){case"\b":return"\\b";case"\f":return"\\f";case`
3
- `:return"\\n";case"\r":return"\\r";case"\t":return"\\t";default:return`\\u${b.codePointAt(0)?.toString(16).padStart(4,"0")??"0000"}`}}function B(b){let f="",v=!1;for(let k=0;k<b.length;k++){let q=b[k];if(!v){if(f+=q,q==='"')v=!0;continue}if(q==='"'){f+=q,v=!1;continue}if(q==="\\"){let w=b[k+1];if(w===void 0){f+="\\\\";continue}if(w==="u"){let z=b.slice(k+2,k+6);if(/^[0-9a-fA-F]{4}$/.test(z)){f+=`\\u${z}`,k+=5;continue}}if(H.has(w)){f+=`\\${w}`,k+=1;continue}f+="\\\\";continue}f+=K(q)?Q(q):q}return f}function T(b){try{return JSON.parse(b)}catch(f){let v=B(b);if(v!==b)return JSON.parse(v);throw f}}function X(b){if(!b||b.trim()==="")return{};try{return T(b)}catch{try{return y.parse(b)??{}}catch{try{return y.parse(B(b))??{}}catch{return{}}}}}
4
- export{T as Ye,X as Ze};
@@ -1,3 +0,0 @@
1
- // @bun
2
- class f{queue=[];waiting=[];done=!1;finalResultPromise;resolveFinalResult;isComplete;extractResult;constructor(b,d){this.isComplete=b,this.extractResult=d,this.finalResultPromise=new Promise((h)=>{this.resolveFinalResult=h})}push(b){if(this.done)return;if(this.isComplete(b))this.done=!0,this.resolveFinalResult(this.extractResult(b));let d=this.waiting.shift();if(d)d({value:b,done:!1});else this.queue.push(b)}end(b){if(this.done=!0,b!==void 0)this.resolveFinalResult(b);while(this.waiting.length>0)this.waiting.shift()({value:void 0,done:!0})}async*[Symbol.asyncIterator](){while(!0)if(this.queue.length>0)yield this.queue.shift();else if(this.done)return;else{let b=await new Promise((d)=>this.waiting.push(d));if(b.done)return;yield b.value}}result(){return this.finalResultPromise}}class k extends f{constructor(){super((b)=>b.type==="done"||b.type==="error",(b)=>{if(b.type==="done")return b.message;else if(b.type==="error")return b.error;throw Error("Unexpected event type for final result")})}}
3
- export{k as df};
@@ -1,14 +0,0 @@
1
- // @bun
2
- import{xk as J}from"./chunk-dhekxndw.js";import{Ck as w}from"./chunk-c3fvs0bv.js";import{Sk as R}from"./chunk-5zntjzxw.js";import{Tk as j}from"./chunk-vf066xwh.js";import{Wk as V}from"./chunk-qvgc9e08.js";function M(Q,E){let W={v:1,id:Q};if(E)W.phase=E;return JSON.stringify(W)}function C(Q){if(!Q)return;if(Q.startsWith("{"))try{let E=JSON.parse(Q);if(E.v===1&&typeof E.id==="string"){if(E.phase==="commentary"||E.phase==="final_answer")return{id:E.id,phase:E.phase};return{id:E.id}}}catch{}return{id:Q}}function x(Q,E,W,U){let _=[],N=(G)=>{let O=G.replace(/[^a-zA-Z0-9_-]/g,"_");return(O.length>64?O.slice(0,64):O).replace(/_+$/,"")},A=(G)=>{let O=`fc_${J(G)}`;return O.length>64?O.slice(0,64):O},y=(G,O,Y)=>{if(!W.has(Q.provider))return N(G);if(!G.includes("|"))return N(G);let[H,L]=G.split("|"),$=N(H),D=Y.provider!==Q.provider||Y.api!==Q.api?A(L):N(L);if(!D.startsWith("fc_"))D=N(`fc_${D}`);return`${$}|${D}`},Z=R(E.messages,Q,y);if((U?.includeSystemPrompt??!0)&&E.systemPrompt){let G=Q.reasoning?"developer":"system";_.push({role:G,content:V(E.systemPrompt)})}let q=0;for(let G of Z){if(G.role==="user")if(typeof G.content==="string")_.push({role:"user",content:[{type:"input_text",text:V(G.content)}]});else{let O=G.content.map((Y)=>{if(Y.type==="text")return{type:"input_text",text:V(Y.text)};return{type:"input_image",detail:"auto",image_url:`data:${Y.mimeType};base64,${Y.data}`}});if(O.length===0)continue;_.push({role:"user",content:O})}else if(G.role==="assistant"){let O=[],Y=G,H=Y.model!==Q.id&&Y.provider===Q.provider&&Y.api===Q.api,L=0;for(let $ of G.content)if($.type==="thinking"){if($.thinkingSignature){let X=JSON.parse($.thinkingSignature);O.push(X)}}else if($.type==="text"){let X=$,D=C(X.textSignature),f=L===0?`msg_pi_${q}`:`msg_pi_${q}_${L}`;L++;let F=D?.id;if(!F)F=f;else if(F.length>64)F=`msg_${J(F)}`;O.push({type:"message",role:"assistant",content:[{type:"output_text",text:V(X.text),annotations:[]}],status:"completed",id:F,phase:D?.phase})}else if($.type==="toolCall"){let X=$,[D,f]=X.id.split("|"),F=f;if(H&&F?.startsWith("fc_"))F=void 0;O.push({type:"function_call",id:F,call_id:D,name:X.name,arguments:JSON.stringify(X.arguments)})}if(O.length===0)continue;_.push(...O)}else if(G.role==="toolResult"){let O=G.content.filter((X)=>X.type==="text").map((X)=>X.text).join(`
3
- `),Y=G.content.some((X)=>X.type==="image"),H=O.length>0,[L]=G.toolCallId.split("|"),$;if(Y&&Q.input.includes("image")){let X=[];if(H)X.push({type:"input_text",text:V(O)});for(let D of G.content)if(D.type==="image")X.push({type:"input_image",detail:"auto",image_url:`data:${D.mimeType};base64,${D.data}`});$=X}else $=V(H?O:"(see attached image)");_.push({type:"function_call_output",call_id:L,output:$})}q++}return _}function v(Q,E){let W=E?.strict===void 0?!1:E.strict;return Q.map((U)=>({type:"function",name:U.name,description:U.description,parameters:U.parameters,strict:W}))}async function B(Q,E,W,U,_){let N=null,A=null,y=E.content,Z=()=>y.length-1;for await(let K of Q)if(K.type==="response.created")E.responseId=K.response.id;else if(K.type==="response.output_item.added"){let q=K.item;if(q.type==="reasoning")N=q,A={type:"thinking",thinking:""},E.content.push(A),W.push({type:"thinking_start",contentIndex:Z(),partial:E});else if(q.type==="message")N=q,A={type:"text",text:""},E.content.push(A),W.push({type:"text_start",contentIndex:Z(),partial:E});else if(q.type==="function_call")N=q,A={type:"toolCall",id:`${q.call_id}|${q.id}`,name:q.name,arguments:{},partialJson:q.arguments||""},E.content.push(A),W.push({type:"toolcall_start",contentIndex:Z(),partial:E})}else if(K.type==="response.reasoning_summary_part.added"){if(N&&N.type==="reasoning")N.summary=N.summary||[],N.summary.push(K.part)}else if(K.type==="response.reasoning_summary_text.delta"){if(N?.type==="reasoning"&&A?.type==="thinking"){N.summary=N.summary||[];let q=N.summary[N.summary.length-1];if(q)A.thinking+=K.delta,q.text+=K.delta,W.push({type:"thinking_delta",contentIndex:Z(),delta:K.delta,partial:E})}}else if(K.type==="response.reasoning_summary_part.done"){if(N?.type==="reasoning"&&A?.type==="thinking"){N.summary=N.summary||[];let q=N.summary[N.summary.length-1];if(q)A.thinking+=`
4
-
5
- `,q.text+=`
6
-
7
- `,W.push({type:"thinking_delta",contentIndex:Z(),delta:`
8
-
9
- `,partial:E})}}else if(K.type==="response.reasoning_text.delta"){if(N?.type==="reasoning"&&A?.type==="thinking")A.thinking+=K.delta,W.push({type:"thinking_delta",contentIndex:Z(),delta:K.delta,partial:E})}else if(K.type==="response.content_part.added"){if(N?.type==="message"){if(N.content=N.content||[],K.part.type==="output_text"||K.part.type==="refusal")N.content.push(K.part)}}else if(K.type==="response.output_text.delta"){if(N?.type==="message"&&A?.type==="text"){if(!N.content||N.content.length===0)continue;let q=N.content[N.content.length-1];if(q?.type==="output_text")A.text+=K.delta,q.text+=K.delta,W.push({type:"text_delta",contentIndex:Z(),delta:K.delta,partial:E})}}else if(K.type==="response.refusal.delta"){if(N?.type==="message"&&A?.type==="text"){if(!N.content||N.content.length===0)continue;let q=N.content[N.content.length-1];if(q?.type==="refusal")A.text+=K.delta,q.refusal+=K.delta,W.push({type:"text_delta",contentIndex:Z(),delta:K.delta,partial:E})}}else if(K.type==="response.function_call_arguments.delta"){if(N?.type==="function_call"&&A?.type==="toolCall")A.partialJson+=K.delta,A.arguments=w(A.partialJson),W.push({type:"toolcall_delta",contentIndex:Z(),delta:K.delta,partial:E})}else if(K.type==="response.function_call_arguments.done"){if(N?.type==="function_call"&&A?.type==="toolCall"){let q=A.partialJson;if(A.partialJson=K.arguments,A.arguments=w(A.partialJson),K.arguments.startsWith(q)){let G=K.arguments.slice(q.length);if(G.length>0)W.push({type:"toolcall_delta",contentIndex:Z(),delta:G,partial:E})}}}else if(K.type==="response.output_item.done"){let q=K.item;if(q.type==="reasoning"&&A?.type==="thinking"){let G=q.summary?.map((Y)=>Y.text).join(`
10
-
11
- `)||"",O=q.content?.map((Y)=>Y.text).join(`
12
-
13
- `)||"";A.thinking=G||O||A.thinking,A.thinkingSignature=JSON.stringify(q),W.push({type:"thinking_end",contentIndex:Z(),content:A.thinking,partial:E}),A=null}else if(q.type==="message"&&A?.type==="text")A.text=q.content.map((G)=>G.type==="output_text"?G.text:G.refusal).join(""),A.textSignature=M(q.id,q.phase??void 0),W.push({type:"text_end",contentIndex:Z(),content:A.text,partial:E}),A=null;else if(q.type==="function_call"){let G=A?.type==="toolCall"&&A.partialJson?w(A.partialJson):w(q.arguments||"{}"),O;if(A?.type==="toolCall")A.arguments=G,delete A.partialJson,O=A;else O={type:"toolCall",id:`${q.call_id}|${q.id}`,name:q.name,arguments:G};A=null,W.push({type:"toolcall_end",contentIndex:Z(),toolCall:O,partial:E})}}else if(K.type==="response.completed"){let q=K.response;if(q?.id)E.responseId=q.id;if(q?.usage){let G=q.usage.input_tokens_details?.cached_tokens||0;E.usage={input:(q.usage.input_tokens||0)-G,output:q.usage.output_tokens||0,cacheRead:G,cacheWrite:0,totalTokens:q.usage.total_tokens||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}if(j(U,E.usage),_?.applyServiceTierPricing){let G=_.resolveServiceTier?_.resolveServiceTier(q?.service_tier,_.serviceTier):q?.service_tier??_.serviceTier;_.applyServiceTierPricing(E.usage,G)}if(E.stopReason=T(q?.status),E.content.some((G)=>G.type==="toolCall")&&E.stopReason==="stop")E.stopReason="toolUse"}else if(K.type==="error")throw Error(`Error Code ${K.code}: ${K.message}`||"Unknown error");else if(K.type==="response.failed"){let q=K.response?.error,G=K.response?.incomplete_details,O=q?`${q.code||"unknown"}: ${q.message||"no message"}`:G?.reason?`incomplete: ${G.reason}`:"Unknown error (no error details in response)";throw Error(O)}}function T(Q){if(!Q)return"stop";switch(Q){case"completed":return"stop";case"incomplete":return"length";case"failed":case"cancelled":return"error";case"in_progress":case"queued":return"stop";default:throw Error(`Unhandled stop reason: ${Q}`)}}
14
- export{x as uk,v as vk,B as wk};
@@ -1,2 +0,0 @@
1
- import{_a as Kq}from"./chunk-1nh6xgek.js";import{ab as s,bb as o,cb as r,db as m,eb as e,fb as qq,gb as Eq,hb as Jq}from"./chunk-20y3wte3.js";import{Rg as H,Tg as z,Ug as F,Wg as y,Xg as X,dh as d}from"./chunk-nr89225z.js";import{Ai as l,Kh as P,Wh as $,ck as Q,dk as c,ek as T,fk as w,gh as yq,hh as x,ih as E,ik as J,jh as K,jk as b,kk as a,lk as t,nk as n,qi as f,xj as i}from"./chunk-b1e3tec3.js";import{Xk as Fq}from"./chunk-ws07a9kv.js";var V=Fq(yq(),1);function Tq({open:Nq,onOpenChange:Pq,title:Qq,members:A,isOwner:B,onInvite:S,onUpdateRole:D,onRemoveMember:R,currentUserId:Vq,availableMembersToAdd:k,onAddMember:I,type:Wq="team"}){let[G,g]=V.useState("editor"),[Z,M]=V.useState(null),[v,u]=V.useState(!1),[L,_]=V.useState(null),[Y,h]=V.useState(null),[Xq,p]=V.useState({}),[U,O]=V.useState(null),C=(q)=>{if(!q)return"";switch(q.toLowerCase()){case"owner":return J.owner();case"editor":return J.editor();case"reviewer":return J.reviewer();default:return q}},Yq=(q,N)=>{p((W)=>({...W,[q]:N}))},Zq=async(q,N)=>{if(!D)return;_(q);try{await D(q,N),P.success(J.member_role_updated())}catch(W){console.error(W),P.error(J.failed_to_update_member_role())}finally{_(null)}},_q=async()=>{if(!R||!Y?.id)return;_(Y.id);try{await R(Y.id),P.success(J.member_removed()),h(null)}catch(q){console.error(q),P.error(J.failed_to_remove_member())}finally{_(null)}},$q=async()=>{if(!S)return;u(!0);try{let q=await S(G),N=`${window.location.origin}/signup?inviteCode=${q}`;M(N)}catch(q){console.error(q),P.error(J.failed_to_generate_invite_link())}finally{u(!1)}},fq=async()=>{if(Z){if(await Kq(Z))P.success(J.invite_link_copied())}},j=(q)=>{if(!q)return"??";return q.split(" ").map((N)=>N[0]).slice(0,2).join("").toUpperCase()},Hq=(q)=>{if(!q)M(null),g("editor"),p({}),O(null);Pq(q)},zq=Array.isArray(A)?A:[];return E(b,{open:Nq,onOpenChange:Hq,children:K(a,{className:"sm:max-w-md",onOpenAutoFocus:(q)=>q.preventDefault(),children:[E(t,{children:E(n,{children:Qq})}),K("div",{className:"space-y-4",children:[E("div",{className:"max-h-[300px] overflow-y-auto space-y-2",children:zq.map((q)=>K("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[K("div",{className:"flex items-center gap-3",children:[K(c,{children:[q.image&&E(T,{src:q.image,alt:q.name,className:"object-cover"}),E(w,{children:j(q.name)})]}),K("div",{className:"flex flex-col",children:[E("span",{className:"text-sm font-medium",children:q.name}),K("div",{className:"flex items-center gap-2",children:[E("span",{className:"text-xs text-muted-foreground capitalize",children:C(q.role)}),q.scope&&K(x,{children:[E("span",{className:"text-[10px] text-muted-foreground/70",children:"•"}),E("span",{className:"text-xs text-muted-foreground capitalize",children:q.scope==="team"?J.team_member():J.project_member()})]})]})]})]}),B&&q.role!=="owner"&&q.id!==Vq&&K("div",{className:"flex items-center gap-2",children:[K(H,{children:[E(z,{asChild:!0,children:K(Q,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:L===q.id,children:[C(q.role),E(f,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(F,{children:K(y,{value:q.role,onValueChange:(N)=>Zq(q.id,N),children:[E(X,{value:"editor",className:"text-xs",children:J.editor()}),E(X,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(Q,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>h(q),disabled:L===q.id,children:L===q.id?E($,{className:"h-3 w-3 animate-spin"}):E(i,{className:"h-3 w-3"})})]})]},q.id))}),E(s,{open:!!Y,onOpenChange:(q)=>!q&&h(null),children:K(o,{children:[K(r,{children:[E(e,{children:J.remove_member()}),E(qq,{children:J.remove_member_confirmation({name:Y?.name||"",type:Wq==="project"?J.project():J.team()})})]}),K(m,{children:[E(Jq,{children:J.cancel()}),E(Eq,{onClick:_q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:J.remove()})]})]})})," ",B&&I&&k&&k.length>0&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-3",children:J.add_team_member_to_project()}),E("div",{className:"max-h-[200px] overflow-y-auto space-y-2 pr-1",children:k.map((q)=>{let N=Xq[q.id]||"editor";return K("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[K("div",{className:"flex items-center gap-3",children:[K(c,{children:[q.image&&E(T,{src:q.image,alt:q.name,className:"object-cover"}),E(w,{children:j(q.name)})]}),K("div",{className:"flex flex-col",children:[E("span",{className:"text-sm font-medium",children:q.name}),E("span",{className:"text-xs text-muted-foreground capitalize",children:q.scope==="team"?J.team_member():J.project_member()})]})]}),K("div",{className:"flex items-center gap-2",children:[K(H,{children:[E(z,{asChild:!0,children:K(Q,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:U===q.id,children:[C(N),E(f,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(F,{children:K(y,{value:N,onValueChange:(W)=>Yq(q.id,W),children:[E(X,{value:"editor",className:"text-xs",children:J.editor()}),E(X,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(Q,{onClick:async()=>{O(q.id);try{await I(q.id,N),P.success(J.added_member_successfully({name:q.name||""}))}catch(W){console.error(W),P.error(J.failed_to_add_member({name:q.name||""}))}finally{O(null)}},disabled:U!==null,size:"sm",className:"h-8 text-xs px-3 w-[60px]",children:U===q.id?E($,{className:"h-3 w-3 animate-spin"}):J.add()})]})]},q.id)})})]}),B&&S&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-3",children:J.invite_new_member()}),K("div",{className:"space-y-3",children:[K("div",{className:"flex gap-2",children:[K(H,{children:[E(z,{asChild:!0,children:K(Q,{variant:"outline",className:"w-[120px] justify-between",children:[G==="editor"?J.editor():J.reviewer(),E(f,{className:"h-4 w-4 opacity-50"})]})}),E(F,{children:K(y,{value:G,onValueChange:(q)=>g(q),children:[E(X,{value:"editor",children:J.editor()}),E(X,{value:"reviewer",children:J.reviewer()})]})})]}),K(Q,{onClick:$q,disabled:v,className:"flex-1",children:[v&&E($,{className:"mr-2 h-4 w-4 animate-spin"}),J.generate_link()]})]}),Z&&K("div",{className:"flex gap-2",children:[E(d,{value:Z,readOnly:!0}),E(Q,{variant:"outline",size:"icon",onClick:fq,children:E(l,{className:"h-4 w-4"})})]})]})]})]})]})})}
2
- export{Tq as Za};
@@ -1,6 +0,0 @@
1
- // @bun
2
- var T_=Symbol("Let zodToJsonSchema decide on which parser to use");var l_={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},h_=(_)=>typeof _==="string"?{...l_,name:_}:{...l_,..._};var A;(function(_){_.assertEqual=(W)=>{};function $(W){}_.assertIs=$;function q(W){throw Error()}_.assertNever=q,_.arrayToEnum=(W)=>{let X={};for(let H of W)X[H]=H;return X},_.getValidEnumValues=(W)=>{let X=_.objectKeys(W).filter((Y)=>typeof W[W[Y]]!=="number"),H={};for(let Y of X)H[Y]=W[Y];return _.objectValues(H)},_.objectValues=(W)=>{return _.objectKeys(W).map(function(X){return W[X]})},_.objectKeys=typeof Object.keys==="function"?(W)=>Object.keys(W):(W)=>{let X=[];for(let H in W)if(Object.prototype.hasOwnProperty.call(W,H))X.push(H);return X},_.find=(W,X)=>{for(let H of W)if(X(H))return H;return},_.isInteger=typeof Number.isInteger==="function"?(W)=>Number.isInteger(W):(W)=>typeof W==="number"&&Number.isFinite(W)&&Math.floor(W)===W;function J(W,X=" | "){return W.map((H)=>typeof H==="string"?`'${H}'`:H).join(X)}_.joinValues=J,_.jsonStringifyReplacer=(W,X)=>{if(typeof X==="bigint")return X.toString();return X}})(A||(A={}));var y_;(function(_){_.mergeShapes=($,q)=>{return{...$,...q}}})(y_||(y_={}));var B=A.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),P=(_)=>{switch(typeof _){case"undefined":return B.undefined;case"string":return B.string;case"number":return Number.isNaN(_)?B.nan:B.number;case"boolean":return B.boolean;case"function":return B.function;case"bigint":return B.bigint;case"symbol":return B.symbol;case"object":if(Array.isArray(_))return B.array;if(_===null)return B.null;if(_.then&&typeof _.then==="function"&&_.catch&&typeof _.catch==="function")return B.promise;if(typeof Map<"u"&&_ instanceof Map)return B.map;if(typeof Set<"u"&&_ instanceof Set)return B.set;if(typeof Date<"u"&&_ instanceof Date)return B.date;return B.object;default:return B.unknown}};var G=A.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class K extends Error{get errors(){return this.issues}constructor(_){super();this.issues=[],this.addIssue=(q)=>{this.issues=[...this.issues,q]},this.addIssues=(q=[])=>{this.issues=[...this.issues,...q]};let $=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,$);else this.__proto__=$;this.name="ZodError",this.issues=_}format(_){let $=_||function(W){return W.message},q={_errors:[]},J=(W)=>{for(let X of W.issues)if(X.code==="invalid_union")X.unionErrors.map(J);else if(X.code==="invalid_return_type")J(X.returnTypeError);else if(X.code==="invalid_arguments")J(X.argumentsError);else if(X.path.length===0)q._errors.push($(X));else{let H=q,Y=0;while(Y<X.path.length){let Q=X.path[Y];if(Y!==X.path.length-1)H[Q]=H[Q]||{_errors:[]};else H[Q]=H[Q]||{_errors:[]},H[Q]._errors.push($(X));H=H[Q],Y++}}};return J(this),q}static assert(_){if(!(_ instanceof K))throw Error(`Not a ZodError: ${_}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,A.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(_=($)=>$.message){let $=Object.create(null),q=[];for(let J of this.issues)if(J.path.length>0){let W=J.path[0];$[W]=$[W]||[],$[W].push(_(J))}else q.push(_(J));return{formErrors:q,fieldErrors:$}}get formErrors(){return this.flatten()}}K.create=(_)=>{return new K(_)};var A$=(_,$)=>{let q;switch(_.code){case G.invalid_type:if(_.received===B.undefined)q="Required";else q=`Expected ${_.expected}, received ${_.received}`;break;case G.invalid_literal:q=`Invalid literal value, expected ${JSON.stringify(_.expected,A.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:q=`Unrecognized key(s) in object: ${A.joinValues(_.keys,", ")}`;break;case G.invalid_union:q="Invalid input";break;case G.invalid_union_discriminator:q=`Invalid discriminator value. Expected ${A.joinValues(_.options)}`;break;case G.invalid_enum_value:q=`Invalid enum value. Expected ${A.joinValues(_.options)}, received '${_.received}'`;break;case G.invalid_arguments:q="Invalid function arguments";break;case G.invalid_return_type:q="Invalid function return type";break;case G.invalid_date:q="Invalid date";break;case G.invalid_string:if(typeof _.validation==="object")if("includes"in _.validation){if(q=`Invalid input: must include "${_.validation.includes}"`,typeof _.validation.position==="number")q=`${q} at one or more positions greater than or equal to ${_.validation.position}`}else if("startsWith"in _.validation)q=`Invalid input: must start with "${_.validation.startsWith}"`;else if("endsWith"in _.validation)q=`Invalid input: must end with "${_.validation.endsWith}"`;else A.assertNever(_.validation);else if(_.validation!=="regex")q=`Invalid ${_.validation}`;else q="Invalid";break;case G.too_small:if(_.type==="array")q=`Array must contain ${_.exact?"exactly":_.inclusive?"at least":"more than"} ${_.minimum} element(s)`;else if(_.type==="string")q=`String must contain ${_.exact?"exactly":_.inclusive?"at least":"over"} ${_.minimum} character(s)`;else if(_.type==="number")q=`Number must be ${_.exact?"exactly equal to ":_.inclusive?"greater than or equal to ":"greater than "}${_.minimum}`;else if(_.type==="bigint")q=`Number must be ${_.exact?"exactly equal to ":_.inclusive?"greater than or equal to ":"greater than "}${_.minimum}`;else if(_.type==="date")q=`Date must be ${_.exact?"exactly equal to ":_.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(_.minimum))}`;else q="Invalid input";break;case G.too_big:if(_.type==="array")q=`Array must contain ${_.exact?"exactly":_.inclusive?"at most":"less than"} ${_.maximum} element(s)`;else if(_.type==="string")q=`String must contain ${_.exact?"exactly":_.inclusive?"at most":"under"} ${_.maximum} character(s)`;else if(_.type==="number")q=`Number must be ${_.exact?"exactly":_.inclusive?"less than or equal to":"less than"} ${_.maximum}`;else if(_.type==="bigint")q=`BigInt must be ${_.exact?"exactly":_.inclusive?"less than or equal to":"less than"} ${_.maximum}`;else if(_.type==="date")q=`Date must be ${_.exact?"exactly":_.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(_.maximum))}`;else q="Invalid input";break;case G.custom:q="Invalid input";break;case G.invalid_intersection_types:q="Intersection results could not be merged";break;case G.not_multiple_of:q=`Number must be a multiple of ${_.multipleOf}`;break;case G.not_finite:q="Number must be finite";break;default:q=$.defaultError,A.assertNever(_)}return{message:q}},y=A$;var O$=y;function t(){return O$}var B_=(_)=>{let{data:$,path:q,errorMaps:J,issueData:W}=_,X=[...q,...W.path||[]],H={...W,path:X};if(W.message!==void 0)return{...W,path:X,message:W.message};let Y="",Q=J.filter((S)=>!!S).slice().reverse();for(let S of Q)Y=S(H,{data:$,defaultError:Y}).message;return{...W,path:X,message:Y}};function D(_,$){let q=t(),J=B_({issueData:$,data:_.data,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,q,q===y?void 0:y].filter((W)=>!!W)});_.common.issues.push(J)}class V{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(_,$){let q=[];for(let J of $){if(J.status==="aborted")return b;if(J.status==="dirty")_.dirty();q.push(J.value)}return{status:_.value,value:q}}static async mergeObjectAsync(_,$){let q=[];for(let J of $){let W=await J.key,X=await J.value;q.push({key:W,value:X})}return V.mergeObjectSync(_,q)}static mergeObjectSync(_,$){let q={};for(let J of $){let{key:W,value:X}=J;if(W.status==="aborted")return b;if(X.status==="aborted")return b;if(W.status==="dirty")_.dirty();if(X.status==="dirty")_.dirty();if(W.value!=="__proto__"&&(typeof X.value<"u"||J.alwaysSet))q[W.value]=X.value}return{status:_.value,value:q}}}var b=Object.freeze({status:"aborted"}),p=(_)=>({status:"dirty",value:_}),R=(_)=>({status:"valid",value:_}),R_=(_)=>_.status==="aborted",L_=(_)=>_.status==="dirty",n=(_)=>_.status==="valid",a=(_)=>typeof Promise<"u"&&_ instanceof Promise;var w;(function(_){_.errToObj=($)=>typeof $==="string"?{message:$}:$||{},_.toString=($)=>typeof $==="string"?$:$?.message})(w||(w={}));class F{constructor(_,$,q,J){this._cachedPath=[],this.parent=_,this.data=$,this._path=q,this._key=J}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var x_=(_,$)=>{if(n($))return{success:!0,data:$.value};else{if(!_.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let q=new K(_.common.issues);return this._error=q,this._error}}}};function v(_){if(!_)return{};let{errorMap:$,invalid_type_error:q,required_error:J,description:W}=_;if($&&(q||J))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if($)return{errorMap:$,description:W};return{errorMap:(H,Y)=>{let{message:Q}=_;if(H.code==="invalid_enum_value")return{message:Q??Y.defaultError};if(typeof Y.data>"u")return{message:Q??J??Y.defaultError};if(H.code!=="invalid_type")return{message:Y.defaultError};return{message:Q??q??Y.defaultError}},description:W}}class j{get description(){return this._def.description}_getType(_){return P(_.data)}_getOrReturnCtx(_,$){return $||{common:_.parent.common,data:_.data,parsedType:P(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}_processInputParams(_){return{status:new V,ctx:{common:_.parent.common,data:_.data,parsedType:P(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}}_parseSync(_){let $=this._parse(_);if(a($))throw Error("Synchronous parse encountered promise.");return $}_parseAsync(_){let $=this._parse(_);return Promise.resolve($)}parse(_,$){let q=this.safeParse(_,$);if(q.success)return q.data;throw q.error}safeParse(_,$){let q={common:{issues:[],async:$?.async??!1,contextualErrorMap:$?.errorMap},path:$?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:P(_)},J=this._parseSync({data:_,path:q.path,parent:q});return x_(q,J)}"~validate"(_){let $={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:P(_)};if(!this["~standard"].async)try{let q=this._parseSync({data:_,path:[],parent:$});return n(q)?{value:q.value}:{issues:$.common.issues}}catch(q){if(q?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;$.common={issues:[],async:!0}}return this._parseAsync({data:_,path:[],parent:$}).then((q)=>n(q)?{value:q.value}:{issues:$.common.issues})}async parseAsync(_,$){let q=await this.safeParseAsync(_,$);if(q.success)return q.data;throw q.error}async safeParseAsync(_,$){let q={common:{issues:[],contextualErrorMap:$?.errorMap,async:!0},path:$?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:P(_)},J=this._parse({data:_,path:q.path,parent:q}),W=await(a(J)?J:Promise.resolve(J));return x_(q,W)}refine(_,$){let q=(J)=>{if(typeof $==="string"||typeof $>"u")return{message:$};else if(typeof $==="function")return $(J);else return $};return this._refinement((J,W)=>{let X=_(J),H=()=>W.addIssue({code:G.custom,...q(J)});if(typeof Promise<"u"&&X instanceof Promise)return X.then((Y)=>{if(!Y)return H(),!1;else return!0});if(!X)return H(),!1;else return!0})}refinement(_,$){return this._refinement((q,J)=>{if(!_(q))return J.addIssue(typeof $==="function"?$(q,J):$),!1;else return!0})}_refinement(_){return new I({schema:this,typeName:M.ZodEffects,effect:{type:"refinement",refinement:_}})}superRefine(_){return this._refinement(_)}constructor(_){this.spa=this.safeParseAsync,this._def=_,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:($)=>this["~validate"]($)}}optional(){return k.create(this,this._def)}nullable(){return x.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return C.create(this)}promise(){return d.create(this,this._def)}or(_){return q_.create([this,_],this._def)}and(_){return J_.create(this,_,this._def)}transform(_){return new I({...v(this._def),schema:this,typeName:M.ZodEffects,effect:{type:"transform",transform:_}})}default(_){let $=typeof _==="function"?_:()=>_;return new Q_({...v(this._def),innerType:this,defaultValue:$,typeName:M.ZodDefault})}brand(){return new g_({typeName:M.ZodBranded,type:this,...v(this._def)})}catch(_){let $=typeof _==="function"?_:()=>_;return new Y_({...v(this._def),innerType:this,catchValue:$,typeName:M.ZodCatch})}describe(_){return new this.constructor({...this._def,description:_})}pipe(_){return A_.create(this,_)}readonly(){return G_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var N$=/^c[^\s-]{8,}$/i,E$=/^[0-9a-z]+$/,U$=/^[0-9A-HJKMNP-TV-Z]{26}$/i,V$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,R$=/^[a-z0-9_-]{21}$/i,L$=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,K$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,F$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,f$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",K_,g$=/^(?:(?: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])$/,C$=/^(?:(?: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])$/,k$=/^(([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]))$/,I$=/^(([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])$/,P$=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,m$=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,n_="((\\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])))",l$=new RegExp(`^${n_}$`);function Z_(_){let $="[0-5]\\d";if(_.precision)$=`${$}\\.\\d{${_.precision}}`;else if(_.precision==null)$=`${$}(\\.\\d+)?`;let q=_.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${$})${q}`}function T$(_){return new RegExp(`^${Z_(_)}$`)}function h$(_){let $=`${n_}T${Z_(_)}`,q=[];if(q.push(_.local?"Z?":"Z"),_.offset)q.push("([+-]\\d{2}:?\\d{2})");return $=`${$}(${q.join("|")})`,new RegExp(`^${$}$`)}function y$(_,$){if(($==="v4"||!$)&&g$.test(_))return!0;if(($==="v6"||!$)&&k$.test(_))return!0;return!1}function x$(_,$){if(!L$.test(_))return!1;try{let[q]=_.split(".");if(!q)return!1;let J=q.replace(/-/g,"+").replace(/_/g,"/").padEnd(q.length+(4-q.length%4)%4,"="),W=JSON.parse(atob(J));if(typeof W!=="object"||W===null)return!1;if("typ"in W&&W?.typ!=="JWT")return!1;if(!W.alg)return!1;if($&&W.alg!==$)return!1;return!0}catch{return!1}}function n$(_,$){if(($==="v4"||!$)&&C$.test(_))return!0;if(($==="v6"||!$)&&I$.test(_))return!0;return!1}class l extends j{_parse(_){if(this._def.coerce)_.data=String(_.data);if(this._getType(_)!==B.string){let W=this._getOrReturnCtx(_);return D(W,{code:G.invalid_type,expected:B.string,received:W.parsedType}),b}let q=new V,J=void 0;for(let W of this._def.checks)if(W.kind==="min"){if(_.data.length<W.value)J=this._getOrReturnCtx(_,J),D(J,{code:G.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),q.dirty()}else if(W.kind==="max"){if(_.data.length>W.value)J=this._getOrReturnCtx(_,J),D(J,{code:G.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),q.dirty()}else if(W.kind==="length"){let X=_.data.length>W.value,H=_.data.length<W.value;if(X||H){if(J=this._getOrReturnCtx(_,J),X)D(J,{code:G.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});else if(H)D(J,{code:G.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});q.dirty()}}else if(W.kind==="email"){if(!F$.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"email",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="emoji"){if(!K_)K_=new RegExp(f$,"u");if(!K_.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"emoji",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="uuid"){if(!V$.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"uuid",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="nanoid"){if(!R$.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"nanoid",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="cuid"){if(!N$.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"cuid",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="cuid2"){if(!E$.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"cuid2",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="ulid"){if(!U$.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"ulid",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="url")try{new URL(_.data)}catch{J=this._getOrReturnCtx(_,J),D(J,{validation:"url",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="regex"){if(W.regex.lastIndex=0,!W.regex.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"regex",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="trim")_.data=_.data.trim();else if(W.kind==="includes"){if(!_.data.includes(W.value,W.position))J=this._getOrReturnCtx(_,J),D(J,{code:G.invalid_string,validation:{includes:W.value,position:W.position},message:W.message}),q.dirty()}else if(W.kind==="toLowerCase")_.data=_.data.toLowerCase();else if(W.kind==="toUpperCase")_.data=_.data.toUpperCase();else if(W.kind==="startsWith"){if(!_.data.startsWith(W.value))J=this._getOrReturnCtx(_,J),D(J,{code:G.invalid_string,validation:{startsWith:W.value},message:W.message}),q.dirty()}else if(W.kind==="endsWith"){if(!_.data.endsWith(W.value))J=this._getOrReturnCtx(_,J),D(J,{code:G.invalid_string,validation:{endsWith:W.value},message:W.message}),q.dirty()}else if(W.kind==="datetime"){if(!h$(W).test(_.data))J=this._getOrReturnCtx(_,J),D(J,{code:G.invalid_string,validation:"datetime",message:W.message}),q.dirty()}else if(W.kind==="date"){if(!l$.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{code:G.invalid_string,validation:"date",message:W.message}),q.dirty()}else if(W.kind==="time"){if(!T$(W).test(_.data))J=this._getOrReturnCtx(_,J),D(J,{code:G.invalid_string,validation:"time",message:W.message}),q.dirty()}else if(W.kind==="duration"){if(!K$.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"duration",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="ip"){if(!y$(_.data,W.version))J=this._getOrReturnCtx(_,J),D(J,{validation:"ip",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="jwt"){if(!x$(_.data,W.alg))J=this._getOrReturnCtx(_,J),D(J,{validation:"jwt",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="cidr"){if(!n$(_.data,W.version))J=this._getOrReturnCtx(_,J),D(J,{validation:"cidr",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="base64"){if(!P$.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"base64",code:G.invalid_string,message:W.message}),q.dirty()}else if(W.kind==="base64url"){if(!m$.test(_.data))J=this._getOrReturnCtx(_,J),D(J,{validation:"base64url",code:G.invalid_string,message:W.message}),q.dirty()}else A.assertNever(W);return{status:q.value,value:_.data}}_regex(_,$,q){return this.refinement((J)=>_.test(J),{validation:$,code:G.invalid_string,...w.errToObj(q)})}_addCheck(_){return new l({...this._def,checks:[...this._def.checks,_]})}email(_){return this._addCheck({kind:"email",...w.errToObj(_)})}url(_){return this._addCheck({kind:"url",...w.errToObj(_)})}emoji(_){return this._addCheck({kind:"emoji",...w.errToObj(_)})}uuid(_){return this._addCheck({kind:"uuid",...w.errToObj(_)})}nanoid(_){return this._addCheck({kind:"nanoid",...w.errToObj(_)})}cuid(_){return this._addCheck({kind:"cuid",...w.errToObj(_)})}cuid2(_){return this._addCheck({kind:"cuid2",...w.errToObj(_)})}ulid(_){return this._addCheck({kind:"ulid",...w.errToObj(_)})}base64(_){return this._addCheck({kind:"base64",...w.errToObj(_)})}base64url(_){return this._addCheck({kind:"base64url",...w.errToObj(_)})}jwt(_){return this._addCheck({kind:"jwt",...w.errToObj(_)})}ip(_){return this._addCheck({kind:"ip",...w.errToObj(_)})}cidr(_){return this._addCheck({kind:"cidr",...w.errToObj(_)})}datetime(_){if(typeof _==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:_});return this._addCheck({kind:"datetime",precision:typeof _?.precision>"u"?null:_?.precision,offset:_?.offset??!1,local:_?.local??!1,...w.errToObj(_?.message)})}date(_){return this._addCheck({kind:"date",message:_})}time(_){if(typeof _==="string")return this._addCheck({kind:"time",precision:null,message:_});return this._addCheck({kind:"time",precision:typeof _?.precision>"u"?null:_?.precision,...w.errToObj(_?.message)})}duration(_){return this._addCheck({kind:"duration",...w.errToObj(_)})}regex(_,$){return this._addCheck({kind:"regex",regex:_,...w.errToObj($)})}includes(_,$){return this._addCheck({kind:"includes",value:_,position:$?.position,...w.errToObj($?.message)})}startsWith(_,$){return this._addCheck({kind:"startsWith",value:_,...w.errToObj($)})}endsWith(_,$){return this._addCheck({kind:"endsWith",value:_,...w.errToObj($)})}min(_,$){return this._addCheck({kind:"min",value:_,...w.errToObj($)})}max(_,$){return this._addCheck({kind:"max",value:_,...w.errToObj($)})}length(_,$){return this._addCheck({kind:"length",value:_,...w.errToObj($)})}nonempty(_){return this.min(1,w.errToObj(_))}trim(){return new l({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new l({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new l({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((_)=>_.kind==="datetime")}get isDate(){return!!this._def.checks.find((_)=>_.kind==="date")}get isTime(){return!!this._def.checks.find((_)=>_.kind==="time")}get isDuration(){return!!this._def.checks.find((_)=>_.kind==="duration")}get isEmail(){return!!this._def.checks.find((_)=>_.kind==="email")}get isURL(){return!!this._def.checks.find((_)=>_.kind==="url")}get isEmoji(){return!!this._def.checks.find((_)=>_.kind==="emoji")}get isUUID(){return!!this._def.checks.find((_)=>_.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((_)=>_.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((_)=>_.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((_)=>_.kind==="cuid2")}get isULID(){return!!this._def.checks.find((_)=>_.kind==="ulid")}get isIP(){return!!this._def.checks.find((_)=>_.kind==="ip")}get isCIDR(){return!!this._def.checks.find((_)=>_.kind==="cidr")}get isBase64(){return!!this._def.checks.find((_)=>_.kind==="base64")}get isBase64url(){return!!this._def.checks.find((_)=>_.kind==="base64url")}get minLength(){let _=null;for(let $ of this._def.checks)if($.kind==="min"){if(_===null||$.value>_)_=$.value}return _}get maxLength(){let _=null;for(let $ of this._def.checks)if($.kind==="max"){if(_===null||$.value<_)_=$.value}return _}}l.create=(_)=>{return new l({checks:[],typeName:M.ZodString,coerce:_?.coerce??!1,...v(_)})};function Z$(_,$){let q=(_.toString().split(".")[1]||"").length,J=($.toString().split(".")[1]||"").length,W=q>J?q:J,X=Number.parseInt(_.toFixed(W).replace(".","")),H=Number.parseInt($.toFixed(W).replace(".",""));return X%H/10**W}class r extends j{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(_){if(this._def.coerce)_.data=Number(_.data);if(this._getType(_)!==B.number){let W=this._getOrReturnCtx(_);return D(W,{code:G.invalid_type,expected:B.number,received:W.parsedType}),b}let q=void 0,J=new V;for(let W of this._def.checks)if(W.kind==="int"){if(!A.isInteger(_.data))q=this._getOrReturnCtx(_,q),D(q,{code:G.invalid_type,expected:"integer",received:"float",message:W.message}),J.dirty()}else if(W.kind==="min"){if(W.inclusive?_.data<W.value:_.data<=W.value)q=this._getOrReturnCtx(_,q),D(q,{code:G.too_small,minimum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),J.dirty()}else if(W.kind==="max"){if(W.inclusive?_.data>W.value:_.data>=W.value)q=this._getOrReturnCtx(_,q),D(q,{code:G.too_big,maximum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),J.dirty()}else if(W.kind==="multipleOf"){if(Z$(_.data,W.value)!==0)q=this._getOrReturnCtx(_,q),D(q,{code:G.not_multiple_of,multipleOf:W.value,message:W.message}),J.dirty()}else if(W.kind==="finite"){if(!Number.isFinite(_.data))q=this._getOrReturnCtx(_,q),D(q,{code:G.not_finite,message:W.message}),J.dirty()}else A.assertNever(W);return{status:J.value,value:_.data}}gte(_,$){return this.setLimit("min",_,!0,w.toString($))}gt(_,$){return this.setLimit("min",_,!1,w.toString($))}lte(_,$){return this.setLimit("max",_,!0,w.toString($))}lt(_,$){return this.setLimit("max",_,!1,w.toString($))}setLimit(_,$,q,J){return new r({...this._def,checks:[...this._def.checks,{kind:_,value:$,inclusive:q,message:w.toString(J)}]})}_addCheck(_){return new r({...this._def,checks:[...this._def.checks,_]})}int(_){return this._addCheck({kind:"int",message:w.toString(_)})}positive(_){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(_)})}negative(_){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(_)})}nonpositive(_){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(_)})}nonnegative(_){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(_)})}multipleOf(_,$){return this._addCheck({kind:"multipleOf",value:_,message:w.toString($)})}finite(_){return this._addCheck({kind:"finite",message:w.toString(_)})}safe(_){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(_)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(_)})}get minValue(){let _=null;for(let $ of this._def.checks)if($.kind==="min"){if(_===null||$.value>_)_=$.value}return _}get maxValue(){let _=null;for(let $ of this._def.checks)if($.kind==="max"){if(_===null||$.value<_)_=$.value}return _}get isInt(){return!!this._def.checks.find((_)=>_.kind==="int"||_.kind==="multipleOf"&&A.isInteger(_.value))}get isFinite(){let _=null,$=null;for(let q of this._def.checks)if(q.kind==="finite"||q.kind==="int"||q.kind==="multipleOf")return!0;else if(q.kind==="min"){if($===null||q.value>$)$=q.value}else if(q.kind==="max"){if(_===null||q.value<_)_=q.value}return Number.isFinite($)&&Number.isFinite(_)}}r.create=(_)=>{return new r({checks:[],typeName:M.ZodNumber,coerce:_?.coerce||!1,...v(_)})};class c extends j{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(_){if(this._def.coerce)try{_.data=BigInt(_.data)}catch{return this._getInvalidInput(_)}if(this._getType(_)!==B.bigint)return this._getInvalidInput(_);let q=void 0,J=new V;for(let W of this._def.checks)if(W.kind==="min"){if(W.inclusive?_.data<W.value:_.data<=W.value)q=this._getOrReturnCtx(_,q),D(q,{code:G.too_small,type:"bigint",minimum:W.value,inclusive:W.inclusive,message:W.message}),J.dirty()}else if(W.kind==="max"){if(W.inclusive?_.data>W.value:_.data>=W.value)q=this._getOrReturnCtx(_,q),D(q,{code:G.too_big,type:"bigint",maximum:W.value,inclusive:W.inclusive,message:W.message}),J.dirty()}else if(W.kind==="multipleOf"){if(_.data%W.value!==BigInt(0))q=this._getOrReturnCtx(_,q),D(q,{code:G.not_multiple_of,multipleOf:W.value,message:W.message}),J.dirty()}else A.assertNever(W);return{status:J.value,value:_.data}}_getInvalidInput(_){let $=this._getOrReturnCtx(_);return D($,{code:G.invalid_type,expected:B.bigint,received:$.parsedType}),b}gte(_,$){return this.setLimit("min",_,!0,w.toString($))}gt(_,$){return this.setLimit("min",_,!1,w.toString($))}lte(_,$){return this.setLimit("max",_,!0,w.toString($))}lt(_,$){return this.setLimit("max",_,!1,w.toString($))}setLimit(_,$,q,J){return new c({...this._def,checks:[...this._def.checks,{kind:_,value:$,inclusive:q,message:w.toString(J)}]})}_addCheck(_){return new c({...this._def,checks:[...this._def.checks,_]})}positive(_){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(_)})}negative(_){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(_)})}nonpositive(_){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(_)})}nonnegative(_){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(_)})}multipleOf(_,$){return this._addCheck({kind:"multipleOf",value:_,message:w.toString($)})}get minValue(){let _=null;for(let $ of this._def.checks)if($.kind==="min"){if(_===null||$.value>_)_=$.value}return _}get maxValue(){let _=null;for(let $ of this._def.checks)if($.kind==="max"){if(_===null||$.value<_)_=$.value}return _}}c.create=(_)=>{return new c({checks:[],typeName:M.ZodBigInt,coerce:_?.coerce??!1,...v(_)})};class D_ extends j{_parse(_){if(this._def.coerce)_.data=Boolean(_.data);if(this._getType(_)!==B.boolean){let q=this._getOrReturnCtx(_);return D(q,{code:G.invalid_type,expected:B.boolean,received:q.parsedType}),b}return R(_.data)}}D_.create=(_)=>{return new D_({typeName:M.ZodBoolean,coerce:_?.coerce||!1,...v(_)})};class e extends j{_parse(_){if(this._def.coerce)_.data=new Date(_.data);if(this._getType(_)!==B.date){let W=this._getOrReturnCtx(_);return D(W,{code:G.invalid_type,expected:B.date,received:W.parsedType}),b}if(Number.isNaN(_.data.getTime())){let W=this._getOrReturnCtx(_);return D(W,{code:G.invalid_date}),b}let q=new V,J=void 0;for(let W of this._def.checks)if(W.kind==="min"){if(_.data.getTime()<W.value)J=this._getOrReturnCtx(_,J),D(J,{code:G.too_small,message:W.message,inclusive:!0,exact:!1,minimum:W.value,type:"date"}),q.dirty()}else if(W.kind==="max"){if(_.data.getTime()>W.value)J=this._getOrReturnCtx(_,J),D(J,{code:G.too_big,message:W.message,inclusive:!0,exact:!1,maximum:W.value,type:"date"}),q.dirty()}else A.assertNever(W);return{status:q.value,value:new Date(_.data.getTime())}}_addCheck(_){return new e({...this._def,checks:[...this._def.checks,_]})}min(_,$){return this._addCheck({kind:"min",value:_.getTime(),message:w.toString($)})}max(_,$){return this._addCheck({kind:"max",value:_.getTime(),message:w.toString($)})}get minDate(){let _=null;for(let $ of this._def.checks)if($.kind==="min"){if(_===null||$.value>_)_=$.value}return _!=null?new Date(_):null}get maxDate(){let _=null;for(let $ of this._def.checks)if($.kind==="max"){if(_===null||$.value<_)_=$.value}return _!=null?new Date(_):null}}e.create=(_)=>{return new e({checks:[],coerce:_?.coerce||!1,typeName:M.ZodDate,...v(_)})};class w_ extends j{_parse(_){if(this._getType(_)!==B.symbol){let q=this._getOrReturnCtx(_);return D(q,{code:G.invalid_type,expected:B.symbol,received:q.parsedType}),b}return R(_.data)}}w_.create=(_)=>{return new w_({typeName:M.ZodSymbol,...v(_)})};class __ extends j{_parse(_){if(this._getType(_)!==B.undefined){let q=this._getOrReturnCtx(_);return D(q,{code:G.invalid_type,expected:B.undefined,received:q.parsedType}),b}return R(_.data)}}__.create=(_)=>{return new __({typeName:M.ZodUndefined,...v(_)})};class $_ extends j{_parse(_){if(this._getType(_)!==B.null){let q=this._getOrReturnCtx(_);return D(q,{code:G.invalid_type,expected:B.null,received:q.parsedType}),b}return R(_.data)}}$_.create=(_)=>{return new $_({typeName:M.ZodNull,...v(_)})};class b_ extends j{constructor(){super(...arguments);this._any=!0}_parse(_){return R(_.data)}}b_.create=(_)=>{return new b_({typeName:M.ZodAny,...v(_)})};class Z extends j{constructor(){super(...arguments);this._unknown=!0}_parse(_){return R(_.data)}}Z.create=(_)=>{return new Z({typeName:M.ZodUnknown,...v(_)})};class T extends j{_parse(_){let $=this._getOrReturnCtx(_);return D($,{code:G.invalid_type,expected:B.never,received:$.parsedType}),b}}T.create=(_)=>{return new T({typeName:M.ZodNever,...v(_)})};class z_ extends j{_parse(_){if(this._getType(_)!==B.undefined){let q=this._getOrReturnCtx(_);return D(q,{code:G.invalid_type,expected:B.void,received:q.parsedType}),b}return R(_.data)}}z_.create=(_)=>{return new z_({typeName:M.ZodVoid,...v(_)})};class C extends j{_parse(_){let{ctx:$,status:q}=this._processInputParams(_),J=this._def;if($.parsedType!==B.array)return D($,{code:G.invalid_type,expected:B.array,received:$.parsedType}),b;if(J.exactLength!==null){let X=$.data.length>J.exactLength.value,H=$.data.length<J.exactLength.value;if(X||H)D($,{code:X?G.too_big:G.too_small,minimum:H?J.exactLength.value:void 0,maximum:X?J.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:J.exactLength.message}),q.dirty()}if(J.minLength!==null){if($.data.length<J.minLength.value)D($,{code:G.too_small,minimum:J.minLength.value,type:"array",inclusive:!0,exact:!1,message:J.minLength.message}),q.dirty()}if(J.maxLength!==null){if($.data.length>J.maxLength.value)D($,{code:G.too_big,maximum:J.maxLength.value,type:"array",inclusive:!0,exact:!1,message:J.maxLength.message}),q.dirty()}if($.common.async)return Promise.all([...$.data].map((X,H)=>{return J.type._parseAsync(new F($,X,$.path,H))})).then((X)=>{return V.mergeArray(q,X)});let W=[...$.data].map((X,H)=>{return J.type._parseSync(new F($,X,$.path,H))});return V.mergeArray(q,W)}get element(){return this._def.type}min(_,$){return new C({...this._def,minLength:{value:_,message:w.toString($)}})}max(_,$){return new C({...this._def,maxLength:{value:_,message:w.toString($)}})}length(_,$){return new C({...this._def,exactLength:{value:_,message:w.toString($)}})}nonempty(_){return this.min(1,_)}}C.create=(_,$)=>{return new C({type:_,minLength:null,maxLength:null,exactLength:null,typeName:M.ZodArray,...v($)})};function i(_){if(_ instanceof E){let $={};for(let q in _.shape){let J=_.shape[q];$[q]=k.create(i(J))}return new E({..._._def,shape:()=>$})}else if(_ instanceof C)return new C({..._._def,type:i(_.element)});else if(_ instanceof k)return k.create(i(_.unwrap()));else if(_ instanceof x)return x.create(i(_.unwrap()));else if(_ instanceof h)return h.create(_.items.map(($)=>i($)));else return _}class E extends j{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let _=this._def.shape(),$=A.objectKeys(_);return this._cached={shape:_,keys:$},this._cached}_parse(_){if(this._getType(_)!==B.object){let Q=this._getOrReturnCtx(_);return D(Q,{code:G.invalid_type,expected:B.object,received:Q.parsedType}),b}let{status:q,ctx:J}=this._processInputParams(_),{shape:W,keys:X}=this._getCached(),H=[];if(!(this._def.catchall instanceof T&&this._def.unknownKeys==="strip")){for(let Q in J.data)if(!X.includes(Q))H.push(Q)}let Y=[];for(let Q of X){let S=W[Q],U=J.data[Q];Y.push({key:{status:"valid",value:Q},value:S._parse(new F(J,U,J.path,Q)),alwaysSet:Q in J.data})}if(this._def.catchall instanceof T){let Q=this._def.unknownKeys;if(Q==="passthrough")for(let S of H)Y.push({key:{status:"valid",value:S},value:{status:"valid",value:J.data[S]}});else if(Q==="strict"){if(H.length>0)D(J,{code:G.unrecognized_keys,keys:H}),q.dirty()}else if(Q==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let Q=this._def.catchall;for(let S of H){let U=J.data[S];Y.push({key:{status:"valid",value:S},value:Q._parse(new F(J,U,J.path,S)),alwaysSet:S in J.data})}}if(J.common.async)return Promise.resolve().then(async()=>{let Q=[];for(let S of Y){let U=await S.key,m_=await S.value;Q.push({key:U,value:m_,alwaysSet:S.alwaysSet})}return Q}).then((Q)=>{return V.mergeObjectSync(q,Q)});else return V.mergeObjectSync(q,Y)}get shape(){return this._def.shape()}strict(_){return w.errToObj,new E({...this._def,unknownKeys:"strict",..._!==void 0?{errorMap:($,q)=>{let J=this._def.errorMap?.($,q).message??q.defaultError;if($.code==="unrecognized_keys")return{message:w.errToObj(_).message??J};return{message:J}}}:{}})}strip(){return new E({...this._def,unknownKeys:"strip"})}passthrough(){return new E({...this._def,unknownKeys:"passthrough"})}extend(_){return new E({...this._def,shape:()=>({...this._def.shape(),..._})})}merge(_){return new E({unknownKeys:_._def.unknownKeys,catchall:_._def.catchall,shape:()=>({...this._def.shape(),..._._def.shape()}),typeName:M.ZodObject})}setKey(_,$){return this.augment({[_]:$})}catchall(_){return new E({...this._def,catchall:_})}pick(_){let $={};for(let q of A.objectKeys(_))if(_[q]&&this.shape[q])$[q]=this.shape[q];return new E({...this._def,shape:()=>$})}omit(_){let $={};for(let q of A.objectKeys(this.shape))if(!_[q])$[q]=this.shape[q];return new E({...this._def,shape:()=>$})}deepPartial(){return i(this)}partial(_){let $={};for(let q of A.objectKeys(this.shape)){let J=this.shape[q];if(_&&!_[q])$[q]=J;else $[q]=J.optional()}return new E({...this._def,shape:()=>$})}required(_){let $={};for(let q of A.objectKeys(this.shape))if(_&&!_[q])$[q]=this.shape[q];else{let W=this.shape[q];while(W instanceof k)W=W._def.innerType;$[q]=W}return new E({...this._def,shape:()=>$})}keyof(){return u_(A.objectKeys(this.shape))}}E.create=(_,$)=>{return new E({shape:()=>_,unknownKeys:"strip",catchall:T.create(),typeName:M.ZodObject,...v($)})};E.strictCreate=(_,$)=>{return new E({shape:()=>_,unknownKeys:"strict",catchall:T.create(),typeName:M.ZodObject,...v($)})};E.lazycreate=(_,$)=>{return new E({shape:_,unknownKeys:"strip",catchall:T.create(),typeName:M.ZodObject,...v($)})};class q_ extends j{_parse(_){let{ctx:$}=this._processInputParams(_),q=this._def.options;function J(W){for(let H of W)if(H.result.status==="valid")return H.result;for(let H of W)if(H.result.status==="dirty")return $.common.issues.push(...H.ctx.common.issues),H.result;let X=W.map((H)=>new K(H.ctx.common.issues));return D($,{code:G.invalid_union,unionErrors:X}),b}if($.common.async)return Promise.all(q.map(async(W)=>{let X={...$,common:{...$.common,issues:[]},parent:null};return{result:await W._parseAsync({data:$.data,path:$.path,parent:X}),ctx:X}})).then(J);else{let W=void 0,X=[];for(let Y of q){let Q={...$,common:{...$.common,issues:[]},parent:null},S=Y._parseSync({data:$.data,path:$.path,parent:Q});if(S.status==="valid")return S;else if(S.status==="dirty"&&!W)W={result:S,ctx:Q};if(Q.common.issues.length)X.push(Q.common.issues)}if(W)return $.common.issues.push(...W.ctx.common.issues),W.result;let H=X.map((Y)=>new K(Y));return D($,{code:G.invalid_union,unionErrors:H}),b}}get options(){return this._def.options}}q_.create=(_,$)=>{return new q_({options:_,typeName:M.ZodUnion,...v($)})};var m=(_)=>{if(_ instanceof W_)return m(_.schema);else if(_ instanceof I)return m(_.innerType());else if(_ instanceof X_)return[_.value];else if(_ instanceof u)return _.options;else if(_ instanceof H_)return A.objectValues(_.enum);else if(_ instanceof Q_)return m(_._def.innerType);else if(_ instanceof __)return[void 0];else if(_ instanceof $_)return[null];else if(_ instanceof k)return[void 0,...m(_.unwrap())];else if(_ instanceof x)return[null,...m(_.unwrap())];else if(_ instanceof g_)return m(_.unwrap());else if(_ instanceof G_)return m(_.unwrap());else if(_ instanceof Y_)return m(_._def.innerType);else return[]};class f_ extends j{_parse(_){let{ctx:$}=this._processInputParams(_);if($.parsedType!==B.object)return D($,{code:G.invalid_type,expected:B.object,received:$.parsedType}),b;let q=this.discriminator,J=$.data[q],W=this.optionsMap.get(J);if(!W)return D($,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[q]}),b;if($.common.async)return W._parseAsync({data:$.data,path:$.path,parent:$});else return W._parseSync({data:$.data,path:$.path,parent:$})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(_,$,q){let J=new Map;for(let W of $){let X=m(W.shape[_]);if(!X.length)throw Error(`A discriminator value for key \`${_}\` could not be extracted from all schema options`);for(let H of X){if(J.has(H))throw Error(`Discriminator property ${String(_)} has duplicate value ${String(H)}`);J.set(H,W)}}return new f_({typeName:M.ZodDiscriminatedUnion,discriminator:_,options:$,optionsMap:J,...v(q)})}}function F_(_,$){let q=P(_),J=P($);if(_===$)return{valid:!0,data:_};else if(q===B.object&&J===B.object){let W=A.objectKeys($),X=A.objectKeys(_).filter((Y)=>W.indexOf(Y)!==-1),H={..._,...$};for(let Y of X){let Q=F_(_[Y],$[Y]);if(!Q.valid)return{valid:!1};H[Y]=Q.data}return{valid:!0,data:H}}else if(q===B.array&&J===B.array){if(_.length!==$.length)return{valid:!1};let W=[];for(let X=0;X<_.length;X++){let H=_[X],Y=$[X],Q=F_(H,Y);if(!Q.valid)return{valid:!1};W.push(Q.data)}return{valid:!0,data:W}}else if(q===B.date&&J===B.date&&+_===+$)return{valid:!0,data:_};else return{valid:!1}}class J_ extends j{_parse(_){let{status:$,ctx:q}=this._processInputParams(_),J=(W,X)=>{if(R_(W)||R_(X))return b;let H=F_(W.value,X.value);if(!H.valid)return D(q,{code:G.invalid_intersection_types}),b;if(L_(W)||L_(X))$.dirty();return{status:$.value,value:H.data}};if(q.common.async)return Promise.all([this._def.left._parseAsync({data:q.data,path:q.path,parent:q}),this._def.right._parseAsync({data:q.data,path:q.path,parent:q})]).then(([W,X])=>J(W,X));else return J(this._def.left._parseSync({data:q.data,path:q.path,parent:q}),this._def.right._parseSync({data:q.data,path:q.path,parent:q}))}}J_.create=(_,$,q)=>{return new J_({left:_,right:$,typeName:M.ZodIntersection,...v(q)})};class h extends j{_parse(_){let{status:$,ctx:q}=this._processInputParams(_);if(q.parsedType!==B.array)return D(q,{code:G.invalid_type,expected:B.array,received:q.parsedType}),b;if(q.data.length<this._def.items.length)return D(q,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;if(!this._def.rest&&q.data.length>this._def.items.length)D(q,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$.dirty();let W=[...q.data].map((X,H)=>{let Y=this._def.items[H]||this._def.rest;if(!Y)return null;return Y._parse(new F(q,X,q.path,H))}).filter((X)=>!!X);if(q.common.async)return Promise.all(W).then((X)=>{return V.mergeArray($,X)});else return V.mergeArray($,W)}get items(){return this._def.items}rest(_){return new h({...this._def,rest:_})}}h.create=(_,$)=>{if(!Array.isArray(_))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new h({items:_,typeName:M.ZodTuple,rest:null,...v($)})};class S_ extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(_){let{status:$,ctx:q}=this._processInputParams(_);if(q.parsedType!==B.object)return D(q,{code:G.invalid_type,expected:B.object,received:q.parsedType}),b;let J=[],W=this._def.keyType,X=this._def.valueType;for(let H in q.data)J.push({key:W._parse(new F(q,H,q.path,H)),value:X._parse(new F(q,q.data[H],q.path,H)),alwaysSet:H in q.data});if(q.common.async)return V.mergeObjectAsync($,J);else return V.mergeObjectSync($,J)}get element(){return this._def.valueType}static create(_,$,q){if($ instanceof j)return new S_({keyType:_,valueType:$,typeName:M.ZodRecord,...v(q)});return new S_({keyType:l.create(),valueType:_,typeName:M.ZodRecord,...v($)})}}class v_ extends j{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(_){let{status:$,ctx:q}=this._processInputParams(_);if(q.parsedType!==B.map)return D(q,{code:G.invalid_type,expected:B.map,received:q.parsedType}),b;let J=this._def.keyType,W=this._def.valueType,X=[...q.data.entries()].map(([H,Y],Q)=>{return{key:J._parse(new F(q,H,q.path,[Q,"key"])),value:W._parse(new F(q,Y,q.path,[Q,"value"]))}});if(q.common.async){let H=new Map;return Promise.resolve().then(async()=>{for(let Y of X){let Q=await Y.key,S=await Y.value;if(Q.status==="aborted"||S.status==="aborted")return b;if(Q.status==="dirty"||S.status==="dirty")$.dirty();H.set(Q.value,S.value)}return{status:$.value,value:H}})}else{let H=new Map;for(let Y of X){let{key:Q,value:S}=Y;if(Q.status==="aborted"||S.status==="aborted")return b;if(Q.status==="dirty"||S.status==="dirty")$.dirty();H.set(Q.value,S.value)}return{status:$.value,value:H}}}}v_.create=(_,$,q)=>{return new v_({valueType:$,keyType:_,typeName:M.ZodMap,...v(q)})};class o extends j{_parse(_){let{status:$,ctx:q}=this._processInputParams(_);if(q.parsedType!==B.set)return D(q,{code:G.invalid_type,expected:B.set,received:q.parsedType}),b;let J=this._def;if(J.minSize!==null){if(q.data.size<J.minSize.value)D(q,{code:G.too_small,minimum:J.minSize.value,type:"set",inclusive:!0,exact:!1,message:J.minSize.message}),$.dirty()}if(J.maxSize!==null){if(q.data.size>J.maxSize.value)D(q,{code:G.too_big,maximum:J.maxSize.value,type:"set",inclusive:!0,exact:!1,message:J.maxSize.message}),$.dirty()}let W=this._def.valueType;function X(Y){let Q=new Set;for(let S of Y){if(S.status==="aborted")return b;if(S.status==="dirty")$.dirty();Q.add(S.value)}return{status:$.value,value:Q}}let H=[...q.data.values()].map((Y,Q)=>W._parse(new F(q,Y,q.path,Q)));if(q.common.async)return Promise.all(H).then((Y)=>X(Y));else return X(H)}min(_,$){return new o({...this._def,minSize:{value:_,message:w.toString($)}})}max(_,$){return new o({...this._def,maxSize:{value:_,message:w.toString($)}})}size(_,$){return this.min(_,$).max(_,$)}nonempty(_){return this.min(1,_)}}o.create=(_,$)=>{return new o({valueType:_,minSize:null,maxSize:null,typeName:M.ZodSet,...v($)})};class s extends j{constructor(){super(...arguments);this.validate=this.implement}_parse(_){let{ctx:$}=this._processInputParams(_);if($.parsedType!==B.function)return D($,{code:G.invalid_type,expected:B.function,received:$.parsedType}),b;function q(H,Y){return B_({data:H,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,t(),y].filter((Q)=>!!Q),issueData:{code:G.invalid_arguments,argumentsError:Y}})}function J(H,Y){return B_({data:H,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,t(),y].filter((Q)=>!!Q),issueData:{code:G.invalid_return_type,returnTypeError:Y}})}let W={errorMap:$.common.contextualErrorMap},X=$.data;if(this._def.returns instanceof d){let H=this;return R(async function(...Y){let Q=new K([]),S=await H._def.args.parseAsync(Y,W).catch((V_)=>{throw Q.addIssue(q(Y,V_)),Q}),U=await Reflect.apply(X,this,S);return await H._def.returns._def.type.parseAsync(U,W).catch((V_)=>{throw Q.addIssue(J(U,V_)),Q})})}else{let H=this;return R(function(...Y){let Q=H._def.args.safeParse(Y,W);if(!Q.success)throw new K([q(Y,Q.error)]);let S=Reflect.apply(X,this,Q.data),U=H._def.returns.safeParse(S,W);if(!U.success)throw new K([J(S,U.error)]);return U.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(..._){return new s({...this._def,args:h.create(_).rest(Z.create())})}returns(_){return new s({...this._def,returns:_})}implement(_){return this.parse(_)}strictImplement(_){return this.parse(_)}static create(_,$,q){return new s({args:_?_:h.create([]).rest(Z.create()),returns:$||Z.create(),typeName:M.ZodFunction,...v(q)})}}class W_ extends j{get schema(){return this._def.getter()}_parse(_){let{ctx:$}=this._processInputParams(_);return this._def.getter()._parse({data:$.data,path:$.path,parent:$})}}W_.create=(_,$)=>{return new W_({getter:_,typeName:M.ZodLazy,...v($)})};class X_ extends j{_parse(_){if(_.data!==this._def.value){let $=this._getOrReturnCtx(_);return D($,{received:$.data,code:G.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:_.data}}get value(){return this._def.value}}X_.create=(_,$)=>{return new X_({value:_,typeName:M.ZodLiteral,...v($)})};function u_(_,$){return new u({values:_,typeName:M.ZodEnum,...v($)})}class u extends j{_parse(_){if(typeof _.data!=="string"){let $=this._getOrReturnCtx(_),q=this._def.values;return D($,{expected:A.joinValues(q),received:$.parsedType,code:G.invalid_type}),b}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(_.data)){let $=this._getOrReturnCtx(_),q=this._def.values;return D($,{received:$.data,code:G.invalid_enum_value,options:q}),b}return R(_.data)}get options(){return this._def.values}get enum(){let _={};for(let $ of this._def.values)_[$]=$;return _}get Values(){let _={};for(let $ of this._def.values)_[$]=$;return _}get Enum(){let _={};for(let $ of this._def.values)_[$]=$;return _}extract(_,$=this._def){return u.create(_,{...this._def,...$})}exclude(_,$=this._def){return u.create(this.options.filter((q)=>!_.includes(q)),{...this._def,...$})}}u.create=u_;class H_ extends j{_parse(_){let $=A.getValidEnumValues(this._def.values),q=this._getOrReturnCtx(_);if(q.parsedType!==B.string&&q.parsedType!==B.number){let J=A.objectValues($);return D(q,{expected:A.joinValues(J),received:q.parsedType,code:G.invalid_type}),b}if(!this._cache)this._cache=new Set(A.getValidEnumValues(this._def.values));if(!this._cache.has(_.data)){let J=A.objectValues($);return D(q,{received:q.data,code:G.invalid_enum_value,options:J}),b}return R(_.data)}get enum(){return this._def.values}}H_.create=(_,$)=>{return new H_({values:_,typeName:M.ZodNativeEnum,...v($)})};class d extends j{unwrap(){return this._def.type}_parse(_){let{ctx:$}=this._processInputParams(_);if($.parsedType!==B.promise&&$.common.async===!1)return D($,{code:G.invalid_type,expected:B.promise,received:$.parsedType}),b;let q=$.parsedType===B.promise?$.data:Promise.resolve($.data);return R(q.then((J)=>{return this._def.type.parseAsync(J,{path:$.path,errorMap:$.common.contextualErrorMap})}))}}d.create=(_,$)=>{return new d({type:_,typeName:M.ZodPromise,...v($)})};class I extends j{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===M.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(_){let{status:$,ctx:q}=this._processInputParams(_),J=this._def.effect||null,W={addIssue:(X)=>{if(D(q,X),X.fatal)$.abort();else $.dirty()},get path(){return q.path}};if(W.addIssue=W.addIssue.bind(W),J.type==="preprocess"){let X=J.transform(q.data,W);if(q.common.async)return Promise.resolve(X).then(async(H)=>{if($.value==="aborted")return b;let Y=await this._def.schema._parseAsync({data:H,path:q.path,parent:q});if(Y.status==="aborted")return b;if(Y.status==="dirty")return p(Y.value);if($.value==="dirty")return p(Y.value);return Y});else{if($.value==="aborted")return b;let H=this._def.schema._parseSync({data:X,path:q.path,parent:q});if(H.status==="aborted")return b;if(H.status==="dirty")return p(H.value);if($.value==="dirty")return p(H.value);return H}}if(J.type==="refinement"){let X=(H)=>{let Y=J.refinement(H,W);if(q.common.async)return Promise.resolve(Y);if(Y instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return H};if(q.common.async===!1){let H=this._def.schema._parseSync({data:q.data,path:q.path,parent:q});if(H.status==="aborted")return b;if(H.status==="dirty")$.dirty();return X(H.value),{status:$.value,value:H.value}}else return this._def.schema._parseAsync({data:q.data,path:q.path,parent:q}).then((H)=>{if(H.status==="aborted")return b;if(H.status==="dirty")$.dirty();return X(H.value).then(()=>{return{status:$.value,value:H.value}})})}if(J.type==="transform")if(q.common.async===!1){let X=this._def.schema._parseSync({data:q.data,path:q.path,parent:q});if(!n(X))return b;let H=J.transform(X.value,W);if(H instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:$.value,value:H}}else return this._def.schema._parseAsync({data:q.data,path:q.path,parent:q}).then((X)=>{if(!n(X))return b;return Promise.resolve(J.transform(X.value,W)).then((H)=>({status:$.value,value:H}))});A.assertNever(J)}}I.create=(_,$,q)=>{return new I({schema:_,typeName:M.ZodEffects,effect:$,...v(q)})};I.createWithPreprocess=(_,$,q)=>{return new I({schema:$,effect:{type:"preprocess",transform:_},typeName:M.ZodEffects,...v(q)})};class k extends j{_parse(_){if(this._getType(_)===B.undefined)return R(void 0);return this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}k.create=(_,$)=>{return new k({innerType:_,typeName:M.ZodOptional,...v($)})};class x extends j{_parse(_){if(this._getType(_)===B.null)return R(null);return this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}x.create=(_,$)=>{return new x({innerType:_,typeName:M.ZodNullable,...v($)})};class Q_ extends j{_parse(_){let{ctx:$}=this._processInputParams(_),q=$.data;if($.parsedType===B.undefined)q=this._def.defaultValue();return this._def.innerType._parse({data:q,path:$.path,parent:$})}removeDefault(){return this._def.innerType}}Q_.create=(_,$)=>{return new Q_({innerType:_,typeName:M.ZodDefault,defaultValue:typeof $.default==="function"?$.default:()=>$.default,...v($)})};class Y_ extends j{_parse(_){let{ctx:$}=this._processInputParams(_),q={...$,common:{...$.common,issues:[]}},J=this._def.innerType._parse({data:q.data,path:q.path,parent:{...q}});if(a(J))return J.then((W)=>{return{status:"valid",value:W.status==="valid"?W.value:this._def.catchValue({get error(){return new K(q.common.issues)},input:q.data})}});else return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new K(q.common.issues)},input:q.data})}}removeCatch(){return this._def.innerType}}Y_.create=(_,$)=>{return new Y_({innerType:_,typeName:M.ZodCatch,catchValue:typeof $.catch==="function"?$.catch:()=>$.catch,...v($)})};class j_ extends j{_parse(_){if(this._getType(_)!==B.nan){let q=this._getOrReturnCtx(_);return D(q,{code:G.invalid_type,expected:B.nan,received:q.parsedType}),b}return{status:"valid",value:_.data}}}j_.create=(_)=>{return new j_({typeName:M.ZodNaN,...v(_)})};var Aq=Symbol("zod_brand");class g_ extends j{_parse(_){let{ctx:$}=this._processInputParams(_),q=$.data;return this._def.type._parse({data:q,path:$.path,parent:$})}unwrap(){return this._def.type}}class A_ extends j{_parse(_){let{status:$,ctx:q}=this._processInputParams(_);if(q.common.async)return(async()=>{let W=await this._def.in._parseAsync({data:q.data,path:q.path,parent:q});if(W.status==="aborted")return b;if(W.status==="dirty")return $.dirty(),p(W.value);else return this._def.out._parseAsync({data:W.value,path:q.path,parent:q})})();else{let J=this._def.in._parseSync({data:q.data,path:q.path,parent:q});if(J.status==="aborted")return b;if(J.status==="dirty")return $.dirty(),{status:"dirty",value:J.value};else return this._def.out._parseSync({data:J.value,path:q.path,parent:q})}}static create(_,$){return new A_({in:_,out:$,typeName:M.ZodPipeline})}}class G_ extends j{_parse(_){let $=this._def.innerType._parse(_),q=(J)=>{if(n(J))J.value=Object.freeze(J.value);return J};return a($)?$.then((J)=>q(J)):q($)}unwrap(){return this._def.innerType}}G_.create=(_,$)=>{return new G_({innerType:_,typeName:M.ZodReadonly,...v($)})};var Oq={object:E.lazycreate},M;(function(_){_.ZodString="ZodString",_.ZodNumber="ZodNumber",_.ZodNaN="ZodNaN",_.ZodBigInt="ZodBigInt",_.ZodBoolean="ZodBoolean",_.ZodDate="ZodDate",_.ZodSymbol="ZodSymbol",_.ZodUndefined="ZodUndefined",_.ZodNull="ZodNull",_.ZodAny="ZodAny",_.ZodUnknown="ZodUnknown",_.ZodNever="ZodNever",_.ZodVoid="ZodVoid",_.ZodArray="ZodArray",_.ZodObject="ZodObject",_.ZodUnion="ZodUnion",_.ZodDiscriminatedUnion="ZodDiscriminatedUnion",_.ZodIntersection="ZodIntersection",_.ZodTuple="ZodTuple",_.ZodRecord="ZodRecord",_.ZodMap="ZodMap",_.ZodSet="ZodSet",_.ZodFunction="ZodFunction",_.ZodLazy="ZodLazy",_.ZodLiteral="ZodLiteral",_.ZodEnum="ZodEnum",_.ZodEffects="ZodEffects",_.ZodNativeEnum="ZodNativeEnum",_.ZodOptional="ZodOptional",_.ZodNullable="ZodNullable",_.ZodDefault="ZodDefault",_.ZodCatch="ZodCatch",_.ZodPromise="ZodPromise",_.ZodBranded="ZodBranded",_.ZodPipeline="ZodPipeline",_.ZodReadonly="ZodReadonly"})(M||(M={}));var Nq=l.create,Eq=r.create,Uq=j_.create,Vq=c.create,Rq=D_.create,Lq=e.create,Kq=w_.create,Fq=__.create,fq=$_.create,gq=b_.create,Cq=Z.create,kq=T.create,Iq=z_.create,Pq=C.create,mq=E.create,lq=E.strictCreate,Tq=q_.create,hq=f_.create,yq=J_.create,xq=h.create,nq=S_.create,Zq=v_.create,uq=o.create,pq=s.create,iq=W_.create,rq=X_.create,cq=u.create,oq=H_.create,dq=d.create,tq=I.create,aq=k.create,sq=x.create,eq=I.createWithPreprocess,_3=A_.create;var O_=(_,$)=>{let q=0;for(;q<_.length&&q<$.length;q++)if(_[q]!==$[q])break;return[(_.length-q).toString(),...$.slice(q)].join("/")};function N(_){if(_.target!=="openAi")return{};let $=[..._.basePath,_.definitionPath,_.openAiAnyTypeName];return _.flags.hasReferencedOpenAiAnyType=!0,{$ref:_.$refStrategy==="relative"?O_($,_.currentPath):$.join("/")}}function C_(_,$,q,J){if(!J?.errorMessages)return;if(q)_.errorMessage={..._.errorMessage,[$]:q}}function O(_,$,q,J,W){_[$]=q,C_(_,$,J,W)}function p_(_,$){let q={type:"array"};if(_.type?._def&&_.type?._def?.typeName!==M.ZodAny)q.items=z(_.type._def,{...$,currentPath:[...$.currentPath,"items"]});if(_.minLength)O(q,"minItems",_.minLength.value,_.minLength.message,$);if(_.maxLength)O(q,"maxItems",_.maxLength.value,_.maxLength.message,$);if(_.exactLength)O(q,"minItems",_.exactLength.value,_.exactLength.message,$),O(q,"maxItems",_.exactLength.value,_.exactLength.message,$);return q}function i_(_,$){let q={type:"integer",format:"int64"};if(!_.checks)return q;for(let J of _.checks)switch(J.kind){case"min":if($.target==="jsonSchema7")if(J.inclusive)O(q,"minimum",J.value,J.message,$);else O(q,"exclusiveMinimum",J.value,J.message,$);else{if(!J.inclusive)q.exclusiveMinimum=!0;O(q,"minimum",J.value,J.message,$)}break;case"max":if($.target==="jsonSchema7")if(J.inclusive)O(q,"maximum",J.value,J.message,$);else O(q,"exclusiveMaximum",J.value,J.message,$);else{if(!J.inclusive)q.exclusiveMaximum=!0;O(q,"maximum",J.value,J.message,$)}break;case"multipleOf":O(q,"multipleOf",J.value,J.message,$);break}return q}function r_(){return{type:"boolean"}}function N_(_,$){return z(_.type._def,$)}var c_=(_,$)=>{return z(_.innerType._def,$)};function k_(_,$,q){let J=q??$.dateStrategy;if(Array.isArray(J))return{anyOf:J.map((W,X)=>k_(_,$,W))};switch(J){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return u$(_,$)}}var u$=(_,$)=>{let q={type:"integer",format:"unix-time"};if($.target==="openApi3")return q;for(let J of _.checks)switch(J.kind){case"min":O(q,"minimum",J.value,J.message,$);break;case"max":O(q,"maximum",J.value,J.message,$);break}return q};function o_(_,$){return{...z(_.innerType._def,$),default:_.defaultValue()}}function d_(_,$){return $.effectStrategy==="input"?z(_.schema._def,$):N($)}function t_(_){return{type:"string",enum:Array.from(_.values)}}var p$=(_)=>{if("type"in _&&_.type==="string")return!1;return"allOf"in _};function a_(_,$){let q=[z(_.left._def,{...$,currentPath:[...$.currentPath,"allOf","0"]}),z(_.right._def,{...$,currentPath:[...$.currentPath,"allOf","1"]})].filter((X)=>!!X),J=$.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,W=[];return q.forEach((X)=>{if(p$(X)){if(W.push(...X.allOf),X.unevaluatedProperties===void 0)J=void 0}else{let H=X;if("additionalProperties"in X&&X.additionalProperties===!1){let{additionalProperties:Y,...Q}=X;H=Q}else J=void 0;W.push(H)}}),W.length?{allOf:W,...J}:void 0}function s_(_,$){let q=typeof _.value;if(q!=="bigint"&&q!=="number"&&q!=="boolean"&&q!=="string")return{type:Array.isArray(_.value)?"array":"object"};if($.target==="openApi3")return{type:q==="bigint"?"integer":q,enum:[_.value]};return{type:q==="bigint"?"integer":q,const:_.value}}var I_=void 0,f={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(I_===void 0)I_=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return I_},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 E_(_,$){let q={type:"string"};if(_.checks)for(let J of _.checks)switch(J.kind){case"min":O(q,"minLength",typeof q.minLength==="number"?Math.max(q.minLength,J.value):J.value,J.message,$);break;case"max":O(q,"maxLength",typeof q.maxLength==="number"?Math.min(q.maxLength,J.value):J.value,J.message,$);break;case"email":switch($.emailStrategy){case"format:email":g(q,"email",J.message,$);break;case"format:idn-email":g(q,"idn-email",J.message,$);break;case"pattern:zod":L(q,f.email,J.message,$);break}break;case"url":g(q,"uri",J.message,$);break;case"uuid":g(q,"uuid",J.message,$);break;case"regex":L(q,J.regex,J.message,$);break;case"cuid":L(q,f.cuid,J.message,$);break;case"cuid2":L(q,f.cuid2,J.message,$);break;case"startsWith":L(q,RegExp(`^${P_(J.value,$)}`),J.message,$);break;case"endsWith":L(q,RegExp(`${P_(J.value,$)}$`),J.message,$);break;case"datetime":g(q,"date-time",J.message,$);break;case"date":g(q,"date",J.message,$);break;case"time":g(q,"time",J.message,$);break;case"duration":g(q,"duration",J.message,$);break;case"length":O(q,"minLength",typeof q.minLength==="number"?Math.max(q.minLength,J.value):J.value,J.message,$),O(q,"maxLength",typeof q.maxLength==="number"?Math.min(q.maxLength,J.value):J.value,J.message,$);break;case"includes":{L(q,RegExp(P_(J.value,$)),J.message,$);break}case"ip":{if(J.version!=="v6")g(q,"ipv4",J.message,$);if(J.version!=="v4")g(q,"ipv6",J.message,$);break}case"base64url":L(q,f.base64url,J.message,$);break;case"jwt":L(q,f.jwt,J.message,$);break;case"cidr":{if(J.version!=="v6")L(q,f.ipv4Cidr,J.message,$);if(J.version!=="v4")L(q,f.ipv6Cidr,J.message,$);break}case"emoji":L(q,f.emoji(),J.message,$);break;case"ulid":{L(q,f.ulid,J.message,$);break}case"base64":{switch($.base64Strategy){case"format:binary":{g(q,"binary",J.message,$);break}case"contentEncoding:base64":{O(q,"contentEncoding","base64",J.message,$);break}case"pattern:zod":{L(q,f.base64,J.message,$);break}}break}case"nanoid":L(q,f.nanoid,J.message,$);case"toLowerCase":case"toUpperCase":case"trim":break;default:((W)=>{})(J)}return q}function P_(_,$){return $.patternStrategy==="escape"?r$(_):_}var i$=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function r$(_){let $="";for(let q=0;q<_.length;q++){if(!i$.has(_[q]))$+="\\";$+=_[q]}return $}function g(_,$,q,J){if(_.format||_.anyOf?.some((W)=>W.format)){if(!_.anyOf)_.anyOf=[];if(_.format){if(_.anyOf.push({format:_.format,..._.errorMessage&&J.errorMessages&&{errorMessage:{format:_.errorMessage.format}}}),delete _.format,_.errorMessage){if(delete _.errorMessage.format,Object.keys(_.errorMessage).length===0)delete _.errorMessage}}_.anyOf.push({format:$,...q&&J.errorMessages&&{errorMessage:{format:q}}})}else O(_,"format",$,q,J)}function L(_,$,q,J){if(_.pattern||_.allOf?.some((W)=>W.pattern)){if(!_.allOf)_.allOf=[];if(_.pattern){if(_.allOf.push({pattern:_.pattern,..._.errorMessage&&J.errorMessages&&{errorMessage:{pattern:_.errorMessage.pattern}}}),delete _.pattern,_.errorMessage){if(delete _.errorMessage.pattern,Object.keys(_.errorMessage).length===0)delete _.errorMessage}}_.allOf.push({pattern:e_($,J),...q&&J.errorMessages&&{errorMessage:{pattern:q}}})}else O(_,"pattern",e_($,J),q,J)}function e_(_,$){if(!$.applyRegexFlags||!_.flags)return _.source;let q={i:_.flags.includes("i"),m:_.flags.includes("m"),s:_.flags.includes("s")},J=q.i?_.source.toLowerCase():_.source,W="",X=!1,H=!1,Y=!1;for(let Q=0;Q<J.length;Q++){if(X){W+=J[Q],X=!1;continue}if(q.i){if(H){if(J[Q].match(/[a-z]/)){if(Y)W+=J[Q],W+=`${J[Q-2]}-${J[Q]}`.toUpperCase(),Y=!1;else if(J[Q+1]==="-"&&J[Q+2]?.match(/[a-z]/))W+=J[Q],Y=!0;else W+=`${J[Q]}${J[Q].toUpperCase()}`;continue}}else if(J[Q].match(/[a-z]/)){W+=`[${J[Q]}${J[Q].toUpperCase()}]`;continue}}if(q.m){if(J[Q]==="^"){W+=`(^|(?<=[\r
3
- ]))`;continue}else if(J[Q]==="$"){W+=`($|(?=[\r
4
- ]))`;continue}}if(q.s&&J[Q]==="."){W+=H?`${J[Q]}\r
5
- `:`[${J[Q]}\r
6
- ]`;continue}if(W+=J[Q],J[Q]==="\\")X=!0;else if(H&&J[Q]==="]")H=!1;else if(!H&&J[Q]==="[")H=!0}try{new RegExp(W)}catch{return console.warn(`Could not convert regex pattern at ${$.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),_.source}return W}function U_(_,$){if($.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if($.target==="openApi3"&&_.keyType?._def.typeName===M.ZodEnum)return{type:"object",required:_.keyType._def.values,properties:_.keyType._def.values.reduce((J,W)=>({...J,[W]:z(_.valueType._def,{...$,currentPath:[...$.currentPath,"properties",W]})??N($)}),{}),additionalProperties:$.rejectedAdditionalProperties};let q={type:"object",additionalProperties:z(_.valueType._def,{...$,currentPath:[...$.currentPath,"additionalProperties"]})??$.allowedAdditionalProperties};if($.target==="openApi3")return q;if(_.keyType?._def.typeName===M.ZodString&&_.keyType._def.checks?.length){let{type:J,...W}=E_(_.keyType._def,$);return{...q,propertyNames:W}}else if(_.keyType?._def.typeName===M.ZodEnum)return{...q,propertyNames:{enum:_.keyType._def.values}};else if(_.keyType?._def.typeName===M.ZodBranded&&_.keyType._def.type._def.typeName===M.ZodString&&_.keyType._def.type._def.checks?.length){let{type:J,...W}=N_(_.keyType._def,$);return{...q,propertyNames:W}}return q}function _$(_,$){if($.mapStrategy==="record")return U_(_,$);let q=z(_.keyType._def,{...$,currentPath:[...$.currentPath,"items","items","0"]})||N($),J=z(_.valueType._def,{...$,currentPath:[...$.currentPath,"items","items","1"]})||N($);return{type:"array",maxItems:125,items:{type:"array",items:[q,J],minItems:2,maxItems:2}}}function $$(_){let $=_.values,J=Object.keys(_.values).filter((X)=>{return typeof $[$[X]]!=="number"}).map((X)=>$[X]),W=Array.from(new Set(J.map((X)=>typeof X)));return{type:W.length===1?W[0]==="string"?"string":"number":["string","number"],enum:J}}function q$(_){return _.target==="openAi"?void 0:{not:N({..._,currentPath:[..._.currentPath,"not"]})}}function J$(_){return _.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var M_={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function X$(_,$){if($.target==="openApi3")return W$(_,$);let q=_.options instanceof Map?Array.from(_.options.values()):_.options;if(q.every((J)=>(J._def.typeName in M_)&&(!J._def.checks||!J._def.checks.length))){let J=q.reduce((W,X)=>{let H=M_[X._def.typeName];return H&&!W.includes(H)?[...W,H]:W},[]);return{type:J.length>1?J:J[0]}}else if(q.every((J)=>J._def.typeName==="ZodLiteral"&&!J.description)){let J=q.reduce((W,X)=>{let H=typeof X._def.value;switch(H){case"string":case"number":case"boolean":return[...W,H];case"bigint":return[...W,"integer"];case"object":if(X._def.value===null)return[...W,"null"];case"symbol":case"undefined":case"function":default:return W}},[]);if(J.length===q.length){let W=J.filter((X,H,Y)=>Y.indexOf(X)===H);return{type:W.length>1?W:W[0],enum:q.reduce((X,H)=>{return X.includes(H._def.value)?X:[...X,H._def.value]},[])}}}else if(q.every((J)=>J._def.typeName==="ZodEnum"))return{type:"string",enum:q.reduce((J,W)=>[...J,...W._def.values.filter((X)=>!J.includes(X))],[])};return W$(_,$)}var W$=(_,$)=>{let q=(_.options instanceof Map?Array.from(_.options.values()):_.options).map((J,W)=>z(J._def,{...$,currentPath:[...$.currentPath,"anyOf",`${W}`]})).filter((J)=>!!J&&(!$.strictUnions||typeof J==="object"&&Object.keys(J).length>0));return q.length?{anyOf:q}:void 0};function H$(_,$){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(_.innerType._def.typeName)&&(!_.innerType._def.checks||!_.innerType._def.checks.length)){if($.target==="openApi3")return{type:M_[_.innerType._def.typeName],nullable:!0};return{type:[M_[_.innerType._def.typeName],"null"]}}if($.target==="openApi3"){let J=z(_.innerType._def,{...$,currentPath:[...$.currentPath]});if(J&&"$ref"in J)return{allOf:[J],nullable:!0};return J&&{...J,nullable:!0}}let q=z(_.innerType._def,{...$,currentPath:[...$.currentPath,"anyOf","0"]});return q&&{anyOf:[q,{type:"null"}]}}function Q$(_,$){let q={type:"number"};if(!_.checks)return q;for(let J of _.checks)switch(J.kind){case"int":q.type="integer",C_(q,"type",J.message,$);break;case"min":if($.target==="jsonSchema7")if(J.inclusive)O(q,"minimum",J.value,J.message,$);else O(q,"exclusiveMinimum",J.value,J.message,$);else{if(!J.inclusive)q.exclusiveMinimum=!0;O(q,"minimum",J.value,J.message,$)}break;case"max":if($.target==="jsonSchema7")if(J.inclusive)O(q,"maximum",J.value,J.message,$);else O(q,"exclusiveMaximum",J.value,J.message,$);else{if(!J.inclusive)q.exclusiveMaximum=!0;O(q,"maximum",J.value,J.message,$)}break;case"multipleOf":O(q,"multipleOf",J.value,J.message,$);break}return q}function Y$(_,$){let q=$.target==="openAi",J={type:"object",properties:{}},W=[],X=_.shape();for(let Y in X){let Q=X[Y];if(Q===void 0||Q._def===void 0)continue;let S=o$(Q);if(S&&q){if(Q._def.typeName==="ZodOptional")Q=Q._def.innerType;if(!Q.isNullable())Q=Q.nullable();S=!1}let U=z(Q._def,{...$,currentPath:[...$.currentPath,"properties",Y],propertyPath:[...$.currentPath,"properties",Y]});if(U===void 0)continue;if(J.properties[Y]=U,!S)W.push(Y)}if(W.length)J.required=W;let H=c$(_,$);if(H!==void 0)J.additionalProperties=H;return J}function c$(_,$){if(_.catchall._def.typeName!=="ZodNever")return z(_.catchall._def,{...$,currentPath:[...$.currentPath,"additionalProperties"]});switch(_.unknownKeys){case"passthrough":return $.allowedAdditionalProperties;case"strict":return $.rejectedAdditionalProperties;case"strip":return $.removeAdditionalStrategy==="strict"?$.allowedAdditionalProperties:$.rejectedAdditionalProperties}}function o$(_){try{return _.isOptional()}catch{return!0}}var G$=(_,$)=>{if($.currentPath.toString()===$.propertyPath?.toString())return z(_.innerType._def,$);let q=z(_.innerType._def,{...$,currentPath:[...$.currentPath,"anyOf","1"]});return q?{anyOf:[{not:N($)},q]}:N($)};var M$=(_,$)=>{if($.pipeStrategy==="input")return z(_.in._def,$);else if($.pipeStrategy==="output")return z(_.out._def,$);let q=z(_.in._def,{...$,currentPath:[...$.currentPath,"allOf","0"]}),J=z(_.out._def,{...$,currentPath:[...$.currentPath,"allOf",q?"1":"0"]});return{allOf:[q,J].filter((W)=>W!==void 0)}};function B$(_,$){return z(_.type._def,$)}function D$(_,$){let J={type:"array",uniqueItems:!0,items:z(_.valueType._def,{...$,currentPath:[...$.currentPath,"items"]})};if(_.minSize)O(J,"minItems",_.minSize.value,_.minSize.message,$);if(_.maxSize)O(J,"maxItems",_.maxSize.value,_.maxSize.message,$);return J}function w$(_,$){if(_.rest)return{type:"array",minItems:_.items.length,items:_.items.map((q,J)=>z(q._def,{...$,currentPath:[...$.currentPath,"items",`${J}`]})).reduce((q,J)=>J===void 0?q:[...q,J],[]),additionalItems:z(_.rest._def,{...$,currentPath:[...$.currentPath,"additionalItems"]})};else return{type:"array",minItems:_.items.length,maxItems:_.items.length,items:_.items.map((q,J)=>z(q._def,{...$,currentPath:[...$.currentPath,"items",`${J}`]})).reduce((q,J)=>J===void 0?q:[...q,J],[])}}function b$(_){return{not:N(_)}}function z$(_){return N(_)}var S$=(_,$)=>{return z(_.innerType._def,$)};var v$=(_,$,q)=>{switch($){case M.ZodString:return E_(_,q);case M.ZodNumber:return Q$(_,q);case M.ZodObject:return Y$(_,q);case M.ZodBigInt:return i_(_,q);case M.ZodBoolean:return r_();case M.ZodDate:return k_(_,q);case M.ZodUndefined:return b$(q);case M.ZodNull:return J$(q);case M.ZodArray:return p_(_,q);case M.ZodUnion:case M.ZodDiscriminatedUnion:return X$(_,q);case M.ZodIntersection:return a_(_,q);case M.ZodTuple:return w$(_,q);case M.ZodRecord:return U_(_,q);case M.ZodLiteral:return s_(_,q);case M.ZodEnum:return t_(_);case M.ZodNativeEnum:return $$(_);case M.ZodNullable:return H$(_,q);case M.ZodOptional:return G$(_,q);case M.ZodMap:return _$(_,q);case M.ZodSet:return D$(_,q);case M.ZodLazy:return()=>_.getter()._def;case M.ZodPromise:return B$(_,q);case M.ZodNaN:case M.ZodNever:return q$(q);case M.ZodEffects:return d_(_,q);case M.ZodAny:return N(q);case M.ZodUnknown:return z$(q);case M.ZodDefault:return o_(_,q);case M.ZodBranded:return N_(_,q);case M.ZodReadonly:return S$(_,q);case M.ZodCatch:return c_(_,q);case M.ZodPipeline:return M$(_,q);case M.ZodFunction:case M.ZodVoid:case M.ZodSymbol:return;default:return((J)=>{return})($)}};function z(_,$,q=!1){let J=$.seen.get(_);if($.override){let Y=$.override?.(_,$,J,q);if(Y!==T_)return Y}if(J&&!q){let Y=d$(J,$);if(Y!==void 0)return Y}let W={def:_,path:$.currentPath,jsonSchema:void 0};$.seen.set(_,W);let X=v$(_,_.typeName,$),H=typeof X==="function"?z(X(),$):X;if(H)t$(_,$,H);if($.postProcess){let Y=$.postProcess(H,_,$);return W.jsonSchema=H,Y}return W.jsonSchema=H,H}var d$=(_,$)=>{switch($.$refStrategy){case"root":return{$ref:_.path.join("/")};case"relative":return{$ref:O_($.currentPath,_.path)};case"none":case"seen":{if(_.path.length<$.currentPath.length&&_.path.every((q,J)=>$.currentPath[J]===q))return console.warn(`Recursive reference detected at ${$.currentPath.join("/")}! Defaulting to any`),N($);return $.$refStrategy==="seen"?N($):void 0}}},t$=(_,$,q)=>{if(_.description){if(q.description=_.description,$.markdownDescription)q.markdownDescription=_.description}return q};var j$=(_)=>{let $=h_(_),q=$.name!==void 0?[...$.basePath,$.definitionPath,$.name]:$.basePath;return{...$,flags:{hasReferencedOpenAiAnyType:!1},currentPath:q,propertyPath:void 0,seen:new Map(Object.entries($.definitions).map(([J,W])=>[W._def,{def:W._def,path:[...$.basePath,$.definitionPath,J],jsonSchema:void 0}]))}};var a$=(_,$)=>{let q=j$($),J=typeof $==="object"&&$.definitions?Object.entries($.definitions).reduce((Q,[S,U])=>({...Q,[S]:z(U._def,{...q,currentPath:[...q.basePath,q.definitionPath,S]},!0)??N(q)}),{}):void 0,W=typeof $==="string"?$:$?.nameStrategy==="title"?void 0:$?.name,X=z(_._def,W===void 0?q:{...q,currentPath:[...q.basePath,q.definitionPath,W]},!1)??N(q),H=typeof $==="object"&&$.name!==void 0&&$.nameStrategy==="title"?$.name:void 0;if(H!==void 0)X.title=H;if(q.flags.hasReferencedOpenAiAnyType){if(!J)J={};if(!J[q.openAiAnyTypeName])J[q.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:q.$refStrategy==="relative"?"1":[...q.basePath,q.definitionPath,q.openAiAnyTypeName].join("/")}}}let Y=W===void 0?J?{...X,[q.definitionPath]:J}:X:{$ref:[...q.$refStrategy==="relative"?[]:q.basePath,q.definitionPath,W].join("/"),[q.definitionPath]:{...J,[W]:X}};if(q.target==="jsonSchema7")Y.$schema="http://json-schema.org/draft-07/schema#";else if(q.target==="jsonSchema2019-09"||q.target==="openAi")Y.$schema="https://json-schema.org/draft/2019-09/schema#";if(q.target==="openAi"&&(("anyOf"in Y)||("oneOf"in Y)||("allOf"in Y)||("type"in Y)&&Array.isArray(Y.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return Y};export{a$ as Sb};
@@ -1 +0,0 @@
1
- import{j as V}from"./chunk-k0a35mg9.js";import"./chunk-qn96vbke.js";import"./chunk-d3s00sn0.js";import"./chunk-8e5zvy88.js";import"./chunk-nzy3pjjm.js";import"./chunk-mm1j72a8.js";import"./chunk-9c7fxjej.js";import"./chunk-zhd2mkbr.js";import"./chunk-bdjhb77e.js";import"./chunk-p9xfyqh1.js";import"./chunk-31mjcykb.js";import"./chunk-hfp4hpca.js";import"./chunk-wrz9e73c.js";import"./chunk-1nh6xgek.js";import"./chunk-3rcc5s99.js";import"./chunk-20y3wte3.js";import{yf as U}from"./chunk-vnfmh5ke.js";import"./chunk-qc6dmzn0.js";import{Bf as N}from"./chunk-ve7v8wtv.js";import"./chunk-7y8dng8t.js";import"./chunk-3t7mjvdv.js";import"./chunk-z0ej44ak.js";import"./chunk-tsncwscz.js";import"./chunk-h2wsm7h3.js";import"./chunk-etces6ff.js";import"./chunk-yahb7wan.js";import"./chunk-mahxw48e.js";import"./chunk-wap08p4j.js";import{bh as K}from"./chunk-nr89225z.js";import{Ah as H,Mh as J,gh as Z,ih as q,nh as D,oh as G}from"./chunk-b1e3tec3.js";import{Xk as Y}from"./chunk-ws07a9kv.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=D({queryKey:["folders",b],queryFn:async()=>{let B=await J.api.folders[":folderId"].$get({param:{folderId:b}});if(!B.ok)throw Error("failed to fetch folder");return await B.json()},enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:b,rootFolderId:b})}var $=H("/projects/$projectId/")({component:_});export{$ as Route};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{lc as Z}from"./chunk-6a2eb3b5.js";import{mc as J}from"./chunk-amsb41z5.js";import{Lk as L,Nk as w}from"./chunk-zxpef55w.js";function d(b){return b.thought===!0}function B(b,j){if(typeof j==="string"&&j.length>0)return j;return b}var x=/^[A-Za-z0-9+/]+={0,2}$/;function T(b){if(!b)return!1;if(b.length%4!==0)return!1;return x.test(b)}function Q(b,j){return b&&T(j)?j:void 0}function U(b){return b.startsWith("claude-")||b.startsWith("gpt-oss-")}function f(b){let j=b.toLowerCase().match(/^gemini(?:-live)?-(\d+)/);if(!j)return;return Number.parseInt(j[1],10)}function y(b){let j=f(b);if(j!==void 0)return j>=3;return!0}function R(b,j){let A=[],N=(z)=>{if(!U(b.id))return z;return z.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,64)},$=Z(j.messages,b,N);for(let z of $)if(z.role==="user")if(typeof z.content==="string")A.push({role:"user",parts:[{text:J(z.content)}]});else{let E=z.content.map((D)=>{if(D.type==="text")return{text:J(D.text)};else return{inlineData:{mimeType:D.mimeType,data:D.data}}});if(E.length===0)continue;A.push({role:"user",parts:E})}else if(z.role==="assistant"){let E=[],D=z.provider===b.provider&&z.model===b.id;for(let q of z.content)if(q.type==="text"){if(!q.text||q.text.trim()==="")continue;let G=Q(D,q.textSignature);E.push({text:J(q.text),...G&&{thoughtSignature:G}})}else if(q.type==="thinking"){if(!q.thinking||q.thinking.trim()==="")continue;if(D){let G=Q(D,q.thinkingSignature);E.push({thought:!0,text:J(q.thinking),...G&&{thoughtSignature:G}})}else E.push({text:J(q.thinking)})}else if(q.type==="toolCall"){let G=Q(D,q.thoughtSignature),K={functionCall:{name:q.name,args:q.arguments??{},...U(b.id)?{id:q.id}:{}},...G&&{thoughtSignature:G}};E.push(K)}if(E.length===0)continue;A.push({role:"model",parts:E})}else if(z.role==="toolResult"){let D=z.content.filter((H)=>H.type==="text").map((H)=>H.text).join(`
3
- `),q=b.input.includes("image")?z.content.filter((H)=>H.type==="image"):[],G=D.length>0,K=q.length>0,V=y(b.id),W=G?J(D):K?"(see attached image)":"",X=q.map((H)=>({inlineData:{mimeType:H.mimeType,data:H.data}})),v=U(b.id),Y={functionResponse:{name:z.toolName,response:z.isError?{error:W}:{output:W},...K&&V&&{parts:X},...v?{id:z.toolCallId}:{}}},O=A[A.length-1];if(O?.role==="user"&&O.parts?.some((H)=>H.functionResponse))O.parts.push(Y);else A.push({role:"user",parts:[Y]});if(K&&!V)A.push({role:"user",parts:[{text:"Tool result image:"},...X]})}return A}var F=new Set(["$schema","$id","$anchor","$dynamicAnchor","$vocabulary","$comment","$defs","definitions"]);function _(b){if(typeof b!=="object"||b===null||Array.isArray(b))return b;let j={};for(let[A,N]of Object.entries(b)){if(F.has(A))continue;j[A]=_(N)}return j}function C(b,j=!1){if(b.length===0)return;return[{functionDeclarations:b.map((A)=>({name:A.name,description:A.description,...j?{parameters:_(A.parameters)}:{parametersJsonSchema:A.parameters}}))}]}function k(b){switch(b){case"auto":return L.AUTO;case"none":return L.NONE;case"any":return L.ANY;default:return L.AUTO}}function P(b){switch(b){case w.STOP:return"stop";case w.MAX_TOKENS:return"length";case w.BLOCKLIST:case w.PROHIBITED_CONTENT:case w.SPII:case w.SAFETY:case w.IMAGE_SAFETY:case w.IMAGE_PROHIBITED_CONTENT:case w.IMAGE_RECITATION:case w.IMAGE_OTHER:case w.RECITATION:case w.FINISH_REASON_UNSPECIFIED:case w.OTHER:case w.LANGUAGE:case w.MALFORMED_FUNCTION_CALL:case w.UNEXPECTED_TOOL_CALL:case w.NO_IMAGE:return"error";default:throw Error(`Unhandled stop reason: ${b}`)}}
4
- export{d as ac,B as bc,R as cc,C as dc,k as ec,P as fc};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function B(q){return q==="cloudflare-workers-ai"||q==="cloudflare-ai-gateway"}function D(q){let k=q.baseUrl;if(!k.includes("{"))return k;return k.replace(/\{([A-Z_][A-Z0-9_]*)\}/g,(A,x)=>{let y=process.env[x];if(!y)throw Error(`${x} is required for provider ${q.provider} but is not set.`);return y})}function z(q){let k=q[q.length-1];return k&&k.role!=="user"?"agent":"user"}function F(q){return q.some((k)=>{if(k.role==="user"&&Array.isArray(k.content))return k.content.some((w)=>w.type==="image");if(k.role==="toolResult"&&Array.isArray(k.content))return k.content.some((w)=>w.type==="image");return!1})}function G(q){let k={"X-Initiator":z(q.messages),"Openai-Intent":"conversation-edits"};if(q.hasImages)k["Copilot-Vision-Request"]="true";return k}
3
- export{B as pk,D as qk,F as rk,G as sk};
@@ -1,3 +0,0 @@
1
- import{Eh as O,Fh as R,Kh as $,Mh as D,gh as l,nh as v}from"./chunk-b1e3tec3.js";import{Xk as b}from"./chunk-ws07a9kv.js";var E=null,I=R((p)=>({projectState:null,setProjectState:(c)=>{if(E)clearTimeout(E),E=null;p({projectState:c})},clearProjectState:()=>{if(E)clearTimeout(E);E=setTimeout(()=>{p({projectState:null}),E=null},10)}}));var H=R((p)=>({isChatbotOpen:!1,setIsChatbotOpen:(c)=>p({isChatbotOpen:c}),isHistoryMode:!1,setIsHistoryMode:(c)=>p({isHistoryMode:c}),currentSessionId:null,setCurrentSessionId:(c)=>p({currentSessionId:c}),chatAssets:[],addAssets:(c)=>p((j)=>{let f=new Set(j.chatAssets.map((T)=>T.id)),F=c.filter((T)=>!f.has(T.id));return{chatAssets:[...j.chatAssets,...F]}}),removeAsset:(c)=>p((j)=>({chatAssets:j.chatAssets.filter((f)=>f.id!==c)})),clearAssets:()=>p({chatAssets:[]}),messages:[],setMessages:(c)=>p({messages:c}),historySessions:[],setHistorySessions:(c)=>p({historySessions:c}),isStreaming:!1,setIsStreaming:(c)=>p({isStreaming:c}),selectedAgentId:null,setSelectedAgentId:(c)=>p({selectedAgentId:c}),inputText:"",setInputText:(c)=>p({inputText:c}),scrollTop:0,isAtBottom:!0,setScrollState:(c,j)=>p({scrollTop:c,isAtBottom:j}),fetchHistorySessions:async(c)=>{try{let j=await D.api.teams[":teamId"].chat.sessions.$get({param:{teamId:c},query:{first:"50"}});if(j.ok){let f=await j.json();p({historySessions:f.data||[]})}}catch(j){console.error("Failed to fetch history sessions:",j)}},loadSession:async(c,j)=>{try{let f=await D.api.teams[":teamId"].chat.sessions[":sessionId"].messages.$get({param:{teamId:c,sessionId:j}});if(f.ok){let F=await f.json(),P=H.getState().historySessions.find((J)=>J.id===j)?.agentId||null;p({currentSessionId:j,messages:F,isHistoryMode:!1,scrollTop:0,isAtBottom:!0,...P?{selectedAgentId:P}:{}})}else throw Error("Failed to load session messages")}catch(f){let F=f instanceof Error?f.message:"Failed to load session";$.error(F)}},deleteSession:async(c,j)=>{try{if((await D.api.teams[":teamId"].chat.sessions[":sessionId"].$delete({param:{teamId:c,sessionId:j}})).ok)$.success("Session deleted successfully"),p((F)=>({historySessions:F.historySessions.filter((T)=>T.id!==j),currentSessionId:F.currentSessionId===j?null:F.currentSessionId,messages:F.currentSessionId===j?[]:F.messages}));else throw Error("Failed to delete session")}catch(f){let F=f instanceof Error?f.message:"Failed to delete session";$.error(F)}},startNewSession:()=>{p({currentSessionId:null,messages:[],chatAssets:[],inputText:"",scrollTop:0,isAtBottom:!0})},sendMessage:async(c,j,f,F,T)=>{let P=H.getState();if(P.isStreaming)return;let J=`temp-${Date.now()}`,C={id:J,role:"user",content:[{type:"text",text:j}],timestamp:Date.now()},V=[...P.messages];if(P.chatAssets.length>0){let G={id:`temp-context-${Date.now()}`,role:"custom",customType:"context_display_info",details:{assets:P.chatAssets.map((k)=>({id:k.id,name:k.name,type:k.type}))},timestamp:Date.now()-1};V.push(G)}V.push(C),p({messages:V,isStreaming:!0,chatAssets:[],isAtBottom:!0});let A=P.chatAssets.map((K)=>K.id),_=P.selectedAgentId;if(!_){$.error("No agent selected");return}try{let K=await D.api.teams[":teamId"].chat.$post({param:{teamId:c},json:{agentId:_,textPrompt:j,assetIds:A,sessionId:P.currentSessionId||void 0,contextAssetId:F,projectId:f}});if(!K.ok)throw Error("Failed to start chat");let G=K.headers.get("x-session-id");if(G&&!P.currentSessionId)p({currentSessionId:G});let k=K.body?.getReader();if(!k)throw Error("No stream body");let W=new TextDecoder,X="";while(!0){let{done:M,value:S}=await k.read();if(M)break;X+=W.decode(S,{stream:!0});let h=X.split(`
2
- `);X=h.pop()||"";for(let u of h){let Y=u.trim();if(!Y)continue;if(Y.startsWith("data: ")){let y=Y.slice(6);try{let Q=JSON.parse(y);if(Q.type==="session"){if(!H.getState().currentSessionId)p({currentSessionId:Q.sessionId})}else if(Q.type==="entry"){let w=Q.entry,L=w;if(L.role==="toolResult"&&typeof L.toolName==="string"&&["create_file","create_folder","create_version"].includes(L.toolName)&&!L.isError)T?.();p((N)=>{let z=N.messages.some((q)=>q.id===w.id),Z=N.messages.filter((q)=>{if(w.role==="user"&&!z)return!(q.id.startsWith("temp-")&&!q.id.startsWith("temp-context-"));if(w.role==="custom"&&w.customType==="context_display_info"&&!z)return!q.id.startsWith("temp-context-");return!0}),B=Z.findIndex((q)=>q.id===w.id);if(B!==-1){let q=[...Z];return q[B]=w,{messages:q}}else return{messages:[...Z,w]}})}else if(Q.type==="done"){if(Q.status==="failed")$.error(Q.error||"Workflow failed")}}catch(Q){console.error("Error parsing SSE line:",Q)}}}}H.getState().fetchHistorySessions(c)}catch(K){let G=K instanceof Error?K.message:"Failed to send message";$.error(G),p((k)=>({messages:k.messages.filter((W)=>W.id!==J)}))}finally{p({isStreaming:!1})}},abortActiveSession:async(c)=>{let{currentSessionId:j,isStreaming:f}=H.getState();if(!j||!f)return;try{if((await D.api.teams[":teamId"].chat.sessions[":sessionId"].abort.$post({param:{teamId:c,sessionId:j}})).ok)$.success("Agent execution stopped");else throw Error("Failed to abort agent execution")}catch(F){let T=F instanceof Error?F.message:"Failed to abort execution";$.error(T)}}}));var U=b(l(),1);function x(p){let c=p.match(/teams\/([^/]+)/);if(c)return{teamId:c[1]};let j=p.match(/projects\/([^/]+)/);if(j)return{projectId:j[1]};return{}}function s(){let[p,c]=U.useState(),j=O({select:(P)=>P.location.pathname}),{teamId:f,projectId:F}=x(j),{data:T}=v({queryKey:["projects",F,"team"],queryFn:async()=>{let P=await D.api.projects[":projectId"].team.$get({param:{projectId:F}});if(!P.ok)throw Error("failed to fetch project team");return await P.json()},enabled:!!F});return U.useEffect(()=>{if(f)c(f);else if(T?.teamId)c(T.teamId)},[f,T]),p}
3
- export{s as ig,I as jg,H as kg};
@@ -1 +0,0 @@
1
- import{h as RB,i as bB}from"./chunk-rrxjvewm.js";import{k as gB}from"./chunk-qn96vbke.js";import{o as LB,r as MB}from"./chunk-8e5zvy88.js";import"./chunk-nzy3pjjm.js";import{P as NB}from"./chunk-9c7fxjej.js";import"./chunk-zhd2mkbr.js";import"./chunk-bdjhb77e.js";import{Wa as DB}from"./chunk-31mjcykb.js";import"./chunk-hfp4hpca.js";import"./chunk-3rcc5s99.js";import"./chunk-20y3wte3.js";import{Cf as kB}from"./chunk-ve7v8wtv.js";import"./chunk-7y8dng8t.js";import{jg as VB,kg as wB}from"./chunk-z0ej44ak.js";import"./chunk-tsncwscz.js";import{qg as EB}from"./chunk-etces6ff.js";import{rg as $B}from"./chunk-yahb7wan.js";import"./chunk-mahxw48e.js";import"./chunk-wap08p4j.js";import{bh as PB}from"./chunk-nr89225z.js";import{Ah as TB,Gi as _B,Mh as q,Wh as p,ak as UB,eh as d,gh as XB,hh as zB,hi as ZB,ih as G,ik as yB,jh as D,kh as HB,nh as j,ph as QB,vh as qB,xh as YB}from"./chunk-b1e3tec3.js";import{Xk as KB}from"./chunk-ws07a9kv.js";var $=KB(XB(),1);var tB=({item:J})=>{if(J.preview?.thumbnailUrl)return G("img",{src:J.preview.thumbnailUrl,alt:"Preview",className:"w-full h-full object-cover"});if(J.preview?.proxyType==="audio"||J.proxyType==="audio")return G("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:G(ZB,{className:"w-5 h-5 text-muted-foreground"})});return G("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:G(_B,{className:"w-5 h-5 text-muted-foreground"})})},OB=({projectId:J,currentAssetId:X,parentFolderId:Q,initialFiles:_,initialNextCursor:w})=>{let{ref:z,inView:k}=$B({threshold:0,rootMargin:"200px"}),T=$.useRef(null),N=$.useRef(!1),[O,y]=$.useState(_),[Z,R]=$.useState(w),[b,S]=$.useState(!!w),[L,P]=$.useState(!1);return $.useEffect(()=>{y(_),R(w),S(!!w),N.current=!1},[_,w]),$.useEffect(()=>{(async()=>{if(!Z||L||!k||!b)return;P(!0);try{let W=await q.api.folders[":folderId"].search.$post({param:{folderId:Q},json:{assetType:"file",after:Z,first:200,recursively:!1,conditions:[]}});if(!W.ok)throw Error("Failed to fetch next page");let g=await W.json(),M=g.data||[];y((f)=>[...f,...M]),R(g.pageInfo?.cursor||void 0),S(!!g.pageInfo?.cursor&&M.length>0)}catch(W){console.error("Error fetching next page:",W)}finally{P(!1)}})()},[k,Z,b,L,Q]),$.useEffect(()=>{N.current=!1},[X]),$.useEffect(()=>{if(O.some((W)=>W?.id===X)&&T.current&&!N.current)T.current.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}),N.current=!0},[O,X]),G("div",{className:"h-24 md:h-full w-full md:w-24 bg-gray-100 dark:bg-gray-950 flex flex-row md:flex-col flex-shrink-0 select-none",children:D("div",{className:"flex-1 overflow-x-auto overflow-y-hidden md:overflow-y-auto md:overflow-x-hidden px-4 md:px-0 py-2 md:py-4 flex flex-row md:flex-col items-center gap-3 no-scrollbar",children:[O.map((H)=>{if(!H)return null;let W=H.id===X;return G("div",{ref:H.id===X?T:null,className:"flex-shrink-0",children:G(YB,{to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:H.id},search:{version:void 0},className:UB("rounded-lg border overflow-hidden flex items-center justify-center transition-all bg-muted/30 block",W?"w-[62px] h-[62px] opacity-100":"w-[52px] h-[52px] opacity-60 hover:opacity-100"),children:G(tB,{item:H})})},H.id)}),b&&G("div",{ref:z,className:"px-2 md:px-0 py-2 md:py-4 flex justify-center items-center h-full md:w-full flex-shrink-0",children:L&&G(p,{className:"h-5 w-5 animate-spin text-muted-foreground"})})]})})};var Y=KB(XB(),1);function eB(){let{projectId:J,fileId:X}=WB.useParams(),Q=WB.useSearch(),_=Q.version,w=Q.start,z=_||X,k=Q.cmpLeft,T=Q.cmpRight,N=Q.cmpActive??"left",O=!!Q.compare&&!!k&&!!T,y=Y.useRef(null),{teamId:Z,ensureTeamIdForProject:R}=PB(),[b,S]=Y.useState(360),[L,P]=Y.useState([]),{fileViewRightSidebarCollapsed:H}=EB(),{isChatbotOpen:W}=wB(),[g,M]=Y.useState(0),[f,C]=Y.useState(null),[l,AB]=Y.useState(null),[xB,jB]=Y.useState(void 0),[A,I]=Y.useState({show:!1,files:[],nextCursor:void 0,folderId:void 0}),SB=q.api.files[":fileId"].metadata.$patch,{mutate:CB}=QB({mutationFn:async(B)=>{let K=await SB(B);if(!K.ok)throw Error("Failed to patch metadata");return await K.json()}}),hB=HB(),{members:FB,fetchMembers:n}=NB();Y.useEffect(()=>{R(J)},[J,R]),Y.useEffect(()=>{if(Z)n(Z,!0)},[Z,n]);let{data:o,isLoading:vB,isError:pB,isFetching:fB}=j({queryKey:["files",X],queryFn:async()=>{let B=await q.api.files[":fileId"].$get({param:{fileId:X}});if(!B.ok)throw Error("Failed to fetch stack");return await B.json()},enabled:!!Z,placeholderData:d}),{data:IB,isLoading:mB,isError:uB,isFetching:cB}=j({queryKey:["files",_],queryFn:async()=>{let B=await q.api.files[":fileId"].$get({param:{fileId:_}});if(!B.ok)throw Error("Failed to fetch version");return await B.json()},enabled:!!Z&&!!_,placeholderData:d}),{data:dB}=j({queryKey:["version_stacks",X,"versions"],queryFn:async()=>{let B=await q.api.version_stacks[":stackId"].versions.$get({param:{stackId:X}});if(!B.ok)throw Error("Failed to fetch versions");return await B.json()},enabled:!!J&&!!X&&(!!_||O)}),{data:x}=j({queryKey:["projects",J],queryFn:async()=>{let B=await q.api.projects[":projectId"].$get({param:{projectId:J}});if(!B.ok)throw Error("Failed to fetch project");return await B.json()}}),h=qB(),{setProjectState:a,clearProjectState:r}=VB(),lB=vB||!!_&&mB,nB=pB||!!_&&uB,oB=fB||!!_&&cB,U=IB||o,V=_?dB:o?.versionStack?.versions;Y.useEffect(()=>{if(U&&x&&Z)a({teamId:Z,projectId:J,projectName:x.name??"",ancestorFolders:U.ancestorFolders??[],currentAsset:{name:U.name,type:"file",version:V?V.find((B)=>B.id===z)?.version??V.length:void 0,proxyType:U.proxyType},isRootFolder:!1,fileId:X,downloadInfo:{originalKey:U.media?.original?.key,videoTranscodes:U.media?.videoTranscodes?.map((B)=>({key:B.key,width:B.width,height:B.height,isRaw:B.isRaw}))},versions:V,compareMode:O,canCompareVersions:(V?.length??0)>=2,onCompareVersions:()=>{let B=LB(V);if(!B)return;h({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:X},search:(K)=>({...K,version:void 0,compare:!0,cmpLeft:B.left.id,cmpRight:B.right.id,cmpActive:"left"})})},onFolderClick:(B)=>{h({to:"/projects/$projectId/folders/$folderId",params:{projectId:J,folderId:B}})}});return()=>r()},[Z,J,x,U,V,z,X,O,a,r,h]);let E=U?.ancestorFolders?.[0]?.id??x?.rootFolder??"";if(Y.useEffect(()=>{if(!E||!z)return;if(A.folderId===E)return;let B=!0;return(async()=>{try{let F="",t=!1,e=[],BB=void 0;for(let GB=0;GB<5;GB++){let JB=await q.api.folders[":folderId"].search.$post({param:{folderId:E},json:{assetType:"file",after:F,first:200,recursively:!1,conditions:[]}});if(!JB.ok)throw Error("Failed to search parent folder for carousel");let v=await JB.json(),c=v.data||[];if(e.push(...c),c.some((sB)=>sB.id===z)){t=!0,BB=v.pageInfo?.cursor||void 0;break}if(!v.pageInfo?.cursor||c.length<200)break;F=v.pageInfo.cursor}if(B)if(t)I({show:!0,files:e,nextCursor:BB,folderId:E});else I({show:!1,files:[],nextCursor:void 0,folderId:E})}catch(F){if(console.error(F),B)I({show:!1,files:[],nextCursor:void 0,folderId:E})}})(),()=>{B=!1}},[E,z,A.folderId]),Y.useEffect(()=>{M(0),C(null),P([])},[U?.id]),Y.useEffect(()=>{C(null),P([])},[l?.id]),lB&&!U)return G(kB,{});if(nB||!U||!x||!Z)return G("div",{children:yB.file_not_found()});let m=O?l:U,i=m?.id??z,aB=(B,K)=>{if(!Z)return;CB({param:{fileId:i},json:[{key:B,value:K}]},{onSuccess:()=>{hB.invalidateQueries({queryKey:["files",i]})}})},u=(B)=>{h({to:"/projects/$projectId/files/$fileId",params:{projectId:J,fileId:X},search:(K)=>({...K,...B})})},rB=()=>{u({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:N==="left"?k:T})},iB=(B)=>{C(B.id||null);let K=B.annotations;if(K&&K.length>0)P(K);else P([]);if(O){if(B.second!==null&&B.second!==void 0)jB({second:B.second,nonce:Date.now()});return}if(B.second!==null&&B.second!==void 0)y.current?.seekTo(B.second),y.current?.pause();else if(K&&K.length>0)y.current?.pause()},s=()=>{P([]),C(null)};return G("div",{className:"h-full flex flex-1 flex-col bg-background",children:D("div",{className:"h-full flex flex-1 overflow-hidden",children:[D("div",{className:"flex-1 relative",children:[oB&&!O&&G("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:G(p,{className:"h-8 w-8 animate-spin text-foreground"})}),O&&k&&T?G(bB,{versions:V??[],leftId:k,rightId:T,activeSide:N,annotations:L,seekRequest:xB,onActiveSideChange:(B)=>u({cmpActive:B}),onSwitchVersion:(B,K)=>u(B==="left"?{cmpLeft:K}:{cmpRight:K}),onExit:rB,onActiveAssetChange:AB,onPlay:s,onTimeUpdate:M}):G(RB,{file:U,mediaControllerRef:y,onPlay:s,onTimeUpdate:M,annotations:L,startTime:w,children:A.show&&G(OB,{projectId:J,currentAssetId:z,parentFolderId:E,initialFiles:A.files,initialNextCursor:A.nextCursor})})]}),(!H||W)&&D(zB,{children:[G(DB,{onResize:(B)=>{S((K)=>Math.max(300,Math.min(600,K-B)))},className:"hidden md:block"}),G("div",{style:{width:b},className:"flex-shrink-0 bg-background flex flex-col",children:W?G(gB,{projectId:J,contextAssetId:z}):G(MB,{teamId:Z,projectId:J,file:m,onSaveField:aB,members:FB,onCommentSelect:iB,currentTime:g,onTyping:()=>{if(O)return;y.current?.pause()},selectedCommentId:f,hideAnnotationControl:m?.proxyType==="audio"})})]})]})})}var WB=TB("/projects/$projectId/files/$fileId")({component:eB});export{WB as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Fk as C,Gk as j,Hk as v,Ik as T,Jk as I,Kk as B}from"./chunk-8m6zg15c.js";import{Mk as F,Ok as M,Pk as H}from"./chunk-zxpef55w.js";import{Qk as G}from"./chunk-5zntjzxw.js";import{Tk as P,Uk as L,Vk as K}from"./chunk-vf066xwh.js";import{Wk as y}from"./chunk-qvgc9e08.js";import"./chunk-ws07a9kv.js";var b="v1",k="gcp-vertex-credentials",g={THINKING_LEVEL_UNSPECIFIED:F.THINKING_LEVEL_UNSPECIFIED,MINIMAL:F.MINIMAL,LOW:F.LOW,MEDIUM:F.MEDIUM,HIGH:F.HIGH},m=0,S=(q,w,J)=>{let Y=new K;return(async()=>{let Q={role:"assistant",content:[],api:"google-vertex",provider:q.provider,model:q.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let W=p(J),z=W?u(q,W,J?.headers):d(q,r(J),s(J),J?.headers),N=i(q,w,J),R=await J?.onPayload?.(N,q);if(R!==void 0)N=R;let x=await z.models.generateContentStream(N);Y.push({type:"start",partial:Q});let Z=null,A=Q.content,X=()=>A.length-1;for await(let D of x){Q.responseId||=D.responseId;let V=D.candidates?.[0];if(V?.content?.parts)for(let $ of V.content.parts){if($.text!==void 0){let _=C($);if(!Z||_&&Z.type!=="thinking"||!_&&Z.type!=="text"){if(Z)if(Z.type==="text")Y.push({type:"text_end",contentIndex:A.length-1,content:Z.text,partial:Q});else Y.push({type:"thinking_end",contentIndex:X(),content:Z.thinking,partial:Q});if(_)Z={type:"thinking",thinking:"",thinkingSignature:void 0},Q.content.push(Z),Y.push({type:"thinking_start",contentIndex:X(),partial:Q});else Z={type:"text",text:""},Q.content.push(Z),Y.push({type:"text_start",contentIndex:X(),partial:Q})}if(Z.type==="thinking")Z.thinking+=$.text,Z.thinkingSignature=j(Z.thinkingSignature,$.thoughtSignature),Y.push({type:"thinking_delta",contentIndex:X(),delta:$.text,partial:Q});else Z.text+=$.text,Z.textSignature=j(Z.textSignature,$.thoughtSignature),Y.push({type:"text_delta",contentIndex:X(),delta:$.text,partial:Q})}if($.functionCall){if(Z){if(Z.type==="text")Y.push({type:"text_end",contentIndex:X(),content:Z.text,partial:Q});else Y.push({type:"thinking_end",contentIndex:X(),content:Z.thinking,partial:Q});Z=null}let _=$.functionCall.id,E={type:"toolCall",id:!_||Q.content.some((U)=>U.type==="toolCall"&&U.id===_)?`${$.functionCall.name}_${Date.now()}_${++m}`:_,name:$.functionCall.name||"",arguments:$.functionCall.args??{},...$.thoughtSignature&&{thoughtSignature:$.thoughtSignature}};Q.content.push(E),Y.push({type:"toolcall_start",contentIndex:X(),partial:Q}),Y.push({type:"toolcall_delta",contentIndex:X(),delta:JSON.stringify(E.arguments),partial:Q}),Y.push({type:"toolcall_end",contentIndex:X(),toolCall:E,partial:Q})}}if(V?.finishReason){if(Q.stopReason=B(V.finishReason),Q.content.some(($)=>$.type==="toolCall"))Q.stopReason="toolUse"}if(D.usageMetadata)Q.usage={input:(D.usageMetadata.promptTokenCount||0)-(D.usageMetadata.cachedContentTokenCount||0),output:(D.usageMetadata.candidatesTokenCount||0)+(D.usageMetadata.thoughtsTokenCount||0),cacheRead:D.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:D.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},P(q,Q.usage)}if(Z)if(Z.type==="text")Y.push({type:"text_end",contentIndex:X(),content:Z.text,partial:Q});else Y.push({type:"thinking_end",contentIndex:X(),content:Z.thinking,partial:Q});if(J?.signal?.aborted)throw Error("Request was aborted");if(Q.stopReason==="aborted"||Q.stopReason==="error")throw Error("An unknown error occurred");Y.push({type:"done",reason:Q.stopReason,message:Q}),Y.end()}catch(W){for(let z of Q.content)if("index"in z)delete z.index;Q.stopReason=J?.signal?.aborted?"aborted":"error",Q.errorMessage=W instanceof Error?W.message:JSON.stringify(W),Y.push({type:"error",reason:Q.stopReason,error:Q}),Y.end()}})(),Y},Wq=(q,w,J)=>{let Y=G(q,J,void 0);if(!J?.reasoning)return S(q,w,{...Y,thinking:{enabled:!1}});let Q=L(q,J.reasoning),W=Q==="off"?"high":Q,z=q;if(O(z)||h(z))return S(q,w,{...Y,thinking:{enabled:!0,level:e(W,z)}});return S(q,w,{...Y,thinking:{enabled:!0,budgetTokens:t(z,W,J.thinkingBudgets)}})};function d(q,w,J,Y){return new H({vertexai:!0,project:w,location:J,apiVersion:b,httpOptions:f(q,Y)})}function u(q,w,J){return new H({vertexai:!0,apiKey:w,apiVersion:b,httpOptions:f(q,J)})}function f(q,w){let J={},Y=a(q.baseUrl);if(Y){if(J.baseUrl=Y,J.baseUrlResourceScope=M.COLLECTION,c(Y))J.apiVersion=""}if(q.headers||w)J.headers={...q.headers,...w};return Object.keys(J).length>0?J:void 0}function a(q){let w=q.trim();if(!w||w.includes("{location}"))return;return w}function c(q){try{return new URL(q).pathname.split("/").some((J)=>/^v\d+(?:beta\d*)?$/.test(J))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(q)}}function p(q){let w=q?.apiKey?.trim();if(!w||w===k||l(w))return;return w}function l(q){return/^<[^>]+>$/.test(q)}function r(q){let w=q?.project||process.env.GOOGLE_CLOUD_PROJECT||process.env.GCLOUD_PROJECT;if(!w)throw Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return w}function s(q){let w=q?.location||process.env.GOOGLE_CLOUD_LOCATION;if(!w)throw Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return w}function i(q,w,J={}){let Y=v(q,w),Q={};if(J.temperature!==void 0)Q.temperature=J.temperature;if(J.maxTokens!==void 0)Q.maxOutputTokens=J.maxTokens;let W={...Object.keys(Q).length>0&&Q,...w.systemPrompt&&{systemInstruction:y(w.systemPrompt)},...w.tools&&w.tools.length>0&&{tools:T(w.tools)}};if(w.tools&&w.tools.length>0&&J.toolChoice)W.toolConfig={functionCallingConfig:{mode:I(J.toolChoice)}};else W.toolConfig=void 0;if(J.thinking?.enabled&&q.reasoning){let N={includeThoughts:!0};if(J.thinking.level!==void 0)N.thinkingLevel=g[J.thinking.level];else if(J.thinking.budgetTokens!==void 0)N.thinkingBudget=J.thinking.budgetTokens;W.thinkingConfig=N}else if(q.reasoning&&J.thinking&&!J.thinking.enabled)W.thinkingConfig=n(q);if(J.signal){if(J.signal.aborted)throw Error("Request aborted");W.abortSignal=J.signal}return{model:q.id,contents:Y,config:W}}function O(q){return/gemini-3(?:\.\d+)?-pro/.test(q.id.toLowerCase())}function h(q){return/gemini-3(?:\.\d+)?-flash/.test(q.id.toLowerCase())}function n(q){let w=q;if(O(w))return{thinkingLevel:F.LOW};if(h(w))return{thinkingLevel:F.MINIMAL};return{thinkingBudget:0}}function e(q,w){if(O(w))switch(q){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}switch(q){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function t(q,w,J){if(J?.[w]!==void 0)return J[w];if(q.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[w];if(q.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[w];return-1}export{Wq as streamSimpleGoogleVertex,S as streamGoogleVertex};
@@ -1 +0,0 @@
1
- import{og as e}from"./chunk-tsncwscz.js";import{Vj as n,ak as s,ih as r,jh as l,pi as x,qi as f,ti as b}from"./chunk-b1e3tec3.js";function ae({...t}){return r(n.Root,{"data-slot":"select",...t})}function se({...t}){return r(n.Value,{"data-slot":"select-value",...t})}function pe({className:t,size:o="default",children:a,...c}){return l(n.Trigger,{"data-slot":"select-trigger","data-size":o,className:s("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",t),...c,children:[a,r(n.Icon,{asChild:!0,children:r(f,{className:"size-4 opacity-50"})})]})}function ce({className:t,children:o,position:a="item-aligned",align:c="center",...d}){return r(n.Portal,{children:l(n.Content,{"data-slot":"select-content",className:s("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,align:c,...d,children:[r(C,{}),r(n.Viewport,{className:s("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),r(T,{})]})})}function le({className:t,children:o,...a}){return l(n.Item,{"data-slot":"select-item",className:s("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...a,children:[r("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:r(n.ItemIndicator,{children:r(x,{className:"size-4"})})}),r(n.ItemText,{children:o})]})}function C({className:t,...o}){return r(n.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:s("flex cursor-default items-center justify-center py-1",t),...o,children:r(b,{className:"size-4"})})}function T({className:t,...o}){return r(n.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:s("flex cursor-default items-center justify-center py-1",t),...o,children:r(f,{className:"size-4"})})}var p=e.object({cursor:e.string().optional(),total:e.number().optional(),totalSize:e.number().optional()}),i=e.object({first:e.coerce.number().optional(),after:e.string().optional()});var Se=e.object({name:e.string()}),w=e.object({id:e.string(),name:e.string(),rootFolder:e.string().optional(),updatedAt:e.union([e.string(),e.date()])});var he=e.object({data:e.array(w),pageInfo:p}),xe=e.object({teamId:e.string(),userId:e.string()}),be=e.object({id:e.string(),name:e.string(),email:e.string().optional(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional(),unreadNotificationCount:e.number().optional()}),Re=e.object({name:e.string().optional(),imageKey:e.string().nullable().optional()}),Ie=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),email:e.string().optional(),type:e.enum(["human","agent"]).optional(),image:e.string().optional(),scope:e.enum(["team","project"]).optional()}),ve=e.object({includeAgents:e.string().optional().transform((t)=>t==="true")}),A={best_match:"best_match",all:"all"},qe=e.union([e.object({key:e.literal("transcode.videoStrategy"),value:e.nativeEnum(A)})]),je=e.object({allowedDomains:e.array(e.string()),pendingDomains:e.array(e.string()).default([])});var Pe=e.object({role:e.enum(["editor","reviewer"])});var R=e.enum(["chat","autofill","embedding"]),I=e.enum(["off","minimal","low","medium","high","xhigh"]),N=e.object({id:e.string().optional(),skillId:e.string(),skill:e.object({id:e.string(),name:e.string()}).optional()}),Ce=e.object({id:e.string(),name:e.string(),type:R,enabled:e.boolean(),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:I.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(N).optional(),deniedTools:e.array(e.string()).optional()}),v=e.object({name:e.string().min(1),type:R,enabled:e.boolean().optional().default(!0),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:I.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(e.string()).optional(),deniedTools:e.array(e.string()).optional()}),Te=v.superRefine((t,o)=>{if(t.type==="chat"||t.type==="autofill"){if(!t.providerId)o.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!t.modelId)o.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),we=v.superRefine((t,o)=>{if(t.type==="chat"||t.type==="autofill"){if(!t.providerId)o.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!t.modelId)o.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),Ae=e.object({id:e.string(),sessionId:e.string(),entry:e.unknown()}),Ne=e.object({id:e.string(),name:e.string().nullable().optional(),type:e.string(),createdAt:e.string(),creator:e.object({id:e.string(),name:e.string().nullable().optional(),email:e.string().nullable().optional(),image:e.string().nullable().optional()}).nullable().optional(),agentId:e.string().optional()});var Le=e.object({apiKey:e.string().optional(),baseUrl:e.string().optional(),chatModels:e.array(e.string()).optional()}),F=e.enum(["1h","24h","7d","30d"]),Ve=e.object({timeframe:F.default("30d"),userId:e.string().optional()});var Ee=e.object({data:e.array(e.lazy(()=>O)),pageInfo:p}),q=e.object({proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),thumbnailUrl:e.string().optional(),originalHeight:e.number().optional(),originalWidth:e.number().optional(),spriteUrl:e.string().optional(),duration:e.number().optional(),pageCount:e.number().optional()}),M=e.object({type:e.string().nullable(),preview:q.nullable()}),m=e.object({id:e.string(),name:e.string(),image:e.string().optional()}),L=e.object({fieldId:e.string(),value:e.any()}),V=e.object({id:e.string(),name:e.string()}),B=e.object({duration:e.number().optional(),originalWidth:e.number().optional(),originalHeight:e.number().optional(),frameRate:e.number().optional(),totalFrames:e.number().optional(),startTimecode:e.string().optional()}),O=e.object({id:e.string(),name:e.string(),sizeByte:e.number(),fileCount:e.number(),type:e.string(),targetType:e.string().optional().nullable(),status:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),latestChildren:e.array(M).optional(),preview:q.nullable().optional(),createdAt:e.string(),updatedAt:e.string(),deletedAt:e.string().nullable().optional(),projectId:e.string().optional().nullable(),creator:m.nullable().optional(),fieldValues:e.array(L).optional(),sortIndex:e.string().optional().nullable(),startTime:e.number().optional().nullable(),endTime:e.number().optional().nullable(),media:e.object({original:e.object({downloadUrl:e.string(),key:e.string().optional()}).optional(),videoTranscodes:e.array(e.object({id:e.string(),url:e.string(),key:e.string(),width:e.number(),height:e.number(),size:e.number(),isRaw:e.boolean()})).optional(),imageTranscodes:e.array(e.object({id:e.string(),url:e.string(),key:e.string(),width:e.number(),height:e.number(),size:e.number(),isRaw:e.boolean()})).optional(),videoPreview:e.object({url:e.string(),key:e.string().optional()}).optional(),pdfTranscode:e.object({url:e.string(),key:e.string().optional()}).optional(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),metadata:B.optional()}).optional(),ancestorFolders:e.array(V).optional(),versionStack:e.object({id:e.string(),versions:e.array(e.object({version:e.number(),current:e.boolean(),id:e.string(),name:e.string().optional().nullable(),previewUrl:e.string().optional().nullable(),creator:e.object({id:e.string(),name:e.string().nullable()}).nullable().optional()}))}).optional().nullable()}),Ge=e.object({name:e.string(),type:e.string(),projectId:e.string().optional(),parentId:e.string().optional(),key:e.string().optional(),sizeByte:e.number().optional(),contentType:e.string().optional(),creatorId:e.string().optional()}),Qe=e.object({assetId:e.string()}),_e=e.object({id:e.string(),name:e.string()}),Ze=e.object({assetId:e.string().optional(),assetType:e.string(),projectId:e.string().optional(),showDeleted:e.boolean().optional(),prefix:e.string().optional(),sort:e.string().optional(),order:e.string().optional(),...i.shape}),Ke=e.object({assetId:e.string(),userId:e.string(),replyToId:e.string().optional(),message:e.string(),annotations:e.any().optional(),second:e.number().optional(),attachmentIds:e.array(e.string())}),D=e.object({id:e.string(),assetId:e.string(),url:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),E=e.object({id:e.string(),assetId:e.string(),message:e.string().nullable(),annotations:e.any(),second:e.number().nullable(),creator:m,replies:e.array(e.lazy(()=>E)),attachments:e.array(D),mentions:e.array(m),createdAt:e.string(),updatedAt:e.string(),sessionId:e.string().nullable(),isCompleted:e.boolean(),completionLastChangedBy:m.nullable()}),He=e.object({isCompleted:e.boolean()}),Je=e.object({newParentId:e.string(),assetIds:e.array(e.string()),creatorId:e.string().optional()}),We=e.object({newParentId:e.string(),assetIds:e.array(e.string()),withComments:e.boolean().default(!1),creatorId:e.string().optional()}),Xe=e.object({name:e.string()}),Ye=e.object({beforeIndex:e.string().optional(),afterIndex:e.string().optional()}),$e=e.object({ids:e.array(e.string())}),ze=e.object({ids:e.array(e.string())}),et=e.object({file:e.instanceof(File)}),tt=e.object({key:e.string()}),ot=e.object({fileName:e.string(),contentType:e.string(),size:e.number()}),rt=e.object({id:e.string(),uploadUrl:e.string()}),nt=e.object({ids:e.array(e.string())}),G=e.object({id:e.string(),name:e.string(),url:e.string()}),it=e.object({files:e.array(G)});var pt=e.object({userCount:e.number()}),ct=e.object({name:e.string().min(1,"Name is required").max(100,"Name is too long")}),lt=e.object({id:e.string(),token:e.string(),name:e.string(),createdAt:e.string()});var Q=e.enum(["is","eq","neq","gt","gte","lt","lte","contains","notContains","isEmpty","isNotEmpty","in","notIn","hasAny","hasAll","hasNone","isWithin"]),_=e.object({field:e.string(),operator:Q,value:e.any()}),Z=e.enum(["asc","desc"]),K=e.object({field:e.string(),order:Z}),H=e.enum(["AND","OR"]),J=e.enum(["file","folder"]),u=e.object({operator:H.optional().default("AND"),conditions:e.array(_).optional().default([]),sort:K.optional(),assetType:J.optional(),showSymlink:e.boolean().optional(),recursively:e.boolean().optional().default(!0),query:e.string().optional(),isSemantic:e.boolean().optional().default(!1)}),ut=u.extend(i.shape);var g=e.object({sourceFolderId:e.string(),searchFilter:u}),W=e.object({id:e.string(),name:e.string(),filter:g,projectId:e.string(),createdAt:e.string(),updatedAt:e.string(),creator:e.object({id:e.string(),name:e.string(),image:e.string().optional().nullable()}).optional().nullable()}),xt=e.object({name:e.string(),filter:g}),bt=e.object({name:e.string().optional(),filter:g.optional()});var Rt=e.object({data:e.array(W),pageInfo:e.object({cursor:e.string().optional(),total:e.number().optional()})});var qt=e.object({name:e.string(),parentId:e.string()}),jt=e.object({name:e.string()}),Pt=e.object({ids:e.array(e.string())}),kt=e.object({ids:e.array(e.string())});var Tt=e.object({code:e.string(),role:e.enum(["editor","reviewer","owner"]),teamId:e.string(),teamName:e.string(),projectId:e.string().optional(),projectName:e.string().optional(),inviterName:e.string(),isUsed:e.boolean()}),wt=e.object({role:e.enum(["editor","reviewer"])}),At=e.object({role:e.enum(["editor","reviewer"])}),Nt=e.object({code:e.string()});var Lt={text:"text",longText:"longText",select:"select",selectMulti:"selectMulti",rating:"rating",number:"number",toggle:"toggle",date:"date",user:"user",userMulti:"userMulti"},Vt=e.object({id:e.string(),displayName:e.string(),color:e.string().optional()}),y=e.object({name:e.string(),type:e.enum(["text","longText","select","selectMulti","rating","number","toggle","date","user","userMulti"]),text:e.any().optional(),longText:e.any().optional(),select:e.any().optional(),selectMulti:e.any().optional(),rating:e.any().optional(),number:e.any().optional(),toggle:e.any().optional(),date:e.any().optional(),user:e.any().optional(),userMulti:e.any().optional()}),Bt=e.object({key:e.string().optional(),label:e.string().optional(),scope:e.string().optional(),config:y,aiAutofill:e.boolean().default(!1),description:e.string().default("")}),Ot=e.object({label:e.string().optional(),config:y,aiAutofill:e.boolean().optional(),description:e.string().optional()}),X=e.object({fieldId:e.string(),visible:e.boolean()}),Dt=e.array(X),Y=e.object({key:e.string(),value:e.any()}),Et=e.array(Y),Gt=e.object({id:e.string(),config:y,scope:e.string(),readOnly:e.boolean(),visible:e.boolean(),description:e.string(),aiAutofill:e.boolean()});var j=e.object({id:e.string().optional(),name:e.string().optional(),role:e.string().optional()}),P=e.object({id:e.string().optional(),name:e.string().optional()}),$=e.object({id:e.string().optional(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),name:e.string().optional(),preview:e.string().optional(),thumbnailUrl:e.string().optional(),originalWidth:e.number().optional(),originalHeight:e.number().optional()}),Zt=e.object({id:e.string().optional(),creator:j.optional(),type:e.string().optional(),team:P.optional(),project:P.optional(),asset:$.optional(),user:j.optional(),createdAt:e.string().optional(),isRead:e.boolean().optional()}),Kt=e.object({unreadOnly:e.union([e.boolean(),e.string()]).transform((t)=>t===!0||t==="true").optional(),after:e.string().optional(),pageSize:e.coerce.number().optional()}),Ht=e.object({notificationId:e.string().min(1)}),Jt=e.object({comments:e.boolean().default(!0),replies:e.boolean().default(!0),mentions:e.boolean().default(!0),yourUploads:e.boolean().default(!1),otherUploads:e.boolean().default(!0),statusUpdates:e.boolean().default(!0)});var $t=e.object({name:e.string(),coverImageKey:e.string().optional(),enableNotification:e.boolean().default(!0)}),zt=e.object({name:e.string().optional(),coverImageKey:e.string().optional(),enableNotification:e.boolean().optional()}),z=e.object({id:e.string(),name:e.string(),teamId:e.string(),rootFolder:e.string().optional(),coverImage:e.string().optional(),coverImageKey:e.string().optional(),enableNotification:e.boolean(),updatedAt:e.union([e.string(),e.date()])}),eo=e.object({sortBy:e.string().optional(),sortDirection:e.enum(["asc","desc"]).optional()}).merge(i),to=e.object({data:e.array(z),pageInfo:p}),oo=e.object({teamId:e.string()}),ro=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional(),scope:e.enum(["team","project"]).optional()}),no=e.object({id:e.string(),name:e.string()}),io=e.object({assetType:e.string(),sort:e.enum(["createdAt","name","size"]).optional(),order:e.enum(["asc","desc"]).optional()}).merge(i),ao=e.object({role:e.enum(["editor","reviewer"])}),so=e.object({userId:e.string(),role:e.enum(["owner","editor","reviewer"])}),po=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional()});var k=["openai-completions","mistral-conversations","openai-responses","azure-openai-responses","openai-codex-responses","anthropic-messages","bedrock-converse-stream","google-generative-ai","google-vertex"],ee=e.object({api:e.enum(k).optional(),reasoning:e.boolean().default(!1),input:e.array(e.enum(["text","image"])).default(["text"]),contextWindow:e.number().int().positive().default(128000),maxTokens:e.number().int().positive().default(4096),cost:e.object({input:e.number().nonnegative().default(0),output:e.number().nonnegative().default(0),cacheRead:e.number().nonnegative().default(0),cacheWrite:e.number().nonnegative().default(0)})}),S=e.object({id:e.string().optional(),modelId:e.string().min(1,"Model ID is required"),name:e.string().min(0).default(""),config:ee}),h=e.object({baseUrl:e.string().url("Must be a valid URL").optional().or(e.literal("")),apiKey:e.string().optional().or(e.literal("")),api:e.enum(k),headers:e.record(e.string(),e.string()).optional(),authHeader:e.boolean().optional()}),mo=e.object({name:e.string().min(1,"Provider name is required"),config:h,models:e.array(S).min(1,"At least one model is required")}),fo=e.object({config:h,models:e.array(S).min(1,"At least one model is required")}),uo=e.object({id:e.string(),name:e.string(),isBuiltin:e.boolean(),config:h,models:e.array(S).optional(),modelsCount:e.number().optional(),createdAt:e.date(),updatedAt:e.date()});var ho=e.object({name:e.string().min(1),expireAt:e.string().datetime().optional(),password:e.string().optional(),isDisabled:e.boolean().optional(),defaultSortOrder:e.string().optional(),viewMode:e.string().optional()}),xo=e.object({name:e.string().min(1).optional(),expireAt:e.string().datetime().optional().nullable(),password:e.string().optional().nullable(),isDisabled:e.boolean().optional(),defaultSortOrder:e.string().optional().nullable(),viewMode:e.string().optional().nullable(),fieldVisibility:e.record(e.string(),e.boolean()).optional().nullable()}),bo=i.extend({projectId:e.string().optional()}),Ro=e.object({assetIds:e.array(e.string().min(1)).min(1)});var qo=e.object({assetId:e.string().optional(),githubUrl:e.string().optional(),override:e.boolean().optional()}),jo=e.object({config:e.object({environmentVariables:e.array(e.object({name:e.string(),default:e.string().optional()}))})}),Po=e.object({permission:e.enum(["owner","editor","reviewer"])});var U=e.lazy(()=>e.object({name:e.string(),id:e.string(),size:e.number(),children:e.array(U),type:e.string(),mediaType:e.string().optional()})),Co=e.object({parentId:e.string(),files:e.array(U)}),te=e.object({id:e.string(),fileId:e.string(),url:e.string()}),To=e.object({taskId:e.string(),presignedUrls:e.array(te),createdAssets:e.array(e.object({tempId:e.string(),assetId:e.string()})).optional()}),wo=e.object({fileId:e.string(),errorMessage:e.string().optional()}),Ao=e.object({id:e.string(),name:e.string(),total:e.number(),uploaded:e.number(),createdAt:e.string()}),No=e.object({bucket:e.string(),key:e.string(),Signature:e.string()}),Fo=e.object({file:e.instanceof(File)});var oe=e.object({key:e.string(),value:e.unknown()}),Vo=e.object({value:e.unknown()}),Bo=e.array(oe);var Eo=e.object({fileIds:e.array(e.string())}),Go=e.object({fileId:e.string(),beforeId:e.string()});var Zo=e.object({agentId:e.string(),textPrompt:e.string().optional(),attachedFiles:e.array(e.string()).optional(),assetIds:e.array(e.string()).optional(),sessionId:e.string().optional(),contextAssetId:e.string().optional(),projectId:e.string().optional()}).superRefine((t,o)=>{let a=t.textPrompt&&t.textPrompt.trim().length>0,c=t.attachedFiles&&t.attachedFiles.length>0,d=t.assetIds&&t.assetIds.length>0;if(!a&&!c&&!d)o.addIssue({code:e.ZodIssueCode.custom,message:"At least one of textPrompt, attachedFiles, or assetIds must be provided.",path:["textPrompt"]})}),Ko=e.object({id:e.string(),agentId:e.string(),userId:e.string().nullable(),assetId:e.string().nullable(),userCommentId:e.string().nullable(),name:e.string().nullable().optional(),createdAt:e.string(),updatedAt:e.string()}),Ho=e.intersection(e.object({id:e.string()}),e.unknown());export{ae as W,se as X,pe as Y,ce as Z,le as _,I as $,Lt as aa,k as ba,S as ca,h as da,A as ea};