orcaq 1.1.6 → 1.1.8

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 (196) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/-7uW7YTy.js +1 -0
  3. package/.output/public/_nuxt/{wH-P-_6A.js → 5450EsIE.js} +1 -1
  4. package/.output/public/_nuxt/6mVUr42b.js +1 -0
  5. package/.output/public/_nuxt/7H5y5euK.js +1 -0
  6. package/.output/public/_nuxt/7iCr9_qw.js +26 -0
  7. package/.output/public/_nuxt/{C4-wpUAK.js → B0gkARnK.js} +1 -1
  8. package/.output/public/_nuxt/B21nC2NZ.js +1 -0
  9. package/.output/public/_nuxt/B232GDut.js +2 -0
  10. package/.output/public/_nuxt/{x85BV7y_.js → B6N_D8QI.js} +1 -1
  11. package/.output/public/_nuxt/B7C8fo37.js +1 -0
  12. package/.output/public/_nuxt/BC82eJHt.js +1 -0
  13. package/.output/public/_nuxt/BHr4_sbs.js +9 -0
  14. package/.output/public/_nuxt/{DYqShb5v.js → BJvJ0Hlu.js} +4 -4
  15. package/.output/public/_nuxt/BK-6CJ0A.js +1 -0
  16. package/.output/public/_nuxt/BMVgfiQu.js +1 -0
  17. package/.output/public/_nuxt/BNh4NY7v.js +1 -0
  18. package/.output/public/_nuxt/{3jfBYqJb.js → BO3FEgXG.js} +1 -1
  19. package/.output/public/_nuxt/BQm1mt0O.js +1 -0
  20. package/.output/public/_nuxt/BRCvv3op.js +1 -0
  21. package/.output/public/_nuxt/{DLA-ioQ4.js → BRWis86L.js} +1 -1
  22. package/.output/public/_nuxt/{Bgj8Q52i.js → BRzWRTTF.js} +1 -1
  23. package/.output/public/_nuxt/{BWg3wiuc.js → BWTTrGtY.js} +2 -2
  24. package/.output/public/_nuxt/{BJoSd_uV.js → BXMKgn-J.js} +1 -1
  25. package/.output/public/_nuxt/{BoUZO_NV.js → BYaoWfSN.js} +1 -1
  26. package/.output/public/_nuxt/B_G752SV.js +20 -0
  27. package/.output/public/_nuxt/{B5HZeat4.js → BalNYDR1.js} +1 -1
  28. package/.output/public/_nuxt/{DYPm3mWQ.js → BmfnP4qD.js} +1 -1
  29. package/.output/public/_nuxt/Bn6_QGSK.js +1 -0
  30. package/.output/public/_nuxt/{CROH8wgk.js → BsCPQnkm.js} +1 -1
  31. package/.output/public/_nuxt/{wrneOCBW.js → Bu6ybm3Z.js} +1 -1
  32. package/.output/public/_nuxt/{DDsaDrGo.js → BuTCm7Bo.js} +1 -1
  33. package/.output/public/_nuxt/BuzCyLCh.js +1 -0
  34. package/.output/public/_nuxt/{4LC09zKL.js → BzNEuLKx.js} +1 -1
  35. package/.output/public/_nuxt/{C9ZBCJdc.js → BzNNFvTW.js} +1 -1
  36. package/.output/public/_nuxt/{CoQ_oOia.js → BzqjH2-H.js} +1 -1
  37. package/.output/public/_nuxt/{BCa-NKh0.js → C-e53AuW.js} +1 -1
  38. package/.output/public/_nuxt/C0jXhwNq.js +1 -0
  39. package/.output/public/_nuxt/C6K-C4_d.js +1 -0
  40. package/.output/public/_nuxt/{DgGwe7jd.js → C6teO48Y.js} +133 -133
  41. package/.output/public/_nuxt/{CCK1so3F.js → C874itvn.js} +1 -1
  42. package/.output/public/_nuxt/C8ZJ2pm_.js +1 -0
  43. package/.output/public/_nuxt/CA3O4M9L.js +1 -0
  44. package/.output/public/_nuxt/{Cf6n9dsT.js → CAjVwGyz.js} +1 -1
  45. package/.output/public/_nuxt/{uDsvlLN0.js → CCC5u9Ni.js} +1 -1
  46. package/.output/public/_nuxt/{BmEIj9l9.js → CCCJ2fw7.js} +1 -1
  47. package/.output/public/_nuxt/{dDqgUqt5.js → CFi6G8Aj.js} +2 -2
  48. package/.output/public/_nuxt/CKlMKmo6.js +1 -0
  49. package/.output/public/_nuxt/{FHx3Ejt6.js → CMDq7o88.js} +1 -1
  50. package/.output/public/_nuxt/CMI-3q_e.js +1 -0
  51. package/.output/public/_nuxt/{CBjcd4cE.js → CMnjMfEQ.js} +1 -1
  52. package/.output/public/_nuxt/{Ci7hrFNN.js → CQFANjzf.js} +1 -1
  53. package/.output/public/_nuxt/{BuSZbOQO.js → CU5cwnUW.js} +1 -1
  54. package/.output/public/_nuxt/{Bibtvqd8.js → CXQ2zrsE.js} +1 -1
  55. package/.output/public/_nuxt/{Dd89Vyx8.js → CXbrqQhC.js} +1 -1
  56. package/.output/public/_nuxt/CZXyfpHW.js +1 -0
  57. package/.output/public/_nuxt/CZgTP5wX.js +1 -0
  58. package/.output/public/_nuxt/{BxZgIpkD.js → Cd_fVKDw.js} +1 -1
  59. package/.output/public/_nuxt/CeXnSKvd.js +1 -0
  60. package/.output/public/_nuxt/Chw5tFzx.js +1 -0
  61. package/.output/public/_nuxt/CkLSGVwV.js +1 -0
  62. package/.output/public/_nuxt/Cqk0ImDE.js +1 -0
  63. package/.output/public/_nuxt/{BAasx5OS.js → CuXTA7ZW.js} +1 -1
  64. package/.output/public/_nuxt/Cv9v5fHN.js +1 -0
  65. package/.output/public/_nuxt/{CE0zlNDo.js → CvbYm0uB.js} +1 -1
  66. package/.output/public/_nuxt/{BJ8qQpib.js → Cw1HIv3s.js} +1 -1
  67. package/.output/public/_nuxt/{7nPLTDFM.js → CyEOtFwE.js} +1 -1
  68. package/.output/public/_nuxt/CyKRjZZo.js +1 -0
  69. package/.output/public/_nuxt/{Bap1X7GD.js → D4DMGxvZ.js} +1 -1
  70. package/.output/public/_nuxt/{DP6Az3fC.js → D5GonnbJ.js} +1 -1
  71. package/.output/public/_nuxt/D5Oboajo.js +1 -0
  72. package/.output/public/_nuxt/D8egDyEO.js +1 -0
  73. package/.output/public/_nuxt/DBSV6YXN.js +1 -0
  74. package/.output/public/_nuxt/{habs8oz6.js → DCewvWOu.js} +1 -1
  75. package/.output/public/_nuxt/{CP-7VdtS.js → DG9CsZCx.js} +1 -1
  76. package/.output/public/_nuxt/{DViCRsmA.js → DH2V7e8U.js} +1 -1
  77. package/.output/public/_nuxt/{C6bwwZAc.js → DHXwq7wT.js} +1 -1
  78. package/.output/public/_nuxt/DJXrgohw.js +2 -0
  79. package/.output/public/_nuxt/{Cl3VX8Um.js → DQRyK9Io.js} +1 -1
  80. package/.output/public/_nuxt/{ZNDxw-7x.js → DXVrM3CN.js} +1 -1
  81. package/.output/public/_nuxt/{Un5zjlKE.js → DZ4xLzJg.js} +1 -1
  82. package/.output/public/_nuxt/DZIoL4RO.js +1 -0
  83. package/.output/public/_nuxt/D_kY6P5P.js +1 -0
  84. package/.output/public/_nuxt/DgxTwFGe.js +7 -0
  85. package/.output/public/_nuxt/DkX74xDd.js +1 -0
  86. package/.output/public/_nuxt/{B_hWP06g.js → DmnufEYq.js} +1 -1
  87. package/.output/public/_nuxt/{BCazdlgN.js → Dopm1f4X.js} +1 -1
  88. package/.output/public/_nuxt/{C6CFIGob.js → Dpkaavgs.js} +1 -1
  89. package/.output/public/_nuxt/DpsqSAMo.js +20 -0
  90. package/.output/public/_nuxt/{DHyymmeR.js → DrkGD_bQ.js} +1 -1
  91. package/.output/public/_nuxt/{yLATXAxG.js → Dtry_3Qa.js} +1 -1
  92. package/.output/public/_nuxt/DwPmcz47.js +1 -0
  93. package/.output/public/_nuxt/DyjsVMbv.js +1 -0
  94. package/.output/public/_nuxt/{CNPNWuzz.js → FmHWbXNk.js} +1 -1
  95. package/.output/public/_nuxt/{BbLqUOHs.js → JxgekUqn.js} +1 -1
  96. package/.output/public/_nuxt/KoGK2wLb.js +1 -0
  97. package/.output/public/_nuxt/LU_a7qLd.js +1 -0
  98. package/.output/public/_nuxt/{Lh0RfwhV.js → LxqkguPP.js} +1 -1
  99. package/.output/public/_nuxt/Q8x88Gcd.js +1 -0
  100. package/.output/public/_nuxt/{DRX1aIGD.js → R04uZjs6.js} +1 -1
  101. package/.output/public/_nuxt/So0hX8V0.js +31 -0
  102. package/.output/public/_nuxt/WGDY9i_Q.js +1 -0
  103. package/.output/public/_nuxt/{Df4wU3r0.js → WZQ8mcv9.js} +1 -1
  104. package/.output/public/_nuxt/{CO0Pa76w.js → XjywAggc.js} +1 -1
  105. package/.output/public/_nuxt/{_fileId_.DxhkUVGK.css → _fileId_.CiauI_x3.css} +1 -1
  106. package/.output/public/_nuxt/{C445d10Z.js → _uLivI44.js} +1 -1
  107. package/.output/public/_nuxt/builds/latest.json +1 -1
  108. package/.output/public/_nuxt/builds/meta/30582efd-125a-4f88-bd89-20a7b2ba8697.json +1 -0
  109. package/.output/public/_nuxt/{EZ0owjER.js → eQskTKIU.js} +1 -1
  110. package/.output/public/_nuxt/ecWNT6PZ.js +1 -0
  111. package/.output/public/_nuxt/entry.BcHy7sxf.css +1 -0
  112. package/.output/public/_nuxt/{BEvswgw7.js → f6XRRKUb.js} +1 -1
  113. package/.output/public/_nuxt/jtwYTq7X.js +52 -0
  114. package/.output/public/_nuxt/{Cvkyd5iW.js → mcYTISF7.js} +1 -1
  115. package/.output/public/_nuxt/mcfKrWU-.js +1 -0
  116. package/.output/public/_nuxt/{BnZ5qYkP.js → soHTUlpn.js} +9 -9
  117. package/.output/public/_nuxt/tc7vkD0J.js +3 -0
  118. package/.output/public/_nuxt/vEHvfalB.js +53 -0
  119. package/.output/public/_nuxt/vP25tZUh.js +2 -0
  120. package/.output/public/_nuxt/{F8eHh68O.js → zndqWf9s.js} +8 -8
  121. package/.output/server/chunks/_/registry.mjs +116 -0
  122. package/.output/server/chunks/_/registry.mjs.map +1 -0
  123. package/.output/server/chunks/_/{native-backup.mjs → runtime.mjs} +325 -164
  124. package/.output/server/chunks/_/runtime.mjs.map +1 -0
  125. package/.output/server/chunks/_/{native-backup-jobs.mjs → service.mjs} +185 -248
  126. package/.output/server/chunks/_/service.mjs.map +1 -0
  127. package/.output/server/chunks/_/tables.factory.mjs +1 -1
  128. package/.output/server/chunks/build/client.manifest.mjs +802 -727
  129. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  130. package/.output/server/chunks/nitro/nitro.mjs +683 -648
  131. package/.output/server/chunks/routes/api/database-backup/capability.get.mjs +7 -2
  132. package/.output/server/chunks/routes/api/database-backup/capability.get.mjs.map +1 -1
  133. package/.output/server/chunks/routes/api/database-export/export-database.mjs +4 -3
  134. package/.output/server/chunks/routes/api/database-export/export-database.mjs.map +1 -1
  135. package/.output/server/chunks/routes/api/database-export/jobs/_jobId/download.get.mjs +1 -20
  136. package/.output/server/chunks/routes/api/database-export/jobs/_jobId/download.get.mjs.map +1 -1
  137. package/.output/server/chunks/routes/api/database-export/jobs/_jobId_.get.mjs +1 -20
  138. package/.output/server/chunks/routes/api/database-export/jobs/_jobId_.get.mjs.map +1 -1
  139. package/.output/server/chunks/routes/api/database-import/import-database.mjs +14 -3
  140. package/.output/server/chunks/routes/api/database-import/import-database.mjs.map +1 -1
  141. package/.output/server/chunks/routes/api/database-import/jobs/_jobId_.get.mjs +1 -20
  142. package/.output/server/chunks/routes/api/database-import/jobs/_jobId_.get.mjs.map +1 -1
  143. package/.output/server/package.json +1 -1
  144. package/package.json +1 -1
  145. package/.output/public/_nuxt/27ZsWTm2.js +0 -1
  146. package/.output/public/_nuxt/4OV_5qQE.js +0 -1
  147. package/.output/public/_nuxt/6NXhlm49.js +0 -1
  148. package/.output/public/_nuxt/6wO6CbCo.js +0 -1
  149. package/.output/public/_nuxt/B10QBDL6.js +0 -1
  150. package/.output/public/_nuxt/B3iNzG14.js +0 -1
  151. package/.output/public/_nuxt/BKAEFZqP.js +0 -1
  152. package/.output/public/_nuxt/BTvOPFKG.js +0 -1
  153. package/.output/public/_nuxt/BbawOYVr.js +0 -1
  154. package/.output/public/_nuxt/Bf2bW_MY.js +0 -7
  155. package/.output/public/_nuxt/BhzzQZRC.js +0 -1
  156. package/.output/public/_nuxt/Bok35x_B.js +0 -1
  157. package/.output/public/_nuxt/BusLuQ4Q.js +0 -1
  158. package/.output/public/_nuxt/C7C1kq_N.js +0 -1
  159. package/.output/public/_nuxt/CCOlJAKS.js +0 -2
  160. package/.output/public/_nuxt/CEoM97rJ.js +0 -1
  161. package/.output/public/_nuxt/CHAVZu6b.js +0 -2
  162. package/.output/public/_nuxt/CN8b9qPP.js +0 -1
  163. package/.output/public/_nuxt/CUws2Uv7.js +0 -1
  164. package/.output/public/_nuxt/CZLVBTJx.js +0 -1
  165. package/.output/public/_nuxt/Cl5p4EQY.js +0 -1
  166. package/.output/public/_nuxt/CnQob-tn.js +0 -1
  167. package/.output/public/_nuxt/CoX1_N4R.js +0 -1
  168. package/.output/public/_nuxt/CvDZBOay.js +0 -1
  169. package/.output/public/_nuxt/D29mzs5t.js +0 -1
  170. package/.output/public/_nuxt/D9MMtvTu.js +0 -52
  171. package/.output/public/_nuxt/DM8LJTsg.js +0 -1
  172. package/.output/public/_nuxt/DZFq5yqu.js +0 -1
  173. package/.output/public/_nuxt/DZVfXu09.js +0 -1
  174. package/.output/public/_nuxt/DdbhVPqD.js +0 -1
  175. package/.output/public/_nuxt/DeVs4gEL.js +0 -53
  176. package/.output/public/_nuxt/DlymFQ5D.js +0 -26
  177. package/.output/public/_nuxt/DoNLWeqB.js +0 -20
  178. package/.output/public/_nuxt/Dpm6rnHk.js +0 -1
  179. package/.output/public/_nuxt/DsPClaxV.js +0 -1
  180. package/.output/public/_nuxt/DtOg0Asw.js +0 -1
  181. package/.output/public/_nuxt/DyDU0wFf.js +0 -1
  182. package/.output/public/_nuxt/G40WRC_L.js +0 -1
  183. package/.output/public/_nuxt/NMm6Vanu.js +0 -1
  184. package/.output/public/_nuxt/ORit_vRp.js +0 -1
  185. package/.output/public/_nuxt/P_2SRa71.js +0 -2
  186. package/.output/public/_nuxt/XETGYn3c.js +0 -1
  187. package/.output/public/_nuxt/ZVYA9HBl.js +0 -1
  188. package/.output/public/_nuxt/ZhP2FY6Y.js +0 -1
  189. package/.output/public/_nuxt/_TExiQQQ.js +0 -3
  190. package/.output/public/_nuxt/__PEYcIB.js +0 -9
  191. package/.output/public/_nuxt/builds/meta/47c294b1-d6b3-4974-bd50-5046ae0a393e.json +0 -1
  192. package/.output/public/_nuxt/dSX5D8ur.js +0 -28
  193. package/.output/public/_nuxt/entry.CGwcggc4.css +0 -1
  194. package/.output/public/_nuxt/o60RgyTd.js +0 -1
  195. package/.output/server/chunks/_/native-backup-jobs.mjs.map +0 -1
  196. package/.output/server/chunks/_/native-backup.mjs.map +0 -1
@@ -1,26 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DDsaDrGo.js","./DgGwe7jd.js","./entry.CGwcggc4.css","./CoQ_oOia.js","./DYqShb5v.js"])))=>i.map(i=>d[i]);
2
- var cc=Object.defineProperty;var dc=e=>{throw TypeError(e)};var pc=(e,t,s)=>t in e?cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var lt=(e,t,s)=>pc(e,typeof t!="symbol"?t+"":t,s);var Ke=(e,t,s)=>t.has(e)?dc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s);import{eS as fc,d as X,ak as xo,al as _o,V as cn,bC as wo,c as R,k as H,o as _,w as C,D as Qt,l as Z,g as b,bD as So,p as Bt,bc as Ia,a6 as Ma,bS as hc,a5 as To,f as x,b$ as mc,bB as gc,r as K,ap as vi,bE as Gn,bF as vc,aq as yc,$ as Ao,aL as Co,eT as yi,db as bc,an as Te,aK as xc,ao as dn,aJ as Ra,aE as ko,eU as _c,eV as wc,as as Wt,eW as Sc,eX as Tc,d9 as Ac,j as Da,q as Eo,a8 as es,n as fe,K as xn,eY as Va,au as vs,e as k,t as D,aD as Cc,av as kc,s as Re,ah as Le,d3 as Po,m as w,a7 as pn,a9 as fn,a4 as Ae,A as ye,aa as hn,F as he,z,cD as Io,bG as Ec,Z as Pc,bf as Ve,cl as ks,bg as _n,cg as Mo,bx as Ic,by as Mc,bz as Fs,aj as Rc,cJ as Dc,bL as Vc,bR as $c,bM as Lc,bN as Oc,bO as Nc,bQ as Bc,eZ as jc,ar as Ye,bj as Fc,dg as zc,dh as qc,W as bi,X as xi,dq as Uc,dr as Gc,dt as Hc,G as Ro,e_ as Do,dU as Zc,e$ as Wc,f0 as Kc,f1 as De,cy as V,f2 as Qs,f3 as Vo,f4 as Yc,f5 as ys,cB as oe,f6 as W,f7 as Ee,f8 as ut,f9 as Xc,fa as Es,fb as Jc,fc as Qc,fd as ue,fe as ed,cC as $o,ff as zs,aY as td,O as sd,fg as nd,fh as ad,I as id,dV as rd,eG as od,bh as ld,fi as ud,i as _i,fj as cd}from"./DgGwe7jd.js";import{a as dd,b as pd,_ as fd}from"./DZVfXu09.js";import{g as hd,c as md,a as gd,b as vd,d as yd}from"./DDsaDrGo.js";import{u as $a,_ as bd}from"./CnQob-tn.js";import{_ as xd}from"./EZ0owjER.js";import{_ as _d}from"./6NXhlm49.js";import{C as wd}from"./CoQ_oOia.js";import"./uDsvlLN0.js";import{b as La,a as Oa,D as Na,_ as Ba}from"./Bok35x_B.js";import{b as Sd,a as Td,E as Ad,c as Cd,d as kd,_ as Ed}from"./BnZ5qYkP.js";import{D as Lo,b as Hn,F as nt,G as Pd,H as Id,I as Md,P as we,J as wi,K as Si,L as Oo,M as Rd,N as Ti,O as Ai,Q as wn,l as qs,f as No,R as Dd,_ as ts,T as Bo,U as dt,V as Vd,W as jo,Z as $d,X as Us,Y as Sn,$ as Ci,a0 as Ld,a1 as Od,a2 as Nd,a3 as Bd,a4 as jd,a5 as Fd,a6 as zd,a7 as qd,a8 as ki,a9 as Fo,aa as Ud,ab as Gd,ac as Hd,ad as zo,ae as Zd,af as Wd,ag as Kd,ah as Yd,ai as Xd,aj as Jd,ak as Qd,al as qo,am as ep,v as Uo,an as tp,w as sp,y as np,x as ap,z as ip,A as rp,B as op,E as lp}from"./DeVs4gEL.js";import"./__PEYcIB.js";import"./6wO6CbCo.js";import"./DyDU0wFf.js";import"./B5rxJs06.js";import"./DP6Az3fC.js";import"./dDqgUqt5.js";const up="radio.select";function cp(e,t,s){fc(up,s,{originalEvent:e,value:t})}var dp=X({__name:"Radio",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:checked","select"],setup(e,{emit:t}){const s=e,n=t,a=xo(s,"checked",n,{passive:s.checked===void 0}),{value:i}=_o(s),{forwardRef:r,currentElement:o}=cn(),u=wo(o),l=R(()=>{var d;return s.id&&o.value?((d=document.querySelector(`[for="${s.id}"]`))==null?void 0:d.innerText)??s.value:void 0});function c(d){s.disabled||cp(d,s.value,p=>{n("select",p),!(p!=null&&p.defaultPrevented)&&(a.value=!0,u.value&&p.stopPropagation())})}return(d,p)=>(_(),H(b(Ma),Bt(d.$attrs,{id:d.id,ref:b(r),role:"radio",type:d.as==="button"?"button":void 0,as:d.as,"aria-checked":b(a),"aria-label":l.value,"as-child":d.asChild,disabled:d.disabled?"":void 0,"data-state":b(a)?"checked":"unchecked","data-disabled":d.disabled?"":void 0,value:b(i),required:d.required,name:d.name,onClick:Ia(c,["stop"])}),{default:C(()=>[Qt(d.$slots,"default",{checked:b(a)}),b(u)&&d.name?(_(),H(b(So),{key:0,type:"radio",tabindex:"-1",value:b(i),checked:!!b(a),name:d.name,disabled:d.disabled,required:d.required},null,8,["value","checked","name","disabled","required"])):Z("v-if",!0)]),_:3},16,["id","type","as","aria-checked","aria-label","as-child","disabled","data-state","data-disabled","value","required","name"]))}}),pp=dp;const[fp,hp]=To("RadioGroupRoot");var mp=X({__name:"RadioGroupRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const s=e,n=t,{forwardRef:a,currentElement:i}=cn(),r=xo(s,"modelValue",n,{defaultValue:s.defaultValue,passive:s.modelValue===void 0}),{disabled:o,loop:u,orientation:l,name:c,required:d,dir:p}=_o(s),f=hc(p),m=wo(i);return hp({modelValue:r,changeModelValue:y=>{r.value=y},disabled:o,loop:u,orientation:l,name:c==null?void 0:c.value,required:d}),(y,v)=>(_(),H(b(mc),{"as-child":"",orientation:b(l),dir:b(f),loop:b(u)},{default:C(()=>[x(b(Ma),{ref:b(a),role:"radiogroup","data-disabled":b(o)?"":void 0,"as-child":y.asChild,as:y.as,"aria-orientation":b(l),"aria-required":b(d),dir:b(f)},{default:C(()=>[Qt(y.$slots,"default",{modelValue:b(r)}),b(m)&&b(c)?(_(),H(b(So),{key:0,required:b(d),disabled:b(o),value:b(r),name:b(c)},null,8,["required","disabled","value","name"])):Z("v-if",!0)]),_:3},8,["data-disabled","as-child","as","aria-orientation","aria-required","dir"])]),_:3},8,["orientation","dir","loop"]))}}),gp=mp;const[vp,yp]=To("RadioGroupItem");var bp=X({inheritAttrs:!1,__name:"RadioGroupItem",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["select"],setup(e,{emit:t}){const s=e,n=t,{forwardRef:a,currentElement:i}=cn(),r=fp(),o=R(()=>r.disabled.value||s.disabled),u=R(()=>r.required.value||s.required),l=R(()=>{var f;return gc((f=r.modelValue)==null?void 0:f.value,s.value)});yp({disabled:o,checked:l});const c=K(!1),d=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];vi("keydown",f=>{d.includes(f.key)&&(c.value=!0)}),vi("keyup",()=>{c.value=!1});function p(){setTimeout(()=>{var f;c.value&&((f=i.value)==null||f.click())},0)}return(f,m)=>(_(),H(b(vc),{checked:l.value,disabled:o.value,"as-child":"",focusable:!o.value,active:l.value},{default:C(()=>[x(pp,Bt({...f.$attrs,...s},{ref:b(a),checked:l.value,required:u.value,disabled:o.value,"onUpdate:checked":m[0]||(m[0]=y=>b(r).changeModelValue(f.value)),onSelect:m[1]||(m[1]=y=>n("select",y)),onKeydown:m[2]||(m[2]=Gn(Ia(()=>{},["prevent"]),["enter"])),onFocus:p}),{default:C(()=>[Qt(f.$slots,"default",{checked:l.value,required:u.value,disabled:o.value})]),_:3},16,["checked","required","disabled"])]),_:3},8,["checked","disabled","focusable","active"]))}}),xp=bp,_p=X({__name:"RadioGroupIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const{forwardRef:t}=cn(),s=vp();return(n,a)=>(_(),H(b(yc),{present:n.forceMount||b(s).checked.value},{default:C(()=>[x(b(Ma),Bt({ref:b(t),"data-state":b(s).checked.value?"checked":"unchecked","data-disabled":b(s).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},n.$attrs),{default:C(()=>[Qt(n.$slots,"default")]),_:3},16,["data-state","data-disabled","as-child","as"])]),_:3},8,["present"]))}}),wp=_p,Ei=Math.PI*2,Gs=Math.PI/180;function Go(e,t){return Pd(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function Ho(e,t){var s=Go(e,t),n=e.get("center"),a=e.get("radius");Hn(a)||(a=[0,a]);var i=nt(s.width,t.getWidth()),r=nt(s.height,t.getHeight()),o=Math.min(i,r),u=nt(a[0],o/2),l=nt(a[1],o/2),c,d,p=e.coordinateSystem;if(p){var f=p.dataToPoint(n);c=f[0]||0,d=f[1]||0}else Hn(n)||(n=[n,n]),c=nt(n[0],i)+s.x,d=nt(n[1],r)+s.y;return{cx:c,cy:d,r0:u,r:l}}function Sp(e,t,s){t.eachSeriesByType(e,function(n){var a=n.getData(),i=a.mapDimension("value"),r=Go(n,s),o=Ho(n,s),u=o.cx,l=o.cy,c=o.r,d=o.r0,p=-n.get("startAngle")*Gs,f=n.get("endAngle"),m=n.get("padAngle")*Gs;f=f==="auto"?p-Ei:-f*Gs;var y=n.get("minAngle")*Gs,v=y+m,g=0;a.each(i,function(J){!isNaN(J)&&g++});var A=a.getSum(i),h=Math.PI/(A||g)*2,M=n.get("clockwise"),E=n.get("roseType"),I=n.get("stillShowZeroSum"),T=a.getDataExtent(i);T[0]=0;var S=M?1:-1,N=[p,f],$=S*m/2;Id(N,!M),p=N[0],f=N[1];var U=Zo(n);U.startAngle=p,U.endAngle=f,U.clockwise=M;var j=Math.abs(f-p),ie=j,P=0,O=p;if(a.setLayout({viewRect:r,r:c}),a.each(i,function(J,ee){var G;if(isNaN(J)){a.setItemLayout(ee,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:M,cx:u,cy:l,r0:d,r:E?NaN:c});return}E!=="area"?G=A===0&&I?h:J*h:G=j/g,G<v?(G=v,ie-=v):P+=J;var te=O+S*G,se=0,ne=0;m>G?(se=O+S*G/2,ne=se):(se=O+$,ne=te-$),a.setItemLayout(ee,{angle:G,startAngle:se,endAngle:ne,clockwise:M,cx:u,cy:l,r0:d,r:E?Md(J,T,[d,c]):c}),O=te}),ie<Ei&&g)if(ie<=.001){var q=j/g;a.each(i,function(J,ee){if(!isNaN(J)){var G=a.getItemLayout(ee);G.angle=q;var te=0,se=0;q<m?(te=p+S*(ee+1/2)*q,se=te):(te=p+S*ee*q+$,se=p+S*(ee+1)*q-$),G.startAngle=te,G.endAngle=se}})}else h=ie/P,O=p,a.each(i,function(J,ee){if(!isNaN(J)){var G=a.getItemLayout(ee),te=G.angle===v?v:J*h,se=0,ne=0;te<m?(se=O+S*te/2,ne=se):(se=O+$,ne=O+S*te-$),G.startAngle=se,G.endAngle=ne,O+=S*te}})})}var Zo=Lo();function Tp(e){return{seriesType:e,reset:function(t,s){var n=s.findComponents({mainType:"legend"});if(!(!n||!n.length)){var a=t.getData();a.filterSelf(function(i){for(var r=a.getName(i),o=0;o<n.length;o++)if(!n[o].isSelected(r))return!1;return!0})}}}}function Wo(e,t,s,n,a,i,r,o){var u=a-e,l=i-t,c=s-e,d=n-t,p=Math.sqrt(c*c+d*d);c/=p,d/=p;var f=u*c+l*d,m=f/p;m*=p;var y=r[0]=e+m*c,v=r[1]=t+m*d;return Math.sqrt((y-a)*(y-a)+(v-i)*(v-i))}var ft=new we,de=new we,_e=new we,ht=new we,Xe=new we,en=[],Pe=new we;function Ap(e,t){if(t<=180&&t>0){t=t/180*Math.PI,ft.fromArray(e[0]),de.fromArray(e[1]),_e.fromArray(e[2]),we.sub(ht,ft,de),we.sub(Xe,_e,de);var s=ht.len(),n=Xe.len();if(!(s<.001||n<.001)){ht.scale(1/s),Xe.scale(1/n);var a=ht.dot(Xe),i=Math.cos(t);if(i<a){var r=Wo(de.x,de.y,_e.x,_e.y,ft.x,ft.y,en);Pe.fromArray(en),Pe.scaleAndAdd(Xe,r/Math.tan(Math.PI-t));var o=_e.x!==de.x?(Pe.x-de.x)/(_e.x-de.x):(Pe.y-de.y)/(_e.y-de.y);if(isNaN(o))return;o<0?we.copy(Pe,de):o>1&&we.copy(Pe,_e),Pe.toArray(e[1])}}}}function Cp(e,t,s){if(s<=180&&s>0){s=s/180*Math.PI,ft.fromArray(e[0]),de.fromArray(e[1]),_e.fromArray(e[2]),we.sub(ht,de,ft),we.sub(Xe,_e,de);var n=ht.len(),a=Xe.len();if(!(n<.001||a<.001)){ht.scale(1/n),Xe.scale(1/a);var i=ht.dot(t),r=Math.cos(s);if(i<r){var o=Wo(de.x,de.y,_e.x,_e.y,ft.x,ft.y,en);Pe.fromArray(en);var u=Math.PI/2,l=Math.acos(Xe.dot(t)),c=u+l-s;if(c>=u)we.copy(Pe,_e);else{Pe.scaleAndAdd(Xe,o/Math.tan(Math.PI/2-c));var d=_e.x!==de.x?(Pe.x-de.x)/(_e.x-de.x):(Pe.y-de.y)/(_e.y-de.y);if(isNaN(d))return;d<0?we.copy(Pe,de):d>1&&we.copy(Pe,_e)}Pe.toArray(e[1])}}}}function Tn(e,t,s,n){var a=s==="normal",i=a?e:e.ensureState(s);i.ignore=t;var r=n.get("smooth");r&&r===!0&&(r=.3),i.shape=i.shape||{},r>0&&(i.shape.smooth=r);var o=n.getModel("lineStyle").getLineStyle();a?e.useStyle(o):i.style=o}function kp(e,t){var s=t.smooth,n=t.points;if(n)if(e.moveTo(n[0][0],n[0][1]),s>0&&n.length>=3){var a=Ai(n[0],n[1]),i=Ai(n[1],n[2]);if(!a||!i){e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]);return}var r=Math.min(a,i)*s,o=wn([],n[1],n[0],r/a),u=wn([],n[1],n[2],r/i),l=wn([],o,u,.5);e.bezierCurveTo(o[0],o[1],o[0],o[1],l[0],l[1]),e.bezierCurveTo(u[0],u[1],u[0],u[1],n[2][0],n[2][1])}else for(var c=1;c<n.length;c++)e.lineTo(n[c][0],n[c][1])}function Ep(e,t,s){var n=e.getTextGuideLine(),a=e.getTextContent();if(!a){n&&e.removeTextGuideLine();return}for(var i=t.normal,r=i.get("show"),o=a.ignore,u=0;u<wi.length;u++){var l=wi[u],c=t[l],d=l==="normal";if(c){var p=c.get("show"),f=d?o:Si(a.states[l]&&a.states[l].ignore,o);if(f||!Si(p,r)){var m=d?n:n&&n.states[l];m&&(m.ignore=!0),n&&Tn(n,!0,l,c);continue}n||(n=new Oo,e.setTextGuideLine(n),!d&&(o||!r)&&Tn(n,!0,"normal",t.normal),e.stateProxy&&(n.stateProxy=e.stateProxy)),Tn(n,!1,l,c)}}if(n){Rd(n.style,s),n.style.fill=null;var y=i.get("showAbove"),v=e.textGuideLineConfig=e.textGuideLineConfig||{};v.showAbove=y||!1,n.buildPath=kp}}function Pp(e,t){t=t||"labelLine";for(var s={normal:e.getModel(t)},n=0;n<Ti.length;n++){var a=Ti[n];s[a]=e.getModel([a,t])}return s}var Ip=Math.PI/180;function Pi(e,t,s,n,a,i,r,o,u,l){if(e.length<2)return;function c(y){for(var v=y.rB,g=v*v,A=0;A<y.list.length;A++){var h=y.list[A],M=Math.abs(h.label.y-s),E=n+h.len,I=E*E,T=Math.sqrt(Math.abs((1-M*M/g)*I)),S=t+(T+h.len2)*a,N=S-h.label.x,$=h.targetTextWidth-N*a;Ko(h,$,!0),h.label.x=S}}function d(y){for(var v={list:[],maxY:0},g={list:[],maxY:0},A=0;A<y.length;A++)if(y[A].labelAlignTo==="none"){var h=y[A],M=h.label.y>s?g:v,E=Math.abs(h.label.y-s);if(E>=M.maxY){var I=h.label.x-t-h.len2*a,T=n+h.len,S=Math.abs(I)<T?Math.sqrt(E*E/(1-I*I/T/T)):T;M.rB=S,M.maxY=E}M.list.push(h)}c(v),c(g)}for(var p=e.length,f=0;f<p;f++)if(e[f].position==="outer"&&e[f].labelAlignTo==="labelLine"){var m=e[f].label.x-l;e[f].linePoints[1][0]+=m,e[f].label.x=l}Dd(e,u,u+r)&&d(e)}function Mp(e,t,s,n,a,i,r,o){for(var u=[],l=[],c=Number.MAX_VALUE,d=-Number.MAX_VALUE,p=0;p<e.length;p++){var f=e[p].label;An(e[p])||(f.x<t?(c=Math.min(c,f.x),u.push(e[p])):(d=Math.max(d,f.x),l.push(e[p])))}for(var p=0;p<e.length;p++){var m=e[p];if(!An(m)&&m.linePoints){if(m.labelStyleWidth!=null)continue;var f=m.label,y=m.linePoints,v=void 0;m.labelAlignTo==="edge"?f.x<t?v=y[2][0]-m.labelDistance-r-m.edgeDistance:v=r+a-m.edgeDistance-y[2][0]-m.labelDistance:m.labelAlignTo==="labelLine"?f.x<t?v=c-r-m.bleedMargin:v=r+a-d-m.bleedMargin:f.x<t?v=f.x-r-m.bleedMargin:v=r+a-f.x-m.bleedMargin,m.targetTextWidth=v,Ko(m,v)}}Pi(l,t,s,n,1,a,i,r,o,d),Pi(u,t,s,n,-1,a,i,r,o,c);for(var p=0;p<e.length;p++){var m=e[p];if(!An(m)&&m.linePoints){var f=m.label,y=m.linePoints,g=m.labelAlignTo==="edge",A=f.style.padding,h=A?A[1]+A[3]:0,M=f.style.backgroundColor?0:h,E=m.rect.width+M,I=y[1][0]-y[2][0];g?f.x<t?y[2][0]=r+m.edgeDistance+E+m.labelDistance:y[2][0]=r+a-m.edgeDistance-E-m.labelDistance:(f.x<t?y[2][0]=f.x+m.labelDistance:y[2][0]=f.x-m.labelDistance,y[1][0]=y[2][0]+I),y[1][1]=y[2][1]=f.y}}}function Ko(e,t,s){if(s===void 0&&(s=!1),e.labelStyleWidth==null){var n=e.label,a=n.style,i=e.rect,r=a.backgroundColor,o=a.padding,u=o?o[1]+o[3]:0,l=a.overflow,c=i.width+(r?0:u);if(t<c||s){var d=i.height;if(l&&l.match("break")){n.setStyle("backgroundColor",null),n.setStyle("width",t-u);var p=n.getBoundingRect();n.setStyle("width",Math.ceil(p.width)),n.setStyle("backgroundColor",r)}else{var f=t-u,m=t<c?f:s?f>e.unconstrainedWidth?null:f:null;n.setStyle("width",m)}var y=n.getBoundingRect();i.width=y.width;var v=(n.style.margin||0)+2.1;i.height=y.height+v,i.y-=(i.height-d)/2}}}function An(e){return e.position==="center"}function Rp(e){var t=e.getData(),s=[],n,a,i=!1,r=(e.get("minShowLabelAngle")||0)*Ip,o=t.getLayout("viewRect"),u=t.getLayout("r"),l=o.width,c=o.x,d=o.y,p=o.height;function f(I){I.ignore=!0}function m(I){if(!I.ignore)return!0;for(var T in I.states)if(I.states[T].ignore===!1)return!0;return!1}t.each(function(I){var T=t.getItemGraphicEl(I),S=T.shape,N=T.getTextContent(),$=T.getTextGuideLine(),U=t.getItemModel(I),j=U.getModel("label"),ie=j.get("position")||U.get(["emphasis","label","position"]),P=j.get("distanceToLabelLine"),O=j.get("alignTo"),q=nt(j.get("edgeDistance"),l),J=j.get("bleedMargin"),ee=U.getModel("labelLine"),G=ee.get("length");G=nt(G,l);var te=ee.get("length2");if(te=nt(te,l),Math.abs(S.endAngle-S.startAngle)<r){qs(N.states,f),N.ignore=!0,$&&(qs($.states,f),$.ignore=!0);return}if(m(N)){var se=(S.startAngle+S.endAngle)/2,ne=Math.cos(se),Se=Math.sin(se),ge,Ze,st,jt;n=S.cx,a=S.cy;var We=ie==="inside"||ie==="inner";if(ie==="center")ge=S.cx,Ze=S.cy,jt="center";else{var is=(We?(S.r+S.r0)/2*ne:S.r*ne)+n,ze=(We?(S.r+S.r0)/2*Se:S.r*Se)+a;if(ge=is+ne*3,Ze=ze+Se*3,!We){var Ft=is+ne*(G+u-S.r),zt=ze+Se*(G+u-S.r),$s=Ft+(ne<0?-1:1)*te,Ls=zt;O==="edge"?ge=ne<0?c+q:c+l-q:ge=$s+(ne<0?-P:P),Ze=Ls,st=[[is,ze],[Ft,zt],[$s,Ls]]}jt=We?"center":O==="edge"?ne>0?"right":"left":ne>0?"left":"right"}var yt=Math.PI,rt=0,bt=j.get("rotate");if(No(bt))rt=bt*(yt/180);else if(ie==="center")rt=0;else if(bt==="radial"||bt===!0){var yn=ne<0?-se+yt:-se;rt=yn}else if(bt==="tangential"&&ie!=="outside"&&ie!=="outer"){var ot=Math.atan2(ne,Se);ot<0&&(ot=yt*2+ot);var bn=Se>0;bn&&(ot=yt+ot),rt=ot-yt}if(i=!!rt,N.x=ge,N.y=Ze,N.rotation=rt,N.setStyle({verticalAlign:"middle"}),We){N.setStyle({align:jt});var rs=N.states.select;rs&&(rs.x+=N.x,rs.y+=N.y)}else{var xt=N.getBoundingRect().clone();xt.applyTransform(N.getComputedTransform());var Os=(N.style.margin||0)+2.1;xt.y-=Os/2,xt.height+=Os,s.push({label:N,labelLine:$,position:ie,len:G,len2:te,minTurnAngle:ee.get("minTurnAngle"),maxSurfaceAngle:ee.get("maxSurfaceAngle"),surfaceNormal:new we(ne,Se),linePoints:st,textAlign:jt,labelDistance:P,labelAlignTo:O,edgeDistance:q,bleedMargin:J,rect:xt,unconstrainedWidth:xt.width,labelStyleWidth:N.style.width})}T.setTextConfig({inside:We})}}),!i&&e.get("avoidLabelOverlap")&&Mp(s,n,a,u,l,p,c,d);for(var y=0;y<s.length;y++){var v=s[y],g=v.label,A=v.labelLine,h=isNaN(g.x)||isNaN(g.y);if(g){g.setStyle({align:v.textAlign}),h&&(qs(g.states,f),g.ignore=!0);var M=g.states.select;M&&(M.x+=g.x,M.y+=g.y)}if(A){var E=v.linePoints;h||!E?(qs(A.states,f),A.ignore=!0):(Ap(E,v.minTurnAngle),Cp(E,v.surfaceNormal,v.maxSurfaceAngle),A.setShape({points:E}),g.__hostTarget.textGuideLineConfig={anchor:new we(E[0][0],E[0][1])})}}}var Dp=function(e){ts(t,e);function t(s,n,a){var i=e.call(this)||this;i.z2=2;var r=new $d;return i.setTextContent(r),i.updateData(s,n,a,!0),i}return t.prototype.updateData=function(s,n,a,i){var r=this,o=s.hostModel,u=s.getItemModel(n),l=u.getModel("emphasis"),c=s.getItemLayout(n),d=dt(Us(u.getModel("itemStyle"),c,!0),c);if(isNaN(d.startAngle)){r.setShape(d);return}if(i){r.setShape(d);var p=o.getShallow("animationType");o.ecModel.ssr?(Sn(r,{scaleX:0,scaleY:0},o,{dataIndex:n,isFrom:!0}),r.originX=d.cx,r.originY=d.cy):p==="scale"?(r.shape.r=c.r0,Sn(r,{shape:{r:c.r}},o,n)):a!=null?(r.setShape({startAngle:a,endAngle:a}),Sn(r,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},o,n)):(r.shape.endAngle=c.startAngle,Ci(r,{shape:{endAngle:c.endAngle}},o,n))}else Ld(r),Ci(r,{shape:d},o,n);r.useStyle(s.getItemVisual(n,"style")),Od(r,u);var f=(c.startAngle+c.endAngle)/2,m=o.get("selectedOffset"),y=Math.cos(f)*m,v=Math.sin(f)*m,g=u.getShallow("cursor");g&&r.attr("cursor",g),this._updateLabel(o,s,n),r.ensureState("emphasis").shape=dt({r:c.r+(l.get("scale")&&l.get("scaleSize")||0)},Us(l.getModel("itemStyle"),c)),dt(r.ensureState("select"),{x:y,y:v,shape:Us(u.getModel(["select","itemStyle"]),c)}),dt(r.ensureState("blur"),{shape:Us(u.getModel(["blur","itemStyle"]),c)});var A=r.getTextGuideLine(),h=r.getTextContent();A&&dt(A.ensureState("select"),{x:y,y:v}),dt(h.ensureState("select"),{x:y,y:v}),Nd(this,l.get("focus"),l.get("blurScope"),l.get("disabled"))},t.prototype._updateLabel=function(s,n,a){var i=this,r=n.getItemModel(a),o=r.getModel("labelLine"),u=n.getItemVisual(a,"style"),l=u&&u.fill,c=u&&u.opacity;Bd(i,jd(r),{labelFetcher:n.hostModel,labelDataIndex:a,inheritColor:l,defaultOpacity:c,defaultText:s.getFormattedLabel(a,"normal")||n.getName(a)});var d=i.getTextContent();i.setTextConfig({position:null,rotation:null}),d.attr({z2:10});var p=s.get(["label","position"]);if(p!=="outside"&&p!=="outer")i.removeTextGuideLine();else{var f=this.getTextGuideLine();f||(f=new Oo,this.setTextGuideLine(f)),Ep(this,Pp(r),{stroke:l,opacity:Fd(o.get(["lineStyle","opacity"]),c,1)})}},t}(Bo),Vp=function(e){ts(t,e);function t(){var s=e!==null&&e.apply(this,arguments)||this;return s.ignoreLabelLineUpdate=!0,s}return t.prototype.render=function(s,n,a,i){var r=s.getData(),o=this._data,u=this.group,l;if(!o&&r.count()>0){for(var c=r.getItemLayout(0),d=1;isNaN(c&&c.startAngle)&&d<r.count();++d)c=r.getItemLayout(d);c&&(l=c.startAngle)}if(this._emptyCircleSector&&u.remove(this._emptyCircleSector),r.count()===0&&s.get("showEmptyCircle")){var p=Zo(s),f=new Bo({shape:dt(Ho(s,a),p)});f.useStyle(s.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=f,u.add(f)}r.diff(o).add(function(m){var y=new Dp(r,m,l);r.setItemGraphicEl(m,y),u.add(y)}).update(function(m,y){var v=o.getItemGraphicEl(y);v.updateData(r,m,l),v.off("click"),u.add(v),r.setItemGraphicEl(m,v)}).remove(function(m){var y=o.getItemGraphicEl(m);Vd(y,s,m)}).execute(),Rp(s),s.get("animationTypeUpdate")!=="expansion"&&(this._data=r)},t.prototype.dispose=function(){},t.prototype.containPoint=function(s,n){var a=n.getData(),i=a.getItemLayout(0);if(i){var r=s[0]-i.cx,o=s[1]-i.cy,u=Math.sqrt(r*r+o*o);return u<=i.r&&u>=i.r0}},t.type="pie",t}(jo);function $p(e,t,s){t=Hn(t)&&{coordDimensions:t}||dt({encodeDefine:e.getEncode()},t);var n=e.getSource(),a=zd(n,t).dimensions,i=new qd(a,e);return i.initData(n,s),i}var Lp=function(){function e(t,s){this._getDataWithEncodedVisual=t,this._getRawData=s}return e.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},e.prototype.containName=function(t){var s=this._getRawData();return s.indexOfName(t)>=0},e.prototype.indexOfName=function(t){var s=this._getDataWithEncodedVisual();return s.indexOfName(t)},e.prototype.getItemVisual=function(t,s){var n=this._getDataWithEncodedVisual();return n.getItemVisual(t,s)},e}(),Op=Lo(),Np=function(e){ts(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(s){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new Lp(ki(this.getData,this),ki(this.getRawData,this)),this._defaultLabelLine(s)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return $p(this,{coordDimensions:["value"],encodeDefaulter:Fo(Ud,this)})},t.prototype.getDataParams=function(s){var n=this.getData(),a=Op(n),i=a.seats;if(!i){var r=[];n.each(n.mapDimension("value"),function(u){r.push(u)}),i=a.seats=Gd(r,n.hostModel.get("percentPrecision"))}var o=e.prototype.getDataParams.call(this,s);return o.percent=i[s]||0,o.$vars.push("percent"),o},t.prototype._defaultLabelLine=function(s){Hd(s,"labelLine",["show"]);var n=s.labelLine,a=s.emphasis.labelLine;n.show=n.show&&s.label.show,a.show=a.show&&s.emphasis.label.show},t.type="series.pie",t.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},t}(zo);function Bp(e){return{seriesType:e,reset:function(t,s){var n=t.getData();n.filterSelf(function(a){var i=n.mapDimension("value"),r=n.get(i,a);return!(No(r)&&!isNaN(r)&&r<0)})}}}function jp(e){e.registerChartView(Vp),e.registerSeriesModel(Np),Zd("pie",e.registerAction),e.registerLayout(Fo(Sp,"pie")),e.registerProcessor(Tp("pie")),e.registerProcessor(Bp("pie"))}var Fp=function(e){ts(t,e);function t(){var s=e!==null&&e.apply(this,arguments)||this;return s.type=t.type,s.hasSymbolVisual=!0,s}return t.prototype.getInitialData=function(s,n){return Wd(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){var s=this.option.progressive;return s??(this.option.large?5e3:this.get("progressive"))},t.prototype.getProgressiveThreshold=function(){var s=this.option.progressiveThreshold;return s??(this.option.large?1e4:this.get("progressiveThreshold"))},t.prototype.brushSelector=function(s,n,a){return a.point(n.getItemLayout(s))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},t.type="series.scatter",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},t}(zo),Yo=4,zp=function(){function e(){}return e}(),qp=function(e){ts(t,e);function t(s){var n=e.call(this,s)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.getDefaultShape=function(){return new zp},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(s,n){var a=n.points,i=n.size,r=this.symbolProxy,o=r.shape,u=s.getContext?s.getContext():s,l=u&&i[0]<Yo,c=this.softClipShape,d;if(l){this._ctx=u;return}for(this._ctx=null,d=this._off;d<a.length;){var p=a[d++],f=a[d++];isNaN(p)||isNaN(f)||c&&!c.contain(p,f)||(o.x=p-i[0]/2,o.y=f-i[1]/2,o.width=i[0],o.height=i[1],r.buildPath(s,o,!0))}this.incremental&&(this._off=d,this.notClear=!0)},t.prototype.afterBrush=function(){var s=this.shape,n=s.points,a=s.size,i=this._ctx,r=this.softClipShape,o;if(i){for(o=this._off;o<n.length;){var u=n[o++],l=n[o++];isNaN(u)||isNaN(l)||r&&!r.contain(u,l)||i.fillRect(u-a[0]/2,l-a[1]/2,a[0],a[1])}this.incremental&&(this._off=o,this.notClear=!0)}},t.prototype.findDataIndex=function(s,n){for(var a=this.shape,i=a.points,r=a.size,o=Math.max(r[0],4),u=Math.max(r[1],4),l=i.length/2-1;l>=0;l--){var c=l*2,d=i[c]-o/2,p=i[c+1]-u/2;if(s>=d&&n>=p&&s<=d+o&&n<=p+u)return l}return-1},t.prototype.contain=function(s,n){var a=this.transformCoordToLocal(s,n),i=this.getBoundingRect();if(s=a[0],n=a[1],i.contain(s,n)){var r=this.hoverDataIdx=this.findDataIndex(s,n);return r>=0}return this.hoverDataIdx=-1,!1},t.prototype.getBoundingRect=function(){var s=this._rect;if(!s){for(var n=this.shape,a=n.points,i=n.size,r=i[0],o=i[1],u=1/0,l=1/0,c=-1/0,d=-1/0,p=0;p<a.length;){var f=a[p++],m=a[p++];u=Math.min(f,u),c=Math.max(f,c),l=Math.min(m,l),d=Math.max(m,d)}s=this._rect=new Yd(u-r/2,l-o/2,c-u+r,d-l+o)}return s},t}(Xd),Up=function(){function e(){this.group=new Kd}return e.prototype.updateData=function(t,s){this._clear();var n=this._create();n.setShape({points:t.getLayout("points")}),this._setCommon(n,t,s)},e.prototype.updateLayout=function(t){var s=t.getLayout("points");this.group.eachChild(function(n){if(n.startIndex!=null){var a=(n.endIndex-n.startIndex)*2,i=n.startIndex*4*2;s=new Float32Array(s.buffer,i,a)}n.setShape("points",s),n.reset()})},e.prototype.incrementalPrepareUpdate=function(t){this._clear()},e.prototype.incrementalUpdate=function(t,s,n){var a=this._newAdded[0],i=s.getLayout("points"),r=a&&a.shape.points;if(r&&r.length<2e4){var o=r.length,u=new Float32Array(o+i.length);u.set(r),u.set(i,o),a.endIndex=t.end,a.setShape({points:u})}else{this._newAdded=[];var l=this._create();l.startIndex=t.start,l.endIndex=t.end,l.incremental=!0,l.setShape({points:i}),this._setCommon(l,s,n)}},e.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},e.prototype._create=function(){var t=new qp({cursor:"default"});return t.ignoreCoarsePointer=!0,this.group.add(t),this._newAdded.push(t),t},e.prototype._setCommon=function(t,s,n){var a=s.hostModel;n=n||{};var i=s.getVisual("symbolSize");t.setShape("size",i instanceof Array?i:[i,i]),t.softClipShape=n.clipShape||null,t.symbolProxy=Jd(s.getVisual("symbol"),0,0,0,0),t.setColor=t.symbolProxy.setColor;var r=t.shape.size[0]<Yo;t.useStyle(a.getModel("itemStyle").getItemStyle(r?["color","shadowBlur","shadowColor"]:["color"]));var o=s.getVisual("style"),u=o&&o.fill;u&&t.setColor(u);var l=Qd(t);l.seriesIndex=a.seriesIndex,t.on("mousemove",function(c){l.dataIndex=null;var d=t.hoverDataIdx;d>=0&&(l.dataIndex=d+(t.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),Gp=function(e){ts(t,e);function t(){var s=e!==null&&e.apply(this,arguments)||this;return s.type=t.type,s}return t.prototype.render=function(s,n,a){var i=s.getData(),r=this._updateSymbolDraw(i,s);r.updateData(i,{clipShape:this._getClipShape(s)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(s,n,a){var i=s.getData(),r=this._updateSymbolDraw(i,s);r.incrementalPrepareUpdate(i),this._finished=!1},t.prototype.incrementalRender=function(s,n,a){this._symbolDraw.incrementalUpdate(s,n.getData(),{clipShape:this._getClipShape(n)}),this._finished=s.end===n.getData().count()},t.prototype.updateTransform=function(s,n,a){var i=s.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var r=qo("").reset(s,n,a);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},t.prototype.eachRendered=function(s){this._symbolDraw&&this._symbolDraw.eachRendered(s)},t.prototype._getClipShape=function(s){if(s.get("clip",!0)){var n=s.coordinateSystem;return n&&n.getArea&&n.getArea(.1)}},t.prototype._updateSymbolDraw=function(s,n){var a=this._symbolDraw,i=n.pipelineContext,r=i.large;return(!a||r!==this._isLargeDraw)&&(a&&a.remove(),a=this._symbolDraw=r?new Up:new ep,this._isLargeDraw=r,this.group.removeAll()),this.group.add(a.group),a},t.prototype.remove=function(s,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type="scatter",t}(jo);function Hp(e){Uo(tp),e.registerSeriesModel(Fp),e.registerChartView(Gp),e.registerLayout(qo("scatter"))}function Ps(e,t){const s=typeof e=="string"?`${e}Context`:t,n=Symbol(s);return[r=>{const o=Ao(n,r);if(o===void 0)throw new Error(`Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`);return o},r=>(Co(n,r),r),n]}function Zp(e,t){const{layoutGroup:s,presenceContext:n,config:a}=t,i=s.id&&e.layoutId?`${s.id}-${e.layoutId}`:e.layoutId||void 0;return{...e,layoutId:i,transition:e.transition??a.transition,layoutGroup:s,motionConfig:a,inViewOptions:e.inViewOptions??a.inViewOptions,presenceContext:n,initial:n.initial===!1?n.initial:e.initial===!0?void 0:e.initial}}function ja(e,t){e.indexOf(t)===-1&&e.push(t)}function tn(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const et=(e,t,s)=>s>t?t:s<e?e:s;let Fa=()=>{};const at={},Xo=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Jo(e){return typeof e=="object"&&e!==null}const Qo=e=>/^0[^.\s]+$/u.test(e);function el(e){let t;return()=>(t===void 0&&(t=e()),t)}const je=e=>e,Wp=(e,t)=>s=>t(e(s)),Is=(...e)=>e.reduce(Wp),bs=(e,t,s)=>{const n=t-e;return n===0?1:(s-e)/n};class za{constructor(){this.subscriptions=[]}add(t){return ja(this.subscriptions,t),()=>tn(this.subscriptions,t)}notify(t,s,n){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,s,n);else for(let i=0;i<a;i++){const r=this.subscriptions[i];r&&r(t,s,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Fe=e=>e*1e3,Be=e=>e/1e3;function tl(e,t){return t?e*(1e3/t):0}const sl=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,Kp=1e-7,Yp=12;function Xp(e,t,s,n,a){let i,r,o=0;do r=t+(s-t)/2,i=sl(r,n,a)-e,i>0?s=r:t=r;while(Math.abs(i)>Kp&&++o<Yp);return r}function Ms(e,t,s,n){if(e===t&&s===n)return je;const a=i=>Xp(i,0,1,e,s);return i=>i===0||i===1?i:sl(a(i),t,n)}const nl=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,al=e=>t=>1-e(1-t),il=Ms(.33,1.53,.69,.99),qa=al(il),rl=nl(qa),ol=e=>(e*=2)<1?.5*qa(e):.5*(2-Math.pow(2,-10*(e-1))),Ua=e=>1-Math.sin(Math.acos(e)),ll=al(Ua),ul=nl(Ua),Jp=Ms(.42,0,1,1),Qp=Ms(0,0,.58,1),cl=Ms(.42,0,.58,1),ef=e=>Array.isArray(e)&&typeof e[0]!="number",dl=e=>Array.isArray(e)&&typeof e[0]=="number",tf={linear:je,easeIn:Jp,easeInOut:cl,easeOut:Qp,circIn:Ua,circInOut:ul,circOut:ll,backIn:qa,backInOut:rl,backOut:il,anticipate:ol},sf=e=>typeof e=="string",Ii=e=>{if(dl(e)){Fa(e.length===4);const[t,s,n,a]=e;return Ms(t,s,n,a)}else if(sf(e))return tf[e];return e},Hs=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function nf(e,t){let s=new Set,n=new Set,a=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function u(c){r.has(c)&&(l.schedule(c),e()),c(o)}const l={schedule:(c,d=!1,p=!1)=>{const m=p&&a?s:n;return d&&r.add(c),m.has(c)||m.add(c),c},cancel:c=>{n.delete(c),r.delete(c)},process:c=>{if(o=c,a){i=!0;return}a=!0,[s,n]=[n,s],s.forEach(u),s.clear(),a=!1,i&&(i=!1,l.process(c))}};return l}const af=40;function pl(e,t){let s=!1,n=!0;const a={delta:0,timestamp:0,isProcessing:!1},i=()=>s=!0,r=Hs.reduce((h,M)=>(h[M]=nf(i),h),{}),{setup:o,read:u,resolveKeyframes:l,preUpdate:c,update:d,preRender:p,render:f,postRender:m}=r,y=()=>{const h=at.useManualTiming?a.timestamp:performance.now();s=!1,at.useManualTiming||(a.delta=n?1e3/60:Math.max(Math.min(h-a.timestamp,af),1)),a.timestamp=h,a.isProcessing=!0,o.process(a),u.process(a),l.process(a),c.process(a),d.process(a),p.process(a),f.process(a),m.process(a),a.isProcessing=!1,s&&t&&(n=!1,e(y))},v=()=>{s=!0,n=!0,a.isProcessing||e(y)};return{schedule:Hs.reduce((h,M)=>{const E=r[M];return h[M]=(I,T=!1,S=!1)=>(s||v(),E.schedule(I,T,S)),h},{}),cancel:h=>{for(let M=0;M<Hs.length;M++)r[Hs[M]].cancel(h)},state:a,steps:r}}const{schedule:ae,cancel:vt,state:xe,steps:Cn}=pl(typeof requestAnimationFrame<"u"?requestAnimationFrame:je,!0);let Ys;function rf(){Ys=void 0}const Ie={now:()=>(Ys===void 0&&Ie.set(xe.isProcessing||at.useManualTiming?xe.timestamp:performance.now()),Ys),set:e=>{Ys=e,queueMicrotask(rf)}},fl=e=>t=>typeof t=="string"&&t.startsWith(e),Ga=fl("--"),of=fl("var(--"),Ha=e=>of(e)?lf.test(e.split("/*")[0].trim()):!1,lf=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mi(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const ss={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},xs={...ss,transform:e=>et(0,1,e)},Zs={...ss,default:1},fs=e=>Math.round(e*1e5)/1e5,Za=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function uf(e){return e==null}const cf=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wa=(e,t)=>s=>!!(typeof s=="string"&&cf.test(s)&&s.startsWith(e)||t&&!uf(s)&&Object.prototype.hasOwnProperty.call(s,t)),hl=(e,t,s)=>n=>{if(typeof n!="string")return n;const[a,i,r,o]=n.match(Za);return{[e]:parseFloat(a),[t]:parseFloat(i),[s]:parseFloat(r),alpha:o!==void 0?parseFloat(o):1}},df=e=>et(0,255,e),kn={...ss,transform:e=>Math.round(df(e))},Ct={test:Wa("rgb","red"),parse:hl("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:n=1})=>"rgba("+kn.transform(e)+", "+kn.transform(t)+", "+kn.transform(s)+", "+fs(xs.transform(n))+")"};function pf(e){let t="",s="",n="",a="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),n=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),n=e.substring(3,4),a=e.substring(4,5),t+=t,s+=s,n+=n,a+=a),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:a?parseInt(a,16)/255:1}}const Zn={test:Wa("#"),parse:pf,transform:Ct.transform},Rs=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ct=Rs("deg"),Qe=Rs("%"),F=Rs("px"),ff=Rs("vh"),hf=Rs("vw"),Ri={...Qe,parse:e=>Qe.parse(e)/100,transform:e=>Qe.transform(e*100)},Ut={test:Wa("hsl","hue"),parse:hl("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:n=1})=>"hsla("+Math.round(e)+", "+Qe.transform(fs(t))+", "+Qe.transform(fs(s))+", "+fs(xs.transform(n))+")"},me={test:e=>Ct.test(e)||Zn.test(e)||Ut.test(e),parse:e=>Ct.test(e)?Ct.parse(e):Ut.test(e)?Ut.parse(e):Zn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ct.transform(e):Ut.transform(e),getAnimatableNone:e=>{const t=me.parse(e);return t.alpha=0,me.transform(t)}},mf=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function gf(e){var t,s;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Za))==null?void 0:t.length)||0)+(((s=e.match(mf))==null?void 0:s.length)||0)>0}const ml="number",gl="color",vf="var",yf="var(",Di="${}",bf=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Yt(e){const t=e.toString(),s=[],n={color:[],number:[],var:[]},a=[];let i=0;const o=t.replace(bf,u=>(me.test(u)?(n.color.push(i),a.push(gl),s.push(me.parse(u))):u.startsWith(yf)?(n.var.push(i),a.push(vf),s.push(u)):(n.number.push(i),a.push(ml),s.push(parseFloat(u))),++i,Di)).split(Di);return{values:s,split:o,indexes:n,types:a}}function xf(e){return Yt(e).values}function vl({split:e,types:t}){const s=e.length;return n=>{let a="";for(let i=0;i<s;i++)if(a+=e[i],n[i]!==void 0){const r=t[i];r===ml?a+=fs(n[i]):r===gl?a+=me.transform(n[i]):a+=n[i]}return a}}function _f(e){return vl(Yt(e))}const wf=e=>typeof e=="number"?0:me.test(e)?me.getAnimatableNone(e):e,Sf=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:wf(e);function Tf(e){const t=Yt(e);return vl(t)(t.values.map((n,a)=>Sf(n,t.split[a])))}const He={test:gf,parse:xf,createTransformer:_f,getAnimatableNone:Tf};function En(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function Af({hue:e,saturation:t,lightness:s,alpha:n}){e/=360,t/=100,s/=100;let a=0,i=0,r=0;if(!t)a=i=r=s;else{const o=s<.5?s*(1+t):s+t-s*t,u=2*s-o;a=En(u,o,e+1/3),i=En(u,o,e),r=En(u,o,e-1/3)}return{red:Math.round(a*255),green:Math.round(i*255),blue:Math.round(r*255),alpha:n}}function sn(e,t){return s=>s>0?t:e}const ce=(e,t,s)=>e+(t-e)*s,Pn=(e,t,s)=>{const n=e*e,a=s*(t*t-n)+n;return a<0?0:Math.sqrt(a)},Cf=[Zn,Ct,Ut],kf=e=>Cf.find(t=>t.test(e));function Vi(e){const t=kf(e);if(!t)return!1;let s=t.parse(e);return t===Ut&&(s=Af(s)),s}const $i=(e,t)=>{const s=Vi(e),n=Vi(t);if(!s||!n)return sn(e,t);const a={...s};return i=>(a.red=Pn(s.red,n.red,i),a.green=Pn(s.green,n.green,i),a.blue=Pn(s.blue,n.blue,i),a.alpha=ce(s.alpha,n.alpha,i),Ct.transform(a))},Wn=new Set(["none","hidden"]);function Ef(e,t){return Wn.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function Pf(e,t){return s=>ce(e,t,s)}function Ka(e){return typeof e=="number"?Pf:typeof e=="string"?Ha(e)?sn:me.test(e)?$i:Rf:Array.isArray(e)?yl:typeof e=="object"?me.test(e)?$i:If:sn}function yl(e,t){const s=[...e],n=s.length,a=e.map((i,r)=>Ka(i)(i,t[r]));return i=>{for(let r=0;r<n;r++)s[r]=a[r](i);return s}}function If(e,t){const s={...e,...t},n={};for(const a in s)e[a]!==void 0&&t[a]!==void 0&&(n[a]=Ka(e[a])(e[a],t[a]));return a=>{for(const i in n)s[i]=n[i](a);return s}}function Mf(e,t){const s=[],n={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],r=e.indexes[i][n[i]],o=e.values[r]??0;s[a]=o,n[i]++}return s}const Rf=(e,t)=>{const s=He.createTransformer(t),n=Yt(e),a=Yt(t);return n.indexes.var.length===a.indexes.var.length&&n.indexes.color.length===a.indexes.color.length&&n.indexes.number.length>=a.indexes.number.length?Wn.has(e)&&!a.values.length||Wn.has(t)&&!n.values.length?Ef(e,t):Is(yl(Mf(n,a),a.values),s):sn(e,t)};function bl(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?ce(e,t,s):Ka(e)(e,t)}const Df=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>ae.update(t,s),stop:()=>vt(t),now:()=>xe.isProcessing?xe.timestamp:Ie.now()}},xl=(e,t,s=10)=>{let n="";const a=Math.max(Math.round(t/s),2);for(let i=0;i<a;i++)n+=Math.round(e(i/(a-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},nn=2e4;function Ya(e){let t=0;const s=50;let n=e.next(t);for(;!n.done&&t<nn;)t+=s,n=e.next(t);return t>=nn?1/0:t}function Vf(e,t=100,s){const n=s({...e,keyframes:[0,t]}),a=Math.min(Ya(n),nn);return{type:"keyframes",ease:i=>n.next(a*i).value/t,duration:Be(a)}}const pe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Kn(e,t){return e*Math.sqrt(1-t*t)}const $f=12;function Lf(e,t,s){let n=s;for(let a=1;a<$f;a++)n=n-e(n)/t(n);return n}const Li=.001;function Of({duration:e=pe.duration,bounce:t=pe.bounce,velocity:s=pe.velocity,mass:n=pe.mass}){let a,i,r=1-t;r=et(pe.minDamping,pe.maxDamping,r),e=et(pe.minDuration,pe.maxDuration,Be(e)),r<1?(a=l=>{const c=l*r,d=c*e,p=c-s,f=Kn(l,r),m=Math.exp(-d);return Li-p/f*m},i=l=>{const d=l*r*e,p=d*s+s,f=Math.pow(r,2)*Math.pow(l,2)*e,m=Math.exp(-d),y=Kn(Math.pow(l,2),r);return(-a(l)+Li>0?-1:1)*((p-f)*m)/y}):(a=l=>{const c=Math.exp(-l*e),d=(l-s)*e+1;return-.001+c*d},i=l=>{const c=Math.exp(-l*e),d=(s-l)*(e*e);return c*d});const o=5/e,u=Lf(a,i,o);if(e=Fe(e),isNaN(u))return{stiffness:pe.stiffness,damping:pe.damping,duration:e};{const l=Math.pow(u,2)*n;return{stiffness:l,damping:r*2*Math.sqrt(n*l),duration:e}}}const Nf=["duration","bounce"],Bf=["stiffness","damping","mass"];function Oi(e,t){return t.some(s=>e[s]!==void 0)}function jf(e){let t={velocity:pe.velocity,stiffness:pe.stiffness,damping:pe.damping,mass:pe.mass,isResolvedFromDuration:!1,...e};if(!Oi(e,Bf)&&Oi(e,Nf))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,n=2*Math.PI/(s*1.2),a=n*n,i=2*et(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:pe.mass,stiffness:a,damping:i}}else{const s=Of({...e,velocity:0});t={...t,...s,mass:pe.mass},t.isResolvedFromDuration=!0}return t}function an(e=pe.visualDuration,t=pe.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:a}=s;const i=s.keyframes[0],r=s.keyframes[s.keyframes.length-1],o={done:!1,value:i},{stiffness:u,damping:l,mass:c,duration:d,velocity:p,isResolvedFromDuration:f}=jf({...s,velocity:-Be(s.velocity||0)}),m=p||0,y=l/(2*Math.sqrt(u*c)),v=r-i,g=Be(Math.sqrt(u/c)),A=Math.abs(v)<5;n||(n=A?pe.restSpeed.granular:pe.restSpeed.default),a||(a=A?pe.restDelta.granular:pe.restDelta.default);let h,M,E,I,T,S;if(y<1)E=Kn(g,y),I=(m+y*g*v)/E,h=$=>{const U=Math.exp(-y*g*$);return r-U*(I*Math.sin(E*$)+v*Math.cos(E*$))},T=y*g*I+v*E,S=y*g*v-I*E,M=$=>Math.exp(-y*g*$)*(T*Math.sin(E*$)+S*Math.cos(E*$));else if(y===1){h=U=>r-Math.exp(-g*U)*(v+(m+g*v)*U);const $=m+g*v;M=U=>Math.exp(-g*U)*(g*$*U-m)}else{const $=g*Math.sqrt(y*y-1);h=P=>{const O=Math.exp(-y*g*P),q=Math.min($*P,300);return r-O*((m+y*g*v)*Math.sinh(q)+$*v*Math.cosh(q))/$};const U=(m+y*g*v)/$,j=y*g*U-v*$,ie=y*g*v-U*$;M=P=>{const O=Math.exp(-y*g*P),q=Math.min($*P,300);return O*(j*Math.sinh(q)+ie*Math.cosh(q))}}const N={calculatedDuration:f&&d||null,velocity:$=>Fe(M($)),next:$=>{if(!f&&y<1){const j=Math.exp(-y*g*$),ie=Math.sin(E*$),P=Math.cos(E*$),O=r-j*(I*ie+v*P),q=Fe(j*(T*ie+S*P));return o.done=Math.abs(q)<=n&&Math.abs(r-O)<=a,o.value=o.done?r:O,o}const U=h($);if(f)o.done=$>=d;else{const j=Fe(M($));o.done=Math.abs(j)<=n&&Math.abs(r-U)<=a}return o.value=o.done?r:U,o},toString:()=>{const $=Math.min(Ya(N),nn),U=xl(j=>N.next($*j).value,$,30);return $+"ms "+U},toTransition:()=>{}};return N}an.applyToOptions=e=>{const t=Vf(e,100,an);return e.ease=t.ease,e.duration=Fe(t.duration),e.type="keyframes",e};const Ff=5;function _l(e,t,s){const n=Math.max(t-Ff,0);return tl(s-e(n),t-n)}function Yn({keyframes:e,velocity:t=0,power:s=.8,timeConstant:n=325,bounceDamping:a=10,bounceStiffness:i=500,modifyTarget:r,min:o,max:u,restDelta:l=.5,restSpeed:c}){const d=e[0],p={done:!1,value:d},f=S=>o!==void 0&&S<o||u!==void 0&&S>u,m=S=>o===void 0?u:u===void 0||Math.abs(o-S)<Math.abs(u-S)?o:u;let y=s*t;const v=d+y,g=r===void 0?v:r(v);g!==v&&(y=g-d);const A=S=>-y*Math.exp(-S/n),h=S=>g+A(S),M=S=>{const N=A(S),$=h(S);p.done=Math.abs(N)<=l,p.value=p.done?g:$};let E,I;const T=S=>{f(p.value)&&(E=S,I=an({keyframes:[p.value,m(p.value)],velocity:_l(h,S,p.value),damping:a,stiffness:i,restDelta:l,restSpeed:c}))};return T(0),{calculatedDuration:null,next:S=>{let N=!1;return!I&&E===void 0&&(N=!0,M(S),T(S)),E!==void 0&&S>=E?I.next(S-E):(!N&&M(S),p)}}}function zf(e,t,s){const n=[],a=s||at.mix||bl,i=e.length-1;for(let r=0;r<i;r++){let o=a(e[r],e[r+1]);if(t){const u=Array.isArray(t)?t[r]||je:t;o=Is(u,o)}n.push(o)}return n}function qf(e,t,{clamp:s=!0,ease:n,mixer:a}={}){const i=e.length;if(Fa(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const r=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=zf(t,n,a),u=o.length,l=c=>{if(r&&c<e[0])return t[0];let d=0;if(u>1)for(;d<e.length-2&&!(c<e[d+1]);d++);const p=bs(e[d],e[d+1],c);return o[d](p)};return s?c=>l(et(e[0],e[i-1],c)):l}function Uf(e,t){const s=e[e.length-1];for(let n=1;n<=t;n++){const a=bs(0,t,n);e.push(ce(s,1,a))}}function Gf(e){const t=[0];return Uf(t,e.length-1),t}function Hf(e,t){return e.map(s=>s*t)}function Zf(e,t){return e.map(()=>t||cl).splice(0,e.length-1)}function hs({duration:e=300,keyframes:t,times:s,ease:n="easeInOut"}){const a=ef(n)?n.map(Ii):Ii(n),i={done:!1,value:t[0]},r=Hf(s&&s.length===t.length?s:Gf(t),e),o=qf(r,t,{ease:Array.isArray(a)?a:Zf(t,a)});return{calculatedDuration:e,next:u=>(i.value=o(u),i.done=u>=e,i)}}const Wf=e=>e!==null;function Xa(e,{repeat:t,repeatType:s="loop"},n,a=1){const i=e.filter(Wf),o=a<0||t&&s!=="loop"&&t%2===1?0:i.length-1;return!o||n===void 0?i[o]:n}const Kf={decay:Yn,inertia:Yn,tween:hs,keyframes:hs,spring:an};function wl(e){typeof e.type=="string"&&(e.type=Kf[e.type])}class Ja{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,s){return this.finished.then(t,s)}}const Yf=e=>e/100;class Qa extends Ja{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,a;const{motionValue:s}=this.options;s&&s.updatedAt!==Ie.now()&&this.tick(Ie.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(a=(n=this.options).onStop)==null||a.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;wl(t);const{type:s=hs,repeat:n=0,repeatDelay:a=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const u=s||hs;u!==hs&&typeof o[0]!="number"&&(this.mixKeyframes=Is(Yf,bl(o[0],o[1])),o=[0,100]);const l=u({...t,keyframes:o});i==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...o].reverse(),velocity:-r})),l.calculatedDuration===null&&(l.calculatedDuration=Ya(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+a,this.totalDuration=this.resolvedDuration*(n+1)-a,this.generator=l}updateTime(t){const s=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(t,s=!1){const{generator:n,totalDuration:a,mixKeyframes:i,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:u}=this;if(this.startTime===null)return n.next(0);const{delay:l=0,keyframes:c,repeat:d,repeatType:p,repeatDelay:f,type:m,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),s?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?g<0:g>a;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let h=this.currentTime,M=n;if(d){const S=Math.min(this.currentTime,a)/o;let N=Math.floor(S),$=S%1;!$&&S>=1&&($=1),$===1&&N--,N=Math.min(N,d+1),!!(N%2)&&(p==="reverse"?($=1-$,f&&($-=f/o)):p==="mirror"&&(M=r)),h=et(0,1,$)*o}const E=A?{done:!1,value:c[0]}:M.next(h);i&&!A&&(E.value=i(E.value));let{done:I}=E;!A&&u!==null&&(I=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&I);return T&&m!==Yn&&(E.value=Xa(c,this.options,v,this.speed)),y&&y(E.value),T&&this.finish(),E}then(t,s){return this.finished.then(t,s)}get duration(){return Be(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Be(t)}get time(){return Be(this.currentTime)}set time(t){t=Fe(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const s=this.generator.next(t).value;return _l(n=>this.generator.next(n).value,t,s)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(Ie.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=Be(this.currentTime))}play(){var a,i;if(this.isStopped)return;const{driver:t=Df,startTime:s}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),(i=(a=this.options).onPlay)==null||i.call(a);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=s??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Ie.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,s;this.notifyFinished(),this.teardown(),this.state="finished",(s=(t=this.options).onComplete)==null||s.call(t)}cancel(){var t,s;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(s=(t=this.options).onCancel)==null||s.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var s;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(s=this.driver)==null||s.stop(),t.observe(this)}}function Xf(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const kt=e=>e*180/Math.PI,Xn=e=>{const t=kt(Math.atan2(e[1],e[0]));return Jn(t)},Jf={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Xn,rotateZ:Xn,skewX:e=>kt(Math.atan(e[1])),skewY:e=>kt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Jn=e=>(e=e%360,e<0&&(e+=360),e),Ni=Xn,Bi=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ji=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Qf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Bi,scaleY:ji,scale:e=>(Bi(e)+ji(e))/2,rotateX:e=>Jn(kt(Math.atan2(e[6],e[5]))),rotateY:e=>Jn(kt(Math.atan2(-e[2],e[0]))),rotateZ:Ni,rotate:Ni,skewX:e=>kt(Math.atan(e[4])),skewY:e=>kt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Qn(e){return e.includes("scale")?1:0}function ea(e,t){if(!e||e==="none")return Qn(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,a;if(s)n=Qf,a=s;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=Jf,a=o}if(!a)return Qn(t);const i=n[t],r=a[1].split(",").map(th);return typeof i=="function"?i(r):r[i]}const eh=(e,t)=>{const{transform:s="none"}=getComputedStyle(e);return ea(s,t)};function th(e){return parseFloat(e.trim())}const ns=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],as=new Set(ns),Fi=e=>e===ss||e===F,sh=new Set(["x","y","z"]),nh=ns.filter(e=>!sh.has(e));function ah(e){const t=[];return nh.forEach(s=>{const n=e.getValue(s);n!==void 0&&(t.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),t}const mt={width:({x:e},{paddingLeft:t="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),height:({y:e},{paddingTop:t="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ea(t,"x"),y:(e,{transform:t})=>ea(t,"y")};mt.translateX=mt.x;mt.translateY=mt.y;const Ot=new Set;let ta=!1,sa=!1,na=!1;function Sl(){if(sa){const e=Array.from(Ot).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),s=new Map;t.forEach(n=>{const a=ah(n);a.length&&(s.set(n,a),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const a=s.get(n);a&&a.forEach(([i,r])=>{var o;(o=n.getValue(i))==null||o.set(r)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}sa=!1,ta=!1,Ot.forEach(e=>e.complete(na)),Ot.clear()}function Tl(){Ot.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(sa=!0)})}function ih(){na=!0,Tl(),Sl(),na=!1}class ei{constructor(t,s,n,a,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=n,this.motionValue=a,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Ot.add(this),ta||(ta=!0,ae.read(Tl),ae.resolveKeyframes(Sl))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:n,motionValue:a}=this;if(t[0]===null){const i=a==null?void 0:a.get(),r=t[t.length-1];if(i!==void 0)t[0]=i;else if(n&&s){const o=n.readValue(s,r);o!=null&&(t[0]=o)}t[0]===void 0&&(t[0]=r),a&&i===void 0&&a.set(t[0])}Xf(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ot.delete(this)}cancel(){this.state==="scheduled"&&(Ot.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const rh=e=>e.startsWith("--");function Al(e,t,s){rh(t)?e.style.setProperty(t,s):e.style[t]=s}const oh={};function Cl(e,t){const s=el(e);return()=>oh[t]??s()}const lh=Cl(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),kl=Cl(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ds=([e,t,s,n])=>`cubic-bezier(${e}, ${t}, ${s}, ${n})`,zi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ds([0,.65,.55,1]),circOut:ds([.55,0,1,.45]),backIn:ds([.31,.01,.66,-.59]),backOut:ds([.33,1.53,.69,.99])};function El(e,t){if(e)return typeof e=="function"?kl()?xl(e,t):"ease-out":dl(e)?ds(e):Array.isArray(e)?e.map(s=>El(s,t)||zi.easeOut):zi[e]}function uh(e,t,s,{delay:n=0,duration:a=300,repeat:i=0,repeatType:r="loop",ease:o="easeOut",times:u}={},l=void 0){const c={[t]:s};u&&(c.offset=u);const d=El(o,a);Array.isArray(d)&&(c.easing=d);const p={delay:n,duration:a,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:r==="reverse"?"alternate":"normal"};return l&&(p.pseudoElement=l),e.animate(c,p)}function Pl(e){return typeof e=="function"&&"applyToOptions"in e}function ch({type:e,...t}){return Pl(e)&&kl()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Il extends Ja{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:n,keyframes:a,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o,onComplete:u}=t;this.isPseudoElement=!!i,this.allowFlatten=r,this.options=t,Fa(typeof t.type!="string");const l=ch(t);this.animation=uh(s,n,a,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const c=Xa(a,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Al(s,n,c),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,s;(s=(t=this.animation).finish)==null||s.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var s,n,a;const t=(s=this.options)==null?void 0:s.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((a=(n=this.animation).commitStyles)==null||a.call(n))}get duration(){var s,n;const t=((n=(s=this.animation.effect)==null?void 0:s.getComputedTiming)==null?void 0:n.call(s).duration)||0;return Be(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Be(t)}get time(){return Be(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Fe(t),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:s,rangeEnd:n,observe:a}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&lh()?(this.animation.timeline=t,s&&(this.animation.rangeStart=s),n&&(this.animation.rangeEnd=n),je):a(this)}}const Ml={anticipate:ol,backInOut:rl,circInOut:ul};function dh(e){return e in Ml}function ph(e){typeof e.ease=="string"&&dh(e.ease)&&(e.ease=Ml[e.ease])}const In=10;class fh extends Il{constructor(t){ph(t),wl(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:n,onComplete:a,element:i,...r}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const o=new Qa({...r,autoplay:!1}),u=Math.max(In,Ie.now()-this.startTime),l=et(0,In,u-In),c=o.sample(u).value,{name:d}=this.options;i&&d&&Al(i,d,c),s.setWithVelocity(o.sample(Math.max(0,u-l)).value,c,l),o.stop()}}const qi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(He.test(e)||e==="0")&&!e.startsWith("url("));function hh(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function mh(e,t,s,n){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],r=qi(a,t),o=qi(i,t);return!r||!o?!1:hh(e)||(s==="spring"||Pl(s))&&n}function aa(e){e.duration=0,e.type="keyframes"}const gh=new Set(["opacity","clipPath","filter","transform"]),vh=el(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function yh(e){var c;const{motionValue:t,name:s,repeatDelay:n,repeatType:a,damping:i,type:r}=e;if(!(((c=t==null?void 0:t.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=t.owner.getProps();return vh()&&s&&gh.has(s)&&(s!=="transform"||!l)&&!u&&!n&&a!=="mirror"&&i!==0&&r!=="inertia"}const bh=40;class xh extends Ja{constructor({autoplay:t=!0,delay:s=0,type:n="keyframes",repeat:a=0,repeatDelay:i=0,repeatType:r="loop",keyframes:o,name:u,motionValue:l,element:c,...d}){var m;super(),this.stop=()=>{var y,v;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=Ie.now();const p={autoplay:t,delay:s,type:n,repeat:a,repeatDelay:i,repeatType:r,name:u,motionValue:l,element:c,...d},f=(c==null?void 0:c.KeyframeResolver)||ei;this.keyframeResolver=new f(o,(y,v,g)=>this.onKeyframesResolved(y,v,p,!g),u,l,c),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(t,s,n,a){var v,g;this.keyframeResolver=void 0;const{name:i,type:r,velocity:o,delay:u,isHandoff:l,onUpdate:c}=n;this.resolvedAt=Ie.now(),mh(t,i,r,o)||((at.instantAnimations||!u)&&(c==null||c(Xa(t,n,s))),t[0]=t[t.length-1],aa(n),n.repeat=0);const p={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>bh?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...n,keyframes:t},f=!l&&yh(p),m=(g=(v=p.motionValue)==null?void 0:v.owner)==null?void 0:g.current,y=f?new fh({...p,element:m}):new Qa(p);y.finished.then(()=>{this.notifyFinished()}).catch(je),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,s){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),ih()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Rl(e,t,s,n=0,a=1){const i=Array.from(e).sort((l,c)=>l.sortNodePosition(c)).indexOf(t),r=e.size,o=(r-1)*n;return typeof s=="function"?s(i,r):a===1?i*n:o-i*n}const _h=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wh(e){const t=_h.exec(e);if(!t)return[,];const[,s,n,a]=t;return[`--${s??n}`,a]}function Dl(e,t,s=1){const[n,a]=wh(e);if(!n)return;const i=window.getComputedStyle(t).getPropertyValue(n);if(i){const r=i.trim();return Xo(r)?parseFloat(r):r}return Ha(a)?Dl(a,t,s+1):a}const Sh={type:"spring",stiffness:500,damping:25,restSpeed:10},Th=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ah={type:"keyframes",duration:.8},Ch={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},kh=(e,{keyframes:t})=>t.length>2?Ah:as.has(e)?e.startsWith("scale")?Th(t[1]):Sh:Ch,Eh=e=>e!==null;function Ph(e,{repeat:t,repeatType:s="loop"},n){const a=e.filter(Eh),i=t&&s!=="loop"&&t%2===1?0:a.length-1;return a[i]}function Vl(e,t){if(e!=null&&e.inherit&&t){const{inherit:s,...n}=e;return{...t,...n}}return e}function ti(e,t){const s=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return s!==e?Vl(s,e):s}function Ih({when:e,delay:t,delayChildren:s,staggerChildren:n,staggerDirection:a,repeat:i,repeatType:r,repeatDelay:o,from:u,elapsed:l,...c}){return!!Object.keys(c).length}const si=(e,t,s,n={},a,i)=>r=>{const o=ti(n,e)||{},u=o.delay||n.delay||0;let{elapsed:l=0}=n;l=l-Fe(u);const c={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-l,onUpdate:p=>{t.set(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{r(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:a};Ih(o)||Object.assign(c,kh(e,c)),c.duration&&(c.duration=Fe(c.duration)),c.repeatDelay&&(c.repeatDelay=Fe(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(aa(c),c.delay===0&&(d=!0)),(at.instantAnimations||at.skipAnimations||a!=null&&a.shouldSkipAnimations)&&(d=!0,aa(c),c.delay=0),c.allowFlatten=!o.type&&!o.ease,d&&!i&&t.get()!==void 0){const p=Ph(c.keyframes,o);if(p!==void 0){ae.update(()=>{c.onUpdate(p),c.onComplete()});return}}return o.isSync?new Qa(c):new xh(c)};function Ui(e){const t=[{},{}];return e==null||e.values.forEach((s,n)=>{t[0][n]=s.get(),t[1][n]=s.getVelocity()}),t}function $l(e,t,s,n){if(typeof t=="function"){const[a,i]=Ui(n);t=t(s!==void 0?s:e.custom,a,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,i]=Ui(n);t=t(s!==void 0?s:e.custom,a,i)}return t}function Kt(e,t,s){const n=e.getProps();return $l(n,t,s!==void 0?s:n.custom,e)}const Ll=new Set(["width","height","top","left","right","bottom",...ns]),Gi=30,Mh=e=>!isNaN(parseFloat(e));class Rh{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var i;const a=Ie.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=Ie.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Mh(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new za);const n=this.events[t].add(s);return t==="change"?()=>{n(),ae.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,s,n){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ie.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Gi)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Gi);return tl(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,s;(t=this.dependents)==null||t.clear(),(s=this.events.destroy)==null||s.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Xt(e,t){return new Rh(e,t)}const Dh=e=>Array.isArray(e);function Vh(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,Xt(s))}function $h(e){return Dh(e)?e[e.length-1]||0:e}function Lh(e,t){const s=Kt(e,t);let{transitionEnd:n={},transition:a={},...i}=s||{};i={...i,...n};for(const r in i){const o=$h(i[r]);Vh(e,r,o)}}const Ce=e=>!!(e&&e.getVelocity);function Oh(e){return!!(Ce(e)&&e.add)}function ia(e,t){const s=e.getValue("willChange");if(Oh(s))return s.add(t);if(!s&&at.WillChange){const n=new at.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function ni(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Nh="framerAppearId",Bh="data-"+ni(Nh);function Ol(e){return e.props[Bh]}function jh({protectedKeys:e,needsAnimating:t},s){const n=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,n}function Nl(e,t,{delay:s=0,transitionOverride:n,type:a}={}){let{transition:i,transitionEnd:r,...o}=t;const u=e.getDefaultTransition();i=i?Vl(i,u):u;const l=i==null?void 0:i.reduceMotion;n&&(i=n);const c=[],d=a&&e.animationState&&e.animationState.getState()[a];for(const p in o){const f=e.getValue(p,e.latestValues[p]??null),m=o[p];if(m===void 0||d&&jh(d,p))continue;const y={delay:s,...ti(i||{},p)},v=f.get();if(v!==void 0&&!f.isAnimating&&!Array.isArray(m)&&m===v&&!y.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const M=Ol(e);if(M){const E=window.MotionHandoffAnimation(M,p,ae);E!==null&&(y.startTime=E,g=!0)}}ia(e,p);const A=l??e.shouldReduceMotion;f.start(si(p,f,m,A&&Ll.has(p)?{type:!1}:y,e,g));const h=f.animation;h&&c.push(h)}if(r){const p=()=>ae.update(()=>{r&&Lh(e,r)});c.length?Promise.all(c).then(p):p()}return c}function ra(e,t,s={}){var u;const n=Kt(e,t,s.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=n||{};s.transitionOverride&&(a=s.transitionOverride);const i=n?()=>Promise.all(Nl(e,n,s)):()=>Promise.resolve(),r=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:p}=a;return Fh(e,t,l,c,d,p,s)}:()=>Promise.resolve(),{when:o}=a;if(o){const[l,c]=o==="beforeChildren"?[i,r]:[r,i];return l().then(()=>c())}else return Promise.all([i(),r(s.delay)])}function Fh(e,t,s=0,n=0,a=0,i=1,r){const o=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),o.push(ra(u,t,{...r,delay:s+(typeof n=="function"?0:n)+Rl(e.variantChildren,u,n,a,i)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(o)}function zh(e,t,s={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const a=t.map(i=>ra(e,i,s));n=Promise.all(a)}else if(typeof t=="string")n=ra(e,t,s);else{const a=typeof t=="function"?Kt(e,t,s.custom):t;n=Promise.all(Nl(e,a,s))}return n.then(()=>{e.notify("AnimationComplete",t)})}const qh={test:e=>e==="auto",parse:e=>e},Bl=e=>t=>t.test(e),jl=[ss,F,Qe,ct,hf,ff,qh],Hi=e=>jl.find(Bl(e));function Uh(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Qo(e):!0}const Gh=new Set(["brightness","contrast","saturate","opacity"]);function Hh(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=s.match(Za)||[];if(!n)return e;const a=s.replace(n,"");let i=Gh.has(t)?1:0;return n!==s&&(i*=100),t+"("+i+a+")"}const Zh=/\b([a-z-]*)\(.*?\)/gu,oa={...He,getAnimatableNone:e=>{const t=e.match(Zh);return t?t.map(Hh).join(" "):e}},la={...He,getAnimatableNone:e=>{const t=He.parse(e);return He.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},Zi={...ss,transform:Math.round},Wh={rotate:ct,rotateX:ct,rotateY:ct,rotateZ:ct,scale:Zs,scaleX:Zs,scaleY:Zs,scaleZ:Zs,skew:ct,skewX:ct,skewY:ct,distance:F,translateX:F,translateY:F,translateZ:F,x:F,y:F,z:F,perspective:F,transformPerspective:F,opacity:xs,originX:Ri,originY:Ri,originZ:F},ai={borderWidth:F,borderTopWidth:F,borderRightWidth:F,borderBottomWidth:F,borderLeftWidth:F,borderRadius:F,borderTopLeftRadius:F,borderTopRightRadius:F,borderBottomRightRadius:F,borderBottomLeftRadius:F,width:F,maxWidth:F,height:F,maxHeight:F,top:F,right:F,bottom:F,left:F,inset:F,insetBlock:F,insetBlockStart:F,insetBlockEnd:F,insetInline:F,insetInlineStart:F,insetInlineEnd:F,padding:F,paddingTop:F,paddingRight:F,paddingBottom:F,paddingLeft:F,paddingBlock:F,paddingBlockStart:F,paddingBlockEnd:F,paddingInline:F,paddingInlineStart:F,paddingInlineEnd:F,margin:F,marginTop:F,marginRight:F,marginBottom:F,marginLeft:F,marginBlock:F,marginBlockStart:F,marginBlockEnd:F,marginInline:F,marginInlineStart:F,marginInlineEnd:F,fontSize:F,backgroundPositionX:F,backgroundPositionY:F,...Wh,zIndex:Zi,fillOpacity:xs,strokeOpacity:xs,numOctaves:Zi},Kh={...ai,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:oa,WebkitFilter:oa,mask:la,WebkitMask:la},Fl=e=>Kh[e],Yh=new Set([oa,la]);function zl(e,t){let s=Fl(e);return Yh.has(s)||(s=He),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const Xh=new Set(["auto","none","0"]);function Jh(e,t,s){let n=0,a;for(;n<e.length&&!a;){const i=e[n];typeof i=="string"&&!Xh.has(i)&&Yt(i).values.length&&(a=e[n]),n++}if(a&&s)for(const i of t)e[i]=zl(s,a)}class Qh extends ei{constructor(t,s,n,a,i){super(t,s,n,a,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:n}=this;if(!s||!s.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let d=t[c];if(typeof d=="string"&&(d=d.trim(),Ha(d))){const p=Dl(d,s.current);p!==void 0&&(t[c]=p),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Ll.has(n)||t.length!==2)return;const[a,i]=t,r=Hi(a),o=Hi(i),u=Mi(a),l=Mi(i);if(u!==l&&mt[n]){this.needsMeasurement=!0;return}if(r!==o)if(Fi(r)&&Fi(o))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else mt[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,n=[];for(let a=0;a<t.length;a++)(t[a]===null||Uh(t[a]))&&n.push(a);n.length&&Jh(t,n,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const a=s[s.length-1];a!==void 0&&t.getValue(n,a).jump(a,!1)}measureEndState(){var o;const{element:t,name:s,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const a=t.getValue(s);a&&a.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=mt[s](t.measureViewportBox(),window.getComputedStyle(t.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([u,l])=>{t.getValue(u).set(l)}),this.resolveNoneKeyframes()}}const em=new Set(["opacity","clipPath","filter","transform"]);function ql(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const a=(s==null?void 0:s[e])??n.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(n=>n!=null)}const Ul=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function tm(e){return Jo(e)&&"offsetHeight"in e}const{schedule:Gl}=pl(queueMicrotask,!1),sm={y:!1};function nm(){return sm.y}function Hl(e,t){const s=ql(e),n=new AbortController,a={passive:!0,...t,signal:n.signal};return[s,a,()=>n.abort()]}function am(e){return!(e.pointerType==="touch"||nm())}function im(e,t,s={}){const[n,a,i]=Hl(e,s);return n.forEach(r=>{let o=!1,u=!1,l;const c=()=>{r.removeEventListener("pointerleave",m)},d=v=>{l&&(l(v),l=void 0),c()},p=v=>{o=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),u&&(u=!1,d(v))},f=()=>{o=!0,window.addEventListener("pointerup",p,a),window.addEventListener("pointercancel",p,a)},m=v=>{if(v.pointerType!=="touch"){if(o){u=!0;return}d(v)}},y=v=>{if(!am(v))return;u=!1;const g=t(r,v);typeof g=="function"&&(l=g,r.addEventListener("pointerleave",m,a))};r.addEventListener("pointerenter",y,a),r.addEventListener("pointerdown",f,a)}),i}const Zl=(e,t)=>t?e===t?!0:Zl(e,t.parentElement):!1,rm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,om=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function lm(e){return om.has(e.tagName)||e.isContentEditable===!0}const Xs=new WeakSet;function Wi(e){return t=>{t.key==="Enter"&&e(t)}}function Mn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const um=(e,t)=>{const s=e.currentTarget;if(!s)return;const n=Wi(()=>{if(Xs.has(s))return;Mn(s,"down");const a=Wi(()=>{Mn(s,"up")}),i=()=>Mn(s,"cancel");s.addEventListener("keyup",a,t),s.addEventListener("blur",i,t)});s.addEventListener("keydown",n,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",n),t)};function Ki(e){return rm(e)&&!0}const Yi=new WeakSet;function cm(e,t,s={}){const[n,a,i]=Hl(e,s),r=o=>{const u=o.currentTarget;if(!Ki(o)||Yi.has(o))return;Xs.add(u),s.stopPropagation&&Yi.add(o);const l=t(u,o),c=(f,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",p),Xs.has(u)&&Xs.delete(u),Ki(f)&&typeof l=="function"&&l(f,{success:m})},d=f=>{c(f,u===window||u===document||s.useGlobalTarget||Zl(u,f.target))},p=f=>{c(f,!1)};window.addEventListener("pointerup",d,a),window.addEventListener("pointercancel",p,a)};return n.forEach(o=>{(s.useGlobalTarget?window:o).addEventListener("pointerdown",r,a),tm(o)&&(o.addEventListener("focus",l=>um(l,a)),!lm(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),i}function Wl(e){return Jo(e)&&"ownerSVGElement"in e}function dm(e){return Wl(e)&&e.tagName==="svg"}const pm=[...jl,me,He],fm=e=>pm.find(Bl(e)),Xi=()=>({translate:0,scale:1,origin:0,originPoint:0}),Gt=()=>({x:Xi(),y:Xi()}),Ji=()=>({min:0,max:0}),ve=()=>({x:Ji(),y:Ji()}),hm=new WeakMap;function ii(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function mn(e){return typeof e=="string"||Array.isArray(e)}const mm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],gm=["initial",...mm];function Kl(e){return ii(e.animate)||gm.some(t=>mn(e[t]))}function vm(e){return!!(Kl(e)||e.variants)}function ym(e,t,s){for(const n in t){const a=t[n],i=s[n];if(Ce(a))e.addValue(n,a);else if(Ce(i))e.addValue(n,Xt(a,{owner:e}));else if(i!==a)if(e.hasValue(n)){const r=e.getValue(n);r.liveStyle===!0?r.jump(a):r.hasAnimated||r.set(a)}else{const r=e.getStaticValue(n);e.addValue(n,Xt(r!==void 0?r:a,{owner:e}))}}for(const n in s)t[n]===void 0&&e.removeValue(n);return t}const ua={current:null},Yl={current:!1},bm=typeof window<"u";function xm(){if(Yl.current=!0,!!bm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ua.current=e.matches;e.addEventListener("change",t),t()}else ua.current=!1}const Qi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let er={};class _m{scrapeMotionValuesFromProps(t,s,n){return{}}constructor({parent:t,props:s,presenceContext:n,reducedMotionConfig:a,skipAnimations:i,blockInitialAnimation:r,visualState:o},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ei,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Ie.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,ae.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=s.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=s,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=i,this.options=u,this.blockInitialAnimation=!!r,this.isControllingVariants=Kl(s),this.isVariantNode=vm(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...p}=this.scrapeMotionValuesFromProps(s,{},this);for(const f in p){const m=p[f];l[f]!==void 0&&Ce(m)&&m.set(l[f])}}mount(t){var s,n;if(this.hasBeenMounted)for(const a in this.initialValues)(s=this.values.get(a))==null||s.jump(this.initialValues[a]),this.latestValues[a]=this.initialValues[a];this.current=t,hm.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,i)=>this.bindToMotionValue(i,a)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Yl.current||xm(),this.shouldReduceMotion=ua.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),vt(this.notifyUpdate),vt(this.render),this.valueSubscriptions.forEach(s=>s()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const n=this.features[s];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,s){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),s.accelerate&&em.has(t)&&this.current instanceof HTMLElement){const{factory:r,keyframes:o,times:u,ease:l,duration:c}=s.accelerate,d=new Il({element:this.current,name:t,keyframes:o,times:u,ease:l,duration:Fe(c)}),p=r(d);this.valueSubscriptions.set(t,()=>{p(),d.cancel()});return}const n=as.has(t);n&&this.onBindTransform&&this.onBindTransform();const a=s.on("change",r=>{this.latestValues[t]=r,this.props.onUpdate&&ae.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{a(),i&&i(),s.owner&&s.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in er){const s=er[t];if(!s)continue;const{isEnabled:n,Feature:a}=s;if(!this.features[t]&&a&&n(this.props)&&(this.features[t]=new a(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ve()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let n=0;n<Qi.length;n++){const a=Qi[n];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const i="on"+a,r=t[i];r&&(this.propEventSubscriptions[a]=this.on(a,r))}this.prevMotionValues=ym(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const n=this.values.get(t);s!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&s!==void 0&&(n=Xt(s===null?void 0:s,{owner:this}),this.addValue(t,n)),n}readValue(t,s){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(Xo(n)||Qo(n))?n=parseFloat(n):!fm(n)&&He.test(s)&&(n=zl(t,s)),this.setBaseTarget(t,Ce(n)?n.get():n)),Ce(n)?n.get():n}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){var i;const{initial:s}=this.props;let n;if(typeof s=="string"||typeof s=="object"){const r=$l(this.props,s,(i=this.presenceContext)==null?void 0:i.custom);r&&(n=r[t])}if(s&&n!==void 0)return n;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Ce(a)?a:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new za),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){Gl.render(this.render)}}class Xl extends _m{constructor(){super(...arguments),this.KeyframeResolver=Qh}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const n=t.style;return n?n[s]:void 0}removeValueFromRenderState(t,{vars:s,style:n}){delete s[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ce(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function Jl({top:e,left:t,right:s,bottom:n}){return{x:{min:t,max:s},y:{min:e,max:n}}}function wm({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Sm(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:n.y,right:n.x}}function Rn(e){return e===void 0||e===1}function ca({scale:e,scaleX:t,scaleY:s}){return!Rn(e)||!Rn(t)||!Rn(s)}function Tt(e){return ca(e)||Ql(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ql(e){return tr(e.x)||tr(e.y)}function tr(e){return e&&e!=="0%"}function rn(e,t,s){const n=e-s,a=t*n;return s+a}function sr(e,t,s,n,a){return a!==void 0&&(e=rn(e,a,n)),rn(e,s,n)+t}function da(e,t=0,s=1,n,a){e.min=sr(e.min,t,s,n,a),e.max=sr(e.max,t,s,n,a)}function eu(e,{x:t,y:s}){da(e.x,t.translate,t.scale,t.originPoint),da(e.y,s.translate,s.scale,s.originPoint)}const nr=.999999999999,ar=1.0000000000001;function Tm(e,t,s,n=!1){var o;const a=s.length;if(!a)return;t.x=t.y=1;let i,r;for(let u=0;u<a;u++){i=s[u],r=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Zt(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),r&&(t.x*=r.x.scale,t.y*=r.y.scale,eu(e,r)),n&&Tt(i.latestValues)&&Zt(e,i.latestValues,(o=i.layout)==null?void 0:o.layoutBox))}t.x<ar&&t.x>nr&&(t.x=1),t.y<ar&&t.y>nr&&(t.y=1)}function Ht(e,t){e.min=e.min+t,e.max=e.max+t}function ir(e,t,s,n,a=.5){const i=ce(e.min,e.max,a);da(e,t,s,i,n)}function rr(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Zt(e,t,s){const n=s??e;ir(e.x,rr(t.x,n.x),t.scaleX,t.scale,t.originX),ir(e.y,rr(t.y,n.y),t.scaleY,t.scale,t.originY)}function tu(e,t){return Jl(Sm(e.getBoundingClientRect(),t))}function Am(e,t,s){const n=tu(e,s),{scroll:a}=t;return a&&(Ht(n.x,a.offset.x),Ht(n.y,a.offset.y)),n}const Cm={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},km=ns.length;function Em(e,t,s){let n="",a=!0;for(let i=0;i<km;i++){const r=ns[i],o=e[r];if(o===void 0)continue;let u=!0;if(typeof o=="number")u=o===(r.startsWith("scale")?1:0);else{const l=parseFloat(o);u=r.startsWith("scale")?l===1:l===0}if(!u||s){const l=Ul(o,ai[r]);if(!u){a=!1;const c=Cm[r]||r;n+=`${c}(${l}) `}s&&(t[r]=l)}}return n=n.trim(),s?n=s(t,a?"":n):a&&(n="none"),n}function ri(e,t,s){const{style:n,vars:a,transformOrigin:i}=e;let r=!1,o=!1;for(const u in t){const l=t[u];if(as.has(u)){r=!0;continue}else if(Ga(u)){a[u]=l;continue}else{const c=Ul(l,ai[u]);u.startsWith("origin")?(o=!0,i[u]=c):n[u]=c}}if(t.transform||(r||s?n.transform=Em(t,e.transform,s):n.transform&&(n.transform="none")),o){const{originX:u="50%",originY:l="50%",originZ:c=0}=i;n.transformOrigin=`${u} ${l} ${c}`}}function su(e,{style:t,vars:s},n,a){const i=e.style;let r;for(r in t)i[r]=t[r];a==null||a.applyProjectionStyles(i,n);for(r in s)i.setProperty(r,s[r])}function or(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Je={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(F.test(e))e=parseFloat(e);else return e;const s=or(e,t.target.x),n=or(e,t.target.y);return`${s}% ${n}%`}},nu={correct:(e,{treeScale:t,projectionDelta:s})=>{const n=e,a=He.parse(e);if(a.length>5)return n;const i=He.createTransformer(e),r=typeof a[0]!="number"?1:0,o=s.x.scale*t.x,u=s.y.scale*t.y;a[0+r]/=o,a[1+r]/=u;const l=ce(o,u,.5);return typeof a[2+r]=="number"&&(a[2+r]/=l),typeof a[3+r]=="number"&&(a[3+r]/=l),i(a)}},_s={borderRadius:{...Je,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Je,borderTopRightRadius:Je,borderBottomLeftRadius:Je,borderBottomRightRadius:Je,boxShadow:nu};function au(e){for(const t in e)_s[t]=e[t],Ga(t)&&(_s[t].isCSSVariable=!0)}function Pm(e,{layout:t,layoutId:s}){return as.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!_s[e]||e==="opacity")}function iu(e,t,s){var r;const n=e.style,a=t==null?void 0:t.style,i={};if(!n)return i;for(const o in n)(Ce(n[o])||a&&Ce(a[o])||Pm(o,e)||((r=s==null?void 0:s.getValue(o))==null?void 0:r.liveStyle)!==void 0)&&(i[o]=n[o]);return i}function Im(e){return window.getComputedStyle(e)}class Mm extends Xl{constructor(){super(...arguments),this.type="html",this.renderInstance=su}readValueFromInstance(t,s){var n;if(as.has(s))return(n=this.projection)!=null&&n.isProjecting?Qn(s):eh(t,s);{const a=Im(t),i=(Ga(s)?a.getPropertyValue(s):a[s])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:s}){return tu(t,s)}build(t,s,n){ri(t,s,n.transformTemplate)}scrapeMotionValuesFromProps(t,s,n){return iu(t,s,n)}}const Rm={offset:"stroke-dashoffset",array:"stroke-dasharray"},Dm={offset:"strokeDashoffset",array:"strokeDasharray"};function Vm(e,t,s=1,n=0,a=!0){e.pathLength=1;const i=a?Rm:Dm;e[i.offset]=`${-n}`,e[i.array]=`${t} ${s}`}const $m=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ru(e,{attrX:t,attrY:s,attrScale:n,pathLength:a,pathSpacing:i=1,pathOffset:r=0,...o},u,l,c){if(ri(e,o,l),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:p}=e;d.transform&&(p.transform=d.transform,delete d.transform),(p.transform||d.transformOrigin)&&(p.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),p.transform&&(p.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete d.transformBox);for(const f of $m)d[f]!==void 0&&(p[f]=d[f],delete d[f]);t!==void 0&&(d.x=t),s!==void 0&&(d.y=s),n!==void 0&&(d.scale=n),a!==void 0&&Vm(d,a,i,r,!1)}const oi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),ou=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Lm(e,t,s,n){su(e,t,void 0,n);for(const a in t.attrs)e.setAttribute(oi.has(a)?a:ni(a),t.attrs[a])}function Om(e,t,s){const n=iu(e,t,s);for(const a in e)if(Ce(e[a])||Ce(t[a])){const i=ns.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;n[i]=e[a]}return n}class Nm extends Xl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ve}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(as.has(s)){const n=Fl(s);return n&&n.default||0}return s=oi.has(s)?s:ni(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,n){return Om(t,s,n)}build(t,s,n){ru(t,s,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,s,n,a){Lm(t,s,n,a)}mount(t){this.isSVGTag=ou(t.tagName),super.mount(t)}}function lr(e,t){e.min=t.min,e.max=t.max}function qe(e,t){lr(e.x,t.x),lr(e.y,t.y)}function ur(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const lu=1e-4,Bm=1-lu,jm=1+lu,uu=.01,Fm=0-uu,zm=0+uu;function Me(e){return e.max-e.min}function qm(e,t,s){return Math.abs(e-t)<=s}function cr(e,t,s,n=.5){e.origin=n,e.originPoint=ce(t.min,t.max,e.origin),e.scale=Me(s)/Me(t),e.translate=ce(s.min,s.max,e.origin)-e.originPoint,(e.scale>=Bm&&e.scale<=jm||isNaN(e.scale))&&(e.scale=1),(e.translate>=Fm&&e.translate<=zm||isNaN(e.translate))&&(e.translate=0)}function ms(e,t,s,n){cr(e.x,t.x,s.x,n?n.originX:void 0),cr(e.y,t.y,s.y,n?n.originY:void 0)}function dr(e,t,s){e.min=s.min+t.min,e.max=e.min+Me(t)}function Um(e,t,s){dr(e.x,t.x,s.x),dr(e.y,t.y,s.y)}function pr(e,t,s){e.min=t.min-s.min,e.max=e.min+Me(t)}function on(e,t,s){pr(e.x,t.x,s.x),pr(e.y,t.y,s.y)}function fr(e,t,s,n,a){return e-=t,e=rn(e,1/s,n),a!==void 0&&(e=rn(e,1/a,n)),e}function Gm(e,t=0,s=1,n=.5,a,i=e,r=e){if(Qe.test(t)&&(t=parseFloat(t),t=ce(r.min,r.max,t/100)-r.min),typeof t!="number")return;let o=ce(i.min,i.max,n);e===i&&(o-=t),e.min=fr(e.min,t,s,o,a),e.max=fr(e.max,t,s,o,a)}function hr(e,t,[s,n,a],i,r){Gm(e,t[s],t[n],t[a],t.scale,i,r)}const Hm=["x","scaleX","originX"],Zm=["y","scaleY","originY"];function mr(e,t,s,n){hr(e.x,t,Hm,s?s.x:void 0,n?n.x:void 0),hr(e.y,t,Zm,s?s.y:void 0,n?n.y:void 0)}function gr(e){return e.translate===0&&e.scale===1}function cu(e){return gr(e.x)&&gr(e.y)}function vr(e,t){return e.min===t.min&&e.max===t.max}function Wm(e,t){return vr(e.x,t.x)&&vr(e.y,t.y)}function yr(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function du(e,t){return yr(e.x,t.x)&&yr(e.y,t.y)}function br(e){return Me(e.x)/Me(e.y)}function xr(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ne(e){return[e("x"),e("y")]}function Km(e,t,s){let n="";const a=e.x.translate/t.x,i=e.y.translate/t.y,r=(s==null?void 0:s.z)||0;if((a||i||r)&&(n=`translate3d(${a}px, ${i}px, ${r}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:l,rotate:c,rotateX:d,rotateY:p,skewX:f,skewY:m}=s;l&&(n=`perspective(${l}px) ${n}`),c&&(n+=`rotate(${c}deg) `),d&&(n+=`rotateX(${d}deg) `),p&&(n+=`rotateY(${p}deg) `),f&&(n+=`skewX(${f}deg) `),m&&(n+=`skewY(${m}deg) `)}const o=e.x.scale*t.x,u=e.y.scale*t.y;return(o!==1||u!==1)&&(n+=`scale(${o}, ${u})`),n||"none"}const pu=["TopLeft","TopRight","BottomLeft","BottomRight"],Ym=pu.length,_r=e=>typeof e=="string"?parseFloat(e):e,wr=e=>typeof e=="number"||F.test(e);function Xm(e,t,s,n,a,i){a?(e.opacity=ce(0,s.opacity??1,Jm(n)),e.opacityExit=ce(t.opacity??1,0,Qm(n))):i&&(e.opacity=ce(t.opacity??1,s.opacity??1,n));for(let r=0;r<Ym;r++){const o=`border${pu[r]}Radius`;let u=Sr(t,o),l=Sr(s,o);if(u===void 0&&l===void 0)continue;u||(u=0),l||(l=0),u===0||l===0||wr(u)===wr(l)?(e[o]=Math.max(ce(_r(u),_r(l),n),0),(Qe.test(l)||Qe.test(u))&&(e[o]+="%")):e[o]=l}(t.rotate||s.rotate)&&(e.rotate=ce(t.rotate||0,s.rotate||0,n))}function Sr(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Jm=fu(0,.5,ll),Qm=fu(.5,.95,je);function fu(e,t,s){return n=>n<e?0:n>t?1:s(bs(e,t,n))}function eg(e,t,s){const n=Ce(e)?e:Xt(e);return n.start(si("",n,t,s)),n.animation}function tg(e,t,s,n={passive:!0}){return e.addEventListener(t,s,n),()=>e.removeEventListener(t,s)}const sg=(e,t)=>e.depth-t.depth;class ng{constructor(){this.children=[],this.isDirty=!1}add(t){ja(this.children,t),this.isDirty=!0}remove(t){tn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sg),this.isDirty=!1,this.children.forEach(t)}}function ag(e,t){const s=Ie.now(),n=({timestamp:a})=>{const i=a-s;i>=t&&(vt(n),e(i-t))};return ae.setup(n,!0),()=>vt(n)}function Dn(e){return Ce(e)?e.get():e}class ig{constructor(){this.members=[]}add(t){ja(this.members,t);for(let s=this.members.length-1;s>=0;s--){const n=this.members[s];if(n===t||n===this.lead||n===this.prevLead)continue;const a=n.instance;(!a||a.isConnected===!1)&&!n.snapshot&&(tn(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(tn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){var s;for(let n=this.members.indexOf(t)-1;n>=0;n--){const a=this.members[n];if(a.isPresent!==!1&&((s=a.instance)==null?void 0:s.isConnected)!==!1)return this.promote(a),!0}return!1}promote(t,s){var a;const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:r}=t.options;(i===void 0||i!==r)&&(t.resumeFrom=n,s&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),(a=t.root)!=null&&a.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var s,n,a,i,r;(n=(s=t.options).onExitComplete)==null||n.call(s),(r=(a=t.resumingFrom)==null?void 0:(i=a.options).onExitComplete)==null||r.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const Js={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Vn=["","X","Y","Z"],rg=1e3;let og=0;function $n(e,t,s,n){const{latestValues:a}=t;a[e]&&(s[e]=a[e],t.setStaticValue(e,0),n&&(n[e]=0))}function hu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=Ol(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:a,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",ae,!(a||i))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&hu(n)}function mu({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:n,resetTransform:a}){return class{constructor(r={},o=t==null?void 0:t()){this.id=og++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(cg),this.nodes.forEach(hg),this.nodes.forEach(mg),this.nodes.forEach(dg)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new ng)}addEventListener(r,o){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new za),this.eventHandlers.get(r).add(o)}notifyListeners(r,...o){const u=this.eventHandlers.get(r);u&&u.notify(...o)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=Wl(r)&&!dm(r),this.instance=r;const{layoutId:o,layout:u,visualElement:l}=this.options;if(l&&!l.current&&l.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||o)&&(this.isLayoutDirty=!0),e){let c,d=0;const p=()=>this.root.updateBlockedByResize=!1;ae.read(()=>{d=window.innerWidth}),e(r,()=>{const f=window.innerWidth;f!==d&&(d=f,this.root.updateBlockedByResize=!0,c&&c(),c=ag(p,250),Js.hasAnimatedSinceResize&&(Js.hasAnimatedSinceResize=!1,this.nodes.forEach(Cr)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&l&&(o||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d,hasRelativeLayoutChanged:p,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||xg,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=l.getProps(),g=!this.targetLayout||!du(this.targetLayout,f),A=!d&&p;if(this.options.layoutRoot||this.resumeFrom||A||d&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const h={...ti(m,"layout"),onPlay:y,onComplete:v};(l.shouldReduceMotion||this.options.layoutRoot)&&(h.delay=0,h.type=!1),this.startAnimation(h),this.setAnimationOrigin(c,A)}else d||Cr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),vt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(gg),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&hu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:o,layout:u}=this.options;if(o===void 0&&!u)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Tr);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ar);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(fg),this.nodes.forEach(lg),this.nodes.forEach(ug)):this.nodes.forEach(Ar),this.clearAllSnapshots();const o=Ie.now();xe.delta=et(0,1e3/60,o-xe.timestamp),xe.timestamp=o,xe.isProcessing=!0,Cn.update.process(xe),Cn.preRender.process(xe),Cn.render.process(xe),xe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Gl.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(pg),this.sharedNodes.forEach(vg)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ae.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ae.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Me(this.snapshot.measuredBox.x)&&!Me(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ve(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(o=!1),o&&this.instance){const u=n(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:u,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!a)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!cu(this.projectionDelta),u=this.getTransformTemplate(),l=u?u(this.latestValues,""):void 0,c=l!==this.prevTransformTemplateValue;r&&this.instance&&(o||Tt(this.latestValues)||c)&&(a(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const o=this.measurePageBox();let u=this.removeElementScroll(o);return r&&(u=this.removeTransform(u)),_g(u),{animationId:this.root.animationId,measuredBox:o,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:r}=this.options;if(!r)return ve();const o=r.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(wg))){const{scroll:c}=this.root;c&&(Ht(o.x,c.offset.x),Ht(o.y,c.offset.y))}return o}removeElementScroll(r){var u;const o=ve();if(qe(o,r),(u=this.scroll)!=null&&u.wasRoot)return o;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:d,options:p}=c;c!==this.root&&d&&p.layoutScroll&&(d.wasRoot&&qe(o,r),Ht(o.x,d.offset.x),Ht(o.y,d.offset.y))}return o}applyTransform(r,o=!1){var l,c;const u=ve();qe(u,r);for(let d=0;d<this.path.length;d++){const p=this.path[d];!o&&p.options.layoutScroll&&p.scroll&&p!==p.root&&Zt(u,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),Tt(p.latestValues)&&Zt(u,p.latestValues,(l=p.layout)==null?void 0:l.layoutBox)}return Tt(this.latestValues)&&Zt(u,this.latestValues,(c=this.layout)==null?void 0:c.layoutBox),u}removeTransform(r){var u;const o=ve();qe(o,r);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!Tt(c.latestValues))continue;let d;c.instance&&(ca(c.latestValues)&&c.updateSnapshot(),d=ve(),qe(d,c.measurePageBox())),mr(o,c.latestValues,(u=c.snapshot)==null?void 0:u.layoutBox,d)}return Tt(this.latestValues)&&mr(o,this.latestValues),o}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var f;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==o;if(!(r||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:d}=this.options;if(!this.layout||!(c||d))return;this.resolvedRelativeTargetAt=xe.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ve(),this.targetWithTransforms=ve()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Um(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):qe(this.target,this.layout.layoutBox),eu(this.target,this.targetDelta)):qe(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ca(this.parent.latestValues)||Ql(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,o,u){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ve(),this.relativeTargetOrigin=ve(),on(this.relativeTargetOrigin,o,u),qe(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const r=this.getLead(),o=!!this.resumingFrom||this!==r;let u=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(u=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===xe.timestamp&&(u=!1),u)return;const{layout:l,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||c))return;qe(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,p=this.treeScale.y;Tm(this.layoutCorrected,this.treeScale,this.path,o),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=ve());const{target:f}=r;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ur(this.prevProjectionDelta.x,this.projectionDelta.x),ur(this.prevProjectionDelta.y,this.projectionDelta.y)),ms(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==p||!xr(this.projectionDelta.x,this.prevProjectionDelta.x)||!xr(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),r){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Gt(),this.projectionDelta=Gt(),this.projectionDeltaWithTransform=Gt()}setAnimationOrigin(r,o=!1){const u=this.snapshot,l=u?u.latestValues:{},c={...this.latestValues},d=Gt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const p=ve(),f=u?u.source:void 0,m=this.layout?this.layout.source:void 0,y=f!==m,v=this.getStack(),g=!v||v.members.length<=1,A=!!(y&&!g&&this.options.crossfade===!0&&!this.path.some(bg));this.animationProgress=0;let h;this.mixTargetDelta=M=>{const E=M/1e3;kr(d.x,r.x,E),kr(d.y,r.y,E),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(on(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),yg(this.relativeTarget,this.relativeTargetOrigin,p,E),h&&Wm(this.relativeTarget,h)&&(this.isProjectionDirty=!1),h||(h=ve()),qe(h,this.relativeTarget)),y&&(this.animationValues=c,Xm(c,l,this.latestValues,E,A,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){var o,u,l;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(l=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||l.stop(),this.pendingAnimation&&(vt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ae.update(()=>{Js.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Xt(0)),this.motionValue.jump(0,!1),this.currentAnimation=eg(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),r.onUpdate&&r.onUpdate(c)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(rg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:o,target:u,layout:l,latestValues:c}=r;if(!(!o||!u||!l)){if(this!==r&&this.layout&&l&&gu(this.options.animationType,this.layout.layoutBox,l.layoutBox)){u=this.target||ve();const d=Me(this.layout.layoutBox.x);u.x.min=r.target.x.min,u.x.max=u.x.min+d;const p=Me(this.layout.layoutBox.y);u.y.min=r.target.y.min,u.y.max=u.y.min+p}qe(o,u),Zt(o,c),ms(this.projectionDeltaWithTransform,this.layoutCorrected,o,c)}}registerSharedNode(r,o){this.sharedNodes.has(r)||this.sharedNodes.set(r,new ig),this.sharedNodes.get(r).add(o);const l=o.options.initialPromotionConfig;o.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(o):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var o;const{layoutId:r}=this.options;return r?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:r}=this.options;return r?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:o,preserveFollowOpacity:u}={}){const l=this.getStack();l&&l.promote(this,u),r&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let o=!1;const{latestValues:u}=r;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(o=!0),!o)return;const l={};u.z&&$n("z",r,l,this.animationValues);for(let c=0;c<Vn.length;c++)$n(`rotate${Vn[c]}`,r,l,this.animationValues),$n(`skew${Vn[c]}`,r,l,this.animationValues);r.render();for(const c in l)r.setStaticValue(c,l[c]),this.animationValues&&(this.animationValues[c]=l[c]);r.scheduleRender()}applyProjectionStyles(r,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=Dn(o==null?void 0:o.pointerEvents)||"",r.transform=u?u(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=Dn(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Tt(this.latestValues)&&(r.transform=u?u({},""):"none",this.hasProjected=!1);return}r.visibility="";const c=l.animationValues||l.latestValues;this.applyTransformsToTarget();let d=Km(this.projectionDeltaWithTransform,this.treeScale,c);u&&(d=u(c,d)),r.transform=d;const{x:p,y:f}=this.projectionDelta;r.transformOrigin=`${p.origin*100}% ${f.origin*100}% 0`,l.animationValues?r.opacity=l===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:r.opacity=l===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in _s){if(c[m]===void 0)continue;const{correct:y,applyTo:v,isCSSVariable:g}=_s[m],A=d==="none"?c[m]:y(c[m],l);if(v){const h=v.length;for(let M=0;M<h;M++)r[v[M]]=A}else g?this.options.visualElement.renderState.vars[m]=A:r[m]=A}this.options.layoutId&&(r.pointerEvents=l===this?Dn(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var o;return(o=r.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(Tr),this.root.sharedNodes.clear()}}}function lg(e){e.updateLayout()}function ug(e){var s;const t=((s=e.resumeFrom)==null?void 0:s.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=e.layout,{animationType:i}=e.options,r=t.source!==e.layout.source;i==="size"?Ne(d=>{const p=r?t.measuredBox[d]:t.layoutBox[d],f=Me(p);p.min=n[d].min,p.max=p.min+f}):gu(i,t.layoutBox,n)&&Ne(d=>{const p=r?t.measuredBox[d]:t.layoutBox[d],f=Me(n[d]);p.max=p.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const o=Gt();ms(o,n,t.layoutBox);const u=Gt();r?ms(u,e.applyTransform(a,!0),t.measuredBox):ms(u,n,t.layoutBox);const l=!cu(o);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:p,layout:f}=d;if(p&&f){const m=ve();on(m,t.layoutBox,p.layoutBox);const y=ve();on(y,n,f.layoutBox),du(m,y)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:u,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function cg(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dg(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function pg(e){e.clearSnapshot()}function Tr(e){e.clearMeasurements()}function Ar(e){e.isLayoutDirty=!1}function fg(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Cr(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hg(e){e.resolveTargetDelta()}function mg(e){e.calcProjection()}function gg(e){e.resetSkewAndRotation()}function vg(e){e.removeLeadSnapshot()}function kr(e,t,s){e.translate=ce(t.translate,0,s),e.scale=ce(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function Er(e,t,s,n){e.min=ce(t.min,s.min,n),e.max=ce(t.max,s.max,n)}function yg(e,t,s,n){Er(e.x,t.x,s.x,n),Er(e.y,t.y,s.y,n)}function bg(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const xg={duration:.45,ease:[.4,0,.1,1]},Pr=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ir=Pr("applewebkit/")&&!Pr("chrome/")?Math.round:je;function Mr(e){e.min=Ir(e.min),e.max=Ir(e.max)}function _g(e){Mr(e.x),Mr(e.y)}function gu(e,t,s){return e==="position"||e==="preserve-aspect"&&!qm(br(t),br(s),.2)}function wg(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Sg=mu({attachResizeListener:(e,t)=>tg(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Ln={current:void 0},Tg=mu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ln.current){const e=new Sg({});e.mount(window),e.setOptions({layoutScroll:!0}),Ln.current=e}return Ln.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ag={some:0,all:1};function Cg(e,t,{root:s,margin:n,amount:a="some"}={}){const i=ql(e),r=new WeakMap,o=l=>{l.forEach(c=>{const d=r.get(c.target);if(c.isIntersecting!==!!d)if(c.isIntersecting){const p=t(c.target,c);typeof p=="function"?r.set(c.target,p):u.unobserve(c.target)}else typeof d=="function"&&(d(c),r.delete(c.target))})},u=new IntersectionObserver(o,{root:s,rootMargin:n,threshold:typeof a=="number"?a:Ag[a]});return i.forEach(l=>u.observe(l)),()=>u.disconnect()}const Rr=(e,t)=>Math.abs(e-t);function kg(e,t){const s=Rr(e.x,t.x),n=Rr(e.y,t.y);return Math.sqrt(s**2+n**2)}function vu({current:e}){return e?e.ownerDocument.defaultView:null}function pa(e){if(e)return e.nodeType===3||e.nodeType===8?pa(e.nextSibling):e}const[Eg,Pg,b1]=Ps("Motion"),[Ig,x1,_1]=Ps("LayoutGroup"),Mg={reducedMotion:"never",transition:void 0,nonce:void 0},[Rg,w1,S1]=Ps("MotionConfig");function Dg(){return Rg(R(()=>Mg))}const Vg={motionAttribute:"data-ap"},fa=[];function yu(e){for(const t of e)t&&!fa.includes(t)&&fa.push(t)}function bu(e,t,s){if(Array.isArray(e))return e.reduce((n,a)=>{const i=bu(a,t,s);return i?{...n,...i}:n},{});if(typeof e=="object")return e;if(e&&t){const n=t[e];return typeof n=="function"?n(s):n}}function $g(e,t,s){const n=bu(e,t,s);if(!n)return;const{transition:a,transitionEnd:i,...r}=n;return{...r,...i}}function Lg(e,t){var a;const s=(e.initial===void 0&&e.variants?t==null?void 0:t.initial:e.initial)===!1?["initial","animate"]:["initial"],n=e.custom??((a=e.presenceContext)==null?void 0:a.custom);return s.reduce((i,r)=>({...i,...$g(e[r]||(t==null?void 0:t[r]),e.variants,n)}),{})}function xu(e,t){const s=t==null?void 0:t.length;if(s!==e.length)return!1;for(let n=0;n<s;n++)if(t[n]!==e[n])return!1;return!0}var Og=new Set(["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]);function _u(e){return Og.has(e)}const Dr=new WeakMap;var Ng=class{constructor(e,t){var s;this.element=null,this.isExiting=!1,this.presenceContainer=null,this.children=new Set,this.features=new Map,this._context=null,this.options=e,this.parent=t,(s=t==null?void 0:t.children)==null||s.add(this),this.latestValues=Lg(e,this.context),this.type=_u(this.options.as)?"svg":"html"}get context(){return this._context||(this._context=new Proxy({},{get:(e,t)=>{var n;const s=this.options[t];return mn(s)||t==="initial"&&s===!1?s:(n=this.parent)==null?void 0:n.context[t]}})),this._context}updateFeatures(){if(this.visualElement)for(const e of fa){this.features.has(e.key)||this.features.set(e.key,new e(this));const t=this.features.get(e.key);this.isMounted()&&(t.isMount?t.update():(t.mount(),t.isMount=!0))}}updateOptions(e){var t;this.options=e,(t=this.visualElement)==null||t.update({...this.options,whileTap:this.options.whilePress},null)}mount(e){var t,s;Dr.set(e,this),this.element=e,e.setAttribute(Vg.motionAttribute,((t=this.options.presenceContext)==null?void 0:t.presenceId)??""),(s=this.visualElement)==null||s.mount(e),this.updateFeatures()}beforeUnmount(){this.getSnapshot(this.options,!1)}unmount(){var e,t,s;(t=(e=this.parent)==null?void 0:e.children)==null||t.delete(this),Dr.delete(this.element),this.features.forEach(n=>{var a;return(a=n.unmount)==null?void 0:a.call(n)}),(s=this.visualElement)==null||s.unmount()}beforeUpdate(){this.getSnapshot(this.options,void 0)}update(){this.updateFeatures(),this.didUpdate()}tryExitComplete(){var e,t,s,n,a;this.isExiting||(e=this.options)!=null&&e.layoutId&&((s=(t=this.visualElement.projection)==null?void 0:t.currentAnimation)==null?void 0:s.state)==="running"||(a=(n=this.options.presenceContext)==null?void 0:n.onMotionExitComplete)==null||a.call(n,this.presenceContainer,this)}setActive(e,t){var s,n;e==="exit"&&t&&(this.isExiting=!0),(n=(s=this.visualElement)==null?void 0:s.animationState)==null||n.setActive(e,t).then(()=>{var a;e==="exit"&&t&&(this.isExiting=!1,(a=this.options)!=null&&a.layoutId?ae.postRender(()=>this.tryExitComplete()):this.tryExitComplete())})}isMounted(){return!!this.element}initVisualElement(e){var t,s,n;this.visualElement||(this.visualElement=e(this.options.as,{presenceContext:null,parent:(t=this.parent)==null?void 0:t.visualElement,props:{...this.options,whileTap:this.options.whilePress},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{...this.latestValues}},reducedMotionConfig:(s=this.options.motionConfig)==null?void 0:s.reducedMotion}),(n=this.visualElement.parent)==null||n.addChild(this.visualElement),this.isMounted()&&this.visualElement.mount(this.element))}getSnapshot(e,t){}didUpdate(){}},it=class{constructor(e){this.state=e}mount(){}unmount(){}update(){}};const wu=["initial","animate","exit","whileHover","whileDrag","whileFocus","whilePress"];var Bg=wu.length;function Su(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?Su(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<Bg;s++){const n=wu[s],a=e.props[n];(mn(a)||a===!1)&&(t[n]=a)}return t}var Tu=["animate","whileInView","whileFocus","whileHover","whilePress","whileDrag","exit"],jg=[...Tu].reverse(),Fg=Tu.length;function wt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vr(){return{animate:wt(!0),whileInView:wt(),whileHover:wt(),whilePress:wt(),whileDrag:wt(),whileFocus:wt(),exit:wt()}}function zg(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xu(t,e):!1}function $r(e){return Array.isArray(e)}function qg(e){return t=>Promise.all(t.map(({animation:s,options:n})=>zh(e,s,n)))}function Ug(e){let t=qg(e),s=Vr(),n=!0;const a=u=>(l,c)=>{var p;const d=Kt(e,c,u==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(d){const{transition:f,transitionEnd:m,...y}=d;l={...l,...y,...m}}return l};function i(u){t=u(e)}function r(u){const{props:l}=e,c=Su(e.parent)||{},d=[],p=new Set;let f={},m=1/0;for(let v=0;v<Fg;v++){const g=jg[v],A=s[g],h=l[g]!==void 0?l[g]:c[g],M=mn(h),E=g===u?A.isActive:null;E===!1&&(m=v);let I=h===c[g]&&h!==l[g]&&M;if(I&&n&&e.manuallyAnimateOnMount&&(I=!1),A.protectedKeys={...f},!A.isActive&&E===null||!h&&!A.prevProp||ii(h)||typeof h=="boolean")continue;const T=zg(A.prevProp,h);let S=T||g===u&&A.isActive&&!I&&M||v>m&&M,N=!1;const $=Array.isArray(h)?h:[h];let U=$.reduce(a(g),{});E===!1&&(U={});const{prevResolvedValues:j={}}=A,ie={...j,...U},P=q=>{S=!0,p.has(q)&&(N=!0,p.delete(q)),A.needsAnimating[q]=!0;const J=e.getValue(q);J&&(J.liveStyle=!1)};for(const q in ie){const J=U[q],ee=j[q];if(Object.hasOwnProperty.call(f,q))continue;let G=!1;$r(J)&&$r(ee)?G=!xu(J,ee):G=J!==ee,G?J!=null?P(q):p.add(q):J!==void 0&&p.has(q)?P(q):A.protectedKeys[q]=!0}A.prevProp=h,A.prevResolvedValues=U,A.isActive&&(f={...f,...U}),n&&e.blockInitialAnimation&&(S=!1);const O=I&&T;S&&(!O||N)&&d.push(...$.map(q=>{const J={type:g};if(typeof q=="string"&&n&&!O&&e.manuallyAnimateOnMount&&e.parent){const{parent:ee}=e,G=Kt(ee,q);if(ee.enteringChildren&&G){const{delayChildren:te}=G.transition||{};J.delay=Rl(ee.enteringChildren,e,te)}}return{animation:q,options:J}}))}if(p.size){const v={};if(typeof l.initial!="boolean"){const g=Kt(e,Array.isArray(l.initial)?l.initial[0]:l.initial);g&&g.transition&&(v.transition=g.transition)}p.forEach(g=>{const A=e.getBaseTarget(g),h=e.getValue(g);h&&(h.liveStyle=!0),v[g]=A??null}),d.push({animation:v})}let y=!!d.length;return n&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(y=!1),n=!1,y?t(d):Promise.resolve()}function o(u,l){var d;if(s[u].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(p=>{var f;(f=p.animationState)==null||f.setActive(u,l)}),s[u].isActive=l;const c=r(u);for(const p in s)s[p].protectedKeys={};return c}return{animateChanges:r,setActive:o,setAnimateFunction:i,getState:()=>s,reset:()=>{s=Vr(),n=!0}}}function Au(e){return e.style.display==="none"||e.offsetParent===null&&window.getComputedStyle(e).position!=="fixed"}var Et,_a,Gg=(Et=class extends it{constructor(t){super(t);const s=t.visualElement;s.animationState||(s.animationState=Ug(s))}updateAnimationControlsSubscription(){const{animate:t}=this.state.options;ii(t)&&(this.unmountControls=t.subscribe(this.state.visualElement))}mount(){var t;Au(this.state.element)?this.state.setActive("exit",!0):(t=this.state.visualElement.animationState)==null||t.animateChanges(),this.updateAnimationControlsSubscription()}update(){var n;(n=this.state.visualElement.animationState)==null||n.animateChanges();const{animate:t}=this.state.visualElement.getProps(),{animate:s}=this.state.visualElement.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){var t;this.state.visualElement.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}},_a=new WeakMap,Ke(Et,_a,Et.key="animation"),Et);function Hg(e,t){return _u(e)?new Nm(t):new Mm(t)}function Lr(e){return{point:{x:e.pageX,y:e.pageY}}}var Pt,wa,Zg=(Pt=class extends it{constructor(t){super(t)}isActive(){const{whilePress:t,onPress:s,onPressCancel:n,onPressStart:a}=this.state.options;return!!(t||s||n||a)}register(){var s;const t=this.state.element;!t||!this.isActive()||((s=this.removePress)==null||s.call(this),this.removePress=cm(t,(n,a)=>{const i=this.state.options;return this.state.setActive("whilePress",!0),i.onPressStart&&ae.postRender(()=>i.onPressStart(a,Lr(a))),(r,{success:o})=>{this.state.setActive("whilePress",!1);const u=o?"onPress":"onPressCancel",l=this.state.options[u];l&&ae.postRender(()=>l(r,Lr(r)))}},{useGlobalTarget:this.state.options.globalPressTarget}))}mount(){this.register()}update(){const t=this.state.visualElement.prevProps;!(t!=null&&t.whilePress||t!=null&&t.whileTap||t!=null&&t.onPress||t!=null&&t.onPressCancel||t!=null&&t.onPressStart)&&this.isActive()&&this.register()}unmount(){var t;(t=this.removePress)==null||t.call(this),this.removePress=void 0}},wa=new WeakMap,Ke(Pt,wa,Pt.key="press"),Pt);function Cu(e){return e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1}function ws(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}function Wg(e){return t=>Cu(t)&&e(t,ws(t))}var It,Sa,Kg=(It=class extends it{constructor(t){super(t)}isActive(){const{whileHover:t,onHoverStart:s,onHoverEnd:n}=this.state.options;return!!(t||s||n)}register(){var s;const t=this.state.element;!t||!this.isActive()||((s=this.removeHover)==null||s.call(this),this.removeHover=im(t,(n,a)=>{const i=this.state.options;return this.state.setActive("whileHover",!0),i.onHoverStart&&ae.postRender(()=>i.onHoverStart(a,ws(a))),r=>{this.state.setActive("whileHover",!1);const o=this.state.options.onHoverEnd;o&&ae.postRender(()=>o(r,ws(r)))}}))}mount(){this.register()}update(){const t=this.state.visualElement.prevProps;!(t!=null&&t.whileHover||t!=null&&t.onHoverStart||t!=null&&t.onHoverEnd)&&this.isActive()&&this.register()}unmount(){var t;(t=this.removeHover)==null||t.call(this),this.removeHover=void 0}},Sa=new WeakMap,Ke(It,Sa,It.key="hover"),It),Mt,Ta,Yg=(Mt=class extends it{constructor(t){super(t)}isActive(){const{whileInView:t,onViewportEnter:s,onViewportLeave:n}=this.state.options;return!!(t||s||n)}startObserver(){var a;const t=this.state.element;if(!t||!this.isActive())return;(a=this.removeObserver)==null||a.call(this);const{once:s,...n}=this.state.options.inViewOptions||{};this.removeObserver=Cg(t,(i,r)=>{const o=this.state.options;if(this.state.setActive("whileInView",!0),o.onViewportEnter&&ae.postRender(()=>o.onViewportEnter(r)),!s)return()=>{this.state.setActive("whileInView",!1);const u=this.state.options.onViewportLeave;u&&ae.postRender(()=>u(r))}},n)}mount(){this.startObserver()}update(){const{props:t,prevProps:s}=this.state.visualElement;["amount","margin","root"].some(n=>{var a,i;return((a=t.inViewOptions)==null?void 0:a[n])!==((i=s==null?void 0:s.inViewOptions)==null?void 0:i[n])})&&this.startObserver()}unmount(){var t;(t=this.removeObserver)==null||t.call(this),this.removeObserver=void 0}},Ta=new WeakMap,Ke(Mt,Ta,Mt.key="inView"),Mt);function ln(e,t,s,n={passive:!0}){return e.addEventListener(t,s,n),()=>e.removeEventListener(t,s)}var Rt,Aa,Xg=(Rt=class extends it{constructor(t){super(t),this.isFocused=!1}onFocus(){let t=!1;try{t=this.state.element.matches(":focus-visible")}catch{t=!0}t&&(this.state.setActive("whileFocus",!0),this.isFocused=!0)}onBlur(){this.isFocused&&(this.state.setActive("whileFocus",!1),this.isFocused=!1)}mount(){const t=this.state.element;this.removeFocus=Is(ln(t,"focus",()=>this.onFocus()),ln(t,"blur",()=>this.onBlur()))}unmount(){var t;(t=this.removeFocus)==null||t.call(this),this.removeFocus=void 0}},Aa=new WeakMap,Ke(Rt,Aa,Rt.key="focus"),Rt);function ku(e){if(e)return e.options.allowProjection!==!1?e.projection:ku(e.parent)}const Eu={borderRadius:{...Je,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Je,borderTopRightRadius:Je,borderBottomLeftRadius:Je,borderBottomRightRadius:Je,boxShadow:nu};function ps(e){return typeof e=="object"&&e!==null&&"nodeType"in e}const Jg=typeof window>"u";var Dt,Ca,Qg=(Dt=class extends it{constructor(t){super(t),au(Eu),Jg||this.initProjection()}initProjection(){const t=this.state.options;this.state.visualElement.projection=new Tg(this.state.visualElement.latestValues,t["data-framer-portal-id"]?void 0:ku(this.state.visualElement.parent)),this.projection=this.state.visualElement.projection,this.projection.isPresent=!0,this.setOptions()}setOptions(){var r;const t=this.state.options,{layoutId:s,layout:n,drag:a=!1,dragConstraints:i=!1}=t;(r=this.projection)==null||r.setOptions({layout:n,layoutId:s,alwaysMeasureLayout:!!s||!!a||i&&ps(i),visualElement:this.state.visualElement,animationType:typeof t.layout=="string"?t.layout:"both",layoutRoot:t.layoutRoot,layoutScroll:t.layoutScroll,crossfade:t.crossfade,onExitComplete:()=>{var o;!((o=this.projection)!=null&&o.isPresent)&&this.state.options.layoutId&&!this.state.isExiting&&queueMicrotask(()=>{var u,l;(l=(u=this.state.options.presenceContext)==null?void 0:u.onMotionExitComplete)==null||l.call(u,this.state.presenceContainer,this.state)})}})}update(){this.setOptions()}mount(){var t;(t=this.projection)==null||t.mount(this.state.element)}},Ca=new WeakMap,Ke(Dt,Ca,Dt.key="projection"),Dt);function gs(e,t,s,n){return ln(e,t,Wg(s),n)}var Or=new Set(["auto","scroll"]),Pu=class{constructor(e,t,{transformPagePoint:s,contextWindow:n,dragSnapToOrigin:a=!1,element:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=c=>{this.handleScroll(c.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=Nn(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,p=kg(c.offset,{x:0,y:0})>=3;if(!d&&!p)return;const{point:f}=c,{timestamp:m}=xe;this.history.push({...f,timestamp:m});const{onStart:y,onMove:v}=this.handlers;d||(y&&y(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,c)},this.handlePointerMove=(c,d)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=On(d,this.transformPagePoint),ae.update(this.updatePoint,!0)},this.handlePointerUp=(c,d)=>{this.end();const{onEnd:p,onSessionEnd:f,resumeAnimation:m}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=Nn(c.type==="pointercancel"?this.lastMoveEventInfo:On(d,this.transformPagePoint),this.history);this.startEvent&&p&&p(c,y),f&&f(c,y)},!Cu(e))return;this.dragSnapToOrigin=a,this.handlers=t,this.transformPagePoint=s,this.contextWindow=n||window;const r=On(ws(e),this.transformPagePoint),{point:o}=r,{timestamp:u}=xe;this.history=[{...o,timestamp:u}];const{onSessionStart:l}=t;l&&l(e,Nn(r,this.history)),this.removeListeners=Is(gs(this.contextWindow,"pointermove",this.handlePointerMove),gs(this.contextWindow,"pointerup",this.handlePointerUp),gs(this.contextWindow,"pointercancel",this.handlePointerUp)),i&&this.startScrollTracking(i)}isScrollable(e){const t=window.getComputedStyle(e);return t.overflow==="auto"||t.overflow==="scroll"||t.overflowX==="auto"||t.overflowX==="scroll"||t.overflowY==="auto"||t.overflowY==="scroll"}startScrollTracking(e){let t=e.parentElement;for(;t;){const s=getComputedStyle(t);(Or.has(s.overflowX)||Or.has(s.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const s=e===window,n=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},a={x:n.x-t.x,y:n.y-t.y};a.x===0&&a.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(e,n),ae.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){var e;this.removeListeners&&this.removeListeners(),(e=this.removeScrollListeners)==null||e.call(this),this.scrollPositions.clear(),vt(this.updatePoint)}};function On(e,t){return t?{point:t(e.point)}:e}function Nr(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Nn({point:e},t){return{point:e,delta:Nr(e,Iu(t)),offset:Nr(e,ev(t)),velocity:tv(t,.1)}}function ev(e){return e[0]}function Iu(e){return e[e.length-1]}function tv(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,n=null;const a=Iu(e);for(;s>=0&&(n=e[s],!(a.timestamp-n.timestamp>Fe(t)));)s--;if(!n)return{x:0,y:0};const i=Be(a.timestamp-n.timestamp);if(i===0)return{x:0,y:0};const r={x:(a.x-n.x)/i,y:(a.y-n.y)/i};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Br(e){return(t,s)=>{e&&ae.postRender(()=>e(t,s))}}var Vt,ka,sv=(Vt=class extends it{constructor(...t){super(...t),this.removePointerDownListener=je}onPointerDown(t){this.session=new Pu(t,this.createPanHandlers(),{transformPagePoint:this.state.visualElement.getTransformPagePoint(),contextWindow:vu(this.state.visualElement)})}createPanHandlers(){return{onSessionStart:Br((t,s)=>{const{onPanSessionStart:n}=this.state.options;n&&n(t,s)}),onStart:Br((t,s)=>{const{onPanStart:n}=this.state.options;n&&n(t,s)}),onMove:(t,s)=>{const{onPan:n}=this.state.options;n&&n(t,s)},onEnd:(t,s)=>{const{onPanEnd:n}=this.state.options;delete this.session,n&&ae.postRender(()=>n(t,s))}}}mount(){this.removePointerDownListener=gs(this.state.element,"pointerdown",this.onPointerDown.bind(this))}update(){}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},ka=new WeakMap,Ke(Vt,ka,Vt.key="pan"),Vt);function Mu(e){let t=null;return()=>{const s=()=>{t=null};return t===null?(t=e,s):!1}}var jr=Mu("dragHorizontal"),Fr=Mu("dragVertical");function nv(e){let t=!1;if(e==="y")t=Fr();else if(e==="x")t=jr();else{const s=jr(),n=Fr();s&&n?t=()=>{s(),n()}:(s&&s(),n&&n())}return t}function av(e,{min:t,max:s},n){return t!==void 0&&e<t?e=n?ce(t,e,n.min):Math.max(e,t):s!==void 0&&e>s&&(e=n?ce(s,e,n.max):Math.min(e,s)),e}const ha=.35;function iv(e,{top:t,left:s,bottom:n,right:a}){return{x:zr(e.x,s,a),y:zr(e.y,t,n)}}function zr(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function rv(e=ha){return e===!1?e=0:e===!0&&(e=ha),{x:qr(e,"left","right"),y:qr(e,"top","bottom")}}function qr(e,t,s){return{min:Ur(e,t),max:Ur(e,s)}}function Ur(e,t){return typeof e=="number"?e:e[t]||0}function ov(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}function lv(e,t){return{x:Gr(e.x,t.x),y:Gr(e.y,t.y)}}function Gr(e,t){let s=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,n]=[n,s]),{min:s,max:n}}function uv(e,t){let s=.5;const n=Me(e),a=Me(t);return a>n?s=bs(t.min,t.max-n,e.min):n>a&&(s=bs(e.min,e.max-a,t.min)),et(0,1,s)}const cv=new WeakMap;var dv=class{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ve(),this.state=e}get visualElement(){return this.state.visualElement}start(e,{snapToCursor:t=!1}={}){const s=u=>{t?this.stopAnimation():this.pauseAnimation(),t&&this.snapToCursor(ws(u,"page").point)},n=(u,l)=>{this.stopAnimation();const{drag:c,dragPropagation:d,onDragStart:p}=this.getProps();c&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=nv(c),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ne(f=>{let m=this.getAxisMotionValue(f).get()||0;if(Qe.test(m)){const{projection:y}=this.visualElement;if(y&&y.layout){const v=y.layout.layoutBox[f];v&&(m=Me(v)*(parseFloat(m)/100))}}this.originPoint[f]=m}),p&&ae.postRender(()=>p(u,l)),ia(this.visualElement,"transform"),this.state.setActive("whileDrag",!0))},a=(u,l)=>{const{dragPropagation:c,dragDirectionLock:d,onDirectionLock:p,onDrag:f}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:m}=l;if(d&&this.currentDirection===null){this.currentDirection=pv(m),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",l.point,m),this.updateAxis("y",l.point,m),this.visualElement.render(),f&&f(u,l)},i=(u,l)=>this.stop(u,l),r=()=>Ne(u=>{var l;return this.getAnimationState(u)==="paused"&&((l=this.getAxisMotionValue(u).animation)==null?void 0:l.play())}),{dragSnapToOrigin:o}=this.getProps();this.panSession=new Pu(e,{onSessionStart:s,onStart:n,onMove:a,onSessionEnd:i,resumeAnimation:r},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,contextWindow:vu(this.visualElement),element:this.state.element})}stop(e,t){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:n}=t;this.startAnimation(n);const{onDragEnd:a}=this.getProps();a&&ae.postRender(()=>a(e,t))}cancel(){this.isDragging=!1;const{projection:e}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:t}=this.getProps();!t&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),this.state.setActive("whileDrag",!1)}updateAxis(e,t,s){const{drag:n}=this.getProps();if(!s||!Ws(e,n,this.currentDirection))return;const a=this.getAxisMotionValue(e);let i=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(i=av(i,this.constraints[e],this.elastic[e])),a.set(i)}resolveConstraints(){var a;const{dragConstraints:e,dragElastic:t}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,n=this.constraints;e&&ps(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=iv(s.layoutBox,e):this.constraints=!1,this.elastic=rv(t),n!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ne(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=ov(s.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!ps(e))return!1;const s=e,{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const a=Am(s,n.root,this.visualElement.getTransformPagePoint());let i=lv(n.layout.layoutBox,a);if(t){const r=t(wm(i));this.hasMutatedConstraints=!!r,r&&(i=Jl(r))}return i}startAnimation(e){const{drag:t,dragMomentum:s,dragElastic:n,dragTransition:a,dragSnapToOrigin:i,onDragTransitionEnd:r}=this.getProps(),o=this.constraints||{},u=Ne(l=>{if(!Ws(l,t,this.currentDirection))return;let c=o&&o[l]||{};i&&(c={min:0,max:0});const d=n?200:1e6,p=n?40:1e7,f={type:"inertia",velocity:s?e[l]:0,bounceStiffness:d,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...c};return this.startAxisValueAnimation(l,f)});return Promise.all(u).then(r)}startAxisValueAnimation(e,t){const s=this.getAxisMotionValue(e);return ia(this.visualElement,e),s.start(si(e,s,0,t,this.visualElement,!1))}stopAnimation(){var e;(e=this.visualElement.projection)!=null&&e.isPresent&&Ne(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ne(e=>{var t;return(t=this.getAxisMotionValue(e).animation)==null?void 0:t.pause()})}getAnimationState(e){var t;return(t=this.getAxisMotionValue(e).animation)==null?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps();return s[t]||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){Ne(t=>{const{drag:s}=this.getProps();if(!Ws(t,s,this.currentDirection))return;const{projection:n}=this.visualElement,a=this.getAxisMotionValue(t);if(n&&n.layout){const{min:i,max:r}=n.layout.layoutBox[t];a.set(e[t]-ce(i,r,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:s}=this.visualElement;if(!ps(t)||!s||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};Ne(i=>{const r=this.getAxisMotionValue(i);if(r&&this.constraints!==!1){const o=r.get();n[i]=uv({min:o,max:o},this.constraints[i])}});const{transformTemplate:a}=this.visualElement.getProps();this.state.element.style.transform=a?a({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Ne(i=>{if(!Ws(i,e,null))return;const r=this.getAxisMotionValue(i),{min:o,max:u}=this.constraints[i];r.set(ce(o,u,n[i]))})}addListeners(){if(!this.state.element)return;cv.set(this.visualElement,this);const e=this.state.element,t=gs(e,"pointerdown",o=>{const{drag:u,dragListener:l=!0}=this.getProps();u&&l&&this.start(o)}),s=()=>{const{dragConstraints:o}=this.getProps();ps(o)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,a=n.addEventListener("measure",s);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),ae.read(s);const i=ln(window,"resize",()=>this.scalePositionWithinConstraints()),r=n.addEventListener("didUpdate",({delta:o,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ne(l=>{const c=this.getAxisMotionValue(l);c&&(this.originPoint[l]+=o[l].translate,c.set(c.get()+o[l].translate))}),this.visualElement.render())});return()=>{i(),t(),a(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:s=!1,dragPropagation:n=!1,dragConstraints:a=!1,dragElastic:i=ha,dragMomentum:r=!0}=e;return{...e,drag:t,dragDirectionLock:s,dragPropagation:n,dragConstraints:a,dragElastic:i,dragMomentum:r}}};function Ws(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function pv(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}var $t,Ea,fv=($t=class extends it{constructor(t){super(t),this.removeGroupControls=je,this.removeListeners=je,this.controls=new dv(t)}mount(){const{dragControls:t}=this.state.options;t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||je}unmount(){this.removeGroupControls(),this.removeListeners()}},Ea=new WeakMap,Ke($t,Ea,$t.key="drag"),$t),us=!1,Lt,Pa,hv=(Lt=class extends it{constructor(t){super(t),this.hasMountSettled=!1,au(Eu),t.getSnapshot=this.getSnapshot.bind(this),t.didUpdate=this.didUpdate.bind(this)}updatePrevLead(t){const s=t.getStack();s!=null&&s.prevLead&&!s.prevLead.snapshot&&(s.prevLead.willUpdate(),us=!0)}didUpdate(){var t,s;us&&(this.state.options.layout||this.state.options.layoutId||this.state.options.drag)&&(us=!1,(s=(t=this.state.visualElement.projection)==null?void 0:t.root)==null||s.didUpdate())}mount(){var n;const t=this.state.options,s=this.state.options.layoutGroup;if(t.layout||t.layoutId){const a=this.state.visualElement.projection;if(t.layoutId){const i=!Au(this.state.element);a.isPresent=i,i?a.promote():a.relegate(),this.updatePrevLead(a)}(n=s==null?void 0:s.group)==null||n.add(a),Js.hasEverUpdated=!0}this.didUpdate(),ae.postRender(()=>{this.hasMountSettled=!0})}unmount(){const t=this.state.options.layoutGroup,s=this.state.visualElement.projection;s&&(t!=null&&t.group&&(this.state.options.layout||this.state.options.layoutId)&&t.group.remove(s),this.state.options.layoutId&&(us=!0),this.didUpdate())}getSnapshot(t,s){const n=this.state.visualElement.projection,{drag:a,layoutDependency:i,layout:r,layoutId:o}=t;if(!n||!r&&!o&&!a||!this.hasMountSettled)return;us=!0;const u=this.state.options;(a||u.layoutDependency!==i||i===void 0||yi(s)&&n.isPresent!==s)&&n.willUpdate(),yi(s)&&s!==n.isPresent&&(n.isPresent=s,s?(n.promote(),this.updatePrevLead(n)):n.relegate())}},Pa=new WeakMap,Ke(Lt,Pa,Lt.key="layout"),Lt);const mv={renderer:Hg,features:[Gg,Zg,Kg,Yg,Xg,Qg,sv,fv,hv]},[gv,T1]=Ps("LazyMotionContext"),[vv,A1,C1]=Ps("AnimatePresenceContext");function yv(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}function Ru(){return{transform:{},transformOrigin:{},style:{},vars:{}}}function bv(){return{...Ru(),attrs:{}}}function xv(e){const t=Ru();ri(t,e);const s={...t.style};for(const n in t.vars)s[n]=t.vars[n];return Object.keys(s).length===0?null:s}function _v(e,t,s){const n=bv();ru(n,e,ou(t),void 0,s);const a={};for(const i in n.attrs){const r=oi.has(i)?i:yv(i);a[r]=n.attrs[i]}return{attrs:a,style:{...n.style,...n.vars}}}function wv(e,t){const s=Eg(null),n=Ig({}),a=Dg(),i=vv({}),r=gv({features:K({}),strict:!1}),o=bc();function u(){return Zp(e,{layoutGroup:n,presenceContext:i,config:a.value})}function l(){return{...o,...u()}}const c=new Ng(l(),s);Pg(c),t&&c.initVisualElement(t),Te(r.features,f=>{var m;(m=f.features)!=null&&m.length&&yu(f.features),f.renderer&&c.initVisualElement(f.renderer),c.updateFeatures()},{immediate:!0,flush:"pre"});function d(){var A;const f=c.type==="svg",m={...o};Object.keys(o).forEach(h=>{Ce(o[h])&&(m[h]=o[h].get())});const y=((A=c.visualElement)==null?void 0:A.latestValues)||c.latestValues;let v={...e.style,...f?{}:y};for(const h in v)Ce(v[h])&&(v[h]=v[h].get());if(f){const{attrs:h,style:M}=_v({...y,...v},c.options.as,e.style);Object.assign(m,h),v=M}e.drag&&e.dragListener!==!1&&Object.assign(v,{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`});const g=xv(v);return g&&(m.style=g),m}const p=xc().proxy;return dn(()=>{const f=pa(p.$el);c.mount(f)}),Ra(()=>c.beforeUnmount()),ko(()=>{var f;(f=pa(p.$el))!=null&&f.isConnected||c.unmount()}),_c(()=>{c.beforeUpdate(),c.updateOptions(l())}),wc(()=>{c.update()}),{getProps:u,getAttrs:d,layoutGroup:n,state:c}}const Sv={ignoreStrict:{type:Boolean},forwardMotionProps:{type:Boolean,default:!1},asChild:{type:Boolean,default:!1},whileDrag:{type:[String,Array,Object]},whileHover:{type:[String,Array,Object]},whilePress:{type:[String,Array,Object]},whileInView:{type:[String,Array,Object]},whileFocus:{type:[String,Array,Object]},custom:{type:[String,Number,Object,Array]},initial:{type:[String,Array,Object,Boolean],default:void 0},animate:{type:[String,Array,Object],default:void 0},exit:{type:[String,Array,Object]},variants:{type:Object},inherit:{type:Boolean},style:{type:Object},transformTemplate:{type:Function},transition:{type:Object},onAnimationComplete:{type:Function},onUpdate:{type:Function},layout:{type:[Boolean,String],default:!1},layoutId:{type:String,default:void 0},layoutScroll:{type:Boolean,default:!1},layoutRoot:{type:Boolean,default:!1},"data-framer-portal-id":{type:String},crossfade:{type:Boolean,default:!0},layoutDependency:{type:null,default:void 0},onBeforeLayoutMeasure:{type:Function},onLayoutMeasure:{type:Function},onLayoutAnimationStart:{type:Function},onLayoutAnimationComplete:{type:Function},globalPressTarget:{type:Boolean},onPressStart:{type:Function},onPress:{type:Function},onPressCancel:{type:Function},onHoverStart:{type:Function},onHoverEnd:{type:Function},inViewOptions:{type:Object},onViewportEnter:{type:Function},onViewportLeave:{type:Function},drag:{type:[Boolean,String]},dragSnapToOrigin:{type:Boolean},dragDirectionLock:{type:Boolean},dragPropagation:{type:Boolean},dragConstraints:{type:[Boolean,Object]},dragElastic:{type:[Boolean,Number,Object],default:.5},dragMomentum:{type:Boolean,default:!0},dragTransition:{type:Object},dragListener:{type:Boolean,default:!0},dragControls:{type:Object},onDragStart:{type:Function},onDragEnd:{type:Function},onDrag:{type:Function},onDirectionLock:{type:Function},onDragTransitionEnd:{type:Function},onMeasureDragConstraints:{type:Function},onPanSessionStart:{type:Function},onPanStart:{type:Function},onPan:{type:Function},onPanEnd:{type:Function}};var Tv=new Map,Av=new Map;function Cv(e){if(!Array.isArray(e))return[e];const t=[];for(const s of e)Array.isArray(s)?t.push(...s):t.push(s);return t}var kv=["area","img","input"];function Ev(e,t,s){var n,a;if(typeof e=="string"&&kv.includes(e))return Wt(e,t);if(e==="template"){if(!s.default)return null;const i=Cv(s.default()),r=i.findIndex(c=>c.type!==Sc);if(r===-1)return i;const o=i[r];(n=o.props)==null||delete n.ref;const u=o.props?Bt(t,o.props):t;t.class&&((a=o.props)!=null&&a.class)&&delete o.props.class;const l=Tc(o,u);for(const c in u)c.startsWith("on")&&(l.props||(l.props={}),l.props[c]=u[c]);return i.length===1?l:(i[r]=l,i)}return null}function Hr(e,t={}){const s=typeof e=="string",n=s?e:e.name||"",a=t.renderer?Tv:Av;if(s&&(a!=null&&a.has(e)))return a.get(e);const i=X({inheritAttrs:!1,props:{...Sv,as:{type:[String,Object],default:e||"div"}},name:n?`motion.${n}`:"Motion",setup(r,{slots:o}){const{getProps:u,getAttrs:l,state:c}=wv(r,t.renderer);function d(){const p=c.element;if((typeof r.as!="object"||r.asChild)&&p){const{style:f}=l();if(f)for(const[m,y]of Object.entries(f))p.style[m]=y}}return()=>{const p=u(),f=l(),m=r.asChild?"template":r.as,y={...r.forwardMotionProps?p:{},...f,onVnodeUpdated:d},v=Ev(m,y,o);return v!==null?v:Wt(m,{...y},o)}}});return s&&(a==null||a.set(e,i)),i}function Pv(e){const t=e==null?void 0:e.renderer;return yu((e==null?void 0:e.features)||[]),new Proxy({},{get(s,n){return n==="create"?(a,i)=>Hr(a,{...i,renderer:t}):Hr(n,{renderer:t})}})}const ma=Pv(mv);ma.create("div");const li=X({__name:"Shimmer",props:{as:{default:"p"},class:{},duration:{default:2},spread:{default:2}},setup(e){const t=e,s=Ac(),n=R(()=>{var l;const u=(l=s.default)==null?void 0:l.call(s);return!u||u.length===0?"":u.map(c=>typeof c.children=="string"?c.children:"").join("")}),a=R(()=>{var u;return(((u=n.value)==null?void 0:u.length)??0)*t.spread}),i=R(()=>Da("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",t.class)),r=R(()=>({"--spread":`${a.value}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"})),o=R(()=>ma[t.as]||ma.p);return(u,l)=>(_(),H(Eo(o.value),{class:fe(i.value),style:es(r.value),initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:Number.POSITIVE_INFINITY,duration:u.duration,ease:"linear"}},{default:C(()=>[Qt(u.$slots,"default")]),_:3},8,["class","style","transition"]))}});function Du(e){const t=R(()=>{const i=[];for(const r of e.value){if(r.role!=="assistant")continue;(r.blocks||[]).forEach((u,l)=>{const c=`${r.id}-attachment-${l}`;if(u.kind==="code")i.push({id:c,messageId:r.id,type:"code",language:u.language,code:u.code});else if(u.kind==="source")i.push({id:c,messageId:r.id,type:"source",url:u.url,title:u.title,filename:u.filename,mediaType:u.mediaType});else if(u.kind==="tool"&&(u.toolName==="export_query_result"||u.toolName==="export_content")){const d=u.result;d!=null&&d.filename&&d.content!==void 0&&i.push({id:c,messageId:r.id,type:"file",filename:d.filename,result:d})}})}return i}),s=R(()=>t.value.filter(i=>i.type==="file")),n=R(()=>t.value.filter(i=>i.type==="code")),a=R(()=>t.value.filter(i=>i.type==="source"));return{attachments:t,files:s,codes:n,sources:a}}function Iv(e){const t=window.atob(e),s=new Uint8Array(t.length);for(let n=0;n<t.length;n+=1)s[n]=t.charCodeAt(n);return s}function ui(){return{downloadFile:async t=>{if(t.error)return xn.error(t.error),!1;try{const s=t.encoding==="base64"?new Blob([Iv(t.content)],{type:t.mimeType}):new Blob([t.content],{type:t.mimeType}),n=URL.createObjectURL(s),a=document.createElement("a");return a.href=n,a.download=t.filename,a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n),xn.success(`Downloaded ${t.filename}`),!0}catch(s){const n=s instanceof Error?s.message:"Failed to download export file.";return xn.error(n),!1}}}}const Mv={class:"whitespace-pre-wrap leading-normal chat-text"},Rv=X({__name:"BlockMessageText",props:{content:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean},isUserMessage:{type:Boolean}},setup(e){const t=e,s=R(()=>!!(t.isBlockStreaming&&t.isStreaming)),n=Va(vs(t,"content"),s);return(a,i)=>(_(),k("p",Mv,D(b(n)),1))}});class ci{constructor(t){lt(this,"options");lt(this,"tokensStable",[]);lt(this,"tokensUnstable",[]);lt(this,"lastUnstableCodeChunk","");lt(this,"lastStableGrammarState");this.options=t}async enqueue(t){const s=(this.lastUnstableCodeChunk+t).split(`
3
- `),n=[];let a=[];const i=this.tokensUnstable.length;return s.forEach((r,o)=>{const u=o===s.length-1,l=this.options.highlighter.codeToTokens(r,{...this.options,grammarState:this.lastStableGrammarState}),c=l.tokens[0];u||c.push({content:`
4
- `,offset:0}),u?(a=c,this.lastUnstableCodeChunk=r):(this.lastStableGrammarState=l.grammarState,n.push(...c))}),this.tokensStable.push(...n),this.tokensUnstable=a,{recall:i,stable:n,unstable:a}}close(){const t=this.tokensUnstable;return this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0,{stable:t}}clear(){this.tokensStable=[],this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0}clone(){const t=new ci(this.options);return t.lastUnstableCodeChunk=this.lastUnstableCodeChunk,t.tokensUnstable=this.tokensUnstable,t.tokensStable=this.tokensStable,t.lastStableGrammarState=this.lastStableGrammarState,t}}class Dv extends TransformStream{constructor(s){const n=new ci(s),{allowRecalls:a=!1}=s;super({async transform(i,r){const{stable:o,unstable:u,recall:l}=await n.enqueue(i);a&&l>0&&r.enqueue({recall:l});for(const c of o)r.enqueue(c);if(a)for(const c of u)r.enqueue(c)},async flush(i){const{stable:r}=n.close();if(!a)for(const o of r)i.enqueue(o)}});lt(this,"tokenizer");lt(this,"options");this.tokenizer=n,this.options=s}}function Vv(e){return!e||Object(e)!==e}const $v="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function Lv(e=16,t=$v){let s="",n=e;const a=t.length;for(;n--;)s+=t[Math.random()*a|0];return s}const Bn=new WeakMap;function Ov(e){return Vv(e)?e:(Bn.has(e)||Bn.set(e,Lv()),Bn.get(e))}const Nv=X({name:"ShikiStreamRenderer",props:{stream:{type:Object,required:!0}},emits:["stream-start","stream-end"],setup(e,{emit:t}){const s=kc([]);let n=null;return Te(()=>e.stream,a=>{s.length=0,n&&n.abort(),n=new AbortController;const i=n.signal;let r=!1;a.pipeTo(new WritableStream({write(o){i.aborted||(r||(r=!0,t("stream-start")),"recall"in o?s.length-=o.recall:s.push(o))},close:()=>{i.aborted||t("stream-end")},abort:()=>{i.aborted||t("stream-end")}}),{signal:i}).catch(o=>{o.name!=="AbortError"&&console.error("Stream error:",o)})},{immediate:!0}),()=>Wt("pre",{class:"shiki shiki-stream"},Wt("code",Re(s,a=>Wt("span",{key:Ov(a),style:a.htmlStyle||hd(a)},a.content))))}}),Bv=X({name:"ShikiCachedRenderer",props:{code:{type:String,required:!0},lang:{type:String,required:!0},theme:{type:String,required:!0},highlighter:{type:Object,required:!0}},emits:["stream-start","stream-end"],setup(e,{emit:t}){const s=K(0);let n=null;const a=new ReadableStream({start(r){n=r}});Cc(()=>{e.code.length>s.value&&(n==null||n.enqueue(e.code.slice(s.value)),s.value=e.code.length)});const i=a.pipeThrough(new Dv({highlighter:e.highlighter,lang:e.lang,theme:e.theme,allowRecalls:!0}));return()=>Wt(Nv,{stream:i,onStreamStart:()=>t("stream-start"),onStreamEnd:()=>t("stream-end")})}});let cs=null,jn=null;const jv=new Set,Fv=[Le(()=>import("./B9xm8XSJ.js"),[],import.meta.url),Le(()=>import("./DDsaDrGo.js").then(e=>e.f),__vite__mapDeps([0,1,2]),import.meta.url),Le(()=>import("./DDsaDrGo.js").then(e=>e.e),__vite__mapDeps([0,1,2]),import.meta.url),Le(()=>import("./CoQ_oOia.js").then(e=>e.b),__vite__mapDeps([3,1,2,0]),import.meta.url),Le(()=>import("./DDsaDrGo.js").then(e=>e.m),__vite__mapDeps([0,1,2]),import.meta.url),Le(()=>import("./fuZLfV_i.js"),[],import.meta.url),Le(()=>import("./DDsaDrGo.js").then(e=>e.x),__vite__mapDeps([0,1,2]),import.meta.url),Le(()=>import("./DDsaDrGo.js").then(e=>e.y),__vite__mapDeps([0,1,2]),import.meta.url),Le(()=>import("./DDsaDrGo.js").then(e=>e.h),__vite__mapDeps([0,1,2]),import.meta.url),Le(()=>import("./DDsaDrGo.js").then(e=>e.j),__vite__mapDeps([0,1,2]),import.meta.url),Le(()=>import("./DlfHMoPT.js"),[],import.meta.url)],zv=async e=>{if(jn||(jn=md({langs:Fv,themes:[vd,yd],engine:gd()})),cs||(cs=await jn),e!=null&&e.length){const t=cs.getLoadedLanguages();await Promise.all(e.filter(s=>!t.includes(s)).map(s=>cs.loadLanguage(s).catch(()=>{jv.add(s),console.warn(`[useHighlighter] Unknown language: "${s}" — will render as plain text`)})))}return cs},qv={class:"rounded-xl border overflow-hidden shadow-sm"},Uv={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},Gv={class:"text-xxs font-semibold capitalize text-muted-foreground select-none"},Hv={class:"flex items-center gap-1 justify-center"},Zv={class:"overflow-x-auto px-3 py-2 chat-code-text"},Wv={key:1,class:"m-0"},gn=X({__name:"BlockMessageCode",props:{id:{},code:{},language:{},class:{},meta:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean}},setup(e){const t=Po(),s=K(null),n=e;Te(()=>n.language,async m=>{s.value=await zv([m])},{immediate:!0});const{handleCopyWithKey:a,isCopied:i,getCopyIcon:r,getCopyIconClass:o,getCopyTooltip:u}=$a(),l=R(()=>!!(n.isBlockStreaming&&n.isStreaming)),c=Va(vs(n,"code"),l),d=R(()=>{switch(n.language){case"markdown":return"markdown";case"csv":return"csv";case"json":return"json";case"javascript":return"js";case"typescript":return"ts";case"postgresql":case"mysql":case"oracle":case"sql":case"plsql":case"sqlpl":case"sqlserver":return"sql";default:return"text"}}),p=R(()=>c.value.trim().replace(/`+$/,"")),f=R(()=>`${d.value}-${t.value}`);return(m,y)=>{const v=ye,g=Ae;return _(),k("div",qv,[w("div",Uv,[w("span",Gv,D(n.language),1),x(b(pn),null,{default:C(()=>[x(b(fn),{"as-child":""},{default:C(()=>[x(g,{variant:"ghost",size:"xxs",class:"h-6!",onClick:y[0]||(y[0]=A=>b(a)(m.id,m.code))},{default:C(()=>[w("span",Hv,[(_(),H(v,{key:b(i)(m.id)?"tick":"copy",name:b(r)(b(i)(m.id)),class:fe(["size-3.5",b(o)(b(i)(m.id))])},null,8,["name","class"])),b(i)(m.id)?(_(),k("span",{key:0,class:fe(["text-xxs font-medium leading-none",b(o)(b(i)(m.id))])}," Copied ",2)):Z("",!0)])]),_:1})]),_:1}),x(b(hn),null,{default:C(()=>[w("p",null,D(b(u)(b(i)(m.id))),1)]),_:1})]),_:1})]),w("div",Zv,[s.value?(_(),H(b(Bv),{key:f.value,highlighter:s.value,code:p.value,lang:d.value,theme:b(t).value==="dark"?"catppuccin-mocha":"catppuccin-latte"},null,8,["highlighter","code","lang","theme"])):(_(),k("pre",Wv,[w("code",null,D(p.value),1)]))])])}}}),Kv={class:"rounded-xl border overflow-hidden shadow-sm"},Yv={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},Xv={class:"flex items-center gap-0.5"},Jv={class:"flex items-center gap-1 justify-center"},Qv={key:0,class:"text-xxs font-medium leading-none"},ey={key:0,class:"overflow-auto bg-background max-h-[400px] p-4"},ty={key:0,class:"text-destructive text-sm p-2 bg-destructive/10 rounded"},sy=["innerHTML"],ny={key:1,class:"overflow-x-auto px-3 py-2 chat-code-text"},ay={class:"m-0"},iy={key:0,class:"fixed inset-0 z-50 bg-background flex flex-col"},ry={class:"flex items-center justify-between px-4 py-2 border-b border-border"},oy={class:"flex items-center gap-2"},ly={class:"flex items-center gap-1"},uy={key:0,class:"flex-1 overflow-auto p-6"},cy={key:0,class:"text-destructive text-sm p-2 bg-destructive/10 rounded"},dy=["innerHTML"],py={key:1,class:"flex-1 overflow-auto px-4 py-3 chat-code-text"},fy={class:"m-0"},hy=X({__name:"BlockMessageMermaid",props:{id:{},code:{}},setup(e){const t=e,s=K(null),n=K(null),a=K(null),i=K(null),{handleCopyWithKey:r,isCopied:o,getCopyIcon:u,getCopyIconClass:l,getCopyTooltip:c}=$a();let d=0;const p=async()=>{if(t.code.trim())try{a.value=null;const{default:v}=await Le(async()=>{const{default:h}=await import("./DYqShb5v.js").then(M=>M.bf);return{default:h}},__vite__mapDeps([4,1,2]),import.meta.url);v.initialize({startOnLoad:!1,theme:Po().value==="dark"?"dark":"default",securityLevel:"strict",fontFamily:"inherit"}),d+=1;const g=`mermaid-${t.id}-${d}`,{svg:A}=await v.render(g,t.code.trim());i.value=A}catch(v){a.value=v instanceof Error?v.message:"Failed to render diagram",i.value=null}};dn(p),Te(()=>t.code,p);const f=K(!1),m=K(!1),y=()=>{f.value=!f.value};return(v,g)=>{const A=ye,h=Ae,M=fn,E=hn,I=pn;return _(),k(he,null,[w("div",Kv,[w("div",Yv,[g[4]||(g[4]=w("span",{class:"text-xxs font-semibold capitalize text-muted-foreground select-none"}," Mermaid ",-1)),w("div",Xv,[x(I,null,{default:C(()=>[x(M,{"as-child":""},{default:C(()=>[x(h,{variant:"ghost",size:"iconSm",onClick:g[0]||(g[0]=T=>m.value=!m.value)},{default:C(()=>[x(A,{name:m.value?"hugeicons:eye":"hugeicons:source-code",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),x(E,null,{default:C(()=>[z(D(m.value?"Show diagram":"Show source"),1)]),_:1})]),_:1}),x(I,null,{default:C(()=>[x(M,{"as-child":""},{default:C(()=>[x(h,{variant:"ghost",size:"iconSm",class:"w-[unset]",onClick:g[1]||(g[1]=T=>b(r)(v.id,v.code))},{default:C(()=>[w("span",Jv,[(_(),H(A,{key:b(o)(v.id)?"tick":"copy",name:b(u)(b(o)(v.id)),class:fe(["size-4",b(l)(b(o)(v.id))])},null,8,["name","class"])),b(o)(v.id)?(_(),k("span",Qv," Copied ")):Z("",!0)])]),_:1})]),_:1}),x(E,null,{default:C(()=>[z(D(b(c)(b(o)(v.id))),1)]),_:1})]),_:1}),x(I,null,{default:C(()=>[x(M,{"as-child":""},{default:C(()=>[x(h,{variant:"ghost",size:"iconSm",onClick:y},{default:C(()=>[x(A,{name:f.value?"hugeicons:arrow-shrink-02":"hugeicons:arrow-expand-02",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),x(E,null,{default:C(()=>[z(D(f.value?"Exit full view":"Full view"),1)]),_:1})]),_:1})])]),m.value?(_(),k("div",ny,[w("pre",ay,[w("code",null,D(v.code),1)])])):(_(),k("div",ey,[a.value?(_(),k("div",ty,D(a.value),1)):i.value?(_(),k("div",{key:1,ref_key:"containerRef",ref:s,class:"flex items-center justify-center [&>svg]:max-w-full",innerHTML:i.value},null,8,sy)):Z("",!0)]))]),(_(),H(Io,{to:"body"},[f.value?(_(),k("div",iy,[w("div",ry,[w("div",oy,[x(A,{name:"hugeicons:chart-relationship",class:"size-4 text-primary"}),g[5]||(g[5]=w("span",{class:"text-sm font-medium"},"Mermaid Diagram",-1))]),w("div",ly,[x(I,null,{default:C(()=>[x(M,{"as-child":""},{default:C(()=>[x(h,{variant:"ghost",size:"xxs",class:"h-7!",onClick:g[2]||(g[2]=T=>m.value=!m.value)},{default:C(()=>[x(A,{name:m.value?"hugeicons:eye":"hugeicons:source-code",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),x(E,null,{default:C(()=>[z(D(m.value?"Show diagram":"Show source"),1)]),_:1})]),_:1}),x(I,null,{default:C(()=>[x(M,{"as-child":""},{default:C(()=>[x(h,{variant:"ghost",size:"iconSm",onClick:g[3]||(g[3]=T=>b(r)(v.id,v.code))},{default:C(()=>[x(A,{name:b(u)(b(o)(v.id)),class:fe(["size-4",b(l)(b(o)(v.id))])},null,8,["name","class"])]),_:1})]),_:1}),x(E,null,{default:C(()=>[z(D(b(c)(b(o)(v.id))),1)]),_:1})]),_:1}),x(h,{variant:"ghost",size:"iconSm",onClick:y},{default:C(()=>[x(A,{name:"hugeicons:arrow-shrink-02",class:"size-4"})]),_:1})])]),m.value?(_(),k("div",py,[w("pre",fy,[w("code",null,D(v.code),1)])])):(_(),k("div",uy,[a.value?(_(),k("div",cy,D(a.value),1)):i.value?(_(),k("div",{key:1,ref_key:"fullscreenContainerRef",ref:n,class:"flex items-center justify-center [&>svg]:max-w-full [&>svg]:max-h-full",innerHTML:i.value},null,8,dy)):Z("",!0)]))])):Z("",!0)]))],64)}}}),my={class:"flex items-center gap-2 text-muted-foreground chat-text"},gy=X({__name:"BlockMessageLoading",props:{label:{}},setup(e){return(t,s)=>{const n=ye;return _(),k("div",my,[x(n,{name:"hugeicons:loading-03",class:"size-4 animate-spin"}),x(li,null,{default:C(()=>[z(D(t.label||"Generating summary..."),1)]),_:1})])}}}),vy={class:"rounded-xl py-2 text-destructive"},yy=X({__name:"BlockMessageError",props:{message:{}},setup(e){return(t,s)=>(_(),k("div",vy,D(t.message),1))}}),by={key:1,class:"rounded-2xl border bg-muted/40"},xy={class:"overflow-x-auto px-3 py-3 leading-6 chat-code-text"},_y=X({__name:"BlockMessageTool",props:{toolName:{},result:{},getToolComponent:{type:Function}},setup(e){const t=e,s=R(()=>t.getToolComponent(t.toolName)),n=a=>JSON.stringify(a,null,2);return(a,i)=>b(s)?(_(),H(Eo(b(s)),{key:0,data:a.result},null,8,["data"])):(_(),k("div",by,[w("pre",xy,D(n(a.result)),1)]))}}),wy={class:"inline-flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-xs"},Sy={class:"min-w-0 flex-1"},Ty=["href"],Ay={key:1,class:"truncate font-medium text-foreground"},Cy={key:2,class:"ml-2 text-xxs text-muted-foreground"},ky=X({__name:"BlockMessageSource",props:{sourceId:{},url:{},title:{},mediaType:{},filename:{}},setup(e){return(t,s)=>{const n=ye;return _(),k("div",wy,[x(n,{name:t.url?"hugeicons:link-02":"hugeicons:file-02",class:"size-3.5 shrink-0 text-muted-foreground"},null,8,["name"]),w("div",Sy,[t.url?(_(),k("a",{key:0,href:t.url,target:"_blank",rel:"noopener noreferrer",class:"truncate font-medium text-primary hover:underline"},D(t.title||t.url),9,Ty)):(_(),k("span",Ay,D(t.title||t.filename||"Source document"),1)),t.mediaType?(_(),k("span",Cy,D(t.mediaType),1)):Z("",!0)])])}}}),Zr=X({__name:"RadioGroup",props:{modelValue:{},defaultValue:{},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue"],setup(e,{emit:t}){const s=e,n=t,a=R(()=>{const{class:r,...o}=s;return o}),i=Ec(a,n);return(r,o)=>(_(),H(b(gp),Bt({"data-slot":"radio-group",class:b(Da)("grid gap-3",s.class)},b(i)),{default:C(()=>[Qt(r.$slots,"default")]),_:3},16,["class"]))}}),Wr=X({__name:"RadioGroupItem",props:{id:{},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},setup(e){const t=e,s=R(()=>{const{class:a,...i}=t;return i}),n=Pc(s);return(a,i)=>(_(),H(b(xp),Bt({"data-slot":"radio-group-item"},b(n),{class:b(Da)("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t.class)}),{default:C(()=>[x(b(wp),{"data-slot":"radio-group-indicator",class:"relative flex items-center justify-center"},{default:C(()=>[x(b(wd),{class:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})]),_:1})]),_:1},16,["class"]))}}),Ey={key:0,class:"flex items-center gap-2 rounded-xl border border-border/60 bg-muted/30 px-3 py-2"},Py={class:"text-xs text-muted-foreground truncate"},Iy={key:1,class:"rounded-2xl border border-border/70 bg-background/80 overflow-hidden"},My={class:"px-4 pt-4"},Ry={class:"flex items-center justify-between gap-2 mb-2"},Dy={class:"flex items-center gap-2 min-w-0"},Vy=["title"],$y={class:"shrink-0 text-[11px] text-muted-foreground"},Ly={class:"h-0.5 rounded-full bg-muted overflow-hidden"},Oy={class:"px-4 py-3"},Ny={class:"text-sm leading-relaxed"},By={key:0,class:"text-destructive ml-0.5","aria-label":"required"},jy={key:1,class:"flex flex-col gap-3 py-1"},Fy=["value","placeholder"],zy={class:"px-4 pb-4 flex items-center justify-between gap-2"},qy={key:1},Uy={class:"flex items-center gap-1.5"},Gy=X({__name:"BlockMessageQuiz",props:{toolCallId:{},context:{},questions:{}},emits:["submit"],setup(e,{emit:t}){const s=e,n=t,a=K({}),i=K(0),r=K(!1),o=R(()=>s.questions[i.value]),u=R(()=>i.value===s.questions.length-1),l=R(()=>s.questions.every(I=>!I.required||p(I.id))),c=K("");function d(){if(!o.value)return;const I=a.value[o.value.id];c.value=typeof I=="string"?I:""}function p(I){const T=a.value[I];return Array.isArray(T)?T.length>0:!!(T!=null&&T.trim())}function f(I){const T=o.value;if(!T)return!1;const S=a.value[T.id];return T.type==="multiple"?Array.isArray(S)&&S.includes(I):S===I}function m(I){const T=o.value;if(T){if(T.type==="single")a.value={...a.value,[T.id]:I},c.value="";else if(T.type==="multiple"){const S=a.value[T.id]??[],N=S.includes(I)?S.filter($=>$!==I):[...S,I];a.value={...a.value,[T.id]:N}}}}function y(I){const T=o.value;if(!T)return;const S=I.target.value;c.value=S,a.value={...a.value,[T.id]:S}}function v(){i.value>0&&(i.value--,d())}function g(){u.value?M():(i.value++,d())}function A(){u.value?M():(i.value++,d())}function h(){return`[Quiz answers] ${s.questions.filter(T=>p(T.id)).map(T=>{const S=a.value[T.id],N=Array.isArray(S)?S.join(", "):S;return`${T.id}: ${N}`}).join(" | ")}`}function M(){l.value&&(r.value=!0,n("submit",h()))}const E=R(()=>s.questions.filter(I=>p(I.id)).map(I=>{const T=a.value[I.id];return Array.isArray(T)?T.join(", "):T}).join(" · "));return(I,T)=>{var $;const S=ye,N=Ae;return r.value?(_(),k("div",Ey,[x(S,{name:"lucide:check-circle-2",class:"size-3.5 shrink-0 text-primary"}),w("span",Py,[T[2]||(T[2]=w("span",{class:"font-medium text-foreground"},"Answered",-1)),E.value?(_(),k(he,{key:0},[z(" · "+D(E.value),1)],64)):Z("",!0)])])):I.questions.length>0?(_(),k("div",Iy,[w("div",My,[w("div",Ry,[w("div",Dy,[x(b(Ve),{variant:"outline",class:"text-xs px-1"},{default:C(()=>[x(S,{name:"lucide:help-circle",class:"size-3 text-primary"}),T[3]||(T[3]=z(" Clarification "))]),_:1}),I.context?(_(),k("span",{key:0,class:"text-xs text-muted-foreground truncate",title:I.context},D(I.context),9,Vy)):Z("",!0)]),w("span",$y,D(i.value+1)+" / "+D(I.questions.length),1)]),w("div",Ly,[w("div",{class:"h-full rounded-full bg-primary transition-all duration-300",style:es({width:`${(i.value+1)/I.questions.length*100}%`})},null,4)])]),w("div",Oy,[x(ks,{name:"quiz-slide",mode:"out-in"},{default:C(()=>{var U;return[o.value?(_(),k("div",{key:o.value.id,class:"space-y-3"},[w("p",Ny,[z(D(o.value.question)+" ",1),o.value.required?(_(),k("span",By,"*")):Z("",!0)]),(U=o.value.suggestions)!=null&&U.length?(_(),k(he,{key:0},[o.value.type==="single"?(_(),H(b(Zr),{key:0,"model-value":a.value[o.value.id],"onUpdate:modelValue":T[0]||(T[0]=j=>m(String(j))),class:"flex flex-col gap-3 py-1"},{default:C(()=>[(_(!0),k(he,null,Re(o.value.suggestions,j=>(_(),k("div",{key:j,class:"flex items-center space-x-2"},[x(b(Wr),{id:j,value:j},null,8,["id","value"]),x(b(_n),{for:j,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:C(()=>[z(D(j),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"])):o.value.type==="multiple"?(_(),k("div",jy,[(_(!0),k(he,null,Re(o.value.suggestions,j=>(_(),k("div",{key:j,class:"flex items-center space-x-2"},[x(b(_d),{id:j,checked:f(j),"onUpdate:checked":ie=>m(j)},null,8,["id","checked","onUpdate:checked"]),x(b(_n),{for:j,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:C(()=>[z(D(j),1)]),_:2},1032,["for"])]))),128))])):(_(),H(b(Zr),{key:2,"model-value":a.value[o.value.id],"onUpdate:modelValue":T[1]||(T[1]=j=>m(String(j))),class:"flex flex-col gap-3 py-1"},{default:C(()=>[(_(!0),k(he,null,Re(o.value.suggestions,j=>(_(),k("div",{key:j,class:"flex items-center space-x-2"},[x(b(Wr),{id:j,value:j},null,8,["id","value"]),x(b(_n),{for:j,class:"cursor-pointer text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:C(()=>[z(D(j),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"]))],64)):Z("",!0),w("input",{value:c.value,type:"text",class:"w-full rounded-lg border border-border bg-muted/30 px-3 py-1.5 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary/40 focus:border-primary/50 transition-all",placeholder:o.value.type==="open"?"Type your answer…":"Or type a custom answer…",onInput:y},null,40,Fy)])):Z("",!0)]}),_:1})]),w("div",zy,[i.value>0?(_(),H(N,{key:0,variant:"ghost",size:"sm",class:"text-xs h-7",onClick:v},{default:C(()=>[x(S,{name:"lucide:arrow-left",class:"size-3 mr-1"}),T[4]||(T[4]=z(" Back "))]),_:1})):(_(),k("div",qy)),w("div",Uy,[!(($=o.value)!=null&&$.required)&&!u.value?(_(),H(N,{key:0,variant:"ghost",size:"xs",onClick:A},{default:C(()=>T[5]||(T[5]=[z(" Skip ")])),_:1})):Z("",!0),x(N,{size:"xs",disabled:u.value&&!l.value,onClick:g},{default:C(()=>[z(D(u.value?"Submit":"Next")+" ",1),u.value?(_(),H(S,{key:1,name:"lucide:send",class:"size-3 ml-1"})):(_(),H(S,{key:0,name:"lucide:arrow-right",class:"size-3 ml-1"}))]),_:1},8,["disabled"])])])])):Z("",!0)}}}),Hy=Mo(Gy,[["__scopeId","data-v-2b68c703"]]),Zy={class:"flex h-full flex-col bg-sidebar/50 z-50 p-2 gap-2"},Wy={class:"flex shrink-0 items-center justify-between gap-2"},Ky={class:"flex items-center min-w-0 gap-1 flex-1"},Yy={class:"text-xs"},Xy={class:"flex-1 overflow-hidden flex flex-col min-h-0 relative mt-2"},Jy={class:"flex-1 min-h-0 overflow-y-auto w-full relative"},Qy={key:0,class:"absolute inset-0 flex items-center justify-center p-6 z-10"},e0={class:"space-y-2"},t0=["onClick"],s0={class:"min-w-0 flex-1"},n0={class:"text-xs font-medium truncate"},a0={class:"flex items-center gap-2"},i0={class:"min-w-0 flex-1"},r0={class:"flex flex-wrap gap-1.5 text-xs"},o0={class:"flex-1 overflow-y-auto px-4 space-y-4"},l0={key:0,class:"space-y-2"},u0={key:0,class:"bg-muted/50 p-3 rounded-md overflow-x-auto whitespace-pre-wrap font-mono border chat-code-text"},c0={key:1,class:"flex flex-col items-center justify-center p-5 bg-muted/20 rounded-md border border-dashed min-h-[140px]"},d0={key:1,class:"text-sm"},p0={key:2,class:"flex flex-col gap-3 p-3 bg-muted/30 rounded-md border"},f0={class:"text-xs font-medium"},h0={key:0,class:"text-xs text-primary break-all flex items-center gap-1"},m0=["href"],g0={key:1,class:"text-xs text-muted-foreground"},v0={class:"flex gap-2"},y0=X({__name:"AgentAttachmentPanel",props:{messages:{}},emits:["close"],setup(e,{emit:t}){const s=e,n=t,a=R(()=>s.messages),{attachments:i,files:r,codes:o,sources:u}=Du(a),{downloadFile:l}=ui(),c=K("all"),d=T=>({type:"file",id:T.id,name:T.filename,description:"Exported File",icon:"hugeicons:file-02",data:T.result}),p=T=>({type:"source",id:T.id,name:T.title||T.filename||T.url,description:T.url||"Link & Resources",icon:"hugeicons:link-square-02",data:T}),f=T=>({type:"code",id:T.id,name:T.language?`Snippet (${T.language})`:"Snippet",description:"Code Snippet",icon:"hugeicons:code-circle",data:T}),m=R(()=>({all:[...r.value.map(d),...u.value.map(p),...o.value.map(f)],files:r.value.map(d),code:o.value.map(f),links:u.value.map(p)})),y=R(()=>m.value[c.value]||[]),v=K(!1),g=K(null),A=T=>{if(T==null)return"—";if(T<1024)return`${T} B`;const S=["KB","MB","GB","TB"];let N=T/1024,$=0;for(;N>=1024&&$<S.length-1;)N/=1024,$+=1;return`${N.toFixed(N>=10?0:1)} ${S[$]}`},h=R(()=>g.value?g.value.type==="file"?"File":g.value.type==="code"?"Code":"Link":""),M=R(()=>{var T,S;return((T=g.value)==null?void 0:T.type)==="source"&&!!((S=g.value.data)!=null&&S.url)}),E=T=>{g.value=T,v.value=!0},I=async T=>{var S;if(T)if(T.type==="file")await l(T.data);else if(T.type==="code"){const N=T.data.code,$=new Blob([N],{type:"text/plain"}),U=URL.createObjectURL($),j=document.createElement("a");j.href=U,j.download=`snippet-${T.id.substring(0,6)}.${T.data.language||"txt"}`,j.click(),URL.revokeObjectURL(U)}else T.type==="source"&&(S=T.data)!=null&&S.url&&window.open(T.data.url,"_blank","noopener,noreferrer")};return(T,S)=>{const N=ye,$=Rc;return _(),k("div",Zy,[w("div",Wy,[w("div",Ky,[x(N,{name:"hugeicons:attachment",class:"size-4"}),S[6]||(S[6]=w("h3",{class:"text-sm font-semibold text-foreground"},"Attachments",-1)),w("p",Yy,D(b(i).length),1)]),x(b(Ae),{size:"iconMd",variant:"ghost",onClick:S[0]||(S[0]=U=>n("close"))},{default:C(()=>[x(N,{name:"lucide:x",class:"size-4"})]),_:1})]),w("div",Xy,[x(b(Ic),{modelValue:c.value,"onUpdate:modelValue":S[1]||(S[1]=U=>c.value=U),class:"flex-1 min-h-0"},{default:C(()=>[x(b(Mc),{size:"sm"},{default:C(()=>[x(b(Fs),{size:"xs",value:"all",class:"cursor-pointer"},{default:C(()=>S[7]||(S[7]=[z("All")])),_:1}),x(b(Fs),{size:"xs",value:"files",class:"cursor-pointer"},{default:C(()=>S[8]||(S[8]=[z("Files")])),_:1}),x(b(Fs),{size:"xs",value:"code",class:"cursor-pointer"},{default:C(()=>S[9]||(S[9]=[z("Code")])),_:1}),x(b(Fs),{size:"xs",value:"links",class:"cursor-pointer"},{default:C(()=>S[10]||(S[10]=[z("Links")])),_:1})]),_:1}),w("div",Jy,[y.value.length===0?(_(),k("div",Qy,[x($,{title:"No items found",desc:"Add an attachment to see it here."})])):Z("",!0),(_(),k(he,null,Re(["all","files","code","links"],U=>x(b(Dc),{key:U,value:U,class:"h-full mt-0 focus-visible:ring-0"},{default:C(()=>[w("div",e0,[(_(!0),k(he,null,Re(m.value[U],j=>(_(),k("div",{key:j.id,class:"p-2 px-3 border rounded-lg bg-card hover:bg-accent/50 transition-colors flex items-center gap-2 cursor-pointer group",onClick:ie=>E(j)},[x(N,{name:j.icon,class:"size-5!"},null,8,["name"]),w("div",s0,[w("p",n0,D(j.name),1),w("p",{class:fe(["text-xxs text-muted-foreground truncate",j.type==="source"?"text-primary/70":""])},D(j.description),3)]),x(N,{name:"hugeicons:view",class:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground"})],8,t0))),128))])]),_:2},1032,["value"])),64))])]),_:1},8,["modelValue"])]),x(b(Vc),{open:v.value,"onUpdate:open":S[5]||(S[5]=U=>v.value=U)},{default:C(()=>[x(b($c),{class:"max-w-[50vw]! w-full max-h-[70vh] p-0 flex flex-col overflow-hidden"},{default:C(()=>{var U,j,ie;return[x(b(Lc),{class:"p-4 pb-2 text-left"},{default:C(()=>{var P;return[w("div",a0,[x(N,{name:((P=g.value)==null?void 0:P.icon)||"hugeicons:file-02",class:"size-5!"},null,8,["name"]),w("div",i0,[x(b(Oc),{class:"truncate flex items-center gap-2"},{default:C(()=>{var O,q,J,ee,G,te;return[z(D(((O=g.value)==null?void 0:O.name)||"Attachment Preview")+" ",1),w("div",r0,[x(b(Ve),{variant:"secondary",class:"h-5 px-1.5"},{default:C(()=>[z(D(h.value),1)]),_:1}),((q=g.value)==null?void 0:q.type)==="file"?(_(),H(b(Ve),{key:0,variant:"outline",class:"h-5 px-1.5"},{default:C(()=>[z(D(g.value.data.format||"file"),1)]),_:1})):Z("",!0),((J=g.value)==null?void 0:J.type)==="file"?(_(),H(b(Ve),{key:1,variant:"outline",class:"h-5 px-1.5"},{default:C(()=>[z(D(A(g.value.data.fileSize)),1)]),_:1})):Z("",!0),((ee=g.value)==null?void 0:ee.type)==="code"?(_(),H(b(Ve),{key:2,variant:"outline",class:"h-5 px-1.5"},{default:C(()=>[z(D(g.value.data.language||"text"),1)]),_:1})):Z("",!0),((G=g.value)==null?void 0:G.type)==="source"&&((te=g.value.data)!=null&&te.mediaType)?(_(),H(b(Ve),{key:3,variant:"outline",class:"h-5 px-1.5"},{default:C(()=>[z(D(g.value.data.mediaType),1)]),_:1})):Z("",!0)])]}),_:1}),x(b(Nc),{class:"text-sm"},{default:C(()=>S[11]||(S[11]=[z(" Preview attachment details and content. ")])),_:1})])])]}),_:1}),w("div",o0,[((U=g.value)==null?void 0:U.type)==="file"?(_(),k("div",l0,[g.value.data.encoding==="utf8"?(_(),k("div",u0,D(g.value.data.content),1)):(_(),k("div",c0,[x(N,{name:"hugeicons:file-unknown",class:"size-12 text-muted-foreground/50 mb-3"}),S[12]||(S[12]=w("p",{class:"text-foreground text-sm font-medium"}," Binary file format ",-1)),S[13]||(S[13]=w("p",{class:"text-xs text-muted-foreground text-center mt-1"}," Preview is not available for this file type. Download to view. ",-1))]))])):((j=g.value)==null?void 0:j.type)==="code"?(_(),k("div",d0,[x(b(gn),{id:g.value.data.id,code:g.value.data.code,language:g.value.data.language,"is-streaming":!1,"is-block-streaming":!1},null,8,["id","code","language"])])):((ie=g.value)==null?void 0:ie.type)==="source"?(_(),k("div",p0,[w("div",null,[S[14]||(S[14]=w("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," Title ",-1)),w("p",f0,D(g.value.data.title||g.value.data.filename||"Untitled Resource"),1)]),w("div",null,[S[15]||(S[15]=w("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," URL ",-1)),g.value.data.url?(_(),k("p",h0,[w("a",{href:g.value.data.url,target:"_blank",class:"hover:underline"},D(g.value.data.url),9,m0),x(N,{name:"hugeicons:link-square-02",class:"size-3 shrink-0"})])):(_(),k("p",g0," No URL provided. "))])])):Z("",!0)]),x(b(Bc),{class:"p-4 flex justify-end pt-0"},{default:C(()=>{var P;return[x(b(Ae),{variant:"outline",size:"sm",onClick:S[2]||(S[2]=O=>v.value=!1)},{default:C(()=>S[16]||(S[16]=[z(" Close ")])),_:1}),w("div",v0,[((P=g.value)==null?void 0:P.type)==="source"?(_(),H(b(Ae),{key:0,size:"sm",disabled:!M.value,onClick:S[3]||(S[3]=O=>I(g.value))},{default:C(()=>[S[17]||(S[17]=z(" Open Link ")),x(N,{name:"hugeicons:link-square-02",class:"size-3 ml-2"})]),_:1},8,["disabled"])):(_(),H(b(Ae),{key:1,size:"sm",onClick:S[4]||(S[4]=O=>I(g.value))},{default:C(()=>[S[18]||(S[18]=z(" Download ")),x(N,{name:"hugeicons:download-04",class:"size-3"})]),_:1}))])]}),_:1})]}),_:1})]),_:1},8,["open"])])}}}),ga=[{id:"generate-query",label:"Generate Query",toolName:"generate_query",category:"SQL",description:"Turn a natural language request into SQL for the active schema.",insertText:"Generate SQL for ",icon:"hugeicons:ai-brain-03",promptHint:"The user wants help drafting SQL from natural language. Prefer generate_query first and keep the response focused on producing or refining SQL."},{id:"render-table",label:"Render Table",toolName:"render_table",category:"Execution",description:"Run a read-only SQL query and show the result rows as a table.",insertText:"Run this query and show the table result for ",icon:"hugeicons:table-01",promptHint:"The user expects concrete table output. After generating or receiving read-only SQL, prefer render_table and summarize the returned rows briefly."},{id:"visualize-table",label:"Visualize Table",toolName:"visualize_table",category:"Charts",description:"Build a bar, line, pie, or scatter chart from a read-only query.",insertText:"Visualize this data as a bar, line, pie, or scatter chart for ",icon:"hugeicons:chart-line-data-01",promptHint:"The user wants a chart-oriented answer. Prefer visualize_table for read-only SQL, and ask for the chart type only if it is still missing."},{id:"describe-table",label:"Describe Table",toolName:"describe_table",category:"Schema",description:"Inspect columns, keys, relationships, and table structure.",insertText:"Describe the structure of table ",icon:"hugeicons:database",promptHint:"The user is asking about schema shape, keys, or relationships. Prefer describe_table when a specific table is involved."},{id:"explain-query",label:"Explain Query",toolName:"explain_query",category:"Performance",description:"Analyze a query plan and explain possible performance issues.",insertText:"Explain why this query is slow: ",icon:"hugeicons:activity-02",promptHint:"The user is focused on query performance. Prefer explain_query once a concrete SQL statement is available."},{id:"detect-anomaly",label:"Detect Anomaly",toolName:"detect_anomaly",category:"Quality",description:"Scan for nulls, duplicates, orphaned keys, and outlier values.",insertText:"Detect anomalies in table ",icon:"hugeicons:search-list-01",promptHint:"The user wants data quality checks. Prefer detect_anomaly for table-level validation and summarize the findings with severity."}],Vu=e=>{const t=new Set(e);return ga.filter(s=>t.has(s.id))},b0={class:"w-full relative"},x0={key:0,class:"absolute bottom-[calc(100%+8px)] left-4 right-4 z-50 overflow-hidden rounded-2xl border border-border/80 bg-background shadow-lg"},_0=["id","aria-selected","onMouseenter","onClick"],w0={class:"min-w-0 flex-1"},S0={class:"flex items-center gap-2"},T0={class:"text-xs font-medium text-foreground"},A0={class:"mt-1 block text-xs text-muted-foreground"},C0={key:0,class:"rounded-xl px-3 py-5 text-center text-[11px] text-muted-foreground"},k0={class:"dark:bg-sidebar rounded-3xl border shadow-xs p-3 px-2 pb-2 flex flex-col gap-1 relative z-40"},E0={key:0,class:"flex flex-wrap gap-2 pb-1"},P0=["aria-label","onClick"],I0={class:"flex items-center justify-between px-1"},M0={class:"flex items-center gap-1"},R0={class:"relative w-fit"},D0={class:"flex items-center gap-3"},Ks="agent-command-listbox",Kr="agent-command-status",V0=X({__name:"AgentChatInput",props:{modelValue:{},isLoading:{type:Boolean},hasApiKey:{type:Boolean},provider:{},model:{},selectedCommandOptions:{}},emits:["update:modelValue","update:provider","update:model","update:selectedCommandOptions","submit","stop","keydown"],setup(e,{expose:t,emit:s}){const n=e,a=s,i=K(n.modelValue),r=K(0),o=K("");Te(()=>n.modelValue,P=>{i.value=P});const u=K(null),l=R({get:()=>n.selectedCommandOptions,set:P=>a("update:selectedCommandOptions",P)}),c=R(()=>Vu(l.value)),d=()=>{const P=u.value;if(!P)return null;if(P instanceof HTMLTextAreaElement)return P;if(typeof P=="object"&&"$el"in P&&P.$el instanceof HTMLElement){const O=P.$el;return O instanceof HTMLTextAreaElement?O:O.querySelector("textarea")}return P instanceof HTMLElement?P.querySelector("textarea"):null},p=()=>{const P=d();P==null||P.focus()};t({focusInput:p});const f=R(()=>{const P=d(),O=(P==null?void 0:P.selectionStart)??i.value.length;return i.value.slice(0,O).match(/(?:^|\s)\/([a-z0-9_-]*)$/i)}),m=R(()=>{var P,O;return((O=(P=f.value)==null?void 0:P[1])==null?void 0:O.toLowerCase())||""}),y=R(()=>f.value?f.value[0]:""),v=R(()=>{const P=m.value.trim();return f.value?P?ga.filter(O=>[O.label,O.toolName,O.description,O.category].join(" ").toLowerCase().includes(P)):ga:[]}),g=R(()=>!!f.value&&y.value!==o.value),A=R(()=>v.value[r.value]||null),h=R(()=>g.value?v.value.length===0?"No matching agent tools. Keep typing to filter or press Escape to close.":`${v.value.length} agent tools available. Use arrow keys to move, Enter or Tab to insert, and Escape to close.`:"");Te(v,P=>{if(P.length===0){r.value=0;return}r.value>=P.length&&(r.value=0)}),Te(y,P=>{P||(o.value="")});const M=P=>{const O=P.target.value;i.value=O,o.value&&o.value!==y.value&&(o.value=""),a("update:modelValue",O)},E=async()=>{o.value=y.value,r.value=0,await Ye(),p()},I=P=>{l.value.includes(P.id)||(l.value=[...l.value,P.id])},T=P=>{l.value=l.value.filter(O=>O!==P)},S=async P=>{const O=d(),q=(O==null?void 0:O.selectionStart)??i.value.length,J=i.value.slice(0,q),ee=i.value.slice(q);if(!J.match(/(?:^|\s)\/([a-z0-9_-]*)$/i))return;const te=J.lastIndexOf("/"),se=i.value.slice(0,te);let ne=`${se}${ee}`;se.trim()||(ne=ne.trimStart());const Se=Math.min(se.length,ne.length);i.value=ne,a("update:modelValue",ne),I(P),r.value=0,o.value="",await Ye();const ge=d();ge==null||ge.focus(),ge==null||ge.setSelectionRange(Se,Se)},N=P=>{if(g.value){if(P.key==="Escape"){P.preventDefault(),E();return}if(v.value.length>0){if(P.key==="ArrowDown"){P.preventDefault(),r.value=(r.value+1)%v.value.length;return}if(P.key==="ArrowUp"){P.preventDefault(),r.value=(r.value-1+v.value.length)%v.value.length;return}if(P.key==="Home"){P.preventDefault(),r.value=0;return}if(P.key==="End"){P.preventDefault(),r.value=v.value.length-1;return}if(P.key==="Enter"||P.key==="Tab"){P.preventDefault();const O=A.value;O&&S(O);return}}}a("keydown",P)},$=P=>{P==null||P.preventDefault(),a("submit",typeof P=="object"&&P!==null?P:void 0)},U=P=>{if(n.isLoading){P==null||P.preventDefault(),a("stop");return}$(P)},j=R({get:()=>n.provider,set:P=>a("update:provider",P)}),ie=R({get:()=>n.model,set:P=>a("update:model",P)});return(P,O)=>{const q=ye,J=xd,ee=Ae;return _(),k("div",b0,[g.value?(_(),k("div",x0,[O[4]||(O[4]=w("div",{class:"border-b border-border/50 px-3 py-2"},[w("p",{class:"text-xs font-medium"},"Agent tools"),w("p",{class:"mt-1 text-xs text-muted-foreground"},[z(" Type after "),w("span",{class:"font-medium text-foreground"},"/"),z(" to filter. ")])],-1)),w("div",{id:Ks,role:"listbox","aria-label":"Agent tools",class:"max-h-[260px] overflow-y-auto px-2 py-2"},[(_(!0),k(he,null,Re(v.value,(G,te)=>(_(),k("button",{id:`${Ks}-${G.id}`,key:G.id,type:"button",role:"option","aria-selected":te===r.value,class:fe(["mt-0.5 flex w-full items-start gap-2 rounded-xl px-3 py-2 text-left transition-colors first:mt-0 cursor-pointer",te===r.value?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"]),onMouseenter:se=>r.value=te,onClick:se=>S(G)},[x(q,{name:G.icon,class:"mt-0.5 size-[18px] shrink-0"},null,8,["name"]),w("span",w0,[w("span",S0,[w("span",T0,D(G.label),1)]),w("span",A0,D(G.description),1)]),w("div",null,[c.value.find(se=>se.id===G.id)?(_(),H(q,{key:0,name:"hugeicons:checkmark-circle-01",class:"size-4 mt-0.5 text-muted-foreground cursor-pointer"})):Z("",!0)])],42,_0))),128)),v.value.length===0?(_(),k("div",C0,O[3]||(O[3]=[z(" No matching tools. Try "),w("span",{class:"font-medium text-foreground"},"/render",-1),z(" or "),w("span",{class:"font-medium text-foreground"},"/describe",-1),z(". ")]))):Z("",!0)])])):Z("",!0),w("div",k0,[c.value.length>0?(_(),k("div",E0,[(_(!0),k(he,null,Re(c.value,G=>(_(),k("div",{key:G.id,class:"inline-flex items-center gap-1 rounded-full border border-border/70 bg-muted/40 px-1.5 py-0.5 text-xs text-foreground"},[x(q,{name:G.icon,class:"size-3.5 text-muted-foreground"},null,8,["name"]),w("span",null,D(G.label),1),w("button",{type:"button",class:"inline-flex size-4 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-background hover:text-foreground","aria-label":`Remove ${G.label}`,onClick:te=>T(G.id)},[x(q,{name:"lucide:x",class:"size-3"})],8,P0)]))),128))])):Z("",!0),x(J,{ref_key:"textareaRef",ref:u,modelValue:i.value,"onUpdate:modelValue":O[0]||(O[0]=G=>i.value=G),disabled:!P.hasApiKey||P.isLoading,placeholder:"Ask Orca anythink, / for agent tools",class:"w-full bg-transparent! outline-none border-0 shadow-none focus-visible:ring-0 placeholder:text-muted-foreground resize-none px-2 pt-0 min-h-12 max-h-36 text-sm","aria-autocomplete":"list","aria-controls":g.value?Ks:void 0,"aria-describedby":Kr,"aria-activedescendant":A.value?`${Ks}-${A.value.id}`:void 0,"aria-expanded":g.value,onInput:M,onKeydown:N},null,8,["modelValue","disabled","aria-controls","aria-activedescendant","aria-expanded"]),w("p",{id:Kr,class:"sr-only","aria-live":"polite"},D(h.value),1),w("div",I0,[w("div",M0,[w("div",R0,[x(jc,{provider:j.value,"onUpdate:provider":O[1]||(O[1]=G=>j.value=G),model:ie.value,"onUpdate:model":O[2]||(O[2]=G=>ie.value=G),class:"h-7! border-0 bg-transparent hover:bg-muted rounded-lg shadow-none px-2! text-xs text-muted-foreground hover:text-foreground cursor-pointer"},null,8,["provider","model"])])]),w("div",D0,[x(ee,{size:"iconMd",type:"button",class:"rounded-full shadow bg-foreground text-background hover:bg-foreground disabled disabled:bg-muted disabled:text-muted-foreground",disabled:!i.value.trim()&&!P.isLoading||!P.hasApiKey,onClick:U},{default:C(()=>[x(q,{name:P.isLoading?"lucide:square":"lucide:arrow-up",class:fe(["size-4 stroke-[2]",P.isLoading?"fill-current":""])},null,8,["name","class"])]),_:1},8,["disabled"])])])])])}}}),$0={class:"flex items-center justify-between px-4 mt-2 text-[12px] text-muted-foreground relative z-30"},L0={class:"flex items-center gap-4"},O0={class:"flex items-center gap-1"},N0={class:"flex items-center gap-1.5"},B0={class:"flex items-center gap-1.5"},j0=X({__name:"AgentChatStatusBar",props:{modelLabel:{},isLoading:{type:Boolean},showReasoning:{type:Boolean}},emits:["update:showReasoning"],setup(e,{emit:t}){const s=t;return(n,a)=>{const i=ye,r=Fc;return _(),k("div",$0,[w("div",L0,[w("div",O0,[x(i,{name:"hugeicons:ai-brain-05",class:"size-3.5 stroke-[1.5]"}),a[1]||(a[1]=w("span",null,"Reasoning",-1)),x(r,{"model-value":n.showReasoning,"aria-label":"Toggle reasoning",class:"cursor-pointer","onUpdate:modelValue":a[0]||(a[0]=o=>s("update:showReasoning",!!o))},null,8,["model-value"])]),w("div",N0,[x(i,{name:"hugeicons:robotic",class:"size-3.5 stroke-[1.5]"}),w("span",null,D(n.modelLabel),1)])]),w("div",B0,[x(i,{name:n.isLoading?"hugeicons:loading-03":"hugeicons:checkmark-circle-01",class:fe(["size-3.5 stroke-[1.5]",n.isLoading?"animate-spin":""])},null,8,["name","class"]),w("span",null,D(n.isLoading?"Streaming":"Ready"),1)])])}}}),F0={class:"w-full py-2"},z0={class:"relative w-full max-w-3xl mx-auto flex flex-col px-4"},q0={key:0,class:"absolute -top-12 left-1/2 transform -translate-x-1/2 z-20"},U0=X({__name:"AgentChatFooter",props:{modelValue:{},isLoading:{type:Boolean},hasApiKey:{type:Boolean},provider:{},model:{},selectedCommandOptions:{},showReasoning:{type:Boolean},showScrollButton:{type:Boolean}},emits:["update:modelValue","update:provider","update:model","update:selectedCommandOptions","update:showReasoning","submit","stop","keydown","scrollToBottom"],setup(e,{expose:t,emit:s}){const n=e,a=s,i=R({get:()=>n.modelValue,set:p=>a("update:modelValue",p)}),r=R({get:()=>n.provider,set:p=>a("update:provider",p)}),o=R({get:()=>n.model,set:p=>a("update:model",p)}),u=R({get:()=>n.selectedCommandOptions,set:p=>a("update:selectedCommandOptions",p)}),l=R(()=>`${n.provider} / ${n.model}`),c=K(null);return t({focusInput:()=>{var p;(p=c.value)==null||p.focusInput()}}),(p,f)=>(_(),k("footer",F0,[w("div",z0,[x(ks,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"opacity-0 translate-y-4","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition-all duration-200 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 translate-y-4"},{default:C(()=>[p.showScrollButton?(_(),k("div",q0,[w("button",{class:"flex items-center justify-center size-8 bg-background border border-border rounded-full shadow-sm text-muted-foreground hover:bg-muted/50 cursor-pointer outline-none transition-colors",onClick:f[0]||(f[0]=m=>a("scrollToBottom"))},[x(b(ye),{name:"lucide:arrow-down",class:"size-4 shrink-0"})])])):Z("",!0)]),_:1}),x(V0,{ref_key:"inputRef",ref:c,modelValue:i.value,"onUpdate:modelValue":f[1]||(f[1]=m=>i.value=m),provider:r.value,"onUpdate:provider":f[2]||(f[2]=m=>r.value=m),model:o.value,"onUpdate:model":f[3]||(f[3]=m=>o.value=m),"selected-command-options":u.value,"onUpdate:selectedCommandOptions":f[4]||(f[4]=m=>u.value=m),"is-loading":p.isLoading,"has-api-key":p.hasApiKey,onSubmit:f[5]||(f[5]=m=>a("submit",m)),onStop:f[6]||(f[6]=m=>a("stop")),onKeydown:f[7]||(f[7]=m=>a("keydown",m))},null,8,["modelValue","provider","model","selected-command-options","is-loading","has-api-key"]),x(j0,{"model-label":l.value,"is-loading":p.isLoading,"show-reasoning":p.showReasoning,"onUpdate:showReasoning":f[8]||(f[8]=m=>a("update:showReasoning",m))},null,8,["model-label","is-loading","show-reasoning"])])]))}}),G0={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},H0={class:"flex flex-wrap items-center gap-2"},Z0={key:0,class:"rounded-2xl border bg-background/80 px-3 py-3 text-sm"},W0={key:1,class:"space-y-3"},K0={class:"flex flex-wrap items-center gap-2"},Y0={key:0,class:"text-xs text-muted-foreground"},X0={class:"mt-3 text-sm leading-6"},J0={key:0,class:"mt-3 rounded-xl border bg-muted/30"},Q0={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},eb=X({__name:"AgentAnomalyBlock",props:{data:{}},setup(e){const t={high:"destructive",medium:"secondary",low:"outline"},s=n=>t[n];return(n,a)=>{const i=Ve;return _(),k("div",G0,[w("div",H0,[x(i,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:C(()=>[z(" Clean Score "+D(n.data.cleanScore)+"/100 ",1)]),_:1}),x(i,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:C(()=>[z(D(n.data.scannedRows)+" rows scanned ",1)]),_:1})]),n.data.issues.length===0?(_(),k("div",Z0," No anomalies were detected in the requested checks. ")):(_(),k("div",W0,[(_(!0),k(he,null,Re(n.data.issues,(r,o)=>(_(),k("div",{key:`${r.type}-${r.column||o}`,class:"rounded-2xl border bg-background/90 p-3"},[w("div",K0,[x(i,{variant:s(r.severity),class:"text-xxs tracking-[0.16em]"},{default:C(()=>[z(D(r.severity.toUpperCase()),1)]),_:2},1032,["variant"]),x(i,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:C(()=>[z(D(r.type),1)]),_:2},1024),r.column?(_(),k("span",Y0,D(r.column),1)):Z("",!0)]),w("p",X0,D(r.description),1),r.fixSql?(_(),k("details",J0,[a[0]||(a[0]=w("summary",{class:"cursor-pointer px-3 py-2 text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground"}," Fix suggestion ",-1)),w("pre",Q0,D(r.fixSql),1)])):Z("",!0)]))),128))]))])}}}),tb={class:"space-y-2"},sb={class:"flex flex-wrap justify-start gap-2"},nb=X({__name:"AgentApprovalBlock",props:{toolName:{},input:{},approvalId:{}},emits:["approve","deny"],setup(e,{emit:t}){const s=e,n=t,a=R(()=>"sql"in s.input&&typeof s.input.sql=="string"?s.input.sql:JSON.stringify(s.input,null,2));return(i,r)=>{const o=gn,u=Ae;return _(),k("div",tb,[r[4]||(r[4]=w("div",{class:""},[w("div",{class:"text-xs font-medium"},"Approval Required"),w("p",{class:"text-xs text-muted-foreground"}," *This action needs confirmation before execution. ")],-1)),x(o,{id:s.approvalId,code:b(a)||"",language:"sql"},null,8,["id","code"]),w("div",sb,[x(u,{variant:"outline",size:"xs",class:"rounded-xl font-normal",onClick:r[0]||(r[0]=l=>n("deny",i.approvalId))},{default:C(()=>r[2]||(r[2]=[z(" Cancel ")])),_:1}),x(u,{size:"xs",class:"rounded-xl font-normal",onClick:r[1]||(r[1]=l=>n("approve",i.approvalId))},{default:C(()=>r[3]||(r[3]=[z(" Confirm ")])),_:1})])])}}}),ab={class:"flex items-start justify-between gap-3"},ib={class:"space-y-2 min-w-0"},rb={class:"flex items-center gap-2"},ob={class:"text-sm font-medium"},lb={class:"text-sm leading-6"},ub={key:0,class:"space-y-2"},cb={class:"flex flex-wrap gap-1"},Fn=X({__name:"AgentDescribeBlock",props:{data:{}},setup(e){const t=e,s=R(()=>[["name","Name"],["type","Type"],["nullable","Nullable"],["pk","PK"],["fk","FK"],["references","References"],["description","Description"]].map(([o,u])=>({originalName:o,queryFieldName:o,aliasFieldName:u,isPrimaryKey:!1,isForeignKey:!1,canMutate:!1,type:"text",tableName:""}))),n=R(()=>t.data.columns.map(o=>({name:o.name,type:o.type,nullable:o.isNullable?"Yes":"No",pk:o.isPrimaryKey?"Yes":"No",fk:o.isForeignKey?"Yes":"No",references:o.referencesTable||"—",description:o.description||"—"}))),a=R(()=>La({columns:s.value,rows:n.value,columnKeyBy:"field",hasHashIndex:!1})),i=R(()=>Oa(n.value,!1)),r=R(()=>{const d=48+n.value.length*32;return Math.max(120,Math.min(d,360))});return(o,u)=>{const l=ye,c=Ve,d=Ba;return _(),k(he,null,[w("div",ab,[w("div",ib,[w("div",rb,[x(l,{name:"hugeicons:grid-table",class:"size-4 text-primary"}),w("div",ob,D(o.data.tableName),1)]),w("p",lb,D(o.data.summary),1)]),x(c,{variant:"outline",class:"shrink-0"},{default:C(()=>[z(D(o.data.columns.length)+" columns ",1)]),_:1})]),w("div",{class:"overflow-hidden rounded-lg border",style:es({height:`${b(r)}px`})},[x(d,{"column-defs":b(a),"row-data":b(i),"column-types":b(Na),class:"h-full w-full"},null,8,["column-defs","row-data","column-types"])],4),o.data.relatedTables.length>0?(_(),k("div",ub,[u[0]||(u[0]=w("div",{class:"text-[11px] font-medium text-muted-foreground"}," Related Tables ",-1)),w("div",cb,[(_(!0),k(he,null,Re(o.data.relatedTables,p=>(_(),H(c,{key:p,variant:"outline",class:"text-xxs"},{default:C(()=>[z(D(p),1)]),_:2},1024))),128))])])):Z("",!0)],64)}}});function db(e){return e.nodes.map(t=>({id:t.id,schema:t.schemaName,table:t.tableName,rows:0,type:"table",comment:null,columns:t.columns.map((s,n)=>({name:s.name,ordinal_position:n+1,short_type_name:s.type,type:s.type,character_maximum_length:null,precision:null,nullable:!s.isPrimaryKey,default:null,collation:null,comment:null})),foreign_keys:e.edges.filter(s=>s.source===t.id).map(s=>{const[n,a]=s.target.split(".");return{foreign_key_name:s.id,column:s.sourceColumn,reference_schema:n,reference_table:a,reference_column:s.targetColumn,fk_def:""}}),primary_keys:t.columns.filter(s=>s.isPrimaryKey).map(s=>({column:s.name,pk_def:""})),indexes:[]}))}const pb={class:"space-y-2"},fb={class:"flex items-center justify-between"},hb={class:"flex items-center gap-2"},mb={key:0,class:"fixed inset-0 z-50 bg-background flex flex-col"},gb={class:"flex items-center justify-between px-4 py-2 border-b border-border"},vb={class:"flex items-center gap-2"},yb={class:"flex-1 relative"},bb=X({__name:"AgentErdBlock",props:{data:{}},setup(e){const t=e,s=R(()=>db(t.data)),n=R(()=>Sd(s.value)),a=R(()=>{const l={};for(const c of n.value.nodes)l[c.id]=c.position;return l}),i=R(()=>{const c=Math.max(...t.data.nodes.map(d=>d.columns.length),3)*zc+qc+120;return Math.max(300,Math.min(c,500))}),r=K(!1),o=K(!1),u=()=>{r.value=!r.value,r.value||(o.value=!1)};return(l,c)=>{const d=ye,p=Ve,f=Ae;return _(),k("div",pb,[w("div",fb,[w("div",hb,[x(d,{name:"hugeicons:hierarchy-square-01",class:"size-4 text-primary"}),c[1]||(c[1]=w("span",{class:"text-sm font-medium"}," Entity Relationship Diagram ",-1)),x(p,{variant:"outline",class:"text-xs"},{default:C(()=>[z(D(l.data.nodes.length)+" tables ",1)]),_:1})]),x(f,{variant:"ghost",size:"iconSm",onClick:u},{default:C(()=>[x(d,{name:r.value?"hugeicons:arrow-shrink-02":"hugeicons:arrow-expand-02"},null,8,["name"])]),_:1})]),r.value?Z("",!0):(_(),k("div",{key:0,class:"overflow-hidden rounded-lg border border-border/70",style:es({height:`${i.value}px`})},[x(b(kd),{class:"erd-flow w-full h-full","pan-on-scroll":!0,"pan-on-scroll-speed":1.2,nodes:n.value.nodes,edges:n.value.edges,"default-viewport":{zoom:b(Hc),x:40,y:40},"min-zoom":b(Gc),"max-zoom":b(Uc),"fit-view-on-init":""},{"edge-custom":C(m=>[x(Cd,bi(xi(m)),null,16)]),"node-value":C(m=>[x(Ad,bi(xi(m)),null,16)]),default:C(()=>[x(b(Td),{size:2,gap:30})]),_:1},8,["nodes","edges","default-viewport","min-zoom","max-zoom"])],4)),(_(),H(Io,{to:"body"},[r.value?(_(),k("div",mb,[w("div",gb,[w("div",vb,[x(d,{name:"hugeicons:hierarchy-square-01",class:"size-4 text-primary"}),c[2]||(c[2]=w("span",{class:"text-sm font-medium"}," Entity Relationship Diagram ",-1)),x(p,{variant:"outline",class:"text-xs"},{default:C(()=>[z(D(l.data.nodes.length)+" tables ",1)]),_:1})]),x(f,{variant:"ghost",size:"iconSm",onClick:u},{default:C(()=>[x(d,{name:"hugeicons:arrow-shrink-02"})]),_:1})]),w("div",yb,[x(Ed,{nodes:n.value.nodes,edges:n.value.edges,matrixTablePosition:a.value,tables:s.value,isShowFilter:o.value,"onUpdate:isShowFilter":c[0]||(c[0]=m=>o.value=m)},null,8,["nodes","edges","matrixTablePosition","tables","isShowFilter"])])])):Z("",!0)]))])}}}),xb={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},_b={class:"flex flex-wrap items-center gap-2"},wb={class:"text-sm leading-6 text-foreground/90"},Sb={key:0,class:"space-y-2"},Tb={class:"space-y-2 text-sm leading-6"},Ab={class:"rounded-2xl border bg-background/90"},Cb={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},kb=X({__name:"AgentExplainBlock",props:{data:{}},setup(e){return(t,s)=>{const n=Ve;return _(),k("div",xb,[w("div",_b,[x(n,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:C(()=>[z(D(t.data.slowestNode),1)]),_:1}),x(n,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:C(()=>[z(" Cost "+D(t.data.estimatedCost.toFixed(2)),1)]),_:1})]),w("p",wb,D(t.data.summary),1),t.data.suggestions.length>0?(_(),k("div",Sb,[s[0]||(s[0]=w("div",{class:"text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground"}," Suggestions ",-1)),w("ul",Tb,[(_(!0),k(he,null,Re(t.data.suggestions,a=>(_(),k("li",{key:a,class:"rounded-2xl border bg-background/80 px-3 py-2"},D(a),1))),128))])])):Z("",!0),w("details",Ab,[s[1]||(s[1]=w("summary",{class:"cursor-pointer px-3 py-2 text-sm font-medium"}," Raw EXPLAIN output ",-1)),w("pre",Cb,D(t.data.rawPlan),1)])])}}}),Eb=["disabled"],Pb={class:"flex items-center min-w-0 gap-2 flex-1"},Ib={class:"flex flex-col"},Mb={class:"truncate text-sm leading-4 font-normal text-foreground"},Rb={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},Db={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},Yr=X({__name:"AgentExportFileBlock",props:{data:{}},setup(e){const t=e,s=Ao("activeExportPreview"),{downloadFile:n}=ui(),a=()=>{s&&(s.value=t.data)};R(()=>{switch(t.data.format){case"json":return"lucide:braces";case"sql":return"lucide:database";case"markdown":return"lucide:file-text";case"xml":return"lucide:code-xml";case"yaml":return"lucide:settings-2";case"html":return"lucide:globe";case"tsv":case"csv":return"lucide:table-2";case"txt":return"lucide:file";default:return"lucide:file-text"}});const i=R(()=>{const o=t.data.fileSize;return Ro(o)});R(()=>t.data.error?t.data.error:"Preview available before download");const r=async()=>{await n(t.data)};return(o,u)=>{const l=ye,c=Ae;return _(),k("button",{type:"button",class:fe(["flex w-full items-center gap-2 rounded-xl border border-border/70 bg-muted/20 p-4 text-left transition-colors hover:bg-muted/35",t.data.error?"cursor-not-allowed opacity-80":"cursor-pointer"]),disabled:!!t.data.error,onClick:a},[w("div",Pb,[x(l,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),w("div",Ib,[w("h3",Mb,D(t.data.filename),1),t.data.preview.truncated?(_(),k("p",Rb," First "+D(t.data.preview.rows.length)+" rows ",1)):(_(),k("p",Db," size: "+D(i.value)+" • type: "+D(t.data.format),1))])]),x(c,{disabled:!!t.data.error,size:"xs",variant:"outline"},{default:C(()=>[u[0]||(u[0]=z(" view ")),x(l,{name:"lucide:eye",class:"size-3"})]),_:1},8,["disabled"]),x(c,{onClick:Ia(r,["stop"]),disabled:!!t.data.error,size:"xs",variant:"outline"},{default:C(()=>[u[1]||(u[1]=z(" Download ")),x(l,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"])],10,Eb)}}}),Vb={class:"overflow-hidden mb-1"},$b={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},Lb={class:"my-1"},di=X({__name:"AgentToolSqlPreview",props:{id:{},sql:{},label:{default:"View SQL"},defaultOpen:{type:Boolean,default:!1}},setup(e){const t=e,s=K(!1);function n(r){const o=r;o.style.height="0",o.style.opacity="0",requestAnimationFrame(()=>{o.style.height=o.scrollHeight+"px",o.style.opacity="1"})}function a(r){r.style.height="auto"}function i(r){const o=r;o.style.height=o.scrollHeight+"px",o.style.opacity="1",requestAnimationFrame(()=>{o.style.height="0",o.style.opacity="0"})}return(r,o)=>{const u=ye,l=gn;return _(),k("div",Vb,[w("button",{type:"button",class:"flex cursor-pointer items-center justify-start gap-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",onClick:o[0]||(o[0]=c=>s.value=!b(s))},[z(D(t.label)+" ",1),x(u,{name:"lucide:chevron-down",class:fe(["ml-auto size-4 transition-transform duration-300",{"rotate-180":b(s)}])},null,8,["class"])]),x(ks,{onEnter:n,onAfterEnter:a,onLeave:i},{default:C(()=>[b(s)?(_(),k("div",$b,[w("div",Lb,[x(l,{id:t.id,code:t.sql,language:"sql"},null,8,["id","code"])])])):Z("",!0)]),_:1})])}}}),Ob={class:"space-y-3 rounded-xl border border-border/70 bg-muted/20 p-4"},Nb={class:"flex items-start justify-between gap-3"},Bb={class:"text-sm leading-6 text-foreground/90"},jb=X({__name:"AgentQueryBlock",props:{data:{}},setup(e){const t=e,s=R(()=>`agent-query-${t.data.sql}`);return(n,a)=>{const i=Ve;return _(),k("div",Ob,[w("div",Nb,[w("p",Bb,D(n.data.explanation),1),x(i,{variant:n.data.isMutation?"destructive":"secondary",class:"shrink-0 text-xxs"},{default:C(()=>[z(D(n.data.isMutation?"MUTATION":"READ ONLY"),1)]),_:1},8,["variant"])]),x(di,{id:b(s),sql:n.data.sql,label:n.data.isMutation?"Review SQL before approval":"View SQL","default-open":n.data.isMutation},null,8,["id","sql","label","default-open"])])}}}),Fb={class:"overflow-hidden"},zb={key:1,class:""},qb={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},Ub={class:"mt-2 border-l-2 border-border pl-3 py-1 text-foreground/80 opacity-70 chat-text"},Gb=X({__name:"AgentReasoningBlock",props:{content:{},isStreaming:{type:Boolean}},setup(e){const t=e,s=vs(t,"isStreaming"),n=Va(vs(t,"content"),s),a=K(!1);Te(()=>t.isStreaming,u=>{u?a.value=!0:a.value=!1},{immediate:!0});function i(u){const l=u;l.style.height="0",l.style.opacity="0",requestAnimationFrame(()=>{l.style.height=l.scrollHeight+"px",l.style.opacity="1"})}function r(u){u.style.height="auto"}function o(u){const l=u;l.style.height=l.scrollHeight+"px",l.style.opacity="1",requestAnimationFrame(()=>{l.style.height="0",l.style.opacity="0"})}return(u,l)=>{const c=ye;return _(),k("div",Fb,[w("button",{type:"button",class:"flex cursor-pointer items-center justify-start gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",onClick:l[0]||(l[0]=d=>a.value=!b(a))},[x(c,{name:"hugeicons:ai-brain-05",class:fe(["size-3.5! shrink-0",{"animate-pulse text-primary":u.isStreaming}])},null,8,["class"]),u.isStreaming?(_(),H(li,{key:0,duration:1},{default:C(()=>l[1]||(l[1]=[z("Reasoning")])),_:1})):(_(),k("span",zb," Reasoning ")),x(c,{name:"lucide:chevron-down",class:fe(["ml-auto size-4 transition-transform duration-300",{"rotate-180":b(a)}])},null,8,["class"])]),x(ks,{onEnter:i,onAfterEnter:r,onLeave:o},{default:C(()=>[b(a)?(_(),k("div",qb,[w("div",Ub,[x(Do,{content:b(n),"is-streaming":u.isStreaming,"is-block-streaming":u.isStreaming,"is-user-message":!1},null,8,["content","is-streaming","is-block-streaming"])])])):Z("",!0)]),_:1})])}}}),Hb={key:1,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},Zb={class:"text-xs text-muted-foreground mt-1"},Wb=X({__name:"AgentTableBlock",props:{data:{}},setup(e){const t=e,s=R(()=>(t.data.columns??[]).map(u=>({originalName:u.name,queryFieldName:u.name,aliasFieldName:u.name,isPrimaryKey:!1,isForeignKey:!1,canMutate:!1,type:u.type,tableName:""}))),n=R(()=>t.data.rows??[]),a=R(()=>La({columns:s.value,rows:n.value,columnKeyBy:"field",hasHashIndex:!1})),i=R(()=>Oa(n.value,!1)),r=R(()=>`agent-render-table-${t.data.sql||""}`),o=R(()=>{const p=48+n.value.length*32;return Math.max(120,Math.min(p,420))});return(u,l)=>{const c=Ba;return _(),k(he,null,[u.data.sql?(_(),H(di,{key:0,id:b(r),sql:u.data.sql,label:"View SQL"},null,8,["id","sql"])):Z("",!0),u.data.truncated?(_(),k("div",Hb," Showing only the first "+D(u.data.rowCount)+" rows. ",1)):Z("",!0),w("div",{class:"overflow-hidden rounded-lg border max-h-96",style:es({height:`${b(o)}px`})},[x(c,{"column-defs":b(a),"row-data":b(i),"column-types":b(Na),class:"h-full w-full"},null,8,["column-defs","row-data","column-types"])],4),w("div",Zb," Showing "+D(b(n).length)+" row"+D(b(n).length===1?"":"s"),1)],64)}}}),Kb={class:"flex flex-wrap items-center justify-between gap-2"},Yb={class:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground"},Xb={class:"text-xs text-muted-foreground"},Jb={key:0,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},Qb={class:"overflow-hidden rounded-xl border bg-background/90 p-2 pt-8"},ex={class:"agent-chart-container"},tx=X({__name:"AgentVisualizeTableBlock",props:{data:{}},setup(e){Uo([sp,np,ap,jp,Hp,ip,rp,op]);const t=e,s=R(()=>`agent-visualize-table-${t.data.chartType}-${t.data.sql}`),n=R(()=>t.data.chartType.replace("_"," ")),a=R(()=>t.data.chartType==="pie"?{tooltip:{trigger:"item"},legend:{bottom:0},series:[{type:"pie",radius:["35%","68%"],data:t.data.points.map(i=>({name:i.label,value:i.y}))}]}:t.data.chartType==="scatter"?{tooltip:{trigger:"item"},grid:{left:16,right:16,top:24,bottom:24,containLabel:!0},xAxis:{type:"value",name:t.data.xField},yAxis:{type:"value",name:t.data.yField},series:[{type:"scatter",symbolSize:10,data:t.data.points.map(i=>[i.x,i.y])}]}:{tooltip:{trigger:"axis"},grid:{left:16,right:16,top:24,bottom:24,containLabel:!0},xAxis:{type:"category",name:t.data.xField,data:t.data.points.map(i=>i.label),axisLabel:{hideOverlap:!0}},yAxis:{type:"value",name:t.data.yField},series:[{type:t.data.chartType,smooth:t.data.chartType==="line",data:t.data.points.map(i=>i.y)}]});return(i,r)=>{const o=Ve;return _(),k(he,null,[w("div",Kb,[w("div",Yb,[x(o,{variant:"secondary",class:"uppercase tracking-[0.16em]"},{default:C(()=>[z(D(b(n)),1)]),_:1}),i.data.xField?(_(),H(o,{key:0,variant:"outline"},{default:C(()=>[z(" X: "+D(i.data.xField),1)]),_:1})):Z("",!0),i.data.yField?(_(),H(o,{key:1,variant:"outline"},{default:C(()=>[z(" Y: "+D(i.data.yField),1)]),_:1})):Z("",!0)]),w("div",Xb,D(i.data.rowCount)+" point"+D(i.data.rowCount===1?"":"s"),1)]),x(di,{id:b(s),sql:i.data.sql,label:"View SQL"},null,8,["id","sql"]),i.data.truncated?(_(),k("div",Jb," Showing only the first "+D(i.data.rowCount)+" points. ",1)):Z("",!0),w("div",Qb,[w("div",ex,[x(b(lp),{option:b(a),autoresize:"",class:"agent-chart"},null,8,["option"])])])],64)}}}),sx=Mo(tx,[["__scopeId","data-v-8ea150a2"]]),nx={class:"min-w-0 flex-1 overflow-hidden"},ax={class:"flex items-center gap-1 justify-center"},ix=X({__name:"AgentMessageBubble",props:{message:{},getToolComponent:{type:Function},showReasoning:{type:Boolean},isStreaming:{type:Boolean},highlightedResponseId:{},registerMessageElement:{type:Function}},emits:["approval","edit","quiz-submit"],setup(e,{emit:t}){const s=e,n=t,{handleCopyWithKey:a,isCopied:i,getCopyIcon:r,getCopyIconClass:o,getCopyTooltip:u}=$a(),l=R(()=>s.message.role==="user"),c=p=>{l.value||!s.registerMessageElement||s.registerMessageElement(s.message.id,p)},d=R(()=>(s.message.blocks??[]).map(p=>p.kind==="text"||p.kind==="markdown"?p.content:p.kind==="code"||p.kind==="mermaid"?p.code:"").filter(Boolean).join(`
5
-
6
- `));return(p,f)=>{const m=ye,y=Ae,v=fn,g=hn,A=pn;return _(),k("div",{class:fe(["w-full",l.value?"flex justify-end":"flex justify-start"]),ref:h=>c(h)},[w("div",{class:fe(["flex w-full max-w-3xl gap-3",l.value?"justify-end":"items-start"])},[w("div",nx,[(_(!0),k(he,null,Re(p.message.blocks,(h,M)=>(_(),k("div",{key:`${p.message.id}-${h.kind}-${M}`,class:fe(["overflow-hidden chat-text",!l.value&&s.highlightedResponseId===p.message.id?"ring-1 ring-primary/25 bg-primary/6":"",l.value?"rounded-xl bg-muted text-foreground p-2 px-3 shadow-none whitespace-pre-wrap ml-auto":"rounded-xl border-none bg-transparent py-2 shadow-none flex flex-col gap-1.5"])},[h.kind==="text"?(_(),H(b(Rv),{key:0,content:h.content,"is-block-streaming":h.isStreaming,"is-streaming":p.isStreaming,"is-user-message":l.value},null,8,["content","is-block-streaming","is-streaming","is-user-message"])):h.kind==="reasoning"&&p.showReasoning?(_(),H(b(Gb),{key:1,content:h.content,"is-streaming":h.isStreaming},null,8,["content","is-streaming"])):h.kind==="markdown"?(_(),H(b(Do),{key:2,content:h.content,"is-block-streaming":h.isStreaming,"is-streaming":p.isStreaming,"is-user-message":l.value},null,8,["content","is-block-streaming","is-streaming","is-user-message"])):h.kind==="code"?(_(),H(b(gn),{key:3,id:`${p.message.id}-${M}`,code:h.code,language:h.language||"text","is-block-streaming":h.isStreaming,"is-streaming":p.isStreaming},null,8,["id","code","language","is-block-streaming","is-streaming"])):h.kind==="mermaid"?(_(),H(b(hy),{key:4,id:`${p.message.id}-${M}`,code:h.code},null,8,["id","code"])):h.kind==="loading"?(_(),H(b(gy),{key:5,label:h.label},null,8,["label"])):h.kind==="error"?(_(),H(b(yy),{key:6,message:h.message},null,8,["message"])):h.kind==="tool"?(_(),H(b(_y),{key:7,"tool-name":h.toolName,result:h.result,"get-tool-component":p.getToolComponent},null,8,["tool-name","result","get-tool-component"])):h.kind==="approval"?(_(),H(b(nb),{key:8,"tool-name":h.toolName,input:h.input,"approval-id":h.approvalId,onApprove:f[0]||(f[0]=E=>n("approval",E,!0)),onDeny:f[1]||(f[1]=E=>n("approval",E,!1))},null,8,["tool-name","input","approval-id"])):h.kind==="source"?(_(),H(b(ky),{key:9,"source-id":h.sourceId,url:h.url,title:h.title,"media-type":h.mediaType,filename:h.filename},null,8,["source-id","url","title","media-type","filename"])):h.kind==="quiz"?(_(),H(b(Hy),{key:10,"tool-call-id":h.toolCallId,context:h.context,questions:h.questions,onSubmit:f[2]||(f[2]=E=>n("quiz-submit",E))},null,8,["tool-call-id","context","questions"])):Z("",!0)],2))),128)),p.isStreaming?Z("",!0):(_(),k("div",{key:0,class:fe(["mt-1 flex items-center gap-1",l.value?"justify-end":"justify-start"])},[x(A,null,{default:C(()=>[x(v,{"as-child":""},{default:C(()=>[x(y,{size:"xxs",variant:"ghost",class:"h-4!",onClick:f[3]||(f[3]=h=>b(a)(p.message.id,d.value))},{default:C(()=>[w("span",ax,[x(m,{name:b(r)(b(i)(p.message.id)),class:fe(["size-3.5!",b(o)(b(i)(p.message.id))])},null,8,["name","class"]),b(i)(p.message.id)?(_(),k("span",{key:0,class:fe(["text-xxs font-medium leading-none",b(o)(b(i)(p.message.id))])},"Copied",2)):Z("",!0)])]),_:1})]),_:1}),x(g,null,{default:C(()=>[w("p",null,D(b(u)(b(i)(p.message.id))),1)]),_:1})]),_:1}),l.value?(_(),H(A,{key:0},{default:C(()=>[x(v,{"as-child":""},{default:C(()=>[x(y,{size:"iconSm",variant:"ghost",class:"size-4!",onClick:f[4]||(f[4]=h=>n("edit",d.value))},{default:C(()=>[x(m,{name:"lucide:pencil",class:"size-3!"})]),_:1})]),_:1}),x(g,null,{default:C(()=>f[5]||(f[5]=[w("p",null,"Edit",-1)])),_:1})]),_:1})):Z("",!0)],2))])],2)],2)}}}),rx={class:"mx-auto flex max-w-xl flex-col items-center rounded-2xl border bg-background/90 px-8 py-10 text-center shadow-sm"},ox={class:"text-xl font-medium tracking-tight"},lx=X({__name:"AgentSetupCard",props:{currentProvider:{}},setup(e){const{openSettings:t}=Zc();return(s,n)=>{const a=ye,i=Ae;return _(),k("div",rx,[w("h2",ox,[x(a,{name:"lucide:key-round",class:"size-4! text-muted-foreground"}),z(" Connect "+D(s.currentProvider.name),1)]),n[2]||(n[2]=w("p",{class:"mt-2 text-sm leading-6 text-muted-foreground"}," Add an API key in Settings so the agent can answer questions, inspect schema context, and keep chat history in this workspace. ",-1)),x(i,{variant:"outline",size:"sm",class:"mt-6 rounded-2xl",onClick:n[0]||(n[0]=r=>b(t)("Agent"))},{default:C(()=>[x(a,{name:"lucide:settings-2",class:"size-4"}),n[1]||(n[1]=z(" Open Agent Settings "))]),_:1})])}}}),ux={class:"mx-auto my-auto w-full max-w-3xl py-8"},cx={class:"rounded-3xl p-5"},dx={class:"flex items-start"},px={class:"min-w-0 flex-1"},fx={class:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground"},hx=X({__name:"AgentWelcomePanel",props:{promptCards:{},threadCount:{}},emits:["prompt"],setup(e,{emit:t}){const s=e;return(n,a)=>(_(),k("div",ux,[w("div",cx,[w("div",dx,[w("div",px,[w("div",fx,[a[0]||(a[0]=w("span",{class:"rounded-full bg-muted px-2.5 py-1 font-medium text-foreground"}," Orca Agent ",-1)),w("span",null,D(s.threadCount)+" saved threads ready to resume",1)]),a[1]||(a[1]=w("h2",{class:"mt-3 text-xl font-medium text-foreground"}," Ask for schema help, query ideas, or result checks. ",-1)),a[2]||(a[2]=w("p",{class:"mt-2 max-w-2xl text-sm text-muted-foreground"}," Keep it short. The agent already sees the connected schema and can keep working from past conversations. ",-1))])])])]))}}),mx={class:"flex flex-col items-center gap-1"},gx=["onClick"],vx=["aria-label"],yx={class:"line-clamp-3 leading-relaxed"},bx=X({__name:"ResponseNavigatorDotIndicator",props:{currentIndex:{},responses:{},position:{}},emits:["select"],setup(e,{emit:t}){const s=t;return(n,a)=>(_(),k("div",mx,[(_(!0),k(he,null,Re(n.responses,(i,r)=>(_(),k("div",{key:i.id,class:"group relative flex items-center justify-center px-3 cursor-pointer",onClick:o=>s("select",r)},[w("button",{type:"button",class:fe(["rounded-full transition-all duration-200 ease-out focus:outline-none focus:ring-2 focus:ring-primary/60 pointer-events-none",n.currentIndex===r?"h-1 w-5 bg-foreground":"h-[3px] w-3 bg-foreground/30 group-hover:bg-foreground/50 group-hover:w-4"]),"aria-label":`Go to response ${r+1}`},null,10,vx),i.preview?(_(),k("div",{key:0,class:fe(["absolute top-1/2 -translate-y-1/2 pointer-events-none opacity-0 transition-opacity duration-200 group-hover:opacity-100 z-50 w-56 p-2.5 text-xs bg-popover text-popover-foreground rounded-lg shadow-md border border-border",n.position==="left"?"left-full ml-2":"right-full mr-2"])},[w("div",yx,D(i.preview),1)],2)):Z("",!0)],8,gx))),128))]))}}),xx=X({__name:"ResponseNavigatorToast",props:{message:{},position:{}},setup(e){return(t,s)=>(_(),H(ks,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"translate-x-2 opacity-0","enter-to-class":"translate-x-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"translate-x-0 opacity-100","leave-to-class":"translate-x-2 opacity-0"},{default:C(()=>[t.message?(_(),k("div",{key:0,class:fe(["absolute top-1/2 -translate-y-1/2 whitespace-nowrap rounded-full bg-foreground/90 px-3.5 py-2 text-xs text-background shadow-lg",t.position==="right"?"right-full mr-3":"left-full ml-3"]),role:"status","aria-live":"polite"},D(t.message),3)):Z("",!0)]),_:1}))}});function _x({currentIndex:e,total:t,onNavigate:s}){const n=K("");let a=null;const i=R(()=>e.value>0),r=R(()=>e.value<t.value-1),o=p=>{n.value=p,a&&clearTimeout(a),a=setTimeout(()=>{n.value=""},1500)},u=p=>{p<0||p>=t.value||s(p)},l=()=>{if(!i.value){o("Already at first response");return}const p=e.value-1;u(p),o("Previous response")},c=()=>{if(!r.value){o("Already at last response");return}const p=e.value+1;u(p),o("Next response")},d=p=>{p.key==="ArrowUp"&&(p.preventDefault(),l()),p.key==="ArrowDown"&&(p.preventDefault(),c())};return Ra(()=>{a&&clearTimeout(a)}),{canGoNext:r,canGoPrevious:i,goNext:c,goPrevious:l,handleKeydown:d,toastMessage:n}}const wx=X({__name:"ResponseNavigator",props:{responses:{},currentIndex:{},position:{default:"right"},offset:{default:()=>({})}},emits:["navigate"],setup(e,{emit:t}){const s=e,n=t,a=R(()=>s.responses.length),i=R(()=>({top:`calc(50% + ${s.offset.y??0}px)`,right:s.position==="right"?`${0+(s.offset.x??0)}px`:"auto",left:s.position==="left"?`${0+(s.offset.x??0)}px`:"auto",transform:"translateY(-50%)"})),{canGoNext:r,canGoPrevious:o,goNext:u,goPrevious:l,handleKeydown:c,toastMessage:d}=_x({currentIndex:vs(s,"currentIndex"),total:a,onNavigate:p=>n("navigate",p)});return(p,f)=>{const m=ye,y=Ae,v=fn,g=hn,A=pn;return p.responses.length>0?(_(),k("div",{key:0,class:"absolute z-30 flex flex-col items-center gap-0.5",style:es(i.value),tabindex:"0",onKeydown:f[1]||(f[1]=(...h)=>b(c)&&b(c)(...h))},[x(xx,{message:b(d),position:p.position},null,8,["message","position"]),x(A,{"delay-duration":150},{default:C(()=>[x(v,{"as-child":""},{default:C(()=>[x(y,{size:"iconSm",variant:"ghost","aria-label":"Go to previous response","aria-disabled":!b(o),disabled:!b(o),onClick:b(l)},{default:C(()=>[x(m,{name:"lucide:chevron-up"})]),_:1},8,["aria-disabled","disabled","onClick"])]),_:1}),x(g,{side:p.position==="left"?"right":"left"},{default:C(()=>f[2]||(f[2]=[w("p",null,"Previous response",-1)])),_:1},8,["side"])]),_:1}),x(bx,{"current-index":p.currentIndex,responses:p.responses,position:p.position,onSelect:f[0]||(f[0]=h=>n("navigate",h))},null,8,["current-index","responses","position"]),x(A,{"delay-duration":150},{default:C(()=>[x(v,{"as-child":""},{default:C(()=>[x(y,{size:"iconSm",variant:"ghost","aria-label":"Go to next response","aria-disabled":!b(r),disabled:!b(r),onClick:b(u)},{default:C(()=>[x(m,{name:"lucide:chevron-down"})]),_:1},8,["aria-disabled","disabled","onClick"])]),_:1}),x(g,{side:p.position==="left"?"right":"left"},{default:C(()=>f[3]||(f[3]=[w("p",null,"Next response",-1)])),_:1},8,["side"])]),_:1})],36)):Z("",!0)}}}),Sx={class:"flex h-full flex-col bg-sidebar z-50 p-2 gap-2"},Tx={class:"flex shrink-0 items-center justify-between gap-2"},Ax={class:"flex items-center min-w-0 gap-1 flex-1"},Cx={class:"flex flex-col"},kx={class:"truncate text-sm leading-4 font-medium text-foreground"},Ex={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},Px={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},Ix={class:"flex shrink-0 items-center justify-end gap-1"},Mx={class:"flex-1 overflow-hidden min-h-0 flex flex-col"},Rx={key:0,class:"rounded-xl border border-destructive/20 bg-destructive/5 p-4 text-sm text-destructive mx-2"},Dx={key:1,class:"flex-1 w-full overflow-hidden rounded-xl border border-border/70 flex flex-col min-h-0 relative h-full"},Vx=X({__name:"ExportPreviewPanel",props:{result:{}},emits:["close"],setup(e,{emit:t}){const s=e,n=t,{downloadFile:a}=ui(),i=new Set(["csv","tsv"]),r=R(()=>i.has(s.result.format)),o={json:"json",sql:"sql",markdown:"markdown",xml:"xml",yaml:"yaml",html:"html"},u=R(()=>o[s.result.format]),l=R(()=>s.result.preview.columns??[]),c=R(()=>s.result.preview.rows??[]),d=R(()=>s.result.encoding==="base64"?`${s.result.filename} is a binary spreadsheet file. Use Download to open it locally.`:s.result.content),p=R(()=>l.value.map(g=>({originalName:g,aliasFieldName:g,queryFieldName:g,tableName:"",type:"string",isPrimaryKey:!1,isForeignKey:!1,canMutate:!1}))),f=R(()=>La({columns:p.value,rows:c.value,columnKeyBy:"field"})),m=R(()=>Oa(c.value)),y=async()=>{await a(s.result)},v=R(()=>{const g=s.result.fileSize;return Ro(g)});return(g,A)=>{const h=ye,M=Ae,E=Ba,I=bd;return _(),k("div",Sx,[w("div",Tx,[w("div",Ax,[x(h,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),w("div",Cx,[w("h3",kx,D(g.result.filename),1),g.result.preview.truncated?(_(),k("p",Ex," First "+D(c.value.length)+" rows ",1)):(_(),k("p",Px," size: "+D(v.value)+" • type: "+D(g.result.format),1))])]),w("div",Ix,[x(M,{size:"xs",variant:"outline",disabled:!!g.result.error,onClick:y},{default:C(()=>[A[1]||(A[1]=z(" Download ")),x(h,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"]),x(M,{size:"iconMd",variant:"ghost",onClick:A[0]||(A[0]=T=>n("close"))},{default:C(()=>[x(h,{name:"lucide:x",class:"size-4"})]),_:1})])]),w("div",Mx,[g.result.error?(_(),k("div",Rx,D(g.result.error),1)):r.value?(_(),k("div",Dx,[x(E,{"column-defs":f.value,"row-data":m.value,"column-types":b(Na),class:"h-full"},null,8,["column-defs","row-data","column-types"])])):(_(),H(I,{key:2,code:d.value,language:u.value,"max-height":"100%",class:"h-full rounded-xl overflow-auto border border-border/70"},null,8,["code","language"]))])])}}});var Ss;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function s(a){throw new Error}e.assertNever=s,e.arrayToEnum=a=>{const i={};for(const r of a)i[r]=r;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),r={};for(const o of i)r[o]=a[o];return e.objectValues(r)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&i.push(r);return i},e.find=(a,i)=>{for(const r of a)if(i(r))return r},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(r=>typeof r=="string"?`'${r}'`:r).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Ss||(Ss={}));var Xr;(function(e){e.mergeShapes=(t,s)=>({...t,...s})})(Xr||(Xr={}));Ss.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Ss.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class un extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){const s=t||function(i){return i.message},n={_errors:[]},a=i=>{for(const r of i.issues)if(r.code==="invalid_union")r.unionErrors.map(a);else if(r.code==="invalid_return_type")a(r.returnTypeError);else if(r.code==="invalid_arguments")a(r.argumentsError);else if(r.path.length===0)n._errors.push(s(r));else{let o=n,u=0;for(;u<r.path.length;){const l=r.path[u];u===r.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(s(r))):o[l]=o[l]||{_errors:[]},o=o[l],u++}}};return a(this),n}static assert(t){if(!(t instanceof un))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ss.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){const s=Object.create(null),n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];s[i]=s[i]||[],s[i].push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:s}}get formErrors(){return this.flatten()}}un.create=e=>new un(e);var Jr;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Jr||(Jr={}));var Y;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Y||(Y={}));class Qr extends Error{constructor(t,s){super(t),this.name="ParseError",this.type=s.type,this.field=s.field,this.value=s.value,this.line=s.line}}function zn(e){}function $x(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=zn,onError:s=zn,onRetry:n=zn,onComment:a}=e;let i="",r=!0,o,u="",l="";function c(y){const v=r?y.replace(/^\xEF\xBB\xBF/,""):y,[g,A]=Lx(`${i}${v}`);for(const h of g)d(h);i=A,r=!1}function d(y){if(y===""){f();return}if(y.startsWith(":")){a&&a(y.slice(y.startsWith(": ")?2:1));return}const v=y.indexOf(":");if(v!==-1){const g=y.slice(0,v),A=y[v+1]===" "?2:1,h=y.slice(v+A);p(g,h,y);return}p(y,"",y)}function p(y,v,g){switch(y){case"event":l=v;break;case"data":u=`${u}${v}
7
- `;break;case"id":o=v.includes("\0")?void 0:v;break;case"retry":/^\d+$/.test(v)?n(parseInt(v,10)):s(new Qr(`Invalid \`retry\` value: "${v}"`,{type:"invalid-retry",value:v,line:g}));break;default:s(new Qr(`Unknown field "${y.length>20?`${y.slice(0,20)}…`:y}"`,{type:"unknown-field",field:y,value:v,line:g}));break}}function f(){u.length>0&&t({id:o,event:l||void 0,data:u.endsWith(`
8
- `)?u.slice(0,-1):u}),o=void 0,u="",l=""}function m(y={}){i&&y.consume&&d(i),r=!0,o=void 0,u="",l="",i=""}return{feed:c,reset:m}}function Lx(e){const t=[];let s="",n=0;for(;n<e.length;){const a=e.indexOf("\r",n),i=e.indexOf(`
9
- `,n);let r=-1;if(a!==-1&&i!==-1?r=Math.min(a,i):a!==-1?a===e.length-1?r=-1:r=a:i!==-1&&(r=i),r===-1){s=e.slice(n);break}else{const o=e.slice(n,r);t.push(o),n=r+1,e[n-1]==="\r"&&e[n]===`
10
- `&&n++}}return[t,s]}class Ox extends TransformStream{constructor({onError:t,onRetry:s,onComment:n}={}){let a;super({start(i){a=$x({onEvent:r=>{i.enqueue(r)},onError(r){t==="terminate"?i.error(r):typeof t=="function"&&t(r)},onRetry:s,onComment:n})},transform(i){a.feed(i)}})}}var $u="vercel.ai.error",Nx=Symbol.for($u),eo,to,tt=class Lu extends(to=Error,eo=Nx,to){constructor({name:t,message:s,cause:n}){super(s),this[eo]=!0,this.name=t,this.cause=n}static isInstance(t){return Lu.hasMarker(t,$u)}static hasMarker(t,s){const n=Symbol.for(s);return t!=null&&typeof t=="object"&&n in t&&typeof t[n]=="boolean"&&t[n]===!0}};function Ou(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var Nu="AI_InvalidArgumentError",Bu=`vercel.ai.error.${Nu}`,Bx=Symbol.for(Bu),so,no,jx=class extends(no=tt,so=Bx,no){constructor({message:e,cause:t,argument:s}){super({name:Nu,message:e,cause:t}),this[so]=!0,this.argument=s}static isInstance(e){return tt.hasMarker(e,Bu)}},ju="AI_JSONParseError",Fu=`vercel.ai.error.${ju}`,Fx=Symbol.for(Fu),ao,io,ro=class extends(io=tt,ao=Fx,io){constructor({text:e,cause:t}){super({name:ju,message:`JSON parsing failed: Text: ${e}.
11
- Error message: ${Ou(t)}`,cause:t}),this[ao]=!0,this.text=e}static isInstance(e){return tt.hasMarker(e,Fu)}},zu="AI_TypeValidationError",qu=`vercel.ai.error.${zu}`,zx=Symbol.for(qu),oo,lo,Jt=class va extends(lo=tt,oo=zx,lo){constructor({value:t,cause:s,context:n}){let a="Type validation failed";if(n!=null&&n.field&&(a+=` for ${n.field}`),n!=null&&n.entityName||n!=null&&n.entityId){a+=" (";const i=[];n.entityName&&i.push(n.entityName),n.entityId&&i.push(`id: "${n.entityId}"`),a+=i.join(", "),a+=")"}super({name:zu,message:`${a}: Value: ${JSON.stringify(t)}.
12
- Error message: ${Ou(s)}`,cause:s}),this[oo]=!0,this.value=t,this.context=n}static isInstance(t){return tt.hasMarker(t,qu)}static wrap({value:t,cause:s,context:n}){var a,i,r;return va.isInstance(s)&&s.value===t&&((a=s.context)==null?void 0:a.field)===(n==null?void 0:n.field)&&((i=s.context)==null?void 0:i.entityName)===(n==null?void 0:n.entityName)&&((r=s.context)==null?void 0:r.entityId)===(n==null?void 0:n.entityId)?s:new va({value:t,cause:s,context:n})}},Ds=({prefix:e,size:t=16,alphabet:s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{const a=()=>{const i=s.length,r=new Array(t);for(let o=0;o<t;o++)r[o]=s[Math.random()*i|0];return r.join("")};if(e==null)return a;if(s.includes(n))throw new jx({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${s}".`});return()=>`${e}${n}${a()}`},qx=Ds();function uo(e=globalThis){var t,s,n;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(n=(s=e.process)==null?void 0:s.versions)!=null&&n.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function At(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((s,n)=>{t[n.toLowerCase()]=s});else{Array.isArray(e)||(e=Object.entries(e));for(const[s,n]of e)n!=null&&(t[s.toLowerCase()]=n)}return t}function co(e,...t){const s=new Headers(At(e)),n=s.get("user-agent")||"";return s.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(s.entries())}var Ux=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Gx=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function po(e){const t=JSON.parse(e);return t===null||typeof t!="object"||Ux.test(e)===!1&&Gx.test(e)===!1?t:Hx(t)}function Hx(e){let t=[e];for(;t.length;){const s=t;t=[];for(const n of s){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&n.constructor!==null&&typeof n.constructor=="object"&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const a in n){const i=n[a];i&&typeof i=="object"&&t.push(i)}}}return e}function Zx(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return po(e)}try{return po(e)}finally{Error.stackTraceLimit=t}}function pi(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;const{properties:s}=e;if(s!=null)for(const n of Object.keys(s))s[n]=St(s[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(St):St(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(St)),e.allOf!=null&&(e.allOf=e.allOf.map(St)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(St));const{definitions:t}=e;if(t!=null)for(const s of Object.keys(t))t[s]=St(t[s]);return e}function St(e){return typeof e=="boolean"?e:pi(e)}var Wx=Symbol("Let zodToJsonSchema decide on which parser to use"),fo={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Kx=e=>typeof e=="string"?{...fo,name:e}:{...fo,...e};function $e(){return{}}function Yx(e,t){var s,n,a;const i={type:"array"};return(s=e.type)!=null&&s._def&&((a=(n=e.type)==null?void 0:n._def)==null?void 0:a.typeName)!==Y.ZodAny&&(i.items=re(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(i.minItems=e.minLength.value),e.maxLength&&(i.maxItems=e.maxLength.value),e.exactLength&&(i.minItems=e.exactLength.value,i.maxItems=e.exactLength.value),i}function Xx(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const s of e.checks)switch(s.kind){case"min":s.inclusive?t.minimum=s.value:t.exclusiveMinimum=s.value;break;case"max":s.inclusive?t.maximum=s.value:t.exclusiveMaximum=s.value;break;case"multipleOf":t.multipleOf=s.value;break}return t}function Jx(){return{type:"boolean"}}function Uu(e,t){return re(e.type._def,t)}var Qx=(e,t)=>re(e.innerType._def,t);function Gu(e,t,s){const n=s??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((a,i)=>Gu(e,t,a))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return e_(e)}}var e_=e=>{const t={type:"integer",format:"unix-time"};for(const s of e.checks)switch(s.kind){case"min":t.minimum=s.value;break;case"max":t.maximum=s.value;break}return t};function t_(e,t){return{...re(e.innerType._def,t),default:e.defaultValue()}}function s_(e,t){return t.effectStrategy==="input"?re(e.schema._def,t):$e()}function n_(e){return{type:"string",enum:Array.from(e.values)}}var a_=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function i_(e,t){const s=[re(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),re(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(a=>!!a),n=[];return s.forEach(a=>{if(a_(a))n.push(...a.allOf);else{let i=a;if("additionalProperties"in a&&a.additionalProperties===!1){const{additionalProperties:r,...o}=a;i=o}n.push(i)}}),n.length?{allOf:n}:void 0}function r_(e){const t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var qn=void 0,Ue={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(qn===void 0&&(qn=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),qn),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Hu(e,t){const s={type:"string"};if(e.checks)for(const n of e.checks)switch(n.kind){case"min":s.minLength=typeof s.minLength=="number"?Math.max(s.minLength,n.value):n.value;break;case"max":s.maxLength=typeof s.maxLength=="number"?Math.min(s.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":Ge(s,"email",n.message,t);break;case"format:idn-email":Ge(s,"idn-email",n.message,t);break;case"pattern:zod":ke(s,Ue.email,n.message,t);break}break;case"url":Ge(s,"uri",n.message,t);break;case"uuid":Ge(s,"uuid",n.message,t);break;case"regex":ke(s,n.regex,n.message,t);break;case"cuid":ke(s,Ue.cuid,n.message,t);break;case"cuid2":ke(s,Ue.cuid2,n.message,t);break;case"startsWith":ke(s,RegExp(`^${Un(n.value,t)}`),n.message,t);break;case"endsWith":ke(s,RegExp(`${Un(n.value,t)}$`),n.message,t);break;case"datetime":Ge(s,"date-time",n.message,t);break;case"date":Ge(s,"date",n.message,t);break;case"time":Ge(s,"time",n.message,t);break;case"duration":Ge(s,"duration",n.message,t);break;case"length":s.minLength=typeof s.minLength=="number"?Math.max(s.minLength,n.value):n.value,s.maxLength=typeof s.maxLength=="number"?Math.min(s.maxLength,n.value):n.value;break;case"includes":{ke(s,RegExp(Un(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&Ge(s,"ipv4",n.message,t),n.version!=="v4"&&Ge(s,"ipv6",n.message,t);break}case"base64url":ke(s,Ue.base64url,n.message,t);break;case"jwt":ke(s,Ue.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&ke(s,Ue.ipv4Cidr,n.message,t),n.version!=="v4"&&ke(s,Ue.ipv6Cidr,n.message,t);break}case"emoji":ke(s,Ue.emoji(),n.message,t);break;case"ulid":{ke(s,Ue.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Ge(s,"binary",n.message,t);break}case"contentEncoding:base64":{s.contentEncoding="base64";break}case"pattern:zod":{ke(s,Ue.base64,n.message,t);break}}break}case"nanoid":ke(s,Ue.nanoid,n.message,t)}return s}function Un(e,t){return t.patternStrategy==="escape"?l_(e):e}var o_=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function l_(e){let t="";for(let s=0;s<e.length;s++)o_.has(e[s])||(t+="\\"),t+=e[s];return t}function Ge(e,t,s,n){var a;e.format||(a=e.anyOf)!=null&&a.some(i=>i.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...s&&n.errorMessages&&{errorMessage:{format:s}}})):e.format=t}function ke(e,t,s,n){var a;e.pattern||(a=e.allOf)!=null&&a.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:ho(t,n),...s&&n.errorMessages&&{errorMessage:{pattern:s}}})):e.pattern=ho(t,n)}function ho(e,t){var s;if(!t.applyRegexFlags||!e.flags)return e.source;const n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},a=n.i?e.source.toLowerCase():e.source;let i="",r=!1,o=!1,u=!1;for(let l=0;l<a.length;l++){if(r){i+=a[l],r=!1;continue}if(n.i){if(o){if(a[l].match(/[a-z]/)){u?(i+=a[l],i+=`${a[l-2]}-${a[l]}`.toUpperCase(),u=!1):a[l+1]==="-"&&((s=a[l+2])!=null&&s.match(/[a-z]/))?(i+=a[l],u=!0):i+=`${a[l]}${a[l].toUpperCase()}`;continue}}else if(a[l].match(/[a-z]/)){i+=`[${a[l]}${a[l].toUpperCase()}]`;continue}}if(n.m){if(a[l]==="^"){i+=`(^|(?<=[\r
13
- ]))`;continue}else if(a[l]==="$"){i+=`($|(?=[\r
14
- ]))`;continue}}if(n.s&&a[l]==="."){i+=o?`${a[l]}\r
15
- `:`[${a[l]}\r
16
- ]`;continue}i+=a[l],a[l]==="\\"?r=!0:o&&a[l]==="]"?o=!1:!o&&a[l]==="["&&(o=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function Zu(e,t){var s,n,a,i,r,o;const u={type:"object",additionalProperties:(s=re(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?s:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===Y.ZodString&&((a=e.keyType._def.checks)!=null&&a.length)){const{type:l,...c}=Hu(e.keyType._def,t);return{...u,propertyNames:c}}else{if(((i=e.keyType)==null?void 0:i._def.typeName)===Y.ZodEnum)return{...u,propertyNames:{enum:e.keyType._def.values}};if(((r=e.keyType)==null?void 0:r._def.typeName)===Y.ZodBranded&&e.keyType._def.type._def.typeName===Y.ZodString&&((o=e.keyType._def.type._def.checks)!=null&&o.length)){const{type:l,...c}=Uu(e.keyType._def,t);return{...u,propertyNames:c}}}return u}function u_(e,t){if(t.mapStrategy==="record")return Zu(e,t);const s=re(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||$e(),n=re(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||$e();return{type:"array",maxItems:125,items:{type:"array",items:[s,n],minItems:2,maxItems:2}}}function c_(e){const t=e.values,n=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),a=Array.from(new Set(n.map(i=>typeof i)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:n}}function d_(){return{not:$e()}}function p_(){return{type:"null"}}var ya={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function f_(e,t){const s=e.options instanceof Map?Array.from(e.options.values()):e.options;if(s.every(n=>n._def.typeName in ya&&(!n._def.checks||!n._def.checks.length))){const n=s.reduce((a,i)=>{const r=ya[i._def.typeName];return r&&!a.includes(r)?[...a,r]:a},[]);return{type:n.length>1?n:n[0]}}else if(s.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){const n=s.reduce((a,i)=>{const r=typeof i._def.value;switch(r){case"string":case"number":case"boolean":return[...a,r];case"bigint":return[...a,"integer"];case"object":if(i._def.value===null)return[...a,"null"];case"symbol":case"undefined":case"function":default:return a}},[]);if(n.length===s.length){const a=n.filter((i,r,o)=>o.indexOf(i)===r);return{type:a.length>1?a:a[0],enum:s.reduce((i,r)=>i.includes(r._def.value)?i:[...i,r._def.value],[])}}}else if(s.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:s.reduce((n,a)=>[...n,...a._def.values.filter(i=>!n.includes(i))],[])};return h_(e,t)}var h_=(e,t)=>{const s=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,a)=>re(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${a}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return s.length?{anyOf:s}:void 0};function m_(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[ya[e.innerType._def.typeName],"null"]};const s=re(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return s&&{anyOf:[s,{type:"null"}]}}function g_(e){const t={type:"number"};if(!e.checks)return t;for(const s of e.checks)switch(s.kind){case"int":t.type="integer";break;case"min":s.inclusive?t.minimum=s.value:t.exclusiveMinimum=s.value;break;case"max":s.inclusive?t.maximum=s.value:t.exclusiveMaximum=s.value;break;case"multipleOf":t.multipleOf=s.value;break}return t}function v_(e,t){const s={type:"object",properties:{}},n=[],a=e.shape();for(const r in a){let o=a[r];if(o===void 0||o._def===void 0)continue;const u=b_(o),l=re(o._def,{...t,currentPath:[...t.currentPath,"properties",r],propertyPath:[...t.currentPath,"properties",r]});l!==void 0&&(s.properties[r]=l,u||n.push(r))}n.length&&(s.required=n);const i=y_(e,t);return i!==void 0&&(s.additionalProperties=i),s}function y_(e,t){if(e.catchall._def.typeName!=="ZodNever")return re(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function b_(e){try{return e.isOptional()}catch{return!0}}var x_=(e,t)=>{var s;if(t.currentPath.toString()===((s=t.propertyPath)==null?void 0:s.toString()))return re(e.innerType._def,t);const n=re(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:$e()},n]}:$e()},__=(e,t)=>{if(t.pipeStrategy==="input")return re(e.in._def,t);if(t.pipeStrategy==="output")return re(e.out._def,t);const s=re(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=re(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",s?"1":"0"]});return{allOf:[s,n].filter(a=>a!==void 0)}};function w_(e,t){return re(e.type._def,t)}function S_(e,t){const n={type:"array",uniqueItems:!0,items:re(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function T_(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((s,n)=>re(s._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((s,n)=>n===void 0?s:[...s,n],[]),additionalItems:re(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((s,n)=>re(s._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((s,n)=>n===void 0?s:[...s,n],[])}}function A_(){return{not:$e()}}function C_(){return $e()}var k_=(e,t)=>re(e.innerType._def,t),E_=(e,t,s)=>{switch(t){case Y.ZodString:return Hu(e,s);case Y.ZodNumber:return g_(e);case Y.ZodObject:return v_(e,s);case Y.ZodBigInt:return Xx(e);case Y.ZodBoolean:return Jx();case Y.ZodDate:return Gu(e,s);case Y.ZodUndefined:return A_();case Y.ZodNull:return p_();case Y.ZodArray:return Yx(e,s);case Y.ZodUnion:case Y.ZodDiscriminatedUnion:return f_(e,s);case Y.ZodIntersection:return i_(e,s);case Y.ZodTuple:return T_(e,s);case Y.ZodRecord:return Zu(e,s);case Y.ZodLiteral:return r_(e);case Y.ZodEnum:return n_(e);case Y.ZodNativeEnum:return c_(e);case Y.ZodNullable:return m_(e,s);case Y.ZodOptional:return x_(e,s);case Y.ZodMap:return u_(e,s);case Y.ZodSet:return S_(e,s);case Y.ZodLazy:return()=>e.getter()._def;case Y.ZodPromise:return w_(e,s);case Y.ZodNaN:case Y.ZodNever:return d_();case Y.ZodEffects:return s_(e,s);case Y.ZodAny:return $e();case Y.ZodUnknown:return C_();case Y.ZodDefault:return t_(e,s);case Y.ZodBranded:return Uu(e,s);case Y.ZodReadonly:return k_(e,s);case Y.ZodCatch:return Qx(e,s);case Y.ZodPipeline:return __(e,s);case Y.ZodFunction:case Y.ZodVoid:case Y.ZodSymbol:return;default:return(n=>{})()}},P_=(e,t)=>{let s=0;for(;s<e.length&&s<t.length&&e[s]===t[s];s++);return[(e.length-s).toString(),...t.slice(s)].join("/")};function re(e,t,s=!1){var n;const a=t.seen.get(e);if(t.override){const u=(n=t.override)==null?void 0:n.call(t,e,t,a,s);if(u!==Wx)return u}if(a&&!s){const u=I_(a,t);if(u!==void 0)return u}const i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);const r=E_(e,e.typeName,t),o=typeof r=="function"?re(r(),t):r;if(o&&M_(e,t,o),t.postProcess){const u=t.postProcess(o,e,t);return i.jsonSchema=o,u}return i.jsonSchema=o,o}var I_=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:P_(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((s,n)=>t.currentPath[n]===s)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),$e()):t.$refStrategy==="seen"?$e():void 0}},M_=(e,t,s)=>(e.description&&(s.description=e.description),s),R_=e=>{const t=Kx(e),s=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:s,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,a])=>[a._def,{def:a._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},D_=(e,t)=>{var s;const n=R_(t);let a=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((l,[c,d])=>{var p;return{...l,[c]:(p=re(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,c]},!0))!=null?p:$e()}},{}):void 0;const i=typeof t=="string"?t:(t==null?void 0:t.nameStrategy)==="title"||t==null?void 0:t.name,r=(s=re(e._def,i===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,i]},!1))!=null?s:$e(),o=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;o!==void 0&&(r.title=o);const u=i===void 0?a?{...r,[n.definitionPath]:a}:r:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,i].join("/"),[n.definitionPath]:{...a,[i]:r}};return u.$schema="http://json-schema.org/draft-07/schema#",u},ba=Symbol.for("vercel.ai.schema");function V_(e){let t;return()=>(t==null&&(t=e()),t)}function vn(e,{validate:t}={}){return{[ba]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function $_(e){return typeof e=="object"&&e!==null&&ba in e&&e[ba]===!0&&"jsonSchema"in e&&"validate"in e}function fi(e){return e==null?vn({properties:{},additionalProperties:!1}):$_(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?Wu(e):L_(e):e()}function L_(e){return vn(()=>pi(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{const s=await e["~standard"].validate(t);return"value"in s?{success:!0,value:s.value}:{success:!1,error:new Jt({value:t,cause:s.issues})}}})}function O_(e,t){var s;const n=(s=void 0)!=null?s:!1;return vn(()=>D_(e,{$refStrategy:n?"root":"none"}),{validate:async a=>{const i=await e.safeParseAsync(a);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function N_(e,t){var s;const n=(s=void 0)!=null?s:!1;return vn(()=>pi(Kc(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"})),{validate:async a=>{const i=await Wc(e,a);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function B_(e){return"_zod"in e}function Wu(e,t){return B_(e)?N_(e):O_(e)}async function mo({value:e,schema:t,context:s}){const n=await Ts({value:e,schema:t,context:s});if(!n.success)throw Jt.wrap({value:e,cause:n.error,context:s});return n.value}async function Ts({value:e,schema:t,context:s}){const n=fi(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};const a=await n.validate(e);return a.success?{success:!0,value:a.value,rawValue:e}:{success:!1,error:Jt.wrap({value:e,cause:a.error,context:s}),rawValue:e}}catch(a){return{success:!1,error:Jt.wrap({value:e,cause:a,context:s}),rawValue:e}}}async function Nt({text:e,schema:t}){try{const s=Zx(e);return t==null?{success:!0,value:s,rawValue:s}:await Ts({value:s,schema:t})}catch(s){return{success:!1,error:ro.isInstance(s)?s:new ro({text:e,cause:s}),rawValue:void 0}}}function j_({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Ox).pipeThrough(new TransformStream({async transform({data:s},n){s!=="[DONE]"&&n.enqueue(await Nt({text:s,schema:t}))}}))}async function pt(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var F_=Object.defineProperty,z_=(e,t)=>{for(var s in t)F_(e,s,{get:t[s],enumerable:!0})},Ku="AI_NoObjectGeneratedError",Yu=`vercel.ai.error.${Ku}`,q_=Symbol.for(Yu),Xu,gt=class extends tt{constructor({message:e="No object generated.",cause:t,text:s,response:n,usage:a,finishReason:i}){super({name:Ku,message:e,cause:t}),this[Xu]=!0,this.text=s,this.response=n,this.usage=a,this.finishReason=i}static isInstance(e){return tt.hasMarker(e,Yu)}};Xu=q_;var Ju="AI_UIMessageStreamError",Qu=`vercel.ai.error.${Ju}`,U_=Symbol.for(Qu),ec,qt=class extends tt{constructor({chunkType:e,chunkId:t,message:s}){super({name:Ju,message:s}),this[ec]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return tt.hasMarker(e,Qu)}};ec=U_;var go="6.0.116",tc=De([V(),Qs(Uint8Array),Qs(ArrayBuffer),Vo(e=>{var t,s;return(s=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?s:!1},{message:"Must be a Buffer"})]),As=Yc(()=>De([Jc(),V(),Qc(),Ee(),ys(V(),As.optional()),Es(As)])),Q=ys(V(),ys(V(),As.optional())),sc=oe({type:W("text"),text:V(),providerOptions:Q.optional()}),G_=oe({type:W("image"),image:De([tc,Qs(URL)]),mediaType:V().optional(),providerOptions:Q.optional()}),nc=oe({type:W("file"),data:De([tc,Qs(URL)]),filename:V().optional(),mediaType:V(),providerOptions:Q.optional()}),H_=oe({type:W("reasoning"),text:V(),providerOptions:Q.optional()}),Z_=oe({type:W("tool-call"),toolCallId:V(),toolName:V(),input:ut(),providerOptions:Q.optional(),providerExecuted:Ee().optional()}),W_=Xc("type",[oe({type:W("text"),value:V(),providerOptions:Q.optional()}),oe({type:W("json"),value:As,providerOptions:Q.optional()}),oe({type:W("execution-denied"),reason:V().optional(),providerOptions:Q.optional()}),oe({type:W("error-text"),value:V(),providerOptions:Q.optional()}),oe({type:W("error-json"),value:As,providerOptions:Q.optional()}),oe({type:W("content"),value:Es(De([oe({type:W("text"),text:V(),providerOptions:Q.optional()}),oe({type:W("media"),data:V(),mediaType:V()}),oe({type:W("file-data"),data:V(),mediaType:V(),filename:V().optional(),providerOptions:Q.optional()}),oe({type:W("file-url"),url:V(),providerOptions:Q.optional()}),oe({type:W("file-id"),fileId:De([V(),ys(V(),V())]),providerOptions:Q.optional()}),oe({type:W("image-data"),data:V(),mediaType:V(),providerOptions:Q.optional()}),oe({type:W("image-url"),url:V(),providerOptions:Q.optional()}),oe({type:W("image-file-id"),fileId:De([V(),ys(V(),V())]),providerOptions:Q.optional()}),oe({type:W("custom"),providerOptions:Q.optional()})]))})]),ac=oe({type:W("tool-result"),toolCallId:V(),toolName:V(),output:W_,providerOptions:Q.optional()}),K_=oe({type:W("tool-approval-request"),approvalId:V(),toolCallId:V()}),Y_=oe({type:W("tool-approval-response"),approvalId:V(),approved:Ee(),reason:V().optional()}),X_=oe({role:W("system"),content:V(),providerOptions:Q.optional()}),J_=oe({role:W("user"),content:De([V(),Es(De([sc,G_,nc]))]),providerOptions:Q.optional()}),Q_=oe({role:W("assistant"),content:De([V(),Es(De([sc,nc,H_,Z_,ac,K_]))]),providerOptions:Q.optional()}),ew=oe({role:W("tool"),content:Es(De([ac,Y_])),providerOptions:Q.optional()});De([X_,J_,Q_,ew]);function ic(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;const s={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const a=t[n];if(a===void 0)continue;const i=n in e?e[n]:void 0,r=a!==null&&typeof a=="object"&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp),o=i!=null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);r&&o?s[n]=ic(i,a):s[n]=a}return s}var tw={};z_(tw,{array:()=>iw,choice:()=>rw,json:()=>ow,object:()=>aw,text:()=>nw});function sw(e){const t=["ROOT"];let s=-1,n=null;function a(u,l,c){switch(u){case'"':{s=l,t.pop(),t.push(c),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{s=l,n=l,t.pop(),t.push(c),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{s=l,t.pop(),t.push(c),t.push("INSIDE_NUMBER");break}case"{":{s=l,t.pop(),t.push(c),t.push("INSIDE_OBJECT_START");break}case"[":{s=l,t.pop(),t.push(c),t.push("INSIDE_ARRAY_START");break}}}function i(u,l){switch(u){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{s=l,t.pop();break}}}function r(u,l){switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{s=l,t.pop();break}}}for(let u=0;u<e.length;u++){const l=e[u];switch(t[t.length-1]){case"ROOT":a(l,u,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{s=u,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(l){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(l){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(l){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{a(l,u,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(l,u);break}case"INSIDE_STRING":{switch(l){case'"':{t.pop(),s=u;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:s=u}break}case"INSIDE_ARRAY_START":{switch(l){case"]":{s=u,t.pop();break}default:{s=u,a(l,u,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{s=u,t.pop();break}default:{s=u;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{a(l,u,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),s=u;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{s=u;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&r(l,u),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(l,u);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(l,u);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&r(l,u);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const d=e.substring(n,u+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(l,u):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&r(l,u)):s=u;break}}}let o=e.slice(0,s+1);for(let u=t.length-1;u>=0;u--)switch(t[u]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const c=e.substring(n,e.length);"true".startsWith(c)?o+="true".slice(c.length):"false".startsWith(c)?o+="false".slice(c.length):"null".startsWith(c)&&(o+="null".slice(c.length))}}return o}async function Vs(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await Nt({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await Nt({text:sw(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var nw=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),aw=({schema:e,name:t,description:s})=>{const n=fi(e);return{name:"object",responseFormat:pt(n.jsonSchema).then(a=>({type:"json",schema:a,...t!=null&&{name:t},...s!=null&&{description:s}})),async parseCompleteOutput({text:a},i){const r=await Nt({text:a});if(!r.success)throw new gt({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:i.response,usage:i.usage,finishReason:i.finishReason});const o=await Ts({value:r.value,schema:n});if(!o.success)throw new gt({message:"No object generated: response did not match schema.",cause:o.error,text:a,response:i.response,usage:i.usage,finishReason:i.finishReason});return o.value},async parsePartialOutput({text:a}){const i=await Vs(a);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:i.value}}},createElementStreamTransform(){}}},iw=({element:e,name:t,description:s})=>{const n=fi(e);return{name:"array",responseFormat:pt(n.jsonSchema).then(a=>{const{$schema:i,...r}=a;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:r}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...s!=null&&{description:s}}}),async parseCompleteOutput({text:a},i){const r=await Nt({text:a});if(!r.success)throw new gt({message:"No object generated: could not parse the response.",cause:r.error,text:a,response:i.response,usage:i.usage,finishReason:i.finishReason});const o=r.value;if(o==null||typeof o!="object"||!("elements"in o)||!Array.isArray(o.elements))throw new gt({message:"No object generated: response did not match schema.",cause:new Jt({value:o,cause:"response must be an object with an elements array"}),text:a,response:i.response,usage:i.usage,finishReason:i.finishReason});for(const u of o.elements){const l=await Ts({value:u,schema:n});if(!l.success)throw new gt({message:"No object generated: response did not match schema.",cause:l.error,text:a,response:i.response,usage:i.usage,finishReason:i.finishReason})}return o.elements},async parsePartialOutput({text:a}){const i=await Vs(a);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const r=i.value;if(r==null||typeof r!="object"||!("elements"in r)||!Array.isArray(r.elements))return;const o=i.state==="repaired-parse"&&r.elements.length>0?r.elements.slice(0,-1):r.elements,u=[];for(const l of o){const c=await Ts({value:l,schema:n});c.success&&u.push(c.value)}return{partial:u}}}},createElementStreamTransform(){let a=0;return new TransformStream({transform({partialOutput:i},r){if(i!=null)for(;a<i.length;a++)r.enqueue(i[a])}})}}},rw=({options:e,name:t,description:s})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...s!=null&&{description:s}}),async parseCompleteOutput({text:n},a){const i=await Nt({text:n});if(!i.success)throw new gt({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:a.response,usage:a.usage,finishReason:a.finishReason});const r=i.value;if(r==null||typeof r!="object"||!("result"in r)||typeof r.result!="string"||!e.includes(r.result))throw new gt({message:"No object generated: response did not match schema.",cause:new Jt({value:r,cause:"response must be an object that contains a choice value."}),text:n,response:a.response,usage:a.usage,finishReason:a.finishReason});return r.result},async parsePartialOutput({text:n}){const a=await Vs(n);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=a.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string")return;const r=e.filter(o=>o.startsWith(i.result));return a.state==="successful-parse"?r.includes(i.result)?{partial:i.result}:void 0:r.length===1?{partial:r[0]}:void 0}}},createElementStreamTransform(){}}),ow=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:s},n){const a=await Nt({text:s});if(!a.success)throw new gt({message:"No object generated: could not parse the response.",cause:a.error,text:s,response:n.response,usage:n.usage,finishReason:n.finishReason});return a.value},async parsePartialOutput({text:s}){const n=await Vs(s);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return n.value===void 0?void 0:{partial:n.value}}},createElementStreamTransform(){}});Ds({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
17
-
18
- `)},flush(e){e.enqueue(`data: [DONE]
19
-
20
- `)}})}});var lw=V_(()=>Wu(De([ue({type:W("text-start"),id:V(),providerMetadata:Q.optional()}),ue({type:W("text-delta"),id:V(),delta:V(),providerMetadata:Q.optional()}),ue({type:W("text-end"),id:V(),providerMetadata:Q.optional()}),ue({type:W("error"),errorText:V()}),ue({type:W("tool-input-start"),toolCallId:V(),toolName:V(),providerExecuted:Ee().optional(),providerMetadata:Q.optional(),dynamic:Ee().optional(),title:V().optional()}),ue({type:W("tool-input-delta"),toolCallId:V(),inputTextDelta:V()}),ue({type:W("tool-input-available"),toolCallId:V(),toolName:V(),input:ut(),providerExecuted:Ee().optional(),providerMetadata:Q.optional(),dynamic:Ee().optional(),title:V().optional()}),ue({type:W("tool-input-error"),toolCallId:V(),toolName:V(),input:ut(),providerExecuted:Ee().optional(),providerMetadata:Q.optional(),dynamic:Ee().optional(),errorText:V(),title:V().optional()}),ue({type:W("tool-approval-request"),approvalId:V(),toolCallId:V()}),ue({type:W("tool-output-available"),toolCallId:V(),output:ut(),providerExecuted:Ee().optional(),dynamic:Ee().optional(),preliminary:Ee().optional()}),ue({type:W("tool-output-error"),toolCallId:V(),errorText:V(),providerExecuted:Ee().optional(),dynamic:Ee().optional()}),ue({type:W("tool-output-denied"),toolCallId:V()}),ue({type:W("reasoning-start"),id:V(),providerMetadata:Q.optional()}),ue({type:W("reasoning-delta"),id:V(),delta:V(),providerMetadata:Q.optional()}),ue({type:W("reasoning-end"),id:V(),providerMetadata:Q.optional()}),ue({type:W("source-url"),sourceId:V(),url:V(),title:V().optional(),providerMetadata:Q.optional()}),ue({type:W("source-document"),sourceId:V(),mediaType:V(),title:V(),filename:V().optional(),providerMetadata:Q.optional()}),ue({type:W("file"),url:V(),mediaType:V(),providerMetadata:Q.optional()}),ue({type:Vo(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:V().optional(),data:ut(),transient:Ee().optional()}),ue({type:W("start-step")}),ue({type:W("finish-step")}),ue({type:W("start"),messageId:V().optional(),messageMetadata:ut().optional()}),ue({type:W("finish"),finishReason:ed(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:ut().optional()}),ue({type:W("abort"),reason:V().optional()}),ue({type:W("message-metadata"),messageMetadata:ut()})])));function uw(e){return e.type.startsWith("data-")}function xa(e){return e.type.startsWith("tool-")}function cw(e){return e.type==="dynamic-tool"}function Cs(e){return xa(e)||cw(e)}function vo(e){return e.type.split("-").slice(1).join("-")}function dw({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function pw({stream:e,messageMetadataSchema:t,dataPartSchemas:s,runUpdateMessageJob:n,onError:a,onToolCall:i,onData:r}){return e.pipeThrough(new TransformStream({async transform(o,u){await n(async({state:l,write:c})=>{var d,p,f,m;function y(h){const E=l.message.parts.filter(Cs).find(I=>I.toolCallId===h);if(E==null)throw new qt({chunkType:"tool-invocation",chunkId:h,message:`No tool invocation found for tool call ID "${h}".`});return E}function v(h){var M;const E=l.message.parts.find(S=>xa(S)&&S.toolCallId===h.toolCallId),I=h,T=E;E!=null?(E.state=h.state,T.input=I.input,T.output=I.output,T.errorText=I.errorText,T.rawInput=I.rawInput,T.preliminary=I.preliminary,h.title!==void 0&&(T.title=h.title),T.providerExecuted=(M=I.providerExecuted)!=null?M:E.providerExecuted,I.providerMetadata!=null&&(E.callProviderMetadata=I.providerMetadata)):l.message.parts.push({type:`tool-${h.toolName}`,toolCallId:h.toolCallId,state:h.state,title:h.title,input:I.input,output:I.output,rawInput:I.rawInput,errorText:I.errorText,providerExecuted:I.providerExecuted,preliminary:I.preliminary,...I.providerMetadata!=null?{callProviderMetadata:I.providerMetadata}:{}})}function g(h){var M,E;const I=l.message.parts.find(N=>N.type==="dynamic-tool"&&N.toolCallId===h.toolCallId),T=h,S=I;I!=null?(I.state=h.state,S.toolName=h.toolName,S.input=T.input,S.output=T.output,S.errorText=T.errorText,S.rawInput=(M=T.rawInput)!=null?M:S.rawInput,S.preliminary=T.preliminary,h.title!==void 0&&(S.title=h.title),S.providerExecuted=(E=T.providerExecuted)!=null?E:I.providerExecuted,T.providerMetadata!=null&&(I.callProviderMetadata=T.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:h.toolName,toolCallId:h.toolCallId,state:h.state,input:T.input,output:T.output,errorText:T.errorText,preliminary:T.preliminary,providerExecuted:T.providerExecuted,title:h.title,...T.providerMetadata!=null?{callProviderMetadata:T.providerMetadata}:{}})}async function A(h){if(h!=null){const M=l.message.metadata!=null?ic(l.message.metadata,h):h;t!=null&&await mo({value:M,schema:t,context:{field:"message.metadata",entityId:l.message.id}}),l.message.metadata=M}}switch(o.type){case"text-start":{const h={type:"text",text:"",providerMetadata:o.providerMetadata,state:"streaming"};l.activeTextParts[o.id]=h,l.message.parts.push(h),c();break}case"text-delta":{const h=l.activeTextParts[o.id];if(h==null)throw new qt({chunkType:"text-delta",chunkId:o.id,message:`Received text-delta for missing text part with ID "${o.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});h.text+=o.delta,h.providerMetadata=(d=o.providerMetadata)!=null?d:h.providerMetadata,c();break}case"text-end":{const h=l.activeTextParts[o.id];if(h==null)throw new qt({chunkType:"text-end",chunkId:o.id,message:`Received text-end for missing text part with ID "${o.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});h.state="done",h.providerMetadata=(p=o.providerMetadata)!=null?p:h.providerMetadata,delete l.activeTextParts[o.id],c();break}case"reasoning-start":{const h={type:"reasoning",text:"",providerMetadata:o.providerMetadata,state:"streaming"};l.activeReasoningParts[o.id]=h,l.message.parts.push(h),c();break}case"reasoning-delta":{const h=l.activeReasoningParts[o.id];if(h==null)throw new qt({chunkType:"reasoning-delta",chunkId:o.id,message:`Received reasoning-delta for missing reasoning part with ID "${o.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});h.text+=o.delta,h.providerMetadata=(f=o.providerMetadata)!=null?f:h.providerMetadata,c();break}case"reasoning-end":{const h=l.activeReasoningParts[o.id];if(h==null)throw new qt({chunkType:"reasoning-end",chunkId:o.id,message:`Received reasoning-end for missing reasoning part with ID "${o.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});h.providerMetadata=(m=o.providerMetadata)!=null?m:h.providerMetadata,h.state="done",delete l.activeReasoningParts[o.id],c();break}case"file":{l.message.parts.push({type:"file",mediaType:o.mediaType,url:o.url,...o.providerMetadata!=null?{providerMetadata:o.providerMetadata}:{}}),c();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:o.sourceId,url:o.url,title:o.title,providerMetadata:o.providerMetadata}),c();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:o.sourceId,mediaType:o.mediaType,title:o.title,filename:o.filename,providerMetadata:o.providerMetadata}),c();break}case"tool-input-start":{const h=l.message.parts.filter(xa);l.partialToolCalls[o.toolCallId]={text:"",toolName:o.toolName,index:h.length,dynamic:o.dynamic,title:o.title},o.dynamic?g({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-streaming",input:void 0,providerExecuted:o.providerExecuted,title:o.title,providerMetadata:o.providerMetadata}):v({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-streaming",input:void 0,providerExecuted:o.providerExecuted,title:o.title,providerMetadata:o.providerMetadata}),c();break}case"tool-input-delta":{const h=l.partialToolCalls[o.toolCallId];if(h==null)throw new qt({chunkType:"tool-input-delta",chunkId:o.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${o.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});h.text+=o.inputTextDelta;const{value:M}=await Vs(h.text);h.dynamic?g({toolCallId:o.toolCallId,toolName:h.toolName,state:"input-streaming",input:M,title:h.title}):v({toolCallId:o.toolCallId,toolName:h.toolName,state:"input-streaming",input:M,title:h.title}),c();break}case"tool-input-available":{o.dynamic?g({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-available",input:o.input,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata,title:o.title}):v({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-available",input:o.input,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata,title:o.title}),c(),i&&!o.providerExecuted&&await i({toolCall:o});break}case"tool-input-error":{const h=l.message.parts.filter(Cs).find(E=>E.toolCallId===o.toolCallId);(h!=null?h.type==="dynamic-tool":!!o.dynamic)?g({toolCallId:o.toolCallId,toolName:o.toolName,state:"output-error",input:o.input,errorText:o.errorText,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}):v({toolCallId:o.toolCallId,toolName:o.toolName,state:"output-error",input:void 0,rawInput:o.input,errorText:o.errorText,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}),c();break}case"tool-approval-request":{const h=y(o.toolCallId);h.state="approval-requested",h.approval={id:o.approvalId},c();break}case"tool-output-denied":{const h=y(o.toolCallId);h.state="output-denied",c();break}case"tool-output-available":{const h=y(o.toolCallId);h.type==="dynamic-tool"?g({toolCallId:o.toolCallId,toolName:h.toolName,state:"output-available",input:h.input,output:o.output,preliminary:o.preliminary,providerExecuted:o.providerExecuted,title:h.title}):v({toolCallId:o.toolCallId,toolName:vo(h),state:"output-available",input:h.input,output:o.output,providerExecuted:o.providerExecuted,preliminary:o.preliminary,title:h.title}),c();break}case"tool-output-error":{const h=y(o.toolCallId);h.type==="dynamic-tool"?g({toolCallId:o.toolCallId,toolName:h.toolName,state:"output-error",input:h.input,errorText:o.errorText,providerExecuted:o.providerExecuted,title:h.title}):v({toolCallId:o.toolCallId,toolName:vo(h),state:"output-error",input:h.input,rawInput:h.rawInput,errorText:o.errorText,providerExecuted:o.providerExecuted,title:h.title}),c();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{o.messageId!=null&&(l.message.id=o.messageId),await A(o.messageMetadata),(o.messageId!=null||o.messageMetadata!=null)&&c();break}case"finish":{o.finishReason!=null&&(l.finishReason=o.finishReason),await A(o.messageMetadata),o.messageMetadata!=null&&c();break}case"message-metadata":{await A(o.messageMetadata),o.messageMetadata!=null&&c();break}case"error":{a==null||a(new Error(o.errorText));break}default:if(uw(o)){if((s==null?void 0:s[o.type])!=null){const E=l.message.parts.findIndex(T=>"id"in T&&"data"in T&&T.id===o.id&&T.type===o.type),I=E>=0?E:l.message.parts.length;await mo({value:o.data,schema:s[o.type],context:{field:`message.parts[${I}].data`,entityName:o.type,entityId:o.id}})}const h=o;if(h.transient){r==null||r(h);break}const M=h.id!=null?l.message.parts.find(E=>h.type===E.type&&h.id===E.id):void 0;M!=null?M.data=h.data:l.message.parts.push(h),r==null||r(h),c()}}u.enqueue(o)})}}))}async function fw({stream:e,onError:t}){const s=e.getReader();try{for(;;){const{done:n}=await s.read();if(n)break}}catch(n){t==null||t(n)}finally{s.releaseLock()}}Ds({prefix:"aitxt",size:24});Ds({prefix:"aiobj",size:24});var hw=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,s)=>{this.queue.push(async()=>{try{await e(),t()}catch(n){s(n)}}),this.processQueue()})}};Ds({prefix:"aiobj",size:24});async function mw(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{const{name:s,type:n}=t,a=await new Promise((i,r)=>{const o=new FileReader;o.onload=u=>{var l;i((l=u.target)==null?void 0:l.result)},o.onerror=u=>r(u),o.readAsDataURL(t)});return{type:"file",mediaType:n,filename:s,url:a}}))}var gw=class{constructor({api:e="/api/chat",credentials:t,headers:s,body:n,fetch:a,prepareSendMessagesRequest:i,prepareReconnectToStreamRequest:r}){this.api=e,this.credentials=t,this.headers=s,this.body=n,this.fetch=a,this.prepareSendMessagesRequest=i,this.prepareReconnectToStreamRequest=r}async sendMessages({abortSignal:e,...t}){var s,n,a,i,r;const o=await pt(this.body),u=await pt(this.headers),l=await pt(this.credentials),c={...At(u),...At(t.headers)},d=await((s=this.prepareSendMessagesRequest)==null?void 0:s.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...o,...t.body},headers:c,credentials:l,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),p=(n=d==null?void 0:d.api)!=null?n:this.api,f=(d==null?void 0:d.headers)!==void 0?At(d.headers):c,m=(d==null?void 0:d.body)!==void 0?d.body:{...o,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},y=(a=d==null?void 0:d.credentials)!=null?a:l,g=await((i=this.fetch)!=null?i:globalThis.fetch)(p,{method:"POST",headers:co({"Content-Type":"application/json",...f},`ai-sdk/${go}`,uo()),body:JSON.stringify(m),credentials:y,signal:e});if(!g.ok)throw new Error((r=await g.text())!=null?r:"Failed to fetch the chat response.");if(!g.body)throw new Error("The response body is empty.");return this.processResponseStream(g.body)}async reconnectToStream(e){var t,s,n,a,i;const r=await pt(this.body),o=await pt(this.headers),u=await pt(this.credentials),l={...At(o),...At(e.headers)},c=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...r,...e.body},headers:l,credentials:u,requestMetadata:e.metadata})),d=(s=c==null?void 0:c.api)!=null?s:`${this.api}/${e.chatId}/stream`,p=(c==null?void 0:c.headers)!==void 0?At(c.headers):l,f=(n=c==null?void 0:c.credentials)!=null?n:u,y=await((a=this.fetch)!=null?a:globalThis.fetch)(d,{method:"GET",headers:co(p,`ai-sdk/${go}`,uo()),credentials:f});if(y.status===204)return null;if(!y.ok)throw new Error((i=await y.text())!=null?i:"Failed to fetch the chat response.");if(!y.body)throw new Error("The response body is empty.");return this.processResponseStream(y.body)}},rc=class extends gw{constructor(e={}){super(e)}processResponseStream(e){return j_({stream:e,schema:lw}).pipeThrough(new TransformStream({async transform(t,s){if(!t.success)throw t.error;s.enqueue(t.value)}}))}},vw=class{constructor({generateId:e=qx,id:t=e(),transport:s=new rc,messageMetadataSchema:n,dataPartSchemas:a,state:i,onError:r,onToolCall:o,onFinish:u,onData:l,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new hw,this.sendMessage=async(d,p)=>{var f,m,y,v;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(f=this.lastMessage)==null?void 0:f.id,...p});return}let g;if("text"in d||"files"in d?g={parts:[...Array.isArray(d.files)?d.files:await mw(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:g=d,d.messageId!=null){const A=this.state.messages.findIndex(h=>h.id===d.messageId);if(A===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[A].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,A+1),this.state.replaceMessage(A,{...g,id:d.messageId,role:(m=g.role)!=null?m:"user",metadata:d.metadata})}else this.state.pushMessage({...g,id:(y=g.id)!=null?y:this.generateId(),role:(v=g.role)!=null?v:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...p})},this.regenerate=async({messageId:d,...p}={})=>{const f=d==null?this.state.messages.length-1:this.state.messages.findIndex(m=>m.id===d);if(f===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[f].role==="assistant"?f:f+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...p})},this.resumeStream=async(d={})=>{await this.makeRequest({trigger:"resume-stream",...d})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:d,approved:p,reason:f})=>this.jobExecutor.run(async()=>{const m=this.state.messages,y=m[m.length-1],v=g=>Cs(g)&&g.state==="approval-requested"&&g.approval.id===d?{...g,state:"approval-responded",approval:{id:d,approved:p,reason:f}}:g;this.state.replaceMessage(m.length-1,{...y,parts:y.parts.map(v)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(v)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(g=>{var A;g&&this.makeRequest({trigger:"submit-message",messageId:(A=this.lastMessage)==null?void 0:A.id})})}),this.addToolOutput=async({state:d="output-available",tool:p,toolCallId:f,output:m,errorText:y})=>this.jobExecutor.run(async()=>{const v=this.state.messages,g=v[v.length-1],A=h=>Cs(h)&&h.toolCallId===f?{...h,state:d,output:m,errorText:y}:h;this.state.replaceMessage(v.length-1,{...g,parts:g.parts.map(A)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(A)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(h=>{var M;h&&this.makeRequest({trigger:"submit-message",messageId:(M=this.lastMessage)==null?void 0:M.id})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var d;this.status!=="streaming"&&this.status!=="submitted"||(d=this.activeResponse)!=null&&d.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=s,this.generateId=e,this.messageMetadataSchema=n,this.dataPartSchemas=a,this.state=i,this.onError=r,this.onToolCall=o,this.onFinish=u,this.onData=l,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;const e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:s,body:n,messageId:a}){var i,r,o;let u;if(e==="resume-stream")try{const f=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:s,body:n});if(f==null)return;u=f}catch(f){this.onError&&f instanceof Error&&this.onError(f),this.setStatus({status:"error",error:f});return}this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let c=!1,d=!1,p=!1;try{const f={state:dw({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};f.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=f;let m;e==="resume-stream"?m=u:m=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:f.abortController.signal,metadata:t,headers:s,body:n,trigger:e,messageId:a});const y=v=>this.jobExecutor.run(()=>v({state:f.state,write:()=>{var g;this.setStatus({status:"streaming"}),f.state.message.id===((g=this.lastMessage)==null?void 0:g.id)?this.state.replaceMessage(this.state.messages.length-1,f.state.message):this.state.pushMessage(f.state.message)}}));await fw({stream:pw({stream:m,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:y,onError:v=>{throw v}}),onError:v=>{throw v}}),this.setStatus({status:"ready"})}catch(f){if(c||f.name==="AbortError")return c=!0,this.setStatus({status:"ready"}),null;p=!0,f instanceof TypeError&&(f.message.toLowerCase().includes("fetch")||f.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&f instanceof Error&&this.onError(f),this.setStatus({status:"error",error:f})}finally{try{(r=this.onFinish)==null||r.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:d,isError:p,finishReason:(i=this.activeResponse)==null?void 0:i.state.finishReason})}catch(f){console.error(f)}this.activeResponse=void 0}!p&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(o=this.lastMessage)==null?void 0:o.id,metadata:t,headers:s,body:n})}};function yw({messages:e}){const t=e[e.length-1];if(!t||t.role!=="assistant")return!1;const s=t.parts.reduce((a,i,r)=>i.type==="step-start"?r:a,-1),n=t.parts.slice(s+1).filter(Cs).filter(a=>!a.providerExecuted);return n.filter(a=>a.state==="approval-responded").length>0&&n.every(a=>a.state==="output-available"||a.state==="output-error"||a.state==="approval-responded")}var bw=class{constructor(e){this.statusRef=K("ready"),this.errorRef=K(void 0),this.pushMessage=t=>{this.messagesRef.value=[...this.messagesRef.value,t]},this.popMessage=()=>{this.messagesRef.value=this.messagesRef.value.slice(0,-1)},this.replaceMessage=(t,s)=>{this.messagesRef.value[t]={...s}},this.snapshot=t=>t,this.messagesRef=K(e??[])}get messages(){return this.messagesRef.value}set messages(e){this.messagesRef.value=e}get status(){return this.statusRef.value}set status(e){this.statusRef.value=e}get error(){return this.errorRef.value}set error(e){this.errorRef.value=e}},xw=class extends vw{constructor({messages:e,...t}){super({...t,state:new bw(e)})}};const _w=e=>{if(e)return typeof e=="function"?e():e};function ww(e){const t=$o(),s=e??{},n=K(t.agentSelectedProvider),a=K(t.agentSelectedModel),i=R(()=>zs.find(y=>y.id===n.value)||zs[0]),r=R(()=>i.value.models),o=R(()=>t.agentApiKeyConfigs[n.value]||""),u=R(()=>!!o.value),l=new xw({transport:new rc({api:s.api??"",body:()=>({..._w(s.body),provider:n.value,model:a.value,apiKey:o.value})}),sendAutomaticallyWhen:s.sendAutomaticallyWhen}),c=R(()=>l.messages),d=R(()=>l.status!=="ready"&&l.status!=="error"),p=R(()=>{var y;return((y=l.error)==null?void 0:y.message)??null});return Te(n,y=>{var g,A;const v=(g=zs.find(h=>h.id===y))==null?void 0:g.models;v&&!v.some(h=>h.id===a.value)&&(a.value=((A=v[0])==null?void 0:A.id)||"")}),{selectedProvider:n,selectedModel:a,isLoading:d,error:p,messages:c,hasApiKey:u,currentProvider:i,currentApiKey:o,models:r,sendMessage:async y=>{!y.trim()||!u.value||d.value||await l.sendMessage({text:y})},clearChat:()=>{l.messages.splice(0,l.messages.length)},addToolApprovalResponse:l.addToolApprovalResponse,stopStream:l.stop,clearError:l.clearError,providers:zs}}function Sw(e,t){return t.length===0?e:`[Tool hints]
21
- ${Vu(t).map(a=>`${a.label}: ${a.promptHint}`).join(`
22
- `)}
23
-
24
- ${e}`}function Tw(e){const t=td(),s=sd(),n=ww({api:"/api/ai/agent",body:()=>{var r,o;return{dbConnectionString:(r=s.selectedConnection)==null?void 0:r.connectionString,dbType:(o=s.selectedConnection)==null?void 0:o.type,schemaSnapshots:t.activeSchemas||[],sendReasoning:(e==null?void 0:e.value)??!0}},sendAutomaticallyWhen:yw}),a=()=>{if(!nd(n.messages.value))return;const r=ad(n.messages.value);n.messages.value.splice(0,n.messages.value.length,...r)};return{...n,sendMessage:async(r,o=[])=>{a();const u=Sw(r,o);await n.sendMessage(u)}}}const Oe={GenerateQuery:"generate_query",RenderTable:"render_table",VisualizeTable:"visualize_table",ExplainQuery:"explain_query",DetectAnomaly:"detect_anomaly",DescribeTable:"describe_table",ExportQueryResult:"export_query_result",ExportContent:"export_content",ListSchemas:"list_schemas",GetTableSchema:"get_table_schema",RenderErd:"render_erd",AskClarification:"askClarification"},Aw=[Oe.GenerateQuery,Oe.RenderTable,Oe.VisualizeTable,Oe.ExplainQuery,Oe.DetectAnomaly,Oe.DescribeTable,Oe.ExportQueryResult,Oe.ExportContent,Oe.ListSchemas,Oe.GetTableSchema,Oe.RenderErd],Cw=/^#{1,6}\s|(\*\*|__).+(\*\*|__)|^[-*]\s|^\d+\.\s|^\|.+\|/m,kw=/```([\w-]*)\n?([\s\S]*?)```/g,Ew={generate_query:jb,render_table:Wb,visualize_table:sx,explain_query:kb,detect_anomaly:eb,describe_table:Fn,export_query_result:Yr,export_content:Yr,list_schemas:Fn,get_table_schema:Fn,render_erd:bb},Pw={generate_query:"Generating query...",render_table:"Running query...",visualize_table:"Building chart...",explain_query:"Analyzing query...",detect_anomaly:"Scanning data...",describe_table:"Reading schema...",export_query_result:"Fetching & exporting...",export_content:"Preparing export...",list_schemas:"Listing schemas...",get_table_schema:"Reading table schema...",render_erd:"Building ERD diagram..."},Iw=e=>Aw.includes(e),yo=(e,t)=>{const s=t.trim();s&&e.push({kind:Cw.test(s)?"markdown":"text",content:s})},Mw=(e,t=!1)=>{var a;const s=[];let n=0;for(const i of e.matchAll(kw)){const r=i.index??0;yo(s,e.slice(n,r));const o=i[1]||"text",u=((a=i[2])==null?void 0:a.trimEnd())||"";o==="mermaid"?s.push({kind:"mermaid",code:u}):s.push({kind:"code",language:o,code:u}),n=r+i[0].length}if(yo(s,e.slice(n)),t)for(let i=s.length-1;i>=0;i-=1){const r=s[i];if((r==null?void 0:r.kind)==="text"||(r==null?void 0:r.kind)==="markdown"||(r==null?void 0:r.kind)==="code"){r.isStreaming=!0;break}}return s},oc=e=>e.errorText||e.message||e.error||"Something went wrong.",Rw=e=>{var s,n,a;const t=String(e.type||"").replace(/^tool-/,"");return t===Oe.AskClarification?e.state==="output-available"?[{kind:"quiz",toolCallId:String(e.toolCallId||""),context:String(((s=e.input)==null?void 0:s.context)||""),questions:Array.isArray((n=e.input)==null?void 0:n.questions)?e.input.questions:[]}]:[]:Iw(t)?e.state==="input-streaming"||e.state==="input-available"?[{kind:"loading",toolName:t,toolCallId:e.toolCallId,label:Pw[t]}]:e.state==="approval-requested"?[{kind:"approval",toolName:t,toolCallId:e.toolCallId,input:e.input,approvalId:((a=e.approval)==null?void 0:a.id)||e.toolCallId}]:e.state==="output-available"?[{kind:"tool",toolName:t,toolCallId:e.toolCallId,result:e.output}]:e.state==="output-error"?[{kind:"error",message:oc(e)}]:e.state==="output-denied"?[{kind:"error",message:"Execution was denied. No database changes were made."}]:[]:[]},Dw=e=>{if(e.type==="text")return Mw(typeof e.text=="string"?e.text:"",e.state==="streaming");if(e.type==="reasoning"){const t=typeof e.text=="string"?e.text.trim():"";return t?[{kind:"reasoning",content:t,isStreaming:e.state==="streaming"}]:[]}return e.type==="source-url"?[{kind:"source",sourceId:e.sourceId||"",url:e.url,title:e.title}]:e.type==="source-document"?[{kind:"source",sourceId:e.sourceId||"",title:e.title,mediaType:e.mediaType,filename:e.filename}]:typeof e.type=="string"&&e.type.startsWith("tool-")?Rw(e):e.type==="error"?[{kind:"error",message:oc(e)}]:[]};function Vw(e){const t=R(()=>{const i=e.value??[],r=[];for(let o=0;o<i.length;o++){const u=i[o];if(u.role==="system")continue;const l=u.parts??[],c=[];for(let p=0;p<l.length;p++){const f=Dw(l[p]);f!=null&&f.length&&c.push(...f)}if(c.length===0)continue;const d=[];for(const p of c){const f=d[d.length-1];if(p.kind==="reasoning"&&(f==null?void 0:f.kind)==="reasoning"){const m=[f.content,p.content].filter(Boolean).join(`
25
-
26
- `);d[d.length-1]={kind:"reasoning",content:m,isStreaming:f.isStreaming||p.isStreaming}}else d.push(p)}r.push({id:u.id,role:u.role,blocks:d})}return r}),s=R(()=>t.value.some(i=>i.blocks.some(r=>r.kind==="approval"))),n=i=>Ew[i]||null,a=R(()=>{const i=t.value[t.value.length-1];if(!i)return null;const r=i.blocks[i.blocks.length-1];return r?r.kind:null});return{renderedMessages:t,hasMutationPending:s,getComponent:n,getLastPartKindMessage:a}}const $w=["motion-key","initial"],bo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=[]{}|;:,.<>?/~アイウエオカキクケコサシスセソタチツテトナニヌネノ░▒▓█▌▐▄▀■□▪▫▲△▼▽◆◇○●◎∞≈≠≤≥±÷×√∑πΩµ",Lw=X({__name:"ScrambleText",props:{texts:{},duration:{default:800},speed:{default:55},loop:{type:Boolean,default:!0},loopDelay:{default:600}},setup(e){const t=e,s=K([]);let n=0,a=0,i=0,r=0,o="scramble",u=0,l=[];function c(){return bo[Math.random()*bo.length|0]}function d(){return Math.random()>.5?1:-1}function p(){l=[...t.texts[r]],s.value=l.map(()=>({char:"",reveal:!1,dir:d(),v:0}))}function f(m){const y=l.length,v=y/2|0;a||(a=m);const g=m-a;if(o==="scramble"){if(m-i>t.speed){for(let A=0;A<y;A++)s.value[A].reveal||(s.value[A].char=c(),s.value[A].v++);i=m}g>t.duration&&(o="reveal",u=m)}if(o==="reveal"){const A=m-u;for(let h=0;h<y;h++){const M=Math.abs(h-v)*40;A>M&&!s.value[h].reveal&&(s.value[h].char=l[h],s.value[h].reveal=!0,s.value[h].v++)}A>v*40+200&&(o="wait",a=m)}o==="wait"&&m-a>t.loopDelay&&(r=(r+1)%t.texts.length,p(),o="scramble",a=m),n=requestAnimationFrame(f)}return dn(()=>{p(),n=requestAnimationFrame(f)}),ko(()=>{cancelAnimationFrame(n)}),(m,y)=>{const v=rd("motion");return _(),k("span",Bt({class:"inline-flex select-none"},m.$attrs),[(_(!0),k(he,null,Re(s.value,(g,A)=>id((_(),k("span",{key:A,"motion-key":g.v,initial:{opacity:0,y:g.dir*16,scale:.9},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:260,damping:20},class:"inline-block will-change-transform transform-gpu"},[z(D(g.char),1)],8,$w)),[[v]])),128))],16)}}}),Ow={class:"relative h-full w-full bg-[radial-gradient(circle_at_top,_hsl(var(--primary)/0.12),transparent_40%),linear-gradient(180deg,hsl(var(--background)),hsl(var(--background)))]"},Nw={class:"absolute inset-0 flex flex-col overflow-hidden"},Bw={class:"mx-auto shadow-xs flex w-full flex-col gap-4 px-3 py-2 lg:flex-row lg:items-center lg:justify-between bg-background/50 backdrop-blur-sm"},jw={class:"flex flex-1 items-center gap-2 min-w-0 text-sm leading-4 font-medium text-foreground"},Fw={key:0,class:"flex-1 max-w-md"},zw={class:"truncate text-foreground"},qw={class:"flex shrink-0 items-center gap-2"},Uw={class:"mx-auto flex min-h-full w-full max-w-5xl flex-col px-6 py-8"},Gw={key:2,class:"w-full pb-6"},Hw={class:"space-y-4"},Zw={key:0,class:"flex gap-1 items-center mt-2"},Ww={class:"font-medium text-muted-foreground chat-text"},Kw={key:1,class:"mt-4 overflow-hidden rounded-2xl border border-destructive/15 bg-destructive/5 backdrop-blur-sm"},Yw={class:"flex items-start gap-3 px-4 py-3"},Xw={class:"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full bg-destructive/10"},Jw={class:"min-w-0 flex-1"},Qw={class:"mt-0.5 text-sm leading-relaxed text-destructive"},k1=X({__name:"AgentWorkspace",setup(e){const t=K(null);Co("activeExportPreview",t);const{activeHistory:s,histories:n,showAttachmentPanel:a,showReasoning:i,saveConversation:r,startNewChat:o,renameHistory:u}=od(),l=K(!1),c=K(""),d=K(null),p=()=>{s.value&&(c.value=s.value.title,l.value=!0,Ye(()=>{var L,B;(L=d.value)==null||L.focus(),(B=d.value)==null||B.select()}))},f=()=>{if(!s.value||!l.value)return;const L=c.value.trim();L&&L!==s.value.title&&u(s.value.id,L),l.value=!1},m=()=>{l.value=!1},y=$o(),v=R(()=>y.chatUiConfigs.thinkingStyle),{selectedProvider:g,selectedModel:A,isLoading:h,error:M,messages:E,hasApiKey:I,currentProvider:T,sendMessage:S,addToolApprovalResponse:N,stopStream:$}=Tw(i),{renderedMessages:U,getComponent:j,getLastPartKindMessage:ie}=Vw(E),P=K(""),O=K([]),q=K(null),J=K(null),ee=K(!1),G=K(null),te=L=>JSON.parse(JSON.stringify(L)),se=K(!1),ne=K(null),Se=K(0),ge=K({});let Ze=null;Te(a,L=>{L&&(t.value=null)},{immediate:!0}),Te(t,L=>{L&&(a.value=!1)});const st=R(()=>U.value.flatMap(L=>{if(L.role!=="assistant")return[];const B=(L.blocks??[]).map(le=>le.kind==="text"||le.kind==="markdown"||le.kind==="reasoning"?le.content:"").filter(Boolean).join(" ").trim().replace(/\s+/g," ");return[{id:L.id,type:"message",element:ge.value[L.id]??null,preview:B.length>80?B.slice(0,80)+"...":B||"Thinking..."}]})),jt=(L,B)=>{if(B instanceof HTMLElement){ge.value[L]=B;return}delete ge.value[L]},We=()=>{if(!q.value||st.value.length===0){Se.value=0;return}const{scrollTop:L,scrollHeight:B,clientHeight:le}=q.value;if(B-L-le<50){Se.value=st.value.length-1;return}const os=q.value.getBoundingClientRect().top;let _t=0;st.value.forEach((ls,Ns)=>{var Bs;(((Bs=ls.element)==null?void 0:Bs.getBoundingClientRect().top)??1/0)-os<=150&&(_t=Ns)}),Se.value=_t},is=()=>{if(!q.value)return;const{scrollTop:L,scrollHeight:B,clientHeight:le}=q.value;se.value=B-L-le>150,We()},ze=(L=!1)=>{q.value&&(q.value.scrollTo({top:q.value.scrollHeight,behavior:L===!0?"smooth":"auto"}),se.value=!1)};dn(()=>{setTimeout(()=>{ze()},100)});const Ft=L=>{E.value.splice(0,E.value.length,...L)},zt=async L=>{if(L==null||L.preventDefault(),!P.value.trim()||h.value)return;const B=P.value.trim(),le=[...O.value];P.value="",O.value=[],S(B,le),await Ye(),ze()},$s=L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),zt(L))},Ls=async L=>{P.value=L,await Ye(),await zt()},yt=()=>{$()},rt=()=>{o(),O.value=[],Ft([])},bt=async(L,B)=>{await N({id:L,approved:B})},yn=async L=>{var B;P.value=L,await Ye(),(B=J.value)==null||B.focusInput()},ot=L=>{const B=st.value[L];if(!(B!=null&&B.element)||(Se.value=L,ne.value=B.id,Ze&&clearTimeout(Ze),Ze=setTimeout(()=>{ne.value=null},250),!q.value))return;const le=q.value,os=B.element.getBoundingClientRect().top,_t=le.getBoundingClientRect().top,ls=le.scrollTop;le.scrollTo({top:ls+(os-_t)-24,behavior:"smooth"})},bn=cd(()=>{ee.value||E.value.length===0||r({messages:te(E.value),provider:g.value,model:A.value,showReasoning:i.value})},250);Te(()=>{var L;return((L=s.value)==null?void 0:L.id)??null},async L=>{L!==G.value&&(ee.value=!0,G.value=L,L&&s.value?(Ft(te(s.value.messages)),s.value.provider&&(g.value=s.value.provider),s.value.model&&(A.value=s.value.model),typeof s.value.showReasoning=="boolean"&&(i.value=s.value.showReasoning)):E.value.length>0&&Ft([]),await Ye(),ze(),ee.value=!1)},{immediate:!0}),Te(()=>E.value.length,async()=>{await Ye(),ze(),We()}),Te(()=>{const L=E.value.at(-1);return L!=null&&L.parts?L.parts.map(B=>B.type==="text"||B.type==="reasoning"?B.text||"":JSON.stringify(B)).join(""):""},async()=>{await Ye(),ze(),We()}),Te(()=>U.value.flatMap(L=>L.role!=="assistant"?[]:[L.id]),L=>{const B={};for(const le of L)ge.value[le]&&(B[le]=ge.value[le]);ge.value=B}),Ra(()=>{Ze&&clearTimeout(Ze)}),Te(()=>[E.value,A.value,g.value,i.value],()=>{!E.value.length||ee.value||bn()},{deep:!0});const xt=R(()=>{const L=E.value[0];if(!L||!L.parts||!L.parts.length)return"New Chat";const B=L.parts[0];return typeof B=="object"&&"text"in B?B.text:"New Chat"}),Os=async L=>{await S(L),await Ye(),ze()},rs=R(()=>["Summarize the current schema and highlight the tables that matter most.","Suggest safe next steps for debugging a slow database query.","Write a query plan for the report I need before generating SQL."].filter(L=>!!L)),lc=R(()=>U.value),{attachments:uc}=Du(lc),hi=R(()=>uc.value.length);return(L,B)=>{const le=ye,os=ld,_t=Ae,ls=li,Ns=dd,mi=pd,Bs=fd;return _(),k("section",Ow,[x(Bs,{direction:"horizontal",class:"h-full w-full"},{default:C(()=>[x(Ns,{"default-size":t.value||b(a)?60:100,class:"h-full relative"},{default:C(()=>{var js;return[w("div",Nw,[w("div",Bw,[w("div",jw,[x(le,{name:"hugeicons:chatting-01",class:"size-4! shrink-0"}),l.value?(_(),k("div",Fw,[x(os,{ref_key:"titleInputRef",ref:d,modelValue:c.value,"onUpdate:modelValue":B[0]||(B[0]=be=>c.value=be),class:"h-7 text-xs py-0",onKeydown:[Gn(f,["enter"]),Gn(m,["escape"])],onBlur:f},null,8,["modelValue"])])):(_(),k("div",{key:1,class:"flex items-center gap-2 truncate group cursor-pointer",onClick:p},[w("span",zw,D(((js=b(s))==null?void 0:js.title)||xt.value),1),x(le,{name:"hugeicons:edit-02",class:"size-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]))]),w("div",qw,[x(_t,{size:"xs",variant:"ghost",onClick:B[1]||(B[1]=be=>a.value=!b(a)),class:"relative"},{default:C(()=>[B[10]||(B[10]=z(" Attachment ")),x(le,{name:"hugeicons:attachment",class:"size-3"}),hi.value>0?(_(),H(b(Ve),{key:0,variant:"secondary",class:"absolute -top-1 -right-1 h-4 min-w-4 px-1 text-xxs font-normal"},{default:C(()=>[z(D(hi.value),1)]),_:1})):Z("",!0)]),_:1}),x(_t,{size:"xs",variant:"outline",onClick:rt},{default:C(()=>[B[11]||(B[11]=z(" New Thread ")),x(le,{name:"hugeicons:plus-sign",class:"size-3"})]),_:1})])]),w("div",{ref_key:"messagesContainer",ref:q,class:"flex-1 overflow-y-auto min-h-0",onScroll:is},[w("div",Uw,[b(I)?b(U).length===0?(_(),H(hx,{key:1,"prompt-cards":rs.value,"thread-count":b(n).length,onPrompt:Ls},null,8,["prompt-cards","thread-count"])):(_(),k("div",Gw,[w("div",Hw,[(_(!0),k(he,null,Re(b(U),be=>{var gi;return _(),k("div",{key:be.id},[x(ix,{message:be,"get-tool-component":b(j),"show-reasoning":b(i),"highlighted-response-id":ne.value,"register-message-element":jt,"is-streaming":b(h)&&be.role==="assistant"&&be.id===((gi=b(U).at(-1))==null?void 0:gi.id),onApproval:bt,onEdit:yn,onQuizSubmit:Os},null,8,["message","get-tool-component","show-reasoning","highlighted-response-id","is-streaming"])])}),128))]),b(h)?(_(),k("div",Zw,[x(le,{class:"size-7! text-primary",name:"icons:logo-8-bits"}),w("div",Ww,[v.value===b(ud).Shimmer?(_(),H(ls,{key:0},{default:C(()=>B[12]||(B[12]=[z(" Thinking... ")])),_:1})):(_(),H(b(Lw),{key:1,texts:["Thinking...","Orca_Thinking",b(ie)||""]},null,8,["texts"]))])])):Z("",!0),b(M)?(_(),k("div",Kw,[w("div",Yw,[w("div",Xw,[x(le,{name:"lucide:alert-triangle",class:"size-3.5 text-destructive/90"})]),w("div",Jw,[B[13]||(B[13]=w("p",{class:"text-[11px] font-semibold uppercase tracking-wider text-destructive/70"}," Error ",-1)),w("p",Qw,D(b(M)),1)])])])):Z("",!0)])):(_(),H(lx,{key:0,class:"my-auto","current-provider":b(T)},null,8,["current-provider"]))])],544),st.value.length>0?(_(),H(wx,{key:0,responses:st.value,"current-index":Se.value,onNavigate:ot},null,8,["responses","current-index"])):Z("",!0),x(U0,{ref_key:"footerRef",ref:J,modelValue:P.value,"onUpdate:modelValue":B[2]||(B[2]=be=>P.value=be),provider:b(g),"onUpdate:provider":B[3]||(B[3]=be=>_i(g)?g.value=be:null),model:b(A),"onUpdate:model":B[4]||(B[4]=be=>_i(A)?A.value=be:null),"selected-command-options":O.value,"onUpdate:selectedCommandOptions":B[5]||(B[5]=be=>O.value=be),"is-loading":b(h),"has-api-key":b(I),"show-reasoning":b(i),"show-scroll-button":se.value,onSubmit:zt,onStop:yt,onKeydown:$s,"onUpdate:showReasoning":B[6]||(B[6]=be=>i.value=be),onScrollToBottom:B[7]||(B[7]=be=>ze(!0))},null,8,["modelValue","provider","model","selected-command-options","is-loading","has-api-key","show-reasoning","show-scroll-button"])])]}),_:1},8,["default-size"]),t.value||b(a)?(_(),k(he,{key:0},[x(mi,{"with-handle":"",class:"[&[data-state=hover]]:bg-primary/30! [&[data-state=drag]]:bg-primary/20!"}),x(Ns,{"min-size":20,"max-size":60,"default-size":30,class:"h-full relative"},{default:C(()=>[t.value?(_(),H(Vx,{key:0,result:t.value,onClose:B[8]||(B[8]=js=>t.value=null)},null,8,["result"])):b(a)?(_(),H(y0,{key:1,messages:b(U),onClose:B[9]||(B[9]=js=>a.value=!1)},null,8,["messages"])):Z("",!0)]),_:1})],64)):Z("",!0)]),_:1})])}}});export{k1 as default};