orcaq 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{CDJKw_ak.js → -sZwfgN3.js} +1 -1
  3. package/.output/public/_nuxt/1iqadsOZ.js +1 -0
  4. package/.output/public/_nuxt/2WkPV7Mp.js +22 -0
  5. package/.output/public/_nuxt/{Bq7OeLM1.js → 2XEGje4L.js} +1 -1
  6. package/.output/public/_nuxt/{atdCACH-.js → 5cKDQgbQ.js} +1 -1
  7. package/.output/public/_nuxt/{C3ZBsVV_.js → B8rT4ISg.js} +2 -2
  8. package/.output/public/_nuxt/{C7BQpy74.js → B9Yq_mZo.js} +1 -1
  9. package/.output/public/_nuxt/{Ca0KO9Xq.js → BCFLQ_rL.js} +1 -1
  10. package/.output/public/_nuxt/{BWebIWit.js → BIHJR--x.js} +1 -1
  11. package/.output/public/_nuxt/{DSaBCmOg.js → BN9sUptU.js} +1 -1
  12. package/.output/public/_nuxt/{BjqbQLK3.js → BNkZeak0.js} +1 -1
  13. package/.output/public/_nuxt/{DWqOZJe7.js → BNqd1Zca.js} +1 -1
  14. package/.output/public/_nuxt/BOZgY48g.js +1 -0
  15. package/.output/public/_nuxt/{Ci5B19-c.js → BQFJwqXj.js} +1 -1
  16. package/.output/public/_nuxt/{DAr5YiBT.js → BSBcOKKj.js} +1 -1
  17. package/.output/public/_nuxt/{dNPwafbq.js → BVl8VKr5.js} +1 -1
  18. package/.output/public/_nuxt/{B9uki8o2.js → BWphy0Pi.js} +1 -1
  19. package/.output/public/_nuxt/{DHAL8jJG.js → BXp87mMj.js} +4 -4
  20. package/.output/public/_nuxt/{8tyEaimf.js → BYY9MB0h.js} +1 -1
  21. package/.output/public/_nuxt/{BPACuoI0.js → BYav_5oM.js} +1 -1
  22. package/.output/public/_nuxt/{Bq47tjcm.js → B_J4rjuT.js} +1 -1
  23. package/.output/public/_nuxt/B_U4hCvn.js +7 -0
  24. package/.output/public/_nuxt/{B5WGo5x7.js → BdCzQG_z.js} +1 -1
  25. package/.output/public/_nuxt/{DsmBazLf.js → BdX6JvdH.js} +1 -1
  26. package/.output/public/_nuxt/{S1qa1a4x.js → BdaSWOzD.js} +1 -1
  27. package/.output/public/_nuxt/{BcsKoAPU.js → BfSmOVMj.js} +119 -119
  28. package/.output/public/_nuxt/{xp7rFxcm.js → BiMJOLHR.js} +1 -1
  29. package/.output/public/_nuxt/{BJCrbji-.js → BlRPNODF.js} +1 -1
  30. package/.output/public/_nuxt/BmREJclf.js +1 -0
  31. package/.output/public/_nuxt/{BoMjapT5.js → Bp1mKnR0.js} +1 -1
  32. package/.output/public/_nuxt/{Cnfx1zWl.js → BqZGP9WI.js} +1 -1
  33. package/.output/public/_nuxt/{BTYBVtfa.js → BqjMHuu8.js} +1 -1
  34. package/.output/public/_nuxt/{DuCDilAk.js → Brupmvos.js} +1 -1
  35. package/.output/public/_nuxt/{B6MkNyZd.js → BsA8eQHh.js} +1 -1
  36. package/.output/public/_nuxt/Bwe8I9vL.js +1 -0
  37. package/.output/public/_nuxt/{CrNLwdoE.js → BxdkXfb_.js} +1 -1
  38. package/.output/public/_nuxt/{BoIj4dtd.js → C20WaARR.js} +1 -1
  39. package/.output/public/_nuxt/{D4pAW_0T.js → C2kyA9ZS.js} +1 -1
  40. package/.output/public/_nuxt/C4HRDaS8.js +1 -0
  41. package/.output/public/_nuxt/{FDw04QOj.js → C5zTeLKh.js} +1 -1
  42. package/.output/public/_nuxt/{wRAs0MDn.js → C6r_nDJz.js} +1 -1
  43. package/.output/public/_nuxt/{ioXB9E2w.js → C6yADG7D.js} +1 -1
  44. package/.output/public/_nuxt/{vhkvHdfO.js → CBfQCVFf.js} +1 -1
  45. package/.output/public/_nuxt/{BzvSm28k.js → CDPrFhDR.js} +1 -1
  46. package/.output/public/_nuxt/{D-9vaM6z.js → CFOJLBf2.js} +1 -1
  47. package/.output/public/_nuxt/{63YtjFEq.js → CJhlBUX_.js} +1 -1
  48. package/.output/public/_nuxt/{iNy-Nl0_.js → CLXbv9E5.js} +1 -1
  49. package/.output/public/_nuxt/{DpEV6S2O.js → CMT3TfI0.js} +1 -1
  50. package/.output/public/_nuxt/{COHOh4Oe.js → CRX1CszZ.js} +1 -1
  51. package/.output/public/_nuxt/{Bmgr9uz4.js → CYaqLaPZ.js} +1 -1
  52. package/.output/public/_nuxt/{BEyCol50.js → Cih6uwf6.js} +1 -1
  53. package/.output/public/_nuxt/{BrNfge84.js → CmzTcheK.js} +1 -1
  54. package/.output/public/_nuxt/{DDebxXP-.js → CrNrSEll.js} +1 -1
  55. package/.output/public/_nuxt/{DJH-4SVI.js → CwgI7YXL.js} +1 -1
  56. package/.output/public/_nuxt/{DEZMnZ2r.js → CxSk31iP.js} +1 -1
  57. package/.output/public/_nuxt/CyEWn2V2.js +1 -0
  58. package/.output/public/_nuxt/{xOD4Ev56.js → D-pZQQ02.js} +1 -1
  59. package/.output/public/_nuxt/{BWZ7atse.js → D0mrO5vS.js} +1 -1
  60. package/.output/public/_nuxt/{DcCF9IZB.js → D3ujZRkc.js} +1 -1
  61. package/.output/public/_nuxt/{C2XHqDOf.js → D4PtOV7Y.js} +1 -1
  62. package/.output/public/_nuxt/{BJVPtt2X.js → D65Keo_g.js} +1 -1
  63. package/.output/public/_nuxt/{BtyzMl9p.js → D6c_aTbv.js} +1 -1
  64. package/.output/public/_nuxt/{DNoTlUiY.js → D9SUnmGh.js} +1 -1
  65. package/.output/public/_nuxt/{BpUSbMUb.js → DDIVwUV6.js} +1 -1
  66. package/.output/public/_nuxt/{C_7gtl40.js → DDS9xPxH.js} +1 -1
  67. package/.output/public/_nuxt/{ByiJDSw8.js → DEsdpKnm.js} +1 -1
  68. package/.output/public/_nuxt/{CMkzSwnO.js → DHnV-0Qj.js} +1 -1
  69. package/.output/public/_nuxt/{COq7mAG7.js → DIoeBtoF.js} +3 -3
  70. package/.output/public/_nuxt/{ByibjLZn.js → DKJfWiWm.js} +1 -1
  71. package/.output/public/_nuxt/{DPIEiNwW.js → DKhuBYhy.js} +1 -1
  72. package/.output/public/_nuxt/DLTvS7Vr.js +2 -0
  73. package/.output/public/_nuxt/{dWu56FdP.js → DNgNuAci.js} +1 -1
  74. package/.output/public/_nuxt/{B8TrrBEb.js → DNpk_jbU.js} +1 -1
  75. package/.output/public/_nuxt/{C6dIAdHr.js → DQCTvlJf.js} +1 -1
  76. package/.output/public/_nuxt/DQf3b-ld.js +1 -0
  77. package/.output/public/_nuxt/{B46blMXm.js → DT4w6IwV.js} +1 -1
  78. package/.output/public/_nuxt/{CS9hqyP3.js → DUqYnCG7.js} +1 -1
  79. package/.output/public/_nuxt/{DkD29_YA.js → DYqNroD1.js} +1 -1
  80. package/.output/public/_nuxt/{Bmx1kTaZ.js → DZ9fd-xA.js} +1 -1
  81. package/.output/public/_nuxt/{qzrMNYut.js → DaiufW99.js} +1 -1
  82. package/.output/public/_nuxt/{Sf02B6Pt.js → DdRczQp2.js} +2 -2
  83. package/.output/public/_nuxt/{L2I3LmpB.js → DdW7QNKl.js} +1 -1
  84. package/.output/public/_nuxt/{B2IKcIj2.js → Ddtv9Dxp.js} +1 -1
  85. package/.output/public/_nuxt/Dfzgj0Oq.js +1 -0
  86. package/.output/public/_nuxt/DgRHzRny.js +1 -0
  87. package/.output/public/_nuxt/{CAnr3OhD.js → DijSUoYv.js} +1 -1
  88. package/.output/public/_nuxt/Dm-rJ5VH.js +1 -0
  89. package/.output/public/_nuxt/{sk7V7xQl.js → DmpCN34M.js} +1 -1
  90. package/.output/public/_nuxt/{CHEpbbGc.js → DoB1FFC2.js} +1 -1
  91. package/.output/public/_nuxt/Dp2UQPgO.js +1 -0
  92. package/.output/public/_nuxt/{CycELG5y.js → DryPPXlb.js} +1 -1
  93. package/.output/public/_nuxt/{BogEzQi9.js → DyCQWd5B.js} +3 -3
  94. package/.output/public/_nuxt/{AymhMj9v.js → Ef-1UUMy.js} +1 -1
  95. package/.output/public/_nuxt/{MW5K_zef.js → HP3PGEjt.js} +1 -1
  96. package/.output/public/_nuxt/{B73IHAoF.js → KK3goksi.js} +1 -1
  97. package/.output/public/_nuxt/{kvtnkChG.js → MC96ynYQ.js} +1 -1
  98. package/.output/public/_nuxt/{BpvGVfME.js → N6_KTIJr.js} +1 -1
  99. package/.output/public/_nuxt/{Dq1JM9WZ.js → TKeZJpIw.js} +1 -1
  100. package/.output/public/_nuxt/{DVnDb6ua.js → UHOKyE8O.js} +1 -1
  101. package/.output/public/_nuxt/{Y1gXUmjt.js → Z42SRPvO.js} +1 -1
  102. package/.output/public/_nuxt/{DpT8FO1Q.js → _Od8x2z5.js} +1 -1
  103. package/.output/public/_nuxt/{DMmjWR_K.js → bpGjU0QQ.js} +1 -1
  104. package/.output/public/_nuxt/builds/latest.json +1 -1
  105. package/.output/public/_nuxt/builds/meta/9b89410f-7683-420e-9dea-d15741f0e6ce.json +1 -0
  106. package/.output/public/_nuxt/{CsRSZpa6.js → doR1dsEF.js} +1 -1
  107. package/.output/public/_nuxt/{DGvAu532.js → e04t7nee.js} +1 -1
  108. package/.output/public/_nuxt/entry.DEE2Ngsu.css +1 -0
  109. package/.output/public/_nuxt/{Oe2GG0Lt.js → g4lEPr__.js} +1 -1
  110. package/.output/public/_nuxt/{Cq-MDPLE.js → l12ZvGEh.js} +1 -1
  111. package/.output/public/_nuxt/{CSQ0xnqv.js → u7qmw6wa.js} +1 -1
  112. package/.output/public/_nuxt/{MeLWmO7R.js → xoY3RXI7.js} +1 -1
  113. package/.output/public/_nuxt/{Bf6Q3Zl5.js → ziSTJBFH.js} +1 -1
  114. package/.output/server/chunks/build/client.manifest.mjs +651 -650
  115. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  116. package/.output/server/chunks/nitro/nitro.mjs +650 -650
  117. package/.output/server/package.json +1 -1
  118. package/package.json +1 -1
  119. package/.output/public/_nuxt/BL__uYa3.js +0 -1
  120. package/.output/public/_nuxt/BRFPdiIh.js +0 -1
  121. package/.output/public/_nuxt/BS-LtKx4.js +0 -1
  122. package/.output/public/_nuxt/BTheloyh.js +0 -1
  123. package/.output/public/_nuxt/Bj7ctTfH.js +0 -1
  124. package/.output/public/_nuxt/BpLDGvqy.js +0 -1
  125. package/.output/public/_nuxt/BqU89KuH.js +0 -2
  126. package/.output/public/_nuxt/CerLmMsC.js +0 -22
  127. package/.output/public/_nuxt/CtWq1MER.js +0 -7
  128. package/.output/public/_nuxt/Cww9dXBK.js +0 -1
  129. package/.output/public/_nuxt/DfNTLojg.js +0 -1
  130. package/.output/public/_nuxt/JOg_XIAv.js +0 -1
  131. package/.output/public/_nuxt/M6bBaUHa.js +0 -1
  132. package/.output/public/_nuxt/_qKPTuua.js +0 -1
  133. package/.output/public/_nuxt/builds/meta/7c171291-8bbd-4c4c-8904-0afae065b82e.json +0 -1
  134. package/.output/public/_nuxt/entry.DxCQuGXb.css +0 -1
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./D4pAW_0T.js","./BcsKoAPU.js","./entry.DxCQuGXb.css","./CSQ0xnqv.js","./DHAL8jJG.js"])))=>i.map(i=>d[i]);
2
- var Tl=Object.defineProperty;var kl=t=>{throw TypeError(t)};var Al=(t,e,s)=>e in t?Tl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var We=(t,e,s)=>Al(t,typeof e!="symbol"?e+"":e,s);var Ie=(t,e,s)=>e.has(t)?kl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s);import{dl as Cl,d as W,ar as la,as as ua,aa as Ds,bJ as ca,c as V,k as H,o as b,w as T,D as Vt,l as G,g as m,bK as da,p as xt,bk as qn,ak as Un,cW as Pl,aj as fa,f as v,cY as Ml,bI as Dl,r as K,aw as ki,bL as ln,bM as Vl,ax as El,aS as ha,aT as pa,fe as Ai,du as Ll,au as be,aR as Rl,av as Vs,aQ as Hn,aL as ma,ff as $l,fg as Il,az as Ct,fh as Bl,dr as Ol,dm as Fl,j as Gn,aZ as Et,n as ae,q as ga,K as Fs,fi as Kn,aB as Yt,e as k,t as M,aK as jl,aC as Nl,s as Se,ao as ke,ch as va,m as w,aY as Es,a_ as Ls,a0 as ve,A as de,a$ as Rs,F as re,z as N,er as ya,bN as zl,ae as ql,bm as Te,e$ as es,bn as js,df as xa,bE as Ul,bF as Hl,bG as ds,aq as Gl,a1 as Kl,W as Wl,X as Yl,Y as Xl,Z as Ql,$ as Zl,dc as Jl,eD as eu,ay as Be,bq as tu,dz as su,dA as nu,ab as Ci,ac as Pi,dM as iu,dN as ou,dP as au,H as ba,fj as wa,ef as ru,ba as lu,a3 as uu,fk as cu,fl as du,eg as fu,J as hu,f3 as pu,ci as mu,bo as gu,fm as vu,i as Mi,fn as yu}from"./BcsKoAPU.js";import{a as xu,b as bu,_ as wu}from"./BjqbQLK3.js";import{g as _u,c as Su,a as Tu,b as ku,d as Au}from"./D4pAW_0T.js";import{u as Wn,_ as Cu}from"./Ca0KO9Xq.js";import{_ as Pu}from"./COHOh4Oe.js";import{_ as Mu}from"./BoIj4dtd.js";import{C as Du}from"./CSQ0xnqv.js";import"./dWu56FdP.js";import{_ as Yn}from"./CS9hqyP3.js";import{b as Vu,a as Eu,E as Lu,c as Ru,d as $u,_ as Iu}from"./BWebIWit.js";import{D as _a,b as un,F as qe,G as Bu,H as Ou,I as Fu,P as me,J as Di,K as Vi,L as Sa,M as ju,N as Ei,O as Li,Q as Ns,l as fs,f as Ta,R as Nu,_ as Lt,T as ka,U as Xe,V as zu,W as Aa,Z as qu,X as hs,Y as zs,$ as Ri,a0 as Uu,a1 as Hu,a2 as Gu,a3 as Ku,a4 as Wu,a5 as Yu,a6 as Xu,a7 as Qu,a8 as $i,a9 as Ca,aa as Zu,ab as Ju,ac as ec,ad as Pa,ae as tc,af as sc,ag as nc,ah as ic,ai as oc,aj as ac,ak as rc,al as Ma,am as lc,v as Da,an as uc,w as cc,y as dc,x as fc,z as hc,A as pc,B as mc,E as gc}from"./Cq-MDPLE.js";import{u as vc,l as yc}from"./CsRSZpa6.js";import"./CS5akSNT.js";const xc="radio.select";function bc(t,e,s){Cl(xc,s,{originalEvent:t,value:e})}var wc=W({__name:"Radio",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:checked","select"],setup(t,{emit:e}){const s=t,n=e,i=la(s,"checked",n,{passive:s.checked===void 0}),{value:a}=ua(s),{forwardRef:o,currentElement:r}=Ds(),l=ca(r),u=V(()=>{var f;return s.id&&r.value?((f=document.querySelector(`[for="${s.id}"]`))==null?void 0:f.innerText)??s.value:void 0});function c(f){s.disabled||bc(f,s.value,d=>{n("select",d),!(d!=null&&d.defaultPrevented)&&(i.value=!0,l.value&&d.stopPropagation())})}return(f,d)=>(b(),H(m(Un),xt(f.$attrs,{id:f.id,ref:m(o),role:"radio",type:f.as==="button"?"button":void 0,as:f.as,"aria-checked":m(i),"aria-label":u.value,"as-child":f.asChild,disabled:f.disabled?"":void 0,"data-state":m(i)?"checked":"unchecked","data-disabled":f.disabled?"":void 0,value:m(a),required:f.required,name:f.name,onClick:qn(c,["stop"])}),{default:T(()=>[Vt(f.$slots,"default",{checked:m(i)}),m(l)&&f.name?(b(),H(m(da),{key:0,type:"radio",tabindex:"-1",value:m(a),checked:!!m(i),name:f.name,disabled:f.disabled,required:f.required},null,8,["value","checked","name","disabled","required"])):G("v-if",!0)]),_:3},16,["id","type","as","aria-checked","aria-label","as-child","disabled","data-state","data-disabled","value","required","name"]))}}),_c=wc;const[Sc,Tc]=fa("RadioGroupRoot");var kc=W({__name:"RadioGroupRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,{forwardRef:i,currentElement:a}=Ds(),o=la(s,"modelValue",n,{defaultValue:s.defaultValue,passive:s.modelValue===void 0}),{disabled:r,loop:l,orientation:u,name:c,required:f,dir:d}=ua(s),h=Pl(d),p=ca(a);return Tc({modelValue:o,changeModelValue:x=>{o.value=x},disabled:r,loop:l,orientation:u,name:c==null?void 0:c.value,required:f}),(x,g)=>(b(),H(m(Ml),{"as-child":"",orientation:m(u),dir:m(h),loop:m(l)},{default:T(()=>[v(m(Un),{ref:m(i),role:"radiogroup","data-disabled":m(r)?"":void 0,"as-child":x.asChild,as:x.as,"aria-orientation":m(u),"aria-required":m(f),dir:m(h)},{default:T(()=>[Vt(x.$slots,"default",{modelValue:m(o)}),m(p)&&m(c)?(b(),H(m(da),{key:0,required:m(f),disabled:m(r),value:m(o),name:m(c)},null,8,["required","disabled","value","name"])):G("v-if",!0)]),_:3},8,["data-disabled","as-child","as","aria-orientation","aria-required","dir"])]),_:3},8,["orientation","dir","loop"]))}}),Ac=kc;const[Cc,Pc]=fa("RadioGroupItem");var Mc=W({inheritAttrs:!1,__name:"RadioGroupItem",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["select"],setup(t,{emit:e}){const s=t,n=e,{forwardRef:i,currentElement:a}=Ds(),o=Sc(),r=V(()=>o.disabled.value||s.disabled),l=V(()=>o.required.value||s.required),u=V(()=>{var h;return Dl((h=o.modelValue)==null?void 0:h.value,s.value)});Pc({disabled:r,checked:u});const c=K(!1),f=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];ki("keydown",h=>{f.includes(h.key)&&(c.value=!0)}),ki("keyup",()=>{c.value=!1});function d(){setTimeout(()=>{var h;c.value&&((h=a.value)==null||h.click())},0)}return(h,p)=>(b(),H(m(Vl),{checked:u.value,disabled:r.value,"as-child":"",focusable:!r.value,active:u.value},{default:T(()=>[v(_c,xt({...h.$attrs,...s},{ref:m(i),checked:u.value,required:l.value,disabled:r.value,"onUpdate:checked":p[0]||(p[0]=x=>m(o).changeModelValue(h.value)),onSelect:p[1]||(p[1]=x=>n("select",x)),onKeydown:p[2]||(p[2]=ln(qn(()=>{},["prevent"]),["enter"])),onFocus:d}),{default:T(()=>[Vt(h.$slots,"default",{checked:u.value,required:l.value,disabled:r.value})]),_:3},16,["checked","required","disabled"])]),_:3},8,["checked","disabled","focusable","active"]))}}),Dc=Mc,Vc=W({__name:"RadioGroupIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const{forwardRef:e}=Ds(),s=Cc();return(n,i)=>(b(),H(m(El),{present:n.forceMount||m(s).checked.value},{default:T(()=>[v(m(Un),xt({ref:m(e),"data-state":m(s).checked.value?"checked":"unchecked","data-disabled":m(s).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},n.$attrs),{default:T(()=>[Vt(n.$slots,"default")]),_:3},16,["data-state","data-disabled","as-child","as"])]),_:3},8,["present"]))}}),Ec=Vc,Ii=Math.PI*2,ps=Math.PI/180;function Va(t,e){return Bu(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Ea(t,e){var s=Va(t,e),n=t.get("center"),i=t.get("radius");un(i)||(i=[0,i]);var a=qe(s.width,e.getWidth()),o=qe(s.height,e.getHeight()),r=Math.min(a,o),l=qe(i[0],r/2),u=qe(i[1],r/2),c,f,d=t.coordinateSystem;if(d){var h=d.dataToPoint(n);c=h[0]||0,f=h[1]||0}else un(n)||(n=[n,n]),c=qe(n[0],a)+s.x,f=qe(n[1],o)+s.y;return{cx:c,cy:f,r0:l,r:u}}function Lc(t,e,s){e.eachSeriesByType(t,function(n){var i=n.getData(),a=i.mapDimension("value"),o=Va(n,s),r=Ea(n,s),l=r.cx,u=r.cy,c=r.r,f=r.r0,d=-n.get("startAngle")*ps,h=n.get("endAngle"),p=n.get("padAngle")*ps;h=h==="auto"?d-Ii:-h*ps;var x=n.get("minAngle")*ps,g=x+p,y=0;i.each(a,function(Y){!isNaN(Y)&&y++});var P=i.getSum(a),_=Math.PI/(P||y)*2,L=n.get("clockwise"),D=n.get("roseType"),E=n.get("stillShowZeroSum"),A=i.getDataExtent(a);A[0]=0;var S=L?1:-1,B=[d,h],R=S*p/2;Ou(B,!L),d=B[0],h=B[1];var q=La(n);q.startAngle=d,q.endAngle=h,q.clockwise=L;var F=Math.abs(h-d),te=F,C=0,I=d;if(i.setLayout({viewRect:o,r:c}),i.each(a,function(Y,X){var U;if(isNaN(Y)){i.setItemLayout(X,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:L,cx:l,cy:u,r0:f,r:D?NaN:c});return}D!=="area"?U=P===0&&E?_:Y*_:U=F/y,U<g?(U=g,te-=g):C+=Y;var Q=I+S*U,Z=0,J=0;p>U?(Z=I+S*U/2,J=Z):(Z=I+R,J=Q-R),i.setItemLayout(X,{angle:U,startAngle:Z,endAngle:J,clockwise:L,cx:l,cy:u,r0:f,r:D?Fu(Y,A,[f,c]):c}),I=Q}),te<Ii&&y)if(te<=.001){var z=F/y;i.each(a,function(Y,X){if(!isNaN(Y)){var U=i.getItemLayout(X);U.angle=z;var Q=0,Z=0;z<p?(Q=d+S*(X+1/2)*z,Z=Q):(Q=d+S*X*z+R,Z=d+S*(X+1)*z-R),U.startAngle=Q,U.endAngle=Z}})}else _=te/C,I=d,i.each(a,function(Y,X){if(!isNaN(Y)){var U=i.getItemLayout(X),Q=U.angle===g?g:Y*_,Z=0,J=0;Q<p?(Z=I+S*Q/2,J=Z):(Z=I+R,J=I+S*Q-R),U.startAngle=Z,U.endAngle=J,I+=S*Q}})})}var La=_a();function Rc(t){return{seriesType:t,reset:function(e,s){var n=s.findComponents({mainType:"legend"});if(!(!n||!n.length)){var i=e.getData();i.filterSelf(function(a){for(var o=i.getName(a),r=0;r<n.length;r++)if(!n[r].isSelected(o))return!1;return!0})}}}}function Ra(t,e,s,n,i,a,o,r){var l=i-t,u=a-e,c=s-t,f=n-e,d=Math.sqrt(c*c+f*f);c/=d,f/=d;var h=l*c+u*f,p=h/d;p*=d;var x=o[0]=t+p*c,g=o[1]=e+p*f;return Math.sqrt((x-i)*(x-i)+(g-a)*(g-a))}var Qe=new me,ie=new me,pe=new me,Ze=new me,Oe=new me,_s=[],xe=new me;function $c(t,e){if(e<=180&&e>0){e=e/180*Math.PI,Qe.fromArray(t[0]),ie.fromArray(t[1]),pe.fromArray(t[2]),me.sub(Ze,Qe,ie),me.sub(Oe,pe,ie);var s=Ze.len(),n=Oe.len();if(!(s<.001||n<.001)){Ze.scale(1/s),Oe.scale(1/n);var i=Ze.dot(Oe),a=Math.cos(e);if(a<i){var o=Ra(ie.x,ie.y,pe.x,pe.y,Qe.x,Qe.y,_s);xe.fromArray(_s),xe.scaleAndAdd(Oe,o/Math.tan(Math.PI-e));var r=pe.x!==ie.x?(xe.x-ie.x)/(pe.x-ie.x):(xe.y-ie.y)/(pe.y-ie.y);if(isNaN(r))return;r<0?me.copy(xe,ie):r>1&&me.copy(xe,pe),xe.toArray(t[1])}}}}function Ic(t,e,s){if(s<=180&&s>0){s=s/180*Math.PI,Qe.fromArray(t[0]),ie.fromArray(t[1]),pe.fromArray(t[2]),me.sub(Ze,ie,Qe),me.sub(Oe,pe,ie);var n=Ze.len(),i=Oe.len();if(!(n<.001||i<.001)){Ze.scale(1/n),Oe.scale(1/i);var a=Ze.dot(e),o=Math.cos(s);if(a<o){var r=Ra(ie.x,ie.y,pe.x,pe.y,Qe.x,Qe.y,_s);xe.fromArray(_s);var l=Math.PI/2,u=Math.acos(Oe.dot(e)),c=l+u-s;if(c>=l)me.copy(xe,pe);else{xe.scaleAndAdd(Oe,r/Math.tan(Math.PI/2-c));var f=pe.x!==ie.x?(xe.x-ie.x)/(pe.x-ie.x):(xe.y-ie.y)/(pe.y-ie.y);if(isNaN(f))return;f<0?me.copy(xe,ie):f>1&&me.copy(xe,pe)}xe.toArray(t[1])}}}}function qs(t,e,s,n){var i=s==="normal",a=i?t:t.ensureState(s);a.ignore=e;var o=n.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var r=n.getModel("lineStyle").getLineStyle();i?t.useStyle(r):a.style=r}function Bc(t,e){var s=e.smooth,n=e.points;if(n)if(t.moveTo(n[0][0],n[0][1]),s>0&&n.length>=3){var i=Li(n[0],n[1]),a=Li(n[1],n[2]);if(!i||!a){t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]);return}var o=Math.min(i,a)*s,r=Ns([],n[1],n[0],o/i),l=Ns([],n[1],n[2],o/a),u=Ns([],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],n[2][0],n[2][1])}else for(var c=1;c<n.length;c++)t.lineTo(n[c][0],n[c][1])}function Oc(t,e,s){var n=t.getTextGuideLine(),i=t.getTextContent();if(!i){n&&t.removeTextGuideLine();return}for(var a=e.normal,o=a.get("show"),r=i.ignore,l=0;l<Di.length;l++){var u=Di[l],c=e[u],f=u==="normal";if(c){var d=c.get("show"),h=f?r:Vi(i.states[u]&&i.states[u].ignore,r);if(h||!Vi(d,o)){var p=f?n:n&&n.states[u];p&&(p.ignore=!0),n&&qs(n,!0,u,c);continue}n||(n=new Sa,t.setTextGuideLine(n),!f&&(r||!o)&&qs(n,!0,"normal",e.normal),t.stateProxy&&(n.stateProxy=t.stateProxy)),qs(n,!1,u,c)}}if(n){ju(n.style,s),n.style.fill=null;var x=a.get("showAbove"),g=t.textGuideLineConfig=t.textGuideLineConfig||{};g.showAbove=x||!1,n.buildPath=Bc}}function Fc(t,e){e=e||"labelLine";for(var s={normal:t.getModel(e)},n=0;n<Ei.length;n++){var i=Ei[n];s[i]=t.getModel([i,e])}return s}var jc=Math.PI/180;function Bi(t,e,s,n,i,a,o,r,l,u){if(t.length<2)return;function c(x){for(var g=x.rB,y=g*g,P=0;P<x.list.length;P++){var _=x.list[P],L=Math.abs(_.label.y-s),D=n+_.len,E=D*D,A=Math.sqrt(Math.abs((1-L*L/y)*E)),S=e+(A+_.len2)*i,B=S-_.label.x,R=_.targetTextWidth-B*i;$a(_,R,!0),_.label.x=S}}function f(x){for(var g={list:[],maxY:0},y={list:[],maxY:0},P=0;P<x.length;P++)if(x[P].labelAlignTo==="none"){var _=x[P],L=_.label.y>s?y:g,D=Math.abs(_.label.y-s);if(D>=L.maxY){var E=_.label.x-e-_.len2*i,A=n+_.len,S=Math.abs(E)<A?Math.sqrt(D*D/(1-E*E/A/A)):A;L.rB=S,L.maxY=D}L.list.push(_)}c(g),c(y)}for(var d=t.length,h=0;h<d;h++)if(t[h].position==="outer"&&t[h].labelAlignTo==="labelLine"){var p=t[h].label.x-u;t[h].linePoints[1][0]+=p,t[h].label.x=u}Nu(t,l,l+o)&&f(t)}function Nc(t,e,s,n,i,a,o,r){for(var l=[],u=[],c=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0;d<t.length;d++){var h=t[d].label;Us(t[d])||(h.x<e?(c=Math.min(c,h.x),l.push(t[d])):(f=Math.max(f,h.x),u.push(t[d])))}for(var d=0;d<t.length;d++){var p=t[d];if(!Us(p)&&p.linePoints){if(p.labelStyleWidth!=null)continue;var h=p.label,x=p.linePoints,g=void 0;p.labelAlignTo==="edge"?h.x<e?g=x[2][0]-p.labelDistance-o-p.edgeDistance:g=o+i-p.edgeDistance-x[2][0]-p.labelDistance:p.labelAlignTo==="labelLine"?h.x<e?g=c-o-p.bleedMargin:g=o+i-f-p.bleedMargin:h.x<e?g=h.x-o-p.bleedMargin:g=o+i-h.x-p.bleedMargin,p.targetTextWidth=g,$a(p,g)}}Bi(u,e,s,n,1,i,a,o,r,f),Bi(l,e,s,n,-1,i,a,o,r,c);for(var d=0;d<t.length;d++){var p=t[d];if(!Us(p)&&p.linePoints){var h=p.label,x=p.linePoints,y=p.labelAlignTo==="edge",P=h.style.padding,_=P?P[1]+P[3]:0,L=h.style.backgroundColor?0:_,D=p.rect.width+L,E=x[1][0]-x[2][0];y?h.x<e?x[2][0]=o+p.edgeDistance+D+p.labelDistance:x[2][0]=o+i-p.edgeDistance-D-p.labelDistance:(h.x<e?x[2][0]=h.x+p.labelDistance:x[2][0]=h.x-p.labelDistance,x[1][0]=x[2][0]+E),x[1][1]=x[2][1]=h.y}}}function $a(t,e,s){if(s===void 0&&(s=!1),t.labelStyleWidth==null){var n=t.label,i=n.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||s){var f=a.height;if(u&&u.match("break")){n.setStyle("backgroundColor",null),n.setStyle("width",e-l);var d=n.getBoundingRect();n.setStyle("width",Math.ceil(d.width)),n.setStyle("backgroundColor",o)}else{var h=e-l,p=e<c?h:s?h>t.unconstrainedWidth?null:h:null;n.setStyle("width",p)}var x=n.getBoundingRect();a.width=x.width;var g=(n.style.margin||0)+2.1;a.height=x.height+g,a.y-=(a.height-f)/2}}}function Us(t){return t.position==="center"}function zc(t){var e=t.getData(),s=[],n,i,a=!1,o=(t.get("minShowLabelAngle")||0)*jc,r=e.getLayout("viewRect"),l=e.getLayout("r"),u=r.width,c=r.x,f=r.y,d=r.height;function h(E){E.ignore=!0}function p(E){if(!E.ignore)return!0;for(var A in E.states)if(E.states[A].ignore===!1)return!0;return!1}e.each(function(E){var A=e.getItemGraphicEl(E),S=A.shape,B=A.getTextContent(),R=A.getTextGuideLine(),q=e.getItemModel(E),F=q.getModel("label"),te=F.get("position")||q.get(["emphasis","label","position"]),C=F.get("distanceToLabelLine"),I=F.get("alignTo"),z=qe(F.get("edgeDistance"),u),Y=F.get("bleedMargin"),X=q.getModel("labelLine"),U=X.get("length");U=qe(U,u);var Q=X.get("length2");if(Q=qe(Q,u),Math.abs(S.endAngle-S.startAngle)<o){fs(B.states,h),B.ignore=!0,R&&(fs(R.states,h),R.ignore=!0);return}if(p(B)){var Z=(S.startAngle+S.endAngle)/2,J=Math.cos(Z),ge=Math.sin(Z),ue,Re,ze,bt;n=S.cx,i=S.cy;var $e=te==="inside"||te==="inner";if(te==="center")ue=S.cx,Re=S.cy,bt="center";else{var Bt=($e?(S.r+S.r0)/2*J:S.r*J)+n,Ve=($e?(S.r+S.r0)/2*ge:S.r*ge)+i;if(ue=Bt+J*3,Re=Ve+ge*3,!$e){var wt=Bt+J*(U+l-S.r),_t=Ve+ge*(U+l-S.r),os=wt+(J<0?-1:1)*Q,as=_t;I==="edge"?ue=J<0?c+z:c+u-z:ue=os+(J<0?-C:C),Re=as,ze=[[Bt,Ve],[wt,_t],[os,as]]}bt=$e?"center":I==="edge"?J>0?"right":"left":J>0?"left":"right"}var tt=Math.PI,Ge=0,st=F.get("rotate");if(Ta(st))Ge=st*(tt/180);else if(te==="center")Ge=0;else if(st==="radial"||st===!0){var Bs=J<0?-Z+tt:-Z;Ge=Bs}else if(st==="tangential"&&te!=="outside"&&te!=="outer"){var Ke=Math.atan2(J,ge);Ke<0&&(Ke=tt*2+Ke);var Os=ge>0;Os&&(Ke=tt+Ke),Ge=Ke-tt}if(a=!!Ge,B.x=ue,B.y=Re,B.rotation=Ge,B.setStyle({verticalAlign:"middle"}),$e){B.setStyle({align:bt});var Ot=B.states.select;Ot&&(Ot.x+=B.x,Ot.y+=B.y)}else{var nt=B.getBoundingRect().clone();nt.applyTransform(B.getComputedTransform());var rs=(B.style.margin||0)+2.1;nt.y-=rs/2,nt.height+=rs,s.push({label:B,labelLine:R,position:te,len:U,len2:Q,minTurnAngle:X.get("minTurnAngle"),maxSurfaceAngle:X.get("maxSurfaceAngle"),surfaceNormal:new me(J,ge),linePoints:ze,textAlign:bt,labelDistance:C,labelAlignTo:I,edgeDistance:z,bleedMargin:Y,rect:nt,unconstrainedWidth:nt.width,labelStyleWidth:B.style.width})}A.setTextConfig({inside:$e})}}),!a&&t.get("avoidLabelOverlap")&&Nc(s,n,i,l,u,d,c,f);for(var x=0;x<s.length;x++){var g=s[x],y=g.label,P=g.labelLine,_=isNaN(y.x)||isNaN(y.y);if(y){y.setStyle({align:g.textAlign}),_&&(fs(y.states,h),y.ignore=!0);var L=y.states.select;L&&(L.x+=y.x,L.y+=y.y)}if(P){var D=g.linePoints;_||!D?(fs(P.states,h),P.ignore=!0):($c(D,g.minTurnAngle),Ic(D,g.surfaceNormal,g.maxSurfaceAngle),P.setShape({points:D}),y.__hostTarget.textGuideLineConfig={anchor:new me(D[0][0],D[0][1])})}}}var qc=function(t){Lt(e,t);function e(s,n,i){var a=t.call(this)||this;a.z2=2;var o=new qu;return a.setTextContent(o),a.updateData(s,n,i,!0),a}return e.prototype.updateData=function(s,n,i,a){var o=this,r=s.hostModel,l=s.getItemModel(n),u=l.getModel("emphasis"),c=s.getItemLayout(n),f=Xe(hs(l.getModel("itemStyle"),c,!0),c);if(isNaN(f.startAngle)){o.setShape(f);return}if(a){o.setShape(f);var d=r.getShallow("animationType");r.ecModel.ssr?(zs(o,{scaleX:0,scaleY:0},r,{dataIndex:n,isFrom:!0}),o.originX=f.cx,o.originY=f.cy):d==="scale"?(o.shape.r=c.r0,zs(o,{shape:{r:c.r}},r,n)):i!=null?(o.setShape({startAngle:i,endAngle:i}),zs(o,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},r,n)):(o.shape.endAngle=c.startAngle,Ri(o,{shape:{endAngle:c.endAngle}},r,n))}else Uu(o),Ri(o,{shape:f},r,n);o.useStyle(s.getItemVisual(n,"style")),Hu(o,l);var h=(c.startAngle+c.endAngle)/2,p=r.get("selectedOffset"),x=Math.cos(h)*p,g=Math.sin(h)*p,y=l.getShallow("cursor");y&&o.attr("cursor",y),this._updateLabel(r,s,n),o.ensureState("emphasis").shape=Xe({r:c.r+(u.get("scale")&&u.get("scaleSize")||0)},hs(u.getModel("itemStyle"),c)),Xe(o.ensureState("select"),{x,y:g,shape:hs(l.getModel(["select","itemStyle"]),c)}),Xe(o.ensureState("blur"),{shape:hs(l.getModel(["blur","itemStyle"]),c)});var P=o.getTextGuideLine(),_=o.getTextContent();P&&Xe(P.ensureState("select"),{x,y:g}),Xe(_.ensureState("select"),{x,y:g}),Gu(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(s,n,i){var a=this,o=n.getItemModel(i),r=o.getModel("labelLine"),l=n.getItemVisual(i,"style"),u=l&&l.fill,c=l&&l.opacity;Ku(a,Wu(o),{labelFetcher:n.hostModel,labelDataIndex:i,inheritColor:u,defaultOpacity:c,defaultText:s.getFormattedLabel(i,"normal")||n.getName(i)});var f=a.getTextContent();a.setTextConfig({position:null,rotation:null}),f.attr({z2:10});var d=s.get(["label","position"]);if(d!=="outside"&&d!=="outer")a.removeTextGuideLine();else{var h=this.getTextGuideLine();h||(h=new Sa,this.setTextGuideLine(h)),Oc(this,Fc(o),{stroke:u,opacity:Yu(r.get(["lineStyle","opacity"]),c,1)})}},e}(ka),Uc=function(t){Lt(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.ignoreLabelLineUpdate=!0,s}return e.prototype.render=function(s,n,i,a){var o=s.getData(),r=this._data,l=this.group,u;if(!r&&o.count()>0){for(var c=o.getItemLayout(0),f=1;isNaN(c&&c.startAngle)&&f<o.count();++f)c=o.getItemLayout(f);c&&(u=c.startAngle)}if(this._emptyCircleSector&&l.remove(this._emptyCircleSector),o.count()===0&&s.get("showEmptyCircle")){var d=La(s),h=new ka({shape:Xe(Ea(s,i),d)});h.useStyle(s.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=h,l.add(h)}o.diff(r).add(function(p){var x=new qc(o,p,u);o.setItemGraphicEl(p,x),l.add(x)}).update(function(p,x){var g=r.getItemGraphicEl(x);g.updateData(o,p,u),g.off("click"),l.add(g),o.setItemGraphicEl(p,g)}).remove(function(p){var x=r.getItemGraphicEl(p);zu(x,s,p)}).execute(),zc(s),s.get("animationTypeUpdate")!=="expansion"&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(s,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var o=s[0]-a.cx,r=s[1]-a.cy,l=Math.sqrt(o*o+r*r);return l<=a.r&&l>=a.r0}},e.type="pie",e}(Aa);function Hc(t,e,s){e=un(e)&&{coordDimensions:e}||Xe({encodeDefine:t.getEncode()},e);var n=t.getSource(),i=Xu(n,e).dimensions,a=new Qu(i,t);return a.initData(n,s),a}var Gc=function(){function t(e,s){this._getDataWithEncodedVisual=e,this._getRawData=s}return t.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},t.prototype.containName=function(e){var s=this._getRawData();return s.indexOfName(e)>=0},t.prototype.indexOfName=function(e){var s=this._getDataWithEncodedVisual();return s.indexOfName(e)},t.prototype.getItemVisual=function(e,s){var n=this._getDataWithEncodedVisual();return n.getItemVisual(e,s)},t}(),Kc=_a(),Wc=function(t){Lt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(s){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new Gc($i(this.getData,this),$i(this.getRawData,this)),this._defaultLabelLine(s)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return Hc(this,{coordDimensions:["value"],encodeDefaulter:Ca(Zu,this)})},e.prototype.getDataParams=function(s){var n=this.getData(),i=Kc(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=Ju(o,n.hostModel.get("percentPrecision"))}var r=t.prototype.getDataParams.call(this,s);return r.percent=a[s]||0,r.$vars.push("percent"),r},e.prototype._defaultLabelLine=function(s){ec(s,"labelLine",["show"]);var n=s.labelLine,i=s.emphasis.labelLine;n.show=n.show&&s.label.show,i.show=i.show&&s.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}(Pa);function Yc(t){return{seriesType:t,reset:function(e,s){var n=e.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(Ta(o)&&!isNaN(o)&&o<0)})}}}function Xc(t){t.registerChartView(Uc),t.registerSeriesModel(Wc),tc("pie",t.registerAction),t.registerLayout(Ca(Lc,"pie")),t.registerProcessor(Rc("pie")),t.registerProcessor(Yc("pie"))}var Qc=function(t){Lt(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.type=e.type,s.hasSymbolVisual=!0,s}return e.prototype.getInitialData=function(s,n){return sc(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var s=this.option.progressive;return s??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var s=this.option.progressiveThreshold;return s??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(s,n,i){return i.point(n.getItemLayout(s))},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}(Pa),Ia=4,Zc=function(){function t(){}return t}(),Jc=function(t){Lt(e,t);function e(s){var n=t.call(this,s)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.getDefaultShape=function(){return new Zc},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(s,n){var i=n.points,a=n.size,o=this.symbolProxy,r=o.shape,l=s.getContext?s.getContext():s,u=l&&a[0]<Ia,c=this.softClipShape,f;if(u){this._ctx=l;return}for(this._ctx=null,f=this._off;f<i.length;){var d=i[f++],h=i[f++];isNaN(d)||isNaN(h)||c&&!c.contain(d,h)||(r.x=d-a[0]/2,r.y=h-a[1]/2,r.width=a[0],r.height=a[1],o.buildPath(s,r,!0))}this.incremental&&(this._off=f,this.notClear=!0)},e.prototype.afterBrush=function(){var s=this.shape,n=s.points,i=s.size,a=this._ctx,o=this.softClipShape,r;if(a){for(r=this._off;r<n.length;){var l=n[r++],u=n[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(s,n){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,f=a[c]-r/2,d=a[c+1]-l/2;if(s>=f&&n>=d&&s<=f+r&&n<=d+l)return u}return-1},e.prototype.contain=function(s,n){var i=this.transformCoordToLocal(s,n),a=this.getBoundingRect();if(s=i[0],n=i[1],a.contain(s,n)){var o=this.hoverDataIdx=this.findDataIndex(s,n);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var s=this._rect;if(!s){for(var n=this.shape,i=n.points,a=n.size,o=a[0],r=a[1],l=1/0,u=1/0,c=-1/0,f=-1/0,d=0;d<i.length;){var h=i[d++],p=i[d++];l=Math.min(h,l),c=Math.max(h,c),u=Math.min(p,u),f=Math.max(p,f)}s=this._rect=new ic(l-o/2,u-r/2,c-l+o,f-u+r)}return s},e}(oc),ed=function(){function t(){this.group=new nc}return t.prototype.updateData=function(e,s){this._clear();var n=this._create();n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,s)},t.prototype.updateLayout=function(e){var s=e.getLayout("points");this.group.eachChild(function(n){if(n.startIndex!=null){var i=(n.endIndex-n.startIndex)*2,a=n.startIndex*4*2;s=new Float32Array(s.buffer,a,i)}n.setShape("points",s),n.reset()})},t.prototype.incrementalPrepareUpdate=function(e){this._clear()},t.prototype.incrementalUpdate=function(e,s,n){var i=this._newAdded[0],a=s.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,s,n)}},t.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},t.prototype._create=function(){var e=new Jc({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},t.prototype._setCommon=function(e,s,n){var i=s.hostModel;n=n||{};var a=s.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=n.clipShape||null,e.symbolProxy=ac(s.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<Ia;e.useStyle(i.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var r=s.getVisual("style"),l=r&&r.fill;l&&e.setColor(l);var u=rc(e);u.seriesIndex=i.seriesIndex,e.on("mousemove",function(c){u.dataIndex=null;var f=e.hoverDataIdx;f>=0&&(u.dataIndex=f+(e.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),td=function(t){Lt(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.type=e.type,s}return e.prototype.render=function(s,n,i){var a=s.getData(),o=this._updateSymbolDraw(a,s);o.updateData(a,{clipShape:this._getClipShape(s)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(s,n,i){var a=s.getData(),o=this._updateSymbolDraw(a,s);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(s,n,i){this._symbolDraw.incrementalUpdate(s,n.getData(),{clipShape:this._getClipShape(n)}),this._finished=s.end===n.getData().count()},e.prototype.updateTransform=function(s,n,i){var a=s.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=Ma("").reset(s,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(s){this._symbolDraw&&this._symbolDraw.eachRendered(s)},e.prototype._getClipShape=function(s){if(s.get("clip",!0)){var n=s.coordinateSystem;return n&&n.getArea&&n.getArea(.1)}},e.prototype._updateSymbolDraw=function(s,n){var i=this._symbolDraw,a=n.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new ed:new lc,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(s,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Aa);function sd(t){Da(uc),t.registerSeriesModel(Qc),t.registerChartView(td),t.registerLayout(Ma("scatter"))}function ts(t,e){const s=typeof t=="string"?`${t}Context`:e,n=Symbol(s);return[o=>{const r=ha(n,o);if(r===void 0)throw new Error(`Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`);return r},o=>(pa(n,o),o),n]}function nd(t,e){const{layoutGroup:s,presenceContext:n,config:i}=e,a=s.id&&t.layoutId?`${s.id}-${t.layoutId}`:t.layoutId||void 0;return{...t,layoutId:a,transition:t.transition??i.transition,layoutGroup:s,motionConfig:i,inViewOptions:t.inViewOptions??i.inViewOptions,presenceContext:n,initial:n.initial===!1?n.initial:t.initial===!0?void 0:t.initial}}function Xn(t,e){t.indexOf(e)===-1&&t.push(e)}function Ss(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const Ne=(t,e,s)=>s>e?e:s<t?t:s;let Qn=()=>{};const Ue={},Ba=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Oa(t){return typeof t=="object"&&t!==null}const Fa=t=>/^0[^.\s]+$/u.test(t);function ja(t){let e;return()=>(e===void 0&&(e=t()),e)}const Me=t=>t,id=(t,e)=>s=>e(t(s)),ss=(...t)=>t.reduce(id),Xt=(t,e,s)=>{const n=e-t;return n===0?1:(s-t)/n};class Zn{constructor(){this.subscriptions=[]}add(e){return Xn(this.subscriptions,e),()=>Ss(this.subscriptions,e)}notify(e,s,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,s,n);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(e,s,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const De=t=>t*1e3,Pe=t=>t/1e3;function Na(t,e){return e?t*(1e3/e):0}const za=(t,e,s)=>(((1-3*s+3*e)*t+(3*s-6*e))*t+3*e)*t,od=1e-7,ad=12;function rd(t,e,s,n,i){let a,o,r=0;do o=e+(s-e)/2,a=za(o,n,i)-t,a>0?s=o:e=o;while(Math.abs(a)>od&&++r<ad);return o}function ns(t,e,s,n){if(t===e&&s===n)return Me;const i=a=>rd(a,0,1,t,s);return a=>a===0||a===1?a:za(i(a),e,n)}const qa=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ua=t=>e=>1-t(1-e),Ha=ns(.33,1.53,.69,.99),Jn=Ua(Ha),Ga=qa(Jn),Ka=t=>(t*=2)<1?.5*Jn(t):.5*(2-Math.pow(2,-10*(t-1))),ei=t=>1-Math.sin(Math.acos(t)),Wa=Ua(ei),Ya=qa(ei),ld=ns(.42,0,1,1),ud=ns(0,0,.58,1),Xa=ns(.42,0,.58,1),cd=t=>Array.isArray(t)&&typeof t[0]!="number",Qa=t=>Array.isArray(t)&&typeof t[0]=="number",dd={linear:Me,easeIn:ld,easeInOut:Xa,easeOut:ud,circIn:ei,circInOut:Ya,circOut:Wa,backIn:Jn,backInOut:Ga,backOut:Ha,anticipate:Ka},fd=t=>typeof t=="string",Oi=t=>{if(Qa(t)){Qn(t.length===4);const[e,s,n,i]=t;return ns(e,s,n,i)}else if(fd(t))return dd[t];return t},ms=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hd(t,e){let s=new Set,n=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,f=!1,d=!1)=>{const p=d&&i?s:n;return f&&o.add(c),p.has(c)||p.add(c),c},cancel:c=>{n.delete(c),o.delete(c)},process:c=>{if(r=c,i){a=!0;return}i=!0,[s,n]=[n,s],s.forEach(l),s.clear(),i=!1,a&&(a=!1,u.process(c))}};return u}const pd=40;function Za(t,e){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=ms.reduce((_,L)=>(_[L]=hd(a),_),{}),{setup:r,read:l,resolveKeyframes:u,preUpdate:c,update:f,preRender:d,render:h,postRender:p}=o,x=()=>{const _=Ue.useManualTiming?i.timestamp:performance.now();s=!1,Ue.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(_-i.timestamp,pd),1)),i.timestamp=_,i.isProcessing=!0,r.process(i),l.process(i),u.process(i),c.process(i),f.process(i),d.process(i),h.process(i),p.process(i),i.isProcessing=!1,s&&e&&(n=!1,t(x))},g=()=>{s=!0,n=!0,i.isProcessing||t(x)};return{schedule:ms.reduce((_,L)=>{const D=o[L];return _[L]=(E,A=!1,S=!1)=>(s||g(),D.schedule(E,A,S)),_},{}),cancel:_=>{for(let L=0;L<ms.length;L++)o[ms[L]].cancel(_)},state:i,steps:o}}const{schedule:ee,cancel:et,state:he,steps:Hs}=Za(typeof requestAnimationFrame<"u"?requestAnimationFrame:Me,!0);let xs;function md(){xs=void 0}const we={now:()=>(xs===void 0&&we.set(he.isProcessing||Ue.useManualTiming?he.timestamp:performance.now()),xs),set:t=>{xs=t,queueMicrotask(md)}},Ja=t=>e=>typeof e=="string"&&e.startsWith(t),ti=Ja("--"),gd=Ja("var(--"),si=t=>gd(t)?vd.test(t.split("/*")[0].trim()):!1,vd=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Fi(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Rt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Qt={...Rt,transform:t=>Ne(0,1,t)},gs={...Rt,default:1},Ht=t=>Math.round(t*1e5)/1e5,ni=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function yd(t){return t==null}const xd=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ii=(t,e)=>s=>!!(typeof s=="string"&&xd.test(s)&&s.startsWith(t)||e&&!yd(s)&&Object.prototype.hasOwnProperty.call(s,e)),er=(t,e,s)=>n=>{if(typeof n!="string")return n;const[i,a,o,r]=n.match(ni);return{[t]:parseFloat(i),[e]:parseFloat(a),[s]:parseFloat(o),alpha:r!==void 0?parseFloat(r):1}},bd=t=>Ne(0,255,t),Gs={...Rt,transform:t=>Math.round(bd(t))},rt={test:ii("rgb","red"),parse:er("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+Gs.transform(t)+", "+Gs.transform(e)+", "+Gs.transform(s)+", "+Ht(Qt.transform(n))+")"};function wd(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const cn={test:ii("#"),parse:wd,transform:rt.transform},is=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ye=is("deg"),je=is("%"),j=is("px"),_d=is("vh"),Sd=is("vw"),ji={...je,parse:t=>je.parse(t)/100,transform:t=>je.transform(t*100)},St={test:ii("hsl","hue"),parse:er("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+je.transform(Ht(e))+", "+je.transform(Ht(s))+", "+Ht(Qt.transform(n))+")"},le={test:t=>rt.test(t)||cn.test(t)||St.test(t),parse:t=>rt.test(t)?rt.parse(t):St.test(t)?St.parse(t):cn.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?rt.transform(t):St.transform(t),getAnimatableNone:t=>{const e=le.parse(t);return e.alpha=0,le.transform(e)}},Td=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kd(t){var e,s;return isNaN(t)&&typeof t=="string"&&(((e=t.match(ni))==null?void 0:e.length)||0)+(((s=t.match(Td))==null?void 0:s.length)||0)>0}const tr="number",sr="color",Ad="var",Cd="var(",Ni="${}",Pd=/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 Mt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(Pd,l=>(le.test(l)?(n.color.push(a),i.push(sr),s.push(le.parse(l))):l.startsWith(Cd)?(n.var.push(a),i.push(Ad),s.push(l)):(n.number.push(a),i.push(tr),s.push(parseFloat(l))),++a,Ni)).split(Ni);return{values:s,split:r,indexes:n,types:i}}function Md(t){return Mt(t).values}function nr({split:t,types:e}){const s=t.length;return n=>{let i="";for(let a=0;a<s;a++)if(i+=t[a],n[a]!==void 0){const o=e[a];o===tr?i+=Ht(n[a]):o===sr?i+=le.transform(n[a]):i+=n[a]}return i}}function Dd(t){return nr(Mt(t))}const Vd=t=>typeof t=="number"?0:le.test(t)?le.getAnimatableNone(t):t,Ed=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Vd(t);function Ld(t){const e=Mt(t);return nr(e)(e.values.map((n,i)=>Ed(n,e.split[i])))}const Le={test:kd,parse:Md,createTransformer:Dd,getAnimatableNone:Ld};function Ks(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+(e-t)*6*s:s<1/2?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function Rd({hue:t,saturation:e,lightness:s,alpha:n}){t/=360,e/=100,s/=100;let i=0,a=0,o=0;if(!e)i=a=o=s;else{const r=s<.5?s*(1+e):s+e-s*e,l=2*s-r;i=Ks(l,r,t+1/3),a=Ks(l,r,t),o=Ks(l,r,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:n}}function Ts(t,e){return s=>s>0?e:t}const ne=(t,e,s)=>t+(e-t)*s,Ws=(t,e,s)=>{const n=t*t,i=s*(e*e-n)+n;return i<0?0:Math.sqrt(i)},$d=[cn,rt,St],Id=t=>$d.find(e=>e.test(t));function zi(t){const e=Id(t);if(!e)return!1;let s=e.parse(t);return e===St&&(s=Rd(s)),s}const qi=(t,e)=>{const s=zi(t),n=zi(e);if(!s||!n)return Ts(t,e);const i={...s};return a=>(i.red=Ws(s.red,n.red,a),i.green=Ws(s.green,n.green,a),i.blue=Ws(s.blue,n.blue,a),i.alpha=ne(s.alpha,n.alpha,a),rt.transform(i))},dn=new Set(["none","hidden"]);function Bd(t,e){return dn.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}function Od(t,e){return s=>ne(t,e,s)}function oi(t){return typeof t=="number"?Od:typeof t=="string"?si(t)?Ts:le.test(t)?qi:Nd:Array.isArray(t)?ir:typeof t=="object"?le.test(t)?qi:Fd:Ts}function ir(t,e){const s=[...t],n=s.length,i=t.map((a,o)=>oi(a)(a,e[o]));return a=>{for(let o=0;o<n;o++)s[o]=i[o](a);return s}}function Fd(t,e){const s={...t,...e},n={};for(const i in s)t[i]!==void 0&&e[i]!==void 0&&(n[i]=oi(t[i])(t[i],e[i]));return i=>{for(const a in n)s[a]=n[a](i);return s}}function jd(t,e){const s=[],n={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const a=e.types[i],o=t.indexes[a][n[a]],r=t.values[o]??0;s[i]=r,n[a]++}return s}const Nd=(t,e)=>{const s=Le.createTransformer(e),n=Mt(t),i=Mt(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?dn.has(t)&&!i.values.length||dn.has(e)&&!n.values.length?Bd(t,e):ss(ir(jd(n,i),i.values),s):Ts(t,e)};function or(t,e,s){return typeof t=="number"&&typeof e=="number"&&typeof s=="number"?ne(t,e,s):oi(t)(t,e)}const zd=t=>{const e=({timestamp:s})=>t(s);return{start:(s=!0)=>ee.update(e,s),stop:()=>et(e),now:()=>he.isProcessing?he.timestamp:we.now()}},ar=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let a=0;a<i;a++)n+=Math.round(t(a/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},ks=2e4;function ai(t){let e=0;const s=50;let n=t.next(e);for(;!n.done&&e<ks;)e+=s,n=t.next(e);return e>=ks?1/0:e}function qd(t,e=100,s){const n=s({...t,keyframes:[0,e]}),i=Math.min(ai(n),ks);return{type:"keyframes",ease:a=>n.next(i*a).value/e,duration:Pe(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 fn(t,e){return t*Math.sqrt(1-e*e)}const Ud=12;function Hd(t,e,s){let n=s;for(let i=1;i<Ud;i++)n=n-t(n)/e(n);return n}const Ui=.001;function Gd({duration:t=oe.duration,bounce:e=oe.bounce,velocity:s=oe.velocity,mass:n=oe.mass}){let i,a,o=1-e;o=Ne(oe.minDamping,oe.maxDamping,o),t=Ne(oe.minDuration,oe.maxDuration,Pe(t)),o<1?(i=u=>{const c=u*o,f=c*t,d=c-s,h=fn(u,o),p=Math.exp(-f);return Ui-d/h*p},a=u=>{const f=u*o*t,d=f*s+s,h=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-f),x=fn(Math.pow(u,2),o);return(-i(u)+Ui>0?-1:1)*((d-h)*p)/x}):(i=u=>{const c=Math.exp(-u*t),f=(u-s)*t+1;return-.001+c*f},a=u=>{const c=Math.exp(-u*t),f=(s-u)*(t*t);return c*f});const r=5/t,l=Hd(i,a,r);if(t=De(t),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:t};{const u=Math.pow(l,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:t}}}const Kd=["duration","bounce"],Wd=["stiffness","damping","mass"];function Hi(t,e){return e.some(s=>t[s]!==void 0)}function Yd(t){let e={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...t};if(!Hi(t,Wd)&&Hi(t,Kd))if(e.velocity=0,t.visualDuration){const s=t.visualDuration,n=2*Math.PI/(s*1.2),i=n*n,a=2*Ne(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:oe.mass,stiffness:i,damping:a}}else{const s=Gd({...t,velocity:0});e={...e,...s,mass:oe.mass},e.isResolvedFromDuration=!0}return e}function As(t=oe.visualDuration,e=oe.bounce){const s=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:i}=s;const a=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],r={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:f,velocity:d,isResolvedFromDuration:h}=Yd({...s,velocity:-Pe(s.velocity||0)}),p=d||0,x=u/(2*Math.sqrt(l*c)),g=o-a,y=Pe(Math.sqrt(l/c)),P=Math.abs(g)<5;n||(n=P?oe.restSpeed.granular:oe.restSpeed.default),i||(i=P?oe.restDelta.granular:oe.restDelta.default);let _,L,D,E,A,S;if(x<1)D=fn(y,x),E=(p+x*y*g)/D,_=R=>{const q=Math.exp(-x*y*R);return o-q*(E*Math.sin(D*R)+g*Math.cos(D*R))},A=x*y*E+g*D,S=x*y*g-E*D,L=R=>Math.exp(-x*y*R)*(A*Math.sin(D*R)+S*Math.cos(D*R));else if(x===1){_=q=>o-Math.exp(-y*q)*(g+(p+y*g)*q);const R=p+y*g;L=q=>Math.exp(-y*q)*(y*R*q-p)}else{const R=y*Math.sqrt(x*x-1);_=C=>{const I=Math.exp(-x*y*C),z=Math.min(R*C,300);return o-I*((p+x*y*g)*Math.sinh(z)+R*g*Math.cosh(z))/R};const q=(p+x*y*g)/R,F=x*y*q-g*R,te=x*y*g-q*R;L=C=>{const I=Math.exp(-x*y*C),z=Math.min(R*C,300);return I*(F*Math.sinh(z)+te*Math.cosh(z))}}const B={calculatedDuration:h&&f||null,velocity:R=>De(L(R)),next:R=>{if(!h&&x<1){const F=Math.exp(-x*y*R),te=Math.sin(D*R),C=Math.cos(D*R),I=o-F*(E*te+g*C),z=De(F*(A*te+S*C));return r.done=Math.abs(z)<=n&&Math.abs(o-I)<=i,r.value=r.done?o:I,r}const q=_(R);if(h)r.done=R>=f;else{const F=De(L(R));r.done=Math.abs(F)<=n&&Math.abs(o-q)<=i}return r.value=r.done?o:q,r},toString:()=>{const R=Math.min(ai(B),ks),q=ar(F=>B.next(R*F).value,R,30);return R+"ms "+q},toTransition:()=>{}};return B}As.applyToOptions=t=>{const e=qd(t,100,As);return t.ease=e.ease,t.duration=De(e.duration),t.type="keyframes",t};const Xd=5;function rr(t,e,s){const n=Math.max(e-Xd,0);return Na(s-t(n),e-n)}function hn({keyframes:t,velocity:e=0,power:s=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:r,max:l,restDelta:u=.5,restSpeed:c}){const f=t[0],d={done:!1,value:f},h=S=>r!==void 0&&S<r||l!==void 0&&S>l,p=S=>r===void 0?l:l===void 0||Math.abs(r-S)<Math.abs(l-S)?r:l;let x=s*e;const g=f+x,y=o===void 0?g:o(g);y!==g&&(x=y-f);const P=S=>-x*Math.exp(-S/n),_=S=>y+P(S),L=S=>{const B=P(S),R=_(S);d.done=Math.abs(B)<=u,d.value=d.done?y:R};let D,E;const A=S=>{h(d.value)&&(D=S,E=As({keyframes:[d.value,p(d.value)],velocity:rr(_,S,d.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return A(0),{calculatedDuration:null,next:S=>{let B=!1;return!E&&D===void 0&&(B=!0,L(S),A(S)),D!==void 0&&S>=D?E.next(S-D):(!B&&L(S),d)}}}function Qd(t,e,s){const n=[],i=s||Ue.mix||or,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]||Me:e;r=ss(l,r)}n.push(r)}return n}function Zd(t,e,{clamp:s=!0,ease:n,mixer:i}={}){const a=t.length;if(Qn(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=Qd(e,n,i),l=r.length,u=c=>{if(o&&c<t[0])return e[0];let f=0;if(l>1)for(;f<t.length-2&&!(c<t[f+1]);f++);const d=Xt(t[f],t[f+1],c);return r[f](d)};return s?c=>u(Ne(t[0],t[a-1],c)):u}function Jd(t,e){const s=t[t.length-1];for(let n=1;n<=e;n++){const i=Xt(0,e,n);t.push(ne(s,1,i))}}function ef(t){const e=[0];return Jd(e,t.length-1),e}function tf(t,e){return t.map(s=>s*e)}function sf(t,e){return t.map(()=>e||Xa).splice(0,t.length-1)}function Gt({duration:t=300,keyframes:e,times:s,ease:n="easeInOut"}){const i=cd(n)?n.map(Oi):Oi(n),a={done:!1,value:e[0]},o=tf(s&&s.length===e.length?s:ef(e),t),r=Zd(o,e,{ease:Array.isArray(i)?i:sf(e,i)});return{calculatedDuration:t,next:l=>(a.value=r(l),a.done=l>=t,a)}}const nf=t=>t!==null;function ri(t,{repeat:e,repeatType:s="loop"},n,i=1){const a=t.filter(nf),r=i<0||e&&s!=="loop"&&e%2===1?0:a.length-1;return!r||n===void 0?a[r]:n}const of={decay:hn,inertia:hn,tween:Gt,keyframes:Gt,spring:As};function lr(t){typeof t.type=="string"&&(t.type=of[t.type])}class li{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,s){return this.finished.then(e,s)}}const af=t=>t/100;class ui extends li{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:s}=this.options;s&&s.updatedAt!==we.now()&&this.tick(we.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;lr(e);const{type:s=Gt,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=e;let{keyframes:r}=e;const l=s||Gt;l!==Gt&&typeof r[0]!="number"&&(this.mixKeyframes=ss(af,or(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=ai(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(e){const s=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(e,s=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:c,repeat:f,repeatType:d,repeatDelay:h,type:p,onUpdate:x,finalKeyframe:g}=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)),s?this.currentTime=e:this.updateTime(e);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let _=this.currentTime,L=n;if(f){const S=Math.min(this.currentTime,i)/r;let B=Math.floor(S),R=S%1;!R&&S>=1&&(R=1),R===1&&B--,B=Math.min(B,f+1),!!(B%2)&&(d==="reverse"?(R=1-R,h&&(R-=h/r)):d==="mirror"&&(L=o)),_=Ne(0,1,R)*r}const D=P?{done:!1,value:c[0]}:L.next(_);a&&!P&&(D.value=a(D.value));let{done:E}=D;!P&&l!==null&&(E=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return A&&p!==hn&&(D.value=ri(c,this.options,g,this.speed)),x&&x(D.value),A&&this.finish(),D}then(e,s){return this.finished.then(e,s)}get duration(){return Pe(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Pe(e)}get time(){return Pe(this.currentTime)}set time(e){e=De(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 s=this.generator.next(e).value;return rr(n=>this.generator.next(n).value,e,s)}get speed(){return this.playbackSpeed}set speed(e){const s=this.playbackSpeed!==e;s&&this.driver&&this.updateTime(we.now()),this.playbackSpeed=e,s&&this.driver&&(this.time=Pe(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:e=zd,startTime:s}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(a=(i=this.options).onPlay)==null||a.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=s??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(we.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,s;this.notifyFinished(),this.teardown(),this.state="finished",(s=(e=this.options).onComplete)==null||s.call(e)}cancel(){var e,s;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(s=(e=this.options).onCancel)==null||s.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 s;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(s=this.driver)==null||s.stop(),e.observe(this)}}function rf(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const lt=t=>t*180/Math.PI,pn=t=>{const e=lt(Math.atan2(t[1],t[0]));return mn(e)},lf={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:pn,rotateZ:pn,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},mn=t=>(t=t%360,t<0&&(t+=360),t),Gi=pn,Ki=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Wi=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),uf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ki,scaleY:Wi,scale:t=>(Ki(t)+Wi(t))/2,rotateX:t=>mn(lt(Math.atan2(t[6],t[5]))),rotateY:t=>mn(lt(Math.atan2(-t[2],t[0]))),rotateZ:Gi,rotate:Gi,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 gn(t){return t.includes("scale")?1:0}function vn(t,e){if(!t||t==="none")return gn(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=uf,i=s;else{const r=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=lf,i=r}if(!i)return gn(e);const a=n[e],o=i[1].split(",").map(df);return typeof a=="function"?a(o):o[a]}const cf=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return vn(s,e)};function df(t){return parseFloat(t.trim())}const $t=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],It=new Set($t),Yi=t=>t===Rt||t===j,ff=new Set(["x","y","z"]),hf=$t.filter(t=>!ff.has(t));function pf(t){const e=[];return hf.forEach(s=>{const n=t.getValue(s);n!==void 0&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}const Je={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),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})=>vn(e,"x"),y:(t,{transform:e})=>vn(e,"y")};Je.translateX=Je.x;Je.translateY=Je.y;const yt=new Set;let yn=!1,xn=!1,bn=!1;function ur(){if(xn){const t=Array.from(yt).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),s=new Map;e.forEach(n=>{const i=pf(n);i.length&&(s.set(n,i),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const i=s.get(n);i&&i.forEach(([a,o])=>{var r;(r=n.getValue(a))==null||r.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}xn=!1,yn=!1,yt.forEach(t=>t.complete(bn)),yt.clear()}function cr(){yt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xn=!0)})}function mf(){bn=!0,cr(),ur(),bn=!1}class ci{constructor(e,s,n,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=s,this.name=n,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(yt.add(this),yn||(yn=!0,ee.read(cr),ee.resolveKeyframes(ur))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:s,element:n,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(n&&s){const r=n.readValue(s,o);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=o),i&&a===void 0&&i.set(e[0])}rf(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 gf=t=>t.startsWith("--");function dr(t,e,s){gf(e)?t.style.setProperty(e,s):t.style[e]=s}const vf={};function fr(t,e){const s=ja(t);return()=>vf[e]??s()}const yf=fr(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),hr=fr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Xi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qt([0,.65,.55,1]),circOut:qt([.55,0,1,.45]),backIn:qt([.31,.01,.66,-.59]),backOut:qt([.33,1.53,.69,.99])};function pr(t,e){if(t)return typeof t=="function"?hr()?ar(t,e):"ease-out":Qa(t)?qt(t):Array.isArray(t)?t.map(s=>pr(s,e)||Xi.easeOut):Xi[t]}function xf(t,e,s,{delay:n=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u=void 0){const c={[e]:s};l&&(c.offset=l);const f=pr(r,i);Array.isArray(f)&&(c.easing=f);const d={delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(c,d)}function mr(t){return typeof t=="function"&&"applyToOptions"in t}function bf({type:t,...e}){return mr(t)&&hr()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class gr extends li{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:s,name:n,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:r,onComplete:l}=e;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=e,Qn(typeof e.type!="string");const u=bf(e);this.animation=xf(s,n,i,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const c=ri(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(c),dr(s,n,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,s;(s=(e=this.animation).finish)==null||s.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 s,n,i;const e=(s=this.options)==null?void 0:s.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(n=this.animation).commitStyles)==null||i.call(n))}get duration(){var s,n;const e=((n=(s=this.animation.effect)==null?void 0:s.getComputedTiming)==null?void 0:n.call(s).duration)||0;return Pe(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Pe(e)}get time(){return Pe(Number(this.animation.currentTime)||0)}set time(e){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=De(e),s&&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:s,rangeEnd:n,observe:i}){var a;return this.allowFlatten&&((a=this.animation.effect)==null||a.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&yf()?(this.animation.timeline=e,s&&(this.animation.rangeStart=s),n&&(this.animation.rangeEnd=n),Me):i(this)}}const vr={anticipate:Ka,backInOut:Ga,circInOut:Ya};function wf(t){return t in vr}function _f(t){typeof t.ease=="string"&&wf(t.ease)&&(t.ease=vr[t.ease])}const Ys=10;class Sf extends gr{constructor(e){_f(e),lr(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:s,onUpdate:n,onComplete:i,element:a,...o}=this.options;if(!s)return;if(e!==void 0){s.set(e);return}const r=new ui({...o,autoplay:!1}),l=Math.max(Ys,we.now()-this.startTime),u=Ne(0,Ys,l-Ys),c=r.sample(l).value,{name:f}=this.options;a&&f&&dr(a,f,c),s.setWithVelocity(r.sample(Math.max(0,l-u)).value,c,u),r.stop()}}const Qi=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Le.test(t)||t==="0")&&!t.startsWith("url("));function Tf(t){const e=t[0];if(t.length===1)return!0;for(let s=0;s<t.length;s++)if(t[s]!==e)return!0}function kf(t,e,s,n){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const a=t[t.length-1],o=Qi(i,e),r=Qi(a,e);return!o||!r?!1:Tf(t)||(s==="spring"||mr(s))&&n}function wn(t){t.duration=0,t.type="keyframes"}const Af=new Set(["opacity","clipPath","filter","transform"]),Cf=ja(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Pf(t){var c;const{motionValue:e,name:s,repeatDelay:n,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 Cf()&&s&&Af.has(s)&&(s!=="transform"||!u)&&!l&&!n&&i!=="mirror"&&a!==0&&o!=="inertia"}const Mf=40;class Df extends li{constructor({autoplay:e=!0,delay:s=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:r,name:l,motionValue:u,element:c,...f}){var p;super(),this.stop=()=>{var x,g;this._animation&&(this._animation.stop(),(x=this.stopTimeline)==null||x.call(this)),(g=this.keyframeResolver)==null||g.cancel()},this.createdAt=we.now();const d={autoplay:e,delay:s,type:n,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:u,element:c,...f},h=(c==null?void 0:c.KeyframeResolver)||ci;this.keyframeResolver=new h(r,(x,g,y)=>this.onKeyframesResolved(x,g,d,!y),l,u,c),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,s,n,i){var g,y;this.keyframeResolver=void 0;const{name:a,type:o,velocity:r,delay:l,isHandoff:u,onUpdate:c}=n;this.resolvedAt=we.now(),kf(e,a,o,r)||((Ue.instantAnimations||!l)&&(c==null||c(ri(e,n,s))),e[0]=e[e.length-1],wn(n),n.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Mf?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...n,keyframes:e},h=!u&&Pf(d),p=(y=(g=d.motionValue)==null?void 0:g.owner)==null?void 0:y.current,x=h?new Sf({...d,element:p}):new ui(d);x.finished.then(()=>{this.notifyFinished()}).catch(Me),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,s){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),mf()),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 yr(t,e,s,n=0,i=1){const a=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,r=(o-1)*n;return typeof s=="function"?s(a,o):i===1?a*n:r-a*n}const Vf=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ef(t){const e=Vf.exec(t);if(!e)return[,];const[,s,n,i]=e;return[`--${s??n}`,i]}function xr(t,e,s=1){const[n,i]=Ef(t);if(!n)return;const a=window.getComputedStyle(e).getPropertyValue(n);if(a){const o=a.trim();return Ba(o)?parseFloat(o):o}return si(i)?xr(i,e,s+1):i}const Lf={type:"spring",stiffness:500,damping:25,restSpeed:10},Rf=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),$f={type:"keyframes",duration:.8},If={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Bf=(t,{keyframes:e})=>e.length>2?$f:It.has(t)?t.startsWith("scale")?Rf(e[1]):Lf:If,Of=t=>t!==null;function Ff(t,{repeat:e,repeatType:s="loop"},n){const i=t.filter(Of),a=e&&s!=="loop"&&e%2===1?0:i.length-1;return i[a]}function br(t,e){if(t!=null&&t.inherit&&e){const{inherit:s,...n}=t;return{...e,...n}}return t}function di(t,e){const s=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return s!==t?br(s,t):s}function jf({when:t,delay:e,delayChildren:s,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:r,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const fi=(t,e,s,n={},i,a)=>o=>{const r=di(n,t)||{},l=r.delay||n.delay||0;let{elapsed:u=0}=n;u=u-De(l);const c={keyframes:Array.isArray(s)?s:[null,s],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};jf(r)||Object.assign(c,Bf(t,c)),c.duration&&(c.duration=De(c.duration)),c.repeatDelay&&(c.repeatDelay=De(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(wn(c),c.delay===0&&(f=!0)),(Ue.instantAnimations||Ue.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(f=!0,wn(c),c.delay=0),c.allowFlatten=!r.type&&!r.ease,f&&!a&&e.get()!==void 0){const d=Ff(c.keyframes,r);if(d!==void 0){ee.update(()=>{c.onUpdate(d),c.onComplete()});return}}return r.isSync?new ui(c):new Df(c)};function Zi(t){const e=[{},{}];return t==null||t.values.forEach((s,n)=>{e[0][n]=s.get(),e[1][n]=s.getVelocity()}),e}function wr(t,e,s,n){if(typeof e=="function"){const[i,a]=Zi(n);e=e(s!==void 0?s:t.custom,i,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,a]=Zi(n);e=e(s!==void 0?s:t.custom,i,a)}return e}function Pt(t,e,s){const n=t.getProps();return wr(n,e,s!==void 0?s:n.custom,t)}const _r=new Set(["width","height","top","left","right","bottom",...$t]),Ji=30,Nf=t=>!isNaN(parseFloat(t));class zf{constructor(e,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var a;const i=we.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),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=s.owner}setCurrent(e){this.current=e,this.updatedAt=we.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Nf(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,s){this.events[e]||(this.events[e]=new Zn);const n=this.events[e].add(s);return e==="change"?()=>{n(),ee.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,s){this.passiveEffect=e,this.stopPassiveEffect=s}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,s,n){this.set(s),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,s=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&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=we.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ji)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Ji);return Na(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(e){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=e(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,s;(e=this.dependents)==null||e.clear(),(s=this.events.destroy)==null||s.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Dt(t,e){return new zf(t,e)}const qf=t=>Array.isArray(t);function Uf(t,e,s){t.hasValue(e)?t.getValue(e).set(s):t.addValue(e,Dt(s))}function Hf(t){return qf(t)?t[t.length-1]||0:t}function Gf(t,e){const s=Pt(t,e);let{transitionEnd:n={},transition:i={},...a}=s||{};a={...a,...n};for(const o in a){const r=Hf(a[o]);Uf(t,o,r)}}const ye=t=>!!(t&&t.getVelocity);function Kf(t){return!!(ye(t)&&t.add)}function _n(t,e){const s=t.getValue("willChange");if(Kf(s))return s.add(e);if(!s&&Ue.WillChange){const n=new Ue.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function hi(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Wf="framerAppearId",Yf="data-"+hi(Wf);function Sr(t){return t.props[Yf]}function Xf({protectedKeys:t,needsAnimating:e},s){const n=t.hasOwnProperty(s)&&e[s]!==!0;return e[s]=!1,n}function Tr(t,e,{delay:s=0,transitionOverride:n,type:i}={}){let{transition:a,transitionEnd:o,...r}=e;const l=t.getDefaultTransition();a=a?br(a,l):l;const u=a==null?void 0:a.reduceMotion;n&&(a=n);const c=[],f=i&&t.animationState&&t.animationState.getState()[i];for(const d in r){const h=t.getValue(d,t.latestValues[d]??null),p=r[d];if(p===void 0||f&&Xf(f,d))continue;const x={delay:s,...di(a||{},d)},g=h.get();if(g!==void 0&&!h.isAnimating&&!Array.isArray(p)&&p===g&&!x.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const L=Sr(t);if(L){const D=window.MotionHandoffAnimation(L,d,ee);D!==null&&(x.startTime=D,y=!0)}}_n(t,d);const P=u??t.shouldReduceMotion;h.start(fi(d,h,p,P&&_r.has(d)?{type:!1}:x,t,y));const _=h.animation;_&&c.push(_)}if(o){const d=()=>ee.update(()=>{o&&Gf(t,o)});c.length?Promise.all(c).then(d):d()}return c}function Sn(t,e,s={}){var l;const n=Pt(t,e,s.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=n||{};s.transitionOverride&&(i=s.transitionOverride);const a=n?()=>Promise.all(Tr(t,n,s)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:d}=i;return Qf(t,e,u,c,f,d,s)}:()=>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(s.delay)])}function Qf(t,e,s=0,n=0,i=0,a=1,o){const r=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),r.push(Sn(l,e,{...o,delay:s+(typeof n=="function"?0:n)+yr(t.variantChildren,l,n,i,a)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(r)}function Zf(t,e,s={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(a=>Sn(t,a,s));n=Promise.all(i)}else if(typeof e=="string")n=Sn(t,e,s);else{const i=typeof e=="function"?Pt(t,e,s.custom):e;n=Promise.all(Tr(t,i,s))}return n.then(()=>{t.notify("AnimationComplete",e)})}const Jf={test:t=>t==="auto",parse:t=>t},kr=t=>e=>e.test(t),Ar=[Rt,j,je,Ye,Sd,_d,Jf],eo=t=>Ar.find(kr(t));function eh(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Fa(t):!0}const th=new Set(["brightness","contrast","saturate","opacity"]);function sh(t){const[e,s]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=s.match(ni)||[];if(!n)return t;const i=s.replace(n,"");let a=th.has(e)?1:0;return n!==s&&(a*=100),e+"("+a+i+")"}const nh=/\b([a-z-]*)\(.*?\)/gu,Tn={...Le,getAnimatableNone:t=>{const e=t.match(nh);return e?e.map(sh).join(" "):t}},kn={...Le,getAnimatableNone:t=>{const e=Le.parse(t);return Le.createTransformer(t)(e.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},to={...Rt,transform:Math.round},ih={rotate:Ye,rotateX:Ye,rotateY:Ye,rotateZ:Ye,scale:gs,scaleX:gs,scaleY:gs,scaleZ:gs,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:Qt,originX:ji,originY:ji,originZ:j},pi={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,...ih,zIndex:to,fillOpacity:Qt,strokeOpacity:Qt,numOctaves:to},oh={...pi,color:le,backgroundColor:le,outlineColor:le,fill:le,stroke:le,borderColor:le,borderTopColor:le,borderRightColor:le,borderBottomColor:le,borderLeftColor:le,filter:Tn,WebkitFilter:Tn,mask:kn,WebkitMask:kn},Cr=t=>oh[t],ah=new Set([Tn,kn]);function Pr(t,e){let s=Cr(t);return ah.has(s)||(s=Le),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const rh=new Set(["auto","none","0"]);function lh(t,e,s){let n=0,i;for(;n<t.length&&!i;){const a=t[n];typeof a=="string"&&!rh.has(a)&&Mt(a).values.length&&(i=t[n]),n++}if(i&&s)for(const a of e)t[a]=Pr(s,i)}class uh extends ci{constructor(e,s,n,i,a){super(e,s,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:s,name:n}=this;if(!s||!s.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let f=e[c];if(typeof f=="string"&&(f=f.trim(),si(f))){const d=xr(f,s.current);d!==void 0&&(e[c]=d),c===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!_r.has(n)||e.length!==2)return;const[i,a]=e,o=eo(i),r=eo(a),l=Fi(i),u=Fi(a);if(l!==u&&Je[n]){this.needsMeasurement=!0;return}if(o!==r)if(Yi(o)&&Yi(r))for(let c=0;c<e.length;c++){const f=e[c];typeof f=="string"&&(e[c]=parseFloat(f))}else Je[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:s}=this,n=[];for(let i=0;i<e.length;i++)(e[i]===null||eh(e[i]))&&n.push(i);n.length&&lh(e,n,s)}measureInitialState(){const{element:e,unresolvedKeyframes:s,name:n}=this;if(!e||!e.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Je[n](e.measureViewportBox(),window.getComputedStyle(e.current)),s[0]=this.measuredOrigin;const i=s[s.length-1];i!==void 0&&e.getValue(n,i).jump(i,!1)}measureEndState(){var r;const{element:e,name:s,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const i=e.getValue(s);i&&i.jump(this.measuredOrigin,!1);const a=n.length-1,o=n[a];n[a]=Je[s](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 ch=new Set(["opacity","clipPath","filter","transform"]);function Mr(t,e,s){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let n=document;const i=(s==null?void 0:s[t])??n.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(n=>n!=null)}const Dr=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function dh(t){return Oa(t)&&"offsetHeight"in t}const{schedule:Vr}=Za(queueMicrotask,!1),fh={y:!1};function hh(){return fh.y}function Er(t,e){const s=Mr(t),n=new AbortController,i={passive:!0,...e,signal:n.signal};return[s,i,()=>n.abort()]}function ph(t){return!(t.pointerType==="touch"||hh())}function mh(t,e,s={}){const[n,i,a]=Er(t,s);return n.forEach(o=>{let r=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",p)},f=g=>{u&&(u(g),u=void 0),c()},d=g=>{r=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),l&&(l=!1,f(g))},h=()=>{r=!0,window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",d,i)},p=g=>{if(g.pointerType!=="touch"){if(r){l=!0;return}f(g)}},x=g=>{if(!ph(g))return;l=!1;const y=e(o,g);typeof y=="function"&&(u=y,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",x,i),o.addEventListener("pointerdown",h,i)}),a}const Lr=(t,e)=>e?t===e?!0:Lr(t,e.parentElement):!1,gh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,vh=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function yh(t){return vh.has(t.tagName)||t.isContentEditable===!0}const bs=new WeakSet;function so(t){return e=>{e.key==="Enter"&&t(e)}}function Xs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const xh=(t,e)=>{const s=t.currentTarget;if(!s)return;const n=so(()=>{if(bs.has(s))return;Xs(s,"down");const i=so(()=>{Xs(s,"up")}),a=()=>Xs(s,"cancel");s.addEventListener("keyup",i,e),s.addEventListener("blur",a,e)});s.addEventListener("keydown",n,e),s.addEventListener("blur",()=>s.removeEventListener("keydown",n),e)};function no(t){return gh(t)&&!0}const io=new WeakSet;function bh(t,e,s={}){const[n,i,a]=Er(t,s),o=r=>{const l=r.currentTarget;if(!no(r)||io.has(r))return;bs.add(l),s.stopPropagation&&io.add(r);const u=e(l,r),c=(h,p)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),bs.has(l)&&bs.delete(l),no(h)&&typeof u=="function"&&u(h,{success:p})},f=h=>{c(h,l===window||l===document||s.useGlobalTarget||Lr(l,h.target))},d=h=>{c(h,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",d,i)};return n.forEach(r=>{(s.useGlobalTarget?window:r).addEventListener("pointerdown",o,i),dh(r)&&(r.addEventListener("focus",u=>xh(u,i)),!yh(r)&&!r.hasAttribute("tabindex")&&(r.tabIndex=0))}),a}function Rr(t){return Oa(t)&&"ownerSVGElement"in t}function wh(t){return Rr(t)&&t.tagName==="svg"}const _h=[...Ar,le,Le],Sh=t=>_h.find(kr(t)),oo=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tt=()=>({x:oo(),y:oo()}),ao=()=>({min:0,max:0}),ce=()=>({x:ao(),y:ao()}),Th=new WeakMap;function mi(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function $s(t){return typeof t=="string"||Array.isArray(t)}const kh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ah=["initial",...kh];function $r(t){return mi(t.animate)||Ah.some(e=>$s(t[e]))}function Ch(t){return!!($r(t)||t.variants)}function Ph(t,e,s){for(const n in e){const i=e[n],a=s[n];if(ye(i))t.addValue(n,i);else if(ye(a))t.addValue(n,Dt(i,{owner:t}));else if(a!==i)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(n);t.addValue(n,Dt(o!==void 0?o:i,{owner:t}))}}for(const n in s)e[n]===void 0&&t.removeValue(n);return e}const An={current:null},Ir={current:!1},Mh=typeof window<"u";function Dh(){if(Ir.current=!0,!!Mh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>An.current=t.matches;t.addEventListener("change",e),e()}else An.current=!1}const ro=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let lo={};class Vh{scrapeMotionValuesFromProps(e,s,n){return{}}constructor({parent:e,props:s,presenceContext:n,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=ci,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 h=we.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ee.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=r;this.latestValues=u,this.baseTarget={...u},this.initialValues=s.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=s,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=$r(s),this.isVariantNode=Ch(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...d}=this.scrapeMotionValuesFromProps(s,{},this);for(const h in d){const p=d[h];u[h]!==void 0&&ye(p)&&p.set(u[h])}}mount(e){var s,n;if(this.hasBeenMounted)for(const i in this.initialValues)(s=this.values.get(i))==null||s.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,Th.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:(Ir.current||Dh(),this.shouldReduceMotion=An.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(n=this.parent)==null||n.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(s=>s()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const n=this.features[s];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(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,s){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),s.accelerate&&ch.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:r,times:l,ease:u,duration:c}=s.accelerate,f=new gr({element:this.current,name:e,keyframes:r,times:l,ease:u,duration:De(c)}),d=o(f);this.valueSubscriptions.set(e,()=>{d(),f.cancel()});return}const n=It.has(e);n&&this.onBindTransform&&this.onBindTransform();const i=s.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&ee.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,s)),this.valueSubscriptions.set(e,()=>{i(),a&&a(),s.owner&&s.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 lo){const s=lo[e];if(!s)continue;const{isEnabled:n,Feature:i}=s;if(!this.features[e]&&i&&n(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,s){this.latestValues[e]=s}update(e,s){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let n=0;n<ro.length;n++){const i=ro[n];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=Ph(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 s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(e),()=>s.variantChildren.delete(e)}addValue(e,s){const n=this.values.get(e);s!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,s),this.values.set(e,s),this.latestValues[e]=s.get())}removeValue(e){this.values.delete(e);const s=this.valueSubscriptions.get(e);s&&(s(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,s){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&s!==void 0&&(n=Dt(s===null?void 0:s,{owner:this}),this.addValue(e,n)),n}readValue(e,s){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n=="string"&&(Ba(n)||Fa(n))?n=parseFloat(n):!Sh(n)&&Le.test(s)&&(n=Pr(e,s)),this.setBaseTarget(e,ye(n)?n.get():n)),ye(n)?n.get():n}setBaseTarget(e,s){this.baseTarget[e]=s}getBaseTarget(e){var a;const{initial:s}=this.props;let n;if(typeof s=="string"||typeof s=="object"){const o=wr(this.props,s,(a=this.presenceContext)==null?void 0:a.custom);o&&(n=o[e])}if(s&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!ye(i)?i:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,s){return this.events[e]||(this.events[e]=new Zn),this.events[e].add(s)}notify(e,...s){this.events[e]&&this.events[e].notify(...s)}scheduleRenderMicrotask(){Vr.render(this.render)}}class Br extends Vh{constructor(){super(...arguments),this.KeyframeResolver=uh}sortInstanceNodePosition(e,s){return e.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(e,s){const n=e.style;return n?n[s]:void 0}removeValueFromRenderState(e,{vars:s,style:n}){delete s[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ye(e)&&(this.childSubscription=e.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function Or({top:t,left:e,right:s,bottom:n}){return{x:{min:e,max:s},y:{min:t,max:n}}}function Eh({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Lh(t,e){if(!e)return t;const s=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:s.y,left:s.x,bottom:n.y,right:n.x}}function Qs(t){return t===void 0||t===1}function Cn({scale:t,scaleX:e,scaleY:s}){return!Qs(t)||!Qs(e)||!Qs(s)}function at(t){return Cn(t)||Fr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Fr(t){return uo(t.x)||uo(t.y)}function uo(t){return t&&t!=="0%"}function Cs(t,e,s){const n=t-s,i=e*n;return s+i}function co(t,e,s,n,i){return i!==void 0&&(t=Cs(t,i,n)),Cs(t,s,n)+e}function Pn(t,e=0,s=1,n,i){t.min=co(t.min,e,s,n,i),t.max=co(t.max,e,s,n,i)}function jr(t,{x:e,y:s}){Pn(t.x,e.translate,e.scale,e.originPoint),Pn(t.y,s.translate,s.scale,s.originPoint)}const fo=.999999999999,ho=1.0000000000001;function Rh(t,e,s,n=!1){var r;const i=s.length;if(!i)return;e.x=e.y=1;let a,o;for(let l=0;l<i;l++){a=s[l],o=a.projectionDelta;const{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(n&&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,jr(t,o)),n&&at(a.latestValues)&&At(t,a.latestValues,(r=a.layout)==null?void 0:r.layoutBox))}e.x<ho&&e.x>fo&&(e.x=1),e.y<ho&&e.y>fo&&(e.y=1)}function kt(t,e){t.min=t.min+e,t.max=t.max+e}function po(t,e,s,n,i=.5){const a=ne(t.min,t.max,i);Pn(t,e,s,a,n)}function mo(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function At(t,e,s){const n=s??t;po(t.x,mo(e.x,n.x),e.scaleX,e.scale,e.originX),po(t.y,mo(e.y,n.y),e.scaleY,e.scale,e.originY)}function Nr(t,e){return Or(Lh(t.getBoundingClientRect(),e))}function $h(t,e,s){const n=Nr(t,s),{scroll:i}=e;return i&&(kt(n.x,i.offset.x),kt(n.y,i.offset.y)),n}const Ih={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bh=$t.length;function Oh(t,e,s){let n="",i=!0;for(let a=0;a<Bh;a++){const o=$t[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||s){const u=Dr(r,pi[o]);if(!l){i=!1;const c=Ih[o]||o;n+=`${c}(${u}) `}s&&(e[o]=u)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}function gi(t,e,s){const{style:n,vars:i,transformOrigin:a}=t;let o=!1,r=!1;for(const l in e){const u=e[l];if(It.has(l)){o=!0;continue}else if(ti(l)){i[l]=u;continue}else{const c=Dr(u,pi[l]);l.startsWith("origin")?(r=!0,a[l]=c):n[l]=c}}if(e.transform||(o||s?n.transform=Oh(e,t.transform,s):n.transform&&(n.transform="none")),r){const{originX:l="50%",originY:u="50%",originZ:c=0}=a;n.transformOrigin=`${l} ${u} ${c}`}}function zr(t,{style:e,vars:s},n,i){const a=t.style;let o;for(o in e)a[o]=e[o];i==null||i.applyProjectionStyles(a,n);for(o in s)a.setProperty(o,s[o])}function go(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Fe={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(j.test(t))t=parseFloat(t);else return t;const s=go(t,e.target.x),n=go(t,e.target.y);return`${s}% ${n}%`}},qr={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=Le.parse(t);if(i.length>5)return n;const a=Le.createTransformer(t),o=typeof i[0]!="number"?1:0,r=s.x.scale*e.x,l=s.y.scale*e.y;i[0+o]/=r,i[1+o]/=l;const u=ne(r,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}},Zt={borderRadius:{...Fe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fe,borderTopRightRadius:Fe,borderBottomLeftRadius:Fe,borderBottomRightRadius:Fe,boxShadow:qr};function Ur(t){for(const e in t)Zt[e]=t[e],ti(e)&&(Zt[e].isCSSVariable=!0)}function Fh(t,{layout:e,layoutId:s}){return It.has(t)||t.startsWith("origin")||(e||s!==void 0)&&(!!Zt[t]||t==="opacity")}function Hr(t,e,s){var o;const n=t.style,i=e==null?void 0:e.style,a={};if(!n)return a;for(const r in n)(ye(n[r])||i&&ye(i[r])||Fh(r,t)||((o=s==null?void 0:s.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(a[r]=n[r]);return a}function jh(t){return window.getComputedStyle(t)}class Nh extends Br{constructor(){super(...arguments),this.type="html",this.renderInstance=zr}readValueFromInstance(e,s){var n;if(It.has(s))return(n=this.projection)!=null&&n.isProjecting?gn(s):cf(e,s);{const i=jh(e),a=(ti(s)?i.getPropertyValue(s):i[s])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:s}){return Nr(e,s)}build(e,s,n){gi(e,s,n.transformTemplate)}scrapeMotionValuesFromProps(e,s,n){return Hr(e,s,n)}}const zh={offset:"stroke-dashoffset",array:"stroke-dasharray"},qh={offset:"strokeDashoffset",array:"strokeDasharray"};function Uh(t,e,s=1,n=0,i=!0){t.pathLength=1;const a=i?zh:qh;t[a.offset]=`${-n}`,t[a.array]=`${e} ${s}`}const Hh=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Gr(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...r},l,u,c){if(gi(t,r,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete f.transformBox);for(const h of Hh)f[h]!==void 0&&(d[h]=f[h],delete f[h]);e!==void 0&&(f.x=e),s!==void 0&&(f.y=s),n!==void 0&&(f.scale=n),i!==void 0&&Uh(f,i,a,o,!1)}const vi=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"]),Kr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Gh(t,e,s,n){zr(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(vi.has(i)?i:hi(i),e.attrs[i])}function Kh(t,e,s){const n=Hr(t,e,s);for(const i in t)if(ye(t[i])||ye(e[i])){const a=$t.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=t[i]}return n}class Wh extends Br{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ce}getBaseTargetFromProps(e,s){return e[s]}readValueFromInstance(e,s){if(It.has(s)){const n=Cr(s);return n&&n.default||0}return s=vi.has(s)?s:hi(s),e.getAttribute(s)}scrapeMotionValuesFromProps(e,s,n){return Kh(e,s,n)}build(e,s,n){Gr(e,s,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,s,n,i){Gh(e,s,n,i)}mount(e){this.isSVGTag=Kr(e.tagName),super.mount(e)}}function vo(t,e){t.min=e.min,t.max=e.max}function Ee(t,e){vo(t.x,e.x),vo(t.y,e.y)}function yo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Wr=1e-4,Yh=1-Wr,Xh=1+Wr,Yr=.01,Qh=0-Yr,Zh=0+Yr;function _e(t){return t.max-t.min}function Jh(t,e,s){return Math.abs(t-e)<=s}function xo(t,e,s,n=.5){t.origin=n,t.originPoint=ne(e.min,e.max,t.origin),t.scale=_e(s)/_e(e),t.translate=ne(s.min,s.max,t.origin)-t.originPoint,(t.scale>=Yh&&t.scale<=Xh||isNaN(t.scale))&&(t.scale=1),(t.translate>=Qh&&t.translate<=Zh||isNaN(t.translate))&&(t.translate=0)}function Kt(t,e,s,n){xo(t.x,e.x,s.x,n?n.originX:void 0),xo(t.y,e.y,s.y,n?n.originY:void 0)}function bo(t,e,s){t.min=s.min+e.min,t.max=t.min+_e(e)}function ep(t,e,s){bo(t.x,e.x,s.x),bo(t.y,e.y,s.y)}function wo(t,e,s){t.min=e.min-s.min,t.max=t.min+_e(e)}function Ps(t,e,s){wo(t.x,e.x,s.x),wo(t.y,e.y,s.y)}function _o(t,e,s,n,i){return t-=e,t=Cs(t,1/s,n),i!==void 0&&(t=Cs(t,1/i,n)),t}function tp(t,e=0,s=1,n=.5,i,a=t,o=t){if(je.test(e)&&(e=parseFloat(e),e=ne(o.min,o.max,e/100)-o.min),typeof e!="number")return;let r=ne(a.min,a.max,n);t===a&&(r-=e),t.min=_o(t.min,e,s,r,i),t.max=_o(t.max,e,s,r,i)}function So(t,e,[s,n,i],a,o){tp(t,e[s],e[n],e[i],e.scale,a,o)}const sp=["x","scaleX","originX"],np=["y","scaleY","originY"];function To(t,e,s,n){So(t.x,e,sp,s?s.x:void 0,n?n.x:void 0),So(t.y,e,np,s?s.y:void 0,n?n.y:void 0)}function ko(t){return t.translate===0&&t.scale===1}function Xr(t){return ko(t.x)&&ko(t.y)}function Ao(t,e){return t.min===e.min&&t.max===e.max}function ip(t,e){return Ao(t.x,e.x)&&Ao(t.y,e.y)}function Co(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Qr(t,e){return Co(t.x,e.x)&&Co(t.y,e.y)}function Po(t){return _e(t.x)/_e(t.y)}function Mo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ce(t){return[t("x"),t("y")]}function op(t,e,s){let n="";const i=t.x.translate/e.x,a=t.y.translate/e.y,o=(s==null?void 0:s.z)||0;if((i||a||o)&&(n=`translate3d(${i}px, ${a}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),s){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:d,skewX:h,skewY:p}=s;u&&(n=`perspective(${u}px) ${n}`),c&&(n+=`rotate(${c}deg) `),f&&(n+=`rotateX(${f}deg) `),d&&(n+=`rotateY(${d}deg) `),h&&(n+=`skewX(${h}deg) `),p&&(n+=`skewY(${p}deg) `)}const r=t.x.scale*e.x,l=t.y.scale*e.y;return(r!==1||l!==1)&&(n+=`scale(${r}, ${l})`),n||"none"}const Zr=["TopLeft","TopRight","BottomLeft","BottomRight"],ap=Zr.length,Do=t=>typeof t=="string"?parseFloat(t):t,Vo=t=>typeof t=="number"||j.test(t);function rp(t,e,s,n,i,a){i?(t.opacity=ne(0,s.opacity??1,lp(n)),t.opacityExit=ne(e.opacity??1,0,up(n))):a&&(t.opacity=ne(e.opacity??1,s.opacity??1,n));for(let o=0;o<ap;o++){const r=`border${Zr[o]}Radius`;let l=Eo(e,r),u=Eo(s,r);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Vo(l)===Vo(u)?(t[r]=Math.max(ne(Do(l),Do(u),n),0),(je.test(u)||je.test(l))&&(t[r]+="%")):t[r]=u}(e.rotate||s.rotate)&&(t.rotate=ne(e.rotate||0,s.rotate||0,n))}function Eo(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const lp=Jr(0,.5,Wa),up=Jr(.5,.95,Me);function Jr(t,e,s){return n=>n<t?0:n>e?1:s(Xt(t,e,n))}function cp(t,e,s){const n=ye(t)?t:Dt(t);return n.start(fi("",n,e,s)),n.animation}function dp(t,e,s,n={passive:!0}){return t.addEventListener(e,s,n),()=>t.removeEventListener(e,s)}const fp=(t,e)=>t.depth-e.depth;class hp{constructor(){this.children=[],this.isDirty=!1}add(e){Xn(this.children,e),this.isDirty=!0}remove(e){Ss(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(fp),this.isDirty=!1,this.children.forEach(e)}}function pp(t,e){const s=we.now(),n=({timestamp:i})=>{const a=i-s;a>=e&&(et(n),t(a-e))};return ee.setup(n,!0),()=>et(n)}function Zs(t){return ye(t)?t.get():t}class mp{constructor(){this.members=[]}add(e){Xn(this.members,e);for(let s=this.members.length-1;s>=0;s--){const n=this.members[s];if(n===e||n===this.lead||n===this.prevLead)continue;const i=n.instance;(!i||i.isConnected===!1)&&!n.snapshot&&(Ss(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Ss(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(e){var s;for(let n=this.members.indexOf(e)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&((s=i.instance)==null?void 0:s.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,s){var i;const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();const{layoutDependency:a}=n.options,{layoutDependency:o}=e.options;(a===void 0||a!==o)&&(e.resumeFrom=n,s&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var s,n,i,a,o;(n=(s=e.options).onExitComplete)==null||n.call(s),(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 ws={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Js=["","X","Y","Z"],gp=1e3;let vp=0;function en(t,e,s,n){const{latestValues:i}=e;i[t]&&(s[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function el(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const s=Sr(e);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(s,"transform",ee,!(i||a))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&el(n)}function tl({attachResizeListener:t,defaultParent:e,measureScroll:s,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},r=e==null?void 0:e()){this.id=vp++,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(bp),this.nodes.forEach(Tp),this.nodes.forEach(kp),this.nodes.forEach(wp)},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 hp)}addEventListener(o,r){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Zn),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=Rr(o)&&!wh(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,f=0;const d=()=>this.root.updateBlockedByResize=!1;ee.read(()=>{f=window.innerWidth}),t(o,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,c&&c(),c=pp(d,250),ws.hasAnimatedSinceResize&&(ws.hasAnimatedSinceResize=!1,this.nodes.forEach($o)))})}r&&this.root.registerSharedNode(r,this),this.options.animate!==!1&&u&&(r||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Dp,{onLayoutAnimationStart:x,onLayoutAnimationComplete:g}=u.getProps(),y=!this.targetLayout||!Qr(this.targetLayout,h),P=!f&&d;if(this.options.layoutRoot||this.resumeFrom||P||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...di(p,"layout"),onPlay:x,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(c,P)}else f||$o(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}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(Ap),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&&el(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.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(Lo);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ro);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Sp),this.nodes.forEach(yp),this.nodes.forEach(xp)):this.nodes.forEach(Ro),this.clearAllSnapshots();const r=we.now();he.delta=Ne(0,1e3/60,r-he.timestamp),he.timestamp=r,he.isProcessing=!0,Hs.update.process(he),Hs.preRender.process(he),Hs.render.process(he),he.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_p),this.sharedNodes.forEach(Cp)}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&&!_e(this.snapshot.measuredBox.x)&&!_e(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=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:s(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&&!Xr(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)),Vp(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(Ep))){const{scroll:c}=this.root;c&&(kt(r.x,c.offset.x),kt(r.y,c.offset.y))}return r}removeElementScroll(o){var l;const r=ce();if(Ee(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:f,options:d}=c;c!==this.root&&f&&d.layoutScroll&&(f.wasRoot&&Ee(r,o),kt(r.x,f.offset.x),kt(r.y,f.offset.y))}return r}applyTransform(o,r=!1){var u,c;const l=ce();Ee(l,o);for(let f=0;f<this.path.length;f++){const d=this.path[f];!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();Ee(r,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!at(c.latestValues))continue;let f;c.instance&&(Cn(c.latestValues)&&c.updateSnapshot(),f=ce(),Ee(f,c.measurePageBox())),To(r,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,f)}return at(this.latestValues)&&To(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 h;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||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:f}=this.options;if(!this.layout||!(c||f))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(),ep(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ee(this.target,this.layout.layoutBox),jr(this.target,this.targetDelta)):Ee(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||Cn(this.parent.latestValues)||Fr(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(),Ps(this.relativeTargetOrigin,r,l),Ee(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;Ee(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;Rh(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:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(yo(this.prevProjectionDelta.x,this.projectionDelta.x),yo(this.prevProjectionDelta.y,this.projectionDelta.y)),Kt(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!Mo(this.projectionDelta.x,this.prevProjectionDelta.x)||!Mo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}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=Tt(),this.projectionDelta=Tt(),this.projectionDeltaWithTransform=Tt()}setAnimationOrigin(o,r=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=Tt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!r;const d=ce(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,x=h!==p,g=this.getStack(),y=!g||g.members.length<=1,P=!!(x&&!y&&this.options.crossfade===!0&&!this.path.some(Mp));this.animationProgress=0;let _;this.mixTargetDelta=L=>{const D=L/1e3;Io(f.x,o.x,D),Io(f.y,o.y,D),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ps(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Pp(this.relativeTarget,this.relativeTargetOrigin,d,D),_&&ip(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=ce()),Ee(_,this.relativeTarget)),x&&(this.animationValues=c,rp(c,u,this.latestValues,D,P,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},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(()=>{ws.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Dt(0)),this.motionValue.jump(0,!1),this.currentAnimation=cp(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(gp),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&&sl(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ce();const f=_e(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const d=_e(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}Ee(r,l),At(r,c),Kt(this.projectionDeltaWithTransform,this.layoutCorrected,r,c)}}registerSharedNode(o,r){this.sharedNodes.has(o)||this.sharedNodes.set(o,new mp),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&&en("z",o,u,this.animationValues);for(let c=0;c<Js.length;c++)en(`rotate${Js[c]}`,o,u,this.animationValues),en(`skew${Js[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=Zs(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=Zs(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 f=op(this.projectionDeltaWithTransform,this.treeScale,c);l&&(f=l(c,f)),o.transform=f;const{x:d,y:h}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${h.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 Zt){if(c[p]===void 0)continue;const{correct:x,applyTo:g,isCSSVariable:y}=Zt[p],P=f==="none"?c[p]:x(c[p],u);if(g){const _=g.length;for(let L=0;L<_;L++)o[g[L]]=P}else y?this.options.visualElement.renderState.vars[p]=P:o[p]=P}this.options.layoutId&&(o.pointerEvents=u===this?Zs(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(Lo),this.root.sharedNodes.clear()}}}function yp(t){t.updateLayout()}function xp(t){var s;const e=((s=t.resumeFrom)==null?void 0:s.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:a}=t.options,o=e.source!==t.layout.source;a==="size"?Ce(f=>{const d=o?e.measuredBox[f]:e.layoutBox[f],h=_e(d);d.min=n[f].min,d.max=d.min+h}):sl(a,e.layoutBox,n)&&Ce(f=>{const d=o?e.measuredBox[f]:e.layoutBox[f],h=_e(n[f]);d.max=d.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+h)});const r=Tt();Kt(r,n,e.layoutBox);const l=Tt();o?Kt(l,t.applyTransform(i,!0),e.measuredBox):Kt(l,n,e.layoutBox);const u=!Xr(r);let c=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=ce();Ps(p,e.layoutBox,d.layoutBox);const x=ce();Ps(x,n,h.layoutBox),Qr(p,x)||(c=!0),f.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=p,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:l,layoutDelta:r,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function bp(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 wp(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function _p(t){t.clearSnapshot()}function Lo(t){t.clearMeasurements()}function Ro(t){t.isLayoutDirty=!1}function Sp(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function $o(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Tp(t){t.resolveTargetDelta()}function kp(t){t.calcProjection()}function Ap(t){t.resetSkewAndRotation()}function Cp(t){t.removeLeadSnapshot()}function Io(t,e,s){t.translate=ne(e.translate,0,s),t.scale=ne(e.scale,1,s),t.origin=e.origin,t.originPoint=e.originPoint}function Bo(t,e,s,n){t.min=ne(e.min,s.min,n),t.max=ne(e.max,s.max,n)}function Pp(t,e,s,n){Bo(t.x,e.x,s.x,n),Bo(t.y,e.y,s.y,n)}function Mp(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Dp={duration:.45,ease:[.4,0,.1,1]},Oo=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Fo=Oo("applewebkit/")&&!Oo("chrome/")?Math.round:Me;function jo(t){t.min=Fo(t.min),t.max=Fo(t.max)}function Vp(t){jo(t.x),jo(t.y)}function sl(t,e,s){return t==="position"||t==="preserve-aspect"&&!Jh(Po(e),Po(s),.2)}function Ep(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Lp=tl({attachResizeListener:(t,e)=>dp(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}),tn={current:void 0},Rp=tl({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!tn.current){const t=new Lp({});t.mount(window),t.setOptions({layoutScroll:!0}),tn.current=t}return tn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),$p={some:0,all:1};function Ip(t,e,{root:s,margin:n,amount:i="some"}={}){const a=Mr(t),o=new WeakMap,r=u=>{u.forEach(c=>{const f=o.get(c.target);if(c.isIntersecting!==!!f)if(c.isIntersecting){const d=e(c.target,c);typeof d=="function"?o.set(c.target,d):l.unobserve(c.target)}else typeof f=="function"&&(f(c),o.delete(c.target))})},l=new IntersectionObserver(r,{root:s,rootMargin:n,threshold:typeof i=="number"?i:$p[i]});return a.forEach(u=>l.observe(u)),()=>l.disconnect()}const No=(t,e)=>Math.abs(t-e);function Bp(t,e){const s=No(t.x,e.x),n=No(t.y,e.y);return Math.sqrt(s**2+n**2)}function nl({current:t}){return t?t.ownerDocument.defaultView:null}function Mn(t){if(t)return t.nodeType===3||t.nodeType===8?Mn(t.nextSibling):t}const[Op,Fp,Bx]=ts("Motion"),[jp,Ox,Fx]=ts("LayoutGroup"),Np={reducedMotion:"never",transition:void 0,nonce:void 0},[zp,jx,Nx]=ts("MotionConfig");function qp(){return zp(V(()=>Np))}const Up={motionAttribute:"data-ap"},Dn=[];function il(t){for(const e of t)e&&!Dn.includes(e)&&Dn.push(e)}function ol(t,e,s){if(Array.isArray(t))return t.reduce((n,i)=>{const a=ol(i,e,s);return a?{...n,...a}:n},{});if(typeof t=="object")return t;if(t&&e){const n=e[t];return typeof n=="function"?n(s):n}}function Hp(t,e,s){const n=ol(t,e,s);if(!n)return;const{transition:i,transitionEnd:a,...o}=n;return{...o,...a}}function Gp(t,e){var i;const s=(t.initial===void 0&&t.variants?e==null?void 0:e.initial:t.initial)===!1?["initial","animate"]:["initial"],n=t.custom??((i=t.presenceContext)==null?void 0:i.custom);return s.reduce((a,o)=>({...a,...Hp(t[o]||(e==null?void 0:e[o]),t.variants,n)}),{})}function al(t,e){const s=e==null?void 0:e.length;if(s!==t.length)return!1;for(let n=0;n<s;n++)if(e[n]!==t[n])return!1;return!0}var Kp=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 rl(t){return Kp.has(t)}const zo=new WeakMap;var Wp=class{constructor(t,e){var s;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,(s=e==null?void 0:e.children)==null||s.add(this),this.latestValues=Gp(t,this.context),this.type=rl(this.options.as)?"svg":"html"}get context(){return this._context||(this._context=new Proxy({},{get:(t,e)=>{var n;const s=this.options[e];return $s(s)||e==="initial"&&s===!1?s:(n=this.parent)==null?void 0:n.context[e]}})),this._context}updateFeatures(){if(this.visualElement)for(const t of Dn){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,s;zo.set(t,this),this.element=t,t.setAttribute(Up.motionAttribute,((e=this.options.presenceContext)==null?void 0:e.presenceId)??""),(s=this.visualElement)==null||s.mount(t),this.updateFeatures()}beforeUnmount(){this.getSnapshot(this.options,!1)}unmount(){var t,e,s;(e=(t=this.parent)==null?void 0:t.children)==null||e.delete(this),zo.delete(this.element),this.features.forEach(n=>{var i;return(i=n.unmount)==null?void 0:i.call(n)}),(s=this.visualElement)==null||s.unmount()}beforeUpdate(){this.getSnapshot(this.options,void 0)}update(){this.updateFeatures(),this.didUpdate()}tryExitComplete(){var t,e,s,n,i;this.isExiting||(t=this.options)!=null&&t.layoutId&&((s=(e=this.visualElement.projection)==null?void 0:e.currentAnimation)==null?void 0:s.state)==="running"||(i=(n=this.options.presenceContext)==null?void 0:n.onMotionExitComplete)==null||i.call(n,this.presenceContainer,this)}setActive(t,e){var s,n;t==="exit"&&e&&(this.isExiting=!0),(n=(s=this.visualElement)==null?void 0:s.animationState)==null||n.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,s,n;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:(s=this.options.motionConfig)==null?void 0:s.reducedMotion}),(n=this.visualElement.parent)==null||n.addChild(this.visualElement),this.isMounted()&&this.visualElement.mount(this.element))}getSnapshot(t,e){}didUpdate(){}},He=class{constructor(t){this.state=t}mount(){}unmount(){}update(){}};const ll=["initial","animate","exit","whileHover","whileDrag","whileFocus","whilePress"];var Yp=ll.length;function ul(t){if(!t)return;if(!t.isControllingVariants){const s=t.parent?ul(t.parent)||{}:{};return t.props.initial!==void 0&&(s.initial=t.props.initial),s}const e={};for(let s=0;s<Yp;s++){const n=ll[s],i=t.props[n];($s(i)||i===!1)&&(e[n]=i)}return e}var cl=["animate","whileInView","whileFocus","whileHover","whilePress","whileDrag","exit"],Xp=[...cl].reverse(),Qp=cl.length;function ot(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qo(){return{animate:ot(!0),whileInView:ot(),whileHover:ot(),whilePress:ot(),whileDrag:ot(),whileFocus:ot(),exit:ot()}}function Zp(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!al(e,t):!1}function Uo(t){return Array.isArray(t)}function Jp(t){return e=>Promise.all(e.map(({animation:s,options:n})=>Zf(t,s,n)))}function em(t){let e=Jp(t),s=qo(),n=!0;const i=l=>(u,c)=>{var d;const f=Pt(t,c,l==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(f){const{transition:h,transitionEnd:p,...x}=f;u={...u,...x,...p}}return u};function a(l){e=l(t)}function o(l){const{props:u}=t,c=ul(t.parent)||{},f=[],d=new Set;let h={},p=1/0;for(let g=0;g<Qp;g++){const y=Xp[g],P=s[y],_=u[y]!==void 0?u[y]:c[y],L=$s(_),D=y===l?P.isActive:null;D===!1&&(p=g);let E=_===c[y]&&_!==u[y]&&L;if(E&&n&&t.manuallyAnimateOnMount&&(E=!1),P.protectedKeys={...h},!P.isActive&&D===null||!_&&!P.prevProp||mi(_)||typeof _=="boolean")continue;const A=Zp(P.prevProp,_);let S=A||y===l&&P.isActive&&!E&&L||g>p&&L,B=!1;const R=Array.isArray(_)?_:[_];let q=R.reduce(i(y),{});D===!1&&(q={});const{prevResolvedValues:F={}}=P,te={...F,...q},C=z=>{S=!0,d.has(z)&&(B=!0,d.delete(z)),P.needsAnimating[z]=!0;const Y=t.getValue(z);Y&&(Y.liveStyle=!1)};for(const z in te){const Y=q[z],X=F[z];if(Object.hasOwnProperty.call(h,z))continue;let U=!1;Uo(Y)&&Uo(X)?U=!al(Y,X):U=Y!==X,U?Y!=null?C(z):d.add(z):Y!==void 0&&d.has(z)?C(z):P.protectedKeys[z]=!0}P.prevProp=_,P.prevResolvedValues=q,P.isActive&&(h={...h,...q}),n&&t.blockInitialAnimation&&(S=!1);const I=E&&A;S&&(!I||B)&&f.push(...R.map(z=>{const Y={type:y};if(typeof z=="string"&&n&&!I&&t.manuallyAnimateOnMount&&t.parent){const{parent:X}=t,U=Pt(X,z);if(X.enteringChildren&&U){const{delayChildren:Q}=U.transition||{};Y.delay=yr(X.enteringChildren,t,Q)}}return{animation:z,options:Y}}))}if(d.size){const g={};if(typeof u.initial!="boolean"){const y=Pt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(g.transition=y.transition)}d.forEach(y=>{const P=t.getBaseTarget(y),_=t.getValue(y);_&&(_.liveStyle=!0),g[y]=P??null}),f.push({animation:g})}let x=!!f.length;return n&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(x=!1),n=!1,x?e(f):Promise.resolve()}function r(l,u){var f;if(s[l].isActive===u)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(d=>{var h;(h=d.animationState)==null||h.setActive(l,u)}),s[l].isActive=u;const c=o(l);for(const d in s)s[d].protectedKeys={};return c}return{animateChanges:o,setActive:r,setAnimateFunction:a,getState:()=>s,reset:()=>{s=qo(),n=!0}}}function dl(t){return t.style.display==="none"||t.offsetParent===null&&window.getComputedStyle(t).position!=="fixed"}var ut,Rn,tm=(ut=class extends He{constructor(e){super(e);const s=e.visualElement;s.animationState||(s.animationState=em(s))}updateAnimationControlsSubscription(){const{animate:e}=this.state.options;mi(e)&&(this.unmountControls=e.subscribe(this.state.visualElement))}mount(){var e;dl(this.state.element)?this.state.setActive("exit",!0):(e=this.state.visualElement.animationState)==null||e.animateChanges(),this.updateAnimationControlsSubscription()}update(){var n;(n=this.state.visualElement.animationState)==null||n.animateChanges();const{animate:e}=this.state.visualElement.getProps(),{animate:s}=this.state.visualElement.prevProps||{};e!==s&&this.updateAnimationControlsSubscription()}unmount(){var e;this.state.visualElement.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}},Rn=new WeakMap,Ie(ut,Rn,ut.key="animation"),ut);function sm(t,e){return rl(t)?new Wh(e):new Nh(e)}function Ho(t){return{point:{x:t.pageX,y:t.pageY}}}var ct,$n,nm=(ct=class extends He{constructor(e){super(e)}isActive(){const{whilePress:e,onPress:s,onPressCancel:n,onPressStart:i}=this.state.options;return!!(e||s||n||i)}register(){var s;const e=this.state.element;!e||!this.isActive()||((s=this.removePress)==null||s.call(this),this.removePress=bh(e,(n,i)=>{const a=this.state.options;return this.state.setActive("whilePress",!0),a.onPressStart&&ee.postRender(()=>a.onPressStart(i,Ho(i))),(o,{success:r})=>{this.state.setActive("whilePress",!1);const l=r?"onPress":"onPressCancel",u=this.state.options[l];u&&ee.postRender(()=>u(o,Ho(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}},$n=new WeakMap,Ie(ct,$n,ct.key="press"),ct);function fl(t){return t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1}function Jt(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}function im(t){return e=>fl(e)&&t(e,Jt(e))}var dt,In,om=(dt=class extends He{constructor(e){super(e)}isActive(){const{whileHover:e,onHoverStart:s,onHoverEnd:n}=this.state.options;return!!(e||s||n)}register(){var s;const e=this.state.element;!e||!this.isActive()||((s=this.removeHover)==null||s.call(this),this.removeHover=mh(e,(n,i)=>{const a=this.state.options;return this.state.setActive("whileHover",!0),a.onHoverStart&&ee.postRender(()=>a.onHoverStart(i,Jt(i))),o=>{this.state.setActive("whileHover",!1);const r=this.state.options.onHoverEnd;r&&ee.postRender(()=>r(o,Jt(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}},In=new WeakMap,Ie(dt,In,dt.key="hover"),dt),ft,Bn,am=(ft=class extends He{constructor(e){super(e)}isActive(){const{whileInView:e,onViewportEnter:s,onViewportLeave:n}=this.state.options;return!!(e||s||n)}startObserver(){var i;const e=this.state.element;if(!e||!this.isActive())return;(i=this.removeObserver)==null||i.call(this);const{once:s,...n}=this.state.options.inViewOptions||{};this.removeObserver=Ip(e,(a,o)=>{const r=this.state.options;if(this.state.setActive("whileInView",!0),r.onViewportEnter&&ee.postRender(()=>r.onViewportEnter(o)),!s)return()=>{this.state.setActive("whileInView",!1);const l=this.state.options.onViewportLeave;l&&ee.postRender(()=>l(o))}},n)}mount(){this.startObserver()}update(){const{props:e,prevProps:s}=this.state.visualElement;["amount","margin","root"].some(n=>{var i,a;return((i=e.inViewOptions)==null?void 0:i[n])!==((a=s==null?void 0:s.inViewOptions)==null?void 0:a[n])})&&this.startObserver()}unmount(){var e;(e=this.removeObserver)==null||e.call(this),this.removeObserver=void 0}},Bn=new WeakMap,Ie(ft,Bn,ft.key="inView"),ft);function Ms(t,e,s,n={passive:!0}){return t.addEventListener(e,s,n),()=>t.removeEventListener(e,s)}var ht,On,rm=(ht=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=ss(Ms(e,"focus",()=>this.onFocus()),Ms(e,"blur",()=>this.onBlur()))}unmount(){var e;(e=this.removeFocus)==null||e.call(this),this.removeFocus=void 0}},On=new WeakMap,Ie(ht,On,ht.key="focus"),ht);function hl(t){if(t)return t.options.allowProjection!==!1?t.projection:hl(t.parent)}const pl={borderRadius:{...Fe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fe,borderTopRightRadius:Fe,borderBottomLeftRadius:Fe,borderBottomRightRadius:Fe,boxShadow:qr};function Ut(t){return typeof t=="object"&&t!==null&&"nodeType"in t}const lm=typeof window>"u";var pt,Fn,um=(pt=class extends He{constructor(e){super(e),Ur(pl),lm||this.initProjection()}initProjection(){const e=this.state.options;this.state.visualElement.projection=new Rp(this.state.visualElement.latestValues,e["data-framer-portal-id"]?void 0:hl(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:s,layout:n,drag:i=!1,dragConstraints:a=!1}=e;(o=this.projection)==null||o.setOptions({layout:n,layoutId:s,alwaysMeasureLayout:!!s||!!i||a&&Ut(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)}},Fn=new WeakMap,Ie(pt,Fn,pt.key="projection"),pt);function Wt(t,e,s,n){return Ms(t,e,im(s),n)}var Go=new Set(["auto","scroll"]),ml=class{constructor(t,e,{transformPagePoint:s,contextWindow:n,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=nn(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,d=Bp(c.offset,{x:0,y:0})>=3;if(!f&&!d)return;const{point:h}=c,{timestamp:p}=he;this.history.push({...h,timestamp:p});const{onStart:x,onMove:g}=this.handlers;f||(x&&x(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=sn(f,this.transformPagePoint),ee.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();const{onEnd:d,onSessionEnd:h,resumeAnimation:p}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=nn(c.type==="pointercancel"?this.lastMoveEventInfo:sn(f,this.transformPagePoint),this.history);this.startEvent&&d&&d(c,x),h&&h(c,x)},!fl(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=s,this.contextWindow=n||window;const o=sn(Jt(t),this.transformPagePoint),{point:r}=o,{timestamp:l}=he;this.history=[{...r,timestamp:l}];const{onSessionStart:u}=e;u&&u(t,nn(o,this.history)),this.removeListeners=ss(Wt(this.contextWindow,"pointermove",this.handlePointerMove),Wt(this.contextWindow,"pointerup",this.handlePointerUp),Wt(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 s=getComputedStyle(e);(Go.has(s.overflowX)||Go.has(s.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 s=t===window,n=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:n.x-e.x,y:n.y-e.y};i.x===0&&i.y===0||(s?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,n),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 sn(t,e){return e?{point:e(t.point)}:t}function Ko(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nn({point:t},e){return{point:t,delta:Ko(t,gl(e)),offset:Ko(t,cm(e)),velocity:dm(e,.1)}}function cm(t){return t[0]}function gl(t){return t[t.length-1]}function dm(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,n=null;const i=gl(t);for(;s>=0&&(n=t[s],!(i.timestamp-n.timestamp>De(e)));)s--;if(!n)return{x:0,y:0};const a=Pe(i.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Wo(t){return(e,s)=>{t&&ee.postRender(()=>t(e,s))}}var mt,jn,fm=(mt=class extends He{constructor(...e){super(...e),this.removePointerDownListener=Me}onPointerDown(e){this.session=new ml(e,this.createPanHandlers(),{transformPagePoint:this.state.visualElement.getTransformPagePoint(),contextWindow:nl(this.state.visualElement)})}createPanHandlers(){return{onSessionStart:Wo((e,s)=>{const{onPanSessionStart:n}=this.state.options;n&&n(e,s)}),onStart:Wo((e,s)=>{const{onPanStart:n}=this.state.options;n&&n(e,s)}),onMove:(e,s)=>{const{onPan:n}=this.state.options;n&&n(e,s)},onEnd:(e,s)=>{const{onPanEnd:n}=this.state.options;delete this.session,n&&ee.postRender(()=>n(e,s))}}}mount(){this.removePointerDownListener=Wt(this.state.element,"pointerdown",this.onPointerDown.bind(this))}update(){}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},jn=new WeakMap,Ie(mt,jn,mt.key="pan"),mt);function vl(t){let e=null;return()=>{const s=()=>{e=null};return e===null?(e=t,s):!1}}var Yo=vl("dragHorizontal"),Xo=vl("dragVertical");function hm(t){let e=!1;if(t==="y")e=Xo();else if(t==="x")e=Yo();else{const s=Yo(),n=Xo();s&&n?e=()=>{s(),n()}:(s&&s(),n&&n())}return e}function pm(t,{min:e,max:s},n){return e!==void 0&&t<e?t=n?ne(e,t,n.min):Math.max(t,e):s!==void 0&&t>s&&(t=n?ne(s,t,n.max):Math.min(t,s)),t}const Vn=.35;function mm(t,{top:e,left:s,bottom:n,right:i}){return{x:Qo(t.x,s,i),y:Qo(t.y,e,n)}}function Qo(t,e,s){return{min:e!==void 0?t.min+e:void 0,max:s!==void 0?t.max+s-(t.max-t.min):void 0}}function gm(t=Vn){return t===!1?t=0:t===!0&&(t=Vn),{x:Zo(t,"left","right"),y:Zo(t,"top","bottom")}}function Zo(t,e,s){return{min:Jo(t,e),max:Jo(t,s)}}function Jo(t,e){return typeof t=="number"?t:t[e]||0}function vm(t,e){const s={};return e.min!==void 0&&(s.min=e.min-t.min),e.max!==void 0&&(s.max=e.max-t.min),s}function ym(t,e){return{x:ea(t.x,e.x),y:ea(t.y,e.y)}}function ea(t,e){let s=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([s,n]=[n,s]),{min:s,max:n}}function xm(t,e){let s=.5;const n=_e(t),i=_e(e);return i>n?s=Xt(e.min,e.max-n,t.min):n>i&&(s=Xt(t.min,t.max-i,e.min)),Ne(0,1,s)}const bm=new WeakMap;var wm=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 s=l=>{e?this.stopAnimation():this.pauseAnimation(),e&&this.snapToCursor(Jt(l,"page").point)},n=(l,u)=>{this.stopAnimation();const{drag:c,dragPropagation:f,onDragStart:d}=this.getProps();c&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=hm(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),Ce(h=>{let p=this.getAxisMotionValue(h).get()||0;if(je.test(p)){const{projection:x}=this.visualElement;if(x&&x.layout){const g=x.layout.layoutBox[h];g&&(p=_e(g)*(parseFloat(p)/100))}}this.originPoint[h]=p}),d&&ee.postRender(()=>d(l,u)),_n(this.visualElement,"transform"),this.state.setActive("whileDrag",!0))},i=(l,u)=>{const{dragPropagation:c,dragDirectionLock:f,onDirectionLock:d,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(f&&this.currentDirection===null){this.currentDirection=_m(p),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},a=(l,u)=>this.stop(l,u),o=()=>Ce(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 ml(t,{onSessionStart:s,onStart:n,onMove:i,onSessionEnd:a,resumeAnimation:o},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:nl(this.visualElement),element:this.state.element})}stop(t,e){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:n}=e;this.startAnimation(n);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,s){const{drag:n}=this.getProps();if(!s||!vs(t,n,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(a=pm(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:e}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,n=this.constraints;t&&Ut(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=mm(s.layoutBox,t):this.constraints=!1,this.elastic=gm(e),n!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ce(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=vm(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Ut(t))return!1;const s=t,{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const i=$h(s,n.root,this.visualElement.getTransformPagePoint());let a=ym(n.layout.layoutBox,i);if(e){const o=e(Eh(a));this.hasMutatedConstraints=!!o,o&&(a=Or(o))}return a}startAnimation(t){const{drag:e,dragMomentum:s,dragElastic:n,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),r=this.constraints||{},l=Ce(u=>{if(!vs(u,e,this.currentDirection))return;let c=r&&r[u]||{};a&&(c={min:0,max:0});const f=n?200:1e6,d=n?40:1e7,h={type:"inertia",velocity:s?t[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(u,h)});return Promise.all(l).then(o)}startAxisValueAnimation(t,e){const s=this.getAxisMotionValue(t);return _n(this.visualElement,t),s.start(fi(t,s,0,e,this.visualElement,!1))}stopAnimation(){var t;(t=this.visualElement.projection)!=null&&t.isPresent&&Ce(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ce(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()}`,s=this.visualElement.getProps();return s[e]||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){Ce(e=>{const{drag:s}=this.getProps();if(!vs(e,s,this.currentDirection))return;const{projection:n}=this.visualElement,i=this.getAxisMotionValue(e);if(n&&n.layout){const{min:a,max:o}=n.layout.layoutBox[e];i.set(t[e]-ne(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:s}=this.visualElement;if(!Ut(e)||!s||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};Ce(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const r=o.get();n[a]=xm({min:r,max:r},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.state.element.style.transform=i?i({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Ce(a=>{if(!vs(a,t,null))return;const o=this.getAxisMotionValue(a),{min:r,max:l}=this.constraints[a];o.set(ne(r,l,n[a]))})}addListeners(){if(!this.state.element)return;bm.set(this.visualElement,this);const t=this.state.element,e=Wt(t,"pointerdown",r=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(r)}),s=()=>{const{dragConstraints:r}=this.getProps();Ut(r)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",s);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),ee.read(s);const a=Ms(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:r,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ce(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:s=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:a=Vn,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:s,dragPropagation:n,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function vs(t,e,s){return(e===!0||e===t)&&(s===null||s===t)}function _m(t,e=10){let s=null;return Math.abs(t.y)>e?s="y":Math.abs(t.x)>e&&(s="x"),s}var gt,Nn,Sm=(gt=class extends He{constructor(e){super(e),this.removeGroupControls=Me,this.removeListeners=Me,this.controls=new wm(e)}mount(){const{dragControls:e}=this.state.options;e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Me}unmount(){this.removeGroupControls(),this.removeListeners()}},Nn=new WeakMap,Ie(gt,Nn,gt.key="drag"),gt),Nt=!1,vt,zn,Tm=(vt=class extends He{constructor(e){super(e),this.hasMountSettled=!1,Ur(pl),e.getSnapshot=this.getSnapshot.bind(this),e.didUpdate=this.didUpdate.bind(this)}updatePrevLead(e){const s=e.getStack();s!=null&&s.prevLead&&!s.prevLead.snapshot&&(s.prevLead.willUpdate(),Nt=!0)}didUpdate(){var e,s;Nt&&(this.state.options.layout||this.state.options.layoutId||this.state.options.drag)&&(Nt=!1,(s=(e=this.state.visualElement.projection)==null?void 0:e.root)==null||s.didUpdate())}mount(){var n;const e=this.state.options,s=this.state.options.layoutGroup;if(e.layout||e.layoutId){const i=this.state.visualElement.projection;if(e.layoutId){const a=!dl(this.state.element);i.isPresent=a,a?i.promote():i.relegate(),this.updatePrevLead(i)}(n=s==null?void 0:s.group)==null||n.add(i),ws.hasEverUpdated=!0}this.didUpdate(),ee.postRender(()=>{this.hasMountSettled=!0})}unmount(){const e=this.state.options.layoutGroup,s=this.state.visualElement.projection;s&&(e!=null&&e.group&&(this.state.options.layout||this.state.options.layoutId)&&e.group.remove(s),this.state.options.layoutId&&(Nt=!0),this.didUpdate())}getSnapshot(e,s){const n=this.state.visualElement.projection,{drag:i,layoutDependency:a,layout:o,layoutId:r}=e;if(!n||!o&&!r&&!i||!this.hasMountSettled)return;Nt=!0;const l=this.state.options;(i||l.layoutDependency!==a||a===void 0||Ai(s)&&n.isPresent!==s)&&n.willUpdate(),Ai(s)&&s!==n.isPresent&&(n.isPresent=s,s?(n.promote(),this.updatePrevLead(n)):n.relegate())}},zn=new WeakMap,Ie(vt,zn,vt.key="layout"),vt);const km={renderer:sm,features:[tm,nm,om,am,rm,um,fm,Sm,Tm]},[Am,zx]=ts("LazyMotionContext"),[Cm,qx,Ux]=ts("AnimatePresenceContext");function Pm(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function yl(){return{transform:{},transformOrigin:{},style:{},vars:{}}}function Mm(){return{...yl(),attrs:{}}}function Dm(t){const e=yl();gi(e,t);const s={...e.style};for(const n in e.vars)s[n]=e.vars[n];return Object.keys(s).length===0?null:s}function Vm(t,e,s){const n=Mm();Gr(n,t,Kr(e),void 0,s);const i={};for(const a in n.attrs){const o=vi.has(a)?a:Pm(a);i[o]=n.attrs[a]}return{attrs:i,style:{...n.style,...n.vars}}}function Em(t,e){const s=Op(null),n=jp({}),i=qp(),a=Cm({}),o=Am({features:K({}),strict:!1}),r=Ll();function l(){return nd(t,{layoutGroup:n,presenceContext:a,config:i.value})}function u(){return{...r,...l()}}const c=new Wp(u(),s);Fp(c),e&&c.initVisualElement(e),be(o.features,h=>{var p;(p=h.features)!=null&&p.length&&il(h.features),h.renderer&&c.initVisualElement(h.renderer),c.updateFeatures()},{immediate:!0,flush:"pre"});function f(){var P;const h=c.type==="svg",p={...r};Object.keys(r).forEach(_=>{ye(r[_])&&(p[_]=r[_].get())});const x=((P=c.visualElement)==null?void 0:P.latestValues)||c.latestValues;let g={...t.style,...h?{}:x};for(const _ in g)ye(g[_])&&(g[_]=g[_].get());if(h){const{attrs:_,style:L}=Vm({...x,...g},c.options.as,t.style);Object.assign(p,_),g=L}t.drag&&t.dragListener!==!1&&Object.assign(g,{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`});const y=Dm(g);return y&&(p.style=y),p}const d=Rl().proxy;return Vs(()=>{const h=Mn(d.$el);c.mount(h)}),Hn(()=>c.beforeUnmount()),ma(()=>{var h;(h=Mn(d.$el))!=null&&h.isConnected||c.unmount()}),$l(()=>{c.beforeUpdate(),c.updateOptions(u())}),Il(()=>{c.update()}),{getProps:l,getAttrs:f,layoutGroup:n,state:c}}const Lm={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 Rm=new Map,$m=new Map;function Im(t){if(!Array.isArray(t))return[t];const e=[];for(const s of t)Array.isArray(s)?e.push(...s):e.push(s);return e}var Bm=["area","img","input"];function Om(t,e,s){var n,i;if(typeof t=="string"&&Bm.includes(t))return Ct(t,e);if(t==="template"){if(!s.default)return null;const a=Im(s.default()),o=a.findIndex(c=>c.type!==Bl);if(o===-1)return a;const r=a[o];(n=r.props)==null||delete n.ref;const l=r.props?xt(e,r.props):e;e.class&&((i=r.props)!=null&&i.class)&&delete r.props.class;const u=Ol(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 ta(t,e={}){const s=typeof t=="string",n=s?t:t.name||"",i=e.renderer?Rm:$m;if(s&&(i!=null&&i.has(t)))return i.get(t);const a=W({inheritAttrs:!1,props:{...Lm,as:{type:[String,Object],default:t||"div"}},name:n?`motion.${n}`:"Motion",setup(o,{slots:r}){const{getProps:l,getAttrs:u,state:c}=Em(o,e.renderer);function f(){const d=c.element;if((typeof o.as!="object"||o.asChild)&&d){const{style:h}=u();if(h)for(const[p,x]of Object.entries(h))d.style[p]=x}}return()=>{const d=l(),h=u(),p=o.asChild?"template":o.as,x={...o.forwardMotionProps?d:{},...h,onVnodeUpdated:f},g=Om(p,x,r);return g!==null?g:Ct(p,{...x},r)}}});return s&&(i==null||i.set(t,a)),a}function Fm(t){const e=t==null?void 0:t.renderer;return il((t==null?void 0:t.features)||[]),new Proxy({},{get(s,n){return n==="create"?(i,a)=>ta(i,{...a,renderer:e}):ta(n,{renderer:e})}})}const En=Fm(km);En.create("div");const yi=W({__name:"Shimmer",props:{as:{default:"p"},class:{},duration:{default:2},spread:{default:2}},setup(t){const e=t,s=Fl(),n=V(()=>{var u;const l=(u=s.default)==null?void 0:u.call(s);return!l||l.length===0?"":l.map(c=>typeof c.children=="string"?c.children:"").join("")}),i=V(()=>{var l;return(((l=n.value)==null?void 0:l.length)??0)*e.spread}),a=V(()=>Gn("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=V(()=>({"--spread":`${i.value}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"})),r=V(()=>En[e.as]||En.p);return(l,u)=>(b(),H(ga(r.value),{class:ae(a.value),style:Et(o.value),initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:Number.POSITIVE_INFINITY,duration:l.duration,ease:"linear"}},{default:T(()=>[Vt(l.$slots,"default")]),_:3},8,["class","style","transition"]))}});function xl(t){const e=V(()=>{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 f=l.result;f!=null&&f.filename&&f.content!==void 0&&a.push({id:c,messageId:o.id,type:"file",filename:f.filename,result:f})}})}return a}),s=V(()=>e.value.filter(a=>a.type==="file")),n=V(()=>e.value.filter(a=>a.type==="code")),i=V(()=>e.value.filter(a=>a.type==="source"));return{attachments:e,files:s,codes:n,sources:i}}function jm(t){const e=window.atob(t),s=new Uint8Array(e.length);for(let n=0;n<e.length;n+=1)s[n]=e.charCodeAt(n);return s}function xi(){return{downloadFile:async e=>{if(e.error)return Fs.error(e.error),!1;try{const s=e.encoding==="base64"?new Blob([jm(e.content)],{type:e.mimeType}):new Blob([e.content],{type:e.mimeType}),n=URL.createObjectURL(s),i=document.createElement("a");return i.href=n,i.download=e.filename,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n),Fs.success(`Downloaded ${e.filename}`),!0}catch(s){const n=s instanceof Error?s.message:"Failed to download export file.";return Fs.error(n),!1}}}}const Nm={class:"whitespace-pre-wrap leading-normal chat-text"},zm=W({__name:"BlockMessageText",props:{content:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean},isUserMessage:{type:Boolean}},setup(t){const e=t,s=V(()=>!!(e.isBlockStreaming&&e.isStreaming)),n=Kn(Yt(e,"content"),s);return(i,a)=>(b(),k("p",Nm,M(m(n)),1))}});class bi{constructor(e){We(this,"options");We(this,"tokensStable",[]);We(this,"tokensUnstable",[]);We(this,"lastUnstableCodeChunk","");We(this,"lastStableGrammarState");this.options=e}async enqueue(e){const s=(this.lastUnstableCodeChunk+e).split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./C2kyA9ZS.js","./BfSmOVMj.js","./entry.DEE2Ngsu.css","./u7qmw6wa.js","./BXp87mMj.js"])))=>i.map(i=>d[i]);
2
+ var Tl=Object.defineProperty;var kl=t=>{throw TypeError(t)};var Al=(t,e,s)=>e in t?Tl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var We=(t,e,s)=>Al(t,typeof e!="symbol"?e+"":e,s);var Ie=(t,e,s)=>e.has(t)?kl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s);import{dk as Cl,d as W,ar as la,as as ua,aa as Ds,bI as ca,c as V,k as H,o as b,w as T,D as Vt,l as G,g as m,bJ as da,p as xt,bj as qn,ak as Un,cV as Pl,aj as fa,f as v,cX as Ml,bH as Dl,r as K,aw as ki,bK as ln,bL as Vl,ax as El,aS as ha,aT as pa,fe as Ai,dt as Ll,au as be,aR as Rl,av as Vs,aQ as Hn,aL as ma,ff as $l,fg as Il,az as Ct,fh as Bl,dq as Ol,dl as Fl,j as Gn,aZ as Et,n as ae,q as ga,K as Fs,fi as Kn,aB as Yt,e as k,t as M,aK as jl,aC as Nl,s as Se,ao as ke,cg as va,m as w,aY as Es,a_ as Ls,a0 as ve,A as de,a$ as Rs,F as re,z as N,eq as ya,bM as zl,ae as ql,bl as Te,e$ as es,bm as js,de as xa,bD as Ul,bE as Hl,bF as ds,aq as Gl,a1 as Kl,W as Wl,X as Yl,Y as Xl,Z as Ql,$ as Zl,db as Jl,eC as eu,ay as Be,bp as tu,dy as su,dz as nu,ab as Ci,ac as Pi,dL as iu,dM as ou,dO as au,G as ba,fj as wa,ee as ru,ba as lu,a3 as uu,fk as cu,fl as du,ef as fu,I as hu,f3 as pu,ch as mu,bn as gu,fm as vu,i as Mi,fn as yu}from"./BfSmOVMj.js";import{a as xu,b as bu,_ as wu}from"./BNkZeak0.js";import{g as _u,c as Su,a as Tu,b as ku,d as Au}from"./C2kyA9ZS.js";import{u as Wn,_ as Cu}from"./BCFLQ_rL.js";import{_ as Pu}from"./CRX1CszZ.js";import{_ as Mu}from"./C20WaARR.js";import{C as Du}from"./u7qmw6wa.js";import"./DNgNuAci.js";import{_ as Yn}from"./DUqYnCG7.js";import{b as Vu,a as Eu,E as Lu,c as Ru,d as $u,_ as Iu}from"./BIHJR--x.js";import{D as _a,b as un,F as qe,G as Bu,H as Ou,I as Fu,P as me,J as Di,K as Vi,L as Sa,M as ju,N as Ei,O as Li,Q as Ns,l as fs,f as Ta,R as Nu,_ as Lt,T as ka,U as Xe,V as zu,W as Aa,Z as qu,X as hs,Y as zs,$ as Ri,a0 as Uu,a1 as Hu,a2 as Gu,a3 as Ku,a4 as Wu,a5 as Yu,a6 as Xu,a7 as Qu,a8 as $i,a9 as Ca,aa as Zu,ab as Ju,ac as ec,ad as Pa,ae as tc,af as sc,ag as nc,ah as ic,ai as oc,aj as ac,ak as rc,al as Ma,am as lc,v as Da,an as uc,w as cc,y as dc,x as fc,z as hc,A as pc,B as mc,E as gc}from"./l12ZvGEh.js";import{u as vc,l as yc}from"./doR1dsEF.js";import"./CS5akSNT.js";const xc="radio.select";function bc(t,e,s){Cl(xc,s,{originalEvent:t,value:e})}var wc=W({__name:"Radio",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:checked","select"],setup(t,{emit:e}){const s=t,n=e,i=la(s,"checked",n,{passive:s.checked===void 0}),{value:a}=ua(s),{forwardRef:o,currentElement:r}=Ds(),l=ca(r),u=V(()=>{var f;return s.id&&r.value?((f=document.querySelector(`[for="${s.id}"]`))==null?void 0:f.innerText)??s.value:void 0});function c(f){s.disabled||bc(f,s.value,d=>{n("select",d),!(d!=null&&d.defaultPrevented)&&(i.value=!0,l.value&&d.stopPropagation())})}return(f,d)=>(b(),H(m(Un),xt(f.$attrs,{id:f.id,ref:m(o),role:"radio",type:f.as==="button"?"button":void 0,as:f.as,"aria-checked":m(i),"aria-label":u.value,"as-child":f.asChild,disabled:f.disabled?"":void 0,"data-state":m(i)?"checked":"unchecked","data-disabled":f.disabled?"":void 0,value:m(a),required:f.required,name:f.name,onClick:qn(c,["stop"])}),{default:T(()=>[Vt(f.$slots,"default",{checked:m(i)}),m(l)&&f.name?(b(),H(m(da),{key:0,type:"radio",tabindex:"-1",value:m(a),checked:!!m(i),name:f.name,disabled:f.disabled,required:f.required},null,8,["value","checked","name","disabled","required"])):G("v-if",!0)]),_:3},16,["id","type","as","aria-checked","aria-label","as-child","disabled","data-state","data-disabled","value","required","name"]))}}),_c=wc;const[Sc,Tc]=fa("RadioGroupRoot");var kc=W({__name:"RadioGroupRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,{forwardRef:i,currentElement:a}=Ds(),o=la(s,"modelValue",n,{defaultValue:s.defaultValue,passive:s.modelValue===void 0}),{disabled:r,loop:l,orientation:u,name:c,required:f,dir:d}=ua(s),h=Pl(d),p=ca(a);return Tc({modelValue:o,changeModelValue:x=>{o.value=x},disabled:r,loop:l,orientation:u,name:c==null?void 0:c.value,required:f}),(x,g)=>(b(),H(m(Ml),{"as-child":"",orientation:m(u),dir:m(h),loop:m(l)},{default:T(()=>[v(m(Un),{ref:m(i),role:"radiogroup","data-disabled":m(r)?"":void 0,"as-child":x.asChild,as:x.as,"aria-orientation":m(u),"aria-required":m(f),dir:m(h)},{default:T(()=>[Vt(x.$slots,"default",{modelValue:m(o)}),m(p)&&m(c)?(b(),H(m(da),{key:0,required:m(f),disabled:m(r),value:m(o),name:m(c)},null,8,["required","disabled","value","name"])):G("v-if",!0)]),_:3},8,["data-disabled","as-child","as","aria-orientation","aria-required","dir"])]),_:3},8,["orientation","dir","loop"]))}}),Ac=kc;const[Cc,Pc]=fa("RadioGroupItem");var Mc=W({inheritAttrs:!1,__name:"RadioGroupItem",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["select"],setup(t,{emit:e}){const s=t,n=e,{forwardRef:i,currentElement:a}=Ds(),o=Sc(),r=V(()=>o.disabled.value||s.disabled),l=V(()=>o.required.value||s.required),u=V(()=>{var h;return Dl((h=o.modelValue)==null?void 0:h.value,s.value)});Pc({disabled:r,checked:u});const c=K(!1),f=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];ki("keydown",h=>{f.includes(h.key)&&(c.value=!0)}),ki("keyup",()=>{c.value=!1});function d(){setTimeout(()=>{var h;c.value&&((h=a.value)==null||h.click())},0)}return(h,p)=>(b(),H(m(Vl),{checked:u.value,disabled:r.value,"as-child":"",focusable:!r.value,active:u.value},{default:T(()=>[v(_c,xt({...h.$attrs,...s},{ref:m(i),checked:u.value,required:l.value,disabled:r.value,"onUpdate:checked":p[0]||(p[0]=x=>m(o).changeModelValue(h.value)),onSelect:p[1]||(p[1]=x=>n("select",x)),onKeydown:p[2]||(p[2]=ln(qn(()=>{},["prevent"]),["enter"])),onFocus:d}),{default:T(()=>[Vt(h.$slots,"default",{checked:u.value,required:l.value,disabled:r.value})]),_:3},16,["checked","required","disabled"])]),_:3},8,["checked","disabled","focusable","active"]))}}),Dc=Mc,Vc=W({__name:"RadioGroupIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(t){const{forwardRef:e}=Ds(),s=Cc();return(n,i)=>(b(),H(m(El),{present:n.forceMount||m(s).checked.value},{default:T(()=>[v(m(Un),xt({ref:m(e),"data-state":m(s).checked.value?"checked":"unchecked","data-disabled":m(s).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},n.$attrs),{default:T(()=>[Vt(n.$slots,"default")]),_:3},16,["data-state","data-disabled","as-child","as"])]),_:3},8,["present"]))}}),Ec=Vc,Ii=Math.PI*2,ps=Math.PI/180;function Va(t,e){return Bu(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Ea(t,e){var s=Va(t,e),n=t.get("center"),i=t.get("radius");un(i)||(i=[0,i]);var a=qe(s.width,e.getWidth()),o=qe(s.height,e.getHeight()),r=Math.min(a,o),l=qe(i[0],r/2),u=qe(i[1],r/2),c,f,d=t.coordinateSystem;if(d){var h=d.dataToPoint(n);c=h[0]||0,f=h[1]||0}else un(n)||(n=[n,n]),c=qe(n[0],a)+s.x,f=qe(n[1],o)+s.y;return{cx:c,cy:f,r0:l,r:u}}function Lc(t,e,s){e.eachSeriesByType(t,function(n){var i=n.getData(),a=i.mapDimension("value"),o=Va(n,s),r=Ea(n,s),l=r.cx,u=r.cy,c=r.r,f=r.r0,d=-n.get("startAngle")*ps,h=n.get("endAngle"),p=n.get("padAngle")*ps;h=h==="auto"?d-Ii:-h*ps;var x=n.get("minAngle")*ps,g=x+p,y=0;i.each(a,function(Y){!isNaN(Y)&&y++});var P=i.getSum(a),_=Math.PI/(P||y)*2,L=n.get("clockwise"),D=n.get("roseType"),E=n.get("stillShowZeroSum"),A=i.getDataExtent(a);A[0]=0;var S=L?1:-1,B=[d,h],R=S*p/2;Ou(B,!L),d=B[0],h=B[1];var q=La(n);q.startAngle=d,q.endAngle=h,q.clockwise=L;var F=Math.abs(h-d),te=F,C=0,I=d;if(i.setLayout({viewRect:o,r:c}),i.each(a,function(Y,X){var U;if(isNaN(Y)){i.setItemLayout(X,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:L,cx:l,cy:u,r0:f,r:D?NaN:c});return}D!=="area"?U=P===0&&E?_:Y*_:U=F/y,U<g?(U=g,te-=g):C+=Y;var Q=I+S*U,Z=0,J=0;p>U?(Z=I+S*U/2,J=Z):(Z=I+R,J=Q-R),i.setItemLayout(X,{angle:U,startAngle:Z,endAngle:J,clockwise:L,cx:l,cy:u,r0:f,r:D?Fu(Y,A,[f,c]):c}),I=Q}),te<Ii&&y)if(te<=.001){var z=F/y;i.each(a,function(Y,X){if(!isNaN(Y)){var U=i.getItemLayout(X);U.angle=z;var Q=0,Z=0;z<p?(Q=d+S*(X+1/2)*z,Z=Q):(Q=d+S*X*z+R,Z=d+S*(X+1)*z-R),U.startAngle=Q,U.endAngle=Z}})}else _=te/C,I=d,i.each(a,function(Y,X){if(!isNaN(Y)){var U=i.getItemLayout(X),Q=U.angle===g?g:Y*_,Z=0,J=0;Q<p?(Z=I+S*Q/2,J=Z):(Z=I+R,J=I+S*Q-R),U.startAngle=Z,U.endAngle=J,I+=S*Q}})})}var La=_a();function Rc(t){return{seriesType:t,reset:function(e,s){var n=s.findComponents({mainType:"legend"});if(!(!n||!n.length)){var i=e.getData();i.filterSelf(function(a){for(var o=i.getName(a),r=0;r<n.length;r++)if(!n[r].isSelected(o))return!1;return!0})}}}}function Ra(t,e,s,n,i,a,o,r){var l=i-t,u=a-e,c=s-t,f=n-e,d=Math.sqrt(c*c+f*f);c/=d,f/=d;var h=l*c+u*f,p=h/d;p*=d;var x=o[0]=t+p*c,g=o[1]=e+p*f;return Math.sqrt((x-i)*(x-i)+(g-a)*(g-a))}var Qe=new me,ie=new me,pe=new me,Ze=new me,Oe=new me,_s=[],xe=new me;function $c(t,e){if(e<=180&&e>0){e=e/180*Math.PI,Qe.fromArray(t[0]),ie.fromArray(t[1]),pe.fromArray(t[2]),me.sub(Ze,Qe,ie),me.sub(Oe,pe,ie);var s=Ze.len(),n=Oe.len();if(!(s<.001||n<.001)){Ze.scale(1/s),Oe.scale(1/n);var i=Ze.dot(Oe),a=Math.cos(e);if(a<i){var o=Ra(ie.x,ie.y,pe.x,pe.y,Qe.x,Qe.y,_s);xe.fromArray(_s),xe.scaleAndAdd(Oe,o/Math.tan(Math.PI-e));var r=pe.x!==ie.x?(xe.x-ie.x)/(pe.x-ie.x):(xe.y-ie.y)/(pe.y-ie.y);if(isNaN(r))return;r<0?me.copy(xe,ie):r>1&&me.copy(xe,pe),xe.toArray(t[1])}}}}function Ic(t,e,s){if(s<=180&&s>0){s=s/180*Math.PI,Qe.fromArray(t[0]),ie.fromArray(t[1]),pe.fromArray(t[2]),me.sub(Ze,ie,Qe),me.sub(Oe,pe,ie);var n=Ze.len(),i=Oe.len();if(!(n<.001||i<.001)){Ze.scale(1/n),Oe.scale(1/i);var a=Ze.dot(e),o=Math.cos(s);if(a<o){var r=Ra(ie.x,ie.y,pe.x,pe.y,Qe.x,Qe.y,_s);xe.fromArray(_s);var l=Math.PI/2,u=Math.acos(Oe.dot(e)),c=l+u-s;if(c>=l)me.copy(xe,pe);else{xe.scaleAndAdd(Oe,r/Math.tan(Math.PI/2-c));var f=pe.x!==ie.x?(xe.x-ie.x)/(pe.x-ie.x):(xe.y-ie.y)/(pe.y-ie.y);if(isNaN(f))return;f<0?me.copy(xe,ie):f>1&&me.copy(xe,pe)}xe.toArray(t[1])}}}}function qs(t,e,s,n){var i=s==="normal",a=i?t:t.ensureState(s);a.ignore=e;var o=n.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var r=n.getModel("lineStyle").getLineStyle();i?t.useStyle(r):a.style=r}function Bc(t,e){var s=e.smooth,n=e.points;if(n)if(t.moveTo(n[0][0],n[0][1]),s>0&&n.length>=3){var i=Li(n[0],n[1]),a=Li(n[1],n[2]);if(!i||!a){t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]);return}var o=Math.min(i,a)*s,r=Ns([],n[1],n[0],o/i),l=Ns([],n[1],n[2],o/a),u=Ns([],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],n[2][0],n[2][1])}else for(var c=1;c<n.length;c++)t.lineTo(n[c][0],n[c][1])}function Oc(t,e,s){var n=t.getTextGuideLine(),i=t.getTextContent();if(!i){n&&t.removeTextGuideLine();return}for(var a=e.normal,o=a.get("show"),r=i.ignore,l=0;l<Di.length;l++){var u=Di[l],c=e[u],f=u==="normal";if(c){var d=c.get("show"),h=f?r:Vi(i.states[u]&&i.states[u].ignore,r);if(h||!Vi(d,o)){var p=f?n:n&&n.states[u];p&&(p.ignore=!0),n&&qs(n,!0,u,c);continue}n||(n=new Sa,t.setTextGuideLine(n),!f&&(r||!o)&&qs(n,!0,"normal",e.normal),t.stateProxy&&(n.stateProxy=t.stateProxy)),qs(n,!1,u,c)}}if(n){ju(n.style,s),n.style.fill=null;var x=a.get("showAbove"),g=t.textGuideLineConfig=t.textGuideLineConfig||{};g.showAbove=x||!1,n.buildPath=Bc}}function Fc(t,e){e=e||"labelLine";for(var s={normal:t.getModel(e)},n=0;n<Ei.length;n++){var i=Ei[n];s[i]=t.getModel([i,e])}return s}var jc=Math.PI/180;function Bi(t,e,s,n,i,a,o,r,l,u){if(t.length<2)return;function c(x){for(var g=x.rB,y=g*g,P=0;P<x.list.length;P++){var _=x.list[P],L=Math.abs(_.label.y-s),D=n+_.len,E=D*D,A=Math.sqrt(Math.abs((1-L*L/y)*E)),S=e+(A+_.len2)*i,B=S-_.label.x,R=_.targetTextWidth-B*i;$a(_,R,!0),_.label.x=S}}function f(x){for(var g={list:[],maxY:0},y={list:[],maxY:0},P=0;P<x.length;P++)if(x[P].labelAlignTo==="none"){var _=x[P],L=_.label.y>s?y:g,D=Math.abs(_.label.y-s);if(D>=L.maxY){var E=_.label.x-e-_.len2*i,A=n+_.len,S=Math.abs(E)<A?Math.sqrt(D*D/(1-E*E/A/A)):A;L.rB=S,L.maxY=D}L.list.push(_)}c(g),c(y)}for(var d=t.length,h=0;h<d;h++)if(t[h].position==="outer"&&t[h].labelAlignTo==="labelLine"){var p=t[h].label.x-u;t[h].linePoints[1][0]+=p,t[h].label.x=u}Nu(t,l,l+o)&&f(t)}function Nc(t,e,s,n,i,a,o,r){for(var l=[],u=[],c=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0;d<t.length;d++){var h=t[d].label;Us(t[d])||(h.x<e?(c=Math.min(c,h.x),l.push(t[d])):(f=Math.max(f,h.x),u.push(t[d])))}for(var d=0;d<t.length;d++){var p=t[d];if(!Us(p)&&p.linePoints){if(p.labelStyleWidth!=null)continue;var h=p.label,x=p.linePoints,g=void 0;p.labelAlignTo==="edge"?h.x<e?g=x[2][0]-p.labelDistance-o-p.edgeDistance:g=o+i-p.edgeDistance-x[2][0]-p.labelDistance:p.labelAlignTo==="labelLine"?h.x<e?g=c-o-p.bleedMargin:g=o+i-f-p.bleedMargin:h.x<e?g=h.x-o-p.bleedMargin:g=o+i-h.x-p.bleedMargin,p.targetTextWidth=g,$a(p,g)}}Bi(u,e,s,n,1,i,a,o,r,f),Bi(l,e,s,n,-1,i,a,o,r,c);for(var d=0;d<t.length;d++){var p=t[d];if(!Us(p)&&p.linePoints){var h=p.label,x=p.linePoints,y=p.labelAlignTo==="edge",P=h.style.padding,_=P?P[1]+P[3]:0,L=h.style.backgroundColor?0:_,D=p.rect.width+L,E=x[1][0]-x[2][0];y?h.x<e?x[2][0]=o+p.edgeDistance+D+p.labelDistance:x[2][0]=o+i-p.edgeDistance-D-p.labelDistance:(h.x<e?x[2][0]=h.x+p.labelDistance:x[2][0]=h.x-p.labelDistance,x[1][0]=x[2][0]+E),x[1][1]=x[2][1]=h.y}}}function $a(t,e,s){if(s===void 0&&(s=!1),t.labelStyleWidth==null){var n=t.label,i=n.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||s){var f=a.height;if(u&&u.match("break")){n.setStyle("backgroundColor",null),n.setStyle("width",e-l);var d=n.getBoundingRect();n.setStyle("width",Math.ceil(d.width)),n.setStyle("backgroundColor",o)}else{var h=e-l,p=e<c?h:s?h>t.unconstrainedWidth?null:h:null;n.setStyle("width",p)}var x=n.getBoundingRect();a.width=x.width;var g=(n.style.margin||0)+2.1;a.height=x.height+g,a.y-=(a.height-f)/2}}}function Us(t){return t.position==="center"}function zc(t){var e=t.getData(),s=[],n,i,a=!1,o=(t.get("minShowLabelAngle")||0)*jc,r=e.getLayout("viewRect"),l=e.getLayout("r"),u=r.width,c=r.x,f=r.y,d=r.height;function h(E){E.ignore=!0}function p(E){if(!E.ignore)return!0;for(var A in E.states)if(E.states[A].ignore===!1)return!0;return!1}e.each(function(E){var A=e.getItemGraphicEl(E),S=A.shape,B=A.getTextContent(),R=A.getTextGuideLine(),q=e.getItemModel(E),F=q.getModel("label"),te=F.get("position")||q.get(["emphasis","label","position"]),C=F.get("distanceToLabelLine"),I=F.get("alignTo"),z=qe(F.get("edgeDistance"),u),Y=F.get("bleedMargin"),X=q.getModel("labelLine"),U=X.get("length");U=qe(U,u);var Q=X.get("length2");if(Q=qe(Q,u),Math.abs(S.endAngle-S.startAngle)<o){fs(B.states,h),B.ignore=!0,R&&(fs(R.states,h),R.ignore=!0);return}if(p(B)){var Z=(S.startAngle+S.endAngle)/2,J=Math.cos(Z),ge=Math.sin(Z),ue,Re,ze,bt;n=S.cx,i=S.cy;var $e=te==="inside"||te==="inner";if(te==="center")ue=S.cx,Re=S.cy,bt="center";else{var Bt=($e?(S.r+S.r0)/2*J:S.r*J)+n,Ve=($e?(S.r+S.r0)/2*ge:S.r*ge)+i;if(ue=Bt+J*3,Re=Ve+ge*3,!$e){var wt=Bt+J*(U+l-S.r),_t=Ve+ge*(U+l-S.r),os=wt+(J<0?-1:1)*Q,as=_t;I==="edge"?ue=J<0?c+z:c+u-z:ue=os+(J<0?-C:C),Re=as,ze=[[Bt,Ve],[wt,_t],[os,as]]}bt=$e?"center":I==="edge"?J>0?"right":"left":J>0?"left":"right"}var tt=Math.PI,Ge=0,st=F.get("rotate");if(Ta(st))Ge=st*(tt/180);else if(te==="center")Ge=0;else if(st==="radial"||st===!0){var Bs=J<0?-Z+tt:-Z;Ge=Bs}else if(st==="tangential"&&te!=="outside"&&te!=="outer"){var Ke=Math.atan2(J,ge);Ke<0&&(Ke=tt*2+Ke);var Os=ge>0;Os&&(Ke=tt+Ke),Ge=Ke-tt}if(a=!!Ge,B.x=ue,B.y=Re,B.rotation=Ge,B.setStyle({verticalAlign:"middle"}),$e){B.setStyle({align:bt});var Ot=B.states.select;Ot&&(Ot.x+=B.x,Ot.y+=B.y)}else{var nt=B.getBoundingRect().clone();nt.applyTransform(B.getComputedTransform());var rs=(B.style.margin||0)+2.1;nt.y-=rs/2,nt.height+=rs,s.push({label:B,labelLine:R,position:te,len:U,len2:Q,minTurnAngle:X.get("minTurnAngle"),maxSurfaceAngle:X.get("maxSurfaceAngle"),surfaceNormal:new me(J,ge),linePoints:ze,textAlign:bt,labelDistance:C,labelAlignTo:I,edgeDistance:z,bleedMargin:Y,rect:nt,unconstrainedWidth:nt.width,labelStyleWidth:B.style.width})}A.setTextConfig({inside:$e})}}),!a&&t.get("avoidLabelOverlap")&&Nc(s,n,i,l,u,d,c,f);for(var x=0;x<s.length;x++){var g=s[x],y=g.label,P=g.labelLine,_=isNaN(y.x)||isNaN(y.y);if(y){y.setStyle({align:g.textAlign}),_&&(fs(y.states,h),y.ignore=!0);var L=y.states.select;L&&(L.x+=y.x,L.y+=y.y)}if(P){var D=g.linePoints;_||!D?(fs(P.states,h),P.ignore=!0):($c(D,g.minTurnAngle),Ic(D,g.surfaceNormal,g.maxSurfaceAngle),P.setShape({points:D}),y.__hostTarget.textGuideLineConfig={anchor:new me(D[0][0],D[0][1])})}}}var qc=function(t){Lt(e,t);function e(s,n,i){var a=t.call(this)||this;a.z2=2;var o=new qu;return a.setTextContent(o),a.updateData(s,n,i,!0),a}return e.prototype.updateData=function(s,n,i,a){var o=this,r=s.hostModel,l=s.getItemModel(n),u=l.getModel("emphasis"),c=s.getItemLayout(n),f=Xe(hs(l.getModel("itemStyle"),c,!0),c);if(isNaN(f.startAngle)){o.setShape(f);return}if(a){o.setShape(f);var d=r.getShallow("animationType");r.ecModel.ssr?(zs(o,{scaleX:0,scaleY:0},r,{dataIndex:n,isFrom:!0}),o.originX=f.cx,o.originY=f.cy):d==="scale"?(o.shape.r=c.r0,zs(o,{shape:{r:c.r}},r,n)):i!=null?(o.setShape({startAngle:i,endAngle:i}),zs(o,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},r,n)):(o.shape.endAngle=c.startAngle,Ri(o,{shape:{endAngle:c.endAngle}},r,n))}else Uu(o),Ri(o,{shape:f},r,n);o.useStyle(s.getItemVisual(n,"style")),Hu(o,l);var h=(c.startAngle+c.endAngle)/2,p=r.get("selectedOffset"),x=Math.cos(h)*p,g=Math.sin(h)*p,y=l.getShallow("cursor");y&&o.attr("cursor",y),this._updateLabel(r,s,n),o.ensureState("emphasis").shape=Xe({r:c.r+(u.get("scale")&&u.get("scaleSize")||0)},hs(u.getModel("itemStyle"),c)),Xe(o.ensureState("select"),{x,y:g,shape:hs(l.getModel(["select","itemStyle"]),c)}),Xe(o.ensureState("blur"),{shape:hs(l.getModel(["blur","itemStyle"]),c)});var P=o.getTextGuideLine(),_=o.getTextContent();P&&Xe(P.ensureState("select"),{x,y:g}),Xe(_.ensureState("select"),{x,y:g}),Gu(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(s,n,i){var a=this,o=n.getItemModel(i),r=o.getModel("labelLine"),l=n.getItemVisual(i,"style"),u=l&&l.fill,c=l&&l.opacity;Ku(a,Wu(o),{labelFetcher:n.hostModel,labelDataIndex:i,inheritColor:u,defaultOpacity:c,defaultText:s.getFormattedLabel(i,"normal")||n.getName(i)});var f=a.getTextContent();a.setTextConfig({position:null,rotation:null}),f.attr({z2:10});var d=s.get(["label","position"]);if(d!=="outside"&&d!=="outer")a.removeTextGuideLine();else{var h=this.getTextGuideLine();h||(h=new Sa,this.setTextGuideLine(h)),Oc(this,Fc(o),{stroke:u,opacity:Yu(r.get(["lineStyle","opacity"]),c,1)})}},e}(ka),Uc=function(t){Lt(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.ignoreLabelLineUpdate=!0,s}return e.prototype.render=function(s,n,i,a){var o=s.getData(),r=this._data,l=this.group,u;if(!r&&o.count()>0){for(var c=o.getItemLayout(0),f=1;isNaN(c&&c.startAngle)&&f<o.count();++f)c=o.getItemLayout(f);c&&(u=c.startAngle)}if(this._emptyCircleSector&&l.remove(this._emptyCircleSector),o.count()===0&&s.get("showEmptyCircle")){var d=La(s),h=new ka({shape:Xe(Ea(s,i),d)});h.useStyle(s.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=h,l.add(h)}o.diff(r).add(function(p){var x=new qc(o,p,u);o.setItemGraphicEl(p,x),l.add(x)}).update(function(p,x){var g=r.getItemGraphicEl(x);g.updateData(o,p,u),g.off("click"),l.add(g),o.setItemGraphicEl(p,g)}).remove(function(p){var x=r.getItemGraphicEl(p);zu(x,s,p)}).execute(),zc(s),s.get("animationTypeUpdate")!=="expansion"&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(s,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var o=s[0]-a.cx,r=s[1]-a.cy,l=Math.sqrt(o*o+r*r);return l<=a.r&&l>=a.r0}},e.type="pie",e}(Aa);function Hc(t,e,s){e=un(e)&&{coordDimensions:e}||Xe({encodeDefine:t.getEncode()},e);var n=t.getSource(),i=Xu(n,e).dimensions,a=new Qu(i,t);return a.initData(n,s),a}var Gc=function(){function t(e,s){this._getDataWithEncodedVisual=e,this._getRawData=s}return t.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},t.prototype.containName=function(e){var s=this._getRawData();return s.indexOfName(e)>=0},t.prototype.indexOfName=function(e){var s=this._getDataWithEncodedVisual();return s.indexOfName(e)},t.prototype.getItemVisual=function(e,s){var n=this._getDataWithEncodedVisual();return n.getItemVisual(e,s)},t}(),Kc=_a(),Wc=function(t){Lt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(s){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new Gc($i(this.getData,this),$i(this.getRawData,this)),this._defaultLabelLine(s)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return Hc(this,{coordDimensions:["value"],encodeDefaulter:Ca(Zu,this)})},e.prototype.getDataParams=function(s){var n=this.getData(),i=Kc(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=Ju(o,n.hostModel.get("percentPrecision"))}var r=t.prototype.getDataParams.call(this,s);return r.percent=a[s]||0,r.$vars.push("percent"),r},e.prototype._defaultLabelLine=function(s){ec(s,"labelLine",["show"]);var n=s.labelLine,i=s.emphasis.labelLine;n.show=n.show&&s.label.show,i.show=i.show&&s.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}(Pa);function Yc(t){return{seriesType:t,reset:function(e,s){var n=e.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(Ta(o)&&!isNaN(o)&&o<0)})}}}function Xc(t){t.registerChartView(Uc),t.registerSeriesModel(Wc),tc("pie",t.registerAction),t.registerLayout(Ca(Lc,"pie")),t.registerProcessor(Rc("pie")),t.registerProcessor(Yc("pie"))}var Qc=function(t){Lt(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.type=e.type,s.hasSymbolVisual=!0,s}return e.prototype.getInitialData=function(s,n){return sc(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var s=this.option.progressive;return s??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var s=this.option.progressiveThreshold;return s??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(s,n,i){return i.point(n.getItemLayout(s))},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}(Pa),Ia=4,Zc=function(){function t(){}return t}(),Jc=function(t){Lt(e,t);function e(s){var n=t.call(this,s)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.getDefaultShape=function(){return new Zc},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(s,n){var i=n.points,a=n.size,o=this.symbolProxy,r=o.shape,l=s.getContext?s.getContext():s,u=l&&a[0]<Ia,c=this.softClipShape,f;if(u){this._ctx=l;return}for(this._ctx=null,f=this._off;f<i.length;){var d=i[f++],h=i[f++];isNaN(d)||isNaN(h)||c&&!c.contain(d,h)||(r.x=d-a[0]/2,r.y=h-a[1]/2,r.width=a[0],r.height=a[1],o.buildPath(s,r,!0))}this.incremental&&(this._off=f,this.notClear=!0)},e.prototype.afterBrush=function(){var s=this.shape,n=s.points,i=s.size,a=this._ctx,o=this.softClipShape,r;if(a){for(r=this._off;r<n.length;){var l=n[r++],u=n[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(s,n){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,f=a[c]-r/2,d=a[c+1]-l/2;if(s>=f&&n>=d&&s<=f+r&&n<=d+l)return u}return-1},e.prototype.contain=function(s,n){var i=this.transformCoordToLocal(s,n),a=this.getBoundingRect();if(s=i[0],n=i[1],a.contain(s,n)){var o=this.hoverDataIdx=this.findDataIndex(s,n);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var s=this._rect;if(!s){for(var n=this.shape,i=n.points,a=n.size,o=a[0],r=a[1],l=1/0,u=1/0,c=-1/0,f=-1/0,d=0;d<i.length;){var h=i[d++],p=i[d++];l=Math.min(h,l),c=Math.max(h,c),u=Math.min(p,u),f=Math.max(p,f)}s=this._rect=new ic(l-o/2,u-r/2,c-l+o,f-u+r)}return s},e}(oc),ed=function(){function t(){this.group=new nc}return t.prototype.updateData=function(e,s){this._clear();var n=this._create();n.setShape({points:e.getLayout("points")}),this._setCommon(n,e,s)},t.prototype.updateLayout=function(e){var s=e.getLayout("points");this.group.eachChild(function(n){if(n.startIndex!=null){var i=(n.endIndex-n.startIndex)*2,a=n.startIndex*4*2;s=new Float32Array(s.buffer,a,i)}n.setShape("points",s),n.reset()})},t.prototype.incrementalPrepareUpdate=function(e){this._clear()},t.prototype.incrementalUpdate=function(e,s,n){var i=this._newAdded[0],a=s.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,s,n)}},t.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},t.prototype._create=function(){var e=new Jc({cursor:"default"});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},t.prototype._setCommon=function(e,s,n){var i=s.hostModel;n=n||{};var a=s.getVisual("symbolSize");e.setShape("size",a instanceof Array?a:[a,a]),e.softClipShape=n.clipShape||null,e.symbolProxy=ac(s.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<Ia;e.useStyle(i.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var r=s.getVisual("style"),l=r&&r.fill;l&&e.setColor(l);var u=rc(e);u.seriesIndex=i.seriesIndex,e.on("mousemove",function(c){u.dataIndex=null;var f=e.hoverDataIdx;f>=0&&(u.dataIndex=f+(e.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),td=function(t){Lt(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.type=e.type,s}return e.prototype.render=function(s,n,i){var a=s.getData(),o=this._updateSymbolDraw(a,s);o.updateData(a,{clipShape:this._getClipShape(s)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(s,n,i){var a=s.getData(),o=this._updateSymbolDraw(a,s);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(s,n,i){this._symbolDraw.incrementalUpdate(s,n.getData(),{clipShape:this._getClipShape(n)}),this._finished=s.end===n.getData().count()},e.prototype.updateTransform=function(s,n,i){var a=s.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=Ma("").reset(s,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(s){this._symbolDraw&&this._symbolDraw.eachRendered(s)},e.prototype._getClipShape=function(s){if(s.get("clip",!0)){var n=s.coordinateSystem;return n&&n.getArea&&n.getArea(.1)}},e.prototype._updateSymbolDraw=function(s,n){var i=this._symbolDraw,a=n.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new ed:new lc,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(s,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Aa);function sd(t){Da(uc),t.registerSeriesModel(Qc),t.registerChartView(td),t.registerLayout(Ma("scatter"))}function ts(t,e){const s=typeof t=="string"?`${t}Context`:e,n=Symbol(s);return[o=>{const r=ha(n,o);if(r===void 0)throw new Error(`Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`);return r},o=>(pa(n,o),o),n]}function nd(t,e){const{layoutGroup:s,presenceContext:n,config:i}=e,a=s.id&&t.layoutId?`${s.id}-${t.layoutId}`:t.layoutId||void 0;return{...t,layoutId:a,transition:t.transition??i.transition,layoutGroup:s,motionConfig:i,inViewOptions:t.inViewOptions??i.inViewOptions,presenceContext:n,initial:n.initial===!1?n.initial:t.initial===!0?void 0:t.initial}}function Xn(t,e){t.indexOf(e)===-1&&t.push(e)}function Ss(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const Ne=(t,e,s)=>s>e?e:s<t?t:s;let Qn=()=>{};const Ue={},Ba=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Oa(t){return typeof t=="object"&&t!==null}const Fa=t=>/^0[^.\s]+$/u.test(t);function ja(t){let e;return()=>(e===void 0&&(e=t()),e)}const Me=t=>t,id=(t,e)=>s=>e(t(s)),ss=(...t)=>t.reduce(id),Xt=(t,e,s)=>{const n=e-t;return n===0?1:(s-t)/n};class Zn{constructor(){this.subscriptions=[]}add(e){return Xn(this.subscriptions,e),()=>Ss(this.subscriptions,e)}notify(e,s,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,s,n);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(e,s,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const De=t=>t*1e3,Pe=t=>t/1e3;function Na(t,e){return e?t*(1e3/e):0}const za=(t,e,s)=>(((1-3*s+3*e)*t+(3*s-6*e))*t+3*e)*t,od=1e-7,ad=12;function rd(t,e,s,n,i){let a,o,r=0;do o=e+(s-e)/2,a=za(o,n,i)-t,a>0?s=o:e=o;while(Math.abs(a)>od&&++r<ad);return o}function ns(t,e,s,n){if(t===e&&s===n)return Me;const i=a=>rd(a,0,1,t,s);return a=>a===0||a===1?a:za(i(a),e,n)}const qa=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ua=t=>e=>1-t(1-e),Ha=ns(.33,1.53,.69,.99),Jn=Ua(Ha),Ga=qa(Jn),Ka=t=>(t*=2)<1?.5*Jn(t):.5*(2-Math.pow(2,-10*(t-1))),ei=t=>1-Math.sin(Math.acos(t)),Wa=Ua(ei),Ya=qa(ei),ld=ns(.42,0,1,1),ud=ns(0,0,.58,1),Xa=ns(.42,0,.58,1),cd=t=>Array.isArray(t)&&typeof t[0]!="number",Qa=t=>Array.isArray(t)&&typeof t[0]=="number",dd={linear:Me,easeIn:ld,easeInOut:Xa,easeOut:ud,circIn:ei,circInOut:Ya,circOut:Wa,backIn:Jn,backInOut:Ga,backOut:Ha,anticipate:Ka},fd=t=>typeof t=="string",Oi=t=>{if(Qa(t)){Qn(t.length===4);const[e,s,n,i]=t;return ns(e,s,n,i)}else if(fd(t))return dd[t];return t},ms=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function hd(t,e){let s=new Set,n=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,f=!1,d=!1)=>{const p=d&&i?s:n;return f&&o.add(c),p.has(c)||p.add(c),c},cancel:c=>{n.delete(c),o.delete(c)},process:c=>{if(r=c,i){a=!0;return}i=!0,[s,n]=[n,s],s.forEach(l),s.clear(),i=!1,a&&(a=!1,u.process(c))}};return u}const pd=40;function Za(t,e){let s=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>s=!0,o=ms.reduce((_,L)=>(_[L]=hd(a),_),{}),{setup:r,read:l,resolveKeyframes:u,preUpdate:c,update:f,preRender:d,render:h,postRender:p}=o,x=()=>{const _=Ue.useManualTiming?i.timestamp:performance.now();s=!1,Ue.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(_-i.timestamp,pd),1)),i.timestamp=_,i.isProcessing=!0,r.process(i),l.process(i),u.process(i),c.process(i),f.process(i),d.process(i),h.process(i),p.process(i),i.isProcessing=!1,s&&e&&(n=!1,t(x))},g=()=>{s=!0,n=!0,i.isProcessing||t(x)};return{schedule:ms.reduce((_,L)=>{const D=o[L];return _[L]=(E,A=!1,S=!1)=>(s||g(),D.schedule(E,A,S)),_},{}),cancel:_=>{for(let L=0;L<ms.length;L++)o[ms[L]].cancel(_)},state:i,steps:o}}const{schedule:ee,cancel:et,state:he,steps:Hs}=Za(typeof requestAnimationFrame<"u"?requestAnimationFrame:Me,!0);let xs;function md(){xs=void 0}const we={now:()=>(xs===void 0&&we.set(he.isProcessing||Ue.useManualTiming?he.timestamp:performance.now()),xs),set:t=>{xs=t,queueMicrotask(md)}},Ja=t=>e=>typeof e=="string"&&e.startsWith(t),ti=Ja("--"),gd=Ja("var(--"),si=t=>gd(t)?vd.test(t.split("/*")[0].trim()):!1,vd=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Fi(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Rt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Qt={...Rt,transform:t=>Ne(0,1,t)},gs={...Rt,default:1},Ht=t=>Math.round(t*1e5)/1e5,ni=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function yd(t){return t==null}const xd=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ii=(t,e)=>s=>!!(typeof s=="string"&&xd.test(s)&&s.startsWith(t)||e&&!yd(s)&&Object.prototype.hasOwnProperty.call(s,e)),er=(t,e,s)=>n=>{if(typeof n!="string")return n;const[i,a,o,r]=n.match(ni);return{[t]:parseFloat(i),[e]:parseFloat(a),[s]:parseFloat(o),alpha:r!==void 0?parseFloat(r):1}},bd=t=>Ne(0,255,t),Gs={...Rt,transform:t=>Math.round(bd(t))},rt={test:ii("rgb","red"),parse:er("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+Gs.transform(t)+", "+Gs.transform(e)+", "+Gs.transform(s)+", "+Ht(Qt.transform(n))+")"};function wd(t){let e="",s="",n="",i="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,s+=s,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const cn={test:ii("#"),parse:wd,transform:rt.transform},is=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ye=is("deg"),je=is("%"),j=is("px"),_d=is("vh"),Sd=is("vw"),ji={...je,parse:t=>je.parse(t)/100,transform:t=>je.transform(t*100)},St={test:ii("hsl","hue"),parse:er("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+je.transform(Ht(e))+", "+je.transform(Ht(s))+", "+Ht(Qt.transform(n))+")"},le={test:t=>rt.test(t)||cn.test(t)||St.test(t),parse:t=>rt.test(t)?rt.parse(t):St.test(t)?St.parse(t):cn.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?rt.transform(t):St.transform(t),getAnimatableNone:t=>{const e=le.parse(t);return e.alpha=0,le.transform(e)}},Td=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kd(t){var e,s;return isNaN(t)&&typeof t=="string"&&(((e=t.match(ni))==null?void 0:e.length)||0)+(((s=t.match(Td))==null?void 0:s.length)||0)>0}const tr="number",sr="color",Ad="var",Cd="var(",Ni="${}",Pd=/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 Mt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let a=0;const r=e.replace(Pd,l=>(le.test(l)?(n.color.push(a),i.push(sr),s.push(le.parse(l))):l.startsWith(Cd)?(n.var.push(a),i.push(Ad),s.push(l)):(n.number.push(a),i.push(tr),s.push(parseFloat(l))),++a,Ni)).split(Ni);return{values:s,split:r,indexes:n,types:i}}function Md(t){return Mt(t).values}function nr({split:t,types:e}){const s=t.length;return n=>{let i="";for(let a=0;a<s;a++)if(i+=t[a],n[a]!==void 0){const o=e[a];o===tr?i+=Ht(n[a]):o===sr?i+=le.transform(n[a]):i+=n[a]}return i}}function Dd(t){return nr(Mt(t))}const Vd=t=>typeof t=="number"?0:le.test(t)?le.getAnimatableNone(t):t,Ed=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:Vd(t);function Ld(t){const e=Mt(t);return nr(e)(e.values.map((n,i)=>Ed(n,e.split[i])))}const Le={test:kd,parse:Md,createTransformer:Dd,getAnimatableNone:Ld};function Ks(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+(e-t)*6*s:s<1/2?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function Rd({hue:t,saturation:e,lightness:s,alpha:n}){t/=360,e/=100,s/=100;let i=0,a=0,o=0;if(!e)i=a=o=s;else{const r=s<.5?s*(1+e):s+e-s*e,l=2*s-r;i=Ks(l,r,t+1/3),a=Ks(l,r,t),o=Ks(l,r,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:n}}function Ts(t,e){return s=>s>0?e:t}const ne=(t,e,s)=>t+(e-t)*s,Ws=(t,e,s)=>{const n=t*t,i=s*(e*e-n)+n;return i<0?0:Math.sqrt(i)},$d=[cn,rt,St],Id=t=>$d.find(e=>e.test(t));function zi(t){const e=Id(t);if(!e)return!1;let s=e.parse(t);return e===St&&(s=Rd(s)),s}const qi=(t,e)=>{const s=zi(t),n=zi(e);if(!s||!n)return Ts(t,e);const i={...s};return a=>(i.red=Ws(s.red,n.red,a),i.green=Ws(s.green,n.green,a),i.blue=Ws(s.blue,n.blue,a),i.alpha=ne(s.alpha,n.alpha,a),rt.transform(i))},dn=new Set(["none","hidden"]);function Bd(t,e){return dn.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}function Od(t,e){return s=>ne(t,e,s)}function oi(t){return typeof t=="number"?Od:typeof t=="string"?si(t)?Ts:le.test(t)?qi:Nd:Array.isArray(t)?ir:typeof t=="object"?le.test(t)?qi:Fd:Ts}function ir(t,e){const s=[...t],n=s.length,i=t.map((a,o)=>oi(a)(a,e[o]));return a=>{for(let o=0;o<n;o++)s[o]=i[o](a);return s}}function Fd(t,e){const s={...t,...e},n={};for(const i in s)t[i]!==void 0&&e[i]!==void 0&&(n[i]=oi(t[i])(t[i],e[i]));return i=>{for(const a in n)s[a]=n[a](i);return s}}function jd(t,e){const s=[],n={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const a=e.types[i],o=t.indexes[a][n[a]],r=t.values[o]??0;s[i]=r,n[a]++}return s}const Nd=(t,e)=>{const s=Le.createTransformer(e),n=Mt(t),i=Mt(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?dn.has(t)&&!i.values.length||dn.has(e)&&!n.values.length?Bd(t,e):ss(ir(jd(n,i),i.values),s):Ts(t,e)};function or(t,e,s){return typeof t=="number"&&typeof e=="number"&&typeof s=="number"?ne(t,e,s):oi(t)(t,e)}const zd=t=>{const e=({timestamp:s})=>t(s);return{start:(s=!0)=>ee.update(e,s),stop:()=>et(e),now:()=>he.isProcessing?he.timestamp:we.now()}},ar=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let a=0;a<i;a++)n+=Math.round(t(a/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},ks=2e4;function ai(t){let e=0;const s=50;let n=t.next(e);for(;!n.done&&e<ks;)e+=s,n=t.next(e);return e>=ks?1/0:e}function qd(t,e=100,s){const n=s({...t,keyframes:[0,e]}),i=Math.min(ai(n),ks);return{type:"keyframes",ease:a=>n.next(i*a).value/e,duration:Pe(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 fn(t,e){return t*Math.sqrt(1-e*e)}const Ud=12;function Hd(t,e,s){let n=s;for(let i=1;i<Ud;i++)n=n-t(n)/e(n);return n}const Ui=.001;function Gd({duration:t=oe.duration,bounce:e=oe.bounce,velocity:s=oe.velocity,mass:n=oe.mass}){let i,a,o=1-e;o=Ne(oe.minDamping,oe.maxDamping,o),t=Ne(oe.minDuration,oe.maxDuration,Pe(t)),o<1?(i=u=>{const c=u*o,f=c*t,d=c-s,h=fn(u,o),p=Math.exp(-f);return Ui-d/h*p},a=u=>{const f=u*o*t,d=f*s+s,h=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-f),x=fn(Math.pow(u,2),o);return(-i(u)+Ui>0?-1:1)*((d-h)*p)/x}):(i=u=>{const c=Math.exp(-u*t),f=(u-s)*t+1;return-.001+c*f},a=u=>{const c=Math.exp(-u*t),f=(s-u)*(t*t);return c*f});const r=5/t,l=Hd(i,a,r);if(t=De(t),isNaN(l))return{stiffness:oe.stiffness,damping:oe.damping,duration:t};{const u=Math.pow(l,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:t}}}const Kd=["duration","bounce"],Wd=["stiffness","damping","mass"];function Hi(t,e){return e.some(s=>t[s]!==void 0)}function Yd(t){let e={velocity:oe.velocity,stiffness:oe.stiffness,damping:oe.damping,mass:oe.mass,isResolvedFromDuration:!1,...t};if(!Hi(t,Wd)&&Hi(t,Kd))if(e.velocity=0,t.visualDuration){const s=t.visualDuration,n=2*Math.PI/(s*1.2),i=n*n,a=2*Ne(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:oe.mass,stiffness:i,damping:a}}else{const s=Gd({...t,velocity:0});e={...e,...s,mass:oe.mass},e.isResolvedFromDuration=!0}return e}function As(t=oe.visualDuration,e=oe.bounce){const s=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:i}=s;const a=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],r={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:f,velocity:d,isResolvedFromDuration:h}=Yd({...s,velocity:-Pe(s.velocity||0)}),p=d||0,x=u/(2*Math.sqrt(l*c)),g=o-a,y=Pe(Math.sqrt(l/c)),P=Math.abs(g)<5;n||(n=P?oe.restSpeed.granular:oe.restSpeed.default),i||(i=P?oe.restDelta.granular:oe.restDelta.default);let _,L,D,E,A,S;if(x<1)D=fn(y,x),E=(p+x*y*g)/D,_=R=>{const q=Math.exp(-x*y*R);return o-q*(E*Math.sin(D*R)+g*Math.cos(D*R))},A=x*y*E+g*D,S=x*y*g-E*D,L=R=>Math.exp(-x*y*R)*(A*Math.sin(D*R)+S*Math.cos(D*R));else if(x===1){_=q=>o-Math.exp(-y*q)*(g+(p+y*g)*q);const R=p+y*g;L=q=>Math.exp(-y*q)*(y*R*q-p)}else{const R=y*Math.sqrt(x*x-1);_=C=>{const I=Math.exp(-x*y*C),z=Math.min(R*C,300);return o-I*((p+x*y*g)*Math.sinh(z)+R*g*Math.cosh(z))/R};const q=(p+x*y*g)/R,F=x*y*q-g*R,te=x*y*g-q*R;L=C=>{const I=Math.exp(-x*y*C),z=Math.min(R*C,300);return I*(F*Math.sinh(z)+te*Math.cosh(z))}}const B={calculatedDuration:h&&f||null,velocity:R=>De(L(R)),next:R=>{if(!h&&x<1){const F=Math.exp(-x*y*R),te=Math.sin(D*R),C=Math.cos(D*R),I=o-F*(E*te+g*C),z=De(F*(A*te+S*C));return r.done=Math.abs(z)<=n&&Math.abs(o-I)<=i,r.value=r.done?o:I,r}const q=_(R);if(h)r.done=R>=f;else{const F=De(L(R));r.done=Math.abs(F)<=n&&Math.abs(o-q)<=i}return r.value=r.done?o:q,r},toString:()=>{const R=Math.min(ai(B),ks),q=ar(F=>B.next(R*F).value,R,30);return R+"ms "+q},toTransition:()=>{}};return B}As.applyToOptions=t=>{const e=qd(t,100,As);return t.ease=e.ease,t.duration=De(e.duration),t.type="keyframes",t};const Xd=5;function rr(t,e,s){const n=Math.max(e-Xd,0);return Na(s-t(n),e-n)}function hn({keyframes:t,velocity:e=0,power:s=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:r,max:l,restDelta:u=.5,restSpeed:c}){const f=t[0],d={done:!1,value:f},h=S=>r!==void 0&&S<r||l!==void 0&&S>l,p=S=>r===void 0?l:l===void 0||Math.abs(r-S)<Math.abs(l-S)?r:l;let x=s*e;const g=f+x,y=o===void 0?g:o(g);y!==g&&(x=y-f);const P=S=>-x*Math.exp(-S/n),_=S=>y+P(S),L=S=>{const B=P(S),R=_(S);d.done=Math.abs(B)<=u,d.value=d.done?y:R};let D,E;const A=S=>{h(d.value)&&(D=S,E=As({keyframes:[d.value,p(d.value)],velocity:rr(_,S,d.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return A(0),{calculatedDuration:null,next:S=>{let B=!1;return!E&&D===void 0&&(B=!0,L(S),A(S)),D!==void 0&&S>=D?E.next(S-D):(!B&&L(S),d)}}}function Qd(t,e,s){const n=[],i=s||Ue.mix||or,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]||Me:e;r=ss(l,r)}n.push(r)}return n}function Zd(t,e,{clamp:s=!0,ease:n,mixer:i}={}){const a=t.length;if(Qn(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=Qd(e,n,i),l=r.length,u=c=>{if(o&&c<t[0])return e[0];let f=0;if(l>1)for(;f<t.length-2&&!(c<t[f+1]);f++);const d=Xt(t[f],t[f+1],c);return r[f](d)};return s?c=>u(Ne(t[0],t[a-1],c)):u}function Jd(t,e){const s=t[t.length-1];for(let n=1;n<=e;n++){const i=Xt(0,e,n);t.push(ne(s,1,i))}}function ef(t){const e=[0];return Jd(e,t.length-1),e}function tf(t,e){return t.map(s=>s*e)}function sf(t,e){return t.map(()=>e||Xa).splice(0,t.length-1)}function Gt({duration:t=300,keyframes:e,times:s,ease:n="easeInOut"}){const i=cd(n)?n.map(Oi):Oi(n),a={done:!1,value:e[0]},o=tf(s&&s.length===e.length?s:ef(e),t),r=Zd(o,e,{ease:Array.isArray(i)?i:sf(e,i)});return{calculatedDuration:t,next:l=>(a.value=r(l),a.done=l>=t,a)}}const nf=t=>t!==null;function ri(t,{repeat:e,repeatType:s="loop"},n,i=1){const a=t.filter(nf),r=i<0||e&&s!=="loop"&&e%2===1?0:a.length-1;return!r||n===void 0?a[r]:n}const of={decay:hn,inertia:hn,tween:Gt,keyframes:Gt,spring:As};function lr(t){typeof t.type=="string"&&(t.type=of[t.type])}class li{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,s){return this.finished.then(e,s)}}const af=t=>t/100;class ui extends li{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:s}=this.options;s&&s.updatedAt!==we.now()&&this.tick(we.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;lr(e);const{type:s=Gt,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=e;let{keyframes:r}=e;const l=s||Gt;l!==Gt&&typeof r[0]!="number"&&(this.mixKeyframes=ss(af,or(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=ai(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(e){const s=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(e,s=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:c,repeat:f,repeatType:d,repeatDelay:h,type:p,onUpdate:x,finalKeyframe:g}=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)),s?this.currentTime=e:this.updateTime(e);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let _=this.currentTime,L=n;if(f){const S=Math.min(this.currentTime,i)/r;let B=Math.floor(S),R=S%1;!R&&S>=1&&(R=1),R===1&&B--,B=Math.min(B,f+1),!!(B%2)&&(d==="reverse"?(R=1-R,h&&(R-=h/r)):d==="mirror"&&(L=o)),_=Ne(0,1,R)*r}const D=P?{done:!1,value:c[0]}:L.next(_);a&&!P&&(D.value=a(D.value));let{done:E}=D;!P&&l!==null&&(E=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return A&&p!==hn&&(D.value=ri(c,this.options,g,this.speed)),x&&x(D.value),A&&this.finish(),D}then(e,s){return this.finished.then(e,s)}get duration(){return Pe(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Pe(e)}get time(){return Pe(this.currentTime)}set time(e){e=De(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 s=this.generator.next(e).value;return rr(n=>this.generator.next(n).value,e,s)}get speed(){return this.playbackSpeed}set speed(e){const s=this.playbackSpeed!==e;s&&this.driver&&this.updateTime(we.now()),this.playbackSpeed=e,s&&this.driver&&(this.time=Pe(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:e=zd,startTime:s}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(a=(i=this.options).onPlay)==null||a.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=s??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(we.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,s;this.notifyFinished(),this.teardown(),this.state="finished",(s=(e=this.options).onComplete)==null||s.call(e)}cancel(){var e,s;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(s=(e=this.options).onCancel)==null||s.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 s;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(s=this.driver)==null||s.stop(),e.observe(this)}}function rf(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const lt=t=>t*180/Math.PI,pn=t=>{const e=lt(Math.atan2(t[1],t[0]));return mn(e)},lf={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:pn,rotateZ:pn,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},mn=t=>(t=t%360,t<0&&(t+=360),t),Gi=pn,Ki=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Wi=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),uf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ki,scaleY:Wi,scale:t=>(Ki(t)+Wi(t))/2,rotateX:t=>mn(lt(Math.atan2(t[6],t[5]))),rotateY:t=>mn(lt(Math.atan2(-t[2],t[0]))),rotateZ:Gi,rotate:Gi,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 gn(t){return t.includes("scale")?1:0}function vn(t,e){if(!t||t==="none")return gn(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(s)n=uf,i=s;else{const r=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=lf,i=r}if(!i)return gn(e);const a=n[e],o=i[1].split(",").map(df);return typeof a=="function"?a(o):o[a]}const cf=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return vn(s,e)};function df(t){return parseFloat(t.trim())}const $t=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],It=new Set($t),Yi=t=>t===Rt||t===j,ff=new Set(["x","y","z"]),hf=$t.filter(t=>!ff.has(t));function pf(t){const e=[];return hf.forEach(s=>{const n=t.getValue(s);n!==void 0&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}const Je={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),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})=>vn(e,"x"),y:(t,{transform:e})=>vn(e,"y")};Je.translateX=Je.x;Je.translateY=Je.y;const yt=new Set;let yn=!1,xn=!1,bn=!1;function ur(){if(xn){const t=Array.from(yt).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),s=new Map;e.forEach(n=>{const i=pf(n);i.length&&(s.set(n,i),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const i=s.get(n);i&&i.forEach(([a,o])=>{var r;(r=n.getValue(a))==null||r.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}xn=!1,yn=!1,yt.forEach(t=>t.complete(bn)),yt.clear()}function cr(){yt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xn=!0)})}function mf(){bn=!0,cr(),ur(),bn=!1}class ci{constructor(e,s,n,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=s,this.name=n,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(yt.add(this),yn||(yn=!0,ee.read(cr),ee.resolveKeyframes(ur))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:s,element:n,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(n&&s){const r=n.readValue(s,o);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=o),i&&a===void 0&&i.set(e[0])}rf(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 gf=t=>t.startsWith("--");function dr(t,e,s){gf(e)?t.style.setProperty(e,s):t.style[e]=s}const vf={};function fr(t,e){const s=ja(t);return()=>vf[e]??s()}const yf=fr(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),hr=fr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qt=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Xi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qt([0,.65,.55,1]),circOut:qt([.55,0,1,.45]),backIn:qt([.31,.01,.66,-.59]),backOut:qt([.33,1.53,.69,.99])};function pr(t,e){if(t)return typeof t=="function"?hr()?ar(t,e):"ease-out":Qa(t)?qt(t):Array.isArray(t)?t.map(s=>pr(s,e)||Xi.easeOut):Xi[t]}function xf(t,e,s,{delay:n=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:r="easeOut",times:l}={},u=void 0){const c={[e]:s};l&&(c.offset=l);const f=pr(r,i);Array.isArray(f)&&(c.easing=f);const d={delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(c,d)}function mr(t){return typeof t=="function"&&"applyToOptions"in t}function bf({type:t,...e}){return mr(t)&&hr()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class gr extends li{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:s,name:n,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:r,onComplete:l}=e;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=e,Qn(typeof e.type!="string");const u=bf(e);this.animation=xf(s,n,i,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const c=ri(i,this.options,r,this.speed);this.updateMotionValue&&this.updateMotionValue(c),dr(s,n,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,s;(s=(e=this.animation).finish)==null||s.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 s,n,i;const e=(s=this.options)==null?void 0:s.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(n=this.animation).commitStyles)==null||i.call(n))}get duration(){var s,n;const e=((n=(s=this.animation.effect)==null?void 0:s.getComputedTiming)==null?void 0:n.call(s).duration)||0;return Pe(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Pe(e)}get time(){return Pe(Number(this.animation.currentTime)||0)}set time(e){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=De(e),s&&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:s,rangeEnd:n,observe:i}){var a;return this.allowFlatten&&((a=this.animation.effect)==null||a.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&yf()?(this.animation.timeline=e,s&&(this.animation.rangeStart=s),n&&(this.animation.rangeEnd=n),Me):i(this)}}const vr={anticipate:Ka,backInOut:Ga,circInOut:Ya};function wf(t){return t in vr}function _f(t){typeof t.ease=="string"&&wf(t.ease)&&(t.ease=vr[t.ease])}const Ys=10;class Sf extends gr{constructor(e){_f(e),lr(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:s,onUpdate:n,onComplete:i,element:a,...o}=this.options;if(!s)return;if(e!==void 0){s.set(e);return}const r=new ui({...o,autoplay:!1}),l=Math.max(Ys,we.now()-this.startTime),u=Ne(0,Ys,l-Ys),c=r.sample(l).value,{name:f}=this.options;a&&f&&dr(a,f,c),s.setWithVelocity(r.sample(Math.max(0,l-u)).value,c,u),r.stop()}}const Qi=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Le.test(t)||t==="0")&&!t.startsWith("url("));function Tf(t){const e=t[0];if(t.length===1)return!0;for(let s=0;s<t.length;s++)if(t[s]!==e)return!0}function kf(t,e,s,n){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const a=t[t.length-1],o=Qi(i,e),r=Qi(a,e);return!o||!r?!1:Tf(t)||(s==="spring"||mr(s))&&n}function wn(t){t.duration=0,t.type="keyframes"}const Af=new Set(["opacity","clipPath","filter","transform"]),Cf=ja(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Pf(t){var c;const{motionValue:e,name:s,repeatDelay:n,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 Cf()&&s&&Af.has(s)&&(s!=="transform"||!u)&&!l&&!n&&i!=="mirror"&&a!==0&&o!=="inertia"}const Mf=40;class Df extends li{constructor({autoplay:e=!0,delay:s=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:r,name:l,motionValue:u,element:c,...f}){var p;super(),this.stop=()=>{var x,g;this._animation&&(this._animation.stop(),(x=this.stopTimeline)==null||x.call(this)),(g=this.keyframeResolver)==null||g.cancel()},this.createdAt=we.now();const d={autoplay:e,delay:s,type:n,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:u,element:c,...f},h=(c==null?void 0:c.KeyframeResolver)||ci;this.keyframeResolver=new h(r,(x,g,y)=>this.onKeyframesResolved(x,g,d,!y),l,u,c),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,s,n,i){var g,y;this.keyframeResolver=void 0;const{name:a,type:o,velocity:r,delay:l,isHandoff:u,onUpdate:c}=n;this.resolvedAt=we.now(),kf(e,a,o,r)||((Ue.instantAnimations||!l)&&(c==null||c(ri(e,n,s))),e[0]=e[e.length-1],wn(n),n.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Mf?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...n,keyframes:e},h=!u&&Pf(d),p=(y=(g=d.motionValue)==null?void 0:g.owner)==null?void 0:y.current,x=h?new Sf({...d,element:p}):new ui(d);x.finished.then(()=>{this.notifyFinished()}).catch(Me),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,s){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),mf()),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 yr(t,e,s,n=0,i=1){const a=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,r=(o-1)*n;return typeof s=="function"?s(a,o):i===1?a*n:r-a*n}const Vf=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ef(t){const e=Vf.exec(t);if(!e)return[,];const[,s,n,i]=e;return[`--${s??n}`,i]}function xr(t,e,s=1){const[n,i]=Ef(t);if(!n)return;const a=window.getComputedStyle(e).getPropertyValue(n);if(a){const o=a.trim();return Ba(o)?parseFloat(o):o}return si(i)?xr(i,e,s+1):i}const Lf={type:"spring",stiffness:500,damping:25,restSpeed:10},Rf=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),$f={type:"keyframes",duration:.8},If={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Bf=(t,{keyframes:e})=>e.length>2?$f:It.has(t)?t.startsWith("scale")?Rf(e[1]):Lf:If,Of=t=>t!==null;function Ff(t,{repeat:e,repeatType:s="loop"},n){const i=t.filter(Of),a=e&&s!=="loop"&&e%2===1?0:i.length-1;return i[a]}function br(t,e){if(t!=null&&t.inherit&&e){const{inherit:s,...n}=t;return{...e,...n}}return t}function di(t,e){const s=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return s!==t?br(s,t):s}function jf({when:t,delay:e,delayChildren:s,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:r,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const fi=(t,e,s,n={},i,a)=>o=>{const r=di(n,t)||{},l=r.delay||n.delay||0;let{elapsed:u=0}=n;u=u-De(l);const c={keyframes:Array.isArray(s)?s:[null,s],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};jf(r)||Object.assign(c,Bf(t,c)),c.duration&&(c.duration=De(c.duration)),c.repeatDelay&&(c.repeatDelay=De(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(wn(c),c.delay===0&&(f=!0)),(Ue.instantAnimations||Ue.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(f=!0,wn(c),c.delay=0),c.allowFlatten=!r.type&&!r.ease,f&&!a&&e.get()!==void 0){const d=Ff(c.keyframes,r);if(d!==void 0){ee.update(()=>{c.onUpdate(d),c.onComplete()});return}}return r.isSync?new ui(c):new Df(c)};function Zi(t){const e=[{},{}];return t==null||t.values.forEach((s,n)=>{e[0][n]=s.get(),e[1][n]=s.getVelocity()}),e}function wr(t,e,s,n){if(typeof e=="function"){const[i,a]=Zi(n);e=e(s!==void 0?s:t.custom,i,a)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,a]=Zi(n);e=e(s!==void 0?s:t.custom,i,a)}return e}function Pt(t,e,s){const n=t.getProps();return wr(n,e,s!==void 0?s:n.custom,t)}const _r=new Set(["width","height","top","left","right","bottom",...$t]),Ji=30,Nf=t=>!isNaN(parseFloat(t));class zf{constructor(e,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var a;const i=we.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),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=s.owner}setCurrent(e){this.current=e,this.updatedAt=we.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Nf(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,s){this.events[e]||(this.events[e]=new Zn);const n=this.events[e].add(s);return e==="change"?()=>{n(),ee.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,s){this.passiveEffect=e,this.stopPassiveEffect=s}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,s,n){this.set(s),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,s=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&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=we.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ji)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Ji);return Na(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(e){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=e(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,s;(e=this.dependents)==null||e.clear(),(s=this.events.destroy)==null||s.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Dt(t,e){return new zf(t,e)}const qf=t=>Array.isArray(t);function Uf(t,e,s){t.hasValue(e)?t.getValue(e).set(s):t.addValue(e,Dt(s))}function Hf(t){return qf(t)?t[t.length-1]||0:t}function Gf(t,e){const s=Pt(t,e);let{transitionEnd:n={},transition:i={},...a}=s||{};a={...a,...n};for(const o in a){const r=Hf(a[o]);Uf(t,o,r)}}const ye=t=>!!(t&&t.getVelocity);function Kf(t){return!!(ye(t)&&t.add)}function _n(t,e){const s=t.getValue("willChange");if(Kf(s))return s.add(e);if(!s&&Ue.WillChange){const n=new Ue.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function hi(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Wf="framerAppearId",Yf="data-"+hi(Wf);function Sr(t){return t.props[Yf]}function Xf({protectedKeys:t,needsAnimating:e},s){const n=t.hasOwnProperty(s)&&e[s]!==!0;return e[s]=!1,n}function Tr(t,e,{delay:s=0,transitionOverride:n,type:i}={}){let{transition:a,transitionEnd:o,...r}=e;const l=t.getDefaultTransition();a=a?br(a,l):l;const u=a==null?void 0:a.reduceMotion;n&&(a=n);const c=[],f=i&&t.animationState&&t.animationState.getState()[i];for(const d in r){const h=t.getValue(d,t.latestValues[d]??null),p=r[d];if(p===void 0||f&&Xf(f,d))continue;const x={delay:s,...di(a||{},d)},g=h.get();if(g!==void 0&&!h.isAnimating&&!Array.isArray(p)&&p===g&&!x.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const L=Sr(t);if(L){const D=window.MotionHandoffAnimation(L,d,ee);D!==null&&(x.startTime=D,y=!0)}}_n(t,d);const P=u??t.shouldReduceMotion;h.start(fi(d,h,p,P&&_r.has(d)?{type:!1}:x,t,y));const _=h.animation;_&&c.push(_)}if(o){const d=()=>ee.update(()=>{o&&Gf(t,o)});c.length?Promise.all(c).then(d):d()}return c}function Sn(t,e,s={}){var l;const n=Pt(t,e,s.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=n||{};s.transitionOverride&&(i=s.transitionOverride);const a=n?()=>Promise.all(Tr(t,n,s)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:d}=i;return Qf(t,e,u,c,f,d,s)}:()=>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(s.delay)])}function Qf(t,e,s=0,n=0,i=0,a=1,o){const r=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),r.push(Sn(l,e,{...o,delay:s+(typeof n=="function"?0:n)+yr(t.variantChildren,l,n,i,a)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(r)}function Zf(t,e,s={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(a=>Sn(t,a,s));n=Promise.all(i)}else if(typeof e=="string")n=Sn(t,e,s);else{const i=typeof e=="function"?Pt(t,e,s.custom):e;n=Promise.all(Tr(t,i,s))}return n.then(()=>{t.notify("AnimationComplete",e)})}const Jf={test:t=>t==="auto",parse:t=>t},kr=t=>e=>e.test(t),Ar=[Rt,j,je,Ye,Sd,_d,Jf],eo=t=>Ar.find(kr(t));function eh(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Fa(t):!0}const th=new Set(["brightness","contrast","saturate","opacity"]);function sh(t){const[e,s]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=s.match(ni)||[];if(!n)return t;const i=s.replace(n,"");let a=th.has(e)?1:0;return n!==s&&(a*=100),e+"("+a+i+")"}const nh=/\b([a-z-]*)\(.*?\)/gu,Tn={...Le,getAnimatableNone:t=>{const e=t.match(nh);return e?e.map(sh).join(" "):t}},kn={...Le,getAnimatableNone:t=>{const e=Le.parse(t);return Le.createTransformer(t)(e.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},to={...Rt,transform:Math.round},ih={rotate:Ye,rotateX:Ye,rotateY:Ye,rotateZ:Ye,scale:gs,scaleX:gs,scaleY:gs,scaleZ:gs,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:Qt,originX:ji,originY:ji,originZ:j},pi={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,...ih,zIndex:to,fillOpacity:Qt,strokeOpacity:Qt,numOctaves:to},oh={...pi,color:le,backgroundColor:le,outlineColor:le,fill:le,stroke:le,borderColor:le,borderTopColor:le,borderRightColor:le,borderBottomColor:le,borderLeftColor:le,filter:Tn,WebkitFilter:Tn,mask:kn,WebkitMask:kn},Cr=t=>oh[t],ah=new Set([Tn,kn]);function Pr(t,e){let s=Cr(t);return ah.has(s)||(s=Le),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const rh=new Set(["auto","none","0"]);function lh(t,e,s){let n=0,i;for(;n<t.length&&!i;){const a=t[n];typeof a=="string"&&!rh.has(a)&&Mt(a).values.length&&(i=t[n]),n++}if(i&&s)for(const a of e)t[a]=Pr(s,i)}class uh extends ci{constructor(e,s,n,i,a){super(e,s,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:s,name:n}=this;if(!s||!s.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let f=e[c];if(typeof f=="string"&&(f=f.trim(),si(f))){const d=xr(f,s.current);d!==void 0&&(e[c]=d),c===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!_r.has(n)||e.length!==2)return;const[i,a]=e,o=eo(i),r=eo(a),l=Fi(i),u=Fi(a);if(l!==u&&Je[n]){this.needsMeasurement=!0;return}if(o!==r)if(Yi(o)&&Yi(r))for(let c=0;c<e.length;c++){const f=e[c];typeof f=="string"&&(e[c]=parseFloat(f))}else Je[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:s}=this,n=[];for(let i=0;i<e.length;i++)(e[i]===null||eh(e[i]))&&n.push(i);n.length&&lh(e,n,s)}measureInitialState(){const{element:e,unresolvedKeyframes:s,name:n}=this;if(!e||!e.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Je[n](e.measureViewportBox(),window.getComputedStyle(e.current)),s[0]=this.measuredOrigin;const i=s[s.length-1];i!==void 0&&e.getValue(n,i).jump(i,!1)}measureEndState(){var r;const{element:e,name:s,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const i=e.getValue(s);i&&i.jump(this.measuredOrigin,!1);const a=n.length-1,o=n[a];n[a]=Je[s](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 ch=new Set(["opacity","clipPath","filter","transform"]);function Mr(t,e,s){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let n=document;const i=(s==null?void 0:s[t])??n.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(n=>n!=null)}const Dr=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function dh(t){return Oa(t)&&"offsetHeight"in t}const{schedule:Vr}=Za(queueMicrotask,!1),fh={y:!1};function hh(){return fh.y}function Er(t,e){const s=Mr(t),n=new AbortController,i={passive:!0,...e,signal:n.signal};return[s,i,()=>n.abort()]}function ph(t){return!(t.pointerType==="touch"||hh())}function mh(t,e,s={}){const[n,i,a]=Er(t,s);return n.forEach(o=>{let r=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",p)},f=g=>{u&&(u(g),u=void 0),c()},d=g=>{r=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),l&&(l=!1,f(g))},h=()=>{r=!0,window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",d,i)},p=g=>{if(g.pointerType!=="touch"){if(r){l=!0;return}f(g)}},x=g=>{if(!ph(g))return;l=!1;const y=e(o,g);typeof y=="function"&&(u=y,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",x,i),o.addEventListener("pointerdown",h,i)}),a}const Lr=(t,e)=>e?t===e?!0:Lr(t,e.parentElement):!1,gh=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,vh=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function yh(t){return vh.has(t.tagName)||t.isContentEditable===!0}const bs=new WeakSet;function so(t){return e=>{e.key==="Enter"&&t(e)}}function Xs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const xh=(t,e)=>{const s=t.currentTarget;if(!s)return;const n=so(()=>{if(bs.has(s))return;Xs(s,"down");const i=so(()=>{Xs(s,"up")}),a=()=>Xs(s,"cancel");s.addEventListener("keyup",i,e),s.addEventListener("blur",a,e)});s.addEventListener("keydown",n,e),s.addEventListener("blur",()=>s.removeEventListener("keydown",n),e)};function no(t){return gh(t)&&!0}const io=new WeakSet;function bh(t,e,s={}){const[n,i,a]=Er(t,s),o=r=>{const l=r.currentTarget;if(!no(r)||io.has(r))return;bs.add(l),s.stopPropagation&&io.add(r);const u=e(l,r),c=(h,p)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),bs.has(l)&&bs.delete(l),no(h)&&typeof u=="function"&&u(h,{success:p})},f=h=>{c(h,l===window||l===document||s.useGlobalTarget||Lr(l,h.target))},d=h=>{c(h,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",d,i)};return n.forEach(r=>{(s.useGlobalTarget?window:r).addEventListener("pointerdown",o,i),dh(r)&&(r.addEventListener("focus",u=>xh(u,i)),!yh(r)&&!r.hasAttribute("tabindex")&&(r.tabIndex=0))}),a}function Rr(t){return Oa(t)&&"ownerSVGElement"in t}function wh(t){return Rr(t)&&t.tagName==="svg"}const _h=[...Ar,le,Le],Sh=t=>_h.find(kr(t)),oo=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tt=()=>({x:oo(),y:oo()}),ao=()=>({min:0,max:0}),ce=()=>({x:ao(),y:ao()}),Th=new WeakMap;function mi(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function $s(t){return typeof t=="string"||Array.isArray(t)}const kh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ah=["initial",...kh];function $r(t){return mi(t.animate)||Ah.some(e=>$s(t[e]))}function Ch(t){return!!($r(t)||t.variants)}function Ph(t,e,s){for(const n in e){const i=e[n],a=s[n];if(ye(i))t.addValue(n,i);else if(ye(a))t.addValue(n,Dt(i,{owner:t}));else if(a!==i)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(n);t.addValue(n,Dt(o!==void 0?o:i,{owner:t}))}}for(const n in s)e[n]===void 0&&t.removeValue(n);return e}const An={current:null},Ir={current:!1},Mh=typeof window<"u";function Dh(){if(Ir.current=!0,!!Mh)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>An.current=t.matches;t.addEventListener("change",e),e()}else An.current=!1}const ro=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let lo={};class Vh{scrapeMotionValuesFromProps(e,s,n){return{}}constructor({parent:e,props:s,presenceContext:n,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=ci,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 h=we.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,ee.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=r;this.latestValues=u,this.baseTarget={...u},this.initialValues=s.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=s,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=$r(s),this.isVariantNode=Ch(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...d}=this.scrapeMotionValuesFromProps(s,{},this);for(const h in d){const p=d[h];u[h]!==void 0&&ye(p)&&p.set(u[h])}}mount(e){var s,n;if(this.hasBeenMounted)for(const i in this.initialValues)(s=this.values.get(i))==null||s.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,Th.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:(Ir.current||Dh(),this.shouldReduceMotion=An.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(n=this.parent)==null||n.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(s=>s()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const s in this.events)this.events[s].clear();for(const s in this.features){const n=this.features[s];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(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,s){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),s.accelerate&&ch.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:r,times:l,ease:u,duration:c}=s.accelerate,f=new gr({element:this.current,name:e,keyframes:r,times:l,ease:u,duration:De(c)}),d=o(f);this.valueSubscriptions.set(e,()=>{d(),f.cancel()});return}const n=It.has(e);n&&this.onBindTransform&&this.onBindTransform();const i=s.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&ee.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,s)),this.valueSubscriptions.set(e,()=>{i(),a&&a(),s.owner&&s.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 lo){const s=lo[e];if(!s)continue;const{isEnabled:n,Feature:i}=s;if(!this.features[e]&&i&&n(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,s){this.latestValues[e]=s}update(e,s){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let n=0;n<ro.length;n++){const i=ro[n];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=Ph(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 s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(e),()=>s.variantChildren.delete(e)}addValue(e,s){const n=this.values.get(e);s!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,s),this.values.set(e,s),this.latestValues[e]=s.get())}removeValue(e){this.values.delete(e);const s=this.valueSubscriptions.get(e);s&&(s(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,s){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&s!==void 0&&(n=Dt(s===null?void 0:s,{owner:this}),this.addValue(e,n)),n}readValue(e,s){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n=="string"&&(Ba(n)||Fa(n))?n=parseFloat(n):!Sh(n)&&Le.test(s)&&(n=Pr(e,s)),this.setBaseTarget(e,ye(n)?n.get():n)),ye(n)?n.get():n}setBaseTarget(e,s){this.baseTarget[e]=s}getBaseTarget(e){var a;const{initial:s}=this.props;let n;if(typeof s=="string"||typeof s=="object"){const o=wr(this.props,s,(a=this.presenceContext)==null?void 0:a.custom);o&&(n=o[e])}if(s&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!ye(i)?i:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,s){return this.events[e]||(this.events[e]=new Zn),this.events[e].add(s)}notify(e,...s){this.events[e]&&this.events[e].notify(...s)}scheduleRenderMicrotask(){Vr.render(this.render)}}class Br extends Vh{constructor(){super(...arguments),this.KeyframeResolver=uh}sortInstanceNodePosition(e,s){return e.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(e,s){const n=e.style;return n?n[s]:void 0}removeValueFromRenderState(e,{vars:s,style:n}){delete s[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ye(e)&&(this.childSubscription=e.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function Or({top:t,left:e,right:s,bottom:n}){return{x:{min:e,max:s},y:{min:t,max:n}}}function Eh({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Lh(t,e){if(!e)return t;const s=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:s.y,left:s.x,bottom:n.y,right:n.x}}function Qs(t){return t===void 0||t===1}function Cn({scale:t,scaleX:e,scaleY:s}){return!Qs(t)||!Qs(e)||!Qs(s)}function at(t){return Cn(t)||Fr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Fr(t){return uo(t.x)||uo(t.y)}function uo(t){return t&&t!=="0%"}function Cs(t,e,s){const n=t-s,i=e*n;return s+i}function co(t,e,s,n,i){return i!==void 0&&(t=Cs(t,i,n)),Cs(t,s,n)+e}function Pn(t,e=0,s=1,n,i){t.min=co(t.min,e,s,n,i),t.max=co(t.max,e,s,n,i)}function jr(t,{x:e,y:s}){Pn(t.x,e.translate,e.scale,e.originPoint),Pn(t.y,s.translate,s.scale,s.originPoint)}const fo=.999999999999,ho=1.0000000000001;function Rh(t,e,s,n=!1){var r;const i=s.length;if(!i)return;e.x=e.y=1;let a,o;for(let l=0;l<i;l++){a=s[l],o=a.projectionDelta;const{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(n&&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,jr(t,o)),n&&at(a.latestValues)&&At(t,a.latestValues,(r=a.layout)==null?void 0:r.layoutBox))}e.x<ho&&e.x>fo&&(e.x=1),e.y<ho&&e.y>fo&&(e.y=1)}function kt(t,e){t.min=t.min+e,t.max=t.max+e}function po(t,e,s,n,i=.5){const a=ne(t.min,t.max,i);Pn(t,e,s,a,n)}function mo(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function At(t,e,s){const n=s??t;po(t.x,mo(e.x,n.x),e.scaleX,e.scale,e.originX),po(t.y,mo(e.y,n.y),e.scaleY,e.scale,e.originY)}function Nr(t,e){return Or(Lh(t.getBoundingClientRect(),e))}function $h(t,e,s){const n=Nr(t,s),{scroll:i}=e;return i&&(kt(n.x,i.offset.x),kt(n.y,i.offset.y)),n}const Ih={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bh=$t.length;function Oh(t,e,s){let n="",i=!0;for(let a=0;a<Bh;a++){const o=$t[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||s){const u=Dr(r,pi[o]);if(!l){i=!1;const c=Ih[o]||o;n+=`${c}(${u}) `}s&&(e[o]=u)}}return n=n.trim(),s?n=s(e,i?"":n):i&&(n="none"),n}function gi(t,e,s){const{style:n,vars:i,transformOrigin:a}=t;let o=!1,r=!1;for(const l in e){const u=e[l];if(It.has(l)){o=!0;continue}else if(ti(l)){i[l]=u;continue}else{const c=Dr(u,pi[l]);l.startsWith("origin")?(r=!0,a[l]=c):n[l]=c}}if(e.transform||(o||s?n.transform=Oh(e,t.transform,s):n.transform&&(n.transform="none")),r){const{originX:l="50%",originY:u="50%",originZ:c=0}=a;n.transformOrigin=`${l} ${u} ${c}`}}function zr(t,{style:e,vars:s},n,i){const a=t.style;let o;for(o in e)a[o]=e[o];i==null||i.applyProjectionStyles(a,n);for(o in s)a.setProperty(o,s[o])}function go(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Fe={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(j.test(t))t=parseFloat(t);else return t;const s=go(t,e.target.x),n=go(t,e.target.y);return`${s}% ${n}%`}},qr={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,i=Le.parse(t);if(i.length>5)return n;const a=Le.createTransformer(t),o=typeof i[0]!="number"?1:0,r=s.x.scale*e.x,l=s.y.scale*e.y;i[0+o]/=r,i[1+o]/=l;const u=ne(r,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}},Zt={borderRadius:{...Fe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fe,borderTopRightRadius:Fe,borderBottomLeftRadius:Fe,borderBottomRightRadius:Fe,boxShadow:qr};function Ur(t){for(const e in t)Zt[e]=t[e],ti(e)&&(Zt[e].isCSSVariable=!0)}function Fh(t,{layout:e,layoutId:s}){return It.has(t)||t.startsWith("origin")||(e||s!==void 0)&&(!!Zt[t]||t==="opacity")}function Hr(t,e,s){var o;const n=t.style,i=e==null?void 0:e.style,a={};if(!n)return a;for(const r in n)(ye(n[r])||i&&ye(i[r])||Fh(r,t)||((o=s==null?void 0:s.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(a[r]=n[r]);return a}function jh(t){return window.getComputedStyle(t)}class Nh extends Br{constructor(){super(...arguments),this.type="html",this.renderInstance=zr}readValueFromInstance(e,s){var n;if(It.has(s))return(n=this.projection)!=null&&n.isProjecting?gn(s):cf(e,s);{const i=jh(e),a=(ti(s)?i.getPropertyValue(s):i[s])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:s}){return Nr(e,s)}build(e,s,n){gi(e,s,n.transformTemplate)}scrapeMotionValuesFromProps(e,s,n){return Hr(e,s,n)}}const zh={offset:"stroke-dashoffset",array:"stroke-dasharray"},qh={offset:"strokeDashoffset",array:"strokeDasharray"};function Uh(t,e,s=1,n=0,i=!0){t.pathLength=1;const a=i?zh:qh;t[a.offset]=`${-n}`,t[a.array]=`${e} ${s}`}const Hh=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Gr(t,{attrX:e,attrY:s,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...r},l,u,c){if(gi(t,r,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:d}=t;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete f.transformBox);for(const h of Hh)f[h]!==void 0&&(d[h]=f[h],delete f[h]);e!==void 0&&(f.x=e),s!==void 0&&(f.y=s),n!==void 0&&(f.scale=n),i!==void 0&&Uh(f,i,a,o,!1)}const vi=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"]),Kr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Gh(t,e,s,n){zr(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(vi.has(i)?i:hi(i),e.attrs[i])}function Kh(t,e,s){const n=Hr(t,e,s);for(const i in t)if(ye(t[i])||ye(e[i])){const a=$t.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=t[i]}return n}class Wh extends Br{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ce}getBaseTargetFromProps(e,s){return e[s]}readValueFromInstance(e,s){if(It.has(s)){const n=Cr(s);return n&&n.default||0}return s=vi.has(s)?s:hi(s),e.getAttribute(s)}scrapeMotionValuesFromProps(e,s,n){return Kh(e,s,n)}build(e,s,n){Gr(e,s,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,s,n,i){Gh(e,s,n,i)}mount(e){this.isSVGTag=Kr(e.tagName),super.mount(e)}}function vo(t,e){t.min=e.min,t.max=e.max}function Ee(t,e){vo(t.x,e.x),vo(t.y,e.y)}function yo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Wr=1e-4,Yh=1-Wr,Xh=1+Wr,Yr=.01,Qh=0-Yr,Zh=0+Yr;function _e(t){return t.max-t.min}function Jh(t,e,s){return Math.abs(t-e)<=s}function xo(t,e,s,n=.5){t.origin=n,t.originPoint=ne(e.min,e.max,t.origin),t.scale=_e(s)/_e(e),t.translate=ne(s.min,s.max,t.origin)-t.originPoint,(t.scale>=Yh&&t.scale<=Xh||isNaN(t.scale))&&(t.scale=1),(t.translate>=Qh&&t.translate<=Zh||isNaN(t.translate))&&(t.translate=0)}function Kt(t,e,s,n){xo(t.x,e.x,s.x,n?n.originX:void 0),xo(t.y,e.y,s.y,n?n.originY:void 0)}function bo(t,e,s){t.min=s.min+e.min,t.max=t.min+_e(e)}function ep(t,e,s){bo(t.x,e.x,s.x),bo(t.y,e.y,s.y)}function wo(t,e,s){t.min=e.min-s.min,t.max=t.min+_e(e)}function Ps(t,e,s){wo(t.x,e.x,s.x),wo(t.y,e.y,s.y)}function _o(t,e,s,n,i){return t-=e,t=Cs(t,1/s,n),i!==void 0&&(t=Cs(t,1/i,n)),t}function tp(t,e=0,s=1,n=.5,i,a=t,o=t){if(je.test(e)&&(e=parseFloat(e),e=ne(o.min,o.max,e/100)-o.min),typeof e!="number")return;let r=ne(a.min,a.max,n);t===a&&(r-=e),t.min=_o(t.min,e,s,r,i),t.max=_o(t.max,e,s,r,i)}function So(t,e,[s,n,i],a,o){tp(t,e[s],e[n],e[i],e.scale,a,o)}const sp=["x","scaleX","originX"],np=["y","scaleY","originY"];function To(t,e,s,n){So(t.x,e,sp,s?s.x:void 0,n?n.x:void 0),So(t.y,e,np,s?s.y:void 0,n?n.y:void 0)}function ko(t){return t.translate===0&&t.scale===1}function Xr(t){return ko(t.x)&&ko(t.y)}function Ao(t,e){return t.min===e.min&&t.max===e.max}function ip(t,e){return Ao(t.x,e.x)&&Ao(t.y,e.y)}function Co(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Qr(t,e){return Co(t.x,e.x)&&Co(t.y,e.y)}function Po(t){return _e(t.x)/_e(t.y)}function Mo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ce(t){return[t("x"),t("y")]}function op(t,e,s){let n="";const i=t.x.translate/e.x,a=t.y.translate/e.y,o=(s==null?void 0:s.z)||0;if((i||a||o)&&(n=`translate3d(${i}px, ${a}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),s){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:d,skewX:h,skewY:p}=s;u&&(n=`perspective(${u}px) ${n}`),c&&(n+=`rotate(${c}deg) `),f&&(n+=`rotateX(${f}deg) `),d&&(n+=`rotateY(${d}deg) `),h&&(n+=`skewX(${h}deg) `),p&&(n+=`skewY(${p}deg) `)}const r=t.x.scale*e.x,l=t.y.scale*e.y;return(r!==1||l!==1)&&(n+=`scale(${r}, ${l})`),n||"none"}const Zr=["TopLeft","TopRight","BottomLeft","BottomRight"],ap=Zr.length,Do=t=>typeof t=="string"?parseFloat(t):t,Vo=t=>typeof t=="number"||j.test(t);function rp(t,e,s,n,i,a){i?(t.opacity=ne(0,s.opacity??1,lp(n)),t.opacityExit=ne(e.opacity??1,0,up(n))):a&&(t.opacity=ne(e.opacity??1,s.opacity??1,n));for(let o=0;o<ap;o++){const r=`border${Zr[o]}Radius`;let l=Eo(e,r),u=Eo(s,r);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Vo(l)===Vo(u)?(t[r]=Math.max(ne(Do(l),Do(u),n),0),(je.test(u)||je.test(l))&&(t[r]+="%")):t[r]=u}(e.rotate||s.rotate)&&(t.rotate=ne(e.rotate||0,s.rotate||0,n))}function Eo(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const lp=Jr(0,.5,Wa),up=Jr(.5,.95,Me);function Jr(t,e,s){return n=>n<t?0:n>e?1:s(Xt(t,e,n))}function cp(t,e,s){const n=ye(t)?t:Dt(t);return n.start(fi("",n,e,s)),n.animation}function dp(t,e,s,n={passive:!0}){return t.addEventListener(e,s,n),()=>t.removeEventListener(e,s)}const fp=(t,e)=>t.depth-e.depth;class hp{constructor(){this.children=[],this.isDirty=!1}add(e){Xn(this.children,e),this.isDirty=!0}remove(e){Ss(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(fp),this.isDirty=!1,this.children.forEach(e)}}function pp(t,e){const s=we.now(),n=({timestamp:i})=>{const a=i-s;a>=e&&(et(n),t(a-e))};return ee.setup(n,!0),()=>et(n)}function Zs(t){return ye(t)?t.get():t}class mp{constructor(){this.members=[]}add(e){Xn(this.members,e);for(let s=this.members.length-1;s>=0;s--){const n=this.members[s];if(n===e||n===this.lead||n===this.prevLead)continue;const i=n.instance;(!i||i.isConnected===!1)&&!n.snapshot&&(Ss(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Ss(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(e){var s;for(let n=this.members.indexOf(e)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&((s=i.instance)==null?void 0:s.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,s){var i;const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();const{layoutDependency:a}=n.options,{layoutDependency:o}=e.options;(a===void 0||a!==o)&&(e.resumeFrom=n,s&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var s,n,i,a,o;(n=(s=e.options).onExitComplete)==null||n.call(s),(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 ws={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Js=["","X","Y","Z"],gp=1e3;let vp=0;function en(t,e,s,n){const{latestValues:i}=e;i[t]&&(s[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function el(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const s=Sr(e);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(s,"transform",ee,!(i||a))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&el(n)}function tl({attachResizeListener:t,defaultParent:e,measureScroll:s,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},r=e==null?void 0:e()){this.id=vp++,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(bp),this.nodes.forEach(Tp),this.nodes.forEach(kp),this.nodes.forEach(wp)},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 hp)}addEventListener(o,r){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Zn),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=Rr(o)&&!wh(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,f=0;const d=()=>this.root.updateBlockedByResize=!1;ee.read(()=>{f=window.innerWidth}),t(o,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,c&&c(),c=pp(d,250),ws.hasAnimatedSinceResize&&(ws.hasAnimatedSinceResize=!1,this.nodes.forEach($o)))})}r&&this.root.registerSharedNode(r,this),this.options.animate!==!1&&u&&(r||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Dp,{onLayoutAnimationStart:x,onLayoutAnimationComplete:g}=u.getProps(),y=!this.targetLayout||!Qr(this.targetLayout,h),P=!f&&d;if(this.options.layoutRoot||this.resumeFrom||P||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...di(p,"layout"),onPlay:x,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(c,P)}else f||$o(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}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(Ap),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&&el(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.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(Lo);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ro);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Sp),this.nodes.forEach(yp),this.nodes.forEach(xp)):this.nodes.forEach(Ro),this.clearAllSnapshots();const r=we.now();he.delta=Ne(0,1e3/60,r-he.timestamp),he.timestamp=r,he.isProcessing=!0,Hs.update.process(he),Hs.preRender.process(he),Hs.render.process(he),he.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Vr.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(_p),this.sharedNodes.forEach(Cp)}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&&!_e(this.snapshot.measuredBox.x)&&!_e(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=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:s(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&&!Xr(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)),Vp(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(Ep))){const{scroll:c}=this.root;c&&(kt(r.x,c.offset.x),kt(r.y,c.offset.y))}return r}removeElementScroll(o){var l;const r=ce();if(Ee(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:f,options:d}=c;c!==this.root&&f&&d.layoutScroll&&(f.wasRoot&&Ee(r,o),kt(r.x,f.offset.x),kt(r.y,f.offset.y))}return r}applyTransform(o,r=!1){var u,c;const l=ce();Ee(l,o);for(let f=0;f<this.path.length;f++){const d=this.path[f];!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();Ee(r,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];if(!at(c.latestValues))continue;let f;c.instance&&(Cn(c.latestValues)&&c.updateSnapshot(),f=ce(),Ee(f,c.measurePageBox())),To(r,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,f)}return at(this.latestValues)&&To(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 h;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||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:f}=this.options;if(!this.layout||!(c||f))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(),ep(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ee(this.target,this.layout.layoutBox),jr(this.target,this.targetDelta)):Ee(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||Cn(this.parent.latestValues)||Fr(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(),Ps(this.relativeTargetOrigin,r,l),Ee(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;Ee(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;Rh(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:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(yo(this.prevProjectionDelta.x,this.projectionDelta.x),yo(this.prevProjectionDelta.y,this.projectionDelta.y)),Kt(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!Mo(this.projectionDelta.x,this.prevProjectionDelta.x)||!Mo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}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=Tt(),this.projectionDelta=Tt(),this.projectionDeltaWithTransform=Tt()}setAnimationOrigin(o,r=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=Tt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!r;const d=ce(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,x=h!==p,g=this.getStack(),y=!g||g.members.length<=1,P=!!(x&&!y&&this.options.crossfade===!0&&!this.path.some(Mp));this.animationProgress=0;let _;this.mixTargetDelta=L=>{const D=L/1e3;Io(f.x,o.x,D),Io(f.y,o.y,D),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ps(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Pp(this.relativeTarget,this.relativeTargetOrigin,d,D),_&&ip(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=ce()),Ee(_,this.relativeTarget)),x&&(this.animationValues=c,rp(c,u,this.latestValues,D,P,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},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(()=>{ws.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Dt(0)),this.motionValue.jump(0,!1),this.currentAnimation=cp(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(gp),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&&sl(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ce();const f=_e(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const d=_e(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}Ee(r,l),At(r,c),Kt(this.projectionDeltaWithTransform,this.layoutCorrected,r,c)}}registerSharedNode(o,r){this.sharedNodes.has(o)||this.sharedNodes.set(o,new mp),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&&en("z",o,u,this.animationValues);for(let c=0;c<Js.length;c++)en(`rotate${Js[c]}`,o,u,this.animationValues),en(`skew${Js[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=Zs(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=Zs(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 f=op(this.projectionDeltaWithTransform,this.treeScale,c);l&&(f=l(c,f)),o.transform=f;const{x:d,y:h}=this.projectionDelta;o.transformOrigin=`${d.origin*100}% ${h.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 Zt){if(c[p]===void 0)continue;const{correct:x,applyTo:g,isCSSVariable:y}=Zt[p],P=f==="none"?c[p]:x(c[p],u);if(g){const _=g.length;for(let L=0;L<_;L++)o[g[L]]=P}else y?this.options.visualElement.renderState.vars[p]=P:o[p]=P}this.options.layoutId&&(o.pointerEvents=u===this?Zs(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(Lo),this.root.sharedNodes.clear()}}}function yp(t){t.updateLayout()}function xp(t){var s;const e=((s=t.resumeFrom)==null?void 0:s.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:a}=t.options,o=e.source!==t.layout.source;a==="size"?Ce(f=>{const d=o?e.measuredBox[f]:e.layoutBox[f],h=_e(d);d.min=n[f].min,d.max=d.min+h}):sl(a,e.layoutBox,n)&&Ce(f=>{const d=o?e.measuredBox[f]:e.layoutBox[f],h=_e(n[f]);d.max=d.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+h)});const r=Tt();Kt(r,n,e.layoutBox);const l=Tt();o?Kt(l,t.applyTransform(i,!0),e.measuredBox):Kt(l,n,e.layoutBox);const u=!Xr(r);let c=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:d,layout:h}=f;if(d&&h){const p=ce();Ps(p,e.layoutBox,d.layoutBox);const x=ce();Ps(x,n,h.layoutBox),Qr(p,x)||(c=!0),f.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=p,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:l,layoutDelta:r,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function bp(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 wp(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function _p(t){t.clearSnapshot()}function Lo(t){t.clearMeasurements()}function Ro(t){t.isLayoutDirty=!1}function Sp(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function $o(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Tp(t){t.resolveTargetDelta()}function kp(t){t.calcProjection()}function Ap(t){t.resetSkewAndRotation()}function Cp(t){t.removeLeadSnapshot()}function Io(t,e,s){t.translate=ne(e.translate,0,s),t.scale=ne(e.scale,1,s),t.origin=e.origin,t.originPoint=e.originPoint}function Bo(t,e,s,n){t.min=ne(e.min,s.min,n),t.max=ne(e.max,s.max,n)}function Pp(t,e,s,n){Bo(t.x,e.x,s.x,n),Bo(t.y,e.y,s.y,n)}function Mp(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Dp={duration:.45,ease:[.4,0,.1,1]},Oo=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Fo=Oo("applewebkit/")&&!Oo("chrome/")?Math.round:Me;function jo(t){t.min=Fo(t.min),t.max=Fo(t.max)}function Vp(t){jo(t.x),jo(t.y)}function sl(t,e,s){return t==="position"||t==="preserve-aspect"&&!Jh(Po(e),Po(s),.2)}function Ep(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Lp=tl({attachResizeListener:(t,e)=>dp(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}),tn={current:void 0},Rp=tl({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!tn.current){const t=new Lp({});t.mount(window),t.setOptions({layoutScroll:!0}),tn.current=t}return tn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),$p={some:0,all:1};function Ip(t,e,{root:s,margin:n,amount:i="some"}={}){const a=Mr(t),o=new WeakMap,r=u=>{u.forEach(c=>{const f=o.get(c.target);if(c.isIntersecting!==!!f)if(c.isIntersecting){const d=e(c.target,c);typeof d=="function"?o.set(c.target,d):l.unobserve(c.target)}else typeof f=="function"&&(f(c),o.delete(c.target))})},l=new IntersectionObserver(r,{root:s,rootMargin:n,threshold:typeof i=="number"?i:$p[i]});return a.forEach(u=>l.observe(u)),()=>l.disconnect()}const No=(t,e)=>Math.abs(t-e);function Bp(t,e){const s=No(t.x,e.x),n=No(t.y,e.y);return Math.sqrt(s**2+n**2)}function nl({current:t}){return t?t.ownerDocument.defaultView:null}function Mn(t){if(t)return t.nodeType===3||t.nodeType===8?Mn(t.nextSibling):t}const[Op,Fp,Bx]=ts("Motion"),[jp,Ox,Fx]=ts("LayoutGroup"),Np={reducedMotion:"never",transition:void 0,nonce:void 0},[zp,jx,Nx]=ts("MotionConfig");function qp(){return zp(V(()=>Np))}const Up={motionAttribute:"data-ap"},Dn=[];function il(t){for(const e of t)e&&!Dn.includes(e)&&Dn.push(e)}function ol(t,e,s){if(Array.isArray(t))return t.reduce((n,i)=>{const a=ol(i,e,s);return a?{...n,...a}:n},{});if(typeof t=="object")return t;if(t&&e){const n=e[t];return typeof n=="function"?n(s):n}}function Hp(t,e,s){const n=ol(t,e,s);if(!n)return;const{transition:i,transitionEnd:a,...o}=n;return{...o,...a}}function Gp(t,e){var i;const s=(t.initial===void 0&&t.variants?e==null?void 0:e.initial:t.initial)===!1?["initial","animate"]:["initial"],n=t.custom??((i=t.presenceContext)==null?void 0:i.custom);return s.reduce((a,o)=>({...a,...Hp(t[o]||(e==null?void 0:e[o]),t.variants,n)}),{})}function al(t,e){const s=e==null?void 0:e.length;if(s!==t.length)return!1;for(let n=0;n<s;n++)if(e[n]!==t[n])return!1;return!0}var Kp=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 rl(t){return Kp.has(t)}const zo=new WeakMap;var Wp=class{constructor(t,e){var s;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,(s=e==null?void 0:e.children)==null||s.add(this),this.latestValues=Gp(t,this.context),this.type=rl(this.options.as)?"svg":"html"}get context(){return this._context||(this._context=new Proxy({},{get:(t,e)=>{var n;const s=this.options[e];return $s(s)||e==="initial"&&s===!1?s:(n=this.parent)==null?void 0:n.context[e]}})),this._context}updateFeatures(){if(this.visualElement)for(const t of Dn){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,s;zo.set(t,this),this.element=t,t.setAttribute(Up.motionAttribute,((e=this.options.presenceContext)==null?void 0:e.presenceId)??""),(s=this.visualElement)==null||s.mount(t),this.updateFeatures()}beforeUnmount(){this.getSnapshot(this.options,!1)}unmount(){var t,e,s;(e=(t=this.parent)==null?void 0:t.children)==null||e.delete(this),zo.delete(this.element),this.features.forEach(n=>{var i;return(i=n.unmount)==null?void 0:i.call(n)}),(s=this.visualElement)==null||s.unmount()}beforeUpdate(){this.getSnapshot(this.options,void 0)}update(){this.updateFeatures(),this.didUpdate()}tryExitComplete(){var t,e,s,n,i;this.isExiting||(t=this.options)!=null&&t.layoutId&&((s=(e=this.visualElement.projection)==null?void 0:e.currentAnimation)==null?void 0:s.state)==="running"||(i=(n=this.options.presenceContext)==null?void 0:n.onMotionExitComplete)==null||i.call(n,this.presenceContainer,this)}setActive(t,e){var s,n;t==="exit"&&e&&(this.isExiting=!0),(n=(s=this.visualElement)==null?void 0:s.animationState)==null||n.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,s,n;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:(s=this.options.motionConfig)==null?void 0:s.reducedMotion}),(n=this.visualElement.parent)==null||n.addChild(this.visualElement),this.isMounted()&&this.visualElement.mount(this.element))}getSnapshot(t,e){}didUpdate(){}},He=class{constructor(t){this.state=t}mount(){}unmount(){}update(){}};const ll=["initial","animate","exit","whileHover","whileDrag","whileFocus","whilePress"];var Yp=ll.length;function ul(t){if(!t)return;if(!t.isControllingVariants){const s=t.parent?ul(t.parent)||{}:{};return t.props.initial!==void 0&&(s.initial=t.props.initial),s}const e={};for(let s=0;s<Yp;s++){const n=ll[s],i=t.props[n];($s(i)||i===!1)&&(e[n]=i)}return e}var cl=["animate","whileInView","whileFocus","whileHover","whilePress","whileDrag","exit"],Xp=[...cl].reverse(),Qp=cl.length;function ot(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qo(){return{animate:ot(!0),whileInView:ot(),whileHover:ot(),whilePress:ot(),whileDrag:ot(),whileFocus:ot(),exit:ot()}}function Zp(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!al(e,t):!1}function Uo(t){return Array.isArray(t)}function Jp(t){return e=>Promise.all(e.map(({animation:s,options:n})=>Zf(t,s,n)))}function em(t){let e=Jp(t),s=qo(),n=!0;const i=l=>(u,c)=>{var d;const f=Pt(t,c,l==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(f){const{transition:h,transitionEnd:p,...x}=f;u={...u,...x,...p}}return u};function a(l){e=l(t)}function o(l){const{props:u}=t,c=ul(t.parent)||{},f=[],d=new Set;let h={},p=1/0;for(let g=0;g<Qp;g++){const y=Xp[g],P=s[y],_=u[y]!==void 0?u[y]:c[y],L=$s(_),D=y===l?P.isActive:null;D===!1&&(p=g);let E=_===c[y]&&_!==u[y]&&L;if(E&&n&&t.manuallyAnimateOnMount&&(E=!1),P.protectedKeys={...h},!P.isActive&&D===null||!_&&!P.prevProp||mi(_)||typeof _=="boolean")continue;const A=Zp(P.prevProp,_);let S=A||y===l&&P.isActive&&!E&&L||g>p&&L,B=!1;const R=Array.isArray(_)?_:[_];let q=R.reduce(i(y),{});D===!1&&(q={});const{prevResolvedValues:F={}}=P,te={...F,...q},C=z=>{S=!0,d.has(z)&&(B=!0,d.delete(z)),P.needsAnimating[z]=!0;const Y=t.getValue(z);Y&&(Y.liveStyle=!1)};for(const z in te){const Y=q[z],X=F[z];if(Object.hasOwnProperty.call(h,z))continue;let U=!1;Uo(Y)&&Uo(X)?U=!al(Y,X):U=Y!==X,U?Y!=null?C(z):d.add(z):Y!==void 0&&d.has(z)?C(z):P.protectedKeys[z]=!0}P.prevProp=_,P.prevResolvedValues=q,P.isActive&&(h={...h,...q}),n&&t.blockInitialAnimation&&(S=!1);const I=E&&A;S&&(!I||B)&&f.push(...R.map(z=>{const Y={type:y};if(typeof z=="string"&&n&&!I&&t.manuallyAnimateOnMount&&t.parent){const{parent:X}=t,U=Pt(X,z);if(X.enteringChildren&&U){const{delayChildren:Q}=U.transition||{};Y.delay=yr(X.enteringChildren,t,Q)}}return{animation:z,options:Y}}))}if(d.size){const g={};if(typeof u.initial!="boolean"){const y=Pt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(g.transition=y.transition)}d.forEach(y=>{const P=t.getBaseTarget(y),_=t.getValue(y);_&&(_.liveStyle=!0),g[y]=P??null}),f.push({animation:g})}let x=!!f.length;return n&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(x=!1),n=!1,x?e(f):Promise.resolve()}function r(l,u){var f;if(s[l].isActive===u)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(d=>{var h;(h=d.animationState)==null||h.setActive(l,u)}),s[l].isActive=u;const c=o(l);for(const d in s)s[d].protectedKeys={};return c}return{animateChanges:o,setActive:r,setAnimateFunction:a,getState:()=>s,reset:()=>{s=qo(),n=!0}}}function dl(t){return t.style.display==="none"||t.offsetParent===null&&window.getComputedStyle(t).position!=="fixed"}var ut,Rn,tm=(ut=class extends He{constructor(e){super(e);const s=e.visualElement;s.animationState||(s.animationState=em(s))}updateAnimationControlsSubscription(){const{animate:e}=this.state.options;mi(e)&&(this.unmountControls=e.subscribe(this.state.visualElement))}mount(){var e;dl(this.state.element)?this.state.setActive("exit",!0):(e=this.state.visualElement.animationState)==null||e.animateChanges(),this.updateAnimationControlsSubscription()}update(){var n;(n=this.state.visualElement.animationState)==null||n.animateChanges();const{animate:e}=this.state.visualElement.getProps(),{animate:s}=this.state.visualElement.prevProps||{};e!==s&&this.updateAnimationControlsSubscription()}unmount(){var e;this.state.visualElement.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}},Rn=new WeakMap,Ie(ut,Rn,ut.key="animation"),ut);function sm(t,e){return rl(t)?new Wh(e):new Nh(e)}function Ho(t){return{point:{x:t.pageX,y:t.pageY}}}var ct,$n,nm=(ct=class extends He{constructor(e){super(e)}isActive(){const{whilePress:e,onPress:s,onPressCancel:n,onPressStart:i}=this.state.options;return!!(e||s||n||i)}register(){var s;const e=this.state.element;!e||!this.isActive()||((s=this.removePress)==null||s.call(this),this.removePress=bh(e,(n,i)=>{const a=this.state.options;return this.state.setActive("whilePress",!0),a.onPressStart&&ee.postRender(()=>a.onPressStart(i,Ho(i))),(o,{success:r})=>{this.state.setActive("whilePress",!1);const l=r?"onPress":"onPressCancel",u=this.state.options[l];u&&ee.postRender(()=>u(o,Ho(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}},$n=new WeakMap,Ie(ct,$n,ct.key="press"),ct);function fl(t){return t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1}function Jt(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}function im(t){return e=>fl(e)&&t(e,Jt(e))}var dt,In,om=(dt=class extends He{constructor(e){super(e)}isActive(){const{whileHover:e,onHoverStart:s,onHoverEnd:n}=this.state.options;return!!(e||s||n)}register(){var s;const e=this.state.element;!e||!this.isActive()||((s=this.removeHover)==null||s.call(this),this.removeHover=mh(e,(n,i)=>{const a=this.state.options;return this.state.setActive("whileHover",!0),a.onHoverStart&&ee.postRender(()=>a.onHoverStart(i,Jt(i))),o=>{this.state.setActive("whileHover",!1);const r=this.state.options.onHoverEnd;r&&ee.postRender(()=>r(o,Jt(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}},In=new WeakMap,Ie(dt,In,dt.key="hover"),dt),ft,Bn,am=(ft=class extends He{constructor(e){super(e)}isActive(){const{whileInView:e,onViewportEnter:s,onViewportLeave:n}=this.state.options;return!!(e||s||n)}startObserver(){var i;const e=this.state.element;if(!e||!this.isActive())return;(i=this.removeObserver)==null||i.call(this);const{once:s,...n}=this.state.options.inViewOptions||{};this.removeObserver=Ip(e,(a,o)=>{const r=this.state.options;if(this.state.setActive("whileInView",!0),r.onViewportEnter&&ee.postRender(()=>r.onViewportEnter(o)),!s)return()=>{this.state.setActive("whileInView",!1);const l=this.state.options.onViewportLeave;l&&ee.postRender(()=>l(o))}},n)}mount(){this.startObserver()}update(){const{props:e,prevProps:s}=this.state.visualElement;["amount","margin","root"].some(n=>{var i,a;return((i=e.inViewOptions)==null?void 0:i[n])!==((a=s==null?void 0:s.inViewOptions)==null?void 0:a[n])})&&this.startObserver()}unmount(){var e;(e=this.removeObserver)==null||e.call(this),this.removeObserver=void 0}},Bn=new WeakMap,Ie(ft,Bn,ft.key="inView"),ft);function Ms(t,e,s,n={passive:!0}){return t.addEventListener(e,s,n),()=>t.removeEventListener(e,s)}var ht,On,rm=(ht=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=ss(Ms(e,"focus",()=>this.onFocus()),Ms(e,"blur",()=>this.onBlur()))}unmount(){var e;(e=this.removeFocus)==null||e.call(this),this.removeFocus=void 0}},On=new WeakMap,Ie(ht,On,ht.key="focus"),ht);function hl(t){if(t)return t.options.allowProjection!==!1?t.projection:hl(t.parent)}const pl={borderRadius:{...Fe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fe,borderTopRightRadius:Fe,borderBottomLeftRadius:Fe,borderBottomRightRadius:Fe,boxShadow:qr};function Ut(t){return typeof t=="object"&&t!==null&&"nodeType"in t}const lm=typeof window>"u";var pt,Fn,um=(pt=class extends He{constructor(e){super(e),Ur(pl),lm||this.initProjection()}initProjection(){const e=this.state.options;this.state.visualElement.projection=new Rp(this.state.visualElement.latestValues,e["data-framer-portal-id"]?void 0:hl(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:s,layout:n,drag:i=!1,dragConstraints:a=!1}=e;(o=this.projection)==null||o.setOptions({layout:n,layoutId:s,alwaysMeasureLayout:!!s||!!i||a&&Ut(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)}},Fn=new WeakMap,Ie(pt,Fn,pt.key="projection"),pt);function Wt(t,e,s,n){return Ms(t,e,im(s),n)}var Go=new Set(["auto","scroll"]),ml=class{constructor(t,e,{transformPagePoint:s,contextWindow:n,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=nn(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,d=Bp(c.offset,{x:0,y:0})>=3;if(!f&&!d)return;const{point:h}=c,{timestamp:p}=he;this.history.push({...h,timestamp:p});const{onStart:x,onMove:g}=this.handlers;f||(x&&x(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=sn(f,this.transformPagePoint),ee.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();const{onEnd:d,onSessionEnd:h,resumeAnimation:p}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=nn(c.type==="pointercancel"?this.lastMoveEventInfo:sn(f,this.transformPagePoint),this.history);this.startEvent&&d&&d(c,x),h&&h(c,x)},!fl(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=s,this.contextWindow=n||window;const o=sn(Jt(t),this.transformPagePoint),{point:r}=o,{timestamp:l}=he;this.history=[{...r,timestamp:l}];const{onSessionStart:u}=e;u&&u(t,nn(o,this.history)),this.removeListeners=ss(Wt(this.contextWindow,"pointermove",this.handlePointerMove),Wt(this.contextWindow,"pointerup",this.handlePointerUp),Wt(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 s=getComputedStyle(e);(Go.has(s.overflowX)||Go.has(s.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 s=t===window,n=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:n.x-e.x,y:n.y-e.y};i.x===0&&i.y===0||(s?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,n),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 sn(t,e){return e?{point:e(t.point)}:t}function Ko(t,e){return{x:t.x-e.x,y:t.y-e.y}}function nn({point:t},e){return{point:t,delta:Ko(t,gl(e)),offset:Ko(t,cm(e)),velocity:dm(e,.1)}}function cm(t){return t[0]}function gl(t){return t[t.length-1]}function dm(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,n=null;const i=gl(t);for(;s>=0&&(n=t[s],!(i.timestamp-n.timestamp>De(e)));)s--;if(!n)return{x:0,y:0};const a=Pe(i.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Wo(t){return(e,s)=>{t&&ee.postRender(()=>t(e,s))}}var mt,jn,fm=(mt=class extends He{constructor(...e){super(...e),this.removePointerDownListener=Me}onPointerDown(e){this.session=new ml(e,this.createPanHandlers(),{transformPagePoint:this.state.visualElement.getTransformPagePoint(),contextWindow:nl(this.state.visualElement)})}createPanHandlers(){return{onSessionStart:Wo((e,s)=>{const{onPanSessionStart:n}=this.state.options;n&&n(e,s)}),onStart:Wo((e,s)=>{const{onPanStart:n}=this.state.options;n&&n(e,s)}),onMove:(e,s)=>{const{onPan:n}=this.state.options;n&&n(e,s)},onEnd:(e,s)=>{const{onPanEnd:n}=this.state.options;delete this.session,n&&ee.postRender(()=>n(e,s))}}}mount(){this.removePointerDownListener=Wt(this.state.element,"pointerdown",this.onPointerDown.bind(this))}update(){}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},jn=new WeakMap,Ie(mt,jn,mt.key="pan"),mt);function vl(t){let e=null;return()=>{const s=()=>{e=null};return e===null?(e=t,s):!1}}var Yo=vl("dragHorizontal"),Xo=vl("dragVertical");function hm(t){let e=!1;if(t==="y")e=Xo();else if(t==="x")e=Yo();else{const s=Yo(),n=Xo();s&&n?e=()=>{s(),n()}:(s&&s(),n&&n())}return e}function pm(t,{min:e,max:s},n){return e!==void 0&&t<e?t=n?ne(e,t,n.min):Math.max(t,e):s!==void 0&&t>s&&(t=n?ne(s,t,n.max):Math.min(t,s)),t}const Vn=.35;function mm(t,{top:e,left:s,bottom:n,right:i}){return{x:Qo(t.x,s,i),y:Qo(t.y,e,n)}}function Qo(t,e,s){return{min:e!==void 0?t.min+e:void 0,max:s!==void 0?t.max+s-(t.max-t.min):void 0}}function gm(t=Vn){return t===!1?t=0:t===!0&&(t=Vn),{x:Zo(t,"left","right"),y:Zo(t,"top","bottom")}}function Zo(t,e,s){return{min:Jo(t,e),max:Jo(t,s)}}function Jo(t,e){return typeof t=="number"?t:t[e]||0}function vm(t,e){const s={};return e.min!==void 0&&(s.min=e.min-t.min),e.max!==void 0&&(s.max=e.max-t.min),s}function ym(t,e){return{x:ea(t.x,e.x),y:ea(t.y,e.y)}}function ea(t,e){let s=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([s,n]=[n,s]),{min:s,max:n}}function xm(t,e){let s=.5;const n=_e(t),i=_e(e);return i>n?s=Xt(e.min,e.max-n,t.min):n>i&&(s=Xt(t.min,t.max-i,e.min)),Ne(0,1,s)}const bm=new WeakMap;var wm=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 s=l=>{e?this.stopAnimation():this.pauseAnimation(),e&&this.snapToCursor(Jt(l,"page").point)},n=(l,u)=>{this.stopAnimation();const{drag:c,dragPropagation:f,onDragStart:d}=this.getProps();c&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=hm(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),Ce(h=>{let p=this.getAxisMotionValue(h).get()||0;if(je.test(p)){const{projection:x}=this.visualElement;if(x&&x.layout){const g=x.layout.layoutBox[h];g&&(p=_e(g)*(parseFloat(p)/100))}}this.originPoint[h]=p}),d&&ee.postRender(()=>d(l,u)),_n(this.visualElement,"transform"),this.state.setActive("whileDrag",!0))},i=(l,u)=>{const{dragPropagation:c,dragDirectionLock:f,onDirectionLock:d,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(f&&this.currentDirection===null){this.currentDirection=_m(p),this.currentDirection!==null&&d&&d(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},a=(l,u)=>this.stop(l,u),o=()=>Ce(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 ml(t,{onSessionStart:s,onStart:n,onMove:i,onSessionEnd:a,resumeAnimation:o},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:nl(this.visualElement),element:this.state.element})}stop(t,e){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:n}=e;this.startAnimation(n);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,s){const{drag:n}=this.getProps();if(!s||!vs(t,n,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(a=pm(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:e}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,n=this.constraints;t&&Ut(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=mm(s.layoutBox,t):this.constraints=!1,this.elastic=gm(e),n!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ce(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=vm(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Ut(t))return!1;const s=t,{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const i=$h(s,n.root,this.visualElement.getTransformPagePoint());let a=ym(n.layout.layoutBox,i);if(e){const o=e(Eh(a));this.hasMutatedConstraints=!!o,o&&(a=Or(o))}return a}startAnimation(t){const{drag:e,dragMomentum:s,dragElastic:n,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),r=this.constraints||{},l=Ce(u=>{if(!vs(u,e,this.currentDirection))return;let c=r&&r[u]||{};a&&(c={min:0,max:0});const f=n?200:1e6,d=n?40:1e7,h={type:"inertia",velocity:s?t[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(u,h)});return Promise.all(l).then(o)}startAxisValueAnimation(t,e){const s=this.getAxisMotionValue(t);return _n(this.visualElement,t),s.start(fi(t,s,0,e,this.visualElement,!1))}stopAnimation(){var t;(t=this.visualElement.projection)!=null&&t.isPresent&&Ce(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ce(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()}`,s=this.visualElement.getProps();return s[e]||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){Ce(e=>{const{drag:s}=this.getProps();if(!vs(e,s,this.currentDirection))return;const{projection:n}=this.visualElement,i=this.getAxisMotionValue(e);if(n&&n.layout){const{min:a,max:o}=n.layout.layoutBox[e];i.set(t[e]-ne(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:s}=this.visualElement;if(!Ut(e)||!s||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};Ce(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const r=o.get();n[a]=xm({min:r,max:r},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.state.element.style.transform=i?i({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Ce(a=>{if(!vs(a,t,null))return;const o=this.getAxisMotionValue(a),{min:r,max:l}=this.constraints[a];o.set(ne(r,l,n[a]))})}addListeners(){if(!this.state.element)return;bm.set(this.visualElement,this);const t=this.state.element,e=Wt(t,"pointerdown",r=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(r)}),s=()=>{const{dragConstraints:r}=this.getProps();Ut(r)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",s);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),ee.read(s);const a=Ms(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:r,hasLayoutChanged:l})=>{this.isDragging&&l&&(Ce(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:s=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:a=Vn,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:s,dragPropagation:n,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function vs(t,e,s){return(e===!0||e===t)&&(s===null||s===t)}function _m(t,e=10){let s=null;return Math.abs(t.y)>e?s="y":Math.abs(t.x)>e&&(s="x"),s}var gt,Nn,Sm=(gt=class extends He{constructor(e){super(e),this.removeGroupControls=Me,this.removeListeners=Me,this.controls=new wm(e)}mount(){const{dragControls:e}=this.state.options;e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Me}unmount(){this.removeGroupControls(),this.removeListeners()}},Nn=new WeakMap,Ie(gt,Nn,gt.key="drag"),gt),Nt=!1,vt,zn,Tm=(vt=class extends He{constructor(e){super(e),this.hasMountSettled=!1,Ur(pl),e.getSnapshot=this.getSnapshot.bind(this),e.didUpdate=this.didUpdate.bind(this)}updatePrevLead(e){const s=e.getStack();s!=null&&s.prevLead&&!s.prevLead.snapshot&&(s.prevLead.willUpdate(),Nt=!0)}didUpdate(){var e,s;Nt&&(this.state.options.layout||this.state.options.layoutId||this.state.options.drag)&&(Nt=!1,(s=(e=this.state.visualElement.projection)==null?void 0:e.root)==null||s.didUpdate())}mount(){var n;const e=this.state.options,s=this.state.options.layoutGroup;if(e.layout||e.layoutId){const i=this.state.visualElement.projection;if(e.layoutId){const a=!dl(this.state.element);i.isPresent=a,a?i.promote():i.relegate(),this.updatePrevLead(i)}(n=s==null?void 0:s.group)==null||n.add(i),ws.hasEverUpdated=!0}this.didUpdate(),ee.postRender(()=>{this.hasMountSettled=!0})}unmount(){const e=this.state.options.layoutGroup,s=this.state.visualElement.projection;s&&(e!=null&&e.group&&(this.state.options.layout||this.state.options.layoutId)&&e.group.remove(s),this.state.options.layoutId&&(Nt=!0),this.didUpdate())}getSnapshot(e,s){const n=this.state.visualElement.projection,{drag:i,layoutDependency:a,layout:o,layoutId:r}=e;if(!n||!o&&!r&&!i||!this.hasMountSettled)return;Nt=!0;const l=this.state.options;(i||l.layoutDependency!==a||a===void 0||Ai(s)&&n.isPresent!==s)&&n.willUpdate(),Ai(s)&&s!==n.isPresent&&(n.isPresent=s,s?(n.promote(),this.updatePrevLead(n)):n.relegate())}},zn=new WeakMap,Ie(vt,zn,vt.key="layout"),vt);const km={renderer:sm,features:[tm,nm,om,am,rm,um,fm,Sm,Tm]},[Am,zx]=ts("LazyMotionContext"),[Cm,qx,Ux]=ts("AnimatePresenceContext");function Pm(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function yl(){return{transform:{},transformOrigin:{},style:{},vars:{}}}function Mm(){return{...yl(),attrs:{}}}function Dm(t){const e=yl();gi(e,t);const s={...e.style};for(const n in e.vars)s[n]=e.vars[n];return Object.keys(s).length===0?null:s}function Vm(t,e,s){const n=Mm();Gr(n,t,Kr(e),void 0,s);const i={};for(const a in n.attrs){const o=vi.has(a)?a:Pm(a);i[o]=n.attrs[a]}return{attrs:i,style:{...n.style,...n.vars}}}function Em(t,e){const s=Op(null),n=jp({}),i=qp(),a=Cm({}),o=Am({features:K({}),strict:!1}),r=Ll();function l(){return nd(t,{layoutGroup:n,presenceContext:a,config:i.value})}function u(){return{...r,...l()}}const c=new Wp(u(),s);Fp(c),e&&c.initVisualElement(e),be(o.features,h=>{var p;(p=h.features)!=null&&p.length&&il(h.features),h.renderer&&c.initVisualElement(h.renderer),c.updateFeatures()},{immediate:!0,flush:"pre"});function f(){var P;const h=c.type==="svg",p={...r};Object.keys(r).forEach(_=>{ye(r[_])&&(p[_]=r[_].get())});const x=((P=c.visualElement)==null?void 0:P.latestValues)||c.latestValues;let g={...t.style,...h?{}:x};for(const _ in g)ye(g[_])&&(g[_]=g[_].get());if(h){const{attrs:_,style:L}=Vm({...x,...g},c.options.as,t.style);Object.assign(p,_),g=L}t.drag&&t.dragListener!==!1&&Object.assign(g,{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`});const y=Dm(g);return y&&(p.style=y),p}const d=Rl().proxy;return Vs(()=>{const h=Mn(d.$el);c.mount(h)}),Hn(()=>c.beforeUnmount()),ma(()=>{var h;(h=Mn(d.$el))!=null&&h.isConnected||c.unmount()}),$l(()=>{c.beforeUpdate(),c.updateOptions(u())}),Il(()=>{c.update()}),{getProps:l,getAttrs:f,layoutGroup:n,state:c}}const Lm={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 Rm=new Map,$m=new Map;function Im(t){if(!Array.isArray(t))return[t];const e=[];for(const s of t)Array.isArray(s)?e.push(...s):e.push(s);return e}var Bm=["area","img","input"];function Om(t,e,s){var n,i;if(typeof t=="string"&&Bm.includes(t))return Ct(t,e);if(t==="template"){if(!s.default)return null;const a=Im(s.default()),o=a.findIndex(c=>c.type!==Bl);if(o===-1)return a;const r=a[o];(n=r.props)==null||delete n.ref;const l=r.props?xt(e,r.props):e;e.class&&((i=r.props)!=null&&i.class)&&delete r.props.class;const u=Ol(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 ta(t,e={}){const s=typeof t=="string",n=s?t:t.name||"",i=e.renderer?Rm:$m;if(s&&(i!=null&&i.has(t)))return i.get(t);const a=W({inheritAttrs:!1,props:{...Lm,as:{type:[String,Object],default:t||"div"}},name:n?`motion.${n}`:"Motion",setup(o,{slots:r}){const{getProps:l,getAttrs:u,state:c}=Em(o,e.renderer);function f(){const d=c.element;if((typeof o.as!="object"||o.asChild)&&d){const{style:h}=u();if(h)for(const[p,x]of Object.entries(h))d.style[p]=x}}return()=>{const d=l(),h=u(),p=o.asChild?"template":o.as,x={...o.forwardMotionProps?d:{},...h,onVnodeUpdated:f},g=Om(p,x,r);return g!==null?g:Ct(p,{...x},r)}}});return s&&(i==null||i.set(t,a)),a}function Fm(t){const e=t==null?void 0:t.renderer;return il((t==null?void 0:t.features)||[]),new Proxy({},{get(s,n){return n==="create"?(i,a)=>ta(i,{...a,renderer:e}):ta(n,{renderer:e})}})}const En=Fm(km);En.create("div");const yi=W({__name:"Shimmer",props:{as:{default:"p"},class:{},duration:{default:2},spread:{default:2}},setup(t){const e=t,s=Fl(),n=V(()=>{var u;const l=(u=s.default)==null?void 0:u.call(s);return!l||l.length===0?"":l.map(c=>typeof c.children=="string"?c.children:"").join("")}),i=V(()=>{var l;return(((l=n.value)==null?void 0:l.length)??0)*e.spread}),a=V(()=>Gn("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=V(()=>({"--spread":`${i.value}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"})),r=V(()=>En[e.as]||En.p);return(l,u)=>(b(),H(ga(r.value),{class:ae(a.value),style:Et(o.value),initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:Number.POSITIVE_INFINITY,duration:l.duration,ease:"linear"}},{default:T(()=>[Vt(l.$slots,"default")]),_:3},8,["class","style","transition"]))}});function xl(t){const e=V(()=>{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 f=l.result;f!=null&&f.filename&&f.content!==void 0&&a.push({id:c,messageId:o.id,type:"file",filename:f.filename,result:f})}})}return a}),s=V(()=>e.value.filter(a=>a.type==="file")),n=V(()=>e.value.filter(a=>a.type==="code")),i=V(()=>e.value.filter(a=>a.type==="source"));return{attachments:e,files:s,codes:n,sources:i}}function jm(t){const e=window.atob(t),s=new Uint8Array(e.length);for(let n=0;n<e.length;n+=1)s[n]=e.charCodeAt(n);return s}function xi(){return{downloadFile:async e=>{if(e.error)return Fs.error(e.error),!1;try{const s=e.encoding==="base64"?new Blob([jm(e.content)],{type:e.mimeType}):new Blob([e.content],{type:e.mimeType}),n=URL.createObjectURL(s),i=document.createElement("a");return i.href=n,i.download=e.filename,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n),Fs.success(`Downloaded ${e.filename}`),!0}catch(s){const n=s instanceof Error?s.message:"Failed to download export file.";return Fs.error(n),!1}}}}const Nm={class:"whitespace-pre-wrap leading-normal chat-text"},zm=W({__name:"BlockMessageText",props:{content:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean},isUserMessage:{type:Boolean}},setup(t){const e=t,s=V(()=>!!(e.isBlockStreaming&&e.isStreaming)),n=Kn(Yt(e,"content"),s);return(i,a)=>(b(),k("p",Nm,M(m(n)),1))}});class bi{constructor(e){We(this,"options");We(this,"tokensStable",[]);We(this,"tokensUnstable",[]);We(this,"lastUnstableCodeChunk","");We(this,"lastStableGrammarState");this.options=e}async enqueue(e){const s=(this.lastUnstableCodeChunk+e).split(`
3
3
  `),n=[];let i=[];const a=this.tokensUnstable.length;return s.forEach((o,r)=>{const l=r===s.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,n.push(...c))}),this.tokensStable.push(...n),this.tokensUnstable=i,{recall:a,stable:n,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 bi(this.options);return e.lastUnstableCodeChunk=this.lastUnstableCodeChunk,e.tokensUnstable=this.tokensUnstable,e.tokensStable=this.tokensStable,e.lastStableGrammarState=this.lastStableGrammarState,e}}class qm extends TransformStream{constructor(s){const n=new bi(s),{allowRecalls:i=!1}=s;super({async transform(a,o){const{stable:r,unstable:l,recall:u}=await n.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}=n.close();if(!i)for(const r of o)a.enqueue(r)}});We(this,"tokenizer");We(this,"options");this.tokenizer=n,this.options=s}}function Um(t){return!t||Object(t)!==t}const Hm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function Gm(t=16,e=Hm){let s="",n=t;const i=e.length;for(;n--;)s+=e[Math.random()*i|0];return s}const on=new WeakMap;function Km(t){return Um(t)?t:(on.has(t)||on.set(t,Gm()),on.get(t))}const Wm=W({name:"ShikiStreamRenderer",props:{stream:{type:Object,required:!0}},emits:["stream-start","stream-end"],setup(t,{emit:e}){const s=Nl([]);let n=null;return be(()=>t.stream,i=>{s.length=0,n&&n.abort(),n=new AbortController;const a=n.signal;let o=!1;i.pipeTo(new WritableStream({write(r){a.aborted||(o||(o=!0,e("stream-start")),"recall"in r?s.length-=r.recall:s.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}),()=>Ct("pre",{class:"shiki shiki-stream"},Ct("code",Se(s,i=>Ct("span",{key:Km(i),style:i.htmlStyle||_u(i)},i.content))))}}),Ym=W({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 s=K(0);let n=null;const i=new ReadableStream({start(o){n=o}});jl(()=>{t.code.length>s.value&&(n==null||n.enqueue(t.code.slice(s.value)),s.value=t.code.length)});const a=i.pipeThrough(new qm({highlighter:t.highlighter,lang:t.lang,theme:t.theme,allowRecalls:!0}));return()=>Ct(Wm,{stream:a,onStreamStart:()=>e("stream-start"),onStreamEnd:()=>e("stream-end")})}});let zt=null,an=null;const Xm=new Set,Qm=[ke(()=>import("./B9xm8XSJ.js"),[],import.meta.url),ke(()=>import("./D4pAW_0T.js").then(t=>t.f),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./D4pAW_0T.js").then(t=>t.e),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./CSQ0xnqv.js").then(t=>t.b),__vite__mapDeps([3,1,2,0]),import.meta.url),ke(()=>import("./D4pAW_0T.js").then(t=>t.m),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./fuZLfV_i.js"),[],import.meta.url),ke(()=>import("./D4pAW_0T.js").then(t=>t.x),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./D4pAW_0T.js").then(t=>t.y),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./D4pAW_0T.js").then(t=>t.h),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./D4pAW_0T.js").then(t=>t.j),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./DlfHMoPT.js"),[],import.meta.url)],Zm=async t=>{if(an||(an=Su({langs:Qm,themes:[ku,Au],engine:Tu()})),zt||(zt=await an),t!=null&&t.length){const e=zt.getLoadedLanguages();await Promise.all(t.filter(s=>!e.includes(s)).map(s=>zt.loadLanguage(s).catch(()=>{Xm.add(s),console.warn(`[useHighlighter] Unknown language: "${s}" — will render as plain text`)})))}return zt},Jm={class:"rounded-xl border overflow-hidden shadow-sm"},eg={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},tg={class:"text-xxs font-semibold capitalize text-muted-foreground select-none"},sg={class:"flex items-center gap-1 justify-center"},ng={class:"overflow-x-auto px-3 py-2 chat-code-text"},ig={key:1,class:"m-0"},Is=W({__name:"BlockMessageCode",props:{id:{},code:{},language:{},class:{},meta:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean}},setup(t){const e=va(),s=K(null),n=t;be(()=>n.language,async p=>{s.value=await Zm([p])},{immediate:!0});const{handleCopyWithKey:i,isCopied:a,getCopyIcon:o,getCopyIconClass:r,getCopyTooltip:l}=Wn(),u=V(()=>!!(n.isBlockStreaming&&n.isStreaming)),c=Kn(Yt(n,"code"),u),f=V(()=>{switch(n.language){case"markdown":return"markdown";case"csv":return"csv";case"json":return"json";case"javascript":return"js";case"typescript":return"ts";case"postgresql":case"mysql":case"oracle":case"sql":case"plsql":case"sqlpl":case"sqlserver":return"sql";default:return"text"}}),d=V(()=>c.value.trim().replace(/`+$/,"")),h=V(()=>`${f.value}-${e.value}`);return(p,x)=>{const g=de,y=ve;return b(),k("div",Jm,[w("div",eg,[w("span",tg,M(n.language),1),v(m(Es),null,{default:T(()=>[v(m(Ls),{"as-child":""},{default:T(()=>[v(y,{variant:"ghost",size:"xxs",class:"h-6!",onClick:x[0]||(x[0]=P=>m(i)(p.id,p.code))},{default:T(()=>[w("span",sg,[(b(),H(g,{key:m(a)(p.id)?"tick":"copy",name:m(o)(m(a)(p.id)),class:ae(["size-3.5",m(r)(m(a)(p.id))])},null,8,["name","class"])),m(a)(p.id)?(b(),k("span",{key:0,class:ae(["text-xxs font-medium leading-none",m(r)(m(a)(p.id))])}," Copied ",2)):G("",!0)])]),_:1})]),_:1}),v(m(Rs),null,{default:T(()=>[w("p",null,M(m(l)(m(a)(p.id))),1)]),_:1})]),_:1})]),w("div",ng,[s.value?(b(),H(m(Ym),{key:h.value,highlighter:s.value,code:d.value,lang:f.value,theme:m(e).value==="dark"?"catppuccin-mocha":"catppuccin-latte"},null,8,["highlighter","code","lang","theme"])):(b(),k("pre",ig,[w("code",null,M(d.value),1)]))])])}}}),og={class:"rounded-xl border overflow-hidden shadow-sm"},ag={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},rg={class:"flex items-center gap-0.5"},lg={class:"flex items-center gap-1 justify-center"},ug={key:0,class:"text-xxs font-medium leading-none"},cg={key:0,class:"overflow-auto bg-background max-h-[400px] p-4"},dg={key:0,class:"text-destructive text-sm p-2 bg-destructive/10 rounded"},fg=["innerHTML"],hg={key:1,class:"overflow-x-auto px-3 py-2 chat-code-text"},pg={class:"m-0"},mg={key:0,class:"fixed inset-0 z-50 bg-background flex flex-col"},gg={class:"flex items-center justify-between px-4 py-2 border-b border-border"},vg={class:"flex items-center gap-2"},yg={class:"flex items-center gap-1"},xg={key:0,class:"flex-1 overflow-auto p-6"},bg={key:0,class:"text-destructive text-sm p-2 bg-destructive/10 rounded"},wg=["innerHTML"],_g={key:1,class:"flex-1 overflow-auto px-4 py-3 chat-code-text"},Sg={class:"m-0"},Tg=W({__name:"BlockMessageMermaid",props:{id:{},code:{}},setup(t){const e=t,s=K(null),n=K(null),i=K(null),a=K(null),{handleCopyWithKey:o,isCopied:r,getCopyIcon:l,getCopyIconClass:u,getCopyTooltip:c}=Wn();let f=0;const d=async()=>{if(e.code.trim())try{i.value=null;const{default:g}=await ke(async()=>{const{default:_}=await import("./DHAL8jJG.js").then(L=>L.bf);return{default:_}},__vite__mapDeps([4,1,2]),import.meta.url);g.initialize({startOnLoad:!1,theme:va().value==="dark"?"dark":"default",securityLevel:"strict",fontFamily:"inherit"}),f+=1;const y=`mermaid-${e.id}-${f}`,{svg:P}=await g.render(y,e.code.trim());a.value=P}catch(g){i.value=g instanceof Error?g.message:"Failed to render diagram",a.value=null}};Vs(d),be(()=>e.code,d);const h=K(!1),p=K(!1),x=()=>{h.value=!h.value};return(g,y)=>{const P=de,_=ve,L=Ls,D=Rs,E=Es;return b(),k(re,null,[w("div",og,[w("div",ag,[y[4]||(y[4]=w("span",{class:"text-xxs font-semibold capitalize text-muted-foreground select-none"}," Mermaid ",-1)),w("div",rg,[v(E,null,{default:T(()=>[v(L,{"as-child":""},{default:T(()=>[v(_,{variant:"ghost",size:"iconSm",onClick:y[0]||(y[0]=A=>p.value=!p.value)},{default:T(()=>[v(P,{name:p.value?"hugeicons:eye":"hugeicons:source-code",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),v(D,null,{default:T(()=>[N(M(p.value?"Show diagram":"Show source"),1)]),_:1})]),_:1}),v(E,null,{default:T(()=>[v(L,{"as-child":""},{default:T(()=>[v(_,{variant:"ghost",size:"iconSm",class:"w-[unset]",onClick:y[1]||(y[1]=A=>m(o)(g.id,g.code))},{default:T(()=>[w("span",lg,[(b(),H(P,{key:m(r)(g.id)?"tick":"copy",name:m(l)(m(r)(g.id)),class:ae(["size-4",m(u)(m(r)(g.id))])},null,8,["name","class"])),m(r)(g.id)?(b(),k("span",ug," Copied ")):G("",!0)])]),_:1})]),_:1}),v(D,null,{default:T(()=>[N(M(m(c)(m(r)(g.id))),1)]),_:1})]),_:1}),v(E,null,{default:T(()=>[v(L,{"as-child":""},{default:T(()=>[v(_,{variant:"ghost",size:"iconSm",onClick:x},{default:T(()=>[v(P,{name:h.value?"hugeicons:arrow-shrink-02":"hugeicons:arrow-expand-02",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),v(D,null,{default:T(()=>[N(M(h.value?"Exit full view":"Full view"),1)]),_:1})]),_:1})])]),p.value?(b(),k("div",hg,[w("pre",pg,[w("code",null,M(g.code),1)])])):(b(),k("div",cg,[i.value?(b(),k("div",dg,M(i.value),1)):a.value?(b(),k("div",{key:1,ref_key:"containerRef",ref:s,class:"flex items-center justify-center [&>svg]:max-w-full",innerHTML:a.value},null,8,fg)):G("",!0)]))]),(b(),H(ya,{to:"body"},[h.value?(b(),k("div",mg,[w("div",gg,[w("div",vg,[v(P,{name:"hugeicons:chart-relationship",class:"size-4 text-primary"}),y[5]||(y[5]=w("span",{class:"text-sm font-medium"},"Mermaid Diagram",-1))]),w("div",yg,[v(E,null,{default:T(()=>[v(L,{"as-child":""},{default:T(()=>[v(_,{variant:"ghost",size:"xxs",class:"h-7!",onClick:y[2]||(y[2]=A=>p.value=!p.value)},{default:T(()=>[v(P,{name:p.value?"hugeicons:eye":"hugeicons:source-code",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),v(D,null,{default:T(()=>[N(M(p.value?"Show diagram":"Show source"),1)]),_:1})]),_:1}),v(E,null,{default:T(()=>[v(L,{"as-child":""},{default:T(()=>[v(_,{variant:"ghost",size:"iconSm",onClick:y[3]||(y[3]=A=>m(o)(g.id,g.code))},{default:T(()=>[v(P,{name:m(l)(m(r)(g.id)),class:ae(["size-4",m(u)(m(r)(g.id))])},null,8,["name","class"])]),_:1})]),_:1}),v(D,null,{default:T(()=>[N(M(m(c)(m(r)(g.id))),1)]),_:1})]),_:1}),v(_,{variant:"ghost",size:"iconSm",onClick:x},{default:T(()=>[v(P,{name:"hugeicons:arrow-shrink-02",class:"size-4"})]),_:1})])]),p.value?(b(),k("div",_g,[w("pre",Sg,[w("code",null,M(g.code),1)])])):(b(),k("div",xg,[i.value?(b(),k("div",bg,M(i.value),1)):a.value?(b(),k("div",{key:1,ref_key:"fullscreenContainerRef",ref:n,class:"flex items-center justify-center [&>svg]:max-w-full [&>svg]:max-h-full",innerHTML:a.value},null,8,wg)):G("",!0)]))])):G("",!0)]))],64)}}}),kg={class:"flex items-center gap-2 text-muted-foreground chat-text"},Ag=W({__name:"BlockMessageLoading",props:{label:{}},setup(t){return(e,s)=>{const n=de;return b(),k("div",kg,[v(n,{name:"hugeicons:loading-03",class:"size-4 animate-spin"}),v(yi,null,{default:T(()=>[N(M(e.label||"Generating summary..."),1)]),_:1})])}}}),Cg={class:"rounded-xl py-2 text-destructive"},Pg=W({__name:"BlockMessageError",props:{message:{}},setup(t){return(e,s)=>(b(),k("div",Cg,M(e.message),1))}}),Mg={key:1,class:"rounded-2xl border bg-muted/40"},Dg={class:"overflow-x-auto px-3 py-3 leading-6 chat-code-text"},Vg=W({__name:"BlockMessageTool",props:{toolName:{},result:{},getToolComponent:{type:Function}},setup(t){const e=t,s=V(()=>e.getToolComponent(e.toolName)),n=i=>JSON.stringify(i,null,2);return(i,a)=>m(s)?(b(),H(ga(m(s)),{key:0,data:i.result},null,8,["data"])):(b(),k("div",Mg,[w("pre",Dg,M(n(i.result)),1)]))}}),Eg={class:"inline-flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-xs"},Lg={class:"min-w-0 flex-1"},Rg=["href"],$g={key:1,class:"truncate font-medium text-foreground"},Ig={key:2,class:"ml-2 text-xxs text-muted-foreground"},Bg=W({__name:"BlockMessageSource",props:{sourceId:{},url:{},title:{},mediaType:{},filename:{}},setup(t){return(e,s)=>{const n=de;return b(),k("div",Eg,[v(n,{name:e.url?"hugeicons:link-02":"hugeicons:file-02",class:"size-3.5 shrink-0 text-muted-foreground"},null,8,["name"]),w("div",Lg,[e.url?(b(),k("a",{key:0,href:e.url,target:"_blank",rel:"noopener noreferrer",class:"truncate font-medium text-primary hover:underline"},M(e.title||e.url),9,Rg)):(b(),k("span",$g,M(e.title||e.filename||"Source document"),1)),e.mediaType?(b(),k("span",Ig,M(e.mediaType),1)):G("",!0)])])}}}),sa=W({__name:"RadioGroup",props:{modelValue:{},defaultValue:{},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=V(()=>{const{class:o,...r}=s;return r}),a=zl(i,n);return(o,r)=>(b(),H(m(Ac),xt({"data-slot":"radio-group",class:m(Gn)("grid gap-3",s.class)},m(a)),{default:T(()=>[Vt(o.$slots,"default")]),_:3},16,["class"]))}}),na=W({__name:"RadioGroupItem",props:{id:{},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},setup(t){const e=t,s=V(()=>{const{class:i,...a}=e;return a}),n=ql(s);return(i,a)=>(b(),H(m(Dc),xt({"data-slot":"radio-group-item"},m(n),{class:m(Gn)("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e.class)}),{default:T(()=>[v(m(Ec),{"data-slot":"radio-group-indicator",class:"relative flex items-center justify-center"},{default:T(()=>[v(m(Du),{class:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})]),_:1})]),_:1},16,["class"]))}}),Og={key:0,class:"flex items-center gap-2 rounded-xl border border-border/60 bg-muted/30 px-3 py-2"},Fg={class:"text-xs text-muted-foreground truncate"},jg={key:1,class:"rounded-2xl border border-border/70 bg-background/80 overflow-hidden"},Ng={class:"px-4 pt-4"},zg={class:"flex items-center justify-between gap-2 mb-2"},qg={class:"flex items-center gap-2 min-w-0"},Ug=["title"],Hg={class:"shrink-0 text-[11px] text-muted-foreground"},Gg={class:"h-0.5 rounded-full bg-muted overflow-hidden"},Kg={class:"px-4 py-3"},Wg={class:"text-sm leading-relaxed"},Yg={key:0,class:"text-destructive ml-0.5","aria-label":"required"},Xg={key:1,class:"flex flex-col gap-3 py-1"},Qg=["value","placeholder"],Zg={class:"px-4 pb-4 flex items-center justify-between gap-2"},Jg={key:1},ev={class:"flex items-center gap-1.5"},tv=W({__name:"BlockMessageQuiz",props:{toolCallId:{},context:{},questions:{}},emits:["submit"],setup(t,{emit:e}){const s=t,n=e,i=K({}),a=K(0),o=K(!1),r=V(()=>s.questions[a.value]),l=V(()=>a.value===s.questions.length-1),u=V(()=>s.questions.every(E=>!E.required||d(E.id))),c=K("");function f(){if(!r.value)return;const E=i.value[r.value.id];c.value=typeof E=="string"?E:""}function d(E){const A=i.value[E];return Array.isArray(A)?A.length>0:!!(A!=null&&A.trim())}function h(E){const A=r.value;if(!A)return!1;const S=i.value[A.id];return A.type==="multiple"?Array.isArray(S)&&S.includes(E):S===E}function p(E){const A=r.value;if(A){if(A.type==="single")i.value={...i.value,[A.id]:E},c.value="";else if(A.type==="multiple"){const S=i.value[A.id]??[],B=S.includes(E)?S.filter(R=>R!==E):[...S,E];i.value={...i.value,[A.id]:B}}}}function x(E){const A=r.value;if(!A)return;const S=E.target.value;c.value=S,i.value={...i.value,[A.id]:S}}function g(){a.value>0&&(a.value--,f())}function y(){l.value?L():(a.value++,f())}function P(){l.value?L():(a.value++,f())}function _(){return`[Quiz answers] ${s.questions.filter(A=>d(A.id)).map(A=>{const S=i.value[A.id],B=Array.isArray(S)?S.join(", "):S;return`${A.id}: ${B}`}).join(" | ")}`}function L(){u.value&&(o.value=!0,n("submit",_()))}const D=V(()=>s.questions.filter(E=>d(E.id)).map(E=>{const A=i.value[E.id];return Array.isArray(A)?A.join(", "):A}).join(" · "));return(E,A)=>{var R;const S=de,B=ve;return o.value?(b(),k("div",Og,[v(S,{name:"lucide:check-circle-2",class:"size-3.5 shrink-0 text-primary"}),w("span",Fg,[A[2]||(A[2]=w("span",{class:"font-medium text-foreground"},"Answered",-1)),D.value?(b(),k(re,{key:0},[N(" · "+M(D.value),1)],64)):G("",!0)])])):E.questions.length>0?(b(),k("div",jg,[w("div",Ng,[w("div",zg,[w("div",qg,[v(m(Te),{variant:"outline",class:"text-xs px-1"},{default:T(()=>[v(S,{name:"lucide:help-circle",class:"size-3 text-primary"}),A[3]||(A[3]=N(" Clarification "))]),_:1}),E.context?(b(),k("span",{key:0,class:"text-xs text-muted-foreground truncate",title:E.context},M(E.context),9,Ug)):G("",!0)]),w("span",Hg,M(a.value+1)+" / "+M(E.questions.length),1)]),w("div",Gg,[w("div",{class:"h-full rounded-full bg-primary transition-all duration-300",style:Et({width:`${(a.value+1)/E.questions.length*100}%`})},null,4)])]),w("div",Kg,[v(es,{name:"quiz-slide",mode:"out-in"},{default:T(()=>{var q;return[r.value?(b(),k("div",{key:r.value.id,class:"space-y-3"},[w("p",Wg,[N(M(r.value.question)+" ",1),r.value.required?(b(),k("span",Yg,"*")):G("",!0)]),(q=r.value.suggestions)!=null&&q.length?(b(),k(re,{key:0},[r.value.type==="single"?(b(),H(m(sa),{key:0,"model-value":i.value[r.value.id],"onUpdate:modelValue":A[0]||(A[0]=F=>p(String(F))),class:"flex flex-col gap-3 py-1"},{default:T(()=>[(b(!0),k(re,null,Se(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[v(m(na),{id:F,value:F},null,8,["id","value"]),v(m(js),{for:F,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:T(()=>[N(M(F),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"])):r.value.type==="multiple"?(b(),k("div",Xg,[(b(!0),k(re,null,Se(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[v(m(Mu),{id:F,checked:h(F),"onUpdate:checked":te=>p(F)},null,8,["id","checked","onUpdate:checked"]),v(m(js),{for:F,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:T(()=>[N(M(F),1)]),_:2},1032,["for"])]))),128))])):(b(),H(m(sa),{key:2,"model-value":i.value[r.value.id],"onUpdate:modelValue":A[1]||(A[1]=F=>p(String(F))),class:"flex flex-col gap-3 py-1"},{default:T(()=>[(b(!0),k(re,null,Se(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[v(m(na),{id:F,value:F},null,8,["id","value"]),v(m(js),{for:F,class:"cursor-pointer text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:T(()=>[N(M(F),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"]))],64)):G("",!0),w("input",{value:c.value,type:"text",class:"w-full rounded-lg border border-border bg-muted/30 px-3 py-1.5 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary/40 focus:border-primary/50 transition-all",placeholder:r.value.type==="open"?"Type your answer…":"Or type a custom answer…",onInput:x},null,40,Qg)])):G("",!0)]}),_:1})]),w("div",Zg,[a.value>0?(b(),H(B,{key:0,variant:"ghost",size:"sm",class:"text-xs h-7",onClick:g},{default:T(()=>[v(S,{name:"lucide:arrow-left",class:"size-3 mr-1"}),A[4]||(A[4]=N(" Back "))]),_:1})):(b(),k("div",Jg)),w("div",ev,[!((R=r.value)!=null&&R.required)&&!l.value?(b(),H(B,{key:0,variant:"ghost",size:"xs",onClick:P},{default:T(()=>A[5]||(A[5]=[N(" Skip ")])),_:1})):G("",!0),v(B,{size:"xs",disabled:l.value&&!u.value,onClick:y},{default:T(()=>[N(M(l.value?"Submit":"Next")+" ",1),l.value?(b(),H(S,{key:1,name:"lucide:send",class:"size-3 ml-1"})):(b(),H(S,{key:0,name:"lucide:arrow-right",class:"size-3 ml-1"}))]),_:1},8,["disabled"])])])])):G("",!0)}}}),sv=xa(tv,[["__scopeId","data-v-2b68c703"]]),nv={class:"flex h-full flex-col bg-sidebar/50 z-50 p-2 gap-2"},iv={class:"flex shrink-0 items-center justify-between gap-2"},ov={class:"flex items-center min-w-0 gap-1 flex-1"},av={class:"text-xs"},rv={class:"flex-1 overflow-hidden flex flex-col min-h-0 relative mt-2"},lv={class:"flex-1 min-h-0 overflow-y-auto w-full relative"},uv={key:0,class:"absolute inset-0 flex items-center justify-center p-6 z-10"},cv={class:"space-y-2"},dv=["onClick"],fv={class:"min-w-0 flex-1"},hv={class:"text-xs font-medium truncate"},pv={class:"flex items-center gap-2"},mv={class:"min-w-0 flex-1"},gv={class:"flex flex-wrap gap-1.5 text-xs"},vv={class:"flex-1 overflow-y-auto px-4 space-y-4"},yv={key:0,class:"space-y-2"},xv={key:0,class:"bg-muted/50 p-3 rounded-md overflow-x-auto whitespace-pre-wrap font-mono border chat-code-text"},bv={key:1,class:"flex flex-col items-center justify-center p-5 bg-muted/20 rounded-md border border-dashed min-h-[140px]"},wv={key:1,class:"text-sm"},_v={key:2,class:"flex flex-col gap-3 p-3 bg-muted/30 rounded-md border"},Sv={class:"text-xs font-medium"},Tv={key:0,class:"text-xs text-primary break-all flex items-center gap-1"},kv=["href"],Av={key:1,class:"text-xs text-muted-foreground"},Cv={class:"flex gap-2"},Pv=W({__name:"AgentAttachmentPanel",props:{messages:{}},emits:["close"],setup(t,{emit:e}){const s=t,n=e,i=V(()=>s.messages),{attachments:a,files:o,codes:r,sources:l}=xl(i),{downloadFile:u}=xi(),c=K("all"),f=A=>({type:"file",id:A.id,name:A.filename,description:"Exported File",icon:"hugeicons:file-02",data:A.result}),d=A=>({type:"source",id:A.id,name:A.title||A.filename||A.url,description:A.url||"Link & Resources",icon:"hugeicons:link-square-02",data:A}),h=A=>({type:"code",id:A.id,name:A.language?`Snippet (${A.language})`:"Snippet",description:"Code Snippet",icon:"hugeicons:code-circle",data:A}),p=V(()=>({all:[...o.value.map(f),...l.value.map(d),...r.value.map(h)],files:o.value.map(f),code:r.value.map(h),links:l.value.map(d)})),x=V(()=>p.value[c.value]||[]),g=K(!1),y=K(null),P=A=>{if(A==null)return"—";if(A<1024)return`${A} B`;const S=["KB","MB","GB","TB"];let B=A/1024,R=0;for(;B>=1024&&R<S.length-1;)B/=1024,R+=1;return`${B.toFixed(B>=10?0:1)} ${S[R]}`},_=V(()=>y.value?y.value.type==="file"?"File":y.value.type==="code"?"Code":"Link":""),L=V(()=>{var A,S;return((A=y.value)==null?void 0:A.type)==="source"&&!!((S=y.value.data)!=null&&S.url)}),D=A=>{y.value=A,g.value=!0},E=async A=>{var S;if(A)if(A.type==="file")await u(A.data);else if(A.type==="code"){const B=A.data.code,R=new Blob([B],{type:"text/plain"}),q=URL.createObjectURL(R),F=document.createElement("a");F.href=q,F.download=`snippet-${A.id.substring(0,6)}.${A.data.language||"txt"}`,F.click(),URL.revokeObjectURL(q)}else A.type==="source"&&(S=A.data)!=null&&S.url&&window.open(A.data.url,"_blank","noopener,noreferrer")};return(A,S)=>{const B=de,R=Gl;return b(),k("div",nv,[w("div",iv,[w("div",ov,[v(B,{name:"hugeicons:attachment",class:"size-4"}),S[6]||(S[6]=w("h3",{class:"text-sm font-semibold text-foreground"},"Attachments",-1)),w("p",av,M(m(a).length),1)]),v(m(ve),{size:"iconMd",variant:"ghost",onClick:S[0]||(S[0]=q=>n("close"))},{default:T(()=>[v(B,{name:"lucide:x",class:"size-4"})]),_:1})]),w("div",rv,[v(m(Ul),{modelValue:c.value,"onUpdate:modelValue":S[1]||(S[1]=q=>c.value=q),class:"flex-1 min-h-0"},{default:T(()=>[v(m(Hl),{class:"h-8"},{default:T(()=>[v(m(ds),{value:"all",class:"text-xs cursor-pointer"},{default:T(()=>S[7]||(S[7]=[N("All")])),_:1}),v(m(ds),{value:"files",class:"text-xs cursor-pointer"},{default:T(()=>S[8]||(S[8]=[N("Files")])),_:1}),v(m(ds),{value:"code",class:"text-xs cursor-pointer"},{default:T(()=>S[9]||(S[9]=[N("Code")])),_:1}),v(m(ds),{value:"links",class:"text-xs cursor-pointer"},{default:T(()=>S[10]||(S[10]=[N("Links")])),_:1})]),_:1}),w("div",lv,[x.value.length===0?(b(),k("div",uv,[v(R,{title:"No items found",desc:"Add an attachment to see it here."})])):G("",!0),(b(),k(re,null,Se(["all","files","code","links"],q=>v(m(Jl),{key:q,value:q,class:"h-full mt-0 focus-visible:ring-0"},{default:T(()=>[w("div",cv,[(b(!0),k(re,null,Se(p.value[q],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=>D(F)},[v(B,{name:F.icon,class:"size-5!"},null,8,["name"]),w("div",fv,[w("p",hv,M(F.name),1),w("p",{class:ae(["text-xxs text-muted-foreground truncate",F.type==="source"?"text-primary/70":""])},M(F.description),3)]),v(B,{name:"hugeicons:view",class:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground"})],8,dv))),128))])]),_:2},1032,["value"])),64))])]),_:1},8,["modelValue"])]),v(m(Kl),{open:g.value,"onUpdate:open":S[5]||(S[5]=q=>g.value=q)},{default:T(()=>[v(m(Wl),{class:"max-w-[50vw]! w-full max-h-[70vh] p-0 flex flex-col overflow-hidden"},{default:T(()=>{var q,F,te;return[v(m(Yl),{class:"p-4 pb-2 text-left"},{default:T(()=>{var C;return[w("div",pv,[v(B,{name:((C=y.value)==null?void 0:C.icon)||"hugeicons:file-02",class:"size-5!"},null,8,["name"]),w("div",mv,[v(m(Xl),{class:"truncate flex items-center gap-2"},{default:T(()=>{var I,z,Y,X,U,Q;return[N(M(((I=y.value)==null?void 0:I.name)||"Attachment Preview")+" ",1),w("div",gv,[v(m(Te),{variant:"secondary",class:"h-5 px-1.5"},{default:T(()=>[N(M(_.value),1)]),_:1}),((z=y.value)==null?void 0:z.type)==="file"?(b(),H(m(Te),{key:0,variant:"outline",class:"h-5 px-1.5"},{default:T(()=>[N(M(y.value.data.format||"file"),1)]),_:1})):G("",!0),((Y=y.value)==null?void 0:Y.type)==="file"?(b(),H(m(Te),{key:1,variant:"outline",class:"h-5 px-1.5"},{default:T(()=>[N(M(P(y.value.data.fileSize)),1)]),_:1})):G("",!0),((X=y.value)==null?void 0:X.type)==="code"?(b(),H(m(Te),{key:2,variant:"outline",class:"h-5 px-1.5"},{default:T(()=>[N(M(y.value.data.language||"text"),1)]),_:1})):G("",!0),((U=y.value)==null?void 0:U.type)==="source"&&((Q=y.value.data)!=null&&Q.mediaType)?(b(),H(m(Te),{key:3,variant:"outline",class:"h-5 px-1.5"},{default:T(()=>[N(M(y.value.data.mediaType),1)]),_:1})):G("",!0)])]}),_:1}),v(m(Ql),{class:"text-sm"},{default:T(()=>S[11]||(S[11]=[N(" Preview attachment details and content. ")])),_:1})])])]}),_:1}),w("div",vv,[((q=y.value)==null?void 0:q.type)==="file"?(b(),k("div",yv,[y.value.data.encoding==="utf8"?(b(),k("div",xv,M(y.value.data.content),1)):(b(),k("div",bv,[v(B,{name:"hugeicons:file-unknown",class:"size-12 text-muted-foreground/50 mb-3"}),S[12]||(S[12]=w("p",{class:"text-foreground text-sm font-medium"}," Binary file format ",-1)),S[13]||(S[13]=w("p",{class:"text-xs text-muted-foreground text-center mt-1"}," Preview is not available for this file type. Download to view. ",-1))]))])):((F=y.value)==null?void 0:F.type)==="code"?(b(),k("div",wv,[v(m(Is),{id:y.value.data.id,code:y.value.data.code,language:y.value.data.language,"is-streaming":!1,"is-block-streaming":!1},null,8,["id","code","language"])])):((te=y.value)==null?void 0:te.type)==="source"?(b(),k("div",_v,[w("div",null,[S[14]||(S[14]=w("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," Title ",-1)),w("p",Sv,M(y.value.data.title||y.value.data.filename||"Untitled Resource"),1)]),w("div",null,[S[15]||(S[15]=w("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," URL ",-1)),y.value.data.url?(b(),k("p",Tv,[w("a",{href:y.value.data.url,target:"_blank",class:"hover:underline"},M(y.value.data.url),9,kv),v(B,{name:"hugeicons:link-square-02",class:"size-3 shrink-0"})])):(b(),k("p",Av," No URL provided. "))])])):G("",!0)]),v(m(Zl),{class:"p-4 flex justify-end pt-0"},{default:T(()=>{var C;return[v(m(ve),{variant:"outline",size:"sm",onClick:S[2]||(S[2]=I=>g.value=!1)},{default:T(()=>S[16]||(S[16]=[N(" Close ")])),_:1}),w("div",Cv,[((C=y.value)==null?void 0:C.type)==="source"?(b(),H(m(ve),{key:0,size:"sm",disabled:!L.value,onClick:S[3]||(S[3]=I=>E(y.value))},{default:T(()=>[S[17]||(S[17]=N(" Open Link ")),v(B,{name:"hugeicons:link-square-02",class:"size-3 ml-2"})]),_:1},8,["disabled"])):(b(),H(m(ve),{key:1,size:"sm",onClick:S[4]||(S[4]=I=>E(y.value))},{default:T(()=>[S[18]||(S[18]=N(" Download ")),v(B,{name:"hugeicons:download-04",class:"size-3"})]),_:1}))])]}),_:1})]}),_:1})]),_:1},8,["open"])])}}}),Ln=[{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."}],bl=t=>{const e=new Set(t);return Ln.filter(s=>e.has(s.id))},Mv={class:"w-full relative"},Dv={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"},Vv=["id","aria-selected","onMouseenter","onClick"],Ev={class:"min-w-0 flex-1"},Lv={class:"flex items-center gap-2"},Rv={class:"text-xs font-medium text-foreground"},$v={class:"mt-1 block text-xs text-muted-foreground"},Iv={key:0,class:"rounded-xl px-3 py-5 text-center text-[11px] text-muted-foreground"},Bv={class:"dark:bg-sidebar rounded-3xl border shadow-xs p-3 px-2 pb-2 flex flex-col gap-1 relative z-40"},Ov={key:0,class:"flex flex-wrap gap-2 pb-1"},Fv=["aria-label","onClick"],jv={class:"flex items-center justify-between px-1"},Nv={class:"flex items-center gap-1"},zv={class:"relative w-fit"},qv={class:"flex items-center gap-3"},ys="agent-command-listbox",ia="agent-command-status",Uv=W({__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:s}){const n=t,i=s,a=K(n.modelValue),o=K(0),r=K("");be(()=>n.modelValue,C=>{a.value=C});const l=K(null),u=V({get:()=>n.selectedCommandOptions,set:C=>i("update:selectedCommandOptions",C)}),c=V(()=>bl(u.value)),f=()=>{const C=l.value;if(!C)return null;if(C instanceof HTMLTextAreaElement)return C;if(typeof C=="object"&&"$el"in C&&C.$el instanceof HTMLElement){const I=C.$el;return I instanceof HTMLTextAreaElement?I:I.querySelector("textarea")}return C instanceof HTMLElement?C.querySelector("textarea"):null},d=()=>{const C=f();C==null||C.focus()};e({focusInput:d});const h=V(()=>{const C=f(),I=(C==null?void 0:C.selectionStart)??a.value.length;return a.value.slice(0,I).match(/(?:^|\s)\/([a-z0-9_-]*)$/i)}),p=V(()=>{var C,I;return((I=(C=h.value)==null?void 0:C[1])==null?void 0:I.toLowerCase())||""}),x=V(()=>h.value?h.value[0]:""),g=V(()=>{const C=p.value.trim();return h.value?C?Ln.filter(I=>[I.label,I.toolName,I.description,I.category].join(" ").toLowerCase().includes(C)):Ln:[]}),y=V(()=>!!h.value&&x.value!==r.value),P=V(()=>g.value[o.value]||null),_=V(()=>y.value?g.value.length===0?"No matching agent tools. Keep typing to filter or press Escape to close.":`${g.value.length} agent tools available. Use arrow keys to move, Enter or Tab to insert, and Escape to close.`:"");be(g,C=>{if(C.length===0){o.value=0;return}o.value>=C.length&&(o.value=0)}),be(x,C=>{C||(r.value="")});const L=C=>{const I=C.target.value;a.value=I,r.value&&r.value!==x.value&&(r.value=""),i("update:modelValue",I)},D=async()=>{r.value=x.value,o.value=0,await Be(),d()},E=C=>{u.value.includes(C.id)||(u.value=[...u.value,C.id])},A=C=>{u.value=u.value.filter(I=>I!==C)},S=async C=>{const I=f(),z=(I==null?void 0:I.selectionStart)??a.value.length,Y=a.value.slice(0,z),X=a.value.slice(z);if(!Y.match(/(?:^|\s)\/([a-z0-9_-]*)$/i))return;const Q=Y.lastIndexOf("/"),Z=a.value.slice(0,Q);let J=`${Z}${X}`;Z.trim()||(J=J.trimStart());const ge=Math.min(Z.length,J.length);a.value=J,i("update:modelValue",J),E(C),o.value=0,r.value="",await Be();const ue=f();ue==null||ue.focus(),ue==null||ue.setSelectionRange(ge,ge)},B=C=>{if(y.value){if(C.key==="Escape"){C.preventDefault(),D();return}if(g.value.length>0){if(C.key==="ArrowDown"){C.preventDefault(),o.value=(o.value+1)%g.value.length;return}if(C.key==="ArrowUp"){C.preventDefault(),o.value=(o.value-1+g.value.length)%g.value.length;return}if(C.key==="Home"){C.preventDefault(),o.value=0;return}if(C.key==="End"){C.preventDefault(),o.value=g.value.length-1;return}if(C.key==="Enter"||C.key==="Tab"){C.preventDefault();const I=P.value;I&&S(I);return}}}i("keydown",C)},R=C=>{C==null||C.preventDefault(),i("submit",typeof C=="object"&&C!==null?C:void 0)},q=C=>{if(n.isLoading){C==null||C.preventDefault(),i("stop");return}R(C)},F=V({get:()=>n.provider,set:C=>i("update:provider",C)}),te=V({get:()=>n.model,set:C=>i("update:model",C)});return(C,I)=>{const z=de,Y=Pu,X=ve;return b(),k("div",Mv,[y.value?(b(),k("div",Dv,[I[4]||(I[4]=w("div",{class:"border-b border-border/50 px-3 py-2"},[w("p",{class:"text-xs font-medium"},"Agent tools"),w("p",{class:"mt-1 text-xs text-muted-foreground"},[N(" Type after "),w("span",{class:"font-medium text-foreground"},"/"),N(" to filter. ")])],-1)),w("div",{id:ys,role:"listbox","aria-label":"Agent tools",class:"max-h-[260px] overflow-y-auto px-2 py-2"},[(b(!0),k(re,null,Se(g.value,(U,Q)=>(b(),k("button",{id:`${ys}-${U.id}`,key:U.id,type:"button",role:"option","aria-selected":Q===o.value,class:ae(["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=>S(U)},[v(z,{name:U.icon,class:"mt-0.5 size-[18px] shrink-0"},null,8,["name"]),w("span",Ev,[w("span",Lv,[w("span",Rv,M(U.label),1)]),w("span",$v,M(U.description),1)]),w("div",null,[c.value.find(Z=>Z.id===U.id)?(b(),H(z,{key:0,name:"hugeicons:checkmark-circle-01",class:"size-4 mt-0.5 text-muted-foreground cursor-pointer"})):G("",!0)])],42,Vv))),128)),g.value.length===0?(b(),k("div",Iv,I[3]||(I[3]=[N(" No matching tools. Try "),w("span",{class:"font-medium text-foreground"},"/render",-1),N(" or "),w("span",{class:"font-medium text-foreground"},"/describe",-1),N(". ")]))):G("",!0)])])):G("",!0),w("div",Bv,[c.value.length>0?(b(),k("div",Ov,[(b(!0),k(re,null,Se(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"},[v(z,{name:U.icon,class:"size-3.5 text-muted-foreground"},null,8,["name"]),w("span",null,M(U.label),1),w("button",{type:"button",class:"inline-flex size-4 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-background hover:text-foreground","aria-label":`Remove ${U.label}`,onClick:Q=>A(U.id)},[v(z,{name:"lucide:x",class:"size-3"})],8,Fv)]))),128))])):G("",!0),v(Y,{ref_key:"textareaRef",ref:l,modelValue:a.value,"onUpdate:modelValue":I[0]||(I[0]=U=>a.value=U),disabled:!C.hasApiKey||C.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":y.value?ys:void 0,"aria-describedby":ia,"aria-activedescendant":P.value?`${ys}-${P.value.id}`:void 0,"aria-expanded":y.value,onInput:L,onKeydown:B},null,8,["modelValue","disabled","aria-controls","aria-activedescendant","aria-expanded"]),w("p",{id:ia,class:"sr-only","aria-live":"polite"},M(_.value),1),w("div",jv,[w("div",Nv,[w("div",zv,[v(eu,{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"])])]),w("div",qv,[v(X,{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()&&!C.isLoading||!C.hasApiKey,onClick:q},{default:T(()=>[v(z,{name:C.isLoading?"lucide:square":"lucide:arrow-up",class:ae(["size-4 stroke-[2]",C.isLoading?"fill-current":""])},null,8,["name","class"])]),_:1},8,["disabled"])])])])])}}}),Hv={class:"flex items-center justify-between px-4 mt-2 text-[12px] text-muted-foreground relative z-30"},Gv={class:"flex items-center gap-4"},Kv={class:"flex items-center gap-1"},Wv={class:"flex items-center gap-1.5"},Yv={class:"flex items-center gap-1.5"},Xv=W({__name:"AgentChatStatusBar",props:{modelLabel:{},isLoading:{type:Boolean},showReasoning:{type:Boolean}},emits:["update:showReasoning"],setup(t,{emit:e}){const s=e;return(n,i)=>{const a=de,o=tu;return b(),k("div",Hv,[w("div",Gv,[w("div",Kv,[v(a,{name:"hugeicons:ai-brain-05",class:"size-3.5 stroke-[1.5]"}),i[1]||(i[1]=w("span",null,"Reasoning",-1)),v(o,{"model-value":n.showReasoning,"aria-label":"Toggle reasoning",class:"cursor-pointer","onUpdate:modelValue":i[0]||(i[0]=r=>s("update:showReasoning",!!r))},null,8,["model-value"])]),w("div",Wv,[v(a,{name:"hugeicons:robotic",class:"size-3.5 stroke-[1.5]"}),w("span",null,M(n.modelLabel),1)])]),w("div",Yv,[v(a,{name:n.isLoading?"hugeicons:loading-03":"hugeicons:checkmark-circle-01",class:ae(["size-3.5 stroke-[1.5]",n.isLoading?"animate-spin":""])},null,8,["name","class"]),w("span",null,M(n.isLoading?"Streaming":"Ready"),1)])])}}}),Qv={class:"w-full py-2"},Zv={class:"relative w-full max-w-3xl mx-auto flex flex-col px-4"},Jv={key:0,class:"absolute -top-12 left-1/2 transform -translate-x-1/2 z-20"},ey=W({__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:s}){const n=t,i=s,a=V({get:()=>n.modelValue,set:d=>i("update:modelValue",d)}),o=V({get:()=>n.provider,set:d=>i("update:provider",d)}),r=V({get:()=>n.model,set:d=>i("update:model",d)}),l=V({get:()=>n.selectedCommandOptions,set:d=>i("update:selectedCommandOptions",d)}),u=V(()=>`${n.provider} / ${n.model}`),c=K(null);return e({focusInput:()=>{var d;(d=c.value)==null||d.focusInput()}}),(d,h)=>(b(),k("footer",Qv,[w("div",Zv,[v(es,{"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:T(()=>[d.showScrollButton?(b(),k("div",Jv,[w("button",{class:"flex items-center justify-center size-8 bg-background border border-border rounded-full shadow-sm text-muted-foreground hover:bg-muted/50 cursor-pointer outline-none transition-colors",onClick:h[0]||(h[0]=p=>i("scrollToBottom"))},[v(m(de),{name:"lucide:arrow-down",class:"size-4 shrink-0"})])])):G("",!0)]),_:1}),v(Uv,{ref_key:"inputRef",ref:c,modelValue:a.value,"onUpdate:modelValue":h[1]||(h[1]=p=>a.value=p),provider:o.value,"onUpdate:provider":h[2]||(h[2]=p=>o.value=p),model:r.value,"onUpdate:model":h[3]||(h[3]=p=>r.value=p),"selected-command-options":l.value,"onUpdate:selectedCommandOptions":h[4]||(h[4]=p=>l.value=p),"is-loading":d.isLoading,"has-api-key":d.hasApiKey,onSubmit:h[5]||(h[5]=p=>i("submit",p)),onStop:h[6]||(h[6]=p=>i("stop")),onKeydown:h[7]||(h[7]=p=>i("keydown",p))},null,8,["modelValue","provider","model","selected-command-options","is-loading","has-api-key"]),v(Xv,{"model-label":u.value,"is-loading":d.isLoading,"show-reasoning":d.showReasoning,"onUpdate:showReasoning":h[8]||(h[8]=p=>i("update:showReasoning",p))},null,8,["model-label","is-loading","show-reasoning"])])]))}}),ty={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},sy={class:"flex flex-wrap items-center gap-2"},ny={key:0,class:"rounded-2xl border bg-background/80 px-3 py-3 text-sm"},iy={key:1,class:"space-y-3"},oy={class:"flex flex-wrap items-center gap-2"},ay={key:0,class:"text-xs text-muted-foreground"},ry={class:"mt-3 text-sm leading-6"},ly={key:0,class:"mt-3 rounded-xl border bg-muted/30"},uy={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},cy=W({__name:"AgentAnomalyBlock",props:{data:{}},setup(t){const e={high:"destructive",medium:"secondary",low:"outline"},s=n=>e[n];return(n,i)=>{const a=Te;return b(),k("div",ty,[w("div",sy,[v(a,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(" Clean Score "+M(n.data.cleanScore)+"/100 ",1)]),_:1}),v(a,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(M(n.data.scannedRows)+" rows scanned ",1)]),_:1})]),n.data.issues.length===0?(b(),k("div",ny," No anomalies were detected in the requested checks. ")):(b(),k("div",iy,[(b(!0),k(re,null,Se(n.data.issues,(o,r)=>(b(),k("div",{key:`${o.type}-${o.column||r}`,class:"rounded-2xl border bg-background/90 p-3"},[w("div",oy,[v(a,{variant:s(o.severity),class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(M(o.severity.toUpperCase()),1)]),_:2},1032,["variant"]),v(a,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(M(o.type),1)]),_:2},1024),o.column?(b(),k("span",ay,M(o.column),1)):G("",!0)]),w("p",ry,M(o.description),1),o.fixSql?(b(),k("details",ly,[i[0]||(i[0]=w("summary",{class:"cursor-pointer px-3 py-2 text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground"}," Fix suggestion ",-1)),w("pre",uy,M(o.fixSql),1)])):G("",!0)]))),128))]))])}}}),dy={class:"space-y-2"},fy={class:"flex flex-wrap justify-start gap-2"},hy=W({__name:"AgentApprovalBlock",props:{toolName:{},input:{},approvalId:{}},emits:["approve","deny"],setup(t,{emit:e}){const s=t,n=e,i=V(()=>"sql"in s.input&&typeof s.input.sql=="string"?s.input.sql:JSON.stringify(s.input,null,2));return(a,o)=>{const r=Is,l=ve;return b(),k("div",dy,[o[4]||(o[4]=w("div",{class:""},[w("div",{class:"text-xs font-medium"},"Approval Required"),w("p",{class:"text-xs text-muted-foreground"}," *This action needs confirmation before execution. ")],-1)),v(r,{id:s.approvalId,code:m(i)||"",language:"sql"},null,8,["id","code"]),w("div",fy,[v(l,{variant:"outline",size:"xs",class:"rounded-xl font-normal",onClick:o[0]||(o[0]=u=>n("deny",a.approvalId))},{default:T(()=>o[2]||(o[2]=[N(" Cancel ")])),_:1}),v(l,{size:"xs",class:"rounded-xl font-normal",onClick:o[1]||(o[1]=u=>n("approve",a.approvalId))},{default:T(()=>o[3]||(o[3]=[N(" Confirm ")])),_:1})])])}}}),py={class:"flex items-start justify-between gap-3"},my={class:"space-y-2 min-w-0"},gy={class:"flex items-center gap-2"},vy={class:"text-sm font-medium"},yy={class:"text-sm leading-6"},xy={key:0,class:"space-y-2"},by={class:"flex flex-wrap gap-1"},rn=W({__name:"AgentDescribeBlock",props:{data:{}},setup(t){const e=t,s=V(()=>[["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:""}))),n=V(()=>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=V(()=>{const u=48+n.value.length*32;return Math.max(120,Math.min(u,360))});return(a,o)=>{const r=de,l=Te;return b(),k(re,null,[w("div",py,[w("div",my,[w("div",gy,[v(r,{name:"hugeicons:grid-table",class:"size-4 text-primary"}),w("div",vy,M(a.data.tableName),1)]),w("p",yy,M(a.data.summary),1)]),v(l,{variant:"outline",class:"shrink-0"},{default:T(()=>[N(M(a.data.columns.length)+" columns ",1)]),_:1})]),w("div",{class:"overflow-hidden rounded-lg border",style:Et({height:`${m(i)}px`})},[v(Yn,{columns:m(s),data:m(n),"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",xy,[o[0]||(o[0]=w("div",{class:"text-[11px] font-medium text-muted-foreground"}," Related Tables ",-1)),w("div",by,[(b(!0),k(re,null,Se(a.data.relatedTables,u=>(b(),H(l,{key:u,variant:"outline",class:"text-xxs"},{default:T(()=>[N(M(u),1)]),_:2},1024))),128))])])):G("",!0)],64)}}});function wy(t){return t.nodes.map(e=>({id:e.id,schema:e.schemaName,table:e.tableName,rows:0,type:"table",comment:null,columns:e.columns.map((s,n)=>({name:s.name,ordinal_position:n+1,short_type_name:s.type,type:s.type,character_maximum_length:null,precision:null,nullable:!s.isPrimaryKey,default:null,collation:null,comment:null})),foreign_keys:t.edges.filter(s=>s.source===e.id).map(s=>{const[n,i]=s.target.split(".");return{foreign_key_name:s.id,column:s.sourceColumn,reference_schema:n,reference_table:i,reference_column:s.targetColumn,fk_def:""}}),primary_keys:e.columns.filter(s=>s.isPrimaryKey).map(s=>({column:s.name,pk_def:""})),indexes:[]}))}const _y={class:"space-y-2"},Sy={class:"flex items-center justify-between"},Ty={class:"flex items-center gap-2"},ky={key:0,class:"fixed inset-0 z-50 bg-background flex flex-col"},Ay={class:"flex items-center justify-between px-4 py-2 border-b border-border"},Cy={class:"flex items-center gap-2"},Py={class:"flex-1 relative"},My=W({__name:"AgentErdBlock",props:{data:{}},setup(t){const e=t,s=V(()=>wy(e.data)),n=V(()=>Vu(s.value)),i=V(()=>{const u={};for(const c of n.value.nodes)u[c.id]=c.position;return u}),a=V(()=>{const c=Math.max(...e.data.nodes.map(f=>f.columns.length),3)*su+nu+120;return Math.max(300,Math.min(c,500))}),o=K(!1),r=K(!1),l=()=>{o.value=!o.value,o.value||(r.value=!1)};return(u,c)=>{const f=de,d=Te,h=ve;return b(),k("div",_y,[w("div",Sy,[w("div",Ty,[v(f,{name:"hugeicons:hierarchy-square-01",class:"size-4 text-primary"}),c[1]||(c[1]=w("span",{class:"text-sm font-medium"}," Entity Relationship Diagram ",-1)),v(d,{variant:"outline",class:"text-xs"},{default:T(()=>[N(M(u.data.nodes.length)+" tables ",1)]),_:1})]),v(h,{variant:"ghost",size:"iconSm",onClick:l},{default:T(()=>[v(f,{name:o.value?"hugeicons:arrow-shrink-02":"hugeicons:arrow-expand-02"},null,8,["name"])]),_:1})]),o.value?G("",!0):(b(),k("div",{key:0,class:"overflow-hidden rounded-lg border border-border/70",style:Et({height:`${a.value}px`})},[v(m($u),{class:"erd-flow w-full h-full","pan-on-scroll":!0,"pan-on-scroll-speed":1.2,nodes:n.value.nodes,edges:n.value.edges,"default-viewport":{zoom:m(au),x:40,y:40},"min-zoom":m(ou),"max-zoom":m(iu),"fit-view-on-init":""},{"edge-custom":T(p=>[v(Ru,Ci(Pi(p)),null,16)]),"node-value":T(p=>[v(Lu,Ci(Pi(p)),null,16)]),default:T(()=>[v(m(Eu),{size:2,gap:30})]),_:1},8,["nodes","edges","default-viewport","min-zoom","max-zoom"])],4)),(b(),H(ya,{to:"body"},[o.value?(b(),k("div",ky,[w("div",Ay,[w("div",Cy,[v(f,{name:"hugeicons:hierarchy-square-01",class:"size-4 text-primary"}),c[2]||(c[2]=w("span",{class:"text-sm font-medium"}," Entity Relationship Diagram ",-1)),v(d,{variant:"outline",class:"text-xs"},{default:T(()=>[N(M(u.data.nodes.length)+" tables ",1)]),_:1})]),v(h,{variant:"ghost",size:"iconSm",onClick:l},{default:T(()=>[v(f,{name:"hugeicons:arrow-shrink-02"})]),_:1})]),w("div",Py,[v(Iu,{nodes:n.value.nodes,edges:n.value.edges,matrixTablePosition:i.value,tables:s.value,isShowFilter:r.value,"onUpdate:isShowFilter":c[0]||(c[0]=p=>r.value=p)},null,8,["nodes","edges","matrixTablePosition","tables","isShowFilter"])])])):G("",!0)]))])}}}),Dy={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},Vy={class:"flex flex-wrap items-center gap-2"},Ey={class:"text-sm leading-6 text-foreground/90"},Ly={key:0,class:"space-y-2"},Ry={class:"space-y-2 text-sm leading-6"},$y={class:"rounded-2xl border bg-background/90"},Iy={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},By=W({__name:"AgentExplainBlock",props:{data:{}},setup(t){return(e,s)=>{const n=Te;return b(),k("div",Dy,[w("div",Vy,[v(n,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(M(e.data.slowestNode),1)]),_:1}),v(n,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(" Cost "+M(e.data.estimatedCost.toFixed(2)),1)]),_:1})]),w("p",Ey,M(e.data.summary),1),e.data.suggestions.length>0?(b(),k("div",Ly,[s[0]||(s[0]=w("div",{class:"text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground"}," Suggestions ",-1)),w("ul",Ry,[(b(!0),k(re,null,Se(e.data.suggestions,i=>(b(),k("li",{key:i,class:"rounded-2xl border bg-background/80 px-3 py-2"},M(i),1))),128))])])):G("",!0),w("details",$y,[s[1]||(s[1]=w("summary",{class:"cursor-pointer px-3 py-2 text-sm font-medium"}," Raw EXPLAIN output ",-1)),w("pre",Iy,M(e.data.rawPlan),1)])])}}}),Oy=["disabled"],Fy={class:"flex items-center min-w-0 gap-2 flex-1"},jy={class:"flex flex-col"},Ny={class:"truncate text-sm leading-4 font-normal text-foreground"},zy={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},qy={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},oa=W({__name:"AgentExportFileBlock",props:{data:{}},setup(t){const e=t,s=ha("activeExportPreview"),{downloadFile:n}=xi(),i=()=>{s&&(s.value=e.data)};V(()=>{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=V(()=>{const r=e.data.fileSize;return ba(r)});V(()=>e.data.error?e.data.error:"Preview available before download");const o=async()=>{await n(e.data)};return(r,l)=>{const u=de,c=ve;return b(),k("button",{type:"button",class:ae(["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},[w("div",Fy,[v(u,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),w("div",jy,[w("h3",Ny,M(e.data.filename),1),e.data.preview.truncated?(b(),k("p",zy," First "+M(e.data.preview.rows.length)+" rows ",1)):(b(),k("p",qy," size: "+M(a.value)+" • type: "+M(e.data.format),1))])]),v(c,{disabled:!!e.data.error,size:"xs",variant:"outline"},{default:T(()=>[l[0]||(l[0]=N(" view ")),v(u,{name:"lucide:eye",class:"size-3"})]),_:1},8,["disabled"]),v(c,{onClick:qn(o,["stop"]),disabled:!!e.data.error,size:"xs",variant:"outline"},{default:T(()=>[l[1]||(l[1]=N(" Download ")),v(u,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"])],10,Oy)}}}),Uy={class:"overflow-hidden mb-1"},Hy={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},Gy={class:"my-1"},wi=W({__name:"AgentToolSqlPreview",props:{id:{},sql:{},label:{default:"View SQL"},defaultOpen:{type:Boolean,default:!1}},setup(t){const e=t,s=K(!1);function n(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=de,u=Is;return b(),k("div",Uy,[w("button",{type:"button",class:"flex cursor-pointer items-center justify-start gap-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",onClick:r[0]||(r[0]=c=>s.value=!m(s))},[N(M(e.label)+" ",1),v(l,{name:"lucide:chevron-down",class:ae(["ml-auto size-4 transition-transform duration-300",{"rotate-180":m(s)}])},null,8,["class"])]),v(es,{onEnter:n,onAfterEnter:i,onLeave:a},{default:T(()=>[m(s)?(b(),k("div",Hy,[w("div",Gy,[v(u,{id:e.id,code:e.sql,language:"sql"},null,8,["id","code"])])])):G("",!0)]),_:1})])}}}),Ky={class:"space-y-3 rounded-xl border border-border/70 bg-muted/20 p-4"},Wy={class:"flex items-start justify-between gap-3"},Yy={class:"text-sm leading-6 text-foreground/90"},Xy=W({__name:"AgentQueryBlock",props:{data:{}},setup(t){const e=t,s=V(()=>`agent-query-${e.data.sql}`);return(n,i)=>{const a=Te;return b(),k("div",Ky,[w("div",Wy,[w("p",Yy,M(n.data.explanation),1),v(a,{variant:n.data.isMutation?"destructive":"secondary",class:"shrink-0 text-xxs"},{default:T(()=>[N(M(n.data.isMutation?"MUTATION":"READ ONLY"),1)]),_:1},8,["variant"])]),v(wi,{id:m(s),sql:n.data.sql,label:n.data.isMutation?"Review SQL before approval":"View SQL","default-open":n.data.isMutation},null,8,["id","sql","label","default-open"])])}}}),Qy={class:"overflow-hidden"},Zy={key:1,class:""},Jy={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},e0={class:"mt-2 border-l-2 border-border pl-3 py-1 text-foreground/80 opacity-70 chat-text"},t0=W({__name:"AgentReasoningBlock",props:{content:{},isStreaming:{type:Boolean}},setup(t){const e=t,s=Yt(e,"isStreaming"),n=Kn(Yt(e,"content"),s),i=K(!1);be(()=>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=de;return b(),k("div",Qy,[w("button",{type:"button",class:"flex cursor-pointer items-center justify-start gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",onClick:u[0]||(u[0]=f=>i.value=!m(i))},[v(c,{name:"hugeicons:ai-brain-05",class:ae(["size-3.5! shrink-0",{"animate-pulse text-primary":l.isStreaming}])},null,8,["class"]),l.isStreaming?(b(),H(yi,{key:0,duration:1},{default:T(()=>u[1]||(u[1]=[N("Reasoning")])),_:1})):(b(),k("span",Zy," Reasoning ")),v(c,{name:"lucide:chevron-down",class:ae(["ml-auto size-4 transition-transform duration-300",{"rotate-180":m(i)}])},null,8,["class"])]),v(es,{onEnter:a,onAfterEnter:o,onLeave:r},{default:T(()=>[m(i)?(b(),k("div",Jy,[w("div",e0,[v(wa,{content:m(n),"is-streaming":l.isStreaming,"is-block-streaming":l.isStreaming,"is-user-message":!1},null,8,["content","is-streaming","is-block-streaming"])])])):G("",!0)]),_:1})])}}}),s0={key:1,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},n0={class:"text-xs text-muted-foreground mt-1"},i0=W({__name:"AgentTableBlock",props:{data:{}},setup(t){const e=t,s=V(()=>(e.data.columns??[]).map(o=>({originalName:o.name,queryFieldName:o.name,aliasFieldName:o.name,isPrimaryKey:!1,isForeignKey:!1,canMutate:!1,type:o.type,tableName:""}))),n=V(()=>e.data.rows??[]),i=V(()=>`agent-render-table-${e.data.sql||""}`),a=V(()=>{const c=48+n.value.length*32;return Math.max(120,Math.min(c,420))});return(o,r)=>(b(),k(re,null,[o.data.sql?(b(),H(wi,{key:0,id:m(i),sql:o.data.sql,label:"View SQL"},null,8,["id","sql"])):G("",!0),o.data.truncated?(b(),k("div",s0," Showing only the first "+M(o.data.rowCount)+" rows. ",1)):G("",!0),w("div",{class:"overflow-hidden rounded-lg border max-h-96",style:Et({height:`${m(a)}px`})},[v(Yn,{columns:m(s),data:m(n),"column-key-by":"field","has-hash-index":!1,class:"h-full w-full"},null,8,["columns","data"])],4),w("div",n0," Showing "+M(m(n).length)+" row"+M(m(n).length===1?"":"s"),1)],64))}}),o0={class:"flex flex-wrap items-center justify-between gap-2"},a0={class:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground"},r0={class:"text-xs text-muted-foreground"},l0={key:0,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},u0={class:"overflow-hidden rounded-xl border bg-background/90 p-2 pt-8"},c0={class:"agent-chart-container"},d0=W({__name:"AgentVisualizeTableBlock",props:{data:{}},setup(t){Da([cc,dc,fc,Xc,sd,hc,pc,mc]);const e=t,s=V(()=>`agent-visualize-table-${e.data.chartType}-${e.data.sql}`),n=V(()=>e.data.chartType.replace("_"," ")),i=V(()=>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=Te;return b(),k(re,null,[w("div",o0,[w("div",a0,[v(r,{variant:"secondary",class:"uppercase tracking-[0.16em]"},{default:T(()=>[N(M(m(n)),1)]),_:1}),a.data.xField?(b(),H(r,{key:0,variant:"outline"},{default:T(()=>[N(" X: "+M(a.data.xField),1)]),_:1})):G("",!0),a.data.yField?(b(),H(r,{key:1,variant:"outline"},{default:T(()=>[N(" Y: "+M(a.data.yField),1)]),_:1})):G("",!0)]),w("div",r0,M(a.data.rowCount)+" point"+M(a.data.rowCount===1?"":"s"),1)]),v(wi,{id:m(s),sql:a.data.sql,label:"View SQL"},null,8,["id","sql"]),a.data.truncated?(b(),k("div",l0," Showing only the first "+M(a.data.rowCount)+" points. ",1)):G("",!0),w("div",u0,[w("div",c0,[v(m(gc),{option:m(i),autoresize:"",class:"agent-chart"},null,8,["option"])])])],64)}}}),f0=xa(d0,[["__scopeId","data-v-8ea150a2"]]),h0={class:"min-w-0 flex-1 overflow-hidden"},p0={class:"flex items-center gap-1 justify-center"},m0=W({__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 s=t,n=e,{handleCopyWithKey:i,isCopied:a,getCopyIcon:o,getCopyIconClass:r,getCopyTooltip:l}=Wn(),u=V(()=>s.message.role==="user"),c=d=>{u.value||!s.registerMessageElement||s.registerMessageElement(s.message.id,d)},f=V(()=>(s.message.blocks??[]).map(d=>d.kind==="text"||d.kind==="markdown"?d.content:d.kind==="code"||d.kind==="mermaid"?d.code:"").filter(Boolean).join(`
4
+ `,offset:0}),l?(i=c,this.lastUnstableCodeChunk=o):(this.lastStableGrammarState=u.grammarState,n.push(...c))}),this.tokensStable.push(...n),this.tokensUnstable=i,{recall:a,stable:n,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 bi(this.options);return e.lastUnstableCodeChunk=this.lastUnstableCodeChunk,e.tokensUnstable=this.tokensUnstable,e.tokensStable=this.tokensStable,e.lastStableGrammarState=this.lastStableGrammarState,e}}class qm extends TransformStream{constructor(s){const n=new bi(s),{allowRecalls:i=!1}=s;super({async transform(a,o){const{stable:r,unstable:l,recall:u}=await n.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}=n.close();if(!i)for(const r of o)a.enqueue(r)}});We(this,"tokenizer");We(this,"options");this.tokenizer=n,this.options=s}}function Um(t){return!t||Object(t)!==t}const Hm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function Gm(t=16,e=Hm){let s="",n=t;const i=e.length;for(;n--;)s+=e[Math.random()*i|0];return s}const on=new WeakMap;function Km(t){return Um(t)?t:(on.has(t)||on.set(t,Gm()),on.get(t))}const Wm=W({name:"ShikiStreamRenderer",props:{stream:{type:Object,required:!0}},emits:["stream-start","stream-end"],setup(t,{emit:e}){const s=Nl([]);let n=null;return be(()=>t.stream,i=>{s.length=0,n&&n.abort(),n=new AbortController;const a=n.signal;let o=!1;i.pipeTo(new WritableStream({write(r){a.aborted||(o||(o=!0,e("stream-start")),"recall"in r?s.length-=r.recall:s.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}),()=>Ct("pre",{class:"shiki shiki-stream"},Ct("code",Se(s,i=>Ct("span",{key:Km(i),style:i.htmlStyle||_u(i)},i.content))))}}),Ym=W({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 s=K(0);let n=null;const i=new ReadableStream({start(o){n=o}});jl(()=>{t.code.length>s.value&&(n==null||n.enqueue(t.code.slice(s.value)),s.value=t.code.length)});const a=i.pipeThrough(new qm({highlighter:t.highlighter,lang:t.lang,theme:t.theme,allowRecalls:!0}));return()=>Ct(Wm,{stream:a,onStreamStart:()=>e("stream-start"),onStreamEnd:()=>e("stream-end")})}});let zt=null,an=null;const Xm=new Set,Qm=[ke(()=>import("./B9xm8XSJ.js"),[],import.meta.url),ke(()=>import("./C2kyA9ZS.js").then(t=>t.f),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./C2kyA9ZS.js").then(t=>t.e),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./u7qmw6wa.js").then(t=>t.b),__vite__mapDeps([3,1,2,0]),import.meta.url),ke(()=>import("./C2kyA9ZS.js").then(t=>t.m),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./fuZLfV_i.js"),[],import.meta.url),ke(()=>import("./C2kyA9ZS.js").then(t=>t.x),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./C2kyA9ZS.js").then(t=>t.y),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./C2kyA9ZS.js").then(t=>t.h),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./C2kyA9ZS.js").then(t=>t.j),__vite__mapDeps([0,1,2]),import.meta.url),ke(()=>import("./DlfHMoPT.js"),[],import.meta.url)],Zm=async t=>{if(an||(an=Su({langs:Qm,themes:[ku,Au],engine:Tu()})),zt||(zt=await an),t!=null&&t.length){const e=zt.getLoadedLanguages();await Promise.all(t.filter(s=>!e.includes(s)).map(s=>zt.loadLanguage(s).catch(()=>{Xm.add(s),console.warn(`[useHighlighter] Unknown language: "${s}" — will render as plain text`)})))}return zt},Jm={class:"rounded-xl border overflow-hidden shadow-sm"},eg={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},tg={class:"text-xxs font-semibold capitalize text-muted-foreground select-none"},sg={class:"flex items-center gap-1 justify-center"},ng={class:"overflow-x-auto px-3 py-2 chat-code-text"},ig={key:1,class:"m-0"},Is=W({__name:"BlockMessageCode",props:{id:{},code:{},language:{},class:{},meta:{},isBlockStreaming:{type:Boolean},isStreaming:{type:Boolean}},setup(t){const e=va(),s=K(null),n=t;be(()=>n.language,async p=>{s.value=await Zm([p])},{immediate:!0});const{handleCopyWithKey:i,isCopied:a,getCopyIcon:o,getCopyIconClass:r,getCopyTooltip:l}=Wn(),u=V(()=>!!(n.isBlockStreaming&&n.isStreaming)),c=Kn(Yt(n,"code"),u),f=V(()=>{switch(n.language){case"markdown":return"markdown";case"csv":return"csv";case"json":return"json";case"javascript":return"js";case"typescript":return"ts";case"postgresql":case"mysql":case"oracle":case"sql":case"plsql":case"sqlpl":case"sqlserver":return"sql";default:return"text"}}),d=V(()=>c.value.trim().replace(/`+$/,"")),h=V(()=>`${f.value}-${e.value}`);return(p,x)=>{const g=de,y=ve;return b(),k("div",Jm,[w("div",eg,[w("span",tg,M(n.language),1),v(m(Es),null,{default:T(()=>[v(m(Ls),{"as-child":""},{default:T(()=>[v(y,{variant:"ghost",size:"xxs",class:"h-6!",onClick:x[0]||(x[0]=P=>m(i)(p.id,p.code))},{default:T(()=>[w("span",sg,[(b(),H(g,{key:m(a)(p.id)?"tick":"copy",name:m(o)(m(a)(p.id)),class:ae(["size-3.5",m(r)(m(a)(p.id))])},null,8,["name","class"])),m(a)(p.id)?(b(),k("span",{key:0,class:ae(["text-xxs font-medium leading-none",m(r)(m(a)(p.id))])}," Copied ",2)):G("",!0)])]),_:1})]),_:1}),v(m(Rs),null,{default:T(()=>[w("p",null,M(m(l)(m(a)(p.id))),1)]),_:1})]),_:1})]),w("div",ng,[s.value?(b(),H(m(Ym),{key:h.value,highlighter:s.value,code:d.value,lang:f.value,theme:m(e).value==="dark"?"catppuccin-mocha":"catppuccin-latte"},null,8,["highlighter","code","lang","theme"])):(b(),k("pre",ig,[w("code",null,M(d.value),1)]))])])}}}),og={class:"rounded-xl border overflow-hidden shadow-sm"},ag={class:"flex items-center justify-between px-3 py-1 border-b border-border/40 bg-muted/50"},rg={class:"flex items-center gap-0.5"},lg={class:"flex items-center gap-1 justify-center"},ug={key:0,class:"text-xxs font-medium leading-none"},cg={key:0,class:"overflow-auto bg-background max-h-[400px] p-4"},dg={key:0,class:"text-destructive text-sm p-2 bg-destructive/10 rounded"},fg=["innerHTML"],hg={key:1,class:"overflow-x-auto px-3 py-2 chat-code-text"},pg={class:"m-0"},mg={key:0,class:"fixed inset-0 z-50 bg-background flex flex-col"},gg={class:"flex items-center justify-between px-4 py-2 border-b border-border"},vg={class:"flex items-center gap-2"},yg={class:"flex items-center gap-1"},xg={key:0,class:"flex-1 overflow-auto p-6"},bg={key:0,class:"text-destructive text-sm p-2 bg-destructive/10 rounded"},wg=["innerHTML"],_g={key:1,class:"flex-1 overflow-auto px-4 py-3 chat-code-text"},Sg={class:"m-0"},Tg=W({__name:"BlockMessageMermaid",props:{id:{},code:{}},setup(t){const e=t,s=K(null),n=K(null),i=K(null),a=K(null),{handleCopyWithKey:o,isCopied:r,getCopyIcon:l,getCopyIconClass:u,getCopyTooltip:c}=Wn();let f=0;const d=async()=>{if(e.code.trim())try{i.value=null;const{default:g}=await ke(async()=>{const{default:_}=await import("./BXp87mMj.js").then(L=>L.bf);return{default:_}},__vite__mapDeps([4,1,2]),import.meta.url);g.initialize({startOnLoad:!1,theme:va().value==="dark"?"dark":"default",securityLevel:"strict",fontFamily:"inherit"}),f+=1;const y=`mermaid-${e.id}-${f}`,{svg:P}=await g.render(y,e.code.trim());a.value=P}catch(g){i.value=g instanceof Error?g.message:"Failed to render diagram",a.value=null}};Vs(d),be(()=>e.code,d);const h=K(!1),p=K(!1),x=()=>{h.value=!h.value};return(g,y)=>{const P=de,_=ve,L=Ls,D=Rs,E=Es;return b(),k(re,null,[w("div",og,[w("div",ag,[y[4]||(y[4]=w("span",{class:"text-xxs font-semibold capitalize text-muted-foreground select-none"}," Mermaid ",-1)),w("div",rg,[v(E,null,{default:T(()=>[v(L,{"as-child":""},{default:T(()=>[v(_,{variant:"ghost",size:"iconSm",onClick:y[0]||(y[0]=A=>p.value=!p.value)},{default:T(()=>[v(P,{name:p.value?"hugeicons:eye":"hugeicons:source-code",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),v(D,null,{default:T(()=>[N(M(p.value?"Show diagram":"Show source"),1)]),_:1})]),_:1}),v(E,null,{default:T(()=>[v(L,{"as-child":""},{default:T(()=>[v(_,{variant:"ghost",size:"iconSm",class:"w-[unset]",onClick:y[1]||(y[1]=A=>m(o)(g.id,g.code))},{default:T(()=>[w("span",lg,[(b(),H(P,{key:m(r)(g.id)?"tick":"copy",name:m(l)(m(r)(g.id)),class:ae(["size-4",m(u)(m(r)(g.id))])},null,8,["name","class"])),m(r)(g.id)?(b(),k("span",ug," Copied ")):G("",!0)])]),_:1})]),_:1}),v(D,null,{default:T(()=>[N(M(m(c)(m(r)(g.id))),1)]),_:1})]),_:1}),v(E,null,{default:T(()=>[v(L,{"as-child":""},{default:T(()=>[v(_,{variant:"ghost",size:"iconSm",onClick:x},{default:T(()=>[v(P,{name:h.value?"hugeicons:arrow-shrink-02":"hugeicons:arrow-expand-02",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),v(D,null,{default:T(()=>[N(M(h.value?"Exit full view":"Full view"),1)]),_:1})]),_:1})])]),p.value?(b(),k("div",hg,[w("pre",pg,[w("code",null,M(g.code),1)])])):(b(),k("div",cg,[i.value?(b(),k("div",dg,M(i.value),1)):a.value?(b(),k("div",{key:1,ref_key:"containerRef",ref:s,class:"flex items-center justify-center [&>svg]:max-w-full",innerHTML:a.value},null,8,fg)):G("",!0)]))]),(b(),H(ya,{to:"body"},[h.value?(b(),k("div",mg,[w("div",gg,[w("div",vg,[v(P,{name:"hugeicons:chart-relationship",class:"size-4 text-primary"}),y[5]||(y[5]=w("span",{class:"text-sm font-medium"},"Mermaid Diagram",-1))]),w("div",yg,[v(E,null,{default:T(()=>[v(L,{"as-child":""},{default:T(()=>[v(_,{variant:"ghost",size:"xxs",class:"h-7!",onClick:y[2]||(y[2]=A=>p.value=!p.value)},{default:T(()=>[v(P,{name:p.value?"hugeicons:eye":"hugeicons:source-code",class:"size-4"},null,8,["name"])]),_:1})]),_:1}),v(D,null,{default:T(()=>[N(M(p.value?"Show diagram":"Show source"),1)]),_:1})]),_:1}),v(E,null,{default:T(()=>[v(L,{"as-child":""},{default:T(()=>[v(_,{variant:"ghost",size:"iconSm",onClick:y[3]||(y[3]=A=>m(o)(g.id,g.code))},{default:T(()=>[v(P,{name:m(l)(m(r)(g.id)),class:ae(["size-4",m(u)(m(r)(g.id))])},null,8,["name","class"])]),_:1})]),_:1}),v(D,null,{default:T(()=>[N(M(m(c)(m(r)(g.id))),1)]),_:1})]),_:1}),v(_,{variant:"ghost",size:"iconSm",onClick:x},{default:T(()=>[v(P,{name:"hugeicons:arrow-shrink-02",class:"size-4"})]),_:1})])]),p.value?(b(),k("div",_g,[w("pre",Sg,[w("code",null,M(g.code),1)])])):(b(),k("div",xg,[i.value?(b(),k("div",bg,M(i.value),1)):a.value?(b(),k("div",{key:1,ref_key:"fullscreenContainerRef",ref:n,class:"flex items-center justify-center [&>svg]:max-w-full [&>svg]:max-h-full",innerHTML:a.value},null,8,wg)):G("",!0)]))])):G("",!0)]))],64)}}}),kg={class:"flex items-center gap-2 text-muted-foreground chat-text"},Ag=W({__name:"BlockMessageLoading",props:{label:{}},setup(t){return(e,s)=>{const n=de;return b(),k("div",kg,[v(n,{name:"hugeicons:loading-03",class:"size-4 animate-spin"}),v(yi,null,{default:T(()=>[N(M(e.label||"Generating summary..."),1)]),_:1})])}}}),Cg={class:"rounded-xl py-2 text-destructive"},Pg=W({__name:"BlockMessageError",props:{message:{}},setup(t){return(e,s)=>(b(),k("div",Cg,M(e.message),1))}}),Mg={key:1,class:"rounded-2xl border bg-muted/40"},Dg={class:"overflow-x-auto px-3 py-3 leading-6 chat-code-text"},Vg=W({__name:"BlockMessageTool",props:{toolName:{},result:{},getToolComponent:{type:Function}},setup(t){const e=t,s=V(()=>e.getToolComponent(e.toolName)),n=i=>JSON.stringify(i,null,2);return(i,a)=>m(s)?(b(),H(ga(m(s)),{key:0,data:i.result},null,8,["data"])):(b(),k("div",Mg,[w("pre",Dg,M(n(i.result)),1)]))}}),Eg={class:"inline-flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-xs"},Lg={class:"min-w-0 flex-1"},Rg=["href"],$g={key:1,class:"truncate font-medium text-foreground"},Ig={key:2,class:"ml-2 text-xxs text-muted-foreground"},Bg=W({__name:"BlockMessageSource",props:{sourceId:{},url:{},title:{},mediaType:{},filename:{}},setup(t){return(e,s)=>{const n=de;return b(),k("div",Eg,[v(n,{name:e.url?"hugeicons:link-02":"hugeicons:file-02",class:"size-3.5 shrink-0 text-muted-foreground"},null,8,["name"]),w("div",Lg,[e.url?(b(),k("a",{key:0,href:e.url,target:"_blank",rel:"noopener noreferrer",class:"truncate font-medium text-primary hover:underline"},M(e.title||e.url),9,Rg)):(b(),k("span",$g,M(e.title||e.filename||"Source document"),1)),e.mediaType?(b(),k("span",Ig,M(e.mediaType),1)):G("",!0)])])}}}),sa=W({__name:"RadioGroup",props:{modelValue:{},defaultValue:{},disabled:{type:Boolean},orientation:{},dir:{},loop:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},emits:["update:modelValue"],setup(t,{emit:e}){const s=t,n=e,i=V(()=>{const{class:o,...r}=s;return r}),a=zl(i,n);return(o,r)=>(b(),H(m(Ac),xt({"data-slot":"radio-group",class:m(Gn)("grid gap-3",s.class)},m(a)),{default:T(()=>[Vt(o.$slots,"default")]),_:3},16,["class"]))}}),na=W({__name:"RadioGroupItem",props:{id:{},value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{}},setup(t){const e=t,s=V(()=>{const{class:i,...a}=e;return a}),n=ql(s);return(i,a)=>(b(),H(m(Dc),xt({"data-slot":"radio-group-item"},m(n),{class:m(Gn)("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e.class)}),{default:T(()=>[v(m(Ec),{"data-slot":"radio-group-indicator",class:"relative flex items-center justify-center"},{default:T(()=>[v(m(Du),{class:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})]),_:1})]),_:1},16,["class"]))}}),Og={key:0,class:"flex items-center gap-2 rounded-xl border border-border/60 bg-muted/30 px-3 py-2"},Fg={class:"text-xs text-muted-foreground truncate"},jg={key:1,class:"rounded-2xl border border-border/70 bg-background/80 overflow-hidden"},Ng={class:"px-4 pt-4"},zg={class:"flex items-center justify-between gap-2 mb-2"},qg={class:"flex items-center gap-2 min-w-0"},Ug=["title"],Hg={class:"shrink-0 text-[11px] text-muted-foreground"},Gg={class:"h-0.5 rounded-full bg-muted overflow-hidden"},Kg={class:"px-4 py-3"},Wg={class:"text-sm leading-relaxed"},Yg={key:0,class:"text-destructive ml-0.5","aria-label":"required"},Xg={key:1,class:"flex flex-col gap-3 py-1"},Qg=["value","placeholder"],Zg={class:"px-4 pb-4 flex items-center justify-between gap-2"},Jg={key:1},ev={class:"flex items-center gap-1.5"},tv=W({__name:"BlockMessageQuiz",props:{toolCallId:{},context:{},questions:{}},emits:["submit"],setup(t,{emit:e}){const s=t,n=e,i=K({}),a=K(0),o=K(!1),r=V(()=>s.questions[a.value]),l=V(()=>a.value===s.questions.length-1),u=V(()=>s.questions.every(E=>!E.required||d(E.id))),c=K("");function f(){if(!r.value)return;const E=i.value[r.value.id];c.value=typeof E=="string"?E:""}function d(E){const A=i.value[E];return Array.isArray(A)?A.length>0:!!(A!=null&&A.trim())}function h(E){const A=r.value;if(!A)return!1;const S=i.value[A.id];return A.type==="multiple"?Array.isArray(S)&&S.includes(E):S===E}function p(E){const A=r.value;if(A){if(A.type==="single")i.value={...i.value,[A.id]:E},c.value="";else if(A.type==="multiple"){const S=i.value[A.id]??[],B=S.includes(E)?S.filter(R=>R!==E):[...S,E];i.value={...i.value,[A.id]:B}}}}function x(E){const A=r.value;if(!A)return;const S=E.target.value;c.value=S,i.value={...i.value,[A.id]:S}}function g(){a.value>0&&(a.value--,f())}function y(){l.value?L():(a.value++,f())}function P(){l.value?L():(a.value++,f())}function _(){return`[Quiz answers] ${s.questions.filter(A=>d(A.id)).map(A=>{const S=i.value[A.id],B=Array.isArray(S)?S.join(", "):S;return`${A.id}: ${B}`}).join(" | ")}`}function L(){u.value&&(o.value=!0,n("submit",_()))}const D=V(()=>s.questions.filter(E=>d(E.id)).map(E=>{const A=i.value[E.id];return Array.isArray(A)?A.join(", "):A}).join(" · "));return(E,A)=>{var R;const S=de,B=ve;return o.value?(b(),k("div",Og,[v(S,{name:"lucide:check-circle-2",class:"size-3.5 shrink-0 text-primary"}),w("span",Fg,[A[2]||(A[2]=w("span",{class:"font-medium text-foreground"},"Answered",-1)),D.value?(b(),k(re,{key:0},[N(" · "+M(D.value),1)],64)):G("",!0)])])):E.questions.length>0?(b(),k("div",jg,[w("div",Ng,[w("div",zg,[w("div",qg,[v(m(Te),{variant:"outline",class:"text-xs px-1"},{default:T(()=>[v(S,{name:"lucide:help-circle",class:"size-3 text-primary"}),A[3]||(A[3]=N(" Clarification "))]),_:1}),E.context?(b(),k("span",{key:0,class:"text-xs text-muted-foreground truncate",title:E.context},M(E.context),9,Ug)):G("",!0)]),w("span",Hg,M(a.value+1)+" / "+M(E.questions.length),1)]),w("div",Gg,[w("div",{class:"h-full rounded-full bg-primary transition-all duration-300",style:Et({width:`${(a.value+1)/E.questions.length*100}%`})},null,4)])]),w("div",Kg,[v(es,{name:"quiz-slide",mode:"out-in"},{default:T(()=>{var q;return[r.value?(b(),k("div",{key:r.value.id,class:"space-y-3"},[w("p",Wg,[N(M(r.value.question)+" ",1),r.value.required?(b(),k("span",Yg,"*")):G("",!0)]),(q=r.value.suggestions)!=null&&q.length?(b(),k(re,{key:0},[r.value.type==="single"?(b(),H(m(sa),{key:0,"model-value":i.value[r.value.id],"onUpdate:modelValue":A[0]||(A[0]=F=>p(String(F))),class:"flex flex-col gap-3 py-1"},{default:T(()=>[(b(!0),k(re,null,Se(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[v(m(na),{id:F,value:F},null,8,["id","value"]),v(m(js),{for:F,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:T(()=>[N(M(F),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"])):r.value.type==="multiple"?(b(),k("div",Xg,[(b(!0),k(re,null,Se(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[v(m(Mu),{id:F,checked:h(F),"onUpdate:checked":te=>p(F)},null,8,["id","checked","onUpdate:checked"]),v(m(js),{for:F,class:"cursor-pointer text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:T(()=>[N(M(F),1)]),_:2},1032,["for"])]))),128))])):(b(),H(m(sa),{key:2,"model-value":i.value[r.value.id],"onUpdate:modelValue":A[1]||(A[1]=F=>p(String(F))),class:"flex flex-col gap-3 py-1"},{default:T(()=>[(b(!0),k(re,null,Se(r.value.suggestions,F=>(b(),k("div",{key:F,class:"flex items-center space-x-2"},[v(m(na),{id:F,value:F},null,8,["id","value"]),v(m(js),{for:F,class:"cursor-pointer text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},{default:T(()=>[N(M(F),1)]),_:2},1032,["for"])]))),128))]),_:1},8,["model-value"]))],64)):G("",!0),w("input",{value:c.value,type:"text",class:"w-full rounded-lg border border-border bg-muted/30 px-3 py-1.5 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary/40 focus:border-primary/50 transition-all",placeholder:r.value.type==="open"?"Type your answer…":"Or type a custom answer…",onInput:x},null,40,Qg)])):G("",!0)]}),_:1})]),w("div",Zg,[a.value>0?(b(),H(B,{key:0,variant:"ghost",size:"sm",class:"text-xs h-7",onClick:g},{default:T(()=>[v(S,{name:"lucide:arrow-left",class:"size-3 mr-1"}),A[4]||(A[4]=N(" Back "))]),_:1})):(b(),k("div",Jg)),w("div",ev,[!((R=r.value)!=null&&R.required)&&!l.value?(b(),H(B,{key:0,variant:"ghost",size:"xs",onClick:P},{default:T(()=>A[5]||(A[5]=[N(" Skip ")])),_:1})):G("",!0),v(B,{size:"xs",disabled:l.value&&!u.value,onClick:y},{default:T(()=>[N(M(l.value?"Submit":"Next")+" ",1),l.value?(b(),H(S,{key:1,name:"lucide:send",class:"size-3 ml-1"})):(b(),H(S,{key:0,name:"lucide:arrow-right",class:"size-3 ml-1"}))]),_:1},8,["disabled"])])])])):G("",!0)}}}),sv=xa(tv,[["__scopeId","data-v-2b68c703"]]),nv={class:"flex h-full flex-col bg-sidebar/50 z-50 p-2 gap-2"},iv={class:"flex shrink-0 items-center justify-between gap-2"},ov={class:"flex items-center min-w-0 gap-1 flex-1"},av={class:"text-xs"},rv={class:"flex-1 overflow-hidden flex flex-col min-h-0 relative mt-2"},lv={class:"flex-1 min-h-0 overflow-y-auto w-full relative"},uv={key:0,class:"absolute inset-0 flex items-center justify-center p-6 z-10"},cv={class:"space-y-2"},dv=["onClick"],fv={class:"min-w-0 flex-1"},hv={class:"text-xs font-medium truncate"},pv={class:"flex items-center gap-2"},mv={class:"min-w-0 flex-1"},gv={class:"flex flex-wrap gap-1.5 text-xs"},vv={class:"flex-1 overflow-y-auto px-4 space-y-4"},yv={key:0,class:"space-y-2"},xv={key:0,class:"bg-muted/50 p-3 rounded-md overflow-x-auto whitespace-pre-wrap font-mono border chat-code-text"},bv={key:1,class:"flex flex-col items-center justify-center p-5 bg-muted/20 rounded-md border border-dashed min-h-[140px]"},wv={key:1,class:"text-sm"},_v={key:2,class:"flex flex-col gap-3 p-3 bg-muted/30 rounded-md border"},Sv={class:"text-xs font-medium"},Tv={key:0,class:"text-xs text-primary break-all flex items-center gap-1"},kv=["href"],Av={key:1,class:"text-xs text-muted-foreground"},Cv={class:"flex gap-2"},Pv=W({__name:"AgentAttachmentPanel",props:{messages:{}},emits:["close"],setup(t,{emit:e}){const s=t,n=e,i=V(()=>s.messages),{attachments:a,files:o,codes:r,sources:l}=xl(i),{downloadFile:u}=xi(),c=K("all"),f=A=>({type:"file",id:A.id,name:A.filename,description:"Exported File",icon:"hugeicons:file-02",data:A.result}),d=A=>({type:"source",id:A.id,name:A.title||A.filename||A.url,description:A.url||"Link & Resources",icon:"hugeicons:link-square-02",data:A}),h=A=>({type:"code",id:A.id,name:A.language?`Snippet (${A.language})`:"Snippet",description:"Code Snippet",icon:"hugeicons:code-circle",data:A}),p=V(()=>({all:[...o.value.map(f),...l.value.map(d),...r.value.map(h)],files:o.value.map(f),code:r.value.map(h),links:l.value.map(d)})),x=V(()=>p.value[c.value]||[]),g=K(!1),y=K(null),P=A=>{if(A==null)return"—";if(A<1024)return`${A} B`;const S=["KB","MB","GB","TB"];let B=A/1024,R=0;for(;B>=1024&&R<S.length-1;)B/=1024,R+=1;return`${B.toFixed(B>=10?0:1)} ${S[R]}`},_=V(()=>y.value?y.value.type==="file"?"File":y.value.type==="code"?"Code":"Link":""),L=V(()=>{var A,S;return((A=y.value)==null?void 0:A.type)==="source"&&!!((S=y.value.data)!=null&&S.url)}),D=A=>{y.value=A,g.value=!0},E=async A=>{var S;if(A)if(A.type==="file")await u(A.data);else if(A.type==="code"){const B=A.data.code,R=new Blob([B],{type:"text/plain"}),q=URL.createObjectURL(R),F=document.createElement("a");F.href=q,F.download=`snippet-${A.id.substring(0,6)}.${A.data.language||"txt"}`,F.click(),URL.revokeObjectURL(q)}else A.type==="source"&&(S=A.data)!=null&&S.url&&window.open(A.data.url,"_blank","noopener,noreferrer")};return(A,S)=>{const B=de,R=Gl;return b(),k("div",nv,[w("div",iv,[w("div",ov,[v(B,{name:"hugeicons:attachment",class:"size-4"}),S[6]||(S[6]=w("h3",{class:"text-sm font-semibold text-foreground"},"Attachments",-1)),w("p",av,M(m(a).length),1)]),v(m(ve),{size:"iconMd",variant:"ghost",onClick:S[0]||(S[0]=q=>n("close"))},{default:T(()=>[v(B,{name:"lucide:x",class:"size-4"})]),_:1})]),w("div",rv,[v(m(Ul),{modelValue:c.value,"onUpdate:modelValue":S[1]||(S[1]=q=>c.value=q),class:"flex-1 min-h-0"},{default:T(()=>[v(m(Hl),{class:"h-8"},{default:T(()=>[v(m(ds),{value:"all",class:"text-xs cursor-pointer"},{default:T(()=>S[7]||(S[7]=[N("All")])),_:1}),v(m(ds),{value:"files",class:"text-xs cursor-pointer"},{default:T(()=>S[8]||(S[8]=[N("Files")])),_:1}),v(m(ds),{value:"code",class:"text-xs cursor-pointer"},{default:T(()=>S[9]||(S[9]=[N("Code")])),_:1}),v(m(ds),{value:"links",class:"text-xs cursor-pointer"},{default:T(()=>S[10]||(S[10]=[N("Links")])),_:1})]),_:1}),w("div",lv,[x.value.length===0?(b(),k("div",uv,[v(R,{title:"No items found",desc:"Add an attachment to see it here."})])):G("",!0),(b(),k(re,null,Se(["all","files","code","links"],q=>v(m(Jl),{key:q,value:q,class:"h-full mt-0 focus-visible:ring-0"},{default:T(()=>[w("div",cv,[(b(!0),k(re,null,Se(p.value[q],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=>D(F)},[v(B,{name:F.icon,class:"size-5!"},null,8,["name"]),w("div",fv,[w("p",hv,M(F.name),1),w("p",{class:ae(["text-xxs text-muted-foreground truncate",F.type==="source"?"text-primary/70":""])},M(F.description),3)]),v(B,{name:"hugeicons:view",class:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground"})],8,dv))),128))])]),_:2},1032,["value"])),64))])]),_:1},8,["modelValue"])]),v(m(Kl),{open:g.value,"onUpdate:open":S[5]||(S[5]=q=>g.value=q)},{default:T(()=>[v(m(Wl),{class:"max-w-[50vw]! w-full max-h-[70vh] p-0 flex flex-col overflow-hidden"},{default:T(()=>{var q,F,te;return[v(m(Yl),{class:"p-4 pb-2 text-left"},{default:T(()=>{var C;return[w("div",pv,[v(B,{name:((C=y.value)==null?void 0:C.icon)||"hugeicons:file-02",class:"size-5!"},null,8,["name"]),w("div",mv,[v(m(Xl),{class:"truncate flex items-center gap-2"},{default:T(()=>{var I,z,Y,X,U,Q;return[N(M(((I=y.value)==null?void 0:I.name)||"Attachment Preview")+" ",1),w("div",gv,[v(m(Te),{variant:"secondary",class:"h-5 px-1.5"},{default:T(()=>[N(M(_.value),1)]),_:1}),((z=y.value)==null?void 0:z.type)==="file"?(b(),H(m(Te),{key:0,variant:"outline",class:"h-5 px-1.5"},{default:T(()=>[N(M(y.value.data.format||"file"),1)]),_:1})):G("",!0),((Y=y.value)==null?void 0:Y.type)==="file"?(b(),H(m(Te),{key:1,variant:"outline",class:"h-5 px-1.5"},{default:T(()=>[N(M(P(y.value.data.fileSize)),1)]),_:1})):G("",!0),((X=y.value)==null?void 0:X.type)==="code"?(b(),H(m(Te),{key:2,variant:"outline",class:"h-5 px-1.5"},{default:T(()=>[N(M(y.value.data.language||"text"),1)]),_:1})):G("",!0),((U=y.value)==null?void 0:U.type)==="source"&&((Q=y.value.data)!=null&&Q.mediaType)?(b(),H(m(Te),{key:3,variant:"outline",class:"h-5 px-1.5"},{default:T(()=>[N(M(y.value.data.mediaType),1)]),_:1})):G("",!0)])]}),_:1}),v(m(Ql),{class:"text-sm"},{default:T(()=>S[11]||(S[11]=[N(" Preview attachment details and content. ")])),_:1})])])]}),_:1}),w("div",vv,[((q=y.value)==null?void 0:q.type)==="file"?(b(),k("div",yv,[y.value.data.encoding==="utf8"?(b(),k("div",xv,M(y.value.data.content),1)):(b(),k("div",bv,[v(B,{name:"hugeicons:file-unknown",class:"size-12 text-muted-foreground/50 mb-3"}),S[12]||(S[12]=w("p",{class:"text-foreground text-sm font-medium"}," Binary file format ",-1)),S[13]||(S[13]=w("p",{class:"text-xs text-muted-foreground text-center mt-1"}," Preview is not available for this file type. Download to view. ",-1))]))])):((F=y.value)==null?void 0:F.type)==="code"?(b(),k("div",wv,[v(m(Is),{id:y.value.data.id,code:y.value.data.code,language:y.value.data.language,"is-streaming":!1,"is-block-streaming":!1},null,8,["id","code","language"])])):((te=y.value)==null?void 0:te.type)==="source"?(b(),k("div",_v,[w("div",null,[S[14]||(S[14]=w("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," Title ",-1)),w("p",Sv,M(y.value.data.title||y.value.data.filename||"Untitled Resource"),1)]),w("div",null,[S[15]||(S[15]=w("h4",{class:"text-[11px] font-semibold text-muted-foreground uppercase mb-1"}," URL ",-1)),y.value.data.url?(b(),k("p",Tv,[w("a",{href:y.value.data.url,target:"_blank",class:"hover:underline"},M(y.value.data.url),9,kv),v(B,{name:"hugeicons:link-square-02",class:"size-3 shrink-0"})])):(b(),k("p",Av," No URL provided. "))])])):G("",!0)]),v(m(Zl),{class:"p-4 flex justify-end pt-0"},{default:T(()=>{var C;return[v(m(ve),{variant:"outline",size:"sm",onClick:S[2]||(S[2]=I=>g.value=!1)},{default:T(()=>S[16]||(S[16]=[N(" Close ")])),_:1}),w("div",Cv,[((C=y.value)==null?void 0:C.type)==="source"?(b(),H(m(ve),{key:0,size:"sm",disabled:!L.value,onClick:S[3]||(S[3]=I=>E(y.value))},{default:T(()=>[S[17]||(S[17]=N(" Open Link ")),v(B,{name:"hugeicons:link-square-02",class:"size-3 ml-2"})]),_:1},8,["disabled"])):(b(),H(m(ve),{key:1,size:"sm",onClick:S[4]||(S[4]=I=>E(y.value))},{default:T(()=>[S[18]||(S[18]=N(" Download ")),v(B,{name:"hugeicons:download-04",class:"size-3"})]),_:1}))])]}),_:1})]}),_:1})]),_:1},8,["open"])])}}}),Ln=[{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."}],bl=t=>{const e=new Set(t);return Ln.filter(s=>e.has(s.id))},Mv={class:"w-full relative"},Dv={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"},Vv=["id","aria-selected","onMouseenter","onClick"],Ev={class:"min-w-0 flex-1"},Lv={class:"flex items-center gap-2"},Rv={class:"text-xs font-medium text-foreground"},$v={class:"mt-1 block text-xs text-muted-foreground"},Iv={key:0,class:"rounded-xl px-3 py-5 text-center text-[11px] text-muted-foreground"},Bv={class:"dark:bg-sidebar rounded-3xl border shadow-xs p-3 px-2 pb-2 flex flex-col gap-1 relative z-40"},Ov={key:0,class:"flex flex-wrap gap-2 pb-1"},Fv=["aria-label","onClick"],jv={class:"flex items-center justify-between px-1"},Nv={class:"flex items-center gap-1"},zv={class:"relative w-fit"},qv={class:"flex items-center gap-3"},ys="agent-command-listbox",ia="agent-command-status",Uv=W({__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:s}){const n=t,i=s,a=K(n.modelValue),o=K(0),r=K("");be(()=>n.modelValue,C=>{a.value=C});const l=K(null),u=V({get:()=>n.selectedCommandOptions,set:C=>i("update:selectedCommandOptions",C)}),c=V(()=>bl(u.value)),f=()=>{const C=l.value;if(!C)return null;if(C instanceof HTMLTextAreaElement)return C;if(typeof C=="object"&&"$el"in C&&C.$el instanceof HTMLElement){const I=C.$el;return I instanceof HTMLTextAreaElement?I:I.querySelector("textarea")}return C instanceof HTMLElement?C.querySelector("textarea"):null},d=()=>{const C=f();C==null||C.focus()};e({focusInput:d});const h=V(()=>{const C=f(),I=(C==null?void 0:C.selectionStart)??a.value.length;return a.value.slice(0,I).match(/(?:^|\s)\/([a-z0-9_-]*)$/i)}),p=V(()=>{var C,I;return((I=(C=h.value)==null?void 0:C[1])==null?void 0:I.toLowerCase())||""}),x=V(()=>h.value?h.value[0]:""),g=V(()=>{const C=p.value.trim();return h.value?C?Ln.filter(I=>[I.label,I.toolName,I.description,I.category].join(" ").toLowerCase().includes(C)):Ln:[]}),y=V(()=>!!h.value&&x.value!==r.value),P=V(()=>g.value[o.value]||null),_=V(()=>y.value?g.value.length===0?"No matching agent tools. Keep typing to filter or press Escape to close.":`${g.value.length} agent tools available. Use arrow keys to move, Enter or Tab to insert, and Escape to close.`:"");be(g,C=>{if(C.length===0){o.value=0;return}o.value>=C.length&&(o.value=0)}),be(x,C=>{C||(r.value="")});const L=C=>{const I=C.target.value;a.value=I,r.value&&r.value!==x.value&&(r.value=""),i("update:modelValue",I)},D=async()=>{r.value=x.value,o.value=0,await Be(),d()},E=C=>{u.value.includes(C.id)||(u.value=[...u.value,C.id])},A=C=>{u.value=u.value.filter(I=>I!==C)},S=async C=>{const I=f(),z=(I==null?void 0:I.selectionStart)??a.value.length,Y=a.value.slice(0,z),X=a.value.slice(z);if(!Y.match(/(?:^|\s)\/([a-z0-9_-]*)$/i))return;const Q=Y.lastIndexOf("/"),Z=a.value.slice(0,Q);let J=`${Z}${X}`;Z.trim()||(J=J.trimStart());const ge=Math.min(Z.length,J.length);a.value=J,i("update:modelValue",J),E(C),o.value=0,r.value="",await Be();const ue=f();ue==null||ue.focus(),ue==null||ue.setSelectionRange(ge,ge)},B=C=>{if(y.value){if(C.key==="Escape"){C.preventDefault(),D();return}if(g.value.length>0){if(C.key==="ArrowDown"){C.preventDefault(),o.value=(o.value+1)%g.value.length;return}if(C.key==="ArrowUp"){C.preventDefault(),o.value=(o.value-1+g.value.length)%g.value.length;return}if(C.key==="Home"){C.preventDefault(),o.value=0;return}if(C.key==="End"){C.preventDefault(),o.value=g.value.length-1;return}if(C.key==="Enter"||C.key==="Tab"){C.preventDefault();const I=P.value;I&&S(I);return}}}i("keydown",C)},R=C=>{C==null||C.preventDefault(),i("submit",typeof C=="object"&&C!==null?C:void 0)},q=C=>{if(n.isLoading){C==null||C.preventDefault(),i("stop");return}R(C)},F=V({get:()=>n.provider,set:C=>i("update:provider",C)}),te=V({get:()=>n.model,set:C=>i("update:model",C)});return(C,I)=>{const z=de,Y=Pu,X=ve;return b(),k("div",Mv,[y.value?(b(),k("div",Dv,[I[4]||(I[4]=w("div",{class:"border-b border-border/50 px-3 py-2"},[w("p",{class:"text-xs font-medium"},"Agent tools"),w("p",{class:"mt-1 text-xs text-muted-foreground"},[N(" Type after "),w("span",{class:"font-medium text-foreground"},"/"),N(" to filter. ")])],-1)),w("div",{id:ys,role:"listbox","aria-label":"Agent tools",class:"max-h-[260px] overflow-y-auto px-2 py-2"},[(b(!0),k(re,null,Se(g.value,(U,Q)=>(b(),k("button",{id:`${ys}-${U.id}`,key:U.id,type:"button",role:"option","aria-selected":Q===o.value,class:ae(["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=>S(U)},[v(z,{name:U.icon,class:"mt-0.5 size-[18px] shrink-0"},null,8,["name"]),w("span",Ev,[w("span",Lv,[w("span",Rv,M(U.label),1)]),w("span",$v,M(U.description),1)]),w("div",null,[c.value.find(Z=>Z.id===U.id)?(b(),H(z,{key:0,name:"hugeicons:checkmark-circle-01",class:"size-4 mt-0.5 text-muted-foreground cursor-pointer"})):G("",!0)])],42,Vv))),128)),g.value.length===0?(b(),k("div",Iv,I[3]||(I[3]=[N(" No matching tools. Try "),w("span",{class:"font-medium text-foreground"},"/render",-1),N(" or "),w("span",{class:"font-medium text-foreground"},"/describe",-1),N(". ")]))):G("",!0)])])):G("",!0),w("div",Bv,[c.value.length>0?(b(),k("div",Ov,[(b(!0),k(re,null,Se(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"},[v(z,{name:U.icon,class:"size-3.5 text-muted-foreground"},null,8,["name"]),w("span",null,M(U.label),1),w("button",{type:"button",class:"inline-flex size-4 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-background hover:text-foreground","aria-label":`Remove ${U.label}`,onClick:Q=>A(U.id)},[v(z,{name:"lucide:x",class:"size-3"})],8,Fv)]))),128))])):G("",!0),v(Y,{ref_key:"textareaRef",ref:l,modelValue:a.value,"onUpdate:modelValue":I[0]||(I[0]=U=>a.value=U),disabled:!C.hasApiKey||C.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":y.value?ys:void 0,"aria-describedby":ia,"aria-activedescendant":P.value?`${ys}-${P.value.id}`:void 0,"aria-expanded":y.value,onInput:L,onKeydown:B},null,8,["modelValue","disabled","aria-controls","aria-activedescendant","aria-expanded"]),w("p",{id:ia,class:"sr-only","aria-live":"polite"},M(_.value),1),w("div",jv,[w("div",Nv,[w("div",zv,[v(eu,{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"])])]),w("div",qv,[v(X,{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()&&!C.isLoading||!C.hasApiKey,onClick:q},{default:T(()=>[v(z,{name:C.isLoading?"lucide:square":"lucide:arrow-up",class:ae(["size-4 stroke-[2]",C.isLoading?"fill-current":""])},null,8,["name","class"])]),_:1},8,["disabled"])])])])])}}}),Hv={class:"flex items-center justify-between px-4 mt-2 text-[12px] text-muted-foreground relative z-30"},Gv={class:"flex items-center gap-4"},Kv={class:"flex items-center gap-1"},Wv={class:"flex items-center gap-1.5"},Yv={class:"flex items-center gap-1.5"},Xv=W({__name:"AgentChatStatusBar",props:{modelLabel:{},isLoading:{type:Boolean},showReasoning:{type:Boolean}},emits:["update:showReasoning"],setup(t,{emit:e}){const s=e;return(n,i)=>{const a=de,o=tu;return b(),k("div",Hv,[w("div",Gv,[w("div",Kv,[v(a,{name:"hugeicons:ai-brain-05",class:"size-3.5 stroke-[1.5]"}),i[1]||(i[1]=w("span",null,"Reasoning",-1)),v(o,{"model-value":n.showReasoning,"aria-label":"Toggle reasoning",class:"cursor-pointer","onUpdate:modelValue":i[0]||(i[0]=r=>s("update:showReasoning",!!r))},null,8,["model-value"])]),w("div",Wv,[v(a,{name:"hugeicons:robotic",class:"size-3.5 stroke-[1.5]"}),w("span",null,M(n.modelLabel),1)])]),w("div",Yv,[v(a,{name:n.isLoading?"hugeicons:loading-03":"hugeicons:checkmark-circle-01",class:ae(["size-3.5 stroke-[1.5]",n.isLoading?"animate-spin":""])},null,8,["name","class"]),w("span",null,M(n.isLoading?"Streaming":"Ready"),1)])])}}}),Qv={class:"w-full py-2"},Zv={class:"relative w-full max-w-3xl mx-auto flex flex-col px-4"},Jv={key:0,class:"absolute -top-12 left-1/2 transform -translate-x-1/2 z-20"},ey=W({__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:s}){const n=t,i=s,a=V({get:()=>n.modelValue,set:d=>i("update:modelValue",d)}),o=V({get:()=>n.provider,set:d=>i("update:provider",d)}),r=V({get:()=>n.model,set:d=>i("update:model",d)}),l=V({get:()=>n.selectedCommandOptions,set:d=>i("update:selectedCommandOptions",d)}),u=V(()=>`${n.provider} / ${n.model}`),c=K(null);return e({focusInput:()=>{var d;(d=c.value)==null||d.focusInput()}}),(d,h)=>(b(),k("footer",Qv,[w("div",Zv,[v(es,{"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:T(()=>[d.showScrollButton?(b(),k("div",Jv,[w("button",{class:"flex items-center justify-center size-8 bg-background border border-border rounded-full shadow-sm text-muted-foreground hover:bg-muted/50 cursor-pointer outline-none transition-colors",onClick:h[0]||(h[0]=p=>i("scrollToBottom"))},[v(m(de),{name:"lucide:arrow-down",class:"size-4 shrink-0"})])])):G("",!0)]),_:1}),v(Uv,{ref_key:"inputRef",ref:c,modelValue:a.value,"onUpdate:modelValue":h[1]||(h[1]=p=>a.value=p),provider:o.value,"onUpdate:provider":h[2]||(h[2]=p=>o.value=p),model:r.value,"onUpdate:model":h[3]||(h[3]=p=>r.value=p),"selected-command-options":l.value,"onUpdate:selectedCommandOptions":h[4]||(h[4]=p=>l.value=p),"is-loading":d.isLoading,"has-api-key":d.hasApiKey,onSubmit:h[5]||(h[5]=p=>i("submit",p)),onStop:h[6]||(h[6]=p=>i("stop")),onKeydown:h[7]||(h[7]=p=>i("keydown",p))},null,8,["modelValue","provider","model","selected-command-options","is-loading","has-api-key"]),v(Xv,{"model-label":u.value,"is-loading":d.isLoading,"show-reasoning":d.showReasoning,"onUpdate:showReasoning":h[8]||(h[8]=p=>i("update:showReasoning",p))},null,8,["model-label","is-loading","show-reasoning"])])]))}}),ty={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},sy={class:"flex flex-wrap items-center gap-2"},ny={key:0,class:"rounded-2xl border bg-background/80 px-3 py-3 text-sm"},iy={key:1,class:"space-y-3"},oy={class:"flex flex-wrap items-center gap-2"},ay={key:0,class:"text-xs text-muted-foreground"},ry={class:"mt-3 text-sm leading-6"},ly={key:0,class:"mt-3 rounded-xl border bg-muted/30"},uy={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},cy=W({__name:"AgentAnomalyBlock",props:{data:{}},setup(t){const e={high:"destructive",medium:"secondary",low:"outline"},s=n=>e[n];return(n,i)=>{const a=Te;return b(),k("div",ty,[w("div",sy,[v(a,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(" Clean Score "+M(n.data.cleanScore)+"/100 ",1)]),_:1}),v(a,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(M(n.data.scannedRows)+" rows scanned ",1)]),_:1})]),n.data.issues.length===0?(b(),k("div",ny," No anomalies were detected in the requested checks. ")):(b(),k("div",iy,[(b(!0),k(re,null,Se(n.data.issues,(o,r)=>(b(),k("div",{key:`${o.type}-${o.column||r}`,class:"rounded-2xl border bg-background/90 p-3"},[w("div",oy,[v(a,{variant:s(o.severity),class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(M(o.severity.toUpperCase()),1)]),_:2},1032,["variant"]),v(a,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(M(o.type),1)]),_:2},1024),o.column?(b(),k("span",ay,M(o.column),1)):G("",!0)]),w("p",ry,M(o.description),1),o.fixSql?(b(),k("details",ly,[i[0]||(i[0]=w("summary",{class:"cursor-pointer px-3 py-2 text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground"}," Fix suggestion ",-1)),w("pre",uy,M(o.fixSql),1)])):G("",!0)]))),128))]))])}}}),dy={class:"space-y-2"},fy={class:"flex flex-wrap justify-start gap-2"},hy=W({__name:"AgentApprovalBlock",props:{toolName:{},input:{},approvalId:{}},emits:["approve","deny"],setup(t,{emit:e}){const s=t,n=e,i=V(()=>"sql"in s.input&&typeof s.input.sql=="string"?s.input.sql:JSON.stringify(s.input,null,2));return(a,o)=>{const r=Is,l=ve;return b(),k("div",dy,[o[4]||(o[4]=w("div",{class:""},[w("div",{class:"text-xs font-medium"},"Approval Required"),w("p",{class:"text-xs text-muted-foreground"}," *This action needs confirmation before execution. ")],-1)),v(r,{id:s.approvalId,code:m(i)||"",language:"sql"},null,8,["id","code"]),w("div",fy,[v(l,{variant:"outline",size:"xs",class:"rounded-xl font-normal",onClick:o[0]||(o[0]=u=>n("deny",a.approvalId))},{default:T(()=>o[2]||(o[2]=[N(" Cancel ")])),_:1}),v(l,{size:"xs",class:"rounded-xl font-normal",onClick:o[1]||(o[1]=u=>n("approve",a.approvalId))},{default:T(()=>o[3]||(o[3]=[N(" Confirm ")])),_:1})])])}}}),py={class:"flex items-start justify-between gap-3"},my={class:"space-y-2 min-w-0"},gy={class:"flex items-center gap-2"},vy={class:"text-sm font-medium"},yy={class:"text-sm leading-6"},xy={key:0,class:"space-y-2"},by={class:"flex flex-wrap gap-1"},rn=W({__name:"AgentDescribeBlock",props:{data:{}},setup(t){const e=t,s=V(()=>[["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:""}))),n=V(()=>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=V(()=>{const u=48+n.value.length*32;return Math.max(120,Math.min(u,360))});return(a,o)=>{const r=de,l=Te;return b(),k(re,null,[w("div",py,[w("div",my,[w("div",gy,[v(r,{name:"hugeicons:grid-table",class:"size-4 text-primary"}),w("div",vy,M(a.data.tableName),1)]),w("p",yy,M(a.data.summary),1)]),v(l,{variant:"outline",class:"shrink-0"},{default:T(()=>[N(M(a.data.columns.length)+" columns ",1)]),_:1})]),w("div",{class:"overflow-hidden rounded-lg border",style:Et({height:`${m(i)}px`})},[v(Yn,{columns:m(s),data:m(n),"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",xy,[o[0]||(o[0]=w("div",{class:"text-[11px] font-medium text-muted-foreground"}," Related Tables ",-1)),w("div",by,[(b(!0),k(re,null,Se(a.data.relatedTables,u=>(b(),H(l,{key:u,variant:"outline",class:"text-xxs"},{default:T(()=>[N(M(u),1)]),_:2},1024))),128))])])):G("",!0)],64)}}});function wy(t){return t.nodes.map(e=>({id:e.id,schema:e.schemaName,table:e.tableName,rows:0,type:"table",comment:null,columns:e.columns.map((s,n)=>({name:s.name,ordinal_position:n+1,short_type_name:s.type,type:s.type,character_maximum_length:null,precision:null,nullable:!s.isPrimaryKey,default:null,collation:null,comment:null})),foreign_keys:t.edges.filter(s=>s.source===e.id).map(s=>{const[n,i]=s.target.split(".");return{foreign_key_name:s.id,column:s.sourceColumn,reference_schema:n,reference_table:i,reference_column:s.targetColumn,fk_def:""}}),primary_keys:e.columns.filter(s=>s.isPrimaryKey).map(s=>({column:s.name,pk_def:""})),indexes:[]}))}const _y={class:"space-y-2"},Sy={class:"flex items-center justify-between"},Ty={class:"flex items-center gap-2"},ky={key:0,class:"fixed inset-0 z-50 bg-background flex flex-col"},Ay={class:"flex items-center justify-between px-4 py-2 border-b border-border"},Cy={class:"flex items-center gap-2"},Py={class:"flex-1 relative"},My=W({__name:"AgentErdBlock",props:{data:{}},setup(t){const e=t,s=V(()=>wy(e.data)),n=V(()=>Vu(s.value)),i=V(()=>{const u={};for(const c of n.value.nodes)u[c.id]=c.position;return u}),a=V(()=>{const c=Math.max(...e.data.nodes.map(f=>f.columns.length),3)*su+nu+120;return Math.max(300,Math.min(c,500))}),o=K(!1),r=K(!1),l=()=>{o.value=!o.value,o.value||(r.value=!1)};return(u,c)=>{const f=de,d=Te,h=ve;return b(),k("div",_y,[w("div",Sy,[w("div",Ty,[v(f,{name:"hugeicons:hierarchy-square-01",class:"size-4 text-primary"}),c[1]||(c[1]=w("span",{class:"text-sm font-medium"}," Entity Relationship Diagram ",-1)),v(d,{variant:"outline",class:"text-xs"},{default:T(()=>[N(M(u.data.nodes.length)+" tables ",1)]),_:1})]),v(h,{variant:"ghost",size:"iconSm",onClick:l},{default:T(()=>[v(f,{name:o.value?"hugeicons:arrow-shrink-02":"hugeicons:arrow-expand-02"},null,8,["name"])]),_:1})]),o.value?G("",!0):(b(),k("div",{key:0,class:"overflow-hidden rounded-lg border border-border/70",style:Et({height:`${a.value}px`})},[v(m($u),{class:"erd-flow w-full h-full","pan-on-scroll":!0,"pan-on-scroll-speed":1.2,nodes:n.value.nodes,edges:n.value.edges,"default-viewport":{zoom:m(au),x:40,y:40},"min-zoom":m(ou),"max-zoom":m(iu),"fit-view-on-init":""},{"edge-custom":T(p=>[v(Ru,Ci(Pi(p)),null,16)]),"node-value":T(p=>[v(Lu,Ci(Pi(p)),null,16)]),default:T(()=>[v(m(Eu),{size:2,gap:30})]),_:1},8,["nodes","edges","default-viewport","min-zoom","max-zoom"])],4)),(b(),H(ya,{to:"body"},[o.value?(b(),k("div",ky,[w("div",Ay,[w("div",Cy,[v(f,{name:"hugeicons:hierarchy-square-01",class:"size-4 text-primary"}),c[2]||(c[2]=w("span",{class:"text-sm font-medium"}," Entity Relationship Diagram ",-1)),v(d,{variant:"outline",class:"text-xs"},{default:T(()=>[N(M(u.data.nodes.length)+" tables ",1)]),_:1})]),v(h,{variant:"ghost",size:"iconSm",onClick:l},{default:T(()=>[v(f,{name:"hugeicons:arrow-shrink-02"})]),_:1})]),w("div",Py,[v(Iu,{nodes:n.value.nodes,edges:n.value.edges,matrixTablePosition:i.value,tables:s.value,isShowFilter:r.value,"onUpdate:isShowFilter":c[0]||(c[0]=p=>r.value=p)},null,8,["nodes","edges","matrixTablePosition","tables","isShowFilter"])])])):G("",!0)]))])}}}),Dy={class:"space-y-4 rounded-xl border border-border/70 bg-muted/20 p-4"},Vy={class:"flex flex-wrap items-center gap-2"},Ey={class:"text-sm leading-6 text-foreground/90"},Ly={key:0,class:"space-y-2"},Ry={class:"space-y-2 text-sm leading-6"},$y={class:"rounded-2xl border bg-background/90"},Iy={class:"overflow-x-auto border-t px-3 py-3 leading-6 chat-code-text"},By=W({__name:"AgentExplainBlock",props:{data:{}},setup(t){return(e,s)=>{const n=Te;return b(),k("div",Dy,[w("div",Vy,[v(n,{variant:"secondary",class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(M(e.data.slowestNode),1)]),_:1}),v(n,{variant:"outline",class:"text-xxs tracking-[0.16em]"},{default:T(()=>[N(" Cost "+M(e.data.estimatedCost.toFixed(2)),1)]),_:1})]),w("p",Ey,M(e.data.summary),1),e.data.suggestions.length>0?(b(),k("div",Ly,[s[0]||(s[0]=w("div",{class:"text-[11px] font-medium uppercase tracking-[0.18em] text-muted-foreground"}," Suggestions ",-1)),w("ul",Ry,[(b(!0),k(re,null,Se(e.data.suggestions,i=>(b(),k("li",{key:i,class:"rounded-2xl border bg-background/80 px-3 py-2"},M(i),1))),128))])])):G("",!0),w("details",$y,[s[1]||(s[1]=w("summary",{class:"cursor-pointer px-3 py-2 text-sm font-medium"}," Raw EXPLAIN output ",-1)),w("pre",Iy,M(e.data.rawPlan),1)])])}}}),Oy=["disabled"],Fy={class:"flex items-center min-w-0 gap-2 flex-1"},jy={class:"flex flex-col"},Ny={class:"truncate text-sm leading-4 font-normal text-foreground"},zy={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},qy={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},oa=W({__name:"AgentExportFileBlock",props:{data:{}},setup(t){const e=t,s=ha("activeExportPreview"),{downloadFile:n}=xi(),i=()=>{s&&(s.value=e.data)};V(()=>{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=V(()=>{const r=e.data.fileSize;return ba(r)});V(()=>e.data.error?e.data.error:"Preview available before download");const o=async()=>{await n(e.data)};return(r,l)=>{const u=de,c=ve;return b(),k("button",{type:"button",class:ae(["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},[w("div",Fy,[v(u,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),w("div",jy,[w("h3",Ny,M(e.data.filename),1),e.data.preview.truncated?(b(),k("p",zy," First "+M(e.data.preview.rows.length)+" rows ",1)):(b(),k("p",qy," size: "+M(a.value)+" • type: "+M(e.data.format),1))])]),v(c,{disabled:!!e.data.error,size:"xs",variant:"outline"},{default:T(()=>[l[0]||(l[0]=N(" view ")),v(u,{name:"lucide:eye",class:"size-3"})]),_:1},8,["disabled"]),v(c,{onClick:qn(o,["stop"]),disabled:!!e.data.error,size:"xs",variant:"outline"},{default:T(()=>[l[1]||(l[1]=N(" Download ")),v(u,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"])],10,Oy)}}}),Uy={class:"overflow-hidden mb-1"},Hy={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},Gy={class:"my-1"},wi=W({__name:"AgentToolSqlPreview",props:{id:{},sql:{},label:{default:"View SQL"},defaultOpen:{type:Boolean,default:!1}},setup(t){const e=t,s=K(!1);function n(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=de,u=Is;return b(),k("div",Uy,[w("button",{type:"button",class:"flex cursor-pointer items-center justify-start gap-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",onClick:r[0]||(r[0]=c=>s.value=!m(s))},[N(M(e.label)+" ",1),v(l,{name:"lucide:chevron-down",class:ae(["ml-auto size-4 transition-transform duration-300",{"rotate-180":m(s)}])},null,8,["class"])]),v(es,{onEnter:n,onAfterEnter:i,onLeave:a},{default:T(()=>[m(s)?(b(),k("div",Hy,[w("div",Gy,[v(u,{id:e.id,code:e.sql,language:"sql"},null,8,["id","code"])])])):G("",!0)]),_:1})])}}}),Ky={class:"space-y-3 rounded-xl border border-border/70 bg-muted/20 p-4"},Wy={class:"flex items-start justify-between gap-3"},Yy={class:"text-sm leading-6 text-foreground/90"},Xy=W({__name:"AgentQueryBlock",props:{data:{}},setup(t){const e=t,s=V(()=>`agent-query-${e.data.sql}`);return(n,i)=>{const a=Te;return b(),k("div",Ky,[w("div",Wy,[w("p",Yy,M(n.data.explanation),1),v(a,{variant:n.data.isMutation?"destructive":"secondary",class:"shrink-0 text-xxs"},{default:T(()=>[N(M(n.data.isMutation?"MUTATION":"READ ONLY"),1)]),_:1},8,["variant"])]),v(wi,{id:m(s),sql:n.data.sql,label:n.data.isMutation?"Review SQL before approval":"View SQL","default-open":n.data.isMutation},null,8,["id","sql","label","default-open"])])}}}),Qy={class:"overflow-hidden"},Zy={key:1,class:""},Jy={key:0,class:"overflow-hidden transition-[height,opacity] duration-300 ease-in-out"},e0={class:"mt-2 border-l-2 border-border pl-3 py-1 text-foreground/80 opacity-70 chat-text"},t0=W({__name:"AgentReasoningBlock",props:{content:{},isStreaming:{type:Boolean}},setup(t){const e=t,s=Yt(e,"isStreaming"),n=Kn(Yt(e,"content"),s),i=K(!1);be(()=>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=de;return b(),k("div",Qy,[w("button",{type:"button",class:"flex cursor-pointer items-center justify-start gap-1 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors",onClick:u[0]||(u[0]=f=>i.value=!m(i))},[v(c,{name:"hugeicons:ai-brain-05",class:ae(["size-3.5! shrink-0",{"animate-pulse text-primary":l.isStreaming}])},null,8,["class"]),l.isStreaming?(b(),H(yi,{key:0,duration:1},{default:T(()=>u[1]||(u[1]=[N("Reasoning")])),_:1})):(b(),k("span",Zy," Reasoning ")),v(c,{name:"lucide:chevron-down",class:ae(["ml-auto size-4 transition-transform duration-300",{"rotate-180":m(i)}])},null,8,["class"])]),v(es,{onEnter:a,onAfterEnter:o,onLeave:r},{default:T(()=>[m(i)?(b(),k("div",Jy,[w("div",e0,[v(wa,{content:m(n),"is-streaming":l.isStreaming,"is-block-streaming":l.isStreaming,"is-user-message":!1},null,8,["content","is-streaming","is-block-streaming"])])])):G("",!0)]),_:1})])}}}),s0={key:1,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},n0={class:"text-xs text-muted-foreground mt-1"},i0=W({__name:"AgentTableBlock",props:{data:{}},setup(t){const e=t,s=V(()=>(e.data.columns??[]).map(o=>({originalName:o.name,queryFieldName:o.name,aliasFieldName:o.name,isPrimaryKey:!1,isForeignKey:!1,canMutate:!1,type:o.type,tableName:""}))),n=V(()=>e.data.rows??[]),i=V(()=>`agent-render-table-${e.data.sql||""}`),a=V(()=>{const c=48+n.value.length*32;return Math.max(120,Math.min(c,420))});return(o,r)=>(b(),k(re,null,[o.data.sql?(b(),H(wi,{key:0,id:m(i),sql:o.data.sql,label:"View SQL"},null,8,["id","sql"])):G("",!0),o.data.truncated?(b(),k("div",s0," Showing only the first "+M(o.data.rowCount)+" rows. ",1)):G("",!0),w("div",{class:"overflow-hidden rounded-lg border max-h-96",style:Et({height:`${m(a)}px`})},[v(Yn,{columns:m(s),data:m(n),"column-key-by":"field","has-hash-index":!1,class:"h-full w-full"},null,8,["columns","data"])],4),w("div",n0," Showing "+M(m(n).length)+" row"+M(m(n).length===1?"":"s"),1)],64))}}),o0={class:"flex flex-wrap items-center justify-between gap-2"},a0={class:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground"},r0={class:"text-xs text-muted-foreground"},l0={key:0,class:"text-xs text-muted-foreground border-l-2 pl-2 mb-1"},u0={class:"overflow-hidden rounded-xl border bg-background/90 p-2 pt-8"},c0={class:"agent-chart-container"},d0=W({__name:"AgentVisualizeTableBlock",props:{data:{}},setup(t){Da([cc,dc,fc,Xc,sd,hc,pc,mc]);const e=t,s=V(()=>`agent-visualize-table-${e.data.chartType}-${e.data.sql}`),n=V(()=>e.data.chartType.replace("_"," ")),i=V(()=>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=Te;return b(),k(re,null,[w("div",o0,[w("div",a0,[v(r,{variant:"secondary",class:"uppercase tracking-[0.16em]"},{default:T(()=>[N(M(m(n)),1)]),_:1}),a.data.xField?(b(),H(r,{key:0,variant:"outline"},{default:T(()=>[N(" X: "+M(a.data.xField),1)]),_:1})):G("",!0),a.data.yField?(b(),H(r,{key:1,variant:"outline"},{default:T(()=>[N(" Y: "+M(a.data.yField),1)]),_:1})):G("",!0)]),w("div",r0,M(a.data.rowCount)+" point"+M(a.data.rowCount===1?"":"s"),1)]),v(wi,{id:m(s),sql:a.data.sql,label:"View SQL"},null,8,["id","sql"]),a.data.truncated?(b(),k("div",l0," Showing only the first "+M(a.data.rowCount)+" points. ",1)):G("",!0),w("div",u0,[w("div",c0,[v(m(gc),{option:m(i),autoresize:"",class:"agent-chart"},null,8,["option"])])])],64)}}}),f0=xa(d0,[["__scopeId","data-v-8ea150a2"]]),h0={class:"min-w-0 flex-1 overflow-hidden"},p0={class:"flex items-center gap-1 justify-center"},m0=W({__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 s=t,n=e,{handleCopyWithKey:i,isCopied:a,getCopyIcon:o,getCopyIconClass:r,getCopyTooltip:l}=Wn(),u=V(()=>s.message.role==="user"),c=d=>{u.value||!s.registerMessageElement||s.registerMessageElement(s.message.id,d)},f=V(()=>(s.message.blocks??[]).map(d=>d.kind==="text"||d.kind==="markdown"?d.content:d.kind==="code"||d.kind==="mermaid"?d.code:"").filter(Boolean).join(`
5
5
 
6
6
  `));return(d,h)=>{const p=de,x=ve,g=Ls,y=Rs,P=Es;return b(),k("div",{class:ae(["w-full",u.value?"flex justify-end":"flex justify-start"]),ref:_=>c(_)},[w("div",{class:ae(["flex w-full max-w-3xl gap-3",u.value?"justify-end":"items-start"])},[w("div",h0,[(b(!0),k(re,null,Se(d.message.blocks,(_,L)=>(b(),k("div",{key:`${d.message.id}-${_.kind}-${L}`,class:ae(["overflow-hidden chat-text",!u.value&&s.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"])},[_.kind==="text"?(b(),H(m(zm),{key:0,content:_.content,"is-block-streaming":_.isStreaming,"is-streaming":d.isStreaming,"is-user-message":u.value},null,8,["content","is-block-streaming","is-streaming","is-user-message"])):_.kind==="reasoning"&&d.showReasoning?(b(),H(m(t0),{key:1,content:_.content,"is-streaming":_.isStreaming},null,8,["content","is-streaming"])):_.kind==="markdown"?(b(),H(m(wa),{key:2,content:_.content,"is-block-streaming":_.isStreaming,"is-streaming":d.isStreaming,"is-user-message":u.value},null,8,["content","is-block-streaming","is-streaming","is-user-message"])):_.kind==="code"?(b(),H(m(Is),{key:3,id:`${d.message.id}-${L}`,code:_.code,language:_.language||"text","is-block-streaming":_.isStreaming,"is-streaming":d.isStreaming},null,8,["id","code","language","is-block-streaming","is-streaming"])):_.kind==="mermaid"?(b(),H(m(Tg),{key:4,id:`${d.message.id}-${L}`,code:_.code},null,8,["id","code"])):_.kind==="loading"?(b(),H(m(Ag),{key:5,label:_.label},null,8,["label"])):_.kind==="error"?(b(),H(m(Pg),{key:6,message:_.message},null,8,["message"])):_.kind==="tool"?(b(),H(m(Vg),{key:7,"tool-name":_.toolName,result:_.result,"get-tool-component":d.getToolComponent},null,8,["tool-name","result","get-tool-component"])):_.kind==="approval"?(b(),H(m(hy),{key:8,"tool-name":_.toolName,input:_.input,"approval-id":_.approvalId,onApprove:h[0]||(h[0]=D=>n("approval",D,!0)),onDeny:h[1]||(h[1]=D=>n("approval",D,!1))},null,8,["tool-name","input","approval-id"])):_.kind==="source"?(b(),H(m(Bg),{key:9,"source-id":_.sourceId,url:_.url,title:_.title,"media-type":_.mediaType,filename:_.filename},null,8,["source-id","url","title","media-type","filename"])):_.kind==="quiz"?(b(),H(m(sv),{key:10,"tool-call-id":_.toolCallId,context:_.context,questions:_.questions,onSubmit:h[2]||(h[2]=D=>n("quiz-submit",D))},null,8,["tool-call-id","context","questions"])):G("",!0)],2))),128)),d.isStreaming?G("",!0):(b(),k("div",{key:0,class:ae(["mt-1 flex items-center gap-1",u.value?"justify-end":"justify-start"])},[v(P,null,{default:T(()=>[v(g,{"as-child":""},{default:T(()=>[v(x,{size:"xxs",variant:"ghost",class:"h-4!",onClick:h[3]||(h[3]=_=>m(i)(d.message.id,f.value))},{default:T(()=>[w("span",p0,[v(p,{name:m(o)(m(a)(d.message.id)),class:ae(["size-3.5!",m(r)(m(a)(d.message.id))])},null,8,["name","class"]),m(a)(d.message.id)?(b(),k("span",{key:0,class:ae(["text-xxs font-medium leading-none",m(r)(m(a)(d.message.id))])},"Copied",2)):G("",!0)])]),_:1})]),_:1}),v(y,null,{default:T(()=>[w("p",null,M(m(l)(m(a)(d.message.id))),1)]),_:1})]),_:1}),u.value?(b(),H(P,{key:0},{default:T(()=>[v(g,{"as-child":""},{default:T(()=>[v(x,{size:"iconSm",variant:"ghost",class:"size-4!",onClick:h[4]||(h[4]=_=>n("edit",f.value))},{default:T(()=>[v(p,{name:"lucide:pencil",class:"size-3!"})]),_:1})]),_:1}),v(y,null,{default:T(()=>h[5]||(h[5]=[w("p",null,"Edit",-1)])),_:1})]),_:1})):G("",!0)],2))])],2)],2)}}}),g0={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"},v0={class:"text-xl font-medium tracking-tight"},y0=W({__name:"AgentSetupCard",props:{currentProvider:{}},setup(t){const{openSettings:e}=ru();return(s,n)=>{const i=de,a=ve;return b(),k("div",g0,[w("h2",v0,[v(i,{name:"lucide:key-round",class:"size-4! text-muted-foreground"}),N(" Connect "+M(s.currentProvider.name),1)]),n[2]||(n[2]=w("p",{class:"mt-2 text-sm leading-6 text-muted-foreground"}," Add an API key in Settings so the agent can answer questions, inspect schema context, and keep chat history in this workspace. ",-1)),v(a,{variant:"outline",size:"sm",class:"mt-6 rounded-2xl",onClick:n[0]||(n[0]=o=>m(e)("Agent"))},{default:T(()=>[v(i,{name:"lucide:settings-2",class:"size-4"}),n[1]||(n[1]=N(" Open Agent Settings "))]),_:1})])}}}),x0={class:"mx-auto my-auto w-full max-w-3xl py-8"},b0={class:"rounded-3xl p-5"},w0={class:"flex items-start"},_0={class:"min-w-0 flex-1"},S0={class:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground"},T0=W({__name:"AgentWelcomePanel",props:{promptCards:{},threadCount:{}},emits:["prompt"],setup(t,{emit:e}){const s=t;return(n,i)=>(b(),k("div",x0,[w("div",b0,[w("div",w0,[w("div",_0,[w("div",S0,[i[0]||(i[0]=w("span",{class:"rounded-full bg-muted px-2.5 py-1 font-medium text-foreground"}," Orca Agent ",-1)),w("span",null,M(s.threadCount)+" saved threads ready to resume",1)]),i[1]||(i[1]=w("h2",{class:"mt-3 text-xl font-medium text-foreground"}," Ask for schema help, query ideas, or result checks. ",-1)),i[2]||(i[2]=w("p",{class:"mt-2 max-w-2xl text-sm text-muted-foreground"}," Keep it short. The agent already sees the connected schema and can keep working from past conversations. ",-1))])])])]))}}),k0={class:"flex flex-col items-center gap-1"},A0=["onClick"],C0=["aria-label"],P0={class:"line-clamp-3 leading-relaxed"},M0=W({__name:"ResponseNavigatorDotIndicator",props:{currentIndex:{},responses:{},position:{}},emits:["select"],setup(t,{emit:e}){const s=e;return(n,i)=>(b(),k("div",k0,[(b(!0),k(re,null,Se(n.responses,(a,o)=>(b(),k("div",{key:a.id,class:"group relative flex items-center justify-center px-3 cursor-pointer",onClick:r=>s("select",o)},[w("button",{type:"button",class:ae(["rounded-full transition-all duration-200 ease-out focus:outline-none focus:ring-2 focus:ring-primary/60 pointer-events-none",n.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,C0),a.preview?(b(),k("div",{key:0,class:ae(["absolute top-1/2 -translate-y-1/2 pointer-events-none opacity-0 transition-opacity duration-200 group-hover:opacity-100 z-50 w-56 p-2.5 text-xs bg-popover text-popover-foreground rounded-lg shadow-md border border-border",n.position==="left"?"left-full ml-2":"right-full mr-2"])},[w("div",P0,M(a.preview),1)],2)):G("",!0)],8,A0))),128))]))}}),D0=W({__name:"ResponseNavigatorToast",props:{message:{},position:{}},setup(t){return(e,s)=>(b(),H(es,{"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:T(()=>[e.message?(b(),k("div",{key:0,class:ae(["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"},M(e.message),3)):G("",!0)]),_:1}))}});function V0({currentIndex:t,total:e,onNavigate:s}){const n=K("");let i=null;const a=V(()=>t.value>0),o=V(()=>t.value<e.value-1),r=d=>{n.value=d,i&&clearTimeout(i),i=setTimeout(()=>{n.value=""},1500)},l=d=>{d<0||d>=e.value||s(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")},f=d=>{d.key==="ArrowUp"&&(d.preventDefault(),u()),d.key==="ArrowDown"&&(d.preventDefault(),c())};return Hn(()=>{i&&clearTimeout(i)}),{canGoNext:o,canGoPrevious:a,goNext:c,goPrevious:u,handleKeydown:f,toastMessage:n}}const E0=W({__name:"ResponseNavigator",props:{responses:{},currentIndex:{},position:{default:"right"},offset:{default:()=>({})}},emits:["navigate"],setup(t,{emit:e}){const s=t,n=e,i=V(()=>s.responses.length),a=V(()=>({top:`calc(50% + ${s.offset.y??0}px)`,right:s.position==="right"?`${0+(s.offset.x??0)}px`:"auto",left:s.position==="left"?`${0+(s.offset.x??0)}px`:"auto",transform:"translateY(-50%)"})),{canGoNext:o,canGoPrevious:r,goNext:l,goPrevious:u,handleKeydown:c,toastMessage:f}=V0({currentIndex:Yt(s,"currentIndex"),total:i,onNavigate:d=>n("navigate",d)});return(d,h)=>{const p=de,x=ve,g=Ls,y=Rs,P=Es;return d.responses.length>0?(b(),k("div",{key:0,class:"absolute z-30 flex flex-col items-center gap-0.5",style:Et(a.value),tabindex:"0",onKeydown:h[1]||(h[1]=(..._)=>m(c)&&m(c)(..._))},[v(D0,{message:m(f),position:d.position},null,8,["message","position"]),v(P,{"delay-duration":150},{default:T(()=>[v(g,{"as-child":""},{default:T(()=>[v(x,{size:"iconSm",variant:"ghost","aria-label":"Go to previous response","aria-disabled":!m(r),disabled:!m(r),onClick:m(u)},{default:T(()=>[v(p,{name:"lucide:chevron-up"})]),_:1},8,["aria-disabled","disabled","onClick"])]),_:1}),v(y,{side:d.position==="left"?"right":"left"},{default:T(()=>h[2]||(h[2]=[w("p",null,"Previous response",-1)])),_:1},8,["side"])]),_:1}),v(M0,{"current-index":d.currentIndex,responses:d.responses,position:d.position,onSelect:h[0]||(h[0]=_=>n("navigate",_))},null,8,["current-index","responses","position"]),v(P,{"delay-duration":150},{default:T(()=>[v(g,{"as-child":""},{default:T(()=>[v(x,{size:"iconSm",variant:"ghost","aria-label":"Go to next response","aria-disabled":!m(o),disabled:!m(o),onClick:m(l)},{default:T(()=>[v(p,{name:"lucide:chevron-down"})]),_:1},8,["aria-disabled","disabled","onClick"])]),_:1}),v(y,{side:d.position==="left"?"right":"left"},{default:T(()=>h[3]||(h[3]=[w("p",null,"Next response",-1)])),_:1},8,["side"])]),_:1})],36)):G("",!0)}}}),L0={class:"flex h-full flex-col bg-sidebar z-50 p-2 gap-2"},R0={class:"flex shrink-0 items-center justify-between gap-2"},$0={class:"flex items-center min-w-0 gap-1 flex-1"},I0={class:"flex flex-col"},B0={class:"truncate text-sm leading-4 font-medium text-foreground"},O0={key:0,class:"text-xxs text-muted-foreground truncate shrink-0"},F0={key:1,class:"text-xxs text-muted-foreground truncate shrink-0"},j0={class:"flex shrink-0 items-center justify-end gap-1"},N0={class:"flex-1 overflow-hidden min-h-0 flex flex-col"},z0={key:0,class:"rounded-xl border border-destructive/20 bg-destructive/5 p-4 text-sm text-destructive mx-2"},q0={key:1,class:"flex-1 w-full overflow-hidden rounded-xl border border-border/70 flex flex-col min-h-0 relative h-full"},U0=W({__name:"ExportPreviewPanel",props:{result:{}},emits:["close"],setup(t,{emit:e}){const s=t,n=e,{downloadFile:i}=xi(),a=new Set(["csv","tsv"]),o=V(()=>a.has(s.result.format)),r={json:"json",sql:"sql",markdown:"markdown",xml:"xml",yaml:"yaml",html:"html"},l=V(()=>r[s.result.format]),u=V(()=>s.result.preview.columns??[]),c=V(()=>s.result.preview.rows??[]),f=V(()=>s.result.encoding==="base64"?`${s.result.filename} is a binary spreadsheet file. Use Download to open it locally.`:s.result.content),d=V(()=>u.value.map(x=>({originalName:x,aliasFieldName:x,queryFieldName:x,tableName:"",type:"string",isPrimaryKey:!1,isForeignKey:!1,canMutate:!1}))),h=async()=>{await i(s.result)},p=V(()=>{const x=s.result.fileSize;return ba(x)});return(x,g)=>{const y=de,P=ve,_=Cu;return b(),k("div",L0,[w("div",R0,[w("div",$0,[v(y,{name:"hugeicons:document-attachment",class:"size-5! shrink-0 text-foreground"}),w("div",I0,[w("h3",B0,M(x.result.filename),1),x.result.preview.truncated?(b(),k("p",O0," First "+M(c.value.length)+" rows ",1)):(b(),k("p",F0," size: "+M(p.value)+" • type: "+M(x.result.format),1))])]),w("div",j0,[v(P,{size:"xs",variant:"outline",disabled:!!x.result.error,onClick:h},{default:T(()=>[g[1]||(g[1]=N(" Download ")),v(y,{name:"lucide:download",class:"size-3"})]),_:1},8,["disabled"]),v(P,{size:"iconMd",variant:"ghost",onClick:g[0]||(g[0]=L=>n("close"))},{default:T(()=>[v(y,{name:"lucide:x",class:"size-4"})]),_:1})])]),w("div",N0,[x.result.error?(b(),k("div",z0,M(x.result.error),1)):o.value?(b(),k("div",q0,[v(Yn,{columns:d.value,data:c.value,"column-key-by":"field",class:"h-full"},null,8,["columns","data"])])):(b(),H(_,{key:2,code:f.value,language:l.value,"max-height":"100%",class:"h-full rounded-xl overflow-auto border border-border/70"},null,8,["code","language"]))])])}}});function H0(t,e){return e.length===0?t:`[Tool hints]
7
7
  ${bl(e).map(i=>`${i.label}: ${i.promptHint}`).join(`