@shumai-one/shumai 0.4.1 → 0.4.3

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 (247) hide show
  1. package/bin/{chunk-adekdctx.css → chunk-0ccg9ddn.css} +1 -1
  2. package/bin/chunk-0e4wawpq.js +2 -0
  3. package/bin/chunk-185qefn1.js +2 -0
  4. package/bin/chunk-1kw2mbqb.js +1 -0
  5. package/bin/chunk-1wm6ptdx.js +1 -0
  6. package/bin/chunk-1yacmegc.js +2 -0
  7. package/bin/chunk-2291ehh5.js +3 -0
  8. package/bin/chunk-2520aq8j.js +2 -0
  9. package/bin/chunk-29zdp63z.js +3 -0
  10. package/bin/chunk-2yxj593j.js +2 -0
  11. package/bin/chunk-32pcmaqm.js +3 -0
  12. package/bin/chunk-3a13dcs1.js +1 -0
  13. package/bin/chunk-3cyrcgm5.js +13 -0
  14. package/bin/chunk-3swpwb9v.js +1 -0
  15. package/bin/chunk-3wmcx2bv.js +2 -0
  16. package/bin/chunk-4r81ghg8.js +2 -0
  17. package/bin/chunk-4v5n0ayb.js +2 -0
  18. package/bin/chunk-5a8nt4me.js +1 -0
  19. package/bin/chunk-66hsjnw6.js +2 -0
  20. package/bin/chunk-6bhn1p8v.js +211 -0
  21. package/bin/chunk-6gg1ymer.js +2 -0
  22. package/bin/chunk-70c3xrgd.js +2 -0
  23. package/bin/chunk-7esm0hqb.js +2 -0
  24. package/bin/chunk-7fst8kdw.js +12 -0
  25. package/bin/chunk-83e12sjg.js +3 -0
  26. package/bin/chunk-87zxtf66.js +3 -0
  27. package/bin/chunk-8fmy5jtp.js +2 -0
  28. package/bin/chunk-8zqgaxvv.js +1 -0
  29. package/bin/chunk-9t1ne8xr.js +2 -0
  30. package/bin/chunk-a32vreya.js +2 -0
  31. package/bin/chunk-a3dmtt2j.js +1 -0
  32. package/bin/chunk-abt0azmv.js +2 -0
  33. package/bin/chunk-ag6p3mbf.js +2 -0
  34. package/bin/chunk-aqbrzx9z.js +1 -0
  35. package/bin/chunk-av1a8fqp.js +3 -0
  36. package/bin/chunk-awfwk64v.js +2 -0
  37. package/bin/chunk-b235azv4.js +45 -0
  38. package/bin/chunk-b9yrw9et.js +10 -0
  39. package/bin/chunk-bay038pj.js +2 -0
  40. package/bin/chunk-c007p0t8.js +299 -0
  41. package/bin/chunk-cak32x57.js +2 -0
  42. package/bin/chunk-ce8m4zeg.js +3 -0
  43. package/bin/chunk-ck8azecb.js +12 -0
  44. package/bin/chunk-cnxwmycy.js +6 -0
  45. package/bin/chunk-cqb415s6.js +5 -0
  46. package/bin/chunk-e2mvmq2m.js +1 -0
  47. package/bin/chunk-e7mqtkzn.js +2 -0
  48. package/bin/chunk-e99dv20z.js +3 -0
  49. package/bin/chunk-ea79xnn3.js +2 -0
  50. package/bin/chunk-ehc9adfz.js +2 -0
  51. package/bin/chunk-ejbvfj4r.js +1 -0
  52. package/bin/chunk-ekfem7kf.js +1 -0
  53. package/bin/chunk-etwkk0xh.js +1 -0
  54. package/bin/chunk-evrdd32b.js +2 -0
  55. package/bin/chunk-f15qyp41.js +1 -0
  56. package/bin/chunk-f3ehv01n.js +54 -0
  57. package/bin/chunk-fm6p03ad.js +2 -0
  58. package/bin/chunk-fxswt9hc.js +3 -0
  59. package/bin/chunk-fyha3r13.js +2 -0
  60. package/bin/chunk-g0vs7k2x.js +1 -0
  61. package/bin/chunk-g84z2w7v.js +16 -0
  62. package/bin/chunk-gk3eqd50.js +2 -0
  63. package/bin/chunk-h3tbf521.js +2 -0
  64. package/bin/chunk-h837fyed.js +2 -0
  65. package/bin/chunk-hfh0c082.js +2 -0
  66. package/bin/chunk-j20e0qsw.js +7 -0
  67. package/bin/chunk-j8fxp8ej.js +2 -0
  68. package/bin/chunk-jje8nj8h.js +3 -0
  69. package/bin/chunk-jy006gcv.js +7 -0
  70. package/bin/chunk-k7hss0bd.js +4 -0
  71. package/bin/chunk-m7m9d4fb.js +2 -0
  72. package/bin/chunk-n1jwdb0a.js +1 -0
  73. package/bin/chunk-p5gf1zdm.js +4 -0
  74. package/bin/chunk-pb1zf0vb.js +2 -0
  75. package/bin/chunk-pfgxggaj.js +11 -0
  76. package/bin/chunk-q16490pv.js +2 -0
  77. package/bin/chunk-q2bvyv39.js +8 -0
  78. package/bin/chunk-qf24e71w.js +2 -0
  79. package/bin/chunk-qh81zhg1.js +1 -0
  80. package/bin/chunk-qwp3kwbz.js +2 -0
  81. package/bin/chunk-qwqvt9v6.js +2 -0
  82. package/bin/chunk-qydeqgyj.js +5 -0
  83. package/bin/chunk-r7dty1tg.js +2 -0
  84. package/bin/chunk-rbj4fad9.js +32 -0
  85. package/bin/chunk-rhdxwebf.js +2 -0
  86. package/bin/chunk-rhh716z0.js +42 -0
  87. package/bin/chunk-rpywcvg1.js +3 -0
  88. package/bin/chunk-rza4ae5z.js +3 -0
  89. package/bin/chunk-sfx2588q.js +3 -0
  90. package/bin/chunk-sk4e6rb1.js +1 -0
  91. package/bin/chunk-t2n1dbgx.js +4 -0
  92. package/bin/chunk-tf28796q.js +2 -0
  93. package/bin/chunk-twdxayky.js +3 -0
  94. package/bin/chunk-v9b3w8q5.js +3 -0
  95. package/bin/chunk-v9w25rp2.js +2 -0
  96. package/bin/chunk-vgn5zcpv.js +3 -0
  97. package/bin/chunk-wfzqnpc1.js +3 -0
  98. package/bin/chunk-wry2hvrq.js +24 -0
  99. package/bin/chunk-x8f4defx.js +3 -0
  100. package/bin/chunk-xp59apdb.js +2 -0
  101. package/bin/chunk-xtf3c29c.css +1 -0
  102. package/bin/chunk-z3gkt8w1.js +3 -0
  103. package/bin/chunk-zehyn6vd.js +2 -0
  104. package/bin/chunk-zh6fqq44.js +1 -0
  105. package/bin/chunk-zmv8cg4s.js +8 -0
  106. package/bin/chunk-zqv0zhfb.js +3 -0
  107. package/bin/{pdf.worker.min-szxdj13d.mjs → pdf.worker.min-vf48er29.mjs} +14423 -13889
  108. package/bin/shumai-app.html +1 -1
  109. package/bin/shumai-app.js +630 -452
  110. package/package.json +18 -18
  111. package/prisma/migrations/20260904022457_add_agent_id_to_assets_and_audit_logs/migration.sql +17 -0
  112. package/prisma/migrations/20260906081230_default_denied_tools_delete_asset/migration.sql +15 -0
  113. package/prisma/schema.prisma +9 -0
  114. package/bin/chunk-082zg4nr.js +0 -307
  115. package/bin/chunk-09pe07g6.js +0 -7
  116. package/bin/chunk-0qdzjcny.js +0 -2
  117. package/bin/chunk-0z1p2pvf.js +0 -1
  118. package/bin/chunk-116p639c.js +0 -3
  119. package/bin/chunk-13ypr8v0.js +0 -8
  120. package/bin/chunk-16txy3r1.js +0 -2
  121. package/bin/chunk-1vs91e4q.js +0 -2
  122. package/bin/chunk-29e0mb43.js +0 -1
  123. package/bin/chunk-2a0egvsg.js +0 -1
  124. package/bin/chunk-2f35h4fn.js +0 -2
  125. package/bin/chunk-2jsjrqw4.js +0 -2
  126. package/bin/chunk-2q7ew7yz.js +0 -2
  127. package/bin/chunk-2sc2jxd3.js +0 -2
  128. package/bin/chunk-2vc6pw8q.js +0 -2
  129. package/bin/chunk-3gqdepkd.js +0 -12
  130. package/bin/chunk-44370df5.js +0 -4
  131. package/bin/chunk-44xtwvd7.js +0 -2
  132. package/bin/chunk-47r5b77s.js +0 -41
  133. package/bin/chunk-4azttb3w.js +0 -1
  134. package/bin/chunk-4ee336e3.js +0 -2
  135. package/bin/chunk-4k2d8w9w.js +0 -2
  136. package/bin/chunk-4yhd7bmp.js +0 -5
  137. package/bin/chunk-4yybby29.js +0 -2
  138. package/bin/chunk-5395g4kq.js +0 -4
  139. package/bin/chunk-5bkj2n94.js +0 -2
  140. package/bin/chunk-5c4h0t33.js +0 -2
  141. package/bin/chunk-6nrynqdw.js +0 -2
  142. package/bin/chunk-6tv7rm3x.js +0 -2
  143. package/bin/chunk-785kxysj.js +0 -68
  144. package/bin/chunk-78cxvbjd.js +0 -4
  145. package/bin/chunk-7g2k89gq.js +0 -2
  146. package/bin/chunk-7psq38hv.js +0 -1
  147. package/bin/chunk-7qzt5nhz.js +0 -3
  148. package/bin/chunk-7sf0gbbm.js +0 -2
  149. package/bin/chunk-7wvw67f3.js +0 -5
  150. package/bin/chunk-7xcyn1ba.js +0 -2
  151. package/bin/chunk-7zgvmn5q.js +0 -2
  152. package/bin/chunk-8pfgh13x.js +0 -4
  153. package/bin/chunk-8rcfhfq5.js +0 -3
  154. package/bin/chunk-8yt4m2pb.js +0 -2
  155. package/bin/chunk-90tbc5f4.js +0 -2
  156. package/bin/chunk-92yvt66q.js +0 -2
  157. package/bin/chunk-93v3tm93.js +0 -1
  158. package/bin/chunk-9f83pnfc.js +0 -2
  159. package/bin/chunk-a5b3aevg.js +0 -2
  160. package/bin/chunk-af6m9p1d.js +0 -2
  161. package/bin/chunk-ajryg2e2.js +0 -1
  162. package/bin/chunk-axb1f1ae.js +0 -2
  163. package/bin/chunk-b0cqsrse.js +0 -9
  164. package/bin/chunk-b27jgdsf.css +0 -1
  165. package/bin/chunk-bbar8rsh.js +0 -3
  166. package/bin/chunk-be9a7kc6.js +0 -2
  167. package/bin/chunk-bkbqvxfv.js +0 -65
  168. package/bin/chunk-bwyph9a0.js +0 -1
  169. package/bin/chunk-c43nmcfq.js +0 -2
  170. package/bin/chunk-c97vh5wb.js +0 -44
  171. package/bin/chunk-cerjktz2.js +0 -11
  172. package/bin/chunk-cyvx7gcx.js +0 -2
  173. package/bin/chunk-d6d1j7qq.js +0 -14
  174. package/bin/chunk-d9sh922y.js +0 -13
  175. package/bin/chunk-dbjc1vxt.js +0 -1
  176. package/bin/chunk-djkajvn7.js +0 -24
  177. package/bin/chunk-dyvmwafa.js +0 -2
  178. package/bin/chunk-ewge52nq.js +0 -3
  179. package/bin/chunk-f32kxe6c.js +0 -2
  180. package/bin/chunk-f4d3v0nc.js +0 -2
  181. package/bin/chunk-f8ysqfyv.js +0 -2
  182. package/bin/chunk-fcsar7p0.js +0 -2
  183. package/bin/chunk-gfdfkqrc.js +0 -6
  184. package/bin/chunk-gr30nssh.js +0 -1
  185. package/bin/chunk-gtwhwdbs.js +0 -1
  186. package/bin/chunk-gyaem1t4.js +0 -3
  187. package/bin/chunk-hk6tvf7b.js +0 -1
  188. package/bin/chunk-hmmzbyy1.js +0 -2
  189. package/bin/chunk-hx2mvd20.js +0 -3
  190. package/bin/chunk-hzz4hsss.js +0 -1
  191. package/bin/chunk-j10gz94w.js +0 -2
  192. package/bin/chunk-j5rx3x1q.js +0 -3
  193. package/bin/chunk-j9q9rjvd.js +0 -4
  194. package/bin/chunk-jw00fmkp.js +0 -67
  195. package/bin/chunk-k1f3gj25.js +0 -3
  196. package/bin/chunk-k20w9eaz.js +0 -3
  197. package/bin/chunk-kejt7kcr.js +0 -2
  198. package/bin/chunk-kkveddbn.js +0 -2
  199. package/bin/chunk-kryt6pg3.js +0 -1
  200. package/bin/chunk-ktvmxqfg.js +0 -5
  201. package/bin/chunk-m49g5tf4.js +0 -2
  202. package/bin/chunk-me3xj7na.js +0 -2
  203. package/bin/chunk-mgnxa0vy.js +0 -2
  204. package/bin/chunk-mgytr7nc.js +0 -3
  205. package/bin/chunk-mkb4dycy.js +0 -2
  206. package/bin/chunk-n21a21vx.js +0 -2
  207. package/bin/chunk-n8gsjwht.js +0 -3
  208. package/bin/chunk-nndzhn3n.js +0 -2
  209. package/bin/chunk-pcxjm1re.js +0 -2
  210. package/bin/chunk-pg00gkr4.js +0 -3
  211. package/bin/chunk-pn94h6x7.js +0 -3
  212. package/bin/chunk-pt51m9h1.js +0 -2
  213. package/bin/chunk-px2cvc1n.js +0 -2
  214. package/bin/chunk-q059y3wx.js +0 -2
  215. package/bin/chunk-q46rc697.js +0 -3
  216. package/bin/chunk-r6g1srb3.js +0 -3
  217. package/bin/chunk-r88vwaxc.js +0 -1
  218. package/bin/chunk-r9pzpqst.js +0 -2
  219. package/bin/chunk-rar0gk7s.js +0 -3
  220. package/bin/chunk-rfrpb986.js +0 -1
  221. package/bin/chunk-rfsbzd39.js +0 -2
  222. package/bin/chunk-s503pcvb.js +0 -7
  223. package/bin/chunk-s9sgkkjp.js +0 -2
  224. package/bin/chunk-srs9jq8f.js +0 -2
  225. package/bin/chunk-t77dwtcc.js +0 -2
  226. package/bin/chunk-tcqw0q8x.js +0 -45
  227. package/bin/chunk-thd9zasr.js +0 -1
  228. package/bin/chunk-tkgpc6c9.js +0 -2
  229. package/bin/chunk-ts10cfmc.js +0 -2
  230. package/bin/chunk-txkmks1h.js +0 -3
  231. package/bin/chunk-v9hbssqd.js +0 -3
  232. package/bin/chunk-v9zc56qr.js +0 -1
  233. package/bin/chunk-vh7eb7tp.js +0 -6
  234. package/bin/chunk-w9p59ahz.js +0 -73
  235. package/bin/chunk-wfee9d83.js +0 -12
  236. package/bin/chunk-wxsq9zmf.js +0 -3
  237. package/bin/chunk-wzdnsgwq.js +0 -2
  238. package/bin/chunk-x2nnv4j8.js +0 -1
  239. package/bin/chunk-xxtcmzcv.js +0 -2
  240. package/bin/chunk-xyzmew7g.js +0 -2
  241. package/bin/chunk-ygsbmfcy.js +0 -2
  242. package/bin/chunk-ym9xavj0.js +0 -7
  243. package/bin/chunk-z340qkez.js +0 -8
  244. package/bin/chunk-za7ga4bf.js +0 -3
  245. package/bin/chunk-zqvavykq.js +0 -2
  246. package/bin/chunk-zt15ht52.js +0 -2
  247. /package/bin/{chunk-24ke0th1.css → chunk-kegybs91.css} +0 -0
@@ -1,3 +0,0 @@
1
- import{Di as w,Ii as F,Yi as q}from"./chunk-s503pcvb.js";var z=null,u=w((J)=>({projectState:null,setProjectState:(D)=>{if(z)clearTimeout(z),z=null;J({projectState:D})},clearProjectState:()=>{if(z)clearTimeout(z);z=setTimeout(()=>{J({projectState:null}),z=null},10)}}));var T="shumai_selected_agent_id",M=()=>{if(typeof window<"u"&&window.localStorage)return localStorage.getItem(T);return null},K=w((J)=>({isChatbotOpen:!1,setIsChatbotOpen:(D)=>J({isChatbotOpen:D}),isHistoryMode:!1,setIsHistoryMode:(D)=>J({isHistoryMode:D}),currentSessionId:null,setCurrentSessionId:(D)=>J({currentSessionId:D}),chatAssets:[],addAssets:(D)=>J((H)=>{let L=new Set(H.chatAssets.map((W)=>W.id)),Q=D.filter((W)=>!L.has(W.id));return{chatAssets:[...H.chatAssets,...Q]}}),removeAsset:(D)=>J((H)=>({chatAssets:H.chatAssets.filter((L)=>L.id!==D)})),clearAssets:()=>J({chatAssets:[]}),messages:[],setMessages:(D)=>J({messages:D}),historySessions:[],setHistorySessions:(D)=>J({historySessions:D}),isStreaming:!1,setIsStreaming:(D)=>J({isStreaming:D}),selectedAgentId:M(),setSelectedAgentId:(D)=>{if(typeof window<"u"&&window.localStorage)if(D)localStorage.setItem(T,D);else localStorage.removeItem(T);J({selectedAgentId:D})},inputText:"",setInputText:(D)=>J({inputText:D}),scrollTop:0,isAtBottom:!0,setScrollState:(D,H)=>J({scrollTop:D,isAtBottom:H}),fetchHistorySessions:async(D)=>{try{let H=await F.api.teams[":teamId"].chat.sessions.$get({param:{teamId:D},query:{first:"50"}});if(H.ok){let L=await H.json();J({historySessions:L.data||[]})}}catch(H){console.error("Failed to fetch history sessions:",H)}},loadSession:async(D,H)=>{try{let L=await F.api.teams[":teamId"].chat.sessions[":sessionId"].messages.$get({param:{teamId:D,sessionId:H}});if(L.ok){let Q=await L.json(),V=K.getState().historySessions.find((P)=>P.id===H)?.agentId||null;J({currentSessionId:H,messages:Q,isHistoryMode:!1,scrollTop:0,isAtBottom:!0,...V?{selectedAgentId:V}:{}})}else throw Error("Failed to load session messages")}catch(L){let Q=L instanceof Error?L.message:"Failed to load session";q.error(Q)}},deleteSession:async(D,H)=>{try{if((await F.api.teams[":teamId"].chat.sessions[":sessionId"].$delete({param:{teamId:D,sessionId:H}})).ok)q.success("Session deleted successfully"),J((Q)=>({historySessions:Q.historySessions.filter((W)=>W.id!==H),currentSessionId:Q.currentSessionId===H?null:Q.currentSessionId,messages:Q.currentSessionId===H?[]:Q.messages}));else throw Error("Failed to delete session")}catch(L){let Q=L instanceof Error?L.message:"Failed to delete session";q.error(Q)}},startNewSession:()=>{let D=M();J({currentSessionId:null,messages:[],chatAssets:[],inputText:"",scrollTop:0,isAtBottom:!0,...D?{selectedAgentId:D}:{}})},sendMessage:async(D,H,L,Q,W)=>{let V=K.getState();if(V.isStreaming)return;let P=`temp-${Date.now()}`,b={id:P,role:"user",content:[{type:"text",text:H}],timestamp:Date.now()},v=[...V.messages];if(V.chatAssets.length>0){let B={id:`temp-context-${Date.now()}`,role:"custom",customType:"context_display_info",details:{assets:V.chatAssets.map((U)=>({id:U.id,name:U.name,type:U.type}))},timestamp:Date.now()-1};v.push(B)}v.push(b),J({messages:v,isStreaming:!0,chatAssets:[],isAtBottom:!0});let p=V.chatAssets.map((Z)=>Z.id),h=V.selectedAgentId;if(!h){q.error("No agent selected");return}try{let Z=await F.api.teams[":teamId"].chat.$post({param:{teamId:D},json:{agentId:h,textPrompt:H,assetIds:p,sessionId:V.currentSessionId||void 0,contextAssetId:Q,projectId:L}});if(!Z.ok)throw Error("Failed to start chat");let B=Z.headers.get("x-session-id");if(B&&!V.currentSessionId)J({currentSessionId:B});let U=Z.body?.getReader();if(!U)throw Error("No stream body");let j=new TextDecoder,G="";while(!0){let{done:S,value:x}=await U.read();if(S)break;G+=j.decode(x,{stream:!0});let C=G.split(`
2
- `);G=C.pop()||"";for(let A of C){let N=A.trim();if(!N)continue;if(N.startsWith("data: ")){let y=N.slice(6);try{let $=JSON.parse(y);if($.type==="session"){if(!K.getState().currentSessionId)J({currentSessionId:$.sessionId})}else if($.type==="entry"){let X=$.entry,Y=X;if(Y.role==="toolResult"&&typeof Y.toolName==="string"&&["create_file","create_folder","create_version"].includes(Y.toolName)&&!Y.isError)W?.();J((_)=>{let R=_.messages.some((k)=>k.id===X.id),l=(X.role==="user"||X.role==="custom"&&X.customType==="shumai_message")&&!R,O=_.messages.filter((k)=>{if(l)return!k.id.startsWith("temp-");if(X.role==="custom"&&X.customType==="context_display_info"&&!R)return!k.id.startsWith("temp-context-");return!0}),f=O.findIndex((k)=>k.id===X.id);if(f!==-1){let k=[...O];return k[f]=X,{messages:k}}else return{messages:[...O,X]}})}else if($.type==="done"){if($.status==="failed")q.error($.error||"Workflow failed")}}catch($){console.error("Error parsing SSE line:",$)}}}}K.getState().fetchHistorySessions(D)}catch(Z){let B=Z instanceof Error?Z.message:"Failed to send message";q.error(B),J((U)=>({messages:U.messages.filter((j)=>j.id!==P)}))}finally{J({isStreaming:!1})}},abortActiveSession:async(D)=>{let{currentSessionId:H,isStreaming:L}=K.getState();if(!H||!L)return;try{if((await F.api.teams[":teamId"].chat.sessions[":sessionId"].abort.$post({param:{teamId:D,sessionId:H}})).ok)q.success("Agent execution stopped");else throw Error("Failed to abort agent execution")}catch(Q){let W=Q instanceof Error?Q.message:"Failed to abort execution";q.error(W)}}}));
3
- export{u as eg,K as fg};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function f(b){return b.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"")}
3
- export{f as en};
@@ -1,2 +0,0 @@
1
- import{Wl as i,Xl as u,bj as o,mm as n}from"./chunk-w9p59ahz.js";function m({className:t,orientation:a="horizontal",...r}){return o(n.Root,{"data-slot":"tabs","data-orientation":a,orientation:a,className:i("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...r})}var g=u("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function x({className:t,variant:a="default",...r}){return o(n.List,{"data-slot":"tabs-list","data-variant":a,className:i(g({variant:a}),t),...r})}function y({className:t,...a}){return o(n.Trigger,{"data-slot":"tabs-trigger",className:i("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function h({className:t,...a}){return o(n.Content,{"data-slot":"tabs-content",className:i("flex-1 outline-none",t),...a})}var b=/\.(png|jpe?g|webp|gif|svg|avif|bmp|ico)$/i;function k(t){if(!t)return!1;return b.test(t)}function z(t,a){if(!t||t.length===0)return null;let r=[...t].sort((e,d)=>{let p=e.width??0;return(d.width??0)-p}),s=r.filter((e)=>(e.width??0)>=a);if(s.length>0)return s.sort((e,d)=>{let p=e.width??0,l=d.width??0;return p-l}),s[0];return r[0]}
2
- export{m as zf,x as Af,y as Bf,h as Cf,k as Df,z as Ef};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$d as D,Ad as c,Bd as d,Cd as e,Dd as f,Ed as g,Fd as h,Gd as i,Hd as j,Id as k,Jd as l,Kd as m,Ld as n,Md as o,Nd as p,Od as q,Pd as r,Qd as s,Rd as t,Sd as u,Td as v,Ud as w,Vd as x,Wd as y,Xd as z,Yd as A,Zd as B,_d as C,ae as E,be as F,ce as G,de as H,ee as I,fe as J,ge as K,he as L,xd as a,zd as b}from"./chunk-vh7eb7tp.js";import"./chunk-txkmks1h.js";export{r as jwtVerify,s as jwtDecrypt,E as jwksCache,d as importX509,c as importSPKI,e as importPKCS8,f as importJWK,K as generateSecret,J as generateKeyPair,q as generalVerify,l as generalDecrypt,o as flattenedVerify,j as flattenedDecrypt,g as exportSPKI,h as exportPKCS8,i as exportJWK,b as errors,H as decodeProtectedHeader,I as decodeJwt,D as customFetch,L as cryptoRuntime,F as createRemoteJWKSet,C as createLocalJWKSet,p as compactVerify,k as compactDecrypt,A as calculateJwkThumbprintUri,z as calculateJwkThumbprint,a as base64url,G as UnsecuredJWT,x as SignJWT,w as GeneralSign,n as GeneralEncrypt,u as FlattenedSign,m as FlattenedEncrypt,y as EncryptJWT,B as EmbeddedJWK,v as CompactSign,t as CompactEncrypt};
@@ -1 +0,0 @@
1
- // @bun
@@ -1,5 +0,0 @@
1
- import{Ah as e}from"./chunk-bkbqvxfv.js";import{Wl as _,ak as pe,am as F,bj as m,fm as f}from"./chunk-w9p59ahz.js";var g={human:"human",agent:"agent"};var k={editor:"editor",reviewer:"reviewer"};var G={team:"team",project:"project"};var V={all_members:"all_members",each_member:"each_member",selected_members:"selected_members"};var W={agent_total_tokens:"agent_total_tokens",agent_cost:"agent_cost",agent_mcp_call_count:"agent_mcp_call_count",agent_bash_call_count:"agent_bash_call_count",agent_tool_call_count:"agent_tool_call_count"},c={TODO:"TODO",READY:"READY",IN_PROGRESS:"IN_PROGRESS",BLOCKED:"BLOCKED",IN_REVIEW:"IN_REVIEW",DONE:"DONE"},d={LOW:"LOW",MEDIUM:"MEDIUM",HIGH:"HIGH",URGENT:"URGENT"},y={CREATED:"CREATED",STATUS_CHANGED:"STATUS_CHANGED",ASSIGNED:"ASSIGNED",UNASSIGNED:"UNASSIGNED",COMMENTED:"COMMENTED",CHANGES_REQUESTED:"CHANGES_REQUESTED",BLOCKED:"BLOCKED",UNBLOCKED:"UNBLOCKED",PRIORITY_CHANGED:"PRIORITY_CHANGED",GOAL_CHANGED:"GOAL_CHANGED",DEPENDENCY_ADDED:"DEPENDENCY_ADDED",DEPENDENCY_REMOVED:"DEPENDENCY_REMOVED"},B={chat:"chat",autofill:"autofill",embedding:"embedding"};var u=e.object({cursor:e.string().optional(),total:e.number().optional(),totalSize:e.number().optional()}),p=e.object({first:e.coerce.number().optional(),after:e.string().optional()});var ct=e.object({name:e.string()}),ce=e.object({id:e.string(),name:e.string(),rootFolder:e.string().optional(),updatedAt:e.union([e.string(),e.date()])});var lt=e.object({data:e.array(ce),pageInfo:u}),mt=e.object({teamId:e.string(),userId:e.string()}),ut=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()}),dt=e.object({name:e.string().optional(),imageKey:e.string().nullable().optional()}),ft=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),email:e.string().optional(),type:e.nativeEnum(g).optional(),image:e.string().optional(),scope:e.nativeEnum(G).optional()}),gt=e.object({includeAgents:e.string().optional().transform((t)=>t==="true")}),le={best_match:"best_match",all:"all"},me={off:"off",auto:"auto"},yt=e.union([e.object({key:e.literal("transcode.videoStrategy"),value:e.nativeEnum(le)}),e.object({key:e.literal("transcode.hardwareAcceleration"),value:e.nativeEnum(me)})]),bt=e.object({networkSandboxEnabled:e.boolean(),allowedDomains:e.array(e.string()),pendingDomains:e.array(e.string()).default([])}),ht=e.object({networkSandboxEnabled:e.boolean().optional(),allowedDomains:e.array(e.string()).optional(),pendingDomains:e.array(e.string()).optional()}),St=e.object({role:e.enum(["editor","reviewer"])});var H=e.nativeEnum(B),Z=e.enum(["off","minimal","low","medium","high","xhigh"]),R=e.enum(["owner","editor","reviewer"]),ue=e.object({id:e.string().optional(),skillId:e.string(),skill:e.object({id:e.string(),name:e.string()}).optional()}),Rt=e.object({id:e.string(),name:e.string(),type:H,enabled:e.boolean(),permission:R.optional().default("reviewer"),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:Z.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(ue).optional(),mcpServerIds:e.array(e.string()).optional(),deniedTools:e.array(e.string()).optional()}),Y=e.object({name:e.string().min(1),type:H,enabled:e.boolean().optional().default(!0),permission:R.optional(),avatar:e.string().optional(),providerId:e.string().optional(),modelId:e.string().optional(),thinkingLevel:Z.optional().default("off"),systemPrompt:e.string().optional(),soul:e.string().optional(),skills:e.array(e.string()).optional(),mcpServerIds:e.array(e.string()).optional(),deniedTools:e.array(e.string()).optional()}),It=Y.superRefine((t,a)=>{if(t.type==="chat"||t.type==="autofill"){if(!t.providerId)a.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!t.modelId)a.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),Tt=Y.superRefine((t,a)=>{if(t.type==="chat"||t.type==="autofill"){if(!t.providerId)a.addIssue({code:e.ZodIssueCode.custom,message:"providerId is required for chat/autofill agents",path:["providerId"]});if(!t.modelId)a.addIssue({code:e.ZodIssueCode.custom,message:"modelId is required for chat/autofill agents",path:["modelId"]})}}),vt=e.object({permission:R}),jt=e.object({id:e.string(),sessionId:e.string(),entry:e.unknown()}),qt=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 Ct=e.object({apiKey:e.string().optional(),baseUrl:e.string().optional(),chatModels:e.array(e.string()).optional()}),de=e.enum(["1h","24h","7d","30d"]),Mt=e.object({timeframe:de.default("30d"),userId:e.string().optional()});var Kt=e.object({data:e.array(e.lazy(()=>he)),pageInfo:u}),J=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()}),fe=e.object({type:e.string().nullable(),preview:J.nullable()}),b=e.object({id:e.string(),name:e.string(),image:e.string().optional()}),ge=e.object({fieldId:e.string(),value:e.any()}),ye=e.object({id:e.string(),name:e.string()}),be=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()}),he=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(fe).optional(),preview:J.nullable().optional(),createdAt:e.string(),updatedAt:e.string(),deletedAt:e.string().nullable().optional(),projectId:e.string().optional().nullable(),creator:b.nullable().optional(),fieldValues:e.array(ge).optional(),sortIndex:e.string().optional().nullable(),startTime:e.number().optional().nullable(),endTime:e.number().optional().nullable(),hasAgentsMd:e.boolean().optional(),media:e.object({original:e.object({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()})).optional(),imageTranscodes:e.array(e.object({id:e.string(),url:e.string(),key:e.string(),width:e.number(),height:e.number(),size:e.number()})).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:be.optional()}).optional(),ancestorFolders:e.array(ye).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(),createdAt:e.string().optional().nullable(),creator:e.object({id:e.string(),name:e.string().nullable(),image:e.string().optional().nullable()}).nullable().optional()}))}).optional().nullable()}),wt=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()}),Qt=e.object({assetId:e.string()}),Lt=e.object({id:e.string(),name:e.string()}),I=e.enum(["file","folder","all"]),Ot=e.object({assetId:e.string().optional(),assetType:I.optional().default("all"),projectId:e.string().optional(),showDeleted:e.boolean().optional(),prefix:e.string().optional(),sort:e.string().optional(),order:e.string().optional(),...p.shape}),Ft=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())}),Se=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:b,replies:e.array(e.lazy(()=>_e)),attachments:e.array(Se),mentions:e.array(b),createdAt:e.string(),updatedAt:e.string(),sessionId:e.string().nullable(),isCompleted:e.boolean(),completionLastChangedBy:b.nullable()}),Gt=e.object({isCompleted:e.boolean()}),Vt=e.object({newParentId:e.string(),assetIds:e.array(e.string()),creatorId:e.string().optional()}),Wt=e.object({newParentId:e.string(),assetIds:e.array(e.string()),withComments:e.boolean().default(!1),creatorId:e.string().optional()}),Bt=e.object({name:e.string()}),Ht=e.object({beforeIndex:e.string().optional(),afterIndex:e.string().optional()}),Zt=e.object({ids:e.array(e.string())}),Yt=e.object({ids:e.array(e.string())}),Jt=e.object({file:e.instanceof(File)}),$t=e.object({key:e.string()}),Xt=e.object({fileName:e.string(),contentType:e.string(),size:e.number()}),At=e.object({id:e.string(),uploadUrl:e.string()}),zt=e.object({ids:e.array(e.string())}),xe=e.object({id:e.string(),name:e.string(),url:e.string()}),eo=e.object({files:e.array(xe)});var ro=e.object({userCount:e.number()}),ao=e.object({name:e.string().min(1,"Name is required").max(100,"Name is too long")}),no=e.object({id:e.string(),token:e.string(),name:e.string(),createdAt:e.string()});var ke=e.enum(["is","eq","neq","gt","gte","lt","lte","contains","notContains","isEmpty","isNotEmpty","in","notIn","hasAny","hasAll","hasNone","isWithin"]),Re=e.object({field:e.string(),operator:ke,value:e.any()}),Ie=e.enum(["asc","desc"]),Te=e.object({field:e.string(),order:Ie}),ve=e.enum(["AND","OR"]),je=e.enum(["file","folder"]),T=e.object({operator:ve.optional().default("AND"),conditions:e.array(Re).optional().default([]),sort:Te.optional(),assetType:je.optional(),showSymlink:e.boolean().optional(),recursively:e.boolean().optional().default(!0),query:e.string().optional(),isSemantic:e.boolean().optional().default(!1)}),co=T.extend(p.shape);var v=e.object({sourceFolderId:e.string(),searchFilter:T}),qe=e.object({id:e.string(),name:e.string(),filter:v,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()}),go=e.object({name:e.string(),filter:v}),yo=e.object({name:e.string().optional(),filter:v.optional()});var bo=e.object({data:e.array(qe),pageInfo:e.object({cursor:e.string().optional(),total:e.number().optional()})});var _o=e.object({name:e.string(),parentId:e.string()}),xo=e.object({name:e.string()}),ko=e.object({ids:e.array(e.string())}),Ro=e.object({ids:e.array(e.string())}),Io=e.object({content:e.string().max(1e5)});var qo=e.object({code:e.string(),role:e.string(),teamId:e.string(),teamName:e.string(),projectId:e.string().optional(),projectName:e.string().optional(),inviterName:e.string(),isUsed:e.boolean()}),Po=e.object({role:e.nativeEnum(k)}),Eo=e.object({role:e.nativeEnum(k)}),Co=e.object({code:e.string()});var Ko={text:"text",longText:"longText",select:"select",selectMulti:"selectMulti",rating:"rating",number:"number",toggle:"toggle",date:"date",user:"user",userMulti:"userMulti"},Pe={NONE:"NONE",CONTENT:"CONTENT",CREATION_CONTEXT:"CREATION_CONTEXT"},wo=e.object({id:e.string(),displayName:e.string(),color:e.string().optional()}),j=e.object({name:e.string(),type:e.enum(["text","longText","select","selectMulti","rating","number","toggle","date","user","userMulti"]),autofillSource:e.nativeEnum(Pe).optional(),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()}),Qo=e.object({key:e.string().optional(),label:e.string().optional(),scope:e.string().optional(),config:j,description:e.string().default("")}),Lo=e.object({label:e.string().optional(),config:j,description:e.string().optional()}),Ee=e.object({fieldId:e.string(),visible:e.boolean()}),Oo=e.array(Ee),Ce=e.object({key:e.string(),value:e.any()}),Fo=e.array(Ce),Go=e.object({id:e.string(),config:j,scope:e.string(),readOnly:e.boolean(),visible:e.boolean(),description:e.string()});var $=e.enum(["auto","none","bearer","oauth"]),q=e.enum(["streamable_http","sse"]),h=e.enum(["owner","editor","reviewer"]),Me=e.object({grantType:e.enum(["authorization_code","client_credentials"]).optional(),clientId:e.string().optional(),clientSecret:e.string().optional(),scope:e.string().optional(),authorizationParams:e.record(e.string(),e.string()).optional(),redirectUri:e.string().optional(),clientName:e.string().optional(),clientUri:e.string().optional(),skipIssuerMetadataValidation:e.boolean().optional()}),X=e.object({type:$.optional(),bearerToken:e.string().optional(),headers:e.record(e.string(),e.string()).optional(),oauth:Me.optional()}),P=e.object({excludeTools:e.array(e.string()).optional(),requestTimeoutMs:e.number().int().positive().optional(),idleTimeoutMs:e.number().int().positive().optional(),keepAlive:e.boolean().optional(),protocolVersion:e.enum(["legacy","auto","2026-07-28"]).optional(),directTools:e.array(e.string()).optional()}),De=e.object({name:e.string(),title:e.string().optional(),description:e.string().optional(),inputSchema:e.unknown().optional()}),Bo=e.object({url:e.string().url(),transport:q.optional(),authConfig:X.optional(),config:P.optional(),permission:h.optional()}),Ho=e.object({transport:q.optional(),authConfig:X.optional(),config:P.optional(),permission:h.optional()}),Zo=e.object({permission:h}),Ue=e.object({id:e.string(),name:e.string(),description:e.string().optional(),instructions:e.string().optional(),url:e.string(),transport:q,authType:$,config:P.optional(),permission:h,status:e.string(),lastError:e.string().nullable().optional(),toolCount:e.number(),hasCredential:e.boolean(),createdAt:e.string(),updatedAt:e.string()}),Yo=e.object({servers:e.array(Ue)}),Jo=e.object({}),$o=e.object({tools:e.array(De)}),A=e.enum(["authenticated","expired","not_authenticated","in_progress"]),Xo=e.object({status:A}),Ao=e.object({authorizationUrl:e.string().optional(),status:A}),zo=e.object({code:e.string(),iss:e.string().optional()}),er=e.object({ok:e.boolean(),toolCount:e.number(),message:e.string().optional()});var z=e.object({id:e.string().optional(),name:e.string().optional(),role:e.string().optional()}),ee=e.object({id:e.string().optional(),name:e.string().optional()}),Ne=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()}),Ke=e.object({id:e.string().optional(),title:e.string().optional(),status:e.string().optional()}),rr=e.object({id:e.string().optional(),creator:z.optional(),type:e.string().optional(),team:ee.optional(),project:ee.optional(),asset:Ne.optional(),kanbanTask:Ke.optional(),user:z.optional(),createdAt:e.string().optional(),isRead:e.boolean().optional()}),ar=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()}),nr=e.object({notificationId:e.string().min(1)}),sr=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),kanbanTasks:e.boolean().default(!0),kanbanComments:e.boolean().default(!0)});var ur=e.object({name:e.string(),coverImageKey:e.string().optional(),enableNotification:e.boolean().default(!0)}),dr=e.object({name:e.string().optional(),coverImageKey:e.string().optional(),enableNotification:e.boolean().optional()}),we=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()])}),fr=e.object({sortBy:e.string().optional(),sortDirection:e.enum(["asc","desc"]).optional()}).merge(p),gr=e.object({data:e.array(we),pageInfo:u}),yr=e.object({teamId:e.string()}),br=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),type:e.nativeEnum(g).optional(),image:e.string().optional(),scope:e.enum(["team","project"]).optional(),hasCustomRole:e.boolean().optional()}),hr=e.object({assetType:I.optional().default("all"),sort:e.enum(["createdAt","name","size"]).optional(),order:e.enum(["asc","desc"]).optional()}).merge(p),Sr=e.object({role:e.enum(["editor","reviewer"])}),_r=e.object({userId:e.string(),role:e.enum(["owner","editor","reviewer"])}),xr=e.object({id:e.string(),name:e.string(),role:e.enum(["owner","editor","reviewer","bot","unknown"]),image:e.string().optional()});var te=["openai-completions","mistral-conversations","openai-responses","azure-openai-responses","openai-codex-responses","anthropic-messages","bedrock-converse-stream","google-generative-ai","google-vertex"],Qe=e.object({api:e.enum(te).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)})}),E=e.object({id:e.string().optional(),modelId:e.string().min(1,"Model ID is required"),name:e.string().min(0).default(""),config:Qe}),C=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(te),headers:e.record(e.string(),e.string()).optional(),authHeader:e.boolean().optional()}),Ir=e.object({name:e.string().min(1,"Provider name is required"),config:C,models:e.array(E).min(1,"At least one model is required")}),Tr=e.object({config:C,models:e.array(E).min(1,"At least one model is required")}),vr=e.object({id:e.string(),name:e.string(),isBuiltin:e.boolean(),config:C,models:e.array(E).optional(),modelsCount:e.number().optional(),createdAt:e.date(),updatedAt:e.date()});var Er=e.object({name:e.string().min(1),expireAt:e.string().datetime().optional(),password:e.string().optional(),isDisabled:e.boolean().optional(),allowDownload:e.boolean().optional(),defaultSortOrder:e.string().optional(),viewMode:e.string().optional()}),Cr=e.object({name:e.string().min(1).optional(),expireAt:e.string().datetime().optional().nullable(),password:e.string().optional().nullable(),isDisabled:e.boolean().optional(),allowDownload:e.boolean().optional(),defaultSortOrder:e.string().optional().nullable(),viewMode:e.string().optional().nullable(),fieldVisibility:e.record(e.string(),e.boolean()).optional().nullable()}),Mr=p.extend({projectId:e.string().optional()}),Dr=e.object({assetIds:e.array(e.string().min(1)).min(1)});var Kr=e.object({assetId:e.string().optional(),githubUrl:e.string().optional(),override:e.boolean().optional()}),wr=e.object({config:e.object({environmentVariables:e.array(e.object({name:e.string(),default:e.string().optional()}))})}),Qr=e.object({permission:e.enum(["owner","editor","reviewer"])});var oe=e.lazy(()=>e.object({name:e.string(),id:e.string(),size:e.number(),children:e.array(oe),type:e.string(),mediaType:e.string().optional()})),Fr=e.object({parentId:e.string(),files:e.array(oe)}),Le=e.object({id:e.string(),fileId:e.string(),url:e.string()}),Gr=e.object({taskId:e.string(),presignedUrls:e.array(Le),createdAssets:e.array(e.object({tempId:e.string(),assetId:e.string()})).optional()}),Vr=e.object({fileId:e.string(),errorMessage:e.string().optional()}),Wr=e.object({id:e.string(),name:e.string(),total:e.number(),uploaded:e.number(),createdAt:e.string()}),Br=e.object({bucket:e.string(),key:e.string(),Signature:e.string()}),Hr=e.object({file:e.instanceof(File)});var Oe=e.object({key:e.string(),value:e.unknown()}),Jr=e.object({value:e.unknown()}),$r=e.array(Oe);var zr=e.object({fileIds:e.array(e.string())}),ea=e.object({fileId:e.string(),beforeId:e.string()}),ta=e.object({id:e.string(),version:e.number(),name:e.string().optional().nullable(),previewUrl:e.string().optional().nullable(),createdAt:e.string().optional().nullable(),creator:e.object({id:e.string(),name:e.string().nullable(),image:e.string().optional().nullable()}).nullable().optional()});var aa=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,a)=>{let n=t.textPrompt&&t.textPrompt.trim().length>0,r=t.attachedFiles&&t.attachedFiles.length>0,s=t.assetIds&&t.assetIds.length>0;if(!n&&!r&&!s)a.addIssue({code:e.ZodIssueCode.custom,message:"At least one of textPrompt, attachedFiles, or assetIds must be provided.",path:["textPrompt"]})}),na=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()}),Fe=e.object({id:e.string(),name:e.string(),type:e.string(),mediaType:e.enum(["image","video","pdf","audio","other"]).optional(),mimeType:e.string().optional(),parentId:e.string().optional(),path:e.string().optional(),durationSeconds:e.number().optional(),totalFrames:e.number().optional(),totalPages:e.number().optional(),navigated:e.boolean().optional(),ancestors:e.array(e.object({id:e.string(),name:e.string()})).optional()}),re=e.object({id:e.string(),name:e.string(),type:e.string(),mediaType:e.enum(["image","video","pdf","audio","other"]).optional(),mimeType:e.string().optional(),path:e.string().optional()}),Ge=e.discriminatedUnion("type",[e.object({type:e.literal("time"),seconds:e.number()}),e.object({type:e.literal("page"),page:e.number()})]),sa=e.object({user:e.object({id:e.string(),name:e.string(),role:e.string()}).optional(),currentAsset:Fe.optional(),position:Ge.optional(),annotation:e.boolean().optional(),attachedFiles:e.array(re).optional(),referencedAssets:e.array(re).optional()}),ia=e.intersection(e.object({id:e.string()}),e.unknown());var S;((o)=>{o.team_create="team_create";o.team_update="team_update";o.team_delete="team_delete";o.team_member_add="team_member_add";o.team_member_update="team_member_update";o.team_member_remove="team_member_remove";o.project_create="project_create";o.project_update="project_update";o.project_delete="project_delete";o.project_empty_trash="project_empty_trash";o.project_member_add="project_member_add";o.project_member_update="project_member_update";o.project_member_remove="project_member_remove";o.file_create="file_create";o.file_update="file_update";o.file_delete="file_delete";o.folder_create="folder_create";o.folder_update="folder_update";o.folder_delete="folder_delete";o.asset_reparent="asset_reparent";o.asset_copy="asset_copy";o.share_create="share_create";o.share_update="share_update";o.share_delete="share_delete";o.agent_create="agent_create";o.agent_update="agent_update";o.agent_delete="agent_delete";o.skill_create="skill_create";o.skill_update="skill_update";o.skill_delete="skill_delete";o.mcp_server_create="mcp_server_create";o.mcp_server_update="mcp_server_update";o.mcp_server_delete="mcp_server_delete";o.provider_create="provider_create";o.provider_update="provider_update";o.provider_delete="provider_delete";o.invite_create="invite_create";o.invite_revoke="invite_revoke";o.metadata_field_create="metadata_field_create";o.metadata_field_update="metadata_field_update";o.metadata_field_delete="metadata_field_delete";o.comment_create="comment_create";o.comment_update="comment_update";o.comment_delete="comment_delete";o.comment_complete="comment_complete";o.quota_rule_create="quota_rule_create";o.quota_rule_update="quota_rule_update";o.quota_rule_delete="quota_rule_delete";o.quota_record_reset="quota_record_reset";o.quota_policy_create="quota_policy_create";o.quota_policy_update="quota_policy_update";o.quota_policy_delete="quota_policy_delete";o.kanban_goal_create="kanban_goal_create";o.kanban_goal_update="kanban_goal_update";o.kanban_goal_delete="kanban_goal_delete";o.kanban_task_create="kanban_task_create";o.kanban_task_update="kanban_task_update";o.kanban_task_delete="kanban_task_delete";o.kanban_comment_create="kanban_comment_create";o.kanban_comment_delete="kanban_comment_delete";o.kanban_dependency_add="kanban_dependency_add";o.kanban_dependency_remove="kanban_dependency_remove"})(S||={});var Ve=e.object({id:e.string(),action:e.nativeEnum(S),teamId:e.string(),userId:e.string().nullable().optional(),projectId:e.string().nullable().optional(),itemId:e.string().nullable().optional(),createdAt:e.string()}),la=e.object({first:e.coerce.number().optional(),after:e.string().optional(),actions:e.union([e.nativeEnum(S),e.array(e.nativeEnum(S))]).transform((t)=>Array.isArray(t)?t:[t]).optional(),userIds:e.union([e.string(),e.array(e.string())]).transform((t)=>Array.isArray(t)?t:[t]).optional(),itemId:e.string().optional()}),ma=e.object({nodes:e.array(Ve),pageInfo:e.object({hasNextPage:e.boolean(),endCursor:e.string().nullable()}),total:e.number()});var We=e.object({id:e.string(),type:e.literal("text"),x:e.number().min(0).max(1),y:e.number().min(0).max(1),opacity:e.number().min(0).max(1),rotation:e.number().min(-180).max(180),text:e.string(),size:e.number().positive().max(1),color:e.string()}),Be=e.object({id:e.string(),type:e.literal("image"),x:e.number().min(0).max(1),y:e.number().min(0).max(1),opacity:e.number().min(0).max(1),rotation:e.number().min(-180).max(180),imageAssetKey:e.string().min(1),imageAssetUrl:e.string().optional(),size:e.number().positive().max(1)}),He=e.discriminatedUnion("type",[We,Be]),M=e.object({blocks:e.array(He)}),fa=e.object({name:e.string().min(1),teamId:e.string().optional(),config:M}),ga=e.object({name:e.string().min(1).optional(),config:M.optional()}),ya=e.object({enabled:e.boolean(),config:M.optional()}).superRefine((t,a)=>{if(t.enabled&&(!t.config||t.config.blocks.length===0))a.addIssue({code:"custom",path:["config"],message:"Watermark configuration is required when enabling watermark"})});var D=e.nativeEnum(V),U=e.enum(["1hour","5hour","1day","7day","one_hour","five_hours","one_day","seven_days"]);function xa(t){switch(t){case"one_hour":case"1hour":return"1hour";case"five_hours":case"5hour":return"5hour";case"one_day":case"1day":return"1day";case"seven_days":case"7day":return"7day";default:return t}}var N=e.nativeEnum(W),K=e.enum(["owner","editor","reviewer"]),ae=e.object({id:e.string().min(1,"MCP server ID is required")}),ne=e.object({match:e.string().min(1,"Bash match wildcard is required")}),se=e.object({name:e.string().min(1,"Tool name is required")}),w=e.record(e.string(),e.unknown()),Ze=e.object({id:e.string().nullable(),ruleId:e.string(),teamId:e.string(),userId:e.string().nullable().optional(),user:e.object({id:e.string(),name:e.string(),email:e.string(),image:e.string().nullable().optional()}).nullable().optional(),periodStart:e.string().nullable().optional(),periodEnd:e.string().nullable().optional(),consumed:e.number(),remaining:e.number(),percent:e.number(),isWindowActive:e.boolean()}),ka=e.object({records:e.array(Ze),total:e.number()}),Ye=e.object({id:e.string(),teamId:e.string(),scopeMode:D,role:K.nullable().optional(),userIds:e.array(e.string()).nullable().optional(),resource:N,resourceData:w.nullable().optional(),limit:e.number(),period:U,enabled:e.boolean(),recordsCount:e.number().optional(),createdAt:e.string(),updatedAt:e.string()}),Ra=e.object({rules:e.array(Ye),total:e.number()}),Ia=e.object({scopeMode:D,role:K.optional().nullable(),userIds:e.array(e.string()).optional().nullable(),resource:N,resourceData:w.optional().nullable(),limit:e.number().positive("Limit must be greater than 0"),period:U,enabled:e.boolean().optional().default(!0)}).superRefine((t,a)=>{if(t.scopeMode==="selected_members"){if(!t.userIds||t.userIds.length===0)a.addIssue({code:e.ZodIssueCode.custom,message:'userIds must contain at least one user when scopeMode is "selected_members"',path:["userIds"]})}if(t.resource==="agent_mcp_call_count"){if(!ae.safeParse(t.resourceData).success)a.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.id is required for agent_mcp_call_count",path:["resourceData","id"]})}else if(t.resource==="agent_bash_call_count"){if(!ne.safeParse(t.resourceData).success)a.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.match is required for agent_bash_call_count",path:["resourceData","match"]})}else if(t.resource==="agent_tool_call_count"){if(!se.safeParse(t.resourceData).success)a.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.name is required for agent_tool_call_count",path:["resourceData","name"]})}}),Ta=e.object({userId:e.string().nullable()}),va=e.object({scopeMode:D.optional(),role:K.optional().nullable(),userIds:e.array(e.string()).optional().nullable(),resource:N.optional(),resourceData:w.optional().nullable(),limit:e.number().positive("Limit must be greater than 0").optional(),period:U.optional(),enabled:e.boolean().optional()}).superRefine((t,a)=>{if(t.scopeMode==="selected_members"&&t.userIds!==void 0){if(!t.userIds||t.userIds.length===0)a.addIssue({code:e.ZodIssueCode.custom,message:'userIds must contain at least one user when scopeMode is "selected_members"',path:["userIds"]})}if(t.resource==="agent_mcp_call_count"&&t.resourceData!==void 0){if(!ae.safeParse(t.resourceData).success)a.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.id is required for agent_mcp_call_count",path:["resourceData","id"]})}else if(t.resource==="agent_bash_call_count"&&t.resourceData!==void 0){if(!ne.safeParse(t.resourceData).success)a.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.match is required for agent_bash_call_count",path:["resourceData","match"]})}else if(t.resource==="agent_tool_call_count"&&t.resourceData!==void 0){if(!se.safeParse(t.resourceData).success)a.addIssue({code:e.ZodIssueCode.custom,message:"resourceData.name is required for agent_tool_call_count",path:["resourceData","name"]})}});var Pa="unassigned",Ea=e.object({title:e.string().min(1),description:e.string().optional()}),Ca=e.object({title:e.string().min(1).optional(),description:e.string().nullable().optional()}),Je=e.object({id:e.string(),title:e.string(),description:e.string().nullable().optional(),teamId:e.string(),creatorId:e.string().nullable().optional(),taskCount:e.number().optional(),createdAt:e.union([e.string(),e.date()]),updatedAt:e.union([e.string(),e.date()])}),Ma=e.object({}),Da=e.object({data:e.array(Je)});var l=e.object({id:e.string(),name:e.string(),image:e.string().optional()}),$e=e.object({summary:e.string().optional(),blockReason:e.string().optional(),blockKind:e.string().optional(),reason:e.string().optional(),assets:e.array(e.object({id:e.string(),type:e.string().optional(),name:e.string().optional(),description:e.string().optional()})).optional()}).passthrough(),Q=e.object({id:e.string(),taskId:e.string(),actor:l.nullable().optional(),type:e.nativeEnum(y),fromStatus:e.nativeEnum(c).nullable().optional(),toStatus:e.nativeEnum(c).nullable().optional(),data:$e.nullable().optional(),createdAt:e.union([e.string(),e.date()])}),wa=e.object({data:e.array(Q)});var Xe=e.object({id:e.string(),name:e.string(),key:e.string(),sizeByte:e.number(),contentType:e.string().nullable().optional(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),Ae=e.object({id:e.string(),name:e.string(),sizeByte:e.number(),contentType:e.string().nullable().optional(),url:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),Fa=e.object({id:e.string(),name:e.string(),key:e.string(),sizeByte:e.number(),contentType:e.string().nullable().optional(),uploadUrl:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional()}),Ga=e.object({body:e.string().default(""),attachments:e.array(Xe).optional()}).refine((t)=>t.body.trim().length>0||t.attachments&&t.attachments.length>0,{message:"Comment body or attachments required"}),L=e.object({id:e.string(),taskId:e.string(),author:l,body:e.string(),attachments:e.array(Ae).default([]),createdAt:e.union([e.string(),e.date()]),updatedAt:e.union([e.string(),e.date()])}),Va=e.object({data:e.array(L)});var $a=e.object({title:e.string().min(1),description:e.string().optional(),isAgentTask:e.boolean().optional(),priority:e.nativeEnum(d).optional(),startDate:e.union([e.string(),e.date()]).optional(),dueDate:e.union([e.string(),e.date()]).optional(),goalId:e.string().optional(),projectId:e.string().optional(),reporterId:e.string().optional(),assigneeId:e.string().optional(),targetFolderId:e.string().optional(),parentIds:e.array(e.string()).optional(),assetIds:e.array(e.string()).optional()}),Xa=e.object({fromStatus:e.nativeEnum(c).optional(),title:e.string().min(1).optional(),description:e.string().nullable().optional(),status:e.nativeEnum(c).optional(),reason:e.string().optional(),priority:e.nativeEnum(d).optional(),startDate:e.union([e.string(),e.date()]).nullable().optional(),dueDate:e.union([e.string(),e.date()]).nullable().optional(),goalId:e.string().nullable().optional(),projectId:e.string().nullable().optional(),reporterId:e.string().nullable().optional(),assigneeId:e.string().nullable().optional(),targetFolderId:e.string().nullable().optional(),beforeIndex:e.string().optional(),afterIndex:e.string().optional(),parentIds:e.array(e.string()).optional(),assetIds:e.array(e.string()).optional()}),Aa=e.object({status:e.nativeEnum(c).optional(),isAgentTask:e.union([e.boolean(),e.string()]).transform((t)=>t===!0||t==="true").optional(),goalId:e.string().optional(),projectId:e.string().optional(),priority:e.nativeEnum(d).optional(),assigneeId:e.string().optional(),reporterId:e.string().optional()}).merge(p),ze=e.object({id:e.string(),type:e.nativeEnum(y),actor:l.nullable().optional(),summary:e.string().optional(),blockReason:e.string().optional(),blockKind:e.string().optional(),reason:e.string().optional(),createdAt:e.union([e.string(),e.date()])}),et=e.object({id:e.string(),title:e.string()}),ie=e.object({id:e.string(),title:e.string(),isAgentTask:e.boolean(),status:e.nativeEnum(c),priority:e.nativeEnum(d),sortIndex:e.string().nullable().optional()}),tt=e.object({id:e.string(),name:e.string(),type:e.string(),proxyType:e.enum(["image","video","audio","pdf"]).nullable().optional(),thumbnailUrl:e.string().nullable().optional(),path:e.string(),creator:l.nullable().optional(),sizeByte:e.number().optional(),fileCount:e.number().optional(),projectId:e.string().nullable().optional(),createdAt:e.union([e.string(),e.date()])}),O=e.object({id:e.string(),title:e.string(),description:e.string().nullable().optional(),isAgentTask:e.boolean(),status:e.nativeEnum(c),priority:e.nativeEnum(d),startDate:e.union([e.string(),e.date()]).nullable().optional(),dueDate:e.union([e.string(),e.date()]).nullable().optional(),startedAt:e.union([e.string(),e.date()]).nullable().optional(),completedAt:e.union([e.string(),e.date()]).nullable().optional(),teamId:e.string(),projectId:e.string().nullable().optional(),sortIndex:e.string().nullable().optional(),creator:l,reporter:l.nullable().optional(),assignee:l.nullable().optional(),goal:et.nullable().optional(),targetFolderId:e.string().nullable().optional(),latestStatusEvent:ze.nullable().optional(),commentCount:e.number().default(0),dependencyCount:e.number().default(0),dependentCount:e.number().default(0),assetCount:e.number().default(0),createdAt:e.union([e.string(),e.date()]),updatedAt:e.union([e.string(),e.date()])}),za=O.extend({dependencies:e.array(ie),dependents:e.array(ie),assets:e.array(tt),comments:e.array(L),events:e.array(Q)}),en=e.object({data:e.array(O),pageInfo:u}),tn=e.object({taskId:e.string()}),on=e.object({assetIds:e.array(e.string())}),rn=e.object({data:e.array(O),total:e.number()});var dn=e.object({assetId:e.string()});function ot(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function i(t,a){if(a===void 0||a===null)return"";return` ${t}="${ot(a)}"`}function gn(t){if(!t)return"";let a=[];if(t.user){let n="";if(t.user.id!==void 0)n+=i("id",t.user.id);if(t.user.name!==void 0)n+=i("name",t.user.name);if(t.user.role!==void 0)n+=i("role",t.user.role);if(n)a.push(` <user${n} />`)}if(t.currentAsset){let n=t.currentAsset,r="";if(n.id!==void 0)r+=i("id",n.id);if(n.name!==void 0)r+=i("name",n.name);if(n.type!==void 0)r+=i("type",n.type);if(n.mediaType!==void 0)r+=i("media_type",n.mediaType);if(n.mimeType!==void 0)r+=i("mime_type",n.mimeType);if(n.parentId!==void 0)r+=i("parent_id",n.parentId);if(n.path!==void 0)r+=i("path",n.path);if(n.durationSeconds!==void 0)r+=` duration_seconds="${n.durationSeconds.toFixed(2)}"`;if(n.totalFrames!==void 0)r+=` total_frames="${Math.round(n.totalFrames)}"`;if(n.totalPages!==void 0)r+=` total_pages="${Math.round(n.totalPages)}"`;if(n.navigated!==void 0)r+=` navigated="${String(n.navigated)}"`;if(n.ancestors&&n.ancestors.length>0){a.push(` <current_asset${r}>`),a.push(" <ancestors>");for(let s of n.ancestors){let x="";if(s.id!==void 0)x+=i("id",s.id);if(s.name!==void 0)x+=i("name",s.name);a.push(` <folder${x} />`)}a.push(" </ancestors>"),a.push(" </current_asset>")}else a.push(` <current_asset${r} />`)}if(t.position){if(t.position.type==="time")a.push(` <position type="time" seconds="${t.position.seconds.toFixed(2)}" />`);else if(t.position.type==="page")a.push(` <position type="page" page="${Math.round(t.position.page)}" />`)}if(t.annotation)a.push(" <annotation />");if(t.attachedFiles&&t.attachedFiles.length>0){let n=[...t.attachedFiles].sort((r,s)=>r.id.localeCompare(s.id));a.push(" <attached_files>");for(let r of n){let s="";if(r.id!==void 0)s+=i("id",r.id);if(r.name!==void 0)s+=i("name",r.name);if(r.type!==void 0)s+=i("type",r.type);if(r.mediaType!==void 0)s+=i("media_type",r.mediaType);if(r.mimeType!==void 0)s+=i("mime_type",r.mimeType);if(r.path!==void 0)s+=i("path",r.path);a.push(` <file${s} />`)}a.push(" </attached_files>")}if(t.referencedAssets&&t.referencedAssets.length>0){let n=[...t.referencedAssets].sort((r,s)=>r.id.localeCompare(s.id));a.push(" <referenced_assets>");for(let r of n)if(r.type==="folder"){let s="";if(r.id!==void 0)s+=i("id",r.id);if(r.name!==void 0)s+=i("name",r.name);if(r.path!==void 0)s+=i("path",r.path);a.push(` <folder${s} />`)}else{let s="";if(r.id!==void 0)s+=i("id",r.id);if(r.name!==void 0)s+=i("name",r.name);if(r.type!==void 0)s+=i("type",r.type);if(r.mediaType!==void 0)s+=i("media_type",r.mediaType);if(r.mimeType!==void 0)s+=i("mime_type",r.mimeType);if(r.path!==void 0)s+=i("path",r.path);a.push(` <asset${s} />`)}a.push(" </referenced_assets>")}if(a.length===0)return"";return`<context>
2
- ${a.join(`
3
- `)}
4
- </context>`}function Yn({...t}){return m(f.Root,{"data-slot":"popover",...t})}function Jn({...t}){return m(f.Trigger,{"data-slot":"popover-trigger",...t})}function $n({className:t,align:a="center",sideOffset:n=4,...r}){return m(f.Portal,{children:m(f.Content,{"data-slot":"popover-content",align:a,sideOffset:n,className:_("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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",t),...r})})}function os({className:t,...a}){return m(F.Root,{"data-slot":"checkbox",className:_("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-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-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",t),...a,children:m(F.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:m(pe,{className:"size-3.5"})})})}
5
- export{Yn as Nf,Jn as Of,$n as Pf,c as Qf,d as Rf,y as Sf,Z as Tf,Ko as Uf,Pe as Vf,te as Wf,E as Xf,C as Yf,le as Zf,me as _f,S as $f,xa as ag,Pa as bg,gn as cg,os as dg};
@@ -1,2 +0,0 @@
1
- import{og as A}from"./chunk-7xcyn1ba.js";import{Ii as z}from"./chunk-s503pcvb.js";import{bj as v,lj as w}from"./chunk-w9p59ahz.js";var B=(b)=>({queryKey:["projects",b],queryFn:async()=>{let h=await z.api.projects[":projectId"].$get({param:{projectId:b}});if(!h.ok)throw Error("Failed to fetch project");return await h.json()}}),H=w("/projects/$projectId/folders/$folderId_/agentsmd")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
2
- export{B as re,H as se};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Gm as F}from"./chunk-rar0gk7s.js";import{Jm as B,Km as A,Lm as b,Mm as h,Nm as x,Om as f,Pm as g}from"./chunk-8pfgh13x.js";import{Rm as N,Tm as v,Um as H}from"./chunk-c97vh5wb.js";import{Vm as K,Wm as y}from"./chunk-pn94h6x7.js";import{bn as I}from"./chunk-wxsq9zmf.js";import{en as C}from"./chunk-k20w9eaz.js";import{gn as T}from"./chunk-7qzt5nhz.js";import{ln as L,mn as P}from"./chunk-116p639c.js";import{nn as U}from"./chunk-q46rc697.js";import"./chunk-txkmks1h.js";var k="v1",u="gcp-vertex-credentials",c={THINKING_LEVEL_UNSPECIFIED:N.THINKING_LEVEL_UNSPECIFIED,MINIMAL:N.MINIMAL,LOW:N.LOW,MEDIUM:N.MEDIUM,HIGH:N.HIGH},s=0,V=(q,w,J)=>{let X=new U;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 z=e(J),$=z?l(q,z,J?.headers):p(q,o(J),qq(J),J?.headers,J?.env),R=wq(q,w,J),_=await J?.onPayload?.(R,q);if(_!==void 0)R=_;let d=await $.models.generateContentStream(R);X.push({type:"start",partial:Q});let Y=null,M=Q.content,D=()=>M.length-1;for await(let W of d){Q.responseId||=W.responseId;let G=W.candidates?.[0];if(G?.content?.parts)for(let Z of G.content.parts){if(Z.text!==void 0){let S=B(Z);if(!Y||S&&Y.type!=="thinking"||!S&&Y.type!=="text"){if(Y)if(Y.type==="text")X.push({type:"text_end",contentIndex:M.length-1,content:Y.text,partial:Q});else X.push({type:"thinking_end",contentIndex:D(),content:Y.thinking,partial:Q});if(S)Y={type:"thinking",thinking:"",thinkingSignature:void 0},Q.content.push(Y),X.push({type:"thinking_start",contentIndex:D(),partial:Q});else Y={type:"text",text:""},Q.content.push(Y),X.push({type:"text_start",contentIndex:D(),partial:Q})}if(Y.type==="thinking")Y.thinking+=Z.text,Y.thinkingSignature=A(Y.thinkingSignature,Z.thoughtSignature),X.push({type:"thinking_delta",contentIndex:D(),delta:Z.text,partial:Q});else Y.text+=Z.text,Y.textSignature=A(Y.textSignature,Z.thoughtSignature),X.push({type:"text_delta",contentIndex:D(),delta:Z.text,partial:Q})}if(Z.functionCall){if(Y){if(Y.type==="text")X.push({type:"text_end",contentIndex:D(),content:Y.text,partial:Q});else X.push({type:"thinking_end",contentIndex:D(),content:Y.thinking,partial:Q});Y=null}let S=Z.functionCall.id,j={type:"toolCall",id:!S||Q.content.some((O)=>O.type==="toolCall"&&O.id===S)?`${Z.functionCall.name}_${Date.now()}_${++s}`:S,name:Z.functionCall.name||"",arguments:Z.functionCall.args??{},...Z.thoughtSignature&&{thoughtSignature:Z.thoughtSignature}};Q.content.push(j),X.push({type:"toolcall_start",contentIndex:D(),partial:Q}),X.push({type:"toolcall_delta",contentIndex:D(),delta:JSON.stringify(j.arguments),partial:Q}),X.push({type:"toolcall_end",contentIndex:D(),toolCall:j,partial:Q})}}if(G?.finishReason){if(Q.stopReason=g(G.finishReason),Q.content.some((Z)=>Z.type==="toolCall"))Q.stopReason="toolUse"}if(W.usageMetadata)Q.usage={input:(W.usageMetadata.promptTokenCount||0)-(W.usageMetadata.cachedContentTokenCount||0),output:(W.usageMetadata.candidatesTokenCount||0)+(W.usageMetadata.thoughtsTokenCount||0),cacheRead:W.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:W.usageMetadata.thoughtsTokenCount||0,totalTokens:W.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},L(q,Q.usage)}if(Y)if(Y.type==="text")X.push({type:"text_end",contentIndex:D(),content:Y.text,partial:Q});else X.push({type:"thinking_end",contentIndex:D(),content:Y.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");X.push({type:"done",reason:Q.stopReason,message:Q}),X.end()}catch(z){for(let $ of Q.content)if("index"in $)delete $.index;Q.stopReason=J?.signal?.aborted?"aborted":"error",Q.errorMessage=y(K(z)),X.push({type:"error",reason:Q.stopReason,error:Q}),X.end()}})(),X},Gq=(q,w,J)=>{let X=I(q,w,J,void 0);if(!J?.reasoning)return V(q,w,{...X,thinking:{enabled:!1}});let Q=P(q,J.reasoning),z=Q==="off"?"high":Q,$=q;if(E($)||a($))return V(q,w,{...X,thinking:{enabled:!0,level:Qq(z,$)}});return V(q,w,{...X,thinking:{enabled:!0,budgetTokens:Xq($,z,J.thinkingBudgets)}})};function p(q,w,J,X,Q){let z=n(Q);return new H({vertexai:!0,project:w,location:J,apiVersion:k,...z?{googleAuthOptions:z}:{},httpOptions:m(q,X)})}function l(q,w,J){return new H({vertexai:!0,apiKey:w,apiVersion:k,httpOptions:m(q,J)})}function m(q,w){let J={},X=r(q.baseUrl);if(X){if(J.baseUrl=X,J.baseUrlResourceScope=v.COLLECTION,i(X))J.apiVersion=""}let Q=T({...q.headers,...w});if(Q)J.headers=Q;return Object.keys(J).length>0?J:void 0}function r(q){let w=q.trim();if(!w||w.includes("{location}"))return;return w}function i(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 n(q){let w=F("GOOGLE_APPLICATION_CREDENTIALS",q);return w?{keyFilename:w}:void 0}function e(q){let w=q?.apiKey?.trim();if(!w||w===u||t(w))return;return w}function t(q){return/^<[^>]+>$/.test(q)}function o(q){let w=q?.project||F("GOOGLE_CLOUD_PROJECT",q?.env)||F("GCLOUD_PROJECT",q?.env);if(!w)throw Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return w}function qq(q){let w=q?.location||F("GOOGLE_CLOUD_LOCATION",q?.env);if(!w)throw Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return w}function wq(q,w,J={}){let X=b(q,w),Q={};if(J.temperature!==void 0)Q.temperature=J.temperature;if(J.maxTokens!==void 0)Q.maxOutputTokens=J.maxTokens;let z=w.tools?.length?f(w.tools,J.toolChoice,x(q.id)):void 0,$={...Object.keys(Q).length>0&&Q,...w.systemPrompt&&{systemInstruction:C(w.systemPrompt)},...w.tools&&w.tools.length>0&&{tools:h(w.tools)},...z!==void 0&&{toolConfig:{functionCallingConfig:{mode:z}}}};if(J.thinking?.enabled&&q.reasoning){let _={includeThoughts:!0};if(J.thinking.level!==void 0)_.thinkingLevel=c[J.thinking.level];else if(J.thinking.budgetTokens!==void 0)_.thinkingBudget=J.thinking.budgetTokens;$.thinkingConfig=_}else if(q.reasoning&&J.thinking&&!J.thinking.enabled)$.thinkingConfig=Jq(q);if(J.signal){if(J.signal.aborted)throw Error("Request aborted");$.abortSignal=J.signal}return{model:q.id,contents:X,config:$}}function E(q){return/gemini-3(?:\.\d+)?-pro/.test(q.id.toLowerCase())}function a(q){let w=q.id.toLowerCase();return/gemini-3(?:\.\d+)?-flash/.test(w)||w==="gemini-flash-latest"||w==="gemini-flash-lite-latest"}function Jq(q){let w=q;if(E(w))return{thinkingLevel:N.LOW};if(a(w))return{thinkingLevel:N.MINIMAL};return{thinkingBudget:0}}function Qq(q,w){if(E(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 Xq(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{Gq as streamSimple,V as stream};
@@ -1,2 +0,0 @@
1
- async function q(j){if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText==="function")try{return await navigator.clipboard.writeText(j),!0}catch{}try{let h=document.createElement("textarea");h.value=j,h.style.position="fixed",h.style.top="0",h.style.left="0",h.style.width="2em",h.style.height="2em",h.style.padding="0",h.style.border="none",h.style.outline="none",h.style.boxShadow="none",h.style.background="transparent",h.style.opacity="0",document.body.appendChild(h),h.focus(),h.select();let p=document.execCommand("copy");return document.body.removeChild(h),p}catch(h){return console.error("Failed to copy text to clipboard:",h),!1}}
2
- export{q as da};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function N(k){if(!(k instanceof Error)||!("status"in k)||!("headers"in k))return!1;return(k.status===void 0||typeof k.status==="number")&&(k.headers===void 0||k.headers instanceof Headers)}function O(k){let w=k.headers?.get("x-should-retry");if(w==="true")return!0;if(w==="false")return!1;if(k.status===void 0)return!0;return k.status===408||k.status===409||k.status===429||typeof k.status==="number"&&k.status>=500}function J(k,w,C){let z=w??60000;if(z>0&&k>z)throw Error(`Server requested ${Math.ceil(k/1000)}s retry delay (max: ${Math.ceil(z/1000)}s). ${C}`);return k}function Q(k,w,C){let z=k.headers?.get("retry-after-ms");if(z){let F=Number.parseFloat(z);if(!Number.isNaN(F))return J(F,C,k.message)}let B=k.headers?.get("retry-after");if(B){let F=Number.parseFloat(B),K=Number.isNaN(F)?Date.parse(B)-Date.now():F*1000;return J(K,C,k.message)}return Math.min(0.5*2**w,8)*1000*(1-Math.random()*0.25)}function H(){let k=Error("Request aborted");return k.name="AbortError",k}function T(k,w){return new Promise((C,z)=>{if(w?.aborted){z(H());return}let B=()=>{clearTimeout(G),z(H())},G=setTimeout(()=>{w?.removeEventListener("abort",B),C()},Math.max(0,k));w?.addEventListener("abort",B,{once:!0})})}async function V(k,w={}){let C=w.maxRetries??0,z=C;for(;;)try{return await k()}catch(B){if(w.signal?.aborted)throw H();if(z<=0||!N(B)||!O(B))throw B;let G=C-z;z--,await T(Q(B,G,w.maxRetryDelayMs),w.signal)}}
3
- export{V as Fm};
@@ -1,2 +0,0 @@
1
- import{da as Vq}from"./chunk-mgnxa0vy.js";import{Bh as o,Ch as r,Dh as m,Eh as e}from"./chunk-ts10cfmc.js";import{di as h,ei as C,fi as O}from"./chunk-2f35h4fn.js";import{gi as P,ii as k,ji as G,li as B,mi as Y}from"./chunk-4k2d8w9w.js";import{Ji as qq,Ki as Eq,Li as Jq,Mi as Kq,Ni as Nq,Oi as Qq,Pi as Wq,Qi as Xq,Ri as Yq,Ti as Zq,Ui as _q,Wi as $q,Yi as X}from"./chunk-s503pcvb.js";import{$i as Cq,Dj as z,Fl as s,aj as t,bj as E,bk as H,cj as K,lk as n,qm as W,tm as J,um as Hq}from"./chunk-w9p59ahz.js";import{rn as hq}from"./chunk-txkmks1h.js";var Z=hq(Cq(),1);function uq({open:fq,onOpenChange:Fq,title:zq,members:g,isOwner:_,onInvite:c,onUpdateRole:I,onRemoveMember:v,currentUserId:Pq,availableMembersToAdd:M,onAddMember:L,type:V="team"}){let[T,u]=Z.useState("editor"),[S,p]=Z.useState(null),[l,x]=Z.useState(!1),[D,U]=Z.useState(null),[f,A]=Z.useState(null),[j,i]=Z.useState({}),[$,F]=Z.useState(null),y=(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}},a=(q,N)=>{i((Q)=>({...Q,[q]:N}))},kq=async(q,N)=>{if(!I)return;U(q);try{await I(q,N),X.success(J.member_role_updated())}catch(Q){console.error(Q),X.error(J.failed_to_update_member_role())}finally{U(null)}},Gq=async()=>{if(!v||!f?.id)return;U(f.id);try{await v(f.id),X.success(J.member_removed()),A(null)}catch(q){console.error(q),X.error(J.failed_to_remove_member())}finally{U(null)}},Bq=async()=>{if(!c)return;x(!0);try{let q=await c(T),N=`${window.location.origin}/signup?inviteCode=${q}`;p(N)}catch(q){console.error(q),X.error(J.failed_to_generate_invite_link())}finally{x(!1)}},Lq=async()=>{if(S){if(await Vq(S))X.success(J.invite_link_copied())}},R=(q)=>{if(!q)return"??";return q.split(" ").map((N)=>N[0]).slice(0,2).join("").toUpperCase()},Sq=(q)=>{if(!q)p(null),u("editor"),i({}),F(null);Fq(q)},w=Array.isArray(g)?g:[],Uq=Array.isArray(M)?M:[],yq=V==="project"&&_?w.filter((q)=>q.role==="owner"||q.scope==="project"||q.hasCustomRole):w,d=V==="project"&&_?w.filter((q)=>q.scope==="team"&&q.role!=="owner"&&!q.hasCustomRole):[],b=V==="project"&&_?Uq.filter((q)=>q.scope==="project"):[];return E(Yq,{open:fq,onOpenChange:Sq,children:K(Zq,{className:"sm:max-w-xl",onOpenAutoFocus:(q)=>q.preventDefault(),children:[E(_q,{children:E($q,{children:zq})}),K("div",{className:"space-y-4",children:[E("div",{className:"max-h-[300px] overflow-y-auto space-y-2",children:yq.map((q)=>{let N=V==="team"&&q.scope==="project";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(h,{children:[q.image&&E(C,{src:q.image,alt:q.name,className:"object-cover"}),E(O,{children:R(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:[!N&&E("span",{className:"text-xs text-muted-foreground capitalize",children:y(q.role)}),q.scope&&K(t,{children:[!N&&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()})]})]})]})]}),_&&q.role!=="owner"&&q.id!==Pq&&K("div",{className:"flex items-center gap-2",children:[N?E(o,{children:K(r,{children:[E(m,{asChild:!0,children:E("span",{children:E(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26 justify-between",disabled:!0,children:E(H,{className:"ml-auto h-3 w-3 opacity-50"})})})}),E(e,{side:"top",children:E("p",{className:"text-xs",children:J.project_member_role_tooltip()})})]})}):K(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:D===q.id,children:[y(q.role),E(H,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(G,{children:K(B,{value:q.role,onValueChange:(Q)=>kq(q.id,Q),children:[E(Y,{value:"editor",className:"text-xs",children:J.editor()}),E(Y,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(W,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>A(q),disabled:D===q.id,children:D===q.id?E(z,{className:"h-3 w-3 animate-spin"}):E(s,{className:"h-3 w-3"})})]})]},q.id)})}),E(qq,{open:!!f,onOpenChange:(q)=>!q&&A(null),children:K(Eq,{children:[K(Jq,{children:[E(Nq,{children:J.remove_member()}),E(Qq,{children:J.remove_member_confirmation({name:f?.name||"",type:V==="project"?J.project():J.team()})})]}),K(Kq,{children:[E(Xq,{children:J.cancel()}),E(Wq,{onClick:Gq,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:J.remove()})]})]})})," ",_&&L&&d.length>0&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-1",children:J.add_team_member_to_project()}),E("p",{className:"text-xs text-muted-foreground mb-3 font-normal",children:J.add_team_member_to_project_hint()}),E("div",{className:"max-h-[200px] overflow-y-auto space-y-2 pr-1",children:d.map((q)=>{let N=j[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(h,{children:[q.image&&E(C,{src:q.image,alt:q.name,className:"object-cover"}),E(O,{children:R(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(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:$===q.id,children:[y(N),E(H,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(G,{children:K(B,{value:N,onValueChange:(Q)=>a(q.id,Q),children:[E(Y,{value:"editor",className:"text-xs",children:J.editor()}),E(Y,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(W,{onClick:async()=>{F(q.id);try{await L(q.id,N),X.success(J.added_member_successfully({name:q.name||""}))}catch(Q){console.error(Q),X.error(J.failed_to_add_member({name:q.name||""}))}finally{F(null)}},disabled:$!==null,size:"sm",className:"h-8 text-xs px-3",children:$===q.id?E(z,{className:"h-3 w-3 animate-spin"}):J.set_role()})]})]},q.id)})})]}),_&&L&&b.length>0&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-1",children:J.add_members_from_other_projects()}),E("p",{className:"text-xs text-muted-foreground mb-3 font-normal",children:J.add_members_from_other_projects_hint()}),E("div",{className:"max-h-[200px] overflow-y-auto space-y-2 pr-1",children:b.map((q)=>{let N=j[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(h,{children:[q.image&&E(C,{src:q.image,alt:q.name,className:"object-cover"}),E(O,{children:R(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(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:$===q.id,children:[y(N),E(H,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(G,{children:K(B,{value:N,onValueChange:(Q)=>a(q.id,Q),children:[E(Y,{value:"editor",className:"text-xs",children:J.editor()}),E(Y,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(W,{onClick:async()=>{F(q.id);try{await L(q.id,N),X.success(J.added_member_successfully({name:q.name||""}))}catch(Q){console.error(Q),X.error(J.failed_to_add_member({name:q.name||""}))}finally{F(null)}},disabled:$!==null,size:"sm",className:"h-8 text-xs px-3",children:$===q.id?E(z,{className:"h-3 w-3 animate-spin"}):J.add_to_project()})]})]},q.id)})})]}),_&&c&&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(P,{children:[E(k,{asChild:!0,children:K(W,{variant:"outline",className:"w-[120px] justify-between",children:[T==="editor"?J.editor():J.reviewer(),E(H,{className:"h-4 w-4 opacity-50"})]})}),E(G,{children:K(B,{value:T,onValueChange:(q)=>u(q),children:[E(Y,{value:"editor",children:J.editor()}),E(Y,{value:"reviewer",children:J.reviewer()})]})})]}),K(W,{onClick:Bq,disabled:l,className:"flex-1",children:[l&&E(z,{className:"mr-2 h-4 w-4 animate-spin"}),J.generate_link()]})]}),S&&K("div",{className:"flex gap-2",children:[E(Hq,{value:S,readOnly:!0}),E(W,{variant:"outline",size:"icon",onClick:Lq,children:E(n,{className:"h-4 w-4"})})]})]})]})]})]})})}
2
- export{uq as ca};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Oa as e,Pa as p,Qa as t}from"./chunk-gfdfkqrc.js";import"./chunk-wfee9d83.js";import"./chunk-n8gsjwht.js";import"./chunk-hx2mvd20.js";import"./chunk-8rcfhfq5.js";import"./chunk-za7ga4bf.js";import"./chunk-txkmks1h.js";export{t as kyselyAdapter,e as getKyselyDatabaseType,p as createKyselyAdapter};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Ac as Mk,Cc as YW,Dc as Ch,Wb as c,Xb as V,Yb as _k,Zb as ek,_b as kW,ac as GW,cc as _,dc as kk,ec as h,fc as dk,gc as j,ic as J,mc as I,nc as zk,oc as x,pc as hk,qc as Kk,rc as pW,sc as y,tc as dW,uc as v,vc as fk,wc as Xk,xc as w,yc as sW,zc as TW}from"./chunk-8rcfhfq5.js";function z(k){return kk(k)&&_(k.toOperationNode)}var Q=h({is(k){return k.kind==="ValueNode"},create(k){return h({kind:"ValueNode",value:k})},createImmediate(k){return h({kind:"ValueNode",value:k,immediate:!0})}});var S=h({is(k){return k.kind==="ColumnNode"},create(k){return h({kind:"ColumnNode",column:J.create(k)})}});var pk=h({is(k){return k.kind==="SelectAllNode"},create(){return h({kind:"SelectAllNode"})}});var Ak=h({is(k){return k.kind==="ReferenceNode"},create(k,W){return h({kind:"ReferenceNode",table:W,column:k})},createSelectAll(k){return h({kind:"ReferenceNode",table:k,column:pk.create()})}});function ok(k){return kk(k)&&"expressionType"in k&&z(k)}function iW(k){return kk(k)&&"expression"in k&&V(k.alias)&&z(k)}var a=h({is(k){return k.kind==="SelectModifierNode"},create(k,W){return h({kind:"SelectModifierNode",modifier:k,of:W})},createWithExpression(k){return h({kind:"SelectModifierNode",rawModifier:k})}});var Yk=h({is(k){return k.kind==="BinaryOperationNode"},create(k,W,$){return h({kind:"BinaryOperationNode",leftOperand:k,operator:W,rightOperand:$})}});var sk=h({is(k){return k.kind==="PrimitiveValueListNode"},create(k){return h({kind:"PrimitiveValueListNode",values:h([...k])})}});var rk=h({is(k){return k.kind==="ValueListNode"},create(k){return h({kind:"ValueListNode",values:h(k)})}});function lW(k){if(j(k))return ih(k);return X(k)}function X(k){if(Wk(k))return p(k);return Q.create(k)}function WW(k){return _k(k)||ek(k)||kW(k)}function Bk(k){if(!WW(k))throw Error(`unsafe immediate value ${JSON.stringify(k)}`);return Q.createImmediate(k)}function ih(k){if(k.some(Wk))return rk.create(k.map((W)=>X(W)));return sk.create(k)}function L(k){if(k.length===3)return hW(k[0],k[1],k[2]);else if(k.length===1)return X(k[0]);throw Error(`invalid arguments: ${JSON.stringify(k)}`)}function hW(k,W,$){if(lh(W)&&oW($))return Yk.create(f(k),PW(W),Q.createImmediate($));return Yk.create(f(k),PW(W),lW($))}function m(k,W,$){return Yk.create(f(k),PW(W),f($))}function UW(k,W){return mk(Object.entries(k).filter(([,$])=>!c($)).map(([$,M])=>hW($,oW(M)?"is":"=",M)),W)}function mk(k,W,$=!0){let M=W==="and"?x.create:hk.create;if(k.length===0)return Yk.create(Q.createImmediate(1),y.create("="),Q.createImmediate(W==="and"?1:0));let G=aW(k[0]);for(let q=1;q<k.length;++q)G=M(G,aW(k[q]));if(k.length>1&&$)return Xk.create(G);return G}function lh(k){return k==="is"||k==="is not"}function oW(k){return kW(k)||ek(k)}function PW(k){if(V(k)&&pW.includes(k))return y.create(k);if(z(k))return k.toOperationNode();throw Error(`invalid operator ${JSON.stringify(k)}`)}function aW(k){return z(k)?k.toOperationNode():k}var $k=h({is(k){return k.kind==="OrderByNode"},create(k){return h({kind:"OrderByNode",items:h([...k])})},cloneWithItems(k,W){return h({...k,items:h([...k.items,...W])})}});var VW=h({is(k){return k.kind==="PartitionByNode"},create(k){return h({kind:"PartitionByNode",items:h(k)})},cloneWithItems(k,W){return h({...k,items:h([...k.items,...W])})}});var xk=h({is(k){return k.kind==="OverNode"},create(){return h({kind:"OverNode"})},cloneWithOrderByItems(k,W){return h({...k,orderBy:k.orderBy?$k.cloneWithItems(k.orderBy,W):$k.create(W)})},cloneWithPartitionByItems(k,W){return h({...k,partitionBy:k.partitionBy?VW.cloneWithItems(k.partitionBy,W):VW.create(W)})}});var Vk=h({is(k){return k.kind==="FromNode"},create(k){return h({kind:"FromNode",froms:h(k)})},cloneWithFroms(k,W){return h({...k,froms:h([...k.froms,...W])})}});var wW=h({is(k){return k.kind==="GroupByNode"},create(k){return h({kind:"GroupByNode",items:h(k)})},cloneWithItems(k,W){return h({...k,items:h([...k.items,...W])})}});var FW=h({is(k){return k.kind==="HavingNode"},create(k){return h({kind:"HavingNode",having:k})},cloneWithOperation(k,W,$){return h({...k,having:W==="And"?x.create(k.having,$):hk.create(k.having,$)})}});var o=h({is(k){return k.kind==="UpdateQueryNode"},create(k,W){return h({kind:"UpdateQueryNode",table:k.length===1?k[0]:sW.create(k),...W&&{with:W}})},createWithoutTable(){return h({kind:"UpdateQueryNode"})},cloneWithFromItems(k,W){return h({...k,from:k.from?Vk.cloneWithFroms(k.from,W):Vk.create(W)})},cloneWithUpdates(k,W){return h({...k,updates:k.updates?h([...k.updates,...W]):W})},cloneWithLimit(k,W){return h({...k,limit:W})}});var Dk=h({is(k){return k.kind==="DeleteQueryNode"},create(k,W){return h({kind:"DeleteQueryNode",from:Vk.create(k),...W&&{with:W}})},cloneWithOrderByItems:(k,W)=>K.cloneWithOrderByItems(k,W),cloneWithoutOrderBy:(k)=>K.cloneWithoutOrderBy(k),cloneWithLimit(k,W){return h({...k,limit:W})},cloneWithoutLimit(k){return h({...k,limit:void 0})},cloneWithUsing(k,W){return h({...k,using:k.using!==void 0?TW.cloneWithTables(k.using,W):TW.create(W)})}});var C=h({is(k){return k.kind==="WhereNode"},create(k){return h({kind:"WhereNode",where:k})},cloneWithOperation(k,W,$){return h({...k,where:W==="And"?x.create(k.where,$):hk.create(k.where,$)})}});var vW=h({is(k){return k.kind==="ReturningNode"},create(k){return h({kind:"ReturningNode",selections:h(k)})},cloneWithSelections(k,W){return h({...k,selections:k.selections?h([...k.selections,...W]):h(W)})}});var rW=h({is(k){return k.kind==="ExplainNode"},create(k,W){return h({kind:"ExplainNode",format:k,options:W})}});var N=h({is(k){return k.kind==="MergeQueryNode"},create(k,W){return h({kind:"MergeQueryNode",into:k,...W&&{with:W}})},cloneWithUsing(k,W){return h({...k,using:W})},cloneWithWhen(k,W){return h({...k,whens:k.whens?h([...k.whens,W]):h([W])})},cloneWithThen(k,W){return h({...k,whens:k.whens?h([...k.whens.slice(0,-1),Mk.cloneWithResult(k.whens[k.whens.length-1],W)]):void 0})}});var AW=h({is(k){return k.kind==="OutputNode"},create(k){return h({kind:"OutputNode",selections:h(k)})},cloneWithSelections(k,W){return h({...k,selections:k.selections?h([...k.selections,...W]):h(W)})}});var K=h({is(k){return Y.is(k)||w.is(k)||o.is(k)||Dk.is(k)||N.is(k)},cloneWithEndModifier(k,W){return h({...k,endModifiers:k.endModifiers?h([...k.endModifiers,W]):h([W])})},cloneWithWhere(k,W){return h({...k,where:k.where?C.cloneWithOperation(k.where,"And",W):C.create(W)})},cloneWithJoin(k,W){return h({...k,joins:k.joins?h([...k.joins,W]):h([W])})},cloneWithReturning(k,W){return h({...k,returning:k.returning?vW.cloneWithSelections(k.returning,W):vW.create(W)})},cloneWithoutReturning(k){return h({...k,returning:void 0})},cloneWithoutWhere(k){return h({...k,where:void 0})},cloneWithExplain(k,W,$){return h({...k,explain:rW.create(W,$?.toOperationNode())})},cloneWithTop(k,W){return h({...k,top:W})},cloneWithOutput(k,W){return h({...k,output:k.output?AW.cloneWithSelections(k.output,W):AW.create(W)})},cloneWithOrderByItems(k,W){return h({...k,orderBy:k.orderBy?$k.cloneWithItems(k.orderBy,W):$k.create(W)})},cloneWithoutOrderBy(k){return h({...k,orderBy:void 0})}});var Y=h({is(k){return k.kind==="SelectQueryNode"},create(k){return h({kind:"SelectQueryNode",...k&&{with:k}})},createFrom(k,W){return h({kind:"SelectQueryNode",from:Vk.create(k),...W&&{with:W}})},cloneWithSelections(k,W){return h({...k,selections:k.selections?h([...k.selections,...W]):h(W)})},cloneWithDistinctOn(k,W){return h({...k,distinctOn:k.distinctOn?h([...k.distinctOn,...W]):h(W)})},cloneWithFrontModifier(k,W){return h({...k,frontModifiers:k.frontModifiers?h([...k.frontModifiers,W]):h([W])})},cloneWithOrderByItems:(k,W)=>K.cloneWithOrderByItems(k,W),cloneWithGroupByItems(k,W){return h({...k,groupBy:k.groupBy?wW.cloneWithItems(k.groupBy,W):wW.create(W)})},cloneWithLimit(k,W){return h({...k,limit:W})},cloneWithOffset(k,W){return h({...k,offset:W})},cloneWithFetch(k,W){return h({...k,fetch:W})},cloneWithHaving(k,W){return h({...k,having:k.having?FW.cloneWithOperation(k.having,"And",W):FW.create(W)})},cloneWithSetOperations(k,W){return h({...k,setOperations:k.setOperations?h([...k.setOperations,...W]):h([...W])})},cloneWithoutSelections(k){return h({...k,selections:[]})},cloneWithoutLimit(k){return h({...k,limit:void 0})},cloneWithoutOffset(k){return h({...k,offset:void 0})},cloneWithoutOrderBy:(k)=>K.cloneWithoutOrderBy(k),cloneWithoutGroupBy(k){return h({...k,groupBy:void 0})}});class Rk{#k;constructor(k){this.#k=h(k)}on(...k){return new Rk({...this.#k,joinNode:Kk.cloneWithOn(this.#k.joinNode,L(k))})}onRef(k,W,$){return new Rk({...this.#k,joinNode:Kk.cloneWithOn(this.#k.joinNode,m(k,W,$))})}onTrue(){return new Rk({...this.#k,joinNode:Kk.cloneWithOn(this.#k.joinNode,v.createWithSql("true"))})}$call(k){return k(this)}toOperationNode(){return this.#k.joinNode}}class ah{#k;get dynamicReference(){return this.#k}get refType(){return}constructor(k){this.#k=k}toOperationNode(){return _W(this.#k)}}function $W(k){return kk(k)&&z(k)&&V(k.dynamicReference)}var g=h({is(k){return k.kind==="OrderByItemNode"},create(k,W){return h({kind:"OrderByItemNode",orderBy:k,direction:W})},cloneWith(k,W){return h({...k,...W})}});var eW=h({is(k){return k.kind==="CollateNode"},create(k){return h({kind:"CollateNode",collation:J.create(k)})}});class Lk{#k;constructor(k){this.#k=h(k)}desc(){return new Lk({node:g.cloneWith(this.#k.node,{direction:v.createWithSql("desc")})})}asc(){return new Lk({node:g.cloneWith(this.#k.node,{direction:v.createWithSql("asc")})})}nullsLast(){return new Lk({node:g.cloneWith(this.#k.node,{nulls:"last"})})}nullsFirst(){return new Lk({node:g.cloneWith(this.#k.node,{nulls:"first"})})}collate(k){return new Lk({node:g.cloneWith(this.#k.node,{collation:eW.create(k)})})}toOperationNode(){return this.#k.node}}function RW(k){return k==="asc"||k==="desc"}function B(k){if(k.length===2)return[mW(k[0],k[1])];if(k.length===1){let[W]=k;if(Array.isArray(W))return fk("orderBy(array) is deprecated, use multiple orderBy calls instead."),W.map(($)=>mW($));return[mW(W)]}throw Error(`Invalid number of arguments at order by! expected 1-2, received ${k.length}`)}function mW(k,W){let $=ph(k);if(g.is($)){if(W)throw Error("Cannot specify direction twice!");return $}return kh($,W)}function ph(k){if(Wk(k))return p(k);if($W(k))return k.toOperationNode();let[W,$]=k.split(" ");if($)return fk("`orderBy('column asc')` is deprecated. Use `orderBy('column', 'asc')` instead."),kh(t(W),$);return t(k)}function kh(k,W){if(typeof W==="string"){if(!RW(W))throw Error(`Invalid order by direction: ${W}`);return g.create(k,v.createWithSql(W))}if(ok(W))return fk("`orderBy(..., expr)` is deprecated. Use `orderBy(..., 'asc')` or `orderBy(..., (ob) => ...)` instead."),g.create(k,W.toOperationNode());let $=g.create(k);if(!W)return $;return W(new Lk({node:$})).toOperationNode()}var Wh=h({is(k){return k.kind==="PartitionByItemNode"},create(k){return h({kind:"PartitionByItemNode",partitionBy:k})}});function hh(k){return Gk(k).map(Wh.create)}class Ck{#k;constructor(k){this.#k=h(k)}orderBy(...k){return new Ck({overNode:xk.cloneWithOrderByItems(this.#k.overNode,B(k))})}clearOrderBy(){return new Ck({overNode:K.cloneWithoutOrderBy(this.#k.overNode)})}partitionBy(k){return new Ck({overNode:xk.cloneWithPartitionByItems(this.#k.overNode,hh(k))})}$call(k){return k(this)}toOperationNode(){return this.#k.overNode}}var Sk=h({is(k){return k.kind==="SelectionNode"},create(k){return h({kind:"SelectionNode",selection:k})},createSelectAll(){return h({kind:"SelectionNode",selection:pk.create()})},createSelectAllFromTable(k){return h({kind:"SelectionNode",selection:Ak.createSelectAll(k)})}});class oh{#k;get table(){return this.#k}constructor(k){this.#k=k}as(k){return new $h(this.#k,k)}}class $h{#k;#W;get table(){return this.#k}get alias(){return this.#W}constructor(k,W){this.#k=k,this.#W=W}toOperationNode(){return I.create(F(this.#k),J.create(this.#W))}}function Mh(k){return kk(k)&&z(k)&&V(k.table)&&V(k.alias)}function n(k){if(j(k))return k.map((W)=>wk(W));else return[wk(k)]}function wk(k){if(V(k))return fW(k);else if(Mh(k))return k.toOperationNode();else return MW(k)}function fW(k){if(k.includes(" as ")){let[$,M]=k.split(" as ").map(Kh);return I.create(F($),J.create(M))}else return F(k)}function F(k){if(k.includes(".")){let[$,M]=k.split(".").map(Kh);return zk.createWithSchema($,M)}else return zk.create(k)}function Kh(k){return k.trim()}function A(k){if(_(k))return A(k(d()));else if(j(k))return k.map((W)=>Gh(W));else return[Gh(k)]}function Gh(k){if(V(k))return Sk.create(Zh(k));else if($W(k))return Sk.create(k.toOperationNode());else return Sk.create(MW(k))}function R(k){if(!k)return[Sk.createSelectAll()];else if(Array.isArray(k))return k.map(Hh);else return[Hh(k)]}function Hh(k){if(V(k))return Sk.createSelectAllFromTable(F(k));throw Error(`invalid value selectAll expression: ${JSON.stringify(k)}`)}var Yh=h({is(k){return k.kind==="ValuesNode"},create(k){return h({kind:"ValuesNode",values:h(k)})}});var Xh=h({is(k){return k.kind==="DefaultInsertValueNode"},create(){return h({kind:"DefaultInsertValueNode"})}});function KW(k){let W=_(k)?k(d()):k,$=j(W)?W:h([W]);return sh($)}function sh(k){let W=rh(k);return[h([...W.keys()].map(S.create)),Yh.create(k.map(($)=>eh($,W)))]}function rh(k){let W=new Map;for(let $ of k){let M=Object.keys($);for(let G of M)if(!W.has(G)&&$[G]!==void 0)W.set(G,W.size)}return W}function eh(k,W){let $=Object.keys(k),M=Array.from({length:W.size}),G=!1,q=$.length;for(let ak of $){let Nk=W.get(ak);if(c(Nk)){q--;continue}let qW=k[ak];if(c(qW)||Wk(qW))G=!0;M[Nk]=qW}if(q<W.size||G){let ak=Xh.create();return rk.create(M.map((Nk)=>c(Nk)?ak:X(Nk)))}return sk.create(M)}var CW=h({is(k){return k.kind==="ColumnUpdateNode"},create(k,W){return h({kind:"ColumnUpdateNode",column:k,value:W})}});function Dh(...k){if(k.length===2)return[CW.create(f(k[0]),X(k[1]))];return ck(k[0])}function ck(k){let W=_(k)?k(d()):k;return Object.entries(W).filter(([$,M])=>M!==void 0).map(([$,M])=>{return CW.create(S.create($),X(M))})}var Lh=h({is(k){return k.kind==="OnDuplicateKeyNode"},create(k){return h({kind:"OnDuplicateKeyNode",updates:k})}});class SW{insertId;numInsertedOrUpdatedRows;constructor(k,W){this.insertId=k,this.numInsertedOrUpdatedRows=W}}class u extends Error{node;constructor(k){super("no result");this.node=k}}function s(k){return Object.prototype.hasOwnProperty.call(k,"prototype")}var E=h({is(k){return k.kind==="OnConflictNode"},create(){return h({kind:"OnConflictNode"})},cloneWith(k,W){return h({...k,...W})},cloneWithIndexWhere(k,W){return h({...k,indexWhere:k.indexWhere?C.cloneWithOperation(k.indexWhere,"And",W):C.create(W)})},cloneWithIndexOrWhere(k,W){return h({...k,indexWhere:k.indexWhere?C.cloneWithOperation(k.indexWhere,"Or",W):C.create(W)})},cloneWithUpdateWhere(k,W){return h({...k,updateWhere:k.updateWhere?C.cloneWithOperation(k.updateWhere,"And",W):C.create(W)})},cloneWithUpdateOrWhere(k,W){return h({...k,updateWhere:k.updateWhere?C.cloneWithOperation(k.updateWhere,"Or",W):C.create(W)})},cloneWithoutIndexWhere(k){return h({...k,indexWhere:void 0})},cloneWithoutUpdateWhere(k){return h({...k,updateWhere:void 0})}});class r{#k;constructor(k){this.#k=h(k)}column(k){let W=S.create(k);return new r({...this.#k,onConflictNode:E.cloneWith(this.#k.onConflictNode,{columns:this.#k.onConflictNode.columns?h([...this.#k.onConflictNode.columns,W]):h([W])})})}columns(k){let W=k.map(S.create);return new r({...this.#k,onConflictNode:E.cloneWith(this.#k.onConflictNode,{columns:this.#k.onConflictNode.columns?h([...this.#k.onConflictNode.columns,...W]):h(W)})})}constraint(k){return new r({...this.#k,onConflictNode:E.cloneWith(this.#k.onConflictNode,{constraint:J.create(k)})})}expression(k){return new r({...this.#k,onConflictNode:E.cloneWith(this.#k.onConflictNode,{indexExpression:k.toOperationNode()})})}where(...k){return new r({...this.#k,onConflictNode:E.cloneWithIndexWhere(this.#k.onConflictNode,L(k))})}whereRef(k,W,$){return new r({...this.#k,onConflictNode:E.cloneWithIndexWhere(this.#k.onConflictNode,m(k,W,$))})}clearWhere(){return new r({...this.#k,onConflictNode:E.cloneWithoutIndexWhere(this.#k.onConflictNode)})}doNothing(){return new zh({...this.#k,onConflictNode:E.cloneWith(this.#k.onConflictNode,{doNothing:!0})})}doUpdateSet(k){return new yk({...this.#k,onConflictNode:E.cloneWith(this.#k.onConflictNode,{updates:ck(k)})})}$call(k){return k(this)}}class zh{#k;constructor(k){this.#k=h(k)}toOperationNode(){return this.#k.onConflictNode}}class yk{#k;constructor(k){this.#k=h(k)}where(...k){return new yk({...this.#k,onConflictNode:E.cloneWithUpdateWhere(this.#k.onConflictNode,L(k))})}whereRef(k,W,$){return new yk({...this.#k,onConflictNode:E.cloneWithUpdateWhere(this.#k.onConflictNode,m(k,W,$))})}clearWhere(){return new yk({...this.#k,onConflictNode:E.cloneWithoutUpdateWhere(this.#k.onConflictNode)})}$call(k){return k(this)}toOperationNode(){return this.#k.onConflictNode}}var Jh=h({is(k){return k.kind==="TopNode"},create(k,W){return h({kind:"TopNode",expression:k,modifiers:W})}});function i(k,W){if(!_k(k)&&!GW(k))throw Error(`Invalid top expression: ${k}`);if(!c(W)&&!k$(W))throw Error(`Invalid top modifiers: ${W}`);return Jh.create(k,W)}function k$(k){return k==="percent"||k==="with ties"||k==="percent with ties"}var Fk=h({is(k){return k.kind==="OrActionNode"},create(k){return h({kind:"OrActionNode",action:k})}});class D{#k;constructor(k){this.#k=h(k)}values(k){let[W,$]=KW(k);return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{columns:W,values:$})})}columns(k){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{columns:h(k.map(S.create))})})}expression(k){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{values:p(k)})})}defaultValues(){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{defaultValues:!0})})}modifyEnd(k){return new D({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,k.toOperationNode())})}ignore(){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{orAction:Fk.create("ignore")})})}orIgnore(){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{orAction:Fk.create("ignore")})})}orAbort(){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{orAction:Fk.create("abort")})})}orFail(){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{orAction:Fk.create("fail")})})}orReplace(){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{orAction:Fk.create("replace")})})}orRollback(){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{orAction:Fk.create("rollback")})})}top(k,W){return new D({...this.#k,queryNode:K.cloneWithTop(this.#k.queryNode,i(k,W))})}onConflict(k){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{onConflict:k(new r({onConflictNode:E.create()})).toOperationNode()})})}onDuplicateKeyUpdate(k){return new D({...this.#k,queryNode:w.cloneWith(this.#k.queryNode,{onDuplicateKey:Lh.create(ck(k))})})}returning(k){return new D({...this.#k,queryNode:K.cloneWithReturning(this.#k.queryNode,A(k))})}returningAll(){return new D({...this.#k,queryNode:K.cloneWithReturning(this.#k.queryNode,R())})}output(k){return new D({...this.#k,queryNode:K.cloneWithOutput(this.#k.queryNode,A(k))})}outputAll(k){return new D({...this.#k,queryNode:K.cloneWithOutput(this.#k.queryNode,R(k))})}clearReturning(){return new D({...this.#k,queryNode:K.cloneWithoutReturning(this.#k.queryNode)})}$call(k){return k(this)}$if(k,W){if(k)return W(this);return new D({...this.#k})}$castTo(){return new D(this.#k)}$narrowType(){return new D(this.#k)}$assertType(){return new D(this.#k)}withPlugin(k){return new D({...this.#k,executor:this.#k.executor.withPlugin(k)})}toOperationNode(){return this.#k.executor.transformQuery(this.#k.queryNode,this.#k.queryId)}compile(){return this.#k.executor.compileQuery(this.toOperationNode(),this.#k.queryId)}async execute(){let k=this.compile(),W=await this.#k.executor.executeQuery(k),{adapter:$}=this.#k.executor,M=k.query;if(M.returning&&$.supportsReturning||M.output&&$.supportsOutput)return W.rows;return[new SW(W.insertId,W.numAffectedRows??BigInt(0))]}async executeTakeFirst(){let[k]=await this.execute();return k}async executeTakeFirstOrThrow(k=u){let W=await this.executeTakeFirst();if(W===void 0)throw s(k)?new k(this.toOperationNode()):k(this.toOperationNode());return W}async*stream(k=100){let W=this.compile(),$=this.#k.executor.stream(W,k);for await(let M of $)yield*M.rows}async explain(k,W){return await new D({...this.#k,queryNode:K.cloneWithExplain(this.#k.queryNode,k,W)}).execute()}}class IW{numDeletedRows;constructor(k){this.numDeletedRows=k}}var Ik=h({is(k){return k.kind==="LimitNode"},create(k){return h({kind:"LimitNode",limit:k})}});var P;class HW{#k;constructor(k){this.#k=h(k)}where(...k){return new P({...this.#k,queryNode:K.cloneWithWhere(this.#k.queryNode,L(k))})}whereRef(k,W,$){return new P({...this.#k,queryNode:K.cloneWithWhere(this.#k.queryNode,m(k,W,$))})}clearWhere(){return new P({...this.#k,queryNode:K.cloneWithoutWhere(this.#k.queryNode)})}top(k,W){return new P({...this.#k,queryNode:K.cloneWithTop(this.#k.queryNode,i(k,W))})}using(k){return new P({...this.#k,queryNode:Dk.cloneWithUsing(this.#k.queryNode,n(k))})}innerJoin(...k){return this.#W("InnerJoin",k)}leftJoin(...k){return this.#W("LeftJoin",k)}rightJoin(...k){return this.#W("RightJoin",k)}fullJoin(...k){return this.#W("FullJoin",k)}#W(k,W){return new P({...this.#k,queryNode:K.cloneWithJoin(this.#k.queryNode,Jk(k,W))})}returning(k){return new P({...this.#k,queryNode:K.cloneWithReturning(this.#k.queryNode,A(k))})}returningAll(k){return new P({...this.#k,queryNode:K.cloneWithReturning(this.#k.queryNode,R(k))})}output(k){return new P({...this.#k,queryNode:K.cloneWithOutput(this.#k.queryNode,A(k))})}outputAll(k){return new P({...this.#k,queryNode:K.cloneWithOutput(this.#k.queryNode,R(k))})}clearReturning(){return new P({...this.#k,queryNode:K.cloneWithoutReturning(this.#k.queryNode)})}clearLimit(){return new P({...this.#k,queryNode:Dk.cloneWithoutLimit(this.#k.queryNode)})}orderBy(...k){return new P({...this.#k,queryNode:K.cloneWithOrderByItems(this.#k.queryNode,B(k))})}clearOrderBy(){return new P({...this.#k,queryNode:K.cloneWithoutOrderBy(this.#k.queryNode)})}limit(k){return new P({...this.#k,queryNode:Dk.cloneWithLimit(this.#k.queryNode,Ik.create(X(k)))})}modifyEnd(k){return new P({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,k.toOperationNode())})}$call(k){return k(this)}$if(k,W){if(k)return W(this);return new P({...this.#k})}$castTo(){return new P(this.#k)}$narrowType(){return new P(this.#k)}$assertType(){return new P(this.#k)}withPlugin(k){return new P({...this.#k,executor:this.#k.executor.withPlugin(k)})}toOperationNode(){return this.#k.executor.transformQuery(this.#k.queryNode,this.#k.queryId)}compile(){return this.#k.executor.compileQuery(this.toOperationNode(),this.#k.queryId)}async execute(){let k=this.compile(),W=await this.#k.executor.executeQuery(k),{adapter:$}=this.#k.executor,M=k.query;if(M.returning&&$.supportsReturning||M.output&&$.supportsOutput)return W.rows;return[new IW(W.numAffectedRows??BigInt(0))]}async executeTakeFirst(){let[k]=await this.execute();return k}async executeTakeFirstOrThrow(k=u){let W=await this.executeTakeFirst();if(W===void 0)throw s(k)?new k(this.toOperationNode()):k(this.toOperationNode());return W}async*stream(k=100){let W=this.compile(),$=this.#k.executor.stream(W,k);for await(let M of $)yield*M.rows}async explain(k,W){return await new P({...this.#k,queryNode:K.cloneWithExplain(this.#k.queryNode,k,W)}).execute()}}P=HW;class jW{numUpdatedRows;numChangedRows;constructor(k,W){this.numUpdatedRows=k,this.numChangedRows=W}}var U;class jk{#k;constructor(k){this.#k=h(k)}where(...k){return new U({...this.#k,queryNode:K.cloneWithWhere(this.#k.queryNode,L(k))})}whereRef(k,W,$){return new U({...this.#k,queryNode:K.cloneWithWhere(this.#k.queryNode,m(k,W,$))})}clearWhere(){return new U({...this.#k,queryNode:K.cloneWithoutWhere(this.#k.queryNode)})}top(k,W){return new U({...this.#k,queryNode:K.cloneWithTop(this.#k.queryNode,i(k,W))})}from(k){return new U({...this.#k,queryNode:o.cloneWithFromItems(this.#k.queryNode,n(k))})}innerJoin(...k){return this.#W("InnerJoin",k)}leftJoin(...k){return this.#W("LeftJoin",k)}rightJoin(...k){return this.#W("RightJoin",k)}fullJoin(...k){return this.#W("FullJoin",k)}#W(k,W){return new U({...this.#k,queryNode:K.cloneWithJoin(this.#k.queryNode,Jk(k,W))})}orderBy(...k){return new U({...this.#k,queryNode:K.cloneWithOrderByItems(this.#k.queryNode,B(k))})}clearOrderBy(){return new U({...this.#k,queryNode:K.cloneWithoutOrderBy(this.#k.queryNode)})}limit(k){return new U({...this.#k,queryNode:o.cloneWithLimit(this.#k.queryNode,Ik.create(X(k)))})}set(...k){return new U({...this.#k,queryNode:o.cloneWithUpdates(this.#k.queryNode,Dh(...k))})}returning(k){return new U({...this.#k,queryNode:K.cloneWithReturning(this.#k.queryNode,A(k))})}returningAll(k){return new U({...this.#k,queryNode:K.cloneWithReturning(this.#k.queryNode,R(k))})}output(k){return new U({...this.#k,queryNode:K.cloneWithOutput(this.#k.queryNode,A(k))})}outputAll(k){return new U({...this.#k,queryNode:K.cloneWithOutput(this.#k.queryNode,R(k))})}modifyEnd(k){return new U({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,k.toOperationNode())})}clearReturning(){return new U({...this.#k,queryNode:K.cloneWithoutReturning(this.#k.queryNode)})}$call(k){return k(this)}$if(k,W){if(k)return W(this);return new U({...this.#k})}$castTo(){return new U(this.#k)}$narrowType(){return new U(this.#k)}$assertType(){return new U(this.#k)}withPlugin(k){return new U({...this.#k,executor:this.#k.executor.withPlugin(k)})}toOperationNode(){return this.#k.executor.transformQuery(this.#k.queryNode,this.#k.queryId)}compile(){return this.#k.executor.compileQuery(this.toOperationNode(),this.#k.queryId)}async execute(){let k=this.compile(),W=await this.#k.executor.executeQuery(k),{adapter:$}=this.#k.executor,M=k.query;if(M.returning&&$.supportsReturning||M.output&&$.supportsOutput)return W.rows;return[new jW(W.numAffectedRows??BigInt(0),W.numChangedRows)]}async executeTakeFirst(){let[k]=await this.execute();return k}async executeTakeFirstOrThrow(k=u){let W=await this.executeTakeFirst();if(W===void 0)throw s(k)?new k(this.toOperationNode()):k(this.toOperationNode());return W}async*stream(k=100){let W=this.compile(),$=this.#k.executor.stream(W,k);for await(let M of $)yield*M.rows}async explain(k,W){return await new U({...this.#k,queryNode:K.cloneWithExplain(this.#k.queryNode,k,W)}).execute()}}U=jk;var EW=h({is(k){return k.kind==="CommonTableExpressionNameNode"},create(k,W){return h({kind:"CommonTableExpressionNameNode",table:zk.create(k),columns:W?h(W.map(S.create)):void 0})}});var Ek=h({is(k){return k.kind==="CommonTableExpressionNode"},create(k,W){return h({kind:"CommonTableExpressionNode",name:k,expression:W})},cloneWith(k,W){return h({...k,...W})}});class gk{#k;constructor(k){this.#k=h(k)}materialized(){return new gk({...this.#k,node:Ek.cloneWith(this.#k.node,{materialized:!0})})}notMaterialized(){return new gk({...this.#k,node:Ek.cloneWith(this.#k.node,{materialized:!1})})}toOperationNode(){return this.#k.node}}function OW(k,W){let $=W(Ph()).toOperationNode();if(_(k))return k(W$($)).toOperationNode();return Ek.create(qh(k),$)}function W$(k){return(W)=>{return new gk({node:Ek.create(qh(W),k)})}}function qh(k){if(k.includes("(")){let W=k.split(/[\(\)]/),$=W[0],M=W[1].split(",").map((G)=>G.trim());return EW.create($,M)}else return EW.create(k)}var tk=h({is(k){return k.kind==="WithNode"},create(k,W){return h({kind:"WithNode",expressions:h([k]),...W})},cloneWithExpression(k,W){return h({...k,expressions:h([...k.expressions,W])})}});var Uh=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9"];function Vh(k){let W="";for(let $=0;$<k;++$)W+=h$();return W}function h$(){return Uh[~~(Math.random()*Uh.length)]}function T(){return new wh}class wh{#k;get queryId(){if(this.#k===void 0)this.#k=Vh(8);return this.#k}}var Fh=h({is(k){return k.kind==="MatchedNode"},create(k,W=!1){return h({kind:"MatchedNode",not:k,bySource:W})}});function bW(k,W,$){return Mk.create(mk([Fh.create(!k.isMatched,k.bySource),...W&&W.length>0?[W.length===3&&$?m(W[0],W[1],W[2]):L(W)]:[]],"and",!1))}function Ok(k){if(V(k))return v.create([k],[]);if(z(k))return k.toOperationNode();return k}class ZW{#k;#W;#h;constructor(){this.#k=new Promise((k,W)=>{this.#h=W,this.#W=k})}get promise(){return this.#k}resolve=(k)=>{if(this.#W)this.#W(k)};reject=(k)=>{if(this.#h)this.#h(k)}}async function Th(k){let W=new ZW,$=new ZW;return k.provideConnection(async(M)=>{return W.resolve(M),await $.promise}).catch((M)=>W.reject(M)),h({connection:await W.promise,release:$.resolve})}var $$=h([]);class QW{#k;constructor(k=$$){this.#k=k}get plugins(){return this.#k}transformQuery(k,W){for(let $ of this.#k){let M=$.transformQuery({node:k,queryId:W});if(M.kind===k.kind)k=M;else throw Error(["KyselyPlugin.transformQuery must return a node","of the same kind that was given to it.",`The plugin was given a ${k.kind}`,`but it returned a ${M.kind}`].join(" "))}return k}async executeQuery(k){return await this.provideConnection(async(W)=>{let $=await W.executeQuery(k);if("numUpdatedOrDeletedRows"in $)fk("kysely:warning: outdated driver/plugin detected! `QueryResult.numUpdatedOrDeletedRows` has been replaced with `QueryResult.numAffectedRows`.");return await this.#W($,k.queryId)})}async*stream(k,W){let{connection:$,release:M}=await Th(this);try{for await(let G of $.streamQuery(k,W))yield await this.#W(G,k.queryId)}finally{M()}}async#W(k,W){for(let $ of this.#k)k=await $.transformResult({result:k,queryId:W});return k}}class bk extends QW{get adapter(){throw Error("this query cannot be compiled to SQL")}compileQuery(){throw Error("this query cannot be compiled to SQL")}provideConnection(){throw Error("this query cannot be executed")}withConnectionProvider(){throw Error("this query cannot have a connection provider")}withPlugin(k){return new bk([...this.plugins,k])}withPlugins(k){return new bk([...this.plugins,...k])}withPluginAtFront(k){return new bk([k,...this.plugins])}withoutPlugins(){return new bk([])}}var qk=new bk;class NW{numChangedRows;constructor(k){this.numChangedRows=k}}class Hk{#k;constructor(k){this.#k=h(k)}modifyEnd(k){return new Hk({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,k.toOperationNode())})}top(k,W){return new Hk({...this.#k,queryNode:K.cloneWithTop(this.#k.queryNode,i(k,W))})}using(...k){return new O({...this.#k,queryNode:N.cloneWithUsing(this.#k.queryNode,Jk("Using",k))})}returning(k){return new Hk({...this.#k,queryNode:K.cloneWithReturning(this.#k.queryNode,A(k))})}returningAll(k){return new Hk({...this.#k,queryNode:K.cloneWithReturning(this.#k.queryNode,R(k))})}output(k){return new Hk({...this.#k,queryNode:K.cloneWithOutput(this.#k.queryNode,A(k))})}outputAll(k){return new Hk({...this.#k,queryNode:K.cloneWithOutput(this.#k.queryNode,R(k))})}}class O{#k;constructor(k){this.#k=h(k)}modifyEnd(k){return new O({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,k.toOperationNode())})}top(k,W){return new O({...this.#k,queryNode:K.cloneWithTop(this.#k.queryNode,i(k,W))})}whenMatched(){return this.#W([])}whenMatchedAnd(...k){return this.#W(k)}whenMatchedAndRef(k,W,$){return this.#W([k,W,$],!0)}#W(k,W){return new BW({...this.#k,queryNode:N.cloneWithWhen(this.#k.queryNode,bW({isMatched:!0},k,W))})}whenNotMatched(){return this.#h([])}whenNotMatchedAnd(...k){return this.#h(k)}whenNotMatchedAndRef(k,W,$){return this.#h([k,W,$],!0)}whenNotMatchedBySource(){return this.#h([],!1,!0)}whenNotMatchedBySourceAnd(...k){return this.#h(k,!1,!0)}whenNotMatchedBySourceAndRef(k,W,$){return this.#h([k,W,$],!0,!0)}returning(k){return new O({...this.#k,queryNode:K.cloneWithReturning(this.#k.queryNode,A(k))})}returningAll(k){return new O({...this.#k,queryNode:K.cloneWithReturning(this.#k.queryNode,R(k))})}output(k){return new O({...this.#k,queryNode:K.cloneWithOutput(this.#k.queryNode,A(k))})}outputAll(k){return new O({...this.#k,queryNode:K.cloneWithOutput(this.#k.queryNode,R(k))})}#h(k,W=!1,$=!1){let M={...this.#k,queryNode:N.cloneWithWhen(this.#k.queryNode,bW({isMatched:!1,bySource:$},k,W))};return new($?BW:vh)(M)}$call(k){return k(this)}$if(k,W){if(k)return W(this);return new O({...this.#k})}toOperationNode(){return this.#k.executor.transformQuery(this.#k.queryNode,this.#k.queryId)}compile(){return this.#k.executor.compileQuery(this.toOperationNode(),this.#k.queryId)}async execute(){let k=this.compile(),W=await this.#k.executor.executeQuery(k),{adapter:$}=this.#k.executor,M=k.query;if(M.returning&&$.supportsReturning||M.output&&$.supportsOutput)return W.rows;return[new NW(W.numAffectedRows)]}async executeTakeFirst(){let[k]=await this.execute();return k}async executeTakeFirstOrThrow(k=u){let W=await this.executeTakeFirst();if(W===void 0)throw s(k)?new k(this.toOperationNode()):k(this.toOperationNode());return W}}class BW{#k;constructor(k){this.#k=h(k)}thenDelete(){return new O({...this.#k,queryNode:N.cloneWithThen(this.#k.queryNode,Ok("delete"))})}thenDoNothing(){return new O({...this.#k,queryNode:N.cloneWithThen(this.#k.queryNode,Ok("do nothing"))})}thenUpdate(k){return new O({...this.#k,queryNode:N.cloneWithThen(this.#k.queryNode,Ok(k(new jk({queryId:this.#k.queryId,executor:qk,queryNode:o.createWithoutTable()}))))})}thenUpdateSet(...k){return this.thenUpdate((W)=>W.set(...k))}}class vh{#k;constructor(k){this.#k=h(k)}thenDoNothing(){return new O({...this.#k,queryNode:N.cloneWithThen(this.#k.queryNode,Ok("do nothing"))})}thenInsertValues(k){let[W,$]=KW(k);return new O({...this.#k,queryNode:N.cloneWithThen(this.#k.queryNode,Ok(w.cloneWith(w.createWithoutInto(),{columns:W,values:$})))})}}class Pk{#k;constructor(k){this.#k=h(k)}selectFrom(k){return nk({queryId:T(),executor:this.#k.executor,queryNode:Y.createFrom(n(k),this.#k.withNode)})}selectNoFrom(k){return nk({queryId:T(),executor:this.#k.executor,queryNode:Y.cloneWithSelections(Y.create(this.#k.withNode),A(k))})}insertInto(k){return new D({queryId:T(),executor:this.#k.executor,queryNode:w.create(F(k),this.#k.withNode)})}replaceInto(k){return new D({queryId:T(),executor:this.#k.executor,queryNode:w.create(F(k),this.#k.withNode,!0)})}deleteFrom(k){return new HW({queryId:T(),executor:this.#k.executor,queryNode:Dk.create(n(k),this.#k.withNode)})}updateTable(k){return new jk({queryId:T(),executor:this.#k.executor,queryNode:o.create(n(k),this.#k.withNode)})}mergeInto(k){return new Hk({queryId:T(),executor:this.#k.executor,queryNode:N.create(fW(k),this.#k.withNode)})}with(k,W){let $=OW(k,W);return new Pk({...this.#k,withNode:this.#k.withNode?tk.cloneWithExpression(this.#k.withNode,$):tk.create($)})}withRecursive(k,W){let $=OW(k,W);return new Pk({...this.#k,withNode:this.#k.withNode?tk.cloneWithExpression(this.#k.withNode,$):tk.create($,{recursive:!0})})}withPlugin(k){return new Pk({...this.#k,executor:this.#k.executor.withPlugin(k)})}withoutPlugins(){return new Pk({...this.#k,executor:this.#k.executor.withoutPlugins()})}withSchema(k){return new Pk({...this.#k,executor:this.#k.executor.withPluginAtFront(new YW(k))})}}function Ph(){return new Pk({executor:qk})}function Ah(k,W){return new Rk({joinNode:Kk.create(k,wk(W))})}function _h(){return new Ck({overNode:xk.create()})}function Jk(k,W){if(W.length===3)return K$(k,W[0],W[1],W[2]);else if(W.length===2)return M$(k,W[0],W[1]);else if(W.length===1)return G$(k,W[0]);else throw Error("not implemented")}function M$(k,W,$){return $(Ah(k,W)).toOperationNode()}function K$(k,W,$,M){return Kk.createWithOn(k,wk(W),m($,"=",M))}function G$(k,W){return Kk.create(k,wk(W))}var mh=h({is(k){return k.kind==="OffsetNode"},create(k){return h({kind:"OffsetNode",offset:k})}});var Rh=h({is(k){return k.kind==="GroupByItemNode"},create(k){return h({kind:"GroupByItemNode",groupBy:k})}});function fh(k){return k=_(k)?k(d()):k,Gk(k).map(Rh.create)}function Tk(k,W,$){if(_(W))W=W(XW());if(!j(W))W=[W];return W.map((M)=>Ch.create(k,p(M),$))}class Z{#k;constructor(k){this.#k=k}get expressionType(){return}as(k){return new zW(this,k)}or(...k){return new DW(hk.create(this.#k,L(k)))}and(...k){return new LW(x.create(this.#k,L(k)))}$castTo(){return new Z(this.#k)}$notNull(){return new Z(this.#k)}toOperationNode(){return this.#k}}class zW{#k;#W;constructor(k,W){this.#k=k,this.#W=W}get expression(){return this.#k}get alias(){return this.#W}toOperationNode(){return I.create(this.#k.toOperationNode(),z(this.#W)?this.#W.toOperationNode():J.create(this.#W))}}class DW{#k;constructor(k){this.#k=k}get expressionType(){return}as(k){return new zW(this,k)}or(...k){return new DW(hk.create(this.#k,L(k)))}$castTo(){return new DW(this.#k)}toOperationNode(){return Xk.create(this.#k)}}class LW{#k;constructor(k){this.#k=k}get expressionType(){return}as(k){return new zW(this,k)}and(...k){return new LW(x.create(this.#k,L(k)))}$castTo(){return new LW(this.#k)}toOperationNode(){return Xk.create(this.#k)}}var Sh=h({is(k){return k.kind==="FetchNode"},create(k,W){return{kind:"FetchNode",rowCount:Q.create(k),modifier:W}}});function Ih(k,W){if(!_k(k)&&!GW(k))throw Error(`Invalid fetch row count: ${k}`);if(!H$(W))throw Error(`Invalid fetch modifier: ${W}`);return Sh.create(k,W)}function H$(k){return k==="only"||k==="with ties"}var H;class xW{#k;constructor(k){this.#k=h(k)}get expressionType(){return}get isSelectQueryBuilder(){return!0}where(...k){return new H({...this.#k,queryNode:K.cloneWithWhere(this.#k.queryNode,L(k))})}whereRef(k,W,$){return new H({...this.#k,queryNode:K.cloneWithWhere(this.#k.queryNode,m(k,W,$))})}having(...k){return new H({...this.#k,queryNode:Y.cloneWithHaving(this.#k.queryNode,L(k))})}havingRef(k,W,$){return new H({...this.#k,queryNode:Y.cloneWithHaving(this.#k.queryNode,m(k,W,$))})}select(k){return new H({...this.#k,queryNode:Y.cloneWithSelections(this.#k.queryNode,A(k))})}distinctOn(k){return new H({...this.#k,queryNode:Y.cloneWithDistinctOn(this.#k.queryNode,Gk(k))})}modifyFront(k){return new H({...this.#k,queryNode:Y.cloneWithFrontModifier(this.#k.queryNode,a.createWithExpression(k.toOperationNode()))})}modifyEnd(k){return new H({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,a.createWithExpression(k.toOperationNode()))})}distinct(){return new H({...this.#k,queryNode:Y.cloneWithFrontModifier(this.#k.queryNode,a.create("Distinct"))})}forUpdate(k){return new H({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,a.create("ForUpdate",k?dk(k).map(F):void 0))})}forShare(k){return new H({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,a.create("ForShare",k?dk(k).map(F):void 0))})}forKeyShare(k){return new H({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,a.create("ForKeyShare",k?dk(k).map(F):void 0))})}forNoKeyUpdate(k){return new H({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,a.create("ForNoKeyUpdate",k?dk(k).map(F):void 0))})}skipLocked(){return new H({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,a.create("SkipLocked"))})}noWait(){return new H({...this.#k,queryNode:K.cloneWithEndModifier(this.#k.queryNode,a.create("NoWait"))})}selectAll(k){return new H({...this.#k,queryNode:Y.cloneWithSelections(this.#k.queryNode,R(k))})}innerJoin(...k){return this.#W("InnerJoin",k)}leftJoin(...k){return this.#W("LeftJoin",k)}rightJoin(...k){return this.#W("RightJoin",k)}fullJoin(...k){return this.#W("FullJoin",k)}crossJoin(...k){return this.#W("CrossJoin",k)}innerJoinLateral(...k){return this.#W("LateralInnerJoin",k)}leftJoinLateral(...k){return this.#W("LateralLeftJoin",k)}crossJoinLateral(...k){return this.#W("LateralCrossJoin",k)}crossApply(...k){return this.#W("CrossApply",k)}outerApply(...k){return this.#W("OuterApply",k)}#W(k,W){return new H({...this.#k,queryNode:K.cloneWithJoin(this.#k.queryNode,Jk(k,W))})}orderBy(...k){return new H({...this.#k,queryNode:K.cloneWithOrderByItems(this.#k.queryNode,B(k))})}groupBy(k){return new H({...this.#k,queryNode:Y.cloneWithGroupByItems(this.#k.queryNode,fh(k))})}limit(k){return new H({...this.#k,queryNode:Y.cloneWithLimit(this.#k.queryNode,Ik.create(X(k)))})}offset(k){return new H({...this.#k,queryNode:Y.cloneWithOffset(this.#k.queryNode,mh.create(X(k)))})}fetch(k,W="only"){return new H({...this.#k,queryNode:Y.cloneWithFetch(this.#k.queryNode,Ih(k,W))})}top(k,W){return new H({...this.#k,queryNode:K.cloneWithTop(this.#k.queryNode,i(k,W))})}union(k){return new H({...this.#k,queryNode:Y.cloneWithSetOperations(this.#k.queryNode,Tk("union",k,!1))})}unionAll(k){return new H({...this.#k,queryNode:Y.cloneWithSetOperations(this.#k.queryNode,Tk("union",k,!0))})}intersect(k){return new H({...this.#k,queryNode:Y.cloneWithSetOperations(this.#k.queryNode,Tk("intersect",k,!1))})}intersectAll(k){return new H({...this.#k,queryNode:Y.cloneWithSetOperations(this.#k.queryNode,Tk("intersect",k,!0))})}except(k){return new H({...this.#k,queryNode:Y.cloneWithSetOperations(this.#k.queryNode,Tk("except",k,!1))})}exceptAll(k){return new H({...this.#k,queryNode:Y.cloneWithSetOperations(this.#k.queryNode,Tk("except",k,!0))})}as(k){return new jh(this,k)}clearSelect(){return new H({...this.#k,queryNode:Y.cloneWithoutSelections(this.#k.queryNode)})}clearWhere(){return new H({...this.#k,queryNode:K.cloneWithoutWhere(this.#k.queryNode)})}clearLimit(){return new H({...this.#k,queryNode:Y.cloneWithoutLimit(this.#k.queryNode)})}clearOffset(){return new H({...this.#k,queryNode:Y.cloneWithoutOffset(this.#k.queryNode)})}clearOrderBy(){return new H({...this.#k,queryNode:K.cloneWithoutOrderBy(this.#k.queryNode)})}clearGroupBy(){return new H({...this.#k,queryNode:Y.cloneWithoutGroupBy(this.#k.queryNode)})}$call(k){return k(this)}$if(k,W){if(k)return W(this);return new H({...this.#k})}$castTo(){return new H(this.#k)}$narrowType(){return new H(this.#k)}$assertType(){return new H(this.#k)}$asTuple(){return new Z(this.toOperationNode())}$asScalar(){return new Z(this.toOperationNode())}withPlugin(k){return new H({...this.#k,executor:this.#k.executor.withPlugin(k)})}toOperationNode(){return this.#k.executor.transformQuery(this.#k.queryNode,this.#k.queryId)}compile(){return this.#k.executor.compileQuery(this.toOperationNode(),this.#k.queryId)}async execute(){let k=this.compile();return(await this.#k.executor.executeQuery(k)).rows}async executeTakeFirst(){let[k]=await this.execute();return k}async executeTakeFirstOrThrow(k=u){let W=await this.executeTakeFirst();if(W===void 0)throw s(k)?new k(this.toOperationNode()):k(this.toOperationNode());return W}async*stream(k=100){let W=this.compile(),$=this.#k.executor.stream(W,k);for await(let M of $)yield*M.rows}async explain(k,W){return await new H({...this.#k,queryNode:K.cloneWithExplain(this.#k.queryNode,k,W)}).execute()}}H=xW;function nk(k){return new xW(k)}class jh{#k;#W;constructor(k,W){this.#k=k,this.#W=W}get expression(){return this.#k}get alias(){return this.#W}get isAliasedSelectQueryBuilder(){return!0}toOperationNode(){return I.create(this.#k.toOperationNode(),J.create(this.#W))}}var e=h({is(k){return k.kind==="AggregateFunctionNode"},create(k,W=[]){return h({kind:"AggregateFunctionNode",func:k,aggregated:W})},cloneWithDistinct(k){return h({...k,distinct:!0})},cloneWithOrderBy(k,W,$=!1){let M=$?"withinGroup":"orderBy";return h({...k,[M]:k[M]?$k.cloneWithItems(k[M],W):$k.create(W)})},cloneWithFilter(k,W){return h({...k,filter:k.filter?C.cloneWithOperation(k.filter,"And",W):C.create(W)})},cloneWithOrFilter(k,W){return h({...k,filter:k.filter?C.cloneWithOperation(k.filter,"Or",W):C.create(W)})},cloneWithOver(k,W){return h({...k,over:W})}});var cW=h({is(k){return k.kind==="FunctionNode"},create(k,W){return h({kind:"FunctionNode",func:k,arguments:W})}});class b{#k;constructor(k){this.#k=h(k)}get expressionType(){return}as(k){return new Eh(this,k)}distinct(){return new b({...this.#k,aggregateFunctionNode:e.cloneWithDistinct(this.#k.aggregateFunctionNode)})}orderBy(...k){return new b({...this.#k,aggregateFunctionNode:K.cloneWithOrderByItems(this.#k.aggregateFunctionNode,B(k))})}clearOrderBy(){return new b({...this.#k,aggregateFunctionNode:K.cloneWithoutOrderBy(this.#k.aggregateFunctionNode)})}withinGroupOrderBy(...k){return new b({...this.#k,aggregateFunctionNode:e.cloneWithOrderBy(this.#k.aggregateFunctionNode,B(k),!0)})}filterWhere(...k){return new b({...this.#k,aggregateFunctionNode:e.cloneWithFilter(this.#k.aggregateFunctionNode,L(k))})}filterWhereRef(k,W,$){return new b({...this.#k,aggregateFunctionNode:e.cloneWithFilter(this.#k.aggregateFunctionNode,m(k,W,$))})}over(k){let W=_h();return new b({...this.#k,aggregateFunctionNode:e.cloneWithOver(this.#k.aggregateFunctionNode,(k?k(W):W).toOperationNode())})}$call(k){return k(this)}$castTo(){return new b(this.#k)}$notNull(){return new b(this.#k)}toOperationNode(){return this.#k.aggregateFunctionNode}}class Eh{#k;#W;constructor(k,W){this.#k=k,this.#W=W}get expression(){return this.#k}get alias(){return this.#W}toOperationNode(){return I.create(this.#k.toOperationNode(),J.create(this.#W))}}function Oh(){let k=($,M)=>{return new Z(cW.create($,Gk(M??[])))},W=($,M)=>{return new b({aggregateFunctionNode:e.create($,M?Gk(M):void 0)})};return Object.assign(k,{agg:W,avg($){return W("avg",[$])},coalesce(...$){return k("coalesce",$)},count($){return W("count",[$])},countAll($){return new b({aggregateFunctionNode:e.create("count",R($))})},max($){return W("max",[$])},min($){return W("min",[$])},sum($){return W("sum",[$])},any($){return k("any",[$])},jsonAgg($){return new b({aggregateFunctionNode:e.create("json_agg",[V($)?F($):$.toOperationNode()])})},toJson($){return new Z(cW.create("to_json",[V($)?F($):$.toOperationNode()]))}})}var bh=h({is(k){return k.kind==="UnaryOperationNode"},create(k,W){return h({kind:"UnaryOperationNode",operator:k,operand:W})}});function Qh(k,W){return bh.create(y.create(k),f(W))}var l=h({is(k){return k.kind==="CaseNode"},create(k){return h({kind:"CaseNode",value:k})},cloneWithWhen(k,W){return h({...k,when:h(k.when?[...k.when,W]:[W])})},cloneWithThen(k,W){return h({...k,when:k.when?h([...k.when.slice(0,-1),Mk.cloneWithResult(k.when[k.when.length-1],W)]):void 0})},cloneWith(k,W){return h({...k,...W})}});class yW{#k;constructor(k){this.#k=h(k)}when(...k){return new gW({...this.#k,node:l.cloneWithWhen(this.#k.node,Mk.create(L(k)))})}}class gW{#k;constructor(k){this.#k=h(k)}then(k){return new Nh({...this.#k,node:l.cloneWithThen(this.#k.node,WW(k)?Bk(k):X(k))})}}class Nh{#k;constructor(k){this.#k=h(k)}when(...k){return new gW({...this.#k,node:l.cloneWithWhen(this.#k.node,Mk.create(L(k)))})}else(k){return new Bh({...this.#k,node:l.cloneWith(this.#k.node,{else:WW(k)?Bk(k):X(k)})})}end(){return new Z(l.cloneWith(this.#k.node,{isStatement:!1}))}endCase(){return new Z(l.cloneWith(this.#k.node,{isStatement:!0}))}}class Bh{#k;constructor(k){this.#k=h(k)}end(){return new Z(l.cloneWith(this.#k.node,{isStatement:!1}))}endCase(){return new Z(l.cloneWith(this.#k.node,{isStatement:!0}))}}var JW=h({is(k){return k.kind==="JSONOperatorChainNode"},create(k){return h({kind:"JSONOperatorChainNode",operator:k,values:h([])})},cloneWithValue(k,W){return h({...k,values:h([...k.values,W])})}});var tW=h({is(k){return k.kind==="JSONPathLegNode"},create(k,W){return h({kind:"JSONPathLegNode",type:k,value:W})}});var Uk=h({is(k){return k.kind==="JSONPathNode"},create(k){return h({kind:"JSONPathNode",inOperator:k,pathLegs:h([])})},cloneWithLeg(k,W){return h({...k,pathLegs:h([...k.pathLegs,W])})}});var Qk=h({is(k){return k.kind==="JSONReferenceNode"},create(k,W){return h({kind:"JSONReferenceNode",reference:k,traversal:W})},cloneWithTraversal(k,W){return h({...k,traversal:W})}});var Z$=/^#-\d+$/;class ik{#k;constructor(k){this.#k=k}at(k){if(typeof k!=="number"&&typeof k!=="string"||typeof k==="number"&&!Number.isInteger(k)||typeof k==="string"&&k!=="last"&&!Z$.test(k))throw Error(`Unexpected index value in .at(...): ${k}`);return this.#W("ArrayLocation",k)}key(k){return this.#W("Member",k)}#W(k,W){if(Qk.is(this.#k))return new uk(Qk.cloneWithTraversal(this.#k,Uk.is(this.#k.traversal)?Uk.cloneWithLeg(this.#k.traversal,tW.create(k,W)):JW.cloneWithValue(this.#k.traversal,Q.createImmediate(W))));return new uk(Uk.cloneWithLeg(this.#k,tW.create(k,W)))}}class uk extends ik{#k;constructor(k){super(k);this.#k=k}get expressionType(){return}as(k){return new xh(this,k)}$castTo(){return new uk(this.#k)}$notNull(){return new uk(this.#k)}toOperationNode(){return this.#k}}class xh{#k;#W;constructor(k,W){this.#k=k,this.#W=W}get expression(){return this.#k}get alias(){return this.#W}toOperationNode(){return I.create(this.#k.toOperationNode(),z(this.#W)?this.#W.toOperationNode():J.create(this.#W))}}var nW=h({is(k){return k.kind==="TupleNode"},create(k){return h({kind:"TupleNode",values:h(k)})}});var Y$=["varchar","char","text","integer","int2","int4","int8","smallint","bigint","boolean","real","double precision","float4","float8","decimal","numeric","binary","bytea","date","datetime","time","timetz","timestamp","timestamptz","serial","bigserial","uuid","json","jsonb","blob","varbinary","int4range","int4multirange","int8range","int8multirange","numrange","nummultirange","tsrange","tsmultirange","tstzrange","tstzmultirange","daterange","datemultirange"],X$=[/^varchar\(\d+\)$/,/^char\(\d+\)$/,/^decimal\(\d+, \d+\)$/,/^numeric\(\d+, \d+\)$/,/^binary\(\d+\)$/,/^datetime\(\d+\)$/,/^time\(\d+\)$/,/^timetz\(\d+\)$/,/^timestamp\(\d+\)$/,/^timestamptz\(\d+\)$/,/^varbinary\(\d+\)$/],ch=h({is(k){return k.kind==="DataTypeNode"},create(k){return h({kind:"DataTypeNode",dataType:k})}});function yh(k){if(Y$.includes(k))return!0;if(X$.some((W)=>W.test(k)))return!0;return!1}function gh(k){if(z(k))return k.toOperationNode();if(yh(k))return ch.create(k);throw Error(`invalid column data type ${JSON.stringify(k)}`)}var th=h({is(k){return k.kind==="CastNode"},create(k,W){return h({kind:"CastNode",expression:k,dataType:W})}});function XW(k=qk){function W(G,q,vk){return new Z(hW(G,q,vk))}function $(G,q){return new Z(Qh(G,q))}let M=Object.assign(W,{fn:void 0,eb:void 0,selectFrom(G){return nk({queryId:T(),executor:k,queryNode:Y.createFrom(n(G))})},case(G){return new yW({node:l.create(c(G)?void 0:f(G))})},ref(G,q){if(c(q))return new Z(t(G));return new ik(nh(G,q))},jsonPath(){return new ik(Uk.create())},table(G){return new Z(F(G))},val(G){return new Z(X(G))},refTuple(...G){return new Z(nW.create(G.map(f)))},tuple(...G){return new Z(nW.create(G.map(X)))},lit(G){return new Z(Bk(G))},unary:$,not(G){return $("not",G)},exists(G){return $("exists",G)},neg(G){return $("-",G)},between(G,q,vk){return new Z(Yk.create(f(G),y.create("between"),x.create(X(q),X(vk))))},betweenSymmetric(G,q,vk){return new Z(Yk.create(f(G),y.create("between symmetric"),x.create(X(q),X(vk))))},and(G){if(j(G))return new Z(mk(G,"and"));return new Z(UW(G,"and"))},or(G){if(j(G))return new Z(mk(G,"or"));return new Z(UW(G,"or"))},parens(...G){let q=L(G);if(Xk.is(q))return new Z(q);else return new Z(Xk.create(q))},cast(G,q){return new Z(th.create(f(G),gh(q)))},withSchema(G){return XW(k.withPluginAtFront(new YW(G)))}});return M.fn=Oh(),M.eb=M,M}function d(k){return XW()}function p(k){if(z(k))return k.toOperationNode();else if(_(k))return k(d()).toOperationNode();throw Error(`invalid expression: ${JSON.stringify(k)}`)}function MW(k){if(z(k))return k.toOperationNode();else if(_(k))return k(d()).toOperationNode();throw Error(`invalid aliased expression: ${JSON.stringify(k)}`)}function Wk(k){return ok(k)||iW(k)||_(k)}function _W(k){if(V(k))return t(k);return k.toOperationNode()}function Gk(k){if(j(k))return k.map((W)=>f(W));else return[f(k)]}function f(k){if(Wk(k))return p(k);return _W(k)}function nh(k,W){let $=t(k);if(dW(W))return Qk.create($,JW.create(y.create(W)));let M=W.slice(0,-1);if(dW(M))return Qk.create($,Uk.create(y.create(M)));throw Error(`Invalid JSON operator: ${W}`)}function t(k){if(!k.includes("."))return Ak.create(S.create(k));let $=k.split(".").map(uW);if($.length===3)return L$($);if($.length===2)return z$($);throw Error(`invalid column reference ${k}`)}function Zh(k){if(k.includes(" as ")){let[$,M]=k.split(" as ").map(uW);return I.create(t($),J.create(M))}else return t(k)}function D$(k){return S.create(k)}function R3(k){if(k.includes(" ")){let[$,M]=k.split(" ").map(uW);if(!RW(M))throw Error(`invalid order direction "${M}" next to "${$}"`);return B([$,M])[0]}else return D$(k)}function L$(k){let[W,$,M]=k;return Ak.create(S.create(M),zk.createWithSchema(W,$))}function z$(k){let[W,$]=k;return Ak.create(S.create($),zk.create(W))}function uW(k){return k.trim()}class lk{#k;constructor(k){this.#k=h(k)}get expressionType(){return}get isRawBuilder(){return!0}as(k){return new dh(this,k)}$castTo(){return new lk({...this.#k})}$notNull(){return new lk(this.#k)}withPlugin(k){return new lk({...this.#k,plugins:this.#k.plugins!==void 0?h([...this.#k.plugins,k]):h([k])})}toOperationNode(){return this.#h(this.#W())}compile(k){return this.#$(this.#W(k))}async execute(k){let W=this.#W(k);return W.executeQuery(this.#$(W))}#W(k){let W=k!==void 0?k.getExecutor():qk;return this.#k.plugins!==void 0?W.withPlugins(this.#k.plugins):W}#h(k){return k.transformQuery(this.#k.rawNode,this.#k.queryId)}#$(k){return k.compileQuery(this.#h(k),this.#k.queryId)}}function Zk(k){return new lk(k)}class dh{#k;#W;constructor(k,W){this.#k=k,this.#W=W}get expression(){return this.#k}get alias(){return this.#W}get rawBuilder(){return this.#k}toOperationNode(){return I.create(this.#k.toOperationNode(),z(this.#W)?this.#W.toOperationNode():J.create(this.#W))}}var J$=Object.assign((k,...W)=>{return Zk({queryId:T(),rawNode:v.create(k,W?.map(uh)??[])})},{ref(k){return Zk({queryId:T(),rawNode:v.createWithChild(t(k))})},val(k){return Zk({queryId:T(),rawNode:v.createWithChild(X(k))})},value(k){return this.val(k)},table(k){return Zk({queryId:T(),rawNode:v.createWithChild(F(k))})},id(...k){let W=Array(k.length+1).fill(".");return W[0]="",W[W.length-1]="",Zk({queryId:T(),rawNode:v.create(W,k.map(J.create))})},lit(k){return Zk({queryId:T(),rawNode:v.createWithChild(Q.createImmediate(k))})},literal(k){return this.lit(k)},raw(k){return Zk({queryId:T(),rawNode:v.createWithSql(k)})},join(k,W=J$`, `){let $=Array(Math.max(2*k.length-1,0)),M=W.toOperationNode();for(let G=0;G<k.length;++G)if($[2*G]=uh(k[G]),G!==k.length-1)$[2*G+1]=M;return Zk({queryId:T(),rawNode:v.createWithChildren($)})}});function uh(k){if(z(k))return k.toOperationNode();return X(k)}var l3=h({raw(k,W=[]){return h({sql:k,query:v.createWithSql(k),parameters:h(W),queryId:T()})}});
3
- export{z as sb,S as tb,pk as ub,ah as vb,t as wb,D$ as xb,R3 as yb,rk as zb,Q as Ab,L as Bb,K as Cb,Y as Db,Vh as Eb,T as Fb,ZW as Gb,Th as Hb,QW as Ib,Pk as Jb,Oh as Kb,l as Lb,yW as Mb,gh as Nb,p as Ob,oh as Pb,F as Qb,J$ as Rb,l3 as Sb};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Rb as P,Sb as J}from"./chunk-n8gsjwht.js";import{Fc as V,Gc as W,Hc as X}from"./chunk-8rcfhfq5.js";import"./chunk-txkmks1h.js";var Y=class{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(){}async releaseMigrationLock(){}get supportsOutput(){return!0}},Z=class{#h;#j=new k;#z;#H;constructor(h){this.#h={...h}}async init(){if(this.#z=this.#h.database,this.#H=new $(this.#z),this.#h.onCreateConnection)await this.#h.onCreateConnection(this.#H)}async acquireConnection(){return await this.#j.lock(),this.#H}async beginTransaction(h){await h.executeQuery(J.raw("begin"))}async commitTransaction(h){await h.executeQuery(J.raw("commit"))}async rollbackTransaction(h){await h.executeQuery(J.raw("rollback"))}async releaseConnection(){this.#j.unlock()}async destroy(){this.#z?.close()}},$=class{#h;constructor(h){this.#h=h}executeQuery(h){let{sql:z,parameters:H}=h,j=this.#h.prepare(z).all(...H);return Promise.resolve({rows:j})}async*streamQuery(){throw Error("Streaming query is not supported by SQLite driver.")}},k=class{#h;#j;async lock(){while(this.#h!==void 0)await this.#h;this.#h=new Promise((h)=>{this.#j=h})}unlock(){let h=this.#j;this.#h=void 0,this.#j=void 0,h?.()}},w=class{#h;constructor(h){this.#h=h}async getSchemas(){return[]}async getTables(h={withInternalKyselyTables:!1}){let z=this.#h.selectFrom("sqlite_schema").where("type","=","table").where("name","not like","sqlite_%").select("name").$castTo();if(!h.withInternalKyselyTables)z=z.where("name","!=",W).where("name","!=",X);let H=await z.execute();return Promise.all(H.map(({name:j})=>this.#j(j)))}async getMetadata(h){return{tables:await this.getTables(h)}}async#j(h){let z=this.#h,H=(await z.selectFrom("sqlite_master").where("name","=",h).select("sql").$castTo().execute())[0]?.sql?.split(/[\(\),]/)?.find((j)=>j.toLowerCase().includes("autoincrement"))?.split(/\s+/)?.[0]?.replace(/["`]/g,"");return{name:h,columns:(await z.selectFrom(P`pragma_table_info(${h})`.as("table_info")).select(["name","type","notnull","dflt_value"]).execute()).map((j)=>({name:j.name,dataType:j.type,isNullable:!j.notnull,isAutoIncrementing:j.name===H,hasDefaultValue:j.dflt_value!=null})),isView:!0}}},K=class extends V{getCurrentParameterPlaceholder(){return"?"}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}},F=class{#h;constructor(h){this.#h={...h}}createDriver(){return new Z(this.#h)}createQueryCompiler(){return new K}createAdapter(){return new Y}createIntrospector(h){return new w(h)}};export{F as NodeSqliteDialect};
@@ -1,2 +0,0 @@
1
- import{og as A}from"./chunk-7xcyn1ba.js";import{Ii as z}from"./chunk-s503pcvb.js";import{bj as v,lj as w}from"./chunk-w9p59ahz.js";var B=(b)=>({queryKey:["projects",b],queryFn:async()=>{let h=await z.api.projects[":projectId"].$get({param:{projectId:b}});if(!h.ok)throw Error("Failed to fetch project");return await h.json()}}),H=w("/projects/$projectId/folders/$folderId")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
2
- export{B as me,H as ne};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{sn as $}from"./chunk-txkmks1h.js";var Aq=$((Eq)=>{Object.defineProperty(Eq,"__esModule",{value:!0});Eq._globalThis=void 0;Eq._globalThis=typeof globalThis==="object"?globalThis:global});var yq=$((O)=>{var VZ=O&&O.__createBinding||(Object.create?function(q,z,J,Z){if(Z===void 0)Z=J;Object.defineProperty(q,Z,{enumerable:!0,get:function(){return z[J]}})}:function(q,z,J,Z){if(Z===void 0)Z=J;q[Z]=z[J]}),NZ=O&&O.__exportStar||function(q,z){for(var J in q)if(J!=="default"&&!Object.prototype.hasOwnProperty.call(z,J))VZ(z,q,J)};Object.defineProperty(O,"__esModule",{value:!0});NZ(Aq(),O)});var Pq=$((K)=>{var kZ=K&&K.__createBinding||(Object.create?function(q,z,J,Z){if(Z===void 0)Z=J;Object.defineProperty(q,Z,{enumerable:!0,get:function(){return z[J]}})}:function(q,z,J,Z){if(Z===void 0)Z=J;q[Z]=z[J]}),bZ=K&&K.__exportStar||function(q,z){for(var J in q)if(J!=="default"&&!Object.prototype.hasOwnProperty.call(z,J))kZ(z,q,J)};Object.defineProperty(K,"__esModule",{value:!0});bZ(yq(),K)});var v=$((Mq)=>{Object.defineProperty(Mq,"__esModule",{value:!0});Mq.VERSION=void 0;Mq.VERSION="1.9.0"});var Lq=$((mq)=>{Object.defineProperty(mq,"__esModule",{value:!0});mq.isCompatible=mq._makeCompatibilityCheck=void 0;var RZ=v(),vq=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function uq(q){let z=new Set([q]),J=new Set,Z=q.match(vq);if(!Z)return()=>!1;let Q={major:+Z[1],minor:+Z[2],patch:+Z[3],prerelease:Z[4]};if(Q.prerelease!=null)return function(Y){return Y===q};function H(F){return J.add(F),!1}function X(F){return z.add(F),!0}return function(Y){if(z.has(Y))return!0;if(J.has(Y))return!1;let h=Y.match(vq);if(!h)return H(Y);let G={major:+h[1],minor:+h[2],patch:+h[3],prerelease:h[4]};if(G.prerelease!=null)return H(Y);if(Q.major!==G.major)return H(Y);if(Q.major===0){if(Q.minor===G.minor&&Q.patch<=G.patch)return X(Y);return H(Y)}if(Q.minor<=G.minor)return X(Y);return H(Y)}}mq._makeCompatibilityCheck=uq;mq.isCompatible=uq(RZ.VERSION)});var B=$((xq)=>{Object.defineProperty(xq,"__esModule",{value:!0});xq.unregisterGlobal=xq.getGlobal=xq.registerGlobal=void 0;var TZ=Pq(),U=v(),AZ=Lq(),yZ=U.VERSION.split(".")[0],I=Symbol.for(`opentelemetry.js.api.${yZ}`),V=TZ._globalThis;function PZ(q,z,J,Z=!1){var Q;let H=V[I]=(Q=V[I])!==null&&Q!==void 0?Q:{version:U.VERSION};if(!Z&&H[q]){let X=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${q}`);return J.error(X.stack||X.message),!1}if(H.version!==U.VERSION){let X=Error(`@opentelemetry/api: Registration of version v${H.version} for ${q} does not match previously registered API v${U.VERSION}`);return J.error(X.stack||X.message),!1}return H[q]=z,J.debug(`@opentelemetry/api: Registered a global for ${q} v${U.VERSION}.`),!0}xq.registerGlobal=PZ;function MZ(q){var z,J;let Z=(z=V[I])===null||z===void 0?void 0:z.version;if(!Z||!(0,AZ.isCompatible)(Z))return;return(J=V[I])===null||J===void 0?void 0:J[q]}xq.getGlobal=MZ;function SZ(q,z){z.debug(`@opentelemetry/api: Unregistering a global for ${q} v${U.VERSION}.`);let J=V[I];if(J)delete J[q]}xq.unregisterGlobal=SZ});var iq=$((lq)=>{Object.defineProperty(lq,"__esModule",{value:!0});lq.DiagComponentLogger=void 0;var mZ=B();class cq{constructor(q){this._namespace=q.namespace||"DiagComponentLogger"}debug(...q){return N("debug",this._namespace,q)}error(...q){return N("error",this._namespace,q)}info(...q){return N("info",this._namespace,q)}warn(...q){return N("warn",this._namespace,q)}verbose(...q){return N("verbose",this._namespace,q)}}lq.DiagComponentLogger=cq;function N(q,z,J){let Z=(0,mZ.getGlobal)("diag");if(!Z)return;return J.unshift(z),Z[q](...J)}});var E=$((nq)=>{Object.defineProperty(nq,"__esModule",{value:!0});nq.DiagLogLevel=void 0;var dZ;(function(q){q[q.NONE=0]="NONE",q[q.ERROR=30]="ERROR",q[q.WARN=50]="WARN",q[q.INFO=60]="INFO",q[q.DEBUG=70]="DEBUG",q[q.VERBOSE=80]="VERBOSE",q[q.ALL=9999]="ALL"})(dZ=nq.DiagLogLevel||(nq.DiagLogLevel={}))});var rq=$((pq)=>{Object.defineProperty(pq,"__esModule",{value:!0});pq.createLogLevelDiagLogger=void 0;var w=E();function LZ(q,z){if(q<w.DiagLogLevel.NONE)q=w.DiagLogLevel.NONE;else if(q>w.DiagLogLevel.ALL)q=w.DiagLogLevel.ALL;z=z||{};function J(Z,Q){let H=z[Z];if(typeof H==="function"&&q>=Q)return H.bind(z);return function(){}}return{error:J("error",w.DiagLogLevel.ERROR),warn:J("warn",w.DiagLogLevel.WARN),info:J("info",w.DiagLogLevel.INFO),debug:J("debug",w.DiagLogLevel.DEBUG),verbose:J("verbose",w.DiagLogLevel.VERBOSE)}}pq.createLogLevelDiagLogger=LZ});var f=$((tq)=>{Object.defineProperty(tq,"__esModule",{value:!0});tq.DiagAPI=void 0;var xZ=iq(),_Z=rq(),oq=E(),T=B(),cZ="diag";class m{constructor(){function q(Z){return function(...Q){let H=(0,T.getGlobal)("diag");if(!H)return;return H[Z](...Q)}}let z=this,J=(Z,Q={logLevel:oq.DiagLogLevel.INFO})=>{var H,X,F;if(Z===z){let G=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return z.error((H=G.stack)!==null&&H!==void 0?H:G.message),!1}if(typeof Q==="number")Q={logLevel:Q};let Y=(0,T.getGlobal)("diag"),h=(0,_Z.createLogLevelDiagLogger)((X=Q.logLevel)!==null&&X!==void 0?X:oq.DiagLogLevel.INFO,Z);if(Y&&!Q.suppressOverrideMessage){let G=(F=Error().stack)!==null&&F!==void 0?F:"<failed to generate stacktrace>";Y.warn(`Current logger will be overwritten from ${G}`),h.warn(`Current logger will overwrite one already registered from ${G}`)}return(0,T.registerGlobal)("diag",h,z,!0)};z.setLogger=J,z.disable=()=>{(0,T.unregisterGlobal)(cZ,z)},z.createComponentLogger=(Z)=>{return new xZ.DiagComponentLogger(Z)},z.verbose=q("verbose"),z.debug=q("debug"),z.info=q("info"),z.warn=q("warn"),z.error=q("error")}static instance(){if(!this._instance)this._instance=new m;return this._instance}}tq.DiagAPI=m});var zz=$((eq)=>{Object.defineProperty(eq,"__esModule",{value:!0});eq.BaggageImpl=void 0;class j{constructor(q){this._entries=q?new Map(q):new Map}getEntry(q){let z=this._entries.get(q);if(!z)return;return Object.assign({},z)}getAllEntries(){return Array.from(this._entries.entries()).map(([q,z])=>[q,z])}setEntry(q,z){let J=new j(this._entries);return J._entries.set(q,z),J}removeEntry(q){let z=new j(this._entries);return z._entries.delete(q),z}removeEntries(...q){let z=new j(this._entries);for(let J of q)z._entries.delete(J);return z}clear(){return new j}}eq.BaggageImpl=j});var $z=$((Jz)=>{Object.defineProperty(Jz,"__esModule",{value:!0});Jz.baggageEntryMetadataSymbol=void 0;Jz.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var d=$((Qz)=>{Object.defineProperty(Qz,"__esModule",{value:!0});Qz.baggageEntryMetadataFromString=Qz.createBaggage=void 0;var lZ=f(),gZ=zz(),iZ=$z(),nZ=lZ.DiagAPI.instance();function pZ(q={}){return new gZ.BaggageImpl(new Map(Object.entries(q)))}Qz.createBaggage=pZ;function sZ(q){if(typeof q!=="string")nZ.error(`Cannot create baggage metadata from unknown type: ${typeof q}`),q="";return{__TYPE__:iZ.baggageEntryMetadataSymbol,toString(){return q}}}Qz.baggageEntryMetadataFromString=sZ});var k=$((Hz)=>{Object.defineProperty(Hz,"__esModule",{value:!0});Hz.ROOT_CONTEXT=Hz.createContextKey=void 0;function oZ(q){return Symbol.for(q)}Hz.createContextKey=oZ;class A{constructor(q){let z=this;z._currentContext=q?new Map(q):new Map,z.getValue=(J)=>z._currentContext.get(J),z.setValue=(J,Z)=>{let Q=new A(z._currentContext);return Q._currentContext.set(J,Z),Q},z.deleteValue=(J)=>{let Z=new A(z._currentContext);return Z._currentContext.delete(J),Z}}}Hz.ROOT_CONTEXT=new A});var hz=$((Fz)=>{Object.defineProperty(Fz,"__esModule",{value:!0});Fz.DiagConsoleLogger=void 0;var L=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class Yz{constructor(){function q(z){return function(...J){if(console){let Z=console[z];if(typeof Z!=="function")Z=console.log;if(typeof Z==="function")return Z.apply(console,J)}}}for(let z=0;z<L.length;z++)this[L[z].n]=q(L[z].c)}}Fz.DiagConsoleLogger=Yz});var s=$((wz)=>{Object.defineProperty(wz,"__esModule",{value:!0});wz.createNoopMeter=wz.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=wz.NOOP_OBSERVABLE_GAUGE_METRIC=wz.NOOP_OBSERVABLE_COUNTER_METRIC=wz.NOOP_UP_DOWN_COUNTER_METRIC=wz.NOOP_HISTOGRAM_METRIC=wz.NOOP_GAUGE_METRIC=wz.NOOP_COUNTER_METRIC=wz.NOOP_METER=wz.NoopObservableUpDownCounterMetric=wz.NoopObservableGaugeMetric=wz.NoopObservableCounterMetric=wz.NoopObservableMetric=wz.NoopHistogramMetric=wz.NoopGaugeMetric=wz.NoopUpDownCounterMetric=wz.NoopCounterMetric=wz.NoopMetric=wz.NoopMeter=void 0;class x{constructor(){}createGauge(q,z){return wz.NOOP_GAUGE_METRIC}createHistogram(q,z){return wz.NOOP_HISTOGRAM_METRIC}createCounter(q,z){return wz.NOOP_COUNTER_METRIC}createUpDownCounter(q,z){return wz.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(q,z){return wz.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(q,z){return wz.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(q,z){return wz.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(q,z){}removeBatchObservableCallback(q){}}wz.NoopMeter=x;class D{}wz.NoopMetric=D;class _ extends D{add(q,z){}}wz.NoopCounterMetric=_;class c extends D{add(q,z){}}wz.NoopUpDownCounterMetric=c;class l extends D{record(q,z){}}wz.NoopGaugeMetric=l;class g extends D{record(q,z){}}wz.NoopHistogramMetric=g;class b{addCallback(q){}removeCallback(q){}}wz.NoopObservableMetric=b;class i extends b{}wz.NoopObservableCounterMetric=i;class n extends b{}wz.NoopObservableGaugeMetric=n;class p extends b{}wz.NoopObservableUpDownCounterMetric=p;wz.NOOP_METER=new x;wz.NOOP_COUNTER_METRIC=new _;wz.NOOP_GAUGE_METRIC=new l;wz.NOOP_HISTOGRAM_METRIC=new g;wz.NOOP_UP_DOWN_COUNTER_METRIC=new c;wz.NOOP_OBSERVABLE_COUNTER_METRIC=new i;wz.NOOP_OBSERVABLE_GAUGE_METRIC=new n;wz.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new p;function aZ(){return wz.NOOP_METER}wz.createNoopMeter=aZ});var Nz=$((Vz)=>{Object.defineProperty(Vz,"__esModule",{value:!0});Vz.ValueType=void 0;var Y0;(function(q){q[q.INT=0]="INT",q[q.DOUBLE=1]="DOUBLE"})(Y0=Vz.ValueType||(Vz.ValueType={}))});var o=$((kz)=>{Object.defineProperty(kz,"__esModule",{value:!0});kz.defaultTextMapSetter=kz.defaultTextMapGetter=void 0;kz.defaultTextMapGetter={get(q,z){if(q==null)return;return q[z]},keys(q){if(q==null)return[];return Object.keys(q)}};kz.defaultTextMapSetter={set(q,z,J){if(q==null)return;q[z]=J}}});var Az=$((Ez)=>{Object.defineProperty(Ez,"__esModule",{value:!0});Ez.NoopContextManager=void 0;var G0=k();class Rz{active(){return G0.ROOT_CONTEXT}with(q,z,J,...Z){return z.call(J,...Z)}bind(q,z){return z}enable(){return this}disable(){return this}}Ez.NoopContextManager=Rz});var R=$((Pz)=>{Object.defineProperty(Pz,"__esModule",{value:!0});Pz.ContextAPI=void 0;var h0=Az(),t=B(),yz=f(),a="context",w0=new h0.NoopContextManager;class e{constructor(){}static getInstance(){if(!this._instance)this._instance=new e;return this._instance}setGlobalContextManager(q){return(0,t.registerGlobal)(a,q,yz.DiagAPI.instance())}active(){return this._getContextManager().active()}with(q,z,J,...Z){return this._getContextManager().with(q,z,J,...Z)}bind(q,z){return this._getContextManager().bind(q,z)}_getContextManager(){return(0,t.getGlobal)(a)||w0}disable(){this._getContextManager().disable(),(0,t.unregisterGlobal)(a,yz.DiagAPI.instance())}}Pz.ContextAPI=e});var zq=$((Sz)=>{Object.defineProperty(Sz,"__esModule",{value:!0});Sz.TraceFlags=void 0;var O0;(function(q){q[q.NONE=0]="NONE",q[q.SAMPLED=1]="SAMPLED"})(O0=Sz.TraceFlags||(Sz.TraceFlags={}))});var y=$((vz)=>{Object.defineProperty(vz,"__esModule",{value:!0});vz.INVALID_SPAN_CONTEXT=vz.INVALID_TRACEID=vz.INVALID_SPANID=void 0;var K0=zq();vz.INVALID_SPANID="0000000000000000";vz.INVALID_TRACEID="00000000000000000000000000000000";vz.INVALID_SPAN_CONTEXT={traceId:vz.INVALID_TRACEID,spanId:vz.INVALID_SPANID,traceFlags:K0.TraceFlags.NONE}});var P=$((xz)=>{Object.defineProperty(xz,"__esModule",{value:!0});xz.NonRecordingSpan=void 0;var B0=y();class Lz{constructor(q=B0.INVALID_SPAN_CONTEXT){this._spanContext=q}spanContext(){return this._spanContext}setAttribute(q,z){return this}setAttributes(q){return this}addEvent(q,z){return this}addLink(q){return this}addLinks(q){return this}setStatus(q){return this}updateName(q){return this}end(q){}isRecording(){return!1}recordException(q,z){}}xz.NonRecordingSpan=Lz});var $q=$((lz)=>{Object.defineProperty(lz,"__esModule",{value:!0});lz.getSpanContext=lz.setSpanContext=lz.deleteSpan=lz.setSpan=lz.getActiveSpan=lz.getSpan=void 0;var f0=k(),U0=P(),j0=R(),Jq=(0,f0.createContextKey)("OpenTelemetry Context Key SPAN");function Zq(q){return q.getValue(Jq)||void 0}lz.getSpan=Zq;function D0(){return Zq(j0.ContextAPI.getInstance().active())}lz.getActiveSpan=D0;function cz(q,z){return q.setValue(Jq,z)}lz.setSpan=cz;function C0(q){return q.deleteValue(Jq)}lz.deleteSpan=C0;function I0(q,z){return cz(q,new U0.NonRecordingSpan(z))}lz.setSpanContext=I0;function V0(q){var z;return(z=Zq(q))===null||z===void 0?void 0:z.spanContext()}lz.getSpanContext=V0});var M=$((sz)=>{Object.defineProperty(sz,"__esModule",{value:!0});sz.wrapSpanContext=sz.isSpanContextValid=sz.isValidSpanId=sz.isValidTraceId=void 0;var iz=y(),T0=P(),A0=/^([0-9a-f]{32})$/i,y0=/^[0-9a-f]{16}$/i;function nz(q){return A0.test(q)&&q!==iz.INVALID_TRACEID}sz.isValidTraceId=nz;function pz(q){return y0.test(q)&&q!==iz.INVALID_SPANID}sz.isValidSpanId=pz;function P0(q){return nz(q.traceId)&&pz(q.spanId)}sz.isSpanContextValid=P0;function M0(q){return new T0.NonRecordingSpan(q)}sz.wrapSpanContext=M0});var Hq=$((az)=>{Object.defineProperty(az,"__esModule",{value:!0});az.NoopTracer=void 0;var m0=R(),oz=$q(),Qq=P(),d0=M(),Wq=m0.ContextAPI.getInstance();class tz{startSpan(q,z,J=Wq.active()){if(Boolean(z===null||z===void 0?void 0:z.root))return new Qq.NonRecordingSpan;let Q=J&&(0,oz.getSpanContext)(J);if(L0(Q)&&(0,d0.isSpanContextValid)(Q))return new Qq.NonRecordingSpan(Q);else return new Qq.NonRecordingSpan}startActiveSpan(q,z,J,Z){let Q,H,X;if(arguments.length<2)return;else if(arguments.length===2)X=z;else if(arguments.length===3)Q=z,X=J;else Q=z,H=J,X=Z;let F=H!==null&&H!==void 0?H:Wq.active(),Y=this.startSpan(q,Q,F),h=(0,oz.setSpan)(F,Y);return Wq.with(h,X,void 0,Y)}}az.NoopTracer=tz;function L0(q){return typeof q==="object"&&typeof q.spanId==="string"&&typeof q.traceId==="string"&&typeof q.traceFlags==="number"}});var Xq=$((zJ)=>{Object.defineProperty(zJ,"__esModule",{value:!0});zJ.ProxyTracer=void 0;var x0=Hq(),_0=new x0.NoopTracer;class qJ{constructor(q,z,J,Z){this._provider=q,this.name=z,this.version=J,this.options=Z}startSpan(q,z,J){return this._getTracer().startSpan(q,z,J)}startActiveSpan(q,z,J,Z){let Q=this._getTracer();return Reflect.apply(Q.startActiveSpan,Q,arguments)}_getTracer(){if(this._delegate)return this._delegate;let q=this._provider.getDelegateTracer(this.name,this.version,this.options);if(!q)return _0;return this._delegate=q,this._delegate}}zJ.ProxyTracer=qJ});var WJ=$(($J)=>{Object.defineProperty($J,"__esModule",{value:!0});$J.NoopTracerProvider=void 0;var c0=Hq();class ZJ{getTracer(q,z,J){return new c0.NoopTracer}}$J.NoopTracerProvider=ZJ});var Yq=$((XJ)=>{Object.defineProperty(XJ,"__esModule",{value:!0});XJ.ProxyTracerProvider=void 0;var l0=Xq(),g0=WJ(),i0=new g0.NoopTracerProvider;class HJ{getTracer(q,z,J){var Z;return(Z=this.getDelegateTracer(q,z,J))!==null&&Z!==void 0?Z:new l0.ProxyTracer(this,q,z,J)}getDelegate(){var q;return(q=this._delegate)!==null&&q!==void 0?q:i0}setDelegate(q){this._delegate=q}getDelegateTracer(q,z,J){var Z;return(Z=this._delegate)===null||Z===void 0?void 0:Z.getTracer(q,z,J)}}XJ.ProxyTracerProvider=HJ});var GJ=$((FJ)=>{Object.defineProperty(FJ,"__esModule",{value:!0});FJ.SamplingDecision=void 0;var n0;(function(q){q[q.NOT_RECORD=0]="NOT_RECORD",q[q.RECORD=1]="RECORD",q[q.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(n0=FJ.SamplingDecision||(FJ.SamplingDecision={}))});var wJ=$((hJ)=>{Object.defineProperty(hJ,"__esModule",{value:!0});hJ.SpanKind=void 0;var p0;(function(q){q[q.INTERNAL=0]="INTERNAL",q[q.SERVER=1]="SERVER",q[q.CLIENT=2]="CLIENT",q[q.PRODUCER=3]="PRODUCER",q[q.CONSUMER=4]="CONSUMER"})(p0=hJ.SpanKind||(hJ.SpanKind={}))});var KJ=$((OJ)=>{Object.defineProperty(OJ,"__esModule",{value:!0});OJ.SpanStatusCode=void 0;var s0;(function(q){q[q.UNSET=0]="UNSET",q[q.OK=1]="OK",q[q.ERROR=2]="ERROR"})(s0=OJ.SpanStatusCode||(OJ.SpanStatusCode={}))});var UJ=$((BJ)=>{Object.defineProperty(BJ,"__esModule",{value:!0});BJ.validateValue=BJ.validateKey=void 0;var wq="[_0-9a-z-*/]",r0=`[a-z]${wq}{0,255}`,o0=`[a-z0-9]${wq}{0,240}@[a-z]${wq}{0,13}`,t0=new RegExp(`^(?:${r0}|${o0})$`),a0=/^[ -~]{0,255}[!-~]$/,e0=/,|=/;function q1(q){return t0.test(q)}BJ.validateKey=q1;function z1(q){return a0.test(q)&&!e0.test(q)}BJ.validateValue=z1});var kJ=$((VJ)=>{Object.defineProperty(VJ,"__esModule",{value:!0});VJ.TraceStateImpl=void 0;var jJ=UJ(),DJ=32,Z1=512,CJ=",",IJ="=";class Oq{constructor(q){if(this._internalState=new Map,q)this._parse(q)}set(q,z){let J=this._clone();if(J._internalState.has(q))J._internalState.delete(q);return J._internalState.set(q,z),J}unset(q){let z=this._clone();return z._internalState.delete(q),z}get(q){return this._internalState.get(q)}serialize(){return this._keys().reduce((q,z)=>{return q.push(z+IJ+this.get(z)),q},[]).join(CJ)}_parse(q){if(q.length>Z1)return;if(this._internalState=q.split(CJ).reverse().reduce((z,J)=>{let Z=J.trim(),Q=Z.indexOf(IJ);if(Q!==-1){let H=Z.slice(0,Q),X=Z.slice(Q+1,J.length);if((0,jJ.validateKey)(H)&&(0,jJ.validateValue)(X))z.set(H,X)}return z},new Map),this._internalState.size>DJ)this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,DJ))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let q=new Oq;return q._internalState=new Map(this._internalState),q}}VJ.TraceStateImpl=Oq});var EJ=$((bJ)=>{Object.defineProperty(bJ,"__esModule",{value:!0});bJ.createTraceState=void 0;var $1=kJ();function Q1(q){return new $1.TraceStateImpl(q)}bJ.createTraceState=Q1});var yJ=$((TJ)=>{Object.defineProperty(TJ,"__esModule",{value:!0});TJ.context=void 0;var W1=R();TJ.context=W1.ContextAPI.getInstance()});var SJ=$((PJ)=>{Object.defineProperty(PJ,"__esModule",{value:!0});PJ.diag=void 0;var H1=f();PJ.diag=H1.DiagAPI.instance()});var mJ=$((vJ)=>{Object.defineProperty(vJ,"__esModule",{value:!0});vJ.NOOP_METER_PROVIDER=vJ.NoopMeterProvider=void 0;var X1=s();class Kq{getMeter(q,z,J){return X1.NOOP_METER}}vJ.NoopMeterProvider=Kq;vJ.NOOP_METER_PROVIDER=new Kq});var _J=$((LJ)=>{Object.defineProperty(LJ,"__esModule",{value:!0});LJ.MetricsAPI=void 0;var F1=mJ(),Bq=B(),dJ=f(),fq="metrics";class Uq{constructor(){}static getInstance(){if(!this._instance)this._instance=new Uq;return this._instance}setGlobalMeterProvider(q){return(0,Bq.registerGlobal)(fq,q,dJ.DiagAPI.instance())}getMeterProvider(){return(0,Bq.getGlobal)(fq)||F1.NOOP_METER_PROVIDER}getMeter(q,z,J){return this.getMeterProvider().getMeter(q,z,J)}disable(){(0,Bq.unregisterGlobal)(fq,dJ.DiagAPI.instance())}}LJ.MetricsAPI=Uq});var gJ=$((cJ)=>{Object.defineProperty(cJ,"__esModule",{value:!0});cJ.metrics=void 0;var G1=_J();cJ.metrics=G1.MetricsAPI.getInstance()});var sJ=$((nJ)=>{Object.defineProperty(nJ,"__esModule",{value:!0});nJ.NoopTextMapPropagator=void 0;class iJ{inject(q,z){}extract(q,z){return q}fields(){return[]}}nJ.NoopTextMapPropagator=iJ});var aJ=$((oJ)=>{Object.defineProperty(oJ,"__esModule",{value:!0});oJ.deleteBaggage=oJ.setBaggage=oJ.getActiveBaggage=oJ.getBaggage=void 0;var h1=R(),w1=k(),jq=(0,w1.createContextKey)("OpenTelemetry Baggage Key");function rJ(q){return q.getValue(jq)||void 0}oJ.getBaggage=rJ;function O1(){return rJ(h1.ContextAPI.getInstance().active())}oJ.getActiveBaggage=O1;function K1(q,z){return q.setValue(jq,z)}oJ.setBaggage=K1;function B1(q){return q.deleteValue(jq)}oJ.deleteBaggage=B1});var ZZ=$((zZ)=>{Object.defineProperty(zZ,"__esModule",{value:!0});zZ.PropagationAPI=void 0;var Dq=B(),D1=sJ(),eJ=o(),S=aJ(),C1=d(),qZ=f(),Cq="propagation",I1=new D1.NoopTextMapPropagator;class Iq{constructor(){this.createBaggage=C1.createBaggage,this.getBaggage=S.getBaggage,this.getActiveBaggage=S.getActiveBaggage,this.setBaggage=S.setBaggage,this.deleteBaggage=S.deleteBaggage}static getInstance(){if(!this._instance)this._instance=new Iq;return this._instance}setGlobalPropagator(q){return(0,Dq.registerGlobal)(Cq,q,qZ.DiagAPI.instance())}inject(q,z,J=eJ.defaultTextMapSetter){return this._getGlobalPropagator().inject(q,z,J)}extract(q,z,J=eJ.defaultTextMapGetter){return this._getGlobalPropagator().extract(q,z,J)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,Dq.unregisterGlobal)(Cq,qZ.DiagAPI.instance())}_getGlobalPropagator(){return(0,Dq.getGlobal)(Cq)||I1}}zZ.PropagationAPI=Iq});var WZ=$(($Z)=>{Object.defineProperty($Z,"__esModule",{value:!0});$Z.propagation=void 0;var V1=ZZ();$Z.propagation=V1.PropagationAPI.getInstance()});var hZ=$((FZ)=>{Object.defineProperty(FZ,"__esModule",{value:!0});FZ.TraceAPI=void 0;var Vq=B(),HZ=Yq(),XZ=M(),C=$q(),YZ=f(),Nq="trace";class kq{constructor(){this._proxyTracerProvider=new HZ.ProxyTracerProvider,this.wrapSpanContext=XZ.wrapSpanContext,this.isSpanContextValid=XZ.isSpanContextValid,this.deleteSpan=C.deleteSpan,this.getSpan=C.getSpan,this.getActiveSpan=C.getActiveSpan,this.getSpanContext=C.getSpanContext,this.setSpan=C.setSpan,this.setSpanContext=C.setSpanContext}static getInstance(){if(!this._instance)this._instance=new kq;return this._instance}setGlobalTracerProvider(q){let z=(0,Vq.registerGlobal)(Nq,this._proxyTracerProvider,YZ.DiagAPI.instance());if(z)this._proxyTracerProvider.setDelegate(q);return z}getTracerProvider(){return(0,Vq.getGlobal)(Nq)||this._proxyTracerProvider}getTracer(q,z){return this.getTracerProvider().getTracer(q,z)}disable(){(0,Vq.unregisterGlobal)(Nq,YZ.DiagAPI.instance()),this._proxyTracerProvider=new HZ.ProxyTracerProvider}}FZ.TraceAPI=kq});var KZ=$((wZ)=>{Object.defineProperty(wZ,"__esModule",{value:!0});wZ.trace=void 0;var N1=hZ();wZ.trace=N1.TraceAPI.getInstance()});var L1=$((W)=>{Object.defineProperty(W,"__esModule",{value:!0});W.trace=W.propagation=W.metrics=W.diag=W.context=W.INVALID_SPAN_CONTEXT=W.INVALID_TRACEID=W.INVALID_SPANID=W.isValidSpanId=W.isValidTraceId=W.isSpanContextValid=W.createTraceState=W.TraceFlags=W.SpanStatusCode=W.SpanKind=W.SamplingDecision=W.ProxyTracerProvider=W.ProxyTracer=W.defaultTextMapSetter=W.defaultTextMapGetter=W.ValueType=W.createNoopMeter=W.DiagLogLevel=W.DiagConsoleLogger=W.ROOT_CONTEXT=W.createContextKey=W.baggageEntryMetadataFromString=void 0;var k1=d();Object.defineProperty(W,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return k1.baggageEntryMetadataFromString}});var BZ=k();Object.defineProperty(W,"createContextKey",{enumerable:!0,get:function(){return BZ.createContextKey}});Object.defineProperty(W,"ROOT_CONTEXT",{enumerable:!0,get:function(){return BZ.ROOT_CONTEXT}});var b1=hz();Object.defineProperty(W,"DiagConsoleLogger",{enumerable:!0,get:function(){return b1.DiagConsoleLogger}});var R1=E();Object.defineProperty(W,"DiagLogLevel",{enumerable:!0,get:function(){return R1.DiagLogLevel}});var E1=s();Object.defineProperty(W,"createNoopMeter",{enumerable:!0,get:function(){return E1.createNoopMeter}});var T1=Nz();Object.defineProperty(W,"ValueType",{enumerable:!0,get:function(){return T1.ValueType}});var fZ=o();Object.defineProperty(W,"defaultTextMapGetter",{enumerable:!0,get:function(){return fZ.defaultTextMapGetter}});Object.defineProperty(W,"defaultTextMapSetter",{enumerable:!0,get:function(){return fZ.defaultTextMapSetter}});var A1=Xq();Object.defineProperty(W,"ProxyTracer",{enumerable:!0,get:function(){return A1.ProxyTracer}});var y1=Yq();Object.defineProperty(W,"ProxyTracerProvider",{enumerable:!0,get:function(){return y1.ProxyTracerProvider}});var P1=GJ();Object.defineProperty(W,"SamplingDecision",{enumerable:!0,get:function(){return P1.SamplingDecision}});var M1=wJ();Object.defineProperty(W,"SpanKind",{enumerable:!0,get:function(){return M1.SpanKind}});var S1=KJ();Object.defineProperty(W,"SpanStatusCode",{enumerable:!0,get:function(){return S1.SpanStatusCode}});var v1=zq();Object.defineProperty(W,"TraceFlags",{enumerable:!0,get:function(){return v1.TraceFlags}});var u1=EJ();Object.defineProperty(W,"createTraceState",{enumerable:!0,get:function(){return u1.createTraceState}});var bq=M();Object.defineProperty(W,"isSpanContextValid",{enumerable:!0,get:function(){return bq.isSpanContextValid}});Object.defineProperty(W,"isValidTraceId",{enumerable:!0,get:function(){return bq.isValidTraceId}});Object.defineProperty(W,"isValidSpanId",{enumerable:!0,get:function(){return bq.isValidSpanId}});var Rq=y();Object.defineProperty(W,"INVALID_SPANID",{enumerable:!0,get:function(){return Rq.INVALID_SPANID}});Object.defineProperty(W,"INVALID_TRACEID",{enumerable:!0,get:function(){return Rq.INVALID_TRACEID}});Object.defineProperty(W,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return Rq.INVALID_SPAN_CONTEXT}});var UZ=yJ();Object.defineProperty(W,"context",{enumerable:!0,get:function(){return UZ.context}});var jZ=SJ();Object.defineProperty(W,"diag",{enumerable:!0,get:function(){return jZ.diag}});var DZ=gJ();Object.defineProperty(W,"metrics",{enumerable:!0,get:function(){return DZ.metrics}});var CZ=WZ();Object.defineProperty(W,"propagation",{enumerable:!0,get:function(){return CZ.propagation}});var IZ=KZ();Object.defineProperty(W,"trace",{enumerable:!0,get:function(){return IZ.trace}});W.default={context:UZ.context,diag:jZ.diag,metrics:DZ.metrics,propagation:CZ.propagation,trace:IZ.trace}});
3
- export{L1 as Na};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function W(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 V(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(Q(w))return;if(G(w))return F(w);return}function Q(q){return typeof q==="object"&&q!==null&&"pipe"in q&&typeof q.pipe==="function"}function G(q){return typeof q==="object"&&q!==null&&Object.keys(q).length>0}function X(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 V(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{W as Vm,X as Wm};
@@ -1,2 +0,0 @@
1
- import{$i as m}from"./chunk-w9p59ahz.js";import{rn as s,un as u}from"./chunk-txkmks1h.js";function I(w,B){var E=w.length;w.push(B);w:for(;0<E;){var O=E-1>>>1,A=w[O];if(0<S(A,B))w[O]=B,w[E]=A,E=O;else break w}}function N(w){return w.length===0?null:w[0]}function M(w){if(w.length===0)return null;var B=w[0],E=w.pop();if(E!==B){w[0]=E;w:for(var O=0,A=w.length,q=A>>>1;O<q;){var R=2*(O+1)-1,b=w[R],z=R+1,Y=w[z];if(0>S(b,E))z<A&&0>S(Y,b)?(w[O]=Y,w[z]=E,O=z):(w[O]=b,w[R]=E,O=R);else if(z<A&&0>S(Y,E))w[O]=Y,w[z]=E,O=z;else break w}}return B}function S(w,B){var E=w.sortIndex-B.sortIndex;return E!==0?E:w.id-B.id}function H(w){for(var B=N($);B!==null;){if(B.callback===null)M($);else if(B.startTime<=w)M($),B.sortIndex=B.expirationTime,I(_,B);else break;B=N($)}}function y(w){if(X=!1,H(w),!V)if(N(_)!==null)V=!0,J||(J=!0,G());else{var B=N($);B!==null&&L(y,B.startTime-w)}}function h(){return k?!0:j()-c<a?!1:!0}function W(){if(k=!1,J){var w=j();c=w;var B=!0;try{w:{V=!1,X&&(X=!1,d(Z),Z=-1),f=!0;var E=F;try{E:{H(w);for(K=N(_);K!==null&&!(K.expirationTime>w&&h());){var O=K.callback;if(typeof O==="function"){K.callback=null,F=K.priorityLevel;var A=O(K.expirationTime<=w);if(w=j(),typeof A==="function"){K.callback=A,H(w),B=!0;break E}K===N(_)&&M(_),H(w)}else M(_);K=N(_)}if(K!==null)B=!0;else{var q=N($);q!==null&&L(y,q.startTime-w),B=!1}}break w}finally{K=null,F=E,f=!1}B=void 0}}finally{B?G():J=!1}}}function L(w,B){Z=v(function(){w(j())},B)}var j=void 0,P,Q,g,_,$,p=1,K=null,F=3,f=!1,V=!1,X=!1,k=!1,v,d,T,J=!1,Z=-1,a=5,c=-1,G,U,x,l=5,n=1,o=4,t=3,i=2,r=function(w){w.callback=null},e=function(){return F},ww=function(){k=!0},Ew=function(w,B){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var E=F;F=w;try{return B()}finally{F=E}},Bw=function(w,B,E){var O=j();switch(typeof E==="object"&&E!==null?(E=E.delay,E=typeof E==="number"&&0<E?O+E:O):E=O,w){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5000}return A=E+A,w={id:p++,callback:B,priorityLevel:w,startTime:E,expirationTime:A,sortIndex:-1},E>O?(w.sortIndex=E,I($,w),N(_)===null&&w===N($)&&(X?(d(Z),Z=-1):X=!0,L(y,E-O))):(w.sortIndex=A,I(_,w),V||f||(V=!0,J||(J=!0,G()))),w},Ow;var Aw=u(()=>{if(typeof performance==="object"&&typeof performance.now==="function")P=performance,j=function(){return P.now()};else Q=Date,g=Q.now(),j=function(){return Q.now()-g};_=[],$=[],v=typeof setTimeout==="function"?setTimeout:null,d=typeof clearTimeout==="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;if(typeof T==="function")G=function(){T(W)};else if(typeof MessageChannel<"u")U=new MessageChannel,x=U.port2,U.port1.onmessage=W,G=function(){x.postMessage(null)};else G=function(){v(W,0)};Ow=h});var C=s(m(),1),D=768;function Kw(){let[w,B]=C.useState(void 0);return C.useEffect(()=>{let E=window.matchMedia(`(max-width: ${D-1}px)`),O=()=>{B(window.innerWidth<D)};return E.addEventListener("change",O),B(window.innerWidth<D),()=>E.removeEventListener("change",O)},[]),!!w}
2
- export{j as if,l as jf,n as kf,o as lf,t as mf,i as nf,r as of,e as pf,ww as qf,Ew as rf,Bw as sf,Ow as tf,Aw as uf,Kw as vf};
@@ -1,2 +0,0 @@
1
- import{og as A}from"./chunk-7xcyn1ba.js";import{Ii as z}from"./chunk-s503pcvb.js";import{bj as v,lj as w}from"./chunk-w9p59ahz.js";var B=(b)=>({queryKey:["projects",b],queryFn:async()=>{let h=await z.api.projects[":projectId"].$get({param:{projectId:b}});if(!h.ok)throw Error("Failed to fetch project");return await h.json()}}),H=w("/projects/$projectId/collections/")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
2
- export{B as ie,H as je};
@@ -1,2 +0,0 @@
1
- import{og as A}from"./chunk-7xcyn1ba.js";import{Ii as z}from"./chunk-s503pcvb.js";import{bj as v,lj as w}from"./chunk-w9p59ahz.js";var B=(b)=>({queryKey:["projects",b],queryFn:async()=>{let h=await z.api.projects[":projectId"].$get({param:{projectId:b}});if(!h.ok)throw Error("Failed to fetch project");return await h.json()}}),H=w("/projects/$projectId/recently-deleted")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
2
- export{B as ye,H as ze};
@@ -1,3 +0,0 @@
1
- // @bun
2
- class z{queue=[];waiting=[];done=!1;finalResultPromise;resolveFinalResult;isComplete;extractResult;constructor(b,k){this.isComplete=b,this.extractResult=k,this.finalResultPromise=new Promise((q)=>{this.resolveFinalResult=q})}push(b){if(this.done)return;if(this.isComplete(b))this.done=!0,this.resolveFinalResult(this.extractResult(b));let k=this.waiting.shift();if(k)k({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((k)=>this.waiting.push(k));if(b.done)return;yield b.value}}result(){return this.finalResultPromise}}class B extends z{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")})}}function F(b){if(b instanceof Error)return b.message||b.name;if(typeof b==="string")return b;return String(b)}function G(b){if(!(b instanceof Error))return{name:"ThrownValue",message:F(b)};let k=b.code;return{name:b.name||void 0,message:b.message||b.name,stack:b.stack,code:typeof k==="string"||typeof k==="number"?k:void 0}}function I(b,k,q){return{type:b,timestamp:Date.now(),error:G(k),details:q}}function J(b,k){b.diagnostics=[...b.diagnostics??[],k]}
3
- export{B as nn,F as on,I as pn,J as qn};
@@ -1,3 +0,0 @@
1
- // @bun
2
- var I=(w)=>w;function J(w,H,A=I){let B=new Map;for(let h of w.tools??[])B.set(A(h.name),h);if(!H)return{immediate:[...B.values()],deferred:new Map};let C=new Set,D=new Set;for(let h of w.messages)if(h.role==="assistant"){for(let v of h.content)if(v.type==="toolCall")D.add(A(v.name))}else if(h.role==="toolResult")for(let v of h.addedToolNames??[]){let G=A(v);if(!D.has(G))C.add(G)}let E=[],F=new Map;for(let[h,v]of B)if(C.has(h))F.set(h,v);else E.push(v);return{immediate:E,deferred:F}}
3
- export{J as vm};
@@ -1 +0,0 @@
1
- import{o as a}from"./chunk-r9pzpqst.js";import"./chunk-4yybby29.js";import"./chunk-2vc6pw8q.js";import"./chunk-09pe07g6.js";import"./chunk-082zg4nr.js";import"./chunk-44xtwvd7.js";import"./chunk-44370df5.js";import"./chunk-srs9jq8f.js";import"./chunk-4yhd7bmp.js";import"./chunk-mkb4dycy.js";import"./chunk-mgnxa0vy.js";import"./chunk-wzdnsgwq.js";import"./chunk-6tv7rm3x.js";import"./chunk-t77dwtcc.js";import"./chunk-6nrynqdw.js";import"./chunk-5bkj2n94.js";import"./chunk-be9a7kc6.js";import"./chunk-xxtcmzcv.js";import"./chunk-pt51m9h1.js";import"./chunk-f4d3v0nc.js";import"./chunk-kejt7kcr.js";import"./chunk-2q7ew7yz.js";import"./chunk-j10gz94w.js";import"./chunk-ktvmxqfg.js";import"./chunk-k1f3gj25.js";import"./chunk-hmmzbyy1.js";import"./chunk-d6d1j7qq.js";import"./chunk-7g2k89gq.js";import"./chunk-7xcyn1ba.js";import"./chunk-785kxysj.js";import"./chunk-ygsbmfcy.js";import"./chunk-1vs91e4q.js";import"./chunk-16txy3r1.js";import"./chunk-90tbc5f4.js";import"./chunk-bkbqvxfv.js";import"./chunk-ts10cfmc.js";import"./chunk-rfsbzd39.js";import"./chunk-2sc2jxd3.js";import"./chunk-f32kxe6c.js";import"./chunk-2f35h4fn.js";import"./chunk-4k2d8w9w.js";import"./chunk-s503pcvb.js";import"./chunk-axb1f1ae.js";import{bj as e,mj as t}from"./chunk-w9p59ahz.js";import"./chunk-txkmks1h.js";function o(){let{shareId:s,folderId:n}=r.useParams();return e(a,{shareId:s,initialFolderId:n})}var r=t("/share/$shareId/folders/$folderId")({component:o});export{r as Route};
@@ -1,2 +0,0 @@
1
- import{p as Ry,q as xy,r as jy}from"./chunk-4yybby29.js";import{s as Ly}from"./chunk-2vc6pw8q.js";import{w as My}from"./chunk-09pe07g6.js";import{E as Py,y as Ay}from"./chunk-082zg4nr.js";import{ba as Cy}from"./chunk-4yhd7bmp.js";import{Ne as Ny}from"./chunk-wzdnsgwq.js";import{$e as c,af as m,bf as h,df as F}from"./chunk-be9a7kc6.js";import{vf as Ey}from"./chunk-pt51m9h1.js";import{eg as ky}from"./chunk-k1f3gj25.js";import{Ci as g,Ii as B,zi as N}from"./chunk-s503pcvb.js";import{$i as O1,Dj as D,Tk as By,aj as Wy,bj as X,cj as q,hj as Hy,qm as Qy,tm as Ty,uj as by,um as Vy}from"./chunk-w9p59ahz.js";import{rn as K1}from"./chunk-txkmks1h.js";var G=K1(O1(),1);function A1({shareId:O,initialFolderId:Dy,initialFileId:l,startTime:n,versionId:V,compare:Sy,compareLeftId:A,compareRightId:R,compareActiveSide:o="left"}){let $=Hy(),x=Ey(),H=!!Sy&&!!A&&!!R,[Z,t]=G.useState(()=>{return localStorage.getItem(`share_pwd_${O}`)||""}),[S,py]=G.useState(""),{data:K,error:k,isLoading:wy}=N({queryKey:["share-info",O,Z],queryFn:async()=>{let y=await B.api.shares[":shareId"].info.$get({param:{shareId:O}},{headers:{"x-share-password":Z}});if(y.status===401)throw Error("Unauthorized");if(y.status===403){let z=await y.json();throw Error(z.error||"Forbidden")}if(!y.ok)throw Error("Failed to fetch share info");return await y.json()},retry:!1}),J=Dy||K?.rootFolderId,Y=l||null,p=V||Y,[w,I]=G.useState([]),{data:P}=N({queryKey:["public-share-folder",O,J,Z],queryFn:async()=>{let y=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:O,fileId:J}},{headers:{"x-share-password":Z}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!K&&!!J});G.useEffect(()=>{if(P?.ancestorFolders&&K){let y=P.ancestorFolders.findIndex((z)=>z.id===K.rootFolderId);if(y!==-1)I(P.ancestorFolders.slice(0,y));else if(J===K.rootFolderId)I([])}},[P,K,J]);let[Q,b]=G.useState(new Set),[uy,vy]=G.useState(360),[u,fy]=G.useState(()=>!l),M=G.useRef(null),[i,v]=G.useState([]),[gy,a]=G.useState(0),[cy,d]=G.useState(null),[s,my]=G.useState(null),[hy,Fy]=G.useState(void 0),{data:C,fetchNextPage:r,hasNextPage:e,isFetchingNextPage:yy,isLoading:zy,error:Ky}=g({queryKey:["public-share-children",O,J,"folder",Z],queryFn:async({pageParam:y})=>{let z=await B.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:O,folderId:J},query:{assetType:"folder",after:y}},{headers:{"x-share-password":Z}});if(z.status===401)throw Error("Unauthorized");if(z.status===403)throw Error("Expired");return await z.json()},enabled:!!K&&!!J,initialPageParam:"",getNextPageParam:(y)=>y.pageInfo?.cursor||void 0,retry:!1}),{data:j,fetchNextPage:Oy,hasNextPage:Xy,isFetchingNextPage:Gy,isLoading:Jy}=g({queryKey:["public-share-children",O,J,"file",Z],queryFn:async({pageParam:y})=>{let z=await B.api.shares[":shareId"].folders[":folderId"].children.$get({param:{shareId:O,folderId:J},query:{assetType:"file",after:y}},{headers:{"x-share-password":Z}});if(z.status===401)throw Error("Unauthorized");if(z.status===403)throw Error("Expired");return await z.json()},enabled:!!K&&!!J,initialPageParam:"",getNextPageParam:(y)=>y.pageInfo?.cursor||void 0,retry:!1}),{data:Uy}=N({queryKey:["public-share-fields",O,Z],queryFn:async()=>{let y=await B.api.shares[":shareId"].fields.$get({param:{shareId:O}},{headers:{"x-share-password":Z}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!K}),{data:W,isLoading:ly}=N({queryKey:["public-share-file",O,Y,Z],queryFn:async()=>{let y=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:O,fileId:Y}},{headers:{"x-share-password":Z}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!Y&&!!K}),{data:ny,isLoading:oy}=N({queryKey:["public-share-file",O,V,Z],queryFn:async()=>{let y=await B.api.shares[":shareId"].files[":fileId"].$get({param:{shareId:O,fileId:V}},{headers:{"x-share-password":Z}});if(y.status===401)throw Error("Unauthorized");return await y.json()},enabled:!!V&&!!K}),U=V?ny:W,ty=ly||!!V&&oy;G.useEffect(()=>{if(Ky?.message==="Unauthorized")t(""),localStorage.removeItem(`share_pwd_${O}`)},[Ky,O]);let E=G.useMemo(()=>C?.pages.flatMap((y)=>y.data??[])??[],[C]),L=G.useMemo(()=>j?.pages.flatMap((y)=>y.data??[])??[],[j]),Iy=C?.pages[0]?.pageInfo?.total,iy=j?.pages[0]?.pageInfo?.total,ay=C?.pages[0]?.pageInfo?.totalSize,dy=j?.pages[0]?.pageInfo?.totalSize,Yy=G.useMemo(()=>{if(U)return U;if(Q.size!==1)return null;let y=Array.from(Q)[0];return[...E,...L].find((z)=>z.id===y)||null},[Q,E,L,U]),sy=(y)=>{y.preventDefault(),t(S),localStorage.setItem(`share_pwd_${O}`,S)},Zy=(y)=>{if(y.type==="folder"||y.targetType==="folder")$({to:"/share/$shareId/folders/$folderId",params:{shareId:O,folderId:y.id}});else $({to:"/share/$shareId/files/$fileId",params:{shareId:O,fileId:y.versionStack?y.versionStack.id:y.id}});b(new Set)},ry=(y)=>{if(!K)return;let z=y==="root"?K.rootFolderId:y;if(z===K.rootFolderId)$({to:"/share/$shareId",params:{shareId:O}});else $({to:"/share/$shareId/folders/$folderId",params:{shareId:O,folderId:z}});b(new Set)},ey=(y)=>{d(y.id||null);let z=y.annotations;if(z&&z.length>0)v(z);else v([]);if(H){if(y.second!==null&&y.second!==void 0)Fy({second:y.second,nonce:Date.now()});return}if(y.second!==null&&y.second!==void 0)M.current?.seekTo(y.second),M.current?.pause();else if(z&&z.length>0)M.current?.pause()},_y=()=>{v([]),d(null)},f=(y)=>{if(!Y)return;$({to:"/share/$shareId/files/$fileId",params:{shareId:O,fileId:Y},search:(z)=>({...z,...y})})},y1=()=>{f({compare:void 0,cmpLeft:void 0,cmpRight:void 0,cmpActive:void 0,version:o==="left"?A:R})},{setProjectState:$y,clearProjectState:qy}=ky();G.useEffect(()=>{if(K&&J){let y=J===K.rootFolderId?K.name:E.find((z)=>z.id===J)?.name||K.name;$y({teamId:"",projectId:K.projectId,projectName:K.name,ancestorFolders:w,currentAsset:{name:U?.name||y,type:Y?"file":"folder",version:W?.versionStack?W.versionStack.versions.find((z)=>z.id===p)?.version??W.versionStack.versions.length:void 0,proxyType:U?.proxyType||null},isRootFolder:J===K.rootFolderId&&!Y,isPublic:!0,shareId:O,fileId:Y||void 0,allowDownload:K.allowDownload,downloadInfo:U?{originalKey:U.media?.original?.key,videoTranscodes:U.media?.videoTranscodes?.map((z)=>({key:z.key,width:z.width,height:z.height}))}:void 0,onFolderClick:ry,isRightSidebarCollapsed:u,onRightSidebarToggle:()=>fy((z)=>!z),versions:W?.versionStack?.versions,compareMode:H,canCompareVersions:(W?.versionStack?.versions?.length??0)>=2,onCompareVersions:()=>{let z=Ay(W?.versionStack?.versions);if(!z||!Y)return;$({to:"/share/$shareId/files/$fileId",params:{shareId:O,fileId:Y},search:(_)=>({..._,compare:!0,cmpLeft:z.left.id,cmpRight:z.right.id,cmpActive:"left"})})}})}return()=>qy()},[K,J,E,U,W,p,Y,w,$y,qy,u,H,$,O]);let T;if(wy&&!k)T=X("div",{className:"flex flex-1 items-center justify-center bg-background",children:X(D,{className:"h-8 w-8 animate-spin text-foreground"})});else if(k)if(k.message==="Unauthorized"){let y=Z!=="";T=X("div",{className:"flex flex-1 items-center justify-center p-4",children:q(c,{className:"w-full max-w-md",children:[q(m,{className:"text-center",children:[X("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:X(By,{className:"h-6 w-6 text-primary"})}),X(h,{children:Ty.password_protected()})]}),X(F,{children:q("form",{onSubmit:sy,className:"space-y-4",children:[q("div",{className:"space-y-2",children:[X(Vy,{type:"password",placeholder:"Enter password",value:S,onChange:(z)=>py(z.target.value),autoFocus:!0}),y&&X("p",{className:"text-sm font-medium text-destructive",children:"Incorrect password. Please try again."})]}),X(Qy,{type:"submit",className:"w-full",children:"Access Share"})]})})]})})}else{let y=k.message.includes("expired"),z=k.message.includes("disabled");T=X("div",{className:"flex flex-1 items-center justify-center p-4",children:q(c,{className:"w-full max-w-md",children:[q(m,{className:"text-center",children:[X("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10",children:X(by,{className:"h-6 w-6 text-destructive"})}),X(h,{children:y?"Share Expired":z?"Share Disabled":"Error"})]}),X(F,{className:"text-center text-muted-foreground",children:k.message})]})})}else if(!K)T=X("div",{className:"flex flex-1 items-center justify-center bg-background",children:X(D,{className:"h-8 w-8 animate-spin text-foreground"})});else if(x&&Y&&!H&&U){let y=U?.ancestorFolders?.[0]?.id||(J!==K.rootFolderId?J:void 0),z=U?.ancestorFolders&&U.ancestorFolders.length>0?U.ancestorFolders:w;T=X(xy,{projectId:K.projectId,fileId:Y,file:U,projectInfo:{name:K.name,rootFolder:K.rootFolderId},ancestorFolders:z,versions:W?.versionStack?.versions??U?.versionStack?.versions,activeFileId:p||Y,startTime:n,isPublic:!0,shareId:O,allowDownload:K.allowDownload,publicFields:Uy,siblingFiles:L,onNavigateToFile:(_)=>{$({to:"/share/$shareId/files/$fileId",params:{shareId:O,fileId:_}})},onNavigateBack:()=>{if(y&&y!==K.rootFolderId)$({to:"/share/$shareId/folders/$folderId",params:{shareId:O,folderId:y}});else $({to:"/share/$shareId",params:{shareId:O}})},onSelectVersion:(_)=>{$({to:"/share/$shareId/files/$fileId",params:{shareId:O,fileId:Y},search:(z1)=>({...z1,version:_})})},onSaveField:()=>{}})}else T=q("div",{className:"flex flex-1 overflow-hidden relative",children:[Y?q("div",{className:"flex-1 relative bg-muted/30",children:[ty&&!H&&X("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/50",children:X(D,{className:"h-8 w-8 animate-spin text-foreground"})}),H&&A&&R?X(jy,{isPublic:!0,shareId:O,versions:U?.versionStack?.versions??[],leftId:A,rightId:R,activeSide:o,annotations:i,seekRequest:hy,allowDownload:K.allowDownload,onActiveSideChange:(y)=>f({cmpActive:y}),onSwitchVersion:(y,z)=>f(y==="left"?{cmpLeft:z}:{cmpRight:z}),onExit:y1,onActiveAssetChange:my,onPlay:_y,onTimeUpdate:a}):U&&X(Ry,{file:U,mediaControllerRef:M,onPlay:_y,onTimeUpdate:a,annotations:i,startTime:n,shareId:O,allowDownload:K.allowDownload})]}):J&&(x?X(Ly,{teamId:"",projectId:K.projectId,assetId:J,folders:E,files:L,totalFolders:Iy,totalFiles:iy,totalFoldersSize:ay,totalFilesSize:dy,selectedItem:null,selectedIds:Q,onItemSelect:(y,z)=>{if(z.metaKey||z.ctrlKey){let _=new Set(Q);if(_.has(y.id))_.delete(y.id);else _.add(y.id);b(_)}else b(new Set([y.id]))},onItemDoubleClick:Zy,onClearSelection:()=>b(new Set),fetchNextFoldersPage:r,hasNextFoldersPage:e,isFetchingNextFoldersPage:yy,fetchNextFilesPage:Oy,hasNextFilesPage:Xy,isFetchingNextFilesPage:Gy,isLoading:zy||Jy,isShareView:!0,isPublic:!0,shareId:O,allowDownload:K.allowDownload}):X(My,{teamId:"",projectId:K.projectId,assetId:J,folders:E,files:L,selectedItem:null,selectedIds:Q,onItemSelect:(y,z)=>{if(z.metaKey||z.ctrlKey){let _=new Set(Q);if(_.has(y.id))_.delete(y.id);else _.add(y.id);b(_)}else b(new Set([y.id]))},onItemDoubleClick:Zy,onSaveField:()=>{},displayStyle:K.viewMode??"card",onClearSelection:()=>b(new Set),fetchNextFoldersPage:r,hasNextFoldersPage:e,isFetchingNextFoldersPage:yy,fetchNextFilesPage:Oy,hasNextFilesPage:Xy,isFetchingNextFilesPage:Gy,isLoading:zy||Jy,isShareView:!0,isPublic:!0,shareId:O,allowDownload:K.allowDownload})),!u&&!x&&q(Wy,{children:[X(Cy,{onResize:(y)=>vy((z)=>Math.max(240,Math.min(600,z-y)))}),X("div",{style:{width:uy},className:"flex-shrink-0 border-l",children:X(Py,{teamId:"",projectId:K.projectId,file:H?s:Yy,onSaveField:()=>{},members:[],readOnly:!0,publicFields:Uy,onCommentSelect:ey,isPublic:!0,shareId:O,currentTime:gy,onTyping:()=>{M.current?.pause()},selectedCommentId:cy,hideAnnotationControl:(H?s:Yy)?.proxyType==="audio"})})]})]});return q("div",{className:"flex h-[100dvh] flex-col bg-background",children:[(!x||!Y)&&X(Ny,{}),T]})}
2
- export{A1 as o};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{wn as G}from"./chunk-txkmks1h.js";var q=null;function H(k){if(typeof process>"u"||!process.versions?.bun||Object.keys(process.env).length>0)return;if(q===null){q=new Map;try{let{readFileSync:w}=G("fs"),D=w("/proc/self/environ","utf-8");for(let z of D.split("\x00")){let A=z.indexOf("=");if(A>0)q.set(z.slice(0,A),z.slice(A+1))}}catch{}}return q.get(k)}function I(k,w){return w?.[k]||(typeof process<"u"?process.env[k]:void 0)||H(k)||void 0}
3
- export{I as Gm};
@@ -1 +0,0 @@
1
- import{d as y}from"./chunk-cyvx7gcx.js";import"./chunk-a5b3aevg.js";import"./chunk-0qdzjcny.js";import"./chunk-2vc6pw8q.js";import"./chunk-09pe07g6.js";import"./chunk-082zg4nr.js";import"./chunk-44xtwvd7.js";import"./chunk-44370df5.js";import"./chunk-srs9jq8f.js";import"./chunk-4yhd7bmp.js";import"./chunk-mkb4dycy.js";import"./chunk-mgnxa0vy.js";import{oe as v,pe as m}from"./chunk-f8ysqfyv.js";import"./chunk-zqvavykq.js";import"./chunk-xxtcmzcv.js";import"./chunk-pt51m9h1.js";import"./chunk-f4d3v0nc.js";import"./chunk-kejt7kcr.js";import"./chunk-2q7ew7yz.js";import"./chunk-j10gz94w.js";import"./chunk-ktvmxqfg.js";import"./chunk-k1f3gj25.js";import"./chunk-hmmzbyy1.js";import"./chunk-d6d1j7qq.js";import"./chunk-7g2k89gq.js";import"./chunk-7xcyn1ba.js";import"./chunk-785kxysj.js";import"./chunk-ygsbmfcy.js";import"./chunk-1vs91e4q.js";import"./chunk-16txy3r1.js";import"./chunk-90tbc5f4.js";import"./chunk-bkbqvxfv.js";import"./chunk-ts10cfmc.js";import"./chunk-rfsbzd39.js";import"./chunk-2sc2jxd3.js";import"./chunk-f32kxe6c.js";import"./chunk-2f35h4fn.js";import{si as w}from"./chunk-4k2d8w9w.js";import{Ai as f,Bi as x,Ii as r,zi as i}from"./chunk-s503pcvb.js";import"./chunk-axb1f1ae.js";import{$i as q,bj as n,mj as b,tm as g}from"./chunk-w9p59ahz.js";import{rn as W}from"./chunk-txkmks1h.js";var d=W(q(),1);function A(){let{projectId:e,collectionId:l}=K.useParams(),{teamId:o,ensureTeamIdForProject:h}=w();d.useEffect(()=>{h(e)},[e,h]);let{data:p}=f(v(e)),{data:s,refetch:z}=i({...m(l)}),{mutate:k}=x({mutationFn:async(a)=>{let c=await r.api.collections[":collectionId"].$patch({param:{collectionId:l},json:a});if(!c.ok)throw Error("Failed to update collection");return await c.json()},onSuccess:()=>{z()}}),t=p?.rootFolder,{data:u}=i({queryKey:["folders",t],queryFn:async()=>{let a=await r.api.folders[":folderId"].$get({param:{folderId:t}});if(!a.ok)throw Error("Failed to fetch folder");return await a.json()},enabled:!!t});if(!o||!t||!u||!s)return n("div",{children:g.loading_collection()});let C=s.filter.sourceFolderId||t;return n(y,{teamId:o,projectId:e,projectName:p.name??"",assetId:C,rootFolderId:t,collection:s,onUpdateCollection:k})}var K=b("/projects/$projectId/collections/$collectionId")({component:A});export{K as Route};
@@ -1,2 +0,0 @@
1
- import{Lh as W,Mh as U,Nh as P,Oh as w,Ph as O,Th as h,Vh as I,Wh as V,bi as F}from"./chunk-2sc2jxd3.js";import{tm as K}from"./chunk-w9p59ahz.js";function T($){return P($,Date.now())}function C($,_,M){let[A,N]=h(M?.in,$,_),q=b(A,N),B=Math.abs(I(A,N));A.setDate(A.getDate()-q*B);let E=Number(b(A,N)===-q),H=q*(B-E);return H===0?0:H}function b($,_){let M=$.getFullYear()-_.getFullYear()||$.getMonth()-_.getMonth()||$.getDate()-_.getDate()||$.getHours()-_.getHours()||$.getMinutes()-_.getMinutes()||$.getSeconds()-_.getSeconds()||$.getMilliseconds()-_.getMilliseconds();if(M<0)return-1;if(M>0)return 1;return M}function x($,_){return V(P(_?.in||$,$),T(_?.in||$))}function j($,_,M){return O($,-_,M)}function R($,_){return V(P(_?.in||$,$),j(T(_?.in||$),1))}function Z($,_){let M=()=>P(_?.in,NaN),A=_?.additionalDigits??2,N=k($),q;if(N.date){let G=g(N.date,A);q=y(G.restDateString,G.year)}if(!q||isNaN(+q))return M();let B=+q,E=0,H;if(N.time){if(E=S(N.time),isNaN(E))return M()}if(N.timezone){if(H=c(N.timezone),isNaN(H))return M()}else{let G=new Date(B+E),J=w(0,_?.in);return J.setFullYear(G.getUTCFullYear(),G.getUTCMonth(),G.getUTCDate()),J.setHours(G.getUTCHours(),G.getUTCMinutes(),G.getUTCSeconds(),G.getUTCMilliseconds()),J}return w(B+E+H,_?.in)}var X={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Y=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,f=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,v=/^([+-])(\d{2})(?::?(\d{2}))?$/;function k($){let _={},M=$.split(X.dateTimeDelimiter),A;if(M.length>2)return _;if(/:/.test(M[0]))A=M[0];else if(_.date=M[0],A=M[1],X.timeZoneDelimiter.test(_.date))_.date=$.split(X.timeZoneDelimiter)[0],A=$.substr(_.date.length,$.length);if(A){let N=X.timezone.exec(A);if(N)_.time=A.replace(N[1],""),_.timezone=N[1];else _.time=A}return _}function g($,_){let M=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+_)+"})|(\\d{2}|[+-]\\d{"+(2+_)+"})$)"),A=$.match(M);if(!A)return{year:NaN,restDateString:""};let N=A[1]?parseInt(A[1]):null,q=A[2]?parseInt(A[2]):null;return{year:q===null?N:q*100,restDateString:$.slice((A[1]||A[2]).length)}}function y($,_){if(_===null)return new Date(NaN);let M=$.match(Y);if(!M)return new Date(NaN);let A=!!M[4],N=Q(M[1]),q=Q(M[2])-1,B=Q(M[3]),E=Q(M[4]),H=Q(M[5])-1;if(A){if(!l(_,E,H))return new Date(NaN);return m(_,E,H)}else{let G=new Date(0);if(!u(_,q,B)||!D(_,N))return new Date(NaN);return G.setUTCFullYear(_,q,Math.max(N,B)),G}}function Q($){return $?parseInt($):1}function S($){let _=$.match(f);if(!_)return NaN;let M=L(_[1]),A=L(_[2]),N=L(_[3]);if(!o(M,A,N))return NaN;return M*U+A*W+N*1000}function L($){return $&&parseFloat($.replace(",","."))||0}function c($){if($==="Z")return 0;let _=$.match(v);if(!_)return 0;let M=_[1]==="+"?-1:1,A=parseInt(_[2]),N=_[3]&&parseInt(_[3])||0;if(!n(A,N))return NaN;return M*(A*U+N*W)}function m($,_,M){let A=new Date(0);A.setUTCFullYear($,0,4);let N=A.getUTCDay()||7,q=(_-1)*7+M+1-N;return A.setUTCDate(A.getUTCDate()+q),A}var p=[31,null,31,30,31,30,31,31,30,31,30,31];function z($){return $%400===0||$%4===0&&$%100!==0}function u($,_,M){return _>=0&&_<=11&&M>=1&&M<=(p[_]||(z($)?29:28))}function D($,_){return _>=1&&_<=(z($)?366:365)}function l($,_,M){return _>=1&&_<=53&&M>=0&&M<=6}function o($,_,M){if($===24)return _===0&&M===0;return M>=0&&M<60&&_>=0&&_<60&&$>=0&&$<25}function n($,_){return _>=0&&_<=59}var X0=($)=>{let _=Z($),M=new Date;if(isNaN(_.getTime()))return $;let A=F(_,"HH:mm");if(x(_))return K.today_with_time({time:A});if(R(_))return K.yesterday_with_time({time:A});let N=C(M,_),q=N>=0?N:0;return q===1?K.n_days_ago_singular({count:q}):K.n_days_ago_plural({count:q})},Z0=($)=>{let _=Z($),M=new Date;if(isNaN(_.getTime()))return $;if(x(_))return K.today();if(R(_))return K.yesterday();let A=C(M,_),N=A>=0?A:0;return N===1?K.n_days_ago_singular({count:N}):K.n_days_ago_plural({count:N})},J0=($,_=new Date)=>{let M=typeof $==="string"?Z($).getTime():$ instanceof Date?$.getTime():NaN;if(isNaN(M))return"< 1m";let A=M-_.getTime();if(A<=0)return"< 1m";let N=Math.floor(A/1000),q=Math.floor(N/86400),B=Math.floor(N%86400/3600),E=Math.floor(N%3600/60);if(q>0)return B>0?`${q}d ${B}h`:`${q}d`;if(B>0)return E>0?`${B}h ${E}m`:`${B}h`;return E>0?`${E}m`:"< 1m"};
2
- export{x as Fh,R as Gh,Z as Hh,X0 as Ih,Z0 as Jh,J0 as Kh};