@kafca/agentdock 0.1.21 → 0.1.23

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 (81) hide show
  1. package/README.md +9 -0
  2. package/dist/renderer/assets/{Badge-BRmQIqbd.js → Badge-C2K5apfV.js} +1 -1
  3. package/dist/renderer/assets/{Chat-D94ODABB.js → Chat-DI2YeVKb.js} +1 -1
  4. package/dist/renderer/assets/{ChatMarkdown-DqW7OUvV.js → ChatMarkdown-DMAr15Oi.js} +1 -1
  5. package/dist/renderer/assets/{Config-9lgzpTCp.js → Config-7rP3EuUf.js} +2 -2
  6. package/dist/renderer/assets/CronList-81QslYE8.js +1 -0
  7. package/dist/renderer/assets/{Dashboard-COISXbQy.js → Dashboard-Db2T7rSZ.js} +2 -2
  8. package/dist/renderer/assets/{EmptyState-w5-I9zg7.js → EmptyState-BBJ3cTvB.js} +1 -1
  9. package/dist/renderer/assets/{KnowledgeDetail-DVxwrTLw.js → KnowledgeDetail-Dz_6flG3.js} +2 -2
  10. package/dist/renderer/assets/{KnowledgeHome-BKkubcwi.js → KnowledgeHome-DIh046mN.js} +3 -3
  11. package/dist/renderer/assets/Logs-BXBtHJLf.js +1 -0
  12. package/dist/renderer/assets/{Modal-Ceu_MP2e.js → Modal-BB2Av_Xs.js} +1 -1
  13. package/dist/renderer/assets/{Page-CpSczAz8.js → Page-DPSdvMgU.js} +1 -1
  14. package/dist/renderer/assets/{ProjectDetail-FJ_bNXLF.js → ProjectDetail-C6EWGvGg.js} +1 -1
  15. package/dist/renderer/assets/{ProjectList-DZKL4K9C.js → ProjectList-BBo5ygnS.js} +1 -1
  16. package/dist/renderer/assets/{Select-BHQk6qCU.js → Select-CNX-Tx_O.js} +2 -7
  17. package/dist/renderer/assets/SessionChat-BIn46jqZ.js +1 -0
  18. package/dist/renderer/assets/SessionList-CZt6f1Rd.js +1 -0
  19. package/dist/renderer/assets/{ThreadChat-D3s4GXGh.js → ThreadChat-BotD0gKQ.js} +7 -7
  20. package/dist/renderer/assets/Workspace-C_4tdpjX.js +14 -0
  21. package/dist/renderer/assets/{arrow-left-Dtal-eOi.js → arrow-left-cHr5wkpq.js} +1 -1
  22. package/dist/renderer/assets/{book-open-q814R_Ov.js → book-open-4nx5C8T-.js} +1 -1
  23. package/dist/renderer/assets/{check-DjfCdLvw.js → check-exTS-R-x.js} +1 -1
  24. package/dist/renderer/assets/chevron-down-DSvxXQa0.js +6 -0
  25. package/dist/renderer/assets/{circle-vfhmyE8v.js → circle-DyvEovdw.js} +1 -1
  26. package/dist/renderer/assets/desktop-B-KVT10D.js +1 -0
  27. package/dist/renderer/assets/desktop-CVibRyAw.js +4 -0
  28. package/dist/renderer/assets/{funnel-CUQibo1I.js → funnel-DA9qVdTy.js} +1 -1
  29. package/dist/renderer/assets/{heart-DG9_b8P1.js → heart-DuEV0ZRJ.js} +1 -1
  30. package/dist/renderer/assets/{index-Ds0IN5rP.js → index-BgflqkCN.js} +3 -3
  31. package/dist/renderer/assets/index-Biz-aexG.js +177 -0
  32. package/dist/renderer/assets/{index-3CzgyQYB.css → index-DFiJR0vv.css} +1 -1
  33. package/dist/renderer/assets/{pencil-Dij0LlRY.js → pencil-DBDxeNmO.js} +1 -1
  34. package/dist/renderer/assets/{play-CPFGjIyJ.js → play-IzlP83_7.js} +1 -1
  35. package/dist/renderer/assets/{plug-DH3RKQyn.js → plug-CuT-qFnW.js} +1 -1
  36. package/dist/renderer/assets/{plus-afkK9_Y8.js → plus-DEqgkn63.js} +1 -1
  37. package/dist/renderer/assets/projects-DDtDN1rc.js +1 -0
  38. package/dist/renderer/assets/{save-B-cKgWcy.js → save-D4sRo07y.js} +1 -1
  39. package/dist/renderer/assets/{search-DR6PeYkt.js → search-DbPZLuV8.js} +1 -1
  40. package/dist/renderer/assets/{server-BM6KOB5a.js → server-D1jUQmwN.js} +1 -1
  41. package/dist/renderer/assets/{session-utils-BDuThM0a.js → session-utils-Aife8ep2.js} +1 -1
  42. package/dist/renderer/assets/{sessions-C1yKps4T.js → sessions-DaH3H7gC.js} +1 -1
  43. package/dist/renderer/assets/{shield-check-BFjMG-r2.js → shield-check-BGwUFWNr.js} +1 -1
  44. package/dist/renderer/assets/{trash-2-CW1heMCf.js → trash-2-CIFBioBa.js} +1 -1
  45. package/dist/renderer/assets/{user-r_2sHG7m.js → user-CnKcvHdo.js} +1 -1
  46. package/dist/renderer/assets/{wifi-off-VMUokMpE.js → wifi-off-ClO53WGa.js} +1 -1
  47. package/dist/renderer/index.html +2 -2
  48. package/dist-electron/electron/local-core-refactor.test.js +812 -3
  49. package/dist-electron/electron/plugin-kernel.test.js +74 -14
  50. package/dist-electron/packages/core-sdk/src/index.js +40 -20
  51. package/dist-electron/services/local-ai-core/src/acp/local-core-acp-turn-coordinator.js +5 -1
  52. package/dist-electron/services/local-ai-core/src/acp/workspace-acp-permissions.js +55 -3
  53. package/dist-electron/services/local-ai-core/src/channel/lark/cards.js +210 -0
  54. package/dist-electron/services/local-ai-core/src/channel/lark/config.js +54 -0
  55. package/dist-electron/services/local-ai-core/src/{gateway → channel/lark}/local-core-lark-gateway.js +365 -383
  56. package/dist-electron/services/local-ai-core/src/channel/lark/registration.js +50 -0
  57. package/dist-electron/services/local-ai-core/src/channel/lark/runtime-state.js +191 -0
  58. package/dist-electron/services/local-ai-core/src/channel/lark/types.js +2 -0
  59. package/dist-electron/services/local-ai-core/src/channel/shared/file-utils.js +33 -0
  60. package/dist-electron/services/local-ai-core/src/channel/shared/plugin.js +31 -0
  61. package/dist-electron/services/local-ai-core/src/channel/weixin/config.js +125 -0
  62. package/dist-electron/services/local-ai-core/src/{gateway → channel/weixin}/local-core-weixin-gateway.js +262 -258
  63. package/dist-electron/services/local-ai-core/src/channel/weixin/transport.js +169 -0
  64. package/dist-electron/services/local-ai-core/src/channel/weixin/types.js +2 -0
  65. package/dist-electron/services/local-ai-core/src/cli/lac.js +41 -1
  66. package/dist-electron/services/local-ai-core/src/kernel/bootstrap.js +5 -0
  67. package/dist-electron/services/local-ai-core/src/plugins/builtin/channel-lark-plugin.js +19 -40
  68. package/dist-electron/services/local-ai-core/src/plugins/builtin/channel-weixin-plugin.js +19 -40
  69. package/dist-electron/services/local-ai-core/src/runtime/local-core-controller.js +96 -44
  70. package/dist-electron/services/local-ai-core/src/runtime/server.js +20 -8
  71. package/dist-electron/shared/desktop.js +24 -1
  72. package/package.json +1 -1
  73. package/dist/renderer/assets/CronList-BYZ-x_bp.js +0 -1
  74. package/dist/renderer/assets/Logs-D7HxZ8Nb.js +0 -1
  75. package/dist/renderer/assets/SessionChat-DpgSXF3m.js +0 -1
  76. package/dist/renderer/assets/SessionList-CU6drQ4N.js +0 -1
  77. package/dist/renderer/assets/Workspace-B7looTVo.js +0 -14
  78. package/dist/renderer/assets/desktop-BPIxWbkM.js +0 -1
  79. package/dist/renderer/assets/desktop-DZHC4PDB.js +0 -3
  80. package/dist/renderer/assets/index-Bn8ane6_.js +0 -177
  81. package/dist/renderer/assets/projects-DTDS9SnT.js +0 -1
@@ -1,11 +1,6 @@
1
- import{c as kt,x as he,av as Y,j as S,r as p,w as vt}from"./index-Bn8ane6_.js";import{c as ct,a as Je,r as lt,P as z,u as J,b as Ht,d as yt,e as at,f as $,g as kn,h as Hn,i as Vn,R as Bn,F as Wn,D as Fn}from"./index-Ds0IN5rP.js";import{C as $n}from"./check-DjfCdLvw.js";/**
1
+ import{c as jn,y as he,aA as Y,j as S,r as p,w as vt}from"./index-Biz-aexG.js";import{c as ct,a as Je,r as lt,P as z,u as J,b as kt,d as yt,e as at,f as $,g as kn,h as Hn,i as Vn,R as Bn,F as Wn,D as Fn}from"./index-BgflqkCN.js";import{C as St}from"./chevron-down-DSvxXQa0.js";import{C as $n}from"./check-exTS-R-x.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const zn=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],St=kt("chevron-down",zn);/**
7
- * @license lucide-react v0.487.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Un=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Kn=kt("chevron-up",Un);function bt(e,[t,n]){return Math.min(n,Math.max(t,e))}function Yn(e){const t=e+"CollectionProvider",[n,o]=ct(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=d=>{const{scope:w,children:y}=d,h=he.useRef(null),v=he.useRef(new Map).current;return S.jsx(r,{scope:w,itemMap:v,collectionRef:h,children:y})};i.displayName=t;const c=e+"CollectionSlot",l=Je(c),a=he.forwardRef((d,w)=>{const{scope:y,children:h}=d,v=s(c,y),b=Y(w,v.collectionRef);return S.jsx(l,{ref:b,children:h})});a.displayName=c;const f=e+"CollectionItemSlot",u="data-radix-collection-item",g=Je(f),m=he.forwardRef((d,w)=>{const{scope:y,children:h,...v}=d,b=he.useRef(null),C=Y(w,b),R=s(f,y);return he.useEffect(()=>(R.itemMap.set(b,{ref:b,...v}),()=>void R.itemMap.delete(b))),S.jsx(g,{[u]:"",ref:C,children:h})});m.displayName=f;function x(d){const w=s(e+"CollectionConsumer",d);return he.useCallback(()=>{const h=w.collectionRef.current;if(!h)return[];const v=Array.from(h.querySelectorAll(`[${u}]`));return Array.from(w.itemMap.values()).sort((R,T)=>v.indexOf(R.ref.current)-v.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:a,ItemSlot:m},x,o]}var Xn=p.createContext(void 0);function qn(e){const t=p.useContext(Xn);return e||t||"ltr"}const Gn=["top","right","bottom","left"],fe=Math.min,q=Math.max,ke=Math.round,Le=Math.floor,oe=e=>({x:e,y:e}),Zn={left:"right",right:"left",bottom:"top",top:"bottom"};function Qe(e,t,n){return q(e,fe(t,n))}function se(e,t){return typeof e=="function"?e(t):e}function ce(e){return e.split("-")[0]}function Ce(e){return e.split("-")[1]}function ft(e){return e==="x"?"y":"x"}function dt(e){return e==="y"?"height":"width"}function ne(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ut(e){return ft(ne(e))}function Jn(e,t,n){n===void 0&&(n=!1);const o=Ce(e),r=ut(e),s=dt(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=He(i)),[i,He(i)]}function Qn(e){const t=He(e);return[et(e),t,et(t)]}function et(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ct=["left","right"],Rt=["right","left"],eo=["top","bottom"],to=["bottom","top"];function no(e,t,n){switch(e){case"top":case"bottom":return n?t?Rt:Ct:t?Ct:Rt;case"left":case"right":return t?eo:to;default:return[]}}function oo(e,t,n,o){const r=Ce(e);let s=no(ce(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(et)))),s}function He(e){const t=ce(e);return Zn[t]+e.slice(t.length)}function ro(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vt(e){return typeof e!="number"?ro(e):{top:e,right:e,bottom:e,left:e}}function Ve(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function At(e,t,n){let{reference:o,floating:r}=e;const s=ne(t),i=ut(t),c=dt(i),l=ce(t),a=s==="y",f=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let m;switch(l){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:u};break;case"left":m={x:o.x-r.width,y:u};break;default:m={x:o.x,y:o.y}}switch(Ce(t)){case"start":m[i]-=g*(n&&a?-1:1);break;case"end":m[i]+=g*(n&&a?-1:1);break}return m}async function io(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:g=!1,padding:m=0}=se(t,e),x=Vt(m),w=c[g?u==="floating"?"reference":"floating":u],y=Ve(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:l})),h=u==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},C=Ve(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:h,offsetParent:v,strategy:l}):h);return{top:(y.top-C.top+x.top)/b.y,bottom:(C.bottom-y.bottom+x.bottom)/b.y,left:(y.left-C.left+x.left)/b.x,right:(C.right-y.right+x.right)/b.x}}const so=50,co=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:io},l=await(i.isRTL==null?void 0:i.isRTL(t));let a=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:u}=At(a,o,l),g=o,m=0;const x={};for(let d=0;d<s.length;d++){const w=s[d];if(!w)continue;const{name:y,fn:h}=w,{x:v,y:b,data:C,reset:R}=await h({x:f,y:u,initialPlacement:o,placement:g,strategy:r,middlewareData:x,rects:a,platform:c,elements:{reference:e,floating:t}});f=v??f,u=b??u,x[y]={...x[y],...C},R&&m<so&&(m++,typeof R=="object"&&(R.placement&&(g=R.placement),R.rects&&(a=R.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):R.rects),{x:f,y:u}=At(a,g,l)),d=-1)}return{x:f,y:u,placement:g,strategy:r,middlewareData:x}},lo=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:l}=t,{element:a,padding:f=0}=se(e,t)||{};if(a==null)return{};const u=Vt(f),g={x:n,y:o},m=ut(r),x=dt(m),d=await i.getDimensions(a),w=m==="y",y=w?"top":"left",h=w?"bottom":"right",v=w?"clientHeight":"clientWidth",b=s.reference[x]+s.reference[m]-g[m]-s.floating[x],C=g[m]-s.reference[m],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a));let T=R?R[v]:0;(!T||!await(i.isElement==null?void 0:i.isElement(R)))&&(T=c.floating[v]||s.floating[x]);const N=b/2-C/2,W=T/2-d[x]/2-1,L=fe(u[y],W),k=fe(u[h],W),H=L,_=T-d[x]-k,O=T/2-d[x]/2+N,F=Qe(H,O,_),E=!l.arrow&&Ce(r)!=null&&O!==F&&s.reference[x]/2-(O<H?L:k)-d[x]/2<0,I=E?O<H?O-H:O-_:0;return{[m]:g[m]+I,data:{[m]:F,centerOffset:O-F-I,...E&&{alignmentOffset:I}},reset:E}}}),ao=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:d=!0,...w}=se(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ce(r),h=ne(c),v=ce(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(a.floating)),C=g||(v||!d?[He(c)]:Qn(c)),R=x!=="none";!g&&R&&C.push(...oo(c,d,x,b));const T=[c,...C],N=await l.detectOverflow(t,w),W=[];let L=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&W.push(N[y]),u){const O=Jn(r,i,b);W.push(N[O[0]],N[O[1]])}if(L=[...L,{placement:r,overflows:W}],!W.every(O=>O<=0)){var k,H;const O=(((k=s.flip)==null?void 0:k.index)||0)+1,F=T[O];if(F&&(!(u==="alignment"?h!==ne(F):!1)||L.every(A=>ne(A.placement)===h?A.overflows[0]>0:!0)))return{data:{index:O,overflows:L},reset:{placement:F}};let E=(H=L.filter(I=>I.overflows[0]<=0).sort((I,A)=>I.overflows[1]-A.overflows[1])[0])==null?void 0:H.placement;if(!E)switch(m){case"bestFit":{var _;const I=(_=L.filter(A=>{if(R){const V=ne(A.placement);return V===h||V==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((A,V)=>A[1]-V[1])[0])==null?void 0:_[0];I&&(E=I);break}case"initialPlacement":E=c;break}if(r!==E)return{reset:{placement:E}}}return{}}}};function Pt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tt(e){return Gn.some(t=>e[t]>=0)}const fo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=se(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=Pt(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Tt(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=Pt(i,n.floating);return{data:{escapedOffsets:c,escaped:Tt(c)}}}default:return{}}}}},Bt=new Set(["left","top"]);async function uo(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=ce(n),c=Ce(n),l=ne(n)==="y",a=Bt.has(i)?-1:1,f=s&&l?-1:1,u=se(t,e);let{mainAxis:g,crossAxis:m,alignmentAxis:x}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof x=="number"&&(m=c==="end"?x*-1:x),l?{x:m*f,y:g*a}:{x:g*a,y:m*f}}const po=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,l=await uo(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:i}}}}},mo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x:h,y:v}=y;return{x:h,y:v}}},...a}=se(e,t),f={x:n,y:o},u=await s.detectOverflow(t,a),g=ne(ce(r)),m=ft(g);let x=f[m],d=f[g];if(i){const y=m==="y"?"top":"left",h=m==="y"?"bottom":"right",v=x+u[y],b=x-u[h];x=Qe(v,x,b)}if(c){const y=g==="y"?"top":"left",h=g==="y"?"bottom":"right",v=d+u[y],b=d-u[h];d=Qe(v,d,b)}const w=l.fn({...t,[m]:x,[g]:d});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[m]:i,[g]:c}}}}}},ho=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:l=!0,crossAxis:a=!0}=se(e,t),f={x:n,y:o},u=ne(r),g=ft(u);let m=f[g],x=f[u];const d=se(c,t),w=typeof d=="number"?{mainAxis:d,crossAxis:0}:{mainAxis:0,crossAxis:0,...d};if(l){const v=g==="y"?"height":"width",b=s.reference[g]-s.floating[v]+w.mainAxis,C=s.reference[g]+s.reference[v]-w.mainAxis;m<b?m=b:m>C&&(m=C)}if(a){var y,h;const v=g==="y"?"width":"height",b=Bt.has(ce(r)),C=s.reference[u]-s.floating[v]+(b&&((y=i.offset)==null?void 0:y[u])||0)+(b?0:w.crossAxis),R=s.reference[u]+s.reference[v]+(b?0:((h=i.offset)==null?void 0:h[u])||0)-(b?w.crossAxis:0);x<C?x=C:x>R&&(x=R)}return{[g]:m,[u]:x}}}},go=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:l=()=>{},...a}=se(e,t),f=await i.detectOverflow(t,a),u=ce(r),g=Ce(r),m=ne(r)==="y",{width:x,height:d}=s.floating;let w,y;u==="top"||u==="bottom"?(w=u,y=g===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(y=u,w=g==="end"?"top":"bottom");const h=d-f.top-f.bottom,v=x-f.left-f.right,b=fe(d-f[w],h),C=fe(x-f[y],v),R=!t.middlewareData.shift;let T=b,N=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=v),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=h),R&&!g){const L=q(f.left,0),k=q(f.right,0),H=q(f.top,0),_=q(f.bottom,0);m?N=x-2*(L!==0||k!==0?L+k:q(f.left,f.right)):T=d-2*(H!==0||_!==0?H+_:q(f.top,f.bottom))}await l({...t,availableWidth:N,availableHeight:T});const W=await i.getDimensions(c.floating);return x!==W.width||d!==W.height?{reset:{rects:!0}}:{}}}};function Fe(){return typeof window<"u"}function Re(e){return Wt(e)?(e.nodeName||"").toLowerCase():"#document"}function G(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function re(e){var t;return(t=(Wt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wt(e){return Fe()?e instanceof Node||e instanceof G(e).Node:!1}function Q(e){return Fe()?e instanceof Element||e instanceof G(e).Element:!1}function le(e){return Fe()?e instanceof HTMLElement||e instanceof G(e).HTMLElement:!1}function Et(e){return!Fe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof G(e).ShadowRoot}function Me(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function xo(e){return/^(table|td|th)$/.test(Re(e))}function $e(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const wo=/transform|translate|scale|rotate|perspective|filter/,vo=/paint|layout|strict|content/,ge=e=>!!e&&e!=="none";let qe;function pt(e){const t=Q(e)?ee(e):e;return ge(t.transform)||ge(t.translate)||ge(t.scale)||ge(t.rotate)||ge(t.perspective)||!mt()&&(ge(t.backdropFilter)||ge(t.filter))||wo.test(t.willChange||"")||vo.test(t.contain||"")}function yo(e){let t=de(e);for(;le(t)&&!be(t);){if(pt(t))return t;if($e(t))return null;t=de(t)}return null}function mt(){return qe==null&&(qe=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qe}function be(e){return/^(html|body|#document)$/.test(Re(e))}function ee(e){return G(e).getComputedStyle(e)}function ze(e){return Q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function de(e){if(Re(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||re(e);return Et(t)?t.host:t}function Ft(e){const t=de(e);return be(t)?e.ownerDocument?e.ownerDocument.body:e.body:le(t)&&Me(t)?t:Ft(t)}function _e(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Ft(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=G(r);if(s){const c=tt(i);return t.concat(i,i.visualViewport||[],Me(r)?r:[],c&&n?_e(c):[])}else return t.concat(r,_e(r,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $t(e){const t=ee(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=le(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=ke(n)!==s||ke(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function ht(e){return Q(e)?e:e.contextElement}function Se(e){const t=ht(e);if(!le(t))return oe(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=$t(t);let i=(s?ke(n.width):n.width)/o,c=(s?ke(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const So=oe(0);function zt(e){const t=G(e);return!mt()||!t.visualViewport?So:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==G(e)?!1:t}function xe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=ht(e);let i=oe(1);t&&(o?Q(o)&&(i=Se(o)):i=Se(e));const c=bo(s,n,o)?zt(s):oe(0);let l=(r.left+c.x)/i.x,a=(r.top+c.y)/i.y,f=r.width/i.x,u=r.height/i.y;if(s){const g=G(s),m=o&&Q(o)?G(o):o;let x=g,d=tt(x);for(;d&&o&&m!==x;){const w=Se(d),y=d.getBoundingClientRect(),h=ee(d),v=y.left+(d.clientLeft+parseFloat(h.paddingLeft))*w.x,b=y.top+(d.clientTop+parseFloat(h.paddingTop))*w.y;l*=w.x,a*=w.y,f*=w.x,u*=w.y,l+=v,a+=b,x=G(d),d=tt(x)}}return Ve({width:f,height:u,x:l,y:a})}function Ue(e,t){const n=ze(e).scrollLeft;return t?t.left+n:xe(re(e)).left+n}function Ut(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ue(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Co(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=re(o),c=t?$e(t.floating):!1;if(o===i||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=oe(1);const f=oe(0),u=le(o);if((u||!u&&!s)&&((Re(o)!=="body"||Me(i))&&(l=ze(o)),u)){const m=xe(o);a=Se(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}const g=i&&!u&&!s?Ut(i,l):oe(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+f.x+g.x,y:n.y*a.y-l.scrollTop*a.y+f.y+g.y}}function Ro(e){return Array.from(e.getClientRects())}function Ao(e){const t=re(e),n=ze(e),o=e.ownerDocument.body,r=q(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=q(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Ue(e);const c=-n.scrollTop;return ee(o).direction==="rtl"&&(i+=q(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const Ot=25;function Po(e,t){const n=G(e),o=re(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,l=0;if(r){s=r.width,i=r.height;const f=mt();(!f||f&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const a=Ue(o);if(a<=0){const f=o.ownerDocument,u=f.body,g=getComputedStyle(u),m=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(o.clientWidth-u.clientWidth-m);x<=Ot&&(s-=x)}else a<=Ot&&(s+=a);return{width:s,height:i,x:c,y:l}}function To(e,t){const n=xe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=le(e)?Se(e):oe(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,l=r*s.x,a=o*s.y;return{width:i,height:c,x:l,y:a}}function It(e,t,n){let o;if(t==="viewport")o=Po(e,n);else if(t==="document")o=Ao(re(e));else if(Q(t))o=To(t,n);else{const r=zt(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ve(o)}function Kt(e,t){const n=de(e);return n===t||!Q(n)||be(n)?!1:ee(n).position==="fixed"||Kt(n,t)}function Eo(e,t){const n=t.get(e);if(n)return n;let o=_e(e,[],!1).filter(c=>Q(c)&&Re(c)!=="body"),r=null;const s=ee(e).position==="fixed";let i=s?de(e):e;for(;Q(i)&&!be(i);){const c=ee(i),l=pt(i);!l&&c.position==="fixed"&&(r=null),(s?!l&&!r:!l&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Me(i)&&!l&&Kt(e,i))?o=o.filter(f=>f!==i):r=c,i=de(i)}return t.set(e,o),o}function Oo(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?$e(t)?[]:Eo(t,this._c):[].concat(n),o],c=It(t,i[0],r);let l=c.top,a=c.right,f=c.bottom,u=c.left;for(let g=1;g<i.length;g++){const m=It(t,i[g],r);l=q(m.top,l),a=fe(m.right,a),f=fe(m.bottom,f),u=q(m.left,u)}return{width:a-u,height:f-l,x:u,y:l}}function Io(e){const{width:t,height:n}=$t(e);return{width:t,height:n}}function No(e,t,n){const o=le(t),r=re(t),s=n==="fixed",i=xe(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=oe(0);function a(){l.x=Ue(r)}if(o||!o&&!s)if((Re(t)!=="body"||Me(r))&&(c=ze(t)),o){const m=xe(t,!0,s,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else r&&a();s&&!o&&r&&a();const f=r&&!o&&!s?Ut(r,c):oe(0),u=i.left+c.scrollLeft-l.x-f.x,g=i.top+c.scrollTop-l.y-f.y;return{x:u,y:g,width:i.width,height:i.height}}function Ge(e){return ee(e).position==="static"}function Nt(e,t){if(!le(e)||ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return re(e)===n&&(n=n.ownerDocument.body),n}function Yt(e,t){const n=G(e);if($e(e))return n;if(!le(e)){let r=de(e);for(;r&&!be(r);){if(Q(r)&&!Ge(r))return r;r=de(r)}return n}let o=Nt(e,t);for(;o&&xo(o)&&Ge(o);)o=Nt(o,t);return o&&be(o)&&Ge(o)&&!pt(o)?n:o||yo(e)||n}const _o=async function(e){const t=this.getOffsetParent||Yt,n=this.getDimensions,o=await n(e.floating);return{reference:No(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Mo(e){return ee(e).direction==="rtl"}const Do={convertOffsetParentRelativeRectToViewportRelativeRect:Co,getDocumentElement:re,getClippingRect:Oo,getOffsetParent:Yt,getElementRects:_o,getClientRects:Ro,getDimensions:Io,getScale:Se,isElement:Q,isRTL:Mo};function Xt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Lo(e,t){let n=null,o;const r=re(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const a=e.getBoundingClientRect(),{left:f,top:u,width:g,height:m}=a;if(c||t(),!g||!m)return;const x=Le(u),d=Le(r.clientWidth-(f+g)),w=Le(r.clientHeight-(u+m)),y=Le(f),v={rootMargin:-x+"px "+-d+"px "+-w+"px "+-y+"px",threshold:q(0,fe(1,l))||1};let b=!0;function C(R){const T=R[0].intersectionRatio;if(T!==l){if(!b)return i();T?i(!1,T):o=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Xt(a,e.getBoundingClientRect())&&i(),b=!1}try{n=new IntersectionObserver(C,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,v)}n.observe(e)}return i(!0),s}function jo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=ht(e),f=r||s?[...a?_e(a):[],...t?_e(t):[]]:[];f.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const u=a&&c?Lo(a,n):null;let g=-1,m=null;i&&(m=new ResizeObserver(y=>{let[h]=y;h&&h.target===a&&m&&t&&(m.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),a&&!l&&m.observe(a),t&&m.observe(t));let x,d=l?xe(e):null;l&&w();function w(){const y=xe(e);d&&!Xt(d,y)&&n(),d=y,x=requestAnimationFrame(w)}return n(),()=>{var y;f.forEach(h=>{r&&h.removeEventListener("scroll",n),s&&h.removeEventListener("resize",n)}),u==null||u(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(x)}}const ko=po,Ho=mo,Vo=ao,Bo=go,Wo=fo,_t=lo,Fo=ho,$o=(e,t,n)=>{const o=new Map,r={platform:Do,...n},s={...r.platform,_c:o};return co(e,t,{...r,platform:s})};var zo=typeof document<"u",Uo=function(){},je=zo?p.useLayoutEffect:Uo;function Be(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Be(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Be(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function qt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mt(e,t){const n=qt(e);return Math.round(t*n)/n}function Ze(e){const t=p.useRef(e);return je(()=>{t.current=e}),t}function Ko(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[f,u]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,m]=p.useState(o);Be(g,o)||m(o);const[x,d]=p.useState(null),[w,y]=p.useState(null),h=p.useCallback(A=>{A!==R.current&&(R.current=A,d(A))},[]),v=p.useCallback(A=>{A!==T.current&&(T.current=A,y(A))},[]),b=s||x,C=i||w,R=p.useRef(null),T=p.useRef(null),N=p.useRef(f),W=l!=null,L=Ze(l),k=Ze(r),H=Ze(a),_=p.useCallback(()=>{if(!R.current||!T.current)return;const A={placement:t,strategy:n,middleware:g};k.current&&(A.platform=k.current),$o(R.current,T.current,A).then(V=>{const K={...V,isPositioned:H.current!==!1};O.current&&!Be(N.current,K)&&(N.current=K,lt.flushSync(()=>{u(K)}))})},[g,t,n,k,H]);je(()=>{a===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,u(A=>({...A,isPositioned:!1})))},[a]);const O=p.useRef(!1);je(()=>(O.current=!0,()=>{O.current=!1}),[]),je(()=>{if(b&&(R.current=b),C&&(T.current=C),b&&C){if(L.current)return L.current(b,C,_);_()}},[b,C,_,L,W]);const F=p.useMemo(()=>({reference:R,floating:T,setReference:h,setFloating:v}),[h,v]),E=p.useMemo(()=>({reference:b,floating:C}),[b,C]),I=p.useMemo(()=>{const A={position:n,left:0,top:0};if(!E.floating)return A;const V=Mt(E.floating,f.x),K=Mt(E.floating,f.y);return c?{...A,transform:"translate("+V+"px, "+K+"px)",...qt(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:K}},[n,c,E.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:_,refs:F,elements:E,floatingStyles:I}),[f,_,F,E,I])}const Yo=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?_t({element:o.current,padding:r}).fn(n):{}:o?_t({element:o,padding:r}).fn(n):{}}}},Xo=(e,t)=>{const n=ko(e);return{name:n.name,fn:n.fn,options:[e,t]}},qo=(e,t)=>{const n=Ho(e);return{name:n.name,fn:n.fn,options:[e,t]}},Go=(e,t)=>({fn:Fo(e).fn,options:[e,t]}),Zo=(e,t)=>{const n=Vo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jo=(e,t)=>{const n=Bo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qo=(e,t)=>{const n=Wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},er=(e,t)=>{const n=Yo(e);return{name:n.name,fn:n.fn,options:[e,t]}};var tr="Arrow",Gt=p.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return S.jsx(z.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});Gt.displayName=tr;var nr=Gt;function or(e){const[t,n]=p.useState(void 0);return J(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,c;if("borderBoxSize"in s){const l=s.borderBoxSize,a=Array.isArray(l)?l[0]:l;i=a.inlineSize,c=a.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var gt="Popper",[Zt,Jt]=ct(gt),[rr,Qt]=Zt(gt),en=e=>{const{__scopePopper:t,children:n}=e,[o,r]=p.useState(null);return S.jsx(rr,{scope:t,anchor:o,onAnchorChange:r,children:n})};en.displayName=gt;var tn="PopperAnchor",nn=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Qt(tn,n),i=p.useRef(null),c=Y(t,i),l=p.useRef(null);return p.useEffect(()=>{const a=l.current;l.current=(o==null?void 0:o.current)||i.current,a!==l.current&&s.onAnchorChange(l.current)}),o?null:S.jsx(z.div,{...r,ref:c})});nn.displayName=tn;var xt="PopperContent",[ir,sr]=Zt(xt),on=p.forwardRef((e,t)=>{var P,B,U,j,M,D;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:a=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:g=!1,updatePositionStrategy:m="optimized",onPlaced:x,...d}=e,w=Qt(xt,n),[y,h]=p.useState(null),v=Y(t,X=>h(X)),[b,C]=p.useState(null),R=or(b),T=(R==null?void 0:R.width)??0,N=(R==null?void 0:R.height)??0,W=o+(s!=="center"?"-"+s:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(a)?a:[a],H=k.length>0,_={padding:L,boundary:k.filter(lr),altBoundary:H},{refs:O,floatingStyles:F,placement:E,isPositioned:I,middlewareData:A}=Ko({strategy:"fixed",placement:W,whileElementsMounted:(...X)=>jo(...X,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[Xo({mainAxis:r+N,alignmentAxis:i}),l&&qo({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Go():void 0,..._}),l&&Zo({..._}),Jo({..._,apply:({elements:X,rects:te,availableWidth:Ee,availableHeight:Oe})=>{const{width:Ie,height:jn}=te.reference,De=X.floating.style;De.setProperty("--radix-popper-available-width",`${Ee}px`),De.setProperty("--radix-popper-available-height",`${Oe}px`),De.setProperty("--radix-popper-anchor-width",`${Ie}px`),De.setProperty("--radix-popper-anchor-height",`${jn}px`)}}),b&&er({element:b,padding:c}),ar({arrowWidth:T,arrowHeight:N}),g&&Qo({strategy:"referenceHidden",..._})]}),[V,K]=cn(E),ie=Ht(x);J(()=>{I&&(ie==null||ie())},[I,ie]);const Pe=(P=A.arrow)==null?void 0:P.x,Te=(B=A.arrow)==null?void 0:B.y,ae=((U=A.arrow)==null?void 0:U.centerOffset)!==0,[ye,me]=p.useState();return J(()=>{y&&me(window.getComputedStyle(y).zIndex)},[y]),S.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:I?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[(j=A.transformOrigin)==null?void 0:j.x,(M=A.transformOrigin)==null?void 0:M.y].join(" "),...((D=A.hide)==null?void 0:D.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(ir,{scope:n,placedSide:V,onArrowChange:C,arrowX:Pe,arrowY:Te,shouldHideArrow:ae,children:S.jsx(z.div,{"data-side":V,"data-align":K,...d,ref:v,style:{...d.style,animation:I?void 0:"none"}})})})});on.displayName=xt;var rn="PopperArrow",cr={top:"bottom",right:"left",bottom:"top",left:"right"},sn=p.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=sr(rn,o),i=cr[s.placedSide];return S.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:S.jsx(nr,{...r,ref:n,style:{...r.style,display:"block"}})})});sn.displayName=rn;function lr(e){return e!==null}var ar=e=>({name:"transformOrigin",options:e,fn(t){var w,y,h;const{placement:n,rects:o,middlewareData:r}=t,i=((w=r.arrow)==null?void 0:w.centerOffset)!==0,c=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[a,f]=cn(n),u={start:"0%",center:"50%",end:"100%"}[f],g=(((y=r.arrow)==null?void 0:y.x)??0)+c/2,m=(((h=r.arrow)==null?void 0:h.y)??0)+l/2;let x="",d="";return a==="bottom"?(x=i?u:`${g}px`,d=`${-l}px`):a==="top"?(x=i?u:`${g}px`,d=`${o.floating.height+l}px`):a==="right"?(x=`${-l}px`,d=i?u:`${m}px`):a==="left"&&(x=`${o.floating.width+l}px`,d=i?u:`${m}px`),{data:{x,y:d}}}});function cn(e){const[t,n="center"]=e.split("-");return[t,n]}var fr=en,dr=nn,ur=on,pr=sn;function mr(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ln=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),hr="VisuallyHidden",gr=p.forwardRef((e,t)=>S.jsx(z.span,{...e,ref:t,style:{...ln,...e.style}}));gr.displayName=hr;var xr=[" ","Enter","ArrowUp","ArrowDown"],wr=[" ","Enter"],we="Select",[Ke,Ye,vr]=Yn(we),[Ae]=ct(we,[vr,Jt]),Xe=Jt(),[yr,ue]=Ae(we),[Sr,br]=Ae(we),an=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:i,defaultValue:c,onValueChange:l,dir:a,name:f,autoComplete:u,disabled:g,required:m,form:x}=e,d=Xe(t),[w,y]=p.useState(null),[h,v]=p.useState(null),[b,C]=p.useState(!1),R=qn(a),[T,N]=yt({prop:o,defaultProp:r??!1,onChange:s,caller:we}),[W,L]=yt({prop:i,defaultProp:c,onChange:l,caller:we}),k=p.useRef(null),H=w?x||!!w.closest("form"):!0,[_,O]=p.useState(new Set),F=Array.from(_).map(E=>E.props.value).join(";");return S.jsx(fr,{...d,children:S.jsxs(yr,{required:m,scope:t,trigger:w,onTriggerChange:y,valueNode:h,onValueNodeChange:v,valueNodeHasChildren:b,onValueNodeHasChildrenChange:C,contentId:at(),value:W,onValueChange:L,open:T,onOpenChange:N,dir:R,triggerPointerDownPosRef:k,disabled:g,children:[S.jsx(Ke.Provider,{scope:t,children:S.jsx(Sr,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(E=>{O(I=>new Set(I).add(E))},[]),onNativeOptionRemove:p.useCallback(E=>{O(I=>{const A=new Set(I);return A.delete(E),A})},[]),children:n})}),H?S.jsxs(Nn,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:u,value:W,onChange:E=>L(E.target.value),disabled:g,form:x,children:[W===void 0?S.jsx("option",{value:""}):null,Array.from(_)]},F):null]})})};an.displayName=we;var fn="SelectTrigger",dn=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=Xe(n),i=ue(fn,n),c=i.disabled||o,l=Y(t,i.onTriggerChange),a=Ye(n),f=p.useRef("touch"),[u,g,m]=Mn(d=>{const w=a().filter(v=>!v.disabled),y=w.find(v=>v.value===i.value),h=Dn(w,d,y);h!==void 0&&i.onValueChange(h.value)}),x=d=>{c||(i.onOpenChange(!0),m()),d&&(i.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return S.jsx(dr,{asChild:!0,...s,children:S.jsx(z.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":_n(i.value)?"":void 0,...r,ref:l,onClick:$(r.onClick,d=>{d.currentTarget.focus(),f.current!=="mouse"&&x(d)}),onPointerDown:$(r.onPointerDown,d=>{f.current=d.pointerType;const w=d.target;w.hasPointerCapture(d.pointerId)&&w.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(x(d),d.preventDefault())}),onKeyDown:$(r.onKeyDown,d=>{const w=u.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&g(d.key),!(w&&d.key===" ")&&xr.includes(d.key)&&(x(),d.preventDefault())})})})});dn.displayName=fn;var un="SelectValue",pn=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:i="",...c}=e,l=ue(un,n),{onValueNodeHasChildrenChange:a}=l,f=s!==void 0,u=Y(t,l.onValueNodeChange);return J(()=>{a(f)},[a,f]),S.jsx(z.span,{...c,ref:u,style:{pointerEvents:"none"},children:_n(l.value)?S.jsx(S.Fragment,{children:i}):s})});pn.displayName=un;var Cr="SelectIcon",mn=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return S.jsx(z.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});mn.displayName=Cr;var Rr="SelectPortal",hn=e=>S.jsx(kn,{asChild:!0,...e});hn.displayName=Rr;var ve="SelectContent",gn=p.forwardRef((e,t)=>{const n=ue(ve,e.__scopeSelect),[o,r]=p.useState();if(J(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?lt.createPortal(S.jsx(xn,{scope:e.__scopeSelect,children:S.jsx(Ke.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),s):null}return S.jsx(wn,{...e,ref:t})});gn.displayName=ve;var Z=10,[xn,pe]=Ae(ve),Ar="SelectContentImpl",Pr=Je("SelectContent.RemoveScroll"),wn=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:i,side:c,sideOffset:l,align:a,alignOffset:f,arrowPadding:u,collisionBoundary:g,collisionPadding:m,sticky:x,hideWhenDetached:d,avoidCollisions:w,...y}=e,h=ue(ve,n),[v,b]=p.useState(null),[C,R]=p.useState(null),T=Y(t,P=>b(P)),[N,W]=p.useState(null),[L,k]=p.useState(null),H=Ye(n),[_,O]=p.useState(!1),F=p.useRef(!1);p.useEffect(()=>{if(v)return Hn(v)},[v]),Vn();const E=p.useCallback(P=>{const[B,...U]=H().map(D=>D.ref.current),[j]=U.slice(-1),M=document.activeElement;for(const D of P)if(D===M||(D==null||D.scrollIntoView({block:"nearest"}),D===B&&C&&(C.scrollTop=0),D===j&&C&&(C.scrollTop=C.scrollHeight),D==null||D.focus(),document.activeElement!==M))return},[H,C]),I=p.useCallback(()=>E([N,v]),[E,N,v]);p.useEffect(()=>{_&&I()},[_,I]);const{onOpenChange:A,triggerPointerDownPosRef:V}=h;p.useEffect(()=>{if(v){let P={x:0,y:0};const B=j=>{var M,D;P={x:Math.abs(Math.round(j.pageX)-(((M=V.current)==null?void 0:M.x)??0)),y:Math.abs(Math.round(j.pageY)-(((D=V.current)==null?void 0:D.y)??0))}},U=j=>{P.x<=10&&P.y<=10?j.preventDefault():v.contains(j.target)||A(!1),document.removeEventListener("pointermove",B),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",B),document.addEventListener("pointerup",U,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",B),document.removeEventListener("pointerup",U,{capture:!0})}}},[v,A,V]),p.useEffect(()=>{const P=()=>A(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[A]);const[K,ie]=Mn(P=>{const B=H().filter(M=>!M.disabled),U=B.find(M=>M.ref.current===document.activeElement),j=Dn(B,P,U);j&&setTimeout(()=>j.ref.current.focus())}),Pe=p.useCallback((P,B,U)=>{const j=!F.current&&!U;(h.value!==void 0&&h.value===B||j)&&(W(P),j&&(F.current=!0))},[h.value]),Te=p.useCallback(()=>v==null?void 0:v.focus(),[v]),ae=p.useCallback((P,B,U)=>{const j=!F.current&&!U;(h.value!==void 0&&h.value===B||j)&&k(P)},[h.value]),ye=o==="popper"?nt:vn,me=ye===nt?{side:c,sideOffset:l,align:a,alignOffset:f,arrowPadding:u,collisionBoundary:g,collisionPadding:m,sticky:x,hideWhenDetached:d,avoidCollisions:w}:{};return S.jsx(xn,{scope:n,content:v,viewport:C,onViewportChange:R,itemRefCallback:Pe,selectedItem:N,onItemLeave:Te,itemTextRefCallback:ae,focusSelectedItem:I,selectedItemText:L,position:o,isPositioned:_,searchRef:K,children:S.jsx(Bn,{as:Pr,allowPinchZoom:!0,children:S.jsx(Wn,{asChild:!0,trapped:h.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:$(r,P=>{var B;(B=h.trigger)==null||B.focus({preventScroll:!0}),P.preventDefault()}),children:S.jsx(Fn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:S.jsx(ye,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:P=>P.preventDefault(),...y,...me,onPlaced:()=>O(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:$(y.onKeyDown,P=>{const B=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!B&&P.key.length===1&&ie(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let j=H().filter(M=>!M.disabled).map(M=>M.ref.current);if(["ArrowUp","End"].includes(P.key)&&(j=j.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const M=P.target,D=j.indexOf(M);j=j.slice(D+1)}setTimeout(()=>E(j)),P.preventDefault()}})})})})})})});wn.displayName=Ar;var Tr="SelectItemAlignedPosition",vn=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=ue(ve,n),i=pe(ve,n),[c,l]=p.useState(null),[a,f]=p.useState(null),u=Y(t,T=>f(T)),g=Ye(n),m=p.useRef(!1),x=p.useRef(!0),{viewport:d,selectedItem:w,selectedItemText:y,focusSelectedItem:h}=i,v=p.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&a&&d&&w&&y){const T=s.trigger.getBoundingClientRect(),N=a.getBoundingClientRect(),W=s.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(s.dir!=="rtl"){const M=L.left-N.left,D=W.left-M,X=T.left-D,te=T.width+X,Ee=Math.max(te,N.width),Oe=window.innerWidth-Z,Ie=bt(D,[Z,Math.max(Z,Oe-Ee)]);c.style.minWidth=te+"px",c.style.left=Ie+"px"}else{const M=N.right-L.right,D=window.innerWidth-W.right-M,X=window.innerWidth-T.right-D,te=T.width+X,Ee=Math.max(te,N.width),Oe=window.innerWidth-Z,Ie=bt(D,[Z,Math.max(Z,Oe-Ee)]);c.style.minWidth=te+"px",c.style.right=Ie+"px"}const k=g(),H=window.innerHeight-Z*2,_=d.scrollHeight,O=window.getComputedStyle(a),F=parseInt(O.borderTopWidth,10),E=parseInt(O.paddingTop,10),I=parseInt(O.borderBottomWidth,10),A=parseInt(O.paddingBottom,10),V=F+E+_+A+I,K=Math.min(w.offsetHeight*5,V),ie=window.getComputedStyle(d),Pe=parseInt(ie.paddingTop,10),Te=parseInt(ie.paddingBottom,10),ae=T.top+T.height/2-Z,ye=H-ae,me=w.offsetHeight/2,P=w.offsetTop+me,B=F+E+P,U=V-B;if(B<=ae){const M=k.length>0&&w===k[k.length-1].ref.current;c.style.bottom="0px";const D=a.clientHeight-d.offsetTop-d.offsetHeight,X=Math.max(ye,me+(M?Te:0)+D+I),te=B+X;c.style.height=te+"px"}else{const M=k.length>0&&w===k[0].ref.current;c.style.top="0px";const X=Math.max(ae,F+d.offsetTop+(M?Pe:0)+me)+U;c.style.height=X+"px",d.scrollTop=B-ae+d.offsetTop}c.style.margin=`${Z}px 0`,c.style.minHeight=K+"px",c.style.maxHeight=H+"px",o==null||o(),requestAnimationFrame(()=>m.current=!0)}},[g,s.trigger,s.valueNode,c,a,d,w,y,s.dir,o]);J(()=>v(),[v]);const[b,C]=p.useState();J(()=>{a&&C(window.getComputedStyle(a).zIndex)},[a]);const R=p.useCallback(T=>{T&&x.current===!0&&(v(),h==null||h(),x.current=!1)},[v,h]);return S.jsx(Or,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:R,children:S.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:S.jsx(z.div,{...r,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});vn.displayName=Tr;var Er="SelectPopperPosition",nt=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Z,...s}=e,i=Xe(n);return S.jsx(ur,{...i,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nt.displayName=Er;var[Or,wt]=Ae(ve,{}),ot="SelectViewport",yn=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=pe(ot,n),i=wt(ot,n),c=Y(t,s.onViewportChange),l=p.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),S.jsx(Ke.Slot,{scope:n,children:S.jsx(z.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:$(r.onScroll,a=>{const f=a.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:g}=i;if(g!=null&&g.current&&u){const m=Math.abs(l.current-f.scrollTop);if(m>0){const x=window.innerHeight-Z*2,d=parseFloat(u.style.minHeight),w=parseFloat(u.style.height),y=Math.max(d,w);if(y<x){const h=y+m,v=Math.min(x,h),b=h-v;u.style.height=v+"px",u.style.bottom==="0px"&&(f.scrollTop=b>0?b:0,u.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});yn.displayName=ot;var Sn="SelectGroup",[Ir,Nr]=Ae(Sn),_r=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=at();return S.jsx(Ir,{scope:n,id:r,children:S.jsx(z.div,{role:"group","aria-labelledby":r,...o,ref:t})})});_r.displayName=Sn;var bn="SelectLabel",Mr=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Nr(bn,n);return S.jsx(z.div,{id:r.id,...o,ref:t})});Mr.displayName=bn;var We="SelectItem",[Dr,Cn]=Ae(We),Rn=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...i}=e,c=ue(We,n),l=pe(We,n),a=c.value===o,[f,u]=p.useState(s??""),[g,m]=p.useState(!1),x=Y(t,h=>{var v;return(v=l.itemRefCallback)==null?void 0:v.call(l,h,o,r)}),d=at(),w=p.useRef("touch"),y=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(Dr,{scope:n,value:o,disabled:r,textId:d,isSelected:a,onItemTextChange:p.useCallback(h=>{u(v=>v||((h==null?void 0:h.textContent)??"").trim())},[]),children:S.jsx(Ke.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:S.jsx(z.div,{role:"option","aria-labelledby":d,"data-highlighted":g?"":void 0,"aria-selected":a&&g,"data-state":a?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:x,onFocus:$(i.onFocus,()=>m(!0)),onBlur:$(i.onBlur,()=>m(!1)),onClick:$(i.onClick,()=>{w.current!=="mouse"&&y()}),onPointerUp:$(i.onPointerUp,()=>{w.current==="mouse"&&y()}),onPointerDown:$(i.onPointerDown,h=>{w.current=h.pointerType}),onPointerMove:$(i.onPointerMove,h=>{var v;w.current=h.pointerType,r?(v=l.onItemLeave)==null||v.call(l):w.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$(i.onPointerLeave,h=>{var v;h.currentTarget===document.activeElement&&((v=l.onItemLeave)==null||v.call(l))}),onKeyDown:$(i.onKeyDown,h=>{var b;((b=l.searchRef)==null?void 0:b.current)!==""&&h.key===" "||(wr.includes(h.key)&&y(),h.key===" "&&h.preventDefault())})})})})});Rn.displayName=We;var Ne="SelectItemText",An=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,i=ue(Ne,n),c=pe(Ne,n),l=Cn(Ne,n),a=br(Ne,n),[f,u]=p.useState(null),g=Y(t,y=>u(y),l.onItemTextChange,y=>{var h;return(h=c.itemTextRefCallback)==null?void 0:h.call(c,y,l.value,l.disabled)}),m=f==null?void 0:f.textContent,x=p.useMemo(()=>S.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:d,onNativeOptionRemove:w}=a;return J(()=>(d(x),()=>w(x)),[d,w,x]),S.jsxs(S.Fragment,{children:[S.jsx(z.span,{id:l.textId,...s,ref:g}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?lt.createPortal(s.children,i.valueNode):null]})});An.displayName=Ne;var Pn="SelectItemIndicator",Tn=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Cn(Pn,n).isSelected?S.jsx(z.span,{"aria-hidden":!0,...o,ref:t}):null});Tn.displayName=Pn;var rt="SelectScrollUpButton",En=p.forwardRef((e,t)=>{const n=pe(rt,e.__scopeSelect),o=wt(rt,e.__scopeSelect),[r,s]=p.useState(!1),i=Y(t,o.onScrollButtonChange);return J(()=>{if(n.viewport&&n.isPositioned){let c=function(){const a=l.scrollTop>0;s(a)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?S.jsx(In,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});En.displayName=rt;var it="SelectScrollDownButton",On=p.forwardRef((e,t)=>{const n=pe(it,e.__scopeSelect),o=wt(it,e.__scopeSelect),[r,s]=p.useState(!1),i=Y(t,o.onScrollButtonChange);return J(()=>{if(n.viewport&&n.isPositioned){let c=function(){const a=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<a;s(f)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?S.jsx(In,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});On.displayName=it;var In=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=pe("SelectScrollButton",n),i=p.useRef(null),c=Ye(n),l=p.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return p.useEffect(()=>()=>l(),[l]),J(()=>{var f;const a=c().find(u=>u.ref.current===document.activeElement);(f=a==null?void 0:a.ref.current)==null||f.scrollIntoView({block:"nearest"})},[c]),S.jsx(z.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:$(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:$(r.onPointerMove,()=>{var a;(a=s.onItemLeave)==null||a.call(s),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:$(r.onPointerLeave,()=>{l()})})}),Lr="SelectSeparator",jr=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return S.jsx(z.div,{"aria-hidden":!0,...o,ref:t})});jr.displayName=Lr;var st="SelectArrow",kr=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Xe(n),s=ue(st,n),i=pe(st,n);return s.open&&i.position==="popper"?S.jsx(pr,{...r,...o,ref:t}):null});kr.displayName=st;var Hr="SelectBubbleInput",Nn=p.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=p.useRef(null),s=Y(o,r),i=mr(t);return p.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&f){const u=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(u)}},[i,t]),S.jsx(z.select,{...n,style:{...ln,...n.style},ref:s,defaultValue:t})});Nn.displayName=Hr;function _n(e){return e===""||e===void 0}function Mn(e){const t=Ht(e),n=p.useRef(""),o=p.useRef(0),r=p.useCallback(i=>{const c=n.current+i;t(c),(function l(a){n.current=a,window.clearTimeout(o.current),a!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=p.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function Dn(e,t,n){const r=t.length>1&&Array.from(t).every(a=>a===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Vr(e,Math.max(s,0));r.length===1&&(i=i.filter(a=>a!==n));const l=i.find(a=>a.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function Vr(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Br=an,Wr=dn,Fr=pn,$r=mn,zr=hn,Ur=gn,Kr=yn,Yr=Rn,Xr=An,qr=Tn,Gr=En,Zr=On;const Ln="__radix_empty_value__";function Dt(e){return typeof e=="string"||typeof e=="number"?String(e):p.Children.toArray(e).map(t=>typeof t=="string"||typeof t=="number"?String(t):"").join("")}function Jr(e){return p.Children.toArray(e).flatMap(t=>{if(!p.isValidElement(t))return[];const n=t;if(n.type!=="option")return[];const o=n.props.value??Dt(n.props.children);return[{value:String(o),label:Dt(n.props.children),disabled:n.props.disabled}]})}function Lt(e){return e===""||e===void 0||e===null?Ln:String(e)}function jt(e){return e===Ln?"":e}function ni({label:e,className:t,children:n,...o}){var a;const r=Jr(n),s=Lt(o.value??o.defaultValue??""),i=r.find(f=>f.value===jt(s)),c=(a=r.find(f=>f.value===""))==null?void 0:a.label,l=f=>{var g;const u=jt(f);(g=o.onChange)==null||g.call(o,{target:{value:u},currentTarget:{value:u}})};return S.jsxs("div",{className:"space-y-1.5",children:[e&&S.jsx("label",{className:"block text-sm font-medium text-foreground",children:e}),S.jsxs(Br,{value:s,onValueChange:l,disabled:o.disabled,name:o.name,children:[S.jsxs(Wr,{id:o.id,className:vt("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors","placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),children:[S.jsx(Fr,{placeholder:c,children:i==null?void 0:i.label}),S.jsx($r,{asChild:!0,children:S.jsx(St,{className:"h-4 w-4 opacity-50"})})]}),S.jsx(zr,{children:S.jsxs(Ur,{className:"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-fade-in",children:[S.jsx(Gr,{className:"flex cursor-default items-center justify-center py-1",children:S.jsx(Kn,{className:"h-4 w-4"})}),S.jsx(Kr,{className:"p-1",children:r.map(f=>S.jsxs(Yr,{value:Lt(f.value),disabled:f.disabled,className:vt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-accent/10 focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(qr,{children:S.jsx($n,{className:"h-4 w-4"})})}),S.jsx(Xr,{children:f.label})]},`${f.value}-${f.label}`))}),S.jsx(Zr,{className:"flex cursor-default items-center justify-center py-1",children:S.jsx(St,{className:"h-4 w-4"})})]})})]})]})}export{ni as S};
6
+ */const zn=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Un=jn("chevron-up",zn);function bt(e,[t,n]){return Math.min(n,Math.max(t,e))}function Kn(e){const t=e+"CollectionProvider",[n,o]=ct(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=u=>{const{scope:w,children:y}=u,h=he.useRef(null),v=he.useRef(new Map).current;return S.jsx(r,{scope:w,itemMap:v,collectionRef:h,children:y})};i.displayName=t;const c=e+"CollectionSlot",l=Je(c),a=he.forwardRef((u,w)=>{const{scope:y,children:h}=u,v=s(c,y),b=Y(w,v.collectionRef);return S.jsx(l,{ref:b,children:h})});a.displayName=c;const f=e+"CollectionItemSlot",d="data-radix-collection-item",g=Je(f),m=he.forwardRef((u,w)=>{const{scope:y,children:h,...v}=u,b=he.useRef(null),C=Y(w,b),R=s(f,y);return he.useEffect(()=>(R.itemMap.set(b,{ref:b,...v}),()=>void R.itemMap.delete(b))),S.jsx(g,{[d]:"",ref:C,children:h})});m.displayName=f;function x(u){const w=s(e+"CollectionConsumer",u);return he.useCallback(()=>{const h=w.collectionRef.current;if(!h)return[];const v=Array.from(h.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((R,T)=>v.indexOf(R.ref.current)-v.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:a,ItemSlot:m},x,o]}var Yn=p.createContext(void 0);function Xn(e){const t=p.useContext(Yn);return e||t||"ltr"}const Gn=["top","right","bottom","left"],fe=Math.min,G=Math.max,ke=Math.round,Le=Math.floor,oe=e=>({x:e,y:e}),qn={left:"right",right:"left",bottom:"top",top:"bottom"};function Qe(e,t,n){return G(e,fe(t,n))}function se(e,t){return typeof e=="function"?e(t):e}function ce(e){return e.split("-")[0]}function Ce(e){return e.split("-")[1]}function ft(e){return e==="x"?"y":"x"}function ut(e){return e==="y"?"height":"width"}function ne(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function dt(e){return ft(ne(e))}function Zn(e,t,n){n===void 0&&(n=!1);const o=Ce(e),r=dt(e),s=ut(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=He(i)),[i,He(i)]}function Jn(e){const t=He(e);return[et(e),t,et(t)]}function et(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ct=["left","right"],Rt=["right","left"],Qn=["top","bottom"],eo=["bottom","top"];function to(e,t,n){switch(e){case"top":case"bottom":return n?t?Rt:Ct:t?Ct:Rt;case"left":case"right":return t?Qn:eo;default:return[]}}function no(e,t,n,o){const r=Ce(e);let s=to(ce(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(et)))),s}function He(e){const t=ce(e);return qn[t]+e.slice(t.length)}function oo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ht(e){return typeof e!="number"?oo(e):{top:e,right:e,bottom:e,left:e}}function Ve(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function At(e,t,n){let{reference:o,floating:r}=e;const s=ne(t),i=dt(t),c=ut(i),l=ce(t),a=s==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let m;switch(l){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-r.width,y:d};break;default:m={x:o.x,y:o.y}}switch(Ce(t)){case"start":m[i]-=g*(n&&a?-1:1);break;case"end":m[i]+=g*(n&&a?-1:1);break}return m}async function ro(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:g=!1,padding:m=0}=se(t,e),x=Ht(m),w=c[g?d==="floating"?"reference":"floating":d],y=Ve(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:l})),h=d==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},C=Ve(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:h,offsetParent:v,strategy:l}):h);return{top:(y.top-C.top+x.top)/b.y,bottom:(C.bottom-y.bottom+x.bottom)/b.y,left:(y.left-C.left+x.left)/b.x,right:(C.right-y.right+x.right)/b.x}}const io=50,so=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:ro},l=await(i.isRTL==null?void 0:i.isRTL(t));let a=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:d}=At(a,o,l),g=o,m=0;const x={};for(let u=0;u<s.length;u++){const w=s[u];if(!w)continue;const{name:y,fn:h}=w,{x:v,y:b,data:C,reset:R}=await h({x:f,y:d,initialPlacement:o,placement:g,strategy:r,middlewareData:x,rects:a,platform:c,elements:{reference:e,floating:t}});f=v??f,d=b??d,x[y]={...x[y],...C},R&&m<io&&(m++,typeof R=="object"&&(R.placement&&(g=R.placement),R.rects&&(a=R.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):R.rects),{x:f,y:d}=At(a,g,l)),u=-1)}return{x:f,y:d,placement:g,strategy:r,middlewareData:x}},co=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:l}=t,{element:a,padding:f=0}=se(e,t)||{};if(a==null)return{};const d=Ht(f),g={x:n,y:o},m=dt(r),x=ut(m),u=await i.getDimensions(a),w=m==="y",y=w?"top":"left",h=w?"bottom":"right",v=w?"clientHeight":"clientWidth",b=s.reference[x]+s.reference[m]-g[m]-s.floating[x],C=g[m]-s.reference[m],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a));let T=R?R[v]:0;(!T||!await(i.isElement==null?void 0:i.isElement(R)))&&(T=c.floating[v]||s.floating[x]);const N=b/2-C/2,W=T/2-u[x]/2-1,L=fe(d[y],W),k=fe(d[h],W),H=L,_=T-u[x]-k,O=T/2-u[x]/2+N,F=Qe(H,O,_),E=!l.arrow&&Ce(r)!=null&&O!==F&&s.reference[x]/2-(O<H?L:k)-u[x]/2<0,I=E?O<H?O-H:O-_:0;return{[m]:g[m]+I,data:{[m]:F,centerOffset:O-F-I,...E&&{alignmentOffset:I}},reset:E}}}),lo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:u=!0,...w}=se(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=ce(r),h=ne(c),v=ce(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(a.floating)),C=g||(v||!u?[He(c)]:Jn(c)),R=x!=="none";!g&&R&&C.push(...no(c,u,x,b));const T=[c,...C],N=await l.detectOverflow(t,w),W=[];let L=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&W.push(N[y]),d){const O=Zn(r,i,b);W.push(N[O[0]],N[O[1]])}if(L=[...L,{placement:r,overflows:W}],!W.every(O=>O<=0)){var k,H;const O=(((k=s.flip)==null?void 0:k.index)||0)+1,F=T[O];if(F&&(!(d==="alignment"?h!==ne(F):!1)||L.every(A=>ne(A.placement)===h?A.overflows[0]>0:!0)))return{data:{index:O,overflows:L},reset:{placement:F}};let E=(H=L.filter(I=>I.overflows[0]<=0).sort((I,A)=>I.overflows[1]-A.overflows[1])[0])==null?void 0:H.placement;if(!E)switch(m){case"bestFit":{var _;const I=(_=L.filter(A=>{if(R){const V=ne(A.placement);return V===h||V==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(V=>V>0).reduce((V,K)=>V+K,0)]).sort((A,V)=>A[1]-V[1])[0])==null?void 0:_[0];I&&(E=I);break}case"initialPlacement":E=c;break}if(r!==E)return{reset:{placement:E}}}return{}}}};function Pt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tt(e){return Gn.some(t=>e[t]>=0)}const ao=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=se(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=Pt(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Tt(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=Pt(i,n.floating);return{data:{escapedOffsets:c,escaped:Tt(c)}}}default:return{}}}}},Vt=new Set(["left","top"]);async function fo(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=ce(n),c=Ce(n),l=ne(n)==="y",a=Vt.has(i)?-1:1,f=s&&l?-1:1,d=se(t,e);let{mainAxis:g,crossAxis:m,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof x=="number"&&(m=c==="end"?x*-1:x),l?{x:m*f,y:g*a}:{x:g*a,y:m*f}}const uo=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,l=await fo(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:i}}}}},po=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x:h,y:v}=y;return{x:h,y:v}}},...a}=se(e,t),f={x:n,y:o},d=await s.detectOverflow(t,a),g=ne(ce(r)),m=ft(g);let x=f[m],u=f[g];if(i){const y=m==="y"?"top":"left",h=m==="y"?"bottom":"right",v=x+d[y],b=x-d[h];x=Qe(v,x,b)}if(c){const y=g==="y"?"top":"left",h=g==="y"?"bottom":"right",v=u+d[y],b=u-d[h];u=Qe(v,u,b)}const w=l.fn({...t,[m]:x,[g]:u});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[m]:i,[g]:c}}}}}},mo=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:l=!0,crossAxis:a=!0}=se(e,t),f={x:n,y:o},d=ne(r),g=ft(d);let m=f[g],x=f[d];const u=se(c,t),w=typeof u=="number"?{mainAxis:u,crossAxis:0}:{mainAxis:0,crossAxis:0,...u};if(l){const v=g==="y"?"height":"width",b=s.reference[g]-s.floating[v]+w.mainAxis,C=s.reference[g]+s.reference[v]-w.mainAxis;m<b?m=b:m>C&&(m=C)}if(a){var y,h;const v=g==="y"?"width":"height",b=Vt.has(ce(r)),C=s.reference[d]-s.floating[v]+(b&&((y=i.offset)==null?void 0:y[d])||0)+(b?0:w.crossAxis),R=s.reference[d]+s.reference[v]+(b?0:((h=i.offset)==null?void 0:h[d])||0)-(b?w.crossAxis:0);x<C?x=C:x>R&&(x=R)}return{[g]:m,[d]:x}}}},ho=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:l=()=>{},...a}=se(e,t),f=await i.detectOverflow(t,a),d=ce(r),g=Ce(r),m=ne(r)==="y",{width:x,height:u}=s.floating;let w,y;d==="top"||d==="bottom"?(w=d,y=g===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(y=d,w=g==="end"?"top":"bottom");const h=u-f.top-f.bottom,v=x-f.left-f.right,b=fe(u-f[w],h),C=fe(x-f[y],v),R=!t.middlewareData.shift;let T=b,N=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=v),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=h),R&&!g){const L=G(f.left,0),k=G(f.right,0),H=G(f.top,0),_=G(f.bottom,0);m?N=x-2*(L!==0||k!==0?L+k:G(f.left,f.right)):T=u-2*(H!==0||_!==0?H+_:G(f.top,f.bottom))}await l({...t,availableWidth:N,availableHeight:T});const W=await i.getDimensions(c.floating);return x!==W.width||u!==W.height?{reset:{rects:!0}}:{}}}};function Fe(){return typeof window<"u"}function Re(e){return Bt(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function re(e){var t;return(t=(Bt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bt(e){return Fe()?e instanceof Node||e instanceof q(e).Node:!1}function Q(e){return Fe()?e instanceof Element||e instanceof q(e).Element:!1}function le(e){return Fe()?e instanceof HTMLElement||e instanceof q(e).HTMLElement:!1}function Et(e){return!Fe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof q(e).ShadowRoot}function Me(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function go(e){return/^(table|td|th)$/.test(Re(e))}function $e(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const xo=/transform|translate|scale|rotate|perspective|filter/,wo=/paint|layout|strict|content/,ge=e=>!!e&&e!=="none";let Ge;function pt(e){const t=Q(e)?ee(e):e;return ge(t.transform)||ge(t.translate)||ge(t.scale)||ge(t.rotate)||ge(t.perspective)||!mt()&&(ge(t.backdropFilter)||ge(t.filter))||xo.test(t.willChange||"")||wo.test(t.contain||"")}function vo(e){let t=ue(e);for(;le(t)&&!be(t);){if(pt(t))return t;if($e(t))return null;t=ue(t)}return null}function mt(){return Ge==null&&(Ge=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ge}function be(e){return/^(html|body|#document)$/.test(Re(e))}function ee(e){return q(e).getComputedStyle(e)}function ze(e){return Q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ue(e){if(Re(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||re(e);return Et(t)?t.host:t}function Wt(e){const t=ue(e);return be(t)?e.ownerDocument?e.ownerDocument.body:e.body:le(t)&&Me(t)?t:Wt(t)}function _e(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Wt(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=q(r);if(s){const c=tt(i);return t.concat(i,i.visualViewport||[],Me(r)?r:[],c&&n?_e(c):[])}else return t.concat(r,_e(r,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ft(e){const t=ee(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=le(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=ke(n)!==s||ke(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function ht(e){return Q(e)?e:e.contextElement}function Se(e){const t=ht(e);if(!le(t))return oe(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Ft(t);let i=(s?ke(n.width):n.width)/o,c=(s?ke(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const yo=oe(0);function $t(e){const t=q(e);return!mt()||!t.visualViewport?yo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function So(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==q(e)?!1:t}function xe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=ht(e);let i=oe(1);t&&(o?Q(o)&&(i=Se(o)):i=Se(e));const c=So(s,n,o)?$t(s):oe(0);let l=(r.left+c.x)/i.x,a=(r.top+c.y)/i.y,f=r.width/i.x,d=r.height/i.y;if(s){const g=q(s),m=o&&Q(o)?q(o):o;let x=g,u=tt(x);for(;u&&o&&m!==x;){const w=Se(u),y=u.getBoundingClientRect(),h=ee(u),v=y.left+(u.clientLeft+parseFloat(h.paddingLeft))*w.x,b=y.top+(u.clientTop+parseFloat(h.paddingTop))*w.y;l*=w.x,a*=w.y,f*=w.x,d*=w.y,l+=v,a+=b,x=q(u),u=tt(x)}}return Ve({width:f,height:d,x:l,y:a})}function Ue(e,t){const n=ze(e).scrollLeft;return t?t.left+n:xe(re(e)).left+n}function zt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ue(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function bo(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=re(o),c=t?$e(t.floating):!1;if(o===i||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=oe(1);const f=oe(0),d=le(o);if((d||!d&&!s)&&((Re(o)!=="body"||Me(i))&&(l=ze(o)),d)){const m=xe(o);a=Se(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}const g=i&&!d&&!s?zt(i,l):oe(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+f.x+g.x,y:n.y*a.y-l.scrollTop*a.y+f.y+g.y}}function Co(e){return Array.from(e.getClientRects())}function Ro(e){const t=re(e),n=ze(e),o=e.ownerDocument.body,r=G(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=G(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Ue(e);const c=-n.scrollTop;return ee(o).direction==="rtl"&&(i+=G(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const Ot=25;function Ao(e,t){const n=q(e),o=re(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,l=0;if(r){s=r.width,i=r.height;const f=mt();(!f||f&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const a=Ue(o);if(a<=0){const f=o.ownerDocument,d=f.body,g=getComputedStyle(d),m=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(o.clientWidth-d.clientWidth-m);x<=Ot&&(s-=x)}else a<=Ot&&(s+=a);return{width:s,height:i,x:c,y:l}}function Po(e,t){const n=xe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=le(e)?Se(e):oe(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,l=r*s.x,a=o*s.y;return{width:i,height:c,x:l,y:a}}function It(e,t,n){let o;if(t==="viewport")o=Ao(e,n);else if(t==="document")o=Ro(re(e));else if(Q(t))o=Po(t,n);else{const r=$t(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ve(o)}function Ut(e,t){const n=ue(e);return n===t||!Q(n)||be(n)?!1:ee(n).position==="fixed"||Ut(n,t)}function To(e,t){const n=t.get(e);if(n)return n;let o=_e(e,[],!1).filter(c=>Q(c)&&Re(c)!=="body"),r=null;const s=ee(e).position==="fixed";let i=s?ue(e):e;for(;Q(i)&&!be(i);){const c=ee(i),l=pt(i);!l&&c.position==="fixed"&&(r=null),(s?!l&&!r:!l&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Me(i)&&!l&&Ut(e,i))?o=o.filter(f=>f!==i):r=c,i=ue(i)}return t.set(e,o),o}function Eo(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?$e(t)?[]:To(t,this._c):[].concat(n),o],c=It(t,i[0],r);let l=c.top,a=c.right,f=c.bottom,d=c.left;for(let g=1;g<i.length;g++){const m=It(t,i[g],r);l=G(m.top,l),a=fe(m.right,a),f=fe(m.bottom,f),d=G(m.left,d)}return{width:a-d,height:f-l,x:d,y:l}}function Oo(e){const{width:t,height:n}=Ft(e);return{width:t,height:n}}function Io(e,t,n){const o=le(t),r=re(t),s=n==="fixed",i=xe(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=oe(0);function a(){l.x=Ue(r)}if(o||!o&&!s)if((Re(t)!=="body"||Me(r))&&(c=ze(t)),o){const m=xe(t,!0,s,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else r&&a();s&&!o&&r&&a();const f=r&&!o&&!s?zt(r,c):oe(0),d=i.left+c.scrollLeft-l.x-f.x,g=i.top+c.scrollTop-l.y-f.y;return{x:d,y:g,width:i.width,height:i.height}}function qe(e){return ee(e).position==="static"}function Nt(e,t){if(!le(e)||ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return re(e)===n&&(n=n.ownerDocument.body),n}function Kt(e,t){const n=q(e);if($e(e))return n;if(!le(e)){let r=ue(e);for(;r&&!be(r);){if(Q(r)&&!qe(r))return r;r=ue(r)}return n}let o=Nt(e,t);for(;o&&go(o)&&qe(o);)o=Nt(o,t);return o&&be(o)&&qe(o)&&!pt(o)?n:o||vo(e)||n}const No=async function(e){const t=this.getOffsetParent||Kt,n=this.getDimensions,o=await n(e.floating);return{reference:Io(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function _o(e){return ee(e).direction==="rtl"}const Mo={convertOffsetParentRelativeRectToViewportRelativeRect:bo,getDocumentElement:re,getClippingRect:Eo,getOffsetParent:Kt,getElementRects:No,getClientRects:Co,getDimensions:Oo,getScale:Se,isElement:Q,isRTL:_o};function Yt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Do(e,t){let n=null,o;const r=re(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const a=e.getBoundingClientRect(),{left:f,top:d,width:g,height:m}=a;if(c||t(),!g||!m)return;const x=Le(d),u=Le(r.clientWidth-(f+g)),w=Le(r.clientHeight-(d+m)),y=Le(f),v={rootMargin:-x+"px "+-u+"px "+-w+"px "+-y+"px",threshold:G(0,fe(1,l))||1};let b=!0;function C(R){const T=R[0].intersectionRatio;if(T!==l){if(!b)return i();T?i(!1,T):o=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Yt(a,e.getBoundingClientRect())&&i(),b=!1}try{n=new IntersectionObserver(C,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,v)}n.observe(e)}return i(!0),s}function Lo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=ht(e),f=r||s?[...a?_e(a):[],...t?_e(t):[]]:[];f.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=a&&c?Do(a,n):null;let g=-1,m=null;i&&(m=new ResizeObserver(y=>{let[h]=y;h&&h.target===a&&m&&t&&(m.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(t)})),n()}),a&&!l&&m.observe(a),t&&m.observe(t));let x,u=l?xe(e):null;l&&w();function w(){const y=xe(e);u&&!Yt(u,y)&&n(),u=y,x=requestAnimationFrame(w)}return n(),()=>{var y;f.forEach(h=>{r&&h.removeEventListener("scroll",n),s&&h.removeEventListener("resize",n)}),d==null||d(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(x)}}const jo=uo,ko=po,Ho=lo,Vo=ho,Bo=ao,_t=co,Wo=mo,Fo=(e,t,n)=>{const o=new Map,r={platform:Mo,...n},s={...r.platform,_c:o};return so(e,t,{...r,platform:s})};var $o=typeof document<"u",zo=function(){},je=$o?p.useLayoutEffect:zo;function Be(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Be(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Be(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Xt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mt(e,t){const n=Xt(e);return Math.round(t*n)/n}function Ze(e){const t=p.useRef(e);return je(()=>{t.current=e}),t}function Uo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[f,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,m]=p.useState(o);Be(g,o)||m(o);const[x,u]=p.useState(null),[w,y]=p.useState(null),h=p.useCallback(A=>{A!==R.current&&(R.current=A,u(A))},[]),v=p.useCallback(A=>{A!==T.current&&(T.current=A,y(A))},[]),b=s||x,C=i||w,R=p.useRef(null),T=p.useRef(null),N=p.useRef(f),W=l!=null,L=Ze(l),k=Ze(r),H=Ze(a),_=p.useCallback(()=>{if(!R.current||!T.current)return;const A={placement:t,strategy:n,middleware:g};k.current&&(A.platform=k.current),Fo(R.current,T.current,A).then(V=>{const K={...V,isPositioned:H.current!==!1};O.current&&!Be(N.current,K)&&(N.current=K,lt.flushSync(()=>{d(K)}))})},[g,t,n,k,H]);je(()=>{a===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[a]);const O=p.useRef(!1);je(()=>(O.current=!0,()=>{O.current=!1}),[]),je(()=>{if(b&&(R.current=b),C&&(T.current=C),b&&C){if(L.current)return L.current(b,C,_);_()}},[b,C,_,L,W]);const F=p.useMemo(()=>({reference:R,floating:T,setReference:h,setFloating:v}),[h,v]),E=p.useMemo(()=>({reference:b,floating:C}),[b,C]),I=p.useMemo(()=>{const A={position:n,left:0,top:0};if(!E.floating)return A;const V=Mt(E.floating,f.x),K=Mt(E.floating,f.y);return c?{...A,transform:"translate("+V+"px, "+K+"px)",...Xt(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:K}},[n,c,E.floating,f.x,f.y]);return p.useMemo(()=>({...f,update:_,refs:F,elements:E,floatingStyles:I}),[f,_,F,E,I])}const Ko=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?_t({element:o.current,padding:r}).fn(n):{}:o?_t({element:o,padding:r}).fn(n):{}}}},Yo=(e,t)=>{const n=jo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xo=(e,t)=>{const n=ko(e);return{name:n.name,fn:n.fn,options:[e,t]}},Go=(e,t)=>({fn:Wo(e).fn,options:[e,t]}),qo=(e,t)=>{const n=Ho(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zo=(e,t)=>{const n=Vo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jo=(e,t)=>{const n=Bo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qo=(e,t)=>{const n=Ko(e);return{name:n.name,fn:n.fn,options:[e,t]}};var er="Arrow",Gt=p.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return S.jsx(z.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});Gt.displayName=er;var tr=Gt;function nr(e){const[t,n]=p.useState(void 0);return J(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,c;if("borderBoxSize"in s){const l=s.borderBoxSize,a=Array.isArray(l)?l[0]:l;i=a.inlineSize,c=a.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var gt="Popper",[qt,Zt]=ct(gt),[or,Jt]=qt(gt),Qt=e=>{const{__scopePopper:t,children:n}=e,[o,r]=p.useState(null);return S.jsx(or,{scope:t,anchor:o,onAnchorChange:r,children:n})};Qt.displayName=gt;var en="PopperAnchor",tn=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Jt(en,n),i=p.useRef(null),c=Y(t,i),l=p.useRef(null);return p.useEffect(()=>{const a=l.current;l.current=(o==null?void 0:o.current)||i.current,a!==l.current&&s.onAnchorChange(l.current)}),o?null:S.jsx(z.div,{...r,ref:c})});tn.displayName=en;var xt="PopperContent",[rr,ir]=qt(xt),nn=p.forwardRef((e,t)=>{var P,B,U,j,M,D;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:a=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:g=!1,updatePositionStrategy:m="optimized",onPlaced:x,...u}=e,w=Jt(xt,n),[y,h]=p.useState(null),v=Y(t,X=>h(X)),[b,C]=p.useState(null),R=nr(b),T=(R==null?void 0:R.width)??0,N=(R==null?void 0:R.height)??0,W=o+(s!=="center"?"-"+s:""),L=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(a)?a:[a],H=k.length>0,_={padding:L,boundary:k.filter(cr),altBoundary:H},{refs:O,floatingStyles:F,placement:E,isPositioned:I,middlewareData:A}=Uo({strategy:"fixed",placement:W,whileElementsMounted:(...X)=>Lo(...X,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[Yo({mainAxis:r+N,alignmentAxis:i}),l&&Xo({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Go():void 0,..._}),l&&qo({..._}),Zo({..._,apply:({elements:X,rects:te,availableWidth:Ee,availableHeight:Oe})=>{const{width:Ie,height:Ln}=te.reference,De=X.floating.style;De.setProperty("--radix-popper-available-width",`${Ee}px`),De.setProperty("--radix-popper-available-height",`${Oe}px`),De.setProperty("--radix-popper-anchor-width",`${Ie}px`),De.setProperty("--radix-popper-anchor-height",`${Ln}px`)}}),b&&Qo({element:b,padding:c}),lr({arrowWidth:T,arrowHeight:N}),g&&Jo({strategy:"referenceHidden",..._})]}),[V,K]=sn(E),ie=kt(x);J(()=>{I&&(ie==null||ie())},[I,ie]);const Pe=(P=A.arrow)==null?void 0:P.x,Te=(B=A.arrow)==null?void 0:B.y,ae=((U=A.arrow)==null?void 0:U.centerOffset)!==0,[ye,me]=p.useState();return J(()=>{y&&me(window.getComputedStyle(y).zIndex)},[y]),S.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:I?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[(j=A.transformOrigin)==null?void 0:j.x,(M=A.transformOrigin)==null?void 0:M.y].join(" "),...((D=A.hide)==null?void 0:D.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(rr,{scope:n,placedSide:V,onArrowChange:C,arrowX:Pe,arrowY:Te,shouldHideArrow:ae,children:S.jsx(z.div,{"data-side":V,"data-align":K,...u,ref:v,style:{...u.style,animation:I?void 0:"none"}})})})});nn.displayName=xt;var on="PopperArrow",sr={top:"bottom",right:"left",bottom:"top",left:"right"},rn=p.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=ir(on,o),i=sr[s.placedSide];return S.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:S.jsx(tr,{...r,ref:n,style:{...r.style,display:"block"}})})});rn.displayName=on;function cr(e){return e!==null}var lr=e=>({name:"transformOrigin",options:e,fn(t){var w,y,h;const{placement:n,rects:o,middlewareData:r}=t,i=((w=r.arrow)==null?void 0:w.centerOffset)!==0,c=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[a,f]=sn(n),d={start:"0%",center:"50%",end:"100%"}[f],g=(((y=r.arrow)==null?void 0:y.x)??0)+c/2,m=(((h=r.arrow)==null?void 0:h.y)??0)+l/2;let x="",u="";return a==="bottom"?(x=i?d:`${g}px`,u=`${-l}px`):a==="top"?(x=i?d:`${g}px`,u=`${o.floating.height+l}px`):a==="right"?(x=`${-l}px`,u=i?d:`${m}px`):a==="left"&&(x=`${o.floating.width+l}px`,u=i?d:`${m}px`),{data:{x,y:u}}}});function sn(e){const[t,n="center"]=e.split("-");return[t,n]}var ar=Qt,fr=tn,ur=nn,dr=rn;function pr(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cn=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),mr="VisuallyHidden",hr=p.forwardRef((e,t)=>S.jsx(z.span,{...e,ref:t,style:{...cn,...e.style}}));hr.displayName=mr;var gr=[" ","Enter","ArrowUp","ArrowDown"],xr=[" ","Enter"],we="Select",[Ke,Ye,wr]=Kn(we),[Ae]=ct(we,[wr,Zt]),Xe=Zt(),[vr,de]=Ae(we),[yr,Sr]=Ae(we),ln=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:i,defaultValue:c,onValueChange:l,dir:a,name:f,autoComplete:d,disabled:g,required:m,form:x}=e,u=Xe(t),[w,y]=p.useState(null),[h,v]=p.useState(null),[b,C]=p.useState(!1),R=Xn(a),[T,N]=yt({prop:o,defaultProp:r??!1,onChange:s,caller:we}),[W,L]=yt({prop:i,defaultProp:c,onChange:l,caller:we}),k=p.useRef(null),H=w?x||!!w.closest("form"):!0,[_,O]=p.useState(new Set),F=Array.from(_).map(E=>E.props.value).join(";");return S.jsx(ar,{...u,children:S.jsxs(vr,{required:m,scope:t,trigger:w,onTriggerChange:y,valueNode:h,onValueNodeChange:v,valueNodeHasChildren:b,onValueNodeHasChildrenChange:C,contentId:at(),value:W,onValueChange:L,open:T,onOpenChange:N,dir:R,triggerPointerDownPosRef:k,disabled:g,children:[S.jsx(Ke.Provider,{scope:t,children:S.jsx(yr,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(E=>{O(I=>new Set(I).add(E))},[]),onNativeOptionRemove:p.useCallback(E=>{O(I=>{const A=new Set(I);return A.delete(E),A})},[]),children:n})}),H?S.jsxs(In,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:d,value:W,onChange:E=>L(E.target.value),disabled:g,form:x,children:[W===void 0?S.jsx("option",{value:""}):null,Array.from(_)]},F):null]})})};ln.displayName=we;var an="SelectTrigger",fn=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=Xe(n),i=de(an,n),c=i.disabled||o,l=Y(t,i.onTriggerChange),a=Ye(n),f=p.useRef("touch"),[d,g,m]=_n(u=>{const w=a().filter(v=>!v.disabled),y=w.find(v=>v.value===i.value),h=Mn(w,u,y);h!==void 0&&i.onValueChange(h.value)}),x=u=>{c||(i.onOpenChange(!0),m()),u&&(i.triggerPointerDownPosRef.current={x:Math.round(u.pageX),y:Math.round(u.pageY)})};return S.jsx(fr,{asChild:!0,...s,children:S.jsx(z.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Nn(i.value)?"":void 0,...r,ref:l,onClick:$(r.onClick,u=>{u.currentTarget.focus(),f.current!=="mouse"&&x(u)}),onPointerDown:$(r.onPointerDown,u=>{f.current=u.pointerType;const w=u.target;w.hasPointerCapture(u.pointerId)&&w.releasePointerCapture(u.pointerId),u.button===0&&u.ctrlKey===!1&&u.pointerType==="mouse"&&(x(u),u.preventDefault())}),onKeyDown:$(r.onKeyDown,u=>{const w=d.current!=="";!(u.ctrlKey||u.altKey||u.metaKey)&&u.key.length===1&&g(u.key),!(w&&u.key===" ")&&gr.includes(u.key)&&(x(),u.preventDefault())})})})});fn.displayName=an;var un="SelectValue",dn=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:i="",...c}=e,l=de(un,n),{onValueNodeHasChildrenChange:a}=l,f=s!==void 0,d=Y(t,l.onValueNodeChange);return J(()=>{a(f)},[a,f]),S.jsx(z.span,{...c,ref:d,style:{pointerEvents:"none"},children:Nn(l.value)?S.jsx(S.Fragment,{children:i}):s})});dn.displayName=un;var br="SelectIcon",pn=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return S.jsx(z.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});pn.displayName=br;var Cr="SelectPortal",mn=e=>S.jsx(kn,{asChild:!0,...e});mn.displayName=Cr;var ve="SelectContent",hn=p.forwardRef((e,t)=>{const n=de(ve,e.__scopeSelect),[o,r]=p.useState();if(J(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?lt.createPortal(S.jsx(gn,{scope:e.__scopeSelect,children:S.jsx(Ke.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),s):null}return S.jsx(xn,{...e,ref:t})});hn.displayName=ve;var Z=10,[gn,pe]=Ae(ve),Rr="SelectContentImpl",Ar=Je("SelectContent.RemoveScroll"),xn=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:i,side:c,sideOffset:l,align:a,alignOffset:f,arrowPadding:d,collisionBoundary:g,collisionPadding:m,sticky:x,hideWhenDetached:u,avoidCollisions:w,...y}=e,h=de(ve,n),[v,b]=p.useState(null),[C,R]=p.useState(null),T=Y(t,P=>b(P)),[N,W]=p.useState(null),[L,k]=p.useState(null),H=Ye(n),[_,O]=p.useState(!1),F=p.useRef(!1);p.useEffect(()=>{if(v)return Hn(v)},[v]),Vn();const E=p.useCallback(P=>{const[B,...U]=H().map(D=>D.ref.current),[j]=U.slice(-1),M=document.activeElement;for(const D of P)if(D===M||(D==null||D.scrollIntoView({block:"nearest"}),D===B&&C&&(C.scrollTop=0),D===j&&C&&(C.scrollTop=C.scrollHeight),D==null||D.focus(),document.activeElement!==M))return},[H,C]),I=p.useCallback(()=>E([N,v]),[E,N,v]);p.useEffect(()=>{_&&I()},[_,I]);const{onOpenChange:A,triggerPointerDownPosRef:V}=h;p.useEffect(()=>{if(v){let P={x:0,y:0};const B=j=>{var M,D;P={x:Math.abs(Math.round(j.pageX)-(((M=V.current)==null?void 0:M.x)??0)),y:Math.abs(Math.round(j.pageY)-(((D=V.current)==null?void 0:D.y)??0))}},U=j=>{P.x<=10&&P.y<=10?j.preventDefault():v.contains(j.target)||A(!1),document.removeEventListener("pointermove",B),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",B),document.addEventListener("pointerup",U,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",B),document.removeEventListener("pointerup",U,{capture:!0})}}},[v,A,V]),p.useEffect(()=>{const P=()=>A(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[A]);const[K,ie]=_n(P=>{const B=H().filter(M=>!M.disabled),U=B.find(M=>M.ref.current===document.activeElement),j=Mn(B,P,U);j&&setTimeout(()=>j.ref.current.focus())}),Pe=p.useCallback((P,B,U)=>{const j=!F.current&&!U;(h.value!==void 0&&h.value===B||j)&&(W(P),j&&(F.current=!0))},[h.value]),Te=p.useCallback(()=>v==null?void 0:v.focus(),[v]),ae=p.useCallback((P,B,U)=>{const j=!F.current&&!U;(h.value!==void 0&&h.value===B||j)&&k(P)},[h.value]),ye=o==="popper"?nt:wn,me=ye===nt?{side:c,sideOffset:l,align:a,alignOffset:f,arrowPadding:d,collisionBoundary:g,collisionPadding:m,sticky:x,hideWhenDetached:u,avoidCollisions:w}:{};return S.jsx(gn,{scope:n,content:v,viewport:C,onViewportChange:R,itemRefCallback:Pe,selectedItem:N,onItemLeave:Te,itemTextRefCallback:ae,focusSelectedItem:I,selectedItemText:L,position:o,isPositioned:_,searchRef:K,children:S.jsx(Bn,{as:Ar,allowPinchZoom:!0,children:S.jsx(Wn,{asChild:!0,trapped:h.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:$(r,P=>{var B;(B=h.trigger)==null||B.focus({preventScroll:!0}),P.preventDefault()}),children:S.jsx(Fn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>h.onOpenChange(!1),children:S.jsx(ye,{role:"listbox",id:h.contentId,"data-state":h.open?"open":"closed",dir:h.dir,onContextMenu:P=>P.preventDefault(),...y,...me,onPlaced:()=>O(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:$(y.onKeyDown,P=>{const B=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!B&&P.key.length===1&&ie(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let j=H().filter(M=>!M.disabled).map(M=>M.ref.current);if(["ArrowUp","End"].includes(P.key)&&(j=j.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const M=P.target,D=j.indexOf(M);j=j.slice(D+1)}setTimeout(()=>E(j)),P.preventDefault()}})})})})})})});xn.displayName=Rr;var Pr="SelectItemAlignedPosition",wn=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=de(ve,n),i=pe(ve,n),[c,l]=p.useState(null),[a,f]=p.useState(null),d=Y(t,T=>f(T)),g=Ye(n),m=p.useRef(!1),x=p.useRef(!0),{viewport:u,selectedItem:w,selectedItemText:y,focusSelectedItem:h}=i,v=p.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&a&&u&&w&&y){const T=s.trigger.getBoundingClientRect(),N=a.getBoundingClientRect(),W=s.valueNode.getBoundingClientRect(),L=y.getBoundingClientRect();if(s.dir!=="rtl"){const M=L.left-N.left,D=W.left-M,X=T.left-D,te=T.width+X,Ee=Math.max(te,N.width),Oe=window.innerWidth-Z,Ie=bt(D,[Z,Math.max(Z,Oe-Ee)]);c.style.minWidth=te+"px",c.style.left=Ie+"px"}else{const M=N.right-L.right,D=window.innerWidth-W.right-M,X=window.innerWidth-T.right-D,te=T.width+X,Ee=Math.max(te,N.width),Oe=window.innerWidth-Z,Ie=bt(D,[Z,Math.max(Z,Oe-Ee)]);c.style.minWidth=te+"px",c.style.right=Ie+"px"}const k=g(),H=window.innerHeight-Z*2,_=u.scrollHeight,O=window.getComputedStyle(a),F=parseInt(O.borderTopWidth,10),E=parseInt(O.paddingTop,10),I=parseInt(O.borderBottomWidth,10),A=parseInt(O.paddingBottom,10),V=F+E+_+A+I,K=Math.min(w.offsetHeight*5,V),ie=window.getComputedStyle(u),Pe=parseInt(ie.paddingTop,10),Te=parseInt(ie.paddingBottom,10),ae=T.top+T.height/2-Z,ye=H-ae,me=w.offsetHeight/2,P=w.offsetTop+me,B=F+E+P,U=V-B;if(B<=ae){const M=k.length>0&&w===k[k.length-1].ref.current;c.style.bottom="0px";const D=a.clientHeight-u.offsetTop-u.offsetHeight,X=Math.max(ye,me+(M?Te:0)+D+I),te=B+X;c.style.height=te+"px"}else{const M=k.length>0&&w===k[0].ref.current;c.style.top="0px";const X=Math.max(ae,F+u.offsetTop+(M?Pe:0)+me)+U;c.style.height=X+"px",u.scrollTop=B-ae+u.offsetTop}c.style.margin=`${Z}px 0`,c.style.minHeight=K+"px",c.style.maxHeight=H+"px",o==null||o(),requestAnimationFrame(()=>m.current=!0)}},[g,s.trigger,s.valueNode,c,a,u,w,y,s.dir,o]);J(()=>v(),[v]);const[b,C]=p.useState();J(()=>{a&&C(window.getComputedStyle(a).zIndex)},[a]);const R=p.useCallback(T=>{T&&x.current===!0&&(v(),h==null||h(),x.current=!1)},[v,h]);return S.jsx(Er,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:R,children:S.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:S.jsx(z.div,{...r,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});wn.displayName=Pr;var Tr="SelectPopperPosition",nt=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Z,...s}=e,i=Xe(n);return S.jsx(ur,{...i,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nt.displayName=Tr;var[Er,wt]=Ae(ve,{}),ot="SelectViewport",vn=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=pe(ot,n),i=wt(ot,n),c=Y(t,s.onViewportChange),l=p.useRef(0);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),S.jsx(Ke.Slot,{scope:n,children:S.jsx(z.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:$(r.onScroll,a=>{const f=a.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:g}=i;if(g!=null&&g.current&&d){const m=Math.abs(l.current-f.scrollTop);if(m>0){const x=window.innerHeight-Z*2,u=parseFloat(d.style.minHeight),w=parseFloat(d.style.height),y=Math.max(u,w);if(y<x){const h=y+m,v=Math.min(x,h),b=h-v;d.style.height=v+"px",d.style.bottom==="0px"&&(f.scrollTop=b>0?b:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});vn.displayName=ot;var yn="SelectGroup",[Or,Ir]=Ae(yn),Nr=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=at();return S.jsx(Or,{scope:n,id:r,children:S.jsx(z.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Nr.displayName=yn;var Sn="SelectLabel",_r=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Ir(Sn,n);return S.jsx(z.div,{id:r.id,...o,ref:t})});_r.displayName=Sn;var We="SelectItem",[Mr,bn]=Ae(We),Cn=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...i}=e,c=de(We,n),l=pe(We,n),a=c.value===o,[f,d]=p.useState(s??""),[g,m]=p.useState(!1),x=Y(t,h=>{var v;return(v=l.itemRefCallback)==null?void 0:v.call(l,h,o,r)}),u=at(),w=p.useRef("touch"),y=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return S.jsx(Mr,{scope:n,value:o,disabled:r,textId:u,isSelected:a,onItemTextChange:p.useCallback(h=>{d(v=>v||((h==null?void 0:h.textContent)??"").trim())},[]),children:S.jsx(Ke.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:S.jsx(z.div,{role:"option","aria-labelledby":u,"data-highlighted":g?"":void 0,"aria-selected":a&&g,"data-state":a?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:x,onFocus:$(i.onFocus,()=>m(!0)),onBlur:$(i.onBlur,()=>m(!1)),onClick:$(i.onClick,()=>{w.current!=="mouse"&&y()}),onPointerUp:$(i.onPointerUp,()=>{w.current==="mouse"&&y()}),onPointerDown:$(i.onPointerDown,h=>{w.current=h.pointerType}),onPointerMove:$(i.onPointerMove,h=>{var v;w.current=h.pointerType,r?(v=l.onItemLeave)==null||v.call(l):w.current==="mouse"&&h.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$(i.onPointerLeave,h=>{var v;h.currentTarget===document.activeElement&&((v=l.onItemLeave)==null||v.call(l))}),onKeyDown:$(i.onKeyDown,h=>{var b;((b=l.searchRef)==null?void 0:b.current)!==""&&h.key===" "||(xr.includes(h.key)&&y(),h.key===" "&&h.preventDefault())})})})})});Cn.displayName=We;var Ne="SelectItemText",Rn=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,i=de(Ne,n),c=pe(Ne,n),l=bn(Ne,n),a=Sr(Ne,n),[f,d]=p.useState(null),g=Y(t,y=>d(y),l.onItemTextChange,y=>{var h;return(h=c.itemTextRefCallback)==null?void 0:h.call(c,y,l.value,l.disabled)}),m=f==null?void 0:f.textContent,x=p.useMemo(()=>S.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:u,onNativeOptionRemove:w}=a;return J(()=>(u(x),()=>w(x)),[u,w,x]),S.jsxs(S.Fragment,{children:[S.jsx(z.span,{id:l.textId,...s,ref:g}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?lt.createPortal(s.children,i.valueNode):null]})});Rn.displayName=Ne;var An="SelectItemIndicator",Pn=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return bn(An,n).isSelected?S.jsx(z.span,{"aria-hidden":!0,...o,ref:t}):null});Pn.displayName=An;var rt="SelectScrollUpButton",Tn=p.forwardRef((e,t)=>{const n=pe(rt,e.__scopeSelect),o=wt(rt,e.__scopeSelect),[r,s]=p.useState(!1),i=Y(t,o.onScrollButtonChange);return J(()=>{if(n.viewport&&n.isPositioned){let c=function(){const a=l.scrollTop>0;s(a)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?S.jsx(On,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Tn.displayName=rt;var it="SelectScrollDownButton",En=p.forwardRef((e,t)=>{const n=pe(it,e.__scopeSelect),o=wt(it,e.__scopeSelect),[r,s]=p.useState(!1),i=Y(t,o.onScrollButtonChange);return J(()=>{if(n.viewport&&n.isPositioned){let c=function(){const a=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<a;s(f)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?S.jsx(On,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});En.displayName=it;var On=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=pe("SelectScrollButton",n),i=p.useRef(null),c=Ye(n),l=p.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return p.useEffect(()=>()=>l(),[l]),J(()=>{var f;const a=c().find(d=>d.ref.current===document.activeElement);(f=a==null?void 0:a.ref.current)==null||f.scrollIntoView({block:"nearest"})},[c]),S.jsx(z.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:$(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:$(r.onPointerMove,()=>{var a;(a=s.onItemLeave)==null||a.call(s),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:$(r.onPointerLeave,()=>{l()})})}),Dr="SelectSeparator",Lr=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return S.jsx(z.div,{"aria-hidden":!0,...o,ref:t})});Lr.displayName=Dr;var st="SelectArrow",jr=p.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Xe(n),s=de(st,n),i=pe(st,n);return s.open&&i.position==="popper"?S.jsx(dr,{...r,...o,ref:t}):null});jr.displayName=st;var kr="SelectBubbleInput",In=p.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=p.useRef(null),s=Y(o,r),i=pr(t);return p.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&f){const d=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[i,t]),S.jsx(z.select,{...n,style:{...cn,...n.style},ref:s,defaultValue:t})});In.displayName=kr;function Nn(e){return e===""||e===void 0}function _n(e){const t=kt(e),n=p.useRef(""),o=p.useRef(0),r=p.useCallback(i=>{const c=n.current+i;t(c),(function l(a){n.current=a,window.clearTimeout(o.current),a!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=p.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function Mn(e,t,n){const r=t.length>1&&Array.from(t).every(a=>a===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Hr(e,Math.max(s,0));r.length===1&&(i=i.filter(a=>a!==n));const l=i.find(a=>a.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function Hr(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Vr=ln,Br=fn,Wr=dn,Fr=pn,$r=mn,zr=hn,Ur=vn,Kr=Cn,Yr=Rn,Xr=Pn,Gr=Tn,qr=En;const Dn="__radix_empty_value__";function Dt(e){return typeof e=="string"||typeof e=="number"?String(e):p.Children.toArray(e).map(t=>typeof t=="string"||typeof t=="number"?String(t):"").join("")}function Zr(e){return p.Children.toArray(e).flatMap(t=>{if(!p.isValidElement(t))return[];const n=t;if(n.type!=="option")return[];const o=n.props.value??Dt(n.props.children);return[{value:String(o),label:Dt(n.props.children),disabled:n.props.disabled}]})}function Lt(e){return e===""||e===void 0||e===null?Dn:String(e)}function jt(e){return e===Dn?"":e}function ni({label:e,className:t,children:n,...o}){var a;const r=Zr(n),s=Lt(o.value??o.defaultValue??""),i=r.find(f=>f.value===jt(s)),c=(a=r.find(f=>f.value===""))==null?void 0:a.label,l=f=>{var g;const d=jt(f);(g=o.onChange)==null||g.call(o,{target:{value:d},currentTarget:{value:d}})};return S.jsxs("div",{className:"space-y-1.5",children:[e&&S.jsx("label",{className:"block text-sm font-medium text-foreground",children:e}),S.jsxs(Vr,{value:s,onValueChange:l,disabled:o.disabled,name:o.name,children:[S.jsxs(Br,{id:o.id,className:vt("flex h-9 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors","placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),children:[S.jsx(Wr,{placeholder:c,children:i==null?void 0:i.label}),S.jsx(Fr,{asChild:!0,children:S.jsx(St,{className:"h-4 w-4 opacity-50"})})]}),S.jsx($r,{children:S.jsxs(zr,{className:"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-fade-in",children:[S.jsx(Gr,{className:"flex cursor-default items-center justify-center py-1",children:S.jsx(Un,{className:"h-4 w-4"})}),S.jsx(Ur,{className:"p-1",children:r.map(f=>S.jsxs(Kr,{value:Lt(f.value),disabled:f.disabled,className:vt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-accent/10 focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"),children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(Xr,{children:S.jsx($n,{className:"h-4 w-4"})})}),S.jsx(Yr,{children:f.label})]},`${f.value}-${f.label}`))}),S.jsx(qr,{className:"flex cursor-default items-center justify-center py-1",children:S.jsx(St,{className:"h-4 w-4"})})]})})]})]})}export{ni as S};
@@ -0,0 +1 @@
1
+ import{u as C,A as z,r as a,j as e,L as S,B as g,w as j,T as B}from"./index-Biz-aexG.js";import{B as b}from"./Badge-C2K5apfV.js";import{g as E,a as L}from"./sessions-DaH3H7gC.js";import{C as _,A}from"./ChatMarkdown-DMAr15Oi.js";import{A as I}from"./arrow-left-cHr5wkpq.js";import{C as M}from"./circle-DyvEovdw.js";import{W as y,R}from"./wifi-off-ClO53WGa.js";import{B as T,U}from"./user-CnKcvHdo.js";import"./check-exTS-R-x.js";function G(){var p;const{t:r}=C(),{project:i,id:l}=z(),[s,v]=a.useState(null),[d,m]=a.useState(""),[c,x]=a.useState(!1),[w,u]=a.useState(!0),f=a.useRef(null),o=a.useCallback(async()=>{if(!(!i||!l))try{u(!0);const t=await E(i,l,200);v(t)}finally{u(!1)}},[i,l]);a.useEffect(()=>{o()},[o]),a.useEffect(()=>{var t;(t=f.current)==null||t.scrollIntoView({behavior:"smooth"})},[s==null?void 0:s.history]);const h=async()=>{if(!d.trim()||!i||!s)return;const t=d.trim();m(""),x(!0);try{await L(i,{session_key:s.session_key,message:t}),setTimeout(o,1500)}finally{x(!1)}},N=t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),h())};return w&&!s?e.jsx("div",{className:"flex items-center justify-center h-64 text-muted-foreground animate-pulse",children:"Loading..."}):e.jsxs("div",{className:"flex flex-col h-[calc(100vh-8rem)] animate-fade-in",children:[e.jsxs("div",{className:"flex items-center justify-between pb-4 border-b",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(S,{to:"/sessions",className:"p-2 rounded-md hover:bg-accent/10 transition-colors",children:e.jsx(I,{size:18,className:"text-muted-foreground"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:(s==null?void 0:s.name)||l}),s!=null&&s.live?e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-primary bg-primary/10 px-1.5 py-0.5 rounded-full",children:[e.jsx(M,{size:5,className:"fill-current"})," live"]}):e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded-full",children:[e.jsx(y,{size:9})," ",r("sessions.offline")]})]}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx(b,{children:i}),(s==null?void 0:s.platform)&&e.jsx(b,{variant:"info",children:s.platform}),e.jsx("span",{className:"text-xs text-muted-foreground",children:s==null?void 0:s.session_key})]})]})]}),e.jsxs(g,{size:"sm",variant:"ghost",onClick:o,children:[e.jsx(R,{size:14})," ",r("common.refresh")]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto py-6 space-y-5",children:[(!(s!=null&&s.history)||s.history.length===0)&&e.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:r("sessions.noMessages")}),(p=s==null?void 0:s.history)==null?void 0:p.map((t,k)=>{const n=t.role==="user";return e.jsxs("div",{className:j("flex gap-3",n?"justify-end":"justify-start"),children:[!n&&e.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0 mt-1",children:e.jsx(T,{size:16,className:"text-primary"})}),e.jsx("div",{className:j("rounded-lg px-5 py-3.5 text-sm",n?"max-w-[70%] bg-primary text-primary-foreground rounded-br-md":"max-w-[85%] bg-card border text-card-foreground rounded-bl-md shadow-sm"),children:e.jsx(_,{content:t.content,isUser:n})}),n&&e.jsx("div",{className:"w-8 h-8 rounded-md bg-muted flex items-center justify-center shrink-0 mt-1",children:e.jsx(U,{size:16,className:"text-muted-foreground"})})]},k)}),e.jsx("div",{ref:f})]}),e.jsx("div",{className:"border-t pt-4",children:s!=null&&s.live?e.jsxs("div",{className:"relative",children:[e.jsx(B,{value:d,onChange:t=>m(t.target.value),onKeyDown:N,placeholder:r("sessions.messageInput"),rows:2,className:"min-h-[88px] rounded-[24px] border-gray-200 bg-white px-4 pb-14 pt-3 text-[15px] leading-6 shadow-[0_12px_34px_rgba(15,23,42,0.08)] dark:border-white/[0.08] dark:bg-[rgba(0,0,0,0.42)] sm:min-h-[96px] sm:px-5 sm:pt-4",disabled:c}),e.jsx(g,{onClick:h,disabled:c||!d.trim(),size:"icon","aria-label":r("sessions.messageInput"),className:"absolute bottom-3 right-3 h-10 w-10 rounded-full bg-slate-900 px-0 text-white shadow-none hover:bg-slate-800 disabled:bg-slate-300 disabled:text-white disabled:opacity-100 dark:bg-slate-100 dark:text-slate-950 dark:hover:bg-white dark:disabled:bg-white/20 dark:disabled:text-white/55 sm:h-11 sm:w-11",children:c?e.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):e.jsx(A,{size:20,strokeWidth:2.2})})]}):e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-sm text-muted-foreground bg-muted rounded-lg",children:[e.jsx(y,{size:14}),e.jsx("span",{children:r("sessions.notLiveHint")})]})})]})}export{G as default};
@@ -0,0 +1 @@
1
+ import{u as N,r as n,j as s,M as x,L as v,C as y}from"./index-Biz-aexG.js";import{B as f}from"./Badge-C2K5apfV.js";import{S as w}from"./Select-CNX-Tx_O.js";import{E as _}from"./EmptyState-BBJ3cTvB.js";import{l as S}from"./projects-DDtDN1rc.js";import{l as C}from"./sessions-DaH3H7gC.js";import{F as L}from"./funnel-DA9qVdTy.js";import{C as M}from"./circle-DyvEovdw.js";import{U as E,B as $}from"./user-CnKcvHdo.js";import"./index-BgflqkCN.js";import"./chevron-down-DSvxXQa0.js";import"./check-exTS-R-x.js";function k(a,o){if(!a)return"";const m=Date.now()-new Date(a).getTime(),i=Math.floor(m/6e4);if(i<1)return o("sessions.justNow");if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function G(){const{t:a}=N(),[o,m]=n.useState([]),[i,l]=n.useState([]),[c,j]=n.useState(""),[h,p]=n.useState(!0),d=n.useCallback(async()=>{p(!0);try{const{projects:e}=await S();l(e||[]);const t=await Promise.all((e||[]).map(async r=>{try{const{sessions:g}=await C(r.name);return{project:r.name,sessions:g||[]}}catch{return{project:r.name,sessions:[]}}}));m(t)}finally{p(!1)}},[]);n.useEffect(()=>{d();const e=()=>d();return window.addEventListener("cc:refresh",e),()=>window.removeEventListener("cc:refresh",e)},[d]);const u=n.useMemo(()=>(c?o.filter(t=>t.project===c):o).flatMap(t=>t.sessions.map(r=>({...r,_project:t.project}))).sort((t,r)=>(r.updated_at||r.created_at||"").localeCompare(t.updated_at||t.created_at||"")),[o,c]);return h&&o.length===0?s.jsx("div",{className:"flex items-center justify-center h-64 text-muted-foreground animate-pulse",children:"Loading..."}):s.jsxs("div",{className:"space-y-4 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(L,{size:16,className:"text-muted-foreground"}),s.jsxs(w,{value:c,onChange:e=>j(e.target.value),className:"w-auto min-w-48",children:[s.jsx("option",{value:"",children:a("sessions.allProjects")}),i.map(e=>s.jsx("option",{value:e.name,children:e.name},e.name))]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.length," ",a("nav.sessions").toLowerCase()]})]}),u.length===0?s.jsx(_,{message:a("sessions.noSessions"),icon:x}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-3",children:u.map(e=>s.jsx(v,{to:`/sessions/${encodeURIComponent(e._project)}/${encodeURIComponent(e.id)}`,children:s.jsxs(y,{hover:!0,className:"group relative h-full p-4",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(x,{size:14,className:e.live?"text-primary shrink-0":"text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.name||e.user_name||e.id.slice(0,8)}),e.live&&s.jsx(M,{size:5,className:"fill-primary text-primary shrink-0"})]}),s.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 mt-0.5",children:k(e.updated_at||e.created_at,a)})]}),s.jsx("div",{className:"mb-2.5 min-h-[2.5rem]",children:e.last_message?s.jsxs("p",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed",children:[e.last_message.role==="user"?s.jsx(E,{size:10,className:"inline mr-1 -mt-0.5 opacity-60"}):s.jsx($,{size:10,className:"inline mr-1 -mt-0.5 opacity-60"}),e.last_message.content.replace(/\n/g," ").slice(0,100)]}):s.jsx("p",{className:"text-xs text-muted-foreground italic",children:a("sessions.noMessages")})}),s.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.jsx(f,{children:e._project}),e.platform&&s.jsx(f,{variant:"info",children:e.platform}),s.jsxs("span",{className:"text-[10px] text-muted-foreground ml-auto",children:[e.history_count," msgs"]})]})]})},`${e._project}-${e.id}`))})]})}export{G as default};