orcaq 1.0.28 → 1.0.30

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 (204) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{S6q6IfIg.js → 6I72R6kW.js} +1 -1
  3. package/.output/public/_nuxt/{W0T58tNs.js → 8_EuFD3X.js} +1 -1
  4. package/.output/public/_nuxt/B6H7odCi.js +1 -0
  5. package/.output/public/_nuxt/B7nSJBpY.js +1 -0
  6. package/.output/public/_nuxt/{B-o1cyu1.js → BBNxNerU.js} +1 -1
  7. package/.output/public/_nuxt/BDKd-SA5.js +1 -0
  8. package/.output/public/_nuxt/{DAsY4LnG.js → BDRdbLz0.js} +1 -1
  9. package/.output/public/_nuxt/{T2yrk5P8.js → BKWWO5HE.js} +1 -1
  10. package/.output/public/_nuxt/{DhSSuHOz.js → BV6TSzbC.js} +4 -1
  11. package/.output/public/_nuxt/{BranJUWp.js → BVKG-F8j.js} +1 -1
  12. package/.output/public/_nuxt/{BHFnD9yO.js → BoGW82nK.js} +1 -1
  13. package/.output/public/_nuxt/Bs_ItSbk.js +1 -0
  14. package/.output/public/_nuxt/{BZEKLHO-.js → Btu7FO8S.js} +1 -1
  15. package/.output/public/_nuxt/C04Tz2vC.js +67 -0
  16. package/.output/public/_nuxt/{DNmOzKte.js → C4JPKbJK.js} +1 -1
  17. package/.output/public/_nuxt/{B7iORLht.js → C5KSeJUi.js} +5 -5
  18. package/.output/public/_nuxt/CDnZBTSk.js +1 -0
  19. package/.output/public/_nuxt/CKq06U7u.js +19 -0
  20. package/.output/public/_nuxt/{vU5dtBjy.js → CQpD-JHn.js} +1 -1
  21. package/.output/public/_nuxt/{DdMwxl0I.js → C_CjS9Yt.js} +1 -1
  22. package/.output/public/_nuxt/{BRpeq4XL.js → Chcc8yNZ.js} +1 -1
  23. package/.output/public/_nuxt/{Dwm3kp4S.js → ClnidwGv.js} +86 -86
  24. package/.output/public/_nuxt/{BV4_2PzU.js → CpzDNDcD.js} +1 -1
  25. package/.output/public/_nuxt/Cs1HkKH7.js +1 -0
  26. package/.output/public/_nuxt/{DgPgl0Vt.js → CsYOf3m-.js} +1 -1
  27. package/.output/public/_nuxt/{Ds4ET3BG.js → CtRc_P0d.js} +27 -27
  28. package/.output/public/_nuxt/Ctr2mpV9.js +2 -0
  29. package/.output/public/_nuxt/{SzZsnvJ-.js → CzF1NEwP.js} +1 -1
  30. package/.output/public/_nuxt/{D4jtSPyP.js → D2j2esR5.js} +2 -2
  31. package/.output/public/_nuxt/D4ZGn1tW.js +1 -0
  32. package/.output/public/_nuxt/{B3XOCDJg.js → D6YseYA6.js} +1 -1
  33. package/.output/public/_nuxt/{CbjqLbgu.js → D7EPcL9i.js} +1 -1
  34. package/.output/public/_nuxt/{DfL_wWxk.js → DCMJS6Fh.js} +1 -1
  35. package/.output/public/_nuxt/{rdXrKZa8.js → DFd73eNR.js} +1 -1
  36. package/.output/public/_nuxt/{BUuSKT2f.js → DQiMjOqm.js} +15 -15
  37. package/.output/public/_nuxt/{BQAF7cM_.js → DVe5MHjS.js} +1 -1
  38. package/.output/public/_nuxt/{BsnN2mQb.js → D_G1mAJ8.js} +2 -2
  39. package/.output/public/_nuxt/{DM73sEXg.js → De1hkrJC.js} +1 -1
  40. package/.output/public/_nuxt/DlfHMoPT.js +1 -0
  41. package/.output/public/_nuxt/{BIW9Rd2L.js → DnCs9xpG.js} +1 -1
  42. package/.output/public/_nuxt/DvJ2MjiW.js +2 -0
  43. package/.output/public/_nuxt/DynamicTable.B3c2woGb.css +1 -0
  44. package/.output/public/_nuxt/{CAcIcjka.js → DzJD_fir.js} +3 -3
  45. package/.output/public/_nuxt/{UrLgZoyE.js → Dzr_z_mY.js} +1 -1
  46. package/.output/public/_nuxt/{DftZZFKd.js → FyrDS92w.js} +104 -104
  47. package/.output/public/_nuxt/{BlWNlw-C.js → HQyqkOpZ.js} +1 -1
  48. package/.output/public/_nuxt/{BwddCgOY.js → KlH93fIm.js} +1 -1
  49. package/.output/public/_nuxt/{iDT-eQ46.js → MLO1tLKS.js} +1 -1
  50. package/.output/public/_nuxt/{D8s-WG7x.js → OEVyCyyD.js} +1 -1
  51. package/.output/public/_nuxt/{_fileId_.B3PtfMYN.css → _fileId_.DDOcnoDQ.css} +1 -1
  52. package/.output/public/_nuxt/builds/latest.json +1 -1
  53. package/.output/public/_nuxt/builds/meta/0ab6db39-d52b-46b9-a687-0df3b4c65db5.json +1 -0
  54. package/.output/public/_nuxt/builds/meta/dev.json +1 -0
  55. package/.output/public/_nuxt/{CQNFvXDN.js → e_Ir8LP9.js} +1 -1
  56. package/.output/public/_nuxt/entry.XV7TCKso.css +1 -0
  57. package/.output/public/_nuxt/{DpyvTVPg.js → fRxmPZZB.js} +1 -1
  58. package/.output/public/_nuxt/{B0pvfm-W.js → h2fvG4Xe.js} +1 -1
  59. package/.output/public/_nuxt/llxtZpFD.js +160 -0
  60. package/.output/public/_nuxt/{CQr87mff.js → q4KcRwD-.js} +1 -1
  61. package/.output/public/_nuxt/{Cqe10li5.js → qIKg23Pc.js} +1 -1
  62. package/.output/public/_nuxt/{aKVabwds.js → txD20ixW.js} +1 -1
  63. package/.output/public/_nuxt/{CwtNS48a.js → ubO-cWd-.js} +1 -1
  64. package/.output/public/_nuxt/x2HBvptj.js +1 -0
  65. package/.output/public/_nuxt/{lN7hePE6.js → y68LmDX2.js} +1 -1
  66. package/.output/server/chunks/build/client.manifest.mjs +394 -382
  67. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  68. package/.output/server/chunks/nitro/nitro.mjs +389 -372
  69. package/.output/server/chunks/routes/api/ai/agent.mjs +1 -0
  70. package/.output/server/chunks/routes/api/ai/agent.mjs.map +1 -1
  71. package/.output/server/chunks/routes/api/ai/chat.mjs +1 -0
  72. package/.output/server/chunks/routes/api/ai/chat.mjs.map +1 -1
  73. package/.output/server/chunks/routes/api/database-export/export-database.mjs +1 -0
  74. package/.output/server/chunks/routes/api/database-export/export-database.mjs.map +1 -1
  75. package/.output/server/chunks/routes/api/database-import/import-database.mjs +1 -0
  76. package/.output/server/chunks/routes/api/database-import/import-database.mjs.map +1 -1
  77. package/.output/server/chunks/routes/api/database-roles/create-role.mjs +1 -0
  78. package/.output/server/chunks/routes/api/database-roles/create-role.mjs.map +1 -1
  79. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs +1 -0
  80. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs.map +1 -1
  81. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs +1 -0
  82. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs.map +1 -1
  83. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs +1 -0
  84. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs.map +1 -1
  85. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs +1 -0
  86. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs.map +1 -1
  87. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs +1 -0
  88. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs.map +1 -1
  89. package/.output/server/chunks/routes/api/database-roles/get-role.mjs +1 -0
  90. package/.output/server/chunks/routes/api/database-roles/get-role.mjs.map +1 -1
  91. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs +1 -0
  92. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs.map +1 -1
  93. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs +1 -0
  94. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs.map +1 -1
  95. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs +1 -0
  96. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs.map +1 -1
  97. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs +1 -0
  98. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs.map +1 -1
  99. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs +1 -0
  100. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs.map +1 -1
  101. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs +1 -0
  102. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs.map +1 -1
  103. package/.output/server/chunks/routes/api/functions/definition.post.mjs +1 -0
  104. package/.output/server/chunks/routes/api/functions/definition.post.mjs.map +1 -1
  105. package/.output/server/chunks/routes/api/functions/delete.post.mjs +1 -0
  106. package/.output/server/chunks/routes/api/functions/delete.post.mjs.map +1 -1
  107. package/.output/server/chunks/routes/api/functions/overview.post.mjs +1 -0
  108. package/.output/server/chunks/routes/api/functions/overview.post.mjs.map +1 -1
  109. package/.output/server/chunks/routes/api/functions/rename.post.mjs +1 -0
  110. package/.output/server/chunks/routes/api/functions/rename.post.mjs.map +1 -1
  111. package/.output/server/chunks/routes/api/functions/signature.post.mjs +1 -0
  112. package/.output/server/chunks/routes/api/functions/signature.post.mjs.map +1 -1
  113. package/.output/server/chunks/routes/api/functions/update.post.mjs +1 -0
  114. package/.output/server/chunks/routes/api/functions/update.post.mjs.map +1 -1
  115. package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs +1 -0
  116. package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs.map +1 -1
  117. package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs +1 -0
  118. package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs.map +1 -1
  119. package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs +1 -0
  120. package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs.map +1 -1
  121. package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs +1 -0
  122. package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs.map +1 -1
  123. package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs +1 -0
  124. package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs.map +1 -1
  125. package/.output/server/chunks/routes/api/instance-insights/state.post.mjs +1 -0
  126. package/.output/server/chunks/routes/api/instance-insights/state.post.mjs.map +1 -1
  127. package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs +1 -0
  128. package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs.map +1 -1
  129. package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs +1 -0
  130. package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs.map +1 -1
  131. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +1 -0
  132. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -1
  133. package/.output/server/chunks/routes/api/metadata/erd.post.mjs +1 -0
  134. package/.output/server/chunks/routes/api/metadata/erd.post.mjs.map +1 -1
  135. package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs +1 -0
  136. package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs.map +1 -1
  137. package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs +1 -0
  138. package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs.map +1 -1
  139. package/.output/server/chunks/routes/api/metrics/monitor.post.mjs +1 -0
  140. package/.output/server/chunks/routes/api/metrics/monitor.post.mjs.map +1 -1
  141. package/.output/server/chunks/routes/api/query/execute.post.mjs +1 -0
  142. package/.output/server/chunks/routes/api/query/execute.post.mjs.map +1 -1
  143. package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs +1 -0
  144. package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs.map +1 -1
  145. package/.output/server/chunks/routes/api/query/raw-execute.post.mjs +1 -0
  146. package/.output/server/chunks/routes/api/query/raw-execute.post.mjs.map +1 -1
  147. package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs +1 -0
  148. package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs.map +1 -1
  149. package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs +1 -0
  150. package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs.map +1 -1
  151. package/.output/server/chunks/routes/api/tables/ddl.post.mjs +1 -0
  152. package/.output/server/chunks/routes/api/tables/ddl.post.mjs.map +1 -1
  153. package/.output/server/chunks/routes/api/tables/export.post.mjs +1 -0
  154. package/.output/server/chunks/routes/api/tables/export.post.mjs.map +1 -1
  155. package/.output/server/chunks/routes/api/tables/indexes.post.mjs +1 -0
  156. package/.output/server/chunks/routes/api/tables/indexes.post.mjs.map +1 -1
  157. package/.output/server/chunks/routes/api/tables/meta.post.mjs +1 -0
  158. package/.output/server/chunks/routes/api/tables/meta.post.mjs.map +1 -1
  159. package/.output/server/chunks/routes/api/tables/overview.post.mjs +1 -0
  160. package/.output/server/chunks/routes/api/tables/overview.post.mjs.map +1 -1
  161. package/.output/server/chunks/routes/api/tables/rls.post.mjs +1 -0
  162. package/.output/server/chunks/routes/api/tables/rls.post.mjs.map +1 -1
  163. package/.output/server/chunks/routes/api/tables/rules.post.mjs +1 -0
  164. package/.output/server/chunks/routes/api/tables/rules.post.mjs.map +1 -1
  165. package/.output/server/chunks/routes/api/tables/size.post.mjs +1 -0
  166. package/.output/server/chunks/routes/api/tables/size.post.mjs.map +1 -1
  167. package/.output/server/chunks/routes/api/tables/structure.post.mjs +1 -0
  168. package/.output/server/chunks/routes/api/tables/structure.post.mjs.map +1 -1
  169. package/.output/server/chunks/routes/api/tables/triggers.post.mjs +1 -0
  170. package/.output/server/chunks/routes/api/tables/triggers.post.mjs.map +1 -1
  171. package/.output/server/chunks/routes/api/views/definition.post.mjs +1 -0
  172. package/.output/server/chunks/routes/api/views/definition.post.mjs.map +1 -1
  173. package/.output/server/chunks/routes/api/views/dependencies.post.mjs +1 -0
  174. package/.output/server/chunks/routes/api/views/dependencies.post.mjs.map +1 -1
  175. package/.output/server/chunks/routes/api/views/explain.post.mjs +1 -0
  176. package/.output/server/chunks/routes/api/views/explain.post.mjs.map +1 -1
  177. package/.output/server/chunks/routes/api/views/indexes.post.mjs +1 -0
  178. package/.output/server/chunks/routes/api/views/indexes.post.mjs.map +1 -1
  179. package/.output/server/chunks/routes/api/views/meta.post.mjs +1 -0
  180. package/.output/server/chunks/routes/api/views/meta.post.mjs.map +1 -1
  181. package/.output/server/chunks/routes/api/views/overview.post.mjs +1 -0
  182. package/.output/server/chunks/routes/api/views/overview.post.mjs.map +1 -1
  183. package/.output/server/chunks/routes/renderer.mjs +1 -0
  184. package/.output/server/index.mjs +1 -0
  185. package/.output/server/index.mjs.map +1 -1
  186. package/.output/server/package.json +1 -1
  187. package/bin/cli.mjs +55 -9
  188. package/package.json +1 -1
  189. package/.output/public/_nuxt/ACi_yrrw.js +0 -1
  190. package/.output/public/_nuxt/B-E3EDXq.js +0 -21
  191. package/.output/public/_nuxt/B-rj9QI0.js +0 -1
  192. package/.output/public/_nuxt/BDPGejuO.js +0 -2
  193. package/.output/public/_nuxt/BHp-OX9z.js +0 -1
  194. package/.output/public/_nuxt/BJdgR-zN.js +0 -1
  195. package/.output/public/_nuxt/BSs5g8DH.js +0 -1
  196. package/.output/public/_nuxt/CO-m0olR.js +0 -2
  197. package/.output/public/_nuxt/CQQKPHb8.js +0 -225
  198. package/.output/public/_nuxt/CfblXyCF.js +0 -1
  199. package/.output/public/_nuxt/D9SCXF1G.js +0 -1
  200. package/.output/public/_nuxt/DynamicTable.BW0D7NXb.css +0 -1
  201. package/.output/public/_nuxt/GqcI3eLm.js +0 -67
  202. package/.output/public/_nuxt/builds/meta/1e32d709-950d-49a3-8d61-1b3385318747.json +0 -1
  203. package/.output/public/_nuxt/entry.Kia9TCip.css +0 -1
  204. package/.output/public/_nuxt/mW-nBTJP.js +0 -1
@@ -1,8 +1,8 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BUuSKT2f.js","./DftZZFKd.js","./entry.Kia9TCip.css"])))=>i.map(i=>d[i]);
2
- var il=Object.defineProperty;var ol=t=>{throw TypeError(t)};var al=(t,e,n)=>e in t?il(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var We=(t,e,n)=>al(t,typeof e!="symbol"?e+"":e,n);var Re=(t,e,n)=>e.has(t)?ol("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{G as Xo,J as Qo,D as L,bU as mi,r as Y,bV as rl,aC as Se,aF as ll,aD as Rs,aE as Is,aT as Zo,bW as ul,bX as cl,d as X,aH as kt,bY as dl,E as Jo,bZ as hl,aB as fl,j as pl,c as K,o as b,s as ea,aG as Qt,n as re,e as M,f as ml,M as En,b_ as $s,bB as Kt,g as k,v as D,b as _,w as gl,aM as vl,q as we,a8 as Ne,br as ta,h as x,l as S,x as Bs,y as Os,m as _e,a as H,I as me,A as Fs,p as q,F as le,aR as De,bw as Zt,K as Rn,as as na,_ as yl,B as xl,C as bl,O as wl,Q as Sl,V as _l,T as Tl,aK as Al,aI as Ie,bi as kl,Y as Cl,b$ as sa,aL as Pl,k as Ml,bs as Dl,bl as Vl,aJ as Ll,R as El,be as gi,c0 as Rl,W as vi,c1 as Il}from"./DftZZFKd.js";import{h as $l,s as Bl,u as Ol,_ as Fl,a as jl,b as Nl}from"./vU5dtBjy.js";import{_ as zl,a as Ul,b as cn}from"./B3XOCDJg.js";import{_ as ql}from"./DAsY4LnG.js";import{g as Hl,c as Kl,a as Gl,b as Wl,d as Yl}from"./BUuSKT2f.js";import{u as ia,_ as Xl}from"./CAcIcjka.js";import{_ as Ql}from"./DNmOzKte.js";import{_ as Zl}from"./BIW9Rd2L.js";import{_ as yi,a as xi}from"./CQr87mff.js";import{_ as js}from"./Dwm3kp4S.js";import{D as oa,b as es,F as Ue,G as Jl,H as eu,I as tu,P as pe,J as bi,K as wi,L as aa,M as nu,N as Si,O as _i,Q as In,l as dn,f as ra,R as su,_ as Dt,T as la,U as Xe,V as iu,W as ua,Z as ou,X as hn,Y as $n,$ as Ti,a0 as au,a1 as ru,a2 as lu,a3 as uu,a4 as cu,a5 as du,a6 as hu,a7 as fu,a8 as Ai,a9 as ca,aa as pu,ab as mu,ac as gu,ad as da,ae as vu,af as yu,ag as xu,ah as bu,ai as wu,aj as Su,ak as _u,al as ha,am as Tu,v as fa,an as Au,w as ku,y as Cu,x as Pu,z as Mu,A as Du,B as Vu,E as Lu}from"./BQAF7cM_.js";import{f as pa}from"./BKltSiU0.js";import{u as Eu,l as Ru}from"./BlWNlw-C.js";import"./BZEKLHO-.js";import"./Bdtn2mn5.js";import"./S6q6IfIg.js";import"./SzZsnvJ-.js";import"./C26aAkUg.js";var ki=Math.PI*2,fn=Math.PI/180;function ma(t,e){return Jl(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function ga(t,e){var n=ma(t,e),s=t.get("center"),i=t.get("radius");es(i)||(i=[0,i]);var a=Ue(n.width,e.getWidth()),o=Ue(n.height,e.getHeight()),r=Math.min(a,o),l=Ue(i[0],r/2),u=Ue(i[1],r/2),c,h,d=t.coordinateSystem;if(d){var f=d.dataToPoint(s);c=f[0]||0,h=f[1]||0}else es(s)||(s=[s,s]),c=Ue(s[0],a)+n.x,h=Ue(s[1],o)+n.y;return{cx:c,cy:h,r0:l,r:u}}function Iu(t,e,n){e.eachSeriesByType(t,function(s){var i=s.getData(),a=i.mapDimension("value"),o=ma(s,n),r=ga(s,n),l=r.cx,u=r.cy,c=r.r,h=r.r0,d=-s.get("startAngle")*fn,f=s.get("endAngle"),p=s.get("padAngle")*fn;f=f==="auto"?d-ki:-f*fn;var g=s.get("minAngle")*fn,m=g+p,v=0;i.each(a,function(G){!isNaN(G)&&v++});var C=i.getSum(a),y=Math.PI/(C||v)*2,$=s.get("clockwise"),P=s.get("roseType"),V=s.get("stillShowZeroSum"),T=i.getDataExtent(a);T[0]=0;var w=$?1:-1,B=[d,f],E=w*p/2;eu(B,!$),d=B[0],f=B[1];var z=va(s);z.startAngle=d,z.endAngle=f,z.clockwise=$;var F=Math.abs(f-d),te=F,A=0,I=d;if(i.setLayout({viewRect:o,r:c}),i.each(a,function(G,W){var U;if(isNaN(G)){i.setItemLayout(W,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:$,cx:l,cy:u,r0:h,r:P?NaN:c});return}P!=="area"?U=C===0&&V?y:G*y:U=F/v,U<m?(U=m,te-=m):A+=G;var Q=I+w*U,Z=0,J=0;p>U?(Z=I+w*U/2,J=Z):(Z=I+E,J=Q-E),i.setItemLayout(W,{angle:U,startAngle:Z,endAngle:J,clockwise:$,cx:l,cy:u,r0:h,r:P?tu(G,T,[h,c]):c}),I=Q}),te<ki&&v)if(te<=.001){var N=F/v;i.each(a,function(G,W){if(!isNaN(G)){var U=i.getItemLayout(W);U.angle=N;var Q=0,Z=0;N<p?(Q=d+w*(W+1/2)*N,Z=Q):(Q=d+w*W*N+E,Z=d+w*(W+1)*N-E),U.startAngle=Q,U.endAngle=Z}})}else y=te/A,I=d,i.each(a,function(G,W){if(!isNaN(G)){var U=i.getItemLayout(W),Q=U.angle===m?m:G*y,Z=0,J=0;Q<p?(Z=I+w*Q/2,J=Z):(Z=I+E,J=I+w*Q-E),U.startAngle=Z,U.endAngle=J,I+=w*Q}})})}var va=oa();function $u(t){return{seriesType:t,reset:function(e,n){var s=n.findComponents({mainType:"legend"});if(!(!s||!s.length)){var i=e.getData();i.filterSelf(function(a){for(var o=i.getName(a),r=0;r<s.length;r++)if(!s[r].isSelected(o))return!1;return!0})}}}}function ya(t,e,n,s,i,a,o,r){var l=i-t,u=a-e,c=n-t,h=s-e,d=Math.sqrt(c*c+h*h);c/=d,h/=d;var f=l*c+u*h,p=f/d;p*=d;var g=o[0]=t+p*c,m=o[1]=e+p*h;return Math.sqrt((g-i)*(g-i)+(m-a)*(m-a))}var Qe=new pe,ie=new pe,fe=new pe,Ze=new pe,$e=new pe,wn=[],ye=new pe;function Bu(t,e){if(e<=180&&e>0){e=e/180*Math.PI,Qe.fromArray(t[0]),ie.fromArray(t[1]),fe.fromArray(t[2]),pe.sub(Ze,Qe,ie),pe.sub($e,fe,ie);var n=Ze.len(),s=$e.len();if(!(n<.001||s<.001)){Ze.scale(1/n),$e.scale(1/s);var i=Ze.dot($e),a=Math.cos(e);if(a<i){var o=ya(ie.x,ie.y,fe.x,fe.y,Qe.x,Qe.y,wn);ye.fromArray(wn),ye.scaleAndAdd($e,o/Math.tan(Math.PI-e));var r=fe.x!==ie.x?(ye.x-ie.x)/(fe.x-ie.x):(ye.y-ie.y)/(fe.y-ie.y);if(isNaN(r))return;r<0?pe.copy(ye,ie):r>1&&pe.copy(ye,fe),ye.toArray(t[1])}}}}function Ou(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,Qe.fromArray(t[0]),ie.fromArray(t[1]),fe.fromArray(t[2]),pe.sub(Ze,ie,Qe),pe.sub($e,fe,ie);var s=Ze.len(),i=$e.len();if(!(s<.001||i<.001)){Ze.scale(1/s),$e.scale(1/i);var a=Ze.dot(e),o=Math.cos(n);if(a<o){var r=ya(ie.x,ie.y,fe.x,fe.y,Qe.x,Qe.y,wn);ye.fromArray(wn);var l=Math.PI/2,u=Math.acos($e.dot(e)),c=l+u-n;if(c>=l)pe.copy(ye,fe);else{ye.scaleAndAdd($e,r/Math.tan(Math.PI/2-c));var h=fe.x!==ie.x?(ye.x-ie.x)/(fe.x-ie.x):(ye.y-ie.y)/(fe.y-ie.y);if(isNaN(h))return;h<0?pe.copy(ye,ie):h>1&&pe.copy(ye,fe)}ye.toArray(t[1])}}}}function Bn(t,e,n,s){var i=n==="normal",a=i?t:t.ensureState(n);a.ignore=e;var o=s.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var r=s.getModel("lineStyle").getLineStyle();i?t.useStyle(r):a.style=r}function Fu(t,e){var n=e.smooth,s=e.points;if(s)if(t.moveTo(s[0][0],s[0][1]),n>0&&s.length>=3){var i=_i(s[0],s[1]),a=_i(s[1],s[2]);if(!i||!a){t.lineTo(s[1][0],s[1][1]),t.lineTo(s[2][0],s[2][1]);return}var o=Math.min(i,a)*n,r=In([],s[1],s[0],o/i),l=In([],s[1],s[2],o/a),u=In([],r,l,.5);t.bezierCurveTo(r[0],r[1],r[0],r[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],s[2][0],s[2][1])}else for(var c=1;c<s.length;c++)t.lineTo(s[c][0],s[c][1])}function ju(t,e,n){var s=t.getTextGuideLine(),i=t.getTextContent();if(!i){s&&t.removeTextGuideLine();return}for(var a=e.normal,o=a.get("show"),r=i.ignore,l=0;l<bi.length;l++){var u=bi[l],c=e[u],h=u==="normal";if(c){var d=c.get("show"),f=h?r:wi(i.states[u]&&i.states[u].ignore,r);if(f||!wi(d,o)){var p=h?s:s&&s.states[u];p&&(p.ignore=!0),s&&Bn(s,!0,u,c);continue}s||(s=new aa,t.setTextGuideLine(s),!h&&(r||!o)&&Bn(s,!0,"normal",e.normal),t.stateProxy&&(s.stateProxy=t.stateProxy)),Bn(s,!1,u,c)}}if(s){nu(s.style,n),s.style.fill=null;var g=a.get("showAbove"),m=t.textGuideLineConfig=t.textGuideLineConfig||{};m.showAbove=g||!1,s.buildPath=Fu}}function Nu(t,e){e=e||"labelLine";for(var n={normal:t.getModel(e)},s=0;s<Si.length;s++){var i=Si[s];n[i]=t.getModel([i,e])}return n}var zu=Math.PI/180;function Ci(t,e,n,s,i,a,o,r,l,u){if(t.length<2)return;function c(g){for(var m=g.rB,v=m*m,C=0;C<g.list.length;C++){var y=g.list[C],$=Math.abs(y.label.y-n),P=s+y.len,V=P*P,T=Math.sqrt(Math.abs((1-$*$/v)*V)),w=e+(T+y.len2)*i,B=w-y.label.x,E=y.targetTextWidth-B*i;xa(y,E,!0),y.label.x=w}}function h(g){for(var m={list:[],maxY:0},v={list:[],maxY:0},C=0;C<g.length;C++)if(g[C].labelAlignTo==="none"){var y=g[C],$=y.label.y>n?v:m,P=Math.abs(y.label.y-n);if(P>=$.maxY){var V=y.label.x-e-y.len2*i,T=s+y.len,w=Math.abs(V)<T?Math.sqrt(P*P/(1-V*V/T/T)):T;$.rB=w,$.maxY=P}$.list.push(y)}c(m),c(v)}for(var d=t.length,f=0;f<d;f++)if(t[f].position==="outer"&&t[f].labelAlignTo==="labelLine"){var p=t[f].label.x-u;t[f].linePoints[1][0]+=p,t[f].label.x=u}su(t,l,l+o)&&h(t)}function Uu(t,e,n,s,i,a,o,r){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<t.length;d++){var f=t[d].label;On(t[d])||(f.x<e?(c=Math.min(c,f.x),l.push(t[d])):(h=Math.max(h,f.x),u.push(t[d])))}for(var d=0;d<t.length;d++){var p=t[d];if(!On(p)&&p.linePoints){if(p.labelStyleWidth!=null)continue;var f=p.label,g=p.linePoints,m=void 0;p.labelAlignTo==="edge"?f.x<e?m=g[2][0]-p.labelDistance-o-p.edgeDistance:m=o+i-p.edgeDistance-g[2][0]-p.labelDistance:p.labelAlignTo==="labelLine"?f.x<e?m=c-o-p.bleedMargin:m=o+i-h-p.bleedMargin:f.x<e?m=f.x-o-p.bleedMargin:m=o+i-f.x-p.bleedMargin,p.targetTextWidth=m,xa(p,m)}}Ci(u,e,n,s,1,i,a,o,r,h),Ci(l,e,n,s,-1,i,a,o,r,c);for(var d=0;d<t.length;d++){var p=t[d];if(!On(p)&&p.linePoints){var f=p.label,g=p.linePoints,v=p.labelAlignTo==="edge",C=f.style.padding,y=C?C[1]+C[3]:0,$=f.style.backgroundColor?0:y,P=p.rect.width+$,V=g[1][0]-g[2][0];v?f.x<e?g[2][0]=o+p.edgeDistance+P+p.labelDistance:g[2][0]=o+i-p.edgeDistance-P-p.labelDistance:(f.x<e?g[2][0]=f.x+p.labelDistance:g[2][0]=f.x-p.labelDistance,g[1][0]=g[2][0]+V),g[1][1]=g[2][1]=f.y}}}function xa(t,e,n){if(n===void 0&&(n=!1),t.labelStyleWidth==null){var s=t.label,i=s.style,a=t.rect,o=i.backgroundColor,r=i.padding,l=r?r[1]+r[3]:0,u=i.overflow,c=a.width+(o?0:l);if(e<c||n){var h=a.height;if(u&&u.match("break")){s.setStyle("backgroundColor",null),s.setStyle("width",e-l);var d=s.getBoundingRect();s.setStyle("width",Math.ceil(d.width)),s.setStyle("backgroundColor",o)}else{var f=e-l,p=e<c?f:n?f>t.unconstrainedWidth?null:f:null;s.setStyle("width",p)}var g=s.getBoundingRect();a.width=g.width;var m=(s.style.margin||0)+2.1;a.height=g.height+m,a.y-=(a.height-h)/2}}}function On(t){return t.position==="center"}function qu(t){var e=t.getData(),n=[],s,i,a=!1,o=(t.get("minShowLabelAngle")||0)*zu,r=e.getLayout("viewRect"),l=e.getLayout("r"),u=r.width,c=r.x,h=r.y,d=r.height;function f(V){V.ignore=!0}function p(V){if(!V.ignore)return!0;for(var T in V.states)if(V.states[T].ignore===!1)return!0;return!1}e.each(function(V){var T=e.getItemGraphicEl(V),w=T.shape,B=T.getTextContent(),E=T.getTextGuideLine(),z=e.getItemModel(V),F=z.getModel("label"),te=F.get("position")||z.get(["emphasis","label","position"]),A=F.get("distanceToLabelLine"),I=F.get("alignTo"),N=Ue(F.get("edgeDistance"),u),G=F.get("bleedMargin"),W=z.getModel("labelLine"),U=W.get("length");U=Ue(U,u);var Q=W.get("length2");if(Q=Ue(Q,u),Math.abs(w.endAngle-w.startAngle)<o){dn(B.states,f),B.ignore=!0,E&&(dn(E.states,f),E.ignore=!0);return}if(p(B)){var Z=(w.startAngle+w.endAngle)/2,J=Math.cos(Z),ge=Math.sin(Z),ue,Le,je,xt;s=w.cx,i=w.cy;var Ee=te==="inside"||te==="inner";if(te==="center")ue=w.cx,Le=w.cy,xt="center";else{var Rt=(Ee?(w.r+w.r0)/2*J:w.r*J)+s,Pe=(Ee?(w.r+w.r0)/2*ge:w.r*ge)+i;if(ue=Rt+J*3,Le=Pe+ge*3,!Ee){var bt=Rt+J*(U+l-w.r),wt=Pe+ge*(U+l-w.r),sn=bt+(J<0?-1:1)*Q,on=wt;I==="edge"?ue=J<0?c+N:c+u-N:ue=sn+(J<0?-A:A),Le=on,je=[[Rt,Pe],[bt,wt],[sn,on]]}xt=Ee?"center":I==="edge"?J>0?"right":"left":J>0?"left":"right"}var tt=Math.PI,Ke=0,nt=F.get("rotate");if(ra(nt))Ke=nt*(tt/180);else if(te==="center")Ke=0;else if(nt==="radial"||nt===!0){var Vn=J<0?-Z+tt:-Z;Ke=Vn}else if(nt==="tangential"&&te!=="outside"&&te!=="outer"){var Ge=Math.atan2(J,ge);Ge<0&&(Ge=tt*2+Ge);var Ln=ge>0;Ln&&(Ge=tt+Ge),Ke=Ge-tt}if(a=!!Ke,B.x=ue,B.y=Le,B.rotation=Ke,B.setStyle({verticalAlign:"middle"}),Ee){B.setStyle({align:xt});var It=B.states.select;It&&(It.x+=B.x,It.y+=B.y)}else{var st=B.getBoundingRect().clone();st.applyTransform(B.getComputedTransform());var an=(B.style.margin||0)+2.1;st.y-=an/2,st.height+=an,n.push({label:B,labelLine:E,position:te,len:U,len2:Q,minTurnAngle:W.get("minTurnAngle"),maxSurfaceAngle:W.get("maxSurfaceAngle"),surfaceNormal:new pe(J,ge),linePoints:je,textAlign:xt,labelDistance:A,labelAlignTo:I,edgeDistance:N,bleedMargin:G,rect:st,unconstrainedWidth:st.width,labelStyleWidth:B.style.width})}T.setTextConfig({inside:Ee})}}),!a&&t.get("avoidLabelOverlap")&&Uu(n,s,i,l,u,d,c,h);for(var g=0;g<n.length;g++){var m=n[g],v=m.label,C=m.labelLine,y=isNaN(v.x)||isNaN(v.y);if(v){v.setStyle({align:m.textAlign}),y&&(dn(v.states,f),v.ignore=!0);var $=v.states.select;$&&($.x+=v.x,$.y+=v.y)}if(C){var P=m.linePoints;y||!P?(dn(C.states,f),C.ignore=!0):(Bu(P,m.minTurnAngle),Ou(P,m.surfaceNormal,m.maxSurfaceAngle),C.setShape({points:P}),v.__hostTarget.textGuideLineConfig={anchor:new pe(P[0][0],P[0][1])})}}}var Hu=function(t){Dt(e,t);function e(n,s,i){var a=t.call(this)||this;a.z2=2;var o=new ou;return a.setTextContent(o),a.updateData(n,s,i,!0),a}return e.prototype.updateData=function(n,s,i,a){var o=this,r=n.hostModel,l=n.getItemModel(s),u=l.getModel("emphasis"),c=n.getItemLayout(s),h=Xe(hn(l.getModel("itemStyle"),c,!0),c);if(isNaN(h.startAngle)){o.setShape(h);return}if(a){o.setShape(h);var d=r.getShallow("animationType");r.ecModel.ssr?($n(o,{scaleX:0,scaleY:0},r,{dataIndex:s,isFrom:!0}),o.originX=h.cx,o.originY=h.cy):d==="scale"?(o.shape.r=c.r0,$n(o,{shape:{r:c.r}},r,s)):i!=null?(o.setShape({startAngle:i,endAngle:i}),$n(o,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},r,s)):(o.shape.endAngle=c.startAngle,Ti(o,{shape:{endAngle:c.endAngle}},r,s))}else au(o),Ti(o,{shape:h},r,s);o.useStyle(n.getItemVisual(s,"style")),ru(o,l);var f=(c.startAngle+c.endAngle)/2,p=r.get("selectedOffset"),g=Math.cos(f)*p,m=Math.sin(f)*p,v=l.getShallow("cursor");v&&o.attr("cursor",v),this._updateLabel(r,n,s),o.ensureState("emphasis").shape=Xe({r:c.r+(u.get("scale")&&u.get("scaleSize")||0)},hn(u.getModel("itemStyle"),c)),Xe(o.ensureState("select"),{x:g,y:m,shape:hn(l.getModel(["select","itemStyle"]),c)}),Xe(o.ensureState("blur"),{shape:hn(l.getModel(["blur","itemStyle"]),c)});var C=o.getTextGuideLine(),y=o.getTextContent();C&&Xe(C.ensureState("select"),{x:g,y:m}),Xe(y.ensureState("select"),{x:g,y:m}),lu(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(n,s,i){var a=this,o=s.getItemModel(i),r=o.getModel("labelLine"),l=s.getItemVisual(i,"style"),u=l&&l.fill,c=l&&l.opacity;uu(a,cu(o),{labelFetcher:s.hostModel,labelDataIndex:i,inheritColor:u,defaultOpacity:c,defaultText:n.getFormattedLabel(i,"normal")||s.getName(i)});var h=a.getTextContent();a.setTextConfig({position:null,rotation:null}),h.attr({z2:10});var d=n.get(["label","position"]);if(d!=="outside"&&d!=="outer")a.removeTextGuideLine();else{var f=this.getTextGuideLine();f||(f=new aa,this.setTextGuideLine(f)),ju(this,Nu(o),{stroke:u,opacity:du(r.get(["lineStyle","opacity"]),c,1)})}},e}(la),Ku=function(t){Dt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.ignoreLabelLineUpdate=!0,n}return e.prototype.render=function(n,s,i,a){var o=n.getData(),r=this._data,l=this.group,u;if(!r&&o.count()>0){for(var c=o.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h<o.count();++h)c=o.getItemLayout(h);c&&(u=c.startAngle)}if(this._emptyCircleSector&&l.remove(this._emptyCircleSector),o.count()===0&&n.get("showEmptyCircle")){var d=va(n),f=new la({shape:Xe(ga(n,i),d)});f.useStyle(n.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=f,l.add(f)}o.diff(r).add(function(p){var g=new Hu(o,p,u);o.setItemGraphicEl(p,g),l.add(g)}).update(function(p,g){var m=r.getItemGraphicEl(g);m.updateData(o,p,u),m.off("click"),l.add(m),o.setItemGraphicEl(p,m)}).remove(function(p){var g=r.getItemGraphicEl(p);iu(g,n,p)}).execute(),qu(n),n.get("animationTypeUpdate")!=="expansion"&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(n,s){var i=s.getData(),a=i.getItemLayout(0);if(a){var o=n[0]-a.cx,r=n[1]-a.cy,l=Math.sqrt(o*o+r*r);return l<=a.r&&l>=a.r0}},e.type="pie",e}(ua);function Gu(t,e,n){e=es(e)&&{coordDimensions:e}||Xe({encodeDefine:t.getEncode()},e);var s=t.getSource(),i=hu(s,e).dimensions,a=new fu(i,t);return a.initData(s,n),a}var Wu=function(){function t(e,n){this._getDataWithEncodedVisual=e,this._getRawData=n}return t.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},t.prototype.containName=function(e){var n=this._getRawData();return n.indexOfName(e)>=0},t.prototype.indexOfName=function(e){var n=this._getDataWithEncodedVisual();return n.indexOfName(e)},t.prototype.getItemVisual=function(e,n){var s=this._getDataWithEncodedVisual();return s.getItemVisual(e,n)},t}(),Yu=oa(),Xu=function(t){Dt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(n){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new Wu(Ai(this.getData,this),Ai(this.getRawData,this)),this._defaultLabelLine(n)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return Gu(this,{coordDimensions:["value"],encodeDefaulter:ca(pu,this)})},e.prototype.getDataParams=function(n){var s=this.getData(),i=Yu(s),a=i.seats;if(!a){var o=[];s.each(s.mapDimension("value"),function(l){o.push(l)}),a=i.seats=mu(o,s.hostModel.get("percentPrecision"))}var r=t.prototype.getDataParams.call(this,n);return r.percent=a[n]||0,r.$vars.push("percent"),r},e.prototype._defaultLabelLine=function(n){gu(n,"labelLine",["show"]);var s=n.labelLine,i=n.emphasis.labelLine;s.show=s.show&&n.label.show,i.show=i.show&&n.emphasis.label.show},e.type="series.pie",e.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"},e}(da);function Qu(t){return{seriesType:t,reset:function(e,n){var s=e.getData();s.filterSelf(function(i){var a=s.mapDimension("value"),o=s.get(a,i);return!(ra(o)&&!isNaN(o)&&o<0)})}}}function Zu(t){t.registerChartView(Ku),t.registerSeriesModel(Xu),vu("pie",t.registerAction),t.registerLayout(ca(Iu,"pie")),t.registerProcessor($u("pie")),t.registerProcessor(Qu("pie"))}var Ju=function(t){Dt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return e.prototype.getInitialData=function(n,s){return yu(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var n=this.option.progressive;return n??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var n=this.option.progressiveThreshold;return n??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(n,s,i){return i.point(s.getItemLayout(n))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.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"}},e}(da),ba=4,ec=function(){function t(){}return t}(),tc=function(t){Dt(e,t);function e(n){var s=t.call(this,n)||this;return s._off=0,s.hoverDataIdx=-1,s}return e.prototype.getDefaultShape=function(){return new ec},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(n,s){var i=s.points,a=s.size,o=this.symbolProxy,r=o.shape,l=n.getContext?n.getContext():n,u=l&&a[0]<ba,c=this.softClipShape,h;if(u){this._ctx=l;return}for(this._ctx=null,h=this._off;h<i.length;){var d=i[h++],f=i[h++];isNaN(d)||isNaN(f)||c&&!c.contain(d,f)||(r.x=d-a[0]/2,r.y=f-a[1]/2,r.width=a[0],r.height=a[1],o.buildPath(n,r,!0))}this.incremental&&(this._off=h,this.notClear=!0)},e.prototype.afterBrush=function(){var n=this.shape,s=n.points,i=n.size,a=this._ctx,o=this.softClipShape,r;if(a){for(r=this._off;r<s.length;){var l=s[r++],u=s[r++];isNaN(l)||isNaN(u)||o&&!o.contain(l,u)||a.fillRect(l-i[0]/2,u-i[1]/2,i[0],i[1])}this.incremental&&(this._off=r,this.notClear=!0)}},e.prototype.findDataIndex=function(n,s){for(var i=this.shape,a=i.points,o=i.size,r=Math.max(o[0],4),l=Math.max(o[1],4),u=a.length/2-1;u>=0;u--){var c=u*2,h=a[c]-r/2,d=a[c+1]-l/2;if(n>=h&&s>=d&&n<=h+r&&s<=d+l)return u}return-1},e.prototype.contain=function(n,s){var i=this.transformCoordToLocal(n,s),a=this.getBoundingRect();if(n=i[0],s=i[1],a.contain(n,s)){var o=this.hoverDataIdx=this.findDataIndex(n,s);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var n=this._rect;if(!n){for(var s=this.shape,i=s.points,a=s.size,o=a[0],r=a[1],l=1/0,u=1/0,c=-1/0,h=-1/0,d=0;d<i.length;){var f=i[d++],p=i[d++];l=Math.min(f,l),c=Math.max(f,c),u=Math.min(p,u),h=Math.max(p,h)}n=this._rect=new bu(l-o/2,u-r/2,c-l+o,h-u+r)}return n},e}(wu),nc=function(){function t(){this.group=new xu}return t.prototype.updateData=function(e,n){this._clear();var s=this._create();s.setShape({points:e.getLayout("points")}),this._setCommon(s,e,n)},t.prototype.updateLayout=function(e){var n=e.getLayout("points");this.group.eachChild(function(s){if(s.startIndex!=null){var i=(s.endIndex-s.startIndex)*2,a=s.startIndex*4*2;n=new Float32Array(n.buffer,a,i)}s.setShape("points",n),s.reset()})},t.prototype.incrementalPrepareUpdate=function(e){this._clear()},t.prototype.incrementalUpdate=function(e,n,s){var i=this._newAdded[0],a=n.getLayout("points"),o=i&&i.shape.points;if(o&&o.length<2e4){var r=o.length,l=new Float32Array(r+a.length);l.set(o),l.set(a,r),i.endIndex=e.end,i.setShape({points:l})}else{this._newAdded=[];var u=this._create();u.startIndex=e.start,u.endIndex=e.end,u.incremental=!0,u.setShape({points:a}),this._setCommon(u,n,s)}},t.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},t.prototype._create=function(){var e=new tc({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},t.prototype._setCommon=function(e,n,s){var i=n.hostModel;s=s||{};var a=n.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=s.clipShape||null,e.symbolProxy=Su(n.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<ba;e.useStyle(i.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var r=n.getVisual("style"),l=r&&r.fill;l&&e.setColor(l);var u=_u(e);u.seriesIndex=i.seriesIndex,e.on("mousemove",function(c){u.dataIndex=null;var h=e.hoverDataIdx;h>=0&&(u.dataIndex=h+(e.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),sc=function(t){Dt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type=e.type,n}return e.prototype.render=function(n,s,i){var a=n.getData(),o=this._updateSymbolDraw(a,n);o.updateData(a,{clipShape:this._getClipShape(n)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(n,s,i){var a=n.getData(),o=this._updateSymbolDraw(a,n);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(n,s,i){this._symbolDraw.incrementalUpdate(n,s.getData(),{clipShape:this._getClipShape(s)}),this._finished=n.end===s.getData().count()},e.prototype.updateTransform=function(n,s,i){var a=n.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=ha("").reset(n,s,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(n){this._symbolDraw&&this._symbolDraw.eachRendered(n)},e.prototype._getClipShape=function(n){if(n.get("clip",!0)){var s=n.coordinateSystem;return s&&s.getArea&&s.getArea(.1)}},e.prototype._updateSymbolDraw=function(n,s){var i=this._symbolDraw,a=s.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new nc:new Tu,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(n,s){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(ua);function ic(t){fa(Au),t.registerSeriesModel(Ju),t.registerChartView(sc),t.registerLayout(ha("scatter"))}function Jt(t,e){const n=typeof t=="string"?`${t}Context`:e,s=Symbol(n);return[o=>{const r=Xo(s,o);if(r===void 0)throw new Error(`Injection \`${s.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`);return r},o=>(Qo(s,o),o),s]}function oc(t,e){const{layoutGroup:n,presenceContext:s,config:i}=e,a=n.id&&t.layoutId?`${n.id}-${t.layoutId}`:t.layoutId||void 0;return{...t,layoutId:a,transition:t.transition??i.transition,layoutGroup:n,motionConfig:i,inViewOptions:t.inViewOptions??i.inViewOptions,presenceContext:s,initial:s.initial===!1?s.initial:t.initial===!0?void 0:t.initial}}function Ns(t,e){t.indexOf(e)===-1&&t.push(e)}function Sn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Fe=(t,e,n)=>n>e?e:n<t?t:n;let zs=()=>{};const qe={},wa=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Sa(t){return typeof t=="object"&&t!==null}const _a=t=>/^0[^.\s]+$/u.test(t);function Ta(t){let e;return()=>(e===void 0&&(e=t()),e)}const ke=t=>t,ac=(t,e)=>n=>e(t(n)),en=(...t)=>t.reduce(ac),Gt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class Us{constructor(){this.subscriptions=[]}add(e){return Ns(this.subscriptions,e),()=>Sn(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ce=t=>t*1e3,Ae=t=>t/1e3;function Aa(t,e){return e?t*(1e3/e):0}const ka=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,rc=1e-7,lc=12;function uc(t,e,n,s,i){let a,o,r=0;do o=e+(n-e)/2,a=ka(o,s,i)-t,a>0?n=o:e=o;while(Math.abs(a)>rc&&++r<lc);return o}function tn(t,e,n,s){if(t===e&&n===s)return ke;const i=a=>uc(a,0,1,t,n);return a=>a===0||a===1?a:ka(i(a),e,s)}const Ca=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pa=t=>e=>1-t(1-e),Ma=tn(.33,1.53,.69,.99),qs=Pa(Ma),Da=Ca(qs),Va=t=>(t*=2)<1?.5*qs(t):.5*(2-Math.pow(2,-10*(t-1))),Hs=t=>1-Math.sin(Math.acos(t)),La=Pa(Hs),Ea=Ca(Hs),cc=tn(.42,0,1,1),dc=tn(0,0,.58,1),Ra=tn(.42,0,.58,1),hc=t=>Array.isArray(t)&&typeof t[0]!="number",Ia=t=>Array.isArray(t)&&typeof t[0]=="number",fc={linear:ke,easeIn:cc,easeInOut:Ra,easeOut:dc,circIn:Hs,circInOut:Ea,circOut:La,backIn:qs,backInOut:Da,backOut:Ma,anticipate:Va},pc=t=>typeof t=="string",Pi=t=>{if(Ia(t)){zs(t.length===4);const[e,n,s,i]=t;return tn(e,n,s,i)}else if(pc(t))return fc[t];return t},pn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function mc(t,e){let n=new Set,s=new Set,i=!1,a=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(u.schedule(c),t()),c(r)}const u={schedule:(c,h=!1,d=!1)=>{const p=d&&i?n:s;return h&&o.add(c),p.has(c)||p.add(c),c},cancel:c=>{s.delete(c),o.delete(c)},process:c=>{if(r=c,i){a=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,a&&(a=!1,u.process(c))}};return u}const gc=40;function $a(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=pn.reduce((y,$)=>(y[$]=mc(a),y),{}),{setup:r,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:d,render:f,postRender:p}=o,g=()=>{const y=qe.useManualTiming?i.timestamp:performance.now();n=!1,qe.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,gc),1)),i.timestamp=y,i.isProcessing=!0,r.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),f.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))},m=()=>{n=!0,s=!0,i.isProcessing||t(g)};return{schedule:pn.reduce((y,$)=>{const P=o[$];return y[$]=(V,T=!1,w=!1)=>(n||m(),P.schedule(V,T,w)),y},{}),cancel:y=>{for(let $=0;$<pn.length;$++)o[pn[$]].cancel(y)},state:i,steps:o}}const{schedule:ee,cancel:et,state:he,steps:Fn}=$a(typeof requestAnimationFrame<"u"?requestAnimationFrame:ke,!0);let yn;function vc(){yn=void 0}const xe={now:()=>(yn===void 0&&xe.set(he.isProcessing||qe.useManualTiming?he.timestamp:performance.now()),yn),set:t=>{yn=t,queueMicrotask(vc)}},Ba=t=>e=>typeof e=="string"&&e.startsWith(t),Ks=Ba("--"),yc=Ba("var(--"),Gs=t=>yc(t)?xc.test(t.split("/*")[0].trim()):!1,xc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mi(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Vt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Wt={...Vt,transform:t=>Fe(0,1,t)},mn={...Vt,default:1},zt=t=>Math.round(t*1e5)/1e5,Ws=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bc(t){return t==null}const wc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ys=(t,e)=>n=>!!(typeof n=="string"&&wc.test(n)&&n.startsWith(t)||e&&!bc(n)&&Object.prototype.hasOwnProperty.call(n,e)),Oa=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,a,o,r]=s.match(Ws);return{[t]:parseFloat(i),[e]:parseFloat(a),[n]:parseFloat(o),alpha:r!==void 0?parseFloat(r):1}},Sc=t=>Fe(0,255,t),jn={...Vt,transform:t=>Math.round(Sc(t))},rt={test:Ys("rgb","red"),parse:Oa("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+jn.transform(t)+", "+jn.transform(e)+", "+jn.transform(n)+", "+zt(Wt.transform(s))+")"};function _c(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const ts={test:Ys("#"),parse:_c,transform:rt.transform},nn=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ye=nn("deg"),Oe=nn("%"),j=nn("px"),Tc=nn("vh"),Ac=nn("vw"),Di={...Oe,parse:t=>Oe.parse(t)/100,transform:t=>Oe.transform(t*100)},St={test:Ys("hsl","hue"),parse:Oa("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Oe.transform(zt(e))+", "+Oe.transform(zt(n))+", "+zt(Wt.transform(s))+")"},ae={test:t=>rt.test(t)||ts.test(t)||St.test(t),parse:t=>rt.test(t)?rt.parse(t):St.test(t)?St.parse(t):ts.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?rt.transform(t):St.transform(t),getAnimatableNone:t=>{const e=ae.parse(t);return e.alpha=0,ae.transform(e)}},kc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Cc(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ws))==null?void 0:e.length)||0)+(((n=t.match(kc))==null?void 0:n.length)||0)>0}const Fa="number",ja="color",Pc="var",Mc="var(",Vi="${}",Dc=/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 Pt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(Dc,l=>(ae.test(l)?(s.color.push(a),i.push(ja),n.push(ae.parse(l))):l.startsWith(Mc)?(s.var.push(a),i.push(Pc),n.push(l)):(s.number.push(a),i.push(Fa),n.push(parseFloat(l))),++a,Vi)).split(Vi);return{values:n,split:r,indexes:s,types:i}}function Vc(t){return Pt(t).values}function Na({split:t,types:e}){const n=t.length;return s=>{let i="";for(let a=0;a<n;a++)if(i+=t[a],s[a]!==void 0){const o=e[a];o===Fa?i+=zt(s[a]):o===ja?i+=ae.transform(s[a]):i+=s[a]}return i}}function Lc(t){return Na(Pt(t))}const Ec=t=>typeof t=="number"?0:ae.test(t)?ae.getAnimatableNone(t):t,Rc=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Ec(t);function Ic(t){const e=Pt(t);return Na(e)(e.values.map((s,i)=>Rc(s,e.split[i])))}const Ve={test:Cc,parse:Vc,createTransformer:Lc,getAnimatableNone:Ic};function Nn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function $c({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,a=0,o=0;if(!e)i=a=o=n;else{const r=n<.5?n*(1+e):n+e-n*e,l=2*n-r;i=Nn(l,r,t+1/3),a=Nn(l,r,t),o=Nn(l,r,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:s}}function _n(t,e){return n=>n>0?e:t}const se=(t,e,n)=>t+(e-t)*n,zn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Bc=[ts,rt,St],Oc=t=>Bc.find(e=>e.test(t));function Li(t){const e=Oc(t);if(!e)return!1;let n=e.parse(t);return e===St&&(n=$c(n)),n}const Ei=(t,e)=>{const n=Li(t),s=Li(e);if(!n||!s)return _n(t,e);const i={...n};return a=>(i.red=zn(n.red,s.red,a),i.green=zn(n.green,s.green,a),i.blue=zn(n.blue,s.blue,a),i.alpha=se(n.alpha,s.alpha,a),rt.transform(i))},ns=new Set(["none","hidden"]);function Fc(t,e){return ns.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function jc(t,e){return n=>se(t,e,n)}function Xs(t){return typeof t=="number"?jc:typeof t=="string"?Gs(t)?_n:ae.test(t)?Ei:Uc:Array.isArray(t)?za:typeof t=="object"?ae.test(t)?Ei:Nc:_n}function za(t,e){const n=[...t],s=n.length,i=t.map((a,o)=>Xs(a)(a,e[o]));return a=>{for(let o=0;o<s;o++)n[o]=i[o](a);return n}}function Nc(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Xs(t[i])(t[i],e[i]));return i=>{for(const a in s)n[a]=s[a](i);return n}}function zc(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const a=e.types[i],o=t.indexes[a][s[a]],r=t.values[o]??0;n[i]=r,s[a]++}return n}const Uc=(t,e)=>{const n=Ve.createTransformer(e),s=Pt(t),i=Pt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ns.has(t)&&!i.values.length||ns.has(e)&&!s.values.length?Fc(t,e):en(za(zc(s,i),i.values),n):_n(t,e)};function Ua(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?se(t,e,n):Xs(t)(t,e)}const qc=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>ee.update(e,n),stop:()=>et(e),now:()=>he.isProcessing?he.timestamp:xe.now()}},qa=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let a=0;a<i;a++)s+=Math.round(t(a/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Tn=2e4;function Qs(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Tn;)e+=n,s=t.next(e);return e>=Tn?1/0:e}function Hc(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Qs(s),Tn);return{type:"keyframes",ease:a=>s.next(i*a).value/e,duration:Ae(i)}}const oe={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 ss(t,e){return t*Math.sqrt(1-e*e)}const Kc=12;function Gc(t,e,n){let s=n;for(let i=1;i<Kc;i++)s=s-t(s)/e(s);return s}const Ri=.001;function Wc({duration:t=oe.duration,bounce:e=oe.bounce,velocity:n=oe.velocity,mass:s=oe.mass}){let i,a,o=1-e;o=Fe(oe.minDamping,oe.maxDamping,o),t=Fe(oe.minDuration,oe.maxDuration,Ae(t)),o<1?(i=u=>{const c=u*o,h=c*t,d=c-n,f=ss(u,o),p=Math.exp(-h);return Ri-d/f*p},a=u=>{const h=u*o*t,d=h*n+n,f=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),g=ss(Math.pow(u,2),o);return(-i(u)+Ri>0?-1:1)*((d-f)*p)/g}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-.001+c*h},a=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const r=5/t,l=Gc(i,a,r);if(t=Ce(t),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const Yc=["duration","bounce"],Xc=["stiffness","damping","mass"];function Ii(t,e){return e.some(n=>t[n]!==void 0)}function Qc(t){let e={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...t};if(!Ii(t,Xc)&&Ii(t,Yc))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,a=2*Fe(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:oe.mass,stiffness:i,damping:a}}else{const n=Wc({...t,velocity:0});e={...e,...n,mass:oe.mass},e.isResolvedFromDuration=!0}return e}function An(t=oe.visualDuration,e=oe.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],r={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=Qc({...n,velocity:-Ae(n.velocity||0)}),p=d||0,g=u/(2*Math.sqrt(l*c)),m=o-a,v=Ae(Math.sqrt(l/c)),C=Math.abs(m)<5;s||(s=C?oe.restSpeed.granular:oe.restSpeed.default),i||(i=C?oe.restDelta.granular:oe.restDelta.default);let y,$,P,V,T,w;if(g<1)P=ss(v,g),V=(p+g*v*m)/P,y=E=>{const z=Math.exp(-g*v*E);return o-z*(V*Math.sin(P*E)+m*Math.cos(P*E))},T=g*v*V+m*P,w=g*v*m-V*P,$=E=>Math.exp(-g*v*E)*(T*Math.sin(P*E)+w*Math.cos(P*E));else if(g===1){y=z=>o-Math.exp(-v*z)*(m+(p+v*m)*z);const E=p+v*m;$=z=>Math.exp(-v*z)*(v*E*z-p)}else{const E=v*Math.sqrt(g*g-1);y=A=>{const I=Math.exp(-g*v*A),N=Math.min(E*A,300);return o-I*((p+g*v*m)*Math.sinh(N)+E*m*Math.cosh(N))/E};const z=(p+g*v*m)/E,F=g*v*z-m*E,te=g*v*m-z*E;$=A=>{const I=Math.exp(-g*v*A),N=Math.min(E*A,300);return I*(F*Math.sinh(N)+te*Math.cosh(N))}}const B={calculatedDuration:f&&h||null,velocity:E=>Ce($(E)),next:E=>{if(!f&&g<1){const F=Math.exp(-g*v*E),te=Math.sin(P*E),A=Math.cos(P*E),I=o-F*(V*te+m*A),N=Ce(F*(T*te+w*A));return r.done=Math.abs(N)<=s&&Math.abs(o-I)<=i,r.value=r.done?o:I,r}const z=y(E);if(f)r.done=E>=h;else{const F=Ce($(E));r.done=Math.abs(F)<=s&&Math.abs(o-z)<=i}return r.value=r.done?o:z,r},toString:()=>{const E=Math.min(Qs(B),Tn),z=qa(F=>B.next(E*F).value,E,30);return E+"ms "+z},toTransition:()=>{}};return B}An.applyToOptions=t=>{const e=Hc(t,100,An);return t.ease=e.ease,t.duration=Ce(e.duration),t.type="keyframes",t};const Zc=5;function Ha(t,e,n){const s=Math.max(e-Zc,0);return Aa(n-t(s),e-s)}function is({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:r,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},f=w=>r!==void 0&&w<r||l!==void 0&&w>l,p=w=>r===void 0?l:l===void 0||Math.abs(r-w)<Math.abs(l-w)?r:l;let g=n*e;const m=h+g,v=o===void 0?m:o(m);v!==m&&(g=v-h);const C=w=>-g*Math.exp(-w/s),y=w=>v+C(w),$=w=>{const B=C(w),E=y(w);d.done=Math.abs(B)<=u,d.value=d.done?v:E};let P,V;const T=w=>{f(d.value)&&(P=w,V=An({keyframes:[d.value,p(d.value)],velocity:Ha(y,w,d.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:w=>{let B=!1;return!V&&P===void 0&&(B=!0,$(w),T(w)),P!==void 0&&w>=P?V.next(w-P):(!B&&$(w),d)}}}function Jc(t,e,n){const s=[],i=n||qe.mix||Ua,a=t.length-1;for(let o=0;o<a;o++){let r=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||ke:e;r=en(l,r)}s.push(r)}return s}function ed(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const a=t.length;if(zs(a===e.length),a===1)return()=>e[0];if(a===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Jc(e,s,i),l=r.length,u=c=>{if(o&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const d=Gt(t[h],t[h+1],c);return r[h](d)};return n?c=>u(Fe(t[0],t[a-1],c)):u}function td(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Gt(0,e,s);t.push(se(n,1,i))}}function nd(t){const e=[0];return td(e,t.length-1),e}function sd(t,e){return t.map(n=>n*e)}function id(t,e){return t.map(()=>e||Ra).splice(0,t.length-1)}function Ut({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=hc(s)?s.map(Pi):Pi(s),a={done:!1,value:e[0]},o=sd(n&&n.length===e.length?n:nd(e),t),r=ed(o,e,{ease:Array.isArray(i)?i:id(e,i)});return{calculatedDuration:t,next:l=>(a.value=r(l),a.done=l>=t,a)}}const od=t=>t!==null;function Zs(t,{repeat:e,repeatType:n="loop"},s,i=1){const a=t.filter(od),r=i<0||e&&n!=="loop"&&e%2===1?0:a.length-1;return!r||s===void 0?a[r]:s}const ad={decay:is,inertia:is,tween:Ut,keyframes:Ut,spring:An};function Ka(t){typeof t.type=="string"&&(t.type=ad[t.type])}class Js{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const rd=t=>t/100;class ei extends Js{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==xe.now()&&this.tick(xe.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ka(e);const{type:n=Ut,repeat:s=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=e;let{keyframes:r}=e;const l=n||Ut;l!==Ut&&typeof r[0]!="number"&&(this.mixKeyframes=en(rd,Ua(r[0],r[1])),r=[0,100]);const u=l({...e,keyframes:r});a==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...r].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Qs(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:f,type:p,onUpdate:g,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let y=this.currentTime,$=s;if(h){const w=Math.min(this.currentTime,i)/r;let B=Math.floor(w),E=w%1;!E&&w>=1&&(E=1),E===1&&B--,B=Math.min(B,h+1),!!(B%2)&&(d==="reverse"?(E=1-E,f&&(E-=f/r)):d==="mirror"&&($=o)),y=Fe(0,1,E)*r}const P=C?{done:!1,value:c[0]}:$.next(y);a&&!C&&(P.value=a(P.value));let{done:V}=P;!C&&l!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return T&&p!==is&&(P.value=Zs(c,this.options,m,this.speed)),g&&g(P.value),T&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return Ae(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ae(e)}get time(){return Ae(this.currentTime)}set time(e){e=Ce(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Ha(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(xe.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Ae(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:e=qc,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(a=(i=this.options).onPlay)==null||a.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(xe.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function ld(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const lt=t=>t*180/Math.PI,os=t=>{const e=lt(Math.atan2(t[1],t[0]));return as(e)},ud={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:os,rotateZ:os,skewX:t=>lt(Math.atan(t[1])),skewY:t=>lt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},as=t=>(t=t%360,t<0&&(t+=360),t),$i=os,Bi=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Oi=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),cd={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Bi,scaleY:Oi,scale:t=>(Bi(t)+Oi(t))/2,rotateX:t=>as(lt(Math.atan2(t[6],t[5]))),rotateY:t=>as(lt(Math.atan2(-t[2],t[0]))),rotateZ:$i,rotate:$i,skewX:t=>lt(Math.atan(t[4])),skewY:t=>lt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function rs(t){return t.includes("scale")?1:0}function ls(t,e){if(!t||t==="none")return rs(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=cd,i=n;else{const r=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=ud,i=r}if(!i)return rs(e);const a=s[e],o=i[1].split(",").map(hd);return typeof a=="function"?a(o):o[a]}const dd=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ls(n,e)};function hd(t){return parseFloat(t.trim())}const Lt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Et=new Set(Lt),Fi=t=>t===Vt||t===j,fd=new Set(["x","y","z"]),pd=Lt.filter(t=>!fd.has(t));function md(t){const e=[];return pd.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Je={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ls(e,"x"),y:(t,{transform:e})=>ls(e,"y")};Je.translateX=Je.x;Je.translateY=Je.y;const yt=new Set;let us=!1,cs=!1,ds=!1;function Ga(){if(cs){const t=Array.from(yt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=md(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([a,o])=>{var r;(r=s.getValue(a))==null||r.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}cs=!1,us=!1,yt.forEach(t=>t.complete(ds)),yt.clear()}function Wa(){yt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(cs=!0)})}function gd(){ds=!0,Wa(),Ga(),ds=!1}class ti{constructor(e,n,s,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(yt.add(this),us||(us=!0,ee.read(Wa),ee.resolveKeyframes(Ga))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const a=i==null?void 0:i.get(),o=e[e.length-1];if(a!==void 0)e[0]=a;else if(s&&n){const r=s.readValue(n,o);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=o),i&&a===void 0&&i.set(e[0])}ld(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yt.delete(this)}cancel(){this.state==="scheduled"&&(yt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const vd=t=>t.startsWith("--");function Ya(t,e,n){vd(e)?t.style.setProperty(e,n):t.style[e]=n}const yd={};function Xa(t,e){const n=Ta(t);return()=>yd[e]??n()}const xd=Xa(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Qa=Xa(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),jt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,ji={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function Za(t,e){if(t)return typeof t=="function"?Qa()?qa(t,e):"ease-out":Ia(t)?jt(t):Array.isArray(t)?t.map(n=>Za(n,e)||ji.easeOut):ji[t]}function bd(t,e,n,{delay:s=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=Za(r,i);Array.isArray(h)&&(c.easing=h);const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(c,d)}function Ja(t){return typeof t=="function"&&"applyToOptions"in t}function wd({type:t,...e}){return Ja(t)&&Qa()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class er extends Js{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:r,onComplete:l}=e;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=e,zs(typeof e.type!="string");const u=wd(e);this.animation=bd(n,s,i,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const c=Zs(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Ya(n,s,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,s,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return Ae(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ae(e)}get time(){return Ae(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ce(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){var a;return this.allowFlatten&&((a=this.animation.effect)==null||a.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&xd()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),ke):i(this)}}const tr={anticipate:Va,backInOut:Da,circInOut:Ea};function Sd(t){return t in tr}function _d(t){typeof t.ease=="string"&&Sd(t.ease)&&(t.ease=tr[t.ease])}const Un=10;class Td extends er{constructor(e){_d(e),Ka(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:a,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const r=new ei({...o,autoplay:!1}),l=Math.max(Un,xe.now()-this.startTime),u=Fe(0,Un,l-Un),c=r.sample(l).value,{name:h}=this.options;a&&h&&Ya(a,h,c),n.setWithVelocity(r.sample(Math.max(0,l-u)).value,c,u),r.stop()}}const Ni=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ve.test(t)||t==="0")&&!t.startsWith("url("));function Ad(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function kd(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const a=t[t.length-1],o=Ni(i,e),r=Ni(a,e);return!o||!r?!1:Ad(t)||(n==="spring"||Ja(n))&&s}function hs(t){t.duration=0,t.type="keyframes"}const Cd=new Set(["opacity","clipPath","filter","transform"]),Pd=Ta(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Md(t){var c;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:a,type:o}=t;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return Pd()&&n&&Cd.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&a!==0&&o!=="inertia"}const Dd=40;class Vd extends Js{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:r,name:l,motionValue:u,element:c,...h}){var p;super(),this.stop=()=>{var g,m;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(m=this.keyframeResolver)==null||m.cancel()},this.createdAt=xe.now();const d={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:u,element:c,...h},f=(c==null?void 0:c.KeyframeResolver)||ti;this.keyframeResolver=new f(r,(g,m,v)=>this.onKeyframesResolved(g,m,d,!v),l,u,c),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,n,s,i){var m,v;this.keyframeResolver=void 0;const{name:a,type:o,velocity:r,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=xe.now(),kd(e,a,o,r)||((qe.instantAnimations||!l)&&(c==null||c(Zs(e,s,n))),e[0]=e[e.length-1],hs(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Dd?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},f=!u&&Md(d),p=(v=(m=d.motionValue)==null?void 0:m.owner)==null?void 0:v.current,g=f?new Td({...d,element:p}):new ei(d);g.finished.then(()=>{this.notifyFinished()}).catch(ke),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),gd()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function nr(t,e,n,s=0,i=1){const a=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,r=(o-1)*s;return typeof n=="function"?n(a,o):i===1?a*s:r-a*s}const Ld=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ed(t){const e=Ld.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function sr(t,e,n=1){const[s,i]=Ed(t);if(!s)return;const a=window.getComputedStyle(e).getPropertyValue(s);if(a){const o=a.trim();return wa(o)?parseFloat(o):o}return Gs(i)?sr(i,e,n+1):i}const Rd={type:"spring",stiffness:500,damping:25,restSpeed:10},Id=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),$d={type:"keyframes",duration:.8},Bd={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Od=(t,{keyframes:e})=>e.length>2?$d:Et.has(t)?t.startsWith("scale")?Id(e[1]):Rd:Bd,Fd=t=>t!==null;function jd(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Fd),a=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[a]}function ir(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function ni(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?ir(n,t):n}function Nd({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:r,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const si=(t,e,n,s={},i,a)=>o=>{const r=ni(s,t)||{},l=r.delay||s.delay||0;let{elapsed:u=0}=s;u=u-Ce(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...r,delay:-u,onUpdate:d=>{e.set(d),r.onUpdate&&r.onUpdate(d)},onComplete:()=>{o(),r.onComplete&&r.onComplete()},name:t,motionValue:e,element:a?void 0:i};Nd(r)||Object.assign(c,Od(t,c)),c.duration&&(c.duration=Ce(c.duration)),c.repeatDelay&&(c.repeatDelay=Ce(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(hs(c),c.delay===0&&(h=!0)),(qe.instantAnimations||qe.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,hs(c),c.delay=0),c.allowFlatten=!r.type&&!r.ease,h&&!a&&e.get()!==void 0){const d=jd(c.keyframes,r);if(d!==void 0){ee.update(()=>{c.onUpdate(d),c.onComplete()});return}}return r.isSync?new ei(c):new Vd(c)};function zi(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function or(t,e,n,s){if(typeof e=="function"){const[i,a]=zi(s);e=e(n!==void 0?n:t.custom,i,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,a]=zi(s);e=e(n!==void 0?n:t.custom,i,a)}return e}function Ct(t,e,n){const s=t.getProps();return or(s,e,n!==void 0?n:s.custom,t)}const ar=new Set(["width","height","top","left","right","bottom",...Lt]),Ui=30,zd=t=>!isNaN(parseFloat(t));class Ud{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var a;const i=xe.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=xe.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=zd(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Us);const s=this.events[e].add(n);return e==="change"?()=>{s(),ee.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=xe.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ui)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ui);return Aa(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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 e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Mt(t,e){return new Ud(t,e)}const qd=t=>Array.isArray(t);function Hd(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Mt(n))}function Kd(t){return qd(t)?t[t.length-1]||0:t}function Gd(t,e){const n=Ct(t,e);let{transitionEnd:s={},transition:i={},...a}=n||{};a={...a,...s};for(const o in a){const r=Kd(a[o]);Hd(t,o,r)}}const ve=t=>!!(t&&t.getVelocity);function Wd(t){return!!(ve(t)&&t.add)}function fs(t,e){const n=t.getValue("willChange");if(Wd(n))return n.add(e);if(!n&&qe.WillChange){const s=new qe.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function ii(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Yd="framerAppearId",Xd="data-"+ii(Yd);function rr(t){return t.props[Xd]}function Qd({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function lr(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:a,transitionEnd:o,...r}=e;const l=t.getDefaultTransition();a=a?ir(a,l):l;const u=a==null?void 0:a.reduceMotion;s&&(a=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const d in r){const f=t.getValue(d,t.latestValues[d]??null),p=r[d];if(p===void 0||h&&Qd(h,d))continue;const g={delay:n,...ni(a||{},d)},m=f.get();if(m!==void 0&&!f.isAnimating&&!Array.isArray(p)&&p===m&&!g.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const $=rr(t);if($){const P=window.MotionHandoffAnimation($,d,ee);P!==null&&(g.startTime=P,v=!0)}}fs(t,d);const C=u??t.shouldReduceMotion;f.start(si(d,f,p,C&&ar.has(d)?{type:!1}:g,t,v));const y=f.animation;y&&c.push(y)}if(o){const d=()=>ee.update(()=>{o&&Gd(t,o)});c.length?Promise.all(c).then(d):d()}return c}function ps(t,e,n={}){var l;const s=Ct(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const a=s?()=>Promise.all(lr(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:d}=i;return Zd(t,e,u,c,h,d,n)}:()=>Promise.resolve(),{when:r}=i;if(r){const[u,c]=r==="beforeChildren"?[a,o]:[o,a];return u().then(()=>c())}else return Promise.all([a(),o(n.delay)])}function Zd(t,e,n=0,s=0,i=0,a=1,o){const r=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),r.push(ps(l,e,{...o,delay:n+(typeof s=="function"?0:s)+nr(t.variantChildren,l,s,i,a)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(r)}function Jd(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(a=>ps(t,a,n));s=Promise.all(i)}else if(typeof e=="string")s=ps(t,e,n);else{const i=typeof e=="function"?Ct(t,e,n.custom):e;s=Promise.all(lr(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const eh={test:t=>t==="auto",parse:t=>t},ur=t=>e=>e.test(t),cr=[Vt,j,Oe,Ye,Ac,Tc,eh],qi=t=>cr.find(ur(t));function th(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||_a(t):!0}const nh=new Set(["brightness","contrast","saturate","opacity"]);function sh(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ws)||[];if(!s)return t;const i=n.replace(s,"");let a=nh.has(e)?1:0;return s!==n&&(a*=100),e+"("+a+i+")"}const ih=/\b([a-z-]*)\(.*?\)/gu,ms={...Ve,getAnimatableNone:t=>{const e=t.match(ih);return e?e.map(sh).join(" "):t}},gs={...Ve,getAnimatableNone:t=>{const e=Ve.parse(t);return Ve.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Hi={...Vt,transform:Math.round},oh={rotate:Ye,rotateX:Ye,rotateY:Ye,rotateZ:Ye,scale:mn,scaleX:mn,scaleY:mn,scaleZ:mn,skew:Ye,skewX:Ye,skewY:Ye,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:Wt,originX:Di,originY:Di,originZ:j},oi={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...oh,zIndex:Hi,fillOpacity:Wt,strokeOpacity:Wt,numOctaves:Hi},ah={...oi,color:ae,backgroundColor:ae,outlineColor:ae,fill:ae,stroke:ae,borderColor:ae,borderTopColor:ae,borderRightColor:ae,borderBottomColor:ae,borderLeftColor:ae,filter:ms,WebkitFilter:ms,mask:gs,WebkitMask:gs},dr=t=>ah[t],rh=new Set([ms,gs]);function hr(t,e){let n=dr(t);return rh.has(n)||(n=Ve),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const lh=new Set(["auto","none","0"]);function uh(t,e,n){let s=0,i;for(;s<t.length&&!i;){const a=t[s];typeof a=="string"&&!lh.has(a)&&Pt(a).values.length&&(i=t[s]),s++}if(i&&n)for(const a of e)t[a]=hr(n,i)}class ch extends ti{constructor(e,n,s,i,a){super(e,n,s,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let h=e[c];if(typeof h=="string"&&(h=h.trim(),Gs(h))){const d=sr(h,n.current);d!==void 0&&(e[c]=d),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!ar.has(s)||e.length!==2)return;const[i,a]=e,o=qi(i),r=qi(a),l=Mi(i),u=Mi(a);if(l!==u&&Je[s]){this.needsMeasurement=!0;return}if(o!==r)if(Fi(o)&&Fi(r))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else Je[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||th(e[i]))&&s.push(i);s.length&&uh(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Je[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var r;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const a=s.length-1,o=s[a];s[a]=Je[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(r=this.removedTransforms)!=null&&r.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const dh=new Set(["opacity","clipPath","filter","transform"]);function fr(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const pr=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function hh(t){return Sa(t)&&"offsetHeight"in t}const{schedule:mr}=$a(queueMicrotask,!1),fh={y:!1};function ph(){return fh.y}function gr(t,e){const n=fr(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function mh(t){return!(t.pointerType==="touch"||ph())}function gh(t,e,n={}){const[s,i,a]=gr(t,n);return s.forEach(o=>{let r=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",p)},h=m=>{u&&(u(m),u=void 0),c()},d=m=>{r=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),l&&(l=!1,h(m))},f=()=>{r=!0,window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",d,i)},p=m=>{if(m.pointerType!=="touch"){if(r){l=!0;return}h(m)}},g=m=>{if(!mh(m))return;l=!1;const v=e(o,m);typeof v=="function"&&(u=v,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",g,i),o.addEventListener("pointerdown",f,i)}),a}const vr=(t,e)=>e?t===e?!0:vr(t,e.parentElement):!1,vh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,yh=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function xh(t){return yh.has(t.tagName)||t.isContentEditable===!0}const xn=new WeakSet;function Ki(t){return e=>{e.key==="Enter"&&t(e)}}function qn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const bh=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Ki(()=>{if(xn.has(n))return;qn(n,"down");const i=Ki(()=>{qn(n,"up")}),a=()=>qn(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",a,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Gi(t){return vh(t)&&!0}const Wi=new WeakSet;function wh(t,e,n={}){const[s,i,a]=gr(t,n),o=r=>{const l=r.currentTarget;if(!Gi(r)||Wi.has(r))return;xn.add(l),n.stopPropagation&&Wi.add(r);const u=e(l,r),c=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),xn.has(l)&&xn.delete(l),Gi(f)&&typeof u=="function"&&u(f,{success:p})},h=f=>{c(f,l===window||l===document||n.useGlobalTarget||vr(l,f.target))},d=f=>{c(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",d,i)};return s.forEach(r=>{(n.useGlobalTarget?window:r).addEventListener("pointerdown",o,i),hh(r)&&(r.addEventListener("focus",u=>bh(u,i)),!xh(r)&&!r.hasAttribute("tabindex")&&(r.tabIndex=0))}),a}function yr(t){return Sa(t)&&"ownerSVGElement"in t}function Sh(t){return yr(t)&&t.tagName==="svg"}const _h=[...cr,ae,Ve],Th=t=>_h.find(ur(t)),Yi=()=>({translate:0,scale:1,origin:0,originPoint:0}),_t=()=>({x:Yi(),y:Yi()}),Xi=()=>({min:0,max:0}),ce=()=>({x:Xi(),y:Xi()}),Ah=new WeakMap;function ai(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Mn(t){return typeof t=="string"||Array.isArray(t)}const kh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ch=["initial",...kh];function xr(t){return ai(t.animate)||Ch.some(e=>Mn(t[e]))}function Ph(t){return!!(xr(t)||t.variants)}function Mh(t,e,n){for(const s in e){const i=e[s],a=n[s];if(ve(i))t.addValue(s,i);else if(ve(a))t.addValue(s,Mt(i,{owner:t}));else if(a!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Mt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const vs={current:null},br={current:!1},Dh=typeof window<"u";function Vh(){if(br.current=!0,!!Dh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vs.current=t.matches;t.addEventListener("change",e),e()}else vs.current=!1}const Qi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zi={};class Lh{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:r},l={}){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=ti,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=xe.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,ee.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=r;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=xr(n),this.isVariantNode=Ph(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];u[f]!==void 0&&ve(p)&&p.set(u[f])}}mount(e){var n,s;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,Ah.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,a)=>this.bindToMotionValue(a,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(br.current||Vh(),this.shouldReduceMotion=vs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),et(this.notifyUpdate),et(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&dh.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:r,times:l,ease:u,duration:c}=n.accelerate,h=new er({element:this.current,name:e,keyframes:r,times:l,ease:u,duration:Ce(c)}),d=o(h);this.valueSubscriptions.set(e,()=>{d(),h.cancel()});return}const s=Et.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&ee.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Zi){const n=Zi[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ce()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Qi.length;s++){const i=Qi[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=e[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Mh(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Mt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(wa(s)||_a(s))?s=parseFloat(s):!Th(s)&&Ve.test(n)&&(s=hr(e,n)),this.setBaseTarget(e,ve(s)?s.get():s)),ve(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var a;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=or(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!ve(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Us),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){mr.render(this.render)}}class wr extends Lh{constructor(){super(...arguments),this.KeyframeResolver=ch}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ve(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Sr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Eh({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Rh(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Hn(t){return t===void 0||t===1}function ys({scale:t,scaleX:e,scaleY:n}){return!Hn(t)||!Hn(e)||!Hn(n)}function at(t){return ys(t)||_r(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function _r(t){return Ji(t.x)||Ji(t.y)}function Ji(t){return t&&t!=="0%"}function kn(t,e,n){const s=t-n,i=e*s;return n+i}function eo(t,e,n,s,i){return i!==void 0&&(t=kn(t,i,s)),kn(t,n,s)+e}function xs(t,e=0,n=1,s,i){t.min=eo(t.min,e,n,s,i),t.max=eo(t.max,e,n,s,i)}function Tr(t,{x:e,y:n}){xs(t.x,e.translate,e.scale,e.originPoint),xs(t.y,n.translate,n.scale,n.originPoint)}const to=.999999999999,no=1.0000000000001;function Ih(t,e,n,s=!1){var r;const i=n.length;if(!i)return;e.x=e.y=1;let a,o;for(let l=0;l<i;l++){a=n[l],o=a.projectionDelta;const{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(s&&a.options.layoutScroll&&a.scroll&&a!==a.root&&At(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Tr(t,o)),s&&at(a.latestValues)&&At(t,a.latestValues,(r=a.layout)==null?void 0:r.layoutBox))}e.x<no&&e.x>to&&(e.x=1),e.y<no&&e.y>to&&(e.y=1)}function Tt(t,e){t.min=t.min+e,t.max=t.max+e}function so(t,e,n,s,i=.5){const a=se(t.min,t.max,i);xs(t,e,n,a,s)}function io(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function At(t,e,n){const s=n??t;so(t.x,io(e.x,s.x),e.scaleX,e.scale,e.originX),so(t.y,io(e.y,s.y),e.scaleY,e.scale,e.originY)}function Ar(t,e){return Sr(Rh(t.getBoundingClientRect(),e))}function $h(t,e,n){const s=Ar(t,n),{scroll:i}=e;return i&&(Tt(s.x,i.offset.x),Tt(s.y,i.offset.y)),s}const Bh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Oh=Lt.length;function Fh(t,e,n){let s="",i=!0;for(let a=0;a<Oh;a++){const o=Lt[a],r=t[o];if(r===void 0)continue;let l=!0;if(typeof r=="number")l=r===(o.startsWith("scale")?1:0);else{const u=parseFloat(r);l=o.startsWith("scale")?u===1:u===0}if(!l||n){const u=pr(r,oi[o]);if(!l){i=!1;const c=Bh[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function ri(t,e,n){const{style:s,vars:i,transformOrigin:a}=t;let o=!1,r=!1;for(const l in e){const u=e[l];if(Et.has(l)){o=!0;continue}else if(Ks(l)){i[l]=u;continue}else{const c=pr(u,oi[l]);l.startsWith("origin")?(r=!0,a[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=Fh(e,t.transform,n):s.transform&&(s.transform="none")),r){const{originX:l="50%",originY:u="50%",originZ:c=0}=a;s.transformOrigin=`${l} ${u} ${c}`}}function kr(t,{style:e,vars:n},s,i){const a=t.style;let o;for(o in e)a[o]=e[o];i==null||i.applyProjectionStyles(a,s);for(o in n)a.setProperty(o,n[o])}function oo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Be={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(j.test(t))t=parseFloat(t);else return t;const n=oo(t,e.target.x),s=oo(t,e.target.y);return`${n}% ${s}%`}},Cr={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Ve.parse(t);if(i.length>5)return s;const a=Ve.createTransformer(t),o=typeof i[0]!="number"?1:0,r=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=r,i[1+o]/=l;const u=se(r,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}},Yt={borderRadius:{...Be,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Be,borderTopRightRadius:Be,borderBottomLeftRadius:Be,borderBottomRightRadius:Be,boxShadow:Cr};function Pr(t){for(const e in t)Yt[e]=t[e],Ks(e)&&(Yt[e].isCSSVariable=!0)}function jh(t,{layout:e,layoutId:n}){return Et.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Yt[t]||t==="opacity")}function Mr(t,e,n){var o;const s=t.style,i=e==null?void 0:e.style,a={};if(!s)return a;for(const r in s)(ve(s[r])||i&&ve(i[r])||jh(r,t)||((o=n==null?void 0:n.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(a[r]=s[r]);return a}function Nh(t){return window.getComputedStyle(t)}class zh extends wr{constructor(){super(...arguments),this.type="html",this.renderInstance=kr}readValueFromInstance(e,n){var s;if(Et.has(n))return(s=this.projection)!=null&&s.isProjecting?rs(n):dd(e,n);{const i=Nh(e),a=(Ks(n)?i.getPropertyValue(n):i[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Ar(e,n)}build(e,n,s){ri(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Mr(e,n,s)}}const Uh={offset:"stroke-dashoffset",array:"stroke-dasharray"},qh={offset:"strokeDashoffset",array:"strokeDasharray"};function Hh(t,e,n=1,s=0,i=!0){t.pathLength=1;const a=i?Uh:qh;t[a.offset]=`${-s}`,t[a.array]=`${e} ${n}`}const Kh=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Dr(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...r},l,u,c){if(ri(t,r,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete h.transformBox);for(const f of Kh)h[f]!==void 0&&(d[f]=h[f],delete h[f]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Hh(h,i,a,o,!1)}const li=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"]),Vr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Gh(t,e,n,s){kr(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(li.has(i)?i:ii(i),e.attrs[i])}function Wh(t,e,n){const s=Mr(t,e,n);for(const i in t)if(ve(t[i])||ve(e[i])){const a=Lt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[a]=t[i]}return s}class Yh extends wr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ce}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Et.has(n)){const s=dr(n);return s&&s.default||0}return n=li.has(n)?n:ii(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Wh(e,n,s)}build(e,n,s){Dr(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Gh(e,n,s,i)}mount(e){this.isSVGTag=Vr(e.tagName),super.mount(e)}}function ao(t,e){t.min=e.min,t.max=e.max}function Me(t,e){ao(t.x,e.x),ao(t.y,e.y)}function ro(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Lr=1e-4,Xh=1-Lr,Qh=1+Lr,Er=.01,Zh=0-Er,Jh=0+Er;function be(t){return t.max-t.min}function ef(t,e,n){return Math.abs(t-e)<=n}function lo(t,e,n,s=.5){t.origin=s,t.originPoint=se(e.min,e.max,t.origin),t.scale=be(n)/be(e),t.translate=se(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Xh&&t.scale<=Qh||isNaN(t.scale))&&(t.scale=1),(t.translate>=Zh&&t.translate<=Jh||isNaN(t.translate))&&(t.translate=0)}function qt(t,e,n,s){lo(t.x,e.x,n.x,s?s.originX:void 0),lo(t.y,e.y,n.y,s?s.originY:void 0)}function uo(t,e,n){t.min=n.min+e.min,t.max=t.min+be(e)}function tf(t,e,n){uo(t.x,e.x,n.x),uo(t.y,e.y,n.y)}function co(t,e,n){t.min=e.min-n.min,t.max=t.min+be(e)}function Cn(t,e,n){co(t.x,e.x,n.x),co(t.y,e.y,n.y)}function ho(t,e,n,s,i){return t-=e,t=kn(t,1/n,s),i!==void 0&&(t=kn(t,1/i,s)),t}function nf(t,e=0,n=1,s=.5,i,a=t,o=t){if(Oe.test(e)&&(e=parseFloat(e),e=se(o.min,o.max,e/100)-o.min),typeof e!="number")return;let r=se(a.min,a.max,s);t===a&&(r-=e),t.min=ho(t.min,e,n,r,i),t.max=ho(t.max,e,n,r,i)}function fo(t,e,[n,s,i],a,o){nf(t,e[n],e[s],e[i],e.scale,a,o)}const sf=["x","scaleX","originX"],of=["y","scaleY","originY"];function po(t,e,n,s){fo(t.x,e,sf,n?n.x:void 0,s?s.x:void 0),fo(t.y,e,of,n?n.y:void 0,s?s.y:void 0)}function mo(t){return t.translate===0&&t.scale===1}function Rr(t){return mo(t.x)&&mo(t.y)}function go(t,e){return t.min===e.min&&t.max===e.max}function af(t,e){return go(t.x,e.x)&&go(t.y,e.y)}function vo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ir(t,e){return vo(t.x,e.x)&&vo(t.y,e.y)}function yo(t){return be(t.x)/be(t.y)}function xo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Te(t){return[t("x"),t("y")]}function rf(t,e,n){let s="";const i=t.x.translate/e.x,a=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(s=`translate3d(${i}px, ${a}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),d&&(s+=`rotateY(${d}deg) `),f&&(s+=`skewX(${f}deg) `),p&&(s+=`skewY(${p}deg) `)}const r=t.x.scale*e.x,l=t.y.scale*e.y;return(r!==1||l!==1)&&(s+=`scale(${r}, ${l})`),s||"none"}const $r=["TopLeft","TopRight","BottomLeft","BottomRight"],lf=$r.length,bo=t=>typeof t=="string"?parseFloat(t):t,wo=t=>typeof t=="number"||j.test(t);function uf(t,e,n,s,i,a){i?(t.opacity=se(0,n.opacity??1,cf(s)),t.opacityExit=se(e.opacity??1,0,df(s))):a&&(t.opacity=se(e.opacity??1,n.opacity??1,s));for(let o=0;o<lf;o++){const r=`border${$r[o]}Radius`;let l=So(e,r),u=So(n,r);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||wo(l)===wo(u)?(t[r]=Math.max(se(bo(l),bo(u),s),0),(Oe.test(u)||Oe.test(l))&&(t[r]+="%")):t[r]=u}(e.rotate||n.rotate)&&(t.rotate=se(e.rotate||0,n.rotate||0,s))}function So(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const cf=Br(0,.5,La),df=Br(.5,.95,ke);function Br(t,e,n){return s=>s<t?0:s>e?1:n(Gt(t,e,s))}function hf(t,e,n){const s=ve(t)?t:Mt(t);return s.start(si("",s,e,n)),s.animation}function ff(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const pf=(t,e)=>t.depth-e.depth;class mf{constructor(){this.children=[],this.isDirty=!1}add(e){Ns(this.children,e),this.isDirty=!0}remove(e){Sn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(pf),this.isDirty=!1,this.children.forEach(e)}}function gf(t,e){const n=xe.now(),s=({timestamp:i})=>{const a=i-n;a>=e&&(et(s),t(a-e))};return ee.setup(s,!0),()=>et(s)}function Kn(t){return ve(t)?t.get():t}class vf{constructor(){this.members=[]}add(e){Ns(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(Sn(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Sn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let s=this.members.indexOf(e)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:a}=s.options,{layoutDependency:o}=e.options;(a===void 0||a!==o)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,i,a,o;(s=(n=e.options).onExitComplete)==null||s.call(n),(o=(i=e.resumingFrom)==null?void 0:(a=i.options).onExitComplete)==null||o.call(a)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const bn={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Gn=["","X","Y","Z"],yf=1e3;let xf=0;function Wn(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Or(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=rr(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ee,!(i||a))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Or(s)}function Fr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},r=e==null?void 0:e()){this.id=xf++,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(Sf),this.nodes.forEach(kf),this.nodes.forEach(Cf),this.nodes.forEach(_f)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new mf)}addEventListener(o,r){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Us),this.eventHandlers.get(o).add(r)}notifyListeners(o,...r){const l=this.eventHandlers.get(o);l&&l.notify(...r)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=yr(o)&&!Sh(o),this.instance=o;const{layoutId:r,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||r)&&(this.isLayoutDirty=!0),t){let c,h=0;const d=()=>this.root.updateBlockedByResize=!1;ee.read(()=>{h=window.innerWidth}),t(o,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,c&&c(),c=gf(d,250),bn.hasAnimatedSinceResize&&(bn.hasAnimatedSinceResize=!1,this.nodes.forEach(Ao)))})}r&&this.root.registerSharedNode(r,this),this.options.animate!==!1&&u&&(r||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Lf,{onLayoutAnimationStart:g,onLayoutAnimationComplete:m}=u.getProps(),v=!this.targetLayout||!Ir(this.targetLayout,f),C=!h&&d;if(this.options.layoutRoot||this.resumeFrom||C||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...ni(p,"layout"),onPlay:g,onComplete:m};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(c,C)}else h||Ao(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),et(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(Pf),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Or(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:r,layout:l}=this.options;if(r===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(_o);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(To);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Af),this.nodes.forEach(bf),this.nodes.forEach(wf)):this.nodes.forEach(To),this.clearAllSnapshots();const r=xe.now();he.delta=Fe(0,1e3/60,r-he.timestamp),he.timestamp=r,he.isProcessing=!0,Fn.update.process(he),Fn.preRender.process(he),Fn.render.process(he),he.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,mr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Tf),this.sharedNodes.forEach(Mf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ee.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ee.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!be(this.snapshot.measuredBox.x)&&!be(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ce(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:r}=this.options;r&&r.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let r=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(r=!1),r&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,r=this.projectionDelta&&!Rr(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(r||at(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const r=this.measurePageBox();let l=this.removeElementScroll(r);return o&&(l=this.removeTransform(l)),Ef(l),{animationId:this.root.animationId,measuredBox:r,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return ce();const r=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Rf))){const{scroll:c}=this.root;c&&(Tt(r.x,c.offset.x),Tt(r.y,c.offset.y))}return r}removeElementScroll(o){var l;const r=ce();if(Me(r,o),(l=this.scroll)!=null&&l.wasRoot)return r;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:d}=c;c!==this.root&&h&&d.layoutScroll&&(h.wasRoot&&Me(r,o),Tt(r.x,h.offset.x),Tt(r.y,h.offset.y))}return r}applyTransform(o,r=!1){var u,c;const l=ce();Me(l,o);for(let h=0;h<this.path.length;h++){const d=this.path[h];!r&&d.options.layoutScroll&&d.scroll&&d!==d.root&&At(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),at(d.latestValues)&&At(l,d.latestValues,(u=d.layout)==null?void 0:u.layoutBox)}return at(this.latestValues)&&At(l,this.latestValues,(c=this.layout)==null?void 0:c.layoutBox),l}removeTransform(o){var l;const r=ce();Me(r,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!at(c.latestValues))continue;let h;c.instance&&(ys(c.latestValues)&&c.updateSnapshot(),h=ce(),Me(h,c.measurePageBox())),po(r,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,h)}return at(this.latestValues)&&po(r,this.latestValues),r}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==he.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;const r=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=r.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=r.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=r.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==r;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=he.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ce(),this.targetWithTransforms=ce()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tf(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Me(this.target,this.layout.layoutBox),Tr(this.target,this.targetDelta)):Me(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ys(this.parent.latestValues)||_r(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,r,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ce(),this.relativeTargetOrigin=ce(),Cn(this.relativeTargetOrigin,r,l),Me(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const o=this.getLead(),r=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===he.timestamp&&(l=!1),l)return;const{layout:u,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||!(u||c))return;Me(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;Ih(this.layoutCorrected,this.treeScale,this.path,r),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=ce());const{target:f}=o;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ro(this.prevProjectionDelta.x,this.projectionDelta.x),ro(this.prevProjectionDelta.y,this.projectionDelta.y)),qt(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!xo(this.projectionDelta.x,this.prevProjectionDelta.x)||!xo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var r;if((r=this.options.visualElement)==null||r.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=_t(),this.projectionDelta=_t(),this.projectionDeltaWithTransform=_t()}setAnimationOrigin(o,r=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=_t();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!r;const d=ce(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=f!==p,m=this.getStack(),v=!m||m.members.length<=1,C=!!(g&&!v&&this.options.crossfade===!0&&!this.path.some(Vf));this.animationProgress=0;let y;this.mixTargetDelta=$=>{const P=$/1e3;ko(h.x,o.x,P),ko(h.y,o.y,P),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cn(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Df(this.relativeTarget,this.relativeTargetOrigin,d,P),y&&af(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=ce()),Me(y,this.relativeTarget)),g&&(this.animationValues=c,uf(c,u,this.latestValues,P,C,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var r,l,u;this.notifyListeners("animationStart"),(r=this.currentAnimation)==null||r.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(et(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ee.update(()=>{bn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Mt(0)),this.motionValue.jump(0,!1),this.currentAnimation=hf(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(yf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:r,target:l,layout:u,latestValues:c}=o;if(!(!r||!l||!u)){if(this!==o&&this.layout&&u&&jr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ce();const h=be(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=be(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}Me(r,l),At(r,c),qt(this.projectionDeltaWithTransform,this.layoutCorrected,r,c)}}registerSharedNode(o,r){this.sharedNodes.has(o)||this.sharedNodes.set(o,new vf),this.sharedNodes.get(o).add(r);const u=r.options.initialPromotionConfig;r.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(r):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var r;const{layoutId:o}=this.options;return o?((r=this.getStack())==null?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:o}=this.options;return o?(r=this.getStack())==null?void 0:r.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:r,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),r&&this.setOptions({transition:r})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let r=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(r=!0),!r)return;const u={};l.z&&Wn("z",o,u,this.animationValues);for(let c=0;c<Gn.length;c++)Wn(`rotate${Gn[c]}`,o,u,this.animationValues),Wn(`skew${Gn[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,r){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Kn(r==null?void 0:r.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Kn(r==null?void 0:r.pointerEvents)||""),this.hasProjected&&!at(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=rf(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),o.transform=h;const{x:d,y:f}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in Yt){if(c[p]===void 0)continue;const{correct:g,applyTo:m,isCSSVariable:v}=Yt[p],C=h==="none"?c[p]:g(c[p],u);if(m){const y=m.length;for(let $=0;$<y;$++)o[m[$]]=C}else v?this.options.visualElement.renderState.vars[p]=C:o[p]=C}this.options.layoutId&&(o.pointerEvents=u===this?Kn(r==null?void 0:r.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var r;return(r=o.currentAnimation)==null?void 0:r.stop()}),this.root.nodes.forEach(_o),this.root.sharedNodes.clear()}}}function bf(t){t.updateLayout()}function wf(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:a}=t.options,o=e.source!==t.layout.source;a==="size"?Te(h=>{const d=o?e.measuredBox[h]:e.layoutBox[h],f=be(d);d.min=s[h].min,d.max=d.min+f}):jr(a,e.layoutBox,s)&&Te(h=>{const d=o?e.measuredBox[h]:e.layoutBox[h],f=be(s[h]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+f)});const r=_t();qt(r,s,e.layoutBox);const l=_t();o?qt(l,t.applyTransform(i,!0),e.measuredBox):qt(l,s,e.layoutBox);const u=!Rr(r);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:f}=h;if(d&&f){const p=ce();Cn(p,e.layoutBox,d.layoutBox);const g=ce();Cn(g,s,f.layoutBox),Ir(p,g)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:r,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Sf(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function _f(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Tf(t){t.clearSnapshot()}function _o(t){t.clearMeasurements()}function To(t){t.isLayoutDirty=!1}function Af(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ao(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function kf(t){t.resolveTargetDelta()}function Cf(t){t.calcProjection()}function Pf(t){t.resetSkewAndRotation()}function Mf(t){t.removeLeadSnapshot()}function ko(t,e,n){t.translate=se(e.translate,0,n),t.scale=se(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Co(t,e,n,s){t.min=se(e.min,n.min,s),t.max=se(e.max,n.max,s)}function Df(t,e,n,s){Co(t.x,e.x,n.x,s),Co(t.y,e.y,n.y,s)}function Vf(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Lf={duration:.45,ease:[.4,0,.1,1]},Po=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Mo=Po("applewebkit/")&&!Po("chrome/")?Math.round:ke;function Do(t){t.min=Mo(t.min),t.max=Mo(t.max)}function Ef(t){Do(t.x),Do(t.y)}function jr(t,e,n){return t==="position"||t==="preserve-aspect"&&!ef(yo(e),yo(n),.2)}function Rf(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const If=Fr({attachResizeListener:(t,e)=>ff(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Yn={current:void 0},$f=Fr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Yn.current){const t=new If({});t.mount(window),t.setOptions({layoutScroll:!0}),Yn.current=t}return Yn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Bf={some:0,all:1};function Of(t,e,{root:n,margin:s,amount:i="some"}={}){const a=fr(t),o=new WeakMap,r=u=>{u.forEach(c=>{const h=o.get(c.target);if(c.isIntersecting!==!!h)if(c.isIntersecting){const d=e(c.target,c);typeof d=="function"?o.set(c.target,d):l.unobserve(c.target)}else typeof h=="function"&&(h(c),o.delete(c.target))})},l=new IntersectionObserver(r,{root:n,rootMargin:s,threshold:typeof i=="number"?i:Bf[i]});return a.forEach(u=>l.observe(u)),()=>l.disconnect()}const Vo=(t,e)=>Math.abs(t-e);function Ff(t,e){const n=Vo(t.x,e.x),s=Vo(t.y,e.y);return Math.sqrt(n**2+s**2)}function Nr({current:t}){return t?t.ownerDocument.defaultView:null}function bs(t){if(t)return t.nodeType===3||t.nodeType===8?bs(t.nextSibling):t}const[jf,Nf,g0]=Jt("Motion"),[zf,v0,y0]=Jt("LayoutGroup"),Uf={reducedMotion:"never",transition:void 0,nonce:void 0},[qf,x0,b0]=Jt("MotionConfig");function Hf(){return qf(L(()=>Uf))}const Kf={motionAttribute:"data-ap"},ws=[];function zr(t){for(const e of t)e&&!ws.includes(e)&&ws.push(e)}function Ur(t,e,n){if(Array.isArray(t))return t.reduce((s,i)=>{const a=Ur(i,e,n);return a?{...s,...a}:s},{});if(typeof t=="object")return t;if(t&&e){const s=e[t];return typeof s=="function"?s(n):s}}function Gf(t,e,n){const s=Ur(t,e,n);if(!s)return;const{transition:i,transitionEnd:a,...o}=s;return{...o,...a}}function Wf(t,e){var i;const n=(t.initial===void 0&&t.variants?e==null?void 0:e.initial:t.initial)===!1?["initial","animate"]:["initial"],s=t.custom??((i=t.presenceContext)==null?void 0:i.custom);return n.reduce((a,o)=>({...a,...Gf(t[o]||(e==null?void 0:e[o]),t.variants,s)}),{})}function qr(t,e){const n=e==null?void 0:e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}var Yf=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 Hr(t){return Yf.has(t)}const Lo=new WeakMap;var Xf=class{constructor(t,e){var n;this.element=null,this.isExiting=!1,this.presenceContainer=null,this.children=new Set,this.features=new Map,this._context=null,this.options=t,this.parent=e,(n=e==null?void 0:e.children)==null||n.add(this),this.latestValues=Wf(t,this.context),this.type=Hr(this.options.as)?"svg":"html"}get context(){return this._context||(this._context=new Proxy({},{get:(t,e)=>{var s;const n=this.options[e];return Mn(n)||e==="initial"&&n===!1?n:(s=this.parent)==null?void 0:s.context[e]}})),this._context}updateFeatures(){if(this.visualElement)for(const t of ws){this.features.has(t.key)||this.features.set(t.key,new t(this));const e=this.features.get(t.key);this.isMounted()&&(e.isMount?e.update():(e.mount(),e.isMount=!0))}}updateOptions(t){var e;this.options=t,(e=this.visualElement)==null||e.update({...this.options,whileTap:this.options.whilePress},null)}mount(t){var e,n;Lo.set(t,this),this.element=t,t.setAttribute(Kf.motionAttribute,((e=this.options.presenceContext)==null?void 0:e.presenceId)??""),(n=this.visualElement)==null||n.mount(t),this.updateFeatures()}beforeUnmount(){this.getSnapshot(this.options,!1)}unmount(){var t,e,n;(e=(t=this.parent)==null?void 0:t.children)==null||e.delete(this),Lo.delete(this.element),this.features.forEach(s=>{var i;return(i=s.unmount)==null?void 0:i.call(s)}),(n=this.visualElement)==null||n.unmount()}beforeUpdate(){this.getSnapshot(this.options,void 0)}update(){this.updateFeatures(),this.didUpdate()}tryExitComplete(){var t,e,n,s,i;this.isExiting||(t=this.options)!=null&&t.layoutId&&((n=(e=this.visualElement.projection)==null?void 0:e.currentAnimation)==null?void 0:n.state)==="running"||(i=(s=this.options.presenceContext)==null?void 0:s.onMotionExitComplete)==null||i.call(s,this.presenceContainer,this)}setActive(t,e){var n,s;t==="exit"&&e&&(this.isExiting=!0),(s=(n=this.visualElement)==null?void 0:n.animationState)==null||s.setActive(t,e).then(()=>{var i;t==="exit"&&e&&(this.isExiting=!1,(i=this.options)!=null&&i.layoutId?ee.postRender(()=>this.tryExitComplete()):this.tryExitComplete())})}isMounted(){return!!this.element}initVisualElement(t){var e,n,s;this.visualElement||(this.visualElement=t(this.options.as,{presenceContext:null,parent:(e=this.parent)==null?void 0:e.visualElement,props:{...this.options,whileTap:this.options.whilePress},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{...this.latestValues}},reducedMotionConfig:(n=this.options.motionConfig)==null?void 0:n.reducedMotion}),(s=this.visualElement.parent)==null||s.addChild(this.visualElement),this.isMounted()&&this.visualElement.mount(this.element))}getSnapshot(t,e){}didUpdate(){}},He=class{constructor(t){this.state=t}mount(){}unmount(){}update(){}};const Kr=["initial","animate","exit","whileHover","whileDrag","whileFocus","whilePress"];var Qf=Kr.length;function Gr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Gr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Qf;n++){const s=Kr[n],i=t.props[s];(Mn(i)||i===!1)&&(e[s]=i)}return e}var Wr=["animate","whileInView","whileFocus","whileHover","whilePress","whileDrag","exit"],Zf=[...Wr].reverse(),Jf=Wr.length;function ot(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Eo(){return{animate:ot(!0),whileInView:ot(),whileHover:ot(),whilePress:ot(),whileDrag:ot(),whileFocus:ot(),exit:ot()}}function ep(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!qr(e,t):!1}function Ro(t){return Array.isArray(t)}function tp(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Jd(t,n,s)))}function np(t){let e=tp(t),n=Eo(),s=!0;const i=l=>(u,c)=>{var d;const h=Ct(t,c,l==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(h){const{transition:f,transitionEnd:p,...g}=h;u={...u,...g,...p}}return u};function a(l){e=l(t)}function o(l){const{props:u}=t,c=Gr(t.parent)||{},h=[],d=new Set;let f={},p=1/0;for(let m=0;m<Jf;m++){const v=Zf[m],C=n[v],y=u[v]!==void 0?u[v]:c[v],$=Mn(y),P=v===l?C.isActive:null;P===!1&&(p=m);let V=y===c[v]&&y!==u[v]&&$;if(V&&s&&t.manuallyAnimateOnMount&&(V=!1),C.protectedKeys={...f},!C.isActive&&P===null||!y&&!C.prevProp||ai(y)||typeof y=="boolean")continue;const T=ep(C.prevProp,y);let w=T||v===l&&C.isActive&&!V&&$||m>p&&$,B=!1;const E=Array.isArray(y)?y:[y];let z=E.reduce(i(v),{});P===!1&&(z={});const{prevResolvedValues:F={}}=C,te={...F,...z},A=N=>{w=!0,d.has(N)&&(B=!0,d.delete(N)),C.needsAnimating[N]=!0;const G=t.getValue(N);G&&(G.liveStyle=!1)};for(const N in te){const G=z[N],W=F[N];if(Object.hasOwnProperty.call(f,N))continue;let U=!1;Ro(G)&&Ro(W)?U=!qr(G,W):U=G!==W,U?G!=null?A(N):d.add(N):G!==void 0&&d.has(N)?A(N):C.protectedKeys[N]=!0}C.prevProp=y,C.prevResolvedValues=z,C.isActive&&(f={...f,...z}),s&&t.blockInitialAnimation&&(w=!1);const I=V&&T;w&&(!I||B)&&h.push(...E.map(N=>{const G={type:v};if(typeof N=="string"&&s&&!I&&t.manuallyAnimateOnMount&&t.parent){const{parent:W}=t,U=Ct(W,N);if(W.enteringChildren&&U){const{delayChildren:Q}=U.transition||{};G.delay=nr(W.enteringChildren,t,Q)}}return{animation:N,options:G}}))}if(d.size){const m={};if(typeof u.initial!="boolean"){const v=Ct(t,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(m.transition=v.transition)}d.forEach(v=>{const C=t.getBaseTarget(v),y=t.getValue(v);y&&(y.liveStyle=!0),m[v]=C??null}),h.push({animation:m})}let g=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(h):Promise.resolve()}function r(l,u){var h;if(n[l].isActive===u)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(d=>{var f;(f=d.animationState)==null||f.setActive(l,u)}),n[l].isActive=u;const c=o(l);for(const d in n)n[d].protectedKeys={};return c}return{animateChanges:o,setActive:r,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Eo(),s=!0}}}function Yr(t){return t.style.display==="none"||t.offsetParent===null&&window.getComputedStyle(t).position!=="fixed"}var ut,As,sp=(ut=class extends He{constructor(e){super(e);const n=e.visualElement;n.animationState||(n.animationState=np(n))}updateAnimationControlsSubscription(){const{animate:e}=this.state.options;ai(e)&&(this.unmountControls=e.subscribe(this.state.visualElement))}mount(){var e;Yr(this.state.element)?this.state.setActive("exit",!0):(e=this.state.visualElement.animationState)==null||e.animateChanges(),this.updateAnimationControlsSubscription()}update(){var s;(s=this.state.visualElement.animationState)==null||s.animateChanges();const{animate:e}=this.state.visualElement.getProps(),{animate:n}=this.state.visualElement.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.state.visualElement.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}},As=new WeakMap,Re(ut,As,ut.key="animation"),ut);function ip(t,e){return Hr(t)?new Yh(e):new zh(e)}function Io(t){return{point:{x:t.pageX,y:t.pageY}}}var ct,ks,op=(ct=class extends He{constructor(e){super(e)}isActive(){const{whilePress:e,onPress:n,onPressCancel:s,onPressStart:i}=this.state.options;return!!(e||n||s||i)}register(){var n;const e=this.state.element;!e||!this.isActive()||((n=this.removePress)==null||n.call(this),this.removePress=wh(e,(s,i)=>{const a=this.state.options;return this.state.setActive("whilePress",!0),a.onPressStart&&ee.postRender(()=>a.onPressStart(i,Io(i))),(o,{success:r})=>{this.state.setActive("whilePress",!1);const l=r?"onPress":"onPressCancel",u=this.state.options[l];u&&ee.postRender(()=>u(o,Io(o)))}},{useGlobalTarget:this.state.options.globalPressTarget}))}mount(){this.register()}update(){const e=this.state.visualElement.prevProps;!(e!=null&&e.whilePress||e!=null&&e.whileTap||e!=null&&e.onPress||e!=null&&e.onPressCancel||e!=null&&e.onPressStart)&&this.isActive()&&this.register()}unmount(){var e;(e=this.removePress)==null||e.call(this),this.removePress=void 0}},ks=new WeakMap,Re(ct,ks,ct.key="press"),ct);function Xr(t){return t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1}function Xt(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}function ap(t){return e=>Xr(e)&&t(e,Xt(e))}var dt,Cs,rp=(dt=class extends He{constructor(e){super(e)}isActive(){const{whileHover:e,onHoverStart:n,onHoverEnd:s}=this.state.options;return!!(e||n||s)}register(){var n;const e=this.state.element;!e||!this.isActive()||((n=this.removeHover)==null||n.call(this),this.removeHover=gh(e,(s,i)=>{const a=this.state.options;return this.state.setActive("whileHover",!0),a.onHoverStart&&ee.postRender(()=>a.onHoverStart(i,Xt(i))),o=>{this.state.setActive("whileHover",!1);const r=this.state.options.onHoverEnd;r&&ee.postRender(()=>r(o,Xt(o)))}}))}mount(){this.register()}update(){const e=this.state.visualElement.prevProps;!(e!=null&&e.whileHover||e!=null&&e.onHoverStart||e!=null&&e.onHoverEnd)&&this.isActive()&&this.register()}unmount(){var e;(e=this.removeHover)==null||e.call(this),this.removeHover=void 0}},Cs=new WeakMap,Re(dt,Cs,dt.key="hover"),dt),ht,Ps,lp=(ht=class extends He{constructor(e){super(e)}isActive(){const{whileInView:e,onViewportEnter:n,onViewportLeave:s}=this.state.options;return!!(e||n||s)}startObserver(){var i;const e=this.state.element;if(!e||!this.isActive())return;(i=this.removeObserver)==null||i.call(this);const{once:n,...s}=this.state.options.inViewOptions||{};this.removeObserver=Of(e,(a,o)=>{const r=this.state.options;if(this.state.setActive("whileInView",!0),r.onViewportEnter&&ee.postRender(()=>r.onViewportEnter(o)),!n)return()=>{this.state.setActive("whileInView",!1);const l=this.state.options.onViewportLeave;l&&ee.postRender(()=>l(o))}},s)}mount(){this.startObserver()}update(){const{props:e,prevProps:n}=this.state.visualElement;["amount","margin","root"].some(s=>{var i,a;return((i=e.inViewOptions)==null?void 0:i[s])!==((a=n==null?void 0:n.inViewOptions)==null?void 0:a[s])})&&this.startObserver()}unmount(){var e;(e=this.removeObserver)==null||e.call(this),this.removeObserver=void 0}},Ps=new WeakMap,Re(ht,Ps,ht.key="inView"),ht);function Pn(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}var ft,Ms,up=(ft=class extends He{constructor(e){super(e),this.isFocused=!1}onFocus(){let e=!1;try{e=this.state.element.matches(":focus-visible")}catch{e=!0}e&&(this.state.setActive("whileFocus",!0),this.isFocused=!0)}onBlur(){this.isFocused&&(this.state.setActive("whileFocus",!1),this.isFocused=!1)}mount(){const e=this.state.element;this.removeFocus=en(Pn(e,"focus",()=>this.onFocus()),Pn(e,"blur",()=>this.onBlur()))}unmount(){var e;(e=this.removeFocus)==null||e.call(this),this.removeFocus=void 0}},Ms=new WeakMap,Re(ft,Ms,ft.key="focus"),ft);function Qr(t){if(t)return t.options.allowProjection!==!1?t.projection:Qr(t.parent)}const Zr={borderRadius:{...Be,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Be,borderTopRightRadius:Be,borderBottomLeftRadius:Be,borderBottomRightRadius:Be,boxShadow:Cr};function Nt(t){return typeof t=="object"&&t!==null&&"nodeType"in t}const cp=typeof window>"u";var pt,Ds,dp=(pt=class extends He{constructor(e){super(e),Pr(Zr),cp||this.initProjection()}initProjection(){const e=this.state.options;this.state.visualElement.projection=new $f(this.state.visualElement.latestValues,e["data-framer-portal-id"]?void 0:Qr(this.state.visualElement.parent)),this.projection=this.state.visualElement.projection,this.projection.isPresent=!0,this.setOptions()}setOptions(){var o;const e=this.state.options,{layoutId:n,layout:s,drag:i=!1,dragConstraints:a=!1}=e;(o=this.projection)==null||o.setOptions({layout:s,layoutId:n,alwaysMeasureLayout:!!n||!!i||a&&Nt(a),visualElement:this.state.visualElement,animationType:typeof e.layout=="string"?e.layout:"both",layoutRoot:e.layoutRoot,layoutScroll:e.layoutScroll,crossfade:e.crossfade,onExitComplete:()=>{var r;!((r=this.projection)!=null&&r.isPresent)&&this.state.options.layoutId&&!this.state.isExiting&&queueMicrotask(()=>{var l,u;(u=(l=this.state.options.presenceContext)==null?void 0:l.onMotionExitComplete)==null||u.call(l,this.state.presenceContainer,this.state)})}})}update(){this.setOptions()}mount(){var e;(e=this.projection)==null||e.mount(this.state.element)}},Ds=new WeakMap,Re(pt,Ds,pt.key="projection"),pt);function Ht(t,e,n,s){return Pn(t,e,ap(n),s)}var $o=new Set(["auto","scroll"]),Jr=class{constructor(t,e,{transformPagePoint:n,contextWindow:s,dragSnapToOrigin:i=!1,element:a}={}){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=Qn(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,d=Ff(c.offset,{x:0,y:0})>=3;if(!h&&!d)return;const{point:f}=c,{timestamp:p}=he;this.history.push({...f,timestamp:p});const{onStart:g,onMove:m}=this.handlers;h||(g&&g(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,c)},this.handlePointerMove=(c,h)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=Xn(h,this.transformPagePoint),ee.update(this.updatePoint,!0)},this.handlePointerUp=(c,h)=>{this.end();const{onEnd:d,onSessionEnd:f,resumeAnimation:p}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=Qn(c.type==="pointercancel"?this.lastMoveEventInfo:Xn(h,this.transformPagePoint),this.history);this.startEvent&&d&&d(c,g),f&&f(c,g)},!Xr(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=n,this.contextWindow=s||window;const o=Xn(Xt(t),this.transformPagePoint),{point:r}=o,{timestamp:l}=he;this.history=[{...r,timestamp:l}];const{onSessionStart:u}=e;u&&u(t,Qn(o,this.history)),this.removeListeners=en(Ht(this.contextWindow,"pointermove",this.handlePointerMove),Ht(this.contextWindow,"pointerup",this.handlePointerUp),Ht(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}isScrollable(t){const e=window.getComputedStyle(t);return e.overflow==="auto"||e.overflow==="scroll"||e.overflowX==="auto"||e.overflowX==="scroll"||e.overflowY==="auto"||e.overflowY==="scroll"}startScrollTracking(t){let e=t.parentElement;for(;e;){const n=getComputedStyle(e);($o.has(n.overflowX)||$o.has(n.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.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(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,s=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-e.x,y:s.y-e.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),ee.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){var t;this.removeListeners&&this.removeListeners(),(t=this.removeScrollListeners)==null||t.call(this),this.scrollPositions.clear(),et(this.updatePoint)}};function Xn(t,e){return e?{point:e(t.point)}:t}function Bo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Qn({point:t},e){return{point:t,delta:Bo(t,el(e)),offset:Bo(t,hp(e)),velocity:fp(e,.1)}}function hp(t){return t[0]}function el(t){return t[t.length-1]}function fp(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=el(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>Ce(e)));)n--;if(!s)return{x:0,y:0};const a=Ae(i.timestamp-s.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-s.x)/a,y:(i.y-s.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Oo(t){return(e,n)=>{t&&ee.postRender(()=>t(e,n))}}var mt,Vs,pp=(mt=class extends He{constructor(...e){super(...e),this.removePointerDownListener=ke}onPointerDown(e){this.session=new Jr(e,this.createPanHandlers(),{transformPagePoint:this.state.visualElement.getTransformPagePoint(),contextWindow:Nr(this.state.visualElement)})}createPanHandlers(){return{onSessionStart:Oo((e,n)=>{const{onPanSessionStart:s}=this.state.options;s&&s(e,n)}),onStart:Oo((e,n)=>{const{onPanStart:s}=this.state.options;s&&s(e,n)}),onMove:(e,n)=>{const{onPan:s}=this.state.options;s&&s(e,n)},onEnd:(e,n)=>{const{onPanEnd:s}=this.state.options;delete this.session,s&&ee.postRender(()=>s(e,n))}}}mount(){this.removePointerDownListener=Ht(this.state.element,"pointerdown",this.onPointerDown.bind(this))}update(){}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Vs=new WeakMap,Re(mt,Vs,mt.key="pan"),mt);function tl(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}var Fo=tl("dragHorizontal"),jo=tl("dragVertical");function mp(t){let e=!1;if(t==="y")e=jo();else if(t==="x")e=Fo();else{const n=Fo(),s=jo();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function gp(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?se(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?se(n,t,s.max):Math.min(t,n)),t}const Ss=.35;function vp(t,{top:e,left:n,bottom:s,right:i}){return{x:No(t.x,n,i),y:No(t.y,e,s)}}function No(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function yp(t=Ss){return t===!1?t=0:t===!0&&(t=Ss),{x:zo(t,"left","right"),y:zo(t,"top","bottom")}}function zo(t,e,n){return{min:Uo(t,e),max:Uo(t,n)}}function Uo(t,e){return typeof t=="number"?t:t[e]||0}function xp(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}function bp(t,e){return{x:qo(t.x,e.x),y:qo(t.y,e.y)}}function qo(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function wp(t,e){let n=.5;const s=be(t),i=be(e);return i>s?n=Gt(e.min,e.max-s,t.min):s>i&&(n=Gt(t.min,t.max-i,e.min)),Fe(0,1,n)}const Sp=new WeakMap;var _p=class{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ce(),this.state=t}get visualElement(){return this.state.visualElement}start(t,{snapToCursor:e=!1}={}){const n=l=>{e?this.stopAnimation():this.pauseAnimation(),e&&this.snapToCursor(Xt(l,"page").point)},s=(l,u)=>{this.stopAnimation();const{drag:c,dragPropagation:h,onDragStart:d}=this.getProps();c&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=mp(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),Te(f=>{let p=this.getAxisMotionValue(f).get()||0;if(Oe.test(p)){const{projection:g}=this.visualElement;if(g&&g.layout){const m=g.layout.layoutBox[f];m&&(p=be(m)*(parseFloat(p)/100))}}this.originPoint[f]=p}),d&&ee.postRender(()=>d(l,u)),fs(this.visualElement,"transform"),this.state.setActive("whileDrag",!0))},i=(l,u)=>{const{dragPropagation:c,dragDirectionLock:h,onDirectionLock:d,onDrag:f}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(h&&this.currentDirection===null){this.currentDirection=Tp(p),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),f&&f(l,u)},a=(l,u)=>this.stop(l,u),o=()=>Te(l=>{var u;return this.getAnimationState(l)==="paused"&&((u=this.getAxisMotionValue(l).animation)==null?void 0:u.play())}),{dragSnapToOrigin:r}=this.getProps();this.panSession=new Jr(t,{onSessionStart:n,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:o},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Nr(this.visualElement),element:this.state.element})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&ee.postRender(()=>i(t,e))}cancel(){this.isDragging=!1;const{projection:t}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:e}=this.getProps();!e&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),this.state.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:s}=this.getProps();if(!n||!gn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(a=gp(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Nt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=vp(n.layoutBox,t):this.constraints=!1,this.elastic=yp(e),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Te(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=xp(n.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Nt(t))return!1;const n=t,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=$h(n,s.root,this.visualElement.getTransformPagePoint());let a=bp(s.layout.layoutBox,i);if(e){const o=e(Eh(a));this.hasMutatedConstraints=!!o,o&&(a=Sr(o))}return a}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),r=this.constraints||{},l=Te(u=>{if(!gn(u,e,this.currentDirection))return;let c=r&&r[u]||{};a&&(c={min:0,max:0});const h=s?200:1e6,d=s?40:1e7,f={type:"inertia",velocity:n?t[u]:0,bounceStiffness:h,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(u,f)});return Promise.all(l).then(o)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return fs(this.visualElement,t),n.start(si(t,n,0,e,this.visualElement,!1))}stopAnimation(){var t;(t=this.visualElement.projection)!=null&&t.isPresent&&Te(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Te(t=>{var e;return(e=this.getAxisMotionValue(t).animation)==null?void 0:e.pause()})}getAnimationState(t){var e;return(e=this.getAxisMotionValue(t).animation)==null?void 0:e.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Te(e=>{const{drag:n}=this.getProps();if(!gn(e,n,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(e);if(s&&s.layout){const{min:a,max:o}=s.layout.layoutBox[e];i.set(t[e]-se(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Nt(e)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Te(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const r=o.get();s[a]=wp({min:r,max:r},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.state.element.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Te(a=>{if(!gn(a,t,null))return;const o=this.getAxisMotionValue(a),{min:r,max:l}=this.constraints[a];o.set(se(r,l,s[a]))})}addListeners(){if(!this.state.element)return;Sp.set(this.visualElement,this);const t=this.state.element,e=Ht(t,"pointerdown",r=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(r)}),n=()=>{const{dragConstraints:r}=this.getProps();Nt(r)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ee.read(n);const a=Pn(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:r,hasLayoutChanged:l})=>{this.isDragging&&l&&(Te(u=>{const c=this.getAxisMotionValue(u);c&&(this.originPoint[u]+=r[u].translate,c.set(c.get()+r[u].translate))}),this.visualElement.render())});return()=>{a(),e(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=Ss,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function gn(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Tp(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}var gt,Ls,Ap=(gt=class extends He{constructor(e){super(e),this.removeGroupControls=ke,this.removeListeners=ke,this.controls=new _p(e)}mount(){const{dragControls:e}=this.state.options;e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ke}unmount(){this.removeGroupControls(),this.removeListeners()}},Ls=new WeakMap,Re(gt,Ls,gt.key="drag"),gt),Ot=!1,vt,Es,kp=(vt=class extends He{constructor(e){super(e),this.hasMountSettled=!1,Pr(Zr),e.getSnapshot=this.getSnapshot.bind(this),e.didUpdate=this.didUpdate.bind(this)}updatePrevLead(e){const n=e.getStack();n!=null&&n.prevLead&&!n.prevLead.snapshot&&(n.prevLead.willUpdate(),Ot=!0)}didUpdate(){var e,n;Ot&&(this.state.options.layout||this.state.options.layoutId||this.state.options.drag)&&(Ot=!1,(n=(e=this.state.visualElement.projection)==null?void 0:e.root)==null||n.didUpdate())}mount(){var s;const e=this.state.options,n=this.state.options.layoutGroup;if(e.layout||e.layoutId){const i=this.state.visualElement.projection;if(e.layoutId){const a=!Yr(this.state.element);i.isPresent=a,a?i.promote():i.relegate(),this.updatePrevLead(i)}(s=n==null?void 0:n.group)==null||s.add(i),bn.hasEverUpdated=!0}this.didUpdate(),ee.postRender(()=>{this.hasMountSettled=!0})}unmount(){const e=this.state.options.layoutGroup,n=this.state.visualElement.projection;n&&(e!=null&&e.group&&(this.state.options.layout||this.state.options.layoutId)&&e.group.remove(n),this.state.options.layoutId&&(Ot=!0),this.didUpdate())}getSnapshot(e,n){const s=this.state.visualElement.projection,{drag:i,layoutDependency:a,layout:o,layoutId:r}=e;if(!s||!o&&!r&&!i||!this.hasMountSettled)return;Ot=!0;const l=this.state.options;(i||l.layoutDependency!==a||a===void 0||mi(n)&&s.isPresent!==n)&&s.willUpdate(),mi(n)&&n!==s.isPresent&&(s.isPresent=n,n?(s.promote(),this.updatePrevLead(s)):s.relegate())}},Es=new WeakMap,Re(vt,Es,vt.key="layout"),vt);const Cp={renderer:ip,features:[sp,op,rp,lp,up,dp,pp,Ap,kp]},[Pp,w0]=Jt("LazyMotionContext"),[Mp,S0,_0]=Jt("AnimatePresenceContext");function Dp(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function nl(){return{transform:{},transformOrigin:{},style:{},vars:{}}}function Vp(){return{...nl(),attrs:{}}}function Lp(t){const e=nl();ri(e,t);const n={...e.style};for(const s in e.vars)n[s]=e.vars[s];return Object.keys(n).length===0?null:n}function Ep(t,e,n){const s=Vp();Dr(s,t,Vr(e),void 0,n);const i={};for(const a in s.attrs){const o=li.has(a)?a:Dp(a);i[o]=s.attrs[a]}return{attrs:i,style:{...s.style,...s.vars}}}function Rp(t,e){const n=jf(null),s=zf({}),i=Hf(),a=Mp({}),o=Pp({features:Y({}),strict:!1}),r=rl();function l(){return oc(t,{layoutGroup:s,presenceContext:a,config:i.value})}function u(){return{...r,...l()}}const c=new Xf(u(),n);Nf(c),e&&c.initVisualElement(e),Se(o.features,f=>{var p;(p=f.features)!=null&&p.length&&zr(f.features),f.renderer&&c.initVisualElement(f.renderer),c.updateFeatures()},{immediate:!0,flush:"pre"});function h(){var C;const f=c.type==="svg",p={...r};Object.keys(r).forEach(y=>{ve(r[y])&&(p[y]=r[y].get())});const g=((C=c.visualElement)==null?void 0:C.latestValues)||c.latestValues;let m={...t.style,...f?{}:g};for(const y in m)ve(m[y])&&(m[y]=m[y].get());if(f){const{attrs:y,style:$}=Ep({...g,...m},c.options.as,t.style);Object.assign(p,y),m=$}t.drag&&t.dragListener!==!1&&Object.assign(m,{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`});const v=Lp(m);return v&&(p.style=v),p}const d=ll().proxy;return Rs(()=>{const f=bs(d.$el);c.mount(f)}),Is(()=>c.beforeUnmount()),Zo(()=>{var f;(f=bs(d.$el))!=null&&f.isConnected||c.unmount()}),ul(()=>{c.beforeUpdate(),c.updateOptions(u())}),cl(()=>{c.update()}),{getProps:l,getAttrs:h,layoutGroup:s,state:c}}const Ip={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 $p=new Map,Bp=new Map;function Op(t){if(!Array.isArray(t))return[t];const e=[];for(const n of t)Array.isArray(n)?e.push(...n):e.push(n);return e}var Fp=["area","img","input"];function jp(t,e,n){var s,i;if(typeof t=="string"&&Fp.includes(t))return kt(t,e);if(t==="template"){if(!n.default)return null;const a=Op(n.default()),o=a.findIndex(c=>c.type!==dl);if(o===-1)return a;const r=a[o];(s=r.props)==null||delete s.ref;const l=r.props?Jo(e,r.props):e;e.class&&((i=r.props)!=null&&i.class)&&delete r.props.class;const u=hl(r,l);for(const c in l)c.startsWith("on")&&(u.props||(u.props={}),u.props[c]=l[c]);return a.length===1?u:(a[o]=u,a)}return null}function Ho(t,e={}){const n=typeof t=="string",s=n?t:t.name||"",i=e.renderer?$p:Bp;if(n&&(i!=null&&i.has(t)))return i.get(t);const a=X({inheritAttrs:!1,props:{...Ip,as:{type:[String,Object],default:t||"div"}},name:s?`motion.${s}`:"Motion",setup(o,{slots:r}){const{getProps:l,getAttrs:u,state:c}=Rp(o,e.renderer);function h(){const d=c.element;if((typeof o.as!="object"||o.asChild)&&d){const{style:f}=u();if(f)for(const[p,g]of Object.entries(f))d.style[p]=g}}return()=>{const d=l(),f=u(),p=o.asChild?"template":o.as,g={...o.forwardMotionProps?d:{},...f,onVnodeUpdated:h},m=jp(p,g,r);return m!==null?m:kt(p,{...g},r)}}});return n&&(i==null||i.set(t,a)),a}function Np(t){const e=t==null?void 0:t.renderer;return zr((t==null?void 0:t.features)||[]),new Proxy({},{get(n,s){return s==="create"?(i,a)=>Ho(i,{...a,renderer:e}):Ho(s,{renderer:e})}})}const _s=Np(Cp);_s.create("div");const ui=X({__name:"Shimmer",props:{as:{default:"p"},class:{},duration:{default:2},spread:{default:2}},setup(t){const e=t,n=fl(),s=L(()=>{var u;const l=(u=n.default)==null?void 0:u.call(n);return!l||l.length===0?"":l.map(c=>typeof c.children=="string"?c.children:"").join("")}),i=L(()=>{var l;return(((l=s.value)==null?void 0:l.length)??0)*e.spread}),a=L(()=>pl("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]",e.class)),o=L(()=>({"--spread":`${i.value}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"})),r=L(()=>_s[e.as]||_s.p);return(l,u)=>(b(),K(ea(r.value),{class:re(a.value),style:Qt(o.value),initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:Number.POSITIVE_INFINITY,duration:l.duration,ease:"linear"}},{default:M(()=>[ml(l.$slots,"default")]),_:3},8,["class","style","transition"]))}});function zp(t){const e=L(()=>{const a=[];for(const o of t.value){if(o.role!=="assistant")continue;(o.blocks||[]).forEach((l,u)=>{const c=`${o.id}-attachment-${u}`;if(l.kind==="code")a.push({id:c,messageId:o.id,type:"code",language:l.language,code:l.code});else if(l.kind==="source")a.push({id:c,messageId:o.id,type:"source",url:l.url,title:l.title,filename:l.filename,mediaType:l.mediaType});else if(l.kind==="tool"&&(l.toolName==="export_query_result"||l.toolName==="export_content")){const h=l.result;h!=null&&h.filename&&h.content!==void 0&&a.push({id:c,messageId:o.id,type:"file",filename:h.filename,result:h})}})}return a}),n=L(()=>e.value.filter(a=>a.type==="file")),s=L(()=>e.value.filter(a=>a.type==="code")),i=L(()=>e.value.filter(a=>a.type==="source"));return{attachments:e,files:n,codes:s,sources:i}}function Up(t){const e=window.atob(t),n=new Uint8Array(e.length);for(let s=0;s<e.length;s+=1)n[s]=e.charCodeAt(s);return n}function ci(){return{downloadFile:async e=>{if(e.error)return En.error(e.error),!1;try{const n=e.encoding==="base64"?new Blob([Up(e.content)],{type:e.mimeType}):new Blob([e.content],{type:e.mimeType}),s=URL.createObjectURL(n),i=document.createElement("a");return i.href=s,i.download=e.filename,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s),En.success(`Downloaded ${e.filename}`),!0}catch(n){const s=n instanceof Error?n.message:"Failed to download export file.";return En.error(s),!1}}}}const qp={class:"whitespace-pre-wrap leading-normal chat-text"},Hp=X({__name:"BlockMessageText",props:{content:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean},isUserMessage:{type:Boolean}},setup(t){const e=t,n=L(()=>!!(e.isBlockStreaming&&e.isStreaming)),s=$s(Kt(e,"content"),n);return(i,a)=>(b(),k("p",qp,D(_(s)),1))}});class di{constructor(e){We(this,"options");We(this,"tokensStable",[]);We(this,"tokensUnstable",[]);We(this,"lastUnstableCodeChunk","");We(this,"lastStableGrammarState");this.options=e}async enqueue(e){const n=(this.lastUnstableCodeChunk+e).split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DQiMjOqm.js","./FyrDS92w.js","./entry.XV7TCKso.css"])))=>i.map(i=>d[i]);
2
+ var sl=Object.defineProperty;var il=t=>{throw TypeError(t)};var ol=(t,e,n)=>e in t?sl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var We=(t,e,n)=>ol(t,typeof e!="symbol"?e+"":e,n);var Ie=(t,e,n)=>e.has(t)?il("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{H as Xo,J as Qo,E as L,bV as mi,r as Y,bW as al,aC as Se,aF as rl,aD as Rs,aE as Is,aQ as Zo,bX as ll,bY as ul,d as X,aH as kt,bZ as cl,G as Jo,b_ as dl,aB as hl,j as fl,c as K,o as b,t as ea,aG as Qt,n as re,e as M,f as pl,M as En,b$ as $s,bB as Kt,g as k,x as D,b as _,w as ml,aS as gl,s as we,a8 as Me,bp as vl,h as x,l as S,y as Bs,z as Os,m as _e,a as H,q as me,B as Fs,p as q,F as le,aO as Ve,bv as Zt,K as Rn,as as ta,_ as yl,C as xl,D as bl,O as wl,Q as Sl,V as _l,T as Tl,aK as Al,aI as $e,bg as kl,Y as Cl,c0 as na,aL as Pl,k as Ml,bq as Dl,bj as Vl,aJ as Ll,R as El,bc as gi,c1 as Rl,W as vi,c2 as Il}from"./FyrDS92w.js";import{h as $l,s as Bl,u as Ol,_ as Fl,a as jl,b as Nl}from"./CQpD-JHn.js";import{_ as zl,a as Ul,b as cn}from"./D6YseYA6.js";import{_ as ql}from"./BDRdbLz0.js";import{g as Hl,c as Kl,a as Gl,b as Wl,d as Yl}from"./DQiMjOqm.js";import{u as sa,_ as Xl}from"./DzJD_fir.js";import{_ as Ql}from"./C4JPKbJK.js";import{_ as Zl}from"./DnCs9xpG.js";import{_ as yi,a as xi}from"./q4KcRwD-.js";import{_ as js}from"./ClnidwGv.js";import{D as ia,b as es,F as Ue,G as Jl,H as eu,I as tu,P as pe,J as bi,K as wi,L as oa,M as nu,N as Si,O as _i,Q as In,l as dn,f as aa,R as su,_ as Dt,T as ra,U as Xe,V as iu,W as la,Z as ou,X as hn,Y as $n,$ as Ti,a0 as au,a1 as ru,a2 as lu,a3 as uu,a4 as cu,a5 as du,a6 as hu,a7 as fu,a8 as Ai,a9 as ua,aa as pu,ab as mu,ac as gu,ad as ca,ae as vu,af as yu,ag as xu,ah as bu,ai as wu,aj as Su,ak as _u,al as da,am as Tu,v as ha,an as Au,w as ku,y as Cu,x as Pu,z as Mu,A as Du,B as Vu,E as Lu}from"./DVe5MHjS.js";import{f as fa}from"./BKltSiU0.js";import{u as Eu,l as Ru}from"./HQyqkOpZ.js";import"./Btu7FO8S.js";import"./Bdtn2mn5.js";import"./6I72R6kW.js";import"./CzF1NEwP.js";import"./C26aAkUg.js";var ki=Math.PI*2,fn=Math.PI/180;function pa(t,e){return Jl(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function ma(t,e){var n=pa(t,e),s=t.get("center"),i=t.get("radius");es(i)||(i=[0,i]);var a=Ue(n.width,e.getWidth()),o=Ue(n.height,e.getHeight()),r=Math.min(a,o),l=Ue(i[0],r/2),u=Ue(i[1],r/2),c,h,d=t.coordinateSystem;if(d){var f=d.dataToPoint(s);c=f[0]||0,h=f[1]||0}else es(s)||(s=[s,s]),c=Ue(s[0],a)+n.x,h=Ue(s[1],o)+n.y;return{cx:c,cy:h,r0:l,r:u}}function Iu(t,e,n){e.eachSeriesByType(t,function(s){var i=s.getData(),a=i.mapDimension("value"),o=pa(s,n),r=ma(s,n),l=r.cx,u=r.cy,c=r.r,h=r.r0,d=-s.get("startAngle")*fn,f=s.get("endAngle"),p=s.get("padAngle")*fn;f=f==="auto"?d-ki:-f*fn;var g=s.get("minAngle")*fn,m=g+p,v=0;i.each(a,function(G){!isNaN(G)&&v++});var C=i.getSum(a),y=Math.PI/(C||v)*2,$=s.get("clockwise"),P=s.get("roseType"),V=s.get("stillShowZeroSum"),T=i.getDataExtent(a);T[0]=0;var w=$?1:-1,B=[d,f],E=w*p/2;eu(B,!$),d=B[0],f=B[1];var z=ga(s);z.startAngle=d,z.endAngle=f,z.clockwise=$;var F=Math.abs(f-d),te=F,A=0,I=d;if(i.setLayout({viewRect:o,r:c}),i.each(a,function(G,W){var U;if(isNaN(G)){i.setItemLayout(W,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:$,cx:l,cy:u,r0:h,r:P?NaN:c});return}P!=="area"?U=C===0&&V?y:G*y:U=F/v,U<m?(U=m,te-=m):A+=G;var Q=I+w*U,Z=0,J=0;p>U?(Z=I+w*U/2,J=Z):(Z=I+E,J=Q-E),i.setItemLayout(W,{angle:U,startAngle:Z,endAngle:J,clockwise:$,cx:l,cy:u,r0:h,r:P?tu(G,T,[h,c]):c}),I=Q}),te<ki&&v)if(te<=.001){var N=F/v;i.each(a,function(G,W){if(!isNaN(G)){var U=i.getItemLayout(W);U.angle=N;var Q=0,Z=0;N<p?(Q=d+w*(W+1/2)*N,Z=Q):(Q=d+w*W*N+E,Z=d+w*(W+1)*N-E),U.startAngle=Q,U.endAngle=Z}})}else y=te/A,I=d,i.each(a,function(G,W){if(!isNaN(G)){var U=i.getItemLayout(W),Q=U.angle===m?m:G*y,Z=0,J=0;Q<p?(Z=I+w*Q/2,J=Z):(Z=I+E,J=I+w*Q-E),U.startAngle=Z,U.endAngle=J,I+=w*Q}})})}var ga=ia();function $u(t){return{seriesType:t,reset:function(e,n){var s=n.findComponents({mainType:"legend"});if(!(!s||!s.length)){var i=e.getData();i.filterSelf(function(a){for(var o=i.getName(a),r=0;r<s.length;r++)if(!s[r].isSelected(o))return!1;return!0})}}}}function va(t,e,n,s,i,a,o,r){var l=i-t,u=a-e,c=n-t,h=s-e,d=Math.sqrt(c*c+h*h);c/=d,h/=d;var f=l*c+u*h,p=f/d;p*=d;var g=o[0]=t+p*c,m=o[1]=e+p*h;return Math.sqrt((g-i)*(g-i)+(m-a)*(m-a))}var Qe=new pe,ie=new pe,fe=new pe,Ze=new pe,Be=new pe,wn=[],ye=new pe;function Bu(t,e){if(e<=180&&e>0){e=e/180*Math.PI,Qe.fromArray(t[0]),ie.fromArray(t[1]),fe.fromArray(t[2]),pe.sub(Ze,Qe,ie),pe.sub(Be,fe,ie);var n=Ze.len(),s=Be.len();if(!(n<.001||s<.001)){Ze.scale(1/n),Be.scale(1/s);var i=Ze.dot(Be),a=Math.cos(e);if(a<i){var o=va(ie.x,ie.y,fe.x,fe.y,Qe.x,Qe.y,wn);ye.fromArray(wn),ye.scaleAndAdd(Be,o/Math.tan(Math.PI-e));var r=fe.x!==ie.x?(ye.x-ie.x)/(fe.x-ie.x):(ye.y-ie.y)/(fe.y-ie.y);if(isNaN(r))return;r<0?pe.copy(ye,ie):r>1&&pe.copy(ye,fe),ye.toArray(t[1])}}}}function Ou(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,Qe.fromArray(t[0]),ie.fromArray(t[1]),fe.fromArray(t[2]),pe.sub(Ze,ie,Qe),pe.sub(Be,fe,ie);var s=Ze.len(),i=Be.len();if(!(s<.001||i<.001)){Ze.scale(1/s),Be.scale(1/i);var a=Ze.dot(e),o=Math.cos(n);if(a<o){var r=va(ie.x,ie.y,fe.x,fe.y,Qe.x,Qe.y,wn);ye.fromArray(wn);var l=Math.PI/2,u=Math.acos(Be.dot(e)),c=l+u-n;if(c>=l)pe.copy(ye,fe);else{ye.scaleAndAdd(Be,r/Math.tan(Math.PI/2-c));var h=fe.x!==ie.x?(ye.x-ie.x)/(fe.x-ie.x):(ye.y-ie.y)/(fe.y-ie.y);if(isNaN(h))return;h<0?pe.copy(ye,ie):h>1&&pe.copy(ye,fe)}ye.toArray(t[1])}}}}function Bn(t,e,n,s){var i=n==="normal",a=i?t:t.ensureState(n);a.ignore=e;var o=s.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var r=s.getModel("lineStyle").getLineStyle();i?t.useStyle(r):a.style=r}function Fu(t,e){var n=e.smooth,s=e.points;if(s)if(t.moveTo(s[0][0],s[0][1]),n>0&&s.length>=3){var i=_i(s[0],s[1]),a=_i(s[1],s[2]);if(!i||!a){t.lineTo(s[1][0],s[1][1]),t.lineTo(s[2][0],s[2][1]);return}var o=Math.min(i,a)*n,r=In([],s[1],s[0],o/i),l=In([],s[1],s[2],o/a),u=In([],r,l,.5);t.bezierCurveTo(r[0],r[1],r[0],r[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],s[2][0],s[2][1])}else for(var c=1;c<s.length;c++)t.lineTo(s[c][0],s[c][1])}function ju(t,e,n){var s=t.getTextGuideLine(),i=t.getTextContent();if(!i){s&&t.removeTextGuideLine();return}for(var a=e.normal,o=a.get("show"),r=i.ignore,l=0;l<bi.length;l++){var u=bi[l],c=e[u],h=u==="normal";if(c){var d=c.get("show"),f=h?r:wi(i.states[u]&&i.states[u].ignore,r);if(f||!wi(d,o)){var p=h?s:s&&s.states[u];p&&(p.ignore=!0),s&&Bn(s,!0,u,c);continue}s||(s=new oa,t.setTextGuideLine(s),!h&&(r||!o)&&Bn(s,!0,"normal",e.normal),t.stateProxy&&(s.stateProxy=t.stateProxy)),Bn(s,!1,u,c)}}if(s){nu(s.style,n),s.style.fill=null;var g=a.get("showAbove"),m=t.textGuideLineConfig=t.textGuideLineConfig||{};m.showAbove=g||!1,s.buildPath=Fu}}function Nu(t,e){e=e||"labelLine";for(var n={normal:t.getModel(e)},s=0;s<Si.length;s++){var i=Si[s];n[i]=t.getModel([i,e])}return n}var zu=Math.PI/180;function Ci(t,e,n,s,i,a,o,r,l,u){if(t.length<2)return;function c(g){for(var m=g.rB,v=m*m,C=0;C<g.list.length;C++){var y=g.list[C],$=Math.abs(y.label.y-n),P=s+y.len,V=P*P,T=Math.sqrt(Math.abs((1-$*$/v)*V)),w=e+(T+y.len2)*i,B=w-y.label.x,E=y.targetTextWidth-B*i;ya(y,E,!0),y.label.x=w}}function h(g){for(var m={list:[],maxY:0},v={list:[],maxY:0},C=0;C<g.length;C++)if(g[C].labelAlignTo==="none"){var y=g[C],$=y.label.y>n?v:m,P=Math.abs(y.label.y-n);if(P>=$.maxY){var V=y.label.x-e-y.len2*i,T=s+y.len,w=Math.abs(V)<T?Math.sqrt(P*P/(1-V*V/T/T)):T;$.rB=w,$.maxY=P}$.list.push(y)}c(m),c(v)}for(var d=t.length,f=0;f<d;f++)if(t[f].position==="outer"&&t[f].labelAlignTo==="labelLine"){var p=t[f].label.x-u;t[f].linePoints[1][0]+=p,t[f].label.x=u}su(t,l,l+o)&&h(t)}function Uu(t,e,n,s,i,a,o,r){for(var l=[],u=[],c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<t.length;d++){var f=t[d].label;On(t[d])||(f.x<e?(c=Math.min(c,f.x),l.push(t[d])):(h=Math.max(h,f.x),u.push(t[d])))}for(var d=0;d<t.length;d++){var p=t[d];if(!On(p)&&p.linePoints){if(p.labelStyleWidth!=null)continue;var f=p.label,g=p.linePoints,m=void 0;p.labelAlignTo==="edge"?f.x<e?m=g[2][0]-p.labelDistance-o-p.edgeDistance:m=o+i-p.edgeDistance-g[2][0]-p.labelDistance:p.labelAlignTo==="labelLine"?f.x<e?m=c-o-p.bleedMargin:m=o+i-h-p.bleedMargin:f.x<e?m=f.x-o-p.bleedMargin:m=o+i-f.x-p.bleedMargin,p.targetTextWidth=m,ya(p,m)}}Ci(u,e,n,s,1,i,a,o,r,h),Ci(l,e,n,s,-1,i,a,o,r,c);for(var d=0;d<t.length;d++){var p=t[d];if(!On(p)&&p.linePoints){var f=p.label,g=p.linePoints,v=p.labelAlignTo==="edge",C=f.style.padding,y=C?C[1]+C[3]:0,$=f.style.backgroundColor?0:y,P=p.rect.width+$,V=g[1][0]-g[2][0];v?f.x<e?g[2][0]=o+p.edgeDistance+P+p.labelDistance:g[2][0]=o+i-p.edgeDistance-P-p.labelDistance:(f.x<e?g[2][0]=f.x+p.labelDistance:g[2][0]=f.x-p.labelDistance,g[1][0]=g[2][0]+V),g[1][1]=g[2][1]=f.y}}}function ya(t,e,n){if(n===void 0&&(n=!1),t.labelStyleWidth==null){var s=t.label,i=s.style,a=t.rect,o=i.backgroundColor,r=i.padding,l=r?r[1]+r[3]:0,u=i.overflow,c=a.width+(o?0:l);if(e<c||n){var h=a.height;if(u&&u.match("break")){s.setStyle("backgroundColor",null),s.setStyle("width",e-l);var d=s.getBoundingRect();s.setStyle("width",Math.ceil(d.width)),s.setStyle("backgroundColor",o)}else{var f=e-l,p=e<c?f:n?f>t.unconstrainedWidth?null:f:null;s.setStyle("width",p)}var g=s.getBoundingRect();a.width=g.width;var m=(s.style.margin||0)+2.1;a.height=g.height+m,a.y-=(a.height-h)/2}}}function On(t){return t.position==="center"}function qu(t){var e=t.getData(),n=[],s,i,a=!1,o=(t.get("minShowLabelAngle")||0)*zu,r=e.getLayout("viewRect"),l=e.getLayout("r"),u=r.width,c=r.x,h=r.y,d=r.height;function f(V){V.ignore=!0}function p(V){if(!V.ignore)return!0;for(var T in V.states)if(V.states[T].ignore===!1)return!0;return!1}e.each(function(V){var T=e.getItemGraphicEl(V),w=T.shape,B=T.getTextContent(),E=T.getTextGuideLine(),z=e.getItemModel(V),F=z.getModel("label"),te=F.get("position")||z.get(["emphasis","label","position"]),A=F.get("distanceToLabelLine"),I=F.get("alignTo"),N=Ue(F.get("edgeDistance"),u),G=F.get("bleedMargin"),W=z.getModel("labelLine"),U=W.get("length");U=Ue(U,u);var Q=W.get("length2");if(Q=Ue(Q,u),Math.abs(w.endAngle-w.startAngle)<o){dn(B.states,f),B.ignore=!0,E&&(dn(E.states,f),E.ignore=!0);return}if(p(B)){var Z=(w.startAngle+w.endAngle)/2,J=Math.cos(Z),ge=Math.sin(Z),ue,Ee,Ne,xt;s=w.cx,i=w.cy;var Re=te==="inside"||te==="inner";if(te==="center")ue=w.cx,Ee=w.cy,xt="center";else{var Rt=(Re?(w.r+w.r0)/2*J:w.r*J)+s,Pe=(Re?(w.r+w.r0)/2*ge:w.r*ge)+i;if(ue=Rt+J*3,Ee=Pe+ge*3,!Re){var bt=Rt+J*(U+l-w.r),wt=Pe+ge*(U+l-w.r),sn=bt+(J<0?-1:1)*Q,on=wt;I==="edge"?ue=J<0?c+N:c+u-N:ue=sn+(J<0?-A:A),Ee=on,Ne=[[Rt,Pe],[bt,wt],[sn,on]]}xt=Re?"center":I==="edge"?J>0?"right":"left":J>0?"left":"right"}var tt=Math.PI,Ke=0,nt=F.get("rotate");if(aa(nt))Ke=nt*(tt/180);else if(te==="center")Ke=0;else if(nt==="radial"||nt===!0){var Vn=J<0?-Z+tt:-Z;Ke=Vn}else if(nt==="tangential"&&te!=="outside"&&te!=="outer"){var Ge=Math.atan2(J,ge);Ge<0&&(Ge=tt*2+Ge);var Ln=ge>0;Ln&&(Ge=tt+Ge),Ke=Ge-tt}if(a=!!Ke,B.x=ue,B.y=Ee,B.rotation=Ke,B.setStyle({verticalAlign:"middle"}),Re){B.setStyle({align:xt});var It=B.states.select;It&&(It.x+=B.x,It.y+=B.y)}else{var st=B.getBoundingRect().clone();st.applyTransform(B.getComputedTransform());var an=(B.style.margin||0)+2.1;st.y-=an/2,st.height+=an,n.push({label:B,labelLine:E,position:te,len:U,len2:Q,minTurnAngle:W.get("minTurnAngle"),maxSurfaceAngle:W.get("maxSurfaceAngle"),surfaceNormal:new pe(J,ge),linePoints:Ne,textAlign:xt,labelDistance:A,labelAlignTo:I,edgeDistance:N,bleedMargin:G,rect:st,unconstrainedWidth:st.width,labelStyleWidth:B.style.width})}T.setTextConfig({inside:Re})}}),!a&&t.get("avoidLabelOverlap")&&Uu(n,s,i,l,u,d,c,h);for(var g=0;g<n.length;g++){var m=n[g],v=m.label,C=m.labelLine,y=isNaN(v.x)||isNaN(v.y);if(v){v.setStyle({align:m.textAlign}),y&&(dn(v.states,f),v.ignore=!0);var $=v.states.select;$&&($.x+=v.x,$.y+=v.y)}if(C){var P=m.linePoints;y||!P?(dn(C.states,f),C.ignore=!0):(Bu(P,m.minTurnAngle),Ou(P,m.surfaceNormal,m.maxSurfaceAngle),C.setShape({points:P}),v.__hostTarget.textGuideLineConfig={anchor:new pe(P[0][0],P[0][1])})}}}var Hu=function(t){Dt(e,t);function e(n,s,i){var a=t.call(this)||this;a.z2=2;var o=new ou;return a.setTextContent(o),a.updateData(n,s,i,!0),a}return e.prototype.updateData=function(n,s,i,a){var o=this,r=n.hostModel,l=n.getItemModel(s),u=l.getModel("emphasis"),c=n.getItemLayout(s),h=Xe(hn(l.getModel("itemStyle"),c,!0),c);if(isNaN(h.startAngle)){o.setShape(h);return}if(a){o.setShape(h);var d=r.getShallow("animationType");r.ecModel.ssr?($n(o,{scaleX:0,scaleY:0},r,{dataIndex:s,isFrom:!0}),o.originX=h.cx,o.originY=h.cy):d==="scale"?(o.shape.r=c.r0,$n(o,{shape:{r:c.r}},r,s)):i!=null?(o.setShape({startAngle:i,endAngle:i}),$n(o,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},r,s)):(o.shape.endAngle=c.startAngle,Ti(o,{shape:{endAngle:c.endAngle}},r,s))}else au(o),Ti(o,{shape:h},r,s);o.useStyle(n.getItemVisual(s,"style")),ru(o,l);var f=(c.startAngle+c.endAngle)/2,p=r.get("selectedOffset"),g=Math.cos(f)*p,m=Math.sin(f)*p,v=l.getShallow("cursor");v&&o.attr("cursor",v),this._updateLabel(r,n,s),o.ensureState("emphasis").shape=Xe({r:c.r+(u.get("scale")&&u.get("scaleSize")||0)},hn(u.getModel("itemStyle"),c)),Xe(o.ensureState("select"),{x:g,y:m,shape:hn(l.getModel(["select","itemStyle"]),c)}),Xe(o.ensureState("blur"),{shape:hn(l.getModel(["blur","itemStyle"]),c)});var C=o.getTextGuideLine(),y=o.getTextContent();C&&Xe(C.ensureState("select"),{x:g,y:m}),Xe(y.ensureState("select"),{x:g,y:m}),lu(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(n,s,i){var a=this,o=s.getItemModel(i),r=o.getModel("labelLine"),l=s.getItemVisual(i,"style"),u=l&&l.fill,c=l&&l.opacity;uu(a,cu(o),{labelFetcher:s.hostModel,labelDataIndex:i,inheritColor:u,defaultOpacity:c,defaultText:n.getFormattedLabel(i,"normal")||s.getName(i)});var h=a.getTextContent();a.setTextConfig({position:null,rotation:null}),h.attr({z2:10});var d=n.get(["label","position"]);if(d!=="outside"&&d!=="outer")a.removeTextGuideLine();else{var f=this.getTextGuideLine();f||(f=new oa,this.setTextGuideLine(f)),ju(this,Nu(o),{stroke:u,opacity:du(r.get(["lineStyle","opacity"]),c,1)})}},e}(ra),Ku=function(t){Dt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.ignoreLabelLineUpdate=!0,n}return e.prototype.render=function(n,s,i,a){var o=n.getData(),r=this._data,l=this.group,u;if(!r&&o.count()>0){for(var c=o.getItemLayout(0),h=1;isNaN(c&&c.startAngle)&&h<o.count();++h)c=o.getItemLayout(h);c&&(u=c.startAngle)}if(this._emptyCircleSector&&l.remove(this._emptyCircleSector),o.count()===0&&n.get("showEmptyCircle")){var d=ga(n),f=new ra({shape:Xe(ma(n,i),d)});f.useStyle(n.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=f,l.add(f)}o.diff(r).add(function(p){var g=new Hu(o,p,u);o.setItemGraphicEl(p,g),l.add(g)}).update(function(p,g){var m=r.getItemGraphicEl(g);m.updateData(o,p,u),m.off("click"),l.add(m),o.setItemGraphicEl(p,m)}).remove(function(p){var g=r.getItemGraphicEl(p);iu(g,n,p)}).execute(),qu(n),n.get("animationTypeUpdate")!=="expansion"&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(n,s){var i=s.getData(),a=i.getItemLayout(0);if(a){var o=n[0]-a.cx,r=n[1]-a.cy,l=Math.sqrt(o*o+r*r);return l<=a.r&&l>=a.r0}},e.type="pie",e}(la);function Gu(t,e,n){e=es(e)&&{coordDimensions:e}||Xe({encodeDefine:t.getEncode()},e);var s=t.getSource(),i=hu(s,e).dimensions,a=new fu(i,t);return a.initData(s,n),a}var Wu=function(){function t(e,n){this._getDataWithEncodedVisual=e,this._getRawData=n}return t.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},t.prototype.containName=function(e){var n=this._getRawData();return n.indexOfName(e)>=0},t.prototype.indexOfName=function(e){var n=this._getDataWithEncodedVisual();return n.indexOfName(e)},t.prototype.getItemVisual=function(e,n){var s=this._getDataWithEncodedVisual();return s.getItemVisual(e,n)},t}(),Yu=ia(),Xu=function(t){Dt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(n){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new Wu(Ai(this.getData,this),Ai(this.getRawData,this)),this._defaultLabelLine(n)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return Gu(this,{coordDimensions:["value"],encodeDefaulter:ua(pu,this)})},e.prototype.getDataParams=function(n){var s=this.getData(),i=Yu(s),a=i.seats;if(!a){var o=[];s.each(s.mapDimension("value"),function(l){o.push(l)}),a=i.seats=mu(o,s.hostModel.get("percentPrecision"))}var r=t.prototype.getDataParams.call(this,n);return r.percent=a[n]||0,r.$vars.push("percent"),r},e.prototype._defaultLabelLine=function(n){gu(n,"labelLine",["show"]);var s=n.labelLine,i=n.emphasis.labelLine;s.show=s.show&&n.label.show,i.show=i.show&&n.emphasis.label.show},e.type="series.pie",e.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"},e}(ca);function Qu(t){return{seriesType:t,reset:function(e,n){var s=e.getData();s.filterSelf(function(i){var a=s.mapDimension("value"),o=s.get(a,i);return!(aa(o)&&!isNaN(o)&&o<0)})}}}function Zu(t){t.registerChartView(Ku),t.registerSeriesModel(Xu),vu("pie",t.registerAction),t.registerLayout(ua(Iu,"pie")),t.registerProcessor($u("pie")),t.registerProcessor(Qu("pie"))}var Ju=function(t){Dt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return e.prototype.getInitialData=function(n,s){return yu(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var n=this.option.progressive;return n??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var n=this.option.progressiveThreshold;return n??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(n,s,i){return i.point(s.getItemLayout(n))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.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"}},e}(ca),xa=4,ec=function(){function t(){}return t}(),tc=function(t){Dt(e,t);function e(n){var s=t.call(this,n)||this;return s._off=0,s.hoverDataIdx=-1,s}return e.prototype.getDefaultShape=function(){return new ec},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(n,s){var i=s.points,a=s.size,o=this.symbolProxy,r=o.shape,l=n.getContext?n.getContext():n,u=l&&a[0]<xa,c=this.softClipShape,h;if(u){this._ctx=l;return}for(this._ctx=null,h=this._off;h<i.length;){var d=i[h++],f=i[h++];isNaN(d)||isNaN(f)||c&&!c.contain(d,f)||(r.x=d-a[0]/2,r.y=f-a[1]/2,r.width=a[0],r.height=a[1],o.buildPath(n,r,!0))}this.incremental&&(this._off=h,this.notClear=!0)},e.prototype.afterBrush=function(){var n=this.shape,s=n.points,i=n.size,a=this._ctx,o=this.softClipShape,r;if(a){for(r=this._off;r<s.length;){var l=s[r++],u=s[r++];isNaN(l)||isNaN(u)||o&&!o.contain(l,u)||a.fillRect(l-i[0]/2,u-i[1]/2,i[0],i[1])}this.incremental&&(this._off=r,this.notClear=!0)}},e.prototype.findDataIndex=function(n,s){for(var i=this.shape,a=i.points,o=i.size,r=Math.max(o[0],4),l=Math.max(o[1],4),u=a.length/2-1;u>=0;u--){var c=u*2,h=a[c]-r/2,d=a[c+1]-l/2;if(n>=h&&s>=d&&n<=h+r&&s<=d+l)return u}return-1},e.prototype.contain=function(n,s){var i=this.transformCoordToLocal(n,s),a=this.getBoundingRect();if(n=i[0],s=i[1],a.contain(n,s)){var o=this.hoverDataIdx=this.findDataIndex(n,s);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var n=this._rect;if(!n){for(var s=this.shape,i=s.points,a=s.size,o=a[0],r=a[1],l=1/0,u=1/0,c=-1/0,h=-1/0,d=0;d<i.length;){var f=i[d++],p=i[d++];l=Math.min(f,l),c=Math.max(f,c),u=Math.min(p,u),h=Math.max(p,h)}n=this._rect=new bu(l-o/2,u-r/2,c-l+o,h-u+r)}return n},e}(wu),nc=function(){function t(){this.group=new xu}return t.prototype.updateData=function(e,n){this._clear();var s=this._create();s.setShape({points:e.getLayout("points")}),this._setCommon(s,e,n)},t.prototype.updateLayout=function(e){var n=e.getLayout("points");this.group.eachChild(function(s){if(s.startIndex!=null){var i=(s.endIndex-s.startIndex)*2,a=s.startIndex*4*2;n=new Float32Array(n.buffer,a,i)}s.setShape("points",n),s.reset()})},t.prototype.incrementalPrepareUpdate=function(e){this._clear()},t.prototype.incrementalUpdate=function(e,n,s){var i=this._newAdded[0],a=n.getLayout("points"),o=i&&i.shape.points;if(o&&o.length<2e4){var r=o.length,l=new Float32Array(r+a.length);l.set(o),l.set(a,r),i.endIndex=e.end,i.setShape({points:l})}else{this._newAdded=[];var u=this._create();u.startIndex=e.start,u.endIndex=e.end,u.incremental=!0,u.setShape({points:a}),this._setCommon(u,n,s)}},t.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},t.prototype._create=function(){var e=new tc({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},t.prototype._setCommon=function(e,n,s){var i=n.hostModel;s=s||{};var a=n.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=s.clipShape||null,e.symbolProxy=Su(n.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<xa;e.useStyle(i.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var r=n.getVisual("style"),l=r&&r.fill;l&&e.setColor(l);var u=_u(e);u.seriesIndex=i.seriesIndex,e.on("mousemove",function(c){u.dataIndex=null;var h=e.hoverDataIdx;h>=0&&(u.dataIndex=h+(e.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),sc=function(t){Dt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.type=e.type,n}return e.prototype.render=function(n,s,i){var a=n.getData(),o=this._updateSymbolDraw(a,n);o.updateData(a,{clipShape:this._getClipShape(n)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(n,s,i){var a=n.getData(),o=this._updateSymbolDraw(a,n);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(n,s,i){this._symbolDraw.incrementalUpdate(n,s.getData(),{clipShape:this._getClipShape(s)}),this._finished=n.end===s.getData().count()},e.prototype.updateTransform=function(n,s,i){var a=n.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=da("").reset(n,s,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(n){this._symbolDraw&&this._symbolDraw.eachRendered(n)},e.prototype._getClipShape=function(n){if(n.get("clip",!0)){var s=n.coordinateSystem;return s&&s.getArea&&s.getArea(.1)}},e.prototype._updateSymbolDraw=function(n,s){var i=this._symbolDraw,a=s.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new nc:new Tu,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(n,s){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(la);function ic(t){ha(Au),t.registerSeriesModel(Ju),t.registerChartView(sc),t.registerLayout(da("scatter"))}function Jt(t,e){const n=typeof t=="string"?`${t}Context`:e,s=Symbol(n);return[o=>{const r=Xo(s,o);if(r===void 0)throw new Error(`Injection \`${s.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`);return r},o=>(Qo(s,o),o),s]}function oc(t,e){const{layoutGroup:n,presenceContext:s,config:i}=e,a=n.id&&t.layoutId?`${n.id}-${t.layoutId}`:t.layoutId||void 0;return{...t,layoutId:a,transition:t.transition??i.transition,layoutGroup:n,motionConfig:i,inViewOptions:t.inViewOptions??i.inViewOptions,presenceContext:s,initial:s.initial===!1?s.initial:t.initial===!0?void 0:t.initial}}function Ns(t,e){t.indexOf(e)===-1&&t.push(e)}function Sn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const je=(t,e,n)=>n>e?e:n<t?t:n;let zs=()=>{};const qe={},ba=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function wa(t){return typeof t=="object"&&t!==null}const Sa=t=>/^0[^.\s]+$/u.test(t);function _a(t){let e;return()=>(e===void 0&&(e=t()),e)}const ke=t=>t,ac=(t,e)=>n=>e(t(n)),en=(...t)=>t.reduce(ac),Gt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class Us{constructor(){this.subscriptions=[]}add(e){return Ns(this.subscriptions,e),()=>Sn(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ce=t=>t*1e3,Ae=t=>t/1e3;function Ta(t,e){return e?t*(1e3/e):0}const Aa=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,rc=1e-7,lc=12;function uc(t,e,n,s,i){let a,o,r=0;do o=e+(n-e)/2,a=Aa(o,s,i)-t,a>0?n=o:e=o;while(Math.abs(a)>rc&&++r<lc);return o}function tn(t,e,n,s){if(t===e&&n===s)return ke;const i=a=>uc(a,0,1,t,n);return a=>a===0||a===1?a:Aa(i(a),e,s)}const ka=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ca=t=>e=>1-t(1-e),Pa=tn(.33,1.53,.69,.99),qs=Ca(Pa),Ma=ka(qs),Da=t=>(t*=2)<1?.5*qs(t):.5*(2-Math.pow(2,-10*(t-1))),Hs=t=>1-Math.sin(Math.acos(t)),Va=Ca(Hs),La=ka(Hs),cc=tn(.42,0,1,1),dc=tn(0,0,.58,1),Ea=tn(.42,0,.58,1),hc=t=>Array.isArray(t)&&typeof t[0]!="number",Ra=t=>Array.isArray(t)&&typeof t[0]=="number",fc={linear:ke,easeIn:cc,easeInOut:Ea,easeOut:dc,circIn:Hs,circInOut:La,circOut:Va,backIn:qs,backInOut:Ma,backOut:Pa,anticipate:Da},pc=t=>typeof t=="string",Pi=t=>{if(Ra(t)){zs(t.length===4);const[e,n,s,i]=t;return tn(e,n,s,i)}else if(pc(t))return fc[t];return t},pn=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function mc(t,e){let n=new Set,s=new Set,i=!1,a=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(u.schedule(c),t()),c(r)}const u={schedule:(c,h=!1,d=!1)=>{const p=d&&i?n:s;return h&&o.add(c),p.has(c)||p.add(c),c},cancel:c=>{s.delete(c),o.delete(c)},process:c=>{if(r=c,i){a=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,a&&(a=!1,u.process(c))}};return u}const gc=40;function Ia(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=pn.reduce((y,$)=>(y[$]=mc(a),y),{}),{setup:r,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:d,render:f,postRender:p}=o,g=()=>{const y=qe.useManualTiming?i.timestamp:performance.now();n=!1,qe.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,gc),1)),i.timestamp=y,i.isProcessing=!0,r.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),f.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))},m=()=>{n=!0,s=!0,i.isProcessing||t(g)};return{schedule:pn.reduce((y,$)=>{const P=o[$];return y[$]=(V,T=!1,w=!1)=>(n||m(),P.schedule(V,T,w)),y},{}),cancel:y=>{for(let $=0;$<pn.length;$++)o[pn[$]].cancel(y)},state:i,steps:o}}const{schedule:ee,cancel:et,state:he,steps:Fn}=Ia(typeof requestAnimationFrame<"u"?requestAnimationFrame:ke,!0);let yn;function vc(){yn=void 0}const xe={now:()=>(yn===void 0&&xe.set(he.isProcessing||qe.useManualTiming?he.timestamp:performance.now()),yn),set:t=>{yn=t,queueMicrotask(vc)}},$a=t=>e=>typeof e=="string"&&e.startsWith(t),Ks=$a("--"),yc=$a("var(--"),Gs=t=>yc(t)?xc.test(t.split("/*")[0].trim()):!1,xc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mi(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Vt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Wt={...Vt,transform:t=>je(0,1,t)},mn={...Vt,default:1},zt=t=>Math.round(t*1e5)/1e5,Ws=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bc(t){return t==null}const wc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ys=(t,e)=>n=>!!(typeof n=="string"&&wc.test(n)&&n.startsWith(t)||e&&!bc(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ba=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,a,o,r]=s.match(Ws);return{[t]:parseFloat(i),[e]:parseFloat(a),[n]:parseFloat(o),alpha:r!==void 0?parseFloat(r):1}},Sc=t=>je(0,255,t),jn={...Vt,transform:t=>Math.round(Sc(t))},rt={test:Ys("rgb","red"),parse:Ba("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+jn.transform(t)+", "+jn.transform(e)+", "+jn.transform(n)+", "+zt(Wt.transform(s))+")"};function _c(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const ts={test:Ys("#"),parse:_c,transform:rt.transform},nn=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ye=nn("deg"),Fe=nn("%"),j=nn("px"),Tc=nn("vh"),Ac=nn("vw"),Di={...Fe,parse:t=>Fe.parse(t)/100,transform:t=>Fe.transform(t*100)},St={test:Ys("hsl","hue"),parse:Ba("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Fe.transform(zt(e))+", "+Fe.transform(zt(n))+", "+zt(Wt.transform(s))+")"},ae={test:t=>rt.test(t)||ts.test(t)||St.test(t),parse:t=>rt.test(t)?rt.parse(t):St.test(t)?St.parse(t):ts.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?rt.transform(t):St.transform(t),getAnimatableNone:t=>{const e=ae.parse(t);return e.alpha=0,ae.transform(e)}},kc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Cc(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ws))==null?void 0:e.length)||0)+(((n=t.match(kc))==null?void 0:n.length)||0)>0}const Oa="number",Fa="color",Pc="var",Mc="var(",Vi="${}",Dc=/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 Pt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(Dc,l=>(ae.test(l)?(s.color.push(a),i.push(Fa),n.push(ae.parse(l))):l.startsWith(Mc)?(s.var.push(a),i.push(Pc),n.push(l)):(s.number.push(a),i.push(Oa),n.push(parseFloat(l))),++a,Vi)).split(Vi);return{values:n,split:r,indexes:s,types:i}}function Vc(t){return Pt(t).values}function ja({split:t,types:e}){const n=t.length;return s=>{let i="";for(let a=0;a<n;a++)if(i+=t[a],s[a]!==void 0){const o=e[a];o===Oa?i+=zt(s[a]):o===Fa?i+=ae.transform(s[a]):i+=s[a]}return i}}function Lc(t){return ja(Pt(t))}const Ec=t=>typeof t=="number"?0:ae.test(t)?ae.getAnimatableNone(t):t,Rc=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Ec(t);function Ic(t){const e=Pt(t);return ja(e)(e.values.map((s,i)=>Rc(s,e.split[i])))}const Le={test:Cc,parse:Vc,createTransformer:Lc,getAnimatableNone:Ic};function Nn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function $c({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,a=0,o=0;if(!e)i=a=o=n;else{const r=n<.5?n*(1+e):n+e-n*e,l=2*n-r;i=Nn(l,r,t+1/3),a=Nn(l,r,t),o=Nn(l,r,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:s}}function _n(t,e){return n=>n>0?e:t}const se=(t,e,n)=>t+(e-t)*n,zn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Bc=[ts,rt,St],Oc=t=>Bc.find(e=>e.test(t));function Li(t){const e=Oc(t);if(!e)return!1;let n=e.parse(t);return e===St&&(n=$c(n)),n}const Ei=(t,e)=>{const n=Li(t),s=Li(e);if(!n||!s)return _n(t,e);const i={...n};return a=>(i.red=zn(n.red,s.red,a),i.green=zn(n.green,s.green,a),i.blue=zn(n.blue,s.blue,a),i.alpha=se(n.alpha,s.alpha,a),rt.transform(i))},ns=new Set(["none","hidden"]);function Fc(t,e){return ns.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function jc(t,e){return n=>se(t,e,n)}function Xs(t){return typeof t=="number"?jc:typeof t=="string"?Gs(t)?_n:ae.test(t)?Ei:Uc:Array.isArray(t)?Na:typeof t=="object"?ae.test(t)?Ei:Nc:_n}function Na(t,e){const n=[...t],s=n.length,i=t.map((a,o)=>Xs(a)(a,e[o]));return a=>{for(let o=0;o<s;o++)n[o]=i[o](a);return n}}function Nc(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Xs(t[i])(t[i],e[i]));return i=>{for(const a in s)n[a]=s[a](i);return n}}function zc(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const a=e.types[i],o=t.indexes[a][s[a]],r=t.values[o]??0;n[i]=r,s[a]++}return n}const Uc=(t,e)=>{const n=Le.createTransformer(e),s=Pt(t),i=Pt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ns.has(t)&&!i.values.length||ns.has(e)&&!s.values.length?Fc(t,e):en(Na(zc(s,i),i.values),n):_n(t,e)};function za(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?se(t,e,n):Xs(t)(t,e)}const qc=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>ee.update(e,n),stop:()=>et(e),now:()=>he.isProcessing?he.timestamp:xe.now()}},Ua=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let a=0;a<i;a++)s+=Math.round(t(a/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Tn=2e4;function Qs(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Tn;)e+=n,s=t.next(e);return e>=Tn?1/0:e}function Hc(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Qs(s),Tn);return{type:"keyframes",ease:a=>s.next(i*a).value/e,duration:Ae(i)}}const oe={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 ss(t,e){return t*Math.sqrt(1-e*e)}const Kc=12;function Gc(t,e,n){let s=n;for(let i=1;i<Kc;i++)s=s-t(s)/e(s);return s}const Ri=.001;function Wc({duration:t=oe.duration,bounce:e=oe.bounce,velocity:n=oe.velocity,mass:s=oe.mass}){let i,a,o=1-e;o=je(oe.minDamping,oe.maxDamping,o),t=je(oe.minDuration,oe.maxDuration,Ae(t)),o<1?(i=u=>{const c=u*o,h=c*t,d=c-n,f=ss(u,o),p=Math.exp(-h);return Ri-d/f*p},a=u=>{const h=u*o*t,d=h*n+n,f=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),g=ss(Math.pow(u,2),o);return(-i(u)+Ri>0?-1:1)*((d-f)*p)/g}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-.001+c*h},a=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const r=5/t,l=Gc(i,a,r);if(t=Ce(t),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const Yc=["duration","bounce"],Xc=["stiffness","damping","mass"];function Ii(t,e){return e.some(n=>t[n]!==void 0)}function Qc(t){let e={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...t};if(!Ii(t,Xc)&&Ii(t,Yc))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,a=2*je(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:oe.mass,stiffness:i,damping:a}}else{const n=Wc({...t,velocity:0});e={...e,...n,mass:oe.mass},e.isResolvedFromDuration=!0}return e}function An(t=oe.visualDuration,e=oe.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],r={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=Qc({...n,velocity:-Ae(n.velocity||0)}),p=d||0,g=u/(2*Math.sqrt(l*c)),m=o-a,v=Ae(Math.sqrt(l/c)),C=Math.abs(m)<5;s||(s=C?oe.restSpeed.granular:oe.restSpeed.default),i||(i=C?oe.restDelta.granular:oe.restDelta.default);let y,$,P,V,T,w;if(g<1)P=ss(v,g),V=(p+g*v*m)/P,y=E=>{const z=Math.exp(-g*v*E);return o-z*(V*Math.sin(P*E)+m*Math.cos(P*E))},T=g*v*V+m*P,w=g*v*m-V*P,$=E=>Math.exp(-g*v*E)*(T*Math.sin(P*E)+w*Math.cos(P*E));else if(g===1){y=z=>o-Math.exp(-v*z)*(m+(p+v*m)*z);const E=p+v*m;$=z=>Math.exp(-v*z)*(v*E*z-p)}else{const E=v*Math.sqrt(g*g-1);y=A=>{const I=Math.exp(-g*v*A),N=Math.min(E*A,300);return o-I*((p+g*v*m)*Math.sinh(N)+E*m*Math.cosh(N))/E};const z=(p+g*v*m)/E,F=g*v*z-m*E,te=g*v*m-z*E;$=A=>{const I=Math.exp(-g*v*A),N=Math.min(E*A,300);return I*(F*Math.sinh(N)+te*Math.cosh(N))}}const B={calculatedDuration:f&&h||null,velocity:E=>Ce($(E)),next:E=>{if(!f&&g<1){const F=Math.exp(-g*v*E),te=Math.sin(P*E),A=Math.cos(P*E),I=o-F*(V*te+m*A),N=Ce(F*(T*te+w*A));return r.done=Math.abs(N)<=s&&Math.abs(o-I)<=i,r.value=r.done?o:I,r}const z=y(E);if(f)r.done=E>=h;else{const F=Ce($(E));r.done=Math.abs(F)<=s&&Math.abs(o-z)<=i}return r.value=r.done?o:z,r},toString:()=>{const E=Math.min(Qs(B),Tn),z=Ua(F=>B.next(E*F).value,E,30);return E+"ms "+z},toTransition:()=>{}};return B}An.applyToOptions=t=>{const e=Hc(t,100,An);return t.ease=e.ease,t.duration=Ce(e.duration),t.type="keyframes",t};const Zc=5;function qa(t,e,n){const s=Math.max(e-Zc,0);return Ta(n-t(s),e-s)}function is({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:r,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},f=w=>r!==void 0&&w<r||l!==void 0&&w>l,p=w=>r===void 0?l:l===void 0||Math.abs(r-w)<Math.abs(l-w)?r:l;let g=n*e;const m=h+g,v=o===void 0?m:o(m);v!==m&&(g=v-h);const C=w=>-g*Math.exp(-w/s),y=w=>v+C(w),$=w=>{const B=C(w),E=y(w);d.done=Math.abs(B)<=u,d.value=d.done?v:E};let P,V;const T=w=>{f(d.value)&&(P=w,V=An({keyframes:[d.value,p(d.value)],velocity:qa(y,w,d.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:w=>{let B=!1;return!V&&P===void 0&&(B=!0,$(w),T(w)),P!==void 0&&w>=P?V.next(w-P):(!B&&$(w),d)}}}function Jc(t,e,n){const s=[],i=n||qe.mix||za,a=t.length-1;for(let o=0;o<a;o++){let r=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||ke:e;r=en(l,r)}s.push(r)}return s}function ed(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const a=t.length;if(zs(a===e.length),a===1)return()=>e[0];if(a===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Jc(e,s,i),l=r.length,u=c=>{if(o&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const d=Gt(t[h],t[h+1],c);return r[h](d)};return n?c=>u(je(t[0],t[a-1],c)):u}function td(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Gt(0,e,s);t.push(se(n,1,i))}}function nd(t){const e=[0];return td(e,t.length-1),e}function sd(t,e){return t.map(n=>n*e)}function id(t,e){return t.map(()=>e||Ea).splice(0,t.length-1)}function Ut({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=hc(s)?s.map(Pi):Pi(s),a={done:!1,value:e[0]},o=sd(n&&n.length===e.length?n:nd(e),t),r=ed(o,e,{ease:Array.isArray(i)?i:id(e,i)});return{calculatedDuration:t,next:l=>(a.value=r(l),a.done=l>=t,a)}}const od=t=>t!==null;function Zs(t,{repeat:e,repeatType:n="loop"},s,i=1){const a=t.filter(od),r=i<0||e&&n!=="loop"&&e%2===1?0:a.length-1;return!r||s===void 0?a[r]:s}const ad={decay:is,inertia:is,tween:Ut,keyframes:Ut,spring:An};function Ha(t){typeof t.type=="string"&&(t.type=ad[t.type])}class Js{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const rd=t=>t/100;class ei extends Js{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==xe.now()&&this.tick(xe.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ha(e);const{type:n=Ut,repeat:s=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=e;let{keyframes:r}=e;const l=n||Ut;l!==Ut&&typeof r[0]!="number"&&(this.mixKeyframes=en(rd,za(r[0],r[1])),r=[0,100]);const u=l({...e,keyframes:r});a==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...r].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Qs(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:f,type:p,onUpdate:g,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let y=this.currentTime,$=s;if(h){const w=Math.min(this.currentTime,i)/r;let B=Math.floor(w),E=w%1;!E&&w>=1&&(E=1),E===1&&B--,B=Math.min(B,h+1),!!(B%2)&&(d==="reverse"?(E=1-E,f&&(E-=f/r)):d==="mirror"&&($=o)),y=je(0,1,E)*r}const P=C?{done:!1,value:c[0]}:$.next(y);a&&!C&&(P.value=a(P.value));let{done:V}=P;!C&&l!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return T&&p!==is&&(P.value=Zs(c,this.options,m,this.speed)),g&&g(P.value),T&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return Ae(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ae(e)}get time(){return Ae(this.currentTime)}set time(e){e=Ce(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return qa(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(xe.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Ae(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:e=qc,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(a=(i=this.options).onPlay)==null||a.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(xe.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function ld(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const lt=t=>t*180/Math.PI,os=t=>{const e=lt(Math.atan2(t[1],t[0]));return as(e)},ud={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:os,rotateZ:os,skewX:t=>lt(Math.atan(t[1])),skewY:t=>lt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},as=t=>(t=t%360,t<0&&(t+=360),t),$i=os,Bi=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Oi=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),cd={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Bi,scaleY:Oi,scale:t=>(Bi(t)+Oi(t))/2,rotateX:t=>as(lt(Math.atan2(t[6],t[5]))),rotateY:t=>as(lt(Math.atan2(-t[2],t[0]))),rotateZ:$i,rotate:$i,skewX:t=>lt(Math.atan(t[4])),skewY:t=>lt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function rs(t){return t.includes("scale")?1:0}function ls(t,e){if(!t||t==="none")return rs(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=cd,i=n;else{const r=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=ud,i=r}if(!i)return rs(e);const a=s[e],o=i[1].split(",").map(hd);return typeof a=="function"?a(o):o[a]}const dd=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ls(n,e)};function hd(t){return parseFloat(t.trim())}const Lt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Et=new Set(Lt),Fi=t=>t===Vt||t===j,fd=new Set(["x","y","z"]),pd=Lt.filter(t=>!fd.has(t));function md(t){const e=[];return pd.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Je={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ls(e,"x"),y:(t,{transform:e})=>ls(e,"y")};Je.translateX=Je.x;Je.translateY=Je.y;const yt=new Set;let us=!1,cs=!1,ds=!1;function Ka(){if(cs){const t=Array.from(yt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=md(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([a,o])=>{var r;(r=s.getValue(a))==null||r.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}cs=!1,us=!1,yt.forEach(t=>t.complete(ds)),yt.clear()}function Ga(){yt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(cs=!0)})}function gd(){ds=!0,Ga(),Ka(),ds=!1}class ti{constructor(e,n,s,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(yt.add(this),us||(us=!0,ee.read(Ga),ee.resolveKeyframes(Ka))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const a=i==null?void 0:i.get(),o=e[e.length-1];if(a!==void 0)e[0]=a;else if(s&&n){const r=s.readValue(n,o);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=o),i&&a===void 0&&i.set(e[0])}ld(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yt.delete(this)}cancel(){this.state==="scheduled"&&(yt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const vd=t=>t.startsWith("--");function Wa(t,e,n){vd(e)?t.style.setProperty(e,n):t.style[e]=n}const yd={};function Ya(t,e){const n=_a(t);return()=>yd[e]??n()}const xd=Ya(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Xa=Ya(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),jt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,ji={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jt([0,.65,.55,1]),circOut:jt([.55,0,1,.45]),backIn:jt([.31,.01,.66,-.59]),backOut:jt([.33,1.53,.69,.99])};function Qa(t,e){if(t)return typeof t=="function"?Xa()?Ua(t,e):"ease-out":Ra(t)?jt(t):Array.isArray(t)?t.map(n=>Qa(n,e)||ji.easeOut):ji[t]}function bd(t,e,n,{delay:s=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=Qa(r,i);Array.isArray(h)&&(c.easing=h);const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(c,d)}function Za(t){return typeof t=="function"&&"applyToOptions"in t}function wd({type:t,...e}){return Za(t)&&Xa()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ja extends Js{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:r,onComplete:l}=e;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=e,zs(typeof e.type!="string");const u=wd(e);this.animation=bd(n,s,i,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const c=Zs(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(c),Wa(n,s,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,s,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return Ae(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Ae(e)}get time(){return Ae(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ce(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){var a;return this.allowFlatten&&((a=this.animation.effect)==null||a.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&xd()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),ke):i(this)}}const er={anticipate:Da,backInOut:Ma,circInOut:La};function Sd(t){return t in er}function _d(t){typeof t.ease=="string"&&Sd(t.ease)&&(t.ease=er[t.ease])}const Un=10;class Td extends Ja{constructor(e){_d(e),Ha(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:a,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const r=new ei({...o,autoplay:!1}),l=Math.max(Un,xe.now()-this.startTime),u=je(0,Un,l-Un),c=r.sample(l).value,{name:h}=this.options;a&&h&&Wa(a,h,c),n.setWithVelocity(r.sample(Math.max(0,l-u)).value,c,u),r.stop()}}const Ni=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Le.test(t)||t==="0")&&!t.startsWith("url("));function Ad(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function kd(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const a=t[t.length-1],o=Ni(i,e),r=Ni(a,e);return!o||!r?!1:Ad(t)||(n==="spring"||Za(n))&&s}function hs(t){t.duration=0,t.type="keyframes"}const Cd=new Set(["opacity","clipPath","filter","transform"]),Pd=_a(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Md(t){var c;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:a,type:o}=t;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return Pd()&&n&&Cd.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&a!==0&&o!=="inertia"}const Dd=40;class Vd extends Js{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:r,name:l,motionValue:u,element:c,...h}){var p;super(),this.stop=()=>{var g,m;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(m=this.keyframeResolver)==null||m.cancel()},this.createdAt=xe.now();const d={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:u,element:c,...h},f=(c==null?void 0:c.KeyframeResolver)||ti;this.keyframeResolver=new f(r,(g,m,v)=>this.onKeyframesResolved(g,m,d,!v),l,u,c),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,n,s,i){var m,v;this.keyframeResolver=void 0;const{name:a,type:o,velocity:r,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=xe.now(),kd(e,a,o,r)||((qe.instantAnimations||!l)&&(c==null||c(Zs(e,s,n))),e[0]=e[e.length-1],hs(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Dd?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},f=!u&&Md(d),p=(v=(m=d.motionValue)==null?void 0:m.owner)==null?void 0:v.current,g=f?new Td({...d,element:p}):new ei(d);g.finished.then(()=>{this.notifyFinished()}).catch(ke),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),gd()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function tr(t,e,n,s=0,i=1){const a=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,r=(o-1)*s;return typeof n=="function"?n(a,o):i===1?a*s:r-a*s}const Ld=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ed(t){const e=Ld.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function nr(t,e,n=1){const[s,i]=Ed(t);if(!s)return;const a=window.getComputedStyle(e).getPropertyValue(s);if(a){const o=a.trim();return ba(o)?parseFloat(o):o}return Gs(i)?nr(i,e,n+1):i}const Rd={type:"spring",stiffness:500,damping:25,restSpeed:10},Id=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),$d={type:"keyframes",duration:.8},Bd={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Od=(t,{keyframes:e})=>e.length>2?$d:Et.has(t)?t.startsWith("scale")?Id(e[1]):Rd:Bd,Fd=t=>t!==null;function jd(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Fd),a=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[a]}function sr(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function ni(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?sr(n,t):n}function Nd({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:r,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const si=(t,e,n,s={},i,a)=>o=>{const r=ni(s,t)||{},l=r.delay||s.delay||0;let{elapsed:u=0}=s;u=u-Ce(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...r,delay:-u,onUpdate:d=>{e.set(d),r.onUpdate&&r.onUpdate(d)},onComplete:()=>{o(),r.onComplete&&r.onComplete()},name:t,motionValue:e,element:a?void 0:i};Nd(r)||Object.assign(c,Od(t,c)),c.duration&&(c.duration=Ce(c.duration)),c.repeatDelay&&(c.repeatDelay=Ce(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(hs(c),c.delay===0&&(h=!0)),(qe.instantAnimations||qe.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,hs(c),c.delay=0),c.allowFlatten=!r.type&&!r.ease,h&&!a&&e.get()!==void 0){const d=jd(c.keyframes,r);if(d!==void 0){ee.update(()=>{c.onUpdate(d),c.onComplete()});return}}return r.isSync?new ei(c):new Vd(c)};function zi(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function ir(t,e,n,s){if(typeof e=="function"){const[i,a]=zi(s);e=e(n!==void 0?n:t.custom,i,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,a]=zi(s);e=e(n!==void 0?n:t.custom,i,a)}return e}function Ct(t,e,n){const s=t.getProps();return ir(s,e,n!==void 0?n:s.custom,t)}const or=new Set(["width","height","top","left","right","bottom",...Lt]),Ui=30,zd=t=>!isNaN(parseFloat(t));class Ud{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var a;const i=xe.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=xe.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=zd(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Us);const s=this.events[e].add(n);return e==="change"?()=>{s(),ee.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=xe.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ui)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ui);return Ta(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),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 e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Mt(t,e){return new Ud(t,e)}const qd=t=>Array.isArray(t);function Hd(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Mt(n))}function Kd(t){return qd(t)?t[t.length-1]||0:t}function Gd(t,e){const n=Ct(t,e);let{transitionEnd:s={},transition:i={},...a}=n||{};a={...a,...s};for(const o in a){const r=Kd(a[o]);Hd(t,o,r)}}const ve=t=>!!(t&&t.getVelocity);function Wd(t){return!!(ve(t)&&t.add)}function fs(t,e){const n=t.getValue("willChange");if(Wd(n))return n.add(e);if(!n&&qe.WillChange){const s=new qe.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function ii(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Yd="framerAppearId",Xd="data-"+ii(Yd);function ar(t){return t.props[Xd]}function Qd({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function rr(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:a,transitionEnd:o,...r}=e;const l=t.getDefaultTransition();a=a?sr(a,l):l;const u=a==null?void 0:a.reduceMotion;s&&(a=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const d in r){const f=t.getValue(d,t.latestValues[d]??null),p=r[d];if(p===void 0||h&&Qd(h,d))continue;const g={delay:n,...ni(a||{},d)},m=f.get();if(m!==void 0&&!f.isAnimating&&!Array.isArray(p)&&p===m&&!g.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const $=ar(t);if($){const P=window.MotionHandoffAnimation($,d,ee);P!==null&&(g.startTime=P,v=!0)}}fs(t,d);const C=u??t.shouldReduceMotion;f.start(si(d,f,p,C&&or.has(d)?{type:!1}:g,t,v));const y=f.animation;y&&c.push(y)}if(o){const d=()=>ee.update(()=>{o&&Gd(t,o)});c.length?Promise.all(c).then(d):d()}return c}function ps(t,e,n={}){var l;const s=Ct(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const a=s?()=>Promise.all(rr(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:d}=i;return Zd(t,e,u,c,h,d,n)}:()=>Promise.resolve(),{when:r}=i;if(r){const[u,c]=r==="beforeChildren"?[a,o]:[o,a];return u().then(()=>c())}else return Promise.all([a(),o(n.delay)])}function Zd(t,e,n=0,s=0,i=0,a=1,o){const r=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),r.push(ps(l,e,{...o,delay:n+(typeof s=="function"?0:s)+tr(t.variantChildren,l,s,i,a)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(r)}function Jd(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(a=>ps(t,a,n));s=Promise.all(i)}else if(typeof e=="string")s=ps(t,e,n);else{const i=typeof e=="function"?Ct(t,e,n.custom):e;s=Promise.all(rr(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const eh={test:t=>t==="auto",parse:t=>t},lr=t=>e=>e.test(t),ur=[Vt,j,Fe,Ye,Ac,Tc,eh],qi=t=>ur.find(lr(t));function th(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Sa(t):!0}const nh=new Set(["brightness","contrast","saturate","opacity"]);function sh(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ws)||[];if(!s)return t;const i=n.replace(s,"");let a=nh.has(e)?1:0;return s!==n&&(a*=100),e+"("+a+i+")"}const ih=/\b([a-z-]*)\(.*?\)/gu,ms={...Le,getAnimatableNone:t=>{const e=t.match(ih);return e?e.map(sh).join(" "):t}},gs={...Le,getAnimatableNone:t=>{const e=Le.parse(t);return Le.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Hi={...Vt,transform:Math.round},oh={rotate:Ye,rotateX:Ye,rotateY:Ye,rotateZ:Ye,scale:mn,scaleX:mn,scaleY:mn,scaleZ:mn,skew:Ye,skewX:Ye,skewY:Ye,distance:j,translateX:j,translateY:j,translateZ:j,x:j,y:j,z:j,perspective:j,transformPerspective:j,opacity:Wt,originX:Di,originY:Di,originZ:j},oi={borderWidth:j,borderTopWidth:j,borderRightWidth:j,borderBottomWidth:j,borderLeftWidth:j,borderRadius:j,borderTopLeftRadius:j,borderTopRightRadius:j,borderBottomRightRadius:j,borderBottomLeftRadius:j,width:j,maxWidth:j,height:j,maxHeight:j,top:j,right:j,bottom:j,left:j,inset:j,insetBlock:j,insetBlockStart:j,insetBlockEnd:j,insetInline:j,insetInlineStart:j,insetInlineEnd:j,padding:j,paddingTop:j,paddingRight:j,paddingBottom:j,paddingLeft:j,paddingBlock:j,paddingBlockStart:j,paddingBlockEnd:j,paddingInline:j,paddingInlineStart:j,paddingInlineEnd:j,margin:j,marginTop:j,marginRight:j,marginBottom:j,marginLeft:j,marginBlock:j,marginBlockStart:j,marginBlockEnd:j,marginInline:j,marginInlineStart:j,marginInlineEnd:j,fontSize:j,backgroundPositionX:j,backgroundPositionY:j,...oh,zIndex:Hi,fillOpacity:Wt,strokeOpacity:Wt,numOctaves:Hi},ah={...oi,color:ae,backgroundColor:ae,outlineColor:ae,fill:ae,stroke:ae,borderColor:ae,borderTopColor:ae,borderRightColor:ae,borderBottomColor:ae,borderLeftColor:ae,filter:ms,WebkitFilter:ms,mask:gs,WebkitMask:gs},cr=t=>ah[t],rh=new Set([ms,gs]);function dr(t,e){let n=cr(t);return rh.has(n)||(n=Le),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const lh=new Set(["auto","none","0"]);function uh(t,e,n){let s=0,i;for(;s<t.length&&!i;){const a=t[s];typeof a=="string"&&!lh.has(a)&&Pt(a).values.length&&(i=t[s]),s++}if(i&&n)for(const a of e)t[a]=dr(n,i)}class ch extends ti{constructor(e,n,s,i,a){super(e,n,s,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let h=e[c];if(typeof h=="string"&&(h=h.trim(),Gs(h))){const d=nr(h,n.current);d!==void 0&&(e[c]=d),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!or.has(s)||e.length!==2)return;const[i,a]=e,o=qi(i),r=qi(a),l=Mi(i),u=Mi(a);if(l!==u&&Je[s]){this.needsMeasurement=!0;return}if(o!==r)if(Fi(o)&&Fi(r))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else Je[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||th(e[i]))&&s.push(i);s.length&&uh(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Je[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var r;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const a=s.length-1,o=s[a];s[a]=Je[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(r=this.removedTransforms)!=null&&r.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const dh=new Set(["opacity","clipPath","filter","transform"]);function hr(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const fr=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function hh(t){return wa(t)&&"offsetHeight"in t}const{schedule:pr}=Ia(queueMicrotask,!1),fh={y:!1};function ph(){return fh.y}function mr(t,e){const n=hr(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function mh(t){return!(t.pointerType==="touch"||ph())}function gh(t,e,n={}){const[s,i,a]=mr(t,n);return s.forEach(o=>{let r=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",p)},h=m=>{u&&(u(m),u=void 0),c()},d=m=>{r=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),l&&(l=!1,h(m))},f=()=>{r=!0,window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",d,i)},p=m=>{if(m.pointerType!=="touch"){if(r){l=!0;return}h(m)}},g=m=>{if(!mh(m))return;l=!1;const v=e(o,m);typeof v=="function"&&(u=v,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",g,i),o.addEventListener("pointerdown",f,i)}),a}const gr=(t,e)=>e?t===e?!0:gr(t,e.parentElement):!1,vh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,yh=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function xh(t){return yh.has(t.tagName)||t.isContentEditable===!0}const xn=new WeakSet;function Ki(t){return e=>{e.key==="Enter"&&t(e)}}function qn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const bh=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Ki(()=>{if(xn.has(n))return;qn(n,"down");const i=Ki(()=>{qn(n,"up")}),a=()=>qn(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",a,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Gi(t){return vh(t)&&!0}const Wi=new WeakSet;function wh(t,e,n={}){const[s,i,a]=mr(t,n),o=r=>{const l=r.currentTarget;if(!Gi(r)||Wi.has(r))return;xn.add(l),n.stopPropagation&&Wi.add(r);const u=e(l,r),c=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),xn.has(l)&&xn.delete(l),Gi(f)&&typeof u=="function"&&u(f,{success:p})},h=f=>{c(f,l===window||l===document||n.useGlobalTarget||gr(l,f.target))},d=f=>{c(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",d,i)};return s.forEach(r=>{(n.useGlobalTarget?window:r).addEventListener("pointerdown",o,i),hh(r)&&(r.addEventListener("focus",u=>bh(u,i)),!xh(r)&&!r.hasAttribute("tabindex")&&(r.tabIndex=0))}),a}function vr(t){return wa(t)&&"ownerSVGElement"in t}function Sh(t){return vr(t)&&t.tagName==="svg"}const _h=[...ur,ae,Le],Th=t=>_h.find(lr(t)),Yi=()=>({translate:0,scale:1,origin:0,originPoint:0}),_t=()=>({x:Yi(),y:Yi()}),Xi=()=>({min:0,max:0}),ce=()=>({x:Xi(),y:Xi()}),Ah=new WeakMap;function ai(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Mn(t){return typeof t=="string"||Array.isArray(t)}const kh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ch=["initial",...kh];function yr(t){return ai(t.animate)||Ch.some(e=>Mn(t[e]))}function Ph(t){return!!(yr(t)||t.variants)}function Mh(t,e,n){for(const s in e){const i=e[s],a=n[s];if(ve(i))t.addValue(s,i);else if(ve(a))t.addValue(s,Mt(i,{owner:t}));else if(a!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Mt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const vs={current:null},xr={current:!1},Dh=typeof window<"u";function Vh(){if(xr.current=!0,!!Dh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vs.current=t.matches;t.addEventListener("change",e),e()}else vs.current=!1}const Qi=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zi={};class Lh{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:r},l={}){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=ti,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=xe.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,ee.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=r;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=yr(n),this.isVariantNode=Ph(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];u[f]!==void 0&&ve(p)&&p.set(u[f])}}mount(e){var n,s;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,Ah.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,a)=>this.bindToMotionValue(a,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(xr.current||Vh(),this.shouldReduceMotion=vs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),et(this.notifyUpdate),et(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&dh.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:r,times:l,ease:u,duration:c}=n.accelerate,h=new Ja({element:this.current,name:e,keyframes:r,times:l,ease:u,duration:Ce(c)}),d=o(h);this.valueSubscriptions.set(e,()=>{d(),h.cancel()});return}const s=Et.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&ee.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Zi){const n=Zi[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ce()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Qi.length;s++){const i=Qi[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=e[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Mh(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Mt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(ba(s)||Sa(s))?s=parseFloat(s):!Th(s)&&Le.test(n)&&(s=dr(e,n)),this.setBaseTarget(e,ve(s)?s.get():s)),ve(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var a;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=ir(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!ve(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Us),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){pr.render(this.render)}}class br extends Lh{constructor(){super(...arguments),this.KeyframeResolver=ch}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ve(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function wr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Eh({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Rh(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Hn(t){return t===void 0||t===1}function ys({scale:t,scaleX:e,scaleY:n}){return!Hn(t)||!Hn(e)||!Hn(n)}function at(t){return ys(t)||Sr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Sr(t){return Ji(t.x)||Ji(t.y)}function Ji(t){return t&&t!=="0%"}function kn(t,e,n){const s=t-n,i=e*s;return n+i}function eo(t,e,n,s,i){return i!==void 0&&(t=kn(t,i,s)),kn(t,n,s)+e}function xs(t,e=0,n=1,s,i){t.min=eo(t.min,e,n,s,i),t.max=eo(t.max,e,n,s,i)}function _r(t,{x:e,y:n}){xs(t.x,e.translate,e.scale,e.originPoint),xs(t.y,n.translate,n.scale,n.originPoint)}const to=.999999999999,no=1.0000000000001;function Ih(t,e,n,s=!1){var r;const i=n.length;if(!i)return;e.x=e.y=1;let a,o;for(let l=0;l<i;l++){a=n[l],o=a.projectionDelta;const{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(s&&a.options.layoutScroll&&a.scroll&&a!==a.root&&At(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,_r(t,o)),s&&at(a.latestValues)&&At(t,a.latestValues,(r=a.layout)==null?void 0:r.layoutBox))}e.x<no&&e.x>to&&(e.x=1),e.y<no&&e.y>to&&(e.y=1)}function Tt(t,e){t.min=t.min+e,t.max=t.max+e}function so(t,e,n,s,i=.5){const a=se(t.min,t.max,i);xs(t,e,n,a,s)}function io(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function At(t,e,n){const s=n??t;so(t.x,io(e.x,s.x),e.scaleX,e.scale,e.originX),so(t.y,io(e.y,s.y),e.scaleY,e.scale,e.originY)}function Tr(t,e){return wr(Rh(t.getBoundingClientRect(),e))}function $h(t,e,n){const s=Tr(t,n),{scroll:i}=e;return i&&(Tt(s.x,i.offset.x),Tt(s.y,i.offset.y)),s}const Bh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Oh=Lt.length;function Fh(t,e,n){let s="",i=!0;for(let a=0;a<Oh;a++){const o=Lt[a],r=t[o];if(r===void 0)continue;let l=!0;if(typeof r=="number")l=r===(o.startsWith("scale")?1:0);else{const u=parseFloat(r);l=o.startsWith("scale")?u===1:u===0}if(!l||n){const u=fr(r,oi[o]);if(!l){i=!1;const c=Bh[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function ri(t,e,n){const{style:s,vars:i,transformOrigin:a}=t;let o=!1,r=!1;for(const l in e){const u=e[l];if(Et.has(l)){o=!0;continue}else if(Ks(l)){i[l]=u;continue}else{const c=fr(u,oi[l]);l.startsWith("origin")?(r=!0,a[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=Fh(e,t.transform,n):s.transform&&(s.transform="none")),r){const{originX:l="50%",originY:u="50%",originZ:c=0}=a;s.transformOrigin=`${l} ${u} ${c}`}}function Ar(t,{style:e,vars:n},s,i){const a=t.style;let o;for(o in e)a[o]=e[o];i==null||i.applyProjectionStyles(a,s);for(o in n)a.setProperty(o,n[o])}function oo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Oe={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(j.test(t))t=parseFloat(t);else return t;const n=oo(t,e.target.x),s=oo(t,e.target.y);return`${n}% ${s}%`}},kr={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Le.parse(t);if(i.length>5)return s;const a=Le.createTransformer(t),o=typeof i[0]!="number"?1:0,r=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=r,i[1+o]/=l;const u=se(r,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}},Yt={borderRadius:{...Oe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Oe,borderTopRightRadius:Oe,borderBottomLeftRadius:Oe,borderBottomRightRadius:Oe,boxShadow:kr};function Cr(t){for(const e in t)Yt[e]=t[e],Ks(e)&&(Yt[e].isCSSVariable=!0)}function jh(t,{layout:e,layoutId:n}){return Et.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Yt[t]||t==="opacity")}function Pr(t,e,n){var o;const s=t.style,i=e==null?void 0:e.style,a={};if(!s)return a;for(const r in s)(ve(s[r])||i&&ve(i[r])||jh(r,t)||((o=n==null?void 0:n.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(a[r]=s[r]);return a}function Nh(t){return window.getComputedStyle(t)}class zh extends br{constructor(){super(...arguments),this.type="html",this.renderInstance=Ar}readValueFromInstance(e,n){var s;if(Et.has(n))return(s=this.projection)!=null&&s.isProjecting?rs(n):dd(e,n);{const i=Nh(e),a=(Ks(n)?i.getPropertyValue(n):i[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Tr(e,n)}build(e,n,s){ri(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Pr(e,n,s)}}const Uh={offset:"stroke-dashoffset",array:"stroke-dasharray"},qh={offset:"strokeDashoffset",array:"strokeDasharray"};function Hh(t,e,n=1,s=0,i=!0){t.pathLength=1;const a=i?Uh:qh;t[a.offset]=`${-s}`,t[a.array]=`${e} ${n}`}const Kh=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Mr(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...r},l,u,c){if(ri(t,r,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete h.transformBox);for(const f of Kh)h[f]!==void 0&&(d[f]=h[f],delete h[f]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Hh(h,i,a,o,!1)}const li=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"]),Dr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Gh(t,e,n,s){Ar(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(li.has(i)?i:ii(i),e.attrs[i])}function Wh(t,e,n){const s=Pr(t,e,n);for(const i in t)if(ve(t[i])||ve(e[i])){const a=Lt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[a]=t[i]}return s}class Yh extends br{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ce}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Et.has(n)){const s=cr(n);return s&&s.default||0}return n=li.has(n)?n:ii(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Wh(e,n,s)}build(e,n,s){Mr(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Gh(e,n,s,i)}mount(e){this.isSVGTag=Dr(e.tagName),super.mount(e)}}function ao(t,e){t.min=e.min,t.max=e.max}function De(t,e){ao(t.x,e.x),ao(t.y,e.y)}function ro(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Vr=1e-4,Xh=1-Vr,Qh=1+Vr,Lr=.01,Zh=0-Lr,Jh=0+Lr;function be(t){return t.max-t.min}function ef(t,e,n){return Math.abs(t-e)<=n}function lo(t,e,n,s=.5){t.origin=s,t.originPoint=se(e.min,e.max,t.origin),t.scale=be(n)/be(e),t.translate=se(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Xh&&t.scale<=Qh||isNaN(t.scale))&&(t.scale=1),(t.translate>=Zh&&t.translate<=Jh||isNaN(t.translate))&&(t.translate=0)}function qt(t,e,n,s){lo(t.x,e.x,n.x,s?s.originX:void 0),lo(t.y,e.y,n.y,s?s.originY:void 0)}function uo(t,e,n){t.min=n.min+e.min,t.max=t.min+be(e)}function tf(t,e,n){uo(t.x,e.x,n.x),uo(t.y,e.y,n.y)}function co(t,e,n){t.min=e.min-n.min,t.max=t.min+be(e)}function Cn(t,e,n){co(t.x,e.x,n.x),co(t.y,e.y,n.y)}function ho(t,e,n,s,i){return t-=e,t=kn(t,1/n,s),i!==void 0&&(t=kn(t,1/i,s)),t}function nf(t,e=0,n=1,s=.5,i,a=t,o=t){if(Fe.test(e)&&(e=parseFloat(e),e=se(o.min,o.max,e/100)-o.min),typeof e!="number")return;let r=se(a.min,a.max,s);t===a&&(r-=e),t.min=ho(t.min,e,n,r,i),t.max=ho(t.max,e,n,r,i)}function fo(t,e,[n,s,i],a,o){nf(t,e[n],e[s],e[i],e.scale,a,o)}const sf=["x","scaleX","originX"],of=["y","scaleY","originY"];function po(t,e,n,s){fo(t.x,e,sf,n?n.x:void 0,s?s.x:void 0),fo(t.y,e,of,n?n.y:void 0,s?s.y:void 0)}function mo(t){return t.translate===0&&t.scale===1}function Er(t){return mo(t.x)&&mo(t.y)}function go(t,e){return t.min===e.min&&t.max===e.max}function af(t,e){return go(t.x,e.x)&&go(t.y,e.y)}function vo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Rr(t,e){return vo(t.x,e.x)&&vo(t.y,e.y)}function yo(t){return be(t.x)/be(t.y)}function xo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Te(t){return[t("x"),t("y")]}function rf(t,e,n){let s="";const i=t.x.translate/e.x,a=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(s=`translate3d(${i}px, ${a}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),d&&(s+=`rotateY(${d}deg) `),f&&(s+=`skewX(${f}deg) `),p&&(s+=`skewY(${p}deg) `)}const r=t.x.scale*e.x,l=t.y.scale*e.y;return(r!==1||l!==1)&&(s+=`scale(${r}, ${l})`),s||"none"}const Ir=["TopLeft","TopRight","BottomLeft","BottomRight"],lf=Ir.length,bo=t=>typeof t=="string"?parseFloat(t):t,wo=t=>typeof t=="number"||j.test(t);function uf(t,e,n,s,i,a){i?(t.opacity=se(0,n.opacity??1,cf(s)),t.opacityExit=se(e.opacity??1,0,df(s))):a&&(t.opacity=se(e.opacity??1,n.opacity??1,s));for(let o=0;o<lf;o++){const r=`border${Ir[o]}Radius`;let l=So(e,r),u=So(n,r);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||wo(l)===wo(u)?(t[r]=Math.max(se(bo(l),bo(u),s),0),(Fe.test(u)||Fe.test(l))&&(t[r]+="%")):t[r]=u}(e.rotate||n.rotate)&&(t.rotate=se(e.rotate||0,n.rotate||0,s))}function So(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const cf=$r(0,.5,Va),df=$r(.5,.95,ke);function $r(t,e,n){return s=>s<t?0:s>e?1:n(Gt(t,e,s))}function hf(t,e,n){const s=ve(t)?t:Mt(t);return s.start(si("",s,e,n)),s.animation}function ff(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const pf=(t,e)=>t.depth-e.depth;class mf{constructor(){this.children=[],this.isDirty=!1}add(e){Ns(this.children,e),this.isDirty=!0}remove(e){Sn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(pf),this.isDirty=!1,this.children.forEach(e)}}function gf(t,e){const n=xe.now(),s=({timestamp:i})=>{const a=i-n;a>=e&&(et(s),t(a-e))};return ee.setup(s,!0),()=>et(s)}function Kn(t){return ve(t)?t.get():t}class vf{constructor(){this.members=[]}add(e){Ns(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(Sn(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Sn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let s=this.members.indexOf(e)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:a}=s.options,{layoutDependency:o}=e.options;(a===void 0||a!==o)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,i,a,o;(s=(n=e.options).onExitComplete)==null||s.call(n),(o=(i=e.resumingFrom)==null?void 0:(a=i.options).onExitComplete)==null||o.call(a)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const bn={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Gn=["","X","Y","Z"],yf=1e3;let xf=0;function Wn(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Br(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ar(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ee,!(i||a))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Br(s)}function Or({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},r=e==null?void 0:e()){this.id=xf++,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(Sf),this.nodes.forEach(kf),this.nodes.forEach(Cf),this.nodes.forEach(_f)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new mf)}addEventListener(o,r){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Us),this.eventHandlers.get(o).add(r)}notifyListeners(o,...r){const l=this.eventHandlers.get(o);l&&l.notify(...r)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=vr(o)&&!Sh(o),this.instance=o;const{layoutId:r,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||r)&&(this.isLayoutDirty=!0),t){let c,h=0;const d=()=>this.root.updateBlockedByResize=!1;ee.read(()=>{h=window.innerWidth}),t(o,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,c&&c(),c=gf(d,250),bn.hasAnimatedSinceResize&&(bn.hasAnimatedSinceResize=!1,this.nodes.forEach(Ao)))})}r&&this.root.registerSharedNode(r,this),this.options.animate!==!1&&u&&(r||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Lf,{onLayoutAnimationStart:g,onLayoutAnimationComplete:m}=u.getProps(),v=!this.targetLayout||!Rr(this.targetLayout,f),C=!h&&d;if(this.options.layoutRoot||this.resumeFrom||C||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...ni(p,"layout"),onPlay:g,onComplete:m};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(c,C)}else h||Ao(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),et(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(Pf),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Br(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:r,layout:l}=this.options;if(r===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(_o);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(To);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Af),this.nodes.forEach(bf),this.nodes.forEach(wf)):this.nodes.forEach(To),this.clearAllSnapshots();const r=xe.now();he.delta=je(0,1e3/60,r-he.timestamp),he.timestamp=r,he.isProcessing=!0,Fn.update.process(he),Fn.preRender.process(he),Fn.render.process(he),he.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Tf),this.sharedNodes.forEach(Mf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ee.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ee.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!be(this.snapshot.measuredBox.x)&&!be(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ce(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:r}=this.options;r&&r.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let r=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(r=!1),r&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,r=this.projectionDelta&&!Er(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(r||at(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const r=this.measurePageBox();let l=this.removeElementScroll(r);return o&&(l=this.removeTransform(l)),Ef(l),{animationId:this.root.animationId,measuredBox:r,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return ce();const r=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Rf))){const{scroll:c}=this.root;c&&(Tt(r.x,c.offset.x),Tt(r.y,c.offset.y))}return r}removeElementScroll(o){var l;const r=ce();if(De(r,o),(l=this.scroll)!=null&&l.wasRoot)return r;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:d}=c;c!==this.root&&h&&d.layoutScroll&&(h.wasRoot&&De(r,o),Tt(r.x,h.offset.x),Tt(r.y,h.offset.y))}return r}applyTransform(o,r=!1){var u,c;const l=ce();De(l,o);for(let h=0;h<this.path.length;h++){const d=this.path[h];!r&&d.options.layoutScroll&&d.scroll&&d!==d.root&&At(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),at(d.latestValues)&&At(l,d.latestValues,(u=d.layout)==null?void 0:u.layoutBox)}return at(this.latestValues)&&At(l,this.latestValues,(c=this.layout)==null?void 0:c.layoutBox),l}removeTransform(o){var l;const r=ce();De(r,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!at(c.latestValues))continue;let h;c.instance&&(ys(c.latestValues)&&c.updateSnapshot(),h=ce(),De(h,c.measurePageBox())),po(r,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,h)}return at(this.latestValues)&&po(r,this.latestValues),r}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==he.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;const r=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=r.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=r.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=r.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==r;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=he.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ce(),this.targetWithTransforms=ce()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tf(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):De(this.target,this.layout.layoutBox),_r(this.target,this.targetDelta)):De(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ys(this.parent.latestValues)||Sr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,r,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ce(),this.relativeTargetOrigin=ce(),Cn(this.relativeTargetOrigin,r,l),De(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const o=this.getLead(),r=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===he.timestamp&&(l=!1),l)return;const{layout:u,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||!(u||c))return;De(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;Ih(this.layoutCorrected,this.treeScale,this.path,r),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=ce());const{target:f}=o;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ro(this.prevProjectionDelta.x,this.projectionDelta.x),ro(this.prevProjectionDelta.y,this.projectionDelta.y)),qt(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!xo(this.projectionDelta.x,this.prevProjectionDelta.x)||!xo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var r;if((r=this.options.visualElement)==null||r.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=_t(),this.projectionDelta=_t(),this.projectionDeltaWithTransform=_t()}setAnimationOrigin(o,r=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=_t();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!r;const d=ce(),f=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=f!==p,m=this.getStack(),v=!m||m.members.length<=1,C=!!(g&&!v&&this.options.crossfade===!0&&!this.path.some(Vf));this.animationProgress=0;let y;this.mixTargetDelta=$=>{const P=$/1e3;ko(h.x,o.x,P),ko(h.y,o.y,P),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cn(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Df(this.relativeTarget,this.relativeTargetOrigin,d,P),y&&af(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=ce()),De(y,this.relativeTarget)),g&&(this.animationValues=c,uf(c,u,this.latestValues,P,C,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var r,l,u;this.notifyListeners("animationStart"),(r=this.currentAnimation)==null||r.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(et(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ee.update(()=>{bn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Mt(0)),this.motionValue.jump(0,!1),this.currentAnimation=hf(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(yf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:r,target:l,layout:u,latestValues:c}=o;if(!(!r||!l||!u)){if(this!==o&&this.layout&&u&&Fr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ce();const h=be(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=be(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}De(r,l),At(r,c),qt(this.projectionDeltaWithTransform,this.layoutCorrected,r,c)}}registerSharedNode(o,r){this.sharedNodes.has(o)||this.sharedNodes.set(o,new vf),this.sharedNodes.get(o).add(r);const u=r.options.initialPromotionConfig;r.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(r):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var r;const{layoutId:o}=this.options;return o?((r=this.getStack())==null?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:o}=this.options;return o?(r=this.getStack())==null?void 0:r.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:r,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),r&&this.setOptions({transition:r})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let r=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(r=!0),!r)return;const u={};l.z&&Wn("z",o,u,this.animationValues);for(let c=0;c<Gn.length;c++)Wn(`rotate${Gn[c]}`,o,u,this.animationValues),Wn(`skew${Gn[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,r){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Kn(r==null?void 0:r.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Kn(r==null?void 0:r.pointerEvents)||""),this.hasProjected&&!at(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=rf(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),o.transform=h;const{x:d,y:f}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in Yt){if(c[p]===void 0)continue;const{correct:g,applyTo:m,isCSSVariable:v}=Yt[p],C=h==="none"?c[p]:g(c[p],u);if(m){const y=m.length;for(let $=0;$<y;$++)o[m[$]]=C}else v?this.options.visualElement.renderState.vars[p]=C:o[p]=C}this.options.layoutId&&(o.pointerEvents=u===this?Kn(r==null?void 0:r.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var r;return(r=o.currentAnimation)==null?void 0:r.stop()}),this.root.nodes.forEach(_o),this.root.sharedNodes.clear()}}}function bf(t){t.updateLayout()}function wf(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:a}=t.options,o=e.source!==t.layout.source;a==="size"?Te(h=>{const d=o?e.measuredBox[h]:e.layoutBox[h],f=be(d);d.min=s[h].min,d.max=d.min+f}):Fr(a,e.layoutBox,s)&&Te(h=>{const d=o?e.measuredBox[h]:e.layoutBox[h],f=be(s[h]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+f)});const r=_t();qt(r,s,e.layoutBox);const l=_t();o?qt(l,t.applyTransform(i,!0),e.measuredBox):qt(l,s,e.layoutBox);const u=!Er(r);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:f}=h;if(d&&f){const p=ce();Cn(p,e.layoutBox,d.layoutBox);const g=ce();Cn(g,s,f.layoutBox),Rr(p,g)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:r,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Sf(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function _f(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Tf(t){t.clearSnapshot()}function _o(t){t.clearMeasurements()}function To(t){t.isLayoutDirty=!1}function Af(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ao(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function kf(t){t.resolveTargetDelta()}function Cf(t){t.calcProjection()}function Pf(t){t.resetSkewAndRotation()}function Mf(t){t.removeLeadSnapshot()}function ko(t,e,n){t.translate=se(e.translate,0,n),t.scale=se(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Co(t,e,n,s){t.min=se(e.min,n.min,s),t.max=se(e.max,n.max,s)}function Df(t,e,n,s){Co(t.x,e.x,n.x,s),Co(t.y,e.y,n.y,s)}function Vf(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Lf={duration:.45,ease:[.4,0,.1,1]},Po=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Mo=Po("applewebkit/")&&!Po("chrome/")?Math.round:ke;function Do(t){t.min=Mo(t.min),t.max=Mo(t.max)}function Ef(t){Do(t.x),Do(t.y)}function Fr(t,e,n){return t==="position"||t==="preserve-aspect"&&!ef(yo(e),yo(n),.2)}function Rf(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const If=Or({attachResizeListener:(t,e)=>ff(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Yn={current:void 0},$f=Or({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Yn.current){const t=new If({});t.mount(window),t.setOptions({layoutScroll:!0}),Yn.current=t}return Yn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Bf={some:0,all:1};function Of(t,e,{root:n,margin:s,amount:i="some"}={}){const a=hr(t),o=new WeakMap,r=u=>{u.forEach(c=>{const h=o.get(c.target);if(c.isIntersecting!==!!h)if(c.isIntersecting){const d=e(c.target,c);typeof d=="function"?o.set(c.target,d):l.unobserve(c.target)}else typeof h=="function"&&(h(c),o.delete(c.target))})},l=new IntersectionObserver(r,{root:n,rootMargin:s,threshold:typeof i=="number"?i:Bf[i]});return a.forEach(u=>l.observe(u)),()=>l.disconnect()}const Vo=(t,e)=>Math.abs(t-e);function Ff(t,e){const n=Vo(t.x,e.x),s=Vo(t.y,e.y);return Math.sqrt(n**2+s**2)}function jr({current:t}){return t?t.ownerDocument.defaultView:null}function bs(t){if(t)return t.nodeType===3||t.nodeType===8?bs(t.nextSibling):t}const[jf,Nf,v0]=Jt("Motion"),[zf,y0,x0]=Jt("LayoutGroup"),Uf={reducedMotion:"never",transition:void 0,nonce:void 0},[qf,b0,w0]=Jt("MotionConfig");function Hf(){return qf(L(()=>Uf))}const Kf={motionAttribute:"data-ap"},ws=[];function Nr(t){for(const e of t)e&&!ws.includes(e)&&ws.push(e)}function zr(t,e,n){if(Array.isArray(t))return t.reduce((s,i)=>{const a=zr(i,e,n);return a?{...s,...a}:s},{});if(typeof t=="object")return t;if(t&&e){const s=e[t];return typeof s=="function"?s(n):s}}function Gf(t,e,n){const s=zr(t,e,n);if(!s)return;const{transition:i,transitionEnd:a,...o}=s;return{...o,...a}}function Wf(t,e){var i;const n=(t.initial===void 0&&t.variants?e==null?void 0:e.initial:t.initial)===!1?["initial","animate"]:["initial"],s=t.custom??((i=t.presenceContext)==null?void 0:i.custom);return n.reduce((a,o)=>({...a,...Gf(t[o]||(e==null?void 0:e[o]),t.variants,s)}),{})}function Ur(t,e){const n=e==null?void 0:e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}var Yf=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 qr(t){return Yf.has(t)}const Lo=new WeakMap;var Xf=class{constructor(t,e){var n;this.element=null,this.isExiting=!1,this.presenceContainer=null,this.children=new Set,this.features=new Map,this._context=null,this.options=t,this.parent=e,(n=e==null?void 0:e.children)==null||n.add(this),this.latestValues=Wf(t,this.context),this.type=qr(this.options.as)?"svg":"html"}get context(){return this._context||(this._context=new Proxy({},{get:(t,e)=>{var s;const n=this.options[e];return Mn(n)||e==="initial"&&n===!1?n:(s=this.parent)==null?void 0:s.context[e]}})),this._context}updateFeatures(){if(this.visualElement)for(const t of ws){this.features.has(t.key)||this.features.set(t.key,new t(this));const e=this.features.get(t.key);this.isMounted()&&(e.isMount?e.update():(e.mount(),e.isMount=!0))}}updateOptions(t){var e;this.options=t,(e=this.visualElement)==null||e.update({...this.options,whileTap:this.options.whilePress},null)}mount(t){var e,n;Lo.set(t,this),this.element=t,t.setAttribute(Kf.motionAttribute,((e=this.options.presenceContext)==null?void 0:e.presenceId)??""),(n=this.visualElement)==null||n.mount(t),this.updateFeatures()}beforeUnmount(){this.getSnapshot(this.options,!1)}unmount(){var t,e,n;(e=(t=this.parent)==null?void 0:t.children)==null||e.delete(this),Lo.delete(this.element),this.features.forEach(s=>{var i;return(i=s.unmount)==null?void 0:i.call(s)}),(n=this.visualElement)==null||n.unmount()}beforeUpdate(){this.getSnapshot(this.options,void 0)}update(){this.updateFeatures(),this.didUpdate()}tryExitComplete(){var t,e,n,s,i;this.isExiting||(t=this.options)!=null&&t.layoutId&&((n=(e=this.visualElement.projection)==null?void 0:e.currentAnimation)==null?void 0:n.state)==="running"||(i=(s=this.options.presenceContext)==null?void 0:s.onMotionExitComplete)==null||i.call(s,this.presenceContainer,this)}setActive(t,e){var n,s;t==="exit"&&e&&(this.isExiting=!0),(s=(n=this.visualElement)==null?void 0:n.animationState)==null||s.setActive(t,e).then(()=>{var i;t==="exit"&&e&&(this.isExiting=!1,(i=this.options)!=null&&i.layoutId?ee.postRender(()=>this.tryExitComplete()):this.tryExitComplete())})}isMounted(){return!!this.element}initVisualElement(t){var e,n,s;this.visualElement||(this.visualElement=t(this.options.as,{presenceContext:null,parent:(e=this.parent)==null?void 0:e.visualElement,props:{...this.options,whileTap:this.options.whilePress},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{...this.latestValues}},reducedMotionConfig:(n=this.options.motionConfig)==null?void 0:n.reducedMotion}),(s=this.visualElement.parent)==null||s.addChild(this.visualElement),this.isMounted()&&this.visualElement.mount(this.element))}getSnapshot(t,e){}didUpdate(){}},He=class{constructor(t){this.state=t}mount(){}unmount(){}update(){}};const Hr=["initial","animate","exit","whileHover","whileDrag","whileFocus","whilePress"];var Qf=Hr.length;function Kr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Kr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Qf;n++){const s=Hr[n],i=t.props[s];(Mn(i)||i===!1)&&(e[s]=i)}return e}var Gr=["animate","whileInView","whileFocus","whileHover","whilePress","whileDrag","exit"],Zf=[...Gr].reverse(),Jf=Gr.length;function ot(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Eo(){return{animate:ot(!0),whileInView:ot(),whileHover:ot(),whilePress:ot(),whileDrag:ot(),whileFocus:ot(),exit:ot()}}function ep(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Ur(e,t):!1}function Ro(t){return Array.isArray(t)}function tp(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Jd(t,n,s)))}function np(t){let e=tp(t),n=Eo(),s=!0;const i=l=>(u,c)=>{var d;const h=Ct(t,c,l==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(h){const{transition:f,transitionEnd:p,...g}=h;u={...u,...g,...p}}return u};function a(l){e=l(t)}function o(l){const{props:u}=t,c=Kr(t.parent)||{},h=[],d=new Set;let f={},p=1/0;for(let m=0;m<Jf;m++){const v=Zf[m],C=n[v],y=u[v]!==void 0?u[v]:c[v],$=Mn(y),P=v===l?C.isActive:null;P===!1&&(p=m);let V=y===c[v]&&y!==u[v]&&$;if(V&&s&&t.manuallyAnimateOnMount&&(V=!1),C.protectedKeys={...f},!C.isActive&&P===null||!y&&!C.prevProp||ai(y)||typeof y=="boolean")continue;const T=ep(C.prevProp,y);let w=T||v===l&&C.isActive&&!V&&$||m>p&&$,B=!1;const E=Array.isArray(y)?y:[y];let z=E.reduce(i(v),{});P===!1&&(z={});const{prevResolvedValues:F={}}=C,te={...F,...z},A=N=>{w=!0,d.has(N)&&(B=!0,d.delete(N)),C.needsAnimating[N]=!0;const G=t.getValue(N);G&&(G.liveStyle=!1)};for(const N in te){const G=z[N],W=F[N];if(Object.hasOwnProperty.call(f,N))continue;let U=!1;Ro(G)&&Ro(W)?U=!Ur(G,W):U=G!==W,U?G!=null?A(N):d.add(N):G!==void 0&&d.has(N)?A(N):C.protectedKeys[N]=!0}C.prevProp=y,C.prevResolvedValues=z,C.isActive&&(f={...f,...z}),s&&t.blockInitialAnimation&&(w=!1);const I=V&&T;w&&(!I||B)&&h.push(...E.map(N=>{const G={type:v};if(typeof N=="string"&&s&&!I&&t.manuallyAnimateOnMount&&t.parent){const{parent:W}=t,U=Ct(W,N);if(W.enteringChildren&&U){const{delayChildren:Q}=U.transition||{};G.delay=tr(W.enteringChildren,t,Q)}}return{animation:N,options:G}}))}if(d.size){const m={};if(typeof u.initial!="boolean"){const v=Ct(t,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(m.transition=v.transition)}d.forEach(v=>{const C=t.getBaseTarget(v),y=t.getValue(v);y&&(y.liveStyle=!0),m[v]=C??null}),h.push({animation:m})}let g=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(h):Promise.resolve()}function r(l,u){var h;if(n[l].isActive===u)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(d=>{var f;(f=d.animationState)==null||f.setActive(l,u)}),n[l].isActive=u;const c=o(l);for(const d in n)n[d].protectedKeys={};return c}return{animateChanges:o,setActive:r,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Eo(),s=!0}}}function Wr(t){return t.style.display==="none"||t.offsetParent===null&&window.getComputedStyle(t).position!=="fixed"}var ut,As,sp=(ut=class extends He{constructor(e){super(e);const n=e.visualElement;n.animationState||(n.animationState=np(n))}updateAnimationControlsSubscription(){const{animate:e}=this.state.options;ai(e)&&(this.unmountControls=e.subscribe(this.state.visualElement))}mount(){var e;Wr(this.state.element)?this.state.setActive("exit",!0):(e=this.state.visualElement.animationState)==null||e.animateChanges(),this.updateAnimationControlsSubscription()}update(){var s;(s=this.state.visualElement.animationState)==null||s.animateChanges();const{animate:e}=this.state.visualElement.getProps(),{animate:n}=this.state.visualElement.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.state.visualElement.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}},As=new WeakMap,Ie(ut,As,ut.key="animation"),ut);function ip(t,e){return qr(t)?new Yh(e):new zh(e)}function Io(t){return{point:{x:t.pageX,y:t.pageY}}}var ct,ks,op=(ct=class extends He{constructor(e){super(e)}isActive(){const{whilePress:e,onPress:n,onPressCancel:s,onPressStart:i}=this.state.options;return!!(e||n||s||i)}register(){var n;const e=this.state.element;!e||!this.isActive()||((n=this.removePress)==null||n.call(this),this.removePress=wh(e,(s,i)=>{const a=this.state.options;return this.state.setActive("whilePress",!0),a.onPressStart&&ee.postRender(()=>a.onPressStart(i,Io(i))),(o,{success:r})=>{this.state.setActive("whilePress",!1);const l=r?"onPress":"onPressCancel",u=this.state.options[l];u&&ee.postRender(()=>u(o,Io(o)))}},{useGlobalTarget:this.state.options.globalPressTarget}))}mount(){this.register()}update(){const e=this.state.visualElement.prevProps;!(e!=null&&e.whilePress||e!=null&&e.whileTap||e!=null&&e.onPress||e!=null&&e.onPressCancel||e!=null&&e.onPressStart)&&this.isActive()&&this.register()}unmount(){var e;(e=this.removePress)==null||e.call(this),this.removePress=void 0}},ks=new WeakMap,Ie(ct,ks,ct.key="press"),ct);function Yr(t){return t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1}function Xt(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}function ap(t){return e=>Yr(e)&&t(e,Xt(e))}var dt,Cs,rp=(dt=class extends He{constructor(e){super(e)}isActive(){const{whileHover:e,onHoverStart:n,onHoverEnd:s}=this.state.options;return!!(e||n||s)}register(){var n;const e=this.state.element;!e||!this.isActive()||((n=this.removeHover)==null||n.call(this),this.removeHover=gh(e,(s,i)=>{const a=this.state.options;return this.state.setActive("whileHover",!0),a.onHoverStart&&ee.postRender(()=>a.onHoverStart(i,Xt(i))),o=>{this.state.setActive("whileHover",!1);const r=this.state.options.onHoverEnd;r&&ee.postRender(()=>r(o,Xt(o)))}}))}mount(){this.register()}update(){const e=this.state.visualElement.prevProps;!(e!=null&&e.whileHover||e!=null&&e.onHoverStart||e!=null&&e.onHoverEnd)&&this.isActive()&&this.register()}unmount(){var e;(e=this.removeHover)==null||e.call(this),this.removeHover=void 0}},Cs=new WeakMap,Ie(dt,Cs,dt.key="hover"),dt),ht,Ps,lp=(ht=class extends He{constructor(e){super(e)}isActive(){const{whileInView:e,onViewportEnter:n,onViewportLeave:s}=this.state.options;return!!(e||n||s)}startObserver(){var i;const e=this.state.element;if(!e||!this.isActive())return;(i=this.removeObserver)==null||i.call(this);const{once:n,...s}=this.state.options.inViewOptions||{};this.removeObserver=Of(e,(a,o)=>{const r=this.state.options;if(this.state.setActive("whileInView",!0),r.onViewportEnter&&ee.postRender(()=>r.onViewportEnter(o)),!n)return()=>{this.state.setActive("whileInView",!1);const l=this.state.options.onViewportLeave;l&&ee.postRender(()=>l(o))}},s)}mount(){this.startObserver()}update(){const{props:e,prevProps:n}=this.state.visualElement;["amount","margin","root"].some(s=>{var i,a;return((i=e.inViewOptions)==null?void 0:i[s])!==((a=n==null?void 0:n.inViewOptions)==null?void 0:a[s])})&&this.startObserver()}unmount(){var e;(e=this.removeObserver)==null||e.call(this),this.removeObserver=void 0}},Ps=new WeakMap,Ie(ht,Ps,ht.key="inView"),ht);function Pn(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}var ft,Ms,up=(ft=class extends He{constructor(e){super(e),this.isFocused=!1}onFocus(){let e=!1;try{e=this.state.element.matches(":focus-visible")}catch{e=!0}e&&(this.state.setActive("whileFocus",!0),this.isFocused=!0)}onBlur(){this.isFocused&&(this.state.setActive("whileFocus",!1),this.isFocused=!1)}mount(){const e=this.state.element;this.removeFocus=en(Pn(e,"focus",()=>this.onFocus()),Pn(e,"blur",()=>this.onBlur()))}unmount(){var e;(e=this.removeFocus)==null||e.call(this),this.removeFocus=void 0}},Ms=new WeakMap,Ie(ft,Ms,ft.key="focus"),ft);function Xr(t){if(t)return t.options.allowProjection!==!1?t.projection:Xr(t.parent)}const Qr={borderRadius:{...Oe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Oe,borderTopRightRadius:Oe,borderBottomLeftRadius:Oe,borderBottomRightRadius:Oe,boxShadow:kr};function Nt(t){return typeof t=="object"&&t!==null&&"nodeType"in t}const cp=typeof window>"u";var pt,Ds,dp=(pt=class extends He{constructor(e){super(e),Cr(Qr),cp||this.initProjection()}initProjection(){const e=this.state.options;this.state.visualElement.projection=new $f(this.state.visualElement.latestValues,e["data-framer-portal-id"]?void 0:Xr(this.state.visualElement.parent)),this.projection=this.state.visualElement.projection,this.projection.isPresent=!0,this.setOptions()}setOptions(){var o;const e=this.state.options,{layoutId:n,layout:s,drag:i=!1,dragConstraints:a=!1}=e;(o=this.projection)==null||o.setOptions({layout:s,layoutId:n,alwaysMeasureLayout:!!n||!!i||a&&Nt(a),visualElement:this.state.visualElement,animationType:typeof e.layout=="string"?e.layout:"both",layoutRoot:e.layoutRoot,layoutScroll:e.layoutScroll,crossfade:e.crossfade,onExitComplete:()=>{var r;!((r=this.projection)!=null&&r.isPresent)&&this.state.options.layoutId&&!this.state.isExiting&&queueMicrotask(()=>{var l,u;(u=(l=this.state.options.presenceContext)==null?void 0:l.onMotionExitComplete)==null||u.call(l,this.state.presenceContainer,this.state)})}})}update(){this.setOptions()}mount(){var e;(e=this.projection)==null||e.mount(this.state.element)}},Ds=new WeakMap,Ie(pt,Ds,pt.key="projection"),pt);function Ht(t,e,n,s){return Pn(t,e,ap(n),s)}var $o=new Set(["auto","scroll"]),Zr=class{constructor(t,e,{transformPagePoint:n,contextWindow:s,dragSnapToOrigin:i=!1,element:a}={}){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=Qn(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,d=Ff(c.offset,{x:0,y:0})>=3;if(!h&&!d)return;const{point:f}=c,{timestamp:p}=he;this.history.push({...f,timestamp:p});const{onStart:g,onMove:m}=this.handlers;h||(g&&g(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,c)},this.handlePointerMove=(c,h)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=Xn(h,this.transformPagePoint),ee.update(this.updatePoint,!0)},this.handlePointerUp=(c,h)=>{this.end();const{onEnd:d,onSessionEnd:f,resumeAnimation:p}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=Qn(c.type==="pointercancel"?this.lastMoveEventInfo:Xn(h,this.transformPagePoint),this.history);this.startEvent&&d&&d(c,g),f&&f(c,g)},!Yr(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=n,this.contextWindow=s||window;const o=Xn(Xt(t),this.transformPagePoint),{point:r}=o,{timestamp:l}=he;this.history=[{...r,timestamp:l}];const{onSessionStart:u}=e;u&&u(t,Qn(o,this.history)),this.removeListeners=en(Ht(this.contextWindow,"pointermove",this.handlePointerMove),Ht(this.contextWindow,"pointerup",this.handlePointerUp),Ht(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}isScrollable(t){const e=window.getComputedStyle(t);return e.overflow==="auto"||e.overflow==="scroll"||e.overflowX==="auto"||e.overflowX==="scroll"||e.overflowY==="auto"||e.overflowY==="scroll"}startScrollTracking(t){let e=t.parentElement;for(;e;){const n=getComputedStyle(e);($o.has(n.overflowX)||$o.has(n.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.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(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,s=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-e.x,y:s.y-e.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),ee.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){var t;this.removeListeners&&this.removeListeners(),(t=this.removeScrollListeners)==null||t.call(this),this.scrollPositions.clear(),et(this.updatePoint)}};function Xn(t,e){return e?{point:e(t.point)}:t}function Bo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Qn({point:t},e){return{point:t,delta:Bo(t,Jr(e)),offset:Bo(t,hp(e)),velocity:fp(e,.1)}}function hp(t){return t[0]}function Jr(t){return t[t.length-1]}function fp(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Jr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>Ce(e)));)n--;if(!s)return{x:0,y:0};const a=Ae(i.timestamp-s.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-s.x)/a,y:(i.y-s.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Oo(t){return(e,n)=>{t&&ee.postRender(()=>t(e,n))}}var mt,Vs,pp=(mt=class extends He{constructor(...e){super(...e),this.removePointerDownListener=ke}onPointerDown(e){this.session=new Zr(e,this.createPanHandlers(),{transformPagePoint:this.state.visualElement.getTransformPagePoint(),contextWindow:jr(this.state.visualElement)})}createPanHandlers(){return{onSessionStart:Oo((e,n)=>{const{onPanSessionStart:s}=this.state.options;s&&s(e,n)}),onStart:Oo((e,n)=>{const{onPanStart:s}=this.state.options;s&&s(e,n)}),onMove:(e,n)=>{const{onPan:s}=this.state.options;s&&s(e,n)},onEnd:(e,n)=>{const{onPanEnd:s}=this.state.options;delete this.session,s&&ee.postRender(()=>s(e,n))}}}mount(){this.removePointerDownListener=Ht(this.state.element,"pointerdown",this.onPointerDown.bind(this))}update(){}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Vs=new WeakMap,Ie(mt,Vs,mt.key="pan"),mt);function el(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}var Fo=el("dragHorizontal"),jo=el("dragVertical");function mp(t){let e=!1;if(t==="y")e=jo();else if(t==="x")e=Fo();else{const n=Fo(),s=jo();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function gp(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?se(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?se(n,t,s.max):Math.min(t,n)),t}const Ss=.35;function vp(t,{top:e,left:n,bottom:s,right:i}){return{x:No(t.x,n,i),y:No(t.y,e,s)}}function No(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function yp(t=Ss){return t===!1?t=0:t===!0&&(t=Ss),{x:zo(t,"left","right"),y:zo(t,"top","bottom")}}function zo(t,e,n){return{min:Uo(t,e),max:Uo(t,n)}}function Uo(t,e){return typeof t=="number"?t:t[e]||0}function xp(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}function bp(t,e){return{x:qo(t.x,e.x),y:qo(t.y,e.y)}}function qo(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function wp(t,e){let n=.5;const s=be(t),i=be(e);return i>s?n=Gt(e.min,e.max-s,t.min):s>i&&(n=Gt(t.min,t.max-i,e.min)),je(0,1,n)}const Sp=new WeakMap;var _p=class{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ce(),this.state=t}get visualElement(){return this.state.visualElement}start(t,{snapToCursor:e=!1}={}){const n=l=>{e?this.stopAnimation():this.pauseAnimation(),e&&this.snapToCursor(Xt(l,"page").point)},s=(l,u)=>{this.stopAnimation();const{drag:c,dragPropagation:h,onDragStart:d}=this.getProps();c&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=mp(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),Te(f=>{let p=this.getAxisMotionValue(f).get()||0;if(Fe.test(p)){const{projection:g}=this.visualElement;if(g&&g.layout){const m=g.layout.layoutBox[f];m&&(p=be(m)*(parseFloat(p)/100))}}this.originPoint[f]=p}),d&&ee.postRender(()=>d(l,u)),fs(this.visualElement,"transform"),this.state.setActive("whileDrag",!0))},i=(l,u)=>{const{dragPropagation:c,dragDirectionLock:h,onDirectionLock:d,onDrag:f}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(h&&this.currentDirection===null){this.currentDirection=Tp(p),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),f&&f(l,u)},a=(l,u)=>this.stop(l,u),o=()=>Te(l=>{var u;return this.getAnimationState(l)==="paused"&&((u=this.getAxisMotionValue(l).animation)==null?void 0:u.play())}),{dragSnapToOrigin:r}=this.getProps();this.panSession=new Zr(t,{onSessionStart:n,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:o},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:jr(this.visualElement),element:this.state.element})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&ee.postRender(()=>i(t,e))}cancel(){this.isDragging=!1;const{projection:t}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:e}=this.getProps();!e&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),this.state.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:s}=this.getProps();if(!n||!gn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(a=gp(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Nt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=vp(n.layoutBox,t):this.constraints=!1,this.elastic=yp(e),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Te(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=xp(n.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Nt(t))return!1;const n=t,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=$h(n,s.root,this.visualElement.getTransformPagePoint());let a=bp(s.layout.layoutBox,i);if(e){const o=e(Eh(a));this.hasMutatedConstraints=!!o,o&&(a=wr(o))}return a}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),r=this.constraints||{},l=Te(u=>{if(!gn(u,e,this.currentDirection))return;let c=r&&r[u]||{};a&&(c={min:0,max:0});const h=s?200:1e6,d=s?40:1e7,f={type:"inertia",velocity:n?t[u]:0,bounceStiffness:h,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(u,f)});return Promise.all(l).then(o)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return fs(this.visualElement,t),n.start(si(t,n,0,e,this.visualElement,!1))}stopAnimation(){var t;(t=this.visualElement.projection)!=null&&t.isPresent&&Te(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Te(t=>{var e;return(e=this.getAxisMotionValue(t).animation)==null?void 0:e.pause()})}getAnimationState(t){var e;return(e=this.getAxisMotionValue(t).animation)==null?void 0:e.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Te(e=>{const{drag:n}=this.getProps();if(!gn(e,n,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(e);if(s&&s.layout){const{min:a,max:o}=s.layout.layoutBox[e];i.set(t[e]-se(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Nt(e)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Te(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const r=o.get();s[a]=wp({min:r,max:r},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.state.element.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Te(a=>{if(!gn(a,t,null))return;const o=this.getAxisMotionValue(a),{min:r,max:l}=this.constraints[a];o.set(se(r,l,s[a]))})}addListeners(){if(!this.state.element)return;Sp.set(this.visualElement,this);const t=this.state.element,e=Ht(t,"pointerdown",r=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(r)}),n=()=>{const{dragConstraints:r}=this.getProps();Nt(r)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ee.read(n);const a=Pn(window,"resize",()=>this.scalePositionWithinConstraints()),o=s.addEventListener("didUpdate",({delta:r,hasLayoutChanged:l})=>{this.isDragging&&l&&(Te(u=>{const c=this.getAxisMotionValue(u);c&&(this.originPoint[u]+=r[u].translate,c.set(c.get()+r[u].translate))}),this.visualElement.render())});return()=>{a(),e(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=Ss,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function gn(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Tp(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}var gt,Ls,Ap=(gt=class extends He{constructor(e){super(e),this.removeGroupControls=ke,this.removeListeners=ke,this.controls=new _p(e)}mount(){const{dragControls:e}=this.state.options;e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ke}unmount(){this.removeGroupControls(),this.removeListeners()}},Ls=new WeakMap,Ie(gt,Ls,gt.key="drag"),gt),Ot=!1,vt,Es,kp=(vt=class extends He{constructor(e){super(e),this.hasMountSettled=!1,Cr(Qr),e.getSnapshot=this.getSnapshot.bind(this),e.didUpdate=this.didUpdate.bind(this)}updatePrevLead(e){const n=e.getStack();n!=null&&n.prevLead&&!n.prevLead.snapshot&&(n.prevLead.willUpdate(),Ot=!0)}didUpdate(){var e,n;Ot&&(this.state.options.layout||this.state.options.layoutId||this.state.options.drag)&&(Ot=!1,(n=(e=this.state.visualElement.projection)==null?void 0:e.root)==null||n.didUpdate())}mount(){var s;const e=this.state.options,n=this.state.options.layoutGroup;if(e.layout||e.layoutId){const i=this.state.visualElement.projection;if(e.layoutId){const a=!Wr(this.state.element);i.isPresent=a,a?i.promote():i.relegate(),this.updatePrevLead(i)}(s=n==null?void 0:n.group)==null||s.add(i),bn.hasEverUpdated=!0}this.didUpdate(),ee.postRender(()=>{this.hasMountSettled=!0})}unmount(){const e=this.state.options.layoutGroup,n=this.state.visualElement.projection;n&&(e!=null&&e.group&&(this.state.options.layout||this.state.options.layoutId)&&e.group.remove(n),this.state.options.layoutId&&(Ot=!0),this.didUpdate())}getSnapshot(e,n){const s=this.state.visualElement.projection,{drag:i,layoutDependency:a,layout:o,layoutId:r}=e;if(!s||!o&&!r&&!i||!this.hasMountSettled)return;Ot=!0;const l=this.state.options;(i||l.layoutDependency!==a||a===void 0||mi(n)&&s.isPresent!==n)&&s.willUpdate(),mi(n)&&n!==s.isPresent&&(s.isPresent=n,n?(s.promote(),this.updatePrevLead(s)):s.relegate())}},Es=new WeakMap,Ie(vt,Es,vt.key="layout"),vt);const Cp={renderer:ip,features:[sp,op,rp,lp,up,dp,pp,Ap,kp]},[Pp,S0]=Jt("LazyMotionContext"),[Mp,_0,T0]=Jt("AnimatePresenceContext");function Dp(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function tl(){return{transform:{},transformOrigin:{},style:{},vars:{}}}function Vp(){return{...tl(),attrs:{}}}function Lp(t){const e=tl();ri(e,t);const n={...e.style};for(const s in e.vars)n[s]=e.vars[s];return Object.keys(n).length===0?null:n}function Ep(t,e,n){const s=Vp();Mr(s,t,Dr(e),void 0,n);const i={};for(const a in s.attrs){const o=li.has(a)?a:Dp(a);i[o]=s.attrs[a]}return{attrs:i,style:{...s.style,...s.vars}}}function Rp(t,e){const n=jf(null),s=zf({}),i=Hf(),a=Mp({}),o=Pp({features:Y({}),strict:!1}),r=al();function l(){return oc(t,{layoutGroup:s,presenceContext:a,config:i.value})}function u(){return{...r,...l()}}const c=new Xf(u(),n);Nf(c),e&&c.initVisualElement(e),Se(o.features,f=>{var p;(p=f.features)!=null&&p.length&&Nr(f.features),f.renderer&&c.initVisualElement(f.renderer),c.updateFeatures()},{immediate:!0,flush:"pre"});function h(){var C;const f=c.type==="svg",p={...r};Object.keys(r).forEach(y=>{ve(r[y])&&(p[y]=r[y].get())});const g=((C=c.visualElement)==null?void 0:C.latestValues)||c.latestValues;let m={...t.style,...f?{}:g};for(const y in m)ve(m[y])&&(m[y]=m[y].get());if(f){const{attrs:y,style:$}=Ep({...g,...m},c.options.as,t.style);Object.assign(p,y),m=$}t.drag&&t.dragListener!==!1&&Object.assign(m,{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`});const v=Lp(m);return v&&(p.style=v),p}const d=rl().proxy;return Rs(()=>{const f=bs(d.$el);c.mount(f)}),Is(()=>c.beforeUnmount()),Zo(()=>{var f;(f=bs(d.$el))!=null&&f.isConnected||c.unmount()}),ll(()=>{c.beforeUpdate(),c.updateOptions(u())}),ul(()=>{c.update()}),{getProps:l,getAttrs:h,layoutGroup:s,state:c}}const Ip={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 $p=new Map,Bp=new Map;function Op(t){if(!Array.isArray(t))return[t];const e=[];for(const n of t)Array.isArray(n)?e.push(...n):e.push(n);return e}var Fp=["area","img","input"];function jp(t,e,n){var s,i;if(typeof t=="string"&&Fp.includes(t))return kt(t,e);if(t==="template"){if(!n.default)return null;const a=Op(n.default()),o=a.findIndex(c=>c.type!==cl);if(o===-1)return a;const r=a[o];(s=r.props)==null||delete s.ref;const l=r.props?Jo(e,r.props):e;e.class&&((i=r.props)!=null&&i.class)&&delete r.props.class;const u=dl(r,l);for(const c in l)c.startsWith("on")&&(u.props||(u.props={}),u.props[c]=l[c]);return a.length===1?u:(a[o]=u,a)}return null}function Ho(t,e={}){const n=typeof t=="string",s=n?t:t.name||"",i=e.renderer?$p:Bp;if(n&&(i!=null&&i.has(t)))return i.get(t);const a=X({inheritAttrs:!1,props:{...Ip,as:{type:[String,Object],default:t||"div"}},name:s?`motion.${s}`:"Motion",setup(o,{slots:r}){const{getProps:l,getAttrs:u,state:c}=Rp(o,e.renderer);function h(){const d=c.element;if((typeof o.as!="object"||o.asChild)&&d){const{style:f}=u();if(f)for(const[p,g]of Object.entries(f))d.style[p]=g}}return()=>{const d=l(),f=u(),p=o.asChild?"template":o.as,g={...o.forwardMotionProps?d:{},...f,onVnodeUpdated:h},m=jp(p,g,r);return m!==null?m:kt(p,{...g},r)}}});return n&&(i==null||i.set(t,a)),a}function Np(t){const e=t==null?void 0:t.renderer;return Nr((t==null?void 0:t.features)||[]),new Proxy({},{get(n,s){return s==="create"?(i,a)=>Ho(i,{...a,renderer:e}):Ho(s,{renderer:e})}})}const _s=Np(Cp);_s.create("div");const ui=X({__name:"Shimmer",props:{as:{default:"p"},class:{},duration:{default:2},spread:{default:2}},setup(t){const e=t,n=hl(),s=L(()=>{var u;const l=(u=n.default)==null?void 0:u.call(n);return!l||l.length===0?"":l.map(c=>typeof c.children=="string"?c.children:"").join("")}),i=L(()=>{var l;return(((l=s.value)==null?void 0:l.length)??0)*e.spread}),a=L(()=>fl("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]",e.class)),o=L(()=>({"--spread":`${i.value}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"})),r=L(()=>_s[e.as]||_s.p);return(l,u)=>(b(),K(ea(r.value),{class:re(a.value),style:Qt(o.value),initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:Number.POSITIVE_INFINITY,duration:l.duration,ease:"linear"}},{default:M(()=>[pl(l.$slots,"default")]),_:3},8,["class","style","transition"]))}});function zp(t){const e=L(()=>{const a=[];for(const o of t.value){if(o.role!=="assistant")continue;(o.blocks||[]).forEach((l,u)=>{const c=`${o.id}-attachment-${u}`;if(l.kind==="code")a.push({id:c,messageId:o.id,type:"code",language:l.language,code:l.code});else if(l.kind==="source")a.push({id:c,messageId:o.id,type:"source",url:l.url,title:l.title,filename:l.filename,mediaType:l.mediaType});else if(l.kind==="tool"&&(l.toolName==="export_query_result"||l.toolName==="export_content")){const h=l.result;h!=null&&h.filename&&h.content!==void 0&&a.push({id:c,messageId:o.id,type:"file",filename:h.filename,result:h})}})}return a}),n=L(()=>e.value.filter(a=>a.type==="file")),s=L(()=>e.value.filter(a=>a.type==="code")),i=L(()=>e.value.filter(a=>a.type==="source"));return{attachments:e,files:n,codes:s,sources:i}}function Up(t){const e=window.atob(t),n=new Uint8Array(e.length);for(let s=0;s<e.length;s+=1)n[s]=e.charCodeAt(s);return n}function ci(){return{downloadFile:async e=>{if(e.error)return En.error(e.error),!1;try{const n=e.encoding==="base64"?new Blob([Up(e.content)],{type:e.mimeType}):new Blob([e.content],{type:e.mimeType}),s=URL.createObjectURL(n),i=document.createElement("a");return i.href=s,i.download=e.filename,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s),En.success(`Downloaded ${e.filename}`),!0}catch(n){const s=n instanceof Error?n.message:"Failed to download export file.";return En.error(s),!1}}}}const qp={class:"whitespace-pre-wrap leading-normal chat-text"},Hp=X({__name:"BlockMessageText",props:{content:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean},isUserMessage:{type:Boolean}},setup(t){const e=t,n=L(()=>!!(e.isBlockStreaming&&e.isStreaming)),s=$s(Kt(e,"content"),n);return(i,a)=>(b(),k("p",qp,D(_(s)),1))}});class di{constructor(e){We(this,"options");We(this,"tokensStable",[]);We(this,"tokensUnstable",[]);We(this,"lastUnstableCodeChunk","");We(this,"lastStableGrammarState");this.options=e}async enqueue(e){const n=(this.lastUnstableCodeChunk+e).split(`
3
3
  `),s=[];let i=[];const a=this.tokensUnstable.length;return n.forEach((o,r)=>{const l=r===n.length-1,u=this.options.highlighter.codeToTokens(o,{...this.options,grammarState:this.lastStableGrammarState}),c=u.tokens[0];l||c.push({content:`
4
- `,offset:0}),l?(i=c,this.lastUnstableCodeChunk=o):(this.lastStableGrammarState=u.grammarState,s.push(...c))}),this.tokensStable.push(...s),this.tokensUnstable=i,{recall:a,stable:s,unstable:i}}close(){const e=this.tokensUnstable;return this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0,{stable:e}}clear(){this.tokensStable=[],this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0}clone(){const e=new di(this.options);return e.lastUnstableCodeChunk=this.lastUnstableCodeChunk,e.tokensUnstable=this.tokensUnstable,e.tokensStable=this.tokensStable,e.lastStableGrammarState=this.lastStableGrammarState,e}}class Kp extends TransformStream{constructor(n){const s=new di(n),{allowRecalls:i=!1}=n;super({async transform(a,o){const{stable:r,unstable:l,recall:u}=await s.enqueue(a);i&&u>0&&o.enqueue({recall:u});for(const c of r)o.enqueue(c);if(i)for(const c of l)o.enqueue(c)},async flush(a){const{stable:o}=s.close();if(!i)for(const r of o)a.enqueue(r)}});We(this,"tokenizer");We(this,"options");this.tokenizer=s,this.options=n}}function Gp(t){return!t||Object(t)!==t}const Wp="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function Yp(t=16,e=Wp){let n="",s=t;const i=e.length;for(;s--;)n+=e[Math.random()*i|0];return n}const Zn=new WeakMap;function Xp(t){return Gp(t)?t:(Zn.has(t)||Zn.set(t,Yp()),Zn.get(t))}const Qp=X({name:"ShikiStreamRenderer",props:{stream:{type:Object,required:!0}},emits:["stream-start","stream-end"],setup(t,{emit:e}){const n=vl([]);let s=null;return Se(()=>t.stream,i=>{n.length=0,s&&s.abort(),s=new AbortController;const a=s.signal;let o=!1;i.pipeTo(new WritableStream({write(r){a.aborted||(o||(o=!0,e("stream-start")),"recall"in r?n.length-=r.recall:n.push(r))},close:()=>{a.aborted||e("stream-end")},abort:()=>{a.aborted||e("stream-end")}}),{signal:a}).catch(r=>{r.name!=="AbortError"&&console.error("Stream error:",r)})},{immediate:!0}),()=>kt("pre",{class:"shiki shiki-stream"},kt("code",we(n,i=>kt("span",{key:Xp(i),style:i.htmlStyle||Hl(i)},i.content))))}}),Zp=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(t,{emit:e}){const n=Y(0);let s=null;const i=new ReadableStream({start(o){s=o}});gl(()=>{t.code.length>n.value&&(s==null||s.enqueue(t.code.slice(n.value)),n.value=t.code.length)});const a=i.pipeThrough(new Kp({highlighter:t.highlighter,lang:t.lang,theme:t.theme,allowRecalls:!0}));return()=>kt(Qp,{stream:a,onStreamStart:()=>e("stream-start"),onStreamEnd:()=>e("stream-end")})}});let Ft=null,Jn=null;const Jp=[Ne(()=>import("./B9xm8XSJ.js"),[],import.meta.url),Ne(()=>import("./BUuSKT2f.js").then(t=>t.e),__vite__mapDeps([0,1,2]),import.meta.url),Ne(()=>import("./BUuSKT2f.js").then(t=>t.j),__vite__mapDeps([0,1,2]),import.meta.url),Ne(()=>import("./Yzrsuije.js"),[],import.meta.url),Ne(()=>import("./BUuSKT2f.js").then(t=>t.m),__vite__mapDeps([0,1,2]),import.meta.url),Ne(()=>import("./fuZLfV_i.js"),[],import.meta.url),Ne(()=>import("./BUuSKT2f.js").then(t=>t.x),__vite__mapDeps([0,1,2]),import.meta.url),Ne(()=>import("./BUuSKT2f.js").then(t=>t.y),__vite__mapDeps([0,1,2]),import.meta.url),Ne(()=>import("./BUuSKT2f.js").then(t=>t.h),__vite__mapDeps([0,1,2]),import.meta.url)],em=async t=>{if(ta(),Jn||(Jn=Kl({langs:Jp,themes:[Wl,Yl],engine:Gl()})),Ft||(Ft=await Jn),t!=null&&t.length){const e=Ft.getLoadedLanguages();await Promise.all(t.filter(n=>!e.includes(n)).map(n=>Ft.loadLanguage(n).catch(()=>{console.warn(`[useHighlighter] Unknown language: "${n}"`)})))}return Ft},tm={class:"rounded-xl border overflow-hidden shadow-sm"},nm={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},sm={class:"text-xxs font-semibold capitalize text-muted-foreground select-none"},im={class:"flex items-center gap-1 justify-center"},om={class:"overflow-x-auto px-3 py-2 chat-code-text"},am={key:1,class:"m-0"},Dn=X({__name:"BlockMessageCode",props:{id:{},code:{},language:{},class:{},meta:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean}},setup(t){const e=ta(),n=Y(null),s=t;Se(()=>s.language,async p=>{n.value=await em([p])},{immediate:!0});const{handleCopyWithKey:i,isCopied:a,getCopyIcon:o,getCopyIconClass:r,getCopyTooltip:l}=ia(),u=L(()=>!!(s.isBlockStreaming&&s.isStreaming)),c=$s(Kt(s,"code"),u),h=L(()=>{switch(s.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"sql":case"plsql":case"sqlpl":case"sqlserver":return"sql";default:return"text"}}),d=L(()=>c.value.trim().replace(/`+$/,"")),f=L(()=>`${h.value}-${e.value}`);return(p,g)=>{const m=me,v=_e;return b(),k("div",tm,[x("div",nm,[x("span",sm,D(s.language),1),S(_(Bs),null,{default:M(()=>[S(_(Os),{"as-child":""},{default:M(()=>[S(v,{variant:"ghost",size:"xxs",class:"h-6!",onClick:g[0]||(g[0]=C=>_(i)(p.id,p.code))},{default:M(()=>[x("span",im,[(b(),K(m,{key:_(a)(p.id)?"tick":"copy",name:_(o)(_(a)(p.id)),class:re(["size-3.5",_(r)(_(a)(p.id))])},null,8,["name","class"])),_(a)(p.id)?(b(),k("span",{key:0,class:re(["text-[10px] font-medium leading-none",_(r)(_(a)(p.id))])}," Copied ",2)):H("",!0)])]),_:1})]),_:1}),S(_(Fs),null,{default:M(()=>[x("p",null,D(_(l)(_(a)(p.id))),1)]),_:1})]),_:1})]),x("div",om,[n.value?(b(),K(_(Zp),{key:f.value,highlighter:n.value,code:d.value,lang:h.value,theme:_(e).value==="dark"?"catppuccin-mocha":"catppuccin-latte"},null,8,["highlighter","code","lang","theme"])):(b(),k("pre",am,[x("code",null,D(d.value),1)]))])])}}}),rm={class:"flex items-center gap-2 text-muted-foreground chat-text"},lm=X({__name:"BlockMessageLoading",props:{label:{}},setup(t){return(e,n)=>{const s=me;return b(),k("div",rm,[S(s,{name:"hugeicons:loading-03",class:"size-4 animate-spin"}),S(ui,null,{default:M(()=>[q(D(e.label||"Generating summary..."),1)]),_:1})])}}}),um={class:"rounded-xl py-2 text-destructive"},cm=X({__name:"BlockMessageError",props:{message:{}},setup(t){return(e,n)=>(b(),k("div",um,D(e.message),1))}}),dm={key:1,class:"rounded-2xl border bg-muted/40"},hm={class:"overflow-x-auto px-3 py-3 leading-6 chat-code-text"},fm=X({__name:"BlockMessageTool",props:{toolName:{},result:{},getToolComponent:{type:Function}},setup(t){const e=t,n=L(()=>e.getToolComponent(e.toolName)),s=i=>JSON.stringify(i,null,2);return(i,a)=>_(n)?(b(),K(ea(_(n)),{key:0,data:i.result},null,8,["data"])):(b(),k("div",dm,[x("pre",hm,D(s(i.result)),1)]))}}),pm={class:"inline-flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-xs"},mm={class:"min-w-0 flex-1"},gm=["href"],vm={key:1,class:"truncate font-medium text-foreground"},ym={key:2,class:"ml-2 text-xxs text-muted-foreground"},xm=X({__name:"BlockMessageSource",props:{sourceId:{},url:{},title:{},mediaType:{},filename:{}},setup(t){return(e,n)=>{const s=me;return b(),k("div",pm,[S(s,{name:e.url?"hugeicons:link-02":"hugeicons:file-02",class:"size-3.5 shrink-0 text-muted-foreground"},null,8,["name"]),x("div",mm,[e.url?(b(),k("a",{key:0,href:e.url,target:"_blank",rel:"noopener noreferrer",class:"truncate font-medium text-primary hover:underline"},D(e.title||e.url),9,gm)):(b(),k("span",vm,D(e.title||e.filename||"Source document"),1)),e.mediaType?(b(),k("span",ym,D(e.mediaType),1)):H("",!0)])])}}}),bm={key:0,class:"flex items-center gap-2 rounded-xl border border-border/60 bg-muted/30 px-3 py-2"},wm={class:"text-xs text-muted-foreground truncate"},Sm={key:1,class:"rounded-2xl border border-border/70 bg-background/80 overflow-hidden"},_m={class:"px-4 pt-4"},Tm={class:"flex items-center justify-between gap-2 mb-2"},Am={class:"flex items-center gap-2 min-w-0"},km=["title"],Cm={class:"shrink-0 text-[11px] text-muted-foreground"},Pm={class:"h-0.5 rounded-full bg-muted overflow-hidden"},Mm={class:"px-4 py-3"},Dm={class:"text-sm leading-relaxed"},Vm={key:0,class:"text-destructive ml-0.5","aria-label":"required"},Lm={key:1,class:"flex flex-col gap-3 py-1"},Em=["value","placeholder"],Rm={class:"px-4 pb-4 flex items-center justify-between gap-2"},Im={key:1},$m={class:"flex items-center gap-1.5"},Bm=X({__name:"BlockMessageQuiz",props:{toolCallId:{},context:{},questions:{}},emits:["submit"],setup(t,{emit:e}){const n=t,s=e,i=Y({}),a=Y(0),o=Y(!1),r=L(()=>n.questions[a.value]),l=L(()=>a.value===n.questions.length-1),u=L(()=>n.questions.every(V=>!V.required||d(V.id))),c=Y("");function h(){if(!r.value)return;const V=i.value[r.value.id];c.value=typeof V=="string"?V:""}function d(V){const T=i.value[V];return Array.isArray(T)?T.length>0:!!(T!=null&&T.trim())}function f(V){const T=r.value;if(!T)return!1;const w=i.value[T.id];return T.type==="multiple"?Array.isArray(w)&&w.includes(V):w===V}function p(V){const T=r.value;if(T){if(T.type==="single")i.value={...i.value,[T.id]:V},c.value="";else if(T.type==="multiple"){const w=i.value[T.id]??[],B=w.includes(V)?w.filter(E=>E!==V):[...w,V];i.value={...i.value,[T.id]:B}}}}function g(V){const T=r.value;if(!T)return;const w=V.target.value;c.value=w,i.value={...i.value,[T.id]:w}}function m(){a.value>0&&(a.value--,h())}function v(){l.value?$():(a.value++,h())}function C(){l.value?$():(a.value++,h())}function y(){return`[Quiz answers] ${n.questions.filter(T=>d(T.id)).map(T=>{const w=i.value[T.id],B=Array.isArray(w)?w.join(", "):w;return`${T.id}: ${B}`}).join(" | ")}`}function $(){u.value&&(o.value=!0,s("submit",y()))}const P=L(()=>n.questions.filter(V=>d(V.id)).map(V=>{const T=i.value[V.id];return Array.isArray(T)?T.join(", "):T}).join(" · "));return(V,T)=>{var E;const w=me,B=_e;return o.value?(b(),k("div",bm,[S(w,{name:"lucide:check-circle-2",class:"size-3.5 shrink-0 text-primary"}),x("span",wm,[T[2]||(T[2]=x("span",{class:"font-medium text-foreground"},"Answered",-1)),P.value?(b(),k(le,{key:0},[q(" · "+D(P.value),1)],64)):H("",!0)])])):V.questions.length>0?(b(),k("div",Sm,[x("div",_m,[x("div",Tm,[x("div",Am,[S(_(De),{variant:"outline",class:"text-xs px-1"},{default:M(()=>[S(w,{name:"lucide:help-circle",class:"size-3 text-primary"}),T[3]||(T[3]=q(" Clarification "))]),_:1}),V.context?(b(),k("span",{key:0,class:"text-xs text-muted-foreground truncate",title:V.context},D(V.context),9,km)):H("",!0)]),x("span",Cm,D(a.value+1)+" / "+D(V.questions.length),1)]),x("div",Pm,[x("div",{class:"h-full rounded-full bg-primary transition-all duration-300",style:Qt({width:`${(a.value+1)/V.questions.length*100}%`})},null,4)])]),x("div",Mm,[S(Zt,{name:"quiz-slide",mode:"out-in"},{default:M(()=>{var z;return[r.value?(b(),k("div",{key:r.value.id,class:"space-y-3"},[x("p",Dm,[q(D(r.value.question)+" ",1),r.value.required?(b(),k("span",Vm,"*")):H("",!0)]),(z=r.value.suggestions)!=null&&z.length?(b(),k(le,{key:0},[r.value.type==="single"?(b(),K(_(yi),{key:0,"model-value":i.value[r.value.id],"onUpdate:modelValue":T[0]||(T[0]=F=>p(String(F))),class:"flex flex-col gap-3 py-1"},{default:M(()=>[(b(!0),k(le,null,we(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[S(_(xi),{id:F,value:F},null,8,["id","value"]),S(_(Rn),{for:F,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:M(()=>[q(D(F),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"])):r.value.type==="multiple"?(b(),k("div",Lm,[(b(!0),k(le,null,we(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[S(_(Zl),{id:F,checked:f(F),"onUpdate:checked":te=>p(F)},null,8,["id","checked","onUpdate:checked"]),S(_(Rn),{for:F,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:M(()=>[q(D(F),1)]),_:2},1032,["for"])]))),128))])):(b(),K(_(yi),{key:2,"model-value":i.value[r.value.id],"onUpdate:modelValue":T[1]||(T[1]=F=>p(String(F))),class:"flex flex-col gap-3 py-1"},{default:M(()=>[(b(!0),k(le,null,we(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[S(_(xi),{id:F,value:F},null,8,["id","value"]),S(_(Rn),{for:F,class:"cursor-pointer text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:M(()=>[q(D(F),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"]))],64)):H("",!0),x("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:r.value.type==="open"?"Type your answer…":"Or type a custom answer…",onInput:g},null,40,Em)])):H("",!0)]}),_:1})]),x("div",Rm,[a.value>0?(b(),K(B,{key:0,variant:"ghost",size:"sm",class:"text-xs h-7",onClick:m},{default:M(()=>[S(w,{name:"lucide:arrow-left",class:"size-3 mr-1"}),T[4]||(T[4]=q(" Back "))]),_:1})):(b(),k("div",Im)),x("div",$m,[!((E=r.value)!=null&&E.required)&&!l.value?(b(),K(B,{key:0,variant:"ghost",size:"xs",onClick:C},{default:M(()=>T[5]||(T[5]=[q(" Skip ")])),_:1})):H("",!0),S(B,{size:"xs",disabled:l.value&&!u.value,onClick:v},{default:M(()=>[q(D(l.value?"Submit":"Next")+" ",1),l.value?(b(),K(w,{key:1,name:"lucide:send",class:"size-3 ml-1"})):(b(),K(w,{key:0,name:"lucide:arrow-right",class:"size-3 ml-1"}))]),_:1},8,["disabled"])])])])):H("",!0)}}}),Om=na(Bm,[["__scopeId","data-v-2b68c703"]]),Fm={class:"flex h-full flex-col bg-sidebar/50 z-50 p-2 gap-2"},jm={class:"flex shrink-0 items-center justify-between gap-2"},Nm={class:"flex items-center min-w-0 gap-1 flex-1"},zm={class:"text-xs"},Um={class:"flex-1 overflow-hidden flex flex-col min-h-0 relative mt-2"},qm={class:"flex-1 min-h-0 overflow-y-auto w-full relative"},Hm={key:0,class:"absolute inset-0 flex items-center justify-center p-6 z-10"},Km={class:"space-y-2"},Gm=["onClick"],Wm={class:"min-w-0 flex-1"},Ym={class:"text-xs font-medium truncate"},Xm={class:"flex items-center gap-2"},Qm={class:"min-w-0 flex-1"},Zm={class:"flex flex-wrap gap-1.5 text-xs"},Jm={class:"flex-1 overflow-y-auto px-4 space-y-4"},eg={key:0,class:"space-y-2"},tg={key:0,class:"bg-muted/50 p-3 rounded-md overflow-x-auto whitespace-pre-wrap font-mono border chat-code-text"},ng={key:1,class:"flex flex-col items-center justify-center p-5 bg-muted/20 rounded-md border border-dashed min-h-[140px]"},sg={key:1,class:"text-sm"},ig={key:2,class:"flex flex-col gap-3 p-3 bg-muted/30 rounded-md border"},og={class:"text-xs font-medium"},ag={key:0,class:"text-xs text-primary break-all flex items-center gap-1"},rg=["href"],lg={key:1,class:"text-xs text-muted-foreground"},ug={class:"flex gap-2"},cg=X({__name:"AgentAttachmentPanel",props:{messages:{}},emits:["close"],setup(t,{emit:e}){const n=t,s=e,i=L(()=>n.messages),{attachments:a,files:o,codes:r,sources:l}=zp(i),{downloadFile:u}=ci(),c=Y("all"),h=T=>({type:"file",id:T.id,name:T.filename,description:"Exported File",icon:"hugeicons:file-02",data:T.result}),d=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}),p=L(()=>({all:[...o.value.map(h),...l.value.map(d),...r.value.map(f)],files:o.value.map(h),code:r.value.map(f),links:l.value.map(d)})),g=L(()=>p.value[c.value]||[]),m=Y(!1),v=Y(null),C=T=>{if(T==null)return"—";if(T<1024)return`${T} B`;const w=["KB","MB","GB","TB"];let B=T/1024,E=0;for(;B>=1024&&E<w.length-1;)B/=1024,E+=1;return`${B.toFixed(B>=10?0:1)} ${w[E]}`},y=L(()=>v.value?v.value.type==="file"?"File":v.value.type==="code"?"Code":"Link":""),$=L(()=>{var T,w;return((T=v.value)==null?void 0:T.type)==="source"&&!!((w=v.value.data)!=null&&w.url)}),P=T=>{v.value=T,m.value=!0},V=async T=>{var w;if(T)if(T.type==="file")await u(T.data);else if(T.type==="code"){const B=T.data.code,E=new Blob([B],{type:"text/plain"}),z=URL.createObjectURL(E),F=document.createElement("a");F.href=z,F.download=`snippet-${T.id.substring(0,6)}.${T.data.language||"txt"}`,F.click(),URL.revokeObjectURL(z)}else T.type==="source"&&(w=T.data)!=null&&w.url&&window.open(T.data.url,"_blank","noopener,noreferrer")};return(T,w)=>{const B=me,E=yl;return b(),k("div",Fm,[x("div",jm,[x("div",Nm,[S(B,{name:"hugeicons:attachment",class:"size-4"}),w[6]||(w[6]=x("h3",{class:"text-sm font-semibold text-foreground"},"Attachments",-1)),x("p",zm,D(_(a).length),1)]),S(_(_e),{size:"iconMd",variant:"ghost",onClick:w[0]||(w[0]=z=>s("close"))},{default:M(()=>[S(B,{name:"lucide:x",class:"size-4"})]),_:1})]),x("div",Um,[S(_(zl),{modelValue:c.value,"onUpdate:modelValue":w[1]||(w[1]=z=>c.value=z),class:"flex-1 min-h-0"},{default:M(()=>[S(_(Ul),{class:"h-8"},{default:M(()=>[S(_(cn),{value:"all",class:"text-xs cursor-pointer"},{default:M(()=>w[7]||(w[7]=[q("All")])),_:1}),S(_(cn),{value:"files",class:"text-xs cursor-pointer"},{default:M(()=>w[8]||(w[8]=[q("Files")])),_:1}),S(_(cn),{value:"code",class:"text-xs cursor-pointer"},{default:M(()=>w[9]||(w[9]=[q("Code")])),_:1}),S(_(cn),{value:"links",class:"text-xs cursor-pointer"},{default:M(()=>w[10]||(w[10]=[q("Links")])),_:1})]),_:1}),x("div",qm,[g.value.length===0?(b(),k("div",Hm,[S(E,{title:"No items found",desc:"Add an attachment to see it here."})])):H("",!0),(b(),k(le,null,we(["all","files","code","links"],z=>S(_(ql),{key:z,value:z,class:"h-full mt-0 focus-visible:ring-0"},{default:M(()=>[x("div",Km,[(b(!0),k(le,null,we(p.value[z],F=>(b(),k("div",{key:F.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:te=>P(F)},[S(B,{name:F.icon,class:"size-5!"},null,8,["name"]),x("div",Wm,[x("p",Ym,D(F.name),1),x("p",{class:re(["text-xxs text-muted-foreground truncate",F.type==="source"?"text-primary/70":""])},D(F.description),3)]),S(B,{name:"hugeicons:view",class:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground"})],8,Gm))),128))])]),_:2},1032,["value"])),64))])]),_:1},8,["modelValue"])]),S(_(xl),{open:m.value,"onUpdate:open":w[5]||(w[5]=z=>m.value=z)},{default:M(()=>[S(_(bl),{class:"max-w-[50vw]! w-full max-h-[70vh] p-0 flex flex-col overflow-hidden"},{default:M(()=>{var z,F,te;return[S(_(wl),{class:"p-4 pb-2 text-left"},{default:M(()=>{var A;return[x("div",Xm,[S(B,{name:((A=v.value)==null?void 0:A.icon)||"hugeicons:file-02",class:"size-5!"},null,8,["name"]),x("div",Qm,[S(_(Sl),{class:"truncate flex items-center gap-2"},{default:M(()=>{var I,N,G,W,U,Q;return[q(D(((I=v.value)==null?void 0:I.name)||"Attachment Preview")+" ",1),x("div",Zm,[S(_(De),{variant:"secondary",class:"h-5 px-1.5"},{default:M(()=>[q(D(y.value),1)]),_:1}),((N=v.value)==null?void 0:N.type)==="file"?(b(),K(_(De),{key:0,variant:"outline",class:"h-5 px-1.5"},{default:M(()=>[q(D(v.value.data.format||"file"),1)]),_:1})):H("",!0),((G=v.value)==null?void 0:G.type)==="file"?(b(),K(_(De),{key:1,variant:"outline",class:"h-5 px-1.5"},{default:M(()=>[q(D(C(v.value.data.fileSize)),1)]),_:1})):H("",!0),((W=v.value)==null?void 0:W.type)==="code"?(b(),K(_(De),{key:2,variant:"outline",class:"h-5 px-1.5"},{default:M(()=>[q(D(v.value.data.language||"text"),1)]),_:1})):H("",!0),((U=v.value)==null?void 0:U.type)==="source"&&((Q=v.value.data)!=null&&Q.mediaType)?(b(),K(_(De),{key:3,variant:"outline",class:"h-5 px-1.5"},{default:M(()=>[q(D(v.value.data.mediaType),1)]),_:1})):H("",!0)])]}),_:1}),S(_(_l),{class:"text-sm"},{default:M(()=>w[11]||(w[11]=[q(" Preview attachment details and content. ")])),_:1})])])]}),_:1}),x("div",Jm,[((z=v.value)==null?void 0:z.type)==="file"?(b(),k("div",eg,[v.value.data.encoding==="utf8"?(b(),k("div",tg,D(v.value.data.content),1)):(b(),k("div",ng,[S(B,{name:"hugeicons:file-unknown",class:"size-12 text-muted-foreground/50 mb-3"}),w[12]||(w[12]=x("p",{class:"text-foreground text-sm font-medium"}," Binary file format ",-1)),w[13]||(w[13]=x("p",{class:"text-xs text-muted-foreground text-center mt-1"}," Preview is not available for this file type. Download to view. ",-1))]))])):((F=v.value)==null?void 0:F.type)==="code"?(b(),k("div",sg,[S(_(Dn),{id:v.value.data.id,code:v.value.data.code,language:v.value.data.language,"is-streaming":!1,"is-block-streaming":!1},null,8,["id","code","language"])])):((te=v.value)==null?void 0:te.type)==="source"?(b(),k("div",ig,[x("div",null,[w[14]||(w[14]=x("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," Title ",-1)),x("p",og,D(v.value.data.title||v.value.data.filename||"Untitled Resource"),1)]),x("div",null,[w[15]||(w[15]=x("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," URL ",-1)),v.value.data.url?(b(),k("p",ag,[x("a",{href:v.value.data.url,target:"_blank",class:"hover:underline"},D(v.value.data.url),9,rg),S(B,{name:"hugeicons:link-square-02",class:"size-3 shrink-0"})])):(b(),k("p",lg," No URL provided. "))])])):H("",!0)]),S(_(Tl),{class:"p-4 flex justify-end pt-0"},{default:M(()=>{var A;return[S(_(_e),{variant:"outline",size:"sm",onClick:w[2]||(w[2]=I=>m.value=!1)},{default:M(()=>w[16]||(w[16]=[q(" Close ")])),_:1}),x("div",ug,[((A=v.value)==null?void 0:A.type)==="source"?(b(),K(_(_e),{key:0,size:"sm",disabled:!$.value,onClick:w[3]||(w[3]=I=>V(v.value))},{default:M(()=>[w[17]||(w[17]=q(" Open Link ")),S(B,{name:"hugeicons:link-square-02",class:"size-3 ml-2"})]),_:1},8,["disabled"])):(b(),K(_(_e),{key:1,size:"sm",onClick:w[4]||(w[4]=I=>V(v.value))},{default:M(()=>[w[18]||(w[18]=q(" Download ")),S(B,{name:"hugeicons:download-04",class:"size-3"})]),_:1}))])]}),_:1})]}),_:1})]),_:1},8,["open"])])}}}),Ts=[{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."}],dg=t=>{const e=new Set(t);return Ts.filter(n=>e.has(n.id))},hg={class:"w-full relative"},fg={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"},pg=["id","aria-selected","onMouseenter","onClick"],mg={class:"min-w-0 flex-1"},gg={class:"flex items-center gap-2"},vg={class:"text-xs font-medium text-foreground"},yg={class:"mt-1 block text-xs text-muted-foreground"},xg={key:0,class:"rounded-xl px-3 py-5 text-center text-[11px] text-muted-foreground"},bg={class:"dark:bg-sidebar rounded-3xl border shadow-xs p-3 px-2 pb-2 flex flex-col gap-1 relative z-40"},wg={key:0,class:"flex flex-wrap gap-2 pb-1"},Sg=["aria-label","onClick"],_g={class:"flex items-center justify-between px-1"},Tg={class:"flex items-center gap-1"},Ag={class:"relative w-fit"},kg={class:"flex items-center gap-3"},vn="agent-command-listbox",Ko="agent-command-status",Cg=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(t,{expose:e,emit:n}){const s=t,i=n,a=Y(s.modelValue),o=Y(0),r=Y("");Se(()=>s.modelValue,A=>{a.value=A});const l=Y(null),u=L({get:()=>s.selectedCommandOptions,set:A=>i("update:selectedCommandOptions",A)}),c=L(()=>dg(u.value)),h=()=>{const A=l.value;if(!A)return null;if(A instanceof HTMLTextAreaElement)return A;if(typeof A=="object"&&"$el"in A&&A.$el instanceof HTMLElement){const I=A.$el;return I instanceof HTMLTextAreaElement?I:I.querySelector("textarea")}return A instanceof HTMLElement?A.querySelector("textarea"):null},d=()=>{const A=h();A==null||A.focus()};e({focusInput:d});const f=L(()=>{const A=h(),I=(A==null?void 0:A.selectionStart)??a.value.length;return a.value.slice(0,I).match(/(?:^|\s)\/([a-z0-9_-]*)$/i)}),p=L(()=>{var A,I;return((I=(A=f.value)==null?void 0:A[1])==null?void 0:I.toLowerCase())||""}),g=L(()=>f.value?f.value[0]:""),m=L(()=>{const A=p.value.trim();return f.value?A?Ts.filter(I=>[I.label,I.toolName,I.description,I.category].join(" ").toLowerCase().includes(A)):Ts:[]}),v=L(()=>!!f.value&&g.value!==r.value),C=L(()=>m.value[o.value]||null),y=L(()=>v.value?m.value.length===0?"No matching agent tools. Keep typing to filter or press Escape to close.":`${m.value.length} agent tools available. Use arrow keys to move, Enter or Tab to insert, and Escape to close.`:"");Se(m,A=>{if(A.length===0){o.value=0;return}o.value>=A.length&&(o.value=0)}),Se(g,A=>{A||(r.value="")});const $=A=>{const I=A.target.value;a.value=I,r.value&&r.value!==g.value&&(r.value=""),i("update:modelValue",I)},P=async()=>{r.value=g.value,o.value=0,await Ie(),d()},V=A=>{u.value.includes(A.id)||(u.value=[...u.value,A.id])},T=A=>{u.value=u.value.filter(I=>I!==A)},w=async A=>{const I=h(),N=(I==null?void 0:I.selectionStart)??a.value.length,G=a.value.slice(0,N),W=a.value.slice(N);if(!G.match(/(?:^|\s)\/([a-z0-9_-]*)$/i))return;const Q=G.lastIndexOf("/"),Z=a.value.slice(0,Q);let J=`${Z}${W}`;Z.trim()||(J=J.trimStart());const ge=Math.min(Z.length,J.length);a.value=J,i("update:modelValue",J),V(A),o.value=0,r.value="",await Ie();const ue=h();ue==null||ue.focus(),ue==null||ue.setSelectionRange(ge,ge)},B=A=>{if(v.value){if(A.key==="Escape"){A.preventDefault(),P();return}if(m.value.length>0){if(A.key==="ArrowDown"){A.preventDefault(),o.value=(o.value+1)%m.value.length;return}if(A.key==="ArrowUp"){A.preventDefault(),o.value=(o.value-1+m.value.length)%m.value.length;return}if(A.key==="Home"){A.preventDefault(),o.value=0;return}if(A.key==="End"){A.preventDefault(),o.value=m.value.length-1;return}if(A.key==="Enter"||A.key==="Tab"){A.preventDefault();const I=C.value;I&&w(I);return}}}i("keydown",A)},E=A=>{A==null||A.preventDefault(),i("submit",typeof A=="object"&&A!==null?A:void 0)},z=A=>{if(s.isLoading){A==null||A.preventDefault(),i("stop");return}E(A)},F=L({get:()=>s.provider,set:A=>i("update:provider",A)}),te=L({get:()=>s.model,set:A=>i("update:model",A)});return(A,I)=>{const N=me,G=Ql,W=_e;return b(),k("div",hg,[v.value?(b(),k("div",fg,[I[4]||(I[4]=x("div",{class:"border-b border-border/50 px-3 py-2"},[x("p",{class:"text-xs font-medium"},"Agent tools"),x("p",{class:"mt-1 text-xs text-muted-foreground"},[q(" Type after "),x("span",{class:"font-medium text-foreground"},"/"),q(" to filter. ")])],-1)),x("div",{id:vn,role:"listbox","aria-label":"Agent tools",class:"max-h-[260px] overflow-y-auto px-2 py-2"},[(b(!0),k(le,null,we(m.value,(U,Q)=>(b(),k("button",{id:`${vn}-${U.id}`,key:U.id,type:"button",role:"option","aria-selected":Q===o.value,class:re(["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",Q===o.value?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"]),onMouseenter:Z=>o.value=Q,onClick:Z=>w(U)},[S(N,{name:U.icon,class:"mt-0.5 size-[18px] shrink-0"},null,8,["name"]),x("span",mg,[x("span",gg,[x("span",vg,D(U.label),1)]),x("span",yg,D(U.description),1)]),x("div",null,[c.value.find(Z=>Z.id===U.id)?(b(),K(N,{key:0,name:"hugeicons:checkmark-circle-01",class:"size-4 mt-0.5 text-muted-foreground cursor-pointer"})):H("",!0)])],42,pg))),128)),m.value.length===0?(b(),k("div",xg,I[3]||(I[3]=[q(" No matching tools. Try "),x("span",{class:"font-medium text-foreground"},"/render",-1),q(" or "),x("span",{class:"font-medium text-foreground"},"/describe",-1),q(". ")]))):H("",!0)])])):H("",!0),x("div",bg,[c.value.length>0?(b(),k("div",wg,[(b(!0),k(le,null,we(c.value,U=>(b(),k("div",{key:U.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"},[S(N,{name:U.icon,class:"size-3.5 text-muted-foreground"},null,8,["name"]),x("span",null,D(U.label),1),x("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 ${U.label}`,onClick:Q=>T(U.id)},[S(N,{name:"lucide:x",class:"size-3"})],8,Sg)]))),128))])):H("",!0),S(G,{ref_key:"textareaRef",ref:l,modelValue:a.value,"onUpdate:modelValue":I[0]||(I[0]=U=>a.value=U),disabled:!A.hasApiKey||A.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":v.value?vn:void 0,"aria-describedby":Ko,"aria-activedescendant":C.value?`${vn}-${C.value.id}`:void 0,"aria-expanded":v.value,onInput:$,onKeydown:B},null,8,["modelValue","disabled","aria-controls","aria-activedescendant","aria-expanded"]),x("p",{id:Ko,class:"sr-only","aria-live":"polite"},D(y.value),1),x("div",_g,[x("div",Tg,[x("div",Ag,[S(Al,{provider:F.value,"onUpdate:provider":I[1]||(I[1]=U=>F.value=U),model:te.value,"onUpdate:model":I[2]||(I[2]=U=>te.value=U),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"])])]),x("div",kg,[S(W,{size:"iconMd",type:"button",class:"rounded-full shadow bg-foreground text-background hover:bg-foreground disabled disabled:bg-muted disabled:text-muted-foreground",disabled:!a.value.trim()&&!A.isLoading||!A.hasApiKey,onClick:z},{default:M(()=>[S(N,{name:A.isLoading?"lucide:square":"lucide:arrow-up",class:re(["size-4 stroke-[2]",A.isLoading?"fill-current":""])},null,8,["name","class"])]),_:1},8,["disabled"])])])])])}}}),Pg={class:"flex items-center justify-between px-4 mt-2 text-[12px] text-muted-foreground relative z-30"},Mg={class:"flex items-center gap-4"},Dg={class:"flex items-center gap-1"},Vg={class:"flex items-center gap-1.5"},Lg={class:"flex items-center gap-1.5"},Eg=X({__name:"AgentChatStatusBar",props:{modelLabel:{},isLoading:{type:Boolean},showReasoning:{type:Boolean}},emits:["update:showReasoning"],setup(t,{emit:e}){const n=e;return(s,i)=>{const a=me,o=kl;return b(),k("div",Pg,[x("div",Mg,[x("div",Dg,[S(a,{name:"hugeicons:ai-brain-05",class:"size-3.5 stroke-[1.5]"}),i[1]||(i[1]=x("span",null,"Reasoning",-1)),S(o,{"model-value":s.showReasoning,"aria-label":"Toggle reasoning",class:"cursor-pointer","onUpdate:modelValue":i[0]||(i[0]=r=>n("update:showReasoning",!!r))},null,8,["model-value"])]),x("div",Vg,[S(a,{name:"hugeicons:robotic",class:"size-3.5 stroke-[1.5]"}),x("span",null,D(s.modelLabel),1)])]),x("div",Lg,[S(a,{name:s.isLoading?"hugeicons:loading-03":"hugeicons:checkmark-circle-01",class:re(["size-3.5 stroke-[1.5]",s.isLoading?"animate-spin":""])},null,8,["name","class"]),x("span",null,D(s.isLoading?"Streaming":"Ready"),1)])])}}}),Rg={class:"w-full py-2"},Ig={class:"relative w-full max-w-3xl mx-auto flex flex-col px-4"},$g={key:0,class:"absolute -top-12 left-1/2 transform -translate-x-1/2 z-20"},Bg=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(t,{expose:e,emit:n}){const s=t,i=n,a=L({get:()=>s.modelValue,set:d=>i("update:modelValue",d)}),o=L({get:()=>s.provider,set:d=>i("update:provider",d)}),r=L({get:()=>s.model,set:d=>i("update:model",d)}),l=L({get:()=>s.selectedCommandOptions,set:d=>i("update:selectedCommandOptions",d)}),u=L(()=>`${s.provider} / ${s.model}`),c=Y(null);return e({focusInput:()=>{var d;(d=c.value)==null||d.focusInput()}}),(d,f)=>(b(),k("footer",Rg,[x("div",Ig,[S(Zt,{"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:M(()=>[d.showScrollButton?(b(),k("div",$g,[x("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]=p=>i("scrollToBottom"))},[S(_(me),{name:"lucide:arrow-down",class:"size-4 shrink-0"})])])):H("",!0)]),_:1}),S(Cg,{ref_key:"inputRef",ref:c,modelValue:a.value,"onUpdate:modelValue":f[1]||(f[1]=p=>a.value=p),provider:o.value,"onUpdate:provider":f[2]||(f[2]=p=>o.value=p),model:r.value,"onUpdate:model":f[3]||(f[3]=p=>r.value=p),"selected-command-options":l.value,"onUpdate:selectedCommandOptions":f[4]||(f[4]=p=>l.value=p),"is-loading":d.isLoading,"has-api-key":d.hasApiKey,onSubmit:f[5]||(f[5]=p=>i("submit",p)),onStop:f[6]||(f[6]=p=>i("stop")),onKeydown:f[7]||(f[7]=p=>i("keydown",p))},null,8,["modelValue","provider","model","selected-command-options","is-loading","has-api-key"]),S(Eg,{"model-label":u.value,"is-loading":d.isLoading,"show-reasoning":d.showReasoning,"onUpdate:showReasoning":f[8]||(f[8]=p=>i("update:showReasoning",p))},null,8,["model-label","is-loading","show-reasoning"])])]))}}),T0=""+new URL("logo.BsJ2Dfin.png",import.meta.url).href,Og={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},Fg={class:"flex flex-wrap items-center gap-2"},jg={key:0,class:"rounded-2xl border bg-background/80 px-3 py-3 text-sm"},Ng={key:1,class:"space-y-3"},zg={class:"flex flex-wrap items-center gap-2"},Ug={key:0,class:"text-xs text-muted-foreground"},qg={class:"mt-3 text-sm leading-6"},Hg={key:0,class:"mt-3 rounded-xl border bg-muted/30"},Kg={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},Gg=X({__name:"AgentAnomalyBlock",props:{data:{}},setup(t){const e={high:"destructive",medium:"secondary",low:"outline"},n=s=>e[s];return(s,i)=>{const a=De;return b(),k("div",Og,[x("div",Fg,[S(a,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(" Clean Score "+D(s.data.cleanScore)+"/100 ",1)]),_:1}),S(a,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(D(s.data.scannedRows)+" rows scanned ",1)]),_:1})]),s.data.issues.length===0?(b(),k("div",jg," No anomalies were detected in the requested checks. ")):(b(),k("div",Ng,[(b(!0),k(le,null,we(s.data.issues,(o,r)=>(b(),k("div",{key:`${o.type}-${o.column||r}`,class:"rounded-2xl border bg-background/90 p-3"},[x("div",zg,[S(a,{variant:n(o.severity),class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(D(o.severity.toUpperCase()),1)]),_:2},1032,["variant"]),S(a,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(D(o.type),1)]),_:2},1024),o.column?(b(),k("span",Ug,D(o.column),1)):H("",!0)]),x("p",qg,D(o.description),1),o.fixSql?(b(),k("details",Hg,[i[0]||(i[0]=x("summary",{class:"cursor-pointer px-3 py-2 text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground"}," Fix suggestion ",-1)),x("pre",Kg,D(o.fixSql),1)])):H("",!0)]))),128))]))])}}}),Wg={class:"space-y-2"},Yg={class:"flex flex-wrap justify-start gap-2"},Xg=X({__name:"AgentApprovalBlock",props:{toolName:{},input:{},approvalId:{}},emits:["approve","deny"],setup(t,{emit:e}){const n=t,s=e,i=L(()=>"sql"in n.input&&typeof n.input.sql=="string"?n.input.sql:JSON.stringify(n.input,null,2));return(a,o)=>{const r=Dn,l=_e;return b(),k("div",Wg,[o[4]||(o[4]=x("div",{class:""},[x("div",{class:"text-xs font-medium"},"Approval Required"),x("p",{class:"text-xs text-muted-foreground"}," *This action needs confirmation before execution. ")],-1)),S(r,{id:n.approvalId,code:_(i)||"",language:"sql"},null,8,["id","code"]),x("div",Yg,[S(l,{variant:"outline",size:"xs",class:"rounded-xl font-normal",onClick:o[0]||(o[0]=u=>s("deny",a.approvalId))},{default:M(()=>o[2]||(o[2]=[q(" Cancel ")])),_:1}),S(l,{size:"xs",class:"rounded-xl font-normal",onClick:o[1]||(o[1]=u=>s("approve",a.approvalId))},{default:M(()=>o[3]||(o[3]=[q(" Confirm ")])),_:1})])])}}}),Qg={class:"flex items-start justify-between gap-3"},Zg={class:"space-y-2 min-w-0"},Jg={class:"flex items-center gap-2"},ev={class:"text-sm font-medium"},tv={class:"text-sm leading-6"},nv={key:0,class:"space-y-2"},sv={class:"flex flex-wrap gap-1"},iv=X({__name:"AgentDescribeBlock",props:{data:{}},setup(t){const e=t,n=L(()=>[["name","Name"],["type","Type"],["nullable","Nullable"],["pk","PK"],["fk","FK"],["references","References"],["description","Description"]].map(([a,o])=>({originalName:a,queryFieldName:a,aliasFieldName:o,isPrimaryKey:!1,isForeignKey:!1,canMutate:!1,type:"text",tableName:""}))),s=L(()=>e.data.columns.map(a=>({name:a.name,type:a.type,nullable:a.isNullable?"Yes":"No",pk:a.isPrimaryKey?"Yes":"No",fk:a.isForeignKey?"Yes":"No",references:a.referencesTable||"—",description:a.description||"—"}))),i=L(()=>{const u=48+s.value.length*32;return Math.max(120,Math.min(u,360))});return(a,o)=>{const r=me,l=De;return b(),k(le,null,[x("div",Qg,[x("div",Zg,[x("div",Jg,[S(r,{name:"hugeicons:grid-table",class:"size-4 text-primary"}),x("div",ev,D(a.data.tableName),1)]),x("p",tv,D(a.data.summary),1)]),S(l,{variant:"outline",class:"shrink-0"},{default:M(()=>[q(D(a.data.columns.length)+" columns ",1)]),_:1})]),x("div",{class:"overflow-hidden rounded-lg border",style:Qt({height:`${_(i)}px`})},[S(js,{columns:_(n),data:_(s),"column-key-by":"field","has-hash-index":!1,class:"h-full w-full"},null,8,["columns","data"])],4),a.data.relatedTables.length>0?(b(),k("div",nv,[o[0]||(o[0]=x("div",{class:"text-[11px] font-medium text-muted-foreground"}," Related Tables ",-1)),x("div",sv,[(b(!0),k(le,null,we(a.data.relatedTables,u=>(b(),K(l,{key:u,variant:"outline",class:"text-xxs"},{default:M(()=>[q(D(u),1)]),_:2},1024))),128))])])):H("",!0)],64)}}}),ov={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},av={class:"flex flex-wrap items-center gap-2"},rv={class:"text-sm leading-6 text-foreground/90"},lv={key:0,class:"space-y-2"},uv={class:"space-y-2 text-sm leading-6"},cv={class:"rounded-2xl border bg-background/90"},dv={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},hv=X({__name:"AgentExplainBlock",props:{data:{}},setup(t){return(e,n)=>{const s=De;return b(),k("div",ov,[x("div",av,[S(s,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(D(e.data.slowestNode),1)]),_:1}),S(s,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(" Cost "+D(e.data.estimatedCost.toFixed(2)),1)]),_:1})]),x("p",rv,D(e.data.summary),1),e.data.suggestions.length>0?(b(),k("div",lv,[n[0]||(n[0]=x("div",{class:"text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground"}," Suggestions ",-1)),x("ul",uv,[(b(!0),k(le,null,we(e.data.suggestions,i=>(b(),k("li",{key:i,class:"rounded-2xl border bg-background/80 px-3 py-2"},D(i),1))),128))])])):H("",!0),x("details",cv,[n[1]||(n[1]=x("summary",{class:"cursor-pointer px-3 py-2 text-sm font-medium"}," Raw EXPLAIN output ",-1)),x("pre",dv,D(e.data.rawPlan),1)])])}}}),fv=["disabled"],pv={class:"flex items-center min-w-0 gap-2 flex-1"},mv={class:"flex flex-col"},gv={class:"truncate text-sm leading-4 font-normal text-foreground"},vv={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},yv={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},Go=X({__name:"AgentExportFileBlock",props:{data:{}},setup(t){const e=t,n=Xo("activeExportPreview"),{downloadFile:s}=ci(),i=()=>{n&&(n.value=e.data)};L(()=>{switch(e.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 a=L(()=>{const r=e.data.fileSize;return pa(r)});L(()=>e.data.error?e.data.error:"Preview available before download");const o=async()=>{await s(e.data)};return(r,l)=>{const u=me,c=_e;return b(),k("button",{type:"button",class:re(["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",e.data.error?"cursor-not-allowed opacity-80":"cursor-pointer"]),disabled:!!e.data.error,onClick:i},[x("div",pv,[S(u,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),x("div",mv,[x("h3",gv,D(e.data.filename),1),e.data.preview.truncated?(b(),k("p",vv," First "+D(e.data.preview.rows.length)+" rows ",1)):(b(),k("p",yv," size: "+D(a.value)+" • type: "+D(e.data.format),1))])]),S(c,{disabled:!!e.data.error,size:"xs",variant:"outline"},{default:M(()=>[l[0]||(l[0]=q(" view ")),S(u,{name:"lucide:eye",class:"size-3"})]),_:1},8,["disabled"]),S(c,{onClick:Cl(o,["stop"]),disabled:!!e.data.error,size:"xs",variant:"outline"},{default:M(()=>[l[1]||(l[1]=q(" Download ")),S(u,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"])],10,fv)}}}),xv={class:"overflow-hidden mb-1"},bv={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},wv={class:"my-1"},hi=X({__name:"AgentToolSqlPreview",props:{id:{},sql:{},label:{default:"View SQL"},defaultOpen:{type:Boolean,default:!1}},setup(t){const e=t,n=Y(!1);function s(o){const r=o;r.style.height="0",r.style.opacity="0",requestAnimationFrame(()=>{r.style.height=r.scrollHeight+"px",r.style.opacity="1"})}function i(o){o.style.height="auto"}function a(o){const r=o;r.style.height=r.scrollHeight+"px",r.style.opacity="1",requestAnimationFrame(()=>{r.style.height="0",r.style.opacity="0"})}return(o,r)=>{const l=me,u=Dn;return b(),k("div",xv,[x("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:r[0]||(r[0]=c=>n.value=!_(n))},[q(D(e.label)+" ",1),S(l,{name:"lucide:chevron-down",class:re(["ml-auto size-4 transition-transform duration-300",{"rotate-180":_(n)}])},null,8,["class"])]),S(Zt,{onEnter:s,onAfterEnter:i,onLeave:a},{default:M(()=>[_(n)?(b(),k("div",bv,[x("div",wv,[S(u,{id:e.id,code:e.sql,language:"sql"},null,8,["id","code"])])])):H("",!0)]),_:1})])}}}),Sv={class:"space-y-3 rounded-xl border border-border/70 bg-muted/20 p-4"},_v={class:"flex items-start justify-between gap-3"},Tv={class:"text-sm leading-6 text-foreground/90"},Av=X({__name:"AgentQueryBlock",props:{data:{}},setup(t){const e=t,n=L(()=>`agent-query-${e.data.sql}`);return(s,i)=>{const a=De;return b(),k("div",Sv,[x("div",_v,[x("p",Tv,D(s.data.explanation),1),S(a,{variant:s.data.isMutation?"destructive":"secondary",class:"shrink-0 text-xxs"},{default:M(()=>[q(D(s.data.isMutation?"MUTATION":"READ ONLY"),1)]),_:1},8,["variant"])]),S(hi,{id:_(n),sql:s.data.sql,label:s.data.isMutation?"Review SQL before approval":"View SQL","default-open":s.data.isMutation},null,8,["id","sql","label","default-open"])])}}}),kv={class:"overflow-hidden"},Cv={key:1,class:""},Pv={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},Mv={class:"mt-2 border-l-2 border-border pl-3 py-1 text-foreground/80 opacity-70 chat-text"},Dv=X({__name:"AgentReasoningBlock",props:{content:{},isStreaming:{type:Boolean}},setup(t){const e=t,n=Kt(e,"isStreaming"),s=$s(Kt(e,"content"),n),i=Y(!1);Se(()=>e.isStreaming,l=>{l?i.value=!0:i.value=!1},{immediate:!0});function a(l){const u=l;u.style.height="0",u.style.opacity="0",requestAnimationFrame(()=>{u.style.height=u.scrollHeight+"px",u.style.opacity="1"})}function o(l){l.style.height="auto"}function r(l){const u=l;u.style.height=u.scrollHeight+"px",u.style.opacity="1",requestAnimationFrame(()=>{u.style.height="0",u.style.opacity="0"})}return(l,u)=>{const c=me;return b(),k("div",kv,[x("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:u[0]||(u[0]=h=>i.value=!_(i))},[S(c,{name:"hugeicons:ai-brain-05",class:re(["size-3.5! shrink-0",{"animate-pulse text-primary":l.isStreaming}])},null,8,["class"]),l.isStreaming?(b(),K(ui,{key:0,duration:1},{default:M(()=>u[1]||(u[1]=[q("Reasoning")])),_:1})):(b(),k("span",Cv," Reasoning ")),S(c,{name:"lucide:chevron-down",class:re(["ml-auto size-4 transition-transform duration-300",{"rotate-180":_(i)}])},null,8,["class"])]),S(Zt,{onEnter:a,onAfterEnter:o,onLeave:r},{default:M(()=>[_(i)?(b(),k("div",Pv,[x("div",Mv,[S(sa,{content:_(s),"is-streaming":l.isStreaming,"is-block-streaming":l.isStreaming,"is-user-message":!1},null,8,["content","is-streaming","is-block-streaming"])])])):H("",!0)]),_:1})])}}}),Vv={key:1,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},Lv={class:"text-xs text-muted-foreground mt-1"},Ev=X({__name:"AgentTableBlock",props:{data:{}},setup(t){const e=t,n=L(()=>(e.data.columns??[]).map(o=>({originalName:o.name,queryFieldName:o.name,aliasFieldName:o.name,isPrimaryKey:!1,isForeignKey:!1,canMutate:!1,type:o.type,tableName:""}))),s=L(()=>e.data.rows??[]),i=L(()=>`agent-render-table-${e.data.sql||""}`),a=L(()=>{const c=48+s.value.length*32;return Math.max(120,Math.min(c,420))});return(o,r)=>(b(),k(le,null,[o.data.sql?(b(),K(hi,{key:0,id:_(i),sql:o.data.sql,label:"View SQL"},null,8,["id","sql"])):H("",!0),o.data.truncated?(b(),k("div",Vv," Showing only the first "+D(o.data.rowCount)+" rows. ",1)):H("",!0),x("div",{class:"overflow-hidden rounded-lg border max-h-96",style:Qt({height:`${_(a)}px`})},[S(js,{columns:_(n),data:_(s),"column-key-by":"field","has-hash-index":!1,class:"h-full w-full"},null,8,["columns","data"])],4),x("div",Lv," Showing "+D(_(s).length)+" row"+D(_(s).length===1?"":"s"),1)],64))}}),Rv={class:"flex flex-wrap items-center justify-between gap-2"},Iv={class:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground"},$v={class:"text-xs text-muted-foreground"},Bv={key:0,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},Ov={class:"overflow-hidden rounded-xl border bg-background/90 p-2 pt-8"},Fv={class:"agent-chart-container"},jv=X({__name:"AgentVisualizeTableBlock",props:{data:{}},setup(t){fa([ku,Cu,Pu,Zu,ic,Mu,Du,Vu]);const e=t,n=L(()=>`agent-visualize-table-${e.data.chartType}-${e.data.sql}`),s=L(()=>e.data.chartType.replace("_"," ")),i=L(()=>e.data.chartType==="pie"?{tooltip:{trigger:"item"},legend:{bottom:0},series:[{type:"pie",radius:["35%","68%"],data:e.data.points.map(a=>({name:a.label,value:a.y}))}]}:e.data.chartType==="scatter"?{tooltip:{trigger:"item"},grid:{left:16,right:16,top:24,bottom:24,containLabel:!0},xAxis:{type:"value",name:e.data.xField},yAxis:{type:"value",name:e.data.yField},series:[{type:"scatter",symbolSize:10,data:e.data.points.map(a=>[a.x,a.y])}]}:{tooltip:{trigger:"axis"},grid:{left:16,right:16,top:24,bottom:24,containLabel:!0},xAxis:{type:"category",name:e.data.xField,data:e.data.points.map(a=>a.label),axisLabel:{hideOverlap:!0}},yAxis:{type:"value",name:e.data.yField},series:[{type:e.data.chartType,smooth:e.data.chartType==="line",data:e.data.points.map(a=>a.y)}]});return(a,o)=>{const r=De;return b(),k(le,null,[x("div",Rv,[x("div",Iv,[S(r,{variant:"secondary",class:"uppercase tracking-[0.16em]"},{default:M(()=>[q(D(_(s)),1)]),_:1}),a.data.xField?(b(),K(r,{key:0,variant:"outline"},{default:M(()=>[q(" X: "+D(a.data.xField),1)]),_:1})):H("",!0),a.data.yField?(b(),K(r,{key:1,variant:"outline"},{default:M(()=>[q(" Y: "+D(a.data.yField),1)]),_:1})):H("",!0)]),x("div",$v,D(a.data.rowCount)+" point"+D(a.data.rowCount===1?"":"s"),1)]),S(hi,{id:_(n),sql:a.data.sql,label:"View SQL"},null,8,["id","sql"]),a.data.truncated?(b(),k("div",Bv," Showing only the first "+D(a.data.rowCount)+" points. ",1)):H("",!0),x("div",Ov,[x("div",Fv,[S(_(Lu),{option:_(i),autoresize:"",class:"agent-chart"},null,8,["option"])])])],64)}}}),Nv=na(jv,[["__scopeId","data-v-8ea150a2"]]),zv={class:"min-w-0 flex-1 overflow-hidden"};const Uv={class:"flex items-center gap-1 justify-center"},qv=X({__name:"AgentMessageBubble",props:{message:{},getToolComponent:{type:Function},showReasoning:{type:Boolean},isStreaming:{type:Boolean},highlightedResponseId:{},registerMessageElement:{type:Function}},emits:["approval","edit","quiz-submit"],setup(t,{emit:e}){const n=t,s=e,{handleCopyWithKey:i,isCopied:a,getCopyIcon:o,getCopyIconClass:r,getCopyTooltip:l}=ia(),u=L(()=>n.message.role==="user"),c=d=>{u.value||!n.registerMessageElement||n.registerMessageElement(n.message.id,d)},h=L(()=>(n.message.blocks??[]).map(d=>d.kind==="text"||d.kind==="markdown"?d.content:d.kind==="code"?d.code:"").filter(Boolean).join(`
4
+ `,offset:0}),l?(i=c,this.lastUnstableCodeChunk=o):(this.lastStableGrammarState=u.grammarState,s.push(...c))}),this.tokensStable.push(...s),this.tokensUnstable=i,{recall:a,stable:s,unstable:i}}close(){const e=this.tokensUnstable;return this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0,{stable:e}}clear(){this.tokensStable=[],this.tokensUnstable=[],this.lastUnstableCodeChunk="",this.lastStableGrammarState=void 0}clone(){const e=new di(this.options);return e.lastUnstableCodeChunk=this.lastUnstableCodeChunk,e.tokensUnstable=this.tokensUnstable,e.tokensStable=this.tokensStable,e.lastStableGrammarState=this.lastStableGrammarState,e}}class Kp extends TransformStream{constructor(n){const s=new di(n),{allowRecalls:i=!1}=n;super({async transform(a,o){const{stable:r,unstable:l,recall:u}=await s.enqueue(a);i&&u>0&&o.enqueue({recall:u});for(const c of r)o.enqueue(c);if(i)for(const c of l)o.enqueue(c)},async flush(a){const{stable:o}=s.close();if(!i)for(const r of o)a.enqueue(r)}});We(this,"tokenizer");We(this,"options");this.tokenizer=s,this.options=n}}function Gp(t){return!t||Object(t)!==t}const Wp="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function Yp(t=16,e=Wp){let n="",s=t;const i=e.length;for(;s--;)n+=e[Math.random()*i|0];return n}const Zn=new WeakMap;function Xp(t){return Gp(t)?t:(Zn.has(t)||Zn.set(t,Yp()),Zn.get(t))}const Qp=X({name:"ShikiStreamRenderer",props:{stream:{type:Object,required:!0}},emits:["stream-start","stream-end"],setup(t,{emit:e}){const n=gl([]);let s=null;return Se(()=>t.stream,i=>{n.length=0,s&&s.abort(),s=new AbortController;const a=s.signal;let o=!1;i.pipeTo(new WritableStream({write(r){a.aborted||(o||(o=!0,e("stream-start")),"recall"in r?n.length-=r.recall:n.push(r))},close:()=>{a.aborted||e("stream-end")},abort:()=>{a.aborted||e("stream-end")}}),{signal:a}).catch(r=>{r.name!=="AbortError"&&console.error("Stream error:",r)})},{immediate:!0}),()=>kt("pre",{class:"shiki shiki-stream"},kt("code",we(n,i=>kt("span",{key:Xp(i),style:i.htmlStyle||Hl(i)},i.content))))}}),Zp=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(t,{emit:e}){const n=Y(0);let s=null;const i=new ReadableStream({start(o){s=o}});ml(()=>{t.code.length>n.value&&(s==null||s.enqueue(t.code.slice(n.value)),n.value=t.code.length)});const a=i.pipeThrough(new Kp({highlighter:t.highlighter,lang:t.lang,theme:t.theme,allowRecalls:!0}));return()=>kt(Qp,{stream:a,onStreamStart:()=>e("stream-start"),onStreamEnd:()=>e("stream-end")})}});let Ft=null,Jn=null;const Jp=new Set,em=[Me(()=>import("./B9xm8XSJ.js"),[],import.meta.url),Me(()=>import("./DQiMjOqm.js").then(t=>t.f),__vite__mapDeps([0,1,2]),import.meta.url),Me(()=>import("./DQiMjOqm.js").then(t=>t.e),__vite__mapDeps([0,1,2]),import.meta.url),Me(()=>import("./Yzrsuije.js"),[],import.meta.url),Me(()=>import("./DQiMjOqm.js").then(t=>t.m),__vite__mapDeps([0,1,2]),import.meta.url),Me(()=>import("./fuZLfV_i.js"),[],import.meta.url),Me(()=>import("./DQiMjOqm.js").then(t=>t.x),__vite__mapDeps([0,1,2]),import.meta.url),Me(()=>import("./DQiMjOqm.js").then(t=>t.y),__vite__mapDeps([0,1,2]),import.meta.url),Me(()=>import("./DQiMjOqm.js").then(t=>t.h),__vite__mapDeps([0,1,2]),import.meta.url),Me(()=>import("./DQiMjOqm.js").then(t=>t.j),__vite__mapDeps([0,1,2]),import.meta.url),Me(()=>import("./DlfHMoPT.js"),[],import.meta.url)],tm=async t=>{if(Jn||(Jn=Kl({langs:em,themes:[Wl,Yl],engine:Gl()})),Ft||(Ft=await Jn),t!=null&&t.length){const e=Ft.getLoadedLanguages();await Promise.all(t.filter(n=>!e.includes(n)).map(n=>Ft.loadLanguage(n).catch(()=>{Jp.add(n),console.warn(`[useHighlighter] Unknown language: "${n}" — will render as plain text`)})))}return Ft},nm={class:"rounded-xl border overflow-hidden shadow-sm"},sm={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},im={class:"text-xxs font-semibold capitalize text-muted-foreground select-none"},om={class:"flex items-center gap-1 justify-center"},am={class:"overflow-x-auto px-3 py-2 chat-code-text"},rm={key:1,class:"m-0"},Dn=X({__name:"BlockMessageCode",props:{id:{},code:{},language:{},class:{},meta:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean}},setup(t){const e=vl(),n=Y(null),s=t;Se(()=>s.language,async p=>{n.value=await tm([p])},{immediate:!0});const{handleCopyWithKey:i,isCopied:a,getCopyIcon:o,getCopyIconClass:r,getCopyTooltip:l}=sa(),u=L(()=>!!(s.isBlockStreaming&&s.isStreaming)),c=$s(Kt(s,"code"),u),h=L(()=>{switch(s.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"sql":case"plsql":case"sqlpl":case"sqlserver":return"sql";default:return"text"}}),d=L(()=>c.value.trim().replace(/`+$/,"")),f=L(()=>`${h.value}-${e.value}`);return(p,g)=>{const m=me,v=_e;return b(),k("div",nm,[x("div",sm,[x("span",im,D(s.language),1),S(_(Bs),null,{default:M(()=>[S(_(Os),{"as-child":""},{default:M(()=>[S(v,{variant:"ghost",size:"xxs",class:"h-6!",onClick:g[0]||(g[0]=C=>_(i)(p.id,p.code))},{default:M(()=>[x("span",om,[(b(),K(m,{key:_(a)(p.id)?"tick":"copy",name:_(o)(_(a)(p.id)),class:re(["size-3.5",_(r)(_(a)(p.id))])},null,8,["name","class"])),_(a)(p.id)?(b(),k("span",{key:0,class:re(["text-[10px] font-medium leading-none",_(r)(_(a)(p.id))])}," Copied ",2)):H("",!0)])]),_:1})]),_:1}),S(_(Fs),null,{default:M(()=>[x("p",null,D(_(l)(_(a)(p.id))),1)]),_:1})]),_:1})]),x("div",am,[n.value?(b(),K(_(Zp),{key:f.value,highlighter:n.value,code:d.value,lang:h.value,theme:_(e).value==="dark"?"catppuccin-mocha":"catppuccin-latte"},null,8,["highlighter","code","lang","theme"])):(b(),k("pre",rm,[x("code",null,D(d.value),1)]))])])}}}),lm={class:"flex items-center gap-2 text-muted-foreground chat-text"},um=X({__name:"BlockMessageLoading",props:{label:{}},setup(t){return(e,n)=>{const s=me;return b(),k("div",lm,[S(s,{name:"hugeicons:loading-03",class:"size-4 animate-spin"}),S(ui,null,{default:M(()=>[q(D(e.label||"Generating summary..."),1)]),_:1})])}}}),cm={class:"rounded-xl py-2 text-destructive"},dm=X({__name:"BlockMessageError",props:{message:{}},setup(t){return(e,n)=>(b(),k("div",cm,D(e.message),1))}}),hm={key:1,class:"rounded-2xl border bg-muted/40"},fm={class:"overflow-x-auto px-3 py-3 leading-6 chat-code-text"},pm=X({__name:"BlockMessageTool",props:{toolName:{},result:{},getToolComponent:{type:Function}},setup(t){const e=t,n=L(()=>e.getToolComponent(e.toolName)),s=i=>JSON.stringify(i,null,2);return(i,a)=>_(n)?(b(),K(ea(_(n)),{key:0,data:i.result},null,8,["data"])):(b(),k("div",hm,[x("pre",fm,D(s(i.result)),1)]))}}),mm={class:"inline-flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-xs"},gm={class:"min-w-0 flex-1"},vm=["href"],ym={key:1,class:"truncate font-medium text-foreground"},xm={key:2,class:"ml-2 text-xxs text-muted-foreground"},bm=X({__name:"BlockMessageSource",props:{sourceId:{},url:{},title:{},mediaType:{},filename:{}},setup(t){return(e,n)=>{const s=me;return b(),k("div",mm,[S(s,{name:e.url?"hugeicons:link-02":"hugeicons:file-02",class:"size-3.5 shrink-0 text-muted-foreground"},null,8,["name"]),x("div",gm,[e.url?(b(),k("a",{key:0,href:e.url,target:"_blank",rel:"noopener noreferrer",class:"truncate font-medium text-primary hover:underline"},D(e.title||e.url),9,vm)):(b(),k("span",ym,D(e.title||e.filename||"Source document"),1)),e.mediaType?(b(),k("span",xm,D(e.mediaType),1)):H("",!0)])])}}}),wm={key:0,class:"flex items-center gap-2 rounded-xl border border-border/60 bg-muted/30 px-3 py-2"},Sm={class:"text-xs text-muted-foreground truncate"},_m={key:1,class:"rounded-2xl border border-border/70 bg-background/80 overflow-hidden"},Tm={class:"px-4 pt-4"},Am={class:"flex items-center justify-between gap-2 mb-2"},km={class:"flex items-center gap-2 min-w-0"},Cm=["title"],Pm={class:"shrink-0 text-[11px] text-muted-foreground"},Mm={class:"h-0.5 rounded-full bg-muted overflow-hidden"},Dm={class:"px-4 py-3"},Vm={class:"text-sm leading-relaxed"},Lm={key:0,class:"text-destructive ml-0.5","aria-label":"required"},Em={key:1,class:"flex flex-col gap-3 py-1"},Rm=["value","placeholder"],Im={class:"px-4 pb-4 flex items-center justify-between gap-2"},$m={key:1},Bm={class:"flex items-center gap-1.5"},Om=X({__name:"BlockMessageQuiz",props:{toolCallId:{},context:{},questions:{}},emits:["submit"],setup(t,{emit:e}){const n=t,s=e,i=Y({}),a=Y(0),o=Y(!1),r=L(()=>n.questions[a.value]),l=L(()=>a.value===n.questions.length-1),u=L(()=>n.questions.every(V=>!V.required||d(V.id))),c=Y("");function h(){if(!r.value)return;const V=i.value[r.value.id];c.value=typeof V=="string"?V:""}function d(V){const T=i.value[V];return Array.isArray(T)?T.length>0:!!(T!=null&&T.trim())}function f(V){const T=r.value;if(!T)return!1;const w=i.value[T.id];return T.type==="multiple"?Array.isArray(w)&&w.includes(V):w===V}function p(V){const T=r.value;if(T){if(T.type==="single")i.value={...i.value,[T.id]:V},c.value="";else if(T.type==="multiple"){const w=i.value[T.id]??[],B=w.includes(V)?w.filter(E=>E!==V):[...w,V];i.value={...i.value,[T.id]:B}}}}function g(V){const T=r.value;if(!T)return;const w=V.target.value;c.value=w,i.value={...i.value,[T.id]:w}}function m(){a.value>0&&(a.value--,h())}function v(){l.value?$():(a.value++,h())}function C(){l.value?$():(a.value++,h())}function y(){return`[Quiz answers] ${n.questions.filter(T=>d(T.id)).map(T=>{const w=i.value[T.id],B=Array.isArray(w)?w.join(", "):w;return`${T.id}: ${B}`}).join(" | ")}`}function $(){u.value&&(o.value=!0,s("submit",y()))}const P=L(()=>n.questions.filter(V=>d(V.id)).map(V=>{const T=i.value[V.id];return Array.isArray(T)?T.join(", "):T}).join(" · "));return(V,T)=>{var E;const w=me,B=_e;return o.value?(b(),k("div",wm,[S(w,{name:"lucide:check-circle-2",class:"size-3.5 shrink-0 text-primary"}),x("span",Sm,[T[2]||(T[2]=x("span",{class:"font-medium text-foreground"},"Answered",-1)),P.value?(b(),k(le,{key:0},[q(" · "+D(P.value),1)],64)):H("",!0)])])):V.questions.length>0?(b(),k("div",_m,[x("div",Tm,[x("div",Am,[x("div",km,[S(_(Ve),{variant:"outline",class:"text-xs px-1"},{default:M(()=>[S(w,{name:"lucide:help-circle",class:"size-3 text-primary"}),T[3]||(T[3]=q(" Clarification "))]),_:1}),V.context?(b(),k("span",{key:0,class:"text-xs text-muted-foreground truncate",title:V.context},D(V.context),9,Cm)):H("",!0)]),x("span",Pm,D(a.value+1)+" / "+D(V.questions.length),1)]),x("div",Mm,[x("div",{class:"h-full rounded-full bg-primary transition-all duration-300",style:Qt({width:`${(a.value+1)/V.questions.length*100}%`})},null,4)])]),x("div",Dm,[S(Zt,{name:"quiz-slide",mode:"out-in"},{default:M(()=>{var z;return[r.value?(b(),k("div",{key:r.value.id,class:"space-y-3"},[x("p",Vm,[q(D(r.value.question)+" ",1),r.value.required?(b(),k("span",Lm,"*")):H("",!0)]),(z=r.value.suggestions)!=null&&z.length?(b(),k(le,{key:0},[r.value.type==="single"?(b(),K(_(yi),{key:0,"model-value":i.value[r.value.id],"onUpdate:modelValue":T[0]||(T[0]=F=>p(String(F))),class:"flex flex-col gap-3 py-1"},{default:M(()=>[(b(!0),k(le,null,we(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[S(_(xi),{id:F,value:F},null,8,["id","value"]),S(_(Rn),{for:F,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:M(()=>[q(D(F),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"])):r.value.type==="multiple"?(b(),k("div",Em,[(b(!0),k(le,null,we(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[S(_(Zl),{id:F,checked:f(F),"onUpdate:checked":te=>p(F)},null,8,["id","checked","onUpdate:checked"]),S(_(Rn),{for:F,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:M(()=>[q(D(F),1)]),_:2},1032,["for"])]))),128))])):(b(),K(_(yi),{key:2,"model-value":i.value[r.value.id],"onUpdate:modelValue":T[1]||(T[1]=F=>p(String(F))),class:"flex flex-col gap-3 py-1"},{default:M(()=>[(b(!0),k(le,null,we(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[S(_(xi),{id:F,value:F},null,8,["id","value"]),S(_(Rn),{for:F,class:"cursor-pointer text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:M(()=>[q(D(F),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"]))],64)):H("",!0),x("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:r.value.type==="open"?"Type your answer…":"Or type a custom answer…",onInput:g},null,40,Rm)])):H("",!0)]}),_:1})]),x("div",Im,[a.value>0?(b(),K(B,{key:0,variant:"ghost",size:"sm",class:"text-xs h-7",onClick:m},{default:M(()=>[S(w,{name:"lucide:arrow-left",class:"size-3 mr-1"}),T[4]||(T[4]=q(" Back "))]),_:1})):(b(),k("div",$m)),x("div",Bm,[!((E=r.value)!=null&&E.required)&&!l.value?(b(),K(B,{key:0,variant:"ghost",size:"xs",onClick:C},{default:M(()=>T[5]||(T[5]=[q(" Skip ")])),_:1})):H("",!0),S(B,{size:"xs",disabled:l.value&&!u.value,onClick:v},{default:M(()=>[q(D(l.value?"Submit":"Next")+" ",1),l.value?(b(),K(w,{key:1,name:"lucide:send",class:"size-3 ml-1"})):(b(),K(w,{key:0,name:"lucide:arrow-right",class:"size-3 ml-1"}))]),_:1},8,["disabled"])])])])):H("",!0)}}}),Fm=ta(Om,[["__scopeId","data-v-2b68c703"]]),jm={class:"flex h-full flex-col bg-sidebar/50 z-50 p-2 gap-2"},Nm={class:"flex shrink-0 items-center justify-between gap-2"},zm={class:"flex items-center min-w-0 gap-1 flex-1"},Um={class:"text-xs"},qm={class:"flex-1 overflow-hidden flex flex-col min-h-0 relative mt-2"},Hm={class:"flex-1 min-h-0 overflow-y-auto w-full relative"},Km={key:0,class:"absolute inset-0 flex items-center justify-center p-6 z-10"},Gm={class:"space-y-2"},Wm=["onClick"],Ym={class:"min-w-0 flex-1"},Xm={class:"text-xs font-medium truncate"},Qm={class:"flex items-center gap-2"},Zm={class:"min-w-0 flex-1"},Jm={class:"flex flex-wrap gap-1.5 text-xs"},eg={class:"flex-1 overflow-y-auto px-4 space-y-4"},tg={key:0,class:"space-y-2"},ng={key:0,class:"bg-muted/50 p-3 rounded-md overflow-x-auto whitespace-pre-wrap font-mono border chat-code-text"},sg={key:1,class:"flex flex-col items-center justify-center p-5 bg-muted/20 rounded-md border border-dashed min-h-[140px]"},ig={key:1,class:"text-sm"},og={key:2,class:"flex flex-col gap-3 p-3 bg-muted/30 rounded-md border"},ag={class:"text-xs font-medium"},rg={key:0,class:"text-xs text-primary break-all flex items-center gap-1"},lg=["href"],ug={key:1,class:"text-xs text-muted-foreground"},cg={class:"flex gap-2"},dg=X({__name:"AgentAttachmentPanel",props:{messages:{}},emits:["close"],setup(t,{emit:e}){const n=t,s=e,i=L(()=>n.messages),{attachments:a,files:o,codes:r,sources:l}=zp(i),{downloadFile:u}=ci(),c=Y("all"),h=T=>({type:"file",id:T.id,name:T.filename,description:"Exported File",icon:"hugeicons:file-02",data:T.result}),d=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}),p=L(()=>({all:[...o.value.map(h),...l.value.map(d),...r.value.map(f)],files:o.value.map(h),code:r.value.map(f),links:l.value.map(d)})),g=L(()=>p.value[c.value]||[]),m=Y(!1),v=Y(null),C=T=>{if(T==null)return"—";if(T<1024)return`${T} B`;const w=["KB","MB","GB","TB"];let B=T/1024,E=0;for(;B>=1024&&E<w.length-1;)B/=1024,E+=1;return`${B.toFixed(B>=10?0:1)} ${w[E]}`},y=L(()=>v.value?v.value.type==="file"?"File":v.value.type==="code"?"Code":"Link":""),$=L(()=>{var T,w;return((T=v.value)==null?void 0:T.type)==="source"&&!!((w=v.value.data)!=null&&w.url)}),P=T=>{v.value=T,m.value=!0},V=async T=>{var w;if(T)if(T.type==="file")await u(T.data);else if(T.type==="code"){const B=T.data.code,E=new Blob([B],{type:"text/plain"}),z=URL.createObjectURL(E),F=document.createElement("a");F.href=z,F.download=`snippet-${T.id.substring(0,6)}.${T.data.language||"txt"}`,F.click(),URL.revokeObjectURL(z)}else T.type==="source"&&(w=T.data)!=null&&w.url&&window.open(T.data.url,"_blank","noopener,noreferrer")};return(T,w)=>{const B=me,E=yl;return b(),k("div",jm,[x("div",Nm,[x("div",zm,[S(B,{name:"hugeicons:attachment",class:"size-4"}),w[6]||(w[6]=x("h3",{class:"text-sm font-semibold text-foreground"},"Attachments",-1)),x("p",Um,D(_(a).length),1)]),S(_(_e),{size:"iconMd",variant:"ghost",onClick:w[0]||(w[0]=z=>s("close"))},{default:M(()=>[S(B,{name:"lucide:x",class:"size-4"})]),_:1})]),x("div",qm,[S(_(zl),{modelValue:c.value,"onUpdate:modelValue":w[1]||(w[1]=z=>c.value=z),class:"flex-1 min-h-0"},{default:M(()=>[S(_(Ul),{class:"h-8"},{default:M(()=>[S(_(cn),{value:"all",class:"text-xs cursor-pointer"},{default:M(()=>w[7]||(w[7]=[q("All")])),_:1}),S(_(cn),{value:"files",class:"text-xs cursor-pointer"},{default:M(()=>w[8]||(w[8]=[q("Files")])),_:1}),S(_(cn),{value:"code",class:"text-xs cursor-pointer"},{default:M(()=>w[9]||(w[9]=[q("Code")])),_:1}),S(_(cn),{value:"links",class:"text-xs cursor-pointer"},{default:M(()=>w[10]||(w[10]=[q("Links")])),_:1})]),_:1}),x("div",Hm,[g.value.length===0?(b(),k("div",Km,[S(E,{title:"No items found",desc:"Add an attachment to see it here."})])):H("",!0),(b(),k(le,null,we(["all","files","code","links"],z=>S(_(ql),{key:z,value:z,class:"h-full mt-0 focus-visible:ring-0"},{default:M(()=>[x("div",Gm,[(b(!0),k(le,null,we(p.value[z],F=>(b(),k("div",{key:F.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:te=>P(F)},[S(B,{name:F.icon,class:"size-5!"},null,8,["name"]),x("div",Ym,[x("p",Xm,D(F.name),1),x("p",{class:re(["text-xxs text-muted-foreground truncate",F.type==="source"?"text-primary/70":""])},D(F.description),3)]),S(B,{name:"hugeicons:view",class:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground"})],8,Wm))),128))])]),_:2},1032,["value"])),64))])]),_:1},8,["modelValue"])]),S(_(xl),{open:m.value,"onUpdate:open":w[5]||(w[5]=z=>m.value=z)},{default:M(()=>[S(_(bl),{class:"max-w-[50vw]! w-full max-h-[70vh] p-0 flex flex-col overflow-hidden"},{default:M(()=>{var z,F,te;return[S(_(wl),{class:"p-4 pb-2 text-left"},{default:M(()=>{var A;return[x("div",Qm,[S(B,{name:((A=v.value)==null?void 0:A.icon)||"hugeicons:file-02",class:"size-5!"},null,8,["name"]),x("div",Zm,[S(_(Sl),{class:"truncate flex items-center gap-2"},{default:M(()=>{var I,N,G,W,U,Q;return[q(D(((I=v.value)==null?void 0:I.name)||"Attachment Preview")+" ",1),x("div",Jm,[S(_(Ve),{variant:"secondary",class:"h-5 px-1.5"},{default:M(()=>[q(D(y.value),1)]),_:1}),((N=v.value)==null?void 0:N.type)==="file"?(b(),K(_(Ve),{key:0,variant:"outline",class:"h-5 px-1.5"},{default:M(()=>[q(D(v.value.data.format||"file"),1)]),_:1})):H("",!0),((G=v.value)==null?void 0:G.type)==="file"?(b(),K(_(Ve),{key:1,variant:"outline",class:"h-5 px-1.5"},{default:M(()=>[q(D(C(v.value.data.fileSize)),1)]),_:1})):H("",!0),((W=v.value)==null?void 0:W.type)==="code"?(b(),K(_(Ve),{key:2,variant:"outline",class:"h-5 px-1.5"},{default:M(()=>[q(D(v.value.data.language||"text"),1)]),_:1})):H("",!0),((U=v.value)==null?void 0:U.type)==="source"&&((Q=v.value.data)!=null&&Q.mediaType)?(b(),K(_(Ve),{key:3,variant:"outline",class:"h-5 px-1.5"},{default:M(()=>[q(D(v.value.data.mediaType),1)]),_:1})):H("",!0)])]}),_:1}),S(_(_l),{class:"text-sm"},{default:M(()=>w[11]||(w[11]=[q(" Preview attachment details and content. ")])),_:1})])])]}),_:1}),x("div",eg,[((z=v.value)==null?void 0:z.type)==="file"?(b(),k("div",tg,[v.value.data.encoding==="utf8"?(b(),k("div",ng,D(v.value.data.content),1)):(b(),k("div",sg,[S(B,{name:"hugeicons:file-unknown",class:"size-12 text-muted-foreground/50 mb-3"}),w[12]||(w[12]=x("p",{class:"text-foreground text-sm font-medium"}," Binary file format ",-1)),w[13]||(w[13]=x("p",{class:"text-xs text-muted-foreground text-center mt-1"}," Preview is not available for this file type. Download to view. ",-1))]))])):((F=v.value)==null?void 0:F.type)==="code"?(b(),k("div",ig,[S(_(Dn),{id:v.value.data.id,code:v.value.data.code,language:v.value.data.language,"is-streaming":!1,"is-block-streaming":!1},null,8,["id","code","language"])])):((te=v.value)==null?void 0:te.type)==="source"?(b(),k("div",og,[x("div",null,[w[14]||(w[14]=x("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," Title ",-1)),x("p",ag,D(v.value.data.title||v.value.data.filename||"Untitled Resource"),1)]),x("div",null,[w[15]||(w[15]=x("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," URL ",-1)),v.value.data.url?(b(),k("p",rg,[x("a",{href:v.value.data.url,target:"_blank",class:"hover:underline"},D(v.value.data.url),9,lg),S(B,{name:"hugeicons:link-square-02",class:"size-3 shrink-0"})])):(b(),k("p",ug," No URL provided. "))])])):H("",!0)]),S(_(Tl),{class:"p-4 flex justify-end pt-0"},{default:M(()=>{var A;return[S(_(_e),{variant:"outline",size:"sm",onClick:w[2]||(w[2]=I=>m.value=!1)},{default:M(()=>w[16]||(w[16]=[q(" Close ")])),_:1}),x("div",cg,[((A=v.value)==null?void 0:A.type)==="source"?(b(),K(_(_e),{key:0,size:"sm",disabled:!$.value,onClick:w[3]||(w[3]=I=>V(v.value))},{default:M(()=>[w[17]||(w[17]=q(" Open Link ")),S(B,{name:"hugeicons:link-square-02",class:"size-3 ml-2"})]),_:1},8,["disabled"])):(b(),K(_(_e),{key:1,size:"sm",onClick:w[4]||(w[4]=I=>V(v.value))},{default:M(()=>[w[18]||(w[18]=q(" Download ")),S(B,{name:"hugeicons:download-04",class:"size-3"})]),_:1}))])]}),_:1})]}),_:1})]),_:1},8,["open"])])}}}),Ts=[{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."}],hg=t=>{const e=new Set(t);return Ts.filter(n=>e.has(n.id))},fg={class:"w-full relative"},pg={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"},mg=["id","aria-selected","onMouseenter","onClick"],gg={class:"min-w-0 flex-1"},vg={class:"flex items-center gap-2"},yg={class:"text-xs font-medium text-foreground"},xg={class:"mt-1 block text-xs text-muted-foreground"},bg={key:0,class:"rounded-xl px-3 py-5 text-center text-[11px] text-muted-foreground"},wg={class:"dark:bg-sidebar rounded-3xl border shadow-xs p-3 px-2 pb-2 flex flex-col gap-1 relative z-40"},Sg={key:0,class:"flex flex-wrap gap-2 pb-1"},_g=["aria-label","onClick"],Tg={class:"flex items-center justify-between px-1"},Ag={class:"flex items-center gap-1"},kg={class:"relative w-fit"},Cg={class:"flex items-center gap-3"},vn="agent-command-listbox",Ko="agent-command-status",Pg=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(t,{expose:e,emit:n}){const s=t,i=n,a=Y(s.modelValue),o=Y(0),r=Y("");Se(()=>s.modelValue,A=>{a.value=A});const l=Y(null),u=L({get:()=>s.selectedCommandOptions,set:A=>i("update:selectedCommandOptions",A)}),c=L(()=>hg(u.value)),h=()=>{const A=l.value;if(!A)return null;if(A instanceof HTMLTextAreaElement)return A;if(typeof A=="object"&&"$el"in A&&A.$el instanceof HTMLElement){const I=A.$el;return I instanceof HTMLTextAreaElement?I:I.querySelector("textarea")}return A instanceof HTMLElement?A.querySelector("textarea"):null},d=()=>{const A=h();A==null||A.focus()};e({focusInput:d});const f=L(()=>{const A=h(),I=(A==null?void 0:A.selectionStart)??a.value.length;return a.value.slice(0,I).match(/(?:^|\s)\/([a-z0-9_-]*)$/i)}),p=L(()=>{var A,I;return((I=(A=f.value)==null?void 0:A[1])==null?void 0:I.toLowerCase())||""}),g=L(()=>f.value?f.value[0]:""),m=L(()=>{const A=p.value.trim();return f.value?A?Ts.filter(I=>[I.label,I.toolName,I.description,I.category].join(" ").toLowerCase().includes(A)):Ts:[]}),v=L(()=>!!f.value&&g.value!==r.value),C=L(()=>m.value[o.value]||null),y=L(()=>v.value?m.value.length===0?"No matching agent tools. Keep typing to filter or press Escape to close.":`${m.value.length} agent tools available. Use arrow keys to move, Enter or Tab to insert, and Escape to close.`:"");Se(m,A=>{if(A.length===0){o.value=0;return}o.value>=A.length&&(o.value=0)}),Se(g,A=>{A||(r.value="")});const $=A=>{const I=A.target.value;a.value=I,r.value&&r.value!==g.value&&(r.value=""),i("update:modelValue",I)},P=async()=>{r.value=g.value,o.value=0,await $e(),d()},V=A=>{u.value.includes(A.id)||(u.value=[...u.value,A.id])},T=A=>{u.value=u.value.filter(I=>I!==A)},w=async A=>{const I=h(),N=(I==null?void 0:I.selectionStart)??a.value.length,G=a.value.slice(0,N),W=a.value.slice(N);if(!G.match(/(?:^|\s)\/([a-z0-9_-]*)$/i))return;const Q=G.lastIndexOf("/"),Z=a.value.slice(0,Q);let J=`${Z}${W}`;Z.trim()||(J=J.trimStart());const ge=Math.min(Z.length,J.length);a.value=J,i("update:modelValue",J),V(A),o.value=0,r.value="",await $e();const ue=h();ue==null||ue.focus(),ue==null||ue.setSelectionRange(ge,ge)},B=A=>{if(v.value){if(A.key==="Escape"){A.preventDefault(),P();return}if(m.value.length>0){if(A.key==="ArrowDown"){A.preventDefault(),o.value=(o.value+1)%m.value.length;return}if(A.key==="ArrowUp"){A.preventDefault(),o.value=(o.value-1+m.value.length)%m.value.length;return}if(A.key==="Home"){A.preventDefault(),o.value=0;return}if(A.key==="End"){A.preventDefault(),o.value=m.value.length-1;return}if(A.key==="Enter"||A.key==="Tab"){A.preventDefault();const I=C.value;I&&w(I);return}}}i("keydown",A)},E=A=>{A==null||A.preventDefault(),i("submit",typeof A=="object"&&A!==null?A:void 0)},z=A=>{if(s.isLoading){A==null||A.preventDefault(),i("stop");return}E(A)},F=L({get:()=>s.provider,set:A=>i("update:provider",A)}),te=L({get:()=>s.model,set:A=>i("update:model",A)});return(A,I)=>{const N=me,G=Ql,W=_e;return b(),k("div",fg,[v.value?(b(),k("div",pg,[I[4]||(I[4]=x("div",{class:"border-b border-border/50 px-3 py-2"},[x("p",{class:"text-xs font-medium"},"Agent tools"),x("p",{class:"mt-1 text-xs text-muted-foreground"},[q(" Type after "),x("span",{class:"font-medium text-foreground"},"/"),q(" to filter. ")])],-1)),x("div",{id:vn,role:"listbox","aria-label":"Agent tools",class:"max-h-[260px] overflow-y-auto px-2 py-2"},[(b(!0),k(le,null,we(m.value,(U,Q)=>(b(),k("button",{id:`${vn}-${U.id}`,key:U.id,type:"button",role:"option","aria-selected":Q===o.value,class:re(["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",Q===o.value?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"]),onMouseenter:Z=>o.value=Q,onClick:Z=>w(U)},[S(N,{name:U.icon,class:"mt-0.5 size-[18px] shrink-0"},null,8,["name"]),x("span",gg,[x("span",vg,[x("span",yg,D(U.label),1)]),x("span",xg,D(U.description),1)]),x("div",null,[c.value.find(Z=>Z.id===U.id)?(b(),K(N,{key:0,name:"hugeicons:checkmark-circle-01",class:"size-4 mt-0.5 text-muted-foreground cursor-pointer"})):H("",!0)])],42,mg))),128)),m.value.length===0?(b(),k("div",bg,I[3]||(I[3]=[q(" No matching tools. Try "),x("span",{class:"font-medium text-foreground"},"/render",-1),q(" or "),x("span",{class:"font-medium text-foreground"},"/describe",-1),q(". ")]))):H("",!0)])])):H("",!0),x("div",wg,[c.value.length>0?(b(),k("div",Sg,[(b(!0),k(le,null,we(c.value,U=>(b(),k("div",{key:U.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"},[S(N,{name:U.icon,class:"size-3.5 text-muted-foreground"},null,8,["name"]),x("span",null,D(U.label),1),x("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 ${U.label}`,onClick:Q=>T(U.id)},[S(N,{name:"lucide:x",class:"size-3"})],8,_g)]))),128))])):H("",!0),S(G,{ref_key:"textareaRef",ref:l,modelValue:a.value,"onUpdate:modelValue":I[0]||(I[0]=U=>a.value=U),disabled:!A.hasApiKey||A.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":v.value?vn:void 0,"aria-describedby":Ko,"aria-activedescendant":C.value?`${vn}-${C.value.id}`:void 0,"aria-expanded":v.value,onInput:$,onKeydown:B},null,8,["modelValue","disabled","aria-controls","aria-activedescendant","aria-expanded"]),x("p",{id:Ko,class:"sr-only","aria-live":"polite"},D(y.value),1),x("div",Tg,[x("div",Ag,[x("div",kg,[S(Al,{provider:F.value,"onUpdate:provider":I[1]||(I[1]=U=>F.value=U),model:te.value,"onUpdate:model":I[2]||(I[2]=U=>te.value=U),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"])])]),x("div",Cg,[S(W,{size:"iconMd",type:"button",class:"rounded-full shadow bg-foreground text-background hover:bg-foreground disabled disabled:bg-muted disabled:text-muted-foreground",disabled:!a.value.trim()&&!A.isLoading||!A.hasApiKey,onClick:z},{default:M(()=>[S(N,{name:A.isLoading?"lucide:square":"lucide:arrow-up",class:re(["size-4 stroke-[2]",A.isLoading?"fill-current":""])},null,8,["name","class"])]),_:1},8,["disabled"])])])])])}}}),Mg={class:"flex items-center justify-between px-4 mt-2 text-[12px] text-muted-foreground relative z-30"},Dg={class:"flex items-center gap-4"},Vg={class:"flex items-center gap-1"},Lg={class:"flex items-center gap-1.5"},Eg={class:"flex items-center gap-1.5"},Rg=X({__name:"AgentChatStatusBar",props:{modelLabel:{},isLoading:{type:Boolean},showReasoning:{type:Boolean}},emits:["update:showReasoning"],setup(t,{emit:e}){const n=e;return(s,i)=>{const a=me,o=kl;return b(),k("div",Mg,[x("div",Dg,[x("div",Vg,[S(a,{name:"hugeicons:ai-brain-05",class:"size-3.5 stroke-[1.5]"}),i[1]||(i[1]=x("span",null,"Reasoning",-1)),S(o,{"model-value":s.showReasoning,"aria-label":"Toggle reasoning",class:"cursor-pointer","onUpdate:modelValue":i[0]||(i[0]=r=>n("update:showReasoning",!!r))},null,8,["model-value"])]),x("div",Lg,[S(a,{name:"hugeicons:robotic",class:"size-3.5 stroke-[1.5]"}),x("span",null,D(s.modelLabel),1)])]),x("div",Eg,[S(a,{name:s.isLoading?"hugeicons:loading-03":"hugeicons:checkmark-circle-01",class:re(["size-3.5 stroke-[1.5]",s.isLoading?"animate-spin":""])},null,8,["name","class"]),x("span",null,D(s.isLoading?"Streaming":"Ready"),1)])])}}}),Ig={class:"w-full py-2"},$g={class:"relative w-full max-w-3xl mx-auto flex flex-col px-4"},Bg={key:0,class:"absolute -top-12 left-1/2 transform -translate-x-1/2 z-20"},Og=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(t,{expose:e,emit:n}){const s=t,i=n,a=L({get:()=>s.modelValue,set:d=>i("update:modelValue",d)}),o=L({get:()=>s.provider,set:d=>i("update:provider",d)}),r=L({get:()=>s.model,set:d=>i("update:model",d)}),l=L({get:()=>s.selectedCommandOptions,set:d=>i("update:selectedCommandOptions",d)}),u=L(()=>`${s.provider} / ${s.model}`),c=Y(null);return e({focusInput:()=>{var d;(d=c.value)==null||d.focusInput()}}),(d,f)=>(b(),k("footer",Ig,[x("div",$g,[S(Zt,{"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:M(()=>[d.showScrollButton?(b(),k("div",Bg,[x("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]=p=>i("scrollToBottom"))},[S(_(me),{name:"lucide:arrow-down",class:"size-4 shrink-0"})])])):H("",!0)]),_:1}),S(Pg,{ref_key:"inputRef",ref:c,modelValue:a.value,"onUpdate:modelValue":f[1]||(f[1]=p=>a.value=p),provider:o.value,"onUpdate:provider":f[2]||(f[2]=p=>o.value=p),model:r.value,"onUpdate:model":f[3]||(f[3]=p=>r.value=p),"selected-command-options":l.value,"onUpdate:selectedCommandOptions":f[4]||(f[4]=p=>l.value=p),"is-loading":d.isLoading,"has-api-key":d.hasApiKey,onSubmit:f[5]||(f[5]=p=>i("submit",p)),onStop:f[6]||(f[6]=p=>i("stop")),onKeydown:f[7]||(f[7]=p=>i("keydown",p))},null,8,["modelValue","provider","model","selected-command-options","is-loading","has-api-key"]),S(Rg,{"model-label":u.value,"is-loading":d.isLoading,"show-reasoning":d.showReasoning,"onUpdate:showReasoning":f[8]||(f[8]=p=>i("update:showReasoning",p))},null,8,["model-label","is-loading","show-reasoning"])])]))}}),A0=""+new URL("logo.BsJ2Dfin.png",import.meta.url).href,Fg={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},jg={class:"flex flex-wrap items-center gap-2"},Ng={key:0,class:"rounded-2xl border bg-background/80 px-3 py-3 text-sm"},zg={key:1,class:"space-y-3"},Ug={class:"flex flex-wrap items-center gap-2"},qg={key:0,class:"text-xs text-muted-foreground"},Hg={class:"mt-3 text-sm leading-6"},Kg={key:0,class:"mt-3 rounded-xl border bg-muted/30"},Gg={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},Wg=X({__name:"AgentAnomalyBlock",props:{data:{}},setup(t){const e={high:"destructive",medium:"secondary",low:"outline"},n=s=>e[s];return(s,i)=>{const a=Ve;return b(),k("div",Fg,[x("div",jg,[S(a,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(" Clean Score "+D(s.data.cleanScore)+"/100 ",1)]),_:1}),S(a,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(D(s.data.scannedRows)+" rows scanned ",1)]),_:1})]),s.data.issues.length===0?(b(),k("div",Ng," No anomalies were detected in the requested checks. ")):(b(),k("div",zg,[(b(!0),k(le,null,we(s.data.issues,(o,r)=>(b(),k("div",{key:`${o.type}-${o.column||r}`,class:"rounded-2xl border bg-background/90 p-3"},[x("div",Ug,[S(a,{variant:n(o.severity),class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(D(o.severity.toUpperCase()),1)]),_:2},1032,["variant"]),S(a,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(D(o.type),1)]),_:2},1024),o.column?(b(),k("span",qg,D(o.column),1)):H("",!0)]),x("p",Hg,D(o.description),1),o.fixSql?(b(),k("details",Kg,[i[0]||(i[0]=x("summary",{class:"cursor-pointer px-3 py-2 text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground"}," Fix suggestion ",-1)),x("pre",Gg,D(o.fixSql),1)])):H("",!0)]))),128))]))])}}}),Yg={class:"space-y-2"},Xg={class:"flex flex-wrap justify-start gap-2"},Qg=X({__name:"AgentApprovalBlock",props:{toolName:{},input:{},approvalId:{}},emits:["approve","deny"],setup(t,{emit:e}){const n=t,s=e,i=L(()=>"sql"in n.input&&typeof n.input.sql=="string"?n.input.sql:JSON.stringify(n.input,null,2));return(a,o)=>{const r=Dn,l=_e;return b(),k("div",Yg,[o[4]||(o[4]=x("div",{class:""},[x("div",{class:"text-xs font-medium"},"Approval Required"),x("p",{class:"text-xs text-muted-foreground"}," *This action needs confirmation before execution. ")],-1)),S(r,{id:n.approvalId,code:_(i)||"",language:"sql"},null,8,["id","code"]),x("div",Xg,[S(l,{variant:"outline",size:"xs",class:"rounded-xl font-normal",onClick:o[0]||(o[0]=u=>s("deny",a.approvalId))},{default:M(()=>o[2]||(o[2]=[q(" Cancel ")])),_:1}),S(l,{size:"xs",class:"rounded-xl font-normal",onClick:o[1]||(o[1]=u=>s("approve",a.approvalId))},{default:M(()=>o[3]||(o[3]=[q(" Confirm ")])),_:1})])])}}}),Zg={class:"flex items-start justify-between gap-3"},Jg={class:"space-y-2 min-w-0"},ev={class:"flex items-center gap-2"},tv={class:"text-sm font-medium"},nv={class:"text-sm leading-6"},sv={key:0,class:"space-y-2"},iv={class:"flex flex-wrap gap-1"},ov=X({__name:"AgentDescribeBlock",props:{data:{}},setup(t){const e=t,n=L(()=>[["name","Name"],["type","Type"],["nullable","Nullable"],["pk","PK"],["fk","FK"],["references","References"],["description","Description"]].map(([a,o])=>({originalName:a,queryFieldName:a,aliasFieldName:o,isPrimaryKey:!1,isForeignKey:!1,canMutate:!1,type:"text",tableName:""}))),s=L(()=>e.data.columns.map(a=>({name:a.name,type:a.type,nullable:a.isNullable?"Yes":"No",pk:a.isPrimaryKey?"Yes":"No",fk:a.isForeignKey?"Yes":"No",references:a.referencesTable||"—",description:a.description||"—"}))),i=L(()=>{const u=48+s.value.length*32;return Math.max(120,Math.min(u,360))});return(a,o)=>{const r=me,l=Ve;return b(),k(le,null,[x("div",Zg,[x("div",Jg,[x("div",ev,[S(r,{name:"hugeicons:grid-table",class:"size-4 text-primary"}),x("div",tv,D(a.data.tableName),1)]),x("p",nv,D(a.data.summary),1)]),S(l,{variant:"outline",class:"shrink-0"},{default:M(()=>[q(D(a.data.columns.length)+" columns ",1)]),_:1})]),x("div",{class:"overflow-hidden rounded-lg border",style:Qt({height:`${_(i)}px`})},[S(js,{columns:_(n),data:_(s),"column-key-by":"field","has-hash-index":!1,class:"h-full w-full"},null,8,["columns","data"])],4),a.data.relatedTables.length>0?(b(),k("div",sv,[o[0]||(o[0]=x("div",{class:"text-[11px] font-medium text-muted-foreground"}," Related Tables ",-1)),x("div",iv,[(b(!0),k(le,null,we(a.data.relatedTables,u=>(b(),K(l,{key:u,variant:"outline",class:"text-xxs"},{default:M(()=>[q(D(u),1)]),_:2},1024))),128))])])):H("",!0)],64)}}}),av={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},rv={class:"flex flex-wrap items-center gap-2"},lv={class:"text-sm leading-6 text-foreground/90"},uv={key:0,class:"space-y-2"},cv={class:"space-y-2 text-sm leading-6"},dv={class:"rounded-2xl border bg-background/90"},hv={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},fv=X({__name:"AgentExplainBlock",props:{data:{}},setup(t){return(e,n)=>{const s=Ve;return b(),k("div",av,[x("div",rv,[S(s,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(D(e.data.slowestNode),1)]),_:1}),S(s,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:M(()=>[q(" Cost "+D(e.data.estimatedCost.toFixed(2)),1)]),_:1})]),x("p",lv,D(e.data.summary),1),e.data.suggestions.length>0?(b(),k("div",uv,[n[0]||(n[0]=x("div",{class:"text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground"}," Suggestions ",-1)),x("ul",cv,[(b(!0),k(le,null,we(e.data.suggestions,i=>(b(),k("li",{key:i,class:"rounded-2xl border bg-background/80 px-3 py-2"},D(i),1))),128))])])):H("",!0),x("details",dv,[n[1]||(n[1]=x("summary",{class:"cursor-pointer px-3 py-2 text-sm font-medium"}," Raw EXPLAIN output ",-1)),x("pre",hv,D(e.data.rawPlan),1)])])}}}),pv=["disabled"],mv={class:"flex items-center min-w-0 gap-2 flex-1"},gv={class:"flex flex-col"},vv={class:"truncate text-sm leading-4 font-normal text-foreground"},yv={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},xv={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},Go=X({__name:"AgentExportFileBlock",props:{data:{}},setup(t){const e=t,n=Xo("activeExportPreview"),{downloadFile:s}=ci(),i=()=>{n&&(n.value=e.data)};L(()=>{switch(e.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 a=L(()=>{const r=e.data.fileSize;return fa(r)});L(()=>e.data.error?e.data.error:"Preview available before download");const o=async()=>{await s(e.data)};return(r,l)=>{const u=me,c=_e;return b(),k("button",{type:"button",class:re(["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",e.data.error?"cursor-not-allowed opacity-80":"cursor-pointer"]),disabled:!!e.data.error,onClick:i},[x("div",mv,[S(u,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),x("div",gv,[x("h3",vv,D(e.data.filename),1),e.data.preview.truncated?(b(),k("p",yv," First "+D(e.data.preview.rows.length)+" rows ",1)):(b(),k("p",xv," size: "+D(a.value)+" • type: "+D(e.data.format),1))])]),S(c,{disabled:!!e.data.error,size:"xs",variant:"outline"},{default:M(()=>[l[0]||(l[0]=q(" view ")),S(u,{name:"lucide:eye",class:"size-3"})]),_:1},8,["disabled"]),S(c,{onClick:Cl(o,["stop"]),disabled:!!e.data.error,size:"xs",variant:"outline"},{default:M(()=>[l[1]||(l[1]=q(" Download ")),S(u,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"])],10,pv)}}}),bv={class:"overflow-hidden mb-1"},wv={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},Sv={class:"my-1"},hi=X({__name:"AgentToolSqlPreview",props:{id:{},sql:{},label:{default:"View SQL"},defaultOpen:{type:Boolean,default:!1}},setup(t){const e=t,n=Y(!1);function s(o){const r=o;r.style.height="0",r.style.opacity="0",requestAnimationFrame(()=>{r.style.height=r.scrollHeight+"px",r.style.opacity="1"})}function i(o){o.style.height="auto"}function a(o){const r=o;r.style.height=r.scrollHeight+"px",r.style.opacity="1",requestAnimationFrame(()=>{r.style.height="0",r.style.opacity="0"})}return(o,r)=>{const l=me,u=Dn;return b(),k("div",bv,[x("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:r[0]||(r[0]=c=>n.value=!_(n))},[q(D(e.label)+" ",1),S(l,{name:"lucide:chevron-down",class:re(["ml-auto size-4 transition-transform duration-300",{"rotate-180":_(n)}])},null,8,["class"])]),S(Zt,{onEnter:s,onAfterEnter:i,onLeave:a},{default:M(()=>[_(n)?(b(),k("div",wv,[x("div",Sv,[S(u,{id:e.id,code:e.sql,language:"sql"},null,8,["id","code"])])])):H("",!0)]),_:1})])}}}),_v={class:"space-y-3 rounded-xl border border-border/70 bg-muted/20 p-4"},Tv={class:"flex items-start justify-between gap-3"},Av={class:"text-sm leading-6 text-foreground/90"},kv=X({__name:"AgentQueryBlock",props:{data:{}},setup(t){const e=t,n=L(()=>`agent-query-${e.data.sql}`);return(s,i)=>{const a=Ve;return b(),k("div",_v,[x("div",Tv,[x("p",Av,D(s.data.explanation),1),S(a,{variant:s.data.isMutation?"destructive":"secondary",class:"shrink-0 text-xxs"},{default:M(()=>[q(D(s.data.isMutation?"MUTATION":"READ ONLY"),1)]),_:1},8,["variant"])]),S(hi,{id:_(n),sql:s.data.sql,label:s.data.isMutation?"Review SQL before approval":"View SQL","default-open":s.data.isMutation},null,8,["id","sql","label","default-open"])])}}}),Cv={class:"overflow-hidden"},Pv={key:1,class:""},Mv={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},Dv={class:"mt-2 border-l-2 border-border pl-3 py-1 text-foreground/80 opacity-70 chat-text"},Vv=X({__name:"AgentReasoningBlock",props:{content:{},isStreaming:{type:Boolean}},setup(t){const e=t,n=Kt(e,"isStreaming"),s=$s(Kt(e,"content"),n),i=Y(!1);Se(()=>e.isStreaming,l=>{l?i.value=!0:i.value=!1},{immediate:!0});function a(l){const u=l;u.style.height="0",u.style.opacity="0",requestAnimationFrame(()=>{u.style.height=u.scrollHeight+"px",u.style.opacity="1"})}function o(l){l.style.height="auto"}function r(l){const u=l;u.style.height=u.scrollHeight+"px",u.style.opacity="1",requestAnimationFrame(()=>{u.style.height="0",u.style.opacity="0"})}return(l,u)=>{const c=me;return b(),k("div",Cv,[x("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:u[0]||(u[0]=h=>i.value=!_(i))},[S(c,{name:"hugeicons:ai-brain-05",class:re(["size-3.5! shrink-0",{"animate-pulse text-primary":l.isStreaming}])},null,8,["class"]),l.isStreaming?(b(),K(ui,{key:0,duration:1},{default:M(()=>u[1]||(u[1]=[q("Reasoning")])),_:1})):(b(),k("span",Pv," Reasoning ")),S(c,{name:"lucide:chevron-down",class:re(["ml-auto size-4 transition-transform duration-300",{"rotate-180":_(i)}])},null,8,["class"])]),S(Zt,{onEnter:a,onAfterEnter:o,onLeave:r},{default:M(()=>[_(i)?(b(),k("div",Mv,[x("div",Dv,[S(na,{content:_(s),"is-streaming":l.isStreaming,"is-block-streaming":l.isStreaming,"is-user-message":!1},null,8,["content","is-streaming","is-block-streaming"])])])):H("",!0)]),_:1})])}}}),Lv={key:1,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},Ev={class:"text-xs text-muted-foreground mt-1"},Rv=X({__name:"AgentTableBlock",props:{data:{}},setup(t){const e=t,n=L(()=>(e.data.columns??[]).map(o=>({originalName:o.name,queryFieldName:o.name,aliasFieldName:o.name,isPrimaryKey:!1,isForeignKey:!1,canMutate:!1,type:o.type,tableName:""}))),s=L(()=>e.data.rows??[]),i=L(()=>`agent-render-table-${e.data.sql||""}`),a=L(()=>{const c=48+s.value.length*32;return Math.max(120,Math.min(c,420))});return(o,r)=>(b(),k(le,null,[o.data.sql?(b(),K(hi,{key:0,id:_(i),sql:o.data.sql,label:"View SQL"},null,8,["id","sql"])):H("",!0),o.data.truncated?(b(),k("div",Lv," Showing only the first "+D(o.data.rowCount)+" rows. ",1)):H("",!0),x("div",{class:"overflow-hidden rounded-lg border max-h-96",style:Qt({height:`${_(a)}px`})},[S(js,{columns:_(n),data:_(s),"column-key-by":"field","has-hash-index":!1,class:"h-full w-full"},null,8,["columns","data"])],4),x("div",Ev," Showing "+D(_(s).length)+" row"+D(_(s).length===1?"":"s"),1)],64))}}),Iv={class:"flex flex-wrap items-center justify-between gap-2"},$v={class:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground"},Bv={class:"text-xs text-muted-foreground"},Ov={key:0,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},Fv={class:"overflow-hidden rounded-xl border bg-background/90 p-2 pt-8"},jv={class:"agent-chart-container"},Nv=X({__name:"AgentVisualizeTableBlock",props:{data:{}},setup(t){ha([ku,Cu,Pu,Zu,ic,Mu,Du,Vu]);const e=t,n=L(()=>`agent-visualize-table-${e.data.chartType}-${e.data.sql}`),s=L(()=>e.data.chartType.replace("_"," ")),i=L(()=>e.data.chartType==="pie"?{tooltip:{trigger:"item"},legend:{bottom:0},series:[{type:"pie",radius:["35%","68%"],data:e.data.points.map(a=>({name:a.label,value:a.y}))}]}:e.data.chartType==="scatter"?{tooltip:{trigger:"item"},grid:{left:16,right:16,top:24,bottom:24,containLabel:!0},xAxis:{type:"value",name:e.data.xField},yAxis:{type:"value",name:e.data.yField},series:[{type:"scatter",symbolSize:10,data:e.data.points.map(a=>[a.x,a.y])}]}:{tooltip:{trigger:"axis"},grid:{left:16,right:16,top:24,bottom:24,containLabel:!0},xAxis:{type:"category",name:e.data.xField,data:e.data.points.map(a=>a.label),axisLabel:{hideOverlap:!0}},yAxis:{type:"value",name:e.data.yField},series:[{type:e.data.chartType,smooth:e.data.chartType==="line",data:e.data.points.map(a=>a.y)}]});return(a,o)=>{const r=Ve;return b(),k(le,null,[x("div",Iv,[x("div",$v,[S(r,{variant:"secondary",class:"uppercase tracking-[0.16em]"},{default:M(()=>[q(D(_(s)),1)]),_:1}),a.data.xField?(b(),K(r,{key:0,variant:"outline"},{default:M(()=>[q(" X: "+D(a.data.xField),1)]),_:1})):H("",!0),a.data.yField?(b(),K(r,{key:1,variant:"outline"},{default:M(()=>[q(" Y: "+D(a.data.yField),1)]),_:1})):H("",!0)]),x("div",Bv,D(a.data.rowCount)+" point"+D(a.data.rowCount===1?"":"s"),1)]),S(hi,{id:_(n),sql:a.data.sql,label:"View SQL"},null,8,["id","sql"]),a.data.truncated?(b(),k("div",Ov," Showing only the first "+D(a.data.rowCount)+" points. ",1)):H("",!0),x("div",Fv,[x("div",jv,[S(_(Lu),{option:_(i),autoresize:"",class:"agent-chart"},null,8,["option"])])])],64)}}}),zv=ta(Nv,[["__scopeId","data-v-8ea150a2"]]),Uv={class:"min-w-0 flex-1 overflow-hidden"};const qv={class:"flex items-center gap-1 justify-center"},Hv=X({__name:"AgentMessageBubble",props:{message:{},getToolComponent:{type:Function},showReasoning:{type:Boolean},isStreaming:{type:Boolean},highlightedResponseId:{},registerMessageElement:{type:Function}},emits:["approval","edit","quiz-submit"],setup(t,{emit:e}){const n=t,s=e,{handleCopyWithKey:i,isCopied:a,getCopyIcon:o,getCopyIconClass:r,getCopyTooltip:l}=sa(),u=L(()=>n.message.role==="user"),c=d=>{u.value||!n.registerMessageElement||n.registerMessageElement(n.message.id,d)},h=L(()=>(n.message.blocks??[]).map(d=>d.kind==="text"||d.kind==="markdown"?d.content:d.kind==="code"?d.code:"").filter(Boolean).join(`
5
5
 
6
- `));return(d,f)=>{const p=me,g=_e,m=Os,v=Fs,C=Bs;return b(),k("div",{class:re(["w-full",u.value?"flex justify-end":"flex justify-start"]),ref:y=>c(y)},[x("div",{class:re(["flex w-full max-w-3xl gap-3",u.value?"justify-end":"items-start"])},[x("div",zv,[(u.value,H("",!0)),(b(!0),k(le,null,we(d.message.blocks,(y,$)=>(b(),k("div",{key:`${d.message.id}-${y.kind}-${$}`,class:re(["overflow-hidden chat-text",!u.value&&n.highlightedResponseId===d.message.id?"ring-1 ring-primary/25 bg-primary/6":"",u.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"])},[y.kind==="text"?(b(),K(_(Hp),{key:0,content:y.content,"is-block-streaming":y.isStreaming,"is-streaming":d.isStreaming,"is-user-message":u.value},null,8,["content","is-block-streaming","is-streaming","is-user-message"])):y.kind==="reasoning"&&d.showReasoning?(b(),K(_(Dv),{key:1,content:y.content,"is-streaming":y.isStreaming},null,8,["content","is-streaming"])):y.kind==="markdown"?(b(),K(_(sa),{key:2,content:y.content,"is-block-streaming":y.isStreaming,"is-streaming":d.isStreaming,"is-user-message":u.value},null,8,["content","is-block-streaming","is-streaming","is-user-message"])):y.kind==="code"?(b(),K(_(Dn),{key:3,id:`${d.message.id}-${$}`,code:y.code,language:y.language||"text","is-block-streaming":y.isStreaming,"is-streaming":d.isStreaming},null,8,["id","code","language","is-block-streaming","is-streaming"])):y.kind==="loading"?(b(),K(_(lm),{key:4,label:y.label},null,8,["label"])):y.kind==="error"?(b(),K(_(cm),{key:5,message:y.message},null,8,["message"])):y.kind==="tool"?(b(),K(_(fm),{key:6,"tool-name":y.toolName,result:y.result,"get-tool-component":d.getToolComponent},null,8,["tool-name","result","get-tool-component"])):y.kind==="approval"?(b(),K(_(Xg),{key:7,"tool-name":y.toolName,input:y.input,"approval-id":y.approvalId,onApprove:f[0]||(f[0]=P=>s("approval",P,!0)),onDeny:f[1]||(f[1]=P=>s("approval",P,!1))},null,8,["tool-name","input","approval-id"])):y.kind==="source"?(b(),K(_(xm),{key:8,"source-id":y.sourceId,url:y.url,title:y.title,"media-type":y.mediaType,filename:y.filename},null,8,["source-id","url","title","media-type","filename"])):y.kind==="quiz"?(b(),K(_(Om),{key:9,"tool-call-id":y.toolCallId,context:y.context,questions:y.questions,onSubmit:f[2]||(f[2]=P=>s("quiz-submit",P))},null,8,["tool-call-id","context","questions"])):H("",!0)],2))),128)),d.isStreaming?H("",!0):(b(),k("div",{key:1,class:re(["mt-1 flex items-center gap-1",u.value?"justify-end":"justify-start"])},[S(C,null,{default:M(()=>[S(m,{"as-child":""},{default:M(()=>[S(g,{size:"xxs",variant:"ghost",class:"h-4!",onClick:f[3]||(f[3]=y=>_(i)(d.message.id,h.value))},{default:M(()=>[x("span",Uv,[S(p,{name:_(o)(_(a)(d.message.id)),class:re(["size-3.5!",_(r)(_(a)(d.message.id))])},null,8,["name","class"]),_(a)(d.message.id)?(b(),k("span",{key:0,class:re(["text-[10px] font-medium leading-none",_(r)(_(a)(d.message.id))])},"Copied",2)):H("",!0)])]),_:1})]),_:1}),S(v,null,{default:M(()=>[x("p",null,D(_(l)(_(a)(d.message.id))),1)]),_:1})]),_:1}),u.value?(b(),K(C,{key:0},{default:M(()=>[S(m,{"as-child":""},{default:M(()=>[S(g,{size:"iconSm",variant:"ghost",class:"size-4!",onClick:f[4]||(f[4]=y=>s("edit",h.value))},{default:M(()=>[S(p,{name:"lucide:pencil",class:"size-3!"})]),_:1})]),_:1}),S(v,null,{default:M(()=>f[6]||(f[6]=[x("p",null,"Edit",-1)])),_:1})]),_:1})):H("",!0)],2))])],2)],2)}}}),Hv={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"},Kv={class:"text-xl font-medium tracking-tight"},Gv=X({__name:"AgentSetupCard",props:{currentProvider:{}},setup(t){const{openSettings:e}=Pl();return(n,s)=>{const i=me,a=_e;return b(),k("div",Hv,[x("h2",Kv,[S(i,{name:"lucide:key-round",class:"size-4! text-muted-foreground"}),q(" Connect "+D(n.currentProvider.name),1)]),s[2]||(s[2]=x("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)),S(a,{variant:"outline",size:"sm",class:"mt-6 rounded-2xl",onClick:s[0]||(s[0]=o=>_(e)("Agent"))},{default:M(()=>[S(i,{name:"lucide:settings-2",class:"size-4"}),s[1]||(s[1]=q(" Open Agent Settings "))]),_:1})])}}}),Wv={class:"mx-auto my-auto w-full max-w-3xl py-8"},Yv={class:"rounded-3xl p-5"},Xv={class:"flex items-start"},Qv={class:"min-w-0 flex-1"},Zv={class:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground"},Jv=X({__name:"AgentWelcomePanel",props:{promptCards:{},threadCount:{}},emits:["prompt"],setup(t,{emit:e}){const n=t;return(s,i)=>(b(),k("div",Wv,[x("div",Yv,[x("div",Xv,[x("div",Qv,[x("div",Zv,[i[0]||(i[0]=x("span",{class:"rounded-full bg-muted px-2.5 py-1 font-medium text-foreground"}," Orca Agent ",-1)),x("span",null,D(n.threadCount)+" saved threads ready to resume",1)]),i[1]||(i[1]=x("h2",{class:"mt-3 text-xl font-medium text-foreground"}," Ask for schema help, query ideas, or result checks. ",-1)),i[2]||(i[2]=x("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))])])])]))}}),ey={class:"flex flex-col items-center gap-1"},ty=["onClick"],ny=["aria-label"],sy={class:"line-clamp-3 leading-relaxed"},iy=X({__name:"ResponseNavigatorDotIndicator",props:{currentIndex:{},responses:{},position:{}},emits:["select"],setup(t,{emit:e}){const n=e;return(s,i)=>(b(),k("div",ey,[(b(!0),k(le,null,we(s.responses,(a,o)=>(b(),k("div",{key:a.id,class:"group relative flex items-center justify-center px-3 cursor-pointer",onClick:r=>n("select",o)},[x("button",{type:"button",class:re(["rounded-full transition-all duration-200 ease-out focus:outline-none focus:ring-2 focus:ring-primary/60 pointer-events-none",s.currentIndex===o?"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 ${o+1}`},null,10,ny),a.preview?(b(),k("div",{key:0,class:re(["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",s.position==="left"?"left-full ml-2":"right-full mr-2"])},[x("div",sy,D(a.preview),1)],2)):H("",!0)],8,ty))),128))]))}}),oy=X({__name:"ResponseNavigatorToast",props:{message:{},position:{}},setup(t){return(e,n)=>(b(),K(Zt,{"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:M(()=>[e.message?(b(),k("div",{key:0,class:re(["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",e.position==="right"?"right-full mr-3":"left-full ml-3"]),role:"status","aria-live":"polite"},D(e.message),3)):H("",!0)]),_:1}))}});function ay({currentIndex:t,total:e,onNavigate:n}){const s=Y("");let i=null;const a=L(()=>t.value>0),o=L(()=>t.value<e.value-1),r=d=>{s.value=d,i&&clearTimeout(i),i=setTimeout(()=>{s.value=""},1500)},l=d=>{d<0||d>=e.value||n(d)},u=()=>{if(!a.value){r("Already at first response");return}const d=t.value-1;l(d),r("Previous response")},c=()=>{if(!o.value){r("Already at last response");return}const d=t.value+1;l(d),r("Next response")},h=d=>{d.key==="ArrowUp"&&(d.preventDefault(),u()),d.key==="ArrowDown"&&(d.preventDefault(),c())};return Is(()=>{i&&clearTimeout(i)}),{canGoNext:o,canGoPrevious:a,goNext:c,goPrevious:u,handleKeydown:h,toastMessage:s}}const ry=X({__name:"ResponseNavigator",props:{responses:{},currentIndex:{},position:{default:"right"},offset:{default:()=>({})}},emits:["navigate"],setup(t,{emit:e}){const n=t,s=e,i=L(()=>n.responses.length),a=L(()=>({top:`calc(50% + ${n.offset.y??0}px)`,right:n.position==="right"?`${0+(n.offset.x??0)}px`:"auto",left:n.position==="left"?`${0+(n.offset.x??0)}px`:"auto",transform:"translateY(-50%)"})),{canGoNext:o,canGoPrevious:r,goNext:l,goPrevious:u,handleKeydown:c,toastMessage:h}=ay({currentIndex:Kt(n,"currentIndex"),total:i,onNavigate:d=>s("navigate",d)});return(d,f)=>{const p=me,g=_e,m=Os,v=Fs,C=Bs;return d.responses.length>0?(b(),k("div",{key:0,class:"absolute z-30 flex flex-col items-center gap-0.5",style:Qt(a.value),tabindex:"0",onKeydown:f[1]||(f[1]=(...y)=>_(c)&&_(c)(...y))},[S(oy,{message:_(h),position:d.position},null,8,["message","position"]),S(C,{"delay-duration":150},{default:M(()=>[S(m,{"as-child":""},{default:M(()=>[S(g,{size:"iconSm",variant:"ghost","aria-label":"Go to previous response","aria-disabled":!_(r),disabled:!_(r),onClick:_(u)},{default:M(()=>[S(p,{name:"lucide:chevron-up"})]),_:1},8,["aria-disabled","disabled","onClick"])]),_:1}),S(v,{side:d.position==="left"?"right":"left"},{default:M(()=>f[2]||(f[2]=[x("p",null,"Previous response",-1)])),_:1},8,["side"])]),_:1}),S(iy,{"current-index":d.currentIndex,responses:d.responses,position:d.position,onSelect:f[0]||(f[0]=y=>s("navigate",y))},null,8,["current-index","responses","position"]),S(C,{"delay-duration":150},{default:M(()=>[S(m,{"as-child":""},{default:M(()=>[S(g,{size:"iconSm",variant:"ghost","aria-label":"Go to next response","aria-disabled":!_(o),disabled:!_(o),onClick:_(l)},{default:M(()=>[S(p,{name:"lucide:chevron-down"})]),_:1},8,["aria-disabled","disabled","onClick"])]),_:1}),S(v,{side:d.position==="left"?"right":"left"},{default:M(()=>f[3]||(f[3]=[x("p",null,"Next response",-1)])),_:1},8,["side"])]),_:1})],36)):H("",!0)}}}),ly={class:"flex h-full flex-col bg-sidebar z-50 p-2 gap-2"},uy={class:"flex shrink-0 items-center justify-between gap-2"},cy={class:"flex items-center min-w-0 gap-1 flex-1"},dy={class:"flex flex-col"},hy={class:"truncate text-sm leading-4 font-medium text-foreground"},fy={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},py={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},my={class:"flex shrink-0 items-center justify-end gap-1"},gy={class:"flex-1 overflow-hidden min-h-0 flex flex-col"},vy={key:0,class:"rounded-xl border border-destructive/20 bg-destructive/5 p-4 text-sm text-destructive mx-2"},yy={key:1,class:"flex-1 w-full overflow-hidden rounded-xl border border-border/70 flex flex-col min-h-0 relative h-full"},xy=X({__name:"ExportPreviewPanel",props:{result:{}},emits:["close"],setup(t,{emit:e}){const n=t,s=e,{downloadFile:i}=ci(),a=new Set(["csv","tsv"]),o=L(()=>a.has(n.result.format)),r={json:"json",sql:"sql",markdown:"markdown",xml:"xml",yaml:"yaml",html:"html"},l=L(()=>r[n.result.format]),u=L(()=>n.result.preview.columns??[]),c=L(()=>n.result.preview.rows??[]),h=L(()=>n.result.encoding==="base64"?`${n.result.filename} is a binary spreadsheet file. Use Download to open it locally.`:n.result.content),d=L(()=>u.value.map(g=>({originalName:g,aliasFieldName:g,queryFieldName:g,tableName:"",type:"string",isPrimaryKey:!1,isForeignKey:!1,canMutate:!1}))),f=async()=>{await i(n.result)},p=L(()=>{const g=n.result.fileSize;return pa(g)});return(g,m)=>{const v=me,C=_e,y=Xl;return b(),k("div",ly,[x("div",uy,[x("div",cy,[S(v,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),x("div",dy,[x("h3",hy,D(g.result.filename),1),g.result.preview.truncated?(b(),k("p",fy," First "+D(c.value.length)+" rows ",1)):(b(),k("p",py," size: "+D(p.value)+" • type: "+D(g.result.format),1))])]),x("div",my,[S(C,{size:"xs",variant:"outline",disabled:!!g.result.error,onClick:f},{default:M(()=>[m[1]||(m[1]=q(" Download ")),S(v,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"]),S(C,{size:"iconMd",variant:"ghost",onClick:m[0]||(m[0]=$=>s("close"))},{default:M(()=>[S(v,{name:"lucide:x",class:"size-4"})]),_:1})])]),x("div",gy,[g.result.error?(b(),k("div",vy,D(g.result.error),1)):o.value?(b(),k("div",yy,[S(js,{columns:d.value,data:c.value,"column-key-by":"field",class:"h-full"},null,8,["columns","data"])])):(b(),K(y,{key:2,code:h.value,language:l.value,"max-height":"100%",class:"h-full rounded-xl overflow-auto border border-border/70"},null,8,["code","language"]))])])}}});function by(t){const{schemaStore:e,connectionStore:n}=Ml(),s=Y([]),i=Eu({api:"/api/ai/agent",body:()=>{var r,l;return{dbConnectionString:(r=n.selectedConnection)==null?void 0:r.connectionString,dbType:(l=n.selectedConnection)==null?void 0:l.type,schemaSnapshots:e.activeSchemas||[],selectedCommandOptions:s.value.length>0?[...s.value]:void 0,sendReasoning:(t==null?void 0:t.value)??!0}},sendAutomaticallyWhen:Ru}),a=()=>{if(!$l(i.messages.value))return;const r=Bl(i.messages.value);i.messages.value.splice(0,i.messages.value.length,...r)};return{...i,sendMessage:async(r,l=[])=>{a(),s.value=[...l];try{await i.sendMessage(r)}finally{s.value=[]}}}}const ze={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",AskClarification:"askClarification"},wy=[ze.GenerateQuery,ze.RenderTable,ze.VisualizeTable,ze.ExplainQuery,ze.DetectAnomaly,ze.DescribeTable,ze.ExportQueryResult,ze.ExportContent],Sy=/^#{1,6}\s|(\*\*|__).+(\*\*|__)|^[-*]\s|^\d+\.\s|^\|.+\|/m,_y=/```([\w-]*)\n?([\s\S]*?)```/g,Ty={generate_query:Av,render_table:Ev,visualize_table:Nv,explain_query:hv,detect_anomaly:Gg,describe_table:iv,export_query_result:Go,export_content:Go},Ay={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..."},ky=t=>wy.includes(t),Wo=(t,e)=>{const n=e.trim();n&&t.push({kind:Sy.test(n)?"markdown":"text",content:n})},Cy=(t,e=!1)=>{var i;const n=[];let s=0;for(const a of t.matchAll(_y)){const o=a.index??0;Wo(n,t.slice(s,o)),n.push({kind:"code",language:a[1]||"text",code:((i=a[2])==null?void 0:i.trimEnd())||""}),s=o+a[0].length}if(Wo(n,t.slice(s)),e)for(let a=n.length-1;a>=0;a-=1){const o=n[a];if((o==null?void 0:o.kind)==="text"||(o==null?void 0:o.kind)==="markdown"||(o==null?void 0:o.kind)==="code"){o.isStreaming=!0;break}}return n},sl=t=>t.errorText||t.message||t.error||"Something went wrong.",Py=t=>{var n,s,i;const e=String(t.type||"").replace(/^tool-/,"");return e===ze.AskClarification?t.state==="output-available"?[{kind:"quiz",toolCallId:String(t.toolCallId||""),context:String(((n=t.input)==null?void 0:n.context)||""),questions:Array.isArray((s=t.input)==null?void 0:s.questions)?t.input.questions:[]}]:[]:ky(e)?t.state==="input-streaming"||t.state==="input-available"?[{kind:"loading",toolName:e,toolCallId:t.toolCallId,label:Ay[e]}]:t.state==="approval-requested"?[{kind:"approval",toolName:e,toolCallId:t.toolCallId,input:t.input,approvalId:((i=t.approval)==null?void 0:i.id)||t.toolCallId}]:t.state==="output-available"?[{kind:"tool",toolName:e,toolCallId:t.toolCallId,result:t.output}]:t.state==="output-error"?[{kind:"error",message:sl(t)}]:t.state==="output-denied"?[{kind:"error",message:"Execution was denied. No database changes were made."}]:[]:[]},My=t=>{if(t.type==="text")return Cy(typeof t.text=="string"?t.text:"",t.state==="streaming");if(t.type==="reasoning"){const e=typeof t.text=="string"?t.text.trim():"";return e?[{kind:"reasoning",content:e,isStreaming:t.state==="streaming"}]:[]}return t.type==="source-url"?[{kind:"source",sourceId:t.sourceId||"",url:t.url,title:t.title}]:t.type==="source-document"?[{kind:"source",sourceId:t.sourceId||"",title:t.title,mediaType:t.mediaType,filename:t.filename}]:typeof t.type=="string"&&t.type.startsWith("tool-")?Py(t):t.type==="error"?[{kind:"error",message:sl(t)}]:[]};function Dy(t){const e=L(()=>{const a=t.value??[],o=[];for(let r=0;r<a.length;r++){const l=a[r];if(l.role==="system")continue;const u=l.parts??[],c=[];for(let d=0;d<u.length;d++){const f=My(u[d]);f!=null&&f.length&&c.push(...f)}if(c.length===0)continue;const h=[];for(const d of c){const f=h[h.length-1];if(d.kind==="reasoning"&&(f==null?void 0:f.kind)==="reasoning"){const p=[f.content,d.content].filter(Boolean).join(`
6
+ `));return(d,f)=>{const p=me,g=_e,m=Os,v=Fs,C=Bs;return b(),k("div",{class:re(["w-full",u.value?"flex justify-end":"flex justify-start"]),ref:y=>c(y)},[x("div",{class:re(["flex w-full max-w-3xl gap-3",u.value?"justify-end":"items-start"])},[x("div",Uv,[(u.value,H("",!0)),(b(!0),k(le,null,we(d.message.blocks,(y,$)=>(b(),k("div",{key:`${d.message.id}-${y.kind}-${$}`,class:re(["overflow-hidden chat-text",!u.value&&n.highlightedResponseId===d.message.id?"ring-1 ring-primary/25 bg-primary/6":"",u.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"])},[y.kind==="text"?(b(),K(_(Hp),{key:0,content:y.content,"is-block-streaming":y.isStreaming,"is-streaming":d.isStreaming,"is-user-message":u.value},null,8,["content","is-block-streaming","is-streaming","is-user-message"])):y.kind==="reasoning"&&d.showReasoning?(b(),K(_(Vv),{key:1,content:y.content,"is-streaming":y.isStreaming},null,8,["content","is-streaming"])):y.kind==="markdown"?(b(),K(_(na),{key:2,content:y.content,"is-block-streaming":y.isStreaming,"is-streaming":d.isStreaming,"is-user-message":u.value},null,8,["content","is-block-streaming","is-streaming","is-user-message"])):y.kind==="code"?(b(),K(_(Dn),{key:3,id:`${d.message.id}-${$}`,code:y.code,language:y.language||"text","is-block-streaming":y.isStreaming,"is-streaming":d.isStreaming},null,8,["id","code","language","is-block-streaming","is-streaming"])):y.kind==="loading"?(b(),K(_(um),{key:4,label:y.label},null,8,["label"])):y.kind==="error"?(b(),K(_(dm),{key:5,message:y.message},null,8,["message"])):y.kind==="tool"?(b(),K(_(pm),{key:6,"tool-name":y.toolName,result:y.result,"get-tool-component":d.getToolComponent},null,8,["tool-name","result","get-tool-component"])):y.kind==="approval"?(b(),K(_(Qg),{key:7,"tool-name":y.toolName,input:y.input,"approval-id":y.approvalId,onApprove:f[0]||(f[0]=P=>s("approval",P,!0)),onDeny:f[1]||(f[1]=P=>s("approval",P,!1))},null,8,["tool-name","input","approval-id"])):y.kind==="source"?(b(),K(_(bm),{key:8,"source-id":y.sourceId,url:y.url,title:y.title,"media-type":y.mediaType,filename:y.filename},null,8,["source-id","url","title","media-type","filename"])):y.kind==="quiz"?(b(),K(_(Fm),{key:9,"tool-call-id":y.toolCallId,context:y.context,questions:y.questions,onSubmit:f[2]||(f[2]=P=>s("quiz-submit",P))},null,8,["tool-call-id","context","questions"])):H("",!0)],2))),128)),d.isStreaming?H("",!0):(b(),k("div",{key:1,class:re(["mt-1 flex items-center gap-1",u.value?"justify-end":"justify-start"])},[S(C,null,{default:M(()=>[S(m,{"as-child":""},{default:M(()=>[S(g,{size:"xxs",variant:"ghost",class:"h-4!",onClick:f[3]||(f[3]=y=>_(i)(d.message.id,h.value))},{default:M(()=>[x("span",qv,[S(p,{name:_(o)(_(a)(d.message.id)),class:re(["size-3.5!",_(r)(_(a)(d.message.id))])},null,8,["name","class"]),_(a)(d.message.id)?(b(),k("span",{key:0,class:re(["text-[10px] font-medium leading-none",_(r)(_(a)(d.message.id))])},"Copied",2)):H("",!0)])]),_:1})]),_:1}),S(v,null,{default:M(()=>[x("p",null,D(_(l)(_(a)(d.message.id))),1)]),_:1})]),_:1}),u.value?(b(),K(C,{key:0},{default:M(()=>[S(m,{"as-child":""},{default:M(()=>[S(g,{size:"iconSm",variant:"ghost",class:"size-4!",onClick:f[4]||(f[4]=y=>s("edit",h.value))},{default:M(()=>[S(p,{name:"lucide:pencil",class:"size-3!"})]),_:1})]),_:1}),S(v,null,{default:M(()=>f[6]||(f[6]=[x("p",null,"Edit",-1)])),_:1})]),_:1})):H("",!0)],2))])],2)],2)}}}),Kv={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"},Gv={class:"text-xl font-medium tracking-tight"},Wv=X({__name:"AgentSetupCard",props:{currentProvider:{}},setup(t){const{openSettings:e}=Pl();return(n,s)=>{const i=me,a=_e;return b(),k("div",Kv,[x("h2",Gv,[S(i,{name:"lucide:key-round",class:"size-4! text-muted-foreground"}),q(" Connect "+D(n.currentProvider.name),1)]),s[2]||(s[2]=x("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)),S(a,{variant:"outline",size:"sm",class:"mt-6 rounded-2xl",onClick:s[0]||(s[0]=o=>_(e)("Agent"))},{default:M(()=>[S(i,{name:"lucide:settings-2",class:"size-4"}),s[1]||(s[1]=q(" Open Agent Settings "))]),_:1})])}}}),Yv={class:"mx-auto my-auto w-full max-w-3xl py-8"},Xv={class:"rounded-3xl p-5"},Qv={class:"flex items-start"},Zv={class:"min-w-0 flex-1"},Jv={class:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground"},ey=X({__name:"AgentWelcomePanel",props:{promptCards:{},threadCount:{}},emits:["prompt"],setup(t,{emit:e}){const n=t;return(s,i)=>(b(),k("div",Yv,[x("div",Xv,[x("div",Qv,[x("div",Zv,[x("div",Jv,[i[0]||(i[0]=x("span",{class:"rounded-full bg-muted px-2.5 py-1 font-medium text-foreground"}," Orca Agent ",-1)),x("span",null,D(n.threadCount)+" saved threads ready to resume",1)]),i[1]||(i[1]=x("h2",{class:"mt-3 text-xl font-medium text-foreground"}," Ask for schema help, query ideas, or result checks. ",-1)),i[2]||(i[2]=x("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))])])])]))}}),ty={class:"flex flex-col items-center gap-1"},ny=["onClick"],sy=["aria-label"],iy={class:"line-clamp-3 leading-relaxed"},oy=X({__name:"ResponseNavigatorDotIndicator",props:{currentIndex:{},responses:{},position:{}},emits:["select"],setup(t,{emit:e}){const n=e;return(s,i)=>(b(),k("div",ty,[(b(!0),k(le,null,we(s.responses,(a,o)=>(b(),k("div",{key:a.id,class:"group relative flex items-center justify-center px-3 cursor-pointer",onClick:r=>n("select",o)},[x("button",{type:"button",class:re(["rounded-full transition-all duration-200 ease-out focus:outline-none focus:ring-2 focus:ring-primary/60 pointer-events-none",s.currentIndex===o?"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 ${o+1}`},null,10,sy),a.preview?(b(),k("div",{key:0,class:re(["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",s.position==="left"?"left-full ml-2":"right-full mr-2"])},[x("div",iy,D(a.preview),1)],2)):H("",!0)],8,ny))),128))]))}}),ay=X({__name:"ResponseNavigatorToast",props:{message:{},position:{}},setup(t){return(e,n)=>(b(),K(Zt,{"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:M(()=>[e.message?(b(),k("div",{key:0,class:re(["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",e.position==="right"?"right-full mr-3":"left-full ml-3"]),role:"status","aria-live":"polite"},D(e.message),3)):H("",!0)]),_:1}))}});function ry({currentIndex:t,total:e,onNavigate:n}){const s=Y("");let i=null;const a=L(()=>t.value>0),o=L(()=>t.value<e.value-1),r=d=>{s.value=d,i&&clearTimeout(i),i=setTimeout(()=>{s.value=""},1500)},l=d=>{d<0||d>=e.value||n(d)},u=()=>{if(!a.value){r("Already at first response");return}const d=t.value-1;l(d),r("Previous response")},c=()=>{if(!o.value){r("Already at last response");return}const d=t.value+1;l(d),r("Next response")},h=d=>{d.key==="ArrowUp"&&(d.preventDefault(),u()),d.key==="ArrowDown"&&(d.preventDefault(),c())};return Is(()=>{i&&clearTimeout(i)}),{canGoNext:o,canGoPrevious:a,goNext:c,goPrevious:u,handleKeydown:h,toastMessage:s}}const ly=X({__name:"ResponseNavigator",props:{responses:{},currentIndex:{},position:{default:"right"},offset:{default:()=>({})}},emits:["navigate"],setup(t,{emit:e}){const n=t,s=e,i=L(()=>n.responses.length),a=L(()=>({top:`calc(50% + ${n.offset.y??0}px)`,right:n.position==="right"?`${0+(n.offset.x??0)}px`:"auto",left:n.position==="left"?`${0+(n.offset.x??0)}px`:"auto",transform:"translateY(-50%)"})),{canGoNext:o,canGoPrevious:r,goNext:l,goPrevious:u,handleKeydown:c,toastMessage:h}=ry({currentIndex:Kt(n,"currentIndex"),total:i,onNavigate:d=>s("navigate",d)});return(d,f)=>{const p=me,g=_e,m=Os,v=Fs,C=Bs;return d.responses.length>0?(b(),k("div",{key:0,class:"absolute z-30 flex flex-col items-center gap-0.5",style:Qt(a.value),tabindex:"0",onKeydown:f[1]||(f[1]=(...y)=>_(c)&&_(c)(...y))},[S(ay,{message:_(h),position:d.position},null,8,["message","position"]),S(C,{"delay-duration":150},{default:M(()=>[S(m,{"as-child":""},{default:M(()=>[S(g,{size:"iconSm",variant:"ghost","aria-label":"Go to previous response","aria-disabled":!_(r),disabled:!_(r),onClick:_(u)},{default:M(()=>[S(p,{name:"lucide:chevron-up"})]),_:1},8,["aria-disabled","disabled","onClick"])]),_:1}),S(v,{side:d.position==="left"?"right":"left"},{default:M(()=>f[2]||(f[2]=[x("p",null,"Previous response",-1)])),_:1},8,["side"])]),_:1}),S(oy,{"current-index":d.currentIndex,responses:d.responses,position:d.position,onSelect:f[0]||(f[0]=y=>s("navigate",y))},null,8,["current-index","responses","position"]),S(C,{"delay-duration":150},{default:M(()=>[S(m,{"as-child":""},{default:M(()=>[S(g,{size:"iconSm",variant:"ghost","aria-label":"Go to next response","aria-disabled":!_(o),disabled:!_(o),onClick:_(l)},{default:M(()=>[S(p,{name:"lucide:chevron-down"})]),_:1},8,["aria-disabled","disabled","onClick"])]),_:1}),S(v,{side:d.position==="left"?"right":"left"},{default:M(()=>f[3]||(f[3]=[x("p",null,"Next response",-1)])),_:1},8,["side"])]),_:1})],36)):H("",!0)}}}),uy={class:"flex h-full flex-col bg-sidebar z-50 p-2 gap-2"},cy={class:"flex shrink-0 items-center justify-between gap-2"},dy={class:"flex items-center min-w-0 gap-1 flex-1"},hy={class:"flex flex-col"},fy={class:"truncate text-sm leading-4 font-medium text-foreground"},py={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},my={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},gy={class:"flex shrink-0 items-center justify-end gap-1"},vy={class:"flex-1 overflow-hidden min-h-0 flex flex-col"},yy={key:0,class:"rounded-xl border border-destructive/20 bg-destructive/5 p-4 text-sm text-destructive mx-2"},xy={key:1,class:"flex-1 w-full overflow-hidden rounded-xl border border-border/70 flex flex-col min-h-0 relative h-full"},by=X({__name:"ExportPreviewPanel",props:{result:{}},emits:["close"],setup(t,{emit:e}){const n=t,s=e,{downloadFile:i}=ci(),a=new Set(["csv","tsv"]),o=L(()=>a.has(n.result.format)),r={json:"json",sql:"sql",markdown:"markdown",xml:"xml",yaml:"yaml",html:"html"},l=L(()=>r[n.result.format]),u=L(()=>n.result.preview.columns??[]),c=L(()=>n.result.preview.rows??[]),h=L(()=>n.result.encoding==="base64"?`${n.result.filename} is a binary spreadsheet file. Use Download to open it locally.`:n.result.content),d=L(()=>u.value.map(g=>({originalName:g,aliasFieldName:g,queryFieldName:g,tableName:"",type:"string",isPrimaryKey:!1,isForeignKey:!1,canMutate:!1}))),f=async()=>{await i(n.result)},p=L(()=>{const g=n.result.fileSize;return fa(g)});return(g,m)=>{const v=me,C=_e,y=Xl;return b(),k("div",uy,[x("div",cy,[x("div",dy,[S(v,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),x("div",hy,[x("h3",fy,D(g.result.filename),1),g.result.preview.truncated?(b(),k("p",py," First "+D(c.value.length)+" rows ",1)):(b(),k("p",my," size: "+D(p.value)+" • type: "+D(g.result.format),1))])]),x("div",gy,[S(C,{size:"xs",variant:"outline",disabled:!!g.result.error,onClick:f},{default:M(()=>[m[1]||(m[1]=q(" Download ")),S(v,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"]),S(C,{size:"iconMd",variant:"ghost",onClick:m[0]||(m[0]=$=>s("close"))},{default:M(()=>[S(v,{name:"lucide:x",class:"size-4"})]),_:1})])]),x("div",vy,[g.result.error?(b(),k("div",yy,D(g.result.error),1)):o.value?(b(),k("div",xy,[S(js,{columns:d.value,data:c.value,"column-key-by":"field",class:"h-full"},null,8,["columns","data"])])):(b(),K(y,{key:2,code:h.value,language:l.value,"max-height":"100%",class:"h-full rounded-xl overflow-auto border border-border/70"},null,8,["code","language"]))])])}}});function wy(t){const{schemaStore:e,connectionStore:n}=Ml(),s=Y([]),i=Eu({api:"/api/ai/agent",body:()=>{var r,l;return{dbConnectionString:(r=n.selectedConnection)==null?void 0:r.connectionString,dbType:(l=n.selectedConnection)==null?void 0:l.type,schemaSnapshots:e.activeSchemas||[],selectedCommandOptions:s.value.length>0?[...s.value]:void 0,sendReasoning:(t==null?void 0:t.value)??!0}},sendAutomaticallyWhen:Ru}),a=()=>{if(!$l(i.messages.value))return;const r=Bl(i.messages.value);i.messages.value.splice(0,i.messages.value.length,...r)};return{...i,sendMessage:async(r,l=[])=>{a(),s.value=[...l];try{await i.sendMessage(r)}finally{s.value=[]}}}}const ze={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",AskClarification:"askClarification"},Sy=[ze.GenerateQuery,ze.RenderTable,ze.VisualizeTable,ze.ExplainQuery,ze.DetectAnomaly,ze.DescribeTable,ze.ExportQueryResult,ze.ExportContent],_y=/^#{1,6}\s|(\*\*|__).+(\*\*|__)|^[-*]\s|^\d+\.\s|^\|.+\|/m,Ty=/```([\w-]*)\n?([\s\S]*?)```/g,Ay={generate_query:kv,render_table:Rv,visualize_table:zv,explain_query:fv,detect_anomaly:Wg,describe_table:ov,export_query_result:Go,export_content:Go},ky={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..."},Cy=t=>Sy.includes(t),Wo=(t,e)=>{const n=e.trim();n&&t.push({kind:_y.test(n)?"markdown":"text",content:n})},Py=(t,e=!1)=>{var i;const n=[];let s=0;for(const a of t.matchAll(Ty)){const o=a.index??0;Wo(n,t.slice(s,o)),n.push({kind:"code",language:a[1]||"text",code:((i=a[2])==null?void 0:i.trimEnd())||""}),s=o+a[0].length}if(Wo(n,t.slice(s)),e)for(let a=n.length-1;a>=0;a-=1){const o=n[a];if((o==null?void 0:o.kind)==="text"||(o==null?void 0:o.kind)==="markdown"||(o==null?void 0:o.kind)==="code"){o.isStreaming=!0;break}}return n},nl=t=>t.errorText||t.message||t.error||"Something went wrong.",My=t=>{var n,s,i;const e=String(t.type||"").replace(/^tool-/,"");return e===ze.AskClarification?t.state==="output-available"?[{kind:"quiz",toolCallId:String(t.toolCallId||""),context:String(((n=t.input)==null?void 0:n.context)||""),questions:Array.isArray((s=t.input)==null?void 0:s.questions)?t.input.questions:[]}]:[]:Cy(e)?t.state==="input-streaming"||t.state==="input-available"?[{kind:"loading",toolName:e,toolCallId:t.toolCallId,label:ky[e]}]:t.state==="approval-requested"?[{kind:"approval",toolName:e,toolCallId:t.toolCallId,input:t.input,approvalId:((i=t.approval)==null?void 0:i.id)||t.toolCallId}]:t.state==="output-available"?[{kind:"tool",toolName:e,toolCallId:t.toolCallId,result:t.output}]:t.state==="output-error"?[{kind:"error",message:nl(t)}]:t.state==="output-denied"?[{kind:"error",message:"Execution was denied. No database changes were made."}]:[]:[]},Dy=t=>{if(t.type==="text")return Py(typeof t.text=="string"?t.text:"",t.state==="streaming");if(t.type==="reasoning"){const e=typeof t.text=="string"?t.text.trim():"";return e?[{kind:"reasoning",content:e,isStreaming:t.state==="streaming"}]:[]}return t.type==="source-url"?[{kind:"source",sourceId:t.sourceId||"",url:t.url,title:t.title}]:t.type==="source-document"?[{kind:"source",sourceId:t.sourceId||"",title:t.title,mediaType:t.mediaType,filename:t.filename}]:typeof t.type=="string"&&t.type.startsWith("tool-")?My(t):t.type==="error"?[{kind:"error",message:nl(t)}]:[]};function Vy(t){const e=L(()=>{const a=t.value??[],o=[];for(let r=0;r<a.length;r++){const l=a[r];if(l.role==="system")continue;const u=l.parts??[],c=[];for(let d=0;d<u.length;d++){const f=Dy(u[d]);f!=null&&f.length&&c.push(...f)}if(c.length===0)continue;const h=[];for(const d of c){const f=h[h.length-1];if(d.kind==="reasoning"&&(f==null?void 0:f.kind)==="reasoning"){const p=[f.content,d.content].filter(Boolean).join(`
7
7
 
8
- `);h[h.length-1]={kind:"reasoning",content:p,isStreaming:f.isStreaming||d.isStreaming}}else h.push(d)}o.push({id:l.id,role:l.role,blocks:h})}return o}),n=L(()=>e.value.some(a=>a.blocks.some(o=>o.kind==="approval"))),s=a=>Ty[a]||null,i=L(()=>{const a=e.value[e.value.length-1];if(!a)return null;const o=a.blocks[a.blocks.length-1];return o?o.kind:null});return{renderedMessages:e,hasMutationPending:n,getComponent:s,getLastPartKindMessage:i}}const Vy=["motion-key","initial"],Yo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=[]{}|;:,.<>?/~アイウエオカキクケコサシスセソタチツテトナニヌネノ░▒▓█▌▐▄▀■□▪▫▲△▼▽◆◇○●◎∞≈≠≤≥±÷×√∑πΩµ",Ly=X({__name:"ScrambleText",props:{texts:{},duration:{default:800},speed:{default:55},loop:{type:Boolean,default:!0},loopDelay:{default:600}},setup(t){const e=t,n=Y([]);let s=0,i=0,a=0,o=0,r="scramble",l=0,u=[];function c(){return Yo[Math.random()*Yo.length|0]}function h(){return Math.random()>.5?1:-1}function d(){u=[...e.texts[o]],n.value=u.map(()=>({char:"",reveal:!1,dir:h(),v:0}))}function f(p){const g=u.length,m=g/2|0;i||(i=p);const v=p-i;if(r==="scramble"){if(p-a>e.speed){for(let C=0;C<g;C++)n.value[C].reveal||(n.value[C].char=c(),n.value[C].v++);a=p}v>e.duration&&(r="reveal",l=p)}if(r==="reveal"){const C=p-l;for(let y=0;y<g;y++){const $=Math.abs(y-m)*40;C>$&&!n.value[y].reveal&&(n.value[y].char=u[y],n.value[y].reveal=!0,n.value[y].v++)}C>m*40+200&&(r="wait",i=p)}r==="wait"&&p-i>e.loopDelay&&(o=(o+1)%e.texts.length,d(),r="scramble",i=p),s=requestAnimationFrame(f)}return Rs(()=>{d(),s=requestAnimationFrame(f)}),Zo(()=>{cancelAnimationFrame(s)}),(p,g)=>{const m=Dl("motion");return b(),k("span",Jo({class:"inline-flex select-none"},p.$attrs),[(b(!0),k(le,null,we(n.value,(v,C)=>Vl((b(),k("span",{key:C,"motion-key":v.v,initial:{opacity:0,y:v.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"},[q(D(v.char),1)],8,Vy)),[[m]])),128))],16)}}}),Ey={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)))]"},Ry={class:"absolute inset-0 flex flex-col overflow-hidden"},Iy={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 border-b bg-background/50 backdrop-blur-sm"},$y={class:"flex flex-1 items-center gap-2 min-w-0 text-sm leading-4 font-medium text-foreground"},By={key:0,class:"flex-1 max-w-md"},Oy={class:"truncate text-foreground"},Fy={class:"flex shrink-0 items-center gap-2"},jy={class:"mx-auto flex min-h-full w-full max-w-5xl flex-col px-6 py-8"},Ny={key:2,class:"w-full pb-6"},zy={class:"space-y-4"},Uy={key:0,class:"flex gap-1 items-center mt-2"},qy={class:"font-medium text-muted-foreground chat-text"},Hy={key:1,class:"mt-4 overflow-hidden rounded-2xl border border-destructive/15 bg-destructive/5 backdrop-blur-sm"},Ky={class:"flex items-start gap-3 px-4 py-3"},Gy={class:"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full bg-destructive/10"},Wy={class:"min-w-0 flex-1"},Yy={class:"mt-0.5 text-sm leading-relaxed text-destructive"},A0=X({__name:"AgentWorkspace",setup(t){const e=Y(null);Qo("activeExportPreview",e);const{activeHistory:n,histories:s,showAttachmentPanel:i,showReasoning:a,saveConversation:o,startNewChat:r,renameHistory:l}=Ol(),u=Y(!1),c=Y(""),h=Y(null),d=()=>{n.value&&(c.value=n.value.title,u.value=!0,Ie(()=>{var R,O;(R=h.value)==null||R.focus(),(O=h.value)==null||O.select()}))},f=()=>{if(!n.value||!u.value)return;const R=c.value.trim();R&&R!==n.value.title&&l(n.value.id,R),u.value=!1},p=()=>{u.value=!1},g=Ll(),m=L(()=>g.chatUiConfigs.thinkingStyle),{selectedProvider:v,selectedModel:C,isLoading:y,error:$,messages:P,hasApiKey:V,currentProvider:T,sendMessage:w,addToolApprovalResponse:B,stopStream:E}=by(a),{renderedMessages:z,getComponent:F,getLastPartKindMessage:te}=Dy(P),A=Y(""),I=Y([]),N=Y(null),G=Y(null),W=Y(!1),U=Y(null),Q=R=>JSON.parse(JSON.stringify(R)),Z=Y(!1),J=Y(null),ge=Y(0),ue=Y({});let Le=null;Se(i,R=>{R&&(e.value=null)},{immediate:!0}),Se(e,R=>{R&&(i.value=!1)});const je=L(()=>z.value.flatMap(R=>{if(R.role!=="assistant")return[];const O=(R.blocks??[]).map(ne=>ne.kind==="text"||ne.kind==="markdown"||ne.kind==="reasoning"?ne.content:"").filter(Boolean).join(" ").trim().replace(/\s+/g," ");return[{id:R.id,type:"message",element:ue.value[R.id]??null,preview:O.length>80?O.slice(0,80)+"...":O||"Thinking..."}]})),xt=(R,O)=>{if(O instanceof HTMLElement){ue.value[R]=O;return}delete ue.value[R]},Ee=()=>{if(!N.value||je.value.length===0){ge.value=0;return}const{scrollTop:R,scrollHeight:O,clientHeight:ne}=N.value;if(O-R-ne<50){ge.value=je.value.length-1;return}const $t=N.value.getBoundingClientRect().top;let it=0;je.value.forEach((Bt,rn)=>{var ln;(((ln=Bt.element)==null?void 0:ln.getBoundingClientRect().top)??1/0)-$t<=150&&(it=rn)}),ge.value=it},Rt=()=>{if(!N.value)return;const{scrollTop:R,scrollHeight:O,clientHeight:ne}=N.value;Z.value=O-R-ne>150,Ee()},Pe=(R=!1)=>{N.value&&(N.value.scrollTo({top:N.value.scrollHeight,behavior:R===!0?"smooth":"auto"}),Z.value=!1)};Rs(()=>{setTimeout(()=>{Pe()},100)});const bt=R=>{P.value.splice(0,P.value.length,...R)},wt=async R=>{if(R==null||R.preventDefault(),!A.value.trim()||y.value)return;const O=A.value.trim(),ne=[...I.value];A.value="",I.value=[],w(O,ne),await Ie(),Pe()},sn=R=>{R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),wt(R))},on=async R=>{A.value=R,await Ie(),await wt()},tt=()=>{E()},Ke=()=>{r(),I.value=[],bt([])},nt=async(R,O)=>{await B({id:R,approved:O})},Vn=async R=>{var O;A.value=R,await Ie(),(O=G.value)==null||O.focusInput()},Ge=R=>{const O=je.value[R];if(!(O!=null&&O.element)||(ge.value=R,J.value=O.id,Le&&clearTimeout(Le),Le=setTimeout(()=>{J.value=null},250),!N.value))return;const ne=N.value,$t=O.element.getBoundingClientRect().top,it=ne.getBoundingClientRect().top,Bt=ne.scrollTop;ne.scrollTo({top:Bt+($t-it)-24,behavior:"smooth"})},Ln=Il(()=>{W.value||P.value.length===0||o({messages:Q(P.value),provider:v.value,model:C.value,showReasoning:a.value})},250);Se(()=>{var R;return((R=n.value)==null?void 0:R.id)??null},async R=>{R!==U.value&&(W.value=!0,U.value=R,R&&n.value?(bt(Q(n.value.messages)),n.value.provider&&(v.value=n.value.provider),n.value.model&&(C.value=n.value.model),typeof n.value.showReasoning=="boolean"&&(a.value=n.value.showReasoning)):P.value.length>0&&bt([]),await Ie(),Pe(),W.value=!1)},{immediate:!0}),Se(()=>P.value.length,async()=>{await Ie(),Pe(),Ee()}),Se(()=>{const R=P.value.at(-1);return R!=null&&R.parts?R.parts.map(O=>O.type==="text"||O.type==="reasoning"?O.text||"":JSON.stringify(O)).join(""):""},async()=>{await Ie(),Pe(),Ee()}),Se(()=>z.value.flatMap(R=>R.role!=="assistant"?[]:[R.id]),R=>{const O={};for(const ne of R)ue.value[ne]&&(O[ne]=ue.value[ne]);ue.value=O}),Is(()=>{Le&&clearTimeout(Le)}),Se(()=>[P.value,C.value,v.value,a.value],()=>{!P.value.length||W.value||Ln()},{deep:!0});const st=L(()=>{const R=P.value[0];if(!R||!R.parts||!R.parts.length)return"New Chat";const O=R.parts[0];return typeof O=="object"&&"text"in O?O.text:"New Chat"}),an=async R=>{await w(R),await Ie(),Pe()},It=L(()=>["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(R=>!!R));return(R,O)=>{const ne=me,$t=El,it=_e,Bt=ui,rn=Fl,fi=jl,ln=Nl;return b(),k("section",Ey,[S(ln,{direction:"horizontal",class:"h-full w-full"},{default:M(()=>[S(rn,{"default-size":e.value||_(i)?60:100,class:"h-full relative"},{default:M(()=>{var un;return[x("div",Ry,[x("div",Iy,[x("div",$y,[S(ne,{name:"hugeicons:chatting-01",class:"size-4! shrink-0"}),u.value?(b(),k("div",By,[S($t,{ref_key:"titleInputRef",ref:h,modelValue:c.value,"onUpdate:modelValue":O[0]||(O[0]=de=>c.value=de),class:"h-7 text-xs py-0",onKeydown:[gi(f,["enter"]),gi(p,["escape"])],onBlur:f},null,8,["modelValue"])])):(b(),k("div",{key:1,class:"flex items-center gap-2 truncate group cursor-pointer",onClick:d},[x("span",Oy,D(((un=_(n))==null?void 0:un.title)||st.value),1),S(ne,{name:"hugeicons:edit-02",class:"size-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]))]),x("div",Fy,[S(it,{size:"xs",variant:"ghost",onClick:O[1]||(O[1]=de=>i.value=!_(i))},{default:M(()=>[O[10]||(O[10]=q(" Attachment ")),S(ne,{name:"hugeicons:attachment",class:"size-3"})]),_:1}),S(it,{size:"xs",variant:"outline",onClick:Ke},{default:M(()=>[O[11]||(O[11]=q(" New Thread ")),S(ne,{name:"hugeicons:plus-sign",class:"size-3"})]),_:1})])]),x("div",{ref_key:"messagesContainer",ref:N,class:"flex-1 overflow-y-auto min-h-0",onScroll:Rt},[x("div",jy,[_(V)?_(z).length===0?(b(),K(Jv,{key:1,"prompt-cards":It.value,"thread-count":_(s).length,onPrompt:on},null,8,["prompt-cards","thread-count"])):(b(),k("div",Ny,[x("div",zy,[(b(!0),k(le,null,we(_(z),de=>{var pi;return b(),k("div",{key:de.id},[S(qv,{message:de,"get-tool-component":_(F),"show-reasoning":_(a),"highlighted-response-id":J.value,"register-message-element":xt,"is-streaming":_(y)&&de.role==="assistant"&&de.id===((pi=_(z).at(-1))==null?void 0:pi.id),onApproval:nt,onEdit:Vn,onQuizSubmit:an},null,8,["message","get-tool-component","show-reasoning","highlighted-response-id","is-streaming"])])}),128))]),_(y)?(b(),k("div",Uy,[S(ne,{class:"size-7! text-primary",name:"icons:logo-8-bits"}),x("div",qy,[m.value===_(Rl).Shimmer?(b(),K(Bt,{key:0},{default:M(()=>O[12]||(O[12]=[q(" Thinking... ")])),_:1})):(b(),K(_(Ly),{key:1,texts:["Thinking...","Orca_Thinking",_(te)||""]},null,8,["texts"]))])])):H("",!0),_($)?(b(),k("div",Hy,[x("div",Ky,[x("div",Gy,[S(ne,{name:"lucide:alert-triangle",class:"size-3.5 text-destructive/90"})]),x("div",Wy,[O[13]||(O[13]=x("p",{class:"text-[11px] font-semibold uppercase tracking-wider text-destructive/70"}," Error ",-1)),x("p",Yy,D(_($)),1)])])])):H("",!0)])):(b(),K(Gv,{key:0,class:"my-auto","current-provider":_(T)},null,8,["current-provider"]))])],544),je.value.length>0?(b(),K(ry,{key:0,responses:je.value,"current-index":ge.value,onNavigate:Ge},null,8,["responses","current-index"])):H("",!0),S(Bg,{ref_key:"footerRef",ref:G,modelValue:A.value,"onUpdate:modelValue":O[2]||(O[2]=de=>A.value=de),provider:_(v),"onUpdate:provider":O[3]||(O[3]=de=>vi(v)?v.value=de:null),model:_(C),"onUpdate:model":O[4]||(O[4]=de=>vi(C)?C.value=de:null),"selected-command-options":I.value,"onUpdate:selectedCommandOptions":O[5]||(O[5]=de=>I.value=de),"is-loading":_(y),"has-api-key":_(V),"show-reasoning":_(a),"show-scroll-button":Z.value,onSubmit:wt,onStop:tt,onKeydown:sn,"onUpdate:showReasoning":O[6]||(O[6]=de=>a.value=de),onScrollToBottom:O[7]||(O[7]=de=>Pe(!0))},null,8,["modelValue","provider","model","selected-command-options","is-loading","has-api-key","show-reasoning","show-scroll-button"])])]}),_:1},8,["default-size"]),e.value||_(i)?(b(),k(le,{key:0},[S(fi,{"with-handle":"",class:"[&[data-state=hover]]:bg-primary/30! [&[data-state=drag]]:bg-primary/20!"}),S(rn,{"min-size":20,"max-size":60,"default-size":30,class:"h-full relative"},{default:M(()=>[e.value?(b(),K(xy,{key:0,result:e.value,onClose:O[8]||(O[8]=un=>e.value=null)},null,8,["result"])):_(i)?(b(),K(cg,{key:1,messages:_(z),onClose:O[9]||(O[9]=un=>i.value=!1)},null,8,["messages"])):H("",!0)]),_:1})],64)):H("",!0)]),_:1})])}}});export{A0 as default};
8
+ `);h[h.length-1]={kind:"reasoning",content:p,isStreaming:f.isStreaming||d.isStreaming}}else h.push(d)}o.push({id:l.id,role:l.role,blocks:h})}return o}),n=L(()=>e.value.some(a=>a.blocks.some(o=>o.kind==="approval"))),s=a=>Ay[a]||null,i=L(()=>{const a=e.value[e.value.length-1];if(!a)return null;const o=a.blocks[a.blocks.length-1];return o?o.kind:null});return{renderedMessages:e,hasMutationPending:n,getComponent:s,getLastPartKindMessage:i}}const Ly=["motion-key","initial"],Yo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=[]{}|;:,.<>?/~アイウエオカキクケコサシスセソタチツテトナニヌネノ░▒▓█▌▐▄▀■□▪▫▲△▼▽◆◇○●◎∞≈≠≤≥±÷×√∑πΩµ",Ey=X({__name:"ScrambleText",props:{texts:{},duration:{default:800},speed:{default:55},loop:{type:Boolean,default:!0},loopDelay:{default:600}},setup(t){const e=t,n=Y([]);let s=0,i=0,a=0,o=0,r="scramble",l=0,u=[];function c(){return Yo[Math.random()*Yo.length|0]}function h(){return Math.random()>.5?1:-1}function d(){u=[...e.texts[o]],n.value=u.map(()=>({char:"",reveal:!1,dir:h(),v:0}))}function f(p){const g=u.length,m=g/2|0;i||(i=p);const v=p-i;if(r==="scramble"){if(p-a>e.speed){for(let C=0;C<g;C++)n.value[C].reveal||(n.value[C].char=c(),n.value[C].v++);a=p}v>e.duration&&(r="reveal",l=p)}if(r==="reveal"){const C=p-l;for(let y=0;y<g;y++){const $=Math.abs(y-m)*40;C>$&&!n.value[y].reveal&&(n.value[y].char=u[y],n.value[y].reveal=!0,n.value[y].v++)}C>m*40+200&&(r="wait",i=p)}r==="wait"&&p-i>e.loopDelay&&(o=(o+1)%e.texts.length,d(),r="scramble",i=p),s=requestAnimationFrame(f)}return Rs(()=>{d(),s=requestAnimationFrame(f)}),Zo(()=>{cancelAnimationFrame(s)}),(p,g)=>{const m=Dl("motion");return b(),k("span",Jo({class:"inline-flex select-none"},p.$attrs),[(b(!0),k(le,null,we(n.value,(v,C)=>Vl((b(),k("span",{key:C,"motion-key":v.v,initial:{opacity:0,y:v.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"},[q(D(v.char),1)],8,Ly)),[[m]])),128))],16)}}}),Ry={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)))]"},Iy={class:"absolute inset-0 flex flex-col overflow-hidden"},$y={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 border-b bg-background/50 backdrop-blur-sm"},By={class:"flex flex-1 items-center gap-2 min-w-0 text-sm leading-4 font-medium text-foreground"},Oy={key:0,class:"flex-1 max-w-md"},Fy={class:"truncate text-foreground"},jy={class:"flex shrink-0 items-center gap-2"},Ny={class:"mx-auto flex min-h-full w-full max-w-5xl flex-col px-6 py-8"},zy={key:2,class:"w-full pb-6"},Uy={class:"space-y-4"},qy={key:0,class:"flex gap-1 items-center mt-2"},Hy={class:"font-medium text-muted-foreground chat-text"},Ky={key:1,class:"mt-4 overflow-hidden rounded-2xl border border-destructive/15 bg-destructive/5 backdrop-blur-sm"},Gy={class:"flex items-start gap-3 px-4 py-3"},Wy={class:"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full bg-destructive/10"},Yy={class:"min-w-0 flex-1"},Xy={class:"mt-0.5 text-sm leading-relaxed text-destructive"},k0=X({__name:"AgentWorkspace",setup(t){const e=Y(null);Qo("activeExportPreview",e);const{activeHistory:n,histories:s,showAttachmentPanel:i,showReasoning:a,saveConversation:o,startNewChat:r,renameHistory:l}=Ol(),u=Y(!1),c=Y(""),h=Y(null),d=()=>{n.value&&(c.value=n.value.title,u.value=!0,$e(()=>{var R,O;(R=h.value)==null||R.focus(),(O=h.value)==null||O.select()}))},f=()=>{if(!n.value||!u.value)return;const R=c.value.trim();R&&R!==n.value.title&&l(n.value.id,R),u.value=!1},p=()=>{u.value=!1},g=Ll(),m=L(()=>g.chatUiConfigs.thinkingStyle),{selectedProvider:v,selectedModel:C,isLoading:y,error:$,messages:P,hasApiKey:V,currentProvider:T,sendMessage:w,addToolApprovalResponse:B,stopStream:E}=wy(a),{renderedMessages:z,getComponent:F,getLastPartKindMessage:te}=Vy(P),A=Y(""),I=Y([]),N=Y(null),G=Y(null),W=Y(!1),U=Y(null),Q=R=>JSON.parse(JSON.stringify(R)),Z=Y(!1),J=Y(null),ge=Y(0),ue=Y({});let Ee=null;Se(i,R=>{R&&(e.value=null)},{immediate:!0}),Se(e,R=>{R&&(i.value=!1)});const Ne=L(()=>z.value.flatMap(R=>{if(R.role!=="assistant")return[];const O=(R.blocks??[]).map(ne=>ne.kind==="text"||ne.kind==="markdown"||ne.kind==="reasoning"?ne.content:"").filter(Boolean).join(" ").trim().replace(/\s+/g," ");return[{id:R.id,type:"message",element:ue.value[R.id]??null,preview:O.length>80?O.slice(0,80)+"...":O||"Thinking..."}]})),xt=(R,O)=>{if(O instanceof HTMLElement){ue.value[R]=O;return}delete ue.value[R]},Re=()=>{if(!N.value||Ne.value.length===0){ge.value=0;return}const{scrollTop:R,scrollHeight:O,clientHeight:ne}=N.value;if(O-R-ne<50){ge.value=Ne.value.length-1;return}const $t=N.value.getBoundingClientRect().top;let it=0;Ne.value.forEach((Bt,rn)=>{var ln;(((ln=Bt.element)==null?void 0:ln.getBoundingClientRect().top)??1/0)-$t<=150&&(it=rn)}),ge.value=it},Rt=()=>{if(!N.value)return;const{scrollTop:R,scrollHeight:O,clientHeight:ne}=N.value;Z.value=O-R-ne>150,Re()},Pe=(R=!1)=>{N.value&&(N.value.scrollTo({top:N.value.scrollHeight,behavior:R===!0?"smooth":"auto"}),Z.value=!1)};Rs(()=>{setTimeout(()=>{Pe()},100)});const bt=R=>{P.value.splice(0,P.value.length,...R)},wt=async R=>{if(R==null||R.preventDefault(),!A.value.trim()||y.value)return;const O=A.value.trim(),ne=[...I.value];A.value="",I.value=[],w(O,ne),await $e(),Pe()},sn=R=>{R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),wt(R))},on=async R=>{A.value=R,await $e(),await wt()},tt=()=>{E()},Ke=()=>{r(),I.value=[],bt([])},nt=async(R,O)=>{await B({id:R,approved:O})},Vn=async R=>{var O;A.value=R,await $e(),(O=G.value)==null||O.focusInput()},Ge=R=>{const O=Ne.value[R];if(!(O!=null&&O.element)||(ge.value=R,J.value=O.id,Ee&&clearTimeout(Ee),Ee=setTimeout(()=>{J.value=null},250),!N.value))return;const ne=N.value,$t=O.element.getBoundingClientRect().top,it=ne.getBoundingClientRect().top,Bt=ne.scrollTop;ne.scrollTo({top:Bt+($t-it)-24,behavior:"smooth"})},Ln=Il(()=>{W.value||P.value.length===0||o({messages:Q(P.value),provider:v.value,model:C.value,showReasoning:a.value})},250);Se(()=>{var R;return((R=n.value)==null?void 0:R.id)??null},async R=>{R!==U.value&&(W.value=!0,U.value=R,R&&n.value?(bt(Q(n.value.messages)),n.value.provider&&(v.value=n.value.provider),n.value.model&&(C.value=n.value.model),typeof n.value.showReasoning=="boolean"&&(a.value=n.value.showReasoning)):P.value.length>0&&bt([]),await $e(),Pe(),W.value=!1)},{immediate:!0}),Se(()=>P.value.length,async()=>{await $e(),Pe(),Re()}),Se(()=>{const R=P.value.at(-1);return R!=null&&R.parts?R.parts.map(O=>O.type==="text"||O.type==="reasoning"?O.text||"":JSON.stringify(O)).join(""):""},async()=>{await $e(),Pe(),Re()}),Se(()=>z.value.flatMap(R=>R.role!=="assistant"?[]:[R.id]),R=>{const O={};for(const ne of R)ue.value[ne]&&(O[ne]=ue.value[ne]);ue.value=O}),Is(()=>{Ee&&clearTimeout(Ee)}),Se(()=>[P.value,C.value,v.value,a.value],()=>{!P.value.length||W.value||Ln()},{deep:!0});const st=L(()=>{const R=P.value[0];if(!R||!R.parts||!R.parts.length)return"New Chat";const O=R.parts[0];return typeof O=="object"&&"text"in O?O.text:"New Chat"}),an=async R=>{await w(R),await $e(),Pe()},It=L(()=>["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(R=>!!R));return(R,O)=>{const ne=me,$t=El,it=_e,Bt=ui,rn=Fl,fi=jl,ln=Nl;return b(),k("section",Ry,[S(ln,{direction:"horizontal",class:"h-full w-full"},{default:M(()=>[S(rn,{"default-size":e.value||_(i)?60:100,class:"h-full relative"},{default:M(()=>{var un;return[x("div",Iy,[x("div",$y,[x("div",By,[S(ne,{name:"hugeicons:chatting-01",class:"size-4! shrink-0"}),u.value?(b(),k("div",Oy,[S($t,{ref_key:"titleInputRef",ref:h,modelValue:c.value,"onUpdate:modelValue":O[0]||(O[0]=de=>c.value=de),class:"h-7 text-xs py-0",onKeydown:[gi(f,["enter"]),gi(p,["escape"])],onBlur:f},null,8,["modelValue"])])):(b(),k("div",{key:1,class:"flex items-center gap-2 truncate group cursor-pointer",onClick:d},[x("span",Fy,D(((un=_(n))==null?void 0:un.title)||st.value),1),S(ne,{name:"hugeicons:edit-02",class:"size-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]))]),x("div",jy,[S(it,{size:"xs",variant:"ghost",onClick:O[1]||(O[1]=de=>i.value=!_(i))},{default:M(()=>[O[10]||(O[10]=q(" Attachment ")),S(ne,{name:"hugeicons:attachment",class:"size-3"})]),_:1}),S(it,{size:"xs",variant:"outline",onClick:Ke},{default:M(()=>[O[11]||(O[11]=q(" New Thread ")),S(ne,{name:"hugeicons:plus-sign",class:"size-3"})]),_:1})])]),x("div",{ref_key:"messagesContainer",ref:N,class:"flex-1 overflow-y-auto min-h-0",onScroll:Rt},[x("div",Ny,[_(V)?_(z).length===0?(b(),K(ey,{key:1,"prompt-cards":It.value,"thread-count":_(s).length,onPrompt:on},null,8,["prompt-cards","thread-count"])):(b(),k("div",zy,[x("div",Uy,[(b(!0),k(le,null,we(_(z),de=>{var pi;return b(),k("div",{key:de.id},[S(Hv,{message:de,"get-tool-component":_(F),"show-reasoning":_(a),"highlighted-response-id":J.value,"register-message-element":xt,"is-streaming":_(y)&&de.role==="assistant"&&de.id===((pi=_(z).at(-1))==null?void 0:pi.id),onApproval:nt,onEdit:Vn,onQuizSubmit:an},null,8,["message","get-tool-component","show-reasoning","highlighted-response-id","is-streaming"])])}),128))]),_(y)?(b(),k("div",qy,[S(ne,{class:"size-7! text-primary",name:"icons:logo-8-bits"}),x("div",Hy,[m.value===_(Rl).Shimmer?(b(),K(Bt,{key:0},{default:M(()=>O[12]||(O[12]=[q(" Thinking... ")])),_:1})):(b(),K(_(Ey),{key:1,texts:["Thinking...","Orca_Thinking",_(te)||""]},null,8,["texts"]))])])):H("",!0),_($)?(b(),k("div",Ky,[x("div",Gy,[x("div",Wy,[S(ne,{name:"lucide:alert-triangle",class:"size-3.5 text-destructive/90"})]),x("div",Yy,[O[13]||(O[13]=x("p",{class:"text-[11px] font-semibold uppercase tracking-wider text-destructive/70"}," Error ",-1)),x("p",Xy,D(_($)),1)])])])):H("",!0)])):(b(),K(Wv,{key:0,class:"my-auto","current-provider":_(T)},null,8,["current-provider"]))])],544),Ne.value.length>0?(b(),K(ly,{key:0,responses:Ne.value,"current-index":ge.value,onNavigate:Ge},null,8,["responses","current-index"])):H("",!0),S(Og,{ref_key:"footerRef",ref:G,modelValue:A.value,"onUpdate:modelValue":O[2]||(O[2]=de=>A.value=de),provider:_(v),"onUpdate:provider":O[3]||(O[3]=de=>vi(v)?v.value=de:null),model:_(C),"onUpdate:model":O[4]||(O[4]=de=>vi(C)?C.value=de:null),"selected-command-options":I.value,"onUpdate:selectedCommandOptions":O[5]||(O[5]=de=>I.value=de),"is-loading":_(y),"has-api-key":_(V),"show-reasoning":_(a),"show-scroll-button":Z.value,onSubmit:wt,onStop:tt,onKeydown:sn,"onUpdate:showReasoning":O[6]||(O[6]=de=>a.value=de),onScrollToBottom:O[7]||(O[7]=de=>Pe(!0))},null,8,["modelValue","provider","model","selected-command-options","is-loading","has-api-key","show-reasoning","show-scroll-button"])])]}),_:1},8,["default-size"]),e.value||_(i)?(b(),k(le,{key:0},[S(fi,{"with-handle":"",class:"[&[data-state=hover]]:bg-primary/30! [&[data-state=drag]]:bg-primary/20!"}),S(rn,{"min-size":20,"max-size":60,"default-size":30,class:"h-full relative"},{default:M(()=>[e.value?(b(),K(by,{key:0,result:e.value,onClose:O[8]||(O[8]=un=>e.value=null)},null,8,["result"])):_(i)?(b(),K(dg,{key:1,messages:_(z),onClose:O[9]||(O[9]=un=>i.value=!1)},null,8,["messages"])):H("",!0)]),_:1})],64)):H("",!0)]),_:1})])}}});export{k0 as default};